Compare commits

..
Author SHA1 Message Date
taylor 4afe186dc4 disable COLOR_MATERIAL, for nvidia drivers 2004-05-13 00:17:20 +00:00
phreak 87c5d993dc got rid of the color material call, nebulas should blind the player 2004-05-12 23:24:35 +00:00
phreak a0666e9591 don't fog the warp model if its being rendered 2004-05-12 22:50:31 +00:00
phreak 593285a975 renamed the warp model variable from 'wm' to 'Warp_model' 2004-05-12 22:49:14 +00:00
taylor 7096ffbc98 do page in unlock but not for gr_preload() stuff 2004-05-11 23:08:55 +00:00
phreak 490678193a fixed an array bounds error that was causing debug builds to crash when
rendering a ship
2004-05-11 19:39:29 +00:00
phreak 3d3c197dc0 fixed the white boxes appearing on unlit bitmaps 2004-05-11 16:48:19 +00:00
Goober5000 7ac03c7835 completed the FRED import conversion stuff that I started ages ago
--Goober5000
2004-05-11 02:52:12 +00:00
Goober5000 887239e1d4 fixed the AWACS help message
--Goober5000
2004-05-10 13:07:22 +00:00
Goober5000 ea415cce97 made primary and secondary banks quite a bit more friendly... added error-checking
and reorganized a bunch of code
--Goober5000
2004-05-10 10:51:54 +00:00
Goober5000 409e068104 fixored the handling of no lasers and no engines... the tests should check the ship,
not the object
--Goober5000
2004-05-10 08:03:31 +00:00
Goober5000 b4ec7e4e34 fixed $quote and $semicolon... it was simply a matter of moving the spot where
the replacement occurred
--Goober5000
2004-05-10 06:14:40 +00:00
Goober5000 7ad5b133ff fixed warp decision
--Goober5000
2004-05-10 06:11:47 +00:00
phreak 01bc1043e4 bumped to 3.6!!!! 2004-05-09 23:32:40 +00:00
taylor dad23b95db prefer ani over pcx for ship textures 2004-05-09 15:02:00 +00:00
Goober5000 23a79af4dc small fix
--Goober5000
2004-05-08 01:08:48 +00:00
Kazan 39bbccebfc Sorry Guys! 2004-05-07 23:50:14 +00:00
Goober5000 b32d1c7fa9 added Righteous1's Y bug hack
--Goober5000
2004-05-07 19:06:45 +00:00
taylor b318f01819 ...missed one... 2004-05-06 22:39:37 +00:00
taylor 7e8ca9a005 DDS mipmap reading, remove unneeded bm_unlock() during page in 2004-05-06 22:35:26 +00:00
taylor 6f657470fe get mipmap count off of DDS textures for later use 2004-05-06 22:31:02 +00:00
taylor dfc59ef087 fix DDS textures 2004-05-06 22:26:52 +00:00
taylor b09c3b3491 make sure JPG and DDS files are added to the file cache for maps and effects 2004-05-06 22:12:14 +00:00
Kazan c63f80dbaf Abandon strdup() usage for mod list processing - it was acting odd and causing crashing on free()
Fix condition where alt_tab_pause() would flipout and trigger failed assert if game minimizes during startup (like it does a lot during debug)
Nav Point / Auto Pilot code (All disabled via #ifdefs)
2004-05-03 21:22:23 +00:00
randomtiger 66556fe514 fl_abs(theta_goal.xyz.z) < 0.001f is reporting using mprintf now instead of assert 2004-05-03 09:27:16 +00:00
randomtiger d4d41d8eff Fixed D3D fogging on R7000 2004-05-03 08:41:24 +00:00
taylor 12d6469ee7 don't use HTL line fix with Fred 2004-05-02 16:01:38 +00:00
Goober5000 d0f604c81a added a comment
--Goober5000
2004-05-02 03:05:23 +00:00
taylor f5f347109c comment out avi free code for now 2004-05-02 01:26:52 +00:00
randomtiger 4195c0e9fa FS2_open will now take flag settings from cmdline_fso.cfg not cmdline.cfg.
This means retail FS2 will not crash because of fs2_open flags.
The new version of the launcher (v5) must used to setup flags now.
Anyone distributing pre 3.6 builds should make this clear and 3.6 should come with Launcher v5.
2004-05-01 22:47:23 +00:00
taylor f87fbdb857 add some error handling to vm_strdup() 2004-05-01 21:53:39 +00:00
Kazan d97912ce37 bah! stupid me "NULL" not "null" - i hate when i do that 2004-05-01 21:47:43 +00:00
Kazan 1b725c3ac4 changed delete[] to free(), checked for null, if null ERROR 2004-05-01 21:45:31 +00:00
Kazan ab23820319 delete[] str_temp
A null check on str_temp is not needed - take a close look at the for loop
2004-05-01 19:49:31 +00:00
taylor 8c7614ac34 add CF_TYPE_MISSIONS to physical check to avoid network transfer problems 2004-05-01 19:33:20 +00:00
Goober5000 63b9d44968 added an assert
--Goober5000
2004-05-01 17:37:09 +00:00
Kazan 8887c8a07e Multiple -mod - "-mod ModA,ModB,ModC" in order of priority
Giving you:
Root: ModA
Root: ModB
Root: ModC
Root: Fs2Default
Root: CDRom
2004-05-01 17:10:37 +00:00
Goober5000 8367ed5943 extra insurance
--Goober5000
2004-04-30 22:20:27 +00:00
Kazan 6ceeeb7239 Lobby screen only shows when PXO_LOBBY is defined 2004-04-30 18:33:22 +00:00
taylor 1e5fe42652 fix create game buttons 2004-04-27 20:43:32 +00:00
taylor b9802a0d6e add NULL check to game_hacked_data() to prevent crash 2004-04-27 20:41:58 +00:00
Goober5000 343423adc2 added back in Kazan's line: now you can slow down in cheat mode
whether you press tilde or not
--Goober5000
2004-04-26 19:50:04 +00:00
Goober5000 961cfbe12e rolled back Kazan's change
--Goober5000
2004-04-26 19:43:07 +00:00
Kazan 1207801f77 -no_fps_capping 2004-04-26 18:23:48 +00:00
Kazan fd816a1a5b Be careful when modifying other peoples changes - make sure they still work, and do things the simple way
DON'T TOUCH THE CUSTOM BUILD PATH
2004-04-26 17:27:17 +00:00
taylor e086613047 forgot to remove some safety checks that aren't needed anymore 2004-04-26 15:51:26 +00:00
taylor c121c18b4f mark view cutscenes ignoring extension and file case 2004-04-26 13:11:11 +00:00
taylor 5e0b6a687f cvs log header, mark cutscenes viewable for later, gr_flip() to fix OGL white flash 2004-04-26 13:09:20 +00:00
taylor 2ccaf8f927 respect -glow and -spec 2004-04-26 13:05:19 +00:00
taylor c94d4bea59 light setup changes, support cmdline ambient value 2004-04-26 13:02:27 +00:00
taylor 7528ef0fef DevIL stuff 2004-04-26 13:00:56 +00:00
taylor 901e565798 convert to dos format, add DevIL stuff 2004-04-26 12:57:47 +00:00
taylor 7323c9e0da 32-bit targa and jpeg loaders, bug fixes, some preload stuff 2004-04-26 12:44:54 +00:00
taylor 054bcf6dec minor fixes, HTL lines, 32-bit texture support 2004-04-26 12:43:58 +00:00
taylor 79a01657a7 gr_preload() pointer for use in bmpman.cpp 2004-04-26 12:41:46 +00:00
taylor ff5ee510a3 correct header to keep cvs log, minor changes 2004-04-26 12:39:49 +00:00
taylor b4f3e252d0 use d3_draw_rod() for lightning arcs (for OGL fix), fix debris making HUD in OGL disappear 2004-04-26 12:38:35 +00:00
taylor c10a141861 don't try to load glow maps if they are disabled 2004-04-26 12:37:10 +00:00
taylor a83e3a6223 add color and HTL support for g3_draw_rod() 2004-04-26 12:36:10 +00:00
taylor 76d820d0f4 32-bit support with DevIL 2004-04-26 02:14:38 +00:00
taylor b0ece8eb3a initial checkin 2004-04-26 02:05:17 +00:00
taylor e5f836df4b initial checkin 2004-04-26 01:58:17 +00:00
taylor e4256a1cd3 s/idex/idx/ for brief_unload_anims() 2004-04-26 01:41:52 +00:00
taylor 06e8db1bf8 better anim free stuff, disable for now to prevent CTD 2004-04-26 01:40:53 +00:00
taylor c84fbacb8b use absolute moddir path, faster cfilesystem searching 2004-04-26 00:26:37 +00:00
taylor cba0190e05 don't preload every sound (fixes some slowdowns), snd_preload option support 2004-04-26 00:25:08 +00:00
taylor 39e9479ac8 novbo and snd_preload cmdline options, fix moddir getting appended space 2004-04-26 00:23:26 +00:00
Goober5000 f8f1ef779e made time dilation only available in cheat mode; also fixed an obscure CTD
--Goober5000
2004-04-25 06:31:53 +00:00
Kazan 9fccd4c2d0 Fixed Lobby screen showing up while exiting from non-tracker games
Time dialiation up to 1/4
2004-04-24 15:44:22 +00:00
randomtiger 8dc2c082c3 Added -2d_poof command which allows access to 2D poof rendering
Added -radar_reduce to launcher flag description structure
2004-04-18 19:39:13 +00:00
taylor 7ec25aa692 let language reg setting override auto detection 2004-04-14 23:17:26 +00:00
taylor 3835d0758b render lightning unlit so that it works in OGL 2004-04-14 10:27:24 +00:00
taylor e4ab7f2254 don't page in neb poofs unless in a neb2 mission, fix OGL whiteout issue 2004-04-14 10:25:50 +00:00
taylor abbd2a260e fix for lines and shaders - shouldn't be textured 2004-04-14 10:24:51 +00:00
taylor 892cf38736 fix extra large model with -ship_choice_3d in OGL 2004-04-14 00:37:36 +00:00
Goober5000 cc9afc7d3e fixed the custom hitpoints subsystem bug
--Goober5000
2004-04-13 05:42:45 +00:00
phreak f210455827 put in the correct fields for the CVS comments to register
fixed a glowmap problem that occured when rendering glowmapped and non-glowmapped ships
2004-04-13 01:55:41 +00:00
randomtiger 55f84acd98 Adding batching functions here and there and into gr_screen for use with OGL when its ready. 2004-04-11 13:56:33 +00:00
randomtiger b6f02b52cb Fixed movie playing code for fresh install. Removed NO_DSHOW_CODE paths. 2004-04-11 13:43:26 +00:00
Goober5000 b21ab3282d quashed the slider bug!
--Goober5000
2004-04-10 16:55:45 +00:00
Goober5000 1f3318524b some formatting 2004-04-10 16:55:23 +00:00
phreak e2e5a24926 moved an assignment statement inside an #ifdef block so dds works in release mode 2004-04-09 20:32:31 +00:00
phreak 1120cdaa03 fixed DDS not working in OpenGL. there was a misplaced Assert() 2004-04-09 20:07:56 +00:00
phreak 25c7c7c8af got rid of some compile warnings 2004-04-08 20:13:17 +00:00
righteous1 07a01628a0 Backing out mainhall audio fix attempt. 2004-04-08 05:00:13 +00:00
phreak edae245b0e changed around the order of some function calls to get the target model
properly rendering in the hud targetbox
2004-04-07 17:20:24 +00:00
righteous1 fdde5a6713 Updated to call alt_tab_pause() function to draw pause screen and discontinue sounds when the game is minimized. -R1 2004-04-07 03:32:45 +00:00
righteous1 28508f0be4 Updated to add alt_tab_pause() function to draw pause screen and discontinue sounds when the game is minimized. -R1 2004-04-07 03:31:53 +00:00
Goober5000 1502269102 code.dsp should definitely have browse info checked
--Goober5000
2004-04-06 16:25:06 +00:00
Goober5000 d496969846 commented out one of Bobboau's hacks because it was messing stuff up
--Goober5000
2004-04-06 16:19:11 +00:00
Goober5000 e7ee4f4ef1 ugh - added back in something that Bobboau removed
-Goober5000
2004-04-06 05:42:49 +00:00
phreak 7f25fcf05f oops, hanging ')' 2004-04-06 05:28:07 +00:00
phreak 4551cda108 properly commented Local SSM code.
put in some estimation code so the Local SSMs warp in closer to moving ships
2004-04-06 05:26:59 +00:00
phreak 105e95a991 Local SSMs now working again after the code for setting the jumpout/jumpin
times for the missile were removed.
2004-04-06 04:53:21 +00:00
phreak 2257b4efde added a control config option for the wireframe hud targetbox i enabled ages ago 2004-04-06 03:09:53 +00:00
phreak d53c6289dc removed gropenglw32x.cpp (obsolete) and gropengl2d.cpp (unused and accidentaly committed) 2004-04-06 01:51:36 +00:00
phreak d5bc0051fb added comments (terms of use, commit history) to the tops of files 2004-04-06 01:37:21 +00:00
Kazan 4477777cd4 make custom build work again 2004-04-06 01:11:41 +00:00
phreak d81cfcbbba OpenGL files spilt up to make developing and finding bugs much easier 2004-04-03 20:29:53 +00:00
Kazan 42e936b6b1 FRED fixes 2004-04-03 18:11:21 +00:00
Goober5000 f6007413de fixed some stub functions and a bunch of compile warnings
--Goober5000
2004-04-03 06:22:33 +00:00
bobboau 12b3ffb6b9 commiting recent minor bug fixes 2004-04-03 02:55:50 +00:00
randomtiger 034f987d38 Changed D3D secondry texture system to be off by default to save mem.
Added some friendly names for parameters.
2004-04-02 18:25:16 +00:00
taylor d3ca761e30 don't use interface anis as ship textures 2004-04-01 15:31:22 +00:00
taylor f8dcf11f99 close out briefing menu bitmaps before entering mission 2004-04-01 15:29:39 +00:00
taylor a780021f7b don't load all starfield bitmaps on level load 2004-04-01 15:28:42 +00:00
Goober5000 f43da62c3e got rid of all those nasty warnings from xlocale and so forth; also added comments
for #pragma warning disable to indicate the message being disabled
--Goober5000
2004-03-31 05:42:29 +00:00
Goober5000 6487bd1ff4 got rid of Bobboau's SAFEPOINTs in hudtarget.cpp
--Goober5000
2004-03-31 04:24:49 +00:00
taylor bb870a6926 handle movie file extensions better 2004-03-30 08:30:38 +00:00
phreak 6216fb09da fixed a minor bug where the version checker
would complain even if the correct version of OpenGL was present
2004-03-29 02:24:20 +00:00
taylor a1751c30ab runtime language selection, mantis:0000133 2004-03-28 17:49:55 +00:00
randomtiger 98e7e86697 Movies now use win32 calls to clear the screen before playback. 2004-03-27 23:23:36 +00:00
randomtiger c488360abc Committed possible fix to cutscene listing problem in techroom, as described in mantis. 2004-03-27 22:27:07 +00:00
randomtiger c38d9601c8 Bug fix for video playback. 2004-03-21 17:38:18 +00:00
bobboau aa60ef5bcc fixed a texture loading bug 2004-03-21 10:34:05 +00:00
randomtiger e611d3d74e Fixed a bug that was causing windowed movie playback and a crash.
Added some batching redirection.
2004-03-21 09:41:54 +00:00
bobboau 24a9694494 fixed -spec comand line option,
probly some other stuf
2004-03-20 21:17:13 +00:00
randomtiger 55671189f0 Added base for a general dynamic batching solution.
Fixed NO_DSHOW_CODE code path bug.
2004-03-20 14:47:14 +00:00
randomtiger 8e595a903c New command line parameter: -d3d_lesstmem causes D3D to bypass V's secondry texture system. 2004-03-19 14:51:55 +00:00
randomtiger 2e49d55faf Further D3D texture system simplification. 2004-03-19 12:35:58 +00:00
randomtiger 08d8e0799a Removed -d3d_notmanaged param.
Tided D3D texture code. Merged remaining section code into the rest of the system.
Prepared for removal of code causing waste of memory for secondry store of textures.
2004-03-19 11:44:04 +00:00
bobboau 5d54009c21 new fighter beam code
fixed old after burner trails
had to bump a few limits, working on some dynamic solutions
a few fixed to background POF rendering
fixing asorted bugs
2004-03-17 04:07:32 +00:00
randomtiger fcc33b856f Added new launcher flag construction code. 2004-03-16 18:37:02 +00:00
phreak b8d48fac23 really fixed opengl shields this time 2004-03-16 17:41:12 +00:00
randomtiger 4c27f96902 Commented out shield fix that broke shield rendering for D3D.
Fix didnt appear to work for OGL so I didnt bother to if(OGL) it.
2004-03-16 11:52:17 +00:00
phreak 9fde027411 bumped MAX_SOUNDS to 450 if INF_BUILD is defined 2004-03-12 16:26:39 +00:00
phreak 2af460314d bumped MAX_GAME_SOUNDS to 400 if INF_BUILD is defined 2004-03-12 16:23:49 +00:00
Kazan a639da2973 irc 2004-03-10 20:51:16 +00:00
Kazan 9cbbb6fd03 generally it helps if i actually add and commit the files i want to modify on a different system 2004-03-10 19:11:40 +00:00
Kazan 20a083c859 partially complete IRC - so i can work on it on my laptop 2004-03-10 18:45:09 +00:00
Kazan 685880a7b6 Disabled multithreaded TCP_Socket in favor of safer single threaded
FS2NetD doesn't kill the game on connection failure now - just gives warning message and effectively dsiables itself until they try to connect again
2004-03-09 17:59:01 +00:00
Kazan 9010d21b32 more fs2netd stuff 2004-03-09 00:02:16 +00:00
phreak 841774f69f fugly hack to get skyboxes working in HT&L. please port stars_draw() to use HT&L
so this hack can be removed
2004-03-08 22:16:32 +00:00
Kazan 04e34810e0 Lobby GUI screen restored 2004-03-08 22:02:39 +00:00
phreak dcfc77364e fixed a bug so that shields now render in Opengl HT&L 2004-03-08 22:01:29 +00:00
phreak be2d15fc4f made a minor logical fix to gr_opengl_tmapper_internal
disabled pcx32 and jpgtga flags if they were defined by the user
2004-03-08 21:57:04 +00:00
phreak 014e261af1 split the star and space debris rendering loops into their own separate functions
this makes it easier to edit them if we ever need to and it also increases readability
i also brought some variable declarations outside of the rendering loops
2004-03-08 21:55:20 +00:00
randomtiger f343c2f7b1 Added complete stub system to replace software. 2004-03-08 18:36:21 +00:00
Kazan 30ae2da9cd Did, undo 2004-03-08 15:06:24 +00:00
Kazan 9236bd6d7c *crosses fingers* 2004-03-08 15:03:27 +00:00
Kazan 85f05019b5 [Incomplete] Readd of Software renderer so Standalone server works
Also FS2NetD changes
PS: CVS crashing mid-transaction and leaving stale locks = annoying++
2004-03-08 14:53:11 +00:00
Kazan 6509badc36 [Incomplete] Readd of Software renderer so Standalone server works 2004-03-07 23:07:20 +00:00
randomtiger 21856a78e5 If user has stub ani's dshow code will fail gracefully instead of throwing up an error. 2004-03-07 14:02:22 +00:00
bobboau 6ee175e65d fixed motion debris
animated laser textures
and added a new error check called a safepoint, mostly for tracking the 'Y bug'
2004-03-06 23:28:24 +00:00
Goober5000 2f067ae8aa weapons now display counts up to 9999, instead of just 999
--Goober5000
2004-03-06 00:19:23 +00:00
Goober5000 fcc38162c5 d'oh!
--Goober5000
2004-03-05 23:54:48 +00:00
Goober5000 771e6b2faa made awacs only ask for help in the main fs2 campaign
--Goober5000
2004-03-05 23:41:04 +00:00
Kazan 28cc2957c8 Fixed mission validation (was returning false positives) 2004-03-05 21:24:53 +00:00
Kazan 1e99847291 Fixed mission validation (was returning false positives) 2004-03-05 21:19:39 +00:00
Goober5000 2edd420943 Uber pass at reducing #includes
--Goober5000
2004-03-05 09:02:13 +00:00
phreak 852ec76549 fixed the lack of ships in the hud targetbox
prevented other functions calls to glColor3ub() from messing
with the color of textures in gr_opengl_render_buffer().  this was causing some
minor rendering bugs
2004-03-05 04:33:09 +00:00
phreak 7caf442717 made OpenGl use the matrix api if called by g3_start_**** or g3_done_instance 2004-03-05 04:16:20 +00:00
randomtiger e1ca009d9a Think I have fixed dshow window focus error, will tidy code when confirmed. 2004-03-04 20:56:43 +00:00
Kazan 5b591c2c4c LAN works A1 Supar! 2004-03-04 05:57:45 +00:00
Goober5000 55c7d0e0fc preliminary checking of globals.h
--Goober5000
2004-02-28 20:26:10 +00:00
randomtiger 6a2cadb08f Removed a few uneeded if DIRECT3D's.
Set laser function to only render the effect one sided.
Added some stuff to the credits.
Set D3D fogging to fall back to vertex fog if table fog not supported.
2004-02-28 14:14:57 +00:00
Goober5000 0ccb8a19dc commented a slide_face_ship that I missed before
--Goober5000
2004-02-28 01:36:20 +00:00
bobboau 7d87db1939 fixed a Z buffer error in HTL submodel rendering,
and glow points,
and other stuff
2004-02-27 04:09:56 +00:00
Goober5000 e94733df9c added DONT_SHOW_WARNINGS compile branch
--Goober5000
2004-02-25 05:53:32 +00:00
Goober5000 a69f3bd271 removed an old function
--Goober5000
2004-02-23 07:45:38 +00:00
Kazan d7905cd06a FS2NETD License Comments 2004-02-21 00:59:43 +00:00
randomtiger 244b9718d5 Added * to - conversion for start mission code to allow launcher missions with '-' in them.
Currently the parsing code counts that as a flag and messes it up.
2004-02-20 21:58:07 +00:00
randomtiger 020379cf40 Removed some uneeded code between NO_DIRECT3D and added gr_zbias call, ogl is set to a stub func.
Changed -htl param to -nohtl. Fixed some badly named functions to match convention.
Fixed setup of center_alpha in OGL which was causing crash.
2004-02-20 21:45:41 +00:00
randomtiger 183587f8b4 Changed memory leak detection to happen after atexit all other calls.
This will mean it doesnt report leaks that are cleared by just before the game quits by preset functions.
2004-02-20 18:04:27 +00:00
bobboau a963f3ccc1 pluged memory leaks,
3D HTL lasers (they work perfictly)
and posably fixed Turnsky's shinemap bug
2004-02-20 04:29:57 +00:00
bobboau e540947704 fixing lighting bug I accedently introduced 2004-02-16 21:53:40 +00:00
randomtiger b94f8cddde Use _REPORT_MEM_LEAKS compile flag in code.lib to get a report of memory leaks from malloc calls. 2004-02-16 21:22:15 +00:00
phreak 6fd1ef440b grr fixed a warning message i didn't see 2004-02-16 16:15:04 +00:00
phreak cd2b9d9871 made the window command line tag recognize non-standard resolutions 2004-02-16 16:09:59 +00:00
randomtiger eb1b936ff1 Oops, put two files back in, went a bit too far.
Added NO_DSHOW_CODE as a temp solution to Bobs compiling problem.
2004-02-16 12:53:43 +00:00
randomtiger 8bf7c4076b Removed a lot of files that we dont need anymore.
Changed htl to be on by default, command now -nohtl
Changed D3D to use a 2D vertex for 2D operations which should cut down on redundant data having to go though the system.
Added small change to all -start_mission flag to take you to any mission by filename, very useful for testing.
Removed old dshow code and took away timerbar compile flag condition since it uses a runtime flag now.
2004-02-16 11:47:34 +00:00
bobboau 9a76ae8d12 fixed sevral asorted matrix errors,
OGL people make sure I didn't break anything,
most of what I did was replaceing falses with (if graphicts_mode == D3D)
2004-02-15 06:02:32 +00:00
bobboau a9dc8db3bb fixed bug involving 3d shockwaves, note I wasn't able to compile the directshow file, so I ifdefed everything to an older version,
you shouldn't see anything diferent, as the ifdef should be set to the way it should be, if it isn't you will get a warning mesage during compile telling you how to fix it
2004-02-15 03:04:25 +00:00
Goober5000 b99a6b6af2 hmph... fixed some bugs
--Goober5000
2004-02-14 04:26:58 +00:00
randomtiger 397699ec31 Please note that from now on OGL will only run with a registry set by Launcher v4. See forum for details.
OK, these changes effect a lot of file, I suggest everyone updates ASAP:
Removal of many files from project.
Removal of meanless Gr_bitmap_poly variable.
Removal of glide, directdraw, software modules all links to them, and all code specific to those paths.
Removal of redundant Fred paths that arent needed for Fred OGL.
Have seriously tidied the graphics initialisation code and added generic non standard mode functionality.
Fixed many D3D non standard mode bugs and brought OGL up to the same level.
Removed texture section support for D3D8, voodoo 2 and 3 cards will no longer run under fs2_open in D3D, same goes for any card with a maximum texture size less than 1024.
2004-02-14 00:18:37 +00:00
randomtiger 3529db4d37 Turned off fog in OGL for Fred.
Simulated speech doesnt say tags marked by $ now.
The following are fixes to issues that came up testing TBP in fs2_open and fred2_open:
Changed vm_vec_mag and parse_tmap to fail gracefully on bad data.
Error now given on missing briefing icon and bad ship normal data.
Solved more species divide by zero error.
Fixed neb cube crash.
2004-02-13 04:17:14 +00:00
phreak 694d089fe0 fixed a bug where the inferno build would get lower limits for MAX_PERSONAS if INF_BUILD was defined 2004-02-12 22:29:55 +00:00
Goober5000 de560ceb29 fixed the barracks crash bug
--Goober5000
2004-02-10 21:47:47 +00:00
matt 73c417bf70 Fixed issue with ships being rendered off center
in the HUD target box. Much easier than I
thought
-- Sticks
2004-02-10 05:07:38 +00:00
Goober5000 dfc06acfd3 fixed a small bug in FS1-compatible music
--Goober5000
2004-02-08 03:35:08 +00:00
Goober5000 1b0a949dc5 fix for undestroyable subsystems
--Goober5000
2004-02-07 05:11:08 +00:00
Goober5000 4e7667842b hehe, fixed the subsystem compare so it's not destructive :-p
and also fixed the model checking routine
--Goober5000
2004-02-07 01:25:15 +00:00
Goober5000 5129749cb8 made FS2 able to account for subsystem mismatches between ships.tbl and the
model file - e.g. communication vs. communications
--Goober5000
2004-02-07 00:48:53 +00:00
Goober5000 1fe6fa8b06 tweakage
--Goober5000
2004-02-06 23:17:43 +00:00
Goober5000 7034e99aa5 commented my tmap_num Asserts
--Goober5000
2004-02-06 23:00:29 +00:00
Goober5000 47e55fe686 fixed a small HUD bug I introduced
--Goober5000
2004-02-06 22:58:18 +00:00
Goober5000 668ddde68b fixed a small compatibility bug
--Goober5000
2004-02-06 21:26:07 +00:00
Goober5000 ea259b8961 ugh... okay, *really* fixed the head thing this time
--Goober5000
2004-02-06 21:25:43 +00:00
matt 3428289778 Fix for bad ambient lighting in non-htl -Sticks 2004-02-06 05:55:46 +00:00
Goober5000 12c9238f62 fixed a few random bugs
--Goober5000
2004-02-05 14:31:45 +00:00
Goober5000 360060f59d fixed the talking head error
--Goober5000
2004-02-05 14:29:33 +00:00
randomtiger 720b16befb Small changes, deleted old dshow stuff 2004-02-05 01:41:33 +00:00
Goober5000 def739c279 commented a decal function that someone missed
--Goober5000
2004-02-04 10:14:58 +00:00
Goober5000 0e9af797e5 changed spec and glow to be off by default; command lines are now -spec and -glow
--Goober5000
2004-02-04 10:14:25 +00:00
Goober5000 17665a6333 more player ai stuff
--Goober5000
2004-02-04 09:21:36 +00:00
Goober5000 58b82fefd8 got rid of unnecessary double semicolons
--Goober5000
2004-02-04 09:02:45 +00:00
Goober5000 66cb87e18f made code more uniform and simplified some things,
specifically shield percentage and quadrant stuff
--Goober5000
2004-02-04 08:41:04 +00:00
Goober5000 564fb3fd19 fixed Asserts in two places and commented out an unneeded variable
--Goober5000
2004-02-04 04:28:15 +00:00
randomtiger 89fe89775c Fixed OGL fogging in HTL
Changed htl laser function to work in D3D, commented out until function flat bug is fixed
2004-02-03 18:29:30 +00:00
phreak e112deb37a commented out decal references 2004-01-31 04:06:29 +00:00
phreak a6189c4fdd changed "now" to unsigned int 2004-01-31 03:56:46 +00:00
phreak ff7dca2d05 commented out decal references 2004-01-31 03:54:50 +00:00
phreak d83d4098de commented out file pending rewrite 2004-01-31 03:52:41 +00:00
Goober5000 3c2e1de05e whew - I just went through all the code I ever added (or at least, that I could
find that I commented with a Goober5000 tag) and added a bunch of Asserts
and error-checking
--Goober5000
2004-01-30 07:39:09 +00:00
randomtiger 492597e3b2 Added malloc montoring system, use -show_mem_usage, debug exes only to get an ingame list of heap usage.
Also added -d3d_notmanaged flag to activate non managed D3D path, in experimental stage.
2004-01-29 01:34:02 +00:00
phreak 9078d2aea6 bumped MAX_AI_CLASSES to 30 if INF_BUILD is defined 2004-01-26 23:07:43 +00:00
randomtiger c74f634e79 Fix to blurring of interface bitmaps from TGA and JPG.
Changes to the pointsprite system, better but not perfect yet.
2004-01-26 20:03:51 +00:00
randomtiger 72f0a923e0 I have submitted the new movie playing code despite the fact in D3D it sometimes plays behind the main window.
In OGL it works perfectly and in both API's it doesnt switch to the desktop anymore so hopefully people will not experience the crashes etc that the old system used to suffer from.
2004-01-24 15:52:26 +00:00
randomtiger 23be3b5605 Added the D3D particle code, its not bugfree but works perfectly on my card and helps with the framerate.
Its optional and off by default, use -d3d_particle to activiate.
Also bumped up D3D ambient light setting, it was way too dark.
Its now set to something similar to the original game.
2004-01-24 14:31:27 +00:00
randomtiger 49491fac75 Font and other small changes for Fred 2004-01-24 12:47:48 +00:00
randomtiger 8ebf284993 Fixed serious memory leak causes by use of -pcx32 flag 2004-01-23 00:14:27 +00:00
phreak 0a072d7403 bumped MAX_POLYGON_MODELS to 300 if INF_BUILD is defined. 2004-01-21 17:37:48 +00:00
phreak e862231feb added MAX_DRAW_DISTANCE to the ship selection display. This will only take effect if the ani isn't there 2004-01-21 17:37:04 +00:00
phreak f7df30b549 bumped MAX_PERSONAS to 25 if INF_BUILD is defined. 2004-01-21 17:34:31 +00:00
phreak 3f87bea143 added MAX_DRAW_DISTANCE constant 2004-01-21 17:33:47 +00:00
phreak e1dce56a56 added version string message if build is an inferno build 2004-01-21 17:32:05 +00:00
Goober5000 9ae52aa90a whoops, messed up the speech slightly
--Goober5000
2004-01-20 23:56:28 +00:00
Goober5000 2523a62878 added some initialization to get rid of warnings
--Goober5000
2004-01-20 23:01:52 +00:00
Goober5000 1762e4a6be got rid of some warnings... it actually looks like Gr_gamma_lookup can be changed
from int to ubyte, because everything that accesses it converts to a ubyte  O.o
--Goober5000
2004-01-20 22:59:09 +00:00
Goober5000 e691cbc995 changed the speech stubs to #defines
--Goober5000
2004-01-20 22:50:18 +00:00
Goober5000 f98f7e12be commented the variables in a commented function
--Goober5000
2004-01-20 22:39:06 +00:00
Goober5000 7034b6a0f0 First of all, this should be more readable, second of all, old_fog_color wasn't
initialized and VC++ is complaining.  Someone want to fix this?
--Goober5000
2004-01-20 22:37:44 +00:00
Goober5000 d240e24ef1 bumped MAX_SEXP_NODES to 3000
--Goober5000
2004-01-20 22:20:41 +00:00
Goober5000 8f497bfac7 er... corrected some inexplicable code... Bobboau, mind explaining?
--Goober5000
2004-01-20 22:13:06 +00:00
Goober5000 23601fda0d heat-seekers now home in on hidden ships
--Goober5000
2004-01-20 22:10:01 +00:00
randomtiger 278eedf7ad *** empty log message *** 2004-01-19 00:57:18 +00:00
randomtiger efe43d3466 Some more small changes for Fred OGL 2004-01-19 00:56:10 +00:00
randomtiger e19577e35c Few more small changes for Fred OGL 2004-01-18 14:55:08 +00:00
randomtiger 42568915bd A couple of FRED_OGL changes. 2004-01-18 14:03:23 +00:00
randomtiger 6ca2f86255 Changed the #ifndef FRED I added to #ifndef FRED_OGL so they only effect OGL FRED compile 2004-01-18 13:17:55 +00:00
randomtiger 32b0a71369 Some small changes to the main codebase that allow Fred_open OGL to compile. 2004-01-17 21:59:56 +00:00
Goober5000 2cf3e96a6b I think this will fix the problem of the death head ani sometimes incorrectly playing
--Goober5000
2004-01-14 21:12:24 +00:00
Goober5000 cc187b758d added error checking for an annoying crash when running an out-of-range
sound; also, Phreak misspelled "tertiary"
--Goober5000
2004-01-14 07:07:14 +00:00
Goober5000 ea11ea8a63 fixx0red a bug
--Goober5000
2004-01-14 06:38:41 +00:00
Goober5000 33212b6499 made set-support-ship number align with general FS convention
--Goober5000
2004-01-14 06:34:07 +00:00
randomtiger ef1880b03a Added new D3D particle module, will commit the code that uses it when its bug free. 2004-01-13 02:19:59 +00:00
randomtiger 077d4b2a54 Added fix for fogging debris in D3D htl. 2004-01-12 21:12:42 +00:00
phreak 07b00e2fae fixed a null pointer 2003-12-19 05:58:44 +00:00
phreak 018159b822 oops switched the signs in a comparison. thats what was causing debug builds to go haywire 2003-12-18 15:35:52 +00:00
phreak 7f20e9109f added a MAX_BUFFERS_PER_SUBMODEL define so it can be easily changed if we ever want to change the 16 texture limit 2003-12-17 23:25:10 +00:00
phreak 2cb5a44f3e fixed some logic when dealing with parsing local ssms 2003-12-17 20:38:26 +00:00
phreak 450ac81a1e added ai code for "small only" weapons. works for turrets at the moment 2003-12-17 16:42:20 +00:00
phreak dd840fe227 "small only" weapons flag added. weapon shoots at small ships like fighters 2003-12-17 16:41:25 +00:00
phreak 57772da95b disabled tertiary weapons support pending a rewrite of critical code 2003-12-16 21:06:21 +00:00
phreak e672918122 disabled tertiary weapons support pending a rewrite of critical code 2003-12-16 20:55:13 +00:00
phreak 6b00a67df0 made gr_set_proj_matrix use the MIN/MAX_DRAW_DISTANCE constants 2003-12-16 20:48:41 +00:00
phreak 8e68228c86 created two constants
MAX_DRAW_DISTANCE = 250000
MIN_DRAW_DISTANCE = 1
2003-12-16 20:42:36 +00:00
phreak 0cae377b72 replaced asserts in parse_ship with more descriptive warnings 2003-12-15 21:36:42 +00:00
phreak d343e5b73a made turrets use bob's $shots code 2003-12-15 21:32:59 +00:00
phreak 72cb0142b2 upped MAX_WEAPON_TYPES to 300 when INF_BUILD is defined 2003-12-15 21:30:24 +00:00
randomtiger ffdef38781 Put render state and other direct D3D calls repetition check back in, provides speed boost.
Fixed bug that caused fullscreen only crash with DXT textures
Put dithering back in for tgas and jpgs
2003-12-08 22:30:02 +00:00
randomtiger 0578517f3a D3D now supports loading for DXT1-5 into the texture itself, defaults to on same as OGL.
Fixed bug in old ship choice screen that stopped ani repeating.
Changed all builds (demo, OEM) to use retail reg path, this means launcher can set all them up successfully.
2003-12-05 18:17:07 +00:00
randomtiger f994cdac45 Added DDS image support for D3D
Added new command flag '-ship_choice_3d' to activate 3D models instead of ani's in ship choice, feature now off by default
Hopefully have fixed D3D text batching bug that caused old values to appear
Added Hud_target_object_factor variable to control 3D object sizes of zoom in HUD target
Fixed jump nodes not showing
2003-12-04 20:39:10 +00:00
randomtiger 1f16f9dc23 Changed -t32 flag to -jpgtga
Added -query_flag to identify builds with speech not compiled and other problems
Now loads up launcher if videocard reg entry not found
Now offers to go online to download launcher if its not present
Changed target view not to use lower res texture, hi res one is already chached so might as well use it
2003-12-03 19:27:01 +00:00
Goober5000 dbaf87c202 fixed CVS log header so that changes would update more cleanly
--Goober5000
2003-12-02 03:16:16 +00:00
randomtiger 391c18e9e7 Undid my node fix, it introduced a lot of bugs, update again if you have that version. 2003-11-29 17:13:54 +00:00
fryday 026e23d8ed Fixed normal loading in OpenGL HT&L.
Fixed lighting in OpenGL HT&L, hopefully for the last time.
Added a test if a normal is valid during model load, if not, replaced with face normal
2003-11-29 16:11:46 +00:00
randomtiger 8a579733c0 Small changes to D3D setup 2003-11-29 15:48:11 +00:00
randomtiger cfc99c4f23 Rendering jumpnodes in htl via the old system to make them display again, appears to be so cheap it wouldnt be worth the effort to convert it to true htl. 2003-11-29 14:54:35 +00:00
randomtiger dac33aeb71 Turned off D3D file mapping, its using too much memory which may be hurting older systems and doesnt seem to be providing much of a speed benifit.
Added stats command for ingame stats on memory usage.
Trys to play intro.mve and intro.avi, just to be safe since its not set by table.
Added fix for fonts wrapping round in non standard hi res modes.
Changed D3D mipmapping to a good value to suit htl mode.
Added new fog colour method which makes use of the bitmap, making this htl feature backcompatible again.
2003-11-29 10:52:10 +00:00
fryday 29af6aefbc Got lasers to work in HT&L OpenGL
Messed a bit with opengl_tmapper_internal3d, draw_laser functions, and added draw_laser_htl
2003-11-25 15:04:46 +00:00
Goober5000 99e6883251 fixed an old omission
--Goober5000
2003-11-25 02:32:16 +00:00
Goober5000 2513b23ad9 fixed bug in tech-reset-to-default
--Goober5000
2003-11-24 18:18:00 +00:00
Goober5000 d64d8ce6e0 fixed a bug introduced by Penguin for running with NO_NETWORK defined
--Goober5000
2003-11-23 00:59:01 +00:00
fryday 2f994399e9 Changed default alpha value for lasers in OpenGL to be like in D3D
Fixed Glowmaps being rendered with GL_NEAREST instead of GL_LINEAR.
Dynamic Lighting almost there. It looks like some normals are fudged or something.
2003-11-22 10:36:32 +00:00
phreak ad100d79dc changed PLAYER_MAX_DIST_WARNING to 700000 (700km)
changed PLAYER_MAX_DIST_END to 750000           (750km)

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Tested and works on the following systems

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

added

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

No files matched your search

+15
View File
@@ -0,0 +1,15 @@
# The "checkoutlist" file is used to support additional version controlled
# administrative files in $CVSROOT/CVSROOT, such as template files.
#
# The first entry on a line is a filename which will be checked out from
# the corresponding RCS file in the $CVSROOT/CVSROOT directory.
# The remainder of the line is an error message to use if the file cannot
# be checked out.
#
# File format:
#
# [<whitespace>]<filename><whitespace><error message><end-of-line>
#
# comment lines begin with '#'
new_commit_prep Error checking out/updating CVSROOT/new_commit_prep
new_log_accum Error checking out/updating CVSROOT/new_log_accum
+17
View File
@@ -0,0 +1,17 @@
# The "commitinfo" file is used to control pre-commit checks.
# The filter on the right is invoked with the repository and a list
# of files to check. A non-zero exit of the filter program will
# cause the commit to be aborted.
#
# The first entry on a line is a regular expression which is tested
# against the directory that the change is being committed to, relative
# to the $CVSROOT. For the first match that is found, then the remainder
# of the line is the name of the filter to run.
#
# If the repository name does not match any of the regular expressions in this
# file, the "DEFAULT" line is used, if it is specified.
#
# If the name "ALL" appears as a regular expression it is always used
# in addition to the first matching regex or "DEFAULT".
DEFAULT $CVSROOT/CVSROOT/new_commit_prep
CVSROOT $CVSROOT/CVSROOT/new_commit_prep
+14
View File
@@ -0,0 +1,14 @@
# Set this to "no" if pserver shouldn't check system users/passwords
#SystemAuth=no
# Put CVS lock files in this directory rather than directly in the repository.
LockDir=/var/lock/cvs
# Set `TopLevelAdmin' to `yes' to create a CVS directory at the top
# level of the new working directory when using the `cvs checkout'
# command.
#TopLevelAdmin=no
# Set `LogHistory' to `all' or `TOFEWGCMAR' to log all transactions to the
# history file, or a subset as needed (ie `TMAR' logs all write operations)
#LogHistory=TOFEWGCMAR
+23
View File
@@ -0,0 +1,23 @@
# This file affects handling of files based on their names.
#
# The -t/-f options allow one to treat directories of files
# as a single file, or to transform a file in other ways on
# its way in and out of CVS.
#
# The -m option specifies whether CVS attempts to merge files.
#
# The -k option specifies keyword expansion (e.g. -kb for binary).
#
# Format of wrapper file ($CVSROOT/CVSROOT/cvswrappers or .cvswrappers)
#
# wildcard [option value][option value]...
#
# where option is one of
# -f from cvs filter value: path to filter
# -t to cvs filter value: path to filter
# -m update methodology value: MERGE or COPY
# -k expansion mode value: b, o, kkv, &c
#
# and value is a single-quote delimited value.
# For example:
#*.gif -k 'b'
+21
View File
@@ -0,0 +1,21 @@
# The "editinfo" file is used to allow verification of logging
# information. It works best when a template (as specified in the
# rcsinfo file) is provided for the logging procedure. Given a
# template with locations for, a bug-id number, a list of people who
# reviewed the code before it can be checked in, and an external
# process to catalog the differences that were code reviewed, the
# following test can be applied to the code:
#
# Making sure that the entered bug-id number is correct.
# Validating that the code that was reviewed is indeed the code being
# checked in (using the bug-id number or a seperate review
# number to identify this particular code set.).
#
# If any of the above test failed, then the commit would be aborted.
#
# Actions such as mailing a copy of the report to each reviewer are
# better handled by an entry in the loginfo file.
#
# One thing that should be noted is the the ALL keyword is not
# supported. There can be only one entry that matches a given
# repository.
+30
View File
@@ -0,0 +1,30 @@
# The "loginfo" file controls where "cvs commit" log information
# is sent. The first entry on a line is a regular expression which must match
# the directory that the change is being made to, relative to the
# $CVSROOT. If a match is found, then the remainder of the line is a filter
# program that should expect log information on its standard input.
#
# If the repository name does not match any of the regular expressions in this
# file, the "DEFAULT" line is used, if it is specified.
#
# If the name ALL appears as a regular expression it is always used
# in addition to the first matching regex or DEFAULT.
#
# You may specify a format string as part of the
# filter. The string is composed of a `%' followed
# by a single format character, or followed by a set of format
# characters surrounded by `{' and `}' as separators. The format
# characters are:
#
# s = file name
# V = old version number (pre-checkin)
# v = new version number (post-checkin)
#
# For example:
#DEFAULT (echo ""; id; echo %s; date; cat) >> $CVSROOT/CVSROOT/commitlog
# or
#DEFAULT (echo ""; id; echo %{sVv}; date; cat) >> $CVSROOT/CVSROOT/commitlog
DEFAULT $CVSROOT/CVSROOT/new_log_accum -m [email protected] %{sVv}
CVSROOT $CVSROOT/CVSROOT/new_log_accum -m [email protected] %{sVv}
+26
View File
@@ -0,0 +1,26 @@
# Three different line formats are valid:
# key -a aliases...
# key [options] directory
# key [options] directory files...
#
# Where "options" are composed of:
# -i prog Run "prog" on "cvs commit" from top-level of module.
# -o prog Run "prog" on "cvs checkout" of module.
# -e prog Run "prog" on "cvs export" of module.
# -t prog Run "prog" on "cvs rtag" of module.
# -u prog Run "prog" on "cvs update" of module.
# -d dir Place module in directory "dir" instead of module name.
# -l Top-level directory only -- do not recurse.
#
# NOTE: If you change any of the "Run" options above, you'll have to
# release and re-checkout any working directories of these modules.
#
# And "directory" is a path to a directory relative to $CVSROOT.
#
# The "-a" option specifies an alias. An alias is interpreted as if
# everything on the right of the "-a" had been typed on the command line.
#
# You can encode a module within a module by using the special '&'
# character to interpose another module into the current module. This
# can be useful for creating a module that consists of many directories
# spread out over the entire source repository.
+104
View File
@@ -0,0 +1,104 @@
#!/usr/bin/perl -w
#
# Copyright (C) 2000 by Kevin L. Mitchell <[email protected]>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
#
# Script to store the last visited directory for newlogaccum.pl.
#
# $Id: new_commit_prep,v 1.1 2002-08-11 23:05:15 drevil Exp $
use strict;
# This routine removes everything in a directory
sub clear_dir {
my ($dir) = @_;
my ($file);
opendir(DIR, $dir) || die "Cannot clear directory $dir: $!";
while ($file = readdir(DIR)) {
next
if ($file eq "." || $file eq "..");
$file = "$dir/$file";
if (-d $file) {
# It's a directory, recurse into it, then delete it.
clear_dir($file);
rmdir($file);
} else {
# It's a file, delete it.
unlink($file);
}
}
closedir(DIR);
}
# This routine prepares a temporary directory, hopefully in a secure
# fashion; it uses the process group to make secondary programs be able
# to find it.
sub tmpdir (;$) {
my ($clear) = @_;
my ($pgrp, $own, $mode, $tmpdir);
$pgrp = getpgrp();
die "Don't run $0 setuid!"
unless ($< == $>);
# Decide on the directory name, using various environment variables
$tmpdir = ($ENV{TMPDIR} || $ENV{TMP} || $ENV{TEMP} || "/tmp") .
"/.#cvs.$pgrp";
# Doesn't exist, but we can't create it...
die "Can't create temporary directory $tmpdir: $!"
unless (-e $tmpdir || mkdir($tmpdir, 0700));
die "Temporary directory $tmpdir is not a directory"
unless (-d $tmpdir);
# Check ownership and permissions
(undef, undef, $mode, undef, $own, undef) = stat($tmpdir);
die "Temporary directory $tmpdir not owned by $< (owned by $own)"
unless ($own == $<);
die "Temporary directory $tmpdir group-writable"
if ($mode & 0020);
die "Temporary directory $tmpdir other-writable"
if ($mode & 0002);
# If we're supposed to clear the directory, do so...
clear_dir($tmpdir)
if ($clear);
return $tmpdir;
}
# This routine writes a single line to a file
sub write_line ($$) {
my ($fname, $line) = @_;
open(FILE, ">$fname") || die "Cannot open file $fname for writing";
print FILE "$line\n";
close(FILE);
}
# Create and empty the temporary directory
my ($tmpdir) = (tmpdir(1));
# Store the directory name
write_line("$tmpdir/lastdir", shift(@ARGV));
+757
View File
@@ -0,0 +1,757 @@
#!/usr/bin/perl -w
#
# Copyright (C) 2000 by Kevin L. Mitchell <[email protected]>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
#
# Script to accumulate log messages for an entire tree and send them along
# with the diffs; deals correctly with all manner of branching (I hope)
#
# $Id: new_log_accum,v 1.3 2003-09-07 12:46:59 drevil Exp $
#
use strict;
use vars qw($MAILER $CVS $debug $boundary);
use Digest::MD5;
# Set this to the full path of a mailer that takes a list
# of email addresses as arguments...
$MAILER = "/usr/sbin/sendmail -oi -oeq";
# Set this to the path of the CVS binary responsible for this tree...
$CVS = "/usr/bin/cvs";
# Don't touch this; use the -d command line option
$debug = 0;
# This is initialized by build_mailheader()
$boundary = '';
use POSIX qw(setsid);
# We have to dissociate from our parent, so that the CVS commit can
# complete, before we try to extract the diffs
sub daemonize {
defined(my $pid = fork()) || die "Can't fork: $!";
exit(0)
if $pid;
setsid() || die "Can't start a new session: $!";
}
# Debugging output
sub debug (@) {
print STDERR @_
if ($debug);
}
# Constants used in the FSM below for parsing the log message
sub STATE_NONE { 0 }
sub STATE_MODIFIED { 1 }
sub STATE_ADDED { 2 }
sub STATE_REMOVED { 3 }
sub STATE_LOG1 { 4 }
sub STATE_LOG2 { 5 }
# This routine removes everything in a directory
sub clear_dir {
my ($dir) = @_;
my ($file);
opendir(DIR, $dir) || die "Cannot clear directory $dir: $!";
while ($file = readdir(DIR)) {
next
if ($file eq "." || $file eq "..");
$file = "$dir/$file";
if (-d $file) {
# It's a directory, recurse into it, then delete it.
clear_dir($file);
rmdir($file);
} else {
# It's a file, delete it.
unlink($file);
}
}
closedir(DIR);
}
# This routine prepares a temporary directory, hopefully in a secure
# fashion; it uses the process group to make secondary programs be able
# to find it.
sub tmpdir (;$) {
my ($clear) = @_;
my ($pgrp, $own, $mode, $tmpdir);
$pgrp = getpgrp();
die "Don't run $0 setuid!"
unless ($< == $>);
# Decide on the directory name, using various environment variables
$tmpdir = ($ENV{TMPDIR} || $ENV{TMP} || $ENV{TEMP} || "/tmp") .
"/.#cvs.$pgrp";
# Doesn't exist, but we can't create it...
die "Can't create temporary directory $tmpdir: $!"
unless (-e $tmpdir || mkdir($tmpdir, 0700));
die "Temporary directory $tmpdir is not a directory"
unless (-d $tmpdir);
# Check ownership and permissions
(undef, undef, $mode, undef, $own, undef) = stat($tmpdir);
die "Temporary directory $tmpdir not owned by $< (owned by $own)"
unless ($own == $<);
die "Temporary directory $tmpdir group-writable"
if ($mode & 0020);
die "Temporary directory $tmpdir other-writable"
if ($mode & 0002);
# If we're supposed to clear the directory, do so...
clear_dir($tmpdir)
if ($clear);
return $tmpdir;
}
# Routine to remove the temporary directory when done
sub cleanup_dir ($) {
# If we're debugging, we may want to look at the contents...
return
if ($debug);
clear_dir($_[0]);
rmdir($_[0]);
}
# Retrieve a single line from a specified file
sub get_line ($) {
my ($fname) = @_;
open(FILE, "<$fname") || die "Cannot open file $fname for reading";
my $line = <FILE>;
close(FILE);
# Chomp off the \n
chomp $line;
return $line;
}
# Routine that only allows one value to be pushed on the array;
# implemented by making the first element of the array a hash-reference.
# When we add a new value, we also increment the count of an element in
# the hash with the key being the array value...
sub push_once (\@@) {
my ($array, @values) = @_;
# If the array is empty, create our hash ref
push @{$array}, {}
if (@{$array} == 0);
foreach my $value (@values) {
push @{$array}, $value
if (!exists($array->[0]{$value}));
$array->[0]{$value}++;
}
return @{$array} - 1;
}
# Filter //, /./, and remove leading ./ or / from filenames
sub fname_filter ($) {
my ($fname) = @_;
$fname =~ s,//,/,g;
$fname =~ s,/\./,/,g;
$fname =~ s,^\.?/,,g;
return $fname;
}
# Store file data in a temporary file
sub names_to_file ($$@) {
my ($fname, $dir, @names) = @_;
if (@names > 0) {
open(FILE, ">>$fname") || die "Cannot open file $fname for appending";
# Store the directory data
print FILE "D $dir\n";
foreach my $name (@names) {
# Mark record as a file...
print FILE "F ";
# Store the tag, if there is one...
print FILE "$name->{tag}"
if (defined($name->{tag}));
# Then store old revision, new revision, and file name
print FILE ":$name->{old}:$name->{new}:$name->{file}\n";
}
close(FILE);
}
}
# Retrieve file data from temporary file; updates branch tags with what it
# reads
sub file_to_names (\@$) {
my ($btags, $fname) = @_;
my ($dir) = (undef);
my (@names) = ();
debug "Reading file names from $fname...\n";
# We may not have, say, added a file in this subdirectory...
return ()
if (!-e $fname);
open(FILE, "<$fname");
while(<FILE>) {
chomp;
# Get record type...
my ($type, $data) = split(' ', $_, 2);
# ok, it's a directory, remember that...
if ($type eq "D") {
$dir = $data;
debug "Read directory $dir\n";
next;
}
debug "Read file $data\n";
# Get all the information about the file
my ($tag, $old, $new, $file) = split(':', $data);
# and store it all
push(@names, { tag => $tag, old => $old, new => $new, file => $file,
dir => $dir, name => fname_filter("$dir/$file") });
# Remember the tags...
push_once(@{$btags}, $tag)
if (defined($tag) && $tag ne "");
}
close(FILE);
return @names;
}
# Create a text-formatted list of names
sub name_to_list (\@@) {
my ($btags, @names) = @_;
my (@nlist, @nline) = ();
debug "Tags:", join(':', @{$btags}), "\n";
# We group them by tag
foreach my $tag ("", @{$btags}[1..$#{$btags}]) {
debug "Processing tag $tag...\n";
@nlist = ();
# Get a list of files by the tag...
foreach my $name (@names) {
debug "Processing $name->{file}...\n";
next
if ($name->{tag} ne $tag);
debug "Pushing $name->{name} on \@nlist...\n";
push(@nlist, $name->{name});
}
# If the tag is not the empty string, list the tag...
push(@nline, " Tag: $tag", " ")
if ($tag ne "");
# Now list each file name
foreach my $name (@nlist) {
# indent if we run past the end of line limit
push(@nline, " ")
if (@nline == 0 || ($nline[$#nline] ne " " &&
length($nline[$#nline]) + length($name) + 1 > 70));
# add the file name to the list
debug "Adding $name to \@nline...\n";
$nline[$#nline] .= " $name";
}
}
return @nline;
}
# write the log message to a temporary file
sub write_log ($@) {
my ($fname, @text) = @_;
open(FILE, ">$fname") || die "Cannot open file $fname for writing";
print FILE join("\n", @text), "\n";
close(FILE);
}
# Build the header of the commit message: CVSROOT, module name, any
# branch tags, and the commit time
sub build_header ($@) {
my ($module, $subject, $mailto, @branch_tags) = @_;
my (@text, @mailto);
my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = gmtime(time());
my ($user, $dummy);
my ($digest);
($user, $dummy, $dummy, $dummy, $dummy, $dummy, $dummy) = getpwuid($<);
@mailto = @{$mailto};
# generate a unique boundary by calculating the md5sum of the
# current time
$digest = new Digest::MD5;
$digest->reset();
$digest->add(time() . rand());
$boundary = "----=MIME." . unpack("H*", $digest->digest());
# Build the mail header
push(@text, 'From: [email protected]');
push(@text, "To: " . join(' ', @mailto));
push(@text, "Subject: $subject");
push(@text, "MIME-Version: 1.0");
push(@text, "Content-Type: multipart/mixed; boundary=\"$boundary\"");
push(@text, "");
push(@text, "This is a multipart message as defined by RFC2049 (MIME)");
push(@text, "");
push(@text, "--$boundary");
push(@text, "Content-Type: text/plain; charset=us-ascii");
push(@text, "Content-Disposition: inline");
push(@text, "");
# Build the commit message header
push(@text, "Commiter : $user");
push(@text, "CVSROOT : $ENV{CVSROOT}");
push(@text, "Module : $module");
push(@text, "Branch tags: " . join(' ', @branch_tags[1..$#branch_tags]))
if (@branch_tags > 0);
push(@text, sprintf("Commit time: %04d-%02d-%02d %02d:%02d:%02d UTC",
$year + 1900, $mon + 1, $mday, $hour, $min, $sec));
return @text, "";
}
# Send the mail message
sub send_mail {
my ($mailto, $text) = @_;
my (@mailto, @text);
# I <heart> perl
@mailto = @{$mailto};
@text = @{$text};
open(MAIL, "|$MAILER " . join(' ', @mailto));
push(@text, "--$boundary--", "");
print MAIL join("\n", @text), "\n";
close(MAIL);
}
# Find the tmp directory
my ($tmpdir) = (tmpdir());
my (@mailto) = ();
my (@files) = ();
my (@path) = ();
my ($modname, $repdir, $dir) = (undef, undef, undef);
# Process command line arguments
while (@ARGV > 0) {
my ($arg) = (shift(@ARGV));
if ($arg eq '-d') {
# Turn on debugging
$debug++;
} elsif ($arg eq '-M') {
# Module name explicitly set -- XXX Not tested, use at your own risk
die "Argument for -M missing"
unless (@ARGV > 0);
$modname = shift(@ARGV);
} elsif ($arg eq '-m') {
# An address to mail the notification to
die "Argument for -m missing"
unless (@ARGV > 0);
push(@mailto, shift(@ARGV));
} else {
# the list of filenames passed by CVS--you *must* use %{sVv}!
die "Too many arguments!"
unless (@files == 0);
@files = split(" ", $arg);
}
}
die "Nobody to mail to"
unless (@mailto > 0);
die "No files to process"
unless (@files > 1);
# The repository directory
$repdir = shift(@files);
# break it appart...
@path = split("/", $repdir);
# Now we know the module name, if it wasn't explicitly set
$modname = $path[0]
unless (defined($modname));
# Figure out what our directory is
if (@path == 1) {
$dir = ".";
} else {
$dir = join("/", @path[1..$#path]);
}
# append a / to it...
$dir .= "/";
debug "module = $modname\n";
debug "dir = $dir\n";
debug "path = ", join(":", @path), "\n";
debug "files = ", join(":", @files), "\n";
debug "tmpdir = $tmpdir\n";
my (%fversions);
# Unless its a new directory or imported sources, create file records
unless (defined($files[1]) && defined($files[2]) &&
(($files[1] eq "New" && $files[2] eq "directory") ||
($files[1] eq "Imported" && $files[2] eq "sources"))) {
foreach my $fname (@files) {
# You *must* use %{sVv} in the call in loginfo!
die "Invalid filenames"
unless ($fname =~ /^(.*),([0-9.]+|NONE),([0-9.]+|NONE)$/);
$fversions{$1} = {
old => ($2 eq "NONE" ? "0" : $2),
new => ($3 eq "NONE" ? "0" : $3),
};
}
}
# process log message
my ($state, $tag) = (STATE_NONE, undef);
my (@modified, @added, @removed, @log, @branch_tags) = ();
while (<STDIN>) {
chomp;
debug "State $state, line:$_\n";
# Ignore empty space at the beginning of the log message
next
if ($state == STATE_LOG1 && /^\s*$/);
# We're done ignoring empty space
if ($state == STATE_LOG1) {
$state = STATE_LOG2;
}
if ($state == STATE_LOG2) {
# Don't modify the lines at all if we're processing the log message
push(@log, $_);
next;
} else {
# Strip out leading and trailing space
s/^\s*(.*?)\s*$/$1/;
}
if (/^Modified Files/) {
# Collect list of modified files
debug "State switching to STATE_MODIFIED\n";
$state = STATE_MODIFIED;
$tag = undef;
next;
} elsif (/^Added Files/) {
# Collect list of added files
debug "State switching to STATE_ADDED\n";
$state = STATE_ADDED;
$tag = undef;
next;
} elsif (/^Removed Files/) {
# Collect list of removed files
debug "State switching to STATE_REMOVED\n";
$state = STATE_REMOVED;
$tag = undef;
next;
} elsif (/^Log Message/) {
# Collect log message
debug "State switching to STATE_LOG1\n";
$state = STATE_LOG1;
$tag = undef;
next;
} elsif (/^Revision\/Branch/) {
# Parse old-style Revision/Branch field
debug "Found a branch tag\n";
/^[^:]+:\s*(.*)/;
push_once(@branch_tags, $1);
warn "Tag == $tag"
if (defined($tag));
next;
}
# Ignore the stuff at the top of the commit report
next
if ($state == STATE_NONE);
if (/^Tag:\s*(.*)$/) {
# Remember the tag
debug "Setting tag to $1\n";
$tag = $1;
next;
}
my (@tfiles) = ();
# Find the file in our command line list of files
foreach my $file (split) {
die "Nothing known about file $file!"
unless (exists($fversions{$file}));
push @tfiles, {
file => $file,
tag => $tag,
old => $fversions{$file}{old},
new => $fversions{$file}{new},
};
}
# Store the file list in the correct array
push(@modified, @tfiles)
if ($state == STATE_MODIFIED);
push(@added, @tfiles)
if ($state == STATE_ADDED);
push(@removed, @tfiles)
if ($state == STATE_REMOVED);
}
# Remove trailing blank lines from the log message
while (@log > 0 && $log[$#log] =~ /^\s*$/) {
pop(@log);
}
# If a new directory was added, we're done...
if (defined($files[1]) && defined($files[2]) &&
$files[1] eq "New" && $files[2] eq "directory") {
my (@text) = ();
# If there was a sticky tag for the directory, make it a branch tag
if ($log[$#log] =~ /^--> Using per-directory sticky tag \`(.*)\'$/) {
push_once(@branch_tags, $1);
pop(@log);
}
# Build the message...
push(@text, build_header($modname, "Module $modname: New directory $dir",
\@mailto, @branch_tags));
push(@text, "Log message:", "", @log);
# and send it (synchronously)
send_mail(\@mailto, \@text);
# Clean up after ourselves and exit.
cleanup_dir($tmpdir);
exit(0);
}
# If an import was done, we're done...
if (defined($files[1]) && defined($files[2]) &&
$files[1] eq "Imported" && $files[2] eq "sources") {
my (@text) = ();
# Build the message...
push(@text, build_header($modname, "Module $modname: Imported $dir",
\@mailto, @branch_tags));
push(@text, "Log message:", "", @log);
# and send it (synchronously)
send_mail(\@mailto, \@text);
# Clean up after ourselves and exit.
cleanup_dir($tmpdir);
exit(0);
}
debug "Searching for log file index...";
my ($i);
# Look for an empty log file or one that matches our current log message
for ($i = 0; ; $i++) {
my (@text);
# found one that doesn't exist...
last
if (!-e "$tmpdir/logfile.$i");
# read in the log file
open(FILE, "<$tmpdir/logfile.$i");
while (<FILE>) {
chomp;
push(@text, $_);
}
close(FILE);
# If the log file was empty, use it
last
if (@text == 0);
# If the log messages are identical, use that
last
if (join(' ', @log) eq join(' ', @text));
}
debug "$tmpdir/logfile.$i\n";
# Store modified, added, and removed file lists, along with the log message
names_to_file("$tmpdir/modified.$i", $dir, @modified);
names_to_file("$tmpdir/added.$i", $dir, @added);
names_to_file("$tmpdir/removed.$i", $dir, @removed);
write_log("$tmpdir/logfile.$i", @log);
# Now check to see if we're at the end of our rope
my ($lastdir) = (get_line("$tmpdir/lastdir"));
debug "Checking $ENV{CVSROOT}/$repdir against lastdir $lastdir\n";
# Nope, exit instead of sending a message
exit(0)
if ($lastdir ne "$ENV{CVSROOT}/$repdir");
debug "At last, we've reached the end\n";
# We have to daemonize and sleep so that there isn't any lock hanging
# around when we get to the cvs rdiff below...
daemonize();
sleep(10);
# Build the mail message...
my (@text) = ();
@files = ();
@branch_tags = ();
for ($i = 0; ; $i++) {
# No more log files
last
if (!-e "$tmpdir/logfile.$i");
# read and insert the log message
open(FILE, "<$tmpdir/logfile.$i");
push(@text, "Log message:", "");
while (<FILE>) {
chomp;
push(@text, $_);
}
push(@text, "");
close(FILE);
# read modified list and list all modified files if non-empty
@modified = file_to_names(@branch_tags, "$tmpdir/modified.$i");
push(@text, "Modified files:", name_to_list(@branch_tags, @modified), "")
if (@modified > 0);
# read added list and list all added files if non-empty
@added = file_to_names(@branch_tags, "$tmpdir/added.$i");
push(@text, "Added files:", name_to_list(@branch_tags, @added), "")
if (@added > 0);
# read removed list and list all removed files if non-empty
@removed = file_to_names(@branch_tags, "$tmpdir/removed.$i");
push(@text, "Removed files:", name_to_list(@branch_tags, @removed), "")
if (@removed > 0);
# remember all the files we looked at
push(@files, @modified, @added, @removed);
}
# Now that name_to_list has rebuilt our list of branch tags, we can build the
# header and prepend it to the message
unshift(@text, build_header($modname, "Module $modname: Change committed",
\@mailto, @branch_tags));
# sort the files out for our diff
@files = sort { $a->{name} cmp $b->{name} } @files;
my ($user, $filename);
my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = gmtime(time());
$user = getpwuid($<);
$filename = sprintf("%s.%04d%02d%02d.%02d%02d%02d.%s.diff", $modname,
$year + 1900, $mon + 1, $mday, $hour, $min, $sec, $user);
push(@text, "--$boundary");
push(@text, "Content-Type: text/plain; name=\"$filename\"");
push(@text, "Content-Disposition: attachment; filename=\"$filename\"");
push(@text, "Content-Transfer-Encoding: 8bit");
push(@text, "");
foreach my $file (@files) {
debug "Diffing file $file->{name}...\n";
# Run cvs rdiff, extracting a diff between the old version and the new
open(DIFF, "$CVS -Q rdiff -u -r $file->{old} -r $file->{new} " .
"$modname/$file->{name}|");
while (<DIFF>) {
chomp;
push(@text, $_);
}
close(DIFF);
}
# send the mail...
send_mail(\@mailto, \@text);
# and clean up after ourselves
cleanup_dir($tmpdir);
+12
View File
@@ -0,0 +1,12 @@
# The "notify" file controls where notifications from watches set by
# "cvs watch add" or "cvs edit" are sent. The first entry on a line is
# a regular expression which is tested against the directory that the
# change is being made to, relative to the $CVSROOT. If it matches,
# then the remainder of the line is a filter program that should contain
# one occurrence of %s for the user to notify, and information on its
# standard input.
#
# "ALL" or "DEFAULT" can be used in place of the regular expression.
#
# For example:
#ALL mail %s -s "CVS notification"
+19
View File
@@ -0,0 +1,19 @@
drevil:f76FWdDTUBG5c:fs2source
mysterial:f7nJUwoIhmSrg:fs2source
wmcoolmon:f7JRB.js9Q1sE:fs2source
inquisitor:f7BVkOvwjDlWk:fs2source
penguin:Jh.dOjaiO2jHk:fs2source
DTP:f7M92Z/6/uep.:fs2source
unknownplayer:f79BgAn.IzJs6:fs2source
phreak:f7WQyGiT/jzlM:fs2source
randomtiger:f7Way/xL9ic7o:fs2source
righteous1:f7fpcXiE0Ubao:fs2source
bobboau:f7jChSbXOIdWY:fs2source
sesquipedalian:f75AcAOV6TM6Q:fs2source
daveb:f7f2mVbMvbe.6:fs2source
Goober5000:f7Fc.gHzyrOL2:fs2source
dkharrat:f7odljbD5tm5k:fs2source
EdrickV:f7cDahmEbbAlg:fs2source
OldMan:f7N4NyUG5Ommw:fs2source
komet:f7fyoBN5r.m76:fs2source
anonymous:oIKtWP1q6GDt6:fs2source
+13
View File
@@ -0,0 +1,13 @@
# The "rcsinfo" file is used to control templates with which the editor
# is invoked on commit and import.
#
# The first entry on a line is a regular expression which is tested
# against the directory that the change is being made to, relative to the
# $CVSROOT. For the first match that is found, then the remainder of the
# line is the name of the file that contains the template.
#
# If the repository name does not match any of the regular expressions in this
# file, the "DEFAULT" line is used, if it is specified.
#
# If the name "ALL" appears as a regular expression it is always used
# in addition to the first matching regex or "DEFAULT".
+20
View File
@@ -0,0 +1,20 @@
# The "taginfo" file is used to control pre-tag checks.
# The filter on the right is invoked with the following arguments:
#
# $1 -- tagname
# $2 -- operation "add" for tag, "mov" for tag -F, and "del" for tag -d
# $3 -- repository
# $4-> file revision [file revision ...]
#
# A non-zero exit of the filter program will cause the tag to be aborted.
#
# The first entry on a line is a regular expression which is tested
# against the directory that the change is being committed to, relative
# to the $CVSROOT. For the first match that is found, then the remainder
# of the line is the name of the filter to run.
#
# If the repository name does not match any of the regular expressions in this
# file, the "DEFAULT" line is used, if it is specified.
#
# If the name "ALL" appears as a regular expression it is always used
# in addition to the first matching regex or "DEFAULT".
+21
View File
@@ -0,0 +1,21 @@
# The "verifymsg" file is used to allow verification of logging
# information. It works best when a template (as specified in the
# rcsinfo file) is provided for the logging procedure. Given a
# template with locations for, a bug-id number, a list of people who
# reviewed the code before it can be checked in, and an external
# process to catalog the differences that were code reviewed, the
# following test can be applied to the code:
#
# Making sure that the entered bug-id number is correct.
# Validating that the code that was reviewed is indeed the code being
# checked in (using the bug-id number or a seperate review
# number to identify this particular code set.).
#
# If any of the above test failed, then the commit would be aborted.
#
# Actions such as mailing a copy of the report to each reviewer are
# better handled by an entry in the loginfo file.
#
# One thing that should be noted is the the ALL keyword is not
# supported. There can be only one entry that matches a given
# repository.
+18
View File
@@ -0,0 +1,18 @@
drevil
inquisitor
mysterial
DTP
randomtiger
wmcoolmon
unknownplayer
phreak
bobboau
righteous1
sesquipedalian
Goober5000
dkharrat
daveb
EdrickV
OldMan
komet
penguin
-77
View File
@@ -1,77 +0,0 @@
# Makefile.am for fs2_open (top level)
#
# This file uses GNU Automake to generate makefiles
SUBDIRS = libjpeg lua code
EXTRA_DIST = \
FS2OpenSCPReadMe.doc \
projects/MSVC_2005/Freespace2.sln \
projects/MSVC_2005/Freespace2.vcproj \
projects/MSVC_2005/code.vcproj \
projects/MSVC_6/Fred2.dsp \
projects/MSVC_6/Freespace2.dsp \
projects/MSVC_6/Freespace2.dsw \
projects/MSVC_6/code.dsp \
projects/MSVC_6/libjpeg.dsp \
projects/MSVC_6/liblua.dsp \
projects/MSVC_6/wxFRED2.dsp \
projects/Xcode/English.lproj/InfoPlist.strings \
projects/Xcode/FS2_Open.icns \
projects/Xcode/FS2_Open.xcodeproj/project.pbxproj \
projects/Xcode/Frameworks.tgz \
projects/Xcode/Info-debug.plist \
projects/Xcode/Info.plist \
projects/Xcode/README.Xcode \
projects/Xcode/SDLMain.h \
projects/Xcode/SDLMain.m
# D_ variants are defaults and should always be used
AM_CXXFLAGS = -I./code @D_CFLAGS@
AM_LDFLAGS = @D_LDFLAGS@
EXTRA_PROGRAMS = cfilearchiver cfileextractor cryptstring scramble
###############################################################################
##
## Begin utilitites
##
# cfilearchiver -- to create VPs
cfilearchiver_SOURCES = \
code/cfilearchiver/cfilearchiver.cpp
# cfileextractor -- to extract files from VPs
cfileextractor_SOURCES = \
code/cfileextractor/cfileextractor.cpp
# cryptstring -- to encrypt strings that are used as cheat codes
cryptstring_SOURCES = \
code/cryptstring/cryptstring.cpp
# scramble -- to encrypt tables
scramble_SOURCES = \
code/parse/encrypt.cpp \
code/scramble/scramble.cpp \
code/scramble/scramble.h
# catch all to build utilitites
tools: cfilearchiver cfileextractor cryptstring scramble
# cleaning
clean-tools:
-test -z "$(EXTRA_PROGRAMS)" || rm -f $(EXTRA_PROGRAMS)
##
## End utilitites
##
###############################################################################
# make sure we get this stuff cleaned up
clean-generic: clean-tools
-8
View File
@@ -1,8 +0,0 @@
The "projects" directory contains ready projects for:
Microsoft Visual C++ 6
Microsoft Visual C++ 2005
Anjuta 1 (please see README with project before using)
See the ChangeLog to see what's new.
See the INSTALL file for instructions on how to build fs2_open.
-714
View File
@@ -1,714 +0,0 @@
# Configure paths for SDL
# Sam Lantinga 9/21/99
# stolen from Manish Singh
# stolen back from Frank Belew
# stolen from Manish Singh
# Shamelessly stolen from Owen Taylor
dnl AM_PATH_SDL([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
dnl Test for SDL, and define SDL_CFLAGS and SDL_LIBS
dnl
AC_DEFUN([AM_PATH_SDL],
[dnl
dnl Get the cflags and libraries from the sdl-config script
dnl
AC_ARG_WITH(sdl-prefix,[ --with-sdl-prefix=PFX Prefix where SDL is installed (optional)],
sdl_prefix="$withval", sdl_prefix="")
AC_ARG_WITH(sdl-exec-prefix,[ --with-sdl-exec-prefix=PFX Exec prefix where SDL is installed (optional)],
sdl_exec_prefix="$withval", sdl_exec_prefix="")
AC_ARG_ENABLE(sdltest, [ --disable-sdltest Do not try to compile and run a test SDL program],
, enable_sdltest=yes)
if test x$sdl_exec_prefix != x ; then
sdl_args="$sdl_args --exec-prefix=$sdl_exec_prefix"
if test x${SDL_CONFIG+set} != xset ; then
SDL_CONFIG=$sdl_exec_prefix/bin/sdl-config
fi
fi
if test x$sdl_prefix != x ; then
sdl_args="$sdl_args --prefix=$sdl_prefix"
if test x${SDL_CONFIG+set} != xset ; then
SDL_CONFIG=$sdl_prefix/bin/sdl-config
fi
fi
AC_REQUIRE([AC_CANONICAL_TARGET])
PATH="$prefix/bin:$prefix/usr/bin:$PATH"
AC_PATH_PROG(SDL_CONFIG, sdl-config, no, [$PATH])
min_sdl_version=ifelse([$1], ,0.11.0,$1)
AC_MSG_CHECKING(for SDL - version >= $min_sdl_version)
no_sdl=""
if test "$SDL_CONFIG" = "no" ; then
no_sdl=yes
else
SDL_CFLAGS=`$SDL_CONFIG $sdlconf_args --cflags`
SDL_LIBS=`$SDL_CONFIG $sdlconf_args --libs`
sdl_major_version=`$SDL_CONFIG $sdl_args --version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
sdl_minor_version=`$SDL_CONFIG $sdl_args --version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
sdl_micro_version=`$SDL_CONFIG $sdl_config_args --version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
if test "x$enable_sdltest" = "xyes" ; then
ac_save_CFLAGS="$CFLAGS"
ac_save_CXXFLAGS="$CXXFLAGS"
ac_save_LIBS="$LIBS"
CFLAGS="$CFLAGS $SDL_CFLAGS"
CXXFLAGS="$CXXFLAGS $SDL_CFLAGS"
LIBS="$LIBS $SDL_LIBS"
dnl
dnl Now check if the installed SDL is sufficiently new. (Also sanity
dnl checks the results of sdl-config to some extent
dnl
rm -f conf.sdltest
AC_TRY_RUN([
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "SDL.h"
char*
my_strdup (char *str)
{
char *new_str;
if (str)
{
new_str = (char *)malloc ((strlen (str) + 1) * sizeof(char));
strcpy (new_str, str);
}
else
new_str = NULL;
return new_str;
}
int main (int argc, char *argv[])
{
int major, minor, micro;
char *tmp_version;
/* This hangs on some systems (?)
system ("touch conf.sdltest");
*/
{ FILE *fp = fopen("conf.sdltest", "a"); if ( fp ) fclose(fp); }
/* HP/UX 9 (%@#!) writes to sscanf strings */
tmp_version = my_strdup("$min_sdl_version");
if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
printf("%s, bad version string\n", "$min_sdl_version");
exit(1);
}
if (($sdl_major_version > major) ||
(($sdl_major_version == major) && ($sdl_minor_version > minor)) ||
(($sdl_major_version == major) && ($sdl_minor_version == minor) && ($sdl_micro_version >= micro)))
{
return 0;
}
else
{
printf("\n*** 'sdl-config --version' returned %d.%d.%d, but the minimum version\n", $sdl_major_version, $sdl_minor_version, $sdl_micro_version);
printf("*** of SDL required is %d.%d.%d. If sdl-config is correct, then it is\n", major, minor, micro);
printf("*** best to upgrade to the required version.\n");
printf("*** If sdl-config was wrong, set the environment variable SDL_CONFIG\n");
printf("*** to point to the correct copy of sdl-config, and remove the file\n");
printf("*** config.cache before re-running configure\n");
return 1;
}
}
],, no_sdl=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
CFLAGS="$ac_save_CFLAGS"
CXXFLAGS="$ac_save_CXXFLAGS"
LIBS="$ac_save_LIBS"
fi
fi
if test "x$no_sdl" = x ; then
AC_MSG_RESULT(yes)
ifelse([$2], , :, [$2])
else
AC_MSG_RESULT(no)
if test "$SDL_CONFIG" = "no" ; then
echo "*** The sdl-config script installed by SDL could not be found"
echo "*** If SDL was installed in PREFIX, make sure PREFIX/bin is in"
echo "*** your path, or set the SDL_CONFIG environment variable to the"
echo "*** full path to sdl-config."
else
if test -f conf.sdltest ; then
:
else
echo "*** Could not run SDL test program, checking why..."
CFLAGS="$CFLAGS $SDL_CFLAGS"
CXXFLAGS="$CXXFLAGS $SDL_CFLAGS"
LIBS="$LIBS $SDL_LIBS"
AC_TRY_LINK([
#include <stdio.h>
#include "SDL.h"
int main(int argc, char *argv[])
{ return 0; }
#undef main
#define main K_and_R_C_main
], [ return 0; ],
[ echo "*** The test program compiled, but did not run. This usually means"
echo "*** that the run-time linker is not finding SDL or finding the wrong"
echo "*** version of SDL. If it is not finding SDL, you'll need to set your"
echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
echo "*** to the installed location Also, make sure you have run ldconfig if that"
echo "*** is required on your system"
echo "***"
echo "*** If you have an old version installed, it is best to remove it, although"
echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
[ echo "*** The test program failed to compile or link. See the file config.log for the"
echo "*** exact error that occured. This usually means SDL was incorrectly installed"
echo "*** or that you have moved SDL since it was installed. In the latter case, you"
echo "*** may want to edit the sdl-config script: $SDL_CONFIG" ])
CFLAGS="$ac_save_CFLAGS"
CXXFLAGS="$ac_save_CXXFLAGS"
LIBS="$ac_save_LIBS"
fi
fi
SDL_CFLAGS=""
SDL_LIBS=""
ifelse([$3], , :, [$3])
fi
AC_SUBST(SDL_CFLAGS)
AC_SUBST(SDL_LIBS)
rm -f conf.sdltest
])
dnl ---------------------------------------------------------------------------
dnl Macros for wxWindows detection. Typically used in configure.in as:
dnl
dnl AC_ARG_ENABLE(...)
dnl AC_ARG_WITH(...)
dnl ...
dnl AM_OPTIONS_WXCONFIG
dnl ...
dnl ...
dnl AM_PATH_WXCONFIG(2.3.4, wxWin=1)
dnl if test "$wxWin" != 1; then
dnl AC_MSG_ERROR([
dnl wxWindows must be installed on your system
dnl but wx-config script couldn't be found.
dnl
dnl Please check that wx-config is in path, the directory
dnl where wxWindows libraries are installed (returned by
dnl 'wx-config --libs' command) is in LD_LIBRARY_PATH or
dnl equivalent variable and wxWindows version is 2.3.4 or above.
dnl ])
dnl fi
dnl CPPFLAGS="$CPPFLAGS $WX_CPPFLAGS"
dnl CXXFLAGS="$CXXFLAGS $WX_CXXFLAGS_ONLY"
dnl CFLAGS="$CFLAGS $WX_CFLAGS_ONLY"
dnl
dnl LDFLAGS="$LDFLAGS $WX_LIBS"
dnl ---------------------------------------------------------------------------
dnl ---------------------------------------------------------------------------
dnl AM_OPTIONS_WXCONFIG
dnl
dnl adds support for --wx-prefix, --wx-exec-prefix and --wx-config
dnl command line options
dnl ---------------------------------------------------------------------------
AC_DEFUN([AM_OPTIONS_WXCONFIG],
[
AC_ARG_WITH(wx-prefix, [ --with-wx-prefix=PREFIX Prefix where wxWindows is installed (optional)],
wx_config_prefix="$withval", wx_config_prefix="")
AC_ARG_WITH(wx-exec-prefix,[ --with-wx-exec-prefix=PREFIX Exec prefix where wxWindows is installed (optional)],
wx_config_exec_prefix="$withval", wx_config_exec_prefix="")
AC_ARG_WITH(wx-config,[ --with-wx-config=CONFIG wx-config script to use (optional)],
wx_config_name="$withval", wx_config_name="")
])
dnl ---------------------------------------------------------------------------
dnl AM_PATH_WXCONFIG(VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
dnl
dnl Test for wxWindows, and define WX_C*FLAGS, WX_LIBS and WX_LIBS_STATIC
dnl (the latter is for static linking against wxWindows). Set WX_CONFIG_NAME
dnl environment variable to override the default name of the wx-config script
dnl to use. Set WX_CONFIG_PATH to specify the full path to wx-config - in this
dnl case the macro won't even waste time on tests for its existence.
dnl ---------------------------------------------------------------------------
dnl
dnl Get the cflags and libraries from the wx-config script
dnl
AC_DEFUN([AM_PATH_WXCONFIG],
[
dnl do we have wx-config name: it can be wx-config or wxd-config or ...
if test x${WX_CONFIG_NAME+set} != xset ; then
WX_CONFIG_NAME=wx-config
fi
if test "x$wx_config_name" != x ; then
WX_CONFIG_NAME="$wx_config_name"
fi
dnl deal with optional prefixes
if test x$wx_config_exec_prefix != x ; then
wx_config_args="$wx_config_args --exec-prefix=$wx_config_exec_prefix"
WX_LOOKUP_PATH="$wx_config_exec_prefix/bin"
fi
if test x$wx_config_prefix != x ; then
wx_config_args="$wx_config_args --prefix=$wx_config_prefix"
WX_LOOKUP_PATH="$WX_LOOKUP_PATH:$wx_config_prefix/bin"
fi
dnl don't search the PATH if WX_CONFIG_NAME is absolute filename
if test -x "$WX_CONFIG_NAME" ; then
AC_MSG_CHECKING(for wx-config)
WX_CONFIG_PATH="$WX_CONFIG_NAME"
AC_MSG_RESULT($WX_CONFIG_PATH)
else
AC_PATH_PROG(WX_CONFIG_PATH, $WX_CONFIG_NAME, no, "$WX_LOOKUP_PATH:$PATH")
fi
if test "$WX_CONFIG_PATH" != "no" ; then
WX_VERSION=""
no_wx=""
min_wx_version=ifelse([$1], ,2.2.1,$1)
AC_MSG_CHECKING(for wxWindows version >= $min_wx_version)
WX_CONFIG_WITH_ARGS="$WX_CONFIG_PATH $wx_config_args"
WX_VERSION=`$WX_CONFIG_WITH_ARGS --version`
wx_config_major_version=`echo $WX_VERSION | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
wx_config_minor_version=`echo $WX_VERSION | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
wx_config_micro_version=`echo $WX_VERSION | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
wx_requested_major_version=`echo $min_wx_version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
wx_requested_minor_version=`echo $min_wx_version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
wx_requested_micro_version=`echo $min_wx_version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
wx_ver_ok=""
if test $wx_config_major_version -gt $wx_requested_major_version; then
wx_ver_ok=yes
else
if test $wx_config_major_version -eq $wx_requested_major_version; then
if test $wx_config_minor_version -gt $wx_requested_minor_version; then
wx_ver_ok=yes
else
if test $wx_config_minor_version -eq $wx_requested_minor_version; then
if test $wx_config_micro_version -ge $wx_requested_micro_version; then
wx_ver_ok=yes
fi
fi
fi
fi
fi
if test "x$wx_ver_ok" = x ; then
no_wx=yes
else
WX_LIBS=`$WX_CONFIG_WITH_ARGS --libs`
WX_LIBS_STATIC=`$WX_CONFIG_WITH_ARGS --static --libs`
dnl starting with version 2.2.6 wx-config has --cppflags argument
wx_has_cppflags=""
if test $wx_config_major_version -gt 2; then
wx_has_cppflags=yes
else
if test $wx_config_major_version -eq 2; then
if test $wx_config_minor_version -gt 2; then
wx_has_cppflags=yes
else
if test $wx_config_minor_version -eq 2; then
if test $wx_config_micro_version -ge 6; then
wx_has_cppflags=yes
fi
fi
fi
fi
fi
if test "x$wx_has_cppflags" = x ; then
dnl no choice but to define all flags like CFLAGS
WX_CFLAGS=`$WX_CONFIG_WITH_ARGS --cflags`
WX_CPPFLAGS=$WX_CFLAGS
WX_CXXFLAGS=$WX_CFLAGS
WX_CFLAGS_ONLY=$WX_CFLAGS
WX_CXXFLAGS_ONLY=$WX_CFLAGS
else
dnl we have CPPFLAGS included in CFLAGS included in CXXFLAGS
WX_CPPFLAGS=`$WX_CONFIG_WITH_ARGS --cppflags`
WX_CXXFLAGS=`$WX_CONFIG_WITH_ARGS --cxxflags`
WX_CFLAGS=`$WX_CONFIG_WITH_ARGS --cflags`
WX_CFLAGS_ONLY=`echo $WX_CFLAGS | sed "s@^$WX_CPPFLAGS *@@"`
WX_CXXFLAGS_ONLY=`echo $WX_CXXFLAGS | sed "s@^$WX_CFLAGS *@@"`
fi
fi
if test "x$no_wx" = x ; then
AC_MSG_RESULT(yes (version $WX_VERSION))
ifelse([$2], , :, [$2])
else
if test "x$WX_VERSION" = x; then
dnl no wx-config at all
AC_MSG_RESULT(no)
else
AC_MSG_RESULT(no (version $WX_VERSION is not new enough))
fi
WX_CFLAGS=""
WX_CPPFLAGS=""
WX_CXXFLAGS=""
WX_LIBS=""
WX_LIBS_STATIC=""
ifelse([$3], , :, [$3])
fi
fi
AC_SUBST(WX_CPPFLAGS)
AC_SUBST(WX_CFLAGS)
AC_SUBST(WX_CXXFLAGS)
AC_SUBST(WX_CFLAGS_ONLY)
AC_SUBST(WX_CXXFLAGS_ONLY)
AC_SUBST(WX_LIBS)
AC_SUBST(WX_LIBS_STATIC)
AC_SUBST(WX_VERSION)
])
# Configure paths for libogg
# Jack Moffitt <[email protected]> 10-21-2000
# Shamelessly stolen from Owen Taylor and Manish Singh
dnl XIPH_PATH_OGG([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
dnl Test for libogg, and define OGG_CFLAGS and OGG_LIBS
dnl
AC_DEFUN([XIPH_PATH_OGG],
[dnl
dnl Get the cflags and libraries
dnl
AC_ARG_WITH(ogg,[ --with-ogg=PFX Prefix where libogg is installed (optional)], ogg_prefix="$withval", ogg_prefix="")
AC_ARG_WITH(ogg-libraries,[ --with-ogg-libraries=DIR Directory where libogg library is installed (optional)], ogg_libraries="$withval", ogg_libraries="")
AC_ARG_WITH(ogg-includes,[ --with-ogg-includes=DIR Directory where libogg header files are installed (optional)], ogg_includes="$withval", ogg_includes="")
AC_ARG_ENABLE(oggtest, [ --disable-oggtest Do not try to compile and run a test Ogg program],, enable_oggtest=yes)
if test "x$ogg_libraries" != "x" ; then
OGG_LIBS="-L$ogg_libraries"
elif test "x$ogg_prefix" != "x" ; then
OGG_LIBS="-L$ogg_prefix/lib"
elif test "x$prefix" != "xNONE" ; then
OGG_LIBS="-L$libdir"
fi
OGG_LIBS="$OGG_LIBS -logg"
if test "x$ogg_includes" != "x" ; then
OGG_CFLAGS="-I$ogg_includes"
elif test "x$ogg_prefix" != "x" ; then
OGG_CFLAGS="-I$ogg_prefix/include"
elif test "x$prefix" != "xNONE"; then
OGG_CFLAGS=""
fi
AC_MSG_CHECKING(for Ogg)
no_ogg=""
if test "x$enable_oggtest" = "xyes" ; then
ac_save_CFLAGS="$CFLAGS"
ac_save_LIBS="$LIBS"
CFLAGS="$CFLAGS $OGG_CFLAGS"
LIBS="$LIBS $OGG_LIBS"
dnl
dnl Now check if the installed Ogg is sufficiently new.
dnl
rm -f conf.oggtest
AC_TRY_RUN([
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ogg/ogg.h>
int main ()
{
system("touch conf.oggtest");
return 0;
}
],, no_ogg=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
CFLAGS="$ac_save_CFLAGS"
LIBS="$ac_save_LIBS"
fi
if test "x$no_ogg" = "x" ; then
AC_MSG_RESULT(yes)
ifelse([$1], , :, [$1])
else
AC_MSG_RESULT(no)
if test -f conf.oggtest ; then
:
else
echo "*** Could not run Ogg test program, checking why..."
CFLAGS="$CFLAGS $OGG_CFLAGS"
LIBS="$LIBS $OGG_LIBS"
AC_TRY_LINK([
#include <stdio.h>
#include <ogg/ogg.h>
], [ return 0; ],
[ echo "*** The test program compiled, but did not run. This usually means"
echo "*** that the run-time linker is not finding Ogg or finding the wrong"
echo "*** version of Ogg. If it is not finding Ogg, you'll need to set your"
echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
echo "*** to the installed location Also, make sure you have run ldconfig if that"
echo "*** is required on your system"
echo "***"
echo "*** If you have an old version installed, it is best to remove it, although"
echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
[ echo "*** The test program failed to compile or link. See the file config.log for the"
echo "*** exact error that occured. This usually means Ogg was incorrectly installed"
echo "*** or that you have moved Ogg since it was installed." ])
CFLAGS="$ac_save_CFLAGS"
LIBS="$ac_save_LIBS"
fi
OGG_CFLAGS=""
OGG_LIBS=""
ifelse([$2], , :, [$2])
fi
AC_SUBST(OGG_CFLAGS)
AC_SUBST(OGG_LIBS)
rm -f conf.oggtest
])
# Configure paths for libvorbis
# Jack Moffitt <[email protected]> 10-21-2000
# Shamelessly stolen from Owen Taylor and Manish Singh
# thomasvs added check for vorbis_bitrate_addblock which is new in rc3
dnl XIPH_PATH_VORBIS([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
dnl Test for libvorbis, and define VORBIS_CFLAGS and VORBIS_LIBS
dnl
AC_DEFUN([XIPH_PATH_VORBIS],
[dnl
dnl Get the cflags and libraries
dnl
AC_ARG_WITH(vorbis,[ --with-vorbis=PFX Prefix where libvorbis is installed (optional)], vorbis_prefix="$withval", vorbis_prefix="")
AC_ARG_WITH(vorbis-libraries,[ --with-vorbis-libraries=DIR Directory where libvorbis library is installed (optional)], vorbis_libraries="$withval", vorbis_libraries="")
AC_ARG_WITH(vorbis-includes,[ --with-vorbis-includes=DIR Directory where libvorbis header files are installed (optional)], vorbis_includes="$withval", vorbis_includes="")
AC_ARG_ENABLE(vorbistest, [ --disable-vorbistest Do not try to compile and run a test Vorbis program],, enable_vorbistest=yes)
if test "x$vorbis_libraries" != "x" ; then
VORBIS_LIBS="-L$vorbis_libraries"
elif test "x$vorbis_prefix" != "x" ; then
VORBIS_LIBS="-L$vorbis_prefix/lib"
elif test "x$prefix" != "xNONE"; then
VORBIS_LIBS="-L$libdir"
fi
VORBIS_LIBS="$VORBIS_LIBS -lvorbis -lm"
VORBISFILE_LIBS="-lvorbisfile"
VORBISENC_LIBS="-lvorbisenc"
if test "x$vorbis_includes" != "x" ; then
VORBIS_CFLAGS="-I$vorbis_includes"
elif test "x$vorbis_prefix" != "x" ; then
VORBIS_CFLAGS="-I$vorbis_prefix/include"
elif test "x$prefix" != "xNONE"; then
VORBIS_CFLAGS=""
fi
AC_MSG_CHECKING(for Vorbis)
no_vorbis=""
if test "x$enable_vorbistest" = "xyes" ; then
ac_save_CFLAGS="$CFLAGS"
ac_save_LIBS="$LIBS"
CFLAGS="$CFLAGS $VORBIS_CFLAGS $OGG_CFLAGS"
LIBS="$LIBS $VORBIS_LIBS $VORBISENC_LIBS $OGG_LIBS"
dnl
dnl Now check if the installed Vorbis is sufficiently new.
dnl
rm -f conf.vorbistest
AC_TRY_RUN([
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <vorbis/codec.h>
#include <vorbis/vorbisenc.h>
int main ()
{
vorbis_block vb;
vorbis_dsp_state vd;
vorbis_info vi;
vorbis_info_init (&vi);
vorbis_encode_init (&vi, 2, 44100, -1, 128000, -1);
vorbis_analysis_init (&vd, &vi);
vorbis_block_init (&vd, &vb);
/* this function was added in 1.0rc3, so this is what we're testing for */
vorbis_bitrate_addblock (&vb);
system("touch conf.vorbistest");
return 0;
}
],, no_vorbis=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
CFLAGS="$ac_save_CFLAGS"
LIBS="$ac_save_LIBS"
fi
if test "x$no_vorbis" = "x" ; then
AC_MSG_RESULT(yes)
ifelse([$1], , :, [$1])
else
AC_MSG_RESULT(no)
if test -f conf.vorbistest ; then
:
else
echo "*** Could not run Vorbis test program, checking why..."
CFLAGS="$CFLAGS $VORBIS_CFLAGS"
LIBS="$LIBS $VORBIS_LIBS $OGG_LIBS"
AC_TRY_LINK([
#include <stdio.h>
#include <vorbis/codec.h>
], [ return 0; ],
[ echo "*** The test program compiled, but did not run. This usually means"
echo "*** that the run-time linker is not finding Vorbis or finding the wrong"
echo "*** version of Vorbis. If it is not finding Vorbis, you'll need to set your"
echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
echo "*** to the installed location Also, make sure you have run ldconfig if that"
echo "*** is required on your system"
echo "***"
echo "*** If you have an old version installed, it is best to remove it, although"
echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
[ echo "*** The test program failed to compile or link. See the file config.log for the"
echo "*** exact error that occured. This usually means Vorbis was incorrectly installed"
echo "*** or that you have moved Vorbis since it was installed." ])
CFLAGS="$ac_save_CFLAGS"
LIBS="$ac_save_LIBS"
fi
VORBIS_CFLAGS=""
VORBIS_LIBS=""
VORBISFILE_LIBS=""
VORBISENC_LIBS=""
ifelse([$2], , :, [$2])
fi
AC_SUBST(VORBIS_CFLAGS)
AC_SUBST(VORBIS_LIBS)
AC_SUBST(VORBISFILE_LIBS)
AC_SUBST(VORBISENC_LIBS)
rm -f conf.vorbistest
])
dnl XIPH_PATH_THEORA([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
dnl Test for libtheora, and define THEORA_CFLAGS and THEORA_LIBS
dnl
AC_DEFUN([XIPH_PATH_THEORA],
[dnl
dnl Get the cflags and libraries
dnl
AC_ARG_WITH(theora,[ --with-theora=PFX Prefix where libtheora is installed (optional)], theora_prefix="$withval", theora_prefix="")
AC_ARG_WITH(theora-libraries,[ --with-theora-libraries=DIR Directory where libtheora library is installed (optional)], theora_libraries="$withval", theora_libraries="")
AC_ARG_WITH(theora-includes,[ --with-theora-includes=DIR Directory where libtheora header files are installed (optional)], theora_includes="$withval", theora_includes="")
AC_ARG_ENABLE(theoratest, [ --disable-theoratest Do not try to compile and run a test Theora program],, enable_theoratest=yes)
if test "x$theora_libraries" != "x" ; then
THEORA_LIBS="-L$theora_libraries"
elif test "x$theora_prefix" != "x" ; then
THEORA_LIBS="-L$theora_prefix/lib"
elif test "x$prefix" != "xNONE"; then
THEORA_LIBS="-L$libdir"
fi
THEORA_LIBS="$THEORA_LIBS -ltheora"
if test "x$theora_includes" != "x" ; then
THEORA_CFLAGS="-I$theora_includes"
elif test "x$theora_prefix" != "x" ; then
THEORA_CFLAGS="-I$theora_prefix/include"
elif test "x$prefix" != "xNONE"; then
THEORA_CFLAGS=""
fi
AC_MSG_CHECKING(for Theora)
no_theora=""
if test "x$enable_theoratest" = "xyes" ; then
ac_save_CFLAGS="$CFLAGS"
ac_save_LIBS="$LIBS"
CFLAGS="$CFLAGS $THEORA_CFLAGS $OGG_CFLAGS"
LIBS="$LIBS $THEORA_LIBS $OGG_LIBS"
dnl
dnl Now check if the installed Theora is sufficiently new.
dnl
rm -f conf.theoratest
AC_TRY_RUN([
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <theora/theora.h>
#include <vorbis/codec.h>
int main ()
{
theora_info ti;
theora_state ts;
theora_info_init(&ti);
system("touch conf.theoratest");
return 0;
}
],, no_theora=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
CFLAGS="$ac_save_CFLAGS"
LIBS="$ac_save_LIBS"
fi
if test "x$no_theora" = "x" ; then
AC_MSG_RESULT(yes)
ifelse([$1], , :, [$1])
else
AC_MSG_RESULT(no)
if test -f conf.theoratest ; then
:
else
echo "*** Could not run Theora test program, checking why..."
CFLAGS="$CFLAGS $THEORA_CFLAGS"
LIBS="$LIBS $THEORA_LIBS $OGG_LIBS"
AC_TRY_LINK([
#include <stdio.h>
#include <vorbis/codec.h>
], [ return 0; ],
[ echo "*** The test program compiled, but did not run. This usually means"
echo "*** that the run-time linker is not finding Theora or finding the wrong"
echo "*** version of Theora. If it is not finding Theora, you'll need to set your"
echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
echo "*** to the installed location Also, make sure you have run ldconfig if that"
echo "*** is required on your system"
echo "***"
echo "*** If you have an old version installed, it is best to remove it, although"
echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
[ echo "*** The test program failed to compile or link. See the file config.log for the"
echo "*** exact error that occured. This usually means Theora was incorrectly installed"
echo "*** or that you have moved Theora since it was installed." ])
CFLAGS="$ac_save_CFLAGS"
LIBS="$ac_save_LIBS"
fi
THEORA_CFLAGS=""
THEORA_LIBS=""
ifelse([$2], , :, [$2])
fi
AC_SUBST(THEORA_CFLAGS)
AC_SUBST(THEORA_LIBS)
rm -f conf.theoratest
])
-137
View File
@@ -1,137 +0,0 @@
#!/bin/sh
# Run this to generate all the initial makefiles, etc.
srcdir=`dirname $0`
PKG_NAME="fs2_open"
# check the version of a package
check_version() {
COMMAND=$1
MAJOR=$2
MINOR=$3
MICRO=$4
($COMMAND --version) </dev/null >/dev/null 2>&1 || return 1
ver=`$COMMAND --version|head -n 1|sed 's/^.*) //'|sed 's/ (.*)//'`
major=`echo $ver | cut -d. -f1 | sed s/[a-zA-Z\-].*//g`
minor=`echo $ver | cut -d. -f2 | sed s/[a-zA-Z\-].*//g`
micro=`echo $ver | cut -d. -f3 | sed s/[a-zA-Z\-].*//g`
test -z "$major" && major=0
test -z "$minor" && minor=0
test -z "$micro" && micro=0
fail=0
if [ ! "$major" -gt "$MAJOR" ]; then
if [ "$major" -lt "$MAJOR" ]; then
fail=1
elif [ ! "$minor" -gt "$MINOR" ]; then
if [ "$minor" -lt "$MINOR" ]; then
fail=1
elif [ "$micro" -lt "$MICRO" ]; then
fail=1
fi
fi
fi
return "$fail"
}
AUTOMAKE=
ACLOCAL=
DIE=0
(autoconf --version) < /dev/null > /dev/null 2>&1 || {
echo
echo "**Error**: You must have \`autoconf' installed to."
echo "Download the appropriate package for your distribution,"
echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
DIE=1
}
for AM in automake-1.9 automake-1.8 automake-1.7 automake-1.6 automake; do
(check_version "$AM" 1 6 1) && {
AUTOMAKE="$AM"
break
}
done
if [ -z "$AUTOMAKE" ]; then
echo
echo "**Error**: You must have \`automake' version 1.6.1 or greater"
echo "installed to compile $PKG_NAME. Download the appropriate package"
echo "for your distribution, or get the source tarball at"
echo "ftp://ftp.gnu.org/pub/gnu/"
DIE=1
fi
# if no automake, don't bother testing for aclocal
test -z "$AUTOMAKE" || {
for ACL in aclocal-1.9 aclocal-1.8 aclocal-1.7 aclocal-1.6 aclocal; do
(check_version "$ACL" 1 6 1) && {
ACLOCAL="$ACL"
break
}
done
if [ -z "$ACLOCAL" ]; then
echo
echo "**Error**: Missing \`aclocal'. The version of \`automake'"
echo "installed seems to be outdated. Get a recent package from"
echo "ftp://ftp.gnu.org/pub/gnu/"
DIE=1
fi
}
if test "$DIE" -eq 1; then
exit 1
fi
if test -z "$*"; then
echo "**Warning**: I am going to run \`configure' with no arguments."
echo "If you wish to pass any to it, please specify them on the"
echo \`$0\'" command line."
echo
fi
case $CC in
xlc )
am_opt=--include-deps;;
esac
for coin in `find $srcdir -name configure.ac -print`
do
dr=`dirname $coin`
if test -f $dr/NO-AUTO-GEN; then
echo skipping $dr -- flagged as no auto-gen
else
echo processing $dr
macrodirs=`sed -n -e 's,AM_ACLOCAL_INCLUDE(\(.*\)),\1,gp' < $coin`
( cd $dr
aclocalinclude="$ACLOCAL_FLAGS"
for k in $macrodirs; do
if test -d $k; then
aclocalinclude="$aclocalinclude -I $k"
##else
## echo "**Warning**: No such directory \`$k'. Ignored."
fi
done
echo "Running $ACLOCAL $aclocalinclude ..."
"$ACLOCAL" $aclocalinclude
echo "Running $AUTOMAKE --add-missing --copy --foreign $am_opt ..."
"$AUTOMAKE" --add-missing --copy --foreign $am_opt
echo "Running autoconf..."
autoconf
)
fi
done
#conf_flags="--enable-maintainer-mode --enable-compile-warnings" #--enable-iso-c
if test x$NOCONFIGURE = x; then
echo Running $srcdir/configure $conf_flags "$@" ...
$srcdir/configure $conf_flags "$@" \
&& echo Now type \`make\' to compile $PKG_NAME.
else
echo Skipping configure process.
fi
-862
View File
@@ -1,862 +0,0 @@
## code/Makefile.am for fs2_open
##
## $Id: Makefile.am,v 1.31.2.10 2007-11-22 04:52:12 taylor Exp $
EXTRA_DIST = \
freespace2/app_icon.ico \
freespace2/freespace.rc \
freespace2/freespaceresource.h \
freespace2/goal_com.bmp \
freespace2/goal_fail.bmp \
freespace2/goal_inc.bmp \
freespace2/goal_none.bmp \
freespace2/goal_ord.bmp \
fred2/addvariabledlg.cpp \
fred2/addvariabledlg.h \
fred2/adjustgriddlg.cpp \
fred2/adjustgriddlg.h \
fred2/asteroideditordlg.cpp \
fred2/asteroideditordlg.h \
fred2/bgbitmapdlg.cpp \
fred2/bgbitmapdlg.h \
fred2/briefingeditordlg.cpp \
fred2/briefingeditordlg.h \
fred2/campaigneditordlg.cpp \
fred2/campaigneditordlg.h \
fred2/campaignfilelistbox.cpp \
fred2/campaignfilelistbox.h \
fred2/campaigntreeview.cpp \
fred2/campaigntreeview.h \
fred2/campaigntreewnd.cpp \
fred2/campaigntreewnd.h \
fred2/cmdbrief.cpp \
fred2/cmdbrief.h \
fred2/createwingdlg.cpp \
fred2/createwingdlg.h \
fred2/customwingnames.cpp \
fred2/customwingnames.h \
fred2/debriefingeditordlg.cpp \
fred2/debriefingeditordlg.h \
fred2/dialog1.cpp \
fred2/dialog1.h \
fred2/dumpstats.cpp \
fred2/dumpstats.h \
fred2/editor.h \
fred2/eventeditor.cpp \
fred2/eventeditor.h \
fred2/folderdlg.cpp \
fred2/folderdlg.h \
fred2/fred.cpp \
fred2/fred.h \
fred2/fred.rc \
fred2/freddoc.cpp \
fred2/freddoc.h \
fred2/fredrender.cpp \
fred2/fredrender.h \
fred2/fredstubs.cpp \
fred2/fredview.cpp \
fred2/fredview.h \
fred2/grid.cpp \
fred2/grid.h \
fred2/ignoreordersdlg.cpp \
fred2/ignoreordersdlg.h \
fred2/initialships.cpp \
fred2/initialships.h \
fred2/initialstatus.cpp \
fred2/initialstatus.h \
fred2/mainfrm.cpp \
fred2/mainfrm.h \
fred2/makehelp.bat \
fred2/management.cpp \
fred2/management.h \
fred2/messageeditordlg.cpp \
fred2/messageeditordlg.h \
fred2/missiongoalsdlg.cpp \
fred2/missiongoalsdlg.h \
fred2/missionnotesdlg.cpp \
fred2/missionnotesdlg.h \
fred2/missionsave.cpp \
fred2/missionsave.h \
fred2/modifyvariabledlg.cpp \
fred2/modifyvariabledlg.h \
fred2/operatorargtypeselect.cpp \
fred2/operatorargtypeselect.h \
fred2/orienteditor.cpp \
fred2/orienteditor.h \
fred2/playerstarteditor.cpp \
fred2/playerstarteditor.h \
fred2/prefsdlg.cpp \
fred2/prefsdlg.h \
fred2/reinforcementeditordlg.cpp \
fred2/reinforcementeditordlg.h \
fred2/resource.h \
fred2/resource.hm \
fred2/setglobalshipflags.cpp \
fred2/setglobalshipflags.h \
fred2/sexp_tree.cpp \
fred2/sexp_tree.h \
fred2/shieldsysdlg.cpp \
fred2/shieldsysdlg.h \
fred2/ship_select.cpp \
fred2/ship_select.h \
fred2/shipchecklistbox.cpp \
fred2/shipchecklistbox.h \
fred2/shipclasseditordlg.cpp \
fred2/shipclasseditordlg.h \
fred2/shipeditordlg.cpp \
fred2/shipeditordlg.h \
fred2/shipflagsdlg.cpp \
fred2/shipflagsdlg.h \
fred2/shipgoalsdlg.cpp \
fred2/shipgoalsdlg.h \
fred2/shipspecialdamage.cpp \
fred2/shipspecialdamage.h \
fred2/shipspecialhitpoints.cpp \
fred2/shipspecialhitpoints.h \
fred2/shiptexturesdlg.cpp \
fred2/shiptexturesdlg.h \
fred2/starfieldeditor.cpp \
fred2/starfieldeditor.h \
fred2/stdafx.cpp \
fred2/stdafx.h \
fred2/textviewdlg.cpp \
fred2/textviewdlg.h \
fred2/voiceactingmanager.cpp \
fred2/voiceactingmanager.h \
fred2/waypointpathdlg.cpp \
fred2/waypointpathdlg.h \
fred2/weaponeditordlg.cpp \
fred2/weaponeditordlg.h \
fred2/wing.cpp \
fred2/wing.h \
fred2/wing_editor.cpp \
fred2/wing_editor.h \
fred2/hlp/afxcore.rtf \
fred2/hlp/afxhelp.hm \
fred2/hlp/afxprint.rtf \
fred2/hlp/appexit.bmp \
fred2/hlp/bullet.bmp \
fred2/hlp/curarw2.bmp \
fred2/hlp/curarw4.bmp \
fred2/hlp/curhelp.bmp \
fred2/hlp/editcopy.bmp \
fred2/hlp/editcut.bmp \
fred2/hlp/editpast.bmp \
fred2/hlp/editundo.bmp \
fred2/hlp/filenew.bmp \
fred2/hlp/fileopen.bmp \
fred2/hlp/fileprnt.bmp \
fred2/hlp/filesave.bmp \
fred2/hlp/fred.hm \
fred2/hlp/fred.hpj \
fred2/hlp/help.log \
fred2/hlp/hlpsbar.bmp \
fred2/hlp/hlptbar.bmp \
fred2/hlp/recfirst.bmp \
fred2/hlp/reclast.bmp \
fred2/hlp/recnext.bmp \
fred2/hlp/recprev.bmp \
fred2/hlp/scmax.bmp \
fred2/hlp/scmenu.bmp \
fred2/hlp/scmin.bmp \
fred2/res/bitmap1.bmp \
fred2/res/black_do.bmp \
fred2/res/bmp00001.bmp \
fred2/res/chained.bmp \
fred2/res/chained_directive.bmp \
fred2/res/cursor1.cur \
fred2/res/cursor2.cur \
fred2/res/data.bmp \
fred2/res/fred.ico \
fred2/res/fred.rc2 \
fred2/res/freddoc.ico \
fred2/res/green_do.bmp \
fred2/res/root.bmp \
fred2/res/root_directive.bmp \
fred2/res/toolbar.bmp \
fred2/res/toolbar1.bmp \
fred2/res/variable.bmp \
sound/phrases.xml \
sound/gc.exe \
wxfred2/res/fred.ico \
wxfred2/wxfred.xrc
# D_ variants are defaults and should always be used
# FS2_ variants are for game building and wxFRED
AM_CXXFLAGS = @D_CFLAGS@ @FS2_CXXFLAGS@ -I../lua
AM_LDFLAGS = @D_LDFLAGS@ @FS2_LDFLAGS@
noinst_LIBRARIES = libcode.a
noinst_PROGRAMS = @FS2_BINARY@
EXTRA_PROGRAMS = fs2_open_r fs2_open_d wxFRED2_r wxFRED2_d
###############################################################################
##
## Begin CORE library
##
FS2_SOURCES = \
ai/ai.cpp \
ai/ai.h \
ai/aibig.cpp \
ai/aibig.h \
ai/aicode.cpp \
ai/aigoals.cpp \
ai/aigoals.h \
ai/aiinternal.h \
ai/ailocal.h \
ai/aiturret.cpp \
ai/ai_profiles.cpp \
ai/ai_profiles.h \
anim/animplay.cpp \
anim/animplay.h \
anim/packunpack.cpp \
anim/packunpack.h \
asteroid/asteroid.cpp \
asteroid/asteroid.h \
autopilot/autopilot.cpp \
autopilot/autopilot.h \
bmpman/bm_internal.h \
bmpman/bmpman.cpp \
bmpman/bmpman.h \
camera/camera.cpp \
camera/camera.h \
cfile/cfile.cpp \
cfile/cfile.h \
cfile/cfilearchive.cpp \
cfile/cfilearchive.h \
cfile/cfilelist.cpp \
cfile/cfilesystem.cpp \
cfile/cfilesystem.h \
cmdline/cmdline.cpp \
cmdline/cmdline.h \
cmeasure/cmeasure.cpp \
cmeasure/cmeasure.h \
controlconfig/controlsconfig.cpp \
controlconfig/controlsconfig.h \
controlconfig/controlsconfigcommon.cpp \
cutscene/cutscenes.cpp \
cutscene/cutscenes.h \
cutscene/decoder16.cpp \
cutscene/decoder8.cpp \
cutscene/movie.cpp \
cutscene/movie.h \
cutscene/mve_audio.cpp \
cutscene/mvelib.cpp \
cutscene/mvelib.h \
cutscene/mveplayer.cpp \
cutscene/oggplayer.cpp \
cutscene/oggplayer.h \
ddsutils/ddsutils.cpp \
ddsutils/ddsutils.h \
debris/debris.cpp \
debris/debris.h \
debugconsole/console.cpp \
debugconsole/dbugfile.h \
debugconsole/timerbar.cpp \
debugconsole/timerbar.h \
decals/decals.cpp \
decals/decals.h \
demo/demo.cpp \
demo/demo.h \
exceptionhandler/exceptionhandler.cpp \
exceptionhandler/exceptionhandler.h \
fireball/fireballs.cpp \
fireball/fireballs.h \
fireball/warpineffect.cpp \
fs2netd/fs2netd_client.cpp \
fs2netd/fs2netd_client.h \
fs2netd/tcp_client.cpp \
fs2netd/tcp_client.h \
fs2netd/tcp_socket.cpp \
fs2netd/tcp_socket.h \
fs2netd/protocol.h \
gamehelp/contexthelp.cpp \
gamehelp/contexthelp.h \
gamehelp/gameplayhelp.cpp \
gamehelp/gameplayhelp.h \
gamesequence/gamesequence.cpp \
gamesequence/gamesequence.h \
globalincs/alphacolors.cpp \
globalincs/alphacolors.h \
globalincs/crypt.cpp \
globalincs/crypt.h \
globalincs/def_files.cpp \
globalincs/def_files.h \
globalincs/globals.h \
globalincs/linklist.h \
globalincs/pstypes.h \
globalincs/systemvars.cpp \
globalincs/systemvars.h \
globalincs/version.cpp \
globalincs/version.h \
graphics/2d.cpp \
graphics/2d.h \
graphics/font.cpp \
graphics/font.h \
graphics/generic.cpp \
graphics/generic.h \
graphics/grbatch.cpp \
graphics/grbatch.h \
graphics/grinternal.h \
graphics/gropengl.cpp \
graphics/gropengl.h \
graphics/gropenglbmpman.cpp \
graphics/gropenglbmpman.h \
graphics/gropengldraw.cpp \
graphics/gropengldraw.h \
graphics/gropenglextension.cpp \
graphics/gropenglextension.h \
graphics/gropengllight.cpp \
graphics/gropengllight.h \
graphics/gropenglshader.cpp \
graphics/gropenglshader.h \
graphics/gropenglstate.cpp \
graphics/gropenglstate.h \
graphics/gropengltexture.cpp \
graphics/gropengltexture.h \
graphics/gropengltnl.cpp \
graphics/gropengltnl.h \
graphics/grstub.cpp \
graphics/grstub.h \
graphics/line.h \
graphics/tmapper.h \
hud/hud.cpp \
hud/hud.h \
hud/hudartillery.cpp \
hud/hudartillery.h \
hud/hudbrackets.cpp \
hud/hudbrackets.h \
hud/hudconfig.cpp \
hud/hudconfig.h \
hud/hudescort.cpp \
hud/hudescort.h \
hud/hudets.cpp \
hud/hudets.h \
hud/hudgauges.h \
hud/hudlock.cpp \
hud/hudlock.h \
hud/hudmessage.cpp \
hud/hudmessage.h \
hud/hudnavigation.cpp \
hud/hudnavigation.h \
hud/hudobserver.cpp \
hud/hudobserver.h \
hud/hudparse.cpp \
hud/hudparse.h \
hud/hudresource.h \
hud/hudreticle.cpp \
hud/hudreticle.h \
hud/hudshield.cpp \
hud/hudshield.h \
hud/hudsquadmsg.cpp \
hud/hudsquadmsg.h \
hud/hudtarget.cpp \
hud/hudtarget.h \
hud/hudtargetbox.cpp \
hud/hudtargetbox.h \
hud/hudwingmanstatus.cpp \
hud/hudwingmanstatus.h \
iff_defs/iff_defs.cpp \
iff_defs/iff_defs.h \
inetfile/cftp.cpp \
inetfile/cftp.h \
inetfile/chttpget.cpp \
inetfile/chttpget.h \
inetfile/inetgetfile.cpp \
inetfile/inetgetfile.h \
io/key.cpp \
io/key.h \
io/keycontrol.cpp \
io/keycontrol.h \
io/mouse.cpp \
io/mouse.h \
io/timer.cpp \
io/timer.h \
io/trackir.cpp \
io/trackir.h \
jpgutils/jpgutils.cpp \
jpgutils/jpgutils.h \
jumpnode/jumpnode.cpp \
jumpnode/jumpnode.h \
lab/lab.cpp \
lab/lab.h \
lab/wmcgui.cpp \
lab/wmcgui.h \
lighting/lighting.cpp \
lighting/lighting.h \
localization/fhash.cpp \
localization/fhash.h \
localization/localize.cpp \
localization/localize.h \
math/bitarray.h \
math/fix.cpp \
math/fix.h \
math/floating.cpp \
math/floating.h \
math/fvi.cpp \
math/fvi.h \
math/spline.cpp \
math/spline.h \
math/staticrand.cpp \
math/staticrand.h \
math/vecmat.cpp \
math/vecmat.h \
menuui/barracks.cpp \
menuui/barracks.h \
menuui/credits.cpp \
menuui/credits.h \
menuui/fishtank.cpp \
menuui/fishtank.h \
menuui/mainhallmenu.cpp \
menuui/mainhallmenu.h \
menuui/mainhalltemp.cpp \
menuui/mainhalltemp.h \
menuui/optionsmenu.cpp \
menuui/optionsmenu.h \
menuui/optionsmenumulti.cpp \
menuui/optionsmenumulti.h \
menuui/playermenu.cpp \
menuui/playermenu.h \
menuui/readyroom.cpp \
menuui/readyroom.h \
menuui/snazzyui.cpp \
menuui/snazzyui.h \
menuui/techmenu.cpp \
menuui/techmenu.h \
menuui/trainingmenu.cpp \
menuui/trainingmenu.h \
mission/missionbriefcommon.cpp \
mission/missionbriefcommon.h \
mission/missioncampaign.cpp \
mission/missioncampaign.h \
mission/missiongoals.cpp \
mission/missiongoals.h \
mission/missiongrid.cpp \
mission/missiongrid.h \
mission/missionhotkey.cpp \
mission/missionhotkey.h \
mission/missionload.cpp \
mission/missionload.h \
mission/missionlog.cpp \
mission/missionlog.h \
mission/missionmessage.cpp \
mission/missionmessage.h \
mission/missionparse.cpp \
mission/missionparse.h \
mission/missiontraining.cpp \
mission/missiontraining.h \
missionui/chatbox.cpp \
missionui/chatbox.h \
missionui/fictionviewer.cpp \
missionui/fictionviewer.h \
missionui/missionbrief.cpp \
missionui/missionbrief.h \
missionui/missioncmdbrief.cpp \
missionui/missioncmdbrief.h \
missionui/missiondebrief.cpp \
missionui/missiondebrief.h \
missionui/missionloopbrief.cpp \
missionui/missionloopbrief.h \
missionui/missionpause.cpp \
missionui/missionpause.h \
missionui/missionrecommend.cpp \
missionui/missionrecommend.h \
missionui/missionscreencommon.cpp \
missionui/missionscreencommon.h \
missionui/missionshipchoice.cpp \
missionui/missionshipchoice.h \
missionui/missionstats.cpp \
missionui/missionstats.h \
missionui/missionweaponchoice.cpp \
missionui/missionweaponchoice.h \
missionui/redalert.cpp \
missionui/redalert.h \
model/model.h \
model/modelanim.cpp \
model/modelanim.h \
model/modelcollide.cpp \
model/modelinterp.cpp \
model/modelsinc.h \
model/modeloctant.cpp \
model/modelread.cpp \
nebula/neb.cpp \
nebula/neb.h \
nebula/neblightning.cpp \
nebula/neblightning.h \
network/chat_api.cpp \
network/chat_api.h \
network/multi.cpp \
network/multi.h \
network/multilag.cpp \
network/multilag.h \
network/multimsgs.cpp \
network/multimsgs.h \
network/multiteamselect.cpp \
network/multiteamselect.h \
network/multiui.cpp \
network/multiui.h \
network/multiutil.cpp \
network/multiutil.h \
network/multi_campaign.cpp \
network/multi_campaign.h \
network/multi_data.cpp \
network/multi_data.h \
network/multi_dogfight.cpp \
network/multi_dogfight.h \
network/multi_endgame.cpp \
network/multi_endgame.h \
network/multi_ingame.cpp \
network/multi_ingame.h \
network/multi_kick.cpp \
network/multi_kick.h \
network/multi_log.cpp \
network/multi_log.h \
network/multi_obj.cpp \
network/multi_obj.h \
network/multi_observer.cpp \
network/multi_observer.h \
network/multi_oo.h \
network/multi_options.cpp \
network/multi_options.h \
network/multi_pause.cpp \
network/multi_pause.h \
network/multi_pinfo.cpp \
network/multi_pinfo.h \
network/multi_ping.cpp \
network/multi_ping.h \
network/multi_pmsg.cpp \
network/multi_pmsg.h \
network/multi_pxo.cpp \
network/multi_pxo.h \
network/multi_rate.cpp \
network/multi_rate.h \
network/multi_respawn.cpp \
network/multi_respawn.h \
network/multi_team.cpp \
network/multi_team.h \
network/multi_update.h \
network/multi_voice.cpp \
network/multi_voice.h \
network/multi_xfer.cpp \
network/multi_xfer.h \
network/psnet.cpp \
network/psnet.h \
network/psnet2.cpp \
network/psnet2.h \
network/stand_gui.cpp \
network/stand_gui-unix.cpp \
network/stand_gui.h \
object/collidedebrisship.cpp \
object/collidedebrisweapon.cpp \
object/collideshipship.cpp \
object/collideshipweapon.cpp \
object/collideweaponweapon.cpp \
object/deadobjectdock.cpp \
object/deadobjectdock.h \
object/objcollide.cpp \
object/objcollide.h \
object/objectdock.cpp \
object/objectdock.h \
object/object.cpp \
object/object.h \
object/objectshield.cpp \
object/objectshield.h \
object/objectsort.cpp \
object/parseobjectdock.cpp \
object/parseobjectdock.h \
object/waypoint.cpp \
object/waypoint.h \
observer/observer.cpp \
observer/observer.h \
palman/palman.cpp \
palman/palman.h \
parse/encrypt.cpp \
parse/encrypt.h \
parse/lua.cpp \
parse/lua.h \
parse/parselo.cpp \
parse/parselo.h \
parse/scripting.cpp \
parse/scripting.h \
parse/sexp.cpp \
parse/sexp.h \
particle/particle.cpp \
particle/particle.h \
pcxutils/pcxutils.cpp \
pcxutils/pcxutils.h \
physics/physics.cpp \
physics/physics.h \
playerman/managepilot.cpp \
playerman/managepilot.h \
playerman/player.h \
playerman/playercontrol.cpp \
popup/popup.cpp \
popup/popup.h \
popup/popupdead.cpp \
popup/popupdead.h \
radar/radar.cpp \
radar/radar.h \
radar/radarorb.cpp \
radar/radarorb.h \
radar/radarsetup.cpp \
radar/radarsetup.h \
render/3d.h \
render/3dclipper.cpp \
render/3ddraw.cpp \
render/3dinternal.h \
render/3dlaser.cpp \
render/3dmath.cpp \
render/3dsetup.cpp \
ship/afterburner.cpp \
ship/afterburner.h \
ship/awacs.cpp \
ship/awacs.h \
ship/shield.cpp \
ship/ship.cpp \
ship/ship.h \
ship/shipcontrails.cpp \
ship/shipcontrails.h \
ship/shipfx.cpp \
ship/shipfx.h \
ship/shiphit.cpp \
ship/shiphit.h \
ship/subsysdamage.h \
species_defs/species_defs.cpp \
species_defs/species_defs.h \
starfield/nebula.cpp \
starfield/nebula.h \
starfield/starfield.cpp \
starfield/starfield.h \
starfield/supernova.cpp \
starfield/supernova.h \
stats/medals.cpp \
stats/medals.h \
stats/scoring.cpp \
stats/scoring.h \
stats/stats.cpp \
stats/stats.h \
tgautils/tgautils.cpp \
tgautils/tgautils.h \
ui/button.cpp \
ui/checkbox.cpp \
ui/gadget.cpp \
ui/icon.cpp \
ui/inputbox.cpp \
ui/keytrap.cpp \
ui/listbox.cpp \
ui/radio.cpp \
ui/scroll.cpp \
ui/slider.cpp \
ui/slider2.cpp \
ui/ui.h \
ui/uidefs.h \
ui/uidraw.cpp \
ui/uimouse.cpp \
ui/window.cpp \
weapon/beam.cpp \
weapon/beam.h \
weapon/corkscrew.cpp \
weapon/corkscrew.h \
weapon/emp.cpp \
weapon/emp.h \
weapon/flak.cpp \
weapon/flak.h \
weapon/muzzleflash.cpp \
weapon/muzzleflash.h \
weapon/shockwave.cpp \
weapon/shockwave.h \
weapon/swarm.cpp \
weapon/swarm.h \
weapon/trails.cpp \
weapon/trails.h \
weapon/weapons.cpp \
weapon/weapon.h
## conditional includes follow:
## joystic support sources
if FS2_OS_WIN32
JOY_SOURCES = \
io/joy.cpp \
io/joy.h \
io/joy_ff.cpp \
io/joy_ff.h \
io/sw_error.hpp \
io/sw_force.h \
io/sw_guid.hpp \
io/swff_lib.cpp
endif
if FS2_OS_UNIX
JOY_SOURCES = \
io/joy.h \
io/joy_ff.h \
io/joy-unix.cpp
endif
## sound support sources
if FS2_SOUND
SOUND_SOURCES = \
gamesnd/eventmusic.cpp \
gamesnd/eventmusic.h \
gamesnd/gamesnd.cpp \
gamesnd/gamesnd.h \
object/objectsnd.cpp \
object/objectsnd.h \
sound/ogg/ogg.cpp \
sound/ogg/ogg.h \
sound/audiostr-openal.cpp \
sound/audiostr.cpp \
sound/audiostr.h \
sound/acm-openal.cpp \
sound/acm.cpp \
sound/acm.h \
sound/ds.cpp \
sound/ds.h \
sound/ds3d.cpp \
sound/ds3d.h \
sound/dscap.cpp \
sound/dscap.h \
sound/midifile.cpp \
sound/midifile.h \
sound/midiseq.h \
sound/rbaudio.cpp \
sound/rbaudio.h \
sound/rtvoice.cpp \
sound/rtvoice.h \
sound/sound.cpp \
sound/sound.h \
sound/winmidi.cpp \
sound/winmidi.h \
sound/winmidi_base.cpp \
vcodec/codec1.cpp \
vcodec/codec1.h \
sound/fsspeech.cpp \
sound/fsspeech.h \
sound/speech.cpp \
sound/speech.h \
sound/voicerec.cpp \
sound/voicerec.h
endif
## Win32-specific sources
if FS2_OS_WIN32
WIN32_SOURCES = \
directx/dx8show.cpp \
directx/dx8show.h \
directx/vasync.h \
directx/vd3dtypes.h \
directx/vddraw.h \
directx/vdinput.h \
directx/vdplay.h \
directx/vdplobby.h \
directx/vdsetup.h \
directx/vdsound.h \
directx/vdvp.h \
globalincs/windebug.cpp \
graphics/gl/GLAUX.H \
graphics/gl/GLU.H \
graphics/gl/Gl.h \
graphics/gl/Glext.h \
graphics/gl/wglext.h \
graphics/GrD3DStateBlock.cpp \
graphics/GrD3DStateBlock.h \
graphics/grd3d.cpp \
graphics/grd3d.h \
graphics/grd3dcalls.cpp \
graphics/grd3dbmpman.cpp \
graphics/grd3dbmpman.h \
graphics/grd3dinternal.h \
graphics/grd3dlight.cpp \
graphics/grd3dlight.h \
graphics/grd3drender.cpp \
graphics/grd3dsetup.cpp \
graphics/grd3dsetup.h \
graphics/grd3dtexture.cpp \
osapi/monopub.h \
osapi/osapi.cpp \
osapi/osapi.h \
osapi/osregistry.cpp \
osapi/osregistry.h \
osapi/outwnd.cpp \
osapi/outwnd.h
endif
## Unix-specific sources
if FS2_OS_UNIX
UNIX_SOURCES = \
osapi/osapi_unix.cpp \
osapi/osapi.h \
osapi/osregistry_unix.cpp \
osapi/osregistry.h \
osapi/outwnd_unix.cpp \
osapi/outwnd.h \
windows_stub/stubs.cpp \
windows_stub/config.h
endif
## libcode.a
libcode_a_SOURCES = ${FS2_SOURCES} ${JOY_SOURCES} ${SOUND_SOURCES} \
${WIN32_SOURCES} ${UNIX_SOURCES}
##
## End CODE library
##
###############################################################################
###############################################################################
##
## Begin MAIN fs2 binary
##
FS2OPEN_SOURCES = \
freespace2/freespace.cpp \
freespace2/freespace.h \
freespace2/levelpaging.cpp \
freespace2/levelpaging.h
fs2_open_d_SOURCES = \
${FS2OPEN_SOURCES}
fs2_open_r_SOURCES = \
${FS2OPEN_SOURCES}
fs2_open_d_LDADD = libcode.a ../libjpeg/libjpeg.a ../lua/liblua.a
fs2_open_r_LDADD = libcode.a ../libjpeg/libjpeg.a ../lua/liblua.a
##
## End MAIN binary
##
###############################################################################
###############################################################################
##
## Begin wxFRED2 binary
##
wxFRED_SOURCES = \
wxfred2/wxfred2.cpp \
wxfred2/wxfred2.h \
wxfred2/fredframe.cpp \
wxfred2/fredframe.h \
wxfred2/wxfred_xrc.cpp \
wxfred2/wxfred_xrc.h
wxFRED2_d_SOURCES = \
${wxFRED_SOURCES}
wxFRED2_r_SOURCES = \
${wxFRED_SOURCES}
wxFRED2_d_LDADD = libcode.a ../libjpeg/libjpeg.a
wxFRED2_r_LDADD = libcode.a ../libjpeg/libjpeg.a
##
## End wxFRED2 binary
##
###############################################################################
-442
View File
@@ -1,442 +0,0 @@
/*
* Created by Ian "Goober5000" Warfield for the FreeSpace2 Source Code Project.
* You may not sell or otherwise commercially exploit the source or things you
* create based on the source.
*/
/*
* $Logfile: /Freespace2/code/ai/ai_profiles.cpp $
* $Revision: 1.13.2.9 $
* $Date: 2007-10-15 06:43:08 $
* $Author: taylor $
*
* $Log: not supported by cvs2svn $
* Revision 1.13.2.8 2007/09/02 02:07:37 Goober5000
* added fixes for #1415 and #1483, made sure every read_file_text had a corresponding setjmp, and sync'd the parse error messages between HEAD and stable
*
* Revision 1.13.2.7 2007/07/28 22:04:13 Goober5000
* apply some of Turey's changes to stable branch
*
* Revision 1.13.2.6 2007/07/15 02:45:48 Goober5000
* fixed a small bug in the lab
* moved WMC's no damage scaling flag to ai_profiles and made it work correctly
* removed my old supercap damage scaling change
* moved Turey's truefire flag to ai_profiles
*
* Revision 1.13.2.5 2007/02/27 01:44:44 Goober5000
* add two features for WCS: specifyable shield/weapon recharge rates, and removal of linked fire penalty
*
* Revision 1.13.2.4 2006/09/11 01:15:03 taylor
* fixes for stuff_string() bounds checking
*
* Revision 1.13.2.3 2006/07/12 04:57:20 taylor
* fix the endless-loop fix ;) (this is what broke shield recharging btw)
*
* Revision 1.13.2.2 2006/07/06 18:19:55 Goober5000
* fix dumb endless loop bug
* --Goober5000
*
* Revision 1.13.2.1 2006/07/02 03:39:34 Goober5000
* remove associated AI flags
* --Goober5000
*
* Revision 1.13 2006/04/20 06:32:00 Goober5000
* proper capitalization according to Volition
*
* Revision 1.12 2006/03/20 06:25:19 taylor
* change wording to ease Goober's ulcer. ;)
*
* Revision 1.11 2006/03/20 06:19:03 taylor
* add ai_profiles flag to get rid of limit on minimum speed a docked ship can move
* (not going to Int3() here from < 0.1 speed by default, a support ship actually hit it)
*
* Revision 1.10 2006/02/13 04:56:58 Goober5000
* enabled modular tables for ai_profiles and added the default table to def_files
* --Goober5000
*
* Revision 1.9 2006/02/13 00:20:44 Goober5000
* more tweaks, plus clarification of checks for the existence of files
* --Goober5000
*
* Revision 1.8 2005/12/22 04:32:44 taylor
* GCC knows that fix == int so it hates the utility functions here, for sanity sake just rename them to type specific to avoid rampant casting
*
* Revision 1.7 2005/12/06 03:17:48 taylor
* cleanup some debug log messages:
* note that a nprintf() with "Warning" or "General" is basically the same thing as mprintf()
* make sure that OpenAL init failures always get to the debug log
*
* Revision 1.6 2005/11/24 09:08:44 Goober5000
* bah, forgot a colon
* --Goober5000
*
* Revision 1.5 2005/11/24 08:46:11 Goober5000
* * cleaned up mission_do_departure
* * fixed a hidden crash (array index being -1; would only
* be triggered for ships w/o subspace drives under certain conditions)
* * removed finding a new fighterbay target because it might screw up missions
* * improved clarity, code flow, and readability :)
* * added custom AI flag for disabling warpouts if navigation subsystem fails
* --Goober5000
*
* Revision 1.4 2005/11/24 07:27:14 taylor
* fix fred2 startup crash (we probably need to Assert() this case so it doesn't easily happen again)
*
* Revision 1.3 2005/11/21 15:01:18 taylor
* little cleaner, lot more friendly to 64-bit archs (long type is usually 64-bit there)
*
* Revision 1.2 2005/11/21 03:47:51 Goober5000
* bah and double bah
* --Goober5000
*
* Revision 1.1 2005/11/21 02:43:30 Goober5000
* change from "setting" to "profile"; this way makes more sense
* --Goober5000
*
*/
#include "globalincs/pstypes.h"
#include "globalincs/def_files.h"
#include "ai/ai_profiles.h"
#include "parse/parselo.h"
#include "localization/localize.h"
// global stuff
int Num_ai_profiles;
int Default_ai_profile;
ai_profile_t Ai_profiles[MAX_AI_PROFILES];
// local to this file
static int Ai_profiles_initted = 0;
static char Default_profile_name[NAME_LENGTH];
// utility
void set_flag(ai_profile_t *profile, char *name, int flag)
{
if (optional_string(name))
{
bool val;
stuff_boolean(&val);
if (val)
profile->flags |= flag;
else
profile->flags &= ~flag;
}
}
void parse_ai_profiles_tbl(char *filename)
{
int i, rval;
bool no_create = false;
char profile_name[NAME_LENGTH];
ai_profile_t dummy_profile;
char *saved_Mp = NULL;
// open localization
lcl_ext_open();
if ((rval = setjmp(parse_abort)) != 0)
{
mprintf(("TABLES: Unable to parse '%s'! Error code = %i.\n", (filename) ? filename : "<default ai_profiles.tbl>", rval));
lcl_ext_close();
return;
}
if (filename == NULL)
read_file_text_from_array(defaults_get_file("ai_profiles.tbl"));
else
read_file_text(filename, CF_TYPE_TABLES);
reset_parse();
// start parsing
required_string("#AI Profiles");
// new default?
if (optional_string("$Default Profile:"))
stuff_string(Default_profile_name, F_NAME, NAME_LENGTH);
// begin reading data
while (required_string_either("#End","$Profile Name:"))
{
ai_profile_t *profile = &dummy_profile;
ai_profile_t *previous_profile = NULL;
// get the name
required_string("$Profile Name:");
stuff_string(profile_name, F_NAME, NAME_LENGTH);
// see if it exists
for (i = 0; i < Num_ai_profiles; i++)
{
if (!stricmp(Ai_profiles[i].profile_name, profile_name))
{
previous_profile = &Ai_profiles[i];
break;
}
}
// modular table stuff
if (optional_string("+nocreate"))
{
no_create = true;
// use the previous one if possible,
// otherwise continue to use the dummy one
if (previous_profile != NULL)
profile = previous_profile;
}
else
{
// don't create multiple profiles with the same name
if (previous_profile != NULL)
{
Warning(LOCATION, "An ai profile named '%s' already exists! The new one will not be created.\n", profile_name);
}
else
{
// make sure we're under the limit
if (Num_ai_profiles >= MAX_AI_PROFILES)
{
Warning(LOCATION, "Too many profiles in ai_profiles.tbl! Max is %d.\n", MAX_AI_PROFILES-1); // -1 because one is built-in
skip_to_string("#End", NULL);
break;
}
profile = &Ai_profiles[Num_ai_profiles];
Num_ai_profiles++;
}
}
// initialize profile if we're not building from a previously parsed one
if (!no_create)
{
// base profile, so zero it out
if (profile == &Ai_profiles[0])
{
memset(profile, 0, sizeof(ai_profile_t));
}
// brand new profile, so set it to the base defaults
else
{
memcpy(profile, &Ai_profiles[0], sizeof(ai_profile_t));
}
}
// set the name
strcpy(profile->profile_name, profile_name);
// fill in any and all settings; they're all optional and can be in any order
while (!check_for_string("$Profile Name:") && !check_for_string("#End"))
{
if (optional_string("$Player Afterburner Recharge Scale:"))
parse_float_list(profile->afterburner_recharge_scale, NUM_SKILL_LEVELS);
if (optional_string("$Max Beam Friendly Fire Damage:"))
parse_float_list(profile->beam_friendly_damage_cap, NUM_SKILL_LEVELS);
if (optional_string("$Player Countermeasure Life Scale:"))
parse_float_list(profile->cmeasure_life_scale, NUM_SKILL_LEVELS);
if (optional_string("$AI Countermeasure Firing Chance:"))
parse_float_list(profile->cmeasure_fire_chance, NUM_SKILL_LEVELS);
if (optional_string("$AI In Range Time:"))
parse_float_list(profile->in_range_time, NUM_SKILL_LEVELS);
if (optional_string("$AI Always Links Ammo Weapons:"))
parse_float_list(profile->link_ammo_levels_always, NUM_SKILL_LEVELS);
if (optional_string("$AI Maybe Links Ammo Weapons:"))
parse_float_list(profile->link_ammo_levels_maybe, NUM_SKILL_LEVELS);
if (optional_string("$AI Always Links Energy Weapons:"))
parse_float_list(profile->link_energy_levels_always, NUM_SKILL_LEVELS);
if (optional_string("$AI Maybe Links Energy Weapons:"))
parse_float_list(profile->link_energy_levels_maybe, NUM_SKILL_LEVELS);
if (optional_string("$Max Missles Locked on Player:"))
parse_int_list(profile->max_allowed_player_homers, NUM_SKILL_LEVELS);
if (optional_string("$Max Player Attackers:"))
parse_int_list(profile->max_attackers, NUM_SKILL_LEVELS);
if (optional_string("$Max Incoming Asteroids:"))
parse_int_list(profile->max_incoming_asteroids, NUM_SKILL_LEVELS);
if (optional_string("$Player Damage Factor:") || optional_string("$AI Damage Reduction to Player Hull:"))
parse_float_list(profile->player_damage_scale, NUM_SKILL_LEVELS);
if (optional_string("$Player Subsys Damage Factor:") || optional_string("$AI Damage Reduction to Player Subsys:"))
parse_float_list(profile->subsys_damage_scale, NUM_SKILL_LEVELS);
// represented in fractions of F1_0
if (optional_string("$Predict Position Delay:"))
{
int i;
float temp_list[NUM_SKILL_LEVELS];
parse_float_list(temp_list, NUM_SKILL_LEVELS);
for (i = 0; i < NUM_SKILL_LEVELS; i++)
profile->predict_position_delay[i] = fl2f(temp_list[i]);
}
if (optional_string("$Player Shield Recharge Scale:"))
parse_float_list(profile->shield_energy_scale, NUM_SKILL_LEVELS);
if (optional_string("$AI Shield Manage Delay:") || optional_string("$AI Shield Manage Delays:"))
parse_float_list(profile->shield_manage_delay, NUM_SKILL_LEVELS);
if (optional_string("$Friendly AI Fire Delay Scale:"))
parse_float_list(profile->ship_fire_delay_scale_friendly, NUM_SKILL_LEVELS);
if (optional_string("$Hostile AI Fire Delay Scale:"))
parse_float_list(profile->ship_fire_delay_scale_hostile, NUM_SKILL_LEVELS);
if (optional_string("$Friendly AI Secondary Fire Delay Scale:"))
parse_float_list(profile->ship_fire_secondary_delay_scale_friendly, NUM_SKILL_LEVELS);
if (optional_string("$Hostile AI Secondary Fire Delay Scale:"))
parse_float_list(profile->ship_fire_secondary_delay_scale_hostile, NUM_SKILL_LEVELS);
if (optional_string("$Player Subsys Damage Factor:") || optional_string("$AI Damage Reduction to Player Subsys:"))
parse_float_list(profile->subsys_damage_scale, NUM_SKILL_LEVELS);
if (optional_string("$AI Turn Time Scale:"))
parse_float_list(profile->turn_time_scale, NUM_SKILL_LEVELS);
if (optional_string("$Player Weapon Recharge Scale:"))
parse_float_list(profile->weapon_energy_scale, NUM_SKILL_LEVELS);
if (optional_string("$Max Turret Target Ownage:"))
parse_int_list(profile->max_turret_ownage_target, NUM_SKILL_LEVELS);
if (optional_string("$Max Turret Player Ownage:"))
parse_int_list(profile->max_turret_ownage_player, NUM_SKILL_LEVELS);
if (optional_string("$Percentage Required For Kill Scale:"))
parse_float_list(profile->kill_percentage_scale, NUM_SKILL_LEVELS);
if (optional_string("$Percentage Required For Assist Scale:"))
parse_float_list(profile->assist_percentage_scale, NUM_SKILL_LEVELS);
if (optional_string("$Percentage Awarded For Capship Assist:"))
parse_float_list(profile->assist_award_percentage_scale, NUM_SKILL_LEVELS);
set_flag(profile, "$big ships can attack beam turrets on untargeted ships:", AIPF_BIG_SHIPS_CAN_ATTACK_BEAM_TURRETS_ON_UNTARGETED_SHIPS);
set_flag(profile, "$smart primary weapon selection:", AIPF_SMART_PRIMARY_WEAPON_SELECTION);
set_flag(profile, "$smart secondary weapon selection:", AIPF_SMART_SECONDARY_WEAPON_SELECTION);
set_flag(profile, "$smart shield management:", AIPF_SMART_SHIELD_MANAGEMENT);
set_flag(profile, "$smart afterburner management:", AIPF_SMART_AFTERBURNER_MANAGEMENT);
set_flag(profile, "$allow rapid secondary dumbfire:", AIPF_ALLOW_RAPID_SECONDARY_DUMBFIRE);
set_flag(profile, "$huge turret weapons ignore bombs:", AIPF_HUGE_TURRET_WEAPONS_IGNORE_BOMBS);
set_flag(profile, "$don't insert random turret fire delay:", AIPF_DONT_INSERT_RANDOM_TURRET_FIRE_DELAY);
set_flag(profile, "$hack improve non-homing swarm turret fire accuracy:", AIPF_HACK_IMPROVE_NON_HOMING_SWARM_TURRET_FIRE_ACCURACY);
set_flag(profile, "$shockwaves damage small ship subsystems:", AIPF_SHOCKWAVES_DAMAGE_SMALL_SHIP_SUBSYSTEMS);
set_flag(profile, "$navigation subsystem governs warpout capability:", AIPF_NAVIGATION_SUBSYS_GOVERNS_WARP);
set_flag(profile, "$ignore lower bound for minimum speed of docked ship:", AIPF_NO_MIN_DOCK_SPEED_CAP);
set_flag(profile, "$disable linked fire penalty:", AIPF_DISABLE_LINKED_FIRE_PENALTY);
set_flag(profile, "$disable weapon damage scaling:", AIPF_DISABLE_WEAPON_DAMAGE_SCALING);
set_flag(profile, "$use additive weapon velocity:", AIPF_USE_ADDITIVE_WEAPON_VELOCITY);
set_flag(profile, "$use newtonian dampening:", AIPF_USE_NEWTONIAN_DAMPENING);
set_flag(profile, "$include beams for kills and assists:", AIPF_INCLUDE_BEAMS_IN_STAT_CALCS);
set_flag(profile, "$score kills based on damage caused:", AIPF_KILL_SCORING_SCALES_WITH_DAMAGE);
set_flag(profile, "$score assists based on damage caused:", AIPF_ASSIST_SCORING_SCALES_WITH_DAMAGE);
set_flag(profile, "$allow event and goal scoring in multiplayer:", AIPF_ALLOW_MULTI_EVENT_SCORING);
set_flag(profile, "$fix linked primary weapon decision bug:", AIPF_FIX_LINKED_PRIMARY_BUG);
set_flag(profile, "$prevent turrets targeting too distant bombs:", AIPF_PREVENT_TARGETING_BOMBS_BEYOND_RANGE);
set_flag(profile, "$smart subsystem targeting for turrets:", AIPF_SMART_SUBSYSTEM_TARGETING_FOR_TURRETS);
set_flag(profile, "$fix heat seekers homing on stealth ships bug:", AIPF_FIX_HEAT_SEEKER_STEALTH_BUG);
set_flag(profile, "$multi allow empty primaries:", AIPF_MULTI_ALLOW_EMPTY_PRIMARIES);
set_flag(profile, "$multi allow empty secondaries:", AIPF_MULTI_ALLOW_EMPTY_SECONDARIES);
// if we've been through once already and are at the same place, force a move
if ( saved_Mp && (saved_Mp == Mp) )
Mp++;
// find next valid option
skip_to_start_of_string_either("$", "#");
saved_Mp = Mp;
}
}
required_string("#End");
// add tbl/tbm to multiplayer validation list
extern void fs2netd_add_table_validation(char *tblname);
fs2netd_add_table_validation(filename);
// close localization
lcl_ext_close();
}
void ai_profiles_init()
{
int temp;
if (Ai_profiles_initted)
return;
Num_ai_profiles = 0;
Default_ai_profile = 0;
Default_profile_name[0] = '\0';
// init retail entry first
parse_ai_profiles_tbl(NULL);
// now parse the supplied table (if any)
if (cf_exists_full("ai_profiles.tbl", CF_TYPE_TABLES))
parse_ai_profiles_tbl("ai_profiles.tbl");
// parse any modular tables
parse_modular_table("*-aip.tbm", parse_ai_profiles_tbl);
// set default if specified
temp = ai_profile_lookup(Default_profile_name);
if (temp >= 0)
Default_ai_profile = temp;
Ai_profiles_initted = 1;
}
int ai_profile_lookup(char *name)
{
for (int i = 0; i < Num_ai_profiles; i++)
if (!stricmp(name, Ai_profiles[i].profile_name))
return i;
return -1;
}
-156
View File
@@ -1,156 +0,0 @@
/*
* Created by Ian "Goober5000" Warfield for the FreeSpace2 Source Code Project.
* You may not sell or otherwise commercially exploit the source or things you
* create based on the source.
*/
/*
* $Logfile: /Freespace2/code/ai/ai_profiles.h $
* $Revision: 1.4.2.5 $
* $Date: 2007-07-28 22:04:14 $
* $Author: Goober5000 $
*
* $Log: not supported by cvs2svn $
* Revision 1.4.2.4 2007/07/15 02:45:48 Goober5000
* fixed a small bug in the lab
* moved WMC's no damage scaling flag to ai_profiles and made it work correctly
* removed my old supercap damage scaling change
* moved Turey's truefire flag to ai_profiles
*
* Revision 1.4.2.3 2007/02/27 01:44:44 Goober5000
* add two features for WCS: specifyable shield/weapon recharge rates, and removal of linked fire penalty
*
* Revision 1.4.2.2 2006/07/02 04:13:43 Goober5000
* bah
*
* Revision 1.4.2.1 2006/07/02 03:39:34 Goober5000
* remove associated AI flags
* --Goober5000
*
* Revision 1.4 2006/04/20 06:32:00 Goober5000
* proper capitalization according to Volition
*
* Revision 1.3 2006/03/20 06:19:03 taylor
* add ai_profiles flag to get rid of limit on minimum speed a docked ship can move
* (not going to Int3() here from < 0.1 speed by default, a support ship actually hit it)
*
* Revision 1.2 2005/11/24 08:46:11 Goober5000
* * cleaned up mission_do_departure
* * fixed a hidden crash (array index being -1; would only
* be triggered for ships w/o subspace drives under certain conditions)
* * removed finding a new fighterbay target because it might screw up missions
* * improved clarity, code flow, and readability :)
* * added custom AI flag for disabling warpouts if navigation subsystem fails
* --Goober5000
*
* Revision 1.1 2005/11/21 02:43:30 Goober5000
* change from "setting" to "profile"; this way makes more sense
* --Goober5000
*
*/
#ifndef _AI_PROFILES_H_
#define _AI_PROFILES_H_
#include "globalincs/pstypes.h"
#include "globalincs/globals.h"
#include "globalincs/systemvars.h"
// flags
#define AIPF_SMART_SHIELD_MANAGEMENT (1 << 0)
#define AIPF_BIG_SHIPS_CAN_ATTACK_BEAM_TURRETS_ON_UNTARGETED_SHIPS (1 << 1)
#define AIPF_SMART_PRIMARY_WEAPON_SELECTION (1 << 2)
#define AIPF_SMART_SECONDARY_WEAPON_SELECTION (1 << 3)
#define AIPF_ALLOW_RAPID_SECONDARY_DUMBFIRE (1 << 4)
#define AIPF_HUGE_TURRET_WEAPONS_IGNORE_BOMBS (1 << 5)
#define AIPF_DONT_INSERT_RANDOM_TURRET_FIRE_DELAY (1 << 6)
#define AIPF_HACK_IMPROVE_NON_HOMING_SWARM_TURRET_FIRE_ACCURACY (1 << 7)
#define AIPF_SHOCKWAVES_DAMAGE_SMALL_SHIP_SUBSYSTEMS (1 << 8)
#define AIPF_NAVIGATION_SUBSYS_GOVERNS_WARP (1 << 9)
#define AIPF_NO_MIN_DOCK_SPEED_CAP (1 << 10)
#define AIPF_DISABLE_LINKED_FIRE_PENALTY (1 << 11)
#define AIPF_DISABLE_WEAPON_DAMAGE_SCALING (1 << 12)
#define AIPF_USE_ADDITIVE_WEAPON_VELOCITY (1 << 13)
#define AIPF_USE_NEWTONIAN_DAMPENING (1 << 14)
#define AIPF_INCLUDE_BEAMS_IN_STAT_CALCS (1 << 15)
#define AIPF_KILL_SCORING_SCALES_WITH_DAMAGE (1 << 16)
#define AIPF_ASSIST_SCORING_SCALES_WITH_DAMAGE (1 << 17)
#define AIPF_ALLOW_MULTI_EVENT_SCORING (1 << 18)
#define AIPF_SMART_AFTERBURNER_MANAGEMENT (1 << 19)
#define AIPF_FIX_LINKED_PRIMARY_BUG (1 << 20)
#define AIPF_PREVENT_TARGETING_BOMBS_BEYOND_RANGE (1 << 21)
#define AIPF_SMART_SUBSYSTEM_TARGETING_FOR_TURRETS (1 << 22)
#define AIPF_FIX_HEAT_SEEKER_STEALTH_BUG (1 << 23)
#define AIPF_MULTI_ALLOW_EMPTY_PRIMARIES (1 << 24)
#define AIPF_MULTI_ALLOW_EMPTY_SECONDARIES (1 << 25)
#define MAX_AI_PROFILES 5
typedef struct ai_profile_t {
char profile_name[NAME_LENGTH];
int flags;
// difficulty-related values
int max_incoming_asteroids[NUM_SKILL_LEVELS]; // max number of asteroids thrown at friendlies
int max_allowed_player_homers[NUM_SKILL_LEVELS]; // max number of simultaneous homing weapons on player
int max_attackers[NUM_SKILL_LEVELS]; // max number of ships that can attack a ship
fix predict_position_delay[NUM_SKILL_LEVELS]; // how long until AI predicts a ship position
float in_range_time[NUM_SKILL_LEVELS]; // seconds to add to time it takes to get enemy in range (only for player's enemies)
float shield_manage_delay[NUM_SKILL_LEVELS]; // how long before AI manages shields (note that the player's team always uses the average skill's delay)
// AI ships link primaries if energy levels greater than these percents
float link_energy_levels_always[NUM_SKILL_LEVELS]; // always link
float link_energy_levels_maybe[NUM_SKILL_LEVELS]; // link if hull strength low
// AI ships link primaries if ammunition levels greater than these percents
float link_ammo_levels_always[NUM_SKILL_LEVELS]; // always link
float link_ammo_levels_maybe[NUM_SKILL_LEVELS]; // link if hull strength low
// difficulty-related scales
float cmeasure_life_scale[NUM_SKILL_LEVELS]; // life of countermeasures
float cmeasure_fire_chance[NUM_SKILL_LEVELS]; // chance a countermeasure will be fired based on skill level (also scaled by ai_class)
float weapon_energy_scale[NUM_SKILL_LEVELS]; // weapon energy available
float shield_energy_scale[NUM_SKILL_LEVELS]; // shield energy available
float afterburner_recharge_scale[NUM_SKILL_LEVELS]; // speed of afterburner recharge
float player_damage_scale[NUM_SKILL_LEVELS]; // damage applied to the player
float subsys_damage_scale[NUM_SKILL_LEVELS]; // damage applied to a player subsystem
float beam_friendly_damage_cap[NUM_SKILL_LEVELS]; // damage cap values for friendly beam fire
float turn_time_scale[NUM_SKILL_LEVELS]; // speed at which enemy ships turn
// Multiplicative delay factors for increasing skill levels.
float ship_fire_delay_scale_hostile[NUM_SKILL_LEVELS];
float ship_fire_delay_scale_friendly[NUM_SKILL_LEVELS];
// Multiplicative secondary delay factors for increasing skill levels.
float ship_fire_secondary_delay_scale_hostile[NUM_SKILL_LEVELS];
float ship_fire_secondary_delay_scale_friendly[NUM_SKILL_LEVELS];
// Maximum turrets of one ship allowed to shoot the same target
int max_turret_ownage_target[NUM_SKILL_LEVELS];
int max_turret_ownage_player[NUM_SKILL_LEVELS];
// percentage of damage caused required for a kill/assist
float kill_percentage_scale[NUM_SKILL_LEVELS];
float assist_percentage_scale[NUM_SKILL_LEVELS];
// percentage of the capships score given to other team mates on a kill
float assist_award_percentage_scale[NUM_SKILL_LEVELS];
} ai_profile_t;
extern int Num_ai_profiles;
extern int Default_ai_profile;
extern ai_profile_t Ai_profiles[MAX_AI_PROFILES];
void ai_profiles_init();
int ai_profile_lookup(char *name);
#endif
-31
View File
@@ -1,31 +0,0 @@
/*
* Copyright (C) Volition, Inc. 1999. All rights reserved.
*
* All source code herein is the property of Volition, Inc. You may not sell
* or otherwise commercially exploit the source or things you created based on the
* source.
*
*/
#ifndef _AIINTERNAL_H
#define _AIINTERNAL_H
//Returns true if the specified object is a stealth ship, false if not
bool is_object_stealth_ship(object* objp);
//Number of live turrets on the object attacking
int num_turrets_attacking(object *turret_parent, int target_objnum);
//Determine whether an object is targetable within a nebula (checks for stealth)
int object_is_targetable(object *target, ship *viewer);
//Returns the number of enemy fighters within threshold of pos.
int num_nearby_fighters(int enemy_team_mask, vec3d *pos, float threshold);
//Returns true if OK for *aip to fire its current weapon at its current target.
int check_ok_to_fire(int objnum, int target_objnum, weapon_info *wip);
//Does all the stuff needed to aim and fire a turret.
void ai_fire_from_turret(ship *shipp, ship_subsys *ss, int parent_objnum);
#endif
-2019
View File
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
-191
View File
@@ -1,191 +0,0 @@
// Autopilot.h
// Derek Meek
// 4-30-2004
/*
* $Logfile: /Freespace2/code/Autopilot/Autopilot.h $
* $Revision: 1.9.2.3 $
* $Date: 2007-09-02 02:07:38 $
* $Author: Goober5000 $
*
* $Log: not supported by cvs2svn $
* Revision 1.9.2.2 2007/07/24 20:08:29 Kazan
* Make asteroid/debris fields interrupt autopilot, add "hazards near" message to autopilot.tbl, add use-nav-cinematics sexp, fix mantis #1441
*
* Revision 1.9.2.1 2007/07/23 16:08:23 Kazan
* Autopilot updates, minor misc fixes, working MSVC2005 project files
*
* Revision 1.9 2006/02/25 21:42:31 Goober5000
* fixes from last commit
*
* Revision 1.8 2005/07/13 02:50:49 Goober5000
* remove PreProcDefine #includes in FS2
* --Goober5000
*
* Revision 1.7 2005/04/05 05:53:14 taylor
* s/vector/vec3d/g, better support for different compilers (Jens Granseuer)
*
* Revision 1.6 2004/08/11 05:06:18 Kazan
* added preprocdefines.h to prevent what happened with fred -- make sure to make all fred2 headers include this file as the _first_ include -- i have already modified fs2 files to do this
*
* Revision 1.5 2004/07/27 18:52:10 Kazan
* squished another
*
* Revision 1.4 2004/07/25 19:27:51 Kazan
* only disable afterburning during AIM_WAYPOINTS and AIM_FLY_TO_SHIP while AutoPilotEngaged
*
* Revision 1.3 2004/07/25 00:31:27 Kazan
* i have absolutely nothing to say about that subject
*
* Revision 1.2 2004/07/01 16:38:18 Kazan
* working on autonav
*
* Revision 1.1 2004/05/07 23:50:14 Kazan
* Sorry Guys!
*
*
*
*
*/
#if !defined(_AUTOPILOT_H_)
#define _AUTOPILOT_H_
#include "globalincs/pstypes.h"
#include <map>
// milliseconds between updates
#define NPS_TICKRATE 125
#define MAX_NAVPOINTS 8
#define NP_WAYPOINT 0x0001 // Nav Point is bound to the poistion of a single node of a waypoint path
#define NP_SHIP 0x0002 // Nav Point is bound to the poisiton of a certain ship
#define NP_HIDDEN 0x0004 // Nav Point doesn't show on map and isn't selectable
#define NP_NOACCESS 0x0008 // Nav Point isn't selectable
#define NP_VISITED 0x0100 // Whether we've been within 1,000 meters of this waypoint
#define NP_NOSELECT ( NP_HIDDEN | NP_NOACCESS )
#define NP_VALIDTYPE ( NP_WAYPOINT | NP_SHIP )
struct NavPoint
{
char NavName[32];
int flags;
void *target_obj;
int waypoint_num; //only used when flags & NP_WAYPOINT
vec3d *GetPosition();
char* GetInteralName();
};
#define NP_NUM_MESSAGES 6
#define NP_MSG_FAIL_NOSEL 0
#define NP_MSG_FAIL_GLIDING 1
#define NP_MSG_FAIL_TOCLOSE 2
#define NP_MSG_FAIL_HOSTILES 3
#define NP_MSG_MISC_LINKED 4
#define NP_MSG_FAIL_HAZARD 5
struct NavMessage
{
char message[256];
char filename[256]; // can be ""
};
extern bool AutoPilotEngaged;
extern int CurrentNav;
extern NavPoint Navs[MAX_NAVPOINTS];
extern NavMessage NavMsgs[NP_NUM_MESSAGES];
extern int LockAPConv;
extern std::map<int,int> autopilot_wings;
// Cycles through the NavPoint List
bool Sel_NextNav();
// Tell us is autopilot is allow
// This needs:
// * Nav point selected
// * No enemies within 5,000 meters
// * Destination > 1,000 meters away
bool CanAutopilot(bool send_msg=false);
bool CanAutopilotPos(vec3d targetPos);
// Engages autopilot
// This does:
// * Control switched from player to AI
// * Time compression to 32x
// * Tell AI to fly to targetted Nav Point (for all nav-status wings/ships)
// * Sets max waypoint speed to the best-speed of the slowest ship tagged
void StartAutopilot();
// Checks if autopilot should automatically die
// Returns true if:
// * Targetted waypoint < 1,000 meters away
// * Enemy < 5,000 meters
bool Autopilot_AutoDiable();
// Disengages autopilot
// this does:
// * Time compression to 1x
// * Delete AI nav goal
// * Control switched from AI to player
void EndAutoPilot();
// Checks for changes every NPS_TICKRATE milliseconds
// Checks:
// * if we've gotten close enough to a nav point for it to be counted as "Visited"
// * If we're current AutoNavigating it checks if we need to autodisengage
void NavSystem_Do();
// Inits the Nav System
void NavSystem_Init();
// parse autopilot.tbl
void parse_autopilot_table(char *filename);
// Finds a Nav point by name
int FindNav(char *Nav);
// Set A Nav point to "ZERO"
void ZeroNav(int i);
// Removes a Nav
bool DelNavPoint(char *Nav);
bool DelNavPoint(int nav);
// adds a Nav
bool AddNav_Ship(char *Nav, char *TargetName, int flags);
bool AddNav_Waypoint(char *Nav, char *WP_Path, int node, int flags);
//Change Flags
bool Nav_Alt_Flags(char *Nav, int flags);
// Sexp Accessors
bool Nav_Set_Flag(char *Nav, int flag);
bool Nav_UnSet_Flag(char *Nav, int flag);
bool Nav_Set_Hidden(char *Nav);
bool Nav_Set_NoAccess(char *Nav);
bool Nav_Set_Visited(char *Nav);
bool Nav_UnSet_Hidden(char *Nav);
bool Nav_UnSet_NoAccess(char *Nav);
bool Nav_UnSet_Visited(char *Nav);
// Useful functions
unsigned int DistanceTo(char *nav);
unsigned int DistanceTo(int nav);
bool IsVisited(char *nav);
bool IsVisited(int nav);
void send_autopilot_msg(char *msg, char *snd=NULL);
void send_autopilot_msgID(int msgid);
#endif
-185
View File
@@ -1,185 +0,0 @@
/*
* Copyright (C) Volition, Inc. 1999. All rights reserved.
*
* All source code herein is the property of Volition, Inc. You may not sell
* or otherwise commercially exploit the source or things you created based on the
* source.
*
*/
/*
* $Logfile: /Freespace2/code/bmpman/bm_internal.h $
* $Revision: 2.6.2.1 $
* $Date: 2007-02-11 09:51:21 $
* $Author: taylor $
*
* bmpman info that's internal to bmpman related files only
*
* $Log: not supported by cvs2svn $
* Revision 2.6 2006/05/27 17:20:48 taylor
* clean up BM_TYPE_* stuff so it's a little easier to tell what is what
* bm_load_sub_fast() doesn't need to lowercase filenames, so don't
* byte-swap 16-bit DDS on big endian (they still don't look right though)
* update bm_has_alpha_channel() to be less dumb
*
* Revision 2.5 2006/05/13 07:29:51 taylor
* OpenGL envmap support
* newer OpenGL extension support
* add GL_ARB_texture_rectangle support for non-power-of-2 textures as interface graphics
* add cubemap reading and writing support to DDS loader
* fix bug in DDS loader that made compressed images with mipmaps use more memory than they really required
* add support for a default envmap named "cubemap.dds"
* new mission flag "$Environment Map:" to use a pre-existing envmap
* minor cleanup of compiler warning messages
* get rid of wasteful math from gr_set_proj_matrix()
* remove extra gr_set_*_matrix() calls from starfield.cpp as there was no longer a reason for them to be there
* clean up bmpman flags in reguards to cubemaps and render targets
* disable D3D envmap code until it can be upgraded to current level of code
* remove bumpmap code from OpenGL stuff (sorry but it was getting in the way, if it was more than copy-paste it would be worth keeping)
* replace gluPerspective() call with glFrustum() call, it's a lot less math this way and saves the extra function call
*
* Revision 2.4 2005/11/13 06:44:17 taylor
* small bit of EFF cleanup
* add -img2dds support
* cleanup some D3D stuff (missing a lot since the old code is so unstable I couldn't get it working like I wanted)
* some minor OGL cleanup and small performance changes
* converge the various pcx_read_bitmap* functions into one
* cleanup/rename/remove some cmdline options
*
* Revision 2.3 2005/04/21 15:49:20 taylor
* update of bmpman and model bitmap management, well tested but things may get a bit bumpy
* - use VM_* macros for bmpman since it didn't seem to register the memory correctly (temporary)
* - a little "stupid" fix for dds bitmap reading
* - fix it so that memory is released properly on bitmap read errors
* - some cleanup to model texture loading
* - allow model textures to get released rather than just unloaded, saves bitmap slots
* - bump MAX_BITMAPS to 4750, should be able to decrease after public testing of new code
*
* Revision 2.2 2005/03/03 14:29:37 bobboau
* fixed a small error from my earlier commit.
*
* Revision 2.1 2004/11/23 00:10:06 taylor
* try and protect the bitmap_entry stuff a bit better
* fix the transparent support ship, again, but correctly this time
*
*
* $NoKeywords: $
*/
#ifndef __BM_INTERNAL_H__
#define __BM_INTERNAL_H__
// extra check to make sure this stuff doesn't end up in normal files
// don't use any of this unless BMPMAN_INTERNAL is defined
#ifdef BMPMAN_INTERNAL
#include "globalincs/pstypes.h"
#include "bmpman/bmpman.h"
// no-type ( used in: bm_bitmaps[i].type )
#define BM_TYPE_NONE 0
// in-memory type ( used in: bm_bitmaps[i].type )
#define BM_TYPE_USER 1
// file-type types ( used in: bm_bitmaps[i].type )
#define BM_TYPE_PCX 2
#define BM_TYPE_TGA 3 // 16 or 32 bit targa
#define BM_TYPE_DDS 4 // generic identifier for DDS
#define BM_TYPE_JPG 5 // 32 bit jpeg
#define BM_TYPE_ANI 6 // in-house ANI format
#define BM_TYPE_EFF 7 // specifies any type of animated image, the EFF itself is just text
// c-type types ( used in: bm_bitmaps[i].c_type )
#define BM_TYPE_DXT1 8 // 24 bit with switchable alpha (compressed)
#define BM_TYPE_DXT3 9 // 32 bit with 4 bit alpha (compressed)
#define BM_TYPE_DXT5 10 // 32 bit with 8 bit alpha (compressed)
#define BM_TYPE_CUBEMAP_DDS 11 // generic DDS cubemap (uncompressed cubemap surface)
#define BM_TYPE_CUBEMAP_DXT1 12 // 24-bit cubemap (compressed cubemap surface)
#define BM_TYPE_CUBEMAP_DXT3 13 // 32-bit cubemap (compressed cubemap surface)
#define BM_TYPE_CUBEMAP_DXT5 14 // 32-bit cubemap (compressed cubemap surface)
// special types ( used in: bm_bitmaps[i].type )
#define BM_TYPE_RENDER_TARGET_STATIC 16 // 24/32 bit setup internally as a static render target
#define BM_TYPE_RENDER_TARGET_DYNAMIC 17 // 24/32 bit setup internally as a dynamic render target
/// Moved from cpp file ///////////////////
// Consider these 'protected' structures and functions that should only be used by special bitmap functions
typedef union bm_extra_info {
struct {
// Stuff needed for animations
int first_frame; // used for animations -- points to index of first frame
ubyte num_frames; // used for animation -- number of frames in the animation
ubyte fps; // used for animation -- frames per second
struct {
// stuff for static animations
ubyte type; // type for individual images
char filename[MAX_FILENAME_LEN]; // filename for individual images
} eff;
} ani;
struct {
// Stuff needed for user bitmaps
void *data; // For user bitmaps, this is where the data comes from
ubyte bpp; // For user bitmaps, this is what format the data is
ubyte flags; // Flags passed to bm_create
} user;
} bm_extra_info;
typedef struct bitmap_entry {
// identification
char filename[MAX_FILENAME_LEN]; // filename for this bitmap
uint signature; // a unique signature identifying the data
uint palette_checksum; // checksum used to be sure bitmap is in current palette
int handle; // Handle = id*MAX_BITMAPS + bitmapnum
int last_used; // When this bitmap was last used
ubyte type; // PCX, USER, ANI, etc
ubyte comp_type; // What sort of compressed type, BM_TYPE_NONE if not compressed
signed char ref_count; // Number of locks on bitmap. Can't unload unless ref_count is 0.
int dir_type; // which directory this was loaded from (to skip other locations with same name)
// compressed bitmap stuff (.dds) - RT please take a look at this and tell me if we really need it
int mem_taken; // How much memory does this bitmap use? - UnknownPlayer
int num_mipmaps; // number of mipmap levels, we need to read all of them
// Stuff to keep track of usage
ubyte preloaded; // If set, then this was loaded from the lst file
int preload_count; // how many times this gets used in game, for unlocking
ubyte used_flags; // What flags it was accessed thru
int load_count;
// Bitmap info
bitmap bm;
// Data for animations and user bitmaps
bm_extra_info info;
#ifdef BMPMAN_NDEBUG
// bookeeping
ubyte used_last_frame; // If set, then it was used last frame
ubyte used_this_frame; // If set, then it was used this frame
int data_size; // How much data this bitmap uses
int used_count; // How many times it was accessed
#endif
} bitmap_entry;
extern bitmap_entry bm_bitmaps[MAX_BITMAPS];
// image specific lock functions
void bm_lock_ani( int handle, int bitmapnum, bitmap_entry *be, bitmap *bmp, ubyte bpp, ubyte flags );
void bm_lock_dds( int handle, int bitmapnum, bitmap_entry *be, bitmap *bmp, ubyte bpp, ubyte flags );
void bm_lock_jpg( int handle, int bitmapnum, bitmap_entry *be, bitmap *bmp, ubyte bpp, ubyte flags );
void bm_lock_pcx( int handle, int bitmapnum, bitmap_entry *be, bitmap *bmp, ubyte bpp, ubyte flags );
void bm_lock_tga( int handle, int bitmapnum, bitmap_entry *be, bitmap *bmp, ubyte bpp, ubyte flags );
void bm_lock_user( int handle, int bitmapnum, bitmap_entry *be, bitmap *bmp, ubyte bpp, ubyte flags );
#endif // BMPMAN_INTERNAL
#endif // __BM_INTERNAL_H__
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
-179
View File
@@ -1,179 +0,0 @@
#ifndef _CAMERA_H
#define _CAMERA_H
#include "graphics/2d.h"
#include "globalincs/pstypes.h"
#include "globalincs/globals.h"
#include "physics/physics.h" //for avd
#include "object/object.h"
#include <string>
#include <vector>
#define CAM_STATIONARY_FOV (1<<0)
#define CAM_STATIONARY_ORI (1<<1)
#define CAM_STATIONARY_POS (1<<2)
#define CAM_DEFAULT_FLAGS 0
class camera
{
friend class avd_camera;
protected:
char name[NAME_LENGTH];
int sig;
int flags;
object_h object_host;
int object_host_submodel;
object_h object_target;
int object_target_submodel;
void (*func_custom_position)(camera *cam, vec3d *pos);
void (*func_custom_orientation)(camera *cam, matrix *ori);
avd_movement fov;
avd_movement pos_x;
avd_movement pos_y;
avd_movement pos_z;
//avd_movement ori_p;
//avd_movement ori_b;
//avd_movement ori_h;
//avd_movement ori_progress;
//matrix ori_initial;
//matrix ori_final;
avd_movement ori[9];
//Cache stuff
float c_fov;
vec3d c_pos;
matrix c_ori;
public:
camera(char *in_name=NULL, int in_signature=-1);
~camera();
void clear();
void reset();
//Set
void set_name(char *in_name);
void set_object_host(object *objp, int n_object_host_submodel = -1);
void set_object_target(object *objp, int n_object_target_submodel = -1);
void set_custom_position_function(void (*n_func_custom_position)(camera *cam, vec3d *pos));
void set_custom_orientation_function(void (*n_func_custom_orientation)(camera *cam, matrix *ori));
void set_fov(float in_fov, float in_fov_time = 0.0f, float in_fov_acceleration_time = 0.0f, float in_deceleration_time = 0.0f);
void set_position(vec3d *in_position = NULL, float in_translation_time = 0.0f, float in_translation_acceleration_time = 0.0f, float in_translation_deceleration_time = 0.0f, float in_end_velocity = 0.0f);
void set_translation_velocity(vec3d *in_velocity, float in_acceleration_time = 0.0f);
void set_rotation(matrix *in_orientation = NULL, float in_rotation_time = 0.0f, float in_rotation_acceleration_time = 0.0f, float in_rotation_deceleration_time = 0.0f);
void set_rotation(angles *in_angles, float in_rotation_time = 0.0f, float in_rotation_acceleration_time = 0.0f, float in_rotation_deceleration_time = 0.0f);
void set_rotation_facing(vec3d *in_target, float in_rotation_time = 0.0f, float in_rotation_acceleration_time = 0.0f, float in_rotation_deceleration_time = 0.0f);
void set_rotation_velocity(angles *in_rotation_rate, float in_acceleration_time = 0.0f);
//Get
char *get_name() {return name;}
int get_signature() {return sig;}
object *get_object_host();
int get_object_host_submodel();
object *get_object_target();
int get_object_target_submodel();
float get_fov();
void get_info(vec3d *position, matrix *orientation);
//Is
bool is_empty(){return sig < 0;}
//Do
void do_frame(float in_frametime);
};
class warp_camera
{
private:
float c_time;
float c_damping;
vec3d c_vel;
vec3d c_desired_vel;
vec3d c_pos;
matrix c_ori;
public:
warp_camera();
warp_camera(object *objp);
void reset();
void set_position(vec3d *in_pos);
void set_rotation(matrix *in_ori);
void set_velocity(vec3d *in_vel, bool instantaneous);
void do_frame(float in_frametime);
void get_info(vec3d *position, matrix *orientation);
};
extern warp_camera Warp_camera;
class subtitle
{
private:
void clone(const subtitle &sub);
std::vector<std::string> text_lines;
float text_pos[2];
float display_time;
float fade_time;
color text_color;
//Done with set
char imageanim[MAX_FILENAME_LEN];
int image_id;
int image_pos[2];
//Time this has been displayed
float time_displayed;
//When to end it
float time_displayed_end;
public:
subtitle(int in_x_pos, int in_y_pos, char* in_text, float in_display_time, char* in_imageanim = NULL, float in_fade_time = 0.0f, color *in_text_color = NULL, bool center_x = false, bool center_y = false, int in_width = 200);
~subtitle();
subtitle(const subtitle &sub) { clone(sub); }
const subtitle &operator=(const subtitle &sub);
void do_frame(float frametime);
};
//Some global stuff
extern std::vector<subtitle> Subtitles;
extern float VIEWER_ZOOM_DEFAULT;
extern float Sexp_fov;
//Helpful functions
void cam_init();
void cam_close();
void cam_do_frame(float frametime);
camid cam_create(char *n_name=NULL, vec3d *n_pos=NULL, matrix *n_ori=NULL, object *n_object=NULL, int n_submodel_parent=-1);
camid cam_create(char *n_name, vec3d *n_pos, vec3d *n_norm, object *n_object=NULL, int n_submodel_parent=-1);
void cam_delete(camid cid);
bool cam_set_camera(camid cid);
void cam_reset_camera();
camid cam_lookup(char *name);
camid cam_get_camera(uint index);
camid cam_get_current();
uint cam_get_num();
void subtitles_init();
void subtitles_close();
void subtitles_do_frame(float frametime);
#endif // _CAMERA_H
File diff suppressed because it is too large. Load diff
-465
View File
@@ -1,465 +0,0 @@
/*
* Copyright (C) Volition, Inc. 1999. All rights reserved.
*
* All source code herein is the property of Volition, Inc. You may not sell
* or otherwise commercially exploit the source or things you created based on the
* source.
*
*/
/*
* $Logfile: /Freespace2/code/Cfilearchiver/CfileArchiver.cpp $
* $Revision: 2.4.2.1 $
* $Date: 2007-05-11 03:09:21 $
* $Author: taylor $
*
* Program to create an archive file for use with cfile stuff
*
* $Log: not supported by cvs2svn $
* Revision 2.4 2005/11/13 06:38:04 taylor
* never did port this stupid thing to PPC
*
* Revision 2.3 2005/09/08 00:09:31 taylor
* fix building/linking of command line tools under Linux/OSX
* add tools as targets to OSX project file
*
* Revision 2.2 2005/01/30 12:50:08 taylor
* merge with Linux/OSX tree - p0130
*
* Revision 2.1 2003/11/16 09:42:37 Goober5000
* clarified and pruned debug spew messages
* --Goober5000
*
* Revision 2.0 2002/06/03 04:02:21 penguin
* Warpcore CVS sync
*
* Revision 1.1 2002/05/02 18:03:04 mharris
* Initial checkin - converted filenames and includes to lower case
*
*
* 2 10/23/98 6:15p Dave
*
* $NoKeywords: $
*/
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#ifdef _WIN32
#include <direct.h>
#include <io.h>
#include <conio.h>
#else
#include <dirent.h>
#include <unistd.h>
#include <sys/stat.h>
#include <sys/types.h>
#endif
#include "globalincs/pstypes.h"
#include "cfile/cfile.h"
static int data_error;
static int no_dir;
// right out of pstypes.h but we don't want to use the INTEL_INT macro here
// since it would require SDL which isn't used on WIN32 platforms
#if BYTE_ORDER == BIG_ENDIAN
#define INT_SWAP(x) ( \
(x << 24) | \
(((ulong)x) >> 24) | \
((x & 0x0000ff00) << 8) | \
((x & 0x00ff0000) >> 8) \
)
#else
#define INT_SWAP(x) (x)
#endif
size_t fswrite_int(int *wint, FILE *stream)
{
int tmp = *wint;
tmp = INT_SWAP(tmp);
return fwrite(&tmp, 1, sizeof(int), stream);
}
unsigned int Total_size=16; // Start with size of header
unsigned int Num_files =0;
FILE *fp_out = NULL;
FILE *fp_out_hdr = NULL;
typedef struct vp_header {
char id[4];
int version;
int index_offset;
int num_files;
} vp_header;
//vp_header Vp_header;
char archive_dat[1024];
char archive_hdr[1024];
#define BLOCK_SIZE (1024*1024)
#define VERSION_NUMBER 2;
char tmp_data[BLOCK_SIZE]; // 1 MB
void write_header()
{
int ver = VERSION_NUMBER;
fseek(fp_out, 0, SEEK_SET);
fwrite("VPVP", 1, 4, fp_out);
fswrite_int(&ver, fp_out);
fswrite_int((int*)&Total_size, fp_out);
fswrite_int((int*)&Num_files, fp_out);
}
int write_index(char *hf, char *df)
{
FILE *h = NULL, *d = NULL;
unsigned int i;
h = fopen(hf, "rb");
d = fopen(df, "a+b");
if ( (h == NULL) || (d == NULL) )
{
if ( h )
fclose( h );
if ( d )
fclose( d );
return 0;
}
for (i = 0; i < Num_files; i++) {
fread(tmp_data, 32+4+4+4, 1, h);
fwrite(tmp_data, 32+4+4+4, 1, d);
}
fclose(h);
fclose(d);
unlink(hf);
return 1;
}
void pack_file( char *filespec, char *filename, int filesize, _fs_time_t time_write )
{
char path[1024];
if ( strstr( filename, ".vp" )) {
// Don't pack yourself!!
return;
}
if ( strstr( filename, ".hdr" )) {
// Don't pack yourself!!
return;
}
if ( filesize == 0 ) {
// Don't pack 0 length files, screws up directory structure!
return;
}
if ( strlen(filename) > 31 ) {
printf( "Filename '%s' too long! Skipping...\n", filename );
return;
}
memset( path, 0, sizeof(path) );
strcpy( path, filename );
fswrite_int( (int*)&Total_size, fp_out_hdr );
fswrite_int( &filesize, fp_out_hdr );
fwrite( &path, 1, 32, fp_out_hdr );
fswrite_int( (int*)&time_write, fp_out_hdr );
Total_size += filesize;
Num_files++;
printf( "Packing %s%s%s...", filespec, DIR_SEPARATOR_STR, filename );
sprintf( path, "%s%s%s", filespec, DIR_SEPARATOR_STR, filename );
FILE *fp = fopen( path, "rb" );
if ( fp == NULL ) {
printf( "Error opening '%s'\n", path );
exit(1);
}
int nbytes, nbytes_read=0;
do {
nbytes = fread( tmp_data, 1, BLOCK_SIZE, fp );
if ( nbytes > 0 ) {
fwrite( tmp_data, 1, nbytes, fp_out );
nbytes_read += nbytes;
}
} while( nbytes > 0 );
fclose(fp);
printf( " %d bytes\n", nbytes_read );
}
// This function adds a directory marker to the header file
void add_directory( char * dirname)
{
char path[256];
char *pathptr = path;
char *tmpptr;
int i = 0;
strcpy(path, dirname);
fswrite_int( (int*)&Total_size, fp_out_hdr);
fswrite_int( &i, fp_out_hdr);
// strip out any directories that this dir is a subdir of
while ( (tmpptr = strchr(pathptr, DIR_SEPARATOR_CHAR)) != NULL ) {
pathptr = tmpptr+1;
}
fwrite(pathptr, 1, 32, fp_out_hdr);
fswrite_int( &i, fp_out_hdr); // timestamp = 0
Num_files++;
}
void pack_directory( char * filespec)
{
#ifdef _WIN32
int find_handle;
_finddata_t find;
#endif
char tmp[512];
char tmp1[512];
char *ts;
// strip trailing slash
ts = filespec + (strlen(filespec) - 1);
while ( (*ts == DIR_SEPARATOR_CHAR) && (ts > filespec) )
*ts = '\0';
strcpy( tmp1, filespec );
add_directory(filespec);
strcat( tmp1, DIR_SEPARATOR_STR"*.*" );
printf( "In dir '%s'\n", tmp1 );
#ifdef _WIN32
find_handle = _findfirst( tmp1, &find );
if( find_handle != -1 ) {
if ( find.attrib & _A_SUBDIR ) {
if (strcmp( "..", find.name) && strcmp( ".", find.name) && strcmp( ".svn", find.name)) {
strcpy( tmp, filespec );
strcat( tmp, "\\" );
strcat( tmp, find.name );
pack_directory(tmp);
}
} else {
pack_file( filespec, find.name, find.size, find.time_write );
}
while( !_findnext( find_handle, &find ) ) {
if ( find.attrib & _A_SUBDIR ) {
if (strcmp( "..", find.name) && strcmp( ".", find.name) && strcmp( ".svn", find.name)) {
strcpy( tmp, filespec );
strcat( tmp, "\\" );
strcat( tmp, find.name );
pack_directory(tmp);
}
} else {
pack_file( filespec, find.name, find.size, find.time_write );
}
}
}
#else
DIR *dirp;
struct dirent *dir;
dirp = opendir (filespec);
if ( dirp ) {
while ((dir = readdir(dirp)) != NULL) {
char fn[MAX_PATH];
snprintf(fn, MAX_PATH-1, "%s/%s", filespec, dir->d_name);
fn[MAX_PATH-1] = 0;
struct stat buf;
if (stat(fn, &buf) == -1) {
continue;
}
if ( (strcmp(dir->d_name, ".") == 0) || (strcmp(dir->d_name, "..") == 0) ) {
continue;
}
if ( (strcmp(dir->d_name, ".svn") == 0) ) {
continue;
}
if (S_ISDIR(buf.st_mode)) {
strcpy( tmp, filespec );
strcat( tmp, "/" );
strcat( tmp, dir->d_name );
pack_directory(tmp);
} else {
pack_file( filespec, dir->d_name, buf.st_size, buf.st_mtime );
}
}
closedir(dirp);
} else {
printf("Error: Source directory does not exist!\n");
no_dir = 1;
}
#endif
add_directory("..");
}
int verify_directory( char *filespec )
{
char *ts;
char *dd;
// strip trailing '/'
ts = filespec+(strlen(filespec)-1);
while ( (*ts == DIR_SEPARATOR_CHAR) && (ts > filespec) )
*ts = '\0';
// make sure last directory is named "data", ignoring case
dd = filespec + (strlen(filespec) - 4);
if ( stricmp( dd, "data" ) )
data_error = 1;
return data_error;
}
void print_instructions()
{
printf( "Creates a vp archive out of a FreeSpace data tree.\n\n" );
printf( "Usage: cfilearchiver archive_name src_dir\n");
printf( "Example: cfilearchiver freespace /tmp/freespace/data\n\n");
printf( "Directory structure options:\n" );
printf( " Effects (.ani .pcx .neb .tga)\n" );
printf( " Fonts (.vf)\n" );
printf( " Hud (.ani .pcx .tga\n" );
printf( " Interface (.pcx .ani .tga)\n" );
printf( " Maps (.pcx .ani .tga)\n" );
printf( " Missions (.ntl .ssv), FS1(.fsm .fsc), FS2(.fs2 .fc2)\n" );
printf( " Models (.pof)\n" );
printf( " Music (.wav)\n" );
printf( " Sounds/8b22k (.wav)\n" );
printf( " Sounds/16b11k (.wav)\n" );
printf( " Tables (.tbl)\n" );
printf( " Voice/Briefing (.wav)\n" );
printf( " Voice/Command briefings (.wav)\n" );
printf( " Voice/Debriefing (.wav)\n" );
printf( " Voice/Personas (.wav)\n" );
printf( " Voice/Special (.wav)\n" );
printf( " Voice/Training (.wav)\n" );
exit(0);
}
// we end up #include'ing SDL.h which on Windows and Mac will redfine main() which is something
// that we don't want since we don't actually link against SDL, this solves the problem...
#ifdef main
#undef main
#endif
int main(int argc, char *argv[] )
{
char archive[1024];
char *p;
if ( argc < 3 ) {
#ifdef _WIN32
printf( "Usage: %s archive_name src_dir\n", argv[0] );
printf( "Example: %s freespace c:\\freespace\\data\n", argv[0] );
printf( "Creates an archive named freespace out of the\nfreespace data tree\n" );
printf( "Press any key to exit...\n" );
getch();
return 1;
#else
print_instructions();
#endif
}
strcpy( archive, argv[1] );
p = strchr( archive, '.' );
if (p) *p = 0; // remove extension
strcpy( archive_dat, archive );
strcat( archive_dat, ".vp" );
strcpy( archive_hdr, archive );
strcat( archive_hdr, ".hdr" );
fp_out = fopen( archive_dat, "wb" );
if ( !fp_out ) {
printf( "Couldn't open '%s'!\n", archive_dat );
#ifdef _WIN32
printf( "Press any key to exit...\n" );
getch();
return 1;
#else
exit(1);
#endif
}
fp_out_hdr = fopen( archive_hdr, "wb" );
if ( !fp_out_hdr ) {
printf( "Couldn't open '%s'!\n", archive_hdr );
#ifdef _WIN32
printf( "Press any key to exit...\n" );
getch();
return 1;
#else
exit(2);
#endif
}
if ( verify_directory( argv[2] ) != 0 ) {
printf("Warning! Last directory must be named \"data\" (not case sensitive)\n");
exit(3);
}
write_header();
pack_directory( argv[2] );
// in case the directory doesn't exist
if ( no_dir )
exit(4);
write_header();
fclose(fp_out);
fclose(fp_out_hdr);
printf( "Data files written, appending index...\n" );
if (!write_index(archive_hdr, archive_dat)) {
printf("Error appending index!\n");
#ifdef _WIN32
printf("Press any key to exit...\n");
getch();
#endif
return 1;
}
printf( "%d total KB.\n", Total_size/1024 );
return 0;
}
-537
View File
@@ -1,537 +0,0 @@
/*
* Copyright (C) 2005 Taylor Richards
*
*/
/*
* $Logfile: /Freespace2/code/cfileextractor/cfileextractor.cpp $
* $Revision: 1.9 $
* $Date: 2006-01-20 07:10:33 $
* $Author: Goober5000 $
*
* Cross-platform cmdline extractor for VP files
*
* $Log: not supported by cvs2svn $
* Revision 1.8 2005/09/24 02:40:09 Goober5000
* get rid of a whole bunch of Microsoft warnings
* --Goober5000
*
* Revision 1.7 2005/09/20 02:45:47 taylor
* bump version to 0.6
* add a specified directory to output files to
*
* Revision 1.6 2005/09/08 05:04:15 taylor
* make it actually compile under WIN32
* bump version to 0.5 since little else is going to be done to this thing
*
* Revision 1.5 2005/09/08 00:09:31 taylor
* fix building/linking of command line tools under Linux/OSX
* add tools as targets to OSX project file
*
* Revision 1.4 2005/05/24 20:52:10 taylor
* make sure that we recursively create directories for Linux/OSX
* replace older recursive mkdir method in cfileextractor with new method
*
* Revision 1.3 2005/05/24 03:12:27 taylor
* get command sanity check right, fixes lowercase on extract too
*
* Revision 1.2 2005/05/18 01:57:54 taylor
* a few help text adjustments and fix some compiler warnings
*
* Revision 1.1 2005/05/17 21:00:57 taylor
* Initial import of cfileextractor, still needs some work but does what it needs to
*
*
* $NoKeywords: $
*/
#include "cfile/cfile.h"
#include "globalincs/pstypes.h"
#include <vector>
#include <iostream>
#include <cstdlib>
#include <cstdio>
#include <cstring>
#include <ctime>
#ifdef _WIN32
#include <direct.h>
#else
#include <unistd.h>
#endif
#include <sys/stat.h>
#include <sys/types.h>
#include <errno.h>
// /////////////////////////////////////////////////////////////////////////////
//
// GLOBAL FUNCTIONS AND VARIABLES
//
// right out of pstypes.h but we don't want to use the INTEL_INT macro here
// since it would require SDL which isn't used on WIN32 platforms
#if BYTE_ORDER == BIG_ENDIAN
#define INT_SWAP(x) ( \
(x << 24) | \
(((ulong)x) >> 24) | \
((x & 0x0000ff00) << 8) | \
((x & 0x00ff0000) >> 8) \
)
#else
#define INT_SWAP(x) (x)
#endif
FILE *fp_in = NULL;
FILE *fp_out = NULL;
#ifndef MAX_PATH
#define MAX_PATH 255
#endif
char out_dir[MAX_PATH];
#define BLOCK_SIZE (1024*1024)
char tmp_data[BLOCK_SIZE]; // 1 MB
static int have_index = 0;
static int have_header = 0;
#define ERR_NO_FP_IN 0
#define ERR_NO_FP_OUT 1
#define ERR_INVALID_VP 2
#define ERR_NO_INDEX 3
#define ERR_NO_HEADER 4
#define ERR_PATH_TOO_LONG 5
typedef struct vp_header {
char id[4]; // 'VPVP'
int version;
int index_offset; // offset where the file index starts, also a total file data size count
int num_files; // number of files, including each step in the directory structure
} vp_header;
vp_header VP_Header;
typedef struct vp_fileinfo {
// stuff that is actually written to the VP
int offset; // offset of where this file is in the VP
int file_size; // size of file
char file_name[CF_MAX_FILENAME_LENGTH]; // filename
_fs_time_t write_time; // date/time in _fs_time_t type (a 32-bit version of time_t)
// not in the VP
char file_path[CF_MAX_PATHNAME_LENGTH]; // file path, generated here and not actually in the VP on a per file basis
vp_fileinfo() {
offset = 0;
file_size = 0;
file_name[0] = '\0';
file_path[0] = '\0';
write_time = 0;
}
~vp_fileinfo() {}
} vp_fileinfo;
std::vector<vp_fileinfo> VP_FileInfo;
// just like strlwr() but without actually including it here
void lowercase(char *s)
{
if (s == NULL)
return;
while (*s) {
*s = tolower(*s);
s++;
}
}
//
// /////////////////////////////////////////////////////////////////////////////
// /////////////////////////////////////////////////////////////////////////////
//
// The useful stuff...
//
void print_error(int err)
{
switch (err) {
case ERR_NO_FP_IN:
printf("ERROR: The input file (fp_in) is NULL! Exiting...\n");
break;
case ERR_NO_FP_OUT:
printf("ERROR: The output file (fp_out) is NULL! Exiting...\n");
break;
case ERR_INVALID_VP:
printf("ERROR: The specified VP file is invalid! Exiting...\n");
break;
case ERR_NO_INDEX:
printf("ERROR: No file index is available! Exiting...\n");
break;
case ERR_NO_HEADER:
printf("ERROR: No file header is available! Exiting...\n");
break;
case ERR_PATH_TOO_LONG:
printf("ERROR: Path to output directory is too long! Exiting...\n");
break;
default:
break;
}
exit(1);
}
void read_header()
{
fseek(fp_in, 0, SEEK_SET);
fread(&VP_Header.id, 1, 4, fp_in);
fread(&VP_Header.version, 1, sizeof(int), fp_in);
fread(&VP_Header.index_offset, 1, sizeof(int), fp_in);
fread(&VP_Header.num_files, 1, sizeof(int), fp_in);
VP_Header.version = INT_SWAP(VP_Header.version);
VP_Header.index_offset = INT_SWAP(VP_Header.index_offset);
VP_Header.num_files = INT_SWAP(VP_Header.num_files);
// check for a valid id (VPVP)
if ( (VP_Header.id[0] != 'V') && (VP_Header.id[1] != 'P') && (VP_Header.id[2] != 'V') && (VP_Header.id[3] != 'P') )
print_error(ERR_INVALID_VP);
// the index_offset needs to be greater than the size of vp_header at the very least and there should be at least one file
if ( !(VP_Header.index_offset > (int)sizeof(vp_header)) || !(VP_Header.num_files > 1) )
print_error(ERR_INVALID_VP);
have_header = 1;
}
void read_index(int lc = 0)
{
if (fp_in == NULL)
print_error(ERR_NO_FP_IN);
else if (!have_header)
print_error(ERR_NO_HEADER);
int i;
char path[CF_MAX_PATHNAME_LENGTH];
fseek(fp_in, VP_Header.index_offset, SEEK_SET);
memset(path, 0, CF_MAX_PATHNAME_LENGTH);
for ( i = 0; i < VP_Header.num_files; i++) {
vp_fileinfo vpinfo;
fread(&vpinfo.offset, 1, sizeof(int), fp_in);
fread(&vpinfo.file_size, 1, sizeof(int), fp_in);
fread(&vpinfo.file_name, 1, CF_MAX_FILENAME_LENGTH, fp_in);
fread(&vpinfo.write_time, 1, sizeof(_fs_time_t), fp_in);
vpinfo.offset = INT_SWAP(vpinfo.offset);
vpinfo.file_size = INT_SWAP(vpinfo.file_size);
vpinfo.write_time = INT_SWAP(vpinfo.write_time);
// check if it's a directory and if so then create a path to use for files
if (vpinfo.file_size == 0) {
// if we get a ".." then drop down in the path
if (!strcmp(vpinfo.file_name, "..")) {
char *s = strrchr(path, DIR_SEPARATOR_CHAR);
if (s)
*s = '\0';
// skip, we don't want to add the ".." to the path
continue;
}
// don't add the very first directory separator character, easier to clean later
if (path[0] != 0)
strcat( path, DIR_SEPARATOR_STR );
// always make directory names lower case for ease of use
lowercase( vpinfo.file_name );
strcat( path, vpinfo.file_name );
} // it's a file then
else {
// lowercase the filename if wanted
if (lc == 1)
lowercase( vpinfo.file_name );
strcpy( vpinfo.file_path, path );
VP_FileInfo.push_back(vpinfo);
}
}
have_index = 1;
}
void extract_all_files(char *file)
{
if (fp_in == NULL)
print_error(ERR_NO_FP_IN);
else if (!have_header)
print_error(ERR_NO_HEADER);
else if (!have_index)
print_error(ERR_NO_INDEX);
int status, m_error, nbytes, nbytes_remaining;
char path[CF_MAX_PATHNAME_LENGTH+CF_MAX_FILENAME_LENGTH+1]; // path length + filename length + extra NULL
char path2[CF_MAX_PATHNAME_LENGTH+CF_MAX_FILENAME_LENGTH+1]; // path length + filename length + extra NULL
char *c;
ubyte have_outdir = 0;
int out_len = strlen(out_dir);
if (out_len > 0)
have_outdir = 1;
printf("VP file extractor - version 0.6\n");
printf("\n");
if (have_outdir) {
printf("Output directory: \"%s\"\n", out_dir);
}
printf("Extracting: %s...\n", file);
for (uint i = 0; i < VP_FileInfo.size(); i++) {
// save the file path to a temp location and recursively make the needed directories
if (have_outdir) {
if ( (out_len + 1 + strlen(path)) > MAX_PATH-1 )
print_error(ERR_PATH_TOO_LONG);
sprintf(path, "%s%s%s%s", out_dir, DIR_SEPARATOR_STR, VP_FileInfo[i].file_path, DIR_SEPARATOR_STR);
} else {
sprintf(path, "%s%s", VP_FileInfo[i].file_path, DIR_SEPARATOR_STR);
}
c = &path[0];
while (c++) {
c = strchr(c, DIR_SEPARATOR_CHAR);
if (c) {
*c = '\0'; // NULL at DIR_SEP char
#ifdef _WIN32
status = _mkdir(path);
#else
status = mkdir(path, 0777);
#endif
m_error = errno;
if (status && (m_error != EEXIST) ) {
printf("Cannot mkdir %s: %s\n", VP_FileInfo[i].file_path, strerror(m_error));
continue;
}
*c = DIR_SEPARATOR_CHAR; // replace DIR_SEP char
}
}
memset( path, 0, CF_MAX_PATHNAME_LENGTH+CF_MAX_FILENAME_LENGTH+1);
// start writing out the file
fseek(fp_in, VP_FileInfo[i].offset, SEEK_SET);
sprintf(path, "%s%s%s", VP_FileInfo[i].file_path, DIR_SEPARATOR_STR, VP_FileInfo[i].file_name);
// this is cheap, I know.
if (have_outdir) {
if ( (out_len + 1 + strlen(path)) > MAX_PATH-1 )
print_error(ERR_PATH_TOO_LONG);
sprintf(path2, "%s%s%s", out_dir, DIR_SEPARATOR_STR, path);
} else {
strcpy(path2, path);
}
fp_out = fopen(path2, "wb");
printf(" %s ... ", path);
if (fp_out == NULL) {
printf("can't create file!\n");
continue;
}
nbytes_remaining = VP_FileInfo[i].file_size;
while ( nbytes_remaining > 0 ) {
nbytes = fread( tmp_data, 1, MIN(BLOCK_SIZE, nbytes_remaining), fp_in );
if (nbytes > 0) {
fwrite( tmp_data, 1, nbytes, fp_out );
nbytes_remaining -= nbytes;
}
}
printf("done!\n");
fclose(fp_out);
fp_out = NULL;
}
printf("\n");
}
// TODO: the formatting of this is a bit loco but I don't care enough to make it better...
void list_all_files(char *file)
{
char out_time[20];
float one_k = 1024.0f;
float one_m = 1048576.0f;
char m;
float div_by;
time_t plat_time;
// if we don't have an index then bail
if (!have_index)
print_error(ERR_NO_INDEX);
printf("VP file extractor - version 0.6\n");
printf("\n");
printf("%s:\n", file);
printf("\n");
printf(" Name Size Offset Date/Time Path\n");
printf("-------------------------------------------------------------------------------\n");
for (uint i = 0; i < VP_FileInfo.size(); i++) {
plat_time = VP_FileInfo[i].write_time; // gets rid of some platform strangeness this way
strftime(out_time, 32, "%F %H:%M", localtime(&plat_time)); // YYYY-mm-dd HH:mm (ISO 8601 date format, 24-hr time)
if (VP_FileInfo[i].file_size > (int)one_m) {
m = 'M';
div_by = one_m;
} else {
m = 'K';
div_by = one_k;
}
int len = strlen( VP_FileInfo[i].file_name );
printf("%s %*.1f%c %10i %18s %3s%s\n", VP_FileInfo[i].file_name, 33 - len, (float)VP_FileInfo[i].file_size/div_by, m, VP_FileInfo[i].offset, out_time, DIR_SEPARATOR_STR, VP_FileInfo[i].file_path);
}
printf("\n");
// we use the vector size here since VP_Header.num_files would include each entry
// in the directory tree as well as individual files and that artificially inflates
// the number of files that we show or would extract
printf("Total files: %i\n", (int)VP_FileInfo.size());
// yeah, I'm just that cheap
if (VP_Header.index_offset > (int)one_m) {
m = 'M';
div_by = one_m;
} else {
m = 'K';
div_by = one_k;
}
printf("Total size: %.1f%c\n", (float)VP_Header.index_offset/div_by, m);
printf("\n");
}
void help()
{
printf("VP file extractor - version 0.6\n");
printf("\n");
printf("Usage: cfileextractor [-x | -l] [-L] [-o <dir>] <vp_filename>\n");
printf("\n");
printf(" Commands (only one at the time):\n");
printf(" -x | --extract Extract all files into current directory.\n");
printf(" -l | --list List all files in VP archive.\n");
printf(" -h | --help Show this help text.\n");
printf("\n");
printf(" Options:\n");
printf(" -L | --lowercase Force all filenames to be lower case.\n");
printf(" -o <dir> Extract files to <dir> instead of current directory.\n");
printf(" NOTE: No spaces allowed, enclose path in \" \" if needed.\n");
printf("\n");
printf(" (No command specified will list all files in the VP archive.)\n");
printf("\n");
}
// we end up #include'ing SDL.h which on Windows and Mac will redfine main() which is something
// that we don't want since we don't actually link against SDL, this solves the problem...
#ifdef main
#undef main
#endif
int main(int argc, char *argv[])
{
int extract = 0, lc = 0, list = 0;
if (argc < 2) {
help();
return 0;
}
if (!strcmp(argv[1], "-h") || !strcmp(argv[1], "--help")) {
help();
return 0;
}
// the last option should always be the VP file that we want
fp_in = fopen(argv[argc-1], "rb");
if (fp_in == NULL)
print_error(ERR_NO_FP_IN);
// if the header is invalid then read_header() should exit us out
read_header();
memset(out_dir, 0, MAX_PATH);
// TODO: add filter based extraction
for (int i = 1; i < argc-1; i++) {
if (!strcmp(argv[i], "-x") || !strcmp(argv[i], "--extract")) {
if (list) {
help();
exit(0);
}
extract = 1;
} else if (!strcmp(argv[i], "-L") || !strcmp(argv[i], "--lowercase")) {
lc = 1;
} else if (!strcmp(argv[i], "-l") || !strcmp(argv[i], "--list")) {
if (extract) {
help();
exit(0);
}
list = 1;
} else if ( !strcmp(argv[i], "-o") && (i+1 < argc) && (argv[i+1][0] != '-') ) {
strncpy(out_dir, argv[i+1], MAX_PATH-1);
i++; // have to increment "i" past the output directory
} else {
help();
return 0;
}
}
// read the file index, make all filenames lowercase if wanted
read_index( lc );
if (extract) {
extract_all_files( argv[argc-1] );
return 0;
} else if (list) {
list_all_files( argv[argc-1] );
return 0;
} else {
// if only -L is specified or no command is specified then just list files
list_all_files( argv[argc-1] );
return 0;
}
return 0;
}
File diff suppressed because it is too large. Load diff
-669
View File
@@ -1,669 +0,0 @@
/*
* $Logfile: /Freespace2/src/cutscene/decoder16.cpp $
* $Revision: 2.1.2.1 $
* $Date: 2006-08-19 04:14:57 $
* $Author: taylor $
*
* decoder for 16-bit MVE image data
*
* $Log: not supported by cvs2svn $
* Revision 2.1 2006/05/13 06:59:48 taylor
* MVE player (audio only works with OpenAL builds!)
*
*
* $NoKeywords: $
*
*/
#include "globalincs/pstypes.h"
extern int g_width, g_height;
extern void *g_vBackBuf1, *g_vBackBuf2;
/* 16 bit decoding routines */
static ushort *backBuf1, *backBuf2;
static int lookup_initialized;
static void dispatchDecoder16(ushort **pFrame, unsigned char codeType, unsigned char **pData, unsigned char **pOffData, int *pDataRemain, int *curXb, int *curYb);
static void genLoopkupTable();
void decodeFrame16(unsigned char *pFrame, unsigned char *pMap, int mapRemain, unsigned char *pData, int dataRemain)
{
unsigned char *pOrig;
unsigned char *pOffData, *pEnd;
ushort offset;
int length;
int op;
int i, j;
int xb, yb;
if (!lookup_initialized) {
genLoopkupTable();
}
backBuf1 = (ushort *)g_vBackBuf1;
backBuf2 = (ushort *)g_vBackBuf2;
xb = g_width >> 3;
yb = g_height >> 3;
offset = pData[0]|(pData[1]<<8);
pOffData = pData + offset;
pEnd = pData + offset;
pData += 2;
pOrig = pData;
length = offset - 2; /*dataRemain-2;*/
for (j=0; j<yb; j++) {
for (i=0; i<xb/2; i++) {
op = (*pMap) & 0xf;
dispatchDecoder16((ushort **)&pFrame, op, &pData, &pOffData, &dataRemain, &i, &j);
op = ((*pMap) >> 4) & 0xf;
dispatchDecoder16((ushort **)&pFrame, op, &pData, &pOffData, &dataRemain, &i, &j);
pMap++;
mapRemain--;
}
pFrame += 7*g_width*2;
}
if ((length-(pData-pOrig)) != 0) {
nprintf(("MVE", "DEBUG: junk left over: %d,%d,%d\n", (pData-pOrig), length, (length-(pData-pOrig))));
}
}
static ushort GETPIXEL(unsigned char **buf, int off)
{
ushort val = (*buf)[0+off] | ((*buf)[1+off] << 8);
return val;
}
static ushort GETPIXELI(unsigned char **buf, int off)
{
ushort val = (*buf)[0+off] | ((*buf)[1+off] << 8);
(*buf) += 2;
return val;
}
static void relClose(int i, int *x, int *y)
{
int ma, mi;
ma = i >> 4;
mi = i & 0xf;
*x = mi - 8;
*y = ma - 8;
}
static void relFar(int i, int sign, int *x, int *y)
{
if (i < 56) {
*x = sign * (8 + (i % 7));
*y = sign * (i / 7);
} else {
*x = sign * (-14 + (i - 56) % 29);
*y = sign * (8 + (i - 56) / 29);
}
}
static int close_table[512];
static int far_p_table[512];
static int far_n_table[512];
static void genLoopkupTable()
{
int i;
int x, y;
for (i = 0; i < 256; i++) {
relClose(i, &x, &y);
close_table[i*2+0] = x;
close_table[i*2+1] = y;
relFar(i, 1, &x, &y);
far_p_table[i*2+0] = x;
far_p_table[i*2+1] = y;
relFar(i, -1, &x, &y);
far_n_table[i*2+0] = x;
far_n_table[i*2+1] = y;
}
lookup_initialized = 1;
}
static void copyFrame(ushort *pDest, ushort *pSrc)
{
int i;
for (i=0; i<8; i++) {
memcpy(pDest, pSrc, 16);
pDest += g_width;
pSrc += g_width;
}
}
static void patternRow4Pixels(ushort *pFrame, unsigned char pat0, unsigned char pat1, ushort *p)
{
ushort mask=0x0003;
ushort shift=0;
ushort pattern = (pat1 << 8) | pat0;
while (mask != 0) {
*pFrame++ = p[(mask & pattern) >> shift];
mask <<= 2;
shift += 2;
}
}
static void patternRow4Pixels2(ushort *pFrame, unsigned char pat0, ushort *p)
{
unsigned char mask=0x03;
unsigned char shift=0;
ushort pel;
/* ORIGINAL VERSION IS BUGGY
int skip=1;
while (mask != 0) {
pel = p[(mask & pat0) >> shift];
pFrame[0] = pel;
pFrame[2] = pel;
pFrame[g_width + 0] = pel;
pFrame[g_width + 2] = pel;
pFrame += skip;
skip = 4 - skip;
mask <<= 2;
shift += 2;
}
*/
while (mask != 0) {
pel = p[(mask & pat0) >> shift];
pFrame[0] = pel;
pFrame[1] = pel;
pFrame[g_width + 0] = pel;
pFrame[g_width + 1] = pel;
pFrame += 2;
mask <<= 2;
shift += 2;
}
}
static void patternRow4Pixels2x1(ushort *pFrame, unsigned char pat, ushort *p)
{
unsigned char mask=0x03;
unsigned char shift=0;
ushort pel;
while (mask != 0) {
pel = p[(mask & pat) >> shift];
pFrame[0] = pel;
pFrame[1] = pel;
pFrame += 2;
mask <<= 2;
shift += 2;
}
}
static void patternQuadrant4Pixels(ushort *pFrame, unsigned char pat0, unsigned char pat1, unsigned char pat2, unsigned char pat3, ushort *p)
{
unsigned long mask = 0x00000003UL;
int shift=0;
int i;
unsigned long pat = (pat3 << 24) | (pat2 << 16) | (pat1 << 8) | pat0;
for (i=0; i<16; i++) {
pFrame[i&3] = p[(pat & mask) >> shift];
if ((i&3) == 3)
pFrame += g_width;
mask <<= 2;
shift += 2;
}
}
static void patternRow2Pixels(ushort *pFrame, unsigned char pat, ushort *p)
{
unsigned char mask=0x01;
while (mask != 0) {
*pFrame++ = p[(mask & pat) ? 1 : 0];
mask <<= 1;
}
}
static void patternRow2Pixels2(ushort *pFrame, unsigned char pat, ushort *p)
{
ushort pel;
unsigned char mask=0x1;
/* ORIGINAL VERSION IS BUGGY
int skip=1;
while (mask != 0x10) {
pel = p[(mask & pat) ? 1 : 0];
pFrame[0] = pel;
pFrame[2] = pel;
pFrame[g_width + 0] = pel;
pFrame[g_width + 2] = pel;
pFrame += skip;
skip = 4 - skip;
mask <<= 1;
}
*/
while (mask != 0x10) {
pel = p[(mask & pat) ? 1 : 0];
pFrame[0] = pel;
pFrame[1] = pel;
pFrame[g_width + 0] = pel;
pFrame[g_width + 1] = pel;
pFrame += 2;
mask <<= 1;
}
}
static void patternQuadrant2Pixels(ushort *pFrame, unsigned char pat0, unsigned char pat1, ushort *p)
{
ushort mask = 0x0001;
int i;
ushort pat = (pat1 << 8) | pat0;
for (i=0; i<16; i++) {
pFrame[i&3] = p[(pat & mask) ? 1 : 0];
if ((i&3) == 3)
pFrame += g_width;
mask <<= 1;
}
}
static void dispatchDecoder16(ushort **pFrame, unsigned char codeType, unsigned char **pData, unsigned char **pOffData, int *pDataRemain, int *curXb, int *curYb)
{
ushort p[4];
unsigned char pat[16];
int i, j, k;
int x, y;
ushort *pDstBak;
pDstBak = *pFrame;
switch(codeType) {
case 0x0:
copyFrame(*pFrame, *pFrame + (backBuf2 - backBuf1));
break; // ADDED
case 0x1:
break;
case 0x2:
/* relFar(*(*pOffData)++, 1, &x, &y); */
k = *(*pOffData)++;
x = far_p_table[k*2+0];
y = far_p_table[k*2+1];
copyFrame(*pFrame, *pFrame + x + y*g_width);
*pDataRemain--;
break;
case 0x3:
/* relFar(*(*pOffData)++, -1, &x, &y); */
k = *(*pOffData)++;
x = far_n_table[k*2+0];
y = far_n_table[k*2+1];
copyFrame(*pFrame, *pFrame + x + y*g_width);
*pDataRemain--;
break;
case 0x4:
/* relClose(*(*pOffData)++, &x, &y); */
k = *(*pOffData)++;
x = close_table[k*2+0];
y = close_table[k*2+1];
copyFrame(*pFrame, *pFrame + (backBuf2 - backBuf1) + x + y*g_width);
*pDataRemain--;
break;
case 0x5:
x = (char)*(*pData)++;
y = (char)*(*pData)++;
copyFrame(*pFrame, *pFrame + (backBuf2 - backBuf1) + x + y*g_width);
*pDataRemain -= 2;
break;
case 0x6:
nprintf(("MVE", "STUB: encoding 6 not tested\n"));
for (i=0; i<2; i++) {
*pFrame += 16;
if (++*curXb == (g_width >> 3)) {
*pFrame += 7*g_width;
*curXb = 0;
if (++*curYb == (g_height >> 3))
return;
}
}
break;
case 0x7:
p[0] = GETPIXELI(pData, 0);
p[1] = GETPIXELI(pData, 0);
if (!((p[0]/*|p[1]*/)&0x8000)) {
for (i=0; i<8; i++) {
patternRow2Pixels(*pFrame, *(*pData), p);
(*pData)++;
*pFrame += g_width;
}
} else {
for (i=0; i<2; i++) {
patternRow2Pixels2(*pFrame, *(*pData) & 0xf, p);
*pFrame += 2*g_width;
patternRow2Pixels2(*pFrame, *(*pData) >> 4, p);
(*pData)++;
*pFrame += 2*g_width;
}
}
break;
case 0x8:
p[0] = GETPIXEL(pData, 0);
if (!(p[0] & 0x8000)) {
for (i=0; i<4; i++) {
p[0] = GETPIXELI(pData, 0);
p[1] = GETPIXELI(pData, 0);
pat[0] = (*pData)[0];
pat[1] = (*pData)[1];
(*pData) += 2;
patternQuadrant2Pixels(*pFrame, pat[0], pat[1], p);
if (i & 1) {
*pFrame -= (4*g_width - 4);
} else {
*pFrame += 4*g_width;
}
}
} else {
p[2] = GETPIXEL(pData, 8);
if (!(p[2]&0x8000)) {
for (i=0; i<4; i++) {
if ((i & 1) == 0) {
p[0] = GETPIXELI(pData, 0);
p[1] = GETPIXELI(pData, 0);
}
pat[0] = *(*pData)++;
pat[1] = *(*pData)++;
patternQuadrant2Pixels(*pFrame, pat[0], pat[1], p);
if (i & 1) {
*pFrame -= (4*g_width - 4);
} else {
*pFrame += 4*g_width;
}
}
} else {
for (i=0; i<8; i++) {
if ((i & 3) == 0) {
p[0] = GETPIXELI(pData, 0);
p[1] = GETPIXELI(pData, 0);
}
patternRow2Pixels(*pFrame, *(*pData), p);
(*pData)++;
*pFrame += g_width;
}
}
}
break;
case 0x9:
p[0] = GETPIXELI(pData, 0);
p[1] = GETPIXELI(pData, 0);
p[2] = GETPIXELI(pData, 0);
p[3] = GETPIXELI(pData, 0);
*pDataRemain -= 8;
if (!(p[0] & 0x8000)) {
if (!(p[2] & 0x8000)) {
for (i=0; i<8; i++) {
pat[0] = (*pData)[0];
pat[1] = (*pData)[1];
(*pData) += 2;
patternRow4Pixels(*pFrame, pat[0], pat[1], p);
*pFrame += g_width;
}
*pDataRemain -= 16;
} else {
patternRow4Pixels2(*pFrame, (*pData)[0], p);
*pFrame += 2*g_width;
patternRow4Pixels2(*pFrame, (*pData)[1], p);
*pFrame += 2*g_width;
patternRow4Pixels2(*pFrame, (*pData)[2], p);
*pFrame += 2*g_width;
patternRow4Pixels2(*pFrame, (*pData)[3], p);
(*pData) += 4;
*pDataRemain -= 4;
}
} else {
if (!(p[2] & 0x8000)) {
for (i=0; i<8; i++) {
pat[0] = (*pData)[0];
(*pData) += 1;
patternRow4Pixels2x1(*pFrame, pat[0], p);
*pFrame += g_width;
}
*pDataRemain -= 8;
} else {
for (i=0; i<4; i++) {
pat[0] = (*pData)[0];
pat[1] = (*pData)[1];
(*pData) += 2;
patternRow4Pixels(*pFrame, pat[0], pat[1], p);
*pFrame += g_width;
patternRow4Pixels(*pFrame, pat[0], pat[1], p);
*pFrame += g_width;
}
*pDataRemain -= 8;
}
}
break;
case 0xa:
p[0] = GETPIXEL(pData, 0);
if (!(p[0] & 0x8000)) {
for (i=0; i<4; i++) {
p[0] = GETPIXELI(pData, 0);
p[1] = GETPIXELI(pData, 0);
p[2] = GETPIXELI(pData, 0);
p[3] = GETPIXELI(pData, 0);
pat[0] = (*pData)[0];
pat[1] = (*pData)[1];
pat[2] = (*pData)[2];
pat[3] = (*pData)[3];
(*pData) += 4;
patternQuadrant4Pixels(*pFrame, pat[0], pat[1], pat[2], pat[3], p);
if (i & 1) {
*pFrame -= (4*g_width - 4);
} else {
*pFrame += 4*g_width;
}
}
} else {
p[0] = GETPIXEL(pData, 16);
if (!(p[0] & 0x8000)) {
for (i=0; i<4; i++) {
if ((i&1) == 0) {
p[0] = GETPIXELI(pData, 0);
p[1] = GETPIXELI(pData, 0);
p[2] = GETPIXELI(pData, 0);
p[3] = GETPIXELI(pData, 0);
}
pat[0] = (*pData)[0];
pat[1] = (*pData)[1];
pat[2] = (*pData)[2];
pat[3] = (*pData)[3];
(*pData) += 4;
patternQuadrant4Pixels(*pFrame, pat[0], pat[1], pat[2], pat[3], p);
if (i & 1) {
*pFrame -= (4*g_width - 4);
} else {
*pFrame += 4*g_width;
}
}
} else {
for (i=0; i<8; i++) {
if ((i&3) == 0) {
p[0] = GETPIXELI(pData, 0);
p[1] = GETPIXELI(pData, 0);
p[2] = GETPIXELI(pData, 0);
p[3] = GETPIXELI(pData, 0);
}
pat[0] = (*pData)[0];
pat[1] = (*pData)[1];
patternRow4Pixels(*pFrame, pat[0], pat[1], p);
*pFrame += g_width;
(*pData) += 2;
}
}
}
break;
case 0xb:
for (i=0; i<8; i++) {
#if BYTE_ORDER == BIG_ENDIAN
ubyte frame_tmp[16];
memcpy(&frame_tmp, *pData, 16);
ushort *swap_tmp;
for (j = 0; j < 16; j += 2) {
swap_tmp = (ushort*)(frame_tmp + j);
*swap_tmp = INTEL_SHORT(*swap_tmp);
}
memcpy(*pFrame, &frame_tmp, 16);
#else
memcpy(*pFrame, *pData, 16);
#endif
*pFrame += g_width;
*pData += 16;
*pDataRemain -= 16;
}
break;
case 0xc:
for (i=0; i<4; i++) {
p[0] = GETPIXEL(pData, 0);
p[1] = GETPIXEL(pData, 2);
p[2] = GETPIXEL(pData, 4);
p[3] = GETPIXEL(pData, 6);
for (j=0; j<2; j++) {
for (k=0; k<4; k++) {
(*pFrame)[2*k] = p[k];
(*pFrame)[2*k+1] = p[k];
// (*pFrame)[j+2*k] = p[k];
// (*pFrame)[g_width+j+2*k] = p[k];
}
*pFrame += g_width;
}
*pData += 8;
*pDataRemain -= 8;
}
break;
case 0xd:
for (i=0; i<2; i++) {
p[0] = GETPIXEL(pData, 0);
p[1] = GETPIXEL(pData, 2);
for (j=0; j<4; j++) {
for (k=0; k<4; k++) {
(*pFrame)[k*g_width+j] = p[0];
(*pFrame)[k*g_width+j+4] = p[1];
}
}
*pFrame += 4*g_width;
*pData += 4;
*pDataRemain -= 4;
}
break;
case 0xe:
p[0] = GETPIXEL(pData, 0);
for (i = 0; i < 8; i++) {
for (j = 0; j < 8; j++) {
(*pFrame)[j] = p[0];
}
*pFrame += g_width;
}
*pData += 2;
*pDataRemain -= 2;
break;
case 0xf:
p[0] = GETPIXEL(pData, 0);
p[1] = GETPIXEL(pData, 1);
for (i=0; i<8; i++) {
for (j=0; j<8; j++) {
(*pFrame)[j] = p[(i+j)&1];
}
*pFrame += g_width;
}
*pData += 4;
*pDataRemain -= 4;
break;
default:
break;
}
*pFrame = pDstBak+8;
}
-545
View File
@@ -1,545 +0,0 @@
/*
* $Logfile: /Freespace2/src/cutscene/decoder8.cpp $
* $Revision: 1.1.2.1 $
* $Date: 2006-08-19 04:14:57 $
* $Author: taylor $
*
* decoder for 8-bit MVE image data
*
* $Log: not supported by cvs2svn $
*
* $NoKeywords: $
*
*/
#include "globalincs/pstypes.h"
extern int g_width, g_height;
extern void *g_vBackBuf1, *g_vBackBuf2;
static void dispatchDecoder8(ubyte **pFrame, ubyte codeType, ubyte **pData, int *pDataRemain, int *curXb, int *curYb);
void decodeFrame8(ubyte *pFrame, ubyte *pMap, int mapRemain, ubyte *pData, int dataRemain)
{
int i, j;
int xb, yb;
xb = g_width >> 3;
yb = g_height >> 3;
for (j = 0; j < yb; j++) {
for (i = 0; i < (xb / 2); i++) {
dispatchDecoder8(&pFrame, (*pMap) & 0xf, &pData, &dataRemain, &i, &j);
dispatchDecoder8(&pFrame, (*pMap) >> 4, &pData, &dataRemain, &i, &j);
pMap++;
mapRemain--;
}
pFrame += 7*g_width;
}
}
static void relClose(int i, int *x, int *y)
{
int ma, mi;
ma = i >> 4;
mi = i & 0xf;
*x = mi - 8;
*y = ma - 8;
}
static void relFar(int i, int sign, int *x, int *y)
{
if (i < 56) {
*x = sign * (8 + (i % 7));
*y = sign * (i / 7);
} else {
*x = sign * (-14 + (i - 56) % 29);
*y = sign * (8 + (i - 56) / 29);
}
}
/* copies an 8x8 block from pSrc to pDest.
pDest and pSrc are both g_width bytes wide */
static void copyFrame(ubyte *pDest, ubyte *pSrc)
{
int i;
for (i = 0; i < 8; i++) {
memcpy(pDest, pSrc, 8);
pDest += g_width;
pSrc += g_width;
}
}
// Fill in the next eight bytes with p[0], p[1], p[2], or p[3],
// depending on the corresponding two-bit value in pat0 and pat1
static void patternRow4Pixels(ubyte *pFrame, ubyte pat0, ubyte pat1, ubyte *p)
{
ushort mask = 0x0003;
ushort shift = 0;
ushort pattern = (pat1 << 8) | pat0;
while (mask != 0) {
*pFrame++ = p[(mask & pattern) >> shift];
mask <<= 2;
shift += 2;
}
}
// Fill in the next four 2x2 pixel blocks with p[0], p[1], p[2], or p[3],
// depending on the corresponding two-bit value in pat0.
static void patternRow4Pixels2(ubyte *pFrame, ubyte pat0, ubyte *p)
{
ubyte mask = 0x03;
ubyte shift = 0;
ubyte pel;
while (mask != 0) {
pel = p[(mask & pat0) >> shift];
pFrame[0] = pel;
pFrame[1] = pel;
pFrame[g_width + 0] = pel;
pFrame[g_width + 1] = pel;
pFrame += 2;
mask <<= 2;
shift += 2;
}
}
// Fill in the next four 2x1 pixel blocks with p[0], p[1], p[2], or p[3],
// depending on the corresponding two-bit value in pat.
static void patternRow4Pixels2x1(ubyte *pFrame, ubyte pat, ubyte *p)
{
ubyte mask = 0x03;
ubyte shift = 0;
ubyte pel;
while (mask != 0) {
pel = p[(mask & pat) >> shift];
pFrame[0] = pel;
pFrame[1] = pel;
pFrame += 2;
mask <<= 2;
shift += 2;
}
}
// Fill in the next 4x4 pixel block with p[0], p[1], p[2], or p[3],
// depending on the corresponding two-bit value in pat0, pat1, pat2, and pat3.
static void patternQuadrant4Pixels(ubyte *pFrame, ubyte pat0, ubyte pat1, ubyte pat2, ubyte pat3, ubyte *p)
{
unsigned long mask = 0x00000003UL;
int shift=0;
int i;
unsigned long pat = (pat3 << 24) | (pat2 << 16) | (pat1 << 8) | pat0;
for (i = 0; i < 16; i++) {
pFrame[i&3] = p[(pat & mask) >> shift];
if ( (i & 3) == 3 )
pFrame += g_width;
mask <<= 2;
shift += 2;
}
}
// fills the next 8 pixels with either p[0] or p[1], depending on pattern
static void patternRow2Pixels(ubyte *pFrame, ubyte pat, ubyte *p)
{
ubyte mask=0x01;
while (mask != 0) {
*pFrame++ = p[(mask & pat) ? 1 : 0];
mask <<= 1;
}
}
// fills the next four 2 x 2 pixel boxes with either p[0] or p[1], depending on pattern
static void patternRow2Pixels2(ubyte *pFrame, ubyte pat, ubyte *p)
{
ubyte pel;
ubyte mask=0x1;
while (mask != 0x10) {
pel = p[(mask & pat) ? 1 : 0];
pFrame[0] = pel; // upper-left
pFrame[1] = pel; // upper-right
pFrame[g_width + 0] = pel; // lower-left
pFrame[g_width + 1] = pel; // lower-right
pFrame += 2;
mask <<= 1;
}
}
// fills pixels in the next 4 x 4 pixel boxes with either p[0] or p[1], depending on pat0 and pat1.
static void patternQuadrant2Pixels(ubyte *pFrame, ubyte pat0, ubyte pat1, ubyte *p)
{
ubyte pel;
ushort mask = 0x0001;
int i, j;
ushort pat = (pat1 << 8) | pat0;
for (i = 0; i < 4; i++) {
for (j = 0; j < 4; j++) {
pel = p[(pat & mask) ? 1 : 0];
pFrame[j + i * g_width] = pel;
mask <<= 1;
}
}
}
static void dispatchDecoder8(ubyte **pFrame, ubyte codeType, ubyte **pData, int *pDataRemain, int *curXb, int *curYb)
{
ubyte p[4];
ubyte pat[16];
int i, j, k;
int x, y;
switch(codeType) {
case 0x0:
copyFrame(*pFrame, *pFrame + ((ubyte *)g_vBackBuf2 - (ubyte *)g_vBackBuf1));
*pFrame += 8;
break;
case 0x1:
*pFrame += 8;
break;
case 0x2:
relFar(*(*pData)++, 1, &x, &y);
copyFrame(*pFrame, *pFrame + x + y*g_width);
*pFrame += 8;
*pDataRemain--;
break;
case 0x3:
relFar(*(*pData)++, -1, &x, &y);
copyFrame(*pFrame, *pFrame + x + y*g_width);
*pFrame += 8;
*pDataRemain--;
break;
case 0x4:
relClose(*(*pData)++, &x, &y);
copyFrame(*pFrame, *pFrame + ((ubyte *)g_vBackBuf2 - (ubyte *)g_vBackBuf1) + x + y*g_width);
*pFrame += 8;
*pDataRemain--;
break;
case 0x5:
x = (signed char)*(*pData)++;
y = (signed char)*(*pData)++;
copyFrame(*pFrame, *pFrame + ((ubyte *)g_vBackBuf2 - (ubyte *)g_vBackBuf1) + x + y*g_width);
*pFrame += 8;
*pDataRemain -= 2;
break;
case 0x6:
for (i = 0; i < 2; i++) {
*pFrame += 16;
if (++*curXb == (g_width >> 3)) {
*pFrame += 7*g_width;
*curXb = 0;
if (++*curYb == (g_height >> 3))
return;
}
}
break;
case 0x7:
p[0] = *(*pData)++;
p[1] = *(*pData)++;
if (p[0] <= p[1]) {
for (i = 0; i < 8; i++) {
patternRow2Pixels(*pFrame, *(*pData)++, p);
*pFrame += g_width;
}
} else {
for (i = 0; i < 2; i++) {
patternRow2Pixels2(*pFrame, *(*pData) & 0xf, p);
*pFrame += 2*g_width;
patternRow2Pixels2(*pFrame, *(*pData)++ >> 4, p);
*pFrame += 2*g_width;
}
}
*pFrame -= (8*g_width - 8);
break;
case 0x8:
if ( (*pData)[0] <= (*pData)[1] ) {
// four quadrant case
for (i = 0; i < 4; i++) {
p[0] = *(*pData)++;
p[1] = *(*pData)++;
pat[0] = *(*pData)++;
pat[1] = *(*pData)++;
patternQuadrant2Pixels(*pFrame, pat[0], pat[1], p);
// alternate between moving down and moving up and right
if (i & 1)
*pFrame += 4 - 4*g_width; // up and right
else
*pFrame += 4*g_width; // down
}
} else if ( (*pData)[6] <= (*pData)[7] ) {
// split horizontal
for (i = 0; i < 4; i++) {
if ((i & 1) == 0) {
p[0] = *(*pData)++;
p[1] = *(*pData)++;
}
pat[0] = *(*pData)++;
pat[1] = *(*pData)++;
patternQuadrant2Pixels(*pFrame, pat[0], pat[1], p);
if (i & 1)
*pFrame -= (4*g_width - 4);
else
*pFrame += 4*g_width;
}
} else {
// split vertical
for (i = 0; i < 8; i++) {
if ((i & 3) == 0) {
p[0] = *(*pData)++;
p[1] = *(*pData)++;
}
patternRow2Pixels(*pFrame, *(*pData)++, p);
*pFrame += g_width;
}
*pFrame -= (8*g_width - 8);
}
break;
case 0x9:
if ( (*pData)[0] <= (*pData)[1] ) {
if ( (*pData)[2] <= (*pData)[3] ) {
p[0] = *(*pData)++;
p[1] = *(*pData)++;
p[2] = *(*pData)++;
p[3] = *(*pData)++;
for (i = 0; i < 8; i++) {
pat[0] = *(*pData)++;
pat[1] = *(*pData)++;
patternRow4Pixels(*pFrame, pat[0], pat[1], p);
*pFrame += g_width;
}
*pFrame -= (8*g_width - 8);
} else {
p[0] = *(*pData)++;
p[1] = *(*pData)++;
p[2] = *(*pData)++;
p[3] = *(*pData)++;
patternRow4Pixels2(*pFrame, *(*pData)++, p);
*pFrame += 2*g_width;
patternRow4Pixels2(*pFrame, *(*pData)++, p);
*pFrame += 2*g_width;
patternRow4Pixels2(*pFrame, *(*pData)++, p);
*pFrame += 2*g_width;
patternRow4Pixels2(*pFrame, *(*pData)++, p);
*pFrame -= (6*g_width - 8);
}
} else {
if ( (*pData)[2] <= (*pData)[3] ) {
// draw 2x1 strips
p[0] = *(*pData)++;
p[1] = *(*pData)++;
p[2] = *(*pData)++;
p[3] = *(*pData)++;
for (i = 0; i < 8; i++) {
pat[0] = *(*pData)++;
patternRow4Pixels2x1(*pFrame, pat[0], p);
*pFrame += g_width;
}
*pFrame -= (8*g_width - 8);
} else {
// draw 1x2 strips
p[0] = *(*pData)++;
p[1] = *(*pData)++;
p[2] = *(*pData)++;
p[3] = *(*pData)++;
for (i = 0; i < 4; i++) {
pat[0] = *(*pData)++;
pat[1] = *(*pData)++;
patternRow4Pixels(*pFrame, pat[0], pat[1], p);
*pFrame += g_width;
patternRow4Pixels(*pFrame, pat[0], pat[1], p);
*pFrame += g_width;
}
*pFrame -= (8*g_width - 8);
}
}
break;
case 0xa:
if ( (*pData)[0] <= (*pData)[1] ) {
for (i = 0; i < 4; i++) {
p[0] = *(*pData)++;
p[1] = *(*pData)++;
p[2] = *(*pData)++;
p[3] = *(*pData)++;
pat[0] = *(*pData)++;
pat[1] = *(*pData)++;
pat[2] = *(*pData)++;
pat[3] = *(*pData)++;
patternQuadrant4Pixels(*pFrame, pat[0], pat[1], pat[2], pat[3], p);
if (i & 1)
*pFrame -= (4*g_width - 4);
else
*pFrame += 4*g_width;
}
} else {
if ( (*pData)[12] <= (*pData)[13] ) {
// split vertical
for (i = 0; i < 4; i++) {
if ((i&1) == 0) {
p[0] = *(*pData)++;
p[1] = *(*pData)++;
p[2] = *(*pData)++;
p[3] = *(*pData)++;
}
pat[0] = *(*pData)++;
pat[1] = *(*pData)++;
pat[2] = *(*pData)++;
pat[3] = *(*pData)++;
patternQuadrant4Pixels(*pFrame, pat[0], pat[1], pat[2], pat[3], p);
if (i & 1)
*pFrame -= (4*g_width - 4);
else
*pFrame += 4*g_width;
}
} else {
// split horizontal
for (i = 0; i < 8; i++) {
if ((i&3) == 0) {
p[0] = *(*pData)++;
p[1] = *(*pData)++;
p[2] = *(*pData)++;
p[3] = *(*pData)++;
}
pat[0] = *(*pData)++;
pat[1] = *(*pData)++;
patternRow4Pixels(*pFrame, pat[0], pat[1], p);
*pFrame += g_width;
}
*pFrame -= (8*g_width - 8);
}
}
break;
case 0xb:
for (i = 0; i < 8; i++) {
memcpy(*pFrame, *pData, 8);
*pFrame += g_width;
*pData += 8;
*pDataRemain -= 8;
}
*pFrame -= (8*g_width - 8);
break;
case 0xc:
for (i = 0; i < 4; i++) {
for (j = 0; j < 2; j++) {
for (k = 0; k < 4; k++) {
(*pFrame)[2*k] = (*pData)[k];
(*pFrame)[2*k+1] = (*pData)[k];
}
*pFrame += g_width;
}
*pData += 4;
*pDataRemain -= 4;
}
*pFrame -= (8*g_width - 8);
break;
case 0xd:
for (i = 0; i < 2; i++) {
for (j = 0; j < 4; j++) {
for (k = 0; k < 4; k++) {
(*pFrame)[k*g_width+j] = (*pData)[0];
(*pFrame)[k*g_width+j+4] = (*pData)[1];
}
}
*pFrame += 4*g_width;
*pData += 2;
*pDataRemain -= 2;
}
*pFrame -= (8*g_width - 8);
break;
case 0xe:
for (i = 0; i < 8; i++) {
memset(*pFrame, **pData, 8);
*pFrame += g_width;
}
(*pData)++;
*pDataRemain--;
*pFrame -= (8*g_width - 8);
break;
case 0xf:
for (i = 0; i < 8; i++) {
for (j = 0; j < 8; j++) {
(*pFrame)[j] = (*pData)[(i+j)&1];
}
*pFrame += g_width;
}
*pData += 2;
*pDataRemain -= 2;
*pFrame -= (8*g_width - 8);
break;
default:
break;
}
}
-260
View File
@@ -1,260 +0,0 @@
/*
* Copyright (C) Volition, Inc. 1999. All rights reserved.
*
* All source code herein is the property of Volition, Inc. You may not sell
* or otherwise commercially exploit the source or things you created based on the
* source.
*
*/
/*
* $Logfile: /Freespace2/code/cutscene/movie.cpp $
* $Revision: 2.31.2.11 $
* $Date: 2007-02-11 09:23:14 $
* $Author: taylor $
*
* movie player code
*
* $Log: not supported by cvs2svn $
* Revision 2.31.2.10 2007/01/07 12:10:18 taylor
* remove D3D support for Theora movies, make sure that it doesn't try to play them (since it wouldn't work properly anyway)
* fix triple-buffer problem with page flipping (Mantis #1190)
*
* Revision 2.31.2.9 2006/12/26 05:13:29 taylor
* add support for Theora movies (the default format)
* some little bits of cleanup
* add second gr_clear() so that double-buffer'd visuals will work properly (ie, not flicker when playing MVE/OGG)
*
* Revision 2.31.2.8 2006/12/07 17:57:25 taylor
* cleanup for movie init stuff (this will be even cleaner once the rest of the Theora code finally gets in)
* get rid of the clear screen hack for Windows, we can handle that better now
*
* Revision 2.31.2.7 2006/11/15 00:24:47 taylor
* clean up AVI movie stuff a bit:
* - use the default black brush for clearing the screen, it's a little less stupid this way
* - have the AVI player send messages back to the game rather than trying to poll for that extra crap
* - remove the only DivX6 fix, there is better addressed by newer window handling code
*
* Revision 2.31.2.6 2006/09/09 21:27:50 taylor
* be sure to reset color and clear color before MVE playback (fix for Mantis bug #1041)
*
* Revision 2.31.2.5 2006/08/28 17:14:52 taylor
* stupid, stupid, stupid...
* - fix AVI/MPG movie playback
* - fix missing campaign craziness
*
* Revision 2.31.2.4 2006/08/27 18:02:26 taylor
* switch to using cf_find_file_location_ext() when looking for movies
*
* Revision 2.31.2.3 2006/08/19 04:14:57 taylor
* add decoder for 8-bit MVEs
* a basic fix for finding AVIs over MVEs, for mod dir stuff (this needs some CFILE support added to be a true fix, it's on the TODO list)
* little bits of cleanup for old/unused code
* make sure MVE filenames are correct in mvelib
*
* Revision 2.31.2.2 2006/07/13 22:06:38 taylor
* handle non-MVE movies a bit better in OpenGL (don't get freaky with the window, don't lose input, etc.)
* some cleanup to OpenGL window handling, to fix min/max/full issues, and try to make shutdown a little nicer
*
* Revision 2.31.2.1 2006/06/18 16:54:36 taylor
* various compiler warning fixes
*
* Revision 2.31 2006/05/27 17:13:22 taylor
* add NO_DIRECT3D support
*
* Revision 2.30 2006/05/13 06:59:48 taylor
* MVE player (audio only works with OpenAL builds!)
*
* Revision 2.29 2005/12/28 22:17:01 taylor
* deal with cf_find_file_location() changes
* add a central parse_modular_table() function which anything can use
* fix up weapon_expl so that it can properly handle modular tables and LOD count changes
* add support for for a fireball TBM (handled a little different than a normal TBM is since it only changes rather than adds)
*
* Revision 2.28 2005/11/13 06:46:10 taylor
* some minor movie cleanup, not what I would like but enough for now
*
* Revision 2.27 2005/10/16 23:15:46 wmcoolmon
* Hardened cfile against array overflows
*
* Revision 2.26 2005/05/12 17:37:48 taylor
* add an extra gr_flip() after gr_clear() to make sure the change is made active
*
* Revision 2.25 2005/04/24 06:52:23 wmcoolmon
* Enabled movies in windowed mode; if this causes problems for people, they can always use -dnoshowvid
*
* Revision 2.24 2005/02/05 00:30:49 taylor
* fix a few things post merge
*
* Revision 2.23 2004/11/27 10:42:18 taylor
* this should get movies working again in D3D and help OGL too
*
* Revision 2.22 2004/07/26 20:47:26 Kazan
* remove MCD complete
*
* Revision 2.21 2004/07/12 16:32:43 Kazan
* MCD - define _MCD_CHECK to use memory tracking
*
* Revision 2.20 2004/04/26 13:09:20 taylor
* cvs log header, mark cutscenes viewable for later, gr_flip() to fix OGL white flash
*
*
*
* $NoKeywords: $
*/
#ifdef _WIN32
#include <windows.h>
#include "graphics/grd3dinternal.h"
#endif
#include "graphics/2d.h"
#include "globalincs/systemvars.h"
#include "cutscene/movie.h"
#include "osapi/osapi.h"
#include "cmdline/cmdline.h"
#include "cfile/cfile.h"
#include "cutscene/cutscenes.h" // cutscene_mark_viewable()
#include "cutscene/mvelib.h"
#include "cutscene/oggplayer.h"
extern int Game_mode;
#define MOVIE_NONE -1
#define MOVIE_OGG 0
#define MOVIE_MVE 1
// This module links freespace movie calls to the actual API calls the play the movie.
// This module handles all the different requires of OS and gfx API and finding the file to play
// filename - file to search for
// out_name - output, full path to file
// returns non-zero if file is found
int movie_find(char *filename, char *out_name)
{
char full_path[MAX_PATH];
char tmp_name[MAX_PATH];
int size, offset = 0;
const int NUM_EXT = 2;
const char *movie_ext[NUM_EXT] = { ".ogg", ".mve" };
if (out_name == NULL)
return MOVIE_NONE;
memset( full_path, 0, sizeof(full_path) );
memset( tmp_name, 0, sizeof(tmp_name) );
// remove extension
strcpy( tmp_name, filename );
char *p = strrchr(tmp_name, '.');
if ( p ) *p = 0;
int rc = cf_find_file_location_ext(tmp_name, NUM_EXT, movie_ext, CF_TYPE_ANY, sizeof(full_path) - 1, full_path, &size, &offset, 0);
if (rc == MOVIE_NONE)
return MOVIE_NONE;
strcpy( out_name, full_path );
return rc;
}
// Play one movie
bool movie_play(char *name)
{
// mark the movie as viewable to the player when in a campaign
// do this before anything else so that we're sure the movie is available
// to the player even if it's not going to play right now
if (Game_mode & GM_CAMPAIGN_MODE) {
cutscene_mark_viewable(name);
}
extern int Mouse_hidden;
extern int Is_standalone;
if (Cmdline_nomovies || Is_standalone)
return false;
char full_name[MAX_PATH];
int rc = 0;
memset(full_name, 0, sizeof(full_name));
rc = movie_find(name, full_name);
if (rc == MOVIE_NONE) {
strcpy(full_name, name);
char *p = strrchr(full_name, '.');
if ( p ) *p = 0;
mprintf(("Movie Error: Unable to open '%s' movie in any supported format.\n", full_name));
return false;
}
// clear the screen and hide the mouse cursor
Mouse_hidden++;
gr_reset_clip();
gr_set_color(255, 255, 255);
gr_set_clear_color(0, 0, 0);
gr_zbuffer_clear(0);
// clear first buffer
gr_clear();
gr_flip();
// clear second buffer (may not be one, but that's ok)
gr_clear();
gr_flip();
// clear third buffer (may not be one, but that's ok)
gr_clear();
if (rc == MOVIE_OGG) {
if (gr_screen.mode == GR_DIRECT3D) {
mprintf(("MOVIE ERROR: Theora movies are not currently supported in Direct3D mode!\n"));
return false;
}
THEORAFILE *movie_ogg = theora_open(name);
if (movie_ogg) {
// start playing ...
theora_play(movie_ogg);
// ... done playing, close the movie
theora_close(movie_ogg);
} else {
// uh-oh, movie is invalid... Abory, Retry, Fail?
mprintf(("MOVIE ERROR: Found invalid movie! (%s)\n", name));
return false;
}
} else if (rc == MOVIE_MVE) {
MVESTREAM *movie_mve = mve_open(name);
if (movie_mve) {
// start playing ...
mve_init(movie_mve);
mve_play(movie_mve);
// ... done playing, close the movie
mve_shutdown();
mve_close(movie_mve);
} else {
// uh-oh, movie is invalid... Abory, Retry, Fail?
mprintf(("MOVIE ERROR: Found invalid movie! (%s)\n", name));
return false;
}
}
// show the mouse cursor again
Mouse_hidden--;
return true;
}
void movie_play_two(char *name1, char *name2)
{
if ( movie_play(name1) )
movie_play(name2);
}
-79
View File
@@ -1,79 +0,0 @@
/*
* $Logfile: /Freespace2/src/cutscene/mve_audio.cpp $
* $Revision: 2.1 $
* $Date: 2006-05-13 06:59:48 $
* $Author: taylor $
*
* Handles compressed audio data in MVE files
*
* $Log: not supported by cvs2svn $
* Revision 1.2 2005/03/29 07:50:34 taylor
* Update to newest movie code with much better video support and audio support from
* Pierre Willenbrock. Movies are enabled always now (no longer a build option)
* and but can be skipped with the "--nomovies" or "-n" cmdline options.
*
*
*
* $NoKeywords: $
*
*/
#ifdef USE_OPENAL
static int audio_exp_table[256] =
{
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 47, 51, 56, 61,
66, 72, 79, 86, 94, 102, 112, 122, 133, 145, 158, 173, 189, 206, 225, 245,
267, 292, 318, 348, 379, 414, 452, 493, 538, 587, 640, 699, 763, 832, 908, 991,
1081, 1180, 1288, 1405, 1534, 1673, 1826, 1993, 2175, 2373, 2590, 2826, 3084, 3365, 3672, 4008,
4373, 4772, 5208, 5683, 6202, 6767, 7385, 8059, 8794, 9597, 10472, 11428, 12471, 13609, 14851, 16206,
17685, 19298, 21060, 22981, 25078, 27367, 29864, 32589, -29973, -26728, -23186, -19322, -15105, -10503, -5481, -1,
1, 1, 5481, 10503, 15105, 19322, 23186, 26728, 29973, -32589, -29864, -27367, -25078, -22981, -21060, -19298,
-17685, -16206, -14851, -13609, -12471, -11428, -10472, -9597, -8794, -8059, -7385, -6767, -6202, -5683, -5208, -4772,
-4373, -4008, -3672, -3365, -3084, -2826, -2590, -2373, -2175, -1993, -1826, -1673, -1534, -1405, -1288, -1180,
-1081, -991, -908, -832, -763, -699, -640, -587, -538, -493, -452, -414, -379, -348, -318, -292,
-267, -245, -225, -206, -189, -173, -158, -145, -133, -122, -112, -102, -94, -86, -79, -72,
-66, -61, -56, -51, -47, -43, -42, -41, -40, -39, -38, -37, -36, -35, -34, -33,
-32, -31, -30, -29, -28, -27, -26, -25, -24, -23, -22, -21, -20, -19, -18, -17,
-16, -15, -14, -13, -12, -11, -10, -9, -8, -7, -6, -5, -4, -3, -2, -1
};
static int getWord(unsigned char **fin)
{
int value = ((*fin)[1] << 8) | (*fin)[0];
*fin += 2;
return value;
}
static void sendWord(short **fout, int nOffset)
{
*(*fout)++ = nOffset;
}
static void processSwath(short *fout, unsigned char *data, int swath, int *offsets)
{
int i;
for (i=0; i<swath; i++)
{
offsets[i&1] += audio_exp_table[data[i]];
sendWord(&fout, offsets[i&1]);
}
}
void mveaudio_uncompress(short *buffer, unsigned char *data, int length)
{
int nCurOffsets[2];
int swath;
data += 4;
swath = getWord(&data) / 2;
nCurOffsets[0] = getWord(&data);
nCurOffsets[1] = getWord(&data);
sendWord(&buffer, nCurOffsets[0]);
sendWord(&buffer, nCurOffsets[1]);
processSwath(buffer, data, swath, nCurOffsets);
}
#endif
-385
View File
@@ -1,385 +0,0 @@
/*
* $Logfile: /Freespace2/src/cutscene/mvelib.cpp $
* $Revision: 2.1.2.1 $
* $Date: 2006-08-19 04:14:57 $
* $Author: taylor $
*
* main lib for using MVEs
*
* $Log: not supported by cvs2svn $
* Revision 2.1 2006/05/13 06:59:48 taylor
* MVE player (audio only works with OpenAL builds!)
*
*
* $NoKeywords: $
*
*/
#include "globalincs/pstypes.h"
#include "cutscene/mvelib.h"
#include "cfile/cfile.h"
static const char MVE_HEADER[] = "Interplay MVE File\x1A";
static const short MVE_HDRCONST1 = 0x001A;
static const short MVE_HDRCONST2 = 0x0100;
static const short MVE_HDRCONST3 = 0x1133;
// -----------------------------------------------------------
// public MVEFILE functions
// -----------------------------------------------------------
// utility functions for mvefile and mveplayer
short mve_get_short(ubyte *data)
{
short value;
value = data[0] | (data[1] << 8);
return value;
}
ushort mve_get_ushort(ubyte *data)
{
ushort value;
value = data[0] | (data[1] << 8);
return value;
}
int mve_get_int(ubyte *data)
{
int value;
value = data[0] | (data[1] << 8) | (data[2] << 16) | (data[3] << 24);
return value;
}
// open an MVE file
MVEFILE *mvefile_open(char *filename)
{
int cf_opened = 0;
int mve_valid = 1;
char lower_name[MAX_FILENAME_LEN];
char buffer[20];
MVEFILE *file;
// create the file
file = (MVEFILE *)vm_malloc(sizeof(MVEFILE));
// set defaults
file->stream = NULL;
file->cur_chunk = NULL;
file->buf_size = 0;
file->cur_fill = 0;
file->next_segment = 0;
// lower case filename for checking
strncpy(lower_name, filename, strlen(filename)+1);
strlwr(lower_name);
char *p = strchr( lower_name, '.' );
if ( p ) *p = 0;
SAFE_STRCAT( lower_name, ".mve", sizeof(lower_name) );
// NOTE: CF_TYPE *must* be ANY to get movies off of the CDs
// assume lower case filename for *nix
if ( (file->stream = cfopen(lower_name, "rb", CFILE_NORMAL, CF_TYPE_ANY)) ) {
cf_opened = 1;
}
if (!cf_opened) {
mvefile_close(file);
return NULL;
}
// initialize the buffer
file->cur_chunk = (ubyte *)vm_malloc(100 + 1024);
file->buf_size = 100 + 1024;
// verify the file's header
cfread_string(buffer, 20, file->stream);
if (strcmp(buffer, MVE_HEADER))
mve_valid = 0;
if (cfread_short(file->stream) != MVE_HDRCONST1)
mve_valid = 0;
if (cfread_short(file->stream) != MVE_HDRCONST2)
mve_valid = 0;
if (cfread_short(file->stream) != MVE_HDRCONST3)
mve_valid = 0;
if (!mve_valid) {
mvefile_close(file);
return NULL;
}
// now, prefetch the next chunk
mvefile_fetch_next_chunk(file);
return file;
}
// close a MVE file
void mvefile_close(MVEFILE *file)
{
// free the stream
if (file->stream)
cfclose(file->stream);
file->stream = NULL;
// free the buffer
if (file->cur_chunk)
vm_free(file->cur_chunk);
file->cur_chunk = NULL;
// not strictly necessary
file->buf_size = 0;
file->cur_fill = 0;
file->next_segment = 0;
// free the struct
vm_free(file);
}
// get the size of the next segment
int mvefile_get_next_segment_size(MVEFILE *file)
{
// if nothing is cached, fail
if (file->cur_chunk == NULL || file->next_segment >= file->cur_fill)
return -1;
// if we don't have enough data to get a segment, fail
if (file->cur_fill - file->next_segment < 4)
return -1;
// otherwise, get the data length
return mve_get_short(file->cur_chunk + file->next_segment);
}
// get type of next segment in chunk (0xff if no more segments in chunk)
ubyte mvefile_get_next_segment_major(MVEFILE *file)
{
// if nothing is cached, fail
if (file->cur_chunk == NULL || file->next_segment >= file->cur_fill)
return 0xff;
// if we don't have enough data to get a segment, fail
if (file->cur_fill - file->next_segment < 4)
return 0xff;
// otherwise, get the data length
return file->cur_chunk[file->next_segment + 2];
}
// get subtype (version) of next segment in chunk (0xff if no more segments in chunk)
ubyte mvefile_get_next_segment_minor(MVEFILE *file)
{
// if nothing is cached, fail
if (file->cur_chunk == NULL || file->next_segment >= file->cur_fill)
return 0xff;
// if we don't have enough data to get a segment, fail
if (file->cur_fill - file->next_segment < 4)
return 0xff;
// otherwise, get the data length
return file->cur_chunk[file->next_segment + 3];
}
// see next segment (return NULL if no next segment)
ubyte *mvefile_get_next_segment(MVEFILE *file)
{
// if nothing is cached, fail
if (file->cur_chunk == NULL || file->next_segment >= file->cur_fill)
return NULL;
// if we don't have enough data to get a segment, fail
if (file->cur_fill - file->next_segment < 4)
return NULL;
// otherwise, get the data length
return file->cur_chunk + file->next_segment + 4;
}
// advance to next segment
void mvefile_advance_segment(MVEFILE *file)
{
// if nothing is cached, fail
if (file->cur_chunk == NULL || file->next_segment >= file->cur_fill)
return;
// if we don't have enough data to get a segment, fail
if (file->cur_fill - file->next_segment < 4)
return;
// else, advance to next segment
file->next_segment += (4 + mve_get_ushort(file->cur_chunk + file->next_segment));
}
// fetch the next chunk (return 0 if at end of stream)
int mvefile_fetch_next_chunk(MVEFILE *file)
{
ubyte buffer[4];
ubyte *new_buffer;
ushort length;
// fail if not open
if (file->stream == NULL)
return 0;
// fail if we can't read the next segment descriptor
if (cfread(buffer, 1, 4, file->stream) < 4)
return 0;
// pull out the next length
length = mve_get_short(buffer);
// setup a new buffer if needed --
// only allocate new buffer is old one is too small
if (length > file->buf_size) {
// allocate new buffer
new_buffer = (ubyte *)vm_malloc(100 + length);
// copy old data
if (file->cur_chunk && file->cur_fill)
memcpy(new_buffer, file->cur_chunk, file->cur_fill);
// free old buffer
if (file->cur_chunk) {
vm_free(file->cur_chunk);
file->cur_chunk = NULL;
}
// install new buffer
file->cur_chunk = new_buffer;
file->buf_size = 100 + length;
}
// read the chunk
if (length > 0) {
if (cfread(file->cur_chunk, 1, length, file->stream) < length)
return 0;
}
file->cur_fill = length;
file->next_segment = 0;
return 1;
}
// -----------------------------------------------------------
// public MVESTREAM functions
// -----------------------------------------------------------
// open an MVE stream
MVESTREAM *mve_open(char *filename)
{
MVESTREAM *stream;
// allocate
stream = (MVESTREAM *)vm_malloc(sizeof(MVESTREAM));
// defaults
stream->movie = NULL;
// open
stream->movie = mvefile_open(filename);
if (stream->movie == NULL) {
mve_close(stream);
return NULL;
}
return stream;
}
// close an MVE stream
void mve_close(MVESTREAM *stream)
{
// close MVEFILE
if (stream->movie)
mvefile_close(stream->movie);
stream->movie = NULL;
vm_free(stream);
}
// play next chunk
int mve_play_next_chunk(MVESTREAM *stream)
{
ubyte major, minor;
ubyte *data;
int len;
// loop over segments
major = mvefile_get_next_segment_major(stream->movie);
while (major != 0xff) {
// check whether to handle the segment
if (major < 32) {
minor = mvefile_get_next_segment_minor(stream->movie);
len = mvefile_get_next_segment_size(stream->movie);
data = mvefile_get_next_segment(stream->movie);
switch (major) {
case 0x00:
mve_end_movie();
break;
case 0x01:
mve_end_chunk();
break;
case 0x02:
mve_timer_create(data);
break;
case 0x03:
mve_audio_createbuf(minor, data);
break;
case 0x04:
mve_audio_play();
break;
case 0x05:
if (!mve_video_createbuf(minor, data))
return 0;
break;
case 0x07:
mve_video_display();
break;
case 0x08:
mve_audio_data(major, data);
break;
case 0x09:
mve_audio_data(major, data);
break;
case 0x0a:
if (!mve_video_init(data))
return 0;
break;
case 0x0c:
mve_video_palette(data);
break;
case 0x0f:
mve_video_codemap(data, len);
break;
case 0x11:
mve_video_data(data, len);
break;
default:
break;
}
}
// advance to next segment
mvefile_advance_segment(stream->movie);
major = mvefile_get_next_segment_major(stream->movie);
}
if (!mvefile_fetch_next_chunk(stream->movie))
return 0;
// return status
return 1;
}
-101
View File
@@ -1,101 +0,0 @@
/*
* $Logfile: /Freespace2/src/cutscene/mvelib.h $
* $Revision: 2.1 $
* $Date: 2006-05-13 06:59:48 $
* $Author: taylor $
*
* main lib for using MVEs
*
* $Log: not supported by cvs2svn $
*
* $NoKeywords: $
*
*/
#ifndef INCLUDED_MVELIB_H
#define INCLUDED_MVELIB_H
#include "globalincs/pstypes.h"
struct CFILE;
// structure for maintaining info on a MVEFILE stream
typedef struct MVEFILE
{
CFILE *stream;
ubyte *cur_chunk;
int buf_size;
int cur_fill;
int next_segment;
} MVEFILE;
// open a .MVE file
MVEFILE *mvefile_open(char *filename);
// close a .MVE file
void mvefile_close(MVEFILE *movie);
// get size of next segment in chunk (-1 if no more segments in chunk)
int mvefile_get_next_segment_size(MVEFILE *movie);
// get type of next segment in chunk (0xff if no more segments in chunk)
ubyte mvefile_get_next_segment_major(MVEFILE *movie);
// get subtype (version) of next segment in chunk (0xff if no more segments in chunk)
ubyte mvefile_get_next_segment_minor(MVEFILE *movie);
// see next segment (return NULL if no next segment)
ubyte *mvefile_get_next_segment(MVEFILE *movie);
// advance to next segment
void mvefile_advance_segment(MVEFILE *movie);
// fetch the next chunk (return 0 if at end of stream)
int mvefile_fetch_next_chunk(MVEFILE *movie);
// structure for maintaining an MVE stream
typedef struct MVESTREAM
{
MVEFILE *movie;
} MVESTREAM;
// open an MVE stream
MVESTREAM *mve_open(char *filename);
// close an MVE stream
void mve_close(MVESTREAM *movie);
// play next chunk
int mve_play_next_chunk(MVESTREAM *movie);
// basic movie playing functions
void mve_init(MVESTREAM *mve);
void mve_play(MVESTREAM *mve);
void mve_shutdown();
// utility functions
short mve_get_short(ubyte *data);
ushort mve_get_ushort(ubyte *data);
int mve_get_int(ubyte *data);
// callbacks for data handling
// audio
void mve_audio_createbuf(ubyte minor, ubyte *data);
int mve_audio_data(ubyte major, ubyte *data);
void mve_audio_play();
// video
int mve_video_createbuf(ubyte minor, ubyte *data);
int mve_video_init(ubyte *data);
void mve_video_palette(ubyte *data);
void mve_video_data(ubyte *data, int len);
void mve_video_codemap(ubyte *data, int len);
void mve_video_display();
// misc
void mve_end_movie();
void mve_end_chunk();
int mve_timer_create(ubyte *data);
typedef short mves;
#endif /* INCLUDED_MVELIB_H */
-846
View File
@@ -1,846 +0,0 @@
/*
* $Logfile: /Freespace2/code/cutscene/mveplayer.cpp $
* $Revision: 2.1.2.4 $
* $Date: 2007-02-10 00:01:53 $
* $Author: taylor $
*
* MVE movie playing routines
*
* $Log: not supported by cvs2svn $
* Revision 2.1.2.3 2006/12/26 05:14:52 taylor
* get rid of some stale vars that we don't use any longer
* a little at-exit cleanup
* handle rounding error on X/Y placement locations under Windows
*
* Revision 2.1.2.2 2006/12/07 17:55:51 taylor
* port over some Theora player stuff:
* - support for GL_ARB_texture_rectangle
* - fix GL tear-down on movie exit
* - fix sound tear-down order issue on OS X
* - some speed increases, and get rid of the extra gr_clear() per-frame now that it's handled properly
* - proper support for widescreen resolutions
*
* Revision 2.1.2.1 2006/08/19 04:14:57 taylor
* add decoder for 8-bit MVEs
* a basic fix for finding AVIs over MVEs, for mod dir stuff (this needs some CFILE support added to be a true fix, it's on the TODO list)
* little bits of cleanup for old/unused code
* make sure MVE filenames are correct in mvelib
*
* Revision 2.1 2006/05/13 06:59:48 taylor
* MVE player (audio only works with OpenAL builds!)
*
*
* $NoKeywords: $
*/
#ifdef SCP_UNIX
#include <errno.h>
#include <time.h>
#include <sys/time.h>
#endif
#include "graphics/gropengl.h"
#include "graphics/gropengltexture.h"
#include "graphics/gropenglextension.h"
#include "graphics/gropenglstate.h"
#include "globalincs/pstypes.h"
#include "cutscene/mvelib.h"
#include "cutscene/movie.h"
#include "graphics/2d.h"
#include "io/key.h"
#include "osapi/osapi.h"
#include "io/timer.h"
#include "sound/sound.h"
#include "sound/ds.h"
#include "bmpman/bmpman.h"
//#include "sound/audiostr.h"
extern int Cmdline_noscalevid;
static int mve_playing;
// timer variables
static int micro_frame_delay = 0;
static int timer_started = 0;
#ifdef SCP_UNIX
static struct timeval timer_expire = { 0, 0 };
#else
static int timer_expire;
#endif
// audio variables
#define MVE_AUDIO_BUFFERS 64 // total buffers to interact with stream
static int mve_audio_buffer_tail = 0;
static int mve_audio_playing = 0;
static int mve_audio_canplay = 0;
static int mve_audio_compressed = 0;
static int audiobuf_created;
#ifdef USE_OPENAL
// struct for the audio stream information
typedef struct MVE_AUDIO_T {
ALenum format;
int sample_rate;
int bytes_per_sec;
int channels;
int bitsize;
ALuint source_id;
ALuint audio_buffer[MVE_AUDIO_BUFFERS];
} mve_audio_t;
mve_audio_t *mas; // mve_audio_stream
// audio decompressor
extern void mveaudio_uncompress(short *buffer, unsigned char *data, int length);
#endif // USE_OPENAL
// video variables
int g_width, g_height;
void *g_vBuffers = NULL;
void *g_vBackBuf1, *g_vBackBuf2;
ushort *pixelbuf = NULL;
static GLuint GLtex = 0;
static GLint gl_screenYH = 0;
static GLint gl_screenXW = 0;
static GLfloat gl_screenU = 0;
static GLfloat gl_screenV = 0;
static int g_screenWidth, g_screenHeight;
static int g_screenX, g_screenY;
static int g_truecolor = 0;
static ubyte g_palette[768];
static ubyte *g_pCurMap = NULL;
static int g_nMapLength = 0;
static int videobuf_created, video_inited;
static int hp2, wp2;
static uint mve_video_skiptimer = 0;
static int mve_scale_video = 0;
// video externs from API graphics functions
extern void opengl_tcache_get_adjusted_texture_size(int w_in, int h_in, int *w_out, int *h_out);
extern GLenum GL_previous_texture_target;
// the decoders
extern void decodeFrame16(ubyte *pFrame, ubyte *pMap, int mapRemain, ubyte *pData, int dataRemain);
extern void decodeFrame8(ubyte *pFrame, ubyte *pMap, int mapRemain, ubyte *pData, int dataRemain);
/*************************
* general handlers
*************************/
void mve_end_movie()
{
mve_playing = 0;
}
/*************************
* timer handlers
*************************/
int mve_timer_create(ubyte *data)
{
int rate = mve_get_int(data);
int subd = mve_get_short(data+4);
micro_frame_delay = rate * subd;
return 1;
}
static void mve_timer_start(void)
{
#ifdef SCP_UNIX
int nsec = 0;
gettimeofday(&timer_expire, NULL);
timer_expire.tv_usec += micro_frame_delay;
if (timer_expire.tv_usec > 1000000) {
nsec = timer_expire.tv_usec / 1000000;
timer_expire.tv_sec += nsec;
timer_expire.tv_usec -= nsec * 1000000;
}
#else
timer_expire = timer_get_microseconds();
timer_expire += micro_frame_delay;
#endif
timer_started = 1;
}
static int mve_do_timer_wait(void)
{
if (!timer_started)
return 0;
#ifdef SCP_UNIX
int nsec = 0;
struct timespec ts, tsRem;
struct timeval tv;
gettimeofday(&tv, NULL);
if (tv.tv_sec > timer_expire.tv_sec)
goto end;
if ( (tv.tv_sec == timer_expire.tv_sec) && (tv.tv_usec >= timer_expire.tv_usec) )
goto end;
ts.tv_sec = timer_expire.tv_sec - tv.tv_sec;
ts.tv_nsec = 1000 * (timer_expire.tv_usec - tv.tv_usec);
if (ts.tv_nsec < 0) {
ts.tv_nsec += 1000000000UL;
--ts.tv_sec;
}
if ( (nanosleep(&ts, &tsRem) == -1) && (errno == EINTR) ) {
// so we got an error that was a signal interupt, try to sleep again with remainder of time
if ( (nanosleep(&tsRem, NULL) == -1) && (errno == EINTR) ) {
mprintf(("MVE: Timer error! Aborting movie playback!\n"));
return 1;
}
}
end:
timer_expire.tv_usec += micro_frame_delay;
if (timer_expire.tv_usec > 1000000) {
nsec = timer_expire.tv_usec / 1000000;
timer_expire.tv_sec += nsec;
timer_expire.tv_usec -= nsec * 1000000;
}
#else
int tv, ts, ts2;
tv = timer_get_microseconds();
if (tv > timer_expire)
goto end;
ts = timer_expire - tv;
ts2 = ts/1000;
Sleep(ts2);
end:
timer_expire += micro_frame_delay;
#endif
return 0;
}
static void mve_timer_stop()
{
#ifdef SCP_UNIX
timer_expire.tv_sec = 0;
timer_expire.tv_usec = 0;
#else
timer_expire = 0;
#endif
timer_started = 0;
}
/*************************
* audio handlers
*************************/
// setup the audio information from the data stream
void mve_audio_createbuf(ubyte minor, ubyte *data)
{
if (audiobuf_created)
return;
// if game sound disabled don't try and play movie audio
if (!Sound_enabled) {
mve_audio_canplay = 0;
return;
}
#ifdef USE_OPENAL
int flags, desired_buffer, sample_rate;
mas = (mve_audio_t *) vm_malloc ( sizeof(mve_audio_t) );
memset(mas, 0, sizeof(mve_audio_t));
mas->format = AL_INVALID;
flags = mve_get_ushort(data + 2);
sample_rate = mve_get_ushort(data + 4);
desired_buffer = mve_get_int(data + 6);
mas->channels = (flags & 0x0001) ? 2 : 1;
mas->bitsize = (flags & 0x0002) ? 16 : 8;
mas->sample_rate = sample_rate;
if (minor > 0) {
mve_audio_compressed = flags & 0x0004 ? 1 : 0;
} else {
mve_audio_compressed = 0;
}
if (mas->bitsize == 16) {
if (mas->channels == 2) {
mas->format = AL_FORMAT_STEREO16;
} else if (mas->channels == 1) {
mas->format = AL_FORMAT_MONO16;
}
} else if (mas->bitsize == 8) {
if (mas->channels == 2) {
mas->format = AL_FORMAT_STEREO8;
} else if (mas->channels == 1) {
mas->format = AL_FORMAT_MONO8;
}
}
// somethings wrong, bail now
if (mas->format == AL_INVALID) {
mve_audio_canplay = 0;
audiobuf_created = 1;
return;
}
OpenAL_ErrorCheck( alGenSources(1, &mas->source_id), { mve_audio_canplay = 0; return; } );
mve_audio_canplay = 1;
OpenAL_ErrorPrint( alSourcef(mas->source_id, AL_GAIN, 1.0f) );
memset(mas->audio_buffer, 0, MVE_AUDIO_BUFFERS * sizeof(ALuint));
#endif // USE_OPENAL
mve_audio_buffer_tail = 0;
audiobuf_created = 1;
}
// play and stream the audio
void mve_audio_play()
{
if (mve_audio_canplay) {
#ifdef USE_OPENAL
ALint status, bqueued;
OpenAL_ErrorCheck( alGetSourcei(mas->source_id, AL_SOURCE_STATE, &status), return );
OpenAL_ErrorCheck( alGetSourcei(mas->source_id, AL_BUFFERS_QUEUED, &bqueued), return );
mve_audio_playing = 1;
if (status != AL_PLAYING && bqueued > 0) {
OpenAL_ErrorPrint( alSourcePlay(mas->source_id) );
}
#endif // USE_OPENAL
}
}
// call this in shutdown to stop and close audio
static void mve_audio_stop()
{
if (!audiobuf_created)
return;
#ifdef USE_OPENAL
ALint p = 0;
mve_audio_playing = 0;
OpenAL_ErrorPrint( alSourceStop(mas->source_id) );
OpenAL_ErrorPrint( alGetSourcei(mas->source_id, AL_BUFFERS_PROCESSED, &p) );
OpenAL_ErrorPrint( alSourceUnqueueBuffers(mas->source_id, p, mas->audio_buffer) );
OpenAL_ErrorPrint( alDeleteSources(1, &mas->source_id) );
for (int i = 0; i < MVE_AUDIO_BUFFERS; i++) {
// make sure that the buffer is real before trying to delete, it could crash for some otherwise
if ( (mas->audio_buffer[i] != 0) && alIsBuffer(mas->audio_buffer[i]) ) {
OpenAL_ErrorPrint( alDeleteBuffers(1, &mas->audio_buffer[i]) );
}
}
if (mas != NULL) {
vm_free(mas);
mas = NULL;
}
#endif // USE_OPENAL
}
int mve_audio_data(ubyte major, ubyte *data)
{
static const int selected_chan=1;
int chan;
int nsamp;
if (mve_audio_canplay) {
#ifdef USE_OPENAL
chan = mve_get_ushort(data + 2);
nsamp = mve_get_ushort(data + 4);
if (chan & selected_chan) {
ALint bprocessed, bqueued, status;
ALuint bid;
OpenAL_ErrorCheck( alGetSourcei(mas->source_id, AL_BUFFERS_PROCESSED, &bprocessed), return 0 );
while (bprocessed-- > 2)
OpenAL_ErrorPrint( alSourceUnqueueBuffers(mas->source_id, 1, &bid) );
OpenAL_ErrorCheck( alGetSourcei(mas->source_id, AL_BUFFERS_QUEUED, &bqueued), return 0 );
if (bqueued == 0)
mprintf(("MVE: Buffer underun (First is normal)\n"));
OpenAL_ErrorCheck( alGetSourcei(mas->source_id, AL_SOURCE_STATE, &status), return 0 );
if ( (mve_audio_playing) && (status != AL_PLAYING) && (bqueued > 0) ) {
OpenAL_ErrorCheck( alSourcePlay(mas->source_id), return 0 );
}
if (bqueued < MVE_AUDIO_BUFFERS) {
short *buf = NULL;
/* HACK: +4 mveaudio_uncompress adds 4 more bytes */
if (major == 8) {
if (mve_audio_compressed) {
nsamp += 4;
buf = (short *)vm_malloc(nsamp);
mveaudio_uncompress(buf, data, -1); /* XXX */
} else {
nsamp -= 8;
data += 8;
buf = (short *)vm_malloc(nsamp);
memcpy(buf, data, nsamp);
}
} else {
buf = (short *)vm_malloc(nsamp);
memset(buf, 0, nsamp); /* XXX */
}
if (!mas->audio_buffer[mve_audio_buffer_tail]) {
OpenAL_ErrorCheck( alGenBuffers(1,&mas->audio_buffer[mve_audio_buffer_tail]), { vm_free(buf); return 0; } );
}
OpenAL_ErrorCheck( alBufferData(mas->audio_buffer[mve_audio_buffer_tail], mas->format, buf, nsamp, mas->sample_rate), { vm_free(buf); return 0; } );
OpenAL_ErrorCheck( alSourceQueueBuffers(mas->source_id, 1, &mas->audio_buffer[mve_audio_buffer_tail]), { vm_free(buf); return 0;} );
//fprintf(stderr,"Queued buffer %d(%d)\n", mve_audio_buftail, mas->audio_buffer[mve_audio_buftail]);
if (++mve_audio_buffer_tail == MVE_AUDIO_BUFFERS)
mve_audio_buffer_tail = 0;
bqueued++;
vm_free(buf);
} else {
mprintf(("MVE: Buffer overrun: Queue full\n"));
}
}
#endif // USE_OPENAL
}
return 1;
}
/*************************
* video handlers
*************************/
int mve_video_createbuf(ubyte minor, ubyte *data)
{
if (videobuf_created)
return 1;
short w, h;
short count, truecolor;
w = mve_get_short(data);
h = mve_get_short(data+2);
if (minor > 0) {
count = mve_get_short(data+4);
} else {
count = 1;
}
if (minor > 1) {
truecolor = mve_get_short(data+6);
} else {
truecolor = 0;
}
g_width = w << 3;
g_height = h << 3;
g_vBackBuf1 = g_vBuffers = vm_malloc(g_width * g_height * 4);
if (g_vBackBuf1 == NULL) {
nprintf(("MOVIE", "ERROR: Can't allocate video buffer"));
videobuf_created = 1;
return 0;
}
if (truecolor)
g_vBackBuf2 = (ushort *)g_vBackBuf1 + (g_width * g_height);
else
g_vBackBuf2 = (ubyte *)g_vBackBuf1 + (g_width * g_height);
memset(g_vBackBuf1, 0, g_width * g_height * 4);
g_truecolor = truecolor;
videobuf_created = 1;
if (gr_screen.mode == GR_OPENGL) {
GLfloat scale_by = 1.0f;
float screen_ratio = (float)gr_screen.max_w / (float)gr_screen.max_h;
float movie_ratio = (float)g_width / (float)g_height;
if (screen_ratio > movie_ratio)
scale_by = (float)gr_screen.max_h / (float)g_height;
else
scale_by = (float)gr_screen.max_w / (float)g_width;
// don't bother setting anything if we aren't going to need it
if (!Cmdline_noscalevid && (scale_by != 1.0f)) {
glMatrixMode(GL_MODELVIEW);
glPushMatrix();
glLoadIdentity();
glScalef( scale_by, scale_by, 1.0f );
mve_scale_video = 1;
}
if (mve_scale_video) {
g_screenX = ((fl2i(gr_screen.max_w / scale_by + 0.5f) - g_width) / 2);
g_screenY = ((fl2i(gr_screen.max_h / scale_by + 0.5f) - g_height) / 2);
} else {
// centers on 1024x768, fills on 640x480
g_screenX = ((gr_screen.max_w - g_width) / 2);
g_screenY = ((gr_screen.max_h - g_height) / 2);
}
// set additional values for screen width/height and UV coords
if (gr_screen.mode == GR_OPENGL) {
gl_screenYH = g_screenY + g_height;
gl_screenXW = g_screenX + g_width;
gl_screenU = i2fl(g_width) / i2fl(wp2);
gl_screenV = i2fl(g_height) / i2fl(hp2);
}
}
return 1;
}
static void mve_convert_and_draw()
{
ushort *pDests;
ushort *pSrcs = NULL;
ushort *pixels = (ushort *)g_vBackBuf1;
int x, y;
ubyte *pSrcs8 = NULL;
ubyte *pixels8 = (ubyte *)g_vBackBuf1;
ubyte r, g, b;
ushort bit_16;
if (g_truecolor)
pSrcs = pixels;
else
pSrcs8 = pixels8;
pDests = pixelbuf;
if (gr_screen.mode != GR_OPENGL) {
if (g_screenWidth > g_width)
pDests += ((g_screenWidth - g_width) / 2) / 2;
if (g_screenHeight > g_height)
pDests += ((g_screenHeight - g_height) / 2) * g_screenWidth;
}
for (y=0; y<g_height; y++) {
for (x = 0; x < g_width; x++) {
if (g_truecolor) {
Assert( pSrcs != NULL );
pDests[x] = (1<<15)|*pSrcs;
pSrcs++;
} else {
Assert( pSrcs8 != NULL );
// grab rgb color
r = (g_palette[(*pSrcs8)*3] / 2);
g = (g_palette[(*pSrcs8)*3 + 1] / 2);
b = (g_palette[(*pSrcs8)*3 + 2] / 2);
// stuff the color
bit_16 = (ushort)(r << Gr_t_red.shift);
bit_16 |= (ushort)(g << Gr_t_green.shift);
bit_16 |= (ushort)(b << Gr_t_blue.shift);
bit_16 |= (ushort)(Gr_t_alpha.mask);
// stuff the pixel
pDests[x] = (1<<15)|bit_16;
pSrcs8++;
}
}
pDests += g_screenWidth;
}
}
void mve_video_display()
{
fix t1 = timer_get_fixed_seconds();
mve_convert_and_draw();
// this thing is basically stupid but I don't care
// micro_frame_delay is divided by 10 to match mve_video_skiptimer overflow catch
if ( mve_video_skiptimer > (uint)(micro_frame_delay/10) ) {
// we are running slow so subtract desired time from actual and skip this frame
mve_video_skiptimer -= (micro_frame_delay/10);
return;
} else {
// zero out so we can get a new count
mve_video_skiptimer = 0;
}
if (gr_screen.mode == GR_OPENGL) {
glTexSubImage2D(GL_state.Texture.GetTarget(), 0, 0, 0, g_width, g_height, GL_BGRA, GL_UNSIGNED_SHORT_1_5_5_5_REV, pixelbuf);
glBegin(GL_QUADS);
glTexCoord2f(0, 0);
glVertex2i(g_screenX, g_screenY);
glTexCoord2f(0, gl_screenV);
glVertex2i(g_screenX, gl_screenYH);
glTexCoord2f(gl_screenU, gl_screenV);
glVertex2i(gl_screenXW, gl_screenYH);
glTexCoord2f(gl_screenU, 0);
glVertex2i(gl_screenXW, g_screenY);
glEnd();
} else {
// DDOI - This is probably really fricking slow
int bitmap = bm_create (16, g_screenWidth, g_screenHeight, pixelbuf, 0);
gr_set_bitmap (bitmap);
gr_bitmap (g_screenX, g_screenY, true);
bm_release (bitmap);
}
gr_flip();
os_poll();
fix t2 = timer_get_fixed_seconds();
// only get a new count if we are definitely through with old count
if ( mve_video_skiptimer == 0 ) {
// for a more accurate count convert the frame rate to a float and multiply
// by one-hundred-thousand before converting to an uint.
mve_video_skiptimer = (uint)(f2fl(t2-t1) * 100000);
}
int k = key_inkey();
switch (k) {
case KEY_ESC:
case KEY_ENTER:
case KEY_SPACEBAR:
mve_playing = 0;
}
//mprintf(("mve frame took this long: %.6f\n", f2fl(t2-t1) / 1000.0f));
}
int mve_video_init(ubyte *data)
{
if (video_inited)
return 1;
short width, height;
width = mve_get_short(data);
height = mve_get_short(data+2);
g_screenWidth = width;
g_screenHeight = height;
// DDOI - Allocate RGB565 pixel buffer
pixelbuf = (ushort *)vm_malloc(g_screenWidth * g_screenHeight * 2);
if (pixelbuf == NULL) {
nprintf(("MOVIE", "ERROR: Can't allocate memory for pixelbuf"));
video_inited = 1;
return 0;
}
memset(pixelbuf, 0, g_screenWidth * g_screenHeight * 2);
if (gr_screen.mode == GR_OPENGL) {
opengl_set_texture_target(GL_TEXTURE_2D);
opengl_tcache_get_adjusted_texture_size(g_screenWidth, g_screenHeight, &wp2, &hp2);
glGenTextures(1, &GLtex);
Assert( GLtex != 0 );
if ( GLtex == 0 ) {
nprintf(("MOVIE", "ERROR: Can't create a GL texture"));
video_inited = 1;
return 0;
}
gr_set_lighting(false, false);
GL_state.Texture.DisableAll();
GL_state.Texture.SetActiveUnit(0);
GL_state.Texture.SetTarget(GL_texture_target);
GL_state.Texture.Enable(GLtex);
GL_state.SetTextureSource(TEXTURE_SOURCE_DECAL);
GL_state.SetAlphaBlendMode(ALPHA_BLEND_NONE);
GL_state.SetZbufferType(ZBUFFER_TYPE_NONE);
GL_state.Texture.SetWrapS(GL_CLAMP_TO_EDGE);
GL_state.Texture.SetWrapT(GL_CLAMP_TO_EDGE);
// NOTE: using NULL instead of pixelbuf crashes some drivers, but then so does pixelbuf
glTexImage2D(GL_state.Texture.GetTarget(), 0, GL_RGB5_A1, wp2, hp2, 0, GL_BGRA_EXT, GL_UNSIGNED_SHORT_1_5_5_5_REV, NULL);
// set our color so that we can make sure that it's correct
glColor3f(1.0f, 1.0f, 1.0f);
}
#ifndef NO_DIRECT3D
else if (gr_screen.mode == GR_DIRECT3D) {
// TODO: is there a fast way to do frames in D3D too?
}
#endif
memset(g_palette, 0, 768);
video_inited = 1;
return 1;
}
void mve_video_palette(ubyte *data)
{
short start, count;
start = mve_get_short(data);
count = mve_get_short(data+2);
memcpy(g_palette + 3*start, data+4, 3*count);
}
void mve_video_codemap(ubyte *data, int len)
{
g_pCurMap = data;
g_nMapLength = len;
}
void mve_video_data(ubyte *data, int len)
{
short nFrameHot, nFrameCold;
short nXoffset, nYoffset;
short nXsize, nYsize;
ushort nFlags;
ubyte *temp;
nFrameHot = mve_get_short(data);
nFrameCold = mve_get_short(data+2);
nXoffset = mve_get_short(data+4);
nYoffset = mve_get_short(data+6);
nXsize = mve_get_short(data+8);
nYsize = mve_get_short(data+10);
nFlags = mve_get_ushort(data+12);
if (nFlags & 1) {
temp = (ubyte *)g_vBackBuf1;
g_vBackBuf1 = g_vBackBuf2;
g_vBackBuf2 = temp;
}
if (g_truecolor)
decodeFrame16((ubyte *)g_vBackBuf1, g_pCurMap, g_nMapLength, data+14, len-14);
else
decodeFrame8((ubyte *)g_vBackBuf1, g_pCurMap, g_nMapLength, data+14, len-14);
}
void mve_end_chunk()
{
g_pCurMap = NULL;
}
void mve_init(MVESTREAM *mve)
{
// reset to default values
mve_audio_buffer_tail = 0;
mve_audio_playing = 0;
mve_audio_canplay = 0;
mve_audio_compressed = 0;
audiobuf_created = 0;
videobuf_created = 0;
video_inited = 0;
mve_scale_video = 0;
mve_playing = 1;
}
void mve_play(MVESTREAM *mve)
{
int init_timer = 0, timer_error = 0;
int cont = 1;
if (!timer_started)
mve_timer_start();
while (cont && mve_playing && !timer_error) {
cont = mve_play_next_chunk(mve);
if (micro_frame_delay && !init_timer) {
mve_timer_start();
init_timer = 1;
}
timer_error = mve_do_timer_wait();
}
}
void mve_shutdown()
{
if (gr_screen.mode == GR_OPENGL) {
if (mve_scale_video) {
glMatrixMode(GL_MODELVIEW);
glPopMatrix();
}
GL_state.Texture.Disable();
GL_state.Texture.Delete(GLtex);
glDeleteTextures(1, &GLtex);
GLtex = 0;
}
if (pixelbuf != NULL) {
vm_free(pixelbuf);
pixelbuf = NULL;
}
if (g_vBuffers != NULL) {
vm_free(g_vBuffers);
g_vBuffers = NULL;
}
mve_audio_stop();
mve_timer_stop();
}
-957
View File
@@ -1,957 +0,0 @@
/*
* $Logfile: /Freespace2/code/cutscene/oggplayer.cpp $
* $Revision: 1.1.2.5 $
* $Date: 2007-04-11 14:44:32 $
* $Author: taylor $
*
* movie player code
*
* $Log: not supported by cvs2svn $
* Revision 1.1.2.4 2007/03/22 20:23:58 taylor
* fix stupidness that screwed up RGB values (Mantis #1307)
*
* Revision 1.1.2.3 2007/02/10 00:01:53 taylor
* make sure that our color is getting set properly (should properly fix the red/green tint problem, Mantis #1041)
* slight optimization for Theora YUV->RGB converter
*
* Revision 1.1.2.2 2007/01/07 12:10:18 taylor
* remove D3D support for Theora movies, make sure that it doesn't try to play them (since it wouldn't work properly anyway)
* fix triple-buffer problem with page flipping (Mantis #1190)
*
* Revision 1.1.2.1 2006/12/25 21:44:11 taylor
* initial OGG Theora movie support (likely to be rewritten at least in large part)
*
*
*
* $NoKeywords: $
*
*/
// This player code is based largely on the player example in the libtheora package
// and so they get a fair bit of credit for this code, even if in ideas/comments only
#ifdef SCP_UNIX
#include <sys/time.h>
#include <errno.h>
#endif
#include "globalincs/pstypes.h"
#include "cfile/cfile.h"
#include "graphics/gropengl.h"
#include "graphics/gropengltexture.h"
#include "graphics/gropenglextension.h"
#include "graphics/gropenglshader.h"
#include "graphics/gropenglstate.h"
#include "graphics/2d.h"
#include "io/key.h"
#include "osapi/osapi.h"
#include "sound/sound.h"
#include "sound/ds.h"
#include "bmpman/bmpman.h"
#include "cutscene/oggplayer.h"
#include "io/timer.h"
#include "theora/theora.h"
#include "vorbis/codec.h"
extern int Cmdline_noscalevid;
static int hp2, wp2;
static int video_inited = 0;
static int scale_video = 0;
static int playing = 1;
static ubyte *pixelbuf = NULL;
static uint g_screenWidth = 0;
static uint g_screenHeight = 0;
static int g_screenX = 0;
static int g_screenY = 0;
static GLuint GLtex = 0;
static GLint gl_screenYH = 0;
static GLint gl_screenXW = 0;
static GLfloat gl_screenU = 0;
static GLfloat gl_screenV = 0;
// video externs from API graphics functions
extern void opengl_tcache_get_adjusted_texture_size(int w_in, int h_in, int *w_out, int *h_out);
static int timer_started = 0;
static longlong base_time = -1;
#ifdef SCP_UNIX
static struct timeval timer_expire = { 0, 0 };
#else
static int timer_expire;
#endif
static int audio_inited = 0;
static int audio_buffer_tail = 0;
static ALuint audio_sid = 0;
#define OGG_AUDIO_BUFFERS 15
static ALuint audio_buffers[OGG_AUDIO_BUFFERS];
// single audio fragment audio buffering
static int audiobuf_fill = 0;
static short *audiobuf = NULL;
static longlong audiobuf_granulepos = 0; // time position of last sample
static int audiofd_fragsize = 0;
// single frame video buffering
static longlong videobuf_granulepos = -1;
static double videobuf_time = 0;
// -----------------------------------------------------------------------------
// Utility items
//
// helper; just grab some more compressed bitstream and sync it for page extraction
static int OGG_buffer_data(THEORAFILE *movie)
{
char *buffer = ogg_sync_buffer(&movie->osyncstate, 4096);
int bytes = cfread(buffer, 1, 4096, movie->cfp);
ogg_sync_wrote(&movie->osyncstate, bytes);
return bytes;
}
// helper: push a page into the appropriate steam
// this can be done blindly; a stream won't accept a page that doesn't belong to it
static void OGG_queue_page(THEORAFILE *movie)
{
Assert( movie->theora_p );
ogg_stream_pagein(&movie->t_osstate, &movie->opage);
if (movie->vorbis_p)
ogg_stream_pagein(&movie->v_osstate, &movie->opage);
}
// get relative time since beginning playback, compensating for A/V drift
static double OGG_get_time()
{
#ifdef SCP_UNIX
longlong now;
struct timeval tv;
gettimeofday(&tv, NULL);
now = tv.tv_sec * 1000 + tv.tv_usec / 1000;
if (base_time == -1)
base_time = now;
return (now - base_time) * 0.001;
#else
if (base_time == -1)
base_time = timer_get_milliseconds();
return (timer_get_milliseconds() - base_time) * 0.001;
#endif
}
static void OGG_timer_init()
{
#if SCP_UNIX
int nsec = 0;
gettimeofday(&timer_expire, NULL);
timer_expire.tv_usec += (int)((videobuf_time - OGG_get_time()) * 1000000.0);
if (timer_expire.tv_usec > 1000000) {
nsec = timer_expire.tv_usec / 1000000;
timer_expire.tv_sec += nsec;
timer_expire.tv_usec -= nsec * 1000000;
}
#else
timer_expire = timer_get_microseconds();
timer_expire += (int)((videobuf_time - OGG_get_time()) * 1000000.0);
#endif
timer_started = 1;
}
static void OGG_timer_do_wait()
{
if (!timer_started)
OGG_timer_init();
#if SCP_UNIX
int nsec = 0;
struct timespec ts, tsRem;
struct timeval tv;
gettimeofday(&tv, NULL);
if (tv.tv_sec > timer_expire.tv_sec)
goto end;
if ( (tv.tv_sec == timer_expire.tv_sec) && (tv.tv_usec >= timer_expire.tv_usec) )
goto end;
ts.tv_sec = timer_expire.tv_sec - tv.tv_sec;
ts.tv_nsec = 1000 * (timer_expire.tv_usec - tv.tv_usec);
if (ts.tv_nsec < 0) {
ts.tv_nsec += 1000000000UL;
--ts.tv_sec;
}
if ( (nanosleep(&ts, &tsRem) == -1) && (errno == EINTR) ) {
// so we got an error that was a signal interupt, try to sleep again with remainder of time
if ( (nanosleep(&tsRem, NULL) == -1) && (errno == EINTR) ) {
mprintf(("MVE: Timer error! Aborting movie playback!\n"));
return;
}
}
end:
timer_expire.tv_usec += (int)((videobuf_time - OGG_get_time()) * 1000000.0);
if (timer_expire.tv_usec > 1000000) {
nsec = timer_expire.tv_usec / 1000000;
timer_expire.tv_sec += nsec;
timer_expire.tv_usec -= nsec * 1000000;
}
#else
int tv, ts, ts2;
tv = timer_get_microseconds();
if (tv > timer_expire)
goto end;
ts = timer_expire - tv;
ts2 = ts/1000;
Sleep(ts2);
end:
timer_expire += (int)((videobuf_time - OGG_get_time()) * 1000000.0);
#endif
}
//
// End Utility items
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
// That wonderful Audio
//
static void OGG_audio_init(vorbis_info *vinfo)
{
if (audio_inited)
return;
Assert( vinfo != NULL );
audio_inited = 1;
OpenAL_ErrorCheck( alGenSources(1, &audio_sid), return );
OpenAL_ErrorPrint( alSourcef(audio_sid, AL_GAIN, 1.0f) );
memset( &audio_buffers, 0, sizeof(ALuint) * OGG_AUDIO_BUFFERS );
audiofd_fragsize = (((vinfo->channels * 16) / 8) * vinfo->rate);
audiobuf = (short *) vm_malloc(audiofd_fragsize);
}
static void OGG_audio_close()
{
if ( !audio_inited )
return;
audio_inited = 0;
ALint p = 0;
OpenAL_ErrorPrint( alSourceStop(audio_sid) );
OpenAL_ErrorPrint( alGetSourcei(audio_sid, AL_BUFFERS_PROCESSED, &p) );
OpenAL_ErrorPrint( alSourceUnqueueBuffers(audio_sid, p, audio_buffers) );
OpenAL_ErrorPrint( alDeleteSources(1, &audio_sid) );
for (int i = 0; i < OGG_AUDIO_BUFFERS; i++) {
// make sure that the buffer is real before trying to delete, it could crash for some otherwise
if ( (audio_buffers[i] != 0) && alIsBuffer(audio_buffers[i]) ) {
OpenAL_ErrorPrint( alDeleteBuffers(1, &audio_buffers[i]) );
}
}
audio_sid = 0;
audio_buffer_tail = 0;
audiobuf_fill = 0;
audiobuf_granulepos = 0;
audiofd_fragsize = 0;
if (audiobuf != NULL) {
vm_free(audiobuf);
audiobuf = NULL;
}
}
static void OGG_audio_write(vorbis_info *vorbis, bool *ready)
{
ALint status, queued, processed = 0;
ALuint bid = 0;
if ( !audio_inited || !(*ready) )
return;
OpenAL_ErrorCheck( alGetSourcei(audio_sid, AL_BUFFERS_PROCESSED, &processed), return );
while (processed-- > 2)
OpenAL_ErrorPrint( alSourceUnqueueBuffers(audio_sid, 1, &bid) );
if ( !(*ready) )
return;
OpenAL_ErrorCheck( alGetSourcei(audio_sid, AL_BUFFERS_QUEUED, &queued), return );
if ( audiobuf_fill && (queued < OGG_AUDIO_BUFFERS) ) {
if ( !audio_buffers[audio_buffer_tail] )
OpenAL_ErrorCheck( alGenBuffers(1, &audio_buffers[audio_buffer_tail]), return );
ALenum format = (vorbis->channels == 2) ? AL_FORMAT_STEREO16 : AL_FORMAT_MONO16;
OpenAL_ErrorCheck( alBufferData(audio_buffers[audio_buffer_tail], format, audiobuf, audiobuf_fill, vorbis->rate), return );
OpenAL_ErrorCheck( alSourceQueueBuffers(audio_sid, 1, &audio_buffers[audio_buffer_tail]), return );
if (++audio_buffer_tail == OGG_AUDIO_BUFFERS)
audio_buffer_tail = 0;
audiobuf_fill = 0;
*ready = false;
} else {
// mprintf(("Theora WARN: Buffer overrun: Queue full\n"));
}
OpenAL_ErrorCheck( alGetSourcei(audio_sid, AL_SOURCE_STATE, &status), return );
OpenAL_ErrorCheck( alGetSourcei(audio_sid, AL_BUFFERS_QUEUED, &queued), return );
if ( (status != AL_PLAYING) && (queued > 0) )
OpenAL_ErrorPrint( alSourcePlay(audio_sid) );
}
//
// End Audio stuff
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
// Video related stuff
//
static void OGG_video_init(theora_info *tinfo)
{
float scale_by = 0.0f;
if (video_inited)
return;
Assert( tinfo != NULL );
g_screenWidth = tinfo->frame_width;
g_screenHeight = tinfo->frame_height;
if (gr_screen.mode == GR_OPENGL) {
opengl_set_texture_target(GL_TEXTURE_2D);
opengl_tcache_get_adjusted_texture_size(g_screenWidth, g_screenHeight, &wp2, &hp2);
glGenTextures(1, &GLtex);
Assert( GLtex != 0 );
if ( GLtex == 0 ) {
nprintf(("MOVIE", "ERROR: Can't create a GL texture"));
video_inited = 1;
return;
}
gr_set_lighting(false, false);
GL_state.Texture.DisableAll();
GL_state.Texture.SetActiveUnit(0);
GL_state.Texture.SetTarget(GL_texture_target);
GL_state.Texture.Enable(GLtex);
GL_state.SetTextureSource(TEXTURE_SOURCE_DECAL);
GL_state.SetAlphaBlendMode(ALPHA_BLEND_NONE);
GL_state.SetZbufferType(ZBUFFER_TYPE_NONE);
GL_state.Texture.SetWrapS(GL_CLAMP_TO_EDGE);
GL_state.Texture.SetWrapT(GL_CLAMP_TO_EDGE);
// NOTE: using NULL instead of pixelbuf crashes some drivers, but then so does pixelbuf
glTexImage2D(GL_state.Texture.GetTarget(), 0, GL_RGB8, wp2, hp2, 0, GL_BGR, GL_UNSIGNED_BYTE, NULL);
float screen_ratio = (float)gr_screen.max_w / (float)gr_screen.max_h;
float movie_ratio = (float)g_screenWidth / (float)g_screenHeight;
if (screen_ratio > movie_ratio)
scale_by = (float)gr_screen.max_h / (float)g_screenHeight;
else
scale_by = (float)gr_screen.max_w / (float)g_screenWidth;
// don't bother setting anything if we aren't going to need it
if (!Cmdline_noscalevid && (scale_by != 1.0f)) {
glMatrixMode(GL_MODELVIEW);
glPushMatrix();
glLoadIdentity();
glScalef( scale_by, scale_by, -1.0f );
scale_video = 1;
}
// set our color so that we can make sure that it's correct
glColor3f(1.0f, 1.0f, 1.0f);
}
pixelbuf = (ubyte *) vm_malloc_q(g_screenWidth * g_screenHeight * 3);
if (pixelbuf == NULL) {
nprintf(("MOVIE", "ERROR: Can't allocate memory for pixelbuf"));
video_inited = 1;
return;
}
memset( pixelbuf, 0, g_screenWidth * g_screenHeight * 3 );
if (scale_video) {
g_screenX = ((fl2i(gr_screen.max_w / scale_by + 0.5f) - g_screenWidth) / 2);
g_screenY = ((fl2i(gr_screen.max_h / scale_by + 0.5f) - g_screenHeight) / 2);
} else {
// centers on 1024x768, fills on 640x480
g_screenX = ((gr_screen.max_w - g_screenWidth) / 2);
g_screenY = ((gr_screen.max_h - g_screenHeight) / 2);
}
// set additional values for screen width/height and UV coords
if (gr_screen.mode == GR_OPENGL) {
gl_screenYH = g_screenY + g_screenHeight;
gl_screenXW = g_screenX + g_screenWidth;
gl_screenU = i2fl(g_screenWidth) / i2fl(wp2);
gl_screenV = i2fl(g_screenHeight) / i2fl(hp2);
}
video_inited = 1;
}
static void OGG_video_close()
{
if ( !video_inited ) {
return;
}
if (gr_screen.mode == GR_OPENGL) {
if (scale_video) {
glMatrixMode(GL_MODELVIEW);
glPopMatrix();
}
GL_state.Texture.Disable();
GL_state.Texture.Delete(GLtex);
glDeleteTextures(1, &GLtex);
opengl_set_texture_target();
GLtex = 0;
}
if (pixelbuf != NULL) {
vm_free(pixelbuf);
pixelbuf = NULL;
}
video_inited = 0;
scale_video = 0;
pixelbuf = NULL;
g_screenWidth = 0;
g_screenHeight = 0;
g_screenX = 0;
g_screenY = 0;
GLtex = 0;
gl_screenYH = 0;
gl_screenXW = 0;
gl_screenU = 0;
gl_screenV = 0;
}
static void convert_YUV_to_RGB(yuv_buffer *yuv)
{
int Y1, Y2, U, V;
int R = 0, G = 0, B = 0;
int C, D, E;
uint x, y;
uint width_2 = g_screenWidth/2;
ubyte *pix = &pixelbuf[0];
ubyte *y_ptr = (ubyte *)yuv->y;
ubyte *u_ptr = (ubyte *)yuv->u;
ubyte *v_ptr = (ubyte *)yuv->v;
for (y = 0; y < g_screenHeight; y++) {
for (x = 0; x < width_2; x++) {
// we need two pixels of Y
Y1 = *y_ptr; y_ptr++;
Y2 = *y_ptr; y_ptr++;
// only one pixel of U and V (half the size of Y)
U = u_ptr[x];
V = v_ptr[x];
D = (U - 128);
E = (V - 128);
// first pixel
C = (Y1 - 16) * 298;
R = ((C + 409 * E + 128) >> 8);
G = ((C - 100 * D - 208 * E + 128) >> 8);
B = ((C + 516 * D + 128) >> 8);
CLAMP(R, 0, 255);
CLAMP(G, 0, 255);
CLAMP(B, 0, 255);
*pix++ = (ubyte)B;
*pix++ = (ubyte)G;
*pix++ = (ubyte)R;
// second pixel (U and V values are resused)
C = (Y2 - 16) * 298;
R = ((C + 409 * E + 128) >> 8);
G = ((C - 100 * D - 208 * E + 128) >> 8);
B = ((C + 516 * D + 128) >> 8);
CLAMP(R, 0, 255);
CLAMP(G, 0, 255);
CLAMP(B, 0, 255);
*pix++ = (ubyte)B;
*pix++ = (ubyte)G;
*pix++ = (ubyte)R;
}
y_ptr += (yuv->y_stride - yuv->y_width);
// u and v have to be done every other row (it's a 2x2 block)
if (y % 2) {
u_ptr += yuv->uv_stride;
v_ptr += yuv->uv_stride;
}
}
}
static void OGG_video_draw(theora_state *tstate)
{
yuv_buffer yuv;
theora_decode_YUVout(tstate, &yuv);
convert_YUV_to_RGB(&yuv);
if (gr_screen.mode == GR_OPENGL) {
glTexSubImage2D(GL_state.Texture.GetTarget(), 0, 0, 0, g_screenWidth, g_screenHeight, GL_BGR, GL_UNSIGNED_BYTE, pixelbuf);
glBegin(GL_QUADS);
glTexCoord2f(0, 0);
glVertex2i(g_screenX, g_screenY);
glTexCoord2f(0, gl_screenV);
glVertex2i(g_screenX, gl_screenYH);
glTexCoord2f(gl_screenU, gl_screenV);
glVertex2i(gl_screenXW, gl_screenYH);
glTexCoord2f(gl_screenU, 0);
glVertex2i(gl_screenXW, g_screenY);
glEnd();
}
gr_flip();
os_poll();
int k = key_inkey();
switch (k) {
case KEY_ESC:
case KEY_ENTER:
case KEY_SPACEBAR:
playing = 0;
}
}
//
// End Video related stuff
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
// The global stuff...
//
// close out a theora movie and free it's memory
void theora_close(THEORAFILE *movie)
{
Assert( movie != NULL );
timer_started = 0;
base_time = -1;
videobuf_granulepos = -1;
videobuf_time = 0;
if (movie->vorbis_p) {
ogg_stream_clear(&movie->v_osstate);
vorbis_block_clear(&movie->vblock);
vorbis_dsp_clear(&movie->vstate);
vorbis_comment_clear(&movie->vcomment);
vorbis_info_clear(&movie->vinfo);
}
if (movie->theora_p) {
ogg_stream_clear(&movie->t_osstate);
theora_clear(&movie->tstate);
theora_comment_clear(&movie->tcomment);
theora_info_clear(&movie->tinfo);
}
ogg_sync_clear(&movie->osyncstate);
// free the stream
if (movie->cfp)
cfclose(movie->cfp);
// free the struct
vm_free(movie);
playing = 1;
}
// opens a theora file, verifies we can use it, initializes everything needed
// to decode and use the file
THEORAFILE *theora_open(char *filename)
{
char lower_name[MAX_FILENAME_LEN];
THEORAFILE *movie;
int stateflag = 0;
// create the file
movie = (THEORAFILE *) vm_malloc_q( sizeof(THEORAFILE) );
if (movie == NULL)
return NULL;
memset( movie, 0, sizeof(THEORAFILE) );
// lower case filename for checking
memset( lower_name, 0, sizeof(lower_name) );
strncpy( lower_name, filename, strlen(filename) );
strlwr(lower_name);
char *p = strchr( lower_name, '.' );
if ( p ) *p = 0;
SAFE_STRCAT( lower_name, ".ogg", sizeof(lower_name) );
// NOTE: Because the .ogg extension is used for both movies and sounds, we have to
// be a bit more specific about our search locations, so we look only in the
// two places that Theora movies might exist.
movie->cfp = cfopen(lower_name, "rb", CFILE_NORMAL, CF_TYPE_ROOT);
if (movie->cfp == NULL)
movie->cfp = cfopen(lower_name, "rb", CFILE_NORMAL, CF_TYPE_MOVIES);
if (movie->cfp == NULL) {
mprintf(("Theora ERROR: Unable to find and open movie file named '%s'\n", lower_name));
goto Error;
}
// start up Ogg stream synchronization layer
ogg_sync_init(&movie->osyncstate);
// init supporting Vorbis structures needed in header parsing
vorbis_info_init(&movie->vinfo);
vorbis_comment_init(&movie->vcomment);
// init supporting Theora structures needed in header parsing
theora_comment_init(&movie->tcomment);
theora_info_init(&movie->tinfo);
// ogg file open so parse the headers
// we are only interested in Vorbis/Theora streams
while ( !stateflag ) {
int ret = OGG_buffer_data(movie);
if (ret == 0)
break;
while (ogg_sync_pageout(&movie->osyncstate, &movie->opage) > 0) {
ogg_stream_state test;
// is this a mandated initial header? If not, stop parsing
if ( !ogg_page_bos(&movie->opage) ) {
// don't leak the page; get it into the appropriate stream
OGG_queue_page(movie);
stateflag = 1;
break;
}
ogg_stream_init(&test, ogg_page_serialno(&movie->opage));
ogg_stream_pagein(&test, &movie->opage);
ogg_stream_packetout(&test, &movie->opacket);
// identify the codec: try theora
if ( !movie->theora_p && (theora_decode_header(&movie->tinfo, &movie->tcomment, &movie->opacket) >= 0) ) {
// it is theora
memcpy( &movie->t_osstate, &test, sizeof(test) );
movie->theora_p = 1;
} else if ( !movie->vorbis_p && (vorbis_synthesis_headerin(&movie->vinfo, &movie->vcomment, &movie->opacket) >= 0) ) {
// it is vorbis
memcpy( &movie->v_osstate, &test, sizeof(test) );
movie->vorbis_p = 1;
} else {
// whatever it is, we don't care about it
ogg_stream_clear(&test);
}
}
// fall through to non-bos page parsing
}
// if we don't have usable video then bail out now
if ( !movie->theora_p ) {
mprintf(("Theora ERROR: Unable to find video data in '%s'\n", lower_name));
goto Error;
}
// go ahead and do some audio stream error checking...
if ( (movie->vinfo.channels < 0) || (movie->vinfo.channels > 2) ) {
mprintf(("Theora ERROR: Unsupported number of audio channels!\n"));
movie->vorbis_p = 0;
}
// if we don't have usable audio then close out it's partial setup and just use the video
if ( !Sound_enabled || !movie->vorbis_p ) {
vorbis_info_clear(&movie->vinfo);
vorbis_comment_clear(&movie->vcomment);
movie->vorbis_p = 0;
}
// we're expecting more header packets.
while ( (movie->theora_p < 3) || (movie->vorbis_p && (movie->vorbis_p < 3)) ) {
int ret;
// look for further theora headers
while ( (movie->theora_p < 3) && (ret = ogg_stream_packetout(&movie->t_osstate, &movie->opacket)) ){
if ( (ret < 0) || theora_decode_header(&movie->tinfo, &movie->tcomment, &movie->opacket) ) {
mprintf(("Theora ERROR: Error parsing Theora stream headers on '%s'! Corrupt stream?\n", lower_name));
goto Error;
}
if (++movie->theora_p == 3)
break;
}
// look for more vorbis header packets
while ( movie->vorbis_p && (movie->vorbis_p < 3) && (ret = ogg_stream_packetout(&movie->v_osstate, &movie->opacket)) ) {
if ( (ret < 0) || vorbis_synthesis_headerin(&movie->vinfo, &movie->vcomment, &movie->opacket) ) {
mprintf(("Theora ERROR: Error parsing Vorbis stream headers on '%s'! Corrupt stream?\n", lower_name));
goto Error;
}
if (++movie->vorbis_p == 3)
break;
}
// The header pages/packets will arrive before anything else we care about, or the stream is not obeying spec
if ( ogg_sync_pageout(&movie->osyncstate, &movie->opage) > 0 ) {
OGG_queue_page(movie); // demux into the appropriate stream
} else {
ret = OGG_buffer_data(movie); // someone needs more data
if ( ret == 0 ) {
mprintf(("Theora ERROR: End of file while searching for codec headers in '%s'!\n", lower_name));
goto Error;
}
}
}
// initialize video decoder
theora_decode_init(&movie->tstate, &movie->tinfo);
// and now for video stream error checking...
if (movie->tinfo.pixelformat != OC_PF_420) {
mprintf(("Theora ERROR: Only the yuv420p chroma is supported!\n"));
goto Error;
}
if (movie->tinfo.offset_x || movie->tinfo.offset_y) {
mprintf(("Theora ERROR: Player does not support frame offsets!\n"));
goto Error;
}
// initialize audio decoder, if there is audio
if (movie->vorbis_p) {
vorbis_synthesis_init(&movie->vstate, &movie->vinfo);
vorbis_block_init(&movie->vstate, &movie->vblock);
}
return movie;
Error:
theora_close(movie);
return NULL;
}
// play that funky music... err, movie!
void theora_play(THEORAFILE *movie)
{
int i, j;
bool stateflag = false;
bool videobuf_ready = false;
bool audiobuf_ready = false;
double last_time = 0.0; // for frame skipper
if ( (movie == NULL) || !movie->theora_p )
return;
// only OGL is supported
if (gr_screen.mode != GR_OPENGL)
return;
// open audio
if (movie->vorbis_p)
OGG_audio_init(&movie->vinfo);
// open video
OGG_video_init(&movie->tinfo);
// on to the main decode loop. We assume in this example that audio
// and video start roughly together, and don't begin playback until
// we have a start frame for both. This is not necessarily a valid
// assumption in Ogg A/V streams! It will always be true of the
// example_encoder (and most streams) though.
while (playing) {
// we want a video and audio frame ready to go at all times. If
// we have to buffer incoming, buffer the compressed data (ie, let
// ogg do the buffering)
while ( movie->vorbis_p && !audiobuf_ready ) {
int ret;
float **pcm;
// if there's pending, decoded audio, grab it
if ( (ret = vorbis_synthesis_pcmout(&movie->vstate, &pcm)) > 0 ) {
int count = (audiobuf_fill / 2);
int maxsamples = (audiofd_fragsize - audiobuf_fill) / 2 / movie->vinfo.channels;
for (i = 0; (i < ret) && (i < maxsamples); i++) {
for (j = 0; j < movie->vinfo.channels; j++) {
int val = fl2i(pcm[j][i] * 32767.0f + 0.5f);
if (val > 32767)
val = 32767;
if (val < -32768)
val = -32768;
audiobuf[count++] = val;
}
}
vorbis_synthesis_read(&movie->vstate, i);
audiobuf_fill += (i * movie->vinfo.channels * 2);
if (audiobuf_fill == audiofd_fragsize)
audiobuf_ready = true;
if (movie->vstate.granulepos >= 0)
audiobuf_granulepos = movie->vstate.granulepos - ret + i;
else
audiobuf_granulepos += i;
} else {
// no pending audio; is there a pending packet to decode?
if ( ogg_stream_packetout(&movie->v_osstate, &movie->opacket) > 0 ) {
if ( vorbis_synthesis(&movie->vblock, &movie->opacket) == 0 )
vorbis_synthesis_blockin(&movie->vstate, &movie->vblock);
}
// we need more data; break out to suck in another page
else {
break;
}
}
}
while ( !videobuf_ready ) {
// theora is one in, one out...
if ( ogg_stream_packetout(&movie->t_osstate, &movie->opacket) <= 0 )
break;
theora_decode_packetin(&movie->tstate, &movie->opacket);
videobuf_time = theora_granule_time(&movie->tstate, movie->tstate.granulepos);
double now_time = OGG_get_time();
double delay = videobuf_time - OGG_get_time();
// if we are running slow then skip the frame, otherwise to go into ready mode
if ( (delay >= 0.0) || (now_time - last_time >= 1.0) )
videobuf_ready = true;
}
if ( !videobuf_ready && (movie->vorbis_p && !audiobuf_ready) && cfeof(movie->cfp) )
break;
if ( !videobuf_ready || (movie->vorbis_p && !audiobuf_ready) ) {
// no data yet for somebody. Grab another page
OGG_buffer_data(movie);
while (ogg_sync_pageout(&movie->osyncstate, &movie->opage) > 0)
OGG_queue_page(movie);
}
// If playback has begun, top audio buffer off immediately.
if ( stateflag )
OGG_audio_write(&movie->vinfo, &audiobuf_ready);
// are we at or past time for this video frame?
if ( stateflag && videobuf_ready && (videobuf_time <= OGG_get_time()) ) {
OGG_video_draw(&movie->tstate);
last_time = OGG_get_time();
videobuf_ready = false;
}
// if our buffers either don't exist or are ready to go, we can begin playback
if ( videobuf_ready && (audiobuf_ready || !movie->vorbis_p) )
stateflag = true;
// bail if we run into eof
// if ( cfeof(movie->cfp) )
// break;
if (videobuf_ready)
OGG_timer_do_wait();
}
// tear it all down
OGG_audio_close();
OGG_video_close();
}
-52
View File
@@ -1,52 +0,0 @@
/*
* $Logfile: /Freespace2/src/cutscene/oggplayer.h $
* $Revision: 1.1.2.1 $
* $Date: 2006-12-25 21:44:11 $
* $Author: taylor $
*
* main lib for using Theora movies
*
* $Log: not supported by cvs2svn $
*
* $NoKeywords: $
*
*/
#ifndef _OGGPLAYER_H
#define _OGGPLAYER_H
#include "globalincs/pstypes.h"
#include "theora/theora.h"
#include "vorbis/codec.h"
struct CFILE;
// structure for maintaining info on a THEORAFILE stream
typedef struct THEORAFILE
{
CFILE *cfp;
ubyte theora_p;
ubyte vorbis_p;
ogg_sync_state osyncstate;
ogg_page opage;
ogg_packet opacket;
ogg_stream_state v_osstate;
ogg_stream_state t_osstate;
theora_info tinfo;
theora_comment tcomment;
theora_state tstate;
vorbis_info vinfo;
vorbis_dsp_state vstate;
vorbis_block vblock;
vorbis_comment vcomment;
} THEORAFILE;
void theora_play(THEORAFILE *movie);
THEORAFILE *theora_open(char *filename);
void theora_close(THEORAFILE *movie);
#endif
-501
View File
@@ -1,501 +0,0 @@
#include "ddsutils/ddsutils.h"
#include "cfile/cfile.h"
#include "osapi/osregistry.h"
/* Currently supported formats:
* DXT1a (compressed)
* DXT1c (compressed)
* DXT3 (compressed)
* DXT5 (compressed)
* uncompressed 1555 (16-bit, 1-bit being alpha)
* uncompressed 8888 (32-bit)
* uncompressed 888 (24-bit, no alpha)
* paletted 8-bit (256 colors)
*/
int Texture_compression_available = 0;
int Use_compressed_textures = 0;
// power of two check, to verify that a given DDS will always be usable since
// some may not be power-of-2
static inline int is_power_of_two(int w, int h)
{
return ( (w && !(w & (w-1))) && (h && !(h & (h-1))) );
}
int dds_read_header(char *filename, CFILE *img_cfp, int *width, int *height, int *bpp, int *compression_type, int *levels, int *size, ubyte *palette)
{
DDSURFACEDESC2 dds_header;
int code = 0;
CFILE *ddsfile;
char real_name[MAX_FILENAME_LEN];
int retval = DDS_ERROR_NONE;
int ct = DDS_UNCOMPRESSED;
int bits = 0;
int i, trash, is_cubemap = 0;
int d_width = 0, d_height = 0, d_depth = 0, d_size = 0;
if (img_cfp == NULL) {
// this better not happen.. ever
Assert(filename != NULL);
// make sure there is an extension
strcpy(real_name, filename);
char *p = strchr(real_name, '.');
if (p) { *p=0; }
strcat(real_name, ".dds");
// try to open the file
ddsfile = cfopen(real_name, "rb");
// file not found
if (ddsfile == NULL)
return DDS_ERROR_INVALID_FILENAME;
} else {
ddsfile = img_cfp;
}
// read the code
code = cfread_int(ddsfile);
// check it
if (code != DDS_FILECODE) {
retval = DDS_ERROR_BAD_HEADER;
goto Done;
}
// read header variables
dds_header.dwSize = cfread_uint(ddsfile);
dds_header.dwFlags = cfread_uint(ddsfile);
dds_header.dwHeight = cfread_uint(ddsfile);
dds_header.dwWidth = cfread_uint(ddsfile);
dds_header.dwPitchOrLinearSize = cfread_uint(ddsfile);
dds_header.dwDepth = cfread_uint(ddsfile);
dds_header.dwMipMapCount = cfread_uint(ddsfile);
// skip over the crap we don't care about
for (i = 0; i < 11; i++)
trash = cfread_uint(ddsfile);
dds_header.ddpfPixelFormat.dwSize = cfread_uint(ddsfile);
dds_header.ddpfPixelFormat.dwFlags = cfread_uint(ddsfile);
dds_header.ddpfPixelFormat.dwFourCC = cfread_uint(ddsfile);
dds_header.ddpfPixelFormat.dwRGBBitCount = cfread_uint(ddsfile);
dds_header.ddpfPixelFormat.dwRBitMask = cfread_uint(ddsfile);
dds_header.ddpfPixelFormat.dwGBitMask = cfread_uint(ddsfile);
dds_header.ddpfPixelFormat.dwBBitMask = cfread_uint(ddsfile);
dds_header.ddpfPixelFormat.dwRGBAlphaBitMask = cfread_uint(ddsfile);
dds_header.ddsCaps.dwCaps1 = cfread_uint(ddsfile);
dds_header.ddsCaps.dwCaps2 = cfread_uint(ddsfile);
// sanity
if (dds_header.dwDepth == 0)
dds_header.dwDepth = 1;
if (dds_header.dwMipMapCount < 1)
dds_header.dwMipMapCount = 1;
d_width = dds_header.dwWidth;
d_height = dds_header.dwHeight;
d_depth = dds_header.dwDepth;
// calculate the type and size of the data
if (dds_header.ddpfPixelFormat.dwFlags & DDPF_FOURCC) {
// did I mention lately that I hate Microsoft?
// this is here to fix the situation where Microsoft doesn't follow their own docs
if ( dds_header.dwPitchOrLinearSize <= 0 ) {
// calculate the block size, mult by 8 for DXT1, 16 for DXT3 & 5
d_size = ((dds_header.dwWidth + 3)/4) * ((dds_header.dwHeight + 3)/4) * ((dds_header.dwDepth + 3)/4) * ((dds_header.ddpfPixelFormat.dwFourCC == FOURCC_DXT1) ? 8 : 16);
} else {
d_size = dds_header.dwPitchOrLinearSize;
}
// if we have mipmaps then compute them into the final size too
for (i = 1; i < (int)dds_header.dwMipMapCount; i++) {
// reduce size by half for the next pass
d_width /= 2;
d_height /= 2;
if (d_width <= 0)
d_width = 1;
if (d_height <= 0)
d_height = 1;
// size of data block (4x4)
d_size += ((d_width + 3) / 4) * ((d_height + 3) / 4) * ((dds_header.ddpfPixelFormat.dwFourCC == FOURCC_DXT1) ? 8 : 16);
}
if ( dds_header.ddsCaps.dwCaps2 & DDSCAPS2_CUBEMAP ) {
if ( !(dds_header.ddsCaps.dwCaps2 & DDSCAPS2_CUBEMAP_ALLFACES) ) {
retval = DDS_ERROR_CUBEMAP_FACES;
ct = DDS_DXT_INVALID;
goto Done;
}
// it's a valid cubemap, probably
is_cubemap = 1;
// the previously computed size is just per face, mult by 6 for full size
d_size *= 6;
}
Assert( d_size > 0 );
*size = d_size;
switch (dds_header.ddpfPixelFormat.dwFourCC) {
case FOURCC_DXT1:
bits = 24;
ct = (is_cubemap) ? DDS_CUBEMAP_DXT1 : DDS_DXT1;
break;
case FOURCC_DXT3:
bits = 32;
ct = (is_cubemap) ? DDS_CUBEMAP_DXT3 : DDS_DXT3;
break;
case FOURCC_DXT5:
bits = 32;
ct = (is_cubemap) ? DDS_CUBEMAP_DXT5 : DDS_DXT5;
break;
// dxt2 and dxt4 aren't supported
case FOURCC_DXT2:
case FOURCC_DXT4:
retval = DDS_ERROR_UNSUPPORTED;
ct = DDS_DXT_INVALID;
goto Done;
break;
// none of the above
default:
retval = DDS_ERROR_INVALID_FORMAT;
ct = DDS_DXT_INVALID;
goto Done;
break;
}
} else if ( dds_header.ddpfPixelFormat.dwFlags & (DDPF_RGB | DDPF_PALETTEINDEXED8) ) {
d_size += d_width * d_height * d_depth * (dds_header.ddpfPixelFormat.dwRGBBitCount / 8);
// calculate full data size for all mipmap levels
for (i = 1; i < (int)dds_header.dwMipMapCount; i++) {
d_width /= 2;
d_height /= 2;
d_depth /= 2;
if (d_width < 1)
d_width = 1;
if (d_height < 1)
d_height = 1;
if (d_depth < 1)
d_depth = 1;
d_size += d_width * d_height * d_depth * (dds_header.ddpfPixelFormat.dwRGBBitCount / 8);
}
Assert( d_size > 0 );
if ( dds_header.ddsCaps.dwCaps2 & DDSCAPS2_CUBEMAP ) {
if ( !(dds_header.ddsCaps.dwCaps2 & DDSCAPS2_CUBEMAP_ALLFACES) ) {
retval = DDS_ERROR_CUBEMAP_FACES;
ct = DDS_DXT_INVALID;
goto Done;
}
// it's a valid cubemap, probably
is_cubemap = 1;
// the previously computed size is just per face, mult by 6 for full size
d_size *= 6;
}
*size = d_size;
bits = dds_header.ddpfPixelFormat.dwRGBBitCount;
ct = (is_cubemap) ? DDS_CUBEMAP_UNCOMPRESSED : DDS_UNCOMPRESSED;
} else {
// it's not a readable format
retval = DDS_ERROR_INVALID_FORMAT;
goto Done;
}
// we don't support compressed, non-power-of-2 images
if ( (ct != DDS_UNCOMPRESSED) && (!is_power_of_two(dds_header.dwWidth, dds_header.dwHeight)) ) {
retval = DDS_ERROR_NON_POWER_OF_2;
goto Done;
}
// make sure that the video card can handle compressed textures before using them
if ( !Use_compressed_textures && (ct != DDS_UNCOMPRESSED) && (ct != DDS_DXT_INVALID) ) {
retval = DDS_ERROR_NO_COMPRESSION;
goto Done;
}
// stuff important info
if (bpp)
*bpp = bits;
if (compression_type)
*compression_type = ct;
if (width)
*width = dds_header.dwWidth;
if (height)
*height = dds_header.dwHeight;
if (levels)
*levels = dds_header.dwMipMapCount;
if (palette && (bits == 8)) {
cfseek(ddsfile, DDS_OFFSET, CF_SEEK_SET);
cfread(palette, 1, 1024, ddsfile);
}
Done:
if (img_cfp == NULL) {
// close file and return
cfclose(ddsfile);
ddsfile = NULL;
}
return retval;
}
//reads pixel info from a dds file
int dds_read_bitmap(char *filename, ubyte *data, ubyte *bpp, int cf_type)
{
int retval;
int w,h,ct,lvl;
int size = 0, bits = 0;
CFILE *cfp;
char real_name[MAX_FILENAME_LEN];
// this better not happen.. ever
Assert(filename != NULL);
// make sure there is an extension
strcpy(real_name, filename);
char *p = strchr(real_name, '.');
if (p) { *p = 0; }
strcat(real_name, ".dds");
// open it up and go to the data section
cfp = cfopen(real_name, "rb", CFILE_NORMAL, cf_type);
// just in case
if (cfp == NULL)
return DDS_ERROR_INVALID_FILENAME;
// read the header -- if its at this stage, it should be legal.
retval = dds_read_header(real_name, cfp, &w, &h, &bits, &ct, &lvl, &size);
Assert(retval == DDS_ERROR_NONE);
// this really shouldn't be needed but better safe than sorry
if (retval != DDS_ERROR_NONE) {
return retval;
}
cfseek(cfp, DDS_OFFSET, CF_SEEK_SET);
// read in the data
cfread(data, 1, size, cfp);
if (bpp)
*bpp = (ubyte)bits;
// we look done here
cfclose(cfp);
return DDS_ERROR_NONE;
}
// save some image data as a DDS image
// NOTE: we only support, uncompressed, 24-bit RGB and 32-bit RGBA images here!!
void dds_save_image(int width, int height, int bpp, int num_mipmaps, ubyte *data, int cubemap, char *filename)
{
DDSURFACEDESC2 dds_header;
char real_filename[MAX_FILENAME_LEN];
if (data == NULL) {
Int3();
return;
}
// header size check
if (sizeof(DDSURFACEDESC2) != 124) {
Int3();
return;
}
// not that that's out of the way we can get down to business, constructing a sane filename
memset( &real_filename, 0, sizeof(real_filename) );
int count = os_config_read_uint(NULL, "ImageExportNum", 0);
if (count > 999)
count = 0;
if (filename == NULL) {
if (cubemap) {
sprintf(real_filename, "cubemap%.3d.dds", count++);
} else {
sprintf(real_filename, "image%.3d.dds", count++);
}
os_config_write_uint(NULL, "ImageExportNum", count);
} else {
Assert( strlen(filename) < MAX_FILENAME_LEN-5 );
strcpy(real_filename, filename);
char *p = strchr(real_filename, '.');
if (p) { *p = 0; }
strcat(real_filename, ".dds");
}
CFILE *image = cfopen( real_filename, "wb", CFILE_NORMAL, CF_TYPE_CACHE );
if (image == NULL) {
mprintf(("Unable to open DDS image for saving!!\n"));
return;
}
if (num_mipmaps < 1)
num_mipmaps = 1;
// we have a filename and file handle, so now lets create our DDS header...
memset( &dds_header, 0, sizeof(DDSURFACEDESC2) );
uint flags = (DDSD_CAPS | DDSD_PITCH | DDSD_PIXELFORMAT | DDSD_WIDTH | DDSD_HEIGHT);
uint pixel_flags = DDPF_RGB;
uint caps1 = DDSCAPS_TEXTURE;
uint caps2 = 0;
if (bpp == 32) {
pixel_flags |= DDPF_ALPHAPIXELS;
}
if (num_mipmaps > 1) {
flags |= DDSD_MIPMAPCOUNT;
caps1 |= (DDSCAPS_COMPLEX | DDSCAPS_MIPMAP);
}
if (cubemap) {
caps1 |= DDSCAPS_COMPLEX;
caps2 |= (DDSCAPS2_CUBEMAP | DDSCAPS2_CUBEMAP_ALLFACES);
}
dds_header.dwSize = 124;
dds_header.dwFlags = flags;
dds_header.dwHeight = height;
dds_header.dwWidth = width;
dds_header.dwPitchOrLinearSize = (width * (bpp >> 3));
dds_header.dwDepth = 0;
dds_header.dwMipMapCount = num_mipmaps;
dds_header.ddpfPixelFormat.dwSize = 32;
dds_header.ddpfPixelFormat.dwFlags = pixel_flags;
dds_header.ddpfPixelFormat.dwFourCC = 0;
dds_header.ddpfPixelFormat.dwRGBBitCount = bpp;
dds_header.ddpfPixelFormat.dwRBitMask = 0x00ff0000;
dds_header.ddpfPixelFormat.dwGBitMask = 0x0000ff00;
dds_header.ddpfPixelFormat.dwBBitMask = 0x000000ff;
dds_header.ddpfPixelFormat.dwRGBAlphaBitMask = (bpp == 32) ? 0xff000000 : 0x00000000;
dds_header.ddsCaps.dwCaps1 = caps1;
dds_header.ddsCaps.dwCaps2 = caps2;
// now save it all...
uint dds_id = DDS_FILECODE;
cfwrite(&dds_id, 1, 4, image);
cfwrite(&dds_header, 1, sizeof(DDSURFACEDESC2), image);
int faces = (cubemap) ? 6 : 1;
int f_width = width;
int f_height = height;
int f_size = 0, f_offset = 0;
// cubemaps are written:
// face 1
// all face 1 mipmaps
// face 2
// all face 2 mipmaps
// ... etc.
for (int i = 0; i < faces; i++) {
for (int j = 0; j < num_mipmaps; j++) {
f_size = (f_width * f_height * (bpp >> 3));
cfwrite(data + f_offset, 1, f_size, image);
// increase offset for next mipmap level
f_offset += f_size;
// half width and height for next mipmap level
f_width /= 2;
f_height /= 2;
if (f_width < 1)
f_width = 1;
if (f_height < 1)
f_height = 1;
}
// reset width and height to original values for the next face
f_width = width;
f_height = height;
}
// done! now lets go get something to eat...
cfclose(image);
}
// returns string representation of DDS_** error code
const char *dds_error_string(int code)
{
switch (code)
{
case DDS_ERROR_NONE:
return "No error";
case DDS_ERROR_INVALID_FILENAME:
return "File not found";
case DDS_ERROR_BAD_HEADER:
return "Filecode did not equal \"DDS \"";
case DDS_ERROR_INVALID_FORMAT:
return "DDS was in an unsupported/unknown format";
case DDS_ERROR_UNSUPPORTED:
return "DDS format was known but is not supported (ie. DXT2/DXT4)";
case DDS_ERROR_NO_COMPRESSION:
return "DDS is compressed but compression support is not enabled";
case DDS_ERROR_NON_POWER_OF_2:
return "Cannot load DDS if not power-of-2";
case DDS_ERROR_CUBEMAP_FACES:
return "Cubemaps must have all 6 faces";
default:
return "Abort, retry, fail?";
}
//get a warning otherwise
return "Abort, retry, fail?";
}
-156
View File
@@ -1,156 +0,0 @@
//header file to load .dds files
//these use dxtc texture compression
#ifndef __DDS_H
#define __DDS_H
#include "globalincs/pstypes.h"
#include "cfile/cfile.h"
#define DDS_ERROR_NONE 0 // everything went fine
#define DDS_ERROR_INVALID_FILENAME 1 // bad or missing file
#define DDS_ERROR_UNSUPPORTED 2 // a known format but one we don't support
#define DDS_ERROR_INVALID_FORMAT 3 // format that's not supported
#define DDS_ERROR_BAD_HEADER 4 // header was not "DDS "
#define DDS_ERROR_NO_COMPRESSION 5 // file is compressed, compression isn't supported
#define DDS_ERROR_NON_POWER_OF_2 6 // file is not a power of 2 in dimensions
#define DDS_ERROR_CUBEMAP_FACES 7 // file is a cubemap, but doesn't have all six faces
#define DDS_DXT_INVALID -1
#define DDS_UNCOMPRESSED 0
#define DDS_DXT1 1
#define DDS_DXT3 3
#define DDS_DXT5 5
#define DDS_CUBEMAP_UNCOMPRESSED 10
#define DDS_CUBEMAP_DXT1 11
#define DDS_CUBEMAP_DXT3 13
#define DDS_CUBEMAP_DXT5 15
#ifndef MAKEFOURCC
#define MAKEFOURCC(ch0, ch1, ch2, ch3) \
((uint)(ubyte)(ch0) | ((uint)(ubyte)(ch1) << 8) | \
((uint)(ubyte)(ch2) << 16) | ((uint)(ubyte)(ch3) << 24 ))
#endif //defined(MAKEFOURCC)
// FOURCC codes for DX compressed-texture pixel formats
#define FOURCC_DXT1 (MAKEFOURCC('D','X','T','1'))
#define FOURCC_DXT2 (MAKEFOURCC('D','X','T','2'))
#define FOURCC_DXT3 (MAKEFOURCC('D','X','T','3'))
#define FOURCC_DXT4 (MAKEFOURCC('D','X','T','4'))
#define FOURCC_DXT5 (MAKEFOURCC('D','X','T','5'))
#define DDS_FILECODE 0x20534444 // "DDS " in file
// DDS format stuff ...
#define DDSD_LINEARSIZE 0x00080000
#define DDSD_PITCH 0x00000008
#define DDPF_ALPHAPIXELS 0x00000001
#define DDPF_FOURCC 0x00000004
#define DDPF_PALETTEINDEXED4 0x00000008
#define DDPF_PALETTEINDEXEDTO8 0x00000010
#define DDPF_PALETTEINDEXED8 0x00000020
#define DDPF_RGB 0x00000040
#define DDSD_PIXELFORMAT 0x00001000
#define DDSD_WIDTH 0x00000004
#define DDSD_HEIGHT 0x00000002
#define DDSD_CAPS 0x00000001
#define DDSD_MIPMAPCOUNT 0x00020000
#define DDSCAPS_COMPLEX 0x00000008
#define DDSCAPS_PRIMARYSURFACE 0x00000200
#define DDSCAPS_MIPMAP 0x00400000
#define DDSCAPS_TEXTURE 0x00001000
#define DDSCAPS2_CUBEMAP 0x00000200
#define DDSCAPS2_VOLUME 0x00200000
#define DDSCAPS2_CUBEMAP_POSITIVEX 0x00000400
#define DDSCAPS2_CUBEMAP_NEGATIVEX 0x00000800
#define DDSCAPS2_CUBEMAP_POSITIVEY 0x00001000
#define DDSCAPS2_CUBEMAP_NEGATIVEY 0x00002000
#define DDSCAPS2_CUBEMAP_POSITIVEZ 0x00004000
#define DDSCAPS2_CUBEMAP_NEGATIVEZ 0x00008000
#define DDSCAPS2_CUBEMAP_ALLFACES ( DDSCAPS2_CUBEMAP_POSITIVEX | \
DDSCAPS2_CUBEMAP_NEGATIVEX | \
DDSCAPS2_CUBEMAP_POSITIVEY | \
DDSCAPS2_CUBEMAP_NEGATIVEY | \
DDSCAPS2_CUBEMAP_POSITIVEZ | \
DDSCAPS2_CUBEMAP_NEGATIVEZ )
#pragma pack(1)
// these structures are the headers for a dds file
/*typedef struct _DDPIXELFORMAT {
uint dwSize;
uint dwFlags;
uint dwFourCC;
uint dwRGBBitCount;
uint dwRBitMask;
uint dwGBitMask;
uint dwBBitMask;
uint dwRGBAlphaBitMask;
} DDPIXELFORMAT;
typedef struct _DDSCAPS2
{
uint dwCaps1;
uint dwCaps2;
uint Reserved[2];
} DDSCAPS2;*/
typedef struct _DDSURFACEDESC2
{
uint dwSize; // size of the DDSURFACEDESC structure
uint dwFlags; // determines what fields are valid
uint dwHeight; // height of surface to be created
uint dwWidth; // width of input surface
uint dwPitchOrLinearSize;
uint dwDepth;
uint dwMipMapCount;
uint dwReserved1[11];
struct {
uint dwSize;
uint dwFlags;
uint dwFourCC;
uint dwRGBBitCount;
uint dwRBitMask;
uint dwGBitMask;
uint dwBBitMask;
uint dwRGBAlphaBitMask;
} ddpfPixelFormat;
struct {
uint dwCaps1;
uint dwCaps2;
uint Reserved[2];
} ddsCaps;
// DDPIXELFORMAT ddpfPixelFormat;
// DDSCAPS2 ddsCaps; // direct draw surface capabilities
uint dwReserved2;
} DDSURFACEDESC2;
#pragma pack()
#define DDS_OFFSET 4+sizeof(DDSURFACEDESC2) //place where the data starts -- should be 128
//reads a dds header
//returns one of the error values
//'compression_type' comes back as one of the DDS_DXTC* defines
int dds_read_header(char *filename, CFILE *img_cfp = NULL, int *width = 0, int *height = 0, int *bpp = 0, int *compression_type = 0, int *levels = 0, int *size = 0, ubyte *palette = NULL);
//reads bitmap
//size of the data it stored in size
int dds_read_bitmap(char *filename, ubyte *data, ubyte *bpp = NULL, int cf_type = CF_TYPE_ANY);
// writes a DDS file using given data
void dds_save_image(int width, int height, int bpp, int num_mipmaps, ubyte *data = NULL, int cubemap = 0, char *filename = NULL);
//returns a string from a DDS error code
const char *dds_error_string(int code);
extern int Texture_compression_available;
extern int Use_compressed_textures;
#endif //__DDS_H
File diff suppressed because it is too large. Load diff
-129
View File
@@ -1,129 +0,0 @@
//header file for making decals-Bobboau
#ifndef _DECAL_H
#define _DECAL_H
#include "object/object.h"
#include "globalincs/pstypes.h"
//#include "ship/ship.h"
#ifdef ENABLE_DECALS
#define MAX_DECAL_POLY 40
#define MAX_DECAL_POLY_POINT 10
#define MAX_DECAL_DEFPOINTS 10000
#define MAX_DECAL_POINT 10
#define MAX_SHIP_DECALS 25
#define MAX_GLOBAL_DECAL_POLYS 11000
#define QUICKFIND_SUBDIVISION 100
#define QUICKFIND_SEGMENT_LENGTH (MAX_GLOBAL_DECAL_POLYS/QUICKFIND_SUBDIVISION)
#define MAX_GLOBAL_DECALS 5000
#define DP_EOF 0
#define DP_DEFPOINTS 1
#define DP_FLATPOLY 2
#define DP_TMAPPOLY 3
#define DP_SORTNORM 4
#define DP_BOUNDBOX 5
#endif // ENABLE_DECALS
struct decal;
struct decal_list;
struct decal_list_controle;
struct decal_poly{
vec3d norm[3];
vertex point[3];
decal_poly *next;
decal* parent;
int idx;
};
struct decal{
int n_poly;
int timestamp; //when this decal was created
int burn_time; //how long it takes for the glow texture to fade
int vertex_buffer_start; //were is the start of this decal's polys in the vertex buffer
decal_poly* poly;
decal_poly* add_poly();
decal_poly* get_last_poly();
void remove_last_poly();
decal_list_controle *parent;
};
struct decal_list{
decal dec;
decal_list *next;
};
struct decal_item{
decal_list dec;
bool used;
};
struct decal_list_controle{
int n_decals;
int buffer;
int texture;
int n_poly;
int burn_texture;
int glow_texture;
bool modifyed;
decal_list *d_list;
decal_list *end;
decal_list *add_new();
void trim();
void clear();
~decal_list_controle();
decal_list_controle();
};
struct decal_system{
decal_list_controle *decals;
int n_decal_textures;
bool decals_modified;
int max_decals;
decal_system():decals(NULL),n_decal_textures(0),decals_modified(false){};
};
//this is used to give all the data to the generation data to the functions that make them
struct decal_point{
vec3d pnt;
matrix orient;
float radius;
};
#ifdef ENABLE_DECALS
int decal_create(object * obj, decal_point *point, int subobject, int texture, int backfaced_texture = -1, int glow_texture = -1, int burn_texture = -1, int burn_time = 1000);//makes the decal
int decal_create_simple(object * obj, decal_point *point, int texture);//makes a simple non-clipped decal
void decal_render_all(object * obj); //renders all decals
int decal_create_sub(void *model_ptr);
void clear_decals(decal_system *system);
void init_decals();
#else // ENABLE_DECALS
inline int decal_create(object * obj, decal_point *point, int subobject, int texture, int backfaced_texture = -1, int glow_texture = -1, int burn_texture = -1, int burn_time = 1000)
{
return 0;
}
#define decal_create_simple(a, b, c) (0)
#define decal_render_all(a)
#define decal_create_sub(a) (0);
#define clear_decals(a)
#define init_decals()
#endif // ENABLE_DECALS
#endif // _DECAL_H
-288
View File
@@ -1,288 +0,0 @@
/*
* Copyright (C) Volition, Inc. 1999. All rights reserved.
*
* All source code herein is the property of Volition, Inc. You may not sell
* or otherwise commercially exploit the source or things you created based on the
* source.
*
*/
// AddVariableDlg.cpp : implementation file
//
#include "stdafx.h"
#include "FRED.h"
#include "AddVariableDlg.h"
#include "parse/sexp.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
#define NO_RESET_FOCUS 0
#define RESET_FOCUS 1
/////////////////////////////////////////////////////////////////////////////
// CAddVariableDlg dialog
CAddVariableDlg::CAddVariableDlg(CWnd* pParent /*=NULL*/)
: CDialog(CAddVariableDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CAddVariableDlg)
m_default_value = _T("");
m_variable_name = _T("");
//}}AFX_DATA_INIT
}
void CAddVariableDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CAddVariableDlg)
DDX_Text(pDX, IDC_ADD_VARIABLE_DEFAULT_VALUE, m_default_value);
DDV_MaxChars(pDX, m_default_value, 31);
DDX_Text(pDX, IDC_ADD_VARIABLE_NAME, m_variable_name);
DDV_MaxChars(pDX, m_variable_name, 31);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CAddVariableDlg, CDialog)
//{{AFX_MSG_MAP(CAddVariableDlg)
ON_BN_CLICKED(IDC_TYPE_NUMBER, OnTypeNumber)
ON_BN_CLICKED(IDC_TYPE_STRING, OnTypeString)
ON_BN_CLICKED(IDC_TYPE_CAMPAIGN_PERSISTENT, OnTypeCampaignPersistent)
ON_BN_CLICKED(IDC_TYPE_PLAYER_PERSISTENT, OnTypePlayerPersistent)
ON_BN_CLICKED(IDC_TYPE_NETWORK_VARIABLE, OnTypeNetworkVariable)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CAddVariableDlg message handlers
void CAddVariableDlg::OnOK()
{
// validation name
validate_variable_name(RESET_FOCUS);
// validate data
if ( m_name_validated ) {
validate_data(RESET_FOCUS);
}
// both ok, then store results
if ( m_name_validated && m_data_validated ) {
// int sexp_add_variable(char *text, char*, int type);
// char temp_name[32];
// char temp_value[32];
// strcpy(temp_name, m_variable_name);
// strcpy(temp_value, m_default_value);
// SEXP_VARIABLE_NUMBER SEXP_VARIABLE_STRING
// int type;
//
// if (m_type_number) {
// type = SEXP_VARIABLE_NUMBER;
// } else {
// type = SEXP_VARIABLE_STRING;
// }
//
// // Goober5000
// if (m_type_player_persistent) {
// type |= SEXP_VARIABLE_PLAYER_PERSISTENT;
// } else if (m_type_campaign_persistent) {
// type |= SEXP_VARIABLE_CAMPAIGN_PERSISTENT;
// }
//
// m_sexp_var_index = sexp_add_variable(temp_value, temp_name, type);
// this get done for free CDialog::OnOk() UpdateData(TRUE);
m_create = true;
CDialog::OnOK();
}
}
BOOL CAddVariableDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
m_variable_name = "<Variable Name>";
m_default_value = "<Default Value>";
// Set variable type to number
m_type_number = true;
m_type_campaign_persistent = false;
m_type_player_persistent = false;
m_type_network_variable = false;
set_variable_type();
m_name_validated = false;
m_data_validated = false;
m_create = false;
// Send default name and values into dialog box
UpdateData(FALSE);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
bool is_sexp_variable_name(const char* temp_name)
{
for (int i=0; i<MAX_SEXP_VARIABLES; i++) {
if (Sexp_variables[i].type & SEXP_VARIABLE_SET) {
if ( !strcmp(Sexp_variables[i].text, temp_name) ) {
return false;
}
}
}
// name not found
return true;
}
// Check variable name (1) changed (2) > 0 length (3) does not already exist
void CAddVariableDlg::validate_variable_name(int set_focus)
{
CString temp_name;
CEdit *edit = (CEdit *) GetDlgItem(IDC_ADD_VARIABLE_NAME);
edit->GetWindowText(temp_name);
// Check if any change and not already in list
if ( stricmp(temp_name, "<Variable Name>") ) {
if ( (strlen(temp_name) > 0) && (get_index_sexp_variable_name(LPCTSTR(temp_name)) == -1) ) { //not already in list and length > 0 {
// Goober5000 - replace spaces with hyphens
if (strchr(temp_name, ' ') != NULL)
{
// display msg
MessageBox("Variable names cannot contain spaces. Replacing with hyphens.");
// replace chars
//Modified to make the code build. - Thunderbird
temp_name.Replace((TCHAR) ' ', (TCHAR) '-');
//temp_name.Replace((TCHAR) ' ', (TCHAR) '-'));
// fix what's displayed
edit->SetFocus();
edit->SetWindowText(temp_name);
edit->SetSel(0, -1);
}
m_name_validated = true;
} else {
// conflicting variable name
if (strlen(temp_name) == 0) {
edit->SetWindowText("<Variable Name>");
}
m_name_validated = false;
if (set_focus == RESET_FOCUS) {
MessageBox("Conflicting variable name");
edit->SetFocus();
edit->SetSel(0, -1);
}
}
} else {
// name unchanged from default
m_name_validated = false;
if (set_focus == RESET_FOCUS) {
MessageBox("Invalid variable name");
edit->SetFocus();
edit->SetSel(0, -1);
}
}
}
void CAddVariableDlg::validate_data(int set_focus)
{
CString temp_data;
CEdit *edit = (CEdit *) GetDlgItem(IDC_ADD_VARIABLE_DEFAULT_VALUE);
edit->GetWindowText(temp_data);
// check for 0 string length
if (strlen(temp_data) == 0) {
m_data_validated = false;
} else {
if (m_type_number) {
// verify valid number
int temp_num = atoi(temp_data);
char buf[TOKEN_LENGTH];
sprintf(buf, "%d", temp_num);
if ( stricmp(buf, temp_data) ) {
m_data_validated = false;
} else {
m_data_validated = true;
}
} else {
m_data_validated = true;
}
}
// Display message and reset focus
if ( (!m_data_validated) && (set_focus == RESET_FOCUS) ) {
MessageBox("Invalid Default Value.");
edit->SetFocus();
edit->SetSel(0, -1);
}
}
// Set type to number
void CAddVariableDlg::OnTypeNumber()
{
m_type_number = true;
set_variable_type();
}
// Set type to string
void CAddVariableDlg::OnTypeString()
{
m_type_number = false;
set_variable_type();
}
void CAddVariableDlg::OnTypePlayerPersistent()
{
m_type_player_persistent = ((CButton *) GetDlgItem(IDC_TYPE_PLAYER_PERSISTENT))->GetCheck() ? true : false;
if (m_type_player_persistent)
m_type_campaign_persistent = false;
set_variable_type();
}
void CAddVariableDlg::OnTypeCampaignPersistent()
{
m_type_campaign_persistent = ((CButton *) GetDlgItem(IDC_TYPE_CAMPAIGN_PERSISTENT))->GetCheck() ? true : false;
if (m_type_campaign_persistent)
m_type_player_persistent = false;
set_variable_type();
}
void CAddVariableDlg::OnTypeNetworkVariable()
{
m_type_network_variable = ((CButton *) GetDlgItem(IDC_TYPE_NETWORK_VARIABLE))->GetCheck() ? true : false;
set_variable_type();
}
// Set type check boxes
void CAddVariableDlg::set_variable_type()
{
CButton *button_string = (CButton *) GetDlgItem(IDC_TYPE_STRING);
CButton *button_number = (CButton *) GetDlgItem(IDC_TYPE_NUMBER);
button_number->SetCheck( m_type_number);
button_string->SetCheck(!m_type_number);
((CButton *) GetDlgItem(IDC_TYPE_CAMPAIGN_PERSISTENT))->SetCheck(m_type_campaign_persistent);
((CButton *) GetDlgItem(IDC_TYPE_PLAYER_PERSISTENT))->SetCheck(m_type_player_persistent);
((CButton *) GetDlgItem(IDC_TYPE_NETWORK_VARIABLE))->SetCheck(m_type_network_variable);
}
-74
View File
@@ -1,74 +0,0 @@
/*
* Copyright (C) Volition, Inc. 1999. All rights reserved.
*
* All source code herein is the property of Volition, Inc. You may not sell
* or otherwise commercially exploit the source or things you created based on the
* source.
*
*/
#if !defined(AFX_ADDVARIABLEDLG_H__0F668CB5_AAEE_11D2_A899_0060088FAE88__INCLUDED_)
#define AFX_ADDVARIABLEDLG_H__0F668CB5_AAEE_11D2_A899_0060088FAE88__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// AddVariableDlg.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// CAddVariableDlg dialog
class CAddVariableDlg : public CDialog
{
// Construction
public:
CAddVariableDlg(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(CAddVariableDlg)
enum { IDD = IDD_ADD_VARIABLE };
CString m_default_value;
CString m_variable_name;
bool m_name_validated;
bool m_data_validated;
bool m_type_number;
bool m_type_campaign_persistent;
bool m_type_player_persistent;
bool m_type_network_variable;
bool m_create;
int m_sexp_var_index;
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CAddVariableDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CAddVariableDlg)
virtual void OnOK();
virtual BOOL OnInitDialog();
afx_msg void validate_variable_name(int set_focus);
afx_msg void validate_data(int set_focus);
afx_msg void OnTypeNumber();
afx_msg void OnTypeString();
afx_msg void OnTypePlayerPersistent();
afx_msg void OnTypeCampaignPersistent();
afx_msg void OnTypeNetworkVariable();
afx_msg void set_variable_type();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_ADDVARIABLEDLG_H__0F668CB5_AAEE_11D2_A899_0060088FAE88__INCLUDED_)
-180
View File
@@ -1,180 +0,0 @@
/*
* Copyright (C) Volition, Inc. 1999. All rights reserved.
*
* All source code herein is the property of Volition, Inc. You may not sell
* or otherwise commercially exploit the source or things you created based on the
* source.
*
*/
/*
* $Logfile: /Freespace2/code/FRED2/AdjustGridDlg.cpp $
* $Revision: 1.2 $
* $Date: 2006-01-21 02:22:04 $
* $Author: wmcoolmon $
*
* Editor to allow one to change Fred's grid orientation and position.
*
* $Log: not supported by cvs2svn $
* Revision 1.1 2006/01/19 02:27:31 Goober5000
* import FRED2 back into fs2_open module
* --Goober5000
*
* Revision 1.3 2002/08/15 04:35:44 penguin
* Changes to build with fs2_open code.lib
*
* Revision 1.2 2002/08/15 01:06:34 penguin
* Include filename reorg (to coordinate w/ fs2_open)
*
* Revision 1.1.1.1 2002/07/15 03:10:52 inquisitor
* Initial FRED2 Checking
*
*
* 2 10/07/98 6:28p Dave
* Initial checkin. Renamed all relevant stuff to be Fred2 instead of
* Fred. Globalized mission and campaign file extensions. Removed Silent
* Threat specific code.
*
* 1 10/07/98 3:01p Dave
*
* 1 10/07/98 2:59p Dave
*
* 3 8/18/97 10:01p Hoffoss
* Improved dialog by graying out fields that don't have any effect on
* current plane setting.
*
* 2 8/18/97 9:31p Hoffoss
* Added grid adjustment dialog and shield system editor dialog.
*
* $NoKeywords: $
*/
#include "stdafx.h"
#include "FRED.h"
#include "AdjustGridDlg.h"
#include "mission/missiongrid.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// adjust_grid_dlg dialog
adjust_grid_dlg::adjust_grid_dlg(CWnd* pParent /*=NULL*/)
: CDialog(adjust_grid_dlg::IDD, pParent)
{
//{{AFX_DATA_INIT(adjust_grid_dlg)
m_x = 0;
m_y = 0;
m_z = 0;
//}}AFX_DATA_INIT
}
void adjust_grid_dlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(adjust_grid_dlg)
DDX_Control(pDX, IDC_SPIN_Z, m_spinz);
DDX_Control(pDX, IDC_SPIN_Y, m_spiny);
DDX_Control(pDX, IDC_SPIN_X, m_spinx);
DDX_Text(pDX, IDC_EDIT_X, m_x);
DDX_Text(pDX, IDC_EDIT_Y, m_y);
DDX_Text(pDX, IDC_EDIT_Z, m_z);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(adjust_grid_dlg, CDialog)
//{{AFX_MSG_MAP(adjust_grid_dlg)
ON_BN_CLICKED(IDC_XY_PLANE, OnXyPlane)
ON_BN_CLICKED(IDC_XZ_PLANE, OnXzPlane)
ON_BN_CLICKED(IDC_YZ_PLANE, OnYzPlane)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// adjust_grid_dlg message handlers
BOOL adjust_grid_dlg::OnInitDialog()
{
m_x = (int) The_grid->center.xyz.x;
m_y = (int) The_grid->center.xyz.y;
m_z = (int) The_grid->center.xyz.z;
CDialog::OnInitDialog();
if (The_grid->gmatrix.vec.uvec.xyz.y) {
((CButton *) GetDlgItem(IDC_XZ_PLANE))->SetCheck(TRUE);
GetDlgItem(IDC_EDIT_X)->EnableWindow(FALSE);
GetDlgItem(IDC_EDIT_Z)->EnableWindow(FALSE);
} else if (The_grid->gmatrix.vec.uvec.xyz.z) {
((CButton *) GetDlgItem(IDC_XY_PLANE))->SetCheck(TRUE);
GetDlgItem(IDC_EDIT_X)->EnableWindow(FALSE);
GetDlgItem(IDC_EDIT_Y)->EnableWindow(FALSE);
} else {
((CButton *) GetDlgItem(IDC_YZ_PLANE))->SetCheck(TRUE);
GetDlgItem(IDC_EDIT_Y)->EnableWindow(FALSE);
GetDlgItem(IDC_EDIT_Z)->EnableWindow(FALSE);
}
m_spinx.SetRange((short)99999, (short)-99999);
m_spiny.SetRange((short)99999, (short)-99999);
m_spinz.SetRange((short)99999, (short)-99999);
return TRUE;
}
void adjust_grid_dlg::OnOK()
{
UpdateData(TRUE);
The_grid->center.xyz.x = (float) m_x;
The_grid->center.xyz.y = (float) m_y;
The_grid->center.xyz.z = (float) m_z;
if (((CButton *) GetDlgItem(IDC_XY_PLANE)) -> GetCheck()) {
The_grid->gmatrix.vec.fvec = vmd_x_vector;
The_grid->gmatrix.vec.rvec = vmd_y_vector;
} else if (((CButton *) GetDlgItem(IDC_YZ_PLANE)) -> GetCheck()) {
The_grid->gmatrix.vec.fvec = vmd_y_vector;
The_grid->gmatrix.vec.rvec = vmd_z_vector;
} else { // XZ plane
The_grid->gmatrix.vec.fvec = vmd_x_vector;
The_grid->gmatrix.vec.rvec = vmd_z_vector;
}
modify_grid(The_grid);
CDialog::OnOK();
}
void adjust_grid_dlg::OnXyPlane()
{
GetDlgItem(IDC_EDIT_X)->EnableWindow(FALSE);
GetDlgItem(IDC_SPIN_X)->EnableWindow(FALSE);
GetDlgItem(IDC_EDIT_Y)->EnableWindow(FALSE);
GetDlgItem(IDC_SPIN_Y)->EnableWindow(FALSE);
GetDlgItem(IDC_EDIT_Z)->EnableWindow(TRUE);
GetDlgItem(IDC_SPIN_Z)->EnableWindow(TRUE);
}
void adjust_grid_dlg::OnXzPlane()
{
GetDlgItem(IDC_EDIT_X)->EnableWindow(FALSE);
GetDlgItem(IDC_SPIN_X)->EnableWindow(FALSE);
GetDlgItem(IDC_EDIT_Y)->EnableWindow(TRUE);
GetDlgItem(IDC_SPIN_Y)->EnableWindow(TRUE);
GetDlgItem(IDC_EDIT_Z)->EnableWindow(FALSE);
GetDlgItem(IDC_SPIN_Z)->EnableWindow(FALSE);
}
void adjust_grid_dlg::OnYzPlane()
{
GetDlgItem(IDC_EDIT_X)->EnableWindow(TRUE);
GetDlgItem(IDC_SPIN_X)->EnableWindow(TRUE);
GetDlgItem(IDC_EDIT_Y)->EnableWindow(FALSE);
GetDlgItem(IDC_SPIN_Y)->EnableWindow(FALSE);
GetDlgItem(IDC_EDIT_Z)->EnableWindow(FALSE);
GetDlgItem(IDC_SPIN_Z)->EnableWindow(FALSE);
}
-88
View File
@@ -1,88 +0,0 @@
/*
* Copyright (C) Volition, Inc. 1999. All rights reserved.
*
* All source code herein is the property of Volition, Inc. You may not sell
* or otherwise commercially exploit the source or things you created based on the
* source.
*
*/
/*
* $Logfile: /Freespace2/code/FRED2/AdjustGridDlg.h $
* $Revision: 1.1 $
* $Date: 2006-01-19 02:27:31 $
* $Author: Goober5000 $
*
* Editor to allow one to change Fred's grid orientation and position.
*
* $Log: not supported by cvs2svn $
* Revision 1.3 2005/07/13 02:40:50 Goober5000
* remove PreProcDefine #includes in FRED
* --Goober5000
*
* Revision 1.2 2004/09/29 17:26:32 Kazan
* PreProfDefines.h includes for fred2
*
* Revision 1.1.1.1 2002/07/15 03:10:52 inquisitor
* Initial FRED2 Checking
*
*
* 2 10/07/98 6:28p Dave
* Initial checkin. Renamed all relevant stuff to be Fred2 instead of
* Fred. Globalized mission and campaign file extensions. Removed Silent
* Threat specific code.
*
* 1 10/07/98 3:01p Dave
*
* 1 10/07/98 2:59p Dave
*
* 3 8/18/97 10:01p Hoffoss
* Improved dialog by graying out fields that don't have any effect on
* current plane setting.
*
* 2 8/18/97 9:31p Hoffoss
* Added grid adjustment dialog and shield system editor dialog.
*
* $NoKeywords: $
*/
/////////////////////////////////////////////////////////////////////////////
// adjust_grid_dlg dialog
class adjust_grid_dlg : public CDialog
{
// Construction
public:
void OnOK();
adjust_grid_dlg(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(adjust_grid_dlg)
enum { IDD = IDD_ADJUST_GRID };
CSpinButtonCtrl m_spinz;
CSpinButtonCtrl m_spiny;
CSpinButtonCtrl m_spinx;
int m_x;
int m_y;
int m_z;
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(adjust_grid_dlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(adjust_grid_dlg)
virtual BOOL OnInitDialog();
afx_msg void OnXyPlane();
afx_msg void OnXzPlane();
afx_msg void OnYzPlane();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
-680
View File
@@ -1,680 +0,0 @@
/*
* Copyright (C) Volition, Inc. 1999. All rights reserved.
*
* All source code herein is the property of Volition, Inc. You may not sell
* or otherwise commercially exploit the source or things you created based on the
* source.
*
*/
// AsteroidEditorDlg.cpp : implementation file
//
#include "stdafx.h"
#include "FRED.h"
#include "AsteroidEditorDlg.h"
#include "starfield/starfield.h"
#include "FREDDoc.h"
#include "debris/debris.h" // Asteroid stuff.
#include "species_defs/species_defs.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
#define ID_FIELD_MENU 9000
// helps in looping over combo boxes
int Dlg_id[MAX_ACTIVE_DEBRIS_TYPES] = {IDC_SHIP_DEBRIS1, IDC_SHIP_DEBRIS2, IDC_SHIP_DEBRIS3};
/////////////////////////////////////////////////////////////////////////////
// asteroid_editor dialog
asteroid_editor::asteroid_editor(CWnd* pParent /*=NULL*/)
: CDialog(asteroid_editor::IDD, pParent)
{
int i;
//{{AFX_DATA_INIT(asteroid_editor)
m_avg_speed = 0;
m_density = 0;
m_enable_asteroids = FALSE;
m_max_x = _T("");
m_max_y = _T("");
m_max_z = _T("");
m_min_x = _T("");
m_min_y = _T("");
m_min_z = _T("");
m_enable_inner_bounds = FALSE;
m_field_type = FT_ACTIVE;
m_box_max_x = _T("");
m_box_max_y = _T("");
m_box_max_z = _T("");
m_box_min_x = _T("");
m_box_min_y = _T("");
m_box_min_z = _T("");
//}}AFX_DATA_INIT
last_field = -1;
i=0;
// for (i=0; i<MAX_ASTEROID_FIELDS; i++)
a_field[i] = Asteroid_field; // Only supporting one field per mission.
}
void asteroid_editor::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(asteroid_editor)
DDX_Control(pDX, IDC_DENSITY_SPIN, m_density_spin);
DDX_Text(pDX, IDC_AVG_SPEED, m_avg_speed);
DDX_Text(pDX, IDC_DENSITY, m_density);
DDX_Check(pDX, IDC_ENABLE_ASTEROIDS, m_enable_asteroids);
DDX_Text(pDX, IDC_MAX_X, m_max_x);
DDX_Text(pDX, IDC_MAX_Y, m_max_y);
DDX_Text(pDX, IDC_MAX_Z, m_max_z);
DDX_Text(pDX, IDC_MIN_X, m_min_x);
DDX_Text(pDX, IDC_MIN_Y, m_min_y);
DDX_Text(pDX, IDC_MIN_Z, m_min_z);
DDX_Check(pDX, IDC_ENABLE_INNER_BOX, m_enable_inner_bounds);
DDX_Text(pDX, IDC_INNER_MAX_X, m_box_max_x);
DDX_Text(pDX, IDC_INNER_MAX_Y, m_box_max_y);
DDX_Text(pDX, IDC_INNER_MAX_Z, m_box_max_z);
DDX_Text(pDX, IDC_INNER_MIN_X, m_box_min_x);
DDX_Text(pDX, IDC_INNER_MIN_Y, m_box_min_y);
DDX_Text(pDX, IDC_INNER_MIN_Z, m_box_min_z);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(asteroid_editor, CDialog)
//{{AFX_MSG_MAP(asteroid_editor)
ON_WM_INITMENU()
ON_BN_CLICKED(IDC_ENABLE_ASTEROIDS, OnEnableAsteroids)
ON_WM_CLOSE()
ON_BN_CLICKED(IDC_ENABLE_INNER_BOX, OnEnableInnerBox)
ON_BN_CLICKED(IDC_PASSIVE_FIELD, OnPassiveField)
ON_BN_CLICKED(IDC_FIELD_SHIP, OnFieldShip)
ON_BN_CLICKED(IDC_ACTIVE_FIELD, OnActiveField)
ON_BN_CLICKED(IDC_FIELD_ASTEROID, OnFieldAsteroid)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// asteroid_editor message handlers
void asteroid_editor::OnInitMenu(CMenu* pMenu)
{
int i;
CString str;
CMenu *m;
m = pMenu->GetSubMenu(0);
clear_menu(m);
i = 0; //for (i=0; i<MAX_ASTEROID_FIELDS; i++) {
str.Format("Asteroid Field %d", i);
m->AppendMenu(MF_ENABLED | MF_STRING, ID_FIELD_MENU + i, str);
//}
m->DeleteMenu(ID_PLACEHOLDER, MF_BYCOMMAND);
if (cur_field != -1)
m->CheckMenuItem(ID_FIELD_MENU + cur_field, MF_BYCOMMAND | MF_CHECKED);
CDialog::OnInitMenu(pMenu);
}
BOOL asteroid_editor::OnCommand(WPARAM wParam, LPARAM lParam)
{
int id;
id = LOWORD(wParam);
if (id >= ID_FIELD_MENU && id < ID_FIELD_MENU + 1) { //MAX_ASTEROID_FIELDS) {
cur_field = id - ID_FIELD_MENU;
update_init();
}
return CDialog::OnCommand(wParam, lParam);
}
int asteroid_editor::query_modified()
{
int i;
for (i=0; i<1 /*MAX_ASTEROID_FIELDS*/; i++) {
if (a_field[i].num_initial_asteroids != Asteroid_field.num_initial_asteroids)
return 1;
if (vm_vec_dist_quick(&a_field[i].vel, &Asteroid_field.vel) == 0.0f)
return 1;
if (a_field[i].min_bound.xyz.x != Asteroid_field.min_bound.xyz.x)
return 1;
if (a_field[i].min_bound.xyz.y != Asteroid_field.min_bound.xyz.y)
return 1;
if (a_field[i].min_bound.xyz.z != Asteroid_field.min_bound.xyz.z)
return 1;
if (a_field[i].max_bound.xyz.x != Asteroid_field.max_bound.xyz.x)
return 1;
if (a_field[i].max_bound.xyz.y != Asteroid_field.max_bound.xyz.y)
return 1;
if (a_field[i].max_bound.xyz.z != Asteroid_field.max_bound.xyz.z)
return 1;
if (a_field[i].has_inner_bound != Asteroid_field.has_inner_bound)
return 1;
if (a_field[i].field_type != Asteroid_field.field_type)
return 1;
if (a_field[i].has_inner_bound) {
if (a_field[i].inner_max_bound.xyz.x != Asteroid_field.inner_max_bound.xyz.x)
return 1;
if (a_field[i].inner_max_bound.xyz.y != Asteroid_field.inner_max_bound.xyz.y)
return 1;
if (a_field[i].inner_max_bound.xyz.z != Asteroid_field.inner_max_bound.xyz.z)
return 1;
if (a_field[i].inner_min_bound.xyz.x != Asteroid_field.inner_min_bound.xyz.x)
return 1;
if (a_field[i].inner_min_bound.xyz.y != Asteroid_field.inner_min_bound.xyz.y)
return 1;
if (a_field[i].inner_min_bound.xyz.z != Asteroid_field.inner_min_bound.xyz.z)
return 1;
}
}
return 0;
}
#define MIN_BOX_THICKNESS 400
int asteroid_editor::validate_data()
{
if (!m_enable_asteroids) {
return 1;
} else {
// check x
if (a_field[0].max_bound.xyz.x < a_field[0].min_bound.xyz.x) {
MessageBox("Asteroid x min is greater than max");
return 0;
}
// check y
if (a_field[0].max_bound.xyz.y < a_field[0].min_bound.xyz.y) {
MessageBox("Asteroid y min is greater than max");
return 0;
}
// check z
if (a_field[0].max_bound.xyz.z < a_field[0].min_bound.xyz.z) {
MessageBox("Asteroid z min is greater than max");
return 0;
}
// check if inner bounds enabled
if (a_field[0].has_inner_bound) {
if (a_field[0].inner_max_bound.xyz.x < a_field[0].inner_min_bound.xyz.x) {
MessageBox("Asteroid x inner min is greater than inner max");
return 0;
}
if (a_field[0].inner_max_bound.xyz.y < a_field[0].inner_min_bound.xyz.y) {
MessageBox("Asteroid y inner min is greater than inner max");
return 0;
}
if (a_field[0].inner_max_bound.xyz.z < a_field[0].inner_min_bound.xyz.z) {
MessageBox("Asteroid z inner min is greater than inner max");
return 0;
}
// check x thickness
if (a_field[0].inner_min_bound.xyz.x - MIN_BOX_THICKNESS < a_field[0].min_bound.xyz.x) {
MessageBox("Asteroid x thickness from outer box to inner box must be > 400");
return 0;
}
if (a_field[0].inner_max_bound.xyz.x + MIN_BOX_THICKNESS > a_field[0].max_bound.xyz.x) {
MessageBox("Asteroid x thickness from outer box to inner box must be > 400");
return 0;
}
// check y thickness
if (a_field[0].inner_min_bound.xyz.y - MIN_BOX_THICKNESS < a_field[0].min_bound.xyz.y) {
MessageBox("Asteroid y thickness from outer box to inner box must be > 400");
return 0;
}
if (a_field[0].inner_max_bound.xyz.y + MIN_BOX_THICKNESS > a_field[0].max_bound.xyz.y) {
MessageBox("Asteroid y thickness from outer box to inner box must be > 400");
return 0;
}
// check z thickness
if (a_field[0].inner_min_bound.xyz.z - MIN_BOX_THICKNESS < a_field[0].min_bound.xyz.z) {
MessageBox("Asteroid z thickness from outer box to inner box must be > 400");
return 0;
}
if (a_field[0].inner_max_bound.xyz.z + MIN_BOX_THICKNESS > a_field[0].max_bound.xyz.z) {
MessageBox("Asteroid z thickness from outer box to inner box must be > 400");
return 0;
}
}
// check if passive, ship debris field, at least one speceis selected
if (a_field[0].field_type == FT_PASSIVE) {
if (a_field[0].debris_genre == DG_SHIP) {
if ( (a_field[0].field_debris_type[0] == -1) && (a_field[0].field_debris_type[1] == -1) && (a_field[0].field_debris_type[2] == -1) ) {
MessageBox("You must choose one or more types of ship debris");
return 0;
}
}
}
// check at least one asteroid subtype is selected
if (a_field[0].debris_genre == DG_ASTEROID) {
if ( (a_field[0].field_debris_type[0] == -1) && (a_field[0].field_debris_type[1] == -1) && (a_field[0].field_debris_type[2] == -1) ) {
MessageBox("You must choose one or more asteroid subtypes");
return 0;
}
}
}
return 1;
}
void asteroid_editor::OnOK()
{
int i;
update_init();
if (!validate_data()) {
return;
}
for (i=0; i<1 /*MAX_ASTEROID_FIELDS*/; i++)
Asteroid_field = a_field[i];
update_map_window();
theApp.record_window_data(&Asteroid_wnd_data, this);
CDialog::OnOK();
}
BOOL asteroid_editor::OnInitDialog()
{
cur_field = 0;
CDialog::OnInitDialog();
update_init();
theApp.init_window(&Asteroid_wnd_data, this);
m_density_spin.SetRange(1, MAX_ASTEROIDS);
return TRUE;
}
void asteroid_editor::update_init()
{
int num_asteroids, idx, cur_choice;
UpdateData(TRUE);
if (last_field >= 0) {
// store into temp asteroid field
num_asteroids = a_field[last_field].num_initial_asteroids;
a_field[last_field].num_initial_asteroids = m_enable_asteroids ? m_density : 0;
if (a_field[last_field].num_initial_asteroids < 0)
a_field[last_field].num_initial_asteroids = 0;
if (a_field[last_field].num_initial_asteroids > MAX_ASTEROIDS)
a_field[last_field].num_initial_asteroids = MAX_ASTEROIDS;
if (num_asteroids != a_field[last_field].num_initial_asteroids)
set_modified();
vec3d vel_vec = {1.0f, 0.0f, 0.0f};
vm_vec_scale(&vel_vec, (float) m_avg_speed);
MODIFY(a_field[last_field].vel.xyz.x, vel_vec.xyz.x);
MODIFY(a_field[last_field].vel.xyz.y, vel_vec.xyz.y);
MODIFY(a_field[last_field].vel.xyz.z, vel_vec.xyz.z);
MODIFY(a_field[last_field].min_bound.xyz.x, (float) atof(m_min_x));
MODIFY(a_field[last_field].min_bound.xyz.y, (float) atof(m_min_y));
MODIFY(a_field[last_field].min_bound.xyz.z, (float) atof(m_min_z));
MODIFY(a_field[last_field].max_bound.xyz.x, (float) atof(m_max_x));
MODIFY(a_field[last_field].max_bound.xyz.y, (float) atof(m_max_y));
MODIFY(a_field[last_field].max_bound.xyz.z, (float) atof(m_max_z));
// type of field
MODIFY(a_field[last_field].field_type, m_field_type);
MODIFY(a_field[last_field].debris_genre, m_debris_genre);
if ( (m_field_type == FT_PASSIVE) && (m_debris_genre == DG_SHIP) ) {
// we should have ship debris
for (idx=0; idx<MAX_ACTIVE_DEBRIS_TYPES; idx++) {
// loop over combo boxes, store the item data of the cur selection, -1 in no cur selection
int cur_sel = ((CComboBox*)GetDlgItem(Dlg_id[idx]))->GetCurSel();
if (cur_sel != CB_ERR) {
cur_choice = ((CComboBox*)GetDlgItem(Dlg_id[idx]))->GetItemData(cur_sel);
} else {
cur_choice = -1;
}
MODIFY(a_field[cur_field].field_debris_type[idx], cur_choice);
}
}
if ( m_debris_genre == DG_ASTEROID ) {
if ( ((CButton *)GetDlgItem(IDC_SUBTYPE1))->GetCheck() == 1) {
cur_choice = 1;
} else {
cur_choice = -1;
}
MODIFY(a_field[cur_field].field_debris_type[0], cur_choice);
if ( ((CButton *)GetDlgItem(IDC_SUBTYPE2))->GetCheck() == 1) {
cur_choice = 1;
} else {
cur_choice = -1;
}
MODIFY(a_field[cur_field].field_debris_type[1], cur_choice);
if ( ((CButton *)GetDlgItem(IDC_SUBTYPE3))->GetCheck() == 1) {
cur_choice = 1;
} else {
cur_choice = -1;
}
MODIFY(a_field[cur_field].field_debris_type[2], cur_choice);
}
MODIFY(a_field[last_field].has_inner_bound, m_enable_inner_bounds);
MODIFY(a_field[last_field].inner_min_bound.xyz.x, (float) atof(m_box_min_x));
MODIFY(a_field[last_field].inner_min_bound.xyz.y, (float) atof(m_box_min_y));
MODIFY(a_field[last_field].inner_min_bound.xyz.z, (float) atof(m_box_min_z));
MODIFY(a_field[last_field].inner_max_bound.xyz.x, (float) atof(m_box_max_x));
MODIFY(a_field[last_field].inner_max_bound.xyz.y, (float) atof(m_box_max_y));
MODIFY(a_field[last_field].inner_max_bound.xyz.z, (float) atof(m_box_max_z));
}
Assert(cur_field >= 0);
// get from temp asteroid field into class
m_enable_asteroids = a_field[cur_field].num_initial_asteroids ? TRUE : FALSE;
m_enable_inner_bounds = a_field[cur_field].has_inner_bound ? TRUE : FALSE;
m_density = a_field[cur_field].num_initial_asteroids;
if (!m_enable_asteroids)
m_density = 10;
// set field type
m_field_type = a_field[cur_field].field_type;
m_debris_genre = a_field[cur_field].debris_genre;
// m_debris_species = a_field[cur_field].debris_species;
m_avg_speed = (int) vm_vec_mag(&a_field[cur_field].vel);
m_min_x.Format("%.1f", a_field[cur_field].min_bound.xyz.x);
m_min_y.Format("%.1f", a_field[cur_field].min_bound.xyz.y);
m_min_z.Format("%.1f", a_field[cur_field].min_bound.xyz.z);
m_max_x.Format("%.1f", a_field[cur_field].max_bound.xyz.x);
m_max_y.Format("%.1f", a_field[cur_field].max_bound.xyz.y);
m_max_z.Format("%.1f", a_field[cur_field].max_bound.xyz.z);
m_box_min_x.Format("%.1f", a_field[cur_field].inner_min_bound.xyz.x);
m_box_min_y.Format("%.1f", a_field[cur_field].inner_min_bound.xyz.y);
m_box_min_z.Format("%.1f", a_field[cur_field].inner_min_bound.xyz.z);
m_box_max_x.Format("%.1f", a_field[cur_field].inner_max_bound.xyz.x);
m_box_max_y.Format("%.1f", a_field[cur_field].inner_max_bound.xyz.y);
m_box_max_z.Format("%.1f", a_field[cur_field].inner_max_bound.xyz.z);
// set up combo boxes
uint i;
int j, k, index, box_index;
// add "None" to each box
for (k = 0; k < MAX_ACTIVE_DEBRIS_TYPES; k++)
{
box_index = ((CComboBox*)GetDlgItem(Dlg_id[k]))->AddString("None");
((CComboBox*)GetDlgItem(Dlg_id[k]))->SetItemData(box_index, -1);
}
// now add each kind of debris to each box
CString name;
char *debris_size[NUM_DEBRIS_SIZES] = { "Small", "Medium", "Large" };
// each species
for (i = 0; i < Species_info.size(); i++)
{
// each size
for (j = 0; j < NUM_DEBRIS_SIZES; j++)
{
name = CString(Species_info[i].species_name) + " " + debris_size[j];
index = NUM_DEBRIS_SIZES + ((i * NUM_DEBRIS_SIZES) + j);
// each box
for (k = 0; k < MAX_ACTIVE_DEBRIS_TYPES; k++)
{
box_index = ((CComboBox*)GetDlgItem(Dlg_id[k]))->AddString(name);
((CComboBox*)GetDlgItem(Dlg_id[k]))->SetItemData(box_index, index);
}
}
}
// set active debris type for each combo box
int box_count, cur_box_data;
for (idx=0;idx<MAX_ACTIVE_DEBRIS_TYPES; idx++) {
// Only set selection if not "None"
if (a_field[cur_field].field_debris_type[idx] != -1) {
box_count = ((CComboBox*)GetDlgItem(Dlg_id[idx]))->GetCount();
for (box_index=0; box_index<box_count; box_index++) {
cur_box_data = ((CComboBox*)GetDlgItem(Dlg_id[idx]))->GetItemData(box_index);
if (cur_box_data == a_field[cur_field].field_debris_type[idx]) {
// set cur sel
((CComboBox*)GetDlgItem(Dlg_id[idx]))->SetCurSel(box_index);
break;
}
}
}
}
// set up asteroid subtype checkboxes
((CButton*)GetDlgItem(IDC_SUBTYPE1))->SetCheck(a_field[cur_field].field_debris_type[0] == 1);
((CButton*)GetDlgItem(IDC_SUBTYPE2))->SetCheck(a_field[cur_field].field_debris_type[1] == 1);
((CButton*)GetDlgItem(IDC_SUBTYPE3))->SetCheck(a_field[cur_field].field_debris_type[2] == 1);
UpdateData(FALSE);
OnEnableAsteroids();
last_field = cur_field;
}
void asteroid_editor::OnEnableAsteroids()
{
UpdateData(TRUE);
GetDlgItem(IDC_DENSITY)->EnableWindow(m_enable_asteroids);
GetDlgItem(IDC_DENSITY_SPIN)->EnableWindow(m_enable_asteroids);
GetDlgItem(IDC_AVG_SPEED)->EnableWindow(m_enable_asteroids);
GetDlgItem(IDC_MIN_X)->EnableWindow(m_enable_asteroids);
GetDlgItem(IDC_MIN_Y)->EnableWindow(m_enable_asteroids);
GetDlgItem(IDC_MIN_Z)->EnableWindow(m_enable_asteroids);
GetDlgItem(IDC_MAX_X)->EnableWindow(m_enable_asteroids);
GetDlgItem(IDC_MAX_Y)->EnableWindow(m_enable_asteroids);
GetDlgItem(IDC_MAX_Z)->EnableWindow(m_enable_asteroids);
GetDlgItem(IDC_ENABLE_INNER_BOX)->EnableWindow(m_enable_asteroids);
GetDlgItem(IDC_PASSIVE_FIELD)->EnableWindow(m_enable_asteroids);
GetDlgItem(IDC_ACTIVE_FIELD)->EnableWindow(m_enable_asteroids);
GetDlgItem(IDC_FIELD_SHIP)->EnableWindow(m_enable_asteroids);
GetDlgItem(IDC_FIELD_ASTEROID)->EnableWindow(m_enable_asteroids);
GetDlgItem(IDC_SHIP_DEBRIS1)->EnableWindow(m_enable_asteroids && (Asteroid_field.debris_genre == DG_SHIP));
GetDlgItem(IDC_SHIP_DEBRIS2)->EnableWindow(m_enable_asteroids && (Asteroid_field.debris_genre == DG_SHIP));
GetDlgItem(IDC_SHIP_DEBRIS3)->EnableWindow(m_enable_asteroids && (Asteroid_field.debris_genre == DG_SHIP));
GetDlgItem(IDC_SUBTYPE1)->EnableWindow(m_enable_asteroids && (Asteroid_field.debris_genre == DG_ASTEROID));
GetDlgItem(IDC_SUBTYPE2)->EnableWindow(m_enable_asteroids && (Asteroid_field.debris_genre == DG_ASTEROID));
GetDlgItem(IDC_SUBTYPE3)->EnableWindow(m_enable_asteroids && (Asteroid_field.debris_genre == DG_ASTEROID));
OnEnableInnerBox();
OnEnableField();
}
void asteroid_editor::OnCancel()
{
theApp.record_window_data(&Asteroid_wnd_data, this);
CDialog::OnCancel();
}
void asteroid_editor::OnClose()
{
int z;
update_init();
if (query_modified()) {
z = MessageBox("Do you want to keep your changes?", "Close", MB_ICONQUESTION | MB_YESNOCANCEL);
if (z == IDCANCEL)
return;
if (z == IDYES) {
OnOK();
return;
}
}
CDialog::OnClose();
}
// enable inner box (asteroid free zone)
// only allowed for active debris field
void asteroid_editor::OnEnableInnerBox()
{
UpdateData(TRUE);
GetDlgItem(IDC_INNER_MIN_X)->EnableWindow(m_enable_inner_bounds && m_enable_asteroids);
GetDlgItem(IDC_INNER_MAX_X)->EnableWindow(m_enable_inner_bounds && m_enable_asteroids);
GetDlgItem(IDC_INNER_MIN_Y)->EnableWindow(m_enable_inner_bounds && m_enable_asteroids);
GetDlgItem(IDC_INNER_MAX_Y)->EnableWindow(m_enable_inner_bounds && m_enable_asteroids);
GetDlgItem(IDC_INNER_MIN_Z)->EnableWindow(m_enable_inner_bounds && m_enable_asteroids);
GetDlgItem(IDC_INNER_MAX_Z)->EnableWindow(m_enable_inner_bounds && m_enable_asteroids);
}
//
void asteroid_editor::OnEnableField()
{
// set check in active
if (m_enable_asteroids) {
if (m_field_type == FT_ACTIVE) {
OnActiveField();
} else {
OnPassiveField();
}
}
// maybe enable species
if ( m_enable_asteroids && (m_field_type == FT_PASSIVE) && (m_debris_genre == DG_SHIP) ) {
OnFieldShip();
}
}
void asteroid_editor::OnActiveField()
{
// set field type
m_field_type = FT_ACTIVE;
m_debris_genre = DG_ASTEROID;
// gray out ship and species
GetDlgItem(IDC_FIELD_SHIP)->EnableWindow(FALSE);
GetDlgItem(IDC_SHIP_DEBRIS1)->EnableWindow(FALSE);
GetDlgItem(IDC_SHIP_DEBRIS2)->EnableWindow(FALSE);
GetDlgItem(IDC_SHIP_DEBRIS3)->EnableWindow(FALSE);
GetDlgItem(IDC_SUBTYPE1)->EnableWindow(TRUE);
GetDlgItem(IDC_SUBTYPE2)->EnableWindow(TRUE);
GetDlgItem(IDC_SUBTYPE3)->EnableWindow(TRUE);
// force check of asteroid
((CButton*)GetDlgItem(IDC_FIELD_ASTEROID))->SetCheck(1);
((CButton*)GetDlgItem(IDC_FIELD_SHIP))->SetCheck(0);
// force check of active field
((CButton*)GetDlgItem(IDC_ACTIVE_FIELD))->SetCheck(1);
((CButton*)GetDlgItem(IDC_PASSIVE_FIELD))->SetCheck(0);
// enable inner box
GetDlgItem(IDC_ENABLE_INNER_BOX)->EnableWindow(TRUE);
}
void asteroid_editor::OnPassiveField()
{
// set field type
m_field_type = FT_PASSIVE;
// acivate ship
GetDlgItem(IDC_FIELD_SHIP)->EnableWindow(TRUE);
// maybe activate species
GetDlgItem(IDC_SHIP_DEBRIS1)->EnableWindow(m_debris_genre == DG_SHIP);
GetDlgItem(IDC_SHIP_DEBRIS2)->EnableWindow(m_debris_genre == DG_SHIP);
GetDlgItem(IDC_SHIP_DEBRIS3)->EnableWindow(m_debris_genre == DG_SHIP);
// maybe activate asteroid subtype
GetDlgItem(IDC_SUBTYPE1)->EnableWindow(m_debris_genre == DG_ASTEROID);
GetDlgItem(IDC_SUBTYPE2)->EnableWindow(m_debris_genre == DG_ASTEROID);
GetDlgItem(IDC_SUBTYPE3)->EnableWindow(m_debris_genre == DG_ASTEROID);
// force check of current debris type
((CButton*)GetDlgItem(IDC_FIELD_ASTEROID))->SetCheck(m_debris_genre == DG_ASTEROID);
((CButton*)GetDlgItem(IDC_FIELD_SHIP))->SetCheck(m_debris_genre == DG_SHIP);
// force check of passive field
((CButton*)GetDlgItem(IDC_ACTIVE_FIELD))->SetCheck(0);
((CButton*)GetDlgItem(IDC_PASSIVE_FIELD))->SetCheck(1);
// disable inner box
GetDlgItem(IDC_ENABLE_INNER_BOX)->EnableWindow(FALSE);
}
void asteroid_editor::OnFieldShip()
{
// set debris type
m_debris_genre = DG_SHIP;
GetDlgItem(IDC_SHIP_DEBRIS1)->EnableWindow(TRUE);
GetDlgItem(IDC_SHIP_DEBRIS2)->EnableWindow(TRUE);
GetDlgItem(IDC_SHIP_DEBRIS3)->EnableWindow(TRUE);
GetDlgItem(IDC_SUBTYPE1)->EnableWindow(FALSE);
GetDlgItem(IDC_SUBTYPE2)->EnableWindow(FALSE);
GetDlgItem(IDC_SUBTYPE3)->EnableWindow(FALSE);
// force check of ship
((CButton*)GetDlgItem(IDC_FIELD_ASTEROID))->SetCheck(0);
((CButton*)GetDlgItem(IDC_FIELD_SHIP))->SetCheck(1);
}
void asteroid_editor::OnFieldAsteroid()
{
// set debris type
m_debris_genre = DG_ASTEROID;
GetDlgItem(IDC_SHIP_DEBRIS1)->EnableWindow(FALSE);
GetDlgItem(IDC_SHIP_DEBRIS2)->EnableWindow(FALSE);
GetDlgItem(IDC_SHIP_DEBRIS3)->EnableWindow(FALSE);
GetDlgItem(IDC_SUBTYPE1)->EnableWindow(TRUE);
GetDlgItem(IDC_SUBTYPE2)->EnableWindow(TRUE);
GetDlgItem(IDC_SUBTYPE3)->EnableWindow(TRUE);
// force check of asteroid
((CButton*)GetDlgItem(IDC_FIELD_ASTEROID))->SetCheck(1);
((CButton*)GetDlgItem(IDC_FIELD_SHIP))->SetCheck(0);
}
-85
View File
@@ -1,85 +0,0 @@
/*
* Copyright (C) Volition, Inc. 1999. All rights reserved.
*
* All source code herein is the property of Volition, Inc. You may not sell
* or otherwise commercially exploit the source or things you created based on the
* source.
*
*/
// AsteroidEditorDlg.h : header file
//
#include "starfield/starfield.h"
#include "asteroid/asteroid.h"
/////////////////////////////////////////////////////////////////////////////
// asteroid_editor dialog
class asteroid_editor : public CDialog
{
// Construction
public:
void update_init();
int query_modified();
void OnCancel();
void OnOK();
void OnEnableField();
int validate_data();
asteroid_editor(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(asteroid_editor)
enum { IDD = IDD_ASTEROID_EDITOR };
CSpinButtonCtrl m_density_spin;
int m_avg_speed;
int m_density;
BOOL m_enable_asteroids;
CString m_max_x;
CString m_max_y;
CString m_max_z;
CString m_min_x;
CString m_min_y;
CString m_min_z;
BOOL m_enable_inner_bounds;
field_type_t m_field_type; // active or passive
debris_genre_t m_debris_genre; // ship or asteroid
int m_field_debris_type[3]; // species and size of ship debris
CString m_box_max_x;
CString m_box_max_y;
CString m_box_max_z;
CString m_box_min_x;
CString m_box_min_y;
CString m_box_min_z;
//}}AFX_DATA
int cur_field, last_field;
asteroid_field a_field[1 /*MAX_ASTEROID_FIELDS*/];
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(asteroid_editor)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
virtual BOOL OnCommand(WPARAM wParam, LPARAM lParam);
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(asteroid_editor)
virtual BOOL OnInitDialog();
afx_msg void OnInitMenu(CMenu* pMenu);
afx_msg void OnEnableAsteroids();
afx_msg void OnClose();
afx_msg void OnEnableInnerBox();
afx_msg void OnPassiveField();
afx_msg void OnFieldShip();
afx_msg void OnActiveField();
afx_msg void OnFieldAsteroid();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
-88
View File
@@ -1,88 +0,0 @@
// BackgroundChooser.cpp : implementation file
//
#include "stdafx.h"
#include "fred.h"
#include "BackgroundChooser.h"
#include "ship/ship.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// BackgroundChooser dialog
BackgroundChooser::BackgroundChooser(int numBackgrounds)
: CDialog(BackgroundChooser::IDD)
{
//{{AFX_DATA_INIT(BackgroundChooser)
//}}AFX_DATA_INIT
m_numBackgrounds = numBackgrounds;
m_chosenBackground = -1;
}
void BackgroundChooser::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(BackgroundChooser)
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(BackgroundChooser, CDialog)
//{{AFX_MSG_MAP(BackgroundChooser)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// BackgroundChooser message handlers
BOOL BackgroundChooser::OnInitDialog()
{
int i;
for (i = 0; i < m_numBackgrounds; i++)
{
char temp[NAME_LENGTH];
sprintf(temp, "Background %d", i + 1);
((CComboBox*) GetDlgItem(IDC_BACKGROUND))->AddString(temp);
}
((CComboBox*) GetDlgItem(IDC_BACKGROUND))->SetCurSel(0);
CDialog::OnInitDialog();
UpdateData(FALSE);
return TRUE;
}
void BackgroundChooser::OnOK()
{
UpdateData(TRUE);
m_chosenBackground = ((CComboBox*) GetDlgItem(IDC_BACKGROUND))->GetCurSel();
CDialog::OnOK();
}
void BackgroundChooser::OnCancel()
{
// TODO: Add extra cleanup here
CDialog::OnCancel();
}
void BackgroundChooser::OnClose()
{
OnCancel();
}
int BackgroundChooser::GetChosenBackground()
{
return m_chosenBackground;
}
-52
View File
@@ -1,52 +0,0 @@
#if !defined(_BACKGROUND_CHOOSER_H_)
#define _BACKGROUND_CHOOSER_H_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// BackgroundChooser.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// BackgroundChooser dialog
class BackgroundChooser : public CDialog
{
// Construction
public:
BackgroundChooser(int numBackgrounds); // standard constructor
void OnOK();
void OnCancel();
int GetChosenBackground();
// Dialog Data
//{{AFX_DATA(BackgroundChooser)
enum { IDD = IDD_BACKGROUND_CHOOSER};
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(BackgroundChooser)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
int m_numBackgrounds;
int m_chosenBackground;
// Generated message map functions
//{{AFX_MSG(BackgroundChooser)
virtual BOOL OnInitDialog();
afx_msg void OnClose();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(_BACKGROUND_CHOOSER_H_)
File diff suppressed because it is too large. Load diff
-275
View File
@@ -1,275 +0,0 @@
/*
* Copyright (C) Volition, Inc. 1999. All rights reserved.
*
* All source code herein is the property of Volition, Inc. You may not sell
* or otherwise commercially exploit the source or things you created based on the
* source.
*
*/
/*
* $Logfile: /Freespace2/code/Fred2/BgBitmapDlg.h $
* $Revision: 1.2.2.2 $
* $Date: 2006-10-24 13:44:54 $
* $Author: taylor $
*
* Background space images manager dialog
*
* $Log: not supported by cvs2svn $
* Revision 1.2.2.1 2006/08/06 18:47:12 Goober5000
* add the multiple background feature
* --Goober5000
*
* Revision 1.2 2006/04/20 06:32:01 Goober5000
* proper capitalization according to Volition
*
* Revision 1.1 2006/01/19 02:27:31 Goober5000
* import FRED2 back into fs2_open module
* --Goober5000
*
* Revision 1.9 2005/12/21 00:28:43 phreak
* Import background button for mission bitmaps.
*
* Revision 1.8 2005/07/25 06:51:33 Goober5000
* mission flag changes for FRED
* --Goober5000
*
* Revision 1.7 2005/07/13 02:40:50 Goober5000
* remove PreProcDefine #includes in FRED
* --Goober5000
*
* Revision 1.6 2005/04/12 02:18:52 phreak
* Ambient lighting sliders now work in the background editor.
*
* Revision 1.5 2005/03/29 03:13:06 phreak
* Made some changes to the background bitmap dialog to show the user updates
* whenever any information on the position or size changes, or another bitmap is
* used instead of whats currently selected. The spinners for the bitmaps also wrap
* from 359 - > 0 and from 0 -> 359. These enhancements should make creating
* backgrounds much quicker and easier.
*
* Also fixed a bug where if a user entered "39" in either the pitch, bank, or heading
* boxes, then the "39" would be set to "38" due to truncation from converting between
* radians and degrees.
*
* Revision 1.4 2004/09/29 17:26:32 Kazan
* PreProfDefines.h includes for fred2
*
* Revision 1.3 2003/10/23 23:52:26 phreak
* changed the background bitmap dialog so the user can specify custom skyboxes
*
* Revision 1.2 2003/01/13 02:07:26 wmcoolmon
* Removed the override checkbox + flag for ship trails and added a checkbox + flag to disable ship trails within the nebula, NO_NEB_TRAILS, to the Background dialog.
*
* Revision 1.1.1.1 2002/07/15 03:10:52 inquisitor
* Initial FRED2 Checking
*
*
* 8 7/02/99 4:30p Dave
* Much more sophisticated lightning support.
*
* 7 6/03/99 6:37p Dave
* More TNT fun. Made perspective bitmaps more flexible.
*
* 6 4/26/99 8:47p Dave
* Made all pof related nebula stuff customizable through Fred.
*
* 5 4/07/99 6:21p Dave
* Fred and FreeSpace support for multiple background bitmaps and suns.
* Fixed link errors on all subprojects. Moved encrypt_init() to
* cfile_init() and lcl_init(), since its safe to call twice.
*
* 4 1/25/99 5:03a Dave
* First run of stealth, AWACS and TAG missile support. New mission type
* :)
*
* 3 11/14/98 5:37p Dave
* Put in support for full nebulas.
*
* 2 10/07/98 6:28p Dave
* Initial checkin. Renamed all relevant stuff to be Fred2 instead of
* Fred. Globalized mission and campaign file extensions. Removed Silent
* Threat specific code.
*
* 1 10/07/98 3:01p Dave
*
* 1 10/07/98 2:59p Dave
*
* 12 4/13/98 10:25p Hoffoss
* Added a flag for subspace missions, and for aboard the Galatea or
* Bastion.
*
* 11 12/08/97 4:48p Hoffoss
* Moved starfield editor controls to background editor.
*
* 10 11/25/97 11:40a Hoffoss
* Added support for nebula placement editing.
*
* 9 11/21/97 2:55p Hoffoss
* Added Nebula support to Fred. Implemented loading and saving nebula
* info to/from mission files.
*
* 8 3/31/97 6:07p Hoffoss
* Fixed several errors, including BG editor not graying fields, BG editor
* not updating image when changed, Removed obsolete data from Weapon
* editor, priority not being saved when missions saved, priority not
* editable in initial orders editor.
*
* 7 3/27/97 2:24p Hoffoss
* Fixed bug in image not updating when new image selected from listbox of
* combo box.
*
* 6 3/21/97 4:24p Hoffoss
* Fixed bug in changing image to an external image file.
*
* 5 3/17/97 1:54p Hoffoss
* fixed bugs in BG editor, and added delete button functionality.
*
* 4 3/12/97 4:33p Hoffoss
* added spin controls to orient editor, light intensity level can be
* specified in BG editor.
*
* 3 2/04/97 3:09p Hoffoss
* Background bitmap editor implemented fully.
*
* 2 1/30/97 2:24p Hoffoss
* Added remaining mission file structures and implemented load/save of
* them.
*
* $NoKeywords: $
*/
#ifndef _BG_BITMAP_DLG_H
#define _BG_BITMAP_DLG_H
/////////////////////////////////////////////////////////////////////////////
// bg_bitmap_dlg dialog
class bg_bitmap_dlg : public CDialog
{
// Construction
public:
void update_data(int update = 1);
void create();
// sun data functions
void sun_data_init();
void sun_data_close();
void sun_data_save_current();
// bitmap data functions
void bitmap_data_init();
void bitmap_data_close();
void bitmap_data_save_current();
void get_data_spinner(NM_UPDOWN* pUD, int id, int *var, int min, int max);
void get_data_int(int id, int *var, int min, int max);
void get_data_float(int id, float *var, float max, float min);
bg_bitmap_dlg(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(bg_bitmap_dlg)
enum { IDD = IDD_BG_BITMAP };
CSliderCtrl m_amb_blue;
CSliderCtrl m_amb_green;
CSliderCtrl m_amb_red;
CString m_neb_intensity;
int m_nebula_color;
int m_nebula_index;
int m_bank;
int m_heading;
int m_pitch;
CSliderCtrl m_slider;
int m_neb2_texture;
BOOL m_subspace;
BOOL m_fullneb;
int m_poof_0;
int m_poof_1;
int m_poof_2;
int m_poof_3;
int m_poof_4;
int m_poof_5;
BOOL m_toggle_trails;
CString m_storm_name;
CString s_name;
int s_pitch;
int s_bank;
int s_heading;
float s_scale;
int s_index;
CString b_name;
int b_pitch;
int b_bank;
int b_heading;
float b_scale_x;
float b_scale_y;
int b_div_x;
int b_div_y;
int b_index;
CString m_skybox_model;
CString m_envmap;
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(bg_bitmap_dlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// clear and build the nebula filename list appropriately
void build_nebfile_list();
int get_active_background();
int get_swap_background();
void reinitialize_lists();
// Generated message map functions
//{{AFX_MSG(bg_bitmap_dlg)
afx_msg void OnClose();
afx_msg void OnCancel();
afx_msg void OnOK();
afx_msg void OnSelchangeNebcolor();
afx_msg void OnSelchangeNebpattern();
afx_msg void OnFullNeb();
afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
afx_msg void OnSunChange();
afx_msg void OnAddSun();
afx_msg void OnDelSun();
afx_msg void OnSunDropdownChange();
afx_msg void OnBitmapChange();
afx_msg void OnAddBitmap();
afx_msg void OnDelBitmap();
afx_msg void OnBitmapDropdownChange();
afx_msg void OnDeltaposSbitmapPSpin(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnDeltaposSbitmapBSpin(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnDeltaposSbitmapHSpin(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnKillfocusSbitmapScaleX();
afx_msg void OnKillfocusSbitmapScaleY();
afx_msg void OnKillfocusSbitmapDivX();
afx_msg void OnKillfocusSbitmapDivY();
afx_msg void OnKillfocusSbitmapP();
afx_msg void OnKillfocusSbitmapB();
afx_msg void OnKillfocusSbitmapH();
afx_msg void OnDeltaposSun1PSpin(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnDeltaposSun1HSpin(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnDeltaposSun1BSpin(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnKillfocusSun1P();
afx_msg void OnKillfocusSun1H();
afx_msg void OnKillfocusSun1B();
afx_msg void OnKillfocusSun1Scale();
afx_msg void OnImportBackground();
afx_msg void OnSwapBackground();
afx_msg void OnBackgroundDropdownChange();
afx_msg void OnSkyboxBrowse();
afx_msg void OnEnvmapBrowse();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
private:
};
#endif
File diff suppressed because it is too large. Load diff
-261
View File
@@ -1,261 +0,0 @@
/*
* Copyright (C) Volition, Inc. 1999. All rights reserved.
*
* All source code herein is the property of Volition, Inc. You may not sell
* or otherwise commercially exploit the source or things you created based on the
* source.
*
*/
/*
* $Logfile: /Freespace2/code/FRED2/BriefingEditorDlg.h $
* $Revision: 1.3 $
* $Date: 2006-05-30 02:13:22 $
* $Author: Goober5000 $
*
* Briefing editor dialog box class.
*
* $Log: not supported by cvs2svn $
* Revision 1.2 2006/01/26 04:01:58 Goober5000
* spelling
*
* Revision 1.1 2006/01/19 02:27:31 Goober5000
* import FRED2 back into fs2_open module
* --Goober5000
*
* Revision 1.6 2005/12/29 00:55:25 phreak
* Briefing icons are now able to be flipped. Left becomes right and vice versa.
*
* Revision 1.5 2005/07/13 02:40:50 Goober5000
* remove PreProcDefine #includes in FRED
* --Goober5000
*
* Revision 1.4 2005/04/13 20:02:08 chhogg
* Changed vector to vec3d for Fred.
*
* Revision 1.3 2004/09/29 17:26:32 Kazan
* PreProfDefines.h includes for fred2
*
* Revision 1.2 2002/08/15 01:06:34 penguin
* Include filename reorg (to coordinate w/ fs2_open)
*
* Revision 1.1.1.1 2002/07/15 03:10:52 inquisitor
* Initial FRED2 Checking
*
*
* 3 5/20/99 1:46p Andsager
* Add briefing view copy and paste between stages
*
* 2 10/07/98 6:28p Dave
* Initial checkin. Renamed all relevant stuff to be Fred2 instead of
* Fred. Globalized mission and campaign file extensions. Removed Silent
* Threat specific code.
*
* 1 10/07/98 3:01p Dave
*
* 1 10/07/98 3:00p Dave
*
* 24 4/20/98 4:40p Hoffoss
* Added a button to 4 editors to play the chosen wave file.
*
* 23 4/07/98 4:51p Dave
* (Hoffoss) Fixed a boat load of bugs caused by the new change to
* multiple briefings. Allender's code changed to support this in the
* briefing editor wasn't quite correct.
*
* 22 4/06/98 5:37p Hoffoss
* Added sexp tree support to briefings in Fred.
*
* 21 2/18/98 6:45p Hoffoss
* Added support for lines between icons in briefings for Fred.
*
* 20 2/09/98 9:25p Allender
* team v team support. multiple pools and briefings
*
* 19 2/04/98 4:32p Allender
* support for multiple briefings and debriefings. Changes to mission
* type (now a bitfield). Bitfield defs for multiplayer modes
*
* 18 11/04/97 4:33p Hoffoss
* Made saving keep the current briefing state intact.
*
* 17 10/19/97 11:32p Hoffoss
* Added support for briefing cuts in Fred.
*
* 16 9/30/97 5:56p Hoffoss
* Added music selection combo boxes to Fred.
*
* 15 8/19/97 10:15a Hoffoss
* Made escape close briefing window through normal channels.
*
* 14 8/14/97 6:37p Hoffoss
* Added briefing icon id support to Fred.
*
* 13 8/07/97 3:45p Hoffoss
* Added in several requested features to the briefing editor.
*
* 12 8/06/97 12:25p Hoffoss
* Fixed bugs: Briefing editor dialog wasn't getting reset when new
* mission created, and hitting MFC assert when quitting while briefing
* editor open.
*
* 11 7/03/97 9:42a Hoffoss
* Added a ship type field in briefing editor.
*
* 10 6/26/97 6:04p Hoffoss
* Briefing icons now are selected before normal objects.
*
* 9 6/26/97 5:18p Hoffoss
* Major rework of briefing editor functionality.
*
* 8 6/25/97 4:13p Hoffoss
* Added functionality to the make icon button.
*
* 7 6/25/97 10:37a Hoffoss
* Added icon text field support to briefing editor.
*
* 6 6/24/97 3:03p Hoffoss
* New stages now copy another stage if possible.
*
* 5 6/24/97 11:31a Hoffoss
* Added code for handling icon editing.
*
* 4 6/24/97 10:16a Hoffoss
* Changes to briefing editor code.
*
* 3 6/23/97 2:58p Hoffoss
* Added more functionality to briefing editor.
*
* 2 6/18/97 2:39p Hoffoss
* Improved on briefing editor. Still far from done, though.
*
* $NoKeywords: $
*/
#ifndef __BRIEFINGEDITORDLG_H__
#define __BRIEFINGEDITORDLG_H__
#include "parse/sexp.h"
#include "mission/missionbriefcommon.h"
/////////////////////////////////////////////////////////////////////////////
// briefing_editor_dlg dialog
class briefing_editor_dlg : public CDialog
{
// Construction
public:
void focus_sexp(int select_sexp_node);
int calc_num_lines_for_icons(int num);
void batch_render();
void save_editor_state();
void restore_editor_state();
void reset_icon_loop(int stage);
int get_next_icon(int id);
void OnOK();
void OnCancel();
int find_icon(int id, int stage);
void propagate_icon(int num);
void reset_editor();
int check_mouse_hit(int x, int y);
void delete_icon(int num);
void update_positions();
void icon_select(int num);
void draw_icon(object *objp);
void create();
void update_data(int update = 1);
briefing_editor_dlg(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(briefing_editor_dlg)
enum { IDD = IDD_BRIEFING_EDITOR };
sexp_tree m_tree;
CButton m_lines;
BOOL m_hilight;
int m_icon_image;
CString m_icon_label;
CString m_stage_title;
CString m_text;
CString m_time;
CString m_voice;
CString m_icon_text;
int m_icon_team;
int m_ship_type;
BOOL m_change_local;
int m_id;
int m_briefing_music;
CString m_substitute_briefing_music;
BOOL m_cut_next;
BOOL m_cut_prev;
int m_current_briefing;
BOOL m_flipicon;
//}}AFX_DATA
CBitmap m_play_bm;
// copy view variables
int m_copy_view_set;
vec3d m_copy_view_pos;
matrix m_copy_view_orient;
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(briefing_editor_dlg)
public:
virtual BOOL DestroyWindow();
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
virtual BOOL OnCommand(WPARAM wParam, LPARAM lParam);
//}}AFX_VIRTUAL
// Implementation
protected:
brief_icon *iconp;
briefing *save_briefing;
int icon_loop, stage_loop;
int m_cur_stage;
int m_last_stage;
int m_cur_icon;
int m_last_icon;
int m_voice_id;
int stage_saved;
int icon_saved;
int modified;
// int point_obj;
int icon_obj[MAX_STAGE_ICONS];
int icon_marked[MAX_STAGE_ICONS];
int line_marked[MAX_BRIEF_STAGE_LINES];
void copy_stage(int from, int to);
// Generated message map functions
//{{AFX_MSG(briefing_editor_dlg)
afx_msg void OnClose();
afx_msg void OnNext();
afx_msg void OnPrev();
afx_msg void OnBrowse();
afx_msg void OnAddStage();
afx_msg void OnDeleteStage();
afx_msg void OnInsertStage();
afx_msg void OnMakeIcon();
afx_msg void OnDeleteIcon();
afx_msg void OnGotoView();
afx_msg void OnSaveView();
afx_msg void OnSelchangeIconImage();
afx_msg void OnSelchangeTeam();
afx_msg void OnPropagateIcons();
afx_msg void OnInitMenu(CMenu* pMenu);
afx_msg void OnLines();
afx_msg void OnRclickTree(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnBeginlabeleditTree(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnEndlabeleditTree(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnPlay();
afx_msg void OnCopyView();
afx_msg void OnPasteView();
afx_msg void OnFlipIcon();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
private:
};
#endif
-901
View File
@@ -1,901 +0,0 @@
/*
* Copyright (C) Volition, Inc. 1999. All rights reserved.
*
* All source code herein is the property of Volition, Inc. You may not sell
* or otherwise commercially exploit the source or things you created based on the
* source.
*
*/
// CampaignEditorDlg.cpp : implementation file
//
#include <setjmp.h>
#include "stdafx.h"
#include "FRED.h"
#include "CampaignEditorDlg.h"
#include "CampaignTreeView.h"
#include "CampaignTreeWnd.h"
#include "Management.h"
#include "cfile/cfile.h"
#include "FREDDoc.h"
#include "parse/parselo.h"
#include "mission/missiongoals.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
int Cur_campaign_mission = -1;
int Cur_campaign_link = -1;
/////////////////////////////////////////////////////////////////////////////
// campaign_editor dialog
IMPLEMENT_DYNCREATE(campaign_editor, CFormView)
campaign_editor *Campaign_tree_formp;
campaign_editor::campaign_editor()
: CFormView(campaign_editor::IDD)
{
//{{AFX_DATA_INIT(campaign_editor)
m_name = _T("");
m_type = -1;
m_num_players = _T("");
m_desc = _T("");
m_loop_desc = _T("");
m_loop_brief_anim = _T("");
m_loop_brief_sound = _T("");
m_custom_tech_db = FALSE;
//}}AFX_DATA_INIT
m_tree.m_mode = MODE_CAMPAIGN;
m_num_links = 0;
m_tree.link_modified(&Campaign_modified);
m_last_mission = -1;
}
campaign_editor::~campaign_editor()
{
}
void campaign_editor::DoDataExchange(CDataExchange* pDX)
{
CFormView::DoDataExchange(pDX);
//{{AFX_DATA_MAP(campaign_editor)
DDX_Control(pDX, IDC_SEXP_TREE, m_tree);
DDX_Control(pDX, IDC_FILELIST, m_filelist);
DDX_Text(pDX, IDC_NAME, m_name);
DDX_CBIndex(pDX, IDC_CAMPAIGN_TYPE, m_type);
DDX_Text(pDX, IDC_NUM_PLAYERS, m_num_players);
DDX_Text(pDX, IDC_DESC2, m_desc);
DDX_Text(pDX, IDC_MISSISON_LOOP_DESC, m_loop_desc);
DDX_Text(pDX, IDC_LOOP_BRIEF_ANIM, m_loop_brief_anim);
DDX_Text(pDX, IDC_LOOP_BRIEF_SOUND, m_loop_brief_sound);
DDX_Check(pDX, IDC_CUSTOM_TECH_DB, m_custom_tech_db);
//}}AFX_DATA_MAP
DDV_MaxChars(pDX, m_desc, MISSION_DESC_LENGTH - 1);
DDV_MaxChars(pDX, m_loop_desc, MISSION_DESC_LENGTH - 1);
}
BEGIN_MESSAGE_MAP(campaign_editor, CFormView)
//{{AFX_MSG_MAP(campaign_editor)
ON_BN_CLICKED(ID_LOAD, OnLoad)
ON_BN_CLICKED(IDC_ALIGN, OnAlign)
ON_BN_CLICKED(ID_CPGN_CLOSE, OnCpgnClose)
ON_NOTIFY(NM_RCLICK, IDC_SEXP_TREE, OnRclickTree)
ON_NOTIFY(TVN_BEGINLABELEDIT, IDC_SEXP_TREE, OnBeginlabeleditSexpTree)
ON_NOTIFY(TVN_ENDLABELEDIT, IDC_SEXP_TREE, OnEndlabeleditSexpTree)
ON_NOTIFY(TVN_SELCHANGED, IDC_SEXP_TREE, OnSelchangedSexpTree)
ON_BN_CLICKED(IDC_MOVE_UP, OnMoveUp)
ON_BN_CLICKED(IDC_MOVE_DOWN, OnMoveDown)
ON_COMMAND(ID_END_EDIT, OnEndEdit)
ON_EN_CHANGE(IDC_BRIEFING_CUTSCENE, OnChangeBriefingCutscene)
ON_CBN_SELCHANGE(IDC_CAMPAIGN_TYPE, OnSelchangeType)
ON_BN_CLICKED(IDC_TOGGLE_LOOP, OnToggleLoop)
ON_BN_CLICKED(IDC_LOOP_BRIEF_BROWSE, OnBrowseLoopAni)
ON_BN_CLICKED(IDC_LOOP_BRIEF_SOUND_BROWSE, OnBrowseLoopSound)
ON_EN_CHANGE(IDC_MAIN_HALL, OnChangeMainHall)
ON_EN_CHANGE(IDC_DEBRIEFING_PERSONA, OnChangeDebriefingPersona)
ON_BN_CLICKED(IDC_CUSTOM_TECH_DB, OnCustomTechDB)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// campaign_editor diagnostics
#ifdef _DEBUG
void campaign_editor::AssertValid() const
{
CFormView::AssertValid();
}
void campaign_editor::Dump(CDumpContext& dc) const
{
CFormView::Dump(dc);
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// campaign_editor message handlers
void campaign_editor::OnUpdate(CView* pSender, LPARAM lHint, CObject* pHint)
{
UpdateData(FALSE);
}
void campaign_editor::OnLoad()
{
char buf[512];
int size, offset;
if (Cur_campaign_mission < 0){
return;
}
if (Campaign_modified){
if (Campaign_wnd->save_modified()){
return;
}
}
cf_find_file_location(Campaign.missions[Cur_campaign_mission].name, CF_TYPE_MISSIONS, 512, buf, &size, &offset, false);
FREDDoc_ptr->SetPathName(buf);
Campaign_wnd->DestroyWindow();
// if (FREDDoc_ptr->OnOpenDocument(Campaign.missions[Cur_campaign_mission].name)) {
// Bypass_clear_mission = 1;
// Campaign_wnd->DestroyWindow();
//
// } else {
// MessageBox("Failed to load mission!", "Error");
// }
}
BOOL campaign_editor::Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext)
{
int i;
BOOL r;
CComboBox *box;
r = CFormView::Create(lpszClassName, lpszWindowName, dwStyle, rect, pParentWnd, nID, pContext);
if (r) {
box = (CComboBox *) GetDlgItem(IDC_CAMPAIGN_TYPE);
box->ResetContent();
for (i=0; i<MAX_CAMPAIGN_TYPES; i++){
box->AddString(campaign_types[i]);
}
}
return r;
}
void campaign_editor::load_campaign()
{
Cur_campaign_mission = Cur_campaign_link = -1;
load_tree(0);
if (!strlen(Campaign.filename))
strcpy(Campaign.filename, BUILTIN_CAMPAIGN);
if (mission_campaign_load(Campaign.filename, NULL, 0)) {
MessageBox("Couldn't open Campaign file!", "Error");
Campaign_wnd->OnCpgnFileNew();
return;
}
Campaign_modified = 0;
Campaign_tree_viewp->construct_tree();
initialize();
}
void campaign_editor::OnAlign()
{
Campaign_tree_viewp->sort_elements();
Campaign_tree_viewp->realign_tree();
Campaign_tree_viewp->Invalidate();
}
void campaign_editor::initialize( int init_files )
{
Cur_campaign_mission = Cur_campaign_link = -1;
m_tree.setup((CEdit *) GetDlgItem(IDC_HELP_BOX));
load_tree(0);
Campaign_tree_viewp->initialize();
// only initialize the file dialog box when the parameter says to. This should
// only happen when a campaign type changes
if ( init_files ){
m_filelist.initialize();
}
m_name = Campaign.name;
m_type = Campaign.type;
m_num_players.Format("%d", Campaign.num_players);
if (Campaign.desc) {
m_desc = convert_multiline_string(Campaign.desc);
} else {
m_desc = _T("");
}
m_loop_desc = _T("");
m_loop_brief_anim = _T("");
m_loop_brief_sound = _T("");
// single player should hide the two dialog items about number of players allowed
if ( m_type == CAMPAIGN_TYPE_SINGLE ) {
GetDlgItem(IDC_NUM_PLAYERS)->ShowWindow( SW_HIDE );
GetDlgItem(IDC_PLAYERS_LABEL)->ShowWindow( SW_HIDE );
} else {
GetDlgItem(IDC_NUM_PLAYERS)->ShowWindow( SW_SHOW );
GetDlgItem(IDC_PLAYERS_LABEL)->ShowWindow( SW_SHOW );
}
// set up the tech db checkbox
m_custom_tech_db = (BOOL)(Campaign.flags & CF_CUSTOM_TECH_DATABASE);
UpdateData(FALSE);
}
void campaign_editor::mission_selected(int num)
{
CEdit *bc_dialog, *bc_hall, *bc_persona;
char mainhalltext[10];
char personatext[10];
bc_dialog = (CEdit *) GetDlgItem(IDC_BRIEFING_CUTSCENE);
bc_hall = (CEdit *) GetDlgItem(IDC_MAIN_HALL);
bc_persona = (CEdit *) GetDlgItem(IDC_DEBRIEFING_PERSONA);
// clear out the text for the briefing cutscene, and put in new text if specified
bc_dialog->SetWindowText("");
if ( strlen(Campaign.missions[num].briefing_cutscene) )
bc_dialog->SetWindowText(Campaign.missions[num].briefing_cutscene);
// new main hall stuff
sprintf(mainhalltext, "%d", Campaign.missions[num].main_hall);
bc_hall->SetWindowText(CString(mainhalltext));
// new debriefing persona stuff
sprintf(personatext, "%d", Campaign.missions[num].debrief_persona_index);
bc_persona->SetWindowText(CString(personatext));
}
void campaign_editor::update()
{
char buf[MISSION_DESC_LENGTH];
// get data from dlog box
UpdateData(TRUE);
// update campaign name
string_copy(Campaign.name, m_name, NAME_LENGTH);
Campaign.type = m_type;
// update campaign desc
deconvert_multiline_string(buf, m_desc, MISSION_DESC_LENGTH);
if (Campaign.desc) {
free(Campaign.desc);
}
Campaign.desc = NULL;
if (strlen(buf)) {
Campaign.desc = strdup(buf);
}
// update flags
Campaign.flags = CF_DEFAULT_VALUE;
if (m_custom_tech_db)
Campaign.flags |= CF_CUSTOM_TECH_DATABASE;
// maybe update mission loop text
save_loop_desc_window();
// set the number of players in a multiplayer mission equal to the number of players in the first mission
if ( Campaign.type != CAMPAIGN_TYPE_SINGLE ) {
if ( Campaign.num_missions == 0 ) {
Campaign.num_players = 0;
} else {
mission a_mission;
get_mission_info(Campaign.missions[0].name, &a_mission);
Campaign.num_players = a_mission.num_players;
}
}
}
void campaign_editor::OnCpgnClose()
{
Campaign_wnd->OnClose();
}
void campaign_editor::load_tree(int save_first)
{
char text[80];
int i;
HTREEITEM h;
if (save_first)
save_tree();
m_tree.clear_tree();
m_tree.DeleteAllItems();
m_num_links = 0;
UpdateData(TRUE);
update_loop_desc_window();
m_last_mission = Cur_campaign_mission;
if (Cur_campaign_mission < 0) {
GetDlgItem(IDC_SEXP_TREE)->EnableWindow(FALSE);
GetDlgItem(IDC_BRIEFING_CUTSCENE)->EnableWindow(FALSE);
return;
}
GetDlgItem(IDC_SEXP_TREE)->EnableWindow(TRUE);
GetDlgItem(IDC_BRIEFING_CUTSCENE)->EnableWindow(TRUE);
GetDlgItem(IDC_MISSISON_LOOP_DESC)->EnableWindow(FALSE);
GetDlgItem(IDC_LOOP_BRIEF_ANIM)->EnableWindow(FALSE);
GetDlgItem(IDC_LOOP_BRIEF_SOUND)->EnableWindow(FALSE);
GetDlgItem(IDC_LOOP_BRIEF_BROWSE)->EnableWindow(FALSE);
GetDlgItem(IDC_LOOP_BRIEF_SOUND_BROWSE)->EnableWindow(FALSE);
for (i=0; i<Total_links; i++) {
if (Links[i].from == Cur_campaign_mission) {
Links[i].node = m_tree.load_sub_tree(Links[i].sexp, true, "do-nothing");
m_num_links++;
if (Links[i].from == Links[i].to) {
strcpy(text, "Repeat mission");
} else if ( (Links[i].to == -1) && (Links[i].from != -1) ) {
strcpy(text, "End of Campaign");
} else {
sprintf(text, "Branch to %s", Campaign.missions[Links[i].to].name);
}
// insert item into tree
int image, sel_image;
if (Links[i].mission_loop) {
image = BITMAP_BLUE_DOT;
sel_image = BITMAP_GREEN_DOT;
} else {
image = BITMAP_BLACK_DOT;
sel_image = BITMAP_RED_DOT;
}
h = m_tree.insert(text, image, sel_image);
m_tree.SetItemData(h, Links[i].node);
m_tree.add_sub_tree(Links[i].node, h);
}
}
}
void campaign_editor::OnRclickTree(NMHDR* pNMHDR, LRESULT* pResult)
{
m_tree.right_clicked(MODE_CAMPAIGN);
*pResult = 0;
}
void campaign_editor::OnBeginlabeleditSexpTree(NMHDR* pNMHDR, LRESULT* pResult)
{
TV_DISPINFO* pTVDispInfo = (TV_DISPINFO*)pNMHDR;
if (m_tree.edit_label(pTVDispInfo->item.hItem) == 1) {
*pResult = 0;
Campaign_modified = 1;
} else {
*pResult = 1;
}
}
void campaign_editor::OnEndlabeleditSexpTree(NMHDR* pNMHDR, LRESULT* pResult)
{
TV_DISPINFO* pTVDispInfo = (TV_DISPINFO*)pNMHDR;
*pResult = m_tree.end_label_edit(pTVDispInfo->item.hItem, pTVDispInfo->item.pszText);
}
int campaign_editor::handler(int code, int node, char *str)
{
int i;
switch (code) {
case ROOT_DELETED:
for (i=0; i<Total_links; i++){
if ((Links[i].from == Cur_campaign_mission) && (Links[i].node == node)){
break;
}
}
Campaign_tree_viewp->delete_link(i);
m_num_links--;
return node;
default:
Int3();
}
return -1;
}
void campaign_editor::save_tree(int clear)
{
int i;
if (m_last_mission < 0){
return; // nothing to save
}
for (i=0; i<Total_links; i++){
if (Links[i].from == m_last_mission) {
sexp_unmark_persistent(Links[i].sexp);
free_sexp2(Links[i].sexp);
Links[i].sexp = m_tree.save_tree(Links[i].node);
sexp_mark_persistent(Links[i].sexp);
}
}
if (clear){
m_last_mission = -1;
}
}
void campaign_editor::OnSelchangedSexpTree(NMHDR* pNMHDR, LRESULT* pResult)
{
int i, node;
HTREEITEM h, h2;
// get handle of selected item
NM_TREEVIEW* pNMTreeView = (NM_TREEVIEW*)pNMHDR;
h = pNMTreeView->itemNew.hItem;
Assert(h);
// update help on sexp
m_tree.update_help(h);
// get handle of parent
while ((h2 = m_tree.GetParentItem(h))>0){
h = h2;
}
// get identifier of parent
node = m_tree.GetItemData(h);
for (i=0; i<Total_links; i++){
if ((Links[i].from == Cur_campaign_mission) && (Links[i].node == node)){
break;
}
}
if (i == Total_links) {
Cur_campaign_link = -1;
return;
}
// update mission loop text
UpdateData(TRUE);
save_loop_desc_window();
Cur_campaign_link = i;
update_loop_desc_window();
Campaign_tree_viewp->Invalidate();
*pResult = 0;
}
void campaign_editor::OnMoveUp()
{
int i, last = -1;
campaign_tree_link temp;
HTREEITEM h1, h2;
if (Cur_campaign_link >= 0) {
save_tree();
for (i=0; i<Total_links; i++){
if (Links[i].from == Cur_campaign_mission) {
if (i == Cur_campaign_link){
break;
}
last = i;
}
}
if ((last != -1) && (i < Total_links)) {
h1 = m_tree.GetParentItem(m_tree.handle(Links[i].node));
h2 = m_tree.GetParentItem(m_tree.handle(Links[last].node));
m_tree.swap_roots(h1, h2);
m_tree.SelectItem(m_tree.GetParentItem(m_tree.handle(Links[i].node)));
temp = Links[last];
Links[last] = Links[i];
Links[i] = temp;
Cur_campaign_link = last;
}
}
GetDlgItem(IDC_SEXP_TREE)->SetFocus();
}
void campaign_editor::OnMoveDown()
{
int i, j;
campaign_tree_link temp;
HTREEITEM h1, h2;
if (Cur_campaign_link >= 0) {
save_tree();
for (i=0; i<Total_links; i++)
if (Links[i].from == Cur_campaign_mission)
if (i == Cur_campaign_link)
break;
for (j=i+1; j<Total_links; j++)
if (Links[j].from == Cur_campaign_mission)
break;
if (j < Total_links) {
h1 = m_tree.GetParentItem(m_tree.handle(Links[i].node));
h2 = m_tree.GetParentItem(m_tree.handle(Links[j].node));
m_tree.swap_roots(h1, h2);
m_tree.SelectItem(m_tree.GetParentItem(m_tree.handle(Links[i].node)));
temp = Links[j];
Links[j] = Links[i];
Links[i] = temp;
Cur_campaign_link = j;
}
}
GetDlgItem(IDC_SEXP_TREE)->SetFocus();
}
void campaign_editor::swap_handler(int node1, int node2)
{
int index1, index2;
campaign_tree_link temp;
for (index1=0; index1<Total_links; index1++){
if ((Links[index1].from == Cur_campaign_mission) && (Links[index1].node == node1)){
break;
}
}
Assert(index1 < Total_links);
for (index2=0; index2<Total_links; index2++){
if ((Links[index2].from == Cur_campaign_mission) && (Links[index2].node == node2)){
break;
}
}
Assert(index2 < Total_links);
temp = Links[index1];
// Links[index1] = Links[index2];
while (index1 < index2) {
Links[index1] = Links[index1 + 1];
index1++;
}
while (index1 > index2 + 1) {
Links[index1] = Links[index1 - 1];
index1--;
}
// update Cur_campaign_link
Cur_campaign_link = index1;
Links[index1] = temp;
}
void campaign_editor::insert_handler(int old, int node)
{
int i;
for (i=0; i<Total_links; i++){
if ((Links[i].from == Cur_campaign_mission) && (Links[i].node == old)){
break;
}
}
Assert(i < Total_links);
Links[i].node = node;
return;
}
void campaign_editor::OnEndEdit()
{
HWND h;
CWnd *w;
w = GetFocus();
if (w) {
h = w->m_hWnd;
GetDlgItem(IDC_SEXP_TREE)->SetFocus();
::SetFocus(h);
}
}
void campaign_editor::OnChangeBriefingCutscene()
{
CEdit *bc_dialog;
bc_dialog = (CEdit *) GetDlgItem(IDC_BRIEFING_CUTSCENE);
// maybe save off the current cutscene names.
if ( Cur_campaign_mission != -1 ) {
// see if the contents of the edit box have changed. Luckily, this returns 0 when the edit box is
// cleared.
if ( bc_dialog->GetModify() ) {
bc_dialog->GetWindowText( Campaign.missions[Cur_campaign_mission].briefing_cutscene, NAME_LENGTH );
Campaign_modified = 1;
}
}
}
// what to do when changing campaign type
void campaign_editor::OnSelchangeType()
{
// if campaign type is single player, then disable the multiplayer items
update();
initialize();
Campaign_modified = 1;
}
// update the loop mission text
void campaign_editor::save_loop_desc_window()
{
char buffer[MISSION_DESC_LENGTH];
// update only if active link and there is a mission has mission loop
if ( (Cur_campaign_link >= 0) && Links[Cur_campaign_link].mission_loop ) {
deconvert_multiline_string(buffer, m_loop_desc, MISSION_DESC_LENGTH);
if (Links[Cur_campaign_link].mission_loop_txt) {
free(Links[Cur_campaign_link].mission_loop_txt);
}
if (Links[Cur_campaign_link].mission_loop_brief_anim) {
free(Links[Cur_campaign_link].mission_loop_brief_anim);
}
if (Links[Cur_campaign_link].mission_loop_brief_sound) {
free(Links[Cur_campaign_link].mission_loop_brief_sound);
}
if (strlen(buffer)) {
Links[Cur_campaign_link].mission_loop_txt = strdup(buffer);
} else {
Links[Cur_campaign_link].mission_loop_txt = NULL;
}
deconvert_multiline_string(buffer, m_loop_brief_anim, MAX_FILENAME_LEN);
if(strlen(buffer)){
Links[Cur_campaign_link].mission_loop_brief_anim = strdup(buffer);
} else {
Links[Cur_campaign_link].mission_loop_brief_anim = NULL;
}
deconvert_multiline_string(buffer, m_loop_brief_sound, MAX_FILENAME_LEN);
if(strlen(buffer)){
Links[Cur_campaign_link].mission_loop_brief_sound = strdup(buffer);
} else {
Links[Cur_campaign_link].mission_loop_brief_sound = NULL;
}
}
}
void campaign_editor::update_loop_desc_window()
{
bool enable_loop_desc_window;
enable_loop_desc_window = false;
if ((Cur_campaign_link >= 0) && Links[Cur_campaign_link].mission_loop) {
enable_loop_desc_window = true;
}
// maybe enable description window
GetDlgItem(IDC_MISSISON_LOOP_DESC)->EnableWindow(enable_loop_desc_window);
GetDlgItem(IDC_LOOP_BRIEF_ANIM)->EnableWindow(enable_loop_desc_window);
GetDlgItem(IDC_LOOP_BRIEF_SOUND)->EnableWindow(enable_loop_desc_window);
GetDlgItem(IDC_LOOP_BRIEF_BROWSE)->EnableWindow(enable_loop_desc_window);
GetDlgItem(IDC_LOOP_BRIEF_SOUND_BROWSE)->EnableWindow(enable_loop_desc_window);
// set new text
if ((Cur_campaign_link >= 0) && Links[Cur_campaign_link].mission_loop_txt && enable_loop_desc_window) {
m_loop_desc = convert_multiline_string(Links[Cur_campaign_link].mission_loop_txt);
} else {
m_loop_desc = _T("");
}
// set new text
if ((Cur_campaign_link >= 0) && Links[Cur_campaign_link].mission_loop_brief_anim && enable_loop_desc_window) {
m_loop_brief_anim = convert_multiline_string(Links[Cur_campaign_link].mission_loop_brief_anim);
} else {
m_loop_brief_anim = _T("");
}
// set new text
if ((Cur_campaign_link >= 0) && Links[Cur_campaign_link].mission_loop_brief_sound && enable_loop_desc_window) {
m_loop_brief_sound = convert_multiline_string(Links[Cur_campaign_link].mission_loop_brief_sound);
} else {
m_loop_brief_sound = _T("");
}
// reset text
UpdateData(FALSE);
}
void campaign_editor::OnToggleLoop()
{
// check if branch selected
if (Cur_campaign_link == -1) {
return;
}
// store mission looop text
UpdateData(TRUE);
if ( (Cur_campaign_link >= 0) && Links[Cur_campaign_link].mission_loop ) {
if (Links[Cur_campaign_link].mission_loop_txt) {
free(Links[Cur_campaign_link].mission_loop_txt);
}
if (Links[Cur_campaign_link].mission_loop_brief_anim) {
free(Links[Cur_campaign_link].mission_loop_brief_anim);
}
if (Links[Cur_campaign_link].mission_loop_brief_sound) {
free(Links[Cur_campaign_link].mission_loop_brief_sound);
}
char buffer[MISSION_DESC_LENGTH];
deconvert_multiline_string(buffer, m_loop_desc, MISSION_DESC_LENGTH);
if (m_loop_desc && strlen(buffer)) {
Links[Cur_campaign_link].mission_loop_txt = strdup(buffer);
} else {
Links[Cur_campaign_link].mission_loop_txt = NULL;
}
deconvert_multiline_string(buffer, m_loop_brief_anim, MISSION_DESC_LENGTH);
if (m_loop_brief_anim && strlen(buffer)) {
Links[Cur_campaign_link].mission_loop_brief_anim = strdup(buffer);
} else {
Links[Cur_campaign_link].mission_loop_brief_anim = NULL;
}
deconvert_multiline_string(buffer, m_loop_brief_sound, MISSION_DESC_LENGTH);
if (m_loop_brief_sound && strlen(buffer)) {
Links[Cur_campaign_link].mission_loop_brief_sound = strdup(buffer);
} else {
Links[Cur_campaign_link].mission_loop_brief_sound = NULL;
}
}
// toggle to mission_loop setting
Links[Cur_campaign_link].mission_loop = !Links[Cur_campaign_link].mission_loop;
// reset loop desc window (gray if inactive)
update_loop_desc_window();
// set root icon
int bitmap1, bitmap2;
if (Links[Cur_campaign_link].mission_loop) {
bitmap2 = BITMAP_GREEN_DOT;
bitmap1 = BITMAP_BLUE_DOT;
} else {
bitmap1 = BITMAP_BLACK_DOT;
bitmap2 = BITMAP_RED_DOT;
}
// Search for item and update bitmap
HTREEITEM h = m_tree.GetRootItem();
while (h) {
if ((int) m_tree.GetItemData(h) == Links[Cur_campaign_link].node) {
m_tree.SetItemImage(h, bitmap1, bitmap2);
break;
}
h = m_tree.GetNextSiblingItem(h);
}
// set to redraw
Campaign_tree_viewp->Invalidate();
}
void campaign_editor::OnBrowseLoopAni()
{
int pushed_dir;
UpdateData(TRUE);
// switch directories
pushed_dir = cfile_push_chdir(CF_TYPE_INTERFACE);
CFileDialog dlg(TRUE, "ani", NULL, OFN_HIDEREADONLY | OFN_FILEMUSTEXIST | OFN_NOCHANGEDIR, "Ani Files (*.ani)|*.ani");
if (dlg.DoModal() == IDOK) {
m_loop_brief_anim = dlg.GetFileName();
UpdateData(FALSE);
}
// move back to the proper directory
if (!pushed_dir){
cfile_pop_dir();
}
}
void campaign_editor::OnBrowseLoopSound()
{
int pushed_dir;
UpdateData(TRUE);
// switch directories
pushed_dir = cfile_push_chdir(CF_TYPE_VOICE_CMD_BRIEF);
CFileDialog dlg(TRUE, "wav", NULL, OFN_HIDEREADONLY | OFN_FILEMUSTEXIST | OFN_NOCHANGEDIR,
"Voice Files (*.ogg, *.wav)|*.ogg;*.wav|Ogg Vorbis Files (*.ogg)|*.ogg|Wave Files (*.wav)|*.wav||");
if (dlg.DoModal() == IDOK) {
m_loop_brief_sound = dlg.GetFileName();
UpdateData(FALSE);
}
// move back to the proper directory
if (!pushed_dir){
cfile_pop_dir();
}
}
void campaign_editor::OnChangeMainHall()
{
CString str;
int hall;
UpdateData(TRUE);
if (Cur_campaign_mission >= 0)
{
GetDlgItem(IDC_MAIN_HALL)->GetWindowText(str);
hall = atoi(str);
if (hall > 255) hall = 255;
if (hall < 0) hall = 0;
Campaign.missions[Cur_campaign_mission].main_hall = (ubyte) hall;
}
}
void campaign_editor::OnChangeDebriefingPersona()
{
CString str;
int persona;
UpdateData(TRUE);
if (Cur_campaign_mission >= 0)
{
GetDlgItem(IDC_DEBRIEFING_PERSONA)->GetWindowText(str);
persona = atoi(str);
if (persona < 0 || persona > 0xff)
persona = 0;
Campaign.missions[Cur_campaign_mission].debrief_persona_index = persona;
}
}
void campaign_editor::OnCustomTechDB()
{
UpdateData(TRUE);
if (m_custom_tech_db)
Campaign.flags |= CF_CUSTOM_TECH_DATABASE;
else
Campaign.flags &= ~CF_CUSTOM_TECH_DATABASE;
}
-118
View File
@@ -1,118 +0,0 @@
/*
* Copyright (C) Volition, Inc. 1999. All rights reserved.
*
* All source code herein is the property of Volition, Inc. You may not sell
* or otherwise commercially exploit the source or things you created based on the
* source.
*
*/
// CampaignEditorDlg.h : header file
//
#include "resource.h"
#include "Sexp_tree.h"
#include "CampaignFilelistBox.h"
/////////////////////////////////////////////////////////////////////////////
// campaign_editor form view
#ifndef __AFXEXT_H__
#include <afxext.h>
#endif
class campaign_sexp_tree : public sexp_tree
{
};
class campaign_editor : public CFormView
{
private:
int m_num_links;
int m_last_mission;
protected:
campaign_editor(); // protected constructor used by dynamic creation
DECLARE_DYNCREATE(campaign_editor)
// Form Data
public:
void mission_selected(int num);
void insert_handler(int old, int node);
void swap_handler(int node1, int node2);
void update();
void load_tree(int save = 1);
void save_tree(int clear = 1);
int handler(int code, int node, char *str = NULL);
void initialize( int init_files = 1 );
void load_campaign();
void update_loop_desc_window();
void campaign_editor::save_loop_desc_window();
//{{AFX_DATA(campaign_editor)
enum { IDD = IDD_CAMPAIGN };
campaign_sexp_tree m_tree;
campaign_filelist_box m_filelist;
CString m_name;
int m_type;
CString m_num_players;
CString m_desc;
CString m_loop_desc;
CString m_loop_brief_anim;
CString m_loop_brief_sound;
BOOL m_custom_tech_db;
//}}AFX_DATA
// Attributes
public:
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(campaign_editor)
public:
virtual BOOL Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext = NULL);
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
virtual void OnUpdate(CView* pSender, LPARAM lHint, CObject* pHint);
//}}AFX_VIRTUAL
// Implementation
protected:
virtual ~campaign_editor();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
// Generated message map functions
//{{AFX_MSG(campaign_editor)
afx_msg void OnLoad();
afx_msg void OnAlign();
afx_msg void OnCpgnClose();
afx_msg void OnRclickTree(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnBeginlabeleditSexpTree(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnEndlabeleditSexpTree(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnSelchangedSexpTree(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnMoveUp();
afx_msg void OnMoveDown();
afx_msg void OnEndEdit();
afx_msg void OnChangeBriefingCutscene();
afx_msg void OnSelchangeType();
afx_msg void MainHallChange();
afx_msg void OnToggleLoop();
afx_msg void OnBrowseLoopAni();
afx_msg void OnBrowseLoopSound();
afx_msg void OnChangeMainHall();
afx_msg void OnChangeDebriefingPersona();
afx_msg void OnCustomTechDB();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
extern campaign_editor *Campaign_tree_formp;
extern int Cur_campaign_mission;
extern int Cur_campaign_link;
-90
View File
@@ -1,90 +0,0 @@
/*
* Copyright (C) Volition, Inc. 1999. All rights reserved.
*
* All source code herein is the property of Volition, Inc. You may not sell
* or otherwise commercially exploit the source or things you created based on the
* source.
*
*/
// CampaignFilelistBox.cpp : implementation file
//
#include "stdafx.h"
#include "FRED.h"
#include "freespace2/freespace.h"
#include "CampaignFilelistBox.h"
#include "CampaignTreeWnd.h"
#include "mission/missioncampaign.h"
#include "mission/missionparse.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// campaign_filelist_box
campaign_filelist_box::campaign_filelist_box()
{
}
campaign_filelist_box::~campaign_filelist_box()
{
}
BEGIN_MESSAGE_MAP(campaign_filelist_box, CListBox)
//{{AFX_MSG_MAP(campaign_filelist_box)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// campaign_filelist_box message handlers
void campaign_filelist_box::initialize()
{
int i, z, num_files;
char *mission_filenames[2000];
char mission_filenames_arr[2000][MAX_FILENAME_LEN];
mission a_mission;
ResetContent();
extern int Skip_packfile_search;
Skip_packfile_search = 1;
num_files = cf_get_file_list_preallocated(2000, mission_filenames_arr, mission_filenames, CF_TYPE_MISSIONS, "*.fs2");
Skip_packfile_search = 0;
i=0;
while (i < num_files)
{
// make a call to get the mission info for this mission. Passing a misison as the second
// parameter will prevent The_mission from getting overwritten.
get_mission_info( mission_filenames[i] , &a_mission );
strcat(mission_filenames[i],".fs2");
// only add missions of the appropriate type to the file listbox
if ( (Campaign.type == CAMPAIGN_TYPE_SINGLE) && (a_mission.game_type & (MISSION_TYPE_SINGLE|MISSION_TYPE_TRAINING)) )
AddString(mission_filenames[i]);
else if ( (Campaign.type == CAMPAIGN_TYPE_MULTI_COOP) && (a_mission.game_type & MISSION_TYPE_MULTI_COOP) )
AddString(mission_filenames[i]);
else if ( (Campaign.type == CAMPAIGN_TYPE_MULTI_TEAMS) && (a_mission.game_type & MISSION_TYPE_MULTI_TEAMS) )
AddString(mission_filenames[i]);
i++;
}
for (i=0; i<Campaign.num_missions; i++) {
z = FindString(-1, Campaign.missions[i].name);
if (z != LB_ERR) {
DeleteString(z); // take out all missions already in the campaign
i--; // recheck for name just in case there are two (should be impossible but can't be sure)
}
}
}
-47
View File
@@ -1,47 +0,0 @@
/*
* Copyright (C) Volition, Inc. 1999. All rights reserved.
*
* All source code herein is the property of Volition, Inc. You may not sell
* or otherwise commercially exploit the source or things you created based on the
* source.
*
*/
// CampaignFilelistBox.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// campaign_filelist_box window
class campaign_filelist_box : public CListBox
{
// Construction
public:
void initialize();
campaign_filelist_box();
// Attributes
public:
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(campaign_filelist_box)
//}}AFX_VIRTUAL
// Implementation
public:
virtual ~campaign_filelist_box();
// Generated message map functions
protected:
//{{AFX_MSG(campaign_filelist_box)
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
File diff suppressed because it is too large. Load diff
-115
View File
@@ -1,115 +0,0 @@
/*
* Copyright (C) Volition, Inc. 1999. All rights reserved.
*
* All source code herein is the property of Volition, Inc. You may not sell
* or otherwise commercially exploit the source or things you created based on the
* source.
*
*/
// CampaignTreeView.h : header file
//
#include "mission/missioncampaign.h"
#define MAX_LEVELS 100
#define MAX_CAMPAIGN_TREE_LINKS 300
typedef struct campaign_tree_element {
int from_links; // total branches from this mission
int to_links; // total branches that lead to this mission
CRect box; // coordinates of drawn box
} campaign_tree_element;
typedef struct campaign_tree_link {
int from; // index of source mission
int to; // index of mission link leads to
int sexp; // sexp index of condition that allows this branch
int node; // node tracker when link is in sexp tree window
int from_pos; // from link drawing offset
int to_pos; // to link drawing offset
bool mission_loop; // whether link leads to mission loop
char *mission_loop_txt; // text describing mission loop
char *mission_loop_brief_anim; // filename of anim to play in the brief
char *mission_loop_brief_sound; // filename of anim to play in the brief
CPoint p1; // coordinates of line last draw for link, from p1 to p2
CPoint p2;
} campaign_tree_link;
extern int Total_links;
extern int Level_counts[MAX_LEVELS];
extern int Sorted[MAX_CAMPAIGN_MISSIONS];
extern campaign_tree_element Elements[MAX_CAMPAIGN_MISSIONS];
extern campaign_tree_link Links[MAX_CAMPAIGN_TREE_LINKS];
/////////////////////////////////////////////////////////////////////////////
// campaign_tree_view view
class campaign_tree_view : public CScrollView
{
protected:
campaign_tree_view(); // protected constructor used by dynamic creation
DECLARE_DYNCREATE(campaign_tree_view)
// Attributes
public:
void drop_mission(int m, CPoint point);
int add_link(int from, int to);
void remove_mission(int m);
void delete_link(int num);
int get_root_mission();
void horizontally_align_mission(int num, int dir);
void correct_position(int num);
void free_links();
void sort_elements();
int query_alternate_pos(const CPoint& p);
int query_pos(const CPoint& p);
int query_level(const CPoint& p);
void sort_links();
void realign_tree();
int total_levels;
int total_width;
campaign_tree_link *first_link;
// Operations
public:
void construct_tree();
void initialize();
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(campaign_tree_view)
public:
virtual void OnInitialUpdate();
protected:
virtual void OnDraw(CDC* pDC); // overridden to draw this view
//}}AFX_VIRTUAL
// Implementation
protected:
virtual ~campaign_tree_view();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
// Generated message map functions
protected:
//{{AFX_MSG(campaign_tree_view)
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
afx_msg void OnMouseMove(UINT nFlags, CPoint point);
afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
afx_msg void OnContextMenu(CWnd* pWnd, CPoint point);
afx_msg void OnRemoveMission();
afx_msg void OnDeleteRow();
afx_msg void OnInsertRow();
afx_msg void OnAddRepeat();
afx_msg void OnEndOfCampaign();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
extern campaign_tree_view *Campaign_tree_viewp;
-595
View File
@@ -1,595 +0,0 @@
/*
* Copyright (C) Volition, Inc. 1999. All rights reserved.
*
* All source code herein is the property of Volition, Inc. You may not sell
* or otherwise commercially exploit the source or things you created based on the
* source.
*
*/
/*
* $Logfile: /Freespace2/code/FRED2/CampaignTreeWnd.cpp $
* $Revision: 1.1 $
* $Date: 2006-01-19 02:27:31 $
* $Author: Goober5000 $
*
* Campaign display tree window code. Works very closely with the Campaign editor dialog box.
*
* $Log: not supported by cvs2svn $
* Revision 1.5 2006/01/11 04:46:17 phreak
* Some campaign editor fixes:
*
* Filebox is initialized upon opening the window
* Campaign will save to directories other than /data/missions/ or /mod/data/missions
*
* Revision 1.4 2003/03/03 04:15:24 Goober5000
* FRED portion of tech room fix, plus some neatening up of the dialogs
* --Goober5000
*
* Revision 1.3 2003/01/14 04:00:15 Goober5000
* allowed for up to 256 main halls
* --Goober5000
*
* Revision 1.2 2002/08/15 01:06:34 penguin
* Include filename reorg (to coordinate w/ fs2_open)
*
* Revision 1.1.1.1 2002/07/15 03:10:53 inquisitor
* Initial FRED2 Checking
*
*
* 3 1/07/99 1:52p Andsager
* Initial check in of Sexp_variables
*
* 2 10/07/98 6:28p Dave
* Initial checkin. Renamed all relevant stuff to be Fred2 instead of
* Fred. Globalized mission and campaign file extensions. Removed Silent
* Threat specific code.
*
* 1 10/07/98 3:00p Dave
*
* 27 9/16/98 3:08p Dave
* Upped max sexpression nodes to 1800 (from 1600). Changed FRED to sort
* the ship list box. Added code so that tracker stats are not stored with
* only 1 player.
*
* 26 8/19/98 9:46a Hoffoss
* Added some 'save first?' type checks to the campaign editor.
*
* 25 5/26/98 2:32p Hoffoss
* Made campaign editor come up with a new campaign instead of loading
* built-in one.
*
* 24 5/22/98 1:06a Hoffoss
* Made Fred not use OLE.
*
* 23 4/14/98 11:55a Allender
* add end-of-campaign sexpression to allow for mission replay at the end
* of campaigns
*
* 22 3/31/98 12:23a Allender
* changed macro names of campaign types to be more descriptive. Added
* "team" to objectives dialog for team v. team missions. Added two
* distinct multiplayer campaign types
*
* 21 3/18/98 10:38p Allender
* added required "num players" for multiplayer missions. Put in required
* "num players" for multiplayer campaigns. Added campaign editor support
* to determine "num players"
*
* 20 2/24/98 10:23a Johnson
* Fixed up some build bugs caused by a multiplayer struct removal.
*
* 19 12/19/97 10:29a Allender
* made initial status windows appear on top of campaign editor window
* instead of Fred main window
*
* 18 12/18/97 5:11p Allender
* initial support for ship/weapon persistence
*
* 17 12/02/97 5:29p Johnson
* Fixed bug in branch sexp error checking. Was using link number instead
* of mission number.
*
* 16 11/22/97 3:05p Allender
* support for new fields for multiplayer in campaign editor
*
* 15 9/16/97 4:19p Jasen
* Fixed a bug in Fred with Campaign mode.
*
* 14 9/01/97 6:31p Hoffoss
* Added remaining missing features to campaign editor in Fred.
*
* 13 8/14/97 11:54p Hoffoss
* Added more error checking to Campaign editor, and made exit from
* Campaign editor reload last mission in Fred (unless specifically
* loading another mission).
*
* 12 8/13/97 5:49p Hoffoss
* Fixed bugs, made additions.
*
* 11 8/13/97 12:46p Hoffoss
* Added campaign error checker, accelerator table, and mission goal data
* listings to sexp tree right click menu.
*
* 10 7/09/97 2:28p Hoffoss
* Fixed bug with adding new links, and made campaign general info update.
*
* 9 5/15/97 12:45p Hoffoss
* Extensive changes to fix many little bugs.
*
* 8 5/14/97 12:54p Hoffoss
* Added sexp tree for campaign branches, branch hilighting, and branch
* reordering.
*
* 7 5/13/97 12:46p Hoffoss
* Added close campaign editor functions, changed global pointer to have
* capped first letter.
*
* 6 5/13/97 11:13a Hoffoss
* Added remaining file menu options to campaign editor.
*
* 5 5/13/97 10:52a Hoffoss
* Added campaign saving code.
*
* 4 5/09/97 9:50a Hoffoss
* Routine code check in.
*
* 3 5/05/97 9:40a Hoffoss
* Campaign editor begun.
*
* 2 5/01/97 4:11p Hoffoss
* Started on Campaign editor stuff, being sidetracked with fixing bugs
* now, though, so checking it for now.
*
* $NoKeywords: $
*/
#include "stdafx.h"
#include "FRED.h"
#include "CampaignTreeWnd.h"
#include "CampaignEditorDlg.h"
#include "CampaignTreeView.h"
#include "Management.h"
#include "MainFrm.h"
#include "FREDView.h"
#include "MissionSave.h"
#include "InitialShips.h"
#include "mission/missionparse.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
int Mission_filename_cb_format;
int Campaign_modified = 0;
int Bypass_clear_mission;
campaign_tree_wnd *Campaign_wnd = NULL;
IMPLEMENT_DYNCREATE(campaign_tree_wnd, CFrameWnd)
/////////////////////////////////////////////////////////////////////////////
// campaign_tree_wnd
campaign_tree_wnd::campaign_tree_wnd()
{
Bypass_clear_mission = 0;
}
campaign_tree_wnd::~campaign_tree_wnd()
{
}
BEGIN_MESSAGE_MAP(campaign_tree_wnd, CFrameWnd)
//{{AFX_MSG_MAP(campaign_tree_wnd)
ON_UPDATE_COMMAND_UI(ID_CPGN_FILE_OPEN, OnUpdateCpgnFileOpen)
ON_COMMAND(ID_CPGN_FILE_OPEN, OnCpgnFileOpen)
ON_WM_DESTROY()
ON_COMMAND(ID_CPGN_FILE_SAVE, OnCpgnFileSave)
ON_COMMAND(ID_CPGN_FILE_SAVE_AS, OnCpgnFileSaveAs)
ON_COMMAND(ID_CPGN_FILE_NEW, OnCpgnFileNew)
ON_COMMAND(ID_CLOSE, OnClose2)
ON_COMMAND(ID_ERROR_CHECKER, OnErrorChecker)
ON_WM_CLOSE()
ON_COMMAND(ID_INITIAL_SHIPS, OnInitialShips)
ON_COMMAND(ID_INITIAL_WEAPONS, OnInitialWeapons)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// campaign_tree_wnd message handlers
BOOL campaign_tree_wnd::OnCreateClient(LPCREATESTRUCT, CCreateContext* pContext)
{
CSize s;
LoadAccelTable("IDR_ACC_CAMPAIGN");
Mission_filename_cb_format = RegisterClipboardFormat("Mission Filename");
Campaign_modified = 0;
clear_mission();
// create a splitter with 1 row, 2 columns
if (!m_splitter.CreateStatic(this, 1, 2))
{
TRACE0("Failed to CreateStaticSplitter\n");
return FALSE;
}
// add the first splitter pane - the campaign input form in column 0
if (!m_splitter.CreateView(0, 0, RUNTIME_CLASS(campaign_editor), CSize(0, 0), pContext))
{
TRACE0("Failed to create first pane\n");
return FALSE;
}
// add the second splitter pane - the campaign tree view in column 1
if (!m_splitter.CreateView(0, 1, RUNTIME_CLASS(campaign_tree_view), CSize(240, 100), pContext))
{
TRACE0("Failed to create second pane\n");
return FALSE;
}
Campaign_tree_formp = (campaign_editor *) m_splitter.GetPane(0, 0);
Campaign_tree_viewp = (campaign_tree_view *) m_splitter.GetPane(0, 1);
s = Campaign_tree_formp->GetTotalSize();
m_splitter.SetColumnInfo(0, s.cx, 0);
m_splitter.SetColumnInfo(1, 0, 0);
m_splitter.RecalcLayout();
// activate the input view
SetActiveView(Campaign_tree_formp);
OnCpgnFileNew();
// Campaign_tree_formp->load_campaign();
Fred_main_wnd->EnableWindow(FALSE);
return TRUE;
}
void campaign_tree_wnd::OnUpdateCpgnFileOpen(CCmdUI* pCmdUI)
{
pCmdUI->Enable();
}
void campaign_tree_wnd::OnCpgnFileOpen()
{
CString name;
if (Campaign_modified)
if (save_modified())
return;
CFileDialog dlg(TRUE, "fc2", NULL, OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT, "FreeSpace Campaign files (*.fc2)|*.fc2||", this);
if (dlg.DoModal() == IDOK)
{
name = dlg.GetFileName();
if (strlen(name) > MAX_FILENAME_LEN - 1) {
MessageBox("Filename is too long", "Error");
return;
}
if (!strlen(name))
return;
string_copy(Campaign.filename, name, MAX_FILENAME_LEN);
Campaign_tree_formp->load_campaign();
}
}
void campaign_tree_wnd::OnDestroy()
{
CString str;
OnCpgnFileNew();
Fred_main_wnd->EnableWindow(TRUE);
// if (!Bypass_clear_mission)
// create_new_mission();
str = FREDDoc_ptr->GetPathName();
if (str.IsEmpty())
create_new_mission();
else
FREDDoc_ptr->OnOpenDocument(str);
CFrameWnd::OnDestroy();
Campaign_wnd = NULL;
Fred_main_wnd->SetFocus();
}
void campaign_tree_wnd::OnCpgnFileSave()
{
CFred_mission_save save;
Campaign_tree_formp->update();
if (!Campaign.filename[0]) {
OnCpgnFileSaveAs();
return;
}
// sanity checking for multiplayer
/*
if ( Campaign.type == TYPE_MULTI_PLAYER ) {
if ( (Campaign.mc_info.min_players < 0) || (Campaign.mc_info.min_players > Campaign.mc_info.max_players) ) {
MessageBox("Min players must be > 0 and <= max players", "Error", MB_OK | MB_ICONEXCLAMATION);
return;
}
if ( (Campaign.mc_info.max_players < 0) || (Campaign.mc_info.max_players > MAX_PLAYERS) ) {
char buf[256];
sprintf(buf, "Max players must be > 0 and <= %d", MAX_PLAYERS );
MessageBox(buf, "Error", MB_OK | MB_ICONEXCLAMATION);
return;
}
if ( Campaign.mc_info.max_players < Campaign.mc_info.min_players ) {
MessageBox("Max Players must be greater than min players", "Error", MB_OK | MB_ICONEXCLAMATION);
return;
}
}
*/
if (save.save_campaign_file(Campaign.filename))
{
MessageBox("An error occured while saving!", "Error", MB_OK | MB_ICONEXCLAMATION);
return;
}
Campaign_modified = 0;
return;
}
void campaign_tree_wnd::OnCpgnFileSaveAs()
{
char *old_name = NULL;
char campaign_path[256];
CString name;
CFred_mission_save save;
Campaign_tree_formp->update();
if (Campaign.filename[0])
old_name = Campaign.filename;
CFileDialog dlg(FALSE, "fc2", old_name, OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT, "FreeSpace Campaign files (*.fc2)|*.fc2||", this);
if (dlg.DoModal() == IDOK)
{
name = dlg.GetFileName();
if (strlen(name) > MAX_FILENAME_LEN - 1) {
MessageBox("Filename is too long", "Error");
return;
}
if (!strlen(name)){
return;
}
string_copy(Campaign.filename, name, MAX_FILENAME_LEN);
string_copy(campaign_path, dlg.GetPathName(), 256);
if (save.save_campaign_file(campaign_path))
{
MessageBox("An error occured while saving!", "Error", MB_OK | MB_ICONEXCLAMATION);
return;
}
Campaign_modified = 0;
}
}
void campaign_tree_wnd::OnCpgnFileNew()
{
if (Campaign_modified)
if (save_modified())
return;
Campaign.filename[0] = 0;
Campaign.num_missions = 0;
Campaign.num_players = 0;
strcpy(Campaign.name, "Unnamed");
Campaign.desc = NULL;
Campaign_tree_viewp->free_links();
Campaign_tree_formp->initialize();
Campaign_modified = 0;
Campaign.flags = CF_DEFAULT_VALUE;
((CButton *) (Campaign_tree_formp->GetDlgItem(IDC_CUSTOM_TECH_DB)))->SetCheck(0);
}
void campaign_tree_wnd::OnClose()
{
if (Campaign_modified)
if (save_modified())
return;
CFrameWnd::OnClose();
}
void campaign_tree_wnd::OnClose2()
{
if (Campaign_modified)
if (save_modified())
return;
DestroyWindow();
}
// returns 0 for success and 1 for cancel
int campaign_tree_wnd::save_modified()
{
int r;
r = MessageBox("This campaign has been modified. Save changes first?", "Campaign Modified",
MB_YESNOCANCEL | MB_ICONQUESTION);
if (r == IDCANCEL)
return 1;
if (r == IDYES) {
OnCpgnFileSave();
if (Campaign_modified) // error occured in saving.
return 1;
}
Campaign_modified = 0;
return 0;
}
void campaign_tree_wnd::OnErrorChecker()
{
Campaign_tree_formp->save_tree(0);
error_checker();
if (!g_err)
MessageBox("No errors detected in campaign", "Woohoo!");
}
int campaign_tree_wnd::error_checker()
{
int i, j, z;
int mcount[MAX_CAMPAIGN_MISSIONS], true_at[MAX_CAMPAIGN_MISSIONS];
for (i=0; i<MAX_CAMPAIGN_MISSIONS; i++) {
mcount[i] = 0;
true_at[i] = -1;
}
g_err = 0;
for (i=0; i<Total_links; i++) {
if ( (Links[i].from < 0) || (Links[i].from >= Campaign.num_missions) )
return internal_error("Branch #%d has illegal source mission", i);
if ( (Links[i].to < -1) || (Links[i].to >= Campaign.num_missions) )
return internal_error("Branch #%d has illegal target mission", i);
Sexp_useful_number = Links[i].from;
if (fred_check_sexp(Links[i].sexp, OPR_BOOL, "formula of branch #%d", i))
return -1;
z = Links[i].from;
mcount[z]++;
if (Links[i].sexp == Locked_sexp_false)
if (error("Mission \"%s\" branch %d is always false", Campaign.missions[z].name, mcount[z]))
return 1;
if (Links[i].sexp == Locked_sexp_true) {
if (true_at[z] >= 0)
if (error("Mission \"%s\" branch %d is true but is not last branch", Campaign.missions[z].name, true_at[z]))
return 1;
true_at[z] = mcount[z];
}
}
// check that all missions in a multiplayer game have the same number of players
if ( Campaign.type != CAMPAIGN_TYPE_SINGLE ) {
for (i = 0; i < Campaign.num_missions; i++ ) {
mission a_mission;
get_mission_info(Campaign.missions[i].name, &a_mission);
if ( a_mission.num_players != Campaign.num_players ) {
if ( error("Mission \"%s\" has %d players. Multiplayer campaign allows %d", Campaign.missions[i].name, a_mission.num_players, Campaign.num_players) )
return 1;
}
}
}
for (i=0; i<Campaign.num_missions; i++)
if (mcount[i] && true_at[i] < mcount[i])
if (error("Mission \"%s\" last branch isn't set to true", Campaign.missions[i].name))
return 1;
for (i=z=0; i<Campaign.num_missions; i++) {
for (j=0; j<Campaign.num_missions; j++)
if ((i != j) && !stricmp(Campaign.missions[i].name, Campaign.missions[j].name))
return internal_error("Mission \"%s\" is listed twice in campaign", Campaign.missions[i].name);
if (!Campaign.missions[i].level)
z++;
}
if (!z)
if (error("No top level mission present in tree"))
return 1;
if (z > 1)
return internal_error("More than one top level mission present in tree");
return 0;
}
int campaign_tree_wnd::error(char *msg, ...)
{
char buf[2048];
va_list args;
g_err++;
va_start(args, msg);
vsprintf(buf, msg, args);
va_end(args);
if (MessageBox(buf, "Error", MB_OKCANCEL | MB_ICONEXCLAMATION) == IDOK)
return 0;
return 1;
}
int campaign_tree_wnd::internal_error(char *msg, ...)
{
char buf[2048], buf2[2048];
va_list args;
g_err++;
va_start(args, msg);
vsprintf(buf, msg, args);
va_end(args);
sprintf(buf2, "%s\n\nThis is an internal error. Please let Hoffoss\n"
"know about this so he can fix it. Click cancel to debug.", buf);
if (MessageBox(buf2, "Internal Error", MB_OKCANCEL | MB_ICONEXCLAMATION) == IDCANCEL)
Int3(); // drop to debugger so the problem can be analyzed.
return -1;
}
int campaign_tree_wnd::fred_check_sexp(int sexp, int type, char *msg, ...)
{
char buf[512], buf2[2048], buf3[4096];
int err = 0, z, faulty_node;
va_list args;
va_start(args, msg);
vsprintf(buf, msg, args);
va_end(args);
if (sexp == -1)
return 0;
z = check_sexp_syntax(sexp, type, 1, &faulty_node, SEXP_MODE_CAMPAIGN);
if (!z)
return 0;
convert_sexp_to_string(sexp, buf2, SEXP_ERROR_CHECK_MODE, 2048);
sprintf(buf3, "Error in %s: %s\n\nIn sexpression: %s\n\n(Error appears to be: %s)",
buf, sexp_error_message(z), buf2, Sexp_nodes[faulty_node].text);
if (z < 0 && z > -100)
err = 1;
if (err)
return internal_error(buf3);
if (error(buf3))
return 1;
return 0;
}
// code to deal with the initial ships that a player can choose
void campaign_tree_wnd::OnInitialShips()
{
InitialShips isd(Campaign_tree_formp);
isd.m_initial_items = INITIAL_SHIPS;
isd.DoModal();
}
void campaign_tree_wnd::OnInitialWeapons()
{
InitialShips isd(Campaign_tree_formp);
isd.m_initial_items = INITIAL_WEAPONS;
isd.DoModal();
}
-140
View File
@@ -1,140 +0,0 @@
/*
* Copyright (C) Volition, Inc. 1999. All rights reserved.
*
* All source code herein is the property of Volition, Inc. You may not sell
* or otherwise commercially exploit the source or things you created based on the
* source.
*
*/
/*
* $Logfile: /Freespace2/code/FRED2/CampaignTreeWnd.h $
* $Revision: 1.1 $
* $Date: 2006-01-19 02:27:31 $
* $Author: Goober5000 $
*
* Campaign display tree window code. Works very closely with the Campaign editor dialog box.
*
* $Log: not supported by cvs2svn $
* Revision 1.3 2005/07/13 02:40:50 Goober5000
* remove PreProcDefine #includes in FRED
* --Goober5000
*
* Revision 1.2 2004/09/29 17:26:32 Kazan
* PreProfDefines.h includes for fred2
*
* Revision 1.1.1.1 2002/07/15 03:10:53 inquisitor
* Initial FRED2 Checking
*
*
* 2 10/07/98 6:28p Dave
* Initial checkin. Renamed all relevant stuff to be Fred2 instead of
* Fred. Globalized mission and campaign file extensions. Removed Silent
* Threat specific code.
*
* 1 10/07/98 3:01p Dave
*
* 1 10/07/98 3:00p Dave
*
* 12 12/18/97 5:11p Allender
* initial support for ship/weapon persistence
*
* 11 8/14/97 11:54p Hoffoss
* Added more error checking to Campaign editor, and made exit from
* Campaign editor reload last mission in Fred (unless specifically
* loading another mission).
*
* 10 8/13/97 5:49p Hoffoss
* Fixed bugs, made additions.
*
* 9 8/13/97 12:46p Hoffoss
* Added campaign error checker, accelerator table, and mission goal data
* listings to sexp tree right click menu.
*
* 8 5/15/97 12:45p Hoffoss
* Extensive changes to fix many little bugs.
*
* 7 5/14/97 12:54p Hoffoss
* Added sexp tree for campaign branches, branch hilighting, and branch
* reordering.
*
* 6 5/13/97 12:46p Hoffoss
* Added close campaign editor functions, changed global pointer to have
* capped first letter.
*
* 5 5/13/97 11:13a Hoffoss
* Added remaining file menu options to campaign editor.
*
* 4 5/13/97 10:52a Hoffoss
* Added campaign saving code.
*
* 3 5/09/97 9:50a Hoffoss
* Routine code check in.
*
* 2 5/01/97 4:11p Hoffoss
* Started on Campaign editor stuff, being sidetracked with fixing bugs
* now, though, so checking it for now.
*
* $NoKeywords: $
*/
/////////////////////////////////////////////////////////////////////////////
// campaign_tree_wnd window
class campaign_tree_wnd : public CFrameWnd
{
DECLARE_DYNCREATE(campaign_tree_wnd)
// Construction
public:
campaign_tree_wnd();
// Attributes
public:
// Operations
public:
int error_checker();
int fred_check_sexp(int sexp, int type, char *msg, ...);
int error(char *msg, ...);
int internal_error(char *msg, ...);
int save_modified();
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(campaign_tree_wnd)
//}}AFX_VIRTUAL
private:
int g_err;
// Implementation
public:
virtual ~campaign_tree_wnd();
virtual BOOL OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext);
// Generated message map functions
CSplitterWnd m_splitter;
//{{AFX_MSG(campaign_tree_wnd)
afx_msg void OnUpdateCpgnFileOpen(CCmdUI* pCmdUI);
afx_msg void OnCpgnFileOpen();
afx_msg void OnDestroy();
afx_msg void OnCpgnFileSave();
afx_msg void OnCpgnFileSaveAs();
afx_msg void OnCpgnFileNew();
afx_msg void OnClose2();
afx_msg void OnErrorChecker();
afx_msg void OnClose();
afx_msg void OnInitialShips();
afx_msg void OnInitialWeapons();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
extern int Mission_filename_cb_format;
extern int Campaign_modified;
extern int Bypass_clear_mission;
extern campaign_tree_wnd *Campaign_wnd;
-401
View File
@@ -1,401 +0,0 @@
/*
* Copyright (C) Volition, Inc. 1999. All rights reserved.
*
* All source code herein is the property of Volition, Inc. You may not sell
* or otherwise commercially exploit the source or things you created based on the
* source.
*
*/
/*
* $Logfile: /Freespace2/code/FRED2/CmdBrief.cpp $
* $Revision: 1.1.2.3 $
* $Date: 2007-04-08 08:28:20 $
* $Author: karajorma $
*
* Command Briefing Editor
*
* $Log: not supported by cvs2svn $
* Revision 1.1.2.2 2007/03/07 22:36:51 karajorma
* Make .ogg selectable in FRED.
*
* Revision 1.1.2.1 2006/10/24 13:41:54 taylor
* fix the cmdbrief editor deleting the wrong stage (Mantis bug #1115)
*
* Revision 1.1 2006/01/19 02:27:31 Goober5000
* import FRED2 back into fs2_open module
* --Goober5000
*
* Revision 1.3 2005/10/22 05:54:48 wmcoolmon
* Fixed cf_find_file_location
*
* Revision 1.2 2002/08/15 01:06:34 penguin
* Include filename reorg (to coordinate w/ fs2_open)
*
* Revision 1.1.1.1 2002/07/15 03:10:53 inquisitor
* Initial FRED2 Checking
*
*
* 2 10/07/98 6:28p Dave
* Initial checkin. Renamed all relevant stuff to be Fred2 instead of
* Fred. Globalized mission and campaign file extensions. Removed Silent
* Threat specific code.
*
* 1 10/07/98 3:01p Dave
*
* 1 10/07/98 3:00p Dave
*
* 8 4/30/98 8:23p John
* Fixed some bugs with Fred caused by my new cfile code.
*
* 7 4/22/98 9:56a Sandeep
*
* 6 4/20/98 4:40p Hoffoss
* Added a button to 4 editors to play the chosen wave file.
*
* 5 4/03/98 12:39p Hoffoss
* Changed starting directory for browse buttons in several editors.
*
* 4 3/19/98 4:24p Hoffoss
* Added remaining support for command brief screen (ANI and WAVE file
* playing).
*
* 3 3/06/98 2:36p Hoffoss
* Placed correct text size limits on edit boxes.
*
* 2 3/05/98 3:59p Hoffoss
* Added a bunch of new command brief stuff, and asteroid initialization
* to Fred.
*
* $NoKeywords: $
*/
#include "stdafx.h"
#include "FRED.h"
#include "CmdBrief.h"
#include "cfile/cfile.h"
#include "sound/audiostr.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// cmd_brief_dlg dialog
cmd_brief_dlg::cmd_brief_dlg(CWnd* pParent /*=NULL*/)
: CDialog(cmd_brief_dlg::IDD, pParent)
{
//{{AFX_DATA_INIT(cmd_brief_dlg)
m_ani_filename = _T("");
m_text = _T("");
m_stage_title = _T("");
m_wave_filename = _T("");
//}}AFX_DATA_INIT
m_wave_id = -1;
}
void cmd_brief_dlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(cmd_brief_dlg)
DDX_Text(pDX, IDC_ANI_FILENAME, m_ani_filename);
DDX_Text(pDX, IDC_TEXT, m_text);
DDX_Text(pDX, IDC_STAGE_TITLE, m_stage_title);
DDX_Text(pDX, IDC_WAVE_FILENAME, m_wave_filename);
//}}AFX_DATA_MAP
DDV_MaxChars(pDX, m_text, CMD_BRIEF_TEXT_MAX - 1);
DDV_MaxChars(pDX, m_ani_filename, MAX_FILENAME_LEN - 1);
DDV_MaxChars(pDX, m_wave_filename, MAX_FILENAME_LEN - 1);
}
BEGIN_MESSAGE_MAP(cmd_brief_dlg, CDialog)
//{{AFX_MSG_MAP(cmd_brief_dlg)
ON_BN_CLICKED(IDC_NEXT, OnNext)
ON_BN_CLICKED(IDC_PREV, OnPrev)
ON_BN_CLICKED(IDC_ADD_STAGE, OnAddStage)
ON_BN_CLICKED(IDC_INSERT_STAGE, OnInsertStage)
ON_BN_CLICKED(IDC_DELETE_STAGE, OnDeleteStage)
ON_BN_CLICKED(IDC_BROWSE_ANI, OnBrowseAni)
ON_BN_CLICKED(IDC_BROWSE_WAVE, OnBrowseWave)
ON_BN_CLICKED(IDC_PLAY, OnPlay)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// cmd_brief_dlg message handlers
BOOL cmd_brief_dlg::OnInitDialog()
{
Cur_cmd_brief = Cmd_briefs; // default to first cmd briefing
m_cur_stage = 0;
last_cmd_brief = NULL;
CDialog::OnInitDialog();
m_play_bm.LoadBitmap(IDB_PLAY);
((CButton *) GetDlgItem(IDC_PLAY)) -> SetBitmap(m_play_bm);
update_data();
return TRUE;
}
void cmd_brief_dlg::update_data(int update)
{
int enable;
if (update)
UpdateData(TRUE);
// save previously editing data before we load over it.
if (last_cmd_brief && m_last_stage >= 0 && m_last_stage < last_cmd_brief->num_stages) {
char buf[CMD_BRIEF_TEXT_MAX];
if (last_cmd_brief->stage[m_last_stage].text)
free(last_cmd_brief->stage[m_last_stage].text);
deconvert_multiline_string(buf, m_text, CMD_BRIEF_TEXT_MAX);
last_cmd_brief->stage[m_last_stage].text = strdup(buf);
string_copy(last_cmd_brief->stage[m_last_stage].ani_filename, m_ani_filename, MAX_FILENAME_LEN);
string_copy(last_cmd_brief->stage[m_last_stage].wave_filename, m_wave_filename, MAX_FILENAME_LEN);
}
// load data of new stage into dialog
if (Cur_cmd_brief && Cur_cmd_brief->num_stages > 0) {
if (m_cur_stage < 0 || m_cur_stage >= Cur_cmd_brief->num_stages)
m_cur_stage = 0;
m_stage_title.Format("Stage %d of %d", m_cur_stage + 1, Cur_cmd_brief->num_stages);
m_text = convert_multiline_string(Cur_cmd_brief->stage[m_cur_stage].text);
m_ani_filename = Cur_cmd_brief->stage[m_cur_stage].ani_filename;
m_wave_filename = Cur_cmd_brief->stage[m_cur_stage].wave_filename;
enable = TRUE;
} else {
m_stage_title = _T("No stages");
m_text = _T("");
m_ani_filename = _T("");
m_wave_filename = _T("");
enable = FALSE;
m_cur_stage = -1;
}
if (m_cur_stage < Cur_cmd_brief->num_stages - 1)
GetDlgItem(IDC_NEXT) -> EnableWindow(enable);
else
GetDlgItem(IDC_NEXT) -> EnableWindow(FALSE);
if (m_cur_stage)
GetDlgItem(IDC_PREV) -> EnableWindow(enable);
else
GetDlgItem(IDC_PREV) -> EnableWindow(FALSE);
if (Cur_cmd_brief->num_stages >= CMD_BRIEF_STAGES_MAX)
GetDlgItem(IDC_ADD_STAGE) -> EnableWindow(FALSE);
else
GetDlgItem(IDC_ADD_STAGE) -> EnableWindow(TRUE);
if (Cur_cmd_brief->num_stages) {
GetDlgItem(IDC_DELETE_STAGE) -> EnableWindow(enable);
GetDlgItem(IDC_INSERT_STAGE) -> EnableWindow(enable);
} else {
GetDlgItem(IDC_DELETE_STAGE) -> EnableWindow(FALSE);
GetDlgItem(IDC_INSERT_STAGE) -> EnableWindow(FALSE);
}
GetDlgItem(IDC_WAVE_FILENAME) -> EnableWindow(enable);
GetDlgItem(IDC_ANI_FILENAME) -> EnableWindow(enable);
GetDlgItem(IDC_BROWSE_ANI) -> EnableWindow(enable);
GetDlgItem(IDC_BROWSE_WAVE) -> EnableWindow(enable);
GetDlgItem(IDC_TEXT) -> EnableWindow(enable);
UpdateData(FALSE);
last_cmd_brief = Cur_cmd_brief;
m_last_stage = m_cur_stage;
}
void cmd_brief_dlg::OnOK()
{
audiostream_close_file(m_wave_id, 0);
m_wave_id = -1;
update_data();
CDialog::OnOK();
}
void cmd_brief_dlg::OnNext()
{
audiostream_close_file(m_wave_id, 0);
m_wave_id = -1;
m_cur_stage++;
update_data();
}
void cmd_brief_dlg::OnPrev()
{
audiostream_close_file(m_wave_id, 0);
m_wave_id = -1;
m_cur_stage--;
update_data();
}
void cmd_brief_dlg::OnAddStage()
{
int i;
if (Cur_cmd_brief->num_stages >= CMD_BRIEF_STAGES_MAX)
return;
audiostream_close_file(m_wave_id, 0);
m_wave_id = -1;
m_cur_stage = i = Cur_cmd_brief->num_stages++;
copy_stage(i - 1, i);
update_data(1);
}
void cmd_brief_dlg::OnInsertStage()
{
int i, z;
if (Cur_cmd_brief->num_stages >= CMD_BRIEF_STAGES_MAX)
return;
if (!Cur_cmd_brief->num_stages) {
OnAddStage();
return;
}
audiostream_close_file(m_wave_id, 0);
m_wave_id = -1;
z = m_cur_stage;
m_cur_stage = -1;
update_data(1);
for (i=Cur_cmd_brief->num_stages; i>z; i--)
Cur_cmd_brief->stage[i] = Cur_cmd_brief->stage[i - 1];
Cur_cmd_brief->num_stages++;
copy_stage(z, z + 1);
m_cur_stage = z;
m_last_stage = -1;
update_data(0);
}
void cmd_brief_dlg::OnDeleteStage()
{
int i, z;
if (m_cur_stage < 0)
return;
audiostream_close_file(m_wave_id, 0);
m_wave_id = -1;
Assert(Cur_cmd_brief->num_stages);
z = m_cur_stage;
m_cur_stage = -1;
update_data(1);
if (Cur_cmd_brief->stage[z].text)
free(Cur_cmd_brief->stage[z].text);
for (i=z+1; i<Cur_cmd_brief->num_stages; i++)
Cur_cmd_brief->stage[i-1] = Cur_cmd_brief->stage[i];
Cur_cmd_brief->num_stages--;
m_cur_stage = z;
m_last_stage = -1;
if (m_cur_stage >= Cur_cmd_brief->num_stages)
m_cur_stage = Cur_cmd_brief->num_stages - 1;
update_data(0);
}
void cmd_brief_dlg::copy_stage(int from, int to)
{
if ((from < 0) || (from >= Cur_cmd_brief->num_stages)) {
Cur_cmd_brief->stage[to].text = strdup("<Text here>");
strcpy(Cur_cmd_brief->stage[to].ani_filename, "<default>");
strcpy(Cur_cmd_brief->stage[to].wave_filename, "none");
return;
}
Cur_cmd_brief->stage[to] = Cur_cmd_brief->stage[from];
Cur_cmd_brief->stage[to].text = strdup(Cur_cmd_brief->stage[from].text);
}
void cmd_brief_dlg::OnBrowseAni()
{
int z;
CString name;
UpdateData(TRUE);
z = cfile_push_chdir(CF_TYPE_INTERFACE);
CFileDialog dlg(TRUE, "ani", NULL, OFN_HIDEREADONLY | OFN_FILEMUSTEXIST | OFN_NOCHANGEDIR,
"Ani Files (*.ani)|*.ani|Avi Files (*.avi)|*.avi|Both (*.ani, *.avi)|*.ani;*.avi||");
if (dlg.DoModal() == IDOK) {
m_ani_filename = dlg.GetFileName();
UpdateData(FALSE);
}
if (!z)
cfile_pop_dir();
}
void cmd_brief_dlg::OnBrowseWave()
{
int z;
CString name;
audiostream_close_file(m_wave_id, 0);
m_wave_id = -1;
UpdateData(TRUE);
z = cfile_push_chdir(CF_TYPE_VOICE_CMD_BRIEF);
CFileDialog dlg(TRUE, "wav", NULL, OFN_HIDEREADONLY | OFN_FILEMUSTEXIST | OFN_NOCHANGEDIR,
"Voice Files (*.ogg, *.wav)|*.ogg;*.wav|Ogg Vorbis Files (*.ogg)|*.ogg|Wave Files (*.wav)|*.wav||");
if (dlg.DoModal() == IDOK) {
m_wave_filename = dlg.GetFileName();
UpdateData(FALSE);
}
if (!z)
cfile_pop_dir();
}
BOOL cmd_brief_dlg::DestroyWindow()
{
audiostream_close_file(m_wave_id, 0);
m_wave_id = -1;
m_play_bm.DeleteObject();
return CDialog::DestroyWindow();
}
void cmd_brief_dlg::OnPlay()
{
GetDlgItem(IDC_WAVE_FILENAME)->GetWindowText(m_wave_filename);
if (m_wave_id >= 0) {
audiostream_close_file(m_wave_id, 0);
m_wave_id = -1;
return;
}
// we use ASF_EVENTMUSIC here so that it will keep the extension in place
m_wave_id = audiostream_open((char *)(LPCSTR) m_wave_filename, ASF_EVENTMUSIC);
if (m_wave_id >= 0) {
audiostream_play(m_wave_id, 1.0f, 0);
}
}
-111
View File
@@ -1,111 +0,0 @@
/*
* Copyright (C) Volition, Inc. 1999. All rights reserved.
*
* All source code herein is the property of Volition, Inc. You may not sell
* or otherwise commercially exploit the source or things you created based on the
* source.
*
*/
/*
* $Logfile: /Freespace2/code/FRED2/CmdBrief.h $
* $Revision: 1.1 $
* $Date: 2006-01-19 02:27:31 $
* $Author: Goober5000 $
*
* Command Briefing Editor
*
* $Log: not supported by cvs2svn $
* Revision 1.4 2005/07/13 02:40:50 Goober5000
* remove PreProcDefine #includes in FRED
* --Goober5000
*
* Revision 1.3 2004/09/29 17:26:32 Kazan
* PreProfDefines.h includes for fred2
*
* Revision 1.2 2002/08/15 01:06:34 penguin
* Include filename reorg (to coordinate w/ fs2_open)
*
* Revision 1.1.1.1 2002/07/15 03:10:53 inquisitor
* Initial FRED2 Checking
*
*
* 2 10/07/98 6:28p Dave
* Initial checkin. Renamed all relevant stuff to be Fred2 instead of
* Fred. Globalized mission and campaign file extensions. Removed Silent
* Threat specific code.
*
* 1 10/07/98 3:01p Dave
*
* 1 10/07/98 3:00p Dave
*
* 4 4/20/98 4:40p Hoffoss
* Added a button to 4 editors to play the chosen wave file.
*
* 3 3/19/98 4:24p Hoffoss
* Added remaining support for command brief screen (ANI and WAVE file
* playing).
*
* 2 3/05/98 3:59p Hoffoss
* Added a bunch of new command brief stuff, and asteroid initialization
* to Fred.
*
* $NoKeywords: $
*/
#include "missionui/missioncmdbrief.h"
/////////////////////////////////////////////////////////////////////////////
// cmd_brief_dlg dialog
class cmd_brief_dlg : public CDialog
{
// Construction
public:
cmd_brief_dlg(CWnd* pParent = NULL); // standard constructor
void update_data(int update = 1);
void OnOK();
// Dialog Data
//{{AFX_DATA(cmd_brief_dlg)
enum { IDD = IDD_CMD_BRIEF };
CString m_ani_filename;
CString m_text;
CString m_stage_title;
CString m_wave_filename;
//}}AFX_DATA
CBitmap m_play_bm;
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(cmd_brief_dlg)
public:
virtual BOOL DestroyWindow();
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
int m_cur_stage;
int m_last_stage;
int m_wave_id;
cmd_brief *last_cmd_brief;
void copy_stage(int from, int to);
// Generated message map functions
//{{AFX_MSG(cmd_brief_dlg)
virtual BOOL OnInitDialog();
afx_msg void OnNext();
afx_msg void OnPrev();
afx_msg void OnAddStage();
afx_msg void OnInsertStage();
afx_msg void OnDeleteStage();
afx_msg void OnBrowseAni();
afx_msg void OnBrowseWave();
afx_msg void OnPlay();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
-113
View File
@@ -1,113 +0,0 @@
/*
* Copyright (C) Volition, Inc. 1999. All rights reserved.
*
* All source code herein is the property of Volition, Inc. You may not sell
* or otherwise commercially exploit the source or things you created based on the
* source.
*
*/
// CreateWingDlg.cpp : implementation file
//
#include "stdafx.h"
#include "FRED.h"
#include "CreateWingDlg.h"
#include "object/object.h"
#include "object/waypoint.h"
#include "globalincs/linklist.h"
#include "parse/parselo.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// create_wing_dlg dialog
create_wing_dlg::create_wing_dlg(CWnd* pParent /*=NULL*/)
: CDialog(create_wing_dlg::IDD, pParent)
{
//{{AFX_DATA_INIT(create_wing_dlg)
m_name = _T("");
//}}AFX_DATA_INIT
}
void create_wing_dlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(create_wing_dlg)
DDX_Text(pDX, IDC_NAME, m_name);
//}}AFX_DATA_MAP
DDV_MaxChars(pDX, m_name, NAME_LENGTH - 4);
}
BEGIN_MESSAGE_MAP(create_wing_dlg, CDialog)
//{{AFX_MSG_MAP(create_wing_dlg)
// NOTE: the ClassWizard will add message map macros here
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// create_wing_dlg message handlers
void create_wing_dlg::OnOK()
{
char msg[512];
int i;
object *ptr;
UpdateData(TRUE);
UpdateData(TRUE);
m_name = drop_white_space((char *)(LPCSTR) m_name);
if (m_name.IsEmpty()) {
MessageBox("You must give a name before you can continue.");
return;
}
for (i=0; i<MAX_WINGS; i++)
if (!stricmp(Wings[i].name, m_name) && Wings[i].wave_count) {
sprintf(msg, "The name \"%s\" is already being used by another wing", m_name);
MessageBox(msg);
return;
}
ptr = GET_FIRST(&obj_used_list);
while (ptr != END_OF_LIST(&obj_used_list)) {
if (ptr->type == OBJ_SHIP) {
i = ptr->instance;
if (!strnicmp(m_name, Ships[i].ship_name, strlen(m_name))) {
char *namep;
namep = Ships[i].ship_name + strlen(m_name);
if (*namep == ' ') {
namep++;
while (*namep) {
if (!isdigit(*namep))
break;
namep++;
}
}
if (!*namep) {
MessageBox("This wing name is already being used by a ship");
return;
}
}
}
ptr = GET_NEXT(ptr);
}
for (i=0; i<MAX_WAYPOINT_LISTS; i++)
if (Waypoint_lists[i].count && !stricmp(Waypoint_lists[i].name, m_name)) {
MessageBox("This wing name is already being used by a waypoint path");
return;
}
CDialog::OnOK();
}
-45
View File
@@ -1,45 +0,0 @@
/*
* Copyright (C) Volition, Inc. 1999. All rights reserved.
*
* All source code herein is the property of Volition, Inc. You may not sell
* or otherwise commercially exploit the source or things you created based on the
* source.
*
*/
// CreateWingDlg.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// create_wing_dlg dialog
class create_wing_dlg : public CDialog
{
// Construction
public:
void OnOK();
create_wing_dlg(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(create_wing_dlg)
enum { IDD = IDD_WING_CREATE };
CString m_name;
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(create_wing_dlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(create_wing_dlg)
// NOTE: the ClassWizard will add member functions here
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
-173
View File
@@ -1,173 +0,0 @@
// CustomWingNames.cpp : implementation file
//
#include "stdafx.h"
#include "fred.h"
#include "CustomWingNames.h"
#include "ship/ship.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CustomWingNames dialog
CustomWingNames::CustomWingNames(CWnd* pParent /*=NULL*/)
: CDialog(CustomWingNames::IDD, pParent)
{
//{{AFX_DATA_INIT(CustomWingNames)
m_squadron_1 = _T("");
m_squadron_2 = _T("");
m_squadron_3 = _T("");
m_squadron_4 = _T("");
m_squadron_5 = _T("");
m_starting_1 = _T("");
m_starting_2 = _T("");
m_starting_3 = _T("");
m_tvt_1 = _T("");
m_tvt_2 = _T("");
//}}AFX_DATA_INIT
}
void CustomWingNames::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CustomWingNames)
DDX_Text(pDX, IDC_SQUADRON_WING_NAME_1, m_squadron_1);
DDX_Text(pDX, IDC_SQUADRON_WING_NAME_2, m_squadron_2);
DDX_Text(pDX, IDC_SQUADRON_WING_NAME_3, m_squadron_3);
DDX_Text(pDX, IDC_SQUADRON_WING_NAME_4, m_squadron_4);
DDX_Text(pDX, IDC_SQUADRON_WING_NAME_5, m_squadron_5);
DDX_Text(pDX, IDC_STARTING_WING_NAME_1, m_starting_1);
DDX_Text(pDX, IDC_STARTING_WING_NAME_2, m_starting_2);
DDX_Text(pDX, IDC_STARTING_WING_NAME_3, m_starting_3);
DDX_Text(pDX, IDC_TVT_WING_NAME_1, m_tvt_1);
DDX_Text(pDX, IDC_TVT_WING_NAME_2, m_tvt_2);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CustomWingNames, CDialog)
//{{AFX_MSG_MAP(CustomWingNames)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CustomWingNames message handlers
BOOL CustomWingNames::OnInitDialog()
{
// init starting wings
m_starting_1 = _T(Starting_wing_names[0]);
m_starting_2 = _T(Starting_wing_names[1]);
m_starting_3 = _T(Starting_wing_names[2]);
// init squadron wings
m_squadron_1 = _T(Squadron_wing_names[0]);
m_squadron_2 = _T(Squadron_wing_names[1]);
m_squadron_3 = _T(Squadron_wing_names[2]);
m_squadron_4 = _T(Squadron_wing_names[3]);
m_squadron_5 = _T(Squadron_wing_names[4]);
// init tvt wings
m_tvt_1 = _T(TVT_wing_names[0]);
m_tvt_2 = _T(TVT_wing_names[1]);
CDialog::OnInitDialog();
UpdateData(FALSE);
return TRUE;
}
void CustomWingNames::OnOK()
{
UpdateData(TRUE);
if (strcmp(m_starting_1, m_tvt_1))
{
MessageBox("The first starting wing and the first team-versus-team wing must have the same wing name.");
return;
}
if (!stricmp(m_starting_1, m_starting_2) || !stricmp(m_starting_1, m_starting_3)
|| !stricmp(m_starting_2, m_starting_3))
{
MessageBox("Duplicate wing names in starting wing list.");
return;
}
if (!stricmp(m_squadron_1, m_squadron_2) || !stricmp(m_squadron_1, m_squadron_3) || !stricmp(m_squadron_1, m_squadron_4) || !stricmp(m_squadron_1, m_squadron_5)
|| !stricmp(m_squadron_2, m_squadron_3) || !stricmp(m_squadron_2, m_squadron_4) || !stricmp(m_squadron_2, m_squadron_5)
|| !stricmp(m_squadron_3, m_squadron_4) || !stricmp(m_squadron_3, m_squadron_5)
|| !stricmp(m_squadron_4, m_squadron_5))
{
MessageBox("Duplicate wing names in squadron wing list.");
return;
}
if (!stricmp(m_tvt_1, m_tvt_2))
{
MessageBox("Duplicate wing names in team-versus-team wing list.");
return;
}
// copy starting wings
strcpy(Starting_wing_names[0], m_starting_1);
strcpy(Starting_wing_names[1], m_starting_2);
strcpy(Starting_wing_names[2], m_starting_3);
// copy squadron wings
strcpy(Squadron_wing_names[0], m_squadron_1);
strcpy(Squadron_wing_names[1], m_squadron_2);
strcpy(Squadron_wing_names[2], m_squadron_3);
strcpy(Squadron_wing_names[3], m_squadron_4);
strcpy(Squadron_wing_names[4], m_squadron_5);
// copy tvt wings
strcpy(TVT_wing_names[0], m_tvt_1);
strcpy(TVT_wing_names[1], m_tvt_2);
update_custom_wing_indexes();
CDialog::OnOK();
}
void CustomWingNames::OnCancel()
{
// TODO: Add extra cleanup here
CDialog::OnCancel();
}
void CustomWingNames::OnClose()
{
int z;
UpdateData(TRUE);
if (query_modified()) {
z = MessageBox("Do you want to keep your changes?", "Close", MB_ICONQUESTION | MB_YESNOCANCEL);
if (z == IDCANCEL){
return;
}
if (z == IDYES) {
OnOK();
return;
}
}
CDialog::OnClose();
}
int CustomWingNames::query_modified()
{
return strcmp(Starting_wing_names[0], m_starting_1) || strcmp(Starting_wing_names[1], m_starting_2) || strcmp(Starting_wing_names[2], m_starting_3)
|| strcmp(Squadron_wing_names[0], m_squadron_1) || strcmp(Squadron_wing_names[1], m_squadron_2) || strcmp(Squadron_wing_names[2], m_squadron_3) || strcmp(Squadron_wing_names[3], m_squadron_4) || strcmp(Squadron_wing_names[4], m_squadron_5)
|| strcmp(TVT_wing_names[0], m_tvt_1) || strcmp(TVT_wing_names[1], m_tvt_2);
}
-59
View File
@@ -1,59 +0,0 @@
#if !defined(AFX_USTOMWINGNAME_H__D30D7519_D2C9_4907_8D87_EDB690B30608__INCLUDED_)
#define AFX_USTOMWINGNAME_H__D30D7519_D2C9_4907_8D87_EDB690B30608__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// CustomWingNames.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// CustomWingNames dialog
class CustomWingNames : public CDialog
{
// Construction
public:
CustomWingNames(CWnd* pParent = NULL); // standard constructor
int query_modified();
void OnOK();
void OnCancel();
// Dialog Data
//{{AFX_DATA(CustomWingNames)
enum { IDD = IDD_CUSTOM_WING_NAMES };
CString m_squadron_1;
CString m_squadron_2;
CString m_squadron_3;
CString m_squadron_4;
CString m_squadron_5;
CString m_starting_1;
CString m_starting_2;
CString m_starting_3;
CString m_tvt_1;
CString m_tvt_2;
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CustomWingNames)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CustomWingNames)
virtual BOOL OnInitDialog();
afx_msg void OnClose();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_USTOMWINGNAME_H__D30D7519_D2C9_4907_8D87_EDB690B30608__INCLUDED_)
-565
View File
@@ -1,565 +0,0 @@
/*
* Copyright (C) Volition, Inc. 1999. All rights reserved.
*
* All source code herein is the property of Volition, Inc. You may not sell
* or otherwise commercially exploit the source or things you created based on the
* source.
*
*/
/*
* $Logfile: /Freespace2/code/FRED2/DebriefingEditorDlg.cpp $
* $Revision: 1.2.2.4 $
* $Date: 2007-04-08 08:28:20 $
* $Author: karajorma $
*
* Debriefing editor dialog. Used to edit mission debriefings of course.
*
* $Log: not supported by cvs2svn $
* Revision 1.2.2.3 2007/03/07 22:36:51 karajorma
* Make .ogg selectable in FRED.
*
* Revision 1.2.2.2 2006/09/20 04:53:53 taylor
* properly fix the new_recommendation_text FRED problem, plus some real cleanup for that code in general, and some memory leak fixes
*
* Revision 1.2.2.1 2006/09/14 23:29:03 taylor
* add default recommendation text for debriefing, it's either this or making sure that it's nul
*
* Revision 1.2 2006/01/26 04:01:58 Goober5000
* spelling
*
* Revision 1.1 2006/01/19 02:27:31 Goober5000
* import FRED2 back into fs2_open module
* --Goober5000
*
* Revision 1.4 2005/10/22 05:54:48 wmcoolmon
* Fixed cf_find_file_location
*
* Revision 1.3 2005/09/29 05:18:59 Goober5000
* the FRED stuff
* --Goober5000
*
* Revision 1.2 2002/08/15 01:06:34 penguin
* Include filename reorg (to coordinate w/ fs2_open)
*
* Revision 1.1.1.1 2002/07/15 03:10:53 inquisitor
* Initial FRED2 Checking
*
*
* 2 10/07/98 6:28p Dave
* Initial checkin. Renamed all relevant stuff to be Fred2 instead of
* Fred. Globalized mission and campaign file extensions. Removed Silent
* Threat specific code.
*
* 1 10/07/98 3:01p Dave
*
* 1 10/07/98 3:00p Dave
*
* 20 7/07/98 2:09p Hoffoss
* Fixed bug where sexp for debriefing stages get cleared when inserting
* or deleting stages.
*
* 19 4/30/98 8:23p John
* Fixed some bugs with Fred caused by my new cfile code.
*
* 18 4/22/98 9:56a Sandeep
*
* 17 4/20/98 4:40p Hoffoss
* Added a button to 4 editors to play the chosen wave file.
*
* 16 4/17/98 1:41p Allender
* took out function calls in NDEBUG mode
*
* 15 4/06/98 10:43a John
* Fixed bugs with inserting/deleting stages
*
* 14 4/03/98 12:39p Hoffoss
* Changed starting directory for browse buttons in several editors.
*
* 13 4/03/98 11:34a John
* Fixed the stuff I broke in Fred from the new briefing
*
* 12 3/17/98 2:06p Hoffoss
* Made enter key not close the dialog box (default windows behavior, even
* when no ok button. Talk about stupid. :)
*
* 11 2/09/98 9:25p Allender
* team v team support. multiple pools and briefings
*
* 10 2/04/98 4:32p Allender
* support for multiple briefings and debriefings. Changes to mission
* type (now a bitfield). Bitfield defs for multiplayer modes
*
* 9 1/02/98 3:29p Duncan
* Fixed bug with sexp tree freeing.
*
* 8 11/10/97 12:09p Johnson
* Fixed sexp free error in debriefing editor.
*
* 7 11/10/97 11:58a Johnson
* Added support to debriefing editor for "press cancel to go to reference
* of sexp".
*
* 6 10/28/97 6:07p Jasen
* Added some debugging code to detect sexp leaks. Looks there are some I
* will need to investigate more.
*
* 5 10/27/97 2:06p Hoffoss
* Fixed editor to allow correct character limit for recommendation text.
*
* 4 10/14/97 12:06p Hoffoss
* Recoded debriefing editor to utilize new format.
*
* 3 10/14/97 10:35a Hoffoss
* Hacked the hell out of this file to allow Fred to compile for now.
* Next step is to fix it all.
*
* 2 7/08/97 2:03p Hoffoss
* Debriefing editor coded and implemented.
*
* $NoKeywords: $
*/
#include "stdafx.h"
#include "FRED.h"
#include "DebriefingEditorDlg.h"
#include "FREDDoc.h"
#include "mission/missionbriefcommon.h"
#include "parse/sexp.h"
#include "cfile/cfile.h"
#include "sound/audiostr.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// debriefing_editor_dlg dialog
debriefing_editor_dlg::debriefing_editor_dlg(CWnd* pParent /*=NULL*/)
: CDialog(debriefing_editor_dlg::IDD, pParent)
{
//{{AFX_DATA_INIT(debriefing_editor_dlg)
m_text = _T("");
m_voice = _T("");
m_stage_title = _T("");
m_rec_text = _T("");
m_current_debriefing = -1;
//}}AFX_DATA_INIT
modified = 0;
m_cur_stage = 0;
m_last_stage = -1;
m_voice_id = -1;
select_sexp_node = -1;
}
void debriefing_editor_dlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(debriefing_editor_dlg)
DDX_Control(pDX, IDC_TREE, m_tree);
DDX_Text(pDX, IDC_TEXT, m_text);
DDX_Text(pDX, IDC_VOICE, m_voice);
DDX_Text(pDX, IDC_STAGE_TITLE, m_stage_title);
DDX_Text(pDX, IDC_REC_TEXT, m_rec_text);
//}}AFX_DATA_MAP
DDV_MaxChars(pDX, m_text, MAX_BRIEF_LEN - 1);
DDV_MaxChars(pDX, m_voice, MAX_FILENAME_LEN - 1);
DDV_MaxChars(pDX, m_rec_text, MAX_RECOMMENDATION_LEN - 1);
}
BEGIN_MESSAGE_MAP(debriefing_editor_dlg, CDialog)
//{{AFX_MSG_MAP(debriefing_editor_dlg)
ON_BN_CLICKED(IDC_NEXT, OnNext)
ON_BN_CLICKED(IDC_PREV, OnPrev)
ON_BN_CLICKED(IDC_BROWSE, OnBrowse)
ON_BN_CLICKED(IDC_ADD_STAGE, OnAddStage)
ON_BN_CLICKED(IDC_DELETE_STAGE, OnDeleteStage)
ON_BN_CLICKED(IDC_INSERT_STAGE, OnInsertStage)
ON_NOTIFY(NM_RCLICK, IDC_TREE, OnRclickTree)
ON_NOTIFY(TVN_BEGINLABELEDIT, IDC_TREE, OnBeginlabeleditTree)
ON_NOTIFY(TVN_ENDLABELEDIT, IDC_TREE, OnEndlabeleditTree)
ON_WM_CLOSE()
ON_WM_INITMENU()
ON_BN_CLICKED(IDC_PLAY, OnPlay)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// debriefing_editor_dlg message handlers
void debriefing_editor_dlg::OnInitMenu(CMenu* pMenu)
{
int i;
CMenu *m;
// disable any items we should disable
m = pMenu->GetSubMenu(0);
// uncheck all menu items
for (i = 0; i < Num_teams; i++ )
m->CheckMenuItem( i, MF_BYPOSITION | MF_UNCHECKED );
for ( i = Num_teams; i < MAX_TVT_TEAMS; i++ )
m->EnableMenuItem(i, MF_BYPOSITION | MF_GRAYED);
// put a check next to the currently selected item
m->CheckMenuItem(m_current_debriefing, MF_BYPOSITION | MF_CHECKED );
CDialog::OnInitMenu(pMenu);
}
BOOL debriefing_editor_dlg::OnInitDialog()
{
int i, n;
CDialog::OnInitDialog();
m_play_bm.LoadBitmap(IDB_PLAY);
((CButton *) GetDlgItem(IDC_PLAY)) -> SetBitmap(m_play_bm);
m_current_debriefing = 0;
UpdateData(FALSE);
Debriefing = &Debriefings[m_current_debriefing];
m_tree.link_modified(&modified); // provide way to indicate trees are modified in dialog
n = m_tree.select_sexp_node = select_sexp_node;
select_sexp_node = -1;
if (n != -1) {
for (i=0; i<Debriefing->num_stages; i++)
if (query_node_in_sexp(n, Debriefing->stages[i].formula))
break;
if (i < Debriefing->num_stages) {
m_cur_stage = i;
update_data();
GetDlgItem(IDC_TREE) -> SetFocus();
m_tree.hilite_item(m_tree.select_sexp_node);
set_modified();
return FALSE;
}
}
update_data();
set_modified();
// hard coded stuff to deal with the multiple briefings per mission.
return TRUE;
}
void debriefing_editor_dlg::update_data(int update)
{
int enable, save_debriefing;
debrief_stage *ptr;
save_debriefing = m_current_debriefing;
if (update)
UpdateData(TRUE);
// based on the game type, enable the multiple briefings combo box (or disable it)
// set up the pointer to the briefing that we are editing
if ( save_debriefing != m_current_debriefing )
Debriefing = &Debriefings[save_debriefing];
else
Debriefing = &Debriefings[m_current_debriefing];
if (m_last_stage >= 0) {
ptr = &Debriefing->stages[m_last_stage];
if (ptr->formula >= 0)
free_sexp2(ptr->formula);
ptr->formula = m_tree.save_tree();
deconvert_multiline_string(ptr->new_text, m_text, MAX_DEBRIEF_LEN);
deconvert_multiline_string(ptr->new_recommendation_text, m_rec_text, MAX_RECOMMENDATION_LEN);
string_copy(ptr->voice, m_voice, MAX_FILENAME_LEN);
}
// now get new stage data
if ((m_cur_stage >= 0) && (m_cur_stage < Debriefing->num_stages)) {
ptr = &Debriefing->stages[m_cur_stage];
m_stage_title.Format("Stage %d of %d", m_cur_stage + 1, Debriefing->num_stages);
m_tree.load_tree(ptr->formula);
m_text = convert_multiline_string(ptr->new_text);
m_rec_text = convert_multiline_string(ptr->new_recommendation_text);
m_voice = ptr->voice;
enable = TRUE;
} else {
m_stage_title = _T("No stages");
m_tree.clear_tree();
m_text = _T("");
m_rec_text = _T("");
m_voice = _T("");
enable = FALSE;
m_cur_stage = -1;
}
if (m_cur_stage == Debriefing->num_stages - 1)
GetDlgItem(IDC_NEXT) -> EnableWindow(FALSE);
else
GetDlgItem(IDC_NEXT) -> EnableWindow(enable);
if (m_cur_stage)
GetDlgItem(IDC_PREV) -> EnableWindow(enable);
else
GetDlgItem(IDC_PREV) -> EnableWindow(FALSE);
if (Debriefing->num_stages >= MAX_DEBRIEF_STAGES)
GetDlgItem(IDC_ADD_STAGE) -> EnableWindow(FALSE);
else
GetDlgItem(IDC_ADD_STAGE) -> EnableWindow(TRUE);
if (Debriefing->num_stages) {
GetDlgItem(IDC_DELETE_STAGE) -> EnableWindow(enable);
GetDlgItem(IDC_INSERT_STAGE) -> EnableWindow(enable);
} else {
GetDlgItem(IDC_DELETE_STAGE) -> EnableWindow(FALSE);
GetDlgItem(IDC_INSERT_STAGE) -> EnableWindow(FALSE);
}
GetDlgItem(IDC_VOICE) -> EnableWindow(enable);
GetDlgItem(IDC_BROWSE) -> EnableWindow(enable);
GetDlgItem(IDC_TEXT) -> EnableWindow(enable);
GetDlgItem(IDC_REC_TEXT) -> EnableWindow(enable);
GetDlgItem(IDC_TREE) -> EnableWindow(enable);
m_last_stage = m_cur_stage;
UpdateData(FALSE);
#ifndef NDEBUG
count_free_sexp_nodes();
#endif
}
void debriefing_editor_dlg::OnNext()
{
audiostream_close_file(m_voice_id, 0);
m_voice_id = -1;
m_cur_stage++;
update_data();
}
void debriefing_editor_dlg::OnPrev()
{
audiostream_close_file(m_voice_id, 0);
m_voice_id = -1;
m_cur_stage--;
update_data();
}
void debriefing_editor_dlg::OnBrowse()
{
int z;
CString name;
audiostream_close_file(m_voice_id, 0);
m_voice_id = -1;
UpdateData(TRUE);
if (The_mission.game_type & MISSION_TYPE_TRAINING)
z = cfile_push_chdir(CF_TYPE_VOICE_TRAINING);
else
z = cfile_push_chdir(CF_TYPE_VOICE_DEBRIEFINGS);
CFileDialog dlg(TRUE, "wav", NULL, OFN_HIDEREADONLY | OFN_FILEMUSTEXIST | OFN_NOCHANGEDIR,
"Voice Files (*.ogg, *.wav)|*.ogg;*.wav|Ogg Vorbis Files (*.ogg)|*.ogg|Wave Files (*.wav)|*.wav||");
if (dlg.DoModal() == IDOK) {
m_voice = dlg.GetFileName();
UpdateData(FALSE);
}
if (!z)
cfile_pop_dir();
}
void debriefing_editor_dlg::OnAddStage()
{
int i;
if (Debriefing->num_stages >= MAX_DEBRIEF_STAGES)
return;
audiostream_close_file(m_voice_id, 0);
m_voice_id = -1;
m_cur_stage = i = Debriefing->num_stages++;
copy_stage(i - 1, i, 1);
update_data(1);
}
void debriefing_editor_dlg::OnDeleteStage()
{
int i, z;
if (m_cur_stage < 0)
return;
audiostream_close_file(m_voice_id, 0);
m_voice_id = -1;
Assert(Debriefing->num_stages);
z = m_cur_stage;
m_cur_stage = -1;
update_data(1);
for (i=z+1; i<Debriefing->num_stages; i++) {
copy_stage(i, i - 1);
}
Debriefing->num_stages--;
m_cur_stage = z;
if (m_cur_stage >= Debriefing->num_stages)
m_cur_stage = Debriefing->num_stages - 1;
update_data(0);
}
void debriefing_editor_dlg::OnInsertStage()
{
int i, z;
if (Debriefing->num_stages >= MAX_DEBRIEF_STAGES)
return;
if (!Debriefing->num_stages) {
OnAddStage();
return;
}
audiostream_close_file(m_voice_id, 0);
m_voice_id = -1;
z = m_cur_stage;
m_cur_stage = -1;
update_data(1);
for (i=Debriefing->num_stages; i>z; i--) {
copy_stage(i - 1, i);
}
Debriefing->num_stages++;
copy_stage(z, z + 1);
Debriefing->stages[z].formula = -1;
m_cur_stage = z;
update_data(0);
}
void debriefing_editor_dlg::copy_stage(int from, int to, int clear_formula)
{
if ((from < 0) || (from >= Debriefing->num_stages)) {
strcpy(Debriefing->stages[to].new_text, "<Text here>");
strcpy(Debriefing->stages[to].voice, "none.wav");
Debriefing->stages[to].formula = -1;
return;
}
if (clear_formula)
Debriefing->stages[to].formula = -1;
else
Debriefing->stages[to].formula = Debriefing->stages[from].formula;
strcpy( Debriefing->stages[to].new_text, Debriefing->stages[from].new_text );
strcpy( Debriefing->stages[to].voice, Debriefing->stages[from].voice );
strcpy( Debriefing->stages[to].new_recommendation_text, Debriefing->stages[from].new_recommendation_text );
}
void debriefing_editor_dlg::OnRclickTree(NMHDR* pNMHDR, LRESULT* pResult)
{
m_tree.right_clicked();
*pResult = 0;
}
void debriefing_editor_dlg::OnBeginlabeleditTree(NMHDR* pNMHDR, LRESULT* pResult)
{
TV_DISPINFO* pTVDispInfo = (TV_DISPINFO*)pNMHDR;
if (m_tree.edit_label(pTVDispInfo->item.hItem) == 1) {
*pResult = 0;
modified = 1;
} else
*pResult = 1;
}
void debriefing_editor_dlg::OnEndlabeleditTree(NMHDR* pNMHDR, LRESULT* pResult)
{
TV_DISPINFO* pTVDispInfo = (TV_DISPINFO*)pNMHDR;
*pResult = m_tree.end_label_edit(pTVDispInfo->item.hItem, pTVDispInfo->item.pszText);
}
void debriefing_editor_dlg::OnClose()
{
audiostream_close_file(m_voice_id, 0);
m_voice_id = -1;
m_cur_stage = -1;
update_data(1);
CDialog::OnClose();
}
void debriefing_editor_dlg::OnOK()
{
}
BOOL debriefing_editor_dlg::OnCommand(WPARAM wParam, LPARAM lParam)
{
int id;
// deal with figuring out menu stuff
id = LOWORD(wParam);
if ( (id >= ID_TEAM_1) && (id < ID_TEAM_3) ) {
update_data(1);
// set the current debriefing
m_current_debriefing = id - ID_TEAM_1;
// put user back at first stage for this team (or no current stage is there are none).
Debriefing = &Debriefings[m_current_debriefing];
if ( Debriefing->num_stages > 0 )
m_cur_stage = 0;
else
m_cur_stage = -1;
m_last_stage = -1;
update_data(0);
}
return CDialog::OnCommand(wParam, lParam);
}
BOOL debriefing_editor_dlg::DestroyWindow()
{
audiostream_close_file(m_voice_id, 0);
m_play_bm.DeleteObject();
return CDialog::DestroyWindow();
}
void debriefing_editor_dlg::OnPlay()
{
GetDlgItem(IDC_VOICE)->GetWindowText(m_voice);
if (m_voice_id >= 0) {
audiostream_close_file(m_voice_id, 0);
m_voice_id = -1;
return;
}
// we use ASF_EVENTMUSIC here so that it will keep the extension in place
m_voice_id = audiostream_open((char *)(LPCSTR) m_voice, ASF_EVENTMUSIC);
if (m_voice_id >= 0) {
audiostream_play(m_voice_id, 1.0f, 0);
}
}
-134
View File
@@ -1,134 +0,0 @@
/*
* Copyright (C) Volition, Inc. 1999. All rights reserved.
*
* All source code herein is the property of Volition, Inc. You may not sell
* or otherwise commercially exploit the source or things you created based on the
* source.
*
*/
/*
* $Logfile: /Freespace2/code/FRED2/DebriefingEditorDlg.h $
* $Revision: 1.2 $
* $Date: 2006-01-26 04:01:58 $
* $Author: Goober5000 $
*
* Debriefing editor dialog. Used to edit mission debriefings of course.
*
* $Log: not supported by cvs2svn $
* Revision 1.1 2006/01/19 02:27:31 Goober5000
* import FRED2 back into fs2_open module
* --Goober5000
*
* Revision 1.3 2005/07/13 02:40:50 Goober5000
* remove PreProcDefine #includes in FRED
* --Goober5000
*
* Revision 1.2 2004/09/29 17:26:32 Kazan
* PreProfDefines.h includes for fred2
*
* Revision 1.1.1.1 2002/07/15 03:10:53 inquisitor
* Initial FRED2 Checking
*
*
* 2 10/07/98 6:28p Dave
* Initial checkin. Renamed all relevant stuff to be Fred2 instead of
* Fred. Globalized mission and campaign file extensions. Removed Silent
* Threat specific code.
*
* 1 10/07/98 3:01p Dave
*
* 1 10/07/98 3:00p Dave
*
* 9 7/07/98 2:11p Hoffoss
*
* 8 4/20/98 4:40p Hoffoss
* Added a button to 4 editors to play the chosen wave file.
*
* 7 3/17/98 2:06p Hoffoss
* Made enter key not close the dialog box (default windows behavior, even
* when no ok button. Talk about stupid. :)
*
* 6 2/09/98 9:25p Allender
* team v team support. multiple pools and briefings
*
* 5 2/04/98 4:32p Allender
* support for multiple briefings and debriefings. Changes to mission
* type (now a bitfield). Bitfield defs for multiplayer modes
*
* 4 11/10/97 11:58a Johnson
* Added support to debriefing editor for "press cancel to go to reference
* of sexp".
*
* 3 10/14/97 12:06p Hoffoss
* Recoded debriefing editor to utilize new format.
*
* 2 7/08/97 2:03p Hoffoss
* Debriefing editor coded and implemented.
*
* $NoKeywords: $
*/
/////////////////////////////////////////////////////////////////////////////
// debriefing_editor_dlg dialog
class debriefing_editor_dlg : public CDialog
{
// Construction
public:
void OnOK();
void update_data(int update = 1);
debriefing_editor_dlg(CWnd* pParent = NULL); // standard constructor
int select_sexp_node;
// Dialog Data
//{{AFX_DATA(debriefing_editor_dlg)
enum { IDD = IDD_DEBRIEFING_EDITOR };
sexp_tree m_tree;
CString m_text;
CString m_voice;
CString m_stage_title;
CString m_rec_text;
int m_current_debriefing;
//}}AFX_DATA
CBitmap m_play_bm;
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(debriefing_editor_dlg)
public:
virtual BOOL DestroyWindow();
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
virtual BOOL OnCommand(WPARAM wParam, LPARAM lParam);
//}}AFX_VIRTUAL
// Implementation
protected:
int m_cur_stage;
int m_last_stage;
int m_voice_id;
int modified;
void copy_stage(int from, int to, int clear_formula = 0);
// Generated message map functions
//{{AFX_MSG(debriefing_editor_dlg)
afx_msg void OnNext();
afx_msg void OnPrev();
afx_msg void OnBrowse();
afx_msg void OnAddStage();
afx_msg void OnDeleteStage();
afx_msg void OnInsertStage();
virtual BOOL OnInitDialog();
afx_msg void OnRclickTree(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnBeginlabeleditTree(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnEndlabeleditTree(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnClose();
afx_msg void OnInitMenu(CMenu* pMenu);
afx_msg void OnPlay();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
private:
};
-78
View File
@@ -1,78 +0,0 @@
/*
* Copyright (C) Volition, Inc. 1999. All rights reserved.
*
* All source code herein is the property of Volition, Inc. You may not sell
* or otherwise commercially exploit the source or things you created based on the
* source.
*
*/
/*
* $Logfile: /Freespace2/code/FRED2/dialog1.cpp $
* $Revision: 1.1 $
* $Date: 2006-01-19 02:27:31 $
* $Author: Goober5000 $
*
* key usage summary screen (actually a dialog box, but it's not very interactive)
*
* $Log: not supported by cvs2svn $
* Revision 1.2 2002/08/15 01:06:34 penguin
* Include filename reorg (to coordinate w/ fs2_open)
*
* Revision 1.1.1.1 2002/07/15 03:10:53 inquisitor
* Initial FRED2 Checking
*
*
* 2 10/07/98 6:28p Dave
* Initial checkin. Renamed all relevant stuff to be Fred2 instead of
* Fred. Globalized mission and campaign file extensions. Removed Silent
* Threat specific code.
*
* 1 10/07/98 3:01p Dave
*
* 1 10/07/98 3:00p Dave
*
* 2 2/17/97 5:28p Hoffoss
* Checked RCS headers, added them were missing, changing description to
* something better, etc where needed.
*
* $NoKeywords: $
*/
#include "stdafx.h"
#include "FRED.h"
#include "dialog1.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// dialog1 dialog
dialog1::dialog1(CWnd* pParent /*=NULL*/)
: CDialog(dialog1::IDD, pParent)
{
//{{AFX_DATA_INIT(dialog1)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
void dialog1::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(dialog1)
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(dialog1, CDialog)
//{{AFX_MSG_MAP(dialog1)
// NOTE: the ClassWizard will add message map macros here
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// dialog1 message handlers
-77
View File
@@ -1,77 +0,0 @@
/*
* Copyright (C) Volition, Inc. 1999. All rights reserved.
*
* All source code herein is the property of Volition, Inc. You may not sell
* or otherwise commercially exploit the source or things you created based on the
* source.
*
*/
/*
* $Logfile: /Freespace2/code/FRED2/dialog1.h $
* $Revision: 1.1 $
* $Date: 2006-01-19 02:27:31 $
* $Author: Goober5000 $
*
* key usage summary screen (actually a dialog box, but it's not very interactive)
*
* $Log: not supported by cvs2svn $
* Revision 1.3 2005/07/13 02:40:50 Goober5000
* remove PreProcDefine #includes in FRED
* --Goober5000
*
* Revision 1.2 2004/09/29 17:26:33 Kazan
* PreProfDefines.h includes for fred2
*
* Revision 1.1.1.1 2002/07/15 03:10:53 inquisitor
* Initial FRED2 Checking
*
*
* 2 10/07/98 6:28p Dave
* Initial checkin. Renamed all relevant stuff to be Fred2 instead of
* Fred. Globalized mission and campaign file extensions. Removed Silent
* Threat specific code.
*
* 1 10/07/98 3:01p Dave
*
* 1 10/07/98 3:00p Dave
*
* 2 2/17/97 5:28p Hoffoss
* Checked RCS headers, added them were missing, changing description to
* something better, etc where needed.
*
* $NoKeywords: $
*/
/////////////////////////////////////////////////////////////////////////////
// dialog1 dialog
class dialog1 : public CDialog
{
// Construction
public:
dialog1(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(dialog1)
enum { IDD = IDD_HELP_INPUT_INTERFACE };
// NOTE: the ClassWizard will add data members here
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(dialog1)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(dialog1)
// NOTE: the ClassWizard will add member functions here
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
-881
View File
@@ -1,881 +0,0 @@
/*
* Copyright (C) Volition, Inc. 1999. All rights reserved.
*
* All source code herein is the property of Volition, Inc. You may not sell
* or otherwise commercially exploit the source or things you created based on the
* source.
*
*/
// DumpStats.cpp : implementation file
//
#include "stdafx.h"
#include "FRED.h"
#include "DumpStats.h"
#include "starfield/starfield.h"
#include "nebula/neb.h"
#include "cfile/cfile.h"
#include "globalincs/linklist.h"
#include "object/object.h"
#include "object/waypoint.h"
#include "jumpnode/jumpnode.h"
#include "mission/missiongoals.h"
#include "gamesnd/eventmusic.h"
#include "asteroid/asteroid.h"
#include "species_defs/species_defs.h"
#include "weapon/weapon.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// DumpStats dialog
DumpStats::DumpStats(CWnd* pParent /*=NULL*/)
: CDialog(DumpStats::IDD, pParent)
{
//{{AFX_DATA_INIT(DumpStats)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
void DumpStats::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(DumpStats)
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(DumpStats, CDialog)
//{{AFX_MSG_MAP(DumpStats)
ON_BN_CLICKED(IDC_DUMP_TO_FILE, OnDumpToFile)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// DumpStats message handlers
BOOL DumpStats::OnInitDialog()
{
CDialog::OnInitDialog();
CString buffer;
int i;
// get author, title, etc
get_mission_stats(buffer);
// get nebula, stars, etc.
get_background_stats(buffer);
// get number or ships, waypoints, start points, etc.
get_object_stats(buffer);
// get objectives / goals
get_objectives_and_goals(buffer);
// get ship selection for player wings
get_ship_weapon_selection(buffer);
// get messaging info
get_messaging_info(buffer);
// get species ship breakdown
get_species_ship_breakdown(buffer);
// get default loadouts
get_default_ship_loadouts(buffer);
int num_tab_stops = 5;
int tab_stops[5];
for (i=0; i<5; i++) {
tab_stops[i] = (i+1) * 16;
}
((CEdit*) GetDlgItem(IDC_STATS_TEXT))->SetTabStops(num_tab_stops, tab_stops);
((CEdit*) GetDlgItem(IDC_STATS_TEXT))->SetWindowText(buffer);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void DumpStats::OnDumpToFile()
{
// TODO: Add your control notification handler code here
// get dump from window
CString buffer;
((CEdit*) GetDlgItem(IDC_STATS_TEXT))->GetWindowText(buffer);
CString dump_filename;
dump_filename.Format("%s.dmp", Mission_filename);
CFILE *fp;
fp = cfopen((char *)LPCTSTR(dump_filename), "wt", CFILE_NORMAL, CF_TYPE_MISSIONS);
cfputs((char *)LPCTSTR(buffer), fp);
cfclose(fp);
}
void DumpStats::get_mission_stats(CString &buffer)
{
CString temp;
// Mission info
buffer += "\t MISSION INFO\r\n";
temp.Format("Title: %s\r\n", The_mission.name);
buffer += temp;
temp.Format("Filename: %s\r\n", Mission_filename);
buffer += temp;
temp.Format("Author: %s\r\n", The_mission.author);
buffer += temp;
temp.Format("Description: %s\r\n", The_mission.mission_desc);
buffer += temp;
temp.Format("Notes: %s\r\n", The_mission.notes);
buffer += temp;
if (The_mission.game_type & MISSION_TYPE_SINGLE) {
temp.Format("Mission type: Single Player\r\n");
} else if (The_mission.game_type & MISSION_TYPE_MULTI_COOP) {
temp.Format("Mission type: Multi Coop\r\n");
} else if (The_mission.game_type & MISSION_TYPE_MULTI_TEAMS) {
temp.Format("Mission type: Multi Team vs. Team\r\n");
} else if (The_mission.game_type & MISSION_TYPE_MULTI_DOGFIGHT) {
temp.Format("Mission type: Dogfight\r\n");
}
buffer += temp;
if (The_mission.game_type & MISSION_TYPE_MULTI) {
temp.Format("\tNum respawns: %d\r\n", The_mission.num_respawns);
buffer += temp;
}
if (Current_soundtrack_num >= 0) {
temp.Format("\tMusic: %s\r\n", Soundtracks[Current_soundtrack_num].name);
buffer += temp;
}
if (The_mission.flags & MISSION_FLAG_RED_ALERT) {
buffer += "\tRed Alert\r\n";
}
if (The_mission.flags & MISSION_FLAG_SCRAMBLE) {
buffer += "\tScramble\r\n";
}
if (The_mission.flags & MISSION_FLAG_NO_PROMOTION) {
buffer += "\tNo Promotions\r\n";
}
if (The_mission.support_ships.max_support_ships == 0) {
buffer += "\tNo Support ships\r\n";
}
temp.Format("Squadron: %s, Squadron logo: %s\r\n", The_mission.squad_name, The_mission.squad_filename);
buffer += temp;
}
void DumpStats::get_background_stats(CString &buffer)
{
CString temp;
int i;
// Background
buffer += "\r\n\tBACKGROUND INFO\r\n";
// Num stars
temp.Format("Num_stars: %d\r\n", Num_stars);
buffer += temp;
// Suns
temp.Format("Num_suns: %d\r\n", stars_get_num_suns());
buffer += temp;
for (i=0; i<stars_get_num_suns(); i++) {
temp.Format("\tSun%d bitmap name: %s\r\n", i, stars_get_sun_name(i));
buffer += temp;
//temp.Format("Sun%d glow name: %s\r\n", i, Suns[i].glow_filename);
//buffer += temp;
}
// Starfield bitmaps
temp.Format("Num_starfield_bitmaps: %d\r\n", stars_get_num_bitmaps());
buffer += temp;
for (i=0; i<stars_get_num_bitmaps(); i++) {
temp.Format("\tStarfield%d bitmap name: %s\r\n", i, stars_get_bitmap_name(i));
buffer += temp;
}
// Asteroids
temp.Format("Num Field Debris Chunks: %d\r\n", Asteroid_field.num_initial_asteroids);
buffer += temp;
if (Asteroid_field.num_initial_asteroids > 0) {
// active or passive
if (Asteroid_field.field_type == FT_ACTIVE) {
temp.Format("\tActive Field\r\n");
buffer += temp;
temp.Format("\tAsteroid Debris\r\n");
buffer += temp;
} else {
// passive
temp.Format("\tPassive Field\r\n");
buffer += temp;
if (Asteroid_field.debris_genre == DG_ASTEROID) {
temp.Format("\tAsteroid Debris\r\n");
buffer += temp;
} else {
temp.Format("\tShip Debris\r\n");
buffer += temp;
// species
temp.Format("\t\tSpecies: ");
for (i=0; i<(int)Species_info.size(); i++) {
if (Asteroid_field.field_debris_type[i] >= 0) {
temp += CString(Species_info[(Asteroid_field.field_debris_type[i] / NUM_DEBRIS_SIZES) - 1].species_name) + " ";
}
}
temp += "\r\n";
buffer += temp;
}
}
}
// Nebula mission
int nebula_mission = (The_mission.flags & MISSION_FLAG_FULLNEB);
temp = "Nebula mission:";
if (nebula_mission) {
temp += " Yes\r\n";
} else {
temp += " No\r\n";
}
buffer += temp;
if (nebula_mission) {
// range
temp.Format("\tNebula awacs range: %.0f\r\n", Neb2_awacs);
buffer += temp;
// list of poofs
for (i=0; i<MAX_NEB2_POOFS; i++) {
if ( Neb2_poof_flags & (1<<i) ) {
temp.Format("\tNebula poof: %s\r\n", Neb2_poof_filenames[i]);
buffer += temp;
}
}
// nebula texture
if (strlen(Neb2_texture_name) > 0) {
temp.Format("\tNebula texture: %s\r\n", Neb2_texture_name);
buffer += temp;
}
} else {
// FS! nebula pattern
if (Nebula_index > 0) {
temp.Format("\tOld style FS1 nebula filename: %s\r\n", Nebula_filenames[Nebula_index]);
buffer += temp;
}
}
// Subspace mission
temp = "Subspace mission:";
if (The_mission.flags & MISSION_FLAG_SUBSPACE) {
temp += " Yes\r\n";
} else {
temp += " No\r\n";
}
buffer += temp;
}
void DumpStats::get_object_stats(CString &buffer)
{
object *objp;
int obj_type_count[MAX_OBJECT_TYPES];
CString temp;
int num_small_ships, num_big_ships, num_huge_ships;
int i;
memset(obj_type_count,0, sizeof(obj_type_count));
num_small_ships = num_big_ships = num_huge_ships= 0;
for ( objp = GET_FIRST(&obj_used_list); objp != END_OF_LIST(&obj_used_list); objp = GET_NEXT(objp) ) {
// inc big ship or small ship count
if ( (objp->type == OBJ_SHIP) || (objp->type == OBJ_START) ) {
if ( Ship_info[Ships[objp->instance].ship_info_index].flags & SIF_SMALL_SHIP ) {
num_small_ships++;
} else if ( Ship_info[Ships[objp->instance].ship_info_index].flags & SIF_BIG_SHIP ) {
num_big_ships++;
} else if ( Ship_info[Ships[objp->instance].ship_info_index].flags & SIF_HUGE_SHIP ) {
num_huge_ships++;
}
}
obj_type_count[objp->type]++;
}
// Statistics
buffer += "\r\n\tMISSION STATISTICS\r\n";
// OBJ_START is also a OBJ_SHIP
// not counting num_waves (for wings)
obj_type_count[OBJ_SHIP] += obj_type_count[OBJ_START];
for (i=0; i<MAX_OBJECT_TYPES; i++) {
if (obj_type_count[i] > 0) {
switch(i) {
case OBJ_SHIP:
temp.Format("Ship Count: %d\r\n", obj_type_count[i]);
buffer += temp;
break;
case OBJ_START:
temp.Format("Start Count: %d\r\n", obj_type_count[i]);
buffer += temp;
break;
case OBJ_WAYPOINT:
temp.Format("Waypoint Count: %d\r\n", obj_type_count[i]);
buffer += temp;
break;
case OBJ_WING:
temp.Format("Wing Count: %d\r\n", obj_type_count[i]);
buffer += temp;
break;
case OBJ_JUMP_NODE:
temp.Format("Jump Node Count: %d\r\n", obj_type_count[i]);
buffer += temp;
break;
default:
Int3();
break;
}
}
}
buffer += "\r\nSHIPS\r\n";
temp.Format("\tNum small ships: %d\r\n", num_small_ships);
buffer += temp;
temp.Format("\tNum big ships: %d\r\n", num_big_ships);
buffer += temp;
temp.Format("\tNum huge ships: %d\r\n", num_huge_ships);
buffer += temp;
// Waypoints
int total_waypoints = 0;
buffer += "\r\nWAYPOINTS\r\n";
for (i=0; i<Num_waypoint_lists; i++) {
temp.Format("\tWaypoint: %s, count: %d\r\n", Waypoint_lists[i].name, Waypoint_lists[i].count);
buffer += temp;
total_waypoints += Waypoint_lists[i].count;
}
if (total_waypoints > 0) {
temp.Format("\ttotal_waypoints: %d\r\n", total_waypoints);
buffer += temp;
}
// Jumpnodes
buffer += "\r\nJUMPNODES\r\n";
for ( jump_node *jnp = (jump_node *)Jump_nodes.get_first(); !Jump_nodes.is_end(jnp); jnp = (jump_node *)jnp->get_next() ) {
temp.Format("\tJumpnode: %s\r\n", jnp->get_name_ptr());
buffer += temp;
}
if (Jump_nodes.get_num_elements() > 0) {
temp.Format("\ttotal_jumpnodes: %d\r\n", Jump_nodes.get_num_elements());
buffer += temp;
}
// Wings
int num_counted_wings = 0;
buffer += "\r\nWINGS\r\n";
for (i=0; i<MAX_WINGS; i++) {
if (Wings[i].wave_count > 0) {
temp.Format("\tWing Name: %s, wave_count: %d, num_waves: %d\r\n", Wings[i].name, Wings[i].wave_count, Wings[i].num_waves);
buffer += temp;
num_counted_wings++;
if (num_counted_wings == Num_wings) {
break;
}
}
}
// Escort
buffer += "\r\nESCORT\r\n";
for ( objp = GET_FIRST(&obj_used_list); objp != END_OF_LIST(&obj_used_list); objp = GET_NEXT(objp) ) {
if ( (objp->type == OBJ_SHIP) || (objp->type == OBJ_START) ) {
if (Ships[objp->instance].flags & SF_ESCORT) {
temp.Format("\tShip name: %s, priority: %d\r\n", Ships[objp->instance].ship_name, Ships[objp->instance].escort_priority);
buffer += temp;
}
}
}
// Hotkeys
buffer += "\r\nHOTKEYS\r\n";
// ship hotkeys
for ( objp = GET_FIRST(&obj_used_list); objp != END_OF_LIST(&obj_used_list); objp = GET_NEXT(objp) ) {
if ( (objp->type == OBJ_SHIP) || (objp->type == OBJ_START) ) {
if (Ships[objp->instance].hotkey != -1) {
temp.Format("\tShip name: %s, hotkey: F%d\r\n", Ships[objp->instance].ship_name, (Ships[objp->instance].hotkey + 5));
buffer += temp;
}
}
}
// wing hotkeys
for (i=0; i<MAX_WINGS; i++) {
if (Wings[i].wave_count > 0) {
if (Wings[i].hotkey != -1) {
temp.Format("\tWing name: %s, hotkey: F%d\r\n", Wings[i].name, (Wings[i].hotkey + 5));
buffer += temp;
}
}
}
}
void DumpStats::get_objectives_and_goals(CString &buffer)
{
CString temp;
int i;
buffer += "\r\nOBJECTIVES AND GOALS\r\n";
// objectives
for (i=0; i<Num_mission_events; i++) {
// name, objective_text, objective_key_text
if ( Mission_events[i].objective_text == NULL ) {
continue;
}
temp.Format("\tObjective: %s, text: %s, key_text: %s\r\n", Mission_events[i].name, Mission_events[i].objective_text, Mission_events[i].objective_key_text);
buffer += temp;
}
buffer += "\r\n";
// goals
for (i=0; i<Num_goals; i++) {
temp.Format("\tGoal: %s, text: ", Mission_goals[i].name, Mission_goals[i].message);
buffer += temp;
switch(Mission_goals[i].type & GOAL_TYPE_MASK) {
case PRIMARY_GOAL:
buffer += ", type: primary\r\n";
break;
case SECONDARY_GOAL:
buffer += ", type: secondary\r\n";
break;
case BONUS_GOAL:
buffer += ", type: bonus\r\n";
break;
default:
Int3();
break;
}
}
}
void DumpStats::get_ship_weapon_selection(CString &buffer)
{
CString temp;
int i,j;
buffer += "\r\nSHIP WEAPON/SELECTION\r\n";
buffer += "Reported numbers are in addition to assigned ships and their default weapons\r\n";
for (i=0; i<Num_teams; i++) {
temp.Format("Team %d\r\n", i);
buffer += temp;
// ships
for (j=0; j<Team_data[i].number_choices; j++) {
temp.Format("\tShip name: %s, count %d", Ship_info[Ships[Team_data[i].ship_list[j]].ship_info_index].name, Team_data[i].ship_count[j]);
buffer += temp;
if (Team_data[i].ship_list[j] == Team_data[i].default_ship) {
temp = " DEFAULT SHIP\r\n";
} else {
temp = "\r\n";
}
buffer += temp;
}
buffer += "\r\n";
// weapons
for (j=0; j<MAX_WEAPON_TYPES; j++) {
if (Team_data[i].weaponry_pool[j] > 0) {
temp.Format("\tWeapon name: %s, count %d\r\n", Weapon_info[j].name, Team_data[i].weaponry_pool[j]);
buffer += temp;
}
}
}
}
void DumpStats::get_messaging_info(CString &buffer)
{
CString temp;
object *objp;
ship *shipp;
buffer += "\r\nSHIP ACCEPTED ORDERS\r\n";
// go through all ships and check (.orders_accepted against default_orders)
for ( objp = GET_FIRST(&obj_used_list); objp != END_OF_LIST(&obj_used_list); objp = GET_NEXT(objp) ) {
if (objp->type == OBJ_START || objp->type == OBJ_SHIP) {
shipp = &Ships[objp->instance];
if (shipp->orders_accepted != ship_get_default_orders_accepted(&Ship_info[shipp->ship_info_index])) {
temp.Format("\tShip: %s with nonstandard accepted orders\r\n", shipp->ship_name);
buffer += temp;
}
}
}
}
void DumpStats::get_species_ship_breakdown(CString &buffer)
{
CString temp;
int i;
uint species;
object *objp;
ship *shipp;
buffer += "\r\nSHIP SPECIES BREAKDOWN\r\n";
for (species=0; species < Species_info.size(); species++) {
buffer += Species_info[species].species_name;
buffer += "\r\n";
// fighter wings
buffer += "\tFighter wings:\r\n";
for (i=0; i<MAX_WINGS; i++) {
if (Wings[i].wave_count > 0) {
int wing_leader_shipnum = Wings[i].ship_index[Wings[i].special_ship];
if (Ship_info[Ships[wing_leader_shipnum].ship_info_index].species == species) {
if (Ship_info[Ships[wing_leader_shipnum].ship_info_index].flags & SIF_FIGHTER) {
temp.Format("\t\tWing: %s, count: %d, waves: %d, type: %s\r\n", Wings[i].name, Wings[i].wave_count, Wings[i].num_waves, Ship_info[Ships[wing_leader_shipnum].ship_info_index].name);
buffer += temp;
}
}
}
}
// bomber wings
buffer += "\tBomber wings:\r\n";
for (i=0; i<MAX_WINGS; i++) {
if (Wings[i].wave_count > 0) {
int wing_leader_shipnum = Wings[i].ship_index[Wings[i].special_ship];
if (Ship_info[Ships[wing_leader_shipnum].ship_info_index].species == species) {
if (Ship_info[Ships[wing_leader_shipnum].ship_info_index].flags & SIF_BOMBER) {
temp.Format("\t\tWing: %s, count: %d, waves: %d, type: %s\r\n", Wings[i].name, Wings[i].wave_count, Wings[i].num_waves, Ship_info[Ships[wing_leader_shipnum].ship_info_index].name);
buffer += temp;
}
}
}
}
buffer += "\tFreighters, Cargo, Transports:\r\n";
// freighters and transports (cargo)
for ( objp = GET_FIRST(&obj_used_list); objp != END_OF_LIST(&obj_used_list); objp = GET_NEXT(objp) ) {
if (objp->type == OBJ_START || objp->type == OBJ_SHIP) {
shipp = &Ships[objp->instance];
if (Ship_info[shipp->ship_info_index].species == species) {
//if (shipp->wingnum == -1)
//if (shipp->cargo1 > 0)
if (Ship_info[shipp->ship_info_index].flags & (SIF_FREIGHTER | SIF_TRANSPORT | SIF_CARGO)) {
temp.Format("\t\tName: %s Type: %s, Cargo: %s\r\n", shipp->ship_name, Ship_info[shipp->ship_info_index].name, Cargo_names[shipp->cargo1]);
buffer += temp;
}
}
}
}
buffer += "\tNav buoy, Escape pod, Sentry gun:\r\n";
for ( objp = GET_FIRST(&obj_used_list); objp != END_OF_LIST(&obj_used_list); objp = GET_NEXT(objp) ) {
if (objp->type == OBJ_START || objp->type == OBJ_SHIP) {
shipp = &Ships[objp->instance];
if (Ship_info[shipp->ship_info_index].species == species) {
//if (shipp->wingnum == -1)
//if (shipp->cargo1 > 0)
if (Ship_info[shipp->ship_info_index].flags & (SIF_NAVBUOY | SIF_ESCAPEPOD | SIF_SENTRYGUN)) {
temp.Format("\t\tName: %s, Type: %s Cargo: %s\r\n", shipp->ship_name, Ship_info[shipp->ship_info_index].name, Cargo_names[shipp->cargo1]);
buffer += temp;
}
}
}
}
// cruiser
buffer += "\tCruiser:\r\n";
for ( objp = GET_FIRST(&obj_used_list); objp != END_OF_LIST(&obj_used_list); objp = GET_NEXT(objp) ) {
if (objp->type == OBJ_START || objp->type == OBJ_SHIP) {
shipp = &Ships[objp->instance];
if (Ship_info[shipp->ship_info_index].species == species) {
//if (shipp->wingnum == -1)
//if (shipp->cargo1 > 0)
if (Ship_info[shipp->ship_info_index].flags & (SIF_CRUISER)) {
temp.Format("\t\tName: %s, Type: %s, Cargo: %s\r\n", shipp->ship_name, Ship_info[shipp->ship_info_index].name, Cargo_names[shipp->cargo1]);
buffer += temp;
}
}
}
}
// dry dock, cap, super cap
buffer += "\tDry dock, Capital, Supercap:\r\n";
for ( objp = GET_FIRST(&obj_used_list); objp != END_OF_LIST(&obj_used_list); objp = GET_NEXT(objp) ) {
if (objp->type == OBJ_START || objp->type == OBJ_SHIP) {
shipp = &Ships[objp->instance];
if (Ship_info[shipp->ship_info_index].species == species) {
//if (shipp->wingnum == -1)
//if (shipp->cargo1 > 0)
if (Ship_info[shipp->ship_info_index].flags & (SIF_DRYDOCK|SIF_CAPITAL|SIF_SUPERCAP)) {
temp.Format("\t\tName: %s, Type: %s, Cargo: %s\r\n", shipp->ship_name, Ship_info[shipp->ship_info_index].name, Cargo_names[shipp->cargo1]);
buffer += temp;
}
}
}
}
buffer += "\r\n";
}
}
void dump_loadout(ship *shipp, CString &loadout)
{
CString temp;
char *weapon_name;
loadout = "";
// PRIMARY
int pri_idx, sec_idx;
for (pri_idx=0; pri_idx < shipp->weapons.num_primary_banks; pri_idx++) {
if (shipp->weapons.primary_bank_weapons[pri_idx] == -1) {
weapon_name = "none";
} else {
weapon_name = Weapon_info[shipp->weapons.primary_bank_weapons[pri_idx]].name;
}
temp.Format("\t\t\tPrimary[%d]: %s\r\n", pri_idx+1, weapon_name);
loadout += temp;
}
// SECONDARY
for (sec_idx=0; sec_idx < shipp->weapons.num_secondary_banks; sec_idx++) {
if (shipp->weapons.secondary_bank_weapons[sec_idx] == -1) {
weapon_name = "none";
} else {
weapon_name = Weapon_info[shipp->weapons.secondary_bank_weapons[sec_idx]].name;
}
temp.Format("\t\t\tSecondary[%d]: %s\r\n", sec_idx+1, weapon_name);
loadout += temp;
}
// TURRET
ship_subsys *ss;
for (ss = GET_FIRST(&shipp->subsys_list); ss != END_OF_LIST(&shipp->subsys_list); ss = GET_NEXT(ss) ) {
if ( (ss->system_info->type == SUBSYSTEM_TURRET) ) {
// ss->weapons.num_primary_banks, ss->weapons.num_secondary_banks, ss->weapons.primary_bank_weapons[3], ss->weapons.secondary_bank_weapons[2]
// ss->system_info->primary_banks, ss->system_info->secondary_banks
temp.Format("\t\t\tTurret: %s\r\n", ss->system_info->subobj_name);
loadout += temp;
// PRIMARY
for (pri_idx=0; pri_idx < ss->weapons.num_primary_banks; pri_idx++) {
if (ss->weapons.primary_bank_weapons[pri_idx] == -1) {
weapon_name = "none";
} else {
weapon_name = Weapon_info[ss->weapons.primary_bank_weapons[pri_idx]].name;
}
temp.Format("\t\t\t\tPrimary[%d]: %s\r\n", pri_idx+1, weapon_name);
loadout += temp;
}
// SECONDARY
for (sec_idx=0; sec_idx < ss->weapons.num_secondary_banks; sec_idx++) {
if (ss->weapons.secondary_bank_weapons[sec_idx] == -1) {
weapon_name = "none";
} else {
weapon_name = Weapon_info[ss->weapons.secondary_bank_weapons[sec_idx]].name;
}
temp.Format("\t\t\t\tSecondary[%d]: %s\r\n", sec_idx+1, weapon_name);
loadout += temp;
}
}
}
}
void DumpStats::get_default_ship_loadouts(CString &buffer)
{
int i;
uint species;
object *objp;
ship *shipp;
CString temp, loadout;
buffer += "\r\nSHIP SPECIES BREAKDOWN\r\n";
for (species=0; species < Species_info.size(); species++) {
buffer += Species_info[species].species_name;
buffer += "\r\n";
// fighter wings
buffer += "\tFighter wings:\r\n";
for (i=0; i<MAX_WINGS; i++) {
if (Wings[i].wave_count > 0) {
int wing_leader_shipnum = Wings[i].ship_index[Wings[i].special_ship];
if (Ship_info[Ships[wing_leader_shipnum].ship_info_index].species == species) {
if (Ship_info[Ships[wing_leader_shipnum].ship_info_index].flags & SIF_FIGHTER) {
temp.Format("\t\tWing: %s\r\n", Wings[i].name);
buffer += temp;
dump_loadout(&Ships[wing_leader_shipnum], loadout);
buffer += loadout;
}
}
}
}
// bomber wings
buffer += "\tBomber wings:\r\n";
for (i=0; i<MAX_WINGS; i++) {
if (Wings[i].wave_count > 0) {
int wing_leader_shipnum = Wings[i].ship_index[Wings[i].special_ship];
if (Ship_info[Ships[wing_leader_shipnum].ship_info_index].species == species) {
if (Ship_info[Ships[wing_leader_shipnum].ship_info_index].flags & SIF_BOMBER) {
temp.Format("\t\tWing: %s\r\n", Wings[i].name);
buffer += temp;
dump_loadout(&Ships[wing_leader_shipnum], loadout);
buffer += loadout;
}
}
}
}
buffer += "\tFreighters, Cargo, Transports:\r\n";
// freighters and transports (cargo)
for ( objp = GET_FIRST(&obj_used_list); objp != END_OF_LIST(&obj_used_list); objp = GET_NEXT(objp) ) {
if (objp->type == OBJ_START || objp->type == OBJ_SHIP) {
shipp = &Ships[objp->instance];
if (Ship_info[shipp->ship_info_index].species == species) {
//if (shipp->wingnum == -1)
//if (shipp->cargo1 > 0)
if (Ship_info[shipp->ship_info_index].flags & (SIF_FREIGHTER | SIF_TRANSPORT)) {
temp.Format("\t\tName: %s\r\n", shipp->ship_name);
buffer += temp;
dump_loadout(shipp, loadout);
buffer += loadout;
}
}
}
}
buffer += "\tEscape pod, Sentry gun:\r\n";
for ( objp = GET_FIRST(&obj_used_list); objp != END_OF_LIST(&obj_used_list); objp = GET_NEXT(objp) ) {
if (objp->type == OBJ_START || objp->type == OBJ_SHIP) {
shipp = &Ships[objp->instance];
if (Ship_info[shipp->ship_info_index].species == species) {
//if (shipp->wingnum == -1)
//if (shipp->cargo1 > 0)
if (Ship_info[shipp->ship_info_index].flags & (SIF_ESCAPEPOD | SIF_SENTRYGUN)) {
temp.Format("\t\tName: %s\r\n", shipp->ship_name);
buffer += temp;
dump_loadout(shipp, loadout);
buffer += loadout;
}
}
}
}
// cruiser
buffer += "\tCruiser:\r\n";
for ( objp = GET_FIRST(&obj_used_list); objp != END_OF_LIST(&obj_used_list); objp = GET_NEXT(objp) ) {
if (objp->type == OBJ_START || objp->type == OBJ_SHIP) {
shipp = &Ships[objp->instance];
if (Ship_info[shipp->ship_info_index].species == species) {
//if (shipp->wingnum == -1)
//if (shipp->cargo1 > 0)
if (Ship_info[shipp->ship_info_index].flags & (SIF_CRUISER)) {
temp.Format("\t\tName: %s\r\n", shipp->ship_name);
buffer += temp;
dump_loadout(shipp, loadout);
buffer += loadout;
}
}
}
}
// dry dock, cap, super cap
buffer += "\tCapital, Supercap:\r\n";
for ( objp = GET_FIRST(&obj_used_list); objp != END_OF_LIST(&obj_used_list); objp = GET_NEXT(objp) ) {
if (objp->type == OBJ_START || objp->type == OBJ_SHIP) {
shipp = &Ships[objp->instance];
if (Ship_info[shipp->ship_info_index].species == species) {
//if (shipp->wingnum == -1)
//if (shipp->cargo1 > 0)
if (Ship_info[shipp->ship_info_index].flags & (SIF_CAPITAL|SIF_SUPERCAP)) {
temp.Format("\t\tName: %s\r\n", shipp->ship_name);
buffer += temp;
dump_loadout(shipp, loadout);
buffer += loadout;
}
}
}
}
buffer += "\r\n";
}
// go through all wings
// go through all ships not in wings and FLYABLE
// print primary, secondary, and BIG turrets
}
-64
View File
@@ -1,64 +0,0 @@
/*
* Copyright (C) Volition, Inc. 1999. All rights reserved.
*
* All source code herein is the property of Volition, Inc. You may not sell
* or otherwise commercially exploit the source or things you created based on the
* source.
*
*/
#if !defined(AFX_DUMPSTATS_H__04996431_1A80_11D3_A923_0060088FAE88__INCLUDED_)
#define AFX_DUMPSTATS_H__04996431_1A80_11D3_A923_0060088FAE88__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// DumpStats.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// DumpStats dialog
class DumpStats : public CDialog
{
// Construction
public:
DumpStats(CWnd* pParent = NULL); // standard constructor
void get_mission_stats(CString &buffer);
void get_background_stats(CString &buffer);
void get_object_stats(CString &buffer);
void get_objectives_and_goals(CString &buffer);
void get_ship_weapon_selection(CString &buffer);
void get_messaging_info(CString &buffer);
void get_species_ship_breakdown(CString &buffer);
void get_default_ship_loadouts(CString &buffer);
// Dialog Data
//{{AFX_DATA(DumpStats)
enum { IDD = IDD_DUMP_STATS };
// NOTE: the ClassWizard will add data members here
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(DumpStats)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(DumpStats)
virtual BOOL OnInitDialog();
afx_msg void OnDumpToFile();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_DUMPSTATS_H__04996431_1A80_11D3_A923_0060088FAE88__INCLUDED_)
-48
View File
@@ -1,48 +0,0 @@
/*
* Copyright (C) Volition, Inc. 1999. All rights reserved.
*
* All source code herein is the property of Volition, Inc. You may not sell
* or otherwise commercially exploit the source or things you created based on the
* source.
*
*/
#ifndef _EDITOR_H
#define _EDITOR_H
/*
#ifdef __cplusplus
extern "C" {
#endif
*/
#include "physics/physics.h"
#include "render/3d.h"
#include "mission/missiongrid.h"
#define MAX_GRID_POINTS 1000
void create_object(int objnum, vec3d *pos);
// This stuff properly belongs in editor.h, but I gave up trying to figure out how
// to add an include file to the project.
extern void test_form_wing(int x);
extern int select_object(int cx, int cy);
extern void game_init();
extern matrix Grid_gmatrix;
extern vec3d Grid_center;
extern int Show_stars;
extern void rpd_line(vec3d *v0, vec3d *v1);
/*
#ifdef __cplusplus
}
#endif
*/
#endif
File diff suppressed because it is too large. Load diff
-265
View File
@@ -1,265 +0,0 @@
/*
* Copyright (C) Volition, Inc. 1999. All rights reserved.
*
* All source code herein is the property of Volition, Inc. You may not sell
* or otherwise commercially exploit the source or things you created based on the
* source.
*
*/
/*
* $Logfile: /Freespace2/code/Fred2/EventEditor.h $
* $Revision: 1.1.2.1 $
* $Date: 2006-10-09 05:25:07 $
* $Author: Goober5000 $
*
* Event editor dialog box class and event tree class (used for dialog)
*
* $Log: not supported by cvs2svn $
* Revision 1.1 2006/01/19 02:27:31 Goober5000
* import FRED2 back into fs2_open module
* --Goober5000
*
* Revision 1.4 2005/07/13 02:40:50 Goober5000
* remove PreProcDefine #includes in FRED
* --Goober5000
*
* Revision 1.3 2004/09/29 17:26:32 Kazan
* PreProfDefines.h includes for fred2
*
* Revision 1.2 2002/08/15 01:06:34 penguin
* Include filename reorg (to coordinate w/ fs2_open)
*
* Revision 1.1.1.1 2002/07/15 03:10:53 inquisitor
* Initial FRED2 Checking
*
*
* 5 8/26/99 8:52p Dave
* Gave multiplayer TvT messaging a heavy dose of sanity. Cheat codes.
*
* 4 5/04/99 5:21p Andsager
*
* 3 2/17/99 2:11p Dave
* First full run of squad war. All freespace and tracker side stuff
* works.
*
* 2 10/07/98 6:28p Dave
* Initial checkin. Renamed all relevant stuff to be Fred2 instead of
* Fred. Globalized mission and campaign file extensions. Removed Silent
* Threat specific code.
*
* 1 10/07/98 3:01p Dave
*
* 1 10/07/98 3:00p Dave
*
* 27 5/15/98 5:51p Hoffoss
* Fixed escape key and cancel button bugs.
*
* 26 4/22/98 9:56a Sandeep
*
* 25 4/20/98 4:40p Hoffoss
* Added a button to 4 editors to play the chosen wave file.
*
* 24 4/03/98 5:20p Hoffoss
* Changed code so that changing a message's wave file will update the
* persona as well, if the wave file has the proper prefix.
*
* 23 2/16/98 6:25p Hoffoss
* Did major rework of the whole right_clicked() handler to simplify it
* all, break it down and make it more flexible. Should be a lot easier
* to work with from now on.
*
* 22 2/16/98 2:42p Hoffoss
* Added new code in preparation to simplify the sexp_tree monster.
* Checking in code now as a good foundation point that I can revert back
* to if needed.
*
* 21 1/08/98 11:18a Hoffoss
* Fixed several bugs in new Event Editor.
*
* 20 1/07/98 5:58p Hoffoss
* Combined message editor into event editor.
*
* 19 1/06/98 8:25p Hoffoss
* Added insert event functionality to event editor.
*
* 18 10/10/97 6:21p Hoffoss
* Put in Fred support for training object list editing.
*
* 17 10/09/97 1:03p Hoffoss
* Renaming events or goals now updates sexp references as well.
*
* 16 9/30/97 10:01a Hoffoss
* Added event chaining support to Fred and FreeSpace.
*
* 15 8/12/97 3:33p Hoffoss
* Fixed the "press cancel to go to reference" code to work properly.
*
* 14 7/30/97 5:23p Hoffoss
* Removed Sexp tree verification code, since it duplicates normal sexp
* verification, and is just another set of code to keep maintained.
*
* 13 7/25/97 3:05p Allender
* added score field to goals and events editor
*
* 12 7/24/97 12:45p Hoffoss
* Added sexp help system to sexp trees and some dialog boxes.
*
* 11 7/17/97 4:10p Hoffoss
* Added drag and drop to sexp trees for reordering root items.
*
* 10 7/15/97 10:30a Allender
* added repeat count and interval time to event editor. For use in
* repeating events at regular intervals
*
* 9 6/02/97 8:47p Hoffoss
* Fixed bug with inserting an operator at root position, but under a
* label.
*
* 8 5/20/97 2:28p Hoffoss
* Added message box queries for close window operation on all modal
* dialog boxes.
*
* 7 5/01/97 4:12p Hoffoss
* Added return handling to dialogs.
*
* 6 4/17/97 2:01p Hoffoss
* All dialog box window states are saved between sessions now.
*
* 5 4/11/97 10:10a Hoffoss
* Name fields supported by Fred for Events and Mission Goals.
*
* 4 4/07/97 3:48p Hoffoss
* Event editor now supports a sporty new delete button!
*
* 3 1/22/97 11:01a Hoffoss
* Many bug fixes (those pointed out by Mark during Fred testing trying to
* make mission 5).
*
* 2 1/13/97 4:54p Hoffoss
* Added event editor.
*
* $NoKeywords: $
*/
#ifndef _EVENTEDITOR_H
#define _EVENTEDITOR_H
#include "Sexp_tree.h"
#include "mission/missiongoals.h"
#include "mission/missionmessage.h"
#define MAX_SEARCH_MESSAGE_DEPTH 5 // maximum search number of event nodes with message text
class event_sexp_tree : public sexp_tree
{
};
/////////////////////////////////////////////////////////////////////////////
// event_editor dialog
class event_editor : public CDialog
{
// Construction
public:
void update_persona();
void save();
char *current_message_name(int index);
char *get_message_list_item(int i);
int save_message(int num);
void update_cur_message();
HTREEITEM get_event_handle(int num);
void reset_event(int num, HTREEITEM after);
void save_event(int e);
void swap_handler(int node1, int node2);
void insert_handler(int old, int node);
int query_modified();
void OnOK();
void OnCancel();
int handler(int code, int node, char *str = NULL);
void create_tree();
void load_tree();
int modified;
int select_sexp_node;
event_editor(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(event_editor)
enum { IDD = IDD_EVENT_EDITOR };
event_sexp_tree m_event_tree;
UINT m_repeat_count;
UINT m_interval;
int m_event_score;
int m_chain_delay;
BOOL m_chained;
CString m_obj_text;
CString m_obj_key_text;
CString m_avi_filename;
CString m_message_name;
CString m_message_text;
int m_persona;
CString m_wave_filename;
int m_cur_msg;
int m_team;
int m_message_team;
int m_last_message_node;
//}}AFX_DATA
CBitmap m_play_bm;
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(event_editor)
public:
virtual BOOL DestroyWindow();
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(event_editor)
virtual BOOL OnInitDialog();
afx_msg void OnRclickEventTree(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnBeginlabeleditEventTree(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnEndlabeleditEventTree(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnButtonNewEvent();
afx_msg void OnDelete();
afx_msg void OnOk();
afx_msg void OnClose();
afx_msg void OnSelchangedEventTree(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnUpdateRepeatCount();
afx_msg void OnChained();
afx_msg void OnInsert();
afx_msg void OnSelchangeMessageList();
afx_msg void OnNewMsg();
afx_msg void OnDeleteMsg();
afx_msg void OnBrowseAvi();
afx_msg void OnBrowseWave();
afx_msg void OnSelchangeWaveFilename();
afx_msg void OnPlay();
afx_msg void OnUpdate();
afx_msg void On_Cancel();
afx_msg void OnSelchangeTeam();
afx_msg void OnSelchangeMessageTeam();
afx_msg void OnDblclkMessageList();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
private:
int cur_event;
void update_cur_event();
int m_num_events;
int m_sig[MAX_MISSION_EVENTS];
mission_event m_events[MAX_MISSION_EVENTS];
int m_num_messages;
MMessage m_messages[MAX_MISSION_MESSAGES];
int m_msg_sig[MAX_MISSION_MESSAGES];
int m_wave_id;
};
extern event_editor *Event_editor_dlg; // global reference needed by event tree class
#endif
-329
View File
@@ -1,329 +0,0 @@
/////////////////////////////////////////////////////////////////////////////
/*
DESCRIPTION:
CFolderDialog - Folder Selection Dialog Class
Copyright(C) Armen Hakobyan, 2002 - 2005
http://www.codeproject.com/dialog/cfolderdialog.asp
VERSION HISTORY:
24 Mar 2002 - First release
30 Mar 2003 - Some minor changes
- Added missing in old Platform SDK new flag definitions
- Added support for both MFC 6.0 and 7.0
- Added OnIUnknown handler for Windows XP folder filtration
- Added SetExpanded and SetOKText and GetSelectedFolder functions
24 May 2003 - Added OnSelChanged implementation
14 Jul 2003 - Added custom filtration for Windows XP, thanks to Arik Poznanski
29 Nov 2003 - Added SetRootFolder, thanks to Eckhard Schwabe ( and Jose Insa )
02 Jan 2004 - Added GetRootFolder, uncomment if needed
15 Feb 2005 - Small bug fix in DoModal, thanks to WindSeven
*/
/////////////////////////////////////////////////////////////////////////////
#include "FolderDlg.h"
/////////////////////////////////////////////////////////////////////////////
#ifndef BFFM_VALIDATEFAILED
#ifndef UNICODE
#define BFFM_VALIDATEFAILED 3
#else
#define BFFM_VALIDATEFAILED 4
#endif
#endif
#ifndef BFFM_IUNKNOWN
#define BFFM_IUNKNOWN 5
#endif
/////////////////////////////////////////////////////////////////////////////
// CFolderDialog
IMPLEMENT_DYNAMIC( CFolderDialog, CDialog )
CFolderDialog::CFolderDialog( IN LPCTSTR pszTitle /*NULL*/,
IN LPCTSTR pszSelPath /*NULL*/,
IN CWnd* pWndParent /*NULL*/,
IN UINT uFlags /*BIF_RETURNONLYFSDIRS*/ )
: CCommonDialog( pWndParent )
, m_hWnd( NULL )
{
::ZeroMemory( &m_bi, sizeof( BROWSEINFO ) );
::ZeroMemory( m_szFolPath, MAX_PATH );
::ZeroMemory( m_szSelPath, MAX_PATH );
// Fill data
m_bi.hwndOwner = pWndParent->GetSafeHwnd();
m_bi.pidlRoot = NULL;
m_bi.lpszTitle = pszTitle;
m_bi.ulFlags = uFlags;
m_bi.lpfn = (BFFCALLBACK)&BrowseCallbackProc;
m_bi.lParam = (LPARAM)this;
// The size of this buffer is assumed to be MAX_PATH bytes:
m_bi.pszDisplayName = new TCHAR[ MAX_PATH ];
ASSERT( m_bi.pszDisplayName != NULL );
SAFE_ZEROMEMORY(
m_bi.pszDisplayName, ( MAX_PATH * sizeof( TCHAR ) )
);
if( pszSelPath )
SetSelectedFolder( pszSelPath );
}
CFolderDialog::~CFolderDialog( VOID )
{
SAFE_COTASKMEMFREE( m_bi.pidlRoot );
SAFE_DELETE2( m_bi.pszDisplayName );
::ZeroMemory( &m_bi, sizeof( BROWSEINFO ) );
}
BEGIN_MESSAGE_MAP( CFolderDialog, CCommonDialog )
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CFolderDialog message handlers
// SetRootFolder By Jose Insa
// Microsoft knowledge Base Article
// ID Q132750: Convert a File Path to an ITEMIDLIST
BOOL CFolderDialog::SetRootFolder( IN LPCTSTR pszPath )
{
ASSERT_VALID( this );
if( !pszPath )
{
SAFE_COTASKMEMFREE( m_bi.pidlRoot );
return TRUE;
}
ASSERT( AfxIsValidString( pszPath, MAX_PATH ) );
HRESULT hResult = S_FALSE;
IShellFolder* pDeskFolder = NULL;
hResult = ::SHGetDesktopFolder( &pDeskFolder );
if ( hResult == S_OK )
{
LPITEMIDLIST pidlRoot = NULL;
LPTSTR pszRoot = const_cast< LPTSTR >( pszPath );
// Convert the path to an ITEMIDLIST:
USES_CONVERSION;
hResult = pDeskFolder->ParseDisplayName(
NULL, NULL, T2W( pszRoot ), NULL, &pidlRoot, NULL
);
if( hResult == S_OK )
{
SAFE_COTASKMEMFREE( m_bi.pidlRoot );
m_bi.pidlRoot = pidlRoot;
}
SAFE_RELEASE( pDeskFolder );
}
return ( hResult == S_OK );
}
// NOTE: pszPath buffer must be at least
// MAX_PATH characters in size:
BOOL CFolderDialog::GetRootFolder( IN OUT LPTSTR pszPath )
{
ASSERT_VALID( this );
ASSERT( AfxIsValidString( pszPath, MAX_PATH ) );
return ::SHGetPathFromIDList( m_bi.pidlRoot, pszPath );
}
BOOL CFolderDialog::SetSelectedFolder( IN LPCTSTR pszPath )
{
ASSERT( AfxIsValidString( pszPath, MAX_PATH ) );
return (BOOL)::lstrcpy( m_szSelPath, pszPath );
}
/////////////////////////////////////////////////////////////////////////////
#if ( _MFC_VER >= 0x0700 )
INT_PTR CFolderDialog::DoModal( VOID )
#else
INT CFolderDialog::DoModal( VOID )
#endif
{
ASSERT_VALID( this );
ASSERT( m_bi.lpfn != NULL );
INT_PTR nRet = -1;
m_bi.hwndOwner = PreModal();
LPITEMIDLIST pItemIDList = ::SHBrowseForFolder( &m_bi );
if( pItemIDList )
{
if( ::SHGetPathFromIDList( pItemIDList, m_szFolPath ) )
nRet = IDOK;
SAFE_COTASKMEMFREE( pItemIDList );
}
else
nRet = IDCANCEL;
PostModal();
return ( nRet );
}
/////////////////////////////////////////////////////////////////////////////
// Overridables:
VOID CFolderDialog::OnInitialized( VOID )
{
if( ::lstrlen( m_szSelPath ) > 0 )
SetSelection( m_szSelPath );
}
VOID CFolderDialog::OnSelChanged( IN LPITEMIDLIST pItemIDList )
{
if( m_bi.ulFlags & BIF_STATUSTEXT )
{
TCHAR szSelFol[ MAX_PATH ] = { 0 };
if( ::SHGetPathFromIDList( pItemIDList, szSelFol ) )
SetStatusText( szSelFol );
}
}
INT CFolderDialog::OnValidateFailed( IN LPCTSTR /*pszPath*/ )
{
::MessageBeep( MB_ICONHAND );
return 1; // Return 1 to leave dialog open, 0 - to end one
}
VOID CFolderDialog::OnIUnknown( IN IUnknown* /*pIUnknown*/ )
{
}
/////////////////////////////////////////////////////////////////////////////
// Callback function used with the SHBrowseForFolder function.
INT CALLBACK CFolderDialog::BrowseCallbackProc( IN HWND hWnd,
IN UINT uMsg,
IN LPARAM lParam,
IN LPARAM lpData )
{
CFolderDialog* pThis = (CFolderDialog*)lpData;
ASSERT( pThis != NULL );
INT nRet = 0;
pThis->m_hWnd = hWnd;
switch( uMsg )
{
case BFFM_INITIALIZED:
pThis->OnInitialized();
break;
case BFFM_SELCHANGED:
pThis->OnSelChanged( (LPITEMIDLIST)lParam );
break;
case BFFM_VALIDATEFAILED:
nRet = pThis->OnValidateFailed( (LPCTSTR)lParam );
break;
case BFFM_IUNKNOWN:
pThis->OnIUnknown( (IUnknown*)lParam );
break;
default:
ASSERT( FALSE );
break;
}
pThis->m_hWnd = NULL;
return nRet;
}
/////////////////////////////////////////////////////////////////////////////
// Commands, valid to call only from handlers
VOID CFolderDialog::SetExpanded( IN LPCTSTR pszPath )
{
USES_CONVERSION;
ASSERT( m_hWnd != NULL );
ASSERT( AfxIsValidString( pszPath, MAX_PATH ) );
::SendMessage(
m_hWnd, BFFM_SETEXPANDED,
(WPARAM)TRUE, (LPARAM)T2CW( pszPath )
);
}
VOID CFolderDialog::SetOKText( IN LPCTSTR pszText )
{
USES_CONVERSION;
ASSERT( m_hWnd != NULL );
::SendMessage(
m_hWnd, BFFM_SETOKTEXT,
(WPARAM)0, (LPARAM)T2CW( pszText )
);
}
VOID CFolderDialog::EnableOK( IN BOOL bEnable /*TRUE*/ )
{
ASSERT( m_hWnd != NULL );
::SendMessage(
m_hWnd, BFFM_ENABLEOK, (WPARAM)bEnable, 0L
);
}
VOID CFolderDialog::SetSelection( IN LPITEMIDLIST pItemIDList )
{
ASSERT( m_hWnd != NULL );
::SendMessage(
m_hWnd, BFFM_SETSELECTION,
(WPARAM)FALSE, (LPARAM)pItemIDList
);
}
VOID CFolderDialog::SetSelection( IN LPCTSTR pszPath )
{
ASSERT( m_hWnd != NULL );
ASSERT( AfxIsValidString( pszPath, MAX_PATH ) );
::SendMessage(
m_hWnd, BFFM_SETSELECTION,
(WPARAM)TRUE, (LPARAM)pszPath
);
}
VOID CFolderDialog::SetStatusText( IN LPCTSTR pszText )
{
ASSERT( m_hWnd != NULL );
::SendMessage(
m_hWnd, BFFM_SETSTATUSTEXT,
(WPARAM)0, (LPARAM)pszText
);
}
// Shell version 5.0 or later:
VOID CFolderDialog::SetExpanded( IN LPITEMIDLIST pItemIDList )
{
ASSERT( m_hWnd != NULL );
::SendMessage(
m_hWnd, BFFM_SETEXPANDED,
(WPARAM)FALSE, (LPARAM)pItemIDList
);
}
/////////////////////////////////////////////////////////////////////////////
-197
View File
@@ -1,197 +0,0 @@
/////////////////////////////////////////////////////////////////////////////
/*
DESCRIPTION:
CFolderDialog - Folder Selection Dialog Class
Copyright(C) Armen Hakobyan, 2002 - 2005
http://www.codeproject.com/dialog/cfolderdialog.asp
VERSION HISTORY:
24 Mar 2002 - First release
30 Mar 2003 - Some minor changes
- Added missing in old Platform SDK new flag definitions
- Added support for both MFC 6.0 and 7.0
- Added OnIUnknown handler for Windows XP folder filtration
- Added SetExpanded and SetOKText and GetSelectedFolder functions
24 May 2003 - Added OnSelChanged implementation
14 Jul 2003 - Added custom filtration for Windows XP, thanks to Arik Poznanski
29 Nov 2003 - Added SetRootFolder, thanks to Eckhard Schwabe ( and Jose Insa )
02 Jan 2004 - Added GetRootFolder, uncomment if needed
15 Feb 2005 - Small bug fix in DoModal, thanks to WindSeven
*/
/////////////////////////////////////////////////////////////////////////////
#ifndef __FOLDERDLG_H__
#define __FOLDERDLG_H__
#if defined( _MSC_VER ) && ( _MSC_VER >= 1020 )
#pragma once
#endif
/////////////////////////////////////////////////////////////////////////////
#ifndef __AFXDLGS_H__
#include < AfxDlgs.h >
#endif
// Goober5000 - dunno why this wasn't included in the first place
#ifndef _INC_SHLOBJ
#include <shlobj.h>
#endif
#ifndef __ATLCONV_H__
#include < AtlConv.h > // MBCS/Unicode Conversion Macros
#endif
// Uncomment if using GetRootFolder
//#ifndef _INC_SHLWAPI
// #include < shlwapi.h >
//#endif
//#pragma comment( lib, "shlwapi.lib" )
/////////////////////////////////////////////////////////////////////////////
#ifndef SAFE_DELETE2
#define SAFE_DELETE2( p ) \
if( p ){ delete[] p; p = NULL; }
#endif
#ifndef SAFE_ZEROMEMORY
#define SAFE_ZEROMEMORY( p, size ) \
if( p ){ ZeroMemory( p, size ); }
#endif
#ifndef SAFE_RELEASE
#if defined( __cplusplus )
#define SAFE_RELEASE( p ) \
if( p ){ p->Release(); p = NULL; }
#else
#define SAFE_RELEASE( p ) \
if( p ){ p->lpVtbl->Release( p ); p = NULL; }
#endif
#endif
#ifndef SAFE_COTASKMEMFREE
#define SAFE_COTASKMEMFREE( p ) \
if( p ){ CoTaskMemFree( (LPVOID)p ); p = NULL; }
#endif
#ifndef _countof
#define _countof( x ) \
( sizeof( x ) / sizeof( x[ 0 ] ) )
#endif
/////////////////////////////////////////////////////////////////////////////
#ifndef BFFM_SETOKTEXT // Version 5.0 or later
#define BFFM_SETOKTEXT ( WM_USER + 105 ) // Unicode only, req. BIF_USENEWUI
#define BFFM_SETEXPANDED ( WM_USER + 106 ) // Unicode only, req. BIF_USENEWUI
#endif
#ifndef BIF_NEWDIALOGSTYLE // Version 5.0 or later
#define BIF_NEWDIALOGSTYLE 0x0040
#define BIF_BROWSEINCLUDEURLS 0x0080
#define BIF_UAHINT 0x0100 // Req. BIF_NEWDIALOGSTYLE
#define BIF_NONEWFOLDERBUTTON 0x0200
#define BIF_NOTRANSLATETARGETS 0x0400
#define BIF_SHAREABLE 0x8000 // Req. BIF_USENEWUI
#define BIF_USENEWUI ( BIF_NEWDIALOGSTYLE | BIF_EDITBOX )
#endif
/////////////////////////////////////////////////////////////////////////////
class CFolderDialog : public CCommonDialog
{
DECLARE_DYNAMIC( CFolderDialog )
public:
CFolderDialog( IN LPCTSTR pszTitle = NULL,
IN LPCTSTR pszSelPath = NULL,
IN CWnd* pWndParent = NULL,
IN UINT uFlags = BIF_RETURNONLYFSDIRS );
virtual ~CFolderDialog( VOID );
public:
#if ( _MFC_VER >= 0x0700 ) // VC++ 2002 (7.0)
virtual INT_PTR DoModal( VOID );
#else
virtual INT DoModal( VOID );
#endif
BOOL SetRootFolder( IN LPCTSTR pszPath );
BOOL GetRootFolder( IN OUT LPTSTR pszPath );
BOOL SetSelectedFolder( IN LPCTSTR pszPath );
public:
AFX_INLINE LPCTSTR GetFolderPath( VOID ) const;
AFX_INLINE LPCTSTR GetFolderName( VOID ) const;
AFX_INLINE INT GetFolderImage( VOID ) const;
AFX_INLINE LPCTSTR GetSelectedFolder( VOID ) const;
AFX_INLINE BROWSEINFO& GetBI( VOID );
AFX_INLINE const BROWSEINFO& GetBI( VOID ) const;
protected:
BROWSEINFO m_bi;
TCHAR m_szSelPath[ MAX_PATH ];
TCHAR m_szFolPath[ MAX_PATH ];
protected:
DECLARE_MESSAGE_MAP()
protected: // Overridables
virtual VOID OnInitialized( VOID );
virtual VOID OnSelChanged( IN LPITEMIDLIST pItemIDList );
virtual INT OnValidateFailed( IN LPCTSTR /*pszPath*/ );
protected: // Windows XP or later
virtual VOID OnIUnknown( IN IUnknown* /*pIUnknown*/ );
protected: // Valid to call only from the above handlers
VOID EnableOK( IN BOOL bEnable = TRUE );
VOID SetSelection( IN LPITEMIDLIST pItemIDList );
VOID SetSelection( IN LPCTSTR pszPath );
VOID SetStatusText( IN LPCTSTR pszText );
protected: // Shell version 5.0 or later:
VOID SetExpanded( IN LPCTSTR pszPath );
VOID SetExpanded( IN LPITEMIDLIST pItemIDList );
VOID SetOKText( IN LPCTSTR pszText );
private:
HWND m_hWnd; // used only in the callback function
private:
static INT CALLBACK BrowseCallbackProc(
IN HWND hWnd, IN UINT uMsg, IN LPARAM lParam, IN LPARAM lpData
);
};
/////////////////////////////////////////////////////////////////////////////
AFX_INLINE LPCTSTR CFolderDialog::GetSelectedFolder( VOID ) const
{ return m_szSelPath; }
AFX_INLINE BROWSEINFO& CFolderDialog::GetBI( VOID )
{ return m_bi; }
AFX_INLINE const BROWSEINFO& CFolderDialog::GetBI( VOID ) const
{ return m_bi; }
/////////////////////////////////////////////////////////////////////////////
// Filled after a call to DoModal
AFX_INLINE LPCTSTR CFolderDialog::GetFolderPath( VOID ) const
{ return m_szFolPath; }
AFX_INLINE LPCTSTR CFolderDialog::GetFolderName( VOID ) const
{ return m_bi.pszDisplayName; }
AFX_INLINE INT CFolderDialog::GetFolderImage( VOID ) const
{ return m_bi.iImage; }
/////////////////////////////////////////////////////////////////////////////
#endif // __FOLDERDLG_H__
/////////////////////////////////////////////////////////////////////////////
-930
View File
@@ -1,930 +0,0 @@
/*
* Copyright (C) Volition, Inc. 1999. All rights reserved.
*
* All source code herein is the property of Volition, Inc. You may not sell
* or otherwise commercially exploit the source or things you created based on the
* source.
*
*/
/*
* $Logfile: /Freespace2/code/Fred2/FRED.cpp $
* $Revision: 1.2.2.3 $
* $Date: 2007-10-28 16:34:11 $
* $Author: taylor $
*
* FRED.cpp : Defines the class behaviors for the application.
* Global editor dialog box classes are instantiated here, initializes the
* application (MFC level at least), processes the INI file.
*
* $Log: not supported by cvs2svn $
* Revision 1.2.2.2 2006/11/15 00:36:07 taylor
* various bits of little cleanup
* get rid of some more compiler warnings
*
* Revision 1.2.2.1 2006/10/08 02:05:33 Goober5000
* fix forum links
*
* Revision 1.2 2006/04/20 06:32:01 Goober5000
* proper capitalization according to Volition
*
* Revision 1.1 2006/01/19 02:27:31 Goober5000
* import FRED2 back into fs2_open module
* --Goober5000
*
* Revision 1.8 2004/02/13 04:25:37 randomtiger
* Added messagebox to offer startup choice between htl, non htl and quitting.
* Tidied up the background dialog box a bit and added some disabled controls for future ambient light feature.
* Set non htl to use a lower level of model and texture detail to boost poor performance on this path.
*
* Revision 1.7 2004/02/05 23:23:19 randomtiger
* Merging OGL Fred into normal Fred, no conflicts, should be perfect
*
* Revision 1.6.2.4 2004/01/24 13:00:43 randomtiger
* Implemented basic OGL HT&L but some drawing routines missing from cobe.lib so keeping turned off for now.
* Added lighting menu option and made about dialog more useful.
* Ship menu now defaults to the first entry.
* Loads of debug to try and trap crashes.
*
* Revision 1.6.2.3 2004/01/20 19:11:29 randomtiger
* Cut unneeded code, text now works in graphics window.
*
* Revision 1.6.2.2 2004/01/18 14:53:17 randomtiger
* Textures work now, initialisation runs from cobe.lib not internally.
*
* Revision 1.6.2.1 2004/01/17 22:11:25 randomtiger
* Large series of changes to make fred run though OGL. Requires code.lib to be up to date to compile.
* Port still in progress, fred currently unusable, note this has been committed to fred_ogl branch.
*
* Revision 1.6 2004/01/14 05:51:51 Goober5000
* fixed the file association annoyance
* --Goober5000
*
* Revision 1.5 2003/10/15 22:10:34 Kazan
* Da Species Update :D
*
* Revision 1.4 2003/08/26 20:32:41 Goober5000
* added support for saving in FS2 retail format
* --Goober5000
*
* Revision 1.3 2003/08/21 08:56:34 Goober5000
* fixed two linker errors inadvertently added by people who changed stuff in freespace.cpp
* --Goober5000
*
* Revision 1.2 2002/08/15 01:06:34 penguin
* Include filename reorg (to coordinate w/ fs2_open)
*
* Revision 1.1.1.1 2002/07/15 03:10:56 inquisitor
* Initial FRED2 Checking
*
*
* 6 5/19/99 4:07p Dave
* Moved versioning code into a nice isolated common place. Fixed up
* updating code on the pxo screen. Fixed several stub problems.
*
* 5 3/26/99 4:49p Dave
* Made cruisers able to dock with stuff. Made docking points and paths
* visible in fred.
*
* 4 3/20/99 5:09p Dave
* Fixed release build fred warnings and unhandled exception.
*
* 3 10/29/98 10:41a Dave
* Change the way cfile initializes exe directory.
*
* 2 10/07/98 6:28p Dave
* Initial checkin. Renamed all relevant stuff to be Fred2 instead of
* Fred. Globalized mission and campaign file extensions. Removed Silent
* Threat specific code.
*
* 1 10/07/98 3:01p Dave
*
* 1 10/07/98 3:00p Dave
*
* 71 7/02/98 12:17p Hoffoss
* Load and save options 'anti-aliased gridlines' and 'double fine
* gridlines'.
*
* 70 5/22/98 11:02a Allender
* Added error conditions on compile and new MAX_SHIPS limits for when
* FRED is defined when building
*
* 69 5/22/98 1:06a Hoffoss
* Made Fred not use OLE.
*
* 68 4/17/98 1:41p Allender
* took out function calls in NDEBUG mode
*
* 67 3/25/98 4:14p Hoffoss
* Split ship editor up into ship editor and a misc dialog, which tracks
* flags and such.
*
* 66 3/23/98 4:04p Hoffoss
* Fixed dialog window initialization so it looks better at startup (they
* don't flash on for a second).
*
* 65 3/19/98 11:41a Hoffoss
* Fixed problems with rendering and reading of flying controls in Fred.
*
* 64 3/19/98 11:11a Allender
* made Fred actually be able to move camera again -- Hoffos is going to
* fix the code right.
*
* 63 3/18/98 3:10p Allender
* fixed update problems in OnIdle routine
*
* 62 2/06/98 4:39p Hoffoss
* Added better checking for whether Fred is in the foreground or
* background.
*
* 61 8/19/97 5:46p Hoffoss
* Changed font used in Fred, and added display to show current eye
* position.
*
* 60 8/17/97 10:22p Hoffoss
* Fixed several bugs in Fred with Undo feature. In the process, recoded
* a lot of CFile.cpp.
*
* 59 8/14/97 2:32p Hoffoss
* fixed bug where controlling an object doesn't cause screen updates, and
* added a number of cool features to viewpoint/control object code.
*
* 58 8/13/97 1:38p Hoffoss
* Added ability to update multiple times, which in needed in one case to
* brute force redraw so deleted ships actually do get removed from the
* display.
*
* 57 8/12/97 6:32p Hoffoss
* Added code to allow hiding of arrival and departure cues in editors.
*
* 56 8/10/97 4:52p Hoffoss
* Made Fred startup with main window having focus.
*
* 55 8/06/97 7:55p Hoffoss
* Fixed bug with objects not seeming to be where they are drawn (due to
* new briefing clip render stuff). This caused rendering problems,
* though. So I fixed those next.
*
* 54 8/05/97 1:29p Hoffoss
* show sexp help saved between sessions.
*
* 53 8/01/97 3:10p Hoffoss
* Made Sexp help hidable.
*
* 52 8/01/97 12:49p Hoffoss
* Changed recently used files total to 9 instead of 4.
*
* 51 6/18/97 11:46a Hoffoss
* Fixed initial order object reference updating and added briefing dialog
* window tracking data.
*
* 50 6/03/97 10:18a Allender
* make showCmd default to maximized since 0 will make the window hidden
* by default
*
* 49 6/02/97 5:18p Hoffoss
* Fixed bug in error checker and improved startup code.
*
* 48 6/02/97 11:52a Hoffoss
* Custom cursors displayed when over objects in different modes.
*
* 47 5/12/97 12:27p John
* Restructured Graphics Library to add support for multiple renderers.
*
* 46 5/09/97 9:45a Hoffoss
* Added OLE initialization. (needed for drag and drop functionality)
*
* 45 5/06/97 10:34a Hoffoss
* Fixed bug where dialog boxes that change size (in the code) still
* retain their old size from the INI stored values. They are resized now
* automatically.
*
* 44 5/05/97 9:41a Hoffoss
* Campaign editor begun.
*
* 43 5/02/97 8:39a Allender
* turn of heap allocation debuging
*
* 42 4/29/97 1:58p Hoffoss
* Added some debugging to Fred to try and track down sexp corruption
* causes.
*
* 41 4/28/97 3:43p Hoffoss
* Show_waypoints defaults to on for Fred, and is saved as a preference
* now.
*
* 40 4/17/97 2:01p Hoffoss
* All dialog box window states are saved between sessions now.
*
* 39 4/03/97 11:35a Hoffoss
* Fixed bugs: viewpoint didn't reset, initial orders not updated when
* referenced ship is renamed or deleted.
*
* 38 4/01/97 11:43p Mike
* Resolve link errors due to addition of SystemVars.cpp.
*
* 37 3/26/97 12:44p Hoffoss
* Took out the debugging 3d compass on/off toggling I put in to test
* rerendering with.
*
* 36 3/20/97 3:55p Hoffoss
* Major changes to how dialog boxes initialize (load) and update (save)
* their internal data. This should simplify things and create less
* problems.
*
* 35 3/13/97 12:08p Hoffoss
* Waypoint path editor finished (apparently I didn't get around to
* completing it before).
*
* 34 3/12/97 12:39p Hoffoss
* Fixed bugs in wing object management functions, several small additions
* and rearrangements.
*
* 33 3/06/97 3:35p Hoffoss
* Added Show_outline stuff, moved show options to the view menu, fixed a
* bug in message dialog editor.
*
* 32 2/28/97 11:31a Hoffoss
* Implemented modeless dialog saving and restoring, and changed some
* variables names.
*
* 31 2/27/97 5:54p Hoffoss
* Implemented support for saving and restoring window positions.
*
* 30 2/25/97 6:10p Hoffoss
* Fixed bug with modeless dialog box errors on update.
*
* 29 2/24/97 12:50p Hoffoss
* First attempt at non-continuous redrawing.
*
* 28 2/17/97 5:28p Hoffoss
* Checked RCS headers, added them were missing, changing description to
* something better, etc where needed.
*
* 27 2/12/97 12:25p Hoffoss
* Expanded on global error checker, added initial orders conflict
* checking and warning, added waypoint editor dialog and code.
*
* 26 1/30/97 2:24p Hoffoss
* Added remaining mission file structures and implemented load/save of
* them.
*
* $NoKeywords: $
*/
#include "stdafx.h"
#include "FRED.h"
#include "MainFrm.h"
#include "FREDDoc.h"
#include "FREDView.h"
#include "FredRender.h"
#include "Management.h"
#include "graphics/2d.h"
#include "io/key.h"
#include "object/object.h"
#include "editor.h"
#include "CampaignTreeWnd.h"
#include "CampaignTreeView.h"
#include "CampaignEditorDlg.h"
#include "debugconsole/dbugfile.h"
#ifdef NDEBUG
#ifndef FRED
#error macro FRED is not defined when trying to build release Fred. Please define FRED macro in build settings in all Fred projects
#endif
#endif
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
int Fred_running = 1;
int User_interface = HOFFOSS_INTERFACE;
int FrameCount = 0;
int Fred_active = 1;
int Update_window = 1;
HCURSOR h_cursor_move, h_cursor_rotate;
// Goober5000 - needed to restore compatibility with the changes in fs2_open
int Show_cpu = 0;
CWnd *Prev_window;
CShipEditorDlg Ship_editor_dialog;
wing_editor Wing_editor_dialog;
waypoint_path_dlg Waypoint_editor_dialog;
bg_bitmap_dlg *Bg_bitmap_dialog = NULL;
briefing_editor_dlg *Briefing_dialog = NULL;
window_data Main_wnd_data;
window_data Ship_wnd_data;
window_data Wing_wnd_data;
window_data Object_wnd_data;
window_data Mission_goals_wnd_data;
window_data Messages_wnd_data;
window_data Player_wnd_data;
window_data Events_wnd_data;
window_data Bg_wnd_data;
window_data Briefing_wnd_data;
window_data Reinforcement_wnd_data;
window_data Waypoint_wnd_data;
window_data Starfield_wnd_data;
window_data Asteroid_wnd_data;
window_data Mission_notes_wnd_data;
/////////////////////////////////////////////////////////////////////////////
// CFREDApp
BEGIN_MESSAGE_MAP(CFREDApp, CWinApp)
//{{AFX_MSG_MAP(CFREDApp)
ON_COMMAND(ID_APP_ABOUT, OnAppAbout)
// NOTE - the ClassWizard will add and remove mapping macros here.
// DO NOT EDIT what you see in these blocks of generated code!
//}}AFX_MSG_MAP
// Standard file based document commands
ON_COMMAND(ID_FILE_NEW, CWinApp::OnFileNew)
ON_COMMAND(ID_FILE_OPEN, CWinApp::OnFileOpen)
// Standard print setup command
ON_COMMAND(ID_FILE_PRINT_SETUP, CWinApp::OnFilePrintSetup)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CFREDApp construction
CFREDApp::CFREDApp()
{
app_init = 0;
DBUGFILE_INIT();
#ifndef NDEBUG
outwnd_init();
#endif
}
CFREDApp::~CFREDApp()
{
DBUGFILE_DEINIT();
}
/////////////////////////////////////////////////////////////////////////////
// The one and only CFREDApp object
CFREDApp theApp;
/////////////////////////////////////////////////////////////////////////////
// CFREDApp initialization
char *c;
char *tok = "whee";
BOOL CFREDApp::InitInstance()
{
// disable the debug memory stuff
_CrtSetDbgFlag(~(_CRTDBG_ALLOC_MEM_DF) & _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG));
// Standard initialization
// If you are not using these features and wish to reduce the size
// of your final executable, you should remove from the following
// the specific initialization routines you do not need.
#ifdef _AFXDLL
Enable3dControls(); // Call this when using MFC in a shared DLL
#else
Enable3dControlsStatic(); // Call this when linking to MFC statically
#endif
LoadStdProfileSettings(9); // Load standard INI file options (including MRU)
User_interface = GetProfileInt("Preferences", "User interface", User_interface);
Show_stars = GetProfileInt("Preferences", "Show stars", Show_stars);
Show_grid_positions = GetProfileInt("Preferences", "Show grid positions", Show_grid_positions);
Show_coordinates = GetProfileInt("Preferences", "Show coordinates", Show_coordinates);
Show_compass = GetProfileInt("Preferences", "Show compass", Show_compass);
Show_ship_models = GetProfileInt("Preferences", "Show ship models", Show_ship_models);
Show_ship_info = GetProfileInt("Preferences", "Show ship info", Show_ship_info);
Show_outlines = GetProfileInt("Preferences", "Show outlines", Show_outlines);
Show_waypoints = GetProfileInt("Preferences", "Show waypoints", Show_waypoints);
Show_sexp_help = GetProfileInt("Preferences", "Show sexp help", Show_sexp_help);
physics_speed = GetProfileInt("Preferences", "Physics speed", physics_speed);
physics_rot = GetProfileInt("Preferences", "Physics rotation", physics_rot);
Hide_ship_cues = GetProfileInt("Preferences", "Hide ship cues", Hide_ship_cues);
Hide_wing_cues = GetProfileInt("Preferences", "Hide wing cues", Hide_wing_cues);
Autosave_disabled = GetProfileInt("Preferences", "Autosave disabled", Autosave_disabled);
double_fine_gridlines = GetProfileInt("Preferences", "Double fine gridlines", double_fine_gridlines);
Aa_gridlines = GetProfileInt("Preferences", "Anti aliased gridlines", Aa_gridlines);
Show_dock_points = GetProfileInt("Preferences", "Show dock points", Show_dock_points);
Show_paths_fred = GetProfileInt("Preferences", "Show paths", Show_paths_fred);
Lighting_on = GetProfileInt("Preferences", "Lighting On", Lighting_on);
// Goober5000
Format_fs2_open = GetProfileInt("Preferences", "FS2 open format", Format_fs2_open);
Format_fs2_retail = GetProfileInt("Preferences", "FS2 retail format", Format_fs2_retail);
Format_fs1_retail = GetProfileInt("Preferences", "FS1 retail format", Format_fs1_retail);
read_window("Main window", &Main_wnd_data);
read_window("Ship window", &Ship_wnd_data);
read_window("Wing window", &Wing_wnd_data);
read_window("Waypoint window", &Waypoint_wnd_data);
read_window("Object window", &Object_wnd_data);
read_window("Mission goals window", &Mission_goals_wnd_data);
read_window("Messages window", &Messages_wnd_data);
read_window("Player window", &Player_wnd_data);
read_window("Events window", &Events_wnd_data);
read_window("Bg window", &Bg_wnd_data);
read_window("Briefing window", &Briefing_wnd_data);
read_window("Reinforcement window", &Reinforcement_wnd_data);
read_window("Starfield window", &Starfield_wnd_data);
read_window("Asteroid window", &Asteroid_wnd_data);
read_window("Mission notes window", &Mission_notes_wnd_data);
write_ini_file(1);
// Register the application's document templates. Document templates
// serve as the connection between documents, frame windows and views.
CSingleDocTemplate* pDocTemplate;
pDocTemplate = new CSingleDocTemplate(
IDR_MAINFRAME,
RUNTIME_CLASS(CFREDDoc),
RUNTIME_CLASS(CMainFrame), // main SDI frame window
RUNTIME_CLASS(CFREDView));
AddDocTemplate(pDocTemplate);
/* Goober5000: um, no, because this is extremely annoying
// Enable DDE Execute open
EnableShellOpen();
RegisterShellFileTypes(TRUE); */
// setup the fred exe directory so CFILE can init properly
/*
c = GetCommandLine();
Assert(c != NULL);
if(c == NULL){
return FALSE;
}
tok = strtok(c, " \n");
Assert(tok != NULL);
if(tok == NULL){
return FALSE;
}
// Fred_exe_dir = strdup(c);
strcpy(Fred_exe_dir, tok);
*/
// we need a full path, and if run from a shell that may not happen, so work that case out...
Assert( strlen(__argv[0]) > 2 );
// see if we have a ':', and if not then assume that we don't have a full path
if (__argv[0][1] != ':') {
GetCurrentDirectory( sizeof(Fred_exe_dir)-1, Fred_exe_dir );
strcat(Fred_exe_dir, "\\");
strcat(Fred_exe_dir, __argv[0]);
} else {
strcpy(Fred_exe_dir, __argv[0]);
}
strcpy(Fred_base_dir, Fred_exe_dir);
char *str_end = Fred_base_dir + strlen(Fred_base_dir) - 1; // last char
while (*str_end != '//' && *str_end != '\\')
str_end--;
*str_end = '\0';
// Parse command line for standard shell commands, DDE, file open
CCommandLineInfo cmdInfo;
ParseCommandLine(cmdInfo);
m_nCmdShow = Main_wnd_data.p.showCmd;
OnFileNew();
if(m_pMainWnd == NULL) return FALSE;
// Enable drag/drop open
m_pMainWnd->DragAcceptFiles();
h_cursor_move = LoadCursor(IDC_CURSOR1);
h_cursor_rotate = LoadCursor(IDC_CURSOR2);
return TRUE;
}
/////////////////////////////////////////////////////////////////////////////
// CAboutDlg dialog used for App About
class CAboutDlg : public CDialog
{
public:
CAboutDlg();
// Dialog Data
//{{AFX_DATA(CAboutDlg)
enum { IDD = IDD_ABOUTBOX };
//}}AFX_DATA
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CAboutDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
//{{AFX_MSG(CAboutDlg)
afx_msg void OnBug();
afx_msg void OnForums();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
{
//{{AFX_DATA_INIT(CAboutDlg)
//}}AFX_DATA_INIT
}
void CAboutDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CAboutDlg)
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
//{{AFX_MSG_MAP(CAboutDlg)
ON_BN_CLICKED(IDC_BUG, OnBug)
ON_BN_CLICKED(IDC_FORUMS, OnForums)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
// App command to run the dialog
void CFREDApp::OnAppAbout()
{
CAboutDlg aboutDlg;
aboutDlg.DoModal();
}
/////////////////////////////////////////////////////////////////////////////
// CFREDApp commands
char *edit_mode_text[] = {
"Ships",
"Waypoints",
};
/* "Grid",
"Wing",
"Object Relative"
};
*/
char *control_mode_text[] = {
"Camera",
"Object"
};
void show_control_mode(void)
{
CString str;
CMainFrame* pFrame = (CMainFrame*) AfxGetApp()->m_pMainWnd;
CStatusBar* pStatus = &pFrame->m_wndStatusBar;
//CStatusBarCtrl pStatusBarCtrl;
if (pStatus) {
// pStatus->GetStatusBarCtrl().SetParts(NUM_STATUS_PARTS, parts);
if (Marked)
str.Format("Marked: %d", Marked);
else
str = _T("");
pStatus->SetPaneText(1, str);
if (viewpoint)
str.Format("Viewpoint: %s", object_name(view_obj));
else
str.Format("Viewpoint: Camera");
pStatus->SetPaneText(2, str);
if (FREDDoc_ptr->IsModified())
pStatus->SetPaneText(3, "MODIFIED");
else
pStatus->SetPaneText(3, "");
str.Format("Units = %.1f Meters", The_grid->square_size);
pStatus->SetPaneText(4, str);
// pStatus->SetPaneText(4, "abcdefg");
// pStatus->SetPaneText(4, "1234567890!");
}
}
#define MAX_PENDING_MESSAGES 16
typedef struct {
int frame_to_process, hwnd, id, wparam, lparam;
} pending_message;
pending_message Pending_messages[MAX_PENDING_MESSAGES];
// Process messages that needed to wait until a frame had gone by.
void process_pending_messages(void)
{
int i;
for (i=0; i<MAX_PENDING_MESSAGES; i++)
if (Pending_messages[i].frame_to_process != -1)
if (Pending_messages[i].frame_to_process <= FrameCount) {
pending_message *pmp = &Pending_messages[i];
PostMessage((HWND) pmp->hwnd, pmp->id, pmp->wparam, pmp->lparam);
Pending_messages[i].frame_to_process = -1;
}
}
// Add a message to be processed to a buffer.
// Wait skip_count frames before processing.
void add_pending_message(HWND hwnd, int id, int wparam, int lparam, int skip_count)
{
int i;
for (i=0; i<MAX_PENDING_MESSAGES; i++)
if (Pending_messages[i].frame_to_process == -1) {
Pending_messages[i].hwnd = (int) hwnd;
Pending_messages[i].id = id;
Pending_messages[i].wparam = wparam;
Pending_messages[i].lparam = lparam;
Pending_messages[i].frame_to_process = FrameCount + skip_count;
}
}
void init_pending_messages(void)
{
int i;
for (i=0; i<MAX_PENDING_MESSAGES; i++)
Pending_messages[i].frame_to_process = -1;
}
// void win32_blit(HDC hSrcDC, HPALETTE hPalette, int x, int y, int w, int h )
#if 0
void win32_blit(void *xx, void *yy, int x, int y, int w, int h )
{
HPALETTE hOldPalette = NULL;
HDC hdc = GetDC(hwndApp);
if ( !hdc ) return;
if ( !fAppActive ) return;
if (hPalette) {
hOldPalette = SelectPalette(hdc, hPalette, FALSE);
RealizePalette( hdc );
}
BitBlt(hdc, 0, 0, w, h, hSrcDC, x, y, SRCCOPY);
if ( hOldPalette )
SelectPalette(hdc, hOldPalette, FALSE);
ReleaseDC( hwndApp, hdc );
}
#endif
BOOL CFREDApp::OnIdle(LONG lCount)
{
int adjust = 0;
CWnd *top, *wnd;
if (!Show_sexp_help)
adjust = -SEXP_HELP_BOX_SIZE;
if (!app_init) {
app_init = 1;
theApp.init_window(&Ship_wnd_data, &Ship_editor_dialog, adjust, 1);
theApp.init_window(&Wing_wnd_data, &Wing_editor_dialog, adjust, 1);
theApp.init_window(&Waypoint_wnd_data, &Waypoint_editor_dialog, 0, 1);
init_window(&Main_wnd_data, Fred_main_wnd);
Fred_main_wnd->SetWindowPos(&CWnd::wndTop, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
Ship_editor_dialog.calc_cue_height();
Wing_editor_dialog.calc_cue_height();
}
CWinApp::OnIdle(lCount);
// internal_integrity_check();
if (Update_ship) {
Ship_editor_dialog.initialize_data(1);
Update_ship = 0;
}
if (Update_wing) {
Wing_editor_dialog.initialize_data(1);
Update_wing = 0;
}
Prev_window = CFREDView::GetActiveWindow();
// Find the root window of the active window
wnd = top = Prev_window;
while (wnd) {
top = wnd;
wnd = wnd->GetParent();
}
// See if the active window is a child of Fred
if (Prev_window)
Fred_active = ( (top == Fred_main_wnd) || (top == Campaign_wnd) );
else
Fred_active = 0;
if (!Fred_active)
return FALSE; // if fred isn't active, don't waste any time with it.
game_do_frame(); // do stuff that needs doing, whether we render or not.
show_control_mode();
if (!Update_window)
return FALSE;
render_frame(); // "do the rendering!" Renders image to offscreen buffer
process_pending_messages();
FrameCount++;
return TRUE;
}
void update_map_window()
{
if (Fred_active) {
Update_window++; // on idle will handle the drawing already.
return;
}
if (!Fred_main_wnd)
return;
render_frame(); // "do the rendering!"
gr_flip();
show_control_mode();
process_pending_messages();
FrameCount++;
}
void CFREDApp::write_ini_file(int degree)
{
WriteProfileInt("Preferences", "User interface", User_interface);
WriteProfileInt("Preferences", "Show stars", Show_stars);
WriteProfileInt("Preferences", "Show grid positions", Show_grid_positions);
WriteProfileInt("Preferences", "Show coordinates", Show_coordinates);
WriteProfileInt("Preferences", "Show compass", Show_compass);
WriteProfileInt("Preferences", "Show ship models", Show_ship_models);
WriteProfileInt("Preferences", "Show ship info", Show_ship_info);
WriteProfileInt("Preferences", "Show outlines", Show_outlines);
WriteProfileInt("Preferences", "Physics speed", physics_speed);
WriteProfileInt("Preferences", "Physics rotation", physics_rot);
WriteProfileInt("Preferences", "Show waypoints", Show_waypoints);
WriteProfileInt("Preferences", "Show sexp help", Show_sexp_help);
WriteProfileInt("Preferences", "Hide ship cues", Hide_ship_cues);
WriteProfileInt("Preferences", "Hide wing cues", Hide_wing_cues);
WriteProfileInt("Preferences", "Autosave disabled", Autosave_disabled);
WriteProfileInt("Preferences", "Double fine gridlines", double_fine_gridlines);
WriteProfileInt("Preferences", "Anti aliased gridlines", Aa_gridlines);
WriteProfileInt("Preferences", "Show dock points", Show_dock_points);
WriteProfileInt("Preferences", "Show paths", Show_paths_fred);
WriteProfileInt("Preferences", "Lighting On", Lighting_on);
// Goober5000
WriteProfileInt("Preferences", "FS2 open format", Format_fs2_open);
WriteProfileInt("Preferences", "FS2 retail format", Format_fs2_retail);
WriteProfileInt("Preferences", "FS1 retail format", Format_fs1_retail);
if (!degree) {
record_window_data(&Waypoint_wnd_data, &Waypoint_editor_dialog);
record_window_data(&Wing_wnd_data, &Wing_editor_dialog);
record_window_data(&Ship_wnd_data, &Ship_editor_dialog);
record_window_data(&Main_wnd_data, Fred_main_wnd);
write_window("Main window", &Main_wnd_data);
write_window("Ship window", &Ship_wnd_data);
write_window("Wing window", &Wing_wnd_data);
write_window("Waypoint window", &Waypoint_wnd_data);
write_window("Object window", &Object_wnd_data);
write_window("Mission goals window", &Mission_goals_wnd_data);
write_window("Messages window", &Messages_wnd_data);
write_window("Player window", &Player_wnd_data);
write_window("Events window", &Events_wnd_data);
write_window("Bg window", &Bg_wnd_data);
write_window("Briefing window", &Briefing_wnd_data);
write_window("Reinforcement window", &Reinforcement_wnd_data);
write_window("Starfield window", &Starfield_wnd_data);
write_window("Asteroid window", &Asteroid_wnd_data);
write_window("Mission notes window", &Mission_notes_wnd_data);
}
}
void CFREDApp::write_window(char *name, window_data *wndd)
{
WriteProfileInt(name, "valid", wndd->valid);
WriteProfileInt(name, "length", wndd->p.length);
WriteProfileInt(name, "flags", wndd->p.flags);
WriteProfileInt(name, "showCmd", wndd->p.showCmd);
WriteProfileInt(name, "ptMinPosition.x", wndd->p.ptMinPosition.x);
WriteProfileInt(name, "ptMinPosition.y", wndd->p.ptMinPosition.y);
WriteProfileInt(name, "ptMaxPosition.x", wndd->p.ptMaxPosition.x);
WriteProfileInt(name, "ptMaxPosition.y", wndd->p.ptMaxPosition.y);
WriteProfileInt(name, "rcNormalPosition.left", wndd->p.rcNormalPosition.left);
WriteProfileInt(name, "rcNormalPosition.top", wndd->p.rcNormalPosition.top);
WriteProfileInt(name, "rcNormalPosition.right", wndd->p.rcNormalPosition.right);
WriteProfileInt(name, "rcNormalPosition.bottom", wndd->p.rcNormalPosition.bottom);
WriteProfileInt(name, "Visible", wndd->visible);
}
void CFREDApp::read_window(char *name, window_data *wndd)
{
wndd->processed = 0;
wndd->valid = GetProfileInt(name, "valid", FALSE);
wndd->p.length = GetProfileInt(name, "length", 0);
wndd->p.flags = GetProfileInt(name, "flags", 0);
wndd->p.showCmd = GetProfileInt(name, "showCmd", SW_SHOWMAXIMIZED);
wndd->p.ptMinPosition.x = GetProfileInt(name, "ptMinPosition.x", 0);
wndd->p.ptMinPosition.y = GetProfileInt(name, "ptMinPosition.y", 0);
wndd->p.ptMaxPosition.x = GetProfileInt(name, "ptMaxPosition.x", 0);
wndd->p.ptMaxPosition.y = GetProfileInt(name, "ptMaxPosition.y", 0);
wndd->p.rcNormalPosition.left = GetProfileInt(name, "rcNormalPosition.left", 0);
wndd->p.rcNormalPosition.top = GetProfileInt(name, "rcNormalPosition.top", 0);
wndd->p.rcNormalPosition.right = GetProfileInt(name, "rcNormalPosition.right", 0);
wndd->p.rcNormalPosition.bottom = GetProfileInt(name, "rcNormalPosition.bottom", 0);
wndd->visible = GetProfileInt(name, "Visible", 1);
}
int CFREDApp::init_window(window_data *wndd, CWnd *wnd, int adjust, int pre)
{
int width, height;
WINDOWPLACEMENT p;
if (pre && !wndd->visible)
return -1;
if (wndd->processed)
return -2;
Assert(wnd->GetSafeHwnd());
wnd->GetWindowPlacement(&p);
width = p.rcNormalPosition.right - p.rcNormalPosition.left;
height = p.rcNormalPosition.bottom - p.rcNormalPosition.top + adjust;
wndd->p.rcNormalPosition.right = wndd->p.rcNormalPosition.left + width;
wndd->p.rcNormalPosition.bottom = wndd->p.rcNormalPosition.top + height;
if (wndd->valid) {
wnd->SetWindowPlacement(&wndd->p);
// if (!wndd->visible)
// wnd->ShowWindow(SW_SHOW);
// else
// wnd->ShowWindow(SW_HIDE);
}
record_window_data(wndd, wnd);
wndd->processed = 1;
return 0;
}
void CFREDApp::record_window_data(window_data *wndd, CWnd *wnd)
{
wnd->GetWindowPlacement(&wndd->p);
wndd->visible = wnd->IsWindowVisible();
wndd->valid = TRUE;
}
void CAboutDlg::OnBug()
{
char *path = "http://mgo.maxgaming.net/mantis/login_page.php";
char buffer[MAX_PATH];
sprintf(buffer,"explorer.exe \"%s\"", path);
WinExec(buffer,SW_SHOW);
}
void CAboutDlg::OnForums()
{
char *path = "http://www.hard-light.net/forums/";
char buffer[MAX_PATH];
sprintf(buffer,"explorer.exe \"%s\"", path);
WinExec(buffer,SW_SHOW);
}
int CFREDApp::ExitInstance()
{
return CWinApp::ExitInstance();
}
-241
View File
@@ -1,241 +0,0 @@
/*
* Copyright (C) Volition, Inc. 1999. All rights reserved.
*
* All source code herein is the property of Volition, Inc. You may not sell
* or otherwise commercially exploit the source or things you created based on the
* source.
*
*/
/*
* $Logfile: /Freespace2/code/FRED2/FRED.h $
* $Revision: 1.1 $
* $Date: 2006-01-19 02:27:31 $
* $Author: Goober5000 $
*
* FRED.h : main header file for the FRED application
* Global editor dialog box classes are instantiated here, initializes the
* application (MFC level at least), processes the INI file.
*
* $Log: not supported by cvs2svn $
* Revision 1.5 2005/07/13 02:40:50 Goober5000
* remove PreProcDefine #includes in FRED
* --Goober5000
*
* Revision 1.4 2004/09/29 17:26:32 Kazan
* PreProfDefines.h includes for fred2
*
* Revision 1.3 2004/02/05 23:23:19 randomtiger
* Merging OGL Fred into normal Fred, no conflicts, should be perfect
*
* Revision 1.2.2.1 2004/01/24 13:00:43 randomtiger
* Implemented basic OGL HT&L but some drawing routines missing from cobe.lib so keeping turned off for now.
* Added lighting menu option and made about dialog more useful.
* Ship menu now defaults to the first entry.
* Loads of debug to try and trap crashes.
*
* Revision 1.2 2002/08/15 01:06:34 penguin
* Include filename reorg (to coordinate w/ fs2_open)
*
* Revision 1.1.1.1 2002/07/15 03:10:56 inquisitor
* Initial FRED2 Checking
*
*
* 2 10/07/98 6:28p Dave
* Initial checkin. Renamed all relevant stuff to be Fred2 instead of
* Fred. Globalized mission and campaign file extensions. Removed Silent
* Threat specific code.
*
* 1 10/07/98 3:01p Dave
*
* 1 10/07/98 3:00p Dave
*
* 32 3/23/98 4:04p Hoffoss
* Fixed dialog window initialization so it looks better at startup (they
* don't flash on for a second).
*
* 31 9/09/97 10:25a Hoffoss
* Fixed a potential problem.
*
* 30 8/01/97 3:10p Hoffoss
* Made Sexp help hidable.
*
* 29 6/18/97 11:46a Hoffoss
* Fixed initial order object reference updating and added briefing dialog
* window tracking data.
*
* 28 6/05/97 6:10p Hoffoss
* Added features: Autosaving, object hiding. Also fixed some minor bugs.
*
* 27 6/02/97 11:52a Hoffoss
* Custom cursors displayed when over objects in different modes.
*
* 26 5/29/97 5:15p Allender
* fixed macro for MODIFY so that it will work properly within 'if'
* statements
*
* 25 4/29/97 12:24p Adam
* JAS: Added code for delayed point to vec. Fixed some FRED
* sequencing problems with g3_start_frame / g3_end_frame.
*
* 24 4/17/97 2:01p Hoffoss
* All dialog box window states are saved between sessions now.
*
* 23 4/01/97 11:07p Mike
* Clean up game sequencing functions. Get rid of Multiplayer and add
* Game_mode. Add SystemVars.cpp
*
* 22 3/26/97 11:45a Hoffoss
* Fred uses fvi_ray_* functions now (as much as possible) for checking
* mouse selection stuff.
*
* 21 2/28/97 11:31a Hoffoss
* Implemented modeless dialog saving and restoring, and changed some
* variables names.
*
* 20 2/27/97 5:54p Hoffoss
* Implemented support for saving and restoring window positions.
*
* 19 2/24/97 12:50p Hoffoss
* First attempt at non-continuous redrawing.
*
* 18 2/20/97 5:42p Hoffoss
* Fixed bug in modification checking and updating macro.
*
* 17 2/20/97 4:28p Hoffoss
* Added modification tracking to ship editor dialog box, and support
* functions.
*
* 16 2/20/97 4:03p Hoffoss
* Several ToDo items: new reinforcement clears arrival cue, reinforcement
* control from ship and wing dialogs, show grid toggle.
*
* 15 2/17/97 5:28p Hoffoss
* Checked RCS headers, added them were missing, changing description to
* something better, etc where needed.
*
* 14 2/12/97 12:25p Hoffoss
* Expanded on global error checker, added initial orders conflict
* checking and warning, added waypoint editor dialog and code.
*
* 13 1/30/97 2:24p Hoffoss
* Added remaining mission file structures and implemented load/save of
* them.
*
* $NoKeywords: $
*/
#ifndef __AFXWIN_H__
#error include 'stdafx.h' before including this file for PCH
#endif
#include "globalincs/systemvars.h" // Low level variables, common to FreeSpace and Fred
#include "resource.h" // main symbols
#include "mission/missionparse.h"
#include "ShipEditorDlg.h"
#include "wing_editor.h"
#include "WaypointPathDlg.h"
#include "BgBitmapDlg.h"
#include "BriefingEditorDlg.h"
#include "globalincs/systemvars.h"
#define MODIFY(a, b) do { \
if (a != (b)) { \
a = (b); \
set_modified(); \
} \
} while(0)
#define F_RENDER_SHIP_MODELS 0x01
#define F_RENDER_SHIP_ICONS 0x02
// user interface types
#define HOFFOSS_INTERFACE 1
#define ALLENDER_INTERFACE 2
typedef struct window_data {
WINDOWPLACEMENT p;
int visible;
int valid;
int processed;
} window_data;
/////////////////////////////////////////////////////////////////////////////
// CFREDApp:
// See FRED.cpp for the implementation of this class
//
class CFREDApp : public CWinApp
{
int app_init;
public:
void record_window_data(window_data *wndd, CWnd *wnd);
int init_window(window_data *wndd, CWnd *wnd, int adjust = 0, int pre = 0);
void read_window(char *name, window_data *wndd);
void write_window(char *name, window_data *wndd);
void write_ini_file(int degree = 0);
CFREDApp();
~CFREDApp();
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CFREDApp)
public:
virtual BOOL InitInstance();
virtual BOOL OnIdle(LONG lCount);
virtual int ExitInstance();
//}}AFX_VIRTUAL
// Implementation
//{{AFX_MSG(CFREDApp)
afx_msg void OnAppAbout();
// NOTE - the ClassWizard will add and remove member functions here.
// DO NOT EDIT what you see in these blocks of generated code !
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
// Add a message to be processed at the end of this frame.
// This is useful if you need the display to update before it's useful
// to process the message. For example, right click brings up a popup menu.
// But the menu it brings up depends on where you right clicked. If you
// right click on a ship, you get a message that pertains to the chosen
// ship. It is useful to have a visual indication that you have changed the
// current ship.
void add_pending_message(HWND hwnd, int id, int wparam, int lparam, int skip_count);
void init_pending_messages(void);
void update_map_window();
extern int User_interface;
extern int Fred_active;
extern int Update_window;
extern HCURSOR h_cursor_move, h_cursor_rotate;
extern CWnd *Prev_window;
extern CShipEditorDlg Ship_editor_dialog;
extern wing_editor Wing_editor_dialog;
extern waypoint_path_dlg Waypoint_editor_dialog;
extern bg_bitmap_dlg *Bg_bitmap_dialog;
extern briefing_editor_dlg *Briefing_dialog;
extern CFREDApp theApp;
extern window_data Main_wnd_data;
extern window_data Ship_wnd_data;
extern window_data Wing_wnd_data;
extern window_data Object_wnd_data;
extern window_data Mission_goals_wnd_data;
extern window_data Messages_wnd_data;
extern window_data Player_wnd_data;
extern window_data Events_wnd_data;
extern window_data Bg_wnd_data;
extern window_data Briefing_wnd_data;
extern window_data Reinforcement_wnd_data;
extern window_data Waypoint_wnd_data;
extern window_data Starfield_wnd_data;
extern window_data Asteroid_wnd_data;
extern window_data Mission_notes_wnd_data;
-2867
View File
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
-208
View File
@@ -1,208 +0,0 @@
/*
* Copyright (C) Volition, Inc. 1999. All rights reserved.
*
* All source code herein is the property of Volition, Inc. You may not sell
* or otherwise commercially exploit the source or things you created based on the
* source.
*
*/
/*
* $Logfile: /Freespace2/code/FRED2/FREDDoc.h $
* $Revision: 1.2 $
* $Date: 2006-01-31 01:53:36 $
* $Author: Goober5000 $
*
* FREDDoc.h : interface of the CFREDDoc class
* Document class for document/view architechure, which we don't really use in
* Fred, but MFC forces you do use like it or not. Handles loading/saving
* mainly. Most of the MFC related stuff is handled in FredView.
*
* $Log: not supported by cvs2svn $
* Revision 1.1 2006/01/19 02:27:31 Goober5000
* import FRED2 back into fs2_open module
* --Goober5000
*
* Revision 1.8 2005/07/13 02:40:50 Goober5000
* remove PreProcDefine #includes in FRED
* --Goober5000
*
* Revision 1.7 2005/04/13 20:02:08 chhogg
* Changed vector to vec3d for Fred.
*
* Revision 1.6 2005/03/29 03:43:11 phreak
* ai directory fixes as well as fixes for the new jump node code
*
* Revision 1.5 2004/09/29 17:26:32 Kazan
* PreProfDefines.h includes for fred2
*
* Revision 1.4 2003/09/30 04:05:08 Goober5000
* updated FRED to import FS1 default weapons loadouts as well as missions
* --Goober5000
*
* Revision 1.3 2003/09/28 21:22:58 Goober5000
* added the option to import FSM missions, added a replace function, spruced
* up my $player, $rank, etc. code, and fixed encrypt being misspelled as 'encrpyt'
* --Goober5000
*
* Revision 1.2 2002/08/15 01:06:34 penguin
* Include filename reorg (to coordinate w/ fs2_open)
*
* Revision 1.1.1.1 2002/07/15 03:10:57 inquisitor
* Initial FRED2 Checking
*
*
* 2 10/07/98 6:28p Dave
* Initial checkin. Renamed all relevant stuff to be Fred2 instead of
* Fred. Globalized mission and campaign file extensions. Removed Silent
* Threat specific code.
*
* 1 10/07/98 3:01p Dave
*
* 1 10/07/98 3:00p Dave
*
* 15 8/17/97 10:22p Hoffoss
* Fixed several bugs in Fred with Undo feature. In the process, recoded
* a lot of CFile.cpp.
*
* 14 8/13/97 5:49p Hoffoss
* Fixed bugs, made additions.
*
* 13 8/13/97 12:46p Hoffoss
* Added campaign error checker, accelerator table, and mission goal data
* listings to sexp tree right click menu.
*
* 12 6/09/97 4:57p Hoffoss
* Added autosave and undo to Fred.
*
* 11 6/05/97 6:10p Hoffoss
* Added features: Autosaving, object hiding. Also fixed some minor bugs.
*
* 10 5/21/97 5:42p Hoffoss
* Added features requested on Todo list.
*
* 9 2/20/97 4:03p Hoffoss
* Several ToDo items: new reinforcement clears arrival cue, reinforcement
* control from ship and wing dialogs, show grid toggle.
*
* 8 2/17/97 5:28p Hoffoss
* Checked RCS headers, added them were missing, changing description to
* something better, etc where needed.
*
* 14 2/12/97 12:25p Hoffoss
* Expanded on global error checker, added initial orders conflict
* checking and warning, added waypoint editor dialog and code.
*
* 13 1/30/97 2:24p Hoffoss
* Added remaining mission file structures and implemented load/save of
* them.
*
* $NoKeywords: $
*/
#ifndef _FREDDOC_H
#define _FREDDOC_H
#include "ai/ailocal.h"
#include "MissionSave.h"
#define MISSION_BACKUP_NAME "Backup"
#define US_WORLD_CHANGED 0x01
#define US_VIEW_CHANGED 0x02
class CFREDDoc : public CDocument
{
protected: // create from serialization only
CFREDDoc();
DECLARE_DYNCREATE(CFREDDoc)
// Attributes
public:
int check_undo();
int autoload();
int load_mission(char *pathname, int flags = 0);
int autosave(char *desc);
int save_matrix(matrix &m, FILE *fp);
int save_vector(vec3d &v, FILE *fp);
BOOL confirm_deleting;
BOOL show_capital_ships;
BOOL show_elevations;
BOOL show_fighters;
BOOL show_grid;
BOOL show_misc_objects;
BOOL show_planets;
BOOL show_waypoints;
BOOL show_starfield;
char mission_pathname[256];
// Operations
public:
CString undo_desc[BACKUP_DEPTH + 1];
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CFREDDoc)
public:
virtual BOOL OnNewDocument();
virtual void Serialize(CArchive& ar);
virtual void OnEditClearAll();
virtual void DeleteContents();
virtual BOOL OnOpenDocument(LPCTSTR lpszPathName);
virtual BOOL OnSaveDocument(LPCTSTR lpszPathName);
//}}AFX_VIRTUAL
// Implementation
public:
virtual ~CFREDDoc();
static void UpdateStatus(int flags = US_WORLD_CHANGED);
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext &dc) const;
#endif
protected:
// Generated message map functions
protected:
//{{AFX_MSG(CFREDDoc)
afx_msg void OnEditDelete();
afx_msg void OnDuplicate();
afx_msg void OnEditCopy();
afx_msg void OnEditCut();
afx_msg void OnEditHold();
afx_msg void OnEditFetch();
afx_msg void OnEditPaste();
afx_msg void OnEditUndo();
afx_msg void OnFilePreferences();
afx_msg void OnFileSave();
afx_msg void OnFileNew();
afx_msg void editor_init_mission();
afx_msg void OnFileImportFSM();
afx_msg void OnFileImportWeapons();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
private:
int save_waypoint_list(waypoint_list &w, FILE *fp);
int save_waypoints(FILE *fp);
int save_goals(FILE *fp);
int save_wings(FILE *fp);
int save_objects(FILE *fp);
int save_players(FILE *fp);
int save_briefing_info(FILE *fp);
int save_plot_info(FILE *fp);
int save_mission_info(FILE *FP);
};
extern int Local_modified;
extern int Undo_available;
extern int Undo_count;
extern CFREDDoc *FREDDoc_ptr;
void set_modified(BOOL arg = TRUE);
/////////////////////////////////////////////////////////////////////////////
#endif
File diff suppressed because it is too large. Load diff
-167
View File
@@ -1,167 +0,0 @@
/*
* Copyright (C) Volition, Inc. 1999. All rights reserved.
*
* All source code herein is the property of Volition, Inc. You may not sell
* or otherwise commercially exploit the source or things you created based on the
* source.
*
*/
/*
* $Logfile: /Freespace2/code/FRED2/FredRender.h $
* $Revision: 1.1 $
* $Date: 2006-01-19 02:27:31 $
* $Author: Goober5000 $
*
* Handles all view rendering in FRED.
*
* $Log: not supported by cvs2svn $
* Revision 1.5 2005/07/13 02:40:50 Goober5000
* remove PreProcDefine #includes in FRED
* --Goober5000
*
* Revision 1.4 2005/04/13 20:02:08 chhogg
* Changed vector to vec3d for Fred.
*
* Revision 1.3 2004/09/29 17:26:32 Kazan
* PreProfDefines.h includes for fred2
*
* Revision 1.2 2002/08/15 01:06:34 penguin
* Include filename reorg (to coordinate w/ fs2_open)
*
* Revision 1.1.1.1 2002/07/15 03:10:57 inquisitor
* Initial FRED2 Checking
*
*
* 2 10/07/98 6:28p Dave
* Initial checkin. Renamed all relevant stuff to be Fred2 instead of
* Fred. Globalized mission and campaign file extensions. Removed Silent
* Threat specific code.
*
* 1 10/07/98 3:01p Dave
*
* 1 10/07/98 3:00p Dave
*
* 26 3/19/98 11:41a Hoffoss
* Fixed problems with rendering and reading of flying controls in Fred.
*
* 25 10/30/97 3:30p Hoffoss
* Made anti-aliased gridlines an option in Fred.
*
* 24 9/09/97 2:12p Hoffoss
* Added code to allow briefing editor view to be a 1:1 pixel size fixed
* as the FreeSpace view will have.
*
* 23 8/25/97 5:58p Hoffoss
* Created menu items for keypress functions in Fred, and fixed bug this
* uncovered with wing_delete function.
*
* 22 8/07/97 6:01p Hoffoss
* Added a rotate about selected object button to toolbar and
* functionality, as requested by Comet.
*
* 21 8/06/97 6:10p Hoffoss
* Changed Fred to display a forced aspect ratio while briefing editor is
* open. This aspect ratio is the same as the briefing view in FreeSpace,
* so icons appear on and off screen the same as would be in FreeSpace.
*
* 20 6/26/97 5:18p Hoffoss
* Major rework of briefing editor functionality.
*
* 19 6/23/97 3:00p Hoffoss
* Added a define.
*
* 18 6/23/97 2:58p Hoffoss
* Added briefing lookat point variables.
*
* 17 6/18/97 11:36p Lawrance
* move grid rendering code to MissionGrid.cpp
*
* 16 6/12/97 11:27a Lawrance
* separating FRED dependant briefing code
*
* 15 3/06/97 3:35p Hoffoss
* Added Show_outline stuff, moved show options to the view menu, fixed a
* bug in message dialog editor.
*
* 14 2/20/97 4:03p Hoffoss
* Several ToDo items: new reinforcement clears arrival cue, reinforcement
* control from ship and wing dialogs, show grid toggle.
*
* 13 12/02/96 3:36p Hoffoss
* Show horizon now implemented.
*
* 12 11/22/96 12:24p Hoffoss
* Editor functionality added.
*
* 11 11/21/96 12:52p Hoffoss
* Changes to flying controls, etc.
*
* 10 11/21/96 9:20a Hoffoss
* New show distances feature.
*
* 9 11/20/96 5:16p Hoffoss
* New grid system working as suggested.
*
* 8 11/20/96 10:01a Hoffoss
* A few minor improvements.
*
* 7 11/19/96 9:50a Hoffoss
* New interface working, but not finished yet.
*
* 6 11/15/96 1:43p Hoffoss
* Improvements to the Ship Dialog editor window. It is now an
* independant window that updates data correctly.
*
* 5 11/14/96 10:43a Hoffoss
* Made changes to grid display and how it works, etc.
*
* 4 11/13/96 10:15a Hoffoss
* Waypoint editing added, but not quite finished yet.
*
* 3 11/12/96 11:14a Hoffoss
* Everything check in because I don't know what's changed and what's not
* to prevent compiling.
*
* 2 11/11/96 3:47p Hoffoss
* Milestone Checkin.
*
* 1 10/29/96 12:17p Hoffoss
*
* $NoKeywords: $
*/
#include "mission/missiongrid.h"
#define BRIEFING_LOOKAT_POINT_ID 99999
extern int Aa_gridlines;
extern int player_start1;
extern int Editing_mode;
extern int Control_mode;
extern int Show_grid;
extern int Show_grid_positions;
extern int Show_coordinates;
extern int Show_outlines;
extern int Single_axis_constraint;
extern int Show_distances;
extern int Universal_heading;
extern int Flying_controls_mode;
extern int Group_rotate;
extern int Show_horizon;
extern int Lookat_mode;
extern int True_rw, True_rh;
extern int Fixed_briefing_size;
extern vec3d Constraint, Anticonstraint;
extern vec3d Tp1, Tp2; // test points
extern physics_info view_physics;
extern vec3d view_pos, eye_pos;
extern matrix view_orient, eye_orient;
void fred_render_init();
void generate_starfield();
void move_mouse(int btn, int mdx, int mdy);
void game_do_frame();
void render_frame();
void level_controlled();
void verticalize_controlled();
-721
View File
@@ -1,721 +0,0 @@
/*
* Copyright (C) Volition, Inc. 1999. All rights reserved.
*
* All source code herein is the property of Volition, Inc. You may not sell
* or otherwise commercially exploit the source or things you created based on the
* source.
*
*/
/*
* $Logfile: /Freespace2/code/Fred2/FredStubs.cpp $
* $Revision: 1.4.2.3 $
* $Date: 2007-09-29 13:58:33 $
* $Author: karajorma $
*
* Bogus C file for functions and variable stubs that Fred needs because it
* includes some libraries that makes functions calls to other libraries that FRED
* doesn't include. In a perfect world, programmers would work harder to keep
* the code they write more self-contained and not tie all the code everywhere
* to each other.
*
* $Log: not supported by cvs2svn $
* Revision 1.4.2.2 2007/02/11 09:35:11 taylor
* add VALID_FNAME() macro and put it around a few places (more to come)
* clean out some old variables
* move CLAMP() macro from opengl header to global header
* update COUNT_ESTIMATE to match new bmpman changes
*
* Revision 1.4.2.1 2006/07/14 03:49:33 taylor
* add missing stub for game_get_overall_frametime()
*
* Revision 1.4 2006/04/20 06:32:01 Goober5000
* proper capitalization according to Volition
*
* Revision 1.3 2006/03/18 21:23:38 taylor
* add framerate var since it's contained in freespace.cpp and that's not used in a FRED2 compile
*
* Revision 1.2 2006/01/20 05:35:59 wmcoolmon
* Updated FREDStubs.cpp to most current version
*
* Revision 1.1 2006/01/19 02:27:31 Goober5000
* import FRED2 back into fs2_open module
* --Goober5000
*
* Revision 1.12 2005/12/06 21:45:04 taylor
* stub fix for get_version_string() change
*
* Revision 1.11 2005/10/16 18:49:26 taylor
* add Networking_disabled
*
* Revision 1.10 2005/08/28 20:36:38 phreak
* Added "Multi_ping_timestamp" variable to fred stubs
*
* Revision 1.9 2005/06/20 16:07:24 phreak
* added game_pause() and game_unpause() to fred stubs.
* fixed models rendering out of position.
*
* Revision 1.8 2005/05/18 05:19:15 phreak
* stub added for game_feature_disabled_popup()
*
* Revision 1.7 2005/04/13 20:11:06 chhogg
* Changed vector to vec3d for Fred.
*
* Revision 1.6 2005/03/19 23:17:01 phreak
* Added the "cube_map_drawen" (lol) variable to the stub for fred to compile
*
* Revision 1.5 2005/03/06 22:43:14 wmcoolmon
* Fixx0red some of the jump node errors
*
* Revision 1.4 2004/04/29 03:35:47 wmcoolmon
* Added alt_tab_pause() stub
*
* Revision 1.3 2004/03/15 12:14:46 randomtiger
* Fixed a whole heap of problems with Fred introduced by changes to global vars.
*
* Revision 1.2 2002/08/15 01:06:34 penguin
* Include filename reorg (to coordinate w/ fs2_open)
*
* Revision 1.1.1.1 2002/07/15 03:10:57 inquisitor
* Initial FRED2 Checking
*
*
* 26 9/27/99 10:13a Jefff
* another stub for not_in_demo popup
*
* 25 9/13/99 5:16p Dave
* New stubs
*
* 24 9/06/99 8:43p Dave
* Checked in some stubs.
*
* 23 9/01/99 10:14a Dave
* Pirate bob.
*
* 22 8/26/99 10:15a Dave
* Don't apply beam whacks to docked ships.
*
* 21 8/04/99 2:24a Dave
* Fixed escort gauge ordering for dogfight.
*
* 20 7/08/99 10:53a Dave
* New multiplayer interpolation scheme. Not 100% done yet, but still
* better than the old way.
*
* 19 6/10/99 11:11a Jamesa
* More stubs.
*
* 18 4/12/99 10:36a Johnson
* Stub for game_hacked_data
*
* 17 3/19/99 6:15p Dave
* Stubs
*
* 16 2/23/99 7:03p Dave
* Rewrote a horribly mangled and evil team loadout dialog. Bugs gone.
*
* 15 2/17/99 2:11p Dave
* First full run of squad war. All freespace and tracker side stuff
* works.
*
* 14 1/14/99 12:49a Dave
* Made an attempt to put briefing icons back into FRED.
*
* 13 1/12/99 5:45p Dave
* Whole slew of new stubs.
*
* 12 1/08/99 2:07p Dave
* Temporary checkin. Super early support for AWACS and beam weapons.
*
* 11 12/06/98 2:36p Dave
* Stub.
*
* 10 12/03/98 10:14a Dave
*
* 9 11/30/98 5:32p Dave
* Fixed up Fred support for software mode.
*
* 8 11/19/98 8:05a Dave
* Psnet stub
*
* 7 11/12/98 12:12a Dave
* Stub for new turret fired packet.
*
* 6 10/21/98 9:56a Dave
* Fixed stupid linker thing.
*
* 5 10/13/98 9:57a Dave
*
* 4 10/13/98 9:27a Dave
* Started neatening up freespace.h
*
* 3 10/12/98 1:01p Dave
* Fixed object rotation bug (uninitialized data). Changed a few stubs to
* correspond to new var names.
*
* 2 10/07/98 6:28p Dave
* Initial checkin. Renamed all relevant stuff to be Fred2 instead of
* Fred. Globalized mission and campaign file extensions. Removed Silent
* Threat specific code.
*
* 1 10/07/98 3:01p Dave
*
* 1 10/07/98 3:00p Dave
*
* 238 9/20/98 9:46p Dave
* send_change_iff_packet() stub.
*
* 237 9/15/98 11:44a Dave
* Renamed builtin ships and wepaons appropriately in FRED. Put in scoring
* scale factors. Fixed standalone filtering of MD missions to non-MD
* hosts.
*
* 236 9/12/98 2:17p Dave
* Multiplayer reinforcement fix stub.
*
* 235 8/28/98 3:28p Dave
* EMP effect done. AI effects may need some tweaking as required.
*
* 234 8/26/98 2:14p Dave
*
* 233 8/25/98 1:48p Dave
* First rev of EMP effect. Player side stuff basically done. Next comes
* AI code.
*
* 232 8/11/98 9:21a Dave
* new TvT stub.
*
* 231 7/14/98 4:57p Allender
*
* 230 7/06/98 5:08p Hoffoss
*
* 229 6/22/98 11:02a Hoffoss
*
* 228 6/09/98 12:12p Hoffoss
* Added XSTR localization code.
*
* 227 6/07/98 3:25p Lawrance
*
* 226 5/25/98 2:20p Allender
* scoring_level_close()
*
* 225 5/23/98 6:53p Allender
* AL: add Skill_level to stubs
*
* 224 5/21/98 4:14a Allender
*
* 223 5/18/98 1:56a Allender
* respawn limit to 999 max
*
* 222 5/18/98 12:41a Allender
* fixed subsystem problems on clients (i.e. not reporting properly on
* damage indicator). Fixed ingame join problem with respawns. minor
* comm menu stuff
*
* 221 5/15/98 11:04p Sandeep
* fixed a bug caused by Alan. :)
*
* 220 5/14/98 2:24p Sandeep
*
* 219 5/13/98 11:34p Mike
* Model caching system.
*
* 218 5/13/98 11:16p Allender
*
* 217 5/09/98 10:35p Allender
*
* 216 5/09/98 9:49p Allender
*
* 215 5/09/98 3:38p Sandeep
*
* 214 5/08/98 11:20a Allender
* fix ingame join trouble. Small messaging fix. Enable collisions for
* friendlies again
*
* 213 5/05/98 5:12p Sandeep
*
* 212 5/05/98 11:10a Johnson
* Fix help overlay link errors
*
* 211 5/04/98 6:06p Lawrance
* Make red alert mode work!
*
* 210 4/30/98 9:15a Allender
*
* 209 4/28/98 8:07a Jasen
* JAS: Stubbed in cdrom_path
*
* 208 4/27/98 10:17p Allender
*
* 207 4/27/98 8:56p Jim
* stub for modifcation of scoring_eval_hit
*
* 206 4/26/98 12:42p Sandeep
* stubbed send_turret_fired_packet. Stop breaking fred! :)
*
* 205 4/25/98 1:57p Mike
* Oops, someone else had just stubbed out big_explosion_flash.
*
* 204 4/25/98 1:56p Mike
* Stub out big_explosion_flash().
*
* 203 4/25/98 1:20p Jim
* stub for big_explosion_flash
*
* 202 4/20/98 8:54a Mike
* Stub opposing_team_mask().
*
* 201 4/13/98 9:53p Hoffoss
*
* 200 4/13/98 2:48p Allender
* countermeasure sucess packet
*
* 199 4/12/98 12:15p Jim
* Stub out Subspace_effect
*
* 198 4/10/98 12:16p Allender
* fix ship hit kill and debris packets
*
* 197 4/10/98 9:15a Allender
*
* 196 4/09/98 8:42p Sandeep
*
* 195 4/09/98 12:46a Sandeep
*
* 194 4/08/98 8:37a Mike
* Stub out hud_find_target_distance().
*
* 193 4/07/98 10:11p Lawrance
* stub out hud_communications_state
*
* 192 4/07/98 2:52p Andsager
* stub out Energy_levels
*
* 191 4/05/98 10:33a John
* Stubbed in a variable
*
* 190 3/31/98 5:11p John
* Removed demo/save/restore. Made NDEBUG defined compile. Removed a
* bunch of debug stuff out of player file. Made model code be able to
* unload models and malloc out only however many models are needed.
*
* 189 3/30/98 10:26a Hoffoss
*
* 188 3/26/98 6:41p Lawrance
* stub out bmap paging function
*
* 187 3/19/98 10:26a Dave
* Put in several HUD_offset problems.
*
* 186 3/17/98 10:27a Johnson
* AL: stub out some asteroid network calls
*
* 185 3/14/98 4:57p Lawrance
* stub out some wingman status functions
*
* 184 3/12/98 5:36p John
* Took out any unused shaders. Made shader code take rgbc instead of
* matrix and vector since noone used it like a matrix and it would have
* been impossible to do in hardware. Made Glide implement a basic
* shader for online help.
*
* 183 3/12/98 2:21p Johnson
* Fixed some Fred bugs related to jump nodes.
*
* 182 3/11/98 10:22p Dave
* Laid groundwork for new observer HUD. Split up multi respawning into
* its own module.
*
* 181 3/11/98 9:36p Allender
*
* 180 3/11/98 12:25a Lawrance
* stub yet another HUD function.
*
* 179 3/10/98 5:08p Allender
* fixed up multiplayer death messages (I hope). changes in object update
* packets
*
* 178 3/09/98 9:54p Hoffoss
*
* 177 3/09/98 5:03p Lawrance
* stub hud function
*
* 176 3/09/98 4:30p Allender
* multiplayer secondary weapon changes. red-alert and cargo-known-delay
* sexpressions. Add time cargo revealed to ship structure
*
* 175 3/09/98 10:50a Hoffoss
*
* 174 3/09/98 12:12a Lawrance
* Add support for Red Alert missions
*
* 173 3/08/98 12:03p Allender
* changed how ship network signatures are handed out. Done at mission
* load time. Space reserved in wings for all waves/counts for their
* signatures. Fixed some secondary firing issues
*
* 172 3/06/98 5:10p Allender
* made time to: field in extended targetbox use support time to dock code
* for all docking shpis. Only display for waypoints and docking (not
* undocking). Small fixups to message menu -- not allowing depart when
* disabled. Depart is now by default ignored for all non-small ships
*
* 171 3/05/98 11:15p Hoffoss
* Changed non-game key checking to use game_check_key() instead of
* game_poll().
*
* 170 3/04/98 5:04p Hoffoss
* stub out hud function
*
* 169 3/03/98 1:21a Lawrance
* stub out some hud escort functions
*
* 168 2/27/98 10:34a Johnson
*
* 167 2/24/98 3:08p Allender
*
* 166 2/23/98 5:07p Allender
* made net_signature in the object structure an unsigned short. Created
* permanent and non-permanent network object "pools".
*
* 165 2/19/98 7:06p Sandeep
*
* 164 2/18/98 10:34p Allender
* repair/rearm system (for single and multi) about finished.
* dock/undock and ai goals packets implemented for multiplayer
*
* 163 2/17/98 5:03p Allender
* major cdhanges to rearm repair code. All flag and variable setting
* done in one function. A little more work to do. Fix bug in squad
* messaging when hotkey was used on invalid target
*
* 162 2/17/98 8:58a Mike
* Resolve link errors with stubs in FredStubs.
*
* 161 2/12/98 5:12p Lawrance
* stub out hud function
*
* 160 2/11/98 9:44p Allender
* rearm repair code fixes. hud support view shows abort status. New
* support ship killed message. More network stats
*
* 159 2/11/98 5:47p Dave
* multiplayer packet function stub
*
* 158 2/10/98 9:55a Lawrance
* stub out cmeasure function
*
* 157 1/29/98 5:22p Dave
* Made ingame join ignore bad packets more gracefully.
*
* 156 1/29/98 9:00a Allender
* yet more stubs
*
* 155 1/28/98 7:31p Lawrance
* stub out some more hud stuff
*
* 154 1/24/98 4:00p Lawrance
* stub out some new hud functions
*
* 153 1/22/98 11:46p Hoffoss
* Fixed linking problem with Fred.
*
* 152 1/20/98 4:45p Allender
* more, uh..., umm...., more stubs -- yeah, that's it
*
* 151 1/20/98 11:43a Sandeep
* fixed unresolved external
*
* 150 1/17/98 12:35a Sandeep
* fixed fred stub build error
*
* 149 1/16/98 10:40a Lawrance
* stub out hud function
*
* 148 1/14/98 5:22p Allender
* save/restore hotkey selections when replaying the same mission
*
* 147 1/13/98 5:37p Dave
* Reworked a lot of standalone interface code. Put in single and
* multiplayer popups for death sequence. Solidified multiplayer kick
* code.
*
* 146 1/12/98 9:29p Mike
* Stub out send_mission_goal_info_packet().
*
* 145 1/10/98 1:22a Lawrance
* fix link error in FRED
*
* 144 1/07/98 4:40p Allender
* minor modification to special messages. Fixed cargo_revealed problem
* for multiplayer and problem with is-cargo-known sexpression
*
* 143 1/05/98 10:06p Lawrance
* stub out some HUD functions
*
* 142 1/02/98 10:20p Lawrance
* stub out hud_set_default_color()
*
* 141 1/02/98 9:12p Lawrance
* remove some obsolete stubs
*
* 140 12/24/97 9:57p Lawrance
* remove stub
*
* 139 12/24/97 3:37p Hoffoss
* Moved control config stuff to seperate library to Fred can access it as
* well.
*
* 138 12/19/97 2:01p Johnson
* added stubs for game_flash
*
* 137 12/19/97 11:56a John
* Added texturing to missilie trails. Took out Alan's old sphere
* debugging code. Added palette flash effect code.
*
* 136 12/19/97 11:21a Hoffoss
*
* 135 12/18/97 8:46p Lawrance
* Move IFF_color definitions from HUD->ship, so FRED can use them.
*
* 134 12/16/97 9:32p Lawrance
* stub out demo_query_debug()
*
* 133 12/16/97 6:20p Hoffoss
* Added more debugging code for demos, and fixed a bug in demo
* recording/playback.
*
* $NoKeywords: $
*/
#include "globalincs/pstypes.h"
#include "object/object.h"
#include "io/key.h"
#include "ship/ship.h"
#include "graphics/2d.h"
#include "mission/missionparse.h"
#include "network/psnet.h"
#include "stats/scoring.h"
#include "cfile/cfile.h"
float flFrametime;
int game_zbuffer = 1;
int Current_mission = 0xdeadbeef;
char **Builtin_mission_names;
char Game_current_mission_filename[MAX_FILENAME_LEN];
CFILE *Working_demo;
struct beam_info;
bool Env_cubemap_drawn = false;
int Multi_ping_timestamp = -1;
int Sun_drew = 0;
int Networking_disabled = 0;
void init_ets(struct object*){}
control_info PlayerControls;
char * Game_CDROM_dir = NULL;
void game_flash(float r, float g, float b )
{
}
void freespace_menu_background()
{
gr_reset_clip();
gr_clear();
}
int My_observer_num;
void std_update_goals()
{
}
void os_close()
{
}
int gameseq_get_state(void)
{
return 0;
}
int game_check_key()
{
return key_inkey();
}
int game_poll()
{
return key_inkey();
}
void multi_delete_ship(object *obj)
{
}
void send_homing_fired_packet()
{
}
void game_flush()
{
}
typedef struct config_struct
{
int boob;
} config_struct;
config_struct default_config;
typedef struct netgame_info
{
int bubba;
} netgame_info;
void send_netgame_state_packet()
{
}
void send_update_state_packet()
{
}
void send_goal_status_packet()
{
}
int Show_area_effect;
void state_set_mem(unsigned char *c, int i) {}
int state_check_mem(unsigned char *c, int i) { return 0; }
void demo_do_flag_dead(int i) {}
void demo_checkpoint() {}
void demo_set_playback_filter() {}
void multi_end_sequence()
{
}
void multi_server_respawn() {}
void multi_build_respawn_points() {}
void store_p_object( p_object *pbojp, CFILE *fp ) {}
void restore_p_object( p_object *pobjp, CFILE *dp) {}
int Multi_squad_msg_targ;
int Multi_squad_msg_local;
void send_support_warpin_packet(int,int,int){}
void send_support_warpin_packet( int net_sig, int how ) {}
int demo_query_debug(int id) { return 0; };
void send_support_warpin_packet(int){}
void game_whack_apply(float x, float y) {}
void save_restore_vector(vec3d *vec, CFILE *fp, int version, vec3d *deflt) {}
void save_restore_matrix(matrix *mat, CFILE *fp, int version, matrix *deflt) {}
void save_restore_float(float *fl, CFILE *fp, int version, float deflt) {}
void save_restore_angles(angles *ang, CFILE *fp, int version, angles *deflt) {}
void save_restore_int(int *n, CFILE *fp, int version, int deflt) {}
void save_restore_uint(uint *n, CFILE *fp, int version, uint deflt) {}
void save_restore_short(short *n, CFILE *fp, int version, short deflt) {}
void save_restore_ushort(ushort *n, CFILE *fp, int version, ushort deflt) {}
void save_restore_ubyte(ubyte *n, CFILE *fp, int version, ubyte deflt) {}
void save_restore_fix(fix *n, CFILE *fp, int version, fix deflt) {}
void save_restore_string(char *str, CFILE *fp, int len, int version, char *deflt) {}
char *restore_string_alloc(CFILE *fp, int version, char *deflt) { return NULL; }
void save_restore_p_object(p_object *pobj, CFILE *fp) {}
void demo_write_char(char x) {}
char demo_read_char() { return 0; }
int red_alert_default_status() {return 0;}
void send_ship_kill_packet(struct object *,struct object *,float,unsigned char) {}
void send_debris_create_packet( object *objp, ushort net_sig, int model_num, vec3d pos) {}
int Game_subspace_effect;
void big_explosion_flash(float x) {}
int game_do_cd_check(char *) {return 0;}
void game_stop_looped_sounds() {}
int Game_skill_level;
int game_cd_changed(void) {return 0;}
int Interface_framerate;
void game_set_view_clip(){}
int Warpout_forced = 0;
float Warpout_time;
vec3d Dead_player_last_vel;
int game_start_mission(){return 0;}
int Game_weapons_tbl_valid;
int Game_ships_tbl_valid;
void game_level_close(){}
void game_enter_state(int, int){}
void game_leave_state(int, int){}
int Test_begin;
int Debug_octant;
int Framerate_delay;
void game_start_time(){}
void game_stop_time(){}
int game_get_default_skill_level(){return 0;}
void game_load_palette(){}
float FreeSpace_gamma;
int set_cdrom_path(int){return 0;}
int find_freespace_cd(char*){return 0;}
void get_version_string(){}
void game_do_state_common(int, int){}
void game_set_frametime(int){}
void game_increase_skill_level(){}
void get_version_string(char*, int){}
int Show_target_weapons;
int Show_target_debug_info;
int Game_do_state_should_skip;
long Game_time_compression;
struct fs_builtin_mission *game_find_builtin_mission(char*){return NULL;}
void game_format_time(long, char*){}
void game_do_state(int){}
void game_process_event(int, int){}
void game_shudder_apply(int, float){}
int game_hacked_data(){return 0;}
int game_single_step;
int last_single_step;
void get_version_string_short(char *){}
void game_tst_mark(struct object *, struct ship *){}
int tst;
int game_do_cd_mission_check(char *){return 1;}
//int Player_multi_died_check;
int Show_framerate = 0;
void game_feature_not_in_demo_popup() {}
void alt_tab_pause(){}
void game_feature_disabled_popup() {}
void game_pause() {}
void game_unpause() {}
//Time stuff
bool Time_compression_locked;
float flRealframetime;
void lock_time_compression(bool is_locked){}
void change_time_compression(float multiplier){}
void set_time_compression(float multiplier, float change_time){}
fix game_get_overall_frametime() { return 0; }
//WMC
void game_level_init(int seed){}
void game_post_level_init(){}
camid game_render_frame_setup(){return camid();}
void game_render_frame(camid cid){}
void game_simulation_frame(){}
void game_update_missiontime(){}
void game_render_post_frame(){}
File diff suppressed because it is too large. Load diff
-627
View File
@@ -1,627 +0,0 @@
/*
* Copyright (C) Volition, Inc. 1999. All rights reserved.
*
* All source code herein is the property of Volition, Inc. You may not sell
* or otherwise commercially exploit the source or things you created based on the
* source.
*
*/
/*
* $Logfile: /Freespace2/code/fred2/FREDView.h $
* $Revision: 1.2.2.1 $
* $Date: 2006-10-27 06:33:38 $
* $Author: taylor $
*
* View class for a document/view architechure design program, which we don't
* want or need, but MFC forces us to use. This is the main place we handle
* MFC messages, events, etc. Sort of the interface between our code and MFC.
* There is also a lot of our code in here related to these things.
*
* $Log: not supported by cvs2svn $
* Revision 1.2 2006/04/20 06:32:01 Goober5000
* proper capitalization according to Volition
*
* Revision 1.1 2006/01/19 02:27:31 Goober5000
* import FRED2 back into fs2_open module
* --Goober5000
*
* Revision 1.9 2006/01/15 00:48:25 Goober5000
* this should complete the new IFF stuff for FRED
* --Goober5000
*
* Revision 1.8 2005/07/13 02:40:50 Goober5000
* remove PreProcDefine #includes in FRED
* --Goober5000
*
* Revision 1.7 2005/04/13 20:02:08 chhogg
* Changed vector to vec3d for Fred.
*
* Revision 1.6 2004/11/04 01:41:00 Goober5000
* preliminary work on voice acting mananger for FRED
* --Goober5000
*
* Revision 1.5 2004/09/29 17:26:32 Kazan
* PreProfDefines.h includes for fred2
*
* Revision 1.4 2004/02/05 23:23:19 randomtiger
* Merging OGL Fred into normal Fred, no conflicts, should be perfect
*
* Revision 1.3.2.4 2004/01/24 13:00:43 randomtiger
* Implemented basic OGL HT&L but some drawing routines missing from cobe.lib so keeping turned off for now.
* Added lighting menu option and made about dialog more useful.
* Ship menu now defaults to the first entry.
* Loads of debug to try and trap crashes.
*
* Revision 1.3.2.3 2004/01/20 19:11:29 randomtiger
* Cut unneeded code, text now works in graphics window.
*
* Revision 1.3.2.2 2004/01/18 14:53:17 randomtiger
* Textures work now, initialisation runs from cobe.lib not internally.
*
* Revision 1.3.2.1 2004/01/17 22:11:25 randomtiger
* Large series of changes to make fred run though OGL. Requires code.lib to be up to date to compile.
* Port still in progress, fred currently unusable, note this has been committed to fred_ogl branch.
*
* Revision 1.3 2003/09/05 05:32:36 Goober5000
* moved custom buttons from shield sys dialog and added dialog to set
* ship flags globally
* --Goober5000
*
* Revision 1.2 2003/08/26 20:32:41 Goober5000
* added support for saving in FS2 retail format
* --Goober5000
*
* Revision 1.1.1.1 2002/07/15 03:10:58 inquisitor
* Initial FRED2 Checking
*
*
* 6 6/04/99 2:20p Andsager
* Add dump stats basic functionality
*
* 5 3/26/99 4:49p Dave
* Made cruisers able to dock with stuff. Made docking points and paths
* visible in fred.
*
* 4 1/27/99 4:09p Andsager
* Added highlight to ship subsystems
*
* 3 10/13/98 9:27a Dave
* Started neatening up freespace.h
*
* 2 10/07/98 6:28p Dave
* Initial checkin. Renamed all relevant stuff to be Fred2 instead of
* Fred. Globalized mission and campaign file extensions. Removed Silent
* Threat specific code.
*
* 1 10/07/98 3:01p Dave
*
* 1 10/07/98 3:00p Dave
*
* 84 5/21/98 11:48a Hoffoss
* Removed check in and check out options.
*
* 83 5/14/98 5:32p Hoffoss
* Added some more error checking.
*
* 82 4/01/98 10:48a Hoffoss
* Changed Fred to not allow command briefings in multiplayer missions.
*
* 81 3/25/98 4:14p Hoffoss
* Split ship editor up into ship editor and a misc dialog, which tracks
* flags and such.
*
* 80 3/09/98 10:56a Hoffoss
* Added jump node objects to Fred.
*
* 79 3/05/98 3:59p Hoffoss
* Added a bunch of new command brief stuff, and asteroid initialization
* to Fred.
*
* 78 1/29/98 5:14p Hoffoss
* Added error checking for more than 4 ships in a player starting wing.
*
* 77 10/30/97 3:30p Hoffoss
* Made anti-aliased gridlines an option in Fred.
*
* 76 10/14/97 10:59a Allender
* more persona work. Made global error checker call funciton to assign
* and check personas
*
* 75 9/06/97 2:13p Mike
* Replace support for TEAM_NEUTRAL
*
* 74 9/01/97 6:59p Hoffoss
* Added source safe checkin and checkout capabilities to Fred.
*
* 73 8/26/97 4:18p Hoffoss
* Added error checking to initial orders dialog when ok is clicked.
*
* 72 8/25/97 5:58p Hoffoss
* Created menu items for keypress functions in Fred, and fixed bug this
* uncovered with wing_delete function.
*
* 71 8/18/97 9:31p Hoffoss
* Added grid adjustment dialog and shield system editor dialog.
*
* 70 8/14/97 2:32p Hoffoss
* fixed bug where controlling an object doesn't cause screen updates, and
* added a number of cool features to viewpoint/control object code.
*
* 69 8/12/97 6:32p Hoffoss
* Added code to allow hiding of arrival and departure cues in editors.
*
* 68 8/11/97 6:54p Hoffoss
* Groups now supported in Fred.
*
* 67 8/11/97 11:51a Allender
* added stamp stuff to Fred
*
* 66 8/07/97 6:01p Hoffoss
* Added a rotate about selected object button to toolbar and
* functionality, as requested by Comet.
*
* 65 8/01/97 3:10p Hoffoss
* Made Sexp help hidable.
*
* 64 8/01/97 12:52p Hoffoss
* Added variable, fixed bug with global error check.
*
* 63 7/28/97 2:51p Hoffoss
* Re-evaluated and improved global error checker in Fred.
*
* 62 7/24/97 12:45p Hoffoss
* Added camera position save and restore.
*
* 61 7/08/97 2:03p Hoffoss
* Debriefing editor coded and implemented.
*
* 60 6/18/97 3:07p Hoffoss
* Wing ship names are 1 indexes instead of 0 indexed now.
*
* 59 6/09/97 4:57p Hoffoss
* Added autosave and undo to Fred.
*
* 58 6/05/97 6:10p Hoffoss
* Added features: Autosaving, object hiding. Also fixed some minor bugs.
*
* 57 6/02/97 11:52a Hoffoss
* Custom cursors displayed when over objects in different modes.
*
* 56 5/21/97 5:43p Hoffoss
* Added features requested on Todo list.
*
* 55 5/06/97 3:01p Hoffoss
* Added some accelerator keys.
*
* 54 5/05/97 5:44p Hoffoss
* Added specialized popup menu choices, save before running FreeSpace,
* and display filters.
*
* 53 5/05/97 9:42a Hoffoss
* Single axis contraint code changed to operate better.
*
* 52 4/24/97 5:15p Hoffoss
* fixes to Fred.
*
* 51 4/17/97 5:23p Hoffoss
* Implemented ability to run FreeSpace from Fred.
*
* 50 4/16/97 5:18p Hoffoss
* Moved Asteroid field editor stuff to a seperate dialog box.
*
* 49 4/11/97 4:22p Hoffoss
* Fixed bug in Sexp trees, moved Show starfield option to view menu and
* removed preferences dialog box.
*
* 48 3/12/97 12:40p Hoffoss
* Fixed bugs in wing object management functions, several small additions
* and rearrangements.
*
* 47 3/10/97 4:58p Hoffoss
* Added waypoint and start types to drop down toolbar combo box and fixed
* context menu new ship type selection to also work.
*
* 46 3/10/97 12:54p Hoffoss
* Added drop down combo box to toolbar and fixed compiling errors Mark
* (maybe Mike?) introduced to code.
*
* 45 3/06/97 3:35p Hoffoss
* Added Show_outline stuff, moved show options to the view menu, fixed a
* bug in message dialog editor.
*
* 44 3/04/97 6:27p Hoffoss
* Changes to Fred to handle new wing structure.
*
* 43 2/28/97 11:31a Hoffoss
* Implemented modeless dialog saving and restoring, and changed some
* variables names.
*
* 42 2/27/97 5:54p Hoffoss
* Implemented support for saving and restoring window positions.
*
* 41 2/17/97 5:28p Hoffoss
* Checked RCS headers, added them were missing, changing description to
* something better, etc where needed.
*
* 72 2/12/97 5:50p Hoffoss
* Expanded on error checking.
*
* 71 2/12/97 12:25p Hoffoss
* Expanded on global error checker, added initial orders conflict
* checking and warning, added waypoint editor dialog and code.
*
* 70 2/10/97 5:18p Hoffoss
* Global error checker work. Added checks for many things, but still
* more to add tomorrow!
*
* 69 2/04/97 3:09p Hoffoss
* Background bitmap editor implemented fully.
*
* 68 1/30/97 2:24p Hoffoss
* Added remaining mission file structures and implemented load/save of
* them.
*
* $NoKeywords: $
*/
#ifndef STAMPER_PROGRAM
#include "FREDDoc.h"
#define WM_MENU_POPUP_SHIPS (WM_USER+6)
#define WM_MENU_POPUP_EDIT (WM_USER+7)
#define SEXP_HELP_BOX_SIZE 170
typedef struct Marking_box {
int x1, y1, x2, y2;
} Marking_box;
typedef struct subsys_to_render
{
bool do_render;
object *ship_obj;
ship_subsys *cur_subsys;
} subsys_to_render;
class CShipEditorDlg;
class CGrid;
class CFREDView : public CView
{
private:
CGrid* m_pGDlg;
int global_error_check_player_wings(int multi);
protected: // create from serialization only
CFREDView();
DECLARE_DYNCREATE(CFREDView)
// Attributes
public:
int global_error_check_mixed_player_wing(int w);
int fred_check_sexp(int sexp, int type, char *msg, ...);
int internal_error(char *msg, ...);
int error(char *msg, ...);
int global_error_check();
void place_background_bitmap(vec3d v);
void cycle_constraint();
CFREDDoc *GetDocument();
static CFREDView *GetView();
LONG OnGoodbye(UINT wParam, LONG lParam);
// LONG OnMenuPopupShips(CWnd *pWnd, CPoint point);
// LONG OnMenuPopupShips(UINT wParam, LONG lParam);
//BOOL m_ConfirmDeleting;
//BOOL m_ShowCapitalShips;
//BOOL m_ShowElevations;
//BOOL m_ShowFighters;
//BOOL m_ShowGrid;
//BOOL m_ShowMiscObjects;
//BOOL m_ShowPlanets;
//BOOL m_ShowWaypoints;
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CFREDView)
public:
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
virtual BOOL OnCmdMsg(UINT nID, int nCode, void* pExtra, AFX_CMDHANDLERINFO* pHandlerInfo);
virtual void OnInitialUpdate();
virtual BOOL DestroyWindow();
protected:
virtual BOOL OnPreparePrinting(CPrintInfo* pInfo);
virtual void OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo);
virtual void OnEndPrinting(CDC* pDC, CPrintInfo* pInfo);
virtual void OnDraw(CDC* pDC);
//}}AFX_VIRTUAL
// Implementation
public:
virtual ~CFREDView();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
// virtual void SEDlg_destroy();
// Generated message map functions
protected:
//{{AFX_MSG(CFREDView)
afx_msg void OnViewGrid();
afx_msg void OnUpdateViewGrid(CCmdUI* pCmdUI);
afx_msg void OnViewWaypoints();
afx_msg void OnUpdateViewWaypoints(CCmdUI* pCmdUI);
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
afx_msg void OnEditorsShips();
afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
afx_msg void OnKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags);
afx_msg void OnSetFocus(CWnd* pOldWnd);
afx_msg void OnKillFocus(CWnd* pNewWnd);
afx_msg void OnSize(UINT nType, int cx, int cy);
afx_msg void OnMouseMove(UINT nFlags, CPoint point);
afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
afx_msg void OnMiscstuffShowshipsasicons();
afx_msg void OnContextMenu(CWnd* pWnd, CPoint point);
afx_msg void OnEditPopupShowShipIcons();
afx_msg void OnUpdateEditPopupShowShipIcons(CCmdUI* pCmdUI);
afx_msg void OnEditPopupShowShipModels();
afx_msg void OnUpdateEditPopupShowShipModels(CCmdUI* pCmdUI);
afx_msg void OnMiscStatistics();
afx_msg void OnEditPopupShowCompass();
afx_msg void OnUpdateEditPopupShowCompass(CCmdUI* pCmdUI);
afx_msg void OnUpdateChangeViewpointExternal(CCmdUI* pCmdUI);
afx_msg void OnChangeViewpointExternal();
afx_msg void OnUpdateChangeViewpointFollow(CCmdUI* pCmdUI);
afx_msg void OnChangeViewpointFollow();
afx_msg void OnEditorsGoals();
afx_msg void OnSpeed1();
afx_msg void OnSpeed2();
afx_msg void OnSpeed5();
afx_msg void OnSpeed10();
afx_msg void OnUpdateSpeed1(CCmdUI* pCmdUI);
afx_msg void OnSpeed3();
afx_msg void OnSpeed8();
afx_msg void OnRot1();
afx_msg void OnRot2();
afx_msg void OnRot3();
afx_msg void OnRot4();
afx_msg void OnRot5();
afx_msg void OnUpdateSpeed2(CCmdUI* pCmdUI);
afx_msg void OnUpdateSpeed3(CCmdUI* pCmdUI);
afx_msg void OnUpdateSpeed5(CCmdUI* pCmdUI);
afx_msg void OnUpdateSpeed8(CCmdUI* pCmdUI);
afx_msg void OnUpdateSpeed10(CCmdUI* pCmdUI);
afx_msg void OnUpdateRot1(CCmdUI* pCmdUI);
afx_msg void OnUpdateRot2(CCmdUI* pCmdUI);
afx_msg void OnUpdateRot3(CCmdUI* pCmdUI);
afx_msg void OnUpdateRot4(CCmdUI* pCmdUI);
afx_msg void OnUpdateRot5(CCmdUI* pCmdUI);
afx_msg void OnControlModeCamera();
afx_msg void OnUpdateControlModeCamera(CCmdUI* pCmdUI);
afx_msg void OnControlModeShip();
afx_msg void OnUpdateControlModeShip(CCmdUI* pCmdUI);
afx_msg void OnShowGridPositions();
afx_msg void OnUpdateShowGridPositions(CCmdUI* pCmdUI);
afx_msg void OnShowCoordinates();
afx_msg void OnUpdateShowCoordinates(CCmdUI* pCmdUI);
afx_msg void OnSpeed50();
afx_msg void OnUpdateSpeed50(CCmdUI* pCmdUI);
afx_msg void OnSpeed100();
afx_msg void OnUpdateSpeed100(CCmdUI* pCmdUI);
afx_msg void OnSelect();
afx_msg void OnUpdateSelect(CCmdUI* pCmdUI);
afx_msg void OnSelectAndMove();
afx_msg void OnUpdateSelectAndMove(CCmdUI* pCmdUI);
afx_msg void OnSelectAndRotate();
afx_msg void OnUpdateSelectAndRotate(CCmdUI* pCmdUI);
afx_msg void OnConstrainX();
afx_msg void OnUpdateConstrainX(CCmdUI* pCmdUI);
afx_msg void OnConstrainY();
afx_msg void OnUpdateConstrainY(CCmdUI* pCmdUI);
afx_msg void OnConstrainZ();
afx_msg void OnUpdateConstrainZ(CCmdUI* pCmdUI);
afx_msg void OnConstrainXz();
afx_msg void OnUpdateConstrainXz(CCmdUI* pCmdUI);
afx_msg void OnSelectionLock();
afx_msg void OnUpdateSelectionLock(CCmdUI* pCmdUI);
afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
afx_msg void OnDoubleFineGridlines();
afx_msg void OnUpdateDoubleFineGridlines(CCmdUI* pCmdUI);
afx_msg void OnShowDistances();
afx_msg void OnUpdateShowDistances(CCmdUI* pCmdUI);
afx_msg void OnUniversalHeading();
afx_msg void OnUpdateUniversalHeading(CCmdUI* pCmdUI);
afx_msg void OnFlyingControls();
afx_msg void OnUpdateFlyingControls(CCmdUI* pCmdUI);
afx_msg void OnRotateLocally();
afx_msg void OnUpdateRotateLocally(CCmdUI* pCmdUI);
afx_msg void OnConstrainXy();
afx_msg void OnUpdateConstrainXy(CCmdUI* pCmdUI);
afx_msg void OnUpdateConstrainYz(CCmdUI* pCmdUI);
afx_msg void OnConstrainYz();
afx_msg void OnSelectList();
afx_msg void OnZoomExtents();
afx_msg void OnZoomSelected();
afx_msg void OnUpdateZoomSelected(CCmdUI* pCmdUI);
afx_msg void OnFormWing();
afx_msg void OnUpdateFormWing(CCmdUI* pCmdUI);
afx_msg void OnDisbandWing();
afx_msg void OnUpdateDisbandWing(CCmdUI* pCmdUI);
afx_msg void OnShowHorizon();
afx_msg void OnUpdateShowHorizon(CCmdUI* pCmdUI);
afx_msg void OnEditorsWing();
afx_msg void OnEditorsPlayer();
afx_msg void OnEditorsOrient();
afx_msg void OnEditorsEvents();
afx_msg void OnUpdateEditorsOrient(CCmdUI* pCmdUI);
afx_msg void OnEditorsMessage();
afx_msg void OnEditorsStarfield();
afx_msg void OnEditorsBgBitmaps();
afx_msg void OnEditorsReinforcement();
afx_msg void OnErrorChecker();
afx_msg void OnEditorsWaypoint();
afx_msg void OnViewOutlines();
afx_msg void OnUpdateViewOutlines(CCmdUI* pCmdUI);
afx_msg void OnUpdateNewShipType(CCmdUI* pCmdUI);
afx_msg void OnShowStarfield();
afx_msg void OnUpdateShowStarfield(CCmdUI* pCmdUI);
afx_msg void OnAsteroidEditor();
afx_msg void OnRunFreeSpace();
afx_msg void OnEditorCampaign();
afx_msg void OnShowShips();
afx_msg void OnUpdateShowShips(CCmdUI* pCmdUI);
afx_msg void OnShowStarts();
afx_msg void OnUpdateShowStarts(CCmdUI* pCmdUI);
afx_msg void OnShowIFF0();
afx_msg void OnUpdateShowIFF0(CCmdUI* pCmdUI);
afx_msg void OnShowIFF1();
afx_msg void OnUpdateShowIFF1(CCmdUI* pCmdUI);
afx_msg void OnShowIFF2();
afx_msg void OnUpdateShowIFF2(CCmdUI* pCmdUI);
afx_msg void OnShowIFF3();
afx_msg void OnUpdateShowIFF3(CCmdUI* pCmdUI);
afx_msg void OnShowIFF4();
afx_msg void OnUpdateShowIFF4(CCmdUI* pCmdUI);
afx_msg void OnShowIFF5();
afx_msg void OnUpdateShowIFF5(CCmdUI* pCmdUI);
afx_msg void OnShowIFF6();
afx_msg void OnUpdateShowIFF6(CCmdUI* pCmdUI);
afx_msg void OnShowIFF7();
afx_msg void OnUpdateShowIFF7(CCmdUI* pCmdUI);
afx_msg void OnShowIFF8();
afx_msg void OnUpdateShowIFF8(CCmdUI* pCmdUI);
afx_msg void OnShowIFF9();
afx_msg void OnUpdateShowIFF9(CCmdUI* pCmdUI);
afx_msg void OnToggleViewpoint();
afx_msg void OnRevert();
afx_msg void OnUpdateRevert(CCmdUI* pCmdUI);
afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);
afx_msg void OnHideObjects();
afx_msg void OnShowHiddenObjects();
afx_msg void OnEditUndo();
afx_msg void OnUpdateEditUndo(CCmdUI* pCmdUI);
afx_msg void OnEditorsBriefing();
afx_msg void OnEditorsDebriefing();
afx_msg void OnSaveCamera();
afx_msg void OnRestoreCamera();
afx_msg void OnUpdateRestoreCamera(CCmdUI* pCmdUI);
afx_msg void OnShowSexpHelp();
afx_msg void OnUpdateShowSexpHelp(CCmdUI* pCmdUI);
afx_msg void OnLookatObj();
afx_msg void OnUpdateLookatObj(CCmdUI* pCmdUI);
afx_msg void OnEditorsAdjustGrid();
afx_msg void OnEditorsShieldSys();
afx_msg void OnLevelObj();
afx_msg void OnAlignObj();
afx_msg void OnControlObj();
afx_msg void OnNextObj();
afx_msg void OnPrevObj();
afx_msg void OnEditDeleteWing();
afx_msg void OnMarkWing();
afx_msg void OnUpdateControlObj(CCmdUI* pCmdUI);
afx_msg void OnEditDelete();
afx_msg void OnAaGridlines();
afx_msg void OnUpdateAaGridlines(CCmdUI* pCmdUI);
afx_msg void OnCmdBrief();
afx_msg void OnDisableUndo();
afx_msg void OnUpdateDisableUndo(CCmdUI* pCmdUI);
afx_msg void OnUpdateCmdBrief(CCmdUI* pCmdUI);
afx_msg void OnNextSubsys();
afx_msg void OnPrevSubsys();
afx_msg void OnCancelSubsys();
afx_msg void OnDumpStats();
afx_msg void OnShowPaths();
afx_msg void OnUpdateShowPaths(CCmdUI* pCmdUI);
afx_msg void OnShowDockPoints();
afx_msg void OnUpdateShowDockPoints(CCmdUI* pCmdUI);
afx_msg void OnFormatFs2Open();
afx_msg void OnUpdateFormatFs2Open(CCmdUI* pCmdUI);
afx_msg void OnFormatFs2OpenComp();
afx_msg void OnUpdateFormatFs2OpenComp(CCmdUI* pCmdUI);
afx_msg void OnFormatFs2Retail();
afx_msg void OnUpdateFormatFs2Retail(CCmdUI* pCmdUI);
afx_msg void OnFormatFs1Retail();
afx_msg void OnUpdateFormatFs1Retail(CCmdUI* pCmdUI);
afx_msg void OnEditorsSetGlobalShipFlags();
afx_msg void OnEditorsVoiceManager();
afx_msg void OnDestroy();
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
afx_msg BOOL OnEraseBkgnd(CDC* pDC);
afx_msg void OnViewLighting();
afx_msg void OnUpdateViewLighting(CCmdUI* pCmdUI);
afx_msg void OnViewFullDetail();
afx_msg void OnUpdateViewFullDetail(CCmdUI *pCmdUI);
//}}AFX_MSG
afx_msg void OnGroup(UINT nID);
afx_msg void OnSetGroup(UINT nID);
void OnShowIFF(int iff);
void OnUpdateShowIFF(int iff, CCmdUI* pCmdUI);
// LONG OnMenuPopupShips(CWnd *pWnd, CPoint point);
LONG OnMenuPopupShips(UINT wParam, LONG lParam);
LONG OnMenuPopupEdit(UINT wParam, LONG lParam);
DECLARE_MESSAGE_MAP()
};
#ifndef _DEBUG // debug version in FREDView.cpp
inline CFREDDoc* CFREDView::GetDocument()
{ return (CFREDDoc*)m_pDocument; }
#endif
/////////////////////////////////////////////////////////////////////////////
void cancel_drag();
char *error_check_initial_orders(ai_goal *goals, int ship, int wing);
extern void fred_check_message_personas();
extern int Autosave_disabled;
extern int Show_sexp_help;
extern int Show_ships;
extern int Show_starts;
extern int physics_speed;
extern int physics_rot;
extern int viewpoint;
extern int view_obj;
extern int box_marking; // Are we currently box marking? (i.e. draging out a box to mark)
extern int button_down; // Is the left mouse button down and we are handling it?
extern int Marked; // number of marked objects
extern int Show_compass;
extern int Show_ship_models;
extern int Show_ship_info;
extern int Show_dock_points;
extern int Lighting_on;
extern int FullDetail;
extern int Show_paths_fred;
extern int Selection_lock;
extern int Cursor_over;
extern int Cur_bitmap;
extern int Id_select_type_jump_node;
extern int Id_select_type_start;
extern int Id_select_type_waypoint;
extern int Hide_ship_cues, Hide_wing_cues;
extern Marking_box marking_box;
extern object_orient_pos rotation_backup[MAX_OBJECTS];
#define FSO_FORMAT_STANDARD 1
#define FSO_FORMAT_COMPATIBILITY_MODE 2
// Goober5000 (currently, FS1 retail not implemented)
extern int Format_fs2_open;
extern int Format_fs2_retail;
extern int Format_fs1_retail;
extern CFREDView *Fred_view_wnd;
#endif // if #ifndef STAMPER_PROGRAM
-239
View File
@@ -1,239 +0,0 @@
/*
* Copyright (C) Volition, Inc. 1999. All rights reserved.
*
* All source code herein is the property of Volition, Inc. You may not sell
* or otherwise commercially exploit the source or things you created based on the
* source.
*
*/
/*
* $Logfile: /Freespace2/code/FRED2/Grid.cpp $
* $Revision: 1.1 $
* $Date: 2006-01-19 02:27:31 $
* $Author: Goober5000 $
*
* Grid dialog box created by Mike. Probably will never be used again.
*
* $Log: not supported by cvs2svn $
* Revision 1.3 2005/04/13 20:11:06 chhogg
* Changed vector to vec3d for Fred.
*
* Revision 1.2 2002/08/15 01:06:34 penguin
* Include filename reorg (to coordinate w/ fs2_open)
*
* Revision 1.1.1.1 2002/07/15 03:10:58 inquisitor
* Initial FRED2 Checking
*
*
* 2 10/07/98 6:28p Dave
* Initial checkin. Renamed all relevant stuff to be Fred2 instead of
* Fred. Globalized mission and campaign file extensions. Removed Silent
* Threat specific code.
*
* 1 10/07/98 3:01p Dave
*
* 1 10/07/98 3:00p Dave
*
* 5 6/18/97 11:36p Lawrance
* move grid rendering code to MissionGrid.cpp
*
* 4 2/17/97 5:28p Hoffoss
* Checked RCS headers, added them were missing, changing description to
* something better, etc where needed.
*
* $NoKeywords: $
*/
#include "stdafx.h"
#include "FRED.h"
#include "Grid.h"
#include "render/3d.h"
#include "object/object.h"
#include "editor.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
extern int double_fine_gridlines;
/////////////////////////////////////////////////////////////////////////////
// CGrid dialog
// Modeless constructor, MK
CGrid::CGrid(CView* pView)
{
m_pGView = pView;
}
CGrid::CGrid(CWnd* pParent /*=NULL*/)
: CDialog(CGrid::IDD, pParent)
{
//{{AFX_DATA_INIT(CGrid)
m_GridSize = 0;
//}}AFX_DATA_INIT
m_pGView = NULL;
}
void CGrid::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CGrid)
DDX_Text(pDX, IDC_GRID_SIZE, m_GridSize);
DDV_MinMaxUInt(pDX, m_GridSize, 2, 20);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CGrid, CDialog)
//{{AFX_MSG_MAP(CGrid)
ON_BN_CLICKED(IDC_GRID_XY_PLANE, OnGridXyPlane)
ON_BN_CLICKED(IDC_GRID_XZ_PLANE, OnGridXzPlane)
ON_BN_CLICKED(IDC_GRID_YZ_PLANE, OnGridYzPlane)
ON_WM_CLOSE()
ON_WM_DESTROY()
ON_WM_KILLFOCUS()
ON_WM_VSCROLL()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CGrid message handlers
extern grid *The_grid;
void GridOrient(vec3d *forward, vec3d *right)
{
vec3d center;
int nrows, ncols;
float square_size;
if (The_grid != NULL){
center = The_grid->center;
nrows = The_grid->nrows;
ncols = The_grid->ncols;
square_size = The_grid->square_size;
} else {
vm_vec_make(&center, 0.0f, 0.0f, 0.0f);
nrows = 20;
ncols = 20;
square_size = 2.0f;
}
The_grid = create_grid(The_grid, forward,
right,
&center,
nrows, ncols,
square_size);
physics_init(&The_grid->physics);
}
void CGrid::OnGridXyPlane()
{
vec3d forward, right;
vm_vec_make(&forward, 0.0f, 1.0f, 0.0f);
vm_vec_make(&right, 1.0f, 0.0f, 0.0f);
GridOrient(&forward, &right);
}
void CGrid::OnGridXzPlane()
{
vec3d forward, right;
vm_vec_make(&forward, 0.0f, 0.0f, 1.0f);
vm_vec_make(&right, 1.0f, 0.0f, 0.0f);
GridOrient(&forward, &right);
}
void CGrid::OnGridYzPlane()
{
vec3d forward, right;
vm_vec_make(&forward, 0.0f, 1.0f, 0.0f);
vm_vec_make(&right, 0.0f, 0.0f, 1.0f);
GridOrient(&forward, &right);
}
BOOL CGrid::Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext)
{
return CDialog::Create(IDD, pParentWnd);
}
BOOL CGrid::Create()
{
return CDialog::Create(CGrid::IDD);
}
void CGrid::OnClose()
{
DestroyWindow();
}
void CGrid::OnDestroy()
{
UpdateData(TRUE);
CDialog::OnDestroy();
}
void CGrid::OnKillFocus(CWnd* pNewWnd)
{
CDialog::OnKillFocus(pNewWnd);
DestroyWindow();
}
BOOL CGrid::DestroyWindow()
{
// TODO: Add your specialized code here and/or call the base class
UpdateData(TRUE);
return CDialog::DestroyWindow();
}
BOOL CGrid::OnInitDialog()
{
CDialog::OnInitDialog();
CSpinButtonCtrl* pSpin = (CSpinButtonCtrl*) GetDlgItem(IDC_SPIN_GRID_SIZE);
pSpin->SetRange(2, 20);
if ((m_GridSize < 2) || (m_GridSize > 20))
m_GridSize = The_grid->ncols/5;
pSpin->SetPos(m_GridSize);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CGrid::OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
{
CString strValue;
CSpinButtonCtrl* pSpin = (CSpinButtonCtrl*) GetDlgItem(IDC_SPIN_GRID_SIZE);
strValue.Format("%i", pSpin->GetPos());
pSpin->GetBuddy()->SetWindowText(strValue);
The_grid->nrows = pSpin->GetPos()*5;
The_grid->ncols = The_grid->nrows;
modify_grid(The_grid);
CDialog::OnVScroll(nSBCode, nPos, pScrollBar);
}
-93
View File
@@ -1,93 +0,0 @@
/*
* Copyright (C) Volition, Inc. 1999. All rights reserved.
*
* All source code herein is the property of Volition, Inc. You may not sell
* or otherwise commercially exploit the source or things you created based on the
* source.
*
*/
/*
* $Logfile: /Freespace2/code/FRED2/Grid.h $
* $Revision: 1.1 $
* $Date: 2006-01-19 02:27:31 $
* $Author: Goober5000 $
*
* Grid dialog box created by Mike. Probably will never be used again.
*
* $Log: not supported by cvs2svn $
* Revision 1.3 2005/07/13 02:40:50 Goober5000
* remove PreProcDefine #includes in FRED
* --Goober5000
*
* Revision 1.2 2004/09/29 17:26:32 Kazan
* PreProfDefines.h includes for fred2
*
* Revision 1.1.1.1 2002/07/15 03:10:58 inquisitor
* Initial FRED2 Checking
*
*
* 2 10/07/98 6:28p Dave
* Initial checkin. Renamed all relevant stuff to be Fred2 instead of
* Fred. Globalized mission and campaign file extensions. Removed Silent
* Threat specific code.
*
* 1 10/07/98 3:01p Dave
*
* 1 10/07/98 3:00p Dave
*
* 2 2/17/97 5:28p Hoffoss
* Checked RCS headers, added them were missing, changing description to
* something better, etc where needed.
*
* $NoKeywords: $
*/
/////////////////////////////////////////////////////////////////////////////
// CGrid dialog
class CGrid : public CDialog
{
private:
CView* m_pGView;
// Construction
public:
CGrid(CWnd* pParent = NULL); // standard constructor
CGrid(CView* pView);
BOOL Create();
// Dialog Data
//{{AFX_DATA(CGrid)
enum { IDD = IDD_GRID };
UINT m_GridSize;
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CGrid)
public:
virtual BOOL Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext = NULL);
virtual BOOL DestroyWindow();
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CGrid)
afx_msg void OnGridXyPlane();
afx_msg void OnGridXzPlane();
afx_msg void OnGridYzPlane();
afx_msg void OnClose();
afx_msg void OnDestroy();
afx_msg void OnKillFocus(CWnd* pNewWnd);
virtual BOOL OnInitDialog();
afx_msg void OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
-23
View File
@@ -1,23 +0,0 @@
{\rtf1\ansi \deff0\deflang1033{\fonttbl{\f0\froman\fcharset0\fprq2 Tms Rmn{\*\falt Times New Roman};}{\f2\fswiss\fcharset0\fprq2 Helv{\*\falt Arial};}{\f7\fswiss\fcharset0\fprq2 MS Sans Serif;}
{\f9\fswiss\fcharset0\fprq2 Helvetica{\*\falt Arial};}}{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;
\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;\red128\green0\blue128;\red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;\red192\green192\blue192;}{\stylesheet{\nowidctlpar \fs20 \snext0 Normal;}{\s1\sb240\nowidctlpar
\b\f2\ul \sbasedon0\snext0 heading 1;}{\s2\sb120\nowidctlpar \b\f2 \sbasedon0\snext0 heading 2;}{\s3\li360\nowidctlpar \b \sbasedon0\snext17 heading 3;}{\s4\li360\nowidctlpar \ul \sbasedon0\snext17 heading 4;}{\s5\li720\nowidctlpar \b\fs20
\sbasedon0\snext17 heading 5;}{\s6\li720\nowidctlpar \fs20\ul \sbasedon0\snext17 heading 6;}{\s7\li720\nowidctlpar \i\fs20 \sbasedon0\snext17 heading 7;}{\s8\li720\nowidctlpar \i\fs20 \sbasedon0\snext17 heading 8;}{\s9\li720\nowidctlpar \i\fs20
\sbasedon0\snext17 heading 9;}{\*\cs10 \additive Default Paragraph Font;}{\*\cs15 \additive\f0\fs16\up6\lang1033 \sbasedon10 footnote reference;}{\s16\nowidctlpar \fs20 \sbasedon0\snext16 footnote text;}{\s17\li720\nowidctlpar \fs20 \sbasedon0\snext17
Normal Indent;}{\s18\fi-240\li480\sb80\nowidctlpar\tx480 \f9 \sbasedon0\snext18 nscba;}{\s19\fi-240\li240\sa20\nowidctlpar \f9 \sbasedon0\snext19 j;}{\s20\li480\sa20\nowidctlpar \f9 \sbasedon0\snext20 ij;}{\s21\sb80\sa20\nowidctlpar \f9
\sbasedon0\snext21 btb;}{\s22\fi-240\li2400\sb20\sa20\nowidctlpar \f9\fs20 \sbasedon0\snext22 ctcb;}{\s23\fi-240\li480\sa40\nowidctlpar\tx480 \f9 \sbasedon0\snext23 ns;}{\s24\sa120\nowidctlpar \f9\fs28 \sbasedon0\snext24 TT;}{
\s25\fi-240\li2400\sa20\nowidctlpar \f9 \sbasedon0\snext25 crtj;}{\s26\fi-240\li480\nowidctlpar\tx480 \f9 \sbasedon0\snext26 nsca;}{\s27\sa20\nowidctlpar \f9 \sbasedon0\snext27 bt;}{\s28\li240\sb120\sa40\nowidctlpar \f9 \sbasedon0\snext28 Hf;}{
\s29\li240\sb120\sa40\nowidctlpar \f9 \sbasedon0\snext29 Hs;}{\s30\li480\sb120\sa40\nowidctlpar \f9 \sbasedon0\snext30 RT;}{\s31\fi-2160\li2160\sb240\sa80\nowidctlpar\tx2160 \f9 \sbasedon0\snext31 c;}{\s32\li2160\sa20\nowidctlpar \f9 \sbasedon0\snext32
ct;}{\s33\li240\sa20\nowidctlpar \f9 \sbasedon0\snext33 it;}{\s34\li480\nowidctlpar \f9\fs20 \sbasedon0\snext34 nsct;}{\s35\fi-160\li400\sb80\sa40\nowidctlpar \f9 \sbasedon0\snext35 nscb;}{\s36\fi-2640\li2880\sb120\sa40\nowidctlpar\brdrb\brdrs\brdrw15
\brdrbtw\brdrs\brdrw15 \tx2880 \f9 \sbasedon0\snext36 HC2;}{\s37\fi-2640\li2880\sb120\sa20\nowidctlpar\tx2880 \f9 \sbasedon0\snext37 C2;}{\s38\fi-240\li2400\sa20\nowidctlpar \f9\fs20 \sbasedon0\snext38 ctc;}{\s39\li2160\sb160\nowidctlpar \f9
\sbasedon0\snext39 crt;}{\s40\li480\sb20\sa40\nowidctlpar \f9 \sbasedon0\snext40 or;}{\s41\fi-259\li360\sb40\sa40\nowidctlpar\tx360 \f7\fs20 \sbasedon0\snext41 Ln1;}{\s42\li115\sb80\sa80\nowidctlpar \f7\fs20 \sbasedon0\snext0 *Intro;}{
\s43\li115\sb80\sa80\keepn\nowidctlpar \b\f7 \sbasedon3\snext42 *Title;}{\s44\fi-245\li360\sb80\nowidctlpar \f7\fs20 \snext44 *Jl;}{\s45\li360\sb40\sa40\nowidctlpar \f7\fs20 \snext0 Lp1;}{\s46\fi-1800\li1915\sb60\sl-240\slmult0\nowidctlpar\tx1915
\f7\fs20 \sbasedon0\snext46 Tph;}{\s47\li115\sb120\sa80\nowidctlpar \b\f7\fs20 \snext41 Proch;}{\*\cs48 \additive\super \sbasedon10 endnote reference;}}{\info{\title AFXCORE}{\subject MFC Core RTF Help}{\author Jason Hoffoss}{\operator Adam Pletcher}
{\creatim\yr1992\mo10\dy7\hr11\min4}{\revtim\yr1998\mo5\dy26\hr19\min26}{\version2}{\edmins1}{\nofpages1}{\nofwords34}{\nofchars195}{\*\company Parallax Software}{\vern57431}}\widowctrl\ftnbj\aenddoc\hyphcaps0 \fet0\sectd \linex576\endnhere {\*\pnseclvl1
\pnucrm\pnstart1\pnindent720\pnhang{\pntxta .}}{\*\pnseclvl2\pnucltr\pnstart1\pnindent720\pnhang{\pntxta .}}{\*\pnseclvl3\pndec\pnstart1\pnindent720\pnhang{\pntxta .}}{\*\pnseclvl4\pnlcltr\pnstart1\pnindent720\pnhang{\pntxta )}}{\*\pnseclvl5
\pndec\pnstart1\pnindent720\pnhang{\pntxtb (}{\pntxta )}}{\*\pnseclvl6\pnlcltr\pnstart1\pnindent720\pnhang{\pntxtb (}{\pntxta )}}{\*\pnseclvl7\pnlcrm\pnstart1\pnindent720\pnhang{\pntxtb (}{\pntxta )}}{\*\pnseclvl8\pnlcltr\pnstart1\pnindent720\pnhang
{\pntxtb (}{\pntxta )}}{\*\pnseclvl9\pnlcrm\pnstart1\pnindent720\pnhang{\pntxtb (}{\pntxta )}}\pard\plain \sl240\slmult0\widctlpar \fs20 {\cs15\fs16\up6 #{\footnote \pard\plain \s16\widctlpar \fs20 {\cs15\fs16\up6 #} main_index}}{\fs16\up6 }{
\b\f2\fs24\up6 FRED Help}{\b\f2
\par }{\f9
\par }{\f2 For detailed information on how to use FRED, please refer to the FRED documentation (FRED.rtf file). It should be used as the definitive source of information for the operation of FRED rather than this online help system.
\par }}
-272
View File
@@ -1,272 +0,0 @@
// This is a part of the Microsoft Foundation Classes C++ library.
// Copyright (C) 1992-1995 Microsoft Corporation
// All rights reserved.
//
// This source code is only intended as a supplement to the
// Microsoft Foundation Classes Reference and related
// electronic documentation provided with the library.
// See these sources for detailed information regarding the
// Microsoft Foundation Classes product.
// Non-Client HitTest help IDs
HID_HT_NOWHERE 0x40000
HID_HT_CAPTION 0x40002
HID_HT_SIZE 0x40004
HID_HT_HSCROLL 0x40006
HID_HT_VSCROLL 0x40007
HID_HT_MINBUTTON 0x40008
HID_HT_MAXBUTTON 0x40009
HID_HT_SIZE 0x4000A // alias: ID_HT_LEFT
HID_HT_SIZE 0x4000B // alias: ID_HT_RIGHT
HID_HT_SIZE 0x4000C // alias: ID_HT_TOP
HID_HT_SIZE 0x4000D // alias: ID_HT_TOPLEFT
HID_HT_SIZE 0x4000E // alias: ID_HT_TOPRIGHT
HID_HT_SIZE 0x4000F // alias: ID_HT_BOTTOM
HID_HT_SIZE 0x40010 // alias: ID_HT_BOTTOMLEFT
HID_HT_SIZE 0x40011 // alias: ID_HT_BOTTOMRIGHT
HID_HT_SIZE 0x40012 // alias: ID_HT_BORDER
// WM_SYSCOMMAND help IDs
HID_SC_SIZE 0x1EF00
HID_SC_MOVE 0x1EF01
HID_SC_MINIMIZE 0x1EF02
HID_SC_MAXIMIZE 0x1EF03
HID_SC_NEXTWINDOW 0x1EF04
HID_SC_PREVWINDOW 0x1EF05
HID_SC_CLOSE 0x1EF06
HID_SC_RESTORE 0x1EF12
HID_SC_TASKLIST 0x1EF13
// File MRU and aliases
HID_FILE_MRU_FILE1 0x1E110
HID_FILE_MRU_FILE1 0x1E111 // aliases: MRU_2 - MRU_16
HID_FILE_MRU_FILE1 0x1E112
HID_FILE_MRU_FILE1 0x1E113
HID_FILE_MRU_FILE1 0x1E114
HID_FILE_MRU_FILE1 0x1E115
HID_FILE_MRU_FILE1 0x1E116
HID_FILE_MRU_FILE1 0x1E117
HID_FILE_MRU_FILE1 0x1E118
HID_FILE_MRU_FILE1 0x1E119
HID_FILE_MRU_FILE1 0x1E11A
HID_FILE_MRU_FILE1 0x1E11B
HID_FILE_MRU_FILE1 0x1E11C
HID_FILE_MRU_FILE1 0x1E11D
HID_FILE_MRU_FILE1 0x1E11E
HID_FILE_MRU_FILE1 0x1E11F
// Window menu list
HID_WINDOW_ALL 0x1EF1F
// OLE menu and aliases
HID_OLE_VERB_1 0x1E210
HID_OLE_VERB_1 0x1E211 // aliases: VERB_2 -> VERB_16
HID_OLE_VERB_1 0x1E212
HID_OLE_VERB_1 0x1E213
HID_OLE_VERB_1 0x1E214
HID_OLE_VERB_1 0x1E215
HID_OLE_VERB_1 0x1E216
HID_OLE_VERB_1 0x1E217
HID_OLE_VERB_1 0x1E218
HID_OLE_VERB_1 0x1E219
HID_OLE_VERB_1 0x1E21A
HID_OLE_VERB_1 0x1E21B
HID_OLE_VERB_1 0x1E21C
HID_OLE_VERB_1 0x1E21D
HID_OLE_VERB_1 0x1E21E
HID_OLE_VERB_1 0x1E21F
// Commands (HID_*)
HID_FILE_NEW 0x1E100
HID_FILE_OPEN 0x1E101
HID_FILE_CLOSE 0x1E102
HID_FILE_SAVE 0x1E103
HID_FILE_SAVE_AS 0x1E104
HID_FILE_PAGE_SETUP 0x1E105
HID_FILE_PRINT_SETUP 0x1E106
HID_FILE_PRINT 0x1E107
HID_FILE_PRINT_DIRECT 0x1E108
HID_FILE_PRINT_PREVIEW 0x1E109
HID_FILE_UPDATE 0x1E10A
HID_FILE_SAVE_COPY_AS 0x1E10B
HID_FILE_SEND_MAIL 0x1E10C
HID_EDIT_CLEAR 0x1E120
HID_EDIT_CLEAR_ALL 0x1E121
HID_EDIT_COPY 0x1E122
HID_EDIT_CUT 0x1E123
HID_EDIT_FIND 0x1E124
HID_EDIT_PASTE 0x1E125
HID_EDIT_PASTE_LINK 0x1E126
HID_EDIT_PASTE_SPECIAL 0x1E127
HID_EDIT_REPEAT 0x1E128
HID_EDIT_REPLACE 0x1E129
HID_EDIT_SELECT_ALL 0x1E12A
HID_EDIT_UNDO 0x1E12B
HID_EDIT_REDO 0x1E12C
HID_WINDOW_NEW 0x1E130
HID_WINDOW_ARRANGE 0x1E131
HID_WINDOW_CASCADE 0x1E132
HID_WINDOW_TILE_HORZ 0x1E133
HID_WINDOW_TILE_VERT 0x1E134
HID_WINDOW_SPLIT 0x1E135
HID_APP_ABOUT 0x1E140
HID_APP_EXIT 0x1E141
HID_HELP_INDEX 0x1E142
HID_HELP_FINDER 0x1E143
HID_HELP_USING 0x1E144
HID_CONTEXT_HELP 0x1E145
HID_NEXT_PANE 0x1E150
HID_PREV_PANE 0x1E151
HID_FORMAT_FONT 0x1E160
HID_OLE_INSERT_NEW 0x1E200
HID_OLE_EDIT_LINKS 0x1E201
HID_OLE_EDIT_CONVERT 0x1E202
HID_OLE_EDIT_CHANGE_ICON 0x1E203
HID_OLE_EDIT_PROPERTIES 0x1E204
HID_VIEW_TOOLBAR 0x1E800
HID_VIEW_STATUS_BAR 0x1E801
HID_RECORD_FIRST 0x1E900
HID_RECORD_LAST 0x1E901
HID_RECORD_NEXT 0x1E902
HID_RECORD_PREV 0x1E903
HID_WIZBACK 0x13023
HID_WIZNEXT 0x13024
HID_WIZFINISH 0x13025
// Dialogs (AFX_HIDD_*)
AFX_HIDD_FILEOPEN 0x27004
AFX_HIDD_FILESAVE 0x27005
AFX_HIDD_FONT 0x27006
AFX_HIDD_COLOR 0x27007
AFX_HIDD_PRINT 0x27008
AFX_HIDD_PRINTSETUP 0x27009
AFX_HIDD_FIND 0x2700A
AFX_HIDD_REPLACE 0x2700B
AFX_HIDD_NEWTYPEDLG 0x27801
AFX_HIDD_PRINTDLG 0x27802
AFX_HIDD_PREVIEW_TOOLBAR 0x27803
AFX_HIDD_PREVIEW_SHORTTOOLBAR 0x2780B
AFX_HIDD_INSERTOBJECT 0x27804
AFX_HIDD_CHANGEICON 0x27805
AFX_HIDD_CONVERT 0x27806
AFX_HIDD_PASTESPECIAL 0x27807
AFX_HIDD_EDITLINKS 0x27808
AFX_HIDD_FILEBROWSE 0x27809
AFX_HIDD_BUSY 0x2780A
AFX_HIDD_OBJECTPROPERTIES 0x2780C
AFX_HIDD_CHANGESOURCE 0x2780D
// Prompts/Errors (AFX_HIDP_*)
AFX_HIDP_NO_ERROR_AVAILABLE 0x3F020
AFX_HIDP_INVALID_FILENAME 0x3F100
AFX_HIDP_FAILED_TO_OPEN_DOC 0x3F101
AFX_HIDP_FAILED_TO_SAVE_DOC 0x3F102
AFX_HIDP_ASK_TO_SAVE 0x3F103
AFX_HIDP_FAILED_TO_CREATE_DOC 0x3F104
AFX_HIDP_FILE_TOO_LARGE 0x3F105
AFX_HIDP_FAILED_TO_START_PRINT 0x3F106
AFX_HIDP_FAILED_TO_LAUNCH_HELP 0x3F107
AFX_HIDP_INTERNAL_FAILURE 0x3F108
AFX_HIDP_COMMAND_FAILURE 0x3F109
AFX_HIDP_FAILED_MEMORY_ALLOC 0x3F10A
AFX_HIDP_PARSE_INT 0x3F110
AFX_HIDP_PARSE_REAL 0x3F111
AFX_HIDP_PARSE_INT_RANGE 0x3F112
AFX_HIDP_PARSE_REAL_RANGE 0x3F113
AFX_HIDP_PARSE_STRING_SIZE 0x3F114
AFX_HIDP_PARSE_RADIO_BUTTON 0x3F115
AFX_HIDP_PARSE_BYTE 0x3F116
AFX_HIDP_PARSE_UINT 0x3F117
AFX_HIDP_PARSE_DATETIME 0x3F118
AFX_HIDP_PARSE_CURRENCY 0x3F119
AFX_HIDP_FAILED_INVALID_FORMAT 0x3F120
AFX_HIDP_FAILED_INVALID_PATH 0x3F121
AFX_HIDP_FAILED_DISK_FULL 0x3F122
AFX_HIDP_FAILED_ACCESS_READ 0x3F123
AFX_HIDP_FAILED_ACCESS_WRITE 0x3F124
AFX_HIDP_FAILED_IO_ERROR_READ 0x3F125
AFX_HIDP_FAILED_IO_ERROR_WRITE 0x3F126
AFX_HIDP_STATIC_OBJECT 0x3F180
AFX_HIDP_FAILED_TO_CONNECT 0x3F181
AFX_HIDP_SERVER_BUSY 0x3F182
AFX_HIDP_BAD_VERB 0x3F183
AFX_HIDP_FAILED_TO_NOTIFY 0x3F185
AFX_HIDP_FAILED_TO_LAUNCH 0x3F186
AFX_HIDP_ASK_TO_UPDATE 0x3F187
AFX_HIDP_FAILED_TO_UPDATE 0x3F188
AFX_HIDP_FAILED_TO_REGISTER 0x3F189
AFX_HIDP_FAILED_TO_AUTO_REGISTER 0x3F18A
AFX_HIDP_FAILED_TO_CONVERT 0x3F18B
AFX_HIDP_GET_NOT_SUPPORTED 0x3F18C
AFX_HIDP_SET_NOT_SUPPORTED 0x3F18D
AFX_HIDP_ASK_TO_DISCARD 0x3F18E
AFX_HIDP_FAILED_TO_CREATE 0x3F18F
AFX_HIDP_FAILED_MAPI_LOAD 0x3F190
AFX_HIDP_INVALID_MAPI_DLL 0x3F191
AFX_HIDP_FAILED_MAPI_SEND 0x3F192
AFX_HIDP_FILE_NONE 0x3F1A0
AFX_HIDP_FILE_GENERIC 0x3F1A1
AFX_HIDP_FILE_NOT_FOUND 0x3F1A2
AFX_HIDP_FILE_BAD_PATH 0x3F1A3
AFX_HIDP_FILE_TOO_MANY_OPEN 0x3F1A4
AFX_HIDP_FILE_ACCESS_DENIED 0x3F1A5
AFX_HIDP_FILE_INVALID_FILE 0x3F1A6
AFX_HIDP_FILE_REMOVE_CURRENT 0x3F1A7
AFX_HIDP_FILE_DIR_FULL 0x3F1A8
AFX_HIDP_FILE_BAD_SEEK 0x3F1A9
AFX_HIDP_FILE_HARD_IO 0x3F1AA
AFX_HIDP_FILE_SHARING 0x3F1AB
AFX_HIDP_FILE_LOCKING 0x3F1AC
AFX_HIDP_FILE_DISKFULL 0x3F1AD
AFX_HIDP_FILE_EOF 0x3F1AE
AFX_HIDP_ARCH_NONE 0x3F1B0
AFX_HIDP_ARCH_GENERIC 0x3F1B1
AFX_HIDP_ARCH_READONLY 0x3F1B2
AFX_HIDP_ARCH_ENDOFFILE 0x3F1B3
AFX_HIDP_ARCH_WRITEONLY 0x3F1B4
AFX_HIDP_ARCH_BADINDEX 0x3F1B5
AFX_HIDP_ARCH_BADCLASS 0x3F1B6
AFX_HIDP_ARCH_BADSCHEMA 0x3F1B7
AFX_HIDP_SQL_CONNECT_FAIL 0x3F281
AFX_HIDP_SQL_RECORDSET_FORWARD_ONLY 0x3F282
AFX_HIDP_SQL_EMPTY_COLUMN_LIST 0x3F283
AFX_HIDP_SQL_FIELD_SCHEMA_MISMATCH 0x3F284
AFX_HIDP_SQL_ILLEGAL_MODE 0x3F285
AFX_HIDP_SQL_MULTIPLE_ROWS_AFFECTED 0x3F286
AFX_HIDP_SQL_NO_CURRENT_RECORD 0x3F287
AFX_HIDP_SQL_NO_ROWS_AFFECTED 0x3F288
AFX_HIDP_SQL_RECORDSET_READONLY 0x3F289
AFX_HIDP_SQL_SQL_NO_TOTAL 0x3F28A
AFX_HIDP_SQL_ODBC_LOAD_FAILED 0x3F28B
AFX_HIDP_SQL_DYNASET_NOT_SUPPORTED 0x3F28C
AFX_HIDP_SQL_SNAPSHOT_NOT_SUPPORTED 0x3F28D
AFX_HIDP_SQL_API_CONFORMANCE 0x3F28E
AFX_HIDP_SQL_SQL_CONFORMANCE 0x3F28F
AFX_HIDP_SQL_NO_DATA_FOUND 0x3F290
AFX_HIDP_SQL_ROW_UPDATE_NOT_SUPPORTED 0x3F291
AFX_HIDP_SQL_ODBC_V2_REQUIRED 0x3F292
AFX_HIDP_SQL_NO_POSITIONED_UPDATES 0x3F293
AFX_HIDP_SQL_LOCK_MODE_NOT_SUPPORTED 0x3F294
AFX_HIDP_SQL_DATA_TRUNCATED 0x3F295
AFX_HIDP_SQL_ROW_FETCH 0x3F296
AFX_HIDP_SQL_INCORRECT_ODBC 0x3F297
AFX_HIDP_SQL_UPDATE_DELETE_FAILED 0x3F298
AFX_HIDP_SQL_DYNAMIC_CURSOR_NOT_SUPPORTED 0x3F299
AFX_HIDP_DAO_ENGINE_INITIALIZATION 0x3F2A0
AFX_HIDP_DAO_DFX_BIND 0x3F2A1
AFX_HIDP_DAO_OBJECT_NOT_OPEN 0x3F2A2
AFX_HIDP_DAO_ROWTOOSHORT 0x3F2A3
AFX_HIDP_DAO_BADBINDINFO 0x3F2A4
AFX_HIDP_DAO_COLUMNUNAVAILABLE 0x3F2A5
// Frame Controls (AFX_HIDW_*)
AFX_HIDW_TOOLBAR 0x5E800
AFX_HIDW_STATUS_BAR 0x5E801
AFX_HIDW_PREVIEW_BAR 0x5E802
AFX_HIDW_RESIZE_BAR 0x5E803
AFX_HIDW_DOCKBAR_TOP 0x5E81B
AFX_HIDW_DOCKBAR_LEFT 0x5E81C
AFX_HIDW_DOCKBAR_RIGHT 0x5E81D
AFX_HIDW_DOCKBAR_BOTTOM 0x5E81E
AFX_HIDW_DOCKBAR_FLOAT 0x5E81F
-98
View File
@@ -1,98 +0,0 @@
{\rtf1\ansi \deff0\deflang1024{\fonttbl{\f0\froman Times New Roman;}{\f1\froman Symbol;}{\f2\fswiss Arial;}{\f3\froman Tms Rmn;}{\f4\fswiss Helv;}{\f5\fswiss Helvetica;}{\f6\fswiss MS Sans Serif;}}
{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;\red0\green0\blue127;\red0\green127\blue127;\red0\green127\blue0;
\red127\green0\blue127;\red127\green0\blue0;\red127\green127\blue0;\red127\green127\blue127;\red192\green192\blue192;}{\stylesheet{\s244 \f3\fs16\up6\lang1033 \sbasedon0\snext0 footnote reference;}{\s245 \f3\fs20\lang1033
\sbasedon0\snext245 footnote text;}{\s246\li720 \i\f3\fs20\lang1033 \sbasedon0\snext255 heading 9;}{\s247\li720 \i\f3\fs20\lang1033 \sbasedon0\snext255 heading 8;}{\s248\li720 \i\f3\fs20\lang1033 \sbasedon0\snext255 heading 7;}{\s249\li720
\f3\fs20\ul\lang1033 \sbasedon0\snext255 heading 6;}{\s250\li720 \b\f3\fs20\lang1033 \sbasedon0\snext255 heading 5;}{\s251\li360 \f3\ul\lang1033 \sbasedon0\snext255 heading 4;}{\s252\li360 \b\f3\lang1033 \sbasedon0\snext255 heading 3;}{\s253\sb120
\b\f4\lang1033 \sbasedon0\snext0 heading 2;}{\s254\sb240 \b\f4\ul\lang1033 \sbasedon0\snext0 heading 1;}{\s255\li720 \f3\fs20\lang1033 \sbasedon0\snext255 Normal Indent;}{\f3\fs20\lang1033 \snext0 Normal;}{\s2\fi-240\li480\sb80\tx480 \f5\lang1033
\sbasedon0\snext2 nscba;}{\s3\fi-240\li240\sa20 \f5\lang1033 \sbasedon0\snext3 j;}{\s4\li480\sa20 \f5\lang1033 \sbasedon0\snext4 ij;}{\s5\sb80\sa20 \f5\lang1033 \sbasedon0\snext5 btb;}{\s6\fi-240\li2400\sb20\sa20 \f5\fs20\lang1033 \sbasedon0\snext6 ctcb;}
{\s7\fi-240\li480\sa40\tx480 \f5\lang1033 \sbasedon0\snext7 ns;}{\s8\sa120 \f5\fs28\lang1033 \sbasedon0\snext8 TT;}{\s9\fi-240\li2400\sa20 \f5\lang1033 \sbasedon0\snext9 crtj;}{\s10\fi-240\li480\tx480 \f5\lang1033 \sbasedon0\snext10 nsca;}{\s11\sa20
\f5\lang1033 \sbasedon0\snext11 bt;}{\s12\li240\sb120\sa40 \f5\lang1033 \sbasedon0\snext12 Hf;}{\s13\li240\sb120\sa40 \f5\lang1033 \sbasedon0\snext13 Hs;}{\s14\li480\sb120\sa40 \f5\lang1033 \sbasedon0\snext14 RT;}{\s15\fi-2160\li2160\sb240\sa80\tx2160
\f5\lang1033 \sbasedon0\snext15 c;}{\s16\li2160\sa20 \f5\lang1033 \sbasedon0\snext16 ct;}{\s17\li240\sa20 \f5\lang1033 \sbasedon0\snext17 it;}{\s18\li480 \f5\fs20\lang1033 \sbasedon0\snext18 nsct;}{\s19\fi-160\li400\sb80\sa40 \f5\lang1033
\sbasedon0\snext19 nscb;}{\s20\fi-2640\li2880\sb120\sa40\brdrb\brdrs\brdrw15 \brdrbtw\brdrs\brdrw15 \tx2880 \f5\lang1033 \sbasedon0\snext20 HC2;}{\s21\fi-2640\li2880\sb120\sa20\tx2880 \f5\lang1033 \sbasedon0\snext21 C2;}{\s22\fi-240\li2400\sa20
\f5\fs20\lang1033 \sbasedon0\snext22 ctc;}{\s23\li2160\sb160 \f5\lang1033 \sbasedon0\snext23 crt;}{\s24\li480\sb20\sa40 \f5\lang1033 \sbasedon0\snext24 or;}{\s25\fi-259\li360\sb40\sa40\tx360 \f6\fs20\lang1033 \sbasedon0\snext25 Ln1;}{\s26\li115\sb80\sa80
\f6\fs20\lang1033 \sbasedon0\snext0 *Intro;}{\s27\li115\sb80\sa80\keepn \b\f6\lang1033 \sbasedon252\snext26 *Title;}{\s28\fi-245\li360\sb80 \f6\fs20\lang1033 \snext28 *Jl;}{\s29\li360\sb40\sa40 \f6\fs20\lang1033 \snext0 Lp1;}{
\s30\fi-1800\li1915\sb60\sl-240\tx1915 \f6\fs20\lang1033 \sbasedon0\snext30 Tph;}{\s31\li115\sb120\sa80 \b\f6\fs20\lang1033 \snext25 Proch;}}{\info{\title AFXPRINT}{\subject MFC Print RTF Help}{\author AFX}{\creatim\yr1992\mo10\dy7\hr12\min33}{\version1}
{\edmins46}{\nofpages1}{\nofwords65536}{\nofchars65536}{\vern16433}}\paperw12240\paperh15840\margl1800\margr1800\margt1440\margb1440\gutter0 \widowctrl\ftnbj \sectd \linex0\endnhere \pard\plain \sl240 \f3\fs20\lang1033 {\f4 \page }{\f4 #{\footnote
\pard\plain \sl240 \f3\fs20\lang1033 # HID_FILE_PRINT}}{\fs16\up6 K{\footnote \pard\plain \s245 \f3\fs20\lang1033 {\fs16\up6 K} printing and print preview}}{\f4 }{\fs16\up6 ${\footnote \pard\plain \s245 \f3\fs20\lang1033 {\fs16\up6 $} File Print command}
}{\f4 }{\b\f4 Print command (File menu)}{\b\f4
\par }{\f4
\par }{\f4 Use this command to print a document. This command presents a }{\f4\uldb Print dialog box}{\v AFX_HIDD_PRINT}{\f4
, where you may specify the range of pages to be printed, the number of copies, the destination printer, and other printer setup options.}{\b\f4
\par }{\b\f4
\par }{\b\f4 Shortcuts}{\b\f4
\par }\pard \fi-1080\li1440\sl240\tx1440 {\f4 Toolbar:}{\f4 \tab }{\f4 \{}{\f4 bmc }{\f4 fileprnt.bmp}{\f4 \}}{\f4
\par }{\f4 Keys:}{\f4 \tab }{\f4 CTRL+P}{\f4
\par }\pard \sl240 {\f4
\par }{\f4 \page }{\f4 #{\footnote \pard\plain \sl240 \f3\fs20\lang1033 # AFX_HIDD_PRINT}}{\b\f4 Print }{\b\f4 dialog box}{\b\f4
\par }{\f4
\par }{\f4 The following options allow you to specify how the document should be printed:}{\f4
\par }\pard \sb60\sl240 {\b\f4 Printer}{\b\f4
\par }\pard \li360\sl240 {\f4 This is the active printer and printer connection. Choose the Setup option to change the printer and printer connection.}{\f4
\par }\pard \sb60\sl240 {\b\f4 Setup}{\b\f4
\par }\pard \li360\sl240 {\f4 Displays a }{\f4\uldb Print Setup dialog box}{\v AFX_HIDD_PRINTSETUP}{\f4 , so you can select a printer and printer connection.}{\f4
\par }\pard \sb60\sl240 {\b\f4 Print Range}{\b\f4
\par }\pard \li360\sl240 {\f4 Specify the pages you want to print:}{\f4
\par }\trowd \trgaph108\trleft402 \cellx1647\cellx8622\pard \sl240\intbl {\b\f4 All}{\b\f4 \cell }{\f4 Prints the entire document.}{\f4 \cell }\pard \intbl {\f4 \row }\trowd \trgaph108\trleft402 \cellx1647\cellx8622\pard \sl240\intbl {\b\f4 Selection}{\b\f4
\cell }{\f4 Prints the currently selected text.}{\f4 \cell }\pard \intbl {\f4 \row }\trowd \trgaph108\trleft402 \cellx1647\cellx8622\pard \sl240\intbl {\b\f4 Pages}{\b\f4 \cell }{\f4 Prints the range of pages you specify in }{\f4 the From and To boxes.}{
\f4 \cell }\pard \intbl {\f4 \row }\pard \sb60\sl240 {\b\f4 Copies}{\b\f4
\par }\pard \li360\sl240 {\f4 Specify the number of copies you want to print for the above page range.}{\f4
\par }\pard \sb60\sl240 {\b\f4 Collate Copies}{\b\f4
\par }\pard \li360\sl240 {\f4 Prints copies in page number order, instead of separated multiple copies of each page.}{\f4
\par }\pard \sb60\sl240 {\b\f4 Print Quality}{\b\f4
\par }\pard \li360\sl240 {\f4 Select the quality of the printing. Generally, lower quality printing takes less time to produce.}{\f4
\par }\pard \sl240 {\f4 \page }{\f4 #{\footnote \pard\plain \sl240 \f3\fs20\lang1033 # AFX_HIDD_PRINTDLG}}{\b\f4 P}{\b\f4 rint Progress Dialog}{\b\f4
\par }{\f4
\par }{\f4 The Printing dialog box is shown during the time that <<YourApp>> is sending output to the printer. The page number indicates the progre}{\f4 ss of the printing.}{\f4
\par }{\f4
\par }{\f4 To abort printing, choose Cancel.}{\f4
\par }{\f4
\par }{\f4 \page }{\f4 #{\footnote \pard\plain \sl240 \f3\fs20\lang1033 # HID_FILE_PRINT_PREVIEW}}{\fs16\up6 K{\footnote \pard\plain \s245 \f3\fs20\lang1033 {\fs16\up6 K} printing and print preview}}{\f4 }{\fs16\up6 ${\footnote \pard\plain \s245
\f3\fs20\lang1033 {\fs16\up6 $} File Print Preview command}}{\f4 }{\b\f4 Print Preview command (File menu)}{\f4
\par }{\f4
\par }{\f4 Use this command to display the active document as it would appear when printed. When you choose this command, the main window will be replaced with a print preview window in which one or two pages will be displayed in their printed format. The }{
\f4\uldb print preview toolbar}{\v\f4 AFX_HIDW_PREVIEW_BAR}{\f4 offers you options to view either one or two pages at a time; move back and forth through the document; zoom in and out of pages; and initiate a print job.}{\f4
\par }{\f4 \page }{\f4 #{\footnote \pard\plain \sl240 \f3\fs20\lang1033 # AFX_HIDW_PREVIEW_BAR}}{\fs16\up6 K{\footnote \pard\plain \s245 \f3\fs20\lang1033 {\fs16\up6 K} printing and print preview}}{\f4 }{\fs16\up6 ${\footnote \pard\plain \s245
\f3\fs20\lang1033 {\fs16\up6 $} print preview toolbar}}{\f4 }{\b\f4 Print Preview toolbar}{\b\f4
\par }{\f4
\par }{\f4 The print preview toolbar offers you the following options:}{\f4
\par }\pard \sb60\sl240 {\b\f4 Print}{\b\f4
\par }\pard \li360\sl240 {\f4 Bring up the print dialog box, to start a print job.}{\f4
\par }\pard \sb60\sl240 {\b\f4 Next Page}{\b\f4
\par }\pard \li360\sl240 {\f4 Preview the next printed page.}{\f4
\par }\pard \sb60\sl240 {\b\f4 Prev Page}{\b\f4
\par }\pard \li360\sl240 {\f4 Preview the previous printed page.}{\f4
\par }\pard \sb60\sl240 {\b\f4 One Page / Two Page}{\b\f4
\par }\pard \li360\sl240 {\f4 Preview one or two printed pages at a time.}{\f4
\par }\pard \sb60\sl240 {\b\f4 Zoom In}{\b\f4
\par }\pard \li360\sl240 {\f4 Take a closer look at the printed page.}{\f4
\par }\pard \sb60\sl240 {\b\f4 Zoom Out}{\b\f4
\par }\pard \li360\sl240 {\f4 Take a larger look at the printed page.}{\f4
\par }\pard \sb60\sl240 {\b\f4 Close}{\b\f4
\par }\pard \li360\sl240 {\f4 Return from print preview to the editing window.}{\f4
\par }\pard \sl240 {\f4
\par }{\f4 \page }{\f4 #{\footnote \pard\plain \sl240 \f3\fs20\lang1033 # HID_FILE_PRINT_SETUP}}{\fs16\up6 K{\footnote \pard\plain \s245 \f3\fs20\lang1033 {\fs16\up6 K} printing and print preview}}{\f4 }{\fs16\up6 ${\footnote \pard\plain \s245
\f3\fs20\lang1033 {\fs16\up6 $} File Print Setup command}}{\f4 }{\b\f4 Print Setup command (File menu)}{\b\f4
\par }{\f4
\par }{\f4 Use this command to select a printer and a printer connection. This command presents a }{\f4\uldb Print Setup dialog box}{\v AFX_HIDD_PRINTSETUP}{\f4 , where you specify the printer and its connection.}{\b\f4
\par }{\f4 \page }{\f4 #{\footnote \pard\plain \sl240 \f3\fs20\lang1033 # AFX_HIDD_PRINTSETUP}}{\b\f4 Print}{\b\f4 Setup dialog box}{\b\f4
\par }{\f4
\par }{\f4 The following options allow you to select the destination printer and its connection.}{\f4
\par }\pard \sb60\sl240 {\b\f4 Printer}{\b\f4
\par }\pard \li360\sl240 {\f4
Select the printer you want to use. Choose the Default Printer; or choose the Specific Printer option and select one of the current installed printers shown in the box. You install printers and configure ports using the Windows Control Panel. }{\f4
\par }\pard \sb60\sl240 {\b\f4 Orientation}{\b\f4
\par }\pard \li360\sl240 {\f4 Choose Portrait or Landscape.}{\f4
\par }\pard \sb60\sl240 {\b\f4 Paper Size}{\b\f4
\par }\pard \li360\sl240 {\f4 Select the size of paper that the document is to be printed on.}{\f4
\par }\pard \sb60\sl240 {\b\f4 Paper Source}{\b\f4
\par }\pard \li360\sl240 {\f4 Some printers offer multiple trays for different paper sources. Specify the tray here.}{\f4
\par }\pard \sb60\sl240 {\b\f4 Options}{\b\f4
\par }\pard \li360\sl240 {\f4 Displays a dialog box where you can make additional choices about printing, specific to the type of printer you have selected.}{\f4
\par }\pard \sb60\sl240 {\b\f4 Network...}{\b\f4
\par }\pard \li360\sl240 {\f4 Choose this button to connect to a network location, assigning it a new drive letter.}{\f4
\par }\pard \sl240 {\f4 \page }{\f4 #{\footnote \pard\plain \sl240 \f3\fs20\lang1033 # HID_FILE_PAGE_SETUP}}{\f4 ${\footnote \pard\plain \sl240 \f3\fs20\lang1033 $ File Page Setup Command}}{\b\f4 Page Setup command (File menu)}{\b\f4
\par }{\b\f4
\par }{\f4 << Write application-specific help here. >>}{\f4
\par }\pard
\par }
Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

Loaded 100 of 1154 files, more files were not shown because too many files have changed in this diff. Show more