mirror of
https://github.com/scp-fs2open/fs2open.github.com.git
synced 2026-11-07 18:31:26 -10:00
Compare commits
126
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f475ae983e | ||
|
|
3be57f609e | ||
|
|
fc66e2f78b | ||
|
|
1afadaa142 | ||
|
|
1583b74c9d | ||
|
|
e8ba07ee43 | ||
|
|
7f706d398f | ||
|
|
7b50be4afb | ||
|
|
f690e124d0 | ||
|
|
df6e87f552 | ||
|
|
45305bf78f | ||
|
|
e6f640c53d | ||
|
|
4f1d39ed0e | ||
|
|
a7570926c9 | ||
|
|
aa481d7463 | ||
|
|
e79afa5b65 | ||
|
|
b69a80db90 | ||
|
|
5f64b680f5 | ||
|
|
a3508be54a | ||
|
|
0fede5f475 | ||
|
|
a8c36b9654 | ||
|
|
8c98287b39 | ||
|
|
345fa9c3ac | ||
|
|
cf483e0237 | ||
|
|
f40710f500 | ||
|
|
9f162d813f | ||
|
|
3edee14eea | ||
|
|
82757763e6 | ||
|
|
91346a814d | ||
|
|
5f013ad41d | ||
|
|
00cd5490c4 | ||
|
|
a4542cf71b | ||
|
|
f4521da771 | ||
|
|
6ba0f3622a | ||
|
|
e3765e24e1 | ||
|
|
7171bf1005 | ||
|
|
b85ee3217d | ||
|
|
12f137c645 | ||
|
|
f0eb798f7e | ||
|
|
5c60351288 | ||
|
|
5895aca2c5 | ||
|
|
cfd2469f8b | ||
|
|
0094a5dba4 | ||
|
|
94e84fc9b8 | ||
|
|
35ad2c5cdc | ||
|
|
af7e0a700b | ||
|
|
8943449825 | ||
|
|
555488e0bb | ||
|
|
c6cf9da861 | ||
|
|
f11e9253b2 | ||
|
|
fac68e4838 | ||
|
|
17d8105c38 | ||
|
|
a31eed376c | ||
|
|
e8abd881d2 | ||
|
|
136b5c936d | ||
|
|
34855d000e | ||
|
|
b6eed01e41 | ||
|
|
9616fb4cd7 | ||
|
|
344d8ba217 | ||
|
|
7e5239aff0 | ||
|
|
09d5225883 | ||
|
|
7f3ba14cec | ||
|
|
850414b358 | ||
|
|
f18fa672f2 | ||
|
|
fcb62348b9 | ||
|
|
fbbb31bc49 | ||
|
|
4d0e574ba4 | ||
|
|
ce5b56fdf7 | ||
|
|
04de7f7498 | ||
|
|
46b2165312 | ||
|
|
4182951b19 | ||
|
|
cbd6f247d9 | ||
|
|
73facc313e | ||
|
|
d2e3094544 | ||
|
|
61512d5b8f | ||
|
|
2b42038c09 | ||
|
|
ad8f6ccda3 | ||
|
|
a201c9b3f3 | ||
|
|
7edde650a1 | ||
|
|
ae3b88f23b | ||
|
|
c86e58e5e8 | ||
|
|
f441432d57 | ||
|
|
417982862e | ||
|
|
158733df8f | ||
|
|
4b75870857 | ||
|
|
dbfe86f018 | ||
|
|
f7d95acec8 | ||
|
|
506686cfb7 | ||
|
|
8415a591e1 | ||
|
|
1f8644f059 | ||
|
|
f32f947b62 | ||
|
|
99ce717f7e | ||
|
|
28f32a2f6d | ||
|
|
3d5d730306 | ||
|
|
96426de56f | ||
|
|
b14b5e3622 | ||
|
|
35cd6ea336 | ||
|
|
3332870e9e | ||
|
|
944c4bb2f2 | ||
|
|
705faf4a78 | ||
|
|
614eda3b08 | ||
|
|
593cf6a533 | ||
|
|
17ddae5db4 | ||
|
|
d1b1eb65b6 | ||
|
|
43ee74a2e0 | ||
|
|
20d33ac699 | ||
|
|
1609e9211f | ||
|
|
c8c05e9d0b | ||
|
|
35130122e4 | ||
|
|
c1b549867a | ||
|
|
efea823ef1 | ||
|
|
91e375693c | ||
|
|
022aa38ad1 | ||
|
|
40419fb891 | ||
|
|
25d4a3b439 | ||
|
|
968e8d3d66 | ||
|
|
6610938b80 | ||
|
|
4b2691f572 | ||
|
|
0ac2532fe5 | ||
|
|
e42892cb90 | ||
|
|
0d14a559eb | ||
|
|
2a65fcb388 | ||
|
|
a02b9d953a | ||
|
|
53f8c36587 | ||
|
|
8323f5b4ad | ||
|
|
6ef349a6d4 |
No files matched your search
+1
-1
@@ -2,7 +2,7 @@
|
||||
#
|
||||
# This file uses GNU Automake to generate makefiles
|
||||
|
||||
SUBDIRS = libjpeg lua code
|
||||
SUBDIRS = code
|
||||
|
||||
|
||||
EXTRA_DIST = \
|
||||
|
||||
+2
-2
@@ -49,7 +49,7 @@ DIE=0
|
||||
DIE=1
|
||||
}
|
||||
|
||||
for AM in automake-1.9 automake-1.8 automake-1.7 automake-1.6 automake; do
|
||||
for AM in automake-1.11 automake-1.10 automake-1.9 automake-1.8 automake-1.7 automake-1.6 automake; do
|
||||
(check_version "$AM" 1 6 1) && {
|
||||
AUTOMAKE="$AM"
|
||||
break
|
||||
@@ -67,7 +67,7 @@ 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
|
||||
for ACL in aclocal-1.11 aclocal-1.10 aclocal-1.9 aclocal-1.8 aclocal-1.7 aclocal-1.6 aclocal; do
|
||||
(check_version "$ACL" 1 6 1) && {
|
||||
ACLOCAL="$ACL"
|
||||
break
|
||||
|
||||
+72
-73
@@ -185,13 +185,13 @@ EXTRA_DIST = \
|
||||
|
||||
# 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_CXXFLAGS = @D_CFLAGS@ @FS2_CXXFLAGS@
|
||||
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
|
||||
EXTRA_PROGRAMS = fs2_open_r fs2_open_d wxFRED2_r wxFRED2_d fs2_open_INF_r fs2_open_INF_d wxFRED2_INF_r wxFRED2_INF_d
|
||||
|
||||
###############################################################################
|
||||
##
|
||||
@@ -264,6 +264,9 @@ FS2_SOURCES = \
|
||||
demo/demo.h \
|
||||
exceptionhandler/exceptionhandler.cpp \
|
||||
exceptionhandler/exceptionhandler.h \
|
||||
external_dll/externalcode.h \
|
||||
external_dll/trackirglobal.cpp \
|
||||
external_dll/trackirglobal.h \
|
||||
fireball/fireballs.cpp \
|
||||
fireball/fireballs.h \
|
||||
fireball/warpineffect.cpp \
|
||||
@@ -280,6 +283,10 @@ FS2_SOURCES = \
|
||||
gamehelp/gameplayhelp.h \
|
||||
gamesequence/gamesequence.cpp \
|
||||
gamesequence/gamesequence.h \
|
||||
gamesnd/eventmusic.cpp \
|
||||
gamesnd/eventmusic.h \
|
||||
gamesnd/gamesnd.cpp \
|
||||
gamesnd/gamesnd.h \
|
||||
globalincs/alphacolors.cpp \
|
||||
globalincs/alphacolors.h \
|
||||
globalincs/crypt.cpp \
|
||||
@@ -289,6 +296,9 @@ FS2_SOURCES = \
|
||||
globalincs/globals.h \
|
||||
globalincs/linklist.h \
|
||||
globalincs/pstypes.h \
|
||||
globalincs/safe_strings.cpp \
|
||||
globalincs/safe_strings.h \
|
||||
globalincs/safe_strings_test.cpp \
|
||||
globalincs/systemvars.cpp \
|
||||
globalincs/systemvars.h \
|
||||
globalincs/version.cpp \
|
||||
@@ -306,10 +316,18 @@ FS2_SOURCES = \
|
||||
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/gropenglpostprocessing.cpp \
|
||||
graphics/gropenglpostprocessing.h \
|
||||
graphics/gropenglshader.cpp \
|
||||
graphics/gropenglshader.h \
|
||||
graphics/gropenglstate.cpp \
|
||||
graphics/gropenglstate.h \
|
||||
graphics/gropengltexture.cpp \
|
||||
graphics/gropengltexture.h \
|
||||
graphics/gropengltnl.cpp \
|
||||
@@ -370,8 +388,6 @@ FS2_SOURCES = \
|
||||
io/mouse.h \
|
||||
io/timer.cpp \
|
||||
io/timer.h \
|
||||
io/trackir.cpp \
|
||||
io/trackir.h \
|
||||
jpgutils/jpgutils.cpp \
|
||||
jpgutils/jpgutils.h \
|
||||
jumpnode/jumpnode.cpp \
|
||||
@@ -386,7 +402,6 @@ FS2_SOURCES = \
|
||||
localization/fhash.h \
|
||||
localization/localize.cpp \
|
||||
localization/localize.h \
|
||||
math/bitarray.h \
|
||||
math/fix.cpp \
|
||||
math/fix.h \
|
||||
math/floating.cpp \
|
||||
@@ -530,6 +545,8 @@ FS2_SOURCES = \
|
||||
network/multi_rate.h \
|
||||
network/multi_respawn.cpp \
|
||||
network/multi_respawn.h \
|
||||
network/multi_sexp.cpp \
|
||||
network/multi_sexp.h \
|
||||
network/multi_team.cpp \
|
||||
network/multi_team.h \
|
||||
network/multi_update.h \
|
||||
@@ -559,6 +576,8 @@ FS2_SOURCES = \
|
||||
object/object.h \
|
||||
object/objectshield.cpp \
|
||||
object/objectshield.h \
|
||||
object/objectsnd.cpp \
|
||||
object/objectsnd.h \
|
||||
object/objectsort.cpp \
|
||||
object/parseobjectdock.cpp \
|
||||
object/parseobjectdock.h \
|
||||
@@ -582,6 +601,8 @@ FS2_SOURCES = \
|
||||
particle/particle.h \
|
||||
pcxutils/pcxutils.cpp \
|
||||
pcxutils/pcxutils.h \
|
||||
pngutils/pngutils.cpp \
|
||||
pngutils/pngutils.h \
|
||||
physics/physics.cpp \
|
||||
physics/physics.h \
|
||||
playerman/managepilot.cpp \
|
||||
@@ -619,6 +640,30 @@ FS2_SOURCES = \
|
||||
ship/shiphit.cpp \
|
||||
ship/shiphit.h \
|
||||
ship/subsysdamage.h \
|
||||
sound/audiostr.cpp \
|
||||
sound/audiostr.h \
|
||||
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/fsspeech.cpp \
|
||||
sound/fsspeech.h \
|
||||
sound/openal.cpp \
|
||||
sound/openal.h \
|
||||
sound/rtvoice.cpp \
|
||||
sound/rtvoice.h \
|
||||
sound/sound.cpp \
|
||||
sound/sound.h \
|
||||
sound/speech.cpp \
|
||||
sound/speech.h \
|
||||
sound/voicerec.cpp \
|
||||
sound/voicerec.h \
|
||||
sound/ogg/ogg.cpp \
|
||||
sound/ogg/ogg.h \
|
||||
species_defs/species_defs.cpp \
|
||||
species_defs/species_defs.h \
|
||||
starfield/nebula.cpp \
|
||||
@@ -692,56 +737,9 @@ JOY_SOURCES = \
|
||||
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 \
|
||||
@@ -749,7 +747,6 @@ WIN32_SOURCES = \
|
||||
directx/vdplay.h \
|
||||
directx/vdplobby.h \
|
||||
directx/vdsetup.h \
|
||||
directx/vdsound.h \
|
||||
directx/vdvp.h \
|
||||
globalincs/windebug.cpp \
|
||||
graphics/gl/GLAUX.H \
|
||||
@@ -757,20 +754,6 @@ WIN32_SOURCES = \
|
||||
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 \
|
||||
@@ -795,8 +778,8 @@ endif
|
||||
|
||||
|
||||
## libcode.a
|
||||
libcode_a_SOURCES = ${FS2_SOURCES} ${JOY_SOURCES} ${SOUND_SOURCES} \
|
||||
${WIN32_SOURCES} ${UNIX_SOURCES}
|
||||
libcode_a_SOURCES = ${FS2_SOURCES} ${JOY_SOURCES} ${WIN32_SOURCES} \
|
||||
${UNIX_SOURCES}
|
||||
|
||||
##
|
||||
## End CODE library
|
||||
@@ -820,8 +803,16 @@ fs2_open_d_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
|
||||
fs2_open_INF_d_SOURCES = \
|
||||
${FS2OPEN_SOURCES}
|
||||
|
||||
fs2_open_INF_r_SOURCES = \
|
||||
${FS2OPEN_SOURCES}
|
||||
|
||||
fs2_open_d_LDADD = libcode.a
|
||||
fs2_open_r_LDADD = libcode.a
|
||||
fs2_open_INF_d_LDADD = libcode.a
|
||||
fs2_open_INF_r_LDADD = libcode.a
|
||||
|
||||
##
|
||||
## End MAIN binary
|
||||
@@ -847,8 +838,16 @@ wxFRED2_d_SOURCES = \
|
||||
wxFRED2_r_SOURCES = \
|
||||
${wxFRED_SOURCES}
|
||||
|
||||
wxFRED2_d_LDADD = libcode.a ../libjpeg/libjpeg.a
|
||||
wxFRED2_r_LDADD = libcode.a ../libjpeg/libjpeg.a
|
||||
wxFRED2_INF_d_SOURCES = \
|
||||
${wxFRED_SOURCES}
|
||||
|
||||
wxFRED2_INF_r_SOURCES = \
|
||||
${wxFRED_SOURCES}
|
||||
|
||||
wxFRED2_d_LDADD = libcode.a
|
||||
wxFRED2_r_LDADD = libcode.a
|
||||
wxFRED2_INF_d_LDADD = libcode.a
|
||||
wxFRED2_INF_r_LDADD = libcode.a
|
||||
|
||||
##
|
||||
## End wxFRED2 binary
|
||||
|
||||
+2
-2
@@ -88,9 +88,9 @@ char *ai_get_goal_ship_name(char *name, int *index)
|
||||
}
|
||||
|
||||
Assert(Total_goal_ship_names < MAX_GOAL_SHIP_NAMES);
|
||||
Assert(strlen(name) < NAME_LENGTH - 1);
|
||||
Assertion(strlen(name) < NAME_LENGTH - 1, "Ship name %s is too long. Needs to be 31 characters or less.", name);
|
||||
i = Total_goal_ship_names++;
|
||||
strcpy(Goal_ship_names[i], name);
|
||||
strcpy_s(Goal_ship_names[i], name);
|
||||
*index = i;
|
||||
return Goal_ship_names[i];
|
||||
}
|
||||
+119
-291
@@ -7,291 +7,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Ship/ai.h $
|
||||
* $Revision: 1.12.2.2 $
|
||||
* $Date: 2007-08-11 16:51:55 $
|
||||
* $Author: Goober5000 $
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 1.12.2.1 2006/06/04 01:03:12 Goober5000
|
||||
* add fighterbay restriction code
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 1.12 2006/02/25 21:46:59 Goober5000
|
||||
* spelling
|
||||
*
|
||||
* Revision 1.11 2006/02/20 02:13:07 Goober5000
|
||||
* added ai-ignore-new which hopefully should fix the ignore bug
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 1.10 2006/02/19 22:00:09 Goober5000
|
||||
* restore original ignore behavior and remove soon-to-be-obsolete ai-chase-any-except
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 1.9 2005/11/24 08:46:11 Goober5000
|
||||
* * cleaned up mission_do_departure
|
||||
* * fixed a hidden crash (array index being -1; would only
|
||||
* be triggered for ships w/o subspace drives under certain conditions)
|
||||
* * removed finding a new fighterbay target because it might screw up missions
|
||||
* * improved clarity, code flow, and readability :)
|
||||
* * added custom AI flag for disabling warpouts if navigation subsystem fails
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 1.8 2005/11/21 00:46:05 Goober5000
|
||||
* add ai_settings.tbl
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 1.7 2005/07/27 17:22:22 Goober5000
|
||||
* more tweaks to the dock code
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 1.6 2005/07/25 03:13:24 Goober5000
|
||||
* various code cleanups, tweaks, and fixes; most notably the MISSION_FLAG_USE_NEW_AI
|
||||
* should now be added to all places where it is needed (except the turret code, which I still
|
||||
* have to to review)
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 1.5 2005/07/24 20:12:55 Goober5000
|
||||
* cleaned up some rotating submodel code
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 1.4 2005/07/22 09:19:39 wmcoolmon
|
||||
* Dynamic AI Class number commit. KNOWN BUG: When AI_CLASS_INCREMENT is hit and vm_realloc is called, memory corruption seems to
|
||||
* result. Not at all sure what causes this; if this can't be resolved soon, we can always treat _INCREMENT like _MAX
|
||||
*
|
||||
* Revision 1.3 2005/07/13 02:50:48 Goober5000
|
||||
* remove PreProcDefine #includes in FS2
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 1.2 2005/04/05 05:53:13 taylor
|
||||
* s/vector/vec3d/g, better support for different compilers (Jens Granseuer)
|
||||
*
|
||||
* Revision 1.1 2005/03/25 06:45:12 wmcoolmon
|
||||
* Initial AI code move commit - note that aigoals.cpp has some escape characters in it, I'm not sure if this is really a problem.
|
||||
*
|
||||
* Revision 2.21 2005/02/20 23:13:00 wmcoolmon
|
||||
* Trails stuff, moved ship docking func declaration so FRED could get to it.
|
||||
*
|
||||
* Revision 2.20 2005/01/28 09:01:04 Goober5000
|
||||
* finished implementing docking to a rotating submodel
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.19 2005/01/27 11:26:23 Goober5000
|
||||
* dock points on rotating submodels is *almost* working
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.18 2005/01/13 03:33:07 Goober5000
|
||||
* hmm, rolled back one of my clarifications since it caused things to get messed up
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.17 2005/01/11 21:38:48 Goober5000
|
||||
* multiple ship docking :)
|
||||
* don't tell anyone yet... check the SCP internal
|
||||
* --Goober500
|
||||
*
|
||||
* Revision 2.16 2004/08/11 05:06:33 Kazan
|
||||
* added preprocdefines.h to prevent what happened with fred -- make sure to make all fred2 headers include this file as the _first_ include -- i have already modified fs2 files to do this
|
||||
*
|
||||
* Revision 2.15 2004/07/25 00:31:30 Kazan
|
||||
* i have absolutely nothing to say about that subject
|
||||
*
|
||||
* Revision 2.14 2004/03/05 09:01:51 Goober5000
|
||||
* Uber pass at reducing #includes
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.13 2004/01/26 23:07:43 phreak
|
||||
* bumped MAX_AI_CLASSES to 30 if INF_BUILD is defined
|
||||
*
|
||||
* Revision 2.12 2003/11/11 02:15:40 Goober5000
|
||||
* ubercommit - basically spelling and language fixes with some additional
|
||||
* warnings disabled
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.11 2003/09/13 06:02:03 Goober5000
|
||||
* clean rollback of all of argv's stuff
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.9 2003/03/30 04:34:37 Goober5000
|
||||
* preliminary work on ai facing sexp
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.8 2003/01/19 22:20:22 Goober5000
|
||||
* fixed a bunch of bugs -- the support ship sexp, the "no-subspace-drive" flag,
|
||||
* and departure into hangars should now all work properly
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.7 2003/01/19 07:02:15 Goober5000
|
||||
* fixed a bunch of bugs - "no-subspace-drive" should now work properly for
|
||||
* all ships, and all ships who have their departure anchor set to a capital ship
|
||||
* should exit to that ship when told to depart
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.6 2003/01/07 20:06:44 Goober5000
|
||||
* added ai-chase-any-except sexp
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.5 2003/01/06 22:57:23 Goober5000
|
||||
* implemented keep-safe-distance
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.4 2003/01/03 21:58:07 Goober5000
|
||||
* Fixed some minor bugs, and added a primitive-sensors flag, where if a ship
|
||||
* has primitive sensors it can't target anything and objects don't appear
|
||||
* on radar if they're outside a certain range. This range can be modified
|
||||
* via the sexp primitive-sensors-set-range.
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.3 2002/12/10 05:43:33 Goober5000
|
||||
* Full-fledged ballistic primary support added! Try it and see! :)
|
||||
*
|
||||
* Revision 2.2 2002/10/19 19:29:28 bobboau
|
||||
* initial commit, trying to get most of my stuff into FSO, there should be most of my fighter beam, beam rendering, beam shield hit, ABtrails, and ssm stuff. one thing you should be happy to know is the beam texture tileing is now set in the beam section section of the weapon table entry
|
||||
*
|
||||
* Revision 2.1 2002/08/01 01:41:09 penguin
|
||||
* The big include file move
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:28 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
* Revision 1.1 2002/05/02 18:03:12 mharris
|
||||
* Initial checkin - converted filenames and includes to lower case
|
||||
*
|
||||
*
|
||||
* 12 8/29/99 4:18p Andsager
|
||||
* New "burst" limit for friendly damage. Also credit more damage done
|
||||
* against large friendly ships.
|
||||
*
|
||||
* 11 8/26/99 5:14p Andsager
|
||||
*
|
||||
* 10 7/26/99 12:14p Andsager
|
||||
* Apply cap to how much slower a transport flies with cargo. Remove
|
||||
* limit on waypoint speed for training. Enemy ai get stealth exact pos
|
||||
* when stealth fires
|
||||
*
|
||||
* 9 7/02/99 10:56a Andsager
|
||||
* Put in big ship - big ship attack mode. Modify stealth sweep ai.
|
||||
*
|
||||
* 8 6/30/99 5:53p Dave
|
||||
* Put in new anti-camper code.
|
||||
*
|
||||
* 7 6/23/99 5:51p Andsager
|
||||
* Add waypoint-cap-speed. Checkin stealth ai - inactive.
|
||||
*
|
||||
* 6 6/14/99 10:45a Dave
|
||||
* Made beam weapons specify accuracy by skill level in the weapons.tbl
|
||||
*
|
||||
* 5 4/20/99 6:39p Dave
|
||||
* Almost done with artillery targeting. Added support for downloading
|
||||
* images on the PXO screen.
|
||||
*
|
||||
* 4 4/20/99 3:40p Andsager
|
||||
* Changes to big ship ai. Uses bounding box as limit where to fly to
|
||||
* when flying away.
|
||||
*
|
||||
* 3 11/05/98 5:55p Dave
|
||||
* Big pass at reducing #includes
|
||||
*
|
||||
* 2 10/07/98 10:53a Dave
|
||||
* Initial checkin.
|
||||
*
|
||||
* 1 10/07/98 10:51a Dave
|
||||
*
|
||||
* 186 6/09/98 5:15p Lawrance
|
||||
* French/German localization
|
||||
*
|
||||
* 185 5/23/98 2:41p Mike
|
||||
* Make Easy the default skill level and prevent old pilot's skill level
|
||||
* from carrying into new pilot.
|
||||
*
|
||||
* 184 5/20/98 12:45a Mike
|
||||
* Fix bug in support ships aborting rearm. Also, remove test code that
|
||||
* made any ship whose name began, "Kami" a kamikaze.
|
||||
*
|
||||
* 183 5/18/98 1:58a Mike
|
||||
* Make Phoenix not be fired at fighters (but yes bombers).
|
||||
* Improve positioning of ships in guard mode.
|
||||
* Make turrets on player ship not fire near end of support ship docking.
|
||||
*
|
||||
* 182 5/13/98 4:41p Mike
|
||||
* Make big ships try a tiny bit to avoid collision with each other when
|
||||
* attacking another big ship. Make ships a little less likely to collide
|
||||
* into player when in formation, drop off if player flying wacky.
|
||||
*
|
||||
* 181 5/12/98 4:53p Mike
|
||||
* Make ships recover from collisions with big ships, eventually flying
|
||||
* around.
|
||||
*
|
||||
* 180 5/10/98 11:30p Mike
|
||||
* Better firing of bombs, less likely to go into strafe mode.
|
||||
*
|
||||
* 179 4/12/98 2:02p Mike
|
||||
* Make small ships avoid big ships.
|
||||
* Turn on Collide_friendly flag.
|
||||
*
|
||||
* 178 4/10/98 11:02p Mike
|
||||
* Make countermeasures less effective against aspect seekers than against
|
||||
* heat seekers.
|
||||
* Make AI ships match bank with each other when attacking a faraway
|
||||
* target.
|
||||
* Make ships not do silly loop-de-loop sometimes when attacking a faraway
|
||||
* target.
|
||||
*
|
||||
* 177 4/08/98 8:38a Mike
|
||||
* Make ships avoid player when attacking or guarding a faraway object.
|
||||
*
|
||||
* 176 4/06/98 12:46a Allender
|
||||
* bump max ai goals down to 5
|
||||
*
|
||||
* 175 4/01/98 9:20a Mike
|
||||
* Reduce MAX_SHIPS, MAX_OBJECTS and make MAX_AI_INFO same as MAX_SHIPS
|
||||
*
|
||||
* 174 3/21/98 3:36p Mike
|
||||
* Fix/optimize attacking of big ships.
|
||||
*
|
||||
* 173 3/17/98 12:50a Mike
|
||||
* Improved kamikaze behavior.
|
||||
*
|
||||
* 172 3/16/98 8:27p Allender
|
||||
* Fred support for two new AI flags -- kamikaze and no dynamic goals.
|
||||
*
|
||||
* 171 3/16/98 12:03a Mike
|
||||
* Add support for kamikaze mode. Add AIF_NO_DYNAMIC which means
|
||||
* relentlessly pursue current goal.
|
||||
*
|
||||
* 170 3/15/98 9:44p Lawrance
|
||||
* Get secondary weapons for turrets working
|
||||
*
|
||||
* 169 3/13/98 8:34a Mike
|
||||
* Intermediate checkin to resolve link errors. Working on detecting
|
||||
* whether dock with player ship is obstructed by another ship
|
||||
*
|
||||
* 168 3/09/98 5:12p Mike
|
||||
* Make sure Pl_objp uses are valid.
|
||||
* Throw asteroids at ships in asteroid field, not "Gal"
|
||||
* Support ships warp out if no goals after 30 seconds.
|
||||
*
|
||||
* 167 2/26/98 10:07p Hoffoss
|
||||
* Rewrote state saving and restoring to fix bugs and simplify the code.
|
||||
*
|
||||
* 166 2/22/98 4:17p John
|
||||
* More string externalization classification... 190 left to go!
|
||||
*
|
||||
* 165 2/18/98 10:34p Allender
|
||||
* repair/rearm system (for single and multi) about finished.
|
||||
* dock/undock and ai goals packets implemented for multiplayer
|
||||
*
|
||||
* 164 2/17/98 5:03p Allender
|
||||
* major cdhanges to rearm repair code. All flag and variable setting
|
||||
* done in one function. A little more work to do. Fix bug in squad
|
||||
* messaging when hotkey was used on invalid target
|
||||
*
|
||||
* 163 2/16/98 10:13p Allender
|
||||
* initial work on being able to target weapons (bombs specifically).
|
||||
* Work on getting rearm/repair working under multiplayer
|
||||
*
|
||||
* $NoKeywords: $
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _AI_H
|
||||
#define _AI_H
|
||||
@@ -299,10 +15,13 @@
|
||||
#include "globalincs/pstypes.h"
|
||||
#include "globalincs/globals.h"
|
||||
#include "globalincs/systemvars.h"
|
||||
#include "ai/ai_profiles.h"
|
||||
#include "physics/physics.h"
|
||||
|
||||
struct ship_weapon;
|
||||
struct ship_subsys;
|
||||
struct object;
|
||||
struct ship_info;
|
||||
|
||||
#define AI_DEFAULT_CLASS 3 // default AI class for new ships (Fred)
|
||||
|
||||
@@ -388,6 +107,15 @@ struct object;
|
||||
|
||||
#define KAMIKAZE_HULL_ON_DEATH -1000.0f // Hull strength ship gets set to if it crash-dies.
|
||||
|
||||
// flags for possible ai overrides
|
||||
#define AIORF_FULL (1<<0) // Full sexp control
|
||||
#define AIORF_ROLL (1<<1) // Sexp forced roll maneuver
|
||||
#define AIORF_PITCH (1<<2) // Sexp forced pitch change
|
||||
#define AIORF_HEADING (1<<3) // Sexp forced heading change
|
||||
#define AIORF_FULL_LAT (1<<4) // full control over up/side/forward movement
|
||||
#define AIORF_UP (1<<5) // vertical movement
|
||||
#define AIORF_SIDEWAYS (1<<6) // horizontal movement
|
||||
#define AIORF_FORWARD (1<<7) // forward movement
|
||||
|
||||
// structure for AI goals
|
||||
typedef struct ai_goal {
|
||||
@@ -458,6 +186,44 @@ typedef struct ai_class {
|
||||
float ai_evasion[NUM_SKILL_LEVELS];
|
||||
float ai_courage[NUM_SKILL_LEVELS];
|
||||
float ai_patience[NUM_SKILL_LEVELS];
|
||||
|
||||
//SUSHI: These were originally in AI_Profiles, adding the option to override in AI.tbl
|
||||
//INT_MIN and FLT_MIN represent the "not set" state for which defaults are used instead.
|
||||
float ai_cmeasure_fire_chance[NUM_SKILL_LEVELS];
|
||||
float ai_in_range_time[NUM_SKILL_LEVELS];
|
||||
float ai_link_ammo_levels_maybe[NUM_SKILL_LEVELS];
|
||||
float ai_link_ammo_levels_always[NUM_SKILL_LEVELS];
|
||||
float ai_primary_ammo_burst_mult[NUM_SKILL_LEVELS];
|
||||
float ai_link_energy_levels_maybe[NUM_SKILL_LEVELS];
|
||||
float ai_link_energy_levels_always[NUM_SKILL_LEVELS];
|
||||
fix ai_predict_position_delay[NUM_SKILL_LEVELS];
|
||||
float ai_shield_manage_delay[NUM_SKILL_LEVELS];
|
||||
float ai_ship_fire_delay_scale_friendly[NUM_SKILL_LEVELS];
|
||||
float ai_ship_fire_delay_scale_hostile[NUM_SKILL_LEVELS];
|
||||
float ai_ship_fire_secondary_delay_scale_friendly[NUM_SKILL_LEVELS];
|
||||
float ai_ship_fire_secondary_delay_scale_hostile[NUM_SKILL_LEVELS];
|
||||
float ai_turn_time_scale[NUM_SKILL_LEVELS];
|
||||
float ai_glide_attack_percent[NUM_SKILL_LEVELS];
|
||||
float ai_circle_strafe_percent[NUM_SKILL_LEVELS];
|
||||
float ai_glide_strafe_percent[NUM_SKILL_LEVELS];
|
||||
float ai_random_sidethrust_percent[NUM_SKILL_LEVELS];
|
||||
float ai_stalemate_time_thresh[NUM_SKILL_LEVELS];
|
||||
float ai_stalemate_dist_thresh[NUM_SKILL_LEVELS];
|
||||
int ai_chance_to_use_missiles_on_plr[NUM_SKILL_LEVELS];
|
||||
float ai_max_aim_update_delay[NUM_SKILL_LEVELS];
|
||||
float ai_turret_max_aim_update_delay[NUM_SKILL_LEVELS];
|
||||
int ai_profile_flags; //Holds the state of flags that are set
|
||||
int ai_profile_flags_set; //Holds which flags are set and which are just left alone
|
||||
int ai_profile_flags2;
|
||||
int ai_profile_flags2_set;
|
||||
|
||||
//SUSHI: These are optional overrides to an AI class to prevent the automatic scaling based on AI class index
|
||||
int ai_aburn_use_factor[NUM_SKILL_LEVELS];
|
||||
float ai_shockwave_evade_chance[NUM_SKILL_LEVELS];
|
||||
float ai_get_away_chance[NUM_SKILL_LEVELS];
|
||||
float ai_secondary_range_mult[NUM_SKILL_LEVELS];
|
||||
bool ai_class_autoscale; //Defaults to true, but can be turned off in order to disable extra scaling of some AI behaviors
|
||||
//based on AI class index
|
||||
} ai_class;
|
||||
|
||||
// Submode definitions.
|
||||
@@ -480,6 +246,10 @@ typedef struct ai_class {
|
||||
#define SM_BIG_CIRCLE 16 // Big ship flies circle around other big ship to get good angle to go parallel
|
||||
#define SM_BIG_PARALLEL 17 // Big ship flies parallel to another
|
||||
|
||||
//SUSHI: Attack submodes (besides those implicitly listed above)
|
||||
#define AIS_CHASE_GLIDEATTACK 18 // Ship uses glide to move in a constant direction while pointing and shooting at target
|
||||
#define AIS_CHASE_CIRCLESTRAFE 19 // Attempt a circle-strafe on the target
|
||||
|
||||
// Submodes for docking behavior
|
||||
#define AIS_DOCK_0 21
|
||||
#define AIS_DOCK_1 22
|
||||
@@ -506,6 +276,7 @@ typedef struct ai_class {
|
||||
#define AIS_STRAFE_RETREAT1 203 // fly away from attack point
|
||||
#define AIS_STRAFE_RETREAT2 204
|
||||
#define AIS_STRAFE_POSITION 205 // re-position to resume strafing attack
|
||||
#define AIS_STRAFE_GLIDE_ATTACK 206 // SUSHI: Glide strafe atack
|
||||
|
||||
#define WPF_REPEAT (1 << 0)
|
||||
#define WPF_BACKTRACK (1 << 1)
|
||||
@@ -614,14 +385,23 @@ typedef struct ai_info {
|
||||
fix best_dot_from_time; // time at which best dot occurred
|
||||
fix submode_start_time; // time at which we entered the current submode
|
||||
int submode_parm0; // parameter specific to current submode
|
||||
int submode_parm1; // SUSHI: Another optional parameter
|
||||
fix next_predict_pos_time; // Next time to predict position.
|
||||
|
||||
//SUSHI: like last_predicted_enemy_pos, but for aiming (which currently ignores predicted position)
|
||||
//Unlike the predicted position stuff, also takes into account velocity
|
||||
//Only used against small ships
|
||||
fix next_aim_pos_time;
|
||||
vec3d last_aim_enemy_pos;
|
||||
vec3d last_aim_enemy_vel;
|
||||
|
||||
ai_goal goals[MAX_AI_GOALS];
|
||||
int active_goal; // index of active goal, -1 if none, AI_ACTIVE_GOAL_DYNAMIC if dynamic (runtime-created) goal
|
||||
int goal_check_time; // timer used for processing goals for this ai object
|
||||
|
||||
vec3d last_predicted_enemy_pos; // Where he thought enemy was last time.
|
||||
float time_enemy_in_range; // Amount of time enemy continuously in "sight", near crosshair.
|
||||
float time_enemy_in_range; // Amount of time enemy continuously in "sight", near crosshair.
|
||||
float time_enemy_near; // SUSHI: amount of time enemy continuously "near" the player
|
||||
fix last_attack_time; // Missiontime of last time this ship attacked its enemy.
|
||||
fix last_hit_time; // Missiontime of last time this ship was hit by anyone.
|
||||
int last_hit_quadrant; // Shield section of last hit.
|
||||
@@ -633,7 +413,43 @@ typedef struct ai_info {
|
||||
float prev_dot_to_goal; // dot of fvec to goal last frame, used to see if making progress towards goal.
|
||||
vec3d goal_point; // Used in AIM_SAFETY, AIM_STILL and in circling.
|
||||
vec3d prev_goal_point; // Previous location of goal point, used at least for evading.
|
||||
float ai_accuracy, ai_evasion, ai_courage, ai_patience;
|
||||
|
||||
//Values copied from the AI class
|
||||
float ai_accuracy, ai_evasion, ai_courage, ai_patience;
|
||||
int ai_aburn_use_factor;
|
||||
float ai_shockwave_evade_chance;
|
||||
float ai_get_away_chance;
|
||||
float ai_secondary_range_mult;
|
||||
bool ai_class_autoscale;
|
||||
|
||||
//SUSHI: These were originally in AI_Profiles, adding the option to override in AI.tbl
|
||||
float ai_cmeasure_fire_chance;
|
||||
float ai_in_range_time;
|
||||
float ai_link_ammo_levels_maybe;
|
||||
float ai_link_ammo_levels_always;
|
||||
float ai_primary_ammo_burst_mult;
|
||||
float ai_link_energy_levels_maybe;
|
||||
float ai_link_energy_levels_always;
|
||||
fix ai_predict_position_delay;
|
||||
float ai_shield_manage_delay;
|
||||
float ai_ship_fire_delay_scale_friendly;
|
||||
float ai_ship_fire_delay_scale_hostile;
|
||||
float ai_ship_fire_secondary_delay_scale_friendly;
|
||||
float ai_ship_fire_secondary_delay_scale_hostile;
|
||||
float ai_turn_time_scale;
|
||||
float ai_glide_attack_percent;
|
||||
float ai_circle_strafe_percent;
|
||||
float ai_glide_strafe_percent;
|
||||
float ai_random_sidethrust_percent;
|
||||
float ai_stalemate_time_thresh;
|
||||
float ai_stalemate_dist_thresh;
|
||||
int ai_chance_to_use_missiles_on_plr;
|
||||
float ai_max_aim_update_delay;
|
||||
float ai_turret_max_aim_update_delay;
|
||||
int ai_profile_flags; //Holds AI_Profiles flags (possibly overriden by AI class) that actually apply to AI
|
||||
int ai_profile_flags2;
|
||||
|
||||
|
||||
union {
|
||||
float lead_scale; // Amount to lead current opponent by.
|
||||
float stay_near_distance; // Distance to stay within for AIM_STAY_NEAR mode.
|
||||
@@ -717,6 +533,10 @@ typedef struct ai_info {
|
||||
float artillery_lock_time; // how long we've been locked onto this guy
|
||||
vec3d artillery_lock_pos; // base position of the lock point on (in model's frame of reference)
|
||||
float lethality; // measure of how dangerous ship is to enemy BIG|HUGE ships (likelyhood of targeting)
|
||||
|
||||
int ai_override_flags; // flags for marking ai overrides from sexp or lua systems
|
||||
control_info ai_override_ci; // ai override control info
|
||||
int ai_override_timestamp; // mark for when to end the current override
|
||||
} ai_info;
|
||||
|
||||
#define MAX_AI_INFO MAX_SHIPS
|
||||
@@ -742,8 +562,6 @@ extern int find_guard_obj(void);
|
||||
extern ai_info Ai_info[];
|
||||
extern ai_info *Player_ai;
|
||||
|
||||
extern int Waypoints_created; // externed since needed for save/restore
|
||||
|
||||
extern ai_class *Ai_classes;
|
||||
extern char** Ai_class_names;
|
||||
|
||||
@@ -822,6 +640,7 @@ extern ship_subsys *set_targeted_subsys(ai_info *aip, ship_subsys *new_subsys, i
|
||||
extern void ai_rearm_repair( object *objp, int docker_index, object *goal_objp, int dockee_index );
|
||||
extern void ai_add_rearm_goal( object *requester_objp, object *support_objp );
|
||||
extern void create_model_path(object *pl_objp, object *mobjp, int path_num, int subsys_path=0);
|
||||
extern int ai_find_goal_index( ai_goal* aigp, int mode, int submode = -1, int priority = -1 );
|
||||
|
||||
// Goober5000
|
||||
extern void ai_do_safety(object *objp);
|
||||
@@ -846,7 +665,7 @@ extern int ai_fire_secondary_weapon(object *objp, int priority1 = -1, int priori
|
||||
extern float ai_get_weapon_dist(ship_weapon *swp);
|
||||
extern void turn_towards_point(object *objp, vec3d *point, vec3d *slide_vec, float bank_override);
|
||||
extern int ai_maybe_fire_afterburner(object *objp, ai_info *aip);
|
||||
extern void set_predicted_enemy_pos(vec3d *predicted_enemy_pos, object *pobjp, object *eobjp, ai_info *aip);
|
||||
extern void set_predicted_enemy_pos(vec3d *predicted_enemy_pos, object *pobjp, vec3d *enemy_pos, vec3d *enemy_vel, ai_info *aip);
|
||||
|
||||
extern int is_instructor(object *objp);
|
||||
extern int find_enemy(int objnum, float range, int max_attackers);
|
||||
@@ -858,7 +677,7 @@ void set_predicted_enemy_pos_turret(vec3d *predicted_enemy_pos, vec3d *gun_pos,
|
||||
extern void ai_set_rearm_status( int team, int new_status );
|
||||
extern void ai_good_secondary_time( int team, int weapon_index, int num_weapons, char *shipname );
|
||||
|
||||
extern void ai_do_objects_docked_stuff(object *docker, int docker_point, object *dockee, int dockee_point);
|
||||
extern void ai_do_objects_docked_stuff(object *docker, int docker_point, object *dockee, int dockee_point, bool update_clients = true);
|
||||
extern void ai_do_objects_undocked_stuff( object *docker, object *dockee );
|
||||
extern void ai_do_objects_repairing_stuff( object *repaired_obj, object *repair_obj, int how );
|
||||
|
||||
@@ -879,4 +698,13 @@ void ai_fly_to_ship();
|
||||
//Moved declaration here for player ship -WMC
|
||||
void process_subobjects(int objnum);
|
||||
|
||||
//SUSHI: Setting ai_info stuff from both ai class and ai profile
|
||||
void init_aip_from_class_and_profile(ai_info *aip, ai_class *aicp, ai_profile_t *profile);
|
||||
|
||||
//SUSHI: Updating AI aim
|
||||
void ai_update_aim(ai_info *aip, object* En_Objp);
|
||||
|
||||
//SUSHI: Random evasive sidethrust
|
||||
void do_random_sidethrust(ai_info *aip, ship_info *sip);
|
||||
|
||||
#endif
|
||||
+165
-116
@@ -4,96 +4,7 @@
|
||||
* 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"
|
||||
@@ -114,24 +25,30 @@ static char Default_profile_name[NAME_LENGTH];
|
||||
|
||||
|
||||
// utility
|
||||
void set_flag(ai_profile_t *profile, char *name, int flag)
|
||||
void set_flag(ai_profile_t *profile, char *name, int flag, int type)
|
||||
{
|
||||
if (optional_string(name))
|
||||
{
|
||||
bool val;
|
||||
stuff_boolean(&val);
|
||||
|
||||
if (val)
|
||||
profile->flags |= flag;
|
||||
else
|
||||
profile->flags &= ~flag;
|
||||
if (type == AIP_FLAG) {
|
||||
if (val)
|
||||
profile->flags |= flag;
|
||||
else
|
||||
profile->flags &= ~flag;
|
||||
} else {
|
||||
if (val)
|
||||
profile->flags2 |= flag;
|
||||
else
|
||||
profile->flags2 &= ~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;
|
||||
@@ -149,7 +66,7 @@ void parse_ai_profiles_tbl(char *filename)
|
||||
if (filename == NULL)
|
||||
read_file_text_from_array(defaults_get_file("ai_profiles.tbl"));
|
||||
else
|
||||
read_file_text(filename);
|
||||
read_file_text(filename, CF_TYPE_TABLES);
|
||||
|
||||
reset_parse();
|
||||
|
||||
@@ -166,6 +83,7 @@ void parse_ai_profiles_tbl(char *filename)
|
||||
{
|
||||
ai_profile_t *profile = &dummy_profile;
|
||||
ai_profile_t *previous_profile = NULL;
|
||||
bool no_create = false;
|
||||
|
||||
// get the name
|
||||
required_string("$Profile Name:");
|
||||
@@ -229,7 +147,7 @@ void parse_ai_profiles_tbl(char *filename)
|
||||
}
|
||||
|
||||
// set the name
|
||||
strcpy(profile->profile_name, profile_name);
|
||||
strcpy_s(profile->profile_name, profile_name);
|
||||
|
||||
|
||||
// fill in any and all settings; they're all optional and can be in any order
|
||||
@@ -256,6 +174,9 @@ void parse_ai_profiles_tbl(char *filename)
|
||||
if (optional_string("$AI Maybe Links Ammo Weapons:"))
|
||||
parse_float_list(profile->link_ammo_levels_maybe, NUM_SKILL_LEVELS);
|
||||
|
||||
if (optional_string("$Primary Ammo Burst Multiplier:"))
|
||||
parse_float_list(profile->primary_ammo_burst_mult, NUM_SKILL_LEVELS);
|
||||
|
||||
if (optional_string("$AI Always Links Energy Weapons:"))
|
||||
parse_float_list(profile->link_energy_levels_always, NUM_SKILL_LEVELS);
|
||||
|
||||
@@ -280,13 +201,13 @@ void parse_ai_profiles_tbl(char *filename)
|
||||
// represented in fractions of F1_0
|
||||
if (optional_string("$Predict Position Delay:"))
|
||||
{
|
||||
int i;
|
||||
int iLoop;
|
||||
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]);
|
||||
for (iLoop = 0; iLoop < NUM_SKILL_LEVELS; iLoop++)
|
||||
profile->predict_position_delay[iLoop] = fl2f(temp_list[iLoop]);
|
||||
}
|
||||
|
||||
if (optional_string("$Player Shield Recharge Scale:"))
|
||||
@@ -301,12 +222,76 @@ void parse_ai_profiles_tbl(char *filename)
|
||||
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("$Glide Attack Percent:")) {
|
||||
parse_float_list(profile->glide_attack_percent, NUM_SKILL_LEVELS);
|
||||
//Percent is nice for modders, but here in the code we want it betwwen 0 and 1.0
|
||||
//While we're at it, verify the range
|
||||
for (int i = 0; i < NUM_SKILL_LEVELS; i++) {
|
||||
if (profile->glide_attack_percent[i] < 0.0f || profile->glide_attack_percent[i] > 100.0f) {
|
||||
profile->glide_attack_percent[i] = 0.0f;
|
||||
Warning(LOCATION, "$Glide Attack Percent should be between 0 and 100.0 (read %f). Setting to 0.", profile->glide_attack_percent[i]);
|
||||
}
|
||||
profile->glide_attack_percent[i] /= 100.0;
|
||||
}
|
||||
}
|
||||
|
||||
if (optional_string("$Circle Strafe Percent:")) {
|
||||
parse_float_list(profile->circle_strafe_percent, NUM_SKILL_LEVELS);
|
||||
//Percent is nice for modders, but here in the code we want it betwwen 0 and 1.0
|
||||
//While we're at it, verify the range
|
||||
for (int i = 0; i < NUM_SKILL_LEVELS; i++) {
|
||||
if (profile->circle_strafe_percent[i] < 0.0f || profile->circle_strafe_percent[i] > 100.0f) {
|
||||
profile->circle_strafe_percent[i] = 0.0f;
|
||||
Warning(LOCATION, "$Circle Strafe Percent should be between 0 and 100.0 (read %f). Setting to 0.", profile->circle_strafe_percent[i]);
|
||||
}
|
||||
profile->circle_strafe_percent[i] /= 100.0;
|
||||
}
|
||||
}
|
||||
|
||||
if (optional_string("$Glide Strafe Percent:")) {
|
||||
parse_float_list(profile->glide_strafe_percent, NUM_SKILL_LEVELS);
|
||||
//Percent is nice for modders, but here in the code we want it betwwen 0 and 1.0
|
||||
//While we're at it, verify the range
|
||||
for (int i = 0; i < NUM_SKILL_LEVELS; i++) {
|
||||
if (profile->glide_strafe_percent[i] < 0.0f || profile->glide_strafe_percent[i] > 100.0f) {
|
||||
profile->glide_strafe_percent[i] = 0.0f;
|
||||
Warning(LOCATION, "$Glide Strafe Percent should be between 0 and 100.0 (read %f). Setting to 0.", profile->glide_strafe_percent[i]);
|
||||
}
|
||||
profile->glide_strafe_percent[i] /= 100.0;
|
||||
}
|
||||
}
|
||||
|
||||
if (optional_string("$Random Sidethrust Percent:")) {
|
||||
parse_float_list(profile->random_sidethrust_percent, NUM_SKILL_LEVELS);
|
||||
//Percent is nice for modders, but here in the code we want it betwwen 0 and 1.0
|
||||
//While we're at it, verify the range
|
||||
for (int i = 0; i < NUM_SKILL_LEVELS; i++) {
|
||||
if (profile->random_sidethrust_percent[i] < 0.0f || profile->random_sidethrust_percent[i] > 100.0f) {
|
||||
profile->random_sidethrust_percent[i] = 0.0f;
|
||||
Warning(LOCATION, "$Random Sidethrust Percent should be between 0 and 100.0 (read %f). Setting to 0.", profile->random_sidethrust_percent[i]);
|
||||
}
|
||||
profile->random_sidethrust_percent[i] /= 100.0;
|
||||
}
|
||||
}
|
||||
|
||||
if (optional_string("$Stalemate Time Threshold:"))
|
||||
parse_float_list(profile->stalemate_time_thresh, NUM_SKILL_LEVELS);
|
||||
|
||||
if (optional_string("$Stalemate Distance Threshold:"))
|
||||
parse_float_list(profile->stalemate_dist_thresh, NUM_SKILL_LEVELS);
|
||||
|
||||
if (optional_string("$Player Weapon Recharge Scale:"))
|
||||
parse_float_list(profile->weapon_energy_scale, NUM_SKILL_LEVELS);
|
||||
|
||||
@@ -316,35 +301,99 @@ void parse_ai_profiles_tbl(char *filename)
|
||||
if (optional_string("$Max Turret Player Ownage:"))
|
||||
parse_int_list(profile->max_turret_ownage_player, 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);
|
||||
if (optional_string("$Percentage Required For Kill Scale:"))
|
||||
parse_float_list(profile->kill_percentage_scale, NUM_SKILL_LEVELS);
|
||||
|
||||
set_flag(profile, "$smart primary weapon selection:", AIPF_SMART_PRIMARY_WEAPON_SELECTION);
|
||||
if (optional_string("$Percentage Required For Assist Scale:"))
|
||||
parse_float_list(profile->assist_percentage_scale, NUM_SKILL_LEVELS);
|
||||
|
||||
set_flag(profile, "$smart secondary weapon selection:", AIPF_SMART_SECONDARY_WEAPON_SELECTION);
|
||||
if (optional_string("$Percentage Awarded For Capship Assist:"))
|
||||
parse_float_list(profile->assist_award_percentage_scale, NUM_SKILL_LEVELS);
|
||||
|
||||
set_flag(profile, "$smart shield management:", AIPF_SMART_SHIELD_MANAGEMENT);
|
||||
if (optional_string("$Repair Penalty:"))
|
||||
parse_int_list(profile->repair_penalty, NUM_SKILL_LEVELS);
|
||||
|
||||
set_flag(profile, "$allow rapid secondary dumbfire:", AIPF_ALLOW_RAPID_SECONDARY_DUMBFIRE);
|
||||
if (optional_string("$Delay Before Allowing Bombs to Be Shot Down:"))
|
||||
parse_float_list(profile->delay_bomb_arm_timer, NUM_SKILL_LEVELS);
|
||||
|
||||
if (optional_string("$Chance AI Has to Fire Missiles at Player:"))
|
||||
parse_int_list(profile->chance_to_use_missiles_on_plr, NUM_SKILL_LEVELS);
|
||||
|
||||
if (optional_string("$Max Aim Update Delay:"))
|
||||
parse_float_list(profile->max_aim_update_delay, NUM_SKILL_LEVELS);
|
||||
|
||||
if (optional_string("$Turret Max Aim Update Delay:"))
|
||||
parse_float_list(profile->turret_max_aim_update_delay, NUM_SKILL_LEVELS);
|
||||
|
||||
set_flag(profile, "$big ships can attack beam turrets on untargeted ships:", AIPF_BIG_SHIPS_CAN_ATTACK_BEAM_TURRETS_ON_UNTARGETED_SHIPS, AIP_FLAG);
|
||||
|
||||
set_flag(profile, "$smart primary weapon selection:", AIPF_SMART_PRIMARY_WEAPON_SELECTION, AIP_FLAG);
|
||||
|
||||
set_flag(profile, "$smart secondary weapon selection:", AIPF_SMART_SECONDARY_WEAPON_SELECTION, AIP_FLAG);
|
||||
|
||||
set_flag(profile, "$smart shield management:", AIPF_SMART_SHIELD_MANAGEMENT, AIP_FLAG);
|
||||
|
||||
set_flag(profile, "$smart afterburner management:", AIPF_SMART_AFTERBURNER_MANAGEMENT, AIP_FLAG);
|
||||
|
||||
set_flag(profile, "$allow rapid secondary dumbfire:", AIPF_ALLOW_RAPID_SECONDARY_DUMBFIRE, AIP_FLAG);
|
||||
|
||||
set_flag(profile, "$huge turret weapons ignore bombs:", AIPF_HUGE_TURRET_WEAPONS_IGNORE_BOMBS);
|
||||
set_flag(profile, "$huge turret weapons ignore bombs:", AIPF_HUGE_TURRET_WEAPONS_IGNORE_BOMBS, AIP_FLAG);
|
||||
|
||||
set_flag(profile, "$don't insert random turret fire delay:", AIPF_DONT_INSERT_RANDOM_TURRET_FIRE_DELAY);
|
||||
set_flag(profile, "$don't insert random turret fire delay:", AIPF_DONT_INSERT_RANDOM_TURRET_FIRE_DELAY, AIP_FLAG);
|
||||
|
||||
set_flag(profile, "$hack improve non-homing swarm turret fire accuracy:", AIPF_HACK_IMPROVE_NON_HOMING_SWARM_TURRET_FIRE_ACCURACY);
|
||||
set_flag(profile, "$hack improve non-homing swarm turret fire accuracy:", AIPF_HACK_IMPROVE_NON_HOMING_SWARM_TURRET_FIRE_ACCURACY, AIP_FLAG);
|
||||
|
||||
set_flag(profile, "$shockwaves damage small ship subsystems:", AIPF_SHOCKWAVES_DAMAGE_SMALL_SHIP_SUBSYSTEMS);
|
||||
set_flag(profile, "$shockwaves damage small ship subsystems:", AIPF_SHOCKWAVES_DAMAGE_SMALL_SHIP_SUBSYSTEMS, AIP_FLAG);
|
||||
|
||||
set_flag(profile, "$navigation subsystem governs warpout capability:", AIPF_NAVIGATION_SUBSYS_GOVERNS_WARP);
|
||||
set_flag(profile, "$navigation subsystem governs warpout capability:", AIPF_NAVIGATION_SUBSYS_GOVERNS_WARP, AIP_FLAG);
|
||||
|
||||
set_flag(profile, "$ignore lower bound for minimum speed of docked ship:", AIPF_NO_MIN_DOCK_SPEED_CAP);
|
||||
set_flag(profile, "$ignore lower bound for minimum speed of docked ship:", AIPF_NO_MIN_DOCK_SPEED_CAP, AIP_FLAG);
|
||||
|
||||
set_flag(profile, "$disable linked fire penalty:", AIPF_DISABLE_LINKED_FIRE_PENALTY);
|
||||
set_flag(profile, "$disable linked fire penalty:", AIPF_DISABLE_LINKED_FIRE_PENALTY, AIP_FLAG);
|
||||
|
||||
set_flag(profile, "$disable weapon damage scaling:", AIPF_DISABLE_WEAPON_DAMAGE_SCALING);
|
||||
set_flag(profile, "$disable weapon damage scaling:", AIPF_DISABLE_WEAPON_DAMAGE_SCALING, AIP_FLAG);
|
||||
|
||||
set_flag(profile, "$use additive weapon velocity:", AIPF_USE_ADDITIVE_WEAPON_VELOCITY);
|
||||
set_flag(profile, "$use additive weapon velocity:", AIPF_USE_ADDITIVE_WEAPON_VELOCITY, AIP_FLAG);
|
||||
|
||||
set_flag(profile, "$use newtonian dampening:", AIPF_USE_NEWTONIAN_DAMPENING);
|
||||
set_flag(profile, "$use newtonian dampening:", AIPF_USE_NEWTONIAN_DAMPENING, AIP_FLAG);
|
||||
|
||||
set_flag(profile, "$include beams for kills and assists:", AIPF_INCLUDE_BEAMS_IN_STAT_CALCS, AIP_FLAG);
|
||||
|
||||
set_flag(profile, "$score kills based on damage caused:", AIPF_KILL_SCORING_SCALES_WITH_DAMAGE, AIP_FLAG);
|
||||
|
||||
set_flag(profile, "$score assists based on damage caused:", AIPF_ASSIST_SCORING_SCALES_WITH_DAMAGE, AIP_FLAG);
|
||||
|
||||
set_flag(profile, "$allow event and goal scoring in multiplayer:", AIPF_ALLOW_MULTI_EVENT_SCORING, AIP_FLAG);
|
||||
|
||||
set_flag(profile, "$fix linked primary weapon decision bug:", AIPF_FIX_LINKED_PRIMARY_BUG, AIP_FLAG);
|
||||
|
||||
set_flag(profile, "$prevent turrets targeting too distant bombs:", AIPF_PREVENT_TARGETING_BOMBS_BEYOND_RANGE, AIP_FLAG);
|
||||
|
||||
set_flag(profile, "$smart subsystem targeting for turrets:", AIPF_SMART_SUBSYSTEM_TARGETING_FOR_TURRETS, AIP_FLAG);
|
||||
|
||||
set_flag(profile, "$fix heat seekers homing on stealth ships bug:", AIPF_FIX_HEAT_SEEKER_STEALTH_BUG, AIP_FLAG);
|
||||
|
||||
set_flag(profile, "$multi allow empty primaries:", AIPF_MULTI_ALLOW_EMPTY_PRIMARIES, AIP_FLAG);
|
||||
|
||||
set_flag(profile, "$multi allow empty secondaries:", AIPF_MULTI_ALLOW_EMPTY_SECONDARIES, AIP_FLAG);
|
||||
|
||||
set_flag(profile, "$allow turrets target weapons freely:", AIPF_ALLOW_TURRETS_TARGET_WEAPONS_FREELY, AIP_FLAG);
|
||||
|
||||
set_flag(profile, "$use only single fov for turrets:", AIPF_USE_ONLY_SINGLE_FOV_FOR_TURRETS, AIP_FLAG);
|
||||
|
||||
set_flag(profile, "$allow vertical dodge:", AIPF_ALLOW_VERTICAL_DODGE, AIP_FLAG);
|
||||
|
||||
set_flag(profile, "$force beam turrets to use normal fov:", AIPF_FORCE_BEAM_TURRET_FOV, AIP_FLAG);
|
||||
|
||||
set_flag(profile, "$fix ai class bug:", AIPF_FIX_AI_CLASS_BUG, AIP_FLAG);
|
||||
|
||||
set_flag(profile, "$turrets ignore targets radius in range checks:", AIPF2_TURRETS_IGNORE_TARGET_RADIUS, AIP_FLAG2);
|
||||
|
||||
set_flag(profile, "$no extra collision avoidance vs player:", AIPF2_NO_SPECIAL_PLAYER_AVOID, AIP_FLAG2);
|
||||
|
||||
set_flag(profile, "$perform less checks for death screams:", AIPF2_PERFORM_LESS_SCREAM_CHECKS, AIP_FLAG2);
|
||||
|
||||
set_flag(profile, "$all ships manage shields:", AIPF2_ALL_SHIPS_MANAGE_SHIELDS, AIP_FLAG2);
|
||||
|
||||
// if we've been through once already and are at the same place, force a move
|
||||
if ( saved_Mp && (saved_Mp == Mp) )
|
||||
|
||||
+57
-46
@@ -4,50 +4,7 @@
|
||||
* 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_
|
||||
@@ -56,6 +13,9 @@
|
||||
#include "globalincs/globals.h"
|
||||
#include "globalincs/systemvars.h"
|
||||
|
||||
// flag int defines
|
||||
#define AIP_FLAG 1
|
||||
#define AIP_FLAG2 2
|
||||
|
||||
// flags
|
||||
#define AIPF_SMART_SHIELD_MANAGEMENT (1 << 0)
|
||||
@@ -73,7 +33,28 @@
|
||||
#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 AIPF_ALLOW_TURRETS_TARGET_WEAPONS_FREELY (1 << 26)
|
||||
#define AIPF_USE_ONLY_SINGLE_FOV_FOR_TURRETS (1 << 27)
|
||||
#define AIPF_ALLOW_VERTICAL_DODGE (1 << 28) //Allows AI ships to evade weapons vertically as well as horizontally
|
||||
#define AIPF_FORCE_BEAM_TURRET_FOV (1 << 29)
|
||||
#define AIPF_FIX_AI_CLASS_BUG (1 << 30)
|
||||
|
||||
// flags2
|
||||
#define AIPF2_TURRETS_IGNORE_TARGET_RADIUS (1 << 0)
|
||||
#define AIPF2_NO_SPECIAL_PLAYER_AVOID (1 << 1)
|
||||
#define AIPF2_PERFORM_LESS_SCREAM_CHECKS (1 << 2)
|
||||
#define AIPF2_ALL_SHIPS_MANAGE_SHIELDS (1 << 3)
|
||||
|
||||
#define MAX_AI_PROFILES 5
|
||||
|
||||
@@ -82,6 +63,7 @@ typedef struct ai_profile_t {
|
||||
char profile_name[NAME_LENGTH];
|
||||
|
||||
int flags;
|
||||
int flags2;
|
||||
|
||||
// difficulty-related values
|
||||
int max_incoming_asteroids[NUM_SKILL_LEVELS]; // max number of asteroids thrown at friendlies
|
||||
@@ -96,8 +78,9 @@ typedef struct ai_profile_t {
|
||||
float link_energy_levels_maybe[NUM_SKILL_LEVELS]; // link if hull strength low
|
||||
|
||||
// AI ships link primaries if ammunition levels greater than these percents
|
||||
float link_ammo_levels_always[NUM_SKILL_LEVELS]; // always link
|
||||
float link_ammo_levels_maybe[NUM_SKILL_LEVELS]; // link if hull strength low
|
||||
float link_ammo_levels_always[NUM_SKILL_LEVELS]; // always link
|
||||
float link_ammo_levels_maybe[NUM_SKILL_LEVELS]; // link if hull strength low
|
||||
float primary_ammo_burst_mult[NUM_SKILL_LEVELS]; // SUSHI: Multiplier adjusting burst frequency for ballistic primary weapons
|
||||
|
||||
// difficulty-related scales
|
||||
float cmeasure_life_scale[NUM_SKILL_LEVELS]; // life of countermeasures
|
||||
@@ -110,15 +93,43 @@ typedef struct ai_profile_t {
|
||||
float subsys_damage_scale[NUM_SKILL_LEVELS]; // damage applied to a player subsystem
|
||||
float beam_friendly_damage_cap[NUM_SKILL_LEVELS]; // damage cap values for friendly beam fire
|
||||
float turn_time_scale[NUM_SKILL_LEVELS]; // speed at which enemy ships turn
|
||||
float glide_attack_percent[NUM_SKILL_LEVELS]; // SUSHI: The likelihood (0.0-1.0) of the AI to use the "glide attack" move
|
||||
float circle_strafe_percent[NUM_SKILL_LEVELS]; // SUSHI: The likelihood (0.0-1.0) of the AI to use the "circle strafe" move
|
||||
float glide_strafe_percent[NUM_SKILL_LEVELS]; // SUSHI: The likelihood (0.0-1.0) of the AI to use glide when strafing capships
|
||||
float random_sidethrust_percent[NUM_SKILL_LEVELS]; // SUSHI: The likelihood (0.0-1.0) of the AI to randomly use sidethrust while dogfihthing
|
||||
float stalemate_time_thresh[NUM_SKILL_LEVELS]; // SUSHI: The amount of time required for the AI to detect (and try to break) dogfight stalemate
|
||||
float stalemate_dist_thresh[NUM_SKILL_LEVELS]; // SUSHI: The maximum distance the AI and target must be within for a stalemate
|
||||
float max_aim_update_delay[NUM_SKILL_LEVELS]; // SUSHI: The maximum delay before the AI updates their aim against small ships
|
||||
float turret_max_aim_update_delay[NUM_SKILL_LEVELS]; // SUSHI: As above, but for turrets updating their aim
|
||||
|
||||
// Multiplicative delay factors for increasing skill levels.
|
||||
float ship_fire_delay_scale_hostile[NUM_SKILL_LEVELS];
|
||||
float ship_fire_delay_scale_friendly[NUM_SKILL_LEVELS];
|
||||
|
||||
// Multiplicative secondary delay factors for increasing skill levels.
|
||||
float ship_fire_secondary_delay_scale_hostile[NUM_SKILL_LEVELS];
|
||||
float ship_fire_secondary_delay_scale_friendly[NUM_SKILL_LEVELS];
|
||||
|
||||
// Maximum turrets of one ship allowed to shoot the same target
|
||||
int max_turret_ownage_target[NUM_SKILL_LEVELS];
|
||||
int max_turret_ownage_player[NUM_SKILL_LEVELS];
|
||||
|
||||
// percentage of damage caused required for a kill/assist
|
||||
float kill_percentage_scale[NUM_SKILL_LEVELS];
|
||||
float assist_percentage_scale[NUM_SKILL_LEVELS];
|
||||
|
||||
// percentage of the capships score given to other team mates on a kill
|
||||
float assist_award_percentage_scale[NUM_SKILL_LEVELS];
|
||||
|
||||
// the number of points subtracted from score for a rearm started on a player
|
||||
int repair_penalty[NUM_SKILL_LEVELS];
|
||||
|
||||
float delay_bomb_arm_timer[NUM_SKILL_LEVELS];
|
||||
|
||||
// the chance (x/7) that ship is allowed to fire missiles at player ship.
|
||||
int chance_to_use_missiles_on_plr[NUM_SKILL_LEVELS];
|
||||
|
||||
|
||||
} ai_profile_t;
|
||||
|
||||
|
||||
|
||||
+233
-455
@@ -7,428 +7,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Ship/AiBig.cpp $
|
||||
* $Revision: 1.12.2.2 $
|
||||
* $Date: 2007-07-15 04:19:32 $
|
||||
* $Author: Goober5000 $
|
||||
*
|
||||
* C module for AI code related to large ships
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 1.12.2.1 2007/02/20 04:19:09 Goober5000
|
||||
* the great big duplicate model removal commit
|
||||
*
|
||||
* Revision 1.12 2006/02/25 21:46:59 Goober5000
|
||||
* spelling
|
||||
*
|
||||
* Revision 1.11 2006/01/13 03:30:59 Goober5000
|
||||
* übercommit of custom IFF stuff :)
|
||||
*
|
||||
* Revision 1.10 2005/11/21 02:43:30 Goober5000
|
||||
* change from "setting" to "profile"; this way makes more sense
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 1.9 2005/11/21 00:46:05 Goober5000
|
||||
* add ai_settings.tbl
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 1.8 2005/10/22 22:22:41 Goober5000
|
||||
* rolled back UnknownPlayer's commit
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 1.6 2005/09/01 04:14:03 taylor
|
||||
* various weapon_range cap fixes for primary, secondary weapons and hud targetting info
|
||||
*
|
||||
* Revision 1.5 2005/07/27 18:27:49 Goober5000
|
||||
* verified that submode_start_time is updated whenever submode is changed
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 1.4 2005/07/25 05:23:33 Goober5000
|
||||
* whoops
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 1.3 2005/07/25 03:13:23 Goober5000
|
||||
* various code cleanups, tweaks, and fixes; most notably the MISSION_FLAG_USE_NEW_AI
|
||||
* should now be added to all places where it is needed (except the turret code, which I still
|
||||
* have to to review)
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 1.2 2005/04/05 05:53:13 taylor
|
||||
* s/vector/vec3d/g, better support for different compilers (Jens Granseuer)
|
||||
*
|
||||
* Revision 1.1 2005/03/25 06:45:12 wmcoolmon
|
||||
* Initial AI code move commit - note that aigoals.cpp has some escape characters in it, I'm not sure if this is really a problem.
|
||||
*
|
||||
* Revision 2.12 2005/03/10 08:00:14 taylor
|
||||
* change min/max to MIN/MAX to fix GCC problems
|
||||
* add lab stuff to Makefile
|
||||
* build unbreakage for everything that's not MSVC++ 6
|
||||
* lots of warning fixes
|
||||
* fix OpenGL rendering problem with ship insignias
|
||||
* no Warnings() in non-debug mode for Linux (like Windows)
|
||||
* some campaign savefile fixage to stop reverting everyones data
|
||||
*
|
||||
* Revision 2.11 2004/11/27 10:49:14 taylor
|
||||
* make sure the old behavior still applies to everything that's not a beam
|
||||
*
|
||||
* Revision 2.10 2004/07/26 20:47:50 Kazan
|
||||
* remove MCD complete
|
||||
*
|
||||
* Revision 2.9 2004/07/12 16:33:04 Kazan
|
||||
* MCD - define _MCD_CHECK to use memory tracking
|
||||
*
|
||||
* Revision 2.8 2004/03/05 09:01:51 Goober5000
|
||||
* Uber pass at reducing #includes
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.7 2003/11/11 02:15:40 Goober5000
|
||||
* ubercommit - basically spelling and language fixes with some additional
|
||||
* warnings disabled
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.6 2003/06/25 03:16:32 phreak
|
||||
* changed around ai code to take into account a limited lock range for local ssms
|
||||
*
|
||||
* Revision 2.5 2003/06/11 03:03:16 phreak
|
||||
* the ai can now use local ssms. they are able to use them at *very* long range
|
||||
*
|
||||
* Revision 2.4 2003/03/20 08:24:45 unknownplayer
|
||||
* Modified the command line options so they are all in lower-case characters.
|
||||
* Made a slight AI adjustment to how ships choose to attack turrets (they now have a 25% chance of attacking a beam turret which has fired at them from another ship)
|
||||
*
|
||||
* Revision 2.3 2003/01/15 07:09:09 Goober5000
|
||||
* changed most references to modelnum to use ship instead of ship_info --
|
||||
* this will help with the change-model sexp and any other instances of model
|
||||
* changing
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.2 2002/10/19 19:29:28 bobboau
|
||||
* initial commit, trying to get most of my stuff into FSO, there should be most of my fighter beam, beam rendering, beam shield hit, ABtrails, and ssm stuff. one thing you should be happy to know is the beam texture tileing is now set in the beam section section of the weapon table entry
|
||||
*
|
||||
* Revision 2.1 2002/08/01 01:41:09 penguin
|
||||
* The big include file move
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:28 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
* Revision 1.2 2002/05/03 22:07:09 mharris
|
||||
* got some stuff to compile
|
||||
*
|
||||
* Revision 1.1 2002/05/02 18:03:12 mharris
|
||||
* Initial checkin - converted filenames and includes to lower case
|
||||
*
|
||||
*
|
||||
* 13 8/31/99 4:24p Andsager
|
||||
* Reduce collisions when attacking big ships.
|
||||
*
|
||||
* 12 7/19/99 2:18p Mikeb
|
||||
* DA: DOH!!
|
||||
*
|
||||
* 11 7/19/99 2:11p Mikeb
|
||||
* DA: sometimes big_ship_attack_normal is not known
|
||||
*
|
||||
* 10 6/14/99 3:21p Andsager
|
||||
* Allow collisions between ship and its debris. Fix up collision pairs
|
||||
* when large ship is warping out.
|
||||
*
|
||||
* 9 6/02/99 5:41p Andsager
|
||||
* Reduce range of secondary weapons not fired from turrets in nebula.
|
||||
* Reduce range of beams fired from turrrets in nebula
|
||||
*
|
||||
* 8 5/13/99 2:31p Jamesa
|
||||
* DA: Temp fix when attacking subsys of big ship and BS is blown up.
|
||||
*
|
||||
* 7 5/06/99 11:46a Andsager
|
||||
* Bug fixes. Don't get into illegal strafe submode. Don't choose turret
|
||||
* enemy objnum for beam protected.
|
||||
*
|
||||
* 6 4/23/99 12:01p Johnson
|
||||
* Added SIF_HUGE_SHIP
|
||||
*
|
||||
* 5 4/20/99 3:40p Andsager
|
||||
* Changes to big ship ai. Uses bounding box as limit where to fly to
|
||||
* when flying away.
|
||||
*
|
||||
* 4 4/16/99 5:54p Dave
|
||||
* Support for on/off style "stream" weapons. Real early support for
|
||||
* target-painting lasers.
|
||||
*
|
||||
* 3 10/13/98 9:29a Dave
|
||||
* Started neatening up freespace.h. Many variables renamed and
|
||||
* reorganized. Added AlphaColors.[h,cpp]
|
||||
*
|
||||
* 2 10/07/98 10:53a Dave
|
||||
* Initial checkin.
|
||||
*
|
||||
* 1 10/07/98 10:51a Dave
|
||||
*
|
||||
* 77 5/25/98 12:12a Mike
|
||||
* Improve big ship avoidance to avoid big ships when in a nearby dock
|
||||
* mode. Fixes very dumb looking behavior in sm2-01a. Verified sm1-08a
|
||||
* not too dumb at start.
|
||||
*
|
||||
* 76 5/23/98 2:38a Mike
|
||||
* Improve balance of cheat-firing Synaptics.
|
||||
*
|
||||
* 75 5/23/98 12:40a Mike
|
||||
* Hook for Delta wing to fire Synaptic bombs in sm3-09a.
|
||||
*
|
||||
* 74 5/22/98 12:08p Mike
|
||||
* Force reset of aspect locking when AI ships switch banks due to
|
||||
* good-time-to-unload-secondaries
|
||||
*
|
||||
* 73 5/21/98 1:25p Lawrance
|
||||
* Fix exception in ai_bpap() when no verts are in closest octant
|
||||
*
|
||||
* 72 5/21/98 9:57a Mike
|
||||
* Massively improve firing of bombs at big ships. Improve willingness to
|
||||
* take incoming fire to deliver bomb. Make a little easier to gain
|
||||
* aspect lock.
|
||||
*
|
||||
* 71 5/12/98 10:06a Mike
|
||||
* Fix a jillion bugs preventing ships from firing bombs at Lucifer in
|
||||
* sm3-09.
|
||||
*
|
||||
* 70 5/10/98 11:30p Mike
|
||||
* Better firing of bombs, less likely to go into strafe mode.
|
||||
*
|
||||
* 69 5/10/98 3:41a Lawrance
|
||||
* Fix bug that was preventing ships from leaving strafe mode
|
||||
*
|
||||
* 68 5/08/98 4:39p Mike
|
||||
* Make ships match bank when attacking large ships.
|
||||
*
|
||||
* 67 5/07/98 11:59p Mike
|
||||
* Remove unneeded code, computation of num_verts.
|
||||
*
|
||||
* 66 4/29/98 5:01p Mike
|
||||
* Large overhaul in how turrets fire.
|
||||
*
|
||||
* 65 4/27/98 11:59p Mike
|
||||
* Intermediate checkin. Getting big ship turrets firing at big ships to
|
||||
* use pick_big_attack_point.
|
||||
*
|
||||
* 64 4/23/98 12:32a Mike
|
||||
* Fix bogus math which looked at (1-fov) instead of fov.
|
||||
*
|
||||
* 63 4/13/98 4:52p Allender
|
||||
* remove AI_frametime and us flFrametime instead. Make lock warning work
|
||||
* in multiplayer for aspect seeking missiles. Debris fixups
|
||||
*
|
||||
* 62 4/13/98 3:27p Lawrance
|
||||
* Fix bug that caused ships to leave strafe mode right away since they
|
||||
* hadn't taken damage for a while
|
||||
*
|
||||
* 61 4/12/98 2:02p Mike
|
||||
* Make small ships avoid big ships.
|
||||
* Turn on Collide_friendly flag.
|
||||
*
|
||||
* 60 4/01/98 9:21p John
|
||||
* Made NDEBUG, optimized build with no warnings or errors.
|
||||
*
|
||||
* 59 3/25/98 12:00a Allender
|
||||
* MK: make sure that output from function gets a valid valud (ai_pbap I
|
||||
* think)
|
||||
*
|
||||
* 58 3/24/98 10:07p Adam
|
||||
* AL: Add another Assert() to try and catch bogus wp->big_attack_point
|
||||
*
|
||||
* 57 3/24/98 9:56p Adam
|
||||
* AL: Assert that local_attack_point is valid in ai_bpap
|
||||
*
|
||||
* 56 3/21/98 3:36p Mike
|
||||
* Fix/optimize attacking of big ships.
|
||||
*
|
||||
* 55 3/16/98 5:17p Mike
|
||||
* Make ships not get stuck on big ships when attacking.
|
||||
*
|
||||
* 54 3/16/98 12:03a Mike
|
||||
* Add support for kamikaze mode. Add AIF_NO_DYNAMIC which means
|
||||
* relentlessly pursue current goal.
|
||||
*
|
||||
* 53 3/12/98 4:04p Lawrance
|
||||
* Leave strafe mode if haven't been hit for a while and no enemy
|
||||
* fighter/bombers are close by.
|
||||
*
|
||||
* 52 3/09/98 5:12p Mike
|
||||
* Make sure Pl_objp uses are valid.
|
||||
* Throw asteroids at ships in asteroid field, not "Gal"
|
||||
* Support ships warp out if no goals after 30 seconds.
|
||||
*
|
||||
* 51 3/03/98 11:51p Lawrance
|
||||
* Ensure target is a ship before looking at SIF flags
|
||||
*
|
||||
* 50 3/02/98 11:35a Mike
|
||||
* Fix logic with ai_do_default_behavior -- return after call.
|
||||
*
|
||||
* 49 2/19/98 7:37p Lawrance
|
||||
* Fix bug that was causing problems with subsystem path following.
|
||||
*
|
||||
* 48 2/14/98 3:38p Mike
|
||||
* Make bombs have arm time, drop for 1/2 second, have hull_strength.
|
||||
* Make them not fired until closer to target.
|
||||
*
|
||||
* 47 2/13/98 3:56p Mike
|
||||
* Make ships more likely to stick to player orders, not get so distracted
|
||||
* by getting hit by someone else.
|
||||
*
|
||||
* 46 2/11/98 4:30p Lawrance
|
||||
* Improve disarm/disable behavior.
|
||||
*
|
||||
* 45 2/11/98 1:16a Mike
|
||||
* Mods to AI behavior to make it harder to stay on a ship's tail. Not
|
||||
* too much improvement.
|
||||
*
|
||||
* 44 2/05/98 12:51a Mike
|
||||
* Early asteroid stuff.
|
||||
*
|
||||
* 43 1/30/98 11:28a Comet
|
||||
* Fix indexing problem into verts in ai_bpap()
|
||||
*
|
||||
* 42 1/29/98 10:46p Mike
|
||||
* In ai_big_pick_attack_point, handle case of octant with no points.
|
||||
*
|
||||
* 41 1/29/98 1:39p Mike
|
||||
* Better heat seeking homing on big ships.
|
||||
*
|
||||
* 40 1/27/98 4:18p Mike
|
||||
* Not fire weapons too early when attacking large ships. Aspect lock
|
||||
* take proper amount of time for AI ships.
|
||||
*
|
||||
* 39 1/22/98 5:14p Lawrance
|
||||
* clean up ai_big code, clear path info when stop attacking a subsystem
|
||||
*
|
||||
* 38 1/20/98 11:41p Mike
|
||||
* Ships use new system of preferred big weapons to fire. Also, support
|
||||
* AIF_UNLOAD_SECONDARIES which means fire as fast as possible.
|
||||
*
|
||||
* 37 1/20/98 9:47a Mike
|
||||
* Suppress optimized compiler warnings.
|
||||
* Some secondary weapon work.
|
||||
*
|
||||
* 36 1/17/98 4:45p Mike
|
||||
* Better support for AI selection of secondary weapons.
|
||||
*
|
||||
* 35 1/16/98 3:57p Mike
|
||||
* Clean up some bugs with attacking of protected ships. Make turrets
|
||||
* only fire at targets that are within range.
|
||||
*
|
||||
* 34 1/16/98 11:32a Mike
|
||||
* Fix bug when a ship is attacking a dead subsystem on a protected ship.
|
||||
*
|
||||
* 33 1/07/98 1:32p Lawrance
|
||||
* Remove some nprintf output
|
||||
*
|
||||
* 32 1/07/98 1:21p Sandeep
|
||||
* Fix bug where accessing uninited pointer
|
||||
*
|
||||
* 31 1/06/98 6:58p Lawrance
|
||||
* Attack turrets (sometimes) when fired upon while attacking a ship.
|
||||
*
|
||||
* 30 12/31/97 6:28p Lawrance
|
||||
* Improve attacking subsystems on moving ships.
|
||||
*
|
||||
* 29 12/31/97 4:16p Lawrance
|
||||
* Use different fov's for attacking subsystems depending if ship is
|
||||
* moving
|
||||
*
|
||||
* 28 12/31/97 4:05p Mike
|
||||
* Support for all teams optionally attacking all teams.
|
||||
* Lead big ships when attacking their hull.
|
||||
*
|
||||
* 27 12/31/97 12:26p Lawrance
|
||||
* Don't enter strafe mode for transports, fix bug that prevented strafe
|
||||
* mode from getting entered.
|
||||
*
|
||||
* 26 12/30/97 5:20p Mike
|
||||
* Don't fire secondaries at a protected ship if its hull is very weak.
|
||||
*
|
||||
* 25 12/30/97 4:26p Lawrance
|
||||
* Take out some debug statements
|
||||
*
|
||||
* 24 12/15/97 7:16p Lawrance
|
||||
* improving subsystem attacking
|
||||
*
|
||||
* 23 12/02/97 11:58a Lawrance
|
||||
* avoid during strafe mode only when endangered by a weapon
|
||||
*
|
||||
* 22 12/01/97 5:11p Lawrance
|
||||
* make strafe mode more effective... slow down when approaching and use
|
||||
* afterburner in avoids
|
||||
*
|
||||
* 21 11/27/97 4:21p Lawrance
|
||||
* set submode to -1 when switching to AIM_NONE from AIM_STRAFE
|
||||
*
|
||||
* 20 11/24/97 2:27a Lawrance
|
||||
* if attacking a big ship and moving very slow, enter strafe mode if
|
||||
* enemy fighter/bombers are close by
|
||||
*
|
||||
* 19 11/14/97 11:27a Johnson
|
||||
* if goal_objnum is -1, and in STRAFE, return 1 from
|
||||
* ai_maybe_follow_subsys_path(), so break out of STRAFE code
|
||||
*
|
||||
* 18 11/13/97 11:51a Johnson
|
||||
* ALAN: comment out Int3() in AiBig... need to test on my own machine
|
||||
*
|
||||
* 17 11/12/97 11:51p Lawrance
|
||||
* only check target_objnum == goal_objnum when following path
|
||||
*
|
||||
* 16 11/12/97 11:01p Lawrance
|
||||
* change call to ai_find_path()
|
||||
* ensure goal_objnum == target_objnum in STRAFE
|
||||
*
|
||||
* 15 11/12/97 11:18a Lawrance
|
||||
* fix bug in path following of subsystems
|
||||
*
|
||||
* 14 11/11/97 5:22p Mike
|
||||
* Don't allow ships to attack navbuoys.
|
||||
* Make ships lead big ships with dumbfire.
|
||||
* Make ships smarter about leaving evade weapon mode.
|
||||
* Fix a couple Assert() bugs.
|
||||
*
|
||||
* 13 11/06/97 6:27p Lawrance
|
||||
* fix bug that was messing up retreat point in STRAFE mode
|
||||
*
|
||||
* 12 11/06/97 4:53p Mike
|
||||
* Limit number of ships that can simultaneously attack another. Make
|
||||
* turrets inherit AI class from parent ship.
|
||||
*
|
||||
* 11 11/06/97 12:27a Mike
|
||||
* Better avoid behavior.
|
||||
* Modify ai_turn_towards_vector() to take a flag parameter.
|
||||
*
|
||||
* 10 11/02/97 10:55p Lawrance
|
||||
* removed some unused code, added some comments
|
||||
*
|
||||
* 9 11/01/97 4:01p Mike
|
||||
* Adapt to new ai_find_path().
|
||||
*
|
||||
* 8 10/31/97 11:24a Lawrance
|
||||
* If taget changes from a big ship to small ship while in AIM_STRAFE,
|
||||
* switch to AIM_CHASE
|
||||
*
|
||||
* 7 10/30/97 10:06p Lawrance
|
||||
* chg some timing values so ship will reach retreat point
|
||||
*
|
||||
* 6 10/30/97 9:17p Lawrance
|
||||
* work on getting AIM_STRAFE working well with disable/disarm, try to
|
||||
* balance
|
||||
*
|
||||
* 5 10/30/97 12:32a Lawrance
|
||||
* further work on AIM_STRAFE
|
||||
*
|
||||
* 4 10/29/97 6:25p Lawrance
|
||||
* add AIM_STRAFE functionality
|
||||
*
|
||||
* 3 10/26/97 4:19p Lawrance
|
||||
* added ai_get_weapon_dist()
|
||||
*
|
||||
* 2 10/26/97 3:24p Lawrance
|
||||
* split off large ship ai code into AiBig.cpp
|
||||
*
|
||||
* $NoKeywords: $
|
||||
*/
|
||||
|
||||
|
||||
#include "ai/aibig.h"
|
||||
#include "globalincs/linklist.h"
|
||||
@@ -440,6 +19,7 @@
|
||||
#include "io/timer.h"
|
||||
#include "mission/missionparse.h"
|
||||
#include "iff_defs/iff_defs.h"
|
||||
#include "math/staticrand.h"
|
||||
|
||||
|
||||
|
||||
@@ -459,6 +39,7 @@
|
||||
#define STRAFE_RETREAT_COLLIDE_TIME 2.0 // when anticipated collision time is less than this, begin retreat
|
||||
#define STRAFE_RETREAT_COLLIDE_DIST 100 // when perpendicular distance to *surface* is less than this, begin retreat
|
||||
#define STRAFE_RETREAT_BOX_DIST 300 // distance beyond the bounding box to retreat
|
||||
#define STRAFE_MAX_UNHIT_TIME 20 // Maximum amount of time to stay in strafe mode if not hit
|
||||
|
||||
#define EVADE_BOX_BASE_DISTANCE 300 // standard distance to end evade submode
|
||||
#define EVADE_BOX_MIN_DISTANCE 200 // minimun distance to end evade submode, after long time
|
||||
@@ -471,12 +52,16 @@
|
||||
#define ATTACK_COLLIDE_SLOW_DIST 150 // perpendicular distance to attack surface at which begin slowing down
|
||||
#define ATTACK_COLLIDE_SLOW_TIME 1.5 // anticipated collision time at which to begin slowing down
|
||||
|
||||
#define GLIDE_STRAFE_DISTANCE 50.0f //Distance from the ship to pass when glide strafing
|
||||
#define GLIDE_STRAFE_MIN_TIME 2 //Minimum amount of time to stay on one glide strafe approach vector
|
||||
#define GLIDE_STRAFE_MAX_TIME 15 //Maximum amount of time for each glide strafe pass
|
||||
|
||||
// forward declarations
|
||||
void ai_big_evade_ship();
|
||||
void ai_big_chase_attack(ai_info *aip, ship_info *sip, vec3d *enemy_pos, float dist_to_enemy, int modelnum);
|
||||
void ai_big_avoid_ship();
|
||||
int ai_big_maybe_follow_subsys_path(int do_dot_check=1);
|
||||
void ai_big_strafe_position();
|
||||
|
||||
extern int model_which_octant_distant_many( vec3d *pnt, int model_num,matrix *model_orient, vec3d * model_pos, polymodel **pm, int *octs);
|
||||
extern void compute_desired_rvec(vec3d *rvec, vec3d *goal_pos, vec3d *cur_pos);
|
||||
@@ -488,7 +73,7 @@ extern void big_ship_collide_recover_start(object *objp, object *big_objp, vec3d
|
||||
// If truly_random flag set (haha), then generate a pretty random number. Otherwise, generate a static rand which
|
||||
// tends to not change from frame to frame.
|
||||
// Try four times and choose nearest point to increase chance of getting a good point.
|
||||
void ai_bpap(object *objp, vec3d *attacker_objp_pos, vec3d *attacker_objp_fvec, vec3d *attack_point, vec3d *local_attack_point, float fov, float weapon_travel_dist, vec3d *surface_normal)
|
||||
void ai_bpap(object *objp, vec3d *attacker_objp_pos, vec3d *attacker_objp_fvec, vec3d *attack_point, vec3d *local_attack_point, float fov, float weapon_travel_dist, vec3d *surface_normal, ship_subsys *ss)
|
||||
{
|
||||
float nearest_dist;
|
||||
vec3d result_point, best_point;
|
||||
@@ -498,6 +83,9 @@ void ai_bpap(object *objp, vec3d *attacker_objp_pos, vec3d *attacker_objp_fvec,
|
||||
polymodel *pm;
|
||||
int i, q, octs[4];
|
||||
ship_info *sip = &Ship_info[Ships[objp->instance].ship_info_index];
|
||||
model_subsystem *tp = NULL;
|
||||
if (ss != NULL)
|
||||
tp = ss->system_info;
|
||||
|
||||
best_point = objp->pos;
|
||||
nearest_dist = weapon_travel_dist;
|
||||
@@ -542,9 +130,17 @@ void ai_bpap(object *objp, vec3d *attacker_objp_pos, vec3d *attacker_objp_fvec,
|
||||
vm_vec_add2(&result_point, &objp->pos);
|
||||
|
||||
dist = vm_vec_normalized_dir(&v2p, &result_point, attacker_objp_pos);
|
||||
dot = vm_vec_dot(&v2p, attacker_objp_fvec);
|
||||
bool in_fov = false;
|
||||
|
||||
if (dot > fov) {
|
||||
dot = vm_vec_dot(&v2p, attacker_objp_fvec);
|
||||
if (tp == NULL) {
|
||||
if (dot > fov)
|
||||
in_fov = true;
|
||||
} else {
|
||||
in_fov = turret_fov_test(ss, attacker_objp_fvec, &v2p);
|
||||
}
|
||||
|
||||
if (in_fov) {
|
||||
if (dist < nearest_dist) {
|
||||
best_index = index;
|
||||
nearest_dist = dist;
|
||||
@@ -616,7 +212,7 @@ void ai_big_pick_attack_point_turret(object *objp, ship_subsys *ssp, vec3d *gpos
|
||||
} else {
|
||||
vec3d local_attack_point;
|
||||
ssp->turret_pick_big_attack_point_timestamp = timestamp(2000 + (int) (frand()*500.0f));
|
||||
ai_bpap(objp, gpos, gvec, attack_point, &local_attack_point, fov, weapon_travel_dist, NULL);
|
||||
ai_bpap(objp, gpos, gvec, attack_point, &local_attack_point, fov, weapon_travel_dist, NULL, ssp);
|
||||
ssp->turret_big_attack_point = local_attack_point;
|
||||
}
|
||||
}
|
||||
@@ -669,7 +265,7 @@ void ai_big_pick_attack_point(object *objp, object *attacker_objp, vec3d *attack
|
||||
|
||||
// checks valid line to target
|
||||
vec3d surface_normal;
|
||||
ai_bpap(objp, &attacker_objp->pos, &attacker_objp->orient.vec.fvec, attack_point, &local_attack_point, fov, 99999.9f, &surface_normal);
|
||||
ai_bpap(objp, &attacker_objp->pos, &attacker_objp->orient.vec.fvec, attack_point, &local_attack_point, fov, 99999.9f, &surface_normal, NULL);
|
||||
|
||||
switch (attacker_objp->type) {
|
||||
case OBJ_SHIP: {
|
||||
@@ -978,14 +574,23 @@ void ai_big_chase_attack(ai_info *aip, ship_info *sip, vec3d *enemy_pos, float d
|
||||
if ( ai_big_maybe_start_strafe(aip, sip) ) {
|
||||
aip->previous_mode = aip->mode;
|
||||
aip->mode = AIM_STRAFE;
|
||||
aip->submode_parm0 = Missiontime; // use parm0 as time strafe mode entered
|
||||
aip->submode = AIS_STRAFE_ATTACK;
|
||||
aip->submode_start_time = Missiontime;
|
||||
aip->submode_parm0 = Missiontime; // use parm0 as time strafe mode entered (i.e. MODE start time)
|
||||
ai_big_strafe_position();
|
||||
return;
|
||||
}
|
||||
|
||||
} // end if ( Pl_objp->phys_info.speed < 3.0f )
|
||||
|
||||
//Maybe enter glide strafe (check every 8 seconds, on a different schedule for each ship)
|
||||
if ((sip->can_glide == true) && !(aip->ai_flags & AIF_KAMIKAZE) && static_randf((Missiontime + static_rand(aip->shipnum)) >> 19) < aip->ai_glide_strafe_percent) {
|
||||
aip->previous_mode = aip->mode;
|
||||
aip->mode = AIM_STRAFE;
|
||||
aip->submode_parm0 = Missiontime; // use parm0 as time strafe mode entered (i.e. MODE start time)
|
||||
aip->submode = AIS_STRAFE_GLIDE_ATTACK;
|
||||
aip->submode_parm1 = 0;
|
||||
aip->submode_start_time = Missiontime;
|
||||
}
|
||||
|
||||
// see if Pl_objp needs to reposition to get a good shot at subsystem which is being attacked
|
||||
if ( ai_big_maybe_follow_subsys_path() ) {
|
||||
return;
|
||||
@@ -1038,7 +643,7 @@ void ai_big_chase_attack(ai_info *aip, ship_info *sip, vec3d *enemy_pos, float d
|
||||
}
|
||||
}
|
||||
|
||||
// use dist normal to enemy here (dont break 50 barrier)
|
||||
// use dist normal to enemy here (don't break 50 barrier)
|
||||
if (dist_to_enemy < ATTACK_STOP_DISTANCE) {
|
||||
// accelerate_ship(aip, accel * 0.5f);
|
||||
accelerate_ship(aip, -1.0f);
|
||||
@@ -1057,7 +662,7 @@ void ai_big_chase_ct()
|
||||
}
|
||||
|
||||
extern void ai_select_secondary_weapon(object *objp, ship_weapon *swp, int priority1 = -1, int priority2 = -1);
|
||||
extern float set_secondary_fire_delay(ai_info *aip, ship *shipp, weapon_info *swip);
|
||||
extern float set_secondary_fire_delay(ai_info *aip, ship *shipp, weapon_info *swip, bool burst);
|
||||
extern void ai_choose_secondary_weapon(object *objp, ai_info *aip, object *en_objp);
|
||||
extern int maybe_avoid_big_ship(object *objp, object *ignore_objp, ai_info *aip, vec3d *goal_point, float delta_time);
|
||||
|
||||
@@ -1089,7 +694,7 @@ void ai_big_maybe_fire_weapons(float dist_to_enemy, float dot_to_enemy, vec3d *f
|
||||
ship_weapon *tswp = &temp_shipp->weapons;
|
||||
|
||||
if ( tswp->num_primary_banks > 0 ) {
|
||||
Assert(tswp->current_primary_bank < tswp->num_primary_banks);
|
||||
Assertion(tswp->current_primary_bank < tswp->num_primary_banks, "AI tried to select primary bank %d. Might be a model error\n", tswp->current_primary_bank);
|
||||
weapon_info *wip = &Weapon_info[tswp->primary_bank_weapons[tswp->current_primary_bank]];
|
||||
|
||||
if (dist_to_enemy < MIN((wip->max_speed * wip->lifetime), wip->weapon_range)){
|
||||
@@ -1099,6 +704,9 @@ void ai_big_maybe_fire_weapons(float dist_to_enemy, float dot_to_enemy, vec3d *f
|
||||
// ship_stop_fire_primary(Pl_objp);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (tswp->num_secondary_banks > 0) {
|
||||
|
||||
int priority1, priority2;
|
||||
|
||||
@@ -1146,12 +754,31 @@ void ai_big_maybe_fire_weapons(float dist_to_enemy, float dot_to_enemy, vec3d *f
|
||||
//vm_vec_scale_add(&future_enemy_pos, enemy_pos, enemy_vel, dist_to_enemy/swip->max_speed);
|
||||
//if (vm_vec_dist_quick(&future_enemy_pos, firing_pos) < firing_range * 0.8f) {
|
||||
if (ai_fire_secondary_weapon(Pl_objp)) {
|
||||
if (aip->ai_flags & AIF_UNLOAD_SECONDARIES) {
|
||||
t = swip->fire_wait;
|
||||
if ((aip->ai_flags & AIF_UNLOAD_SECONDARIES) || (swip->burst_flags & WBF_FAST_FIRING)) {
|
||||
if (swip->burst_shots > swp->burst_counter[current_bank]) {
|
||||
t = swip->burst_delay;
|
||||
swp->burst_counter[current_bank]++;
|
||||
} else {
|
||||
t = swip->fire_wait;
|
||||
if ((swip->burst_shots > 0) && (swip->burst_flags & WBF_RANDOM_LENGTH)) {
|
||||
swp->burst_counter[current_bank] = myrand() % swip->burst_shots;
|
||||
} else {
|
||||
swp->burst_counter[current_bank] = 0;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
t = set_secondary_fire_delay(aip, temp_shipp, swip);
|
||||
if (swip->burst_shots > swp->burst_counter[current_bank]) {
|
||||
t = set_secondary_fire_delay(aip, temp_shipp, swip, true);
|
||||
swp->burst_counter[current_bank]++;
|
||||
} else {
|
||||
t = set_secondary_fire_delay(aip, temp_shipp, swip, false);
|
||||
if ((swip->burst_shots > 0) && (swip->burst_flags & WBF_RANDOM_LENGTH)) {
|
||||
swp->burst_counter[current_bank] = myrand() % swip->burst_shots;
|
||||
} else {
|
||||
swp->burst_counter[current_bank] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
swp->next_secondary_fire_stamp[current_bank] = timestamp((int) (t*1000.0f));
|
||||
}
|
||||
//}
|
||||
@@ -1163,7 +790,10 @@ void ai_big_maybe_fire_weapons(float dist_to_enemy, float dot_to_enemy, vec3d *f
|
||||
}
|
||||
}
|
||||
} else {
|
||||
aip->time_enemy_in_range *= (1.0f - flFrametime);
|
||||
if (flFrametime < 1.0f)
|
||||
aip->time_enemy_in_range *= (1.0f - flFrametime);
|
||||
else
|
||||
aip->time_enemy_in_range = 0;
|
||||
}
|
||||
|
||||
if(has_fired == -1){ //stuff that hapens when the ship stops fireing
|
||||
@@ -1207,7 +837,7 @@ void ai_big_chase()
|
||||
|
||||
// Compute the predicted position of the center of the ship, then add the delta to the goal pos.
|
||||
if (En_objp->phys_info.speed > 3.0f) {
|
||||
set_predicted_enemy_pos(&predicted_enemy_pos, Pl_objp, En_objp, aip);
|
||||
set_predicted_enemy_pos(&predicted_enemy_pos, Pl_objp, &En_objp->pos, &En_objp->phys_info.vel, aip);
|
||||
vm_vec_add2(&enemy_pos, &predicted_enemy_pos);
|
||||
vm_vec_sub2(&enemy_pos, &En_objp->pos);
|
||||
} else
|
||||
@@ -1223,7 +853,7 @@ void ai_big_chase()
|
||||
if (aip->ai_flags & AIF_TARGET_COLLISION) {
|
||||
if ( ai_big_strafe_maybe_retreat(dist_to_enemy, &enemy_pos) ) {
|
||||
aip->mode = AIM_STRAFE;
|
||||
aip->submode_parm0 = Missiontime; // use parm0 as time strafe mode entered
|
||||
aip->submode_parm0 = Missiontime; // use parm0 as time strafe mode entered (i.e. MODE start time)
|
||||
aip->submode = AIS_STRAFE_AVOID;
|
||||
aip->submode_start_time = Missiontime;
|
||||
return;
|
||||
@@ -1470,8 +1100,12 @@ void ai_big_chase()
|
||||
// a big ship
|
||||
if (aip->mode != AIM_EVADE && aip->path_start == -1 ) {
|
||||
ai_big_maybe_fire_weapons(dist_to_enemy, dot_to_enemy, &player_pos, &predicted_enemy_pos, &En_objp->phys_info.vel);
|
||||
} else
|
||||
aip->time_enemy_in_range *= (1.0f - flFrametime);
|
||||
} else {
|
||||
if (flFrametime < 1.0f)
|
||||
aip->time_enemy_in_range *= (1.0f - flFrametime);
|
||||
else
|
||||
aip->time_enemy_in_range = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void ai_big_ship(object *objp)
|
||||
@@ -1527,9 +1161,13 @@ void ai_big_attack_get_data(vec3d *enemy_pos, float *dist_to_enemy, float *dot_t
|
||||
float weapon_speed;
|
||||
|
||||
// Compute position of gun in absolute space and use that as fire position.
|
||||
pnt = po->gun_banks[0].pnt[0];
|
||||
vm_vec_unrotate(&gun_pos, &pnt, &Pl_objp->orient);
|
||||
vm_vec_add2(&gun_pos, &Pl_objp->pos);
|
||||
if (po->n_guns > 0) {
|
||||
pnt = po->gun_banks[0].pnt[0];
|
||||
vm_vec_unrotate(&gun_pos, &pnt, &Pl_objp->orient);
|
||||
vm_vec_add2(&gun_pos, &Pl_objp->pos);
|
||||
} else {
|
||||
gun_pos = Pl_objp->pos;
|
||||
}
|
||||
weapon_speed = ai_get_weapon_speed(&shipp->weapons);
|
||||
|
||||
set_predicted_enemy_pos_turret(&predicted_enemy_pos, &gun_pos, Pl_objp, enemy_pos, &En_objp->phys_info.vel, weapon_speed, aip->time_enemy_in_range);
|
||||
@@ -1697,12 +1335,132 @@ void ai_big_strafe_attack()
|
||||
|
||||
// if haven't been hit in quite a while, leave strafe mode
|
||||
fix long_enough;
|
||||
long_enough = F1_0*20;
|
||||
long_enough = F1_0 * STRAFE_MAX_UNHIT_TIME;
|
||||
if ( (last_hit > long_enough) && ( (Missiontime - aip->submode_parm0) > long_enough) ) {
|
||||
ai_big_switch_to_chase_mode(aip);
|
||||
}
|
||||
}
|
||||
|
||||
// SUSHI: Strafe attack using glide
|
||||
//submode_parm1 encodes the stage we're in.
|
||||
//0: Choosing goal point to fly towards
|
||||
//1: Accelerating towards the goal point.
|
||||
//2: Raining down fire and brimstone on the target.
|
||||
//3: Dummy stage used when resetting or exiting the mode
|
||||
void ai_big_strafe_glide_attack()
|
||||
{
|
||||
ai_info *aip;
|
||||
vec3d target_pos, vec_to_goal, predicted_enemy_pos, norm_vel_vec;
|
||||
float target_dist, target_dot, target_ship_dist, dot_to_goal, flight_dot_to_enemy;
|
||||
object *target_objp;
|
||||
|
||||
aip = &Ai_info[Ships[Pl_objp->instance].ai_index];
|
||||
target_objp = &Objects[aip->target_objnum];
|
||||
|
||||
vm_vec_sub(&vec_to_goal, &aip->goal_point, &Pl_objp->pos);
|
||||
vm_vec_normalize(&vec_to_goal);
|
||||
|
||||
if (vm_vec_mag(&Pl_objp->phys_info.vel) > 0.0f)
|
||||
vm_vec_copy_normalize(&norm_vel_vec, &Pl_objp->phys_info.vel);
|
||||
else
|
||||
vm_vec_copy_normalize(&norm_vel_vec, &Pl_objp->orient.vec.fvec);
|
||||
|
||||
dot_to_goal = vm_vec_dot(&vec_to_goal, &norm_vel_vec); //Angle between flight path and goal point
|
||||
flight_dot_to_enemy = vm_vec_dot(&target_objp->pos, &norm_vel_vec); //Angle between flight path and target ship
|
||||
|
||||
//If we're following a path, then we shouldn't be doing glide strafe
|
||||
if ( ai_big_maybe_follow_subsys_path(0) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
//Gets a point on the target ship to attack, as well as distance and the angle between the nose of the attacker and that point.
|
||||
ai_big_attack_get_data(&target_pos, &target_dist, &target_dot);
|
||||
target_ship_dist = vm_vec_dist(&target_objp->pos, &Pl_objp->pos);
|
||||
|
||||
//If we haven't chosen the goal point yet, do so now
|
||||
if (aip->submode_parm1 == 0) {
|
||||
//Pick goal point. This should be a random point that passes through the circle whose normal is the vector between attacker and target
|
||||
vec3d targetToAttacker;
|
||||
vec3d tangentPoint;
|
||||
vm_vec_sub(&targetToAttacker, &Pl_objp->pos, &target_objp->pos);
|
||||
matrix orient;
|
||||
vm_vector_2_matrix(&orient, &targetToAttacker, NULL, NULL);
|
||||
vm_vec_random_in_circle(&tangentPoint, &target_objp->pos, &orient, target_objp->radius + GLIDE_STRAFE_DISTANCE, 1);
|
||||
//Get tangent point in coords relative to ship, scale it up so the actual goal point is far away, then put back in world coords
|
||||
vm_vec_sub2(&tangentPoint, &Pl_objp->pos);
|
||||
vm_vec_scale(&tangentPoint, 1000.0f);
|
||||
vm_vec_add(&aip->goal_point, &tangentPoint, &Pl_objp->pos);
|
||||
aip->submode_parm1 = 1;
|
||||
}
|
||||
if (aip->submode_parm1 == 1) {
|
||||
//Stay in acceleration stage?
|
||||
//Accelerate towards goal point until:
|
||||
// Mostly up to speed AND
|
||||
// Moving in the correct direction
|
||||
if ((Pl_objp->phys_info.fspeed > (Pl_objp->phys_info.max_vel.xyz.z * 0.85f)) && (dot_to_goal > 0.99f))
|
||||
aip->submode_parm1 = 2;
|
||||
}
|
||||
if (aip->submode_parm1 == 2) {
|
||||
//Should we stay in the fire stage?
|
||||
//Keep going until we are too far away.
|
||||
//If we are still on approach but too far away, this will still trigger. This will allow us to reposition the target
|
||||
//point and allow for a "jinking" effect.
|
||||
if (target_ship_dist > (STRAFE_RETREAT_BOX_DIST + target_objp->radius) &&
|
||||
Missiontime - aip->submode_start_time > i2f(GLIDE_STRAFE_MIN_TIME)) {
|
||||
//This checks whether we are moving toward the target or away from it. If moving towards, we reset the stage so that we
|
||||
//pick a new attack vector (jinking). If moving away, we're at the end of a run so do a full reset (possibly allowing a
|
||||
//switch back to conventional strafe).
|
||||
if (flight_dot_to_enemy > 0.0f) {
|
||||
aip->submode_parm1 = 0;
|
||||
}
|
||||
else {
|
||||
aip->submode_parm1 = 3;
|
||||
aip->submode = AIS_STRAFE_POSITION;
|
||||
}
|
||||
aip->submode_start_time = Missiontime;
|
||||
}
|
||||
}
|
||||
//Time limit: if we've taken too long, reset
|
||||
if (Missiontime - aip->submode_start_time > i2f(GLIDE_STRAFE_MAX_TIME)) {
|
||||
aip->submode_parm1 = 3;
|
||||
aip->submode = AIS_STRAFE_POSITION;
|
||||
aip->submode_start_time = Missiontime;
|
||||
}
|
||||
|
||||
//Acceleration stage
|
||||
if (aip->submode_parm1 == 1) {
|
||||
accelerate_ship(aip, 1.0f);
|
||||
//Use afterburners if we have them and are pointed the right way
|
||||
if (dot_to_goal > 0.99f) {
|
||||
afterburners_start(Pl_objp);
|
||||
aip->afterburner_stop_time = Missiontime + 3*F1_0;
|
||||
}
|
||||
|
||||
turn_towards_point(Pl_objp, &aip->goal_point, NULL, 0.0f);
|
||||
}
|
||||
//Fire stage
|
||||
if (aip->submode_parm1 == 2) {
|
||||
Pl_objp->phys_info.flags |= PF_GLIDING;
|
||||
accelerate_ship(aip, 0.0f);
|
||||
afterburners_stop(Pl_objp);
|
||||
|
||||
//Compensate for motion of ship and target
|
||||
set_predicted_enemy_pos(&predicted_enemy_pos, Pl_objp, &En_objp->pos, &En_objp->phys_info.vel, aip);
|
||||
vm_vec_add2(&target_pos, &predicted_enemy_pos);
|
||||
vm_vec_sub2(&target_pos, &En_objp->pos);
|
||||
|
||||
turn_towards_point(Pl_objp, &target_pos, NULL, 0.0f);
|
||||
ai_big_maybe_fire_weapons(target_dist, target_dot, &Pl_objp->pos, &En_objp->pos, &En_objp->phys_info.vel);
|
||||
}
|
||||
|
||||
// if haven't been hit in quite a while, leave strafe mode
|
||||
// (same as ai_big_strafe_attack)
|
||||
fix long_enough = F1_0 * STRAFE_MAX_UNHIT_TIME;
|
||||
if ( (Missiontime - aip->last_hit_time > long_enough) && ( (Missiontime - aip->submode_parm0) > long_enough) ) {
|
||||
ai_big_switch_to_chase_mode(aip);
|
||||
}
|
||||
}
|
||||
|
||||
// pick a new attack point when entering this state, and keep using it
|
||||
void ai_big_strafe_avoid()
|
||||
{
|
||||
@@ -1720,9 +1478,7 @@ void ai_big_strafe_avoid()
|
||||
return;
|
||||
|
||||
if ( mode_time > fl2f(0.5)) {
|
||||
aip->submode = AIS_STRAFE_ATTACK;
|
||||
aip->submode_start_time = Missiontime;
|
||||
// nprintf(("Alan","Ship %s entering AIS_STRAFE_ATTACK at frame %d\n", Ships[aip->shipnum].ship_name, Framecount));
|
||||
ai_big_strafe_position();
|
||||
}
|
||||
|
||||
turn_towards_point(Pl_objp, &aip->goal_point, NULL, 0.0f);
|
||||
@@ -1817,13 +1573,19 @@ void ai_big_strafe_retreat2()
|
||||
// reposition self to begin another strafing run
|
||||
void ai_big_strafe_position()
|
||||
{
|
||||
ship_info *sip;
|
||||
ai_info *aip;
|
||||
sip = &Ship_info[Ships[Pl_objp->instance].ship_info_index];
|
||||
aip = &Ai_info[Ships[Pl_objp->instance].ai_index];
|
||||
// TODO: loop around or something!!
|
||||
|
||||
aip->submode = AIS_STRAFE_ATTACK;
|
||||
//Maybe use AIS_STRAFE_GLIDE_ATTACK
|
||||
if ((sip->can_glide == true) && !(aip->ai_flags & AIF_KAMIKAZE) && (frand() < aip->ai_glide_strafe_percent)) {
|
||||
aip->submode = AIS_STRAFE_GLIDE_ATTACK;
|
||||
aip->submode_parm1 = 0;
|
||||
} else {
|
||||
aip->submode = AIS_STRAFE_ATTACK;
|
||||
}
|
||||
aip->submode_start_time = Missiontime;
|
||||
// nprintf(("Alan","Ship %s entering AIS_STRAFE_ATTACK\n", Ships[aip->shipnum].ship_name));
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
@@ -1848,7 +1610,6 @@ void ai_big_strafe()
|
||||
return;
|
||||
}
|
||||
*/
|
||||
|
||||
// check if target is still a big ship... if not enter chase mode
|
||||
if ( !(Ship_info[Ships[En_objp->instance].ship_info_index].flags & (SIF_BIG_SHIP|SIF_HUGE_SHIP)) ) {
|
||||
ai_big_switch_to_chase_mode(aip);
|
||||
@@ -1871,11 +1632,28 @@ void ai_big_strafe()
|
||||
case AIS_STRAFE_POSITION:
|
||||
ai_big_strafe_position();
|
||||
break;
|
||||
case AIS_STRAFE_GLIDE_ATTACK:
|
||||
ai_big_strafe_glide_attack();
|
||||
break;
|
||||
default:
|
||||
|
||||
Int3(); // Illegal submode for AIM_STRAFE
|
||||
break;
|
||||
}
|
||||
|
||||
//Maybe apply random sidethrust, depending on the current submode
|
||||
//The following are valid targets for random sidethrust (circle strafe uses it too, but that is handled separately)
|
||||
if (aip->submode == AIS_STRAFE_ATTACK ||
|
||||
aip->submode == AIS_STRAFE_AVOID ||
|
||||
aip->submode == AIS_STRAFE_RETREAT1 ||
|
||||
aip->submode == AIS_STRAFE_RETREAT2 ||
|
||||
aip->submode == AIS_STRAFE_POSITION)
|
||||
{
|
||||
//Re-roll for random sidethrust every 2 seconds
|
||||
if (static_randf((Missiontime + static_rand(aip->shipnum)) >> 17) < aip->ai_random_sidethrust_percent) {
|
||||
do_random_sidethrust(aip, &Ship_info[Ships[Objects[aip->target_objnum].instance].ship_info_index]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// See if Pl_objp should enter strafe mode (This is called from maybe_evade_dumbfire_weapon(), and the
|
||||
@@ -1946,7 +1724,7 @@ int ai_big_maybe_enter_strafe_mode(object *pl_objp, int weapon_objnum, int consi
|
||||
// big/capital ship... so enter strafe mode
|
||||
aip->previous_mode = aip->mode;
|
||||
aip->mode = AIM_STRAFE;
|
||||
aip->submode_parm0 = Missiontime; // use parm0 as time strafe mode entered
|
||||
aip->submode_parm0 = Missiontime; // use parm0 as time strafe mode entered (i.e. MODE start time)
|
||||
aip->submode = AIS_STRAFE_AVOID;
|
||||
aip->submode_start_time = Missiontime;
|
||||
// nprintf(("Alan","%s Accepted strafe mode\n", Ships[pl_objp->instance].ship_name));
|
||||
@@ -1988,7 +1766,7 @@ void ai_big_strafe_maybe_attack_turret(object *ship_objp, object *weapon_objp)
|
||||
// the ai will not always go after different ships firing beams at them.
|
||||
// Approx 1/4 chance we'll go after the other ship's beam.
|
||||
|
||||
bool attack_turret_on_different_ship = (The_mission.ai_profile->flags & AIPF_BIG_SHIPS_CAN_ATTACK_BEAM_TURRETS_ON_UNTARGETED_SHIPS)
|
||||
bool attack_turret_on_different_ship = (aip->ai_profile_flags & AIPF_BIG_SHIPS_CAN_ATTACK_BEAM_TURRETS_ON_UNTARGETED_SHIPS)
|
||||
&& (Weapon_info[weapon_objp->instance].wi_flags & WIF_BEAM) && (frand()*100 < 25.0f);
|
||||
|
||||
// unless we're making an exception, we should only attack a turret if it sits on the current target
|
||||
|
||||
+1
-75
@@ -7,81 +7,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Ship/AiBig.h $
|
||||
* $Revision: 1.3 $
|
||||
* $Date: 2005-07-13 02:50:48 $
|
||||
* $Author: Goober5000 $
|
||||
*
|
||||
* Header file for AI code related to large ships
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 1.2 2005/04/05 05:53:13 taylor
|
||||
* s/vector/vec3d/g, better support for different compilers (Jens Granseuer)
|
||||
*
|
||||
* Revision 1.1 2005/03/25 06:45:12 wmcoolmon
|
||||
* Initial AI code move commit - note that aigoals.cpp has some escape characters in it, I'm not sure if this is really a problem.
|
||||
*
|
||||
* Revision 2.2 2004/08/11 05:06:34 Kazan
|
||||
* added preprocdefines.h to prevent what happened with fred -- make sure to make all fred2 headers include this file as the _first_ include -- i have already modified fs2 files to do this
|
||||
*
|
||||
* Revision 2.1 2004/03/05 09:01:51 Goober5000
|
||||
* Uber pass at reducing #includes
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:28 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
* Revision 1.1 2002/05/02 18:03:12 mharris
|
||||
* Initial checkin - converted filenames and includes to lower case
|
||||
*
|
||||
*
|
||||
* 2 10/07/98 10:53a Dave
|
||||
* Initial checkin.
|
||||
*
|
||||
* 1 10/07/98 10:51a Dave
|
||||
*
|
||||
* 13 4/29/98 5:01p Mike
|
||||
* Large overhaul in how turrets fire.
|
||||
*
|
||||
* 12 4/27/98 11:59p Mike
|
||||
* Intermediate checkin. Getting big ship turrets firing at big ships to
|
||||
* use pick_big_attack_point.
|
||||
*
|
||||
* 11 3/21/98 3:36p Mike
|
||||
* Fix/optimize attacking of big ships.
|
||||
*
|
||||
* 10 1/29/98 1:39p Mike
|
||||
* Better heat seeking homing on big ships.
|
||||
*
|
||||
* 9 1/22/98 5:14p Lawrance
|
||||
* clean up ai_big code, clear path info when stop attacking a subsystem
|
||||
*
|
||||
* 8 1/06/98 6:58p Lawrance
|
||||
* Attack turrets (sometimes) when fired upon while attacking a ship.
|
||||
*
|
||||
* 7 12/15/97 7:16p Lawrance
|
||||
* improving subsystem attacking
|
||||
*
|
||||
* 6 12/01/97 5:11p Lawrance
|
||||
* make strafe mode more effective... slow down when approaching and use
|
||||
* afterburner in avoids
|
||||
*
|
||||
* 5 10/30/97 9:17p Lawrance
|
||||
* work on getting AIM_STRAFE working well with disable/disarm, try to
|
||||
* balance
|
||||
*
|
||||
* 4 10/30/97 12:32a Lawrance
|
||||
* further work on AIM_STRAFE
|
||||
*
|
||||
* 3 10/29/97 6:24p Lawrance
|
||||
* extern ai_strafe()
|
||||
*
|
||||
* 2 10/26/97 3:24p Lawrance
|
||||
* split off large ship ai code into AiBig.cpp
|
||||
*
|
||||
* $NoKeywords: $
|
||||
*/
|
||||
|
||||
|
||||
#ifndef __AIBIG_H__
|
||||
#define __AIBIG_H__
|
||||
|
||||
+1172
-1827
File diff suppressed because it is too large.
Load diff
+239
-739
File diff suppressed because it is too large.
Load diff
+28
-197
@@ -7,177 +7,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Ship/AiGoals.h $
|
||||
* $Revision: 1.6 $
|
||||
* $Date: 2006-04-20 06:32:00 $
|
||||
* $Author: Goober5000 $
|
||||
*
|
||||
* <insert description of file here>
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 1.5 2006/02/20 02:13:07 Goober5000
|
||||
* added ai-ignore-new which hopefully should fix the ignore bug
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 1.4 2006/02/19 22:00:09 Goober5000
|
||||
* restore original ignore behavior and remove soon-to-be-obsolete ai-chase-any-except
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 1.3 2005/12/29 08:08:33 wmcoolmon
|
||||
* Codebase commit, most notably including objecttypes.tbl
|
||||
*
|
||||
* Revision 1.2 2005/07/13 02:50:48 Goober5000
|
||||
* remove PreProcDefine #includes in FS2
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 1.1 2005/03/25 06:45:13 wmcoolmon
|
||||
* Initial AI code move commit - note that aigoals.cpp has some escape characters in it, I'm not sure if this is really a problem.
|
||||
*
|
||||
* Revision 2.6 2004/08/11 05:06:34 Kazan
|
||||
* added preprocdefines.h to prevent what happened with fred -- make sure to make all fred2 headers include this file as the _first_ include -- i have already modified fs2 files to do this
|
||||
*
|
||||
* Revision 2.5 2004/07/25 00:31:31 Kazan
|
||||
* i have absolutely nothing to say about that subject
|
||||
*
|
||||
* Revision 2.4 2004/03/05 09:01:52 Goober5000
|
||||
* Uber pass at reducing #includes
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.3 2003/01/07 20:06:44 Goober5000
|
||||
* added ai-chase-any-except sexp
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.2 2003/01/06 21:52:58 Goober5000
|
||||
* allowed fighters and bombers to accept the stay-near-ship and
|
||||
* keep-safe-distance orders
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.1 2002/08/01 01:41:10 penguin
|
||||
* The big include file move
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:28 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
* Revision 1.1 2002/05/02 18:03:12 mharris
|
||||
* Initial checkin - converted filenames and includes to lower case
|
||||
*
|
||||
*
|
||||
* 5 7/09/99 5:54p Dave
|
||||
* Seperated cruiser types into individual types. Added tons of new
|
||||
* briefing icons. Campaign screen.
|
||||
*
|
||||
* 4 3/26/99 4:49p Dave
|
||||
* Made cruisers able to dock with stuff. Made docking points and paths
|
||||
* visible in fred.
|
||||
*
|
||||
* 3 11/05/98 5:55p Dave
|
||||
* Big pass at reducing #includes
|
||||
*
|
||||
* 2 10/07/98 10:53a Dave
|
||||
* Initial checkin.
|
||||
*
|
||||
* 1 10/07/98 10:51a Dave
|
||||
*
|
||||
* 46 2/26/98 10:08p Hoffoss
|
||||
* Rewrote state saving and restoring to fix bugs and simplify the code.
|
||||
*
|
||||
* 45 2/22/98 4:17p John
|
||||
* More string externalization classification... 190 left to go!
|
||||
*
|
||||
* 44 2/16/98 10:13p Allender
|
||||
* initial work on being able to target weapons (bombs specifically).
|
||||
* Work on getting rearm/repair working under multiplayer
|
||||
*
|
||||
* 43 2/13/98 3:21p Lawrance
|
||||
* Set up allowed goals for escape pods.
|
||||
*
|
||||
* 42 1/30/98 10:01a Allender
|
||||
* made large ships able to attack other ships. Made goal code recognize
|
||||
* when ships removed from wings during ship select
|
||||
*
|
||||
* 41 12/15/97 5:25p Allender
|
||||
* fix problem with docked ships receiving another dock goal. They now
|
||||
* properly undock
|
||||
*
|
||||
* 40 11/17/97 6:39p Lawrance
|
||||
* add AI_goal_text[] array, used by HUD code to show text description of
|
||||
* order
|
||||
*
|
||||
* 39 10/29/97 10:02p Allender
|
||||
* be sure that player starting wings that arrive late also form on the
|
||||
* players wing if there are no goals
|
||||
*
|
||||
* 38 10/23/97 4:41p Allender
|
||||
* lots of new rearm/repair code. Rearm requests now queue as goals for
|
||||
* support ship. Warp in of new support ships functional. Support for
|
||||
* stay-still and play-dead.
|
||||
*
|
||||
* 37 10/22/97 1:44p Allender
|
||||
* more work on stay-still and play-dead
|
||||
*
|
||||
* 36 10/22/97 11:07a Allender
|
||||
* Hooked in form on my wing into Mikes AI code
|
||||
*
|
||||
* 35 10/22/97 10:33a Hoffoss
|
||||
* Added AI_GOAL_PLAY_DEAD as a valid goal for all ships.
|
||||
*
|
||||
* 34 10/22/97 9:54a Allender
|
||||
* added ai_goal_play_dead
|
||||
*
|
||||
* 33 10/10/97 5:03p Allender
|
||||
* started work on ai-stay-still
|
||||
*
|
||||
* 32 9/23/97 4:35p Allender
|
||||
* added two function to add "internal" goals to ships and wings. Used by
|
||||
* AI when it needs to do something special
|
||||
*
|
||||
* 31 8/15/97 11:07a Hoffoss
|
||||
* Added warning to help eliminate problems later on down the road.
|
||||
*
|
||||
* 30 8/15/97 9:59a Hoffoss
|
||||
* Changed ai_query_goal_valid() again. I can't think of any time you
|
||||
* wouldn't find it easier just to pass in a ship instead of a ship_info
|
||||
* flag structure filtered of all flags that aren't ship type bits. Since
|
||||
* I'll call this quite a few times, it will make my life easier.
|
||||
*
|
||||
* 29 8/14/97 10:00p Allender
|
||||
* made ai goals bitfields so that we can have set of orders that certain
|
||||
* ship types are allowed to receive. Added function for Hoffoss to check
|
||||
* goal vs. ship type validity
|
||||
*
|
||||
* 28 8/12/97 1:55a Hoffoss
|
||||
* Made extensive changes to object reference checking and handling for
|
||||
* object deletion call.
|
||||
*
|
||||
* 27 8/08/97 1:30p Allender
|
||||
* added commands (and ai goals) for support ships. stay near ship (which
|
||||
* could be player or current target), and keep safe distance
|
||||
*
|
||||
* 26 8/06/97 9:41a Allender
|
||||
* renamed from ai_goal function. made a function to remove a goal from a
|
||||
* wing (used strictly for waypoints now). ai-chase-wing and
|
||||
* ai-guard-wing now appear to user as ai-chase and ai-guard. Tidied up
|
||||
* function which deals with sexpression goals
|
||||
*
|
||||
* 25 8/06/97 8:06a Lawrance
|
||||
* add more stuff to save/restore
|
||||
*
|
||||
* 24 7/24/97 4:55p Allender
|
||||
* added ai-evade-ship to Fred and to FreeSpace
|
||||
*
|
||||
* 23 7/17/97 4:23p Allender
|
||||
* ai-guard-wing now in both Fred and FreeSpace
|
||||
*
|
||||
* 22 7/15/97 11:57a Hoffoss
|
||||
* Added a general ai goal reference update mode.
|
||||
*
|
||||
* 21 6/18/97 11:46a Hoffoss
|
||||
* Fixed initial order object reference updating and added briefing dialog
|
||||
* window tracking data.
|
||||
*
|
||||
* $NoKeywords: $
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _AIGOALS_H
|
||||
#define _AIGOALS_H
|
||||
@@ -196,35 +26,35 @@ struct ai_goal;
|
||||
// Fred. If the goal you add doesn't have a target (such as chase_any), then you don't have
|
||||
// to worry about doing this. Also add it to list in Fred\Management.cpp, and let Hoffoss know!
|
||||
// WMC - Oh and add them to Ai_goal_names plz. TY! :)
|
||||
#define AI_GOAL_CHASE (1<<1)
|
||||
#define AI_GOAL_DOCK (1<<2) // used for undocking as well
|
||||
#define AI_GOAL_WAYPOINTS (1<<3)
|
||||
#define AI_GOAL_WAYPOINTS_ONCE (1<<4)
|
||||
#define AI_GOAL_WARP (1<<5)
|
||||
#define AI_GOAL_DESTROY_SUBSYSTEM (1<<6)
|
||||
#define AI_GOAL_FORM_ON_WING (1<<7)
|
||||
#define AI_GOAL_UNDOCK (1<<8)
|
||||
#define AI_GOAL_CHASE_WING (1<<9)
|
||||
#define AI_GOAL_GUARD (1<<10)
|
||||
#define AI_GOAL_DISABLE_SHIP (1<<11)
|
||||
#define AI_GOAL_DISARM_SHIP (1<<12)
|
||||
#define AI_GOAL_CHASE_ANY (1<<13)
|
||||
#define AI_GOAL_IGNORE (1<<14)
|
||||
#define AI_GOAL_GUARD_WING (1<<15)
|
||||
#define AI_GOAL_EVADE_SHIP (1<<16)
|
||||
#define AI_GOAL_CHASE (1<<1) // 0x00000002
|
||||
#define AI_GOAL_DOCK (1<<2) // 0x00000004 // used for undocking as well
|
||||
#define AI_GOAL_WAYPOINTS (1<<3) // 0x00000008
|
||||
#define AI_GOAL_WAYPOINTS_ONCE (1<<4) // 0x00000010
|
||||
#define AI_GOAL_WARP (1<<5) // 0x00000020
|
||||
#define AI_GOAL_DESTROY_SUBSYSTEM (1<<6) // 0x00000040
|
||||
#define AI_GOAL_FORM_ON_WING (1<<7) // 0x00000080
|
||||
#define AI_GOAL_UNDOCK (1<<8) // 0x00000100
|
||||
#define AI_GOAL_CHASE_WING (1<<9) // 0x00000200
|
||||
#define AI_GOAL_GUARD (1<<10) // 0x00000400
|
||||
#define AI_GOAL_DISABLE_SHIP (1<<11) // 0x00000800
|
||||
#define AI_GOAL_DISARM_SHIP (1<<12) // 0x00001000
|
||||
#define AI_GOAL_CHASE_ANY (1<<13) // 0x00002000
|
||||
#define AI_GOAL_IGNORE (1<<14) // 0x00004000
|
||||
#define AI_GOAL_GUARD_WING (1<<15) // 0x00008000
|
||||
#define AI_GOAL_EVADE_SHIP (1<<16) // 0x00010000
|
||||
|
||||
// the next goals are for support ships only
|
||||
#define AI_GOAL_STAY_NEAR_SHIP (1<<17)
|
||||
#define AI_GOAL_KEEP_SAFE_DISTANCE (1<<18)
|
||||
#define AI_GOAL_REARM_REPAIR (1<<19)
|
||||
#define AI_GOAL_STAY_NEAR_SHIP (1<<17) // 0x00020000
|
||||
#define AI_GOAL_KEEP_SAFE_DISTANCE (1<<18) // 0x00040000
|
||||
#define AI_GOAL_REARM_REPAIR (1<<19) // 0x00080000
|
||||
|
||||
// resume regular goals
|
||||
#define AI_GOAL_STAY_STILL (1<<20)
|
||||
#define AI_GOAL_PLAY_DEAD (1<<21)
|
||||
#define AI_GOAL_CHASE_WEAPON (1<<22)
|
||||
#define AI_GOAL_STAY_STILL (1<<20) // 0x00100000
|
||||
#define AI_GOAL_PLAY_DEAD (1<<21) // 0x00200000
|
||||
#define AI_GOAL_CHASE_WEAPON (1<<22) // 0x00400000
|
||||
|
||||
#define AI_GOAL_FLY_TO_SHIP (1<<23) // kazan
|
||||
#define AI_GOAL_IGNORE_NEW (1<<24) // Goober5000
|
||||
#define AI_GOAL_FLY_TO_SHIP (1<<23) // 0x00800000
|
||||
#define AI_GOAL_IGNORE_NEW (1<<24) // 0x01000000
|
||||
|
||||
// now the masks for ship types
|
||||
|
||||
@@ -271,6 +101,9 @@ extern void ai_add_ship_goal_sexp( int sexp, int type, ai_info *aip );
|
||||
extern void ai_add_wing_goal_sexp( int sexp, int type, int wingnum );
|
||||
extern void ai_add_goal_sub_sexp( int sexp, int type, ai_goal *aigp );
|
||||
|
||||
extern int ai_remove_goal_sexp_sub( int sexp, ai_goal* aigp );
|
||||
extern void ai_remove_wing_goal_sexp(int sexp, int wingnum);
|
||||
|
||||
// adds goals to ships/sings through player orders
|
||||
extern void ai_add_ship_goal_player( int type, int mode, int submode, char *shipname, ai_info *aip );
|
||||
extern void ai_add_wing_goal_player( int type, int mode, int submode, char *shipname, int wingnum );
|
||||
@@ -284,8 +117,6 @@ extern void ai_copy_mission_wing_goal( ai_goal *aigp, ai_info *aip );
|
||||
extern void ai_mission_goal_complete( ai_info *aip );
|
||||
extern void ai_mission_wing_goal_complete( int wingnum, ai_goal *remove_goalp );
|
||||
|
||||
extern int ai_get_subsystem_type( char *subsystem );
|
||||
extern char *ai_get_subsystem_type_name(int type);
|
||||
extern void ai_update_goal_references(ai_goal *goals, int type, char *old_name, char *new_name);
|
||||
extern int query_referenced_in_ai_goals(ai_goal *goals, int type, char *name);
|
||||
extern char *ai_add_dock_name(char *str);
|
||||
|
||||
+568
-303
File diff suppressed because it is too large.
Load diff
+12
-287
@@ -7,280 +7,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Anim/AnimPlay.cpp $
|
||||
* $Revision: 2.19.2.2 $
|
||||
* $Date: 2006-09-11 01:00:27 $
|
||||
* $Author: taylor $
|
||||
*
|
||||
* C module for playing back anim files
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.19.2.1 2006/06/22 14:59:44 taylor
|
||||
* fix various things that Valgrind has been complaining about
|
||||
*
|
||||
* Revision 2.19 2006/03/21 00:27:27 taylor
|
||||
* some minor cleanup
|
||||
*
|
||||
* Revision 2.18 2005/11/13 06:39:38 taylor
|
||||
* remove Cmdline_cache_ani support, it only worked if not in a VP and only on streaming ani so it was pretty much useless
|
||||
*
|
||||
* Revision 2.17 2005/05/28 19:40:59 taylor
|
||||
* fix ani corruption detection so that certain streaming anis don't hit it (check was wrong anyway)
|
||||
*
|
||||
* Revision 2.16 2005/05/23 05:58:31 taylor
|
||||
* quick catch for some corrupted anis, only a partial fix but it will do until something
|
||||
* a bit more heavy duty comes along in the near future
|
||||
*
|
||||
* Revision 2.15 2005/05/12 17:49:10 taylor
|
||||
* use vm_malloc(), vm_free(), vm_realloc(), vm_strdup() rather than system named macros
|
||||
* fixes various problems and is past time to make the switch
|
||||
*
|
||||
* Revision 2.14 2005/01/30 12:50:08 taylor
|
||||
* merge with Linux/OSX tree - p0130
|
||||
*
|
||||
* Revision 2.13 2004/12/20 20:18:30 fryday
|
||||
* Commented out ATL dependencies (And changed one macro to an swprintf instead)
|
||||
* Tiny change in animplay ( pow(2.0, ...) instead of pow(2, ...)) because VS2K5
|
||||
* throws an ambiguity error over that.
|
||||
*
|
||||
* Revision 2.12 2004/10/09 17:58:48 taylor
|
||||
* one more try to fix the memory leak and end-of-mission crash for talking head anis
|
||||
*
|
||||
* Revision 2.11 2004/07/26 20:47:23 Kazan
|
||||
* remove MCD complete
|
||||
*
|
||||
* Revision 2.10 2004/07/17 18:46:06 taylor
|
||||
* various OGL and memory leak fixes
|
||||
*
|
||||
* Revision 2.9 2004/07/12 16:32:41 Kazan
|
||||
* MCD - define _MCD_CHECK to use memory tracking
|
||||
*
|
||||
* Revision 2.8 2004/03/05 09:01:52 Goober5000
|
||||
* Uber pass at reducing #includes
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.7 2004/02/16 11:47:31 randomtiger
|
||||
* Removed a lot of files that we dont need anymore.
|
||||
* Changed htl to be on by default, command now -nohtl
|
||||
* Changed D3D to use a 2D vertex for 2D operations which should cut down on redundant data having to go though the system.
|
||||
* Added small change to all -start_mission flag to take you to any mission by filename, very useful for testing.
|
||||
* Removed old dshow code and took away timerbar compile flag condition since it uses a runtime flag now.
|
||||
*
|
||||
* Revision 2.6 2004/02/14 00:18:29 randomtiger
|
||||
* Please note that from now on OGL will only run with a registry set by Launcher v4. See forum for details.
|
||||
* OK, these changes effect a lot of file, I suggest everyone updates ASAP:
|
||||
* Removal of many files from project.
|
||||
* Removal of meanless Gr_bitmap_poly variable.
|
||||
* Removal of glide, directdraw, software modules all links to them, and all code specific to those paths.
|
||||
* Removal of redundant Fred paths that arent needed for Fred OGL.
|
||||
* Have seriously tidied the graphics initialisation code and added generic non standard mode functionality.
|
||||
* Fixed many D3D non standard mode bugs and brought OGL up to the same level.
|
||||
* Removed texture section support for D3D8, voodoo 2 and 3 cards will no longer run under fs2_open in D3D, same goes for any card with a maximum texture size less than 1024.
|
||||
*
|
||||
* Revision 2.5 2003/12/08 22:30:02 randomtiger
|
||||
* Put render state and other direct D3D calls repetition check back in, provides speed boost.
|
||||
* Fixed bug that caused fullscreen only crash with DXT textures
|
||||
* Put dithering back in for tgas and jpgs
|
||||
*
|
||||
* Revision 2.4 2003/11/29 10:52:08 randomtiger
|
||||
* Turned off D3D file mapping, its using too much memory which may be hurting older systems and doesnt seem to be providing much of a speed benifit.
|
||||
* Added stats command for ingame stats on memory usage.
|
||||
* Trys to play intro.mve and intro.avi, just to be safe since its not set by table.
|
||||
* Added fix for fonts wrapping round in non standard hi res modes.
|
||||
* Changed D3D mipmapping to a good value to suit htl mode.
|
||||
* Added new fog colour method which makes use of the bitmap, making this htl feature backcompatible again.
|
||||
*
|
||||
* Revision 2.3 2003/11/11 02:15:41 Goober5000
|
||||
* ubercommit - basically spelling and language fixes with some additional
|
||||
* warnings disabled
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.2 2003/03/18 10:07:00 unknownplayer
|
||||
* The big DX/main line merge. This has been uploaded to the main CVS since I can't manage to get it to upload to the DX branch. Apologies to all who may be affected adversely, but I'll work to debug it as fast as I can.
|
||||
*
|
||||
* Revision 2.1.2.3 2002/11/04 21:24:59 randomtiger
|
||||
*
|
||||
* When running in D3D all ani's are memory mapped for speed, this takes up more memory but stops gametime locking of textures which D3D8 hates.
|
||||
* Added new command line tag Cmdline_d3dlowmem for people who dont want to make use of this because they have no memory.
|
||||
* Cleaned up some more texture stuff enabled console debug for D3D.
|
||||
*
|
||||
* Revision 2.1.2.2 2002/09/28 22:13:42 randomtiger
|
||||
* Sorted out some bits and pieces. The background nebula blends now which is nice. – RT
|
||||
*
|
||||
* Revision 2.1.2.1 2002/09/24 18:56:40 randomtiger
|
||||
* DX8 branch commit
|
||||
*
|
||||
* This is the scub of UP's previous code with the more up to date RT code.
|
||||
* For full details check previous dev e-mails
|
||||
*
|
||||
* Revision 2.1 2002/08/01 01:41:04 penguin
|
||||
* The big include file move
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:21 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
* Revision 1.1 2002/05/02 18:03:04 mharris
|
||||
* Initial checkin - converted filenames and includes to lower case
|
||||
*
|
||||
*
|
||||
* 9 9/13/99 11:26p Andsager
|
||||
* Add debug code to check for poorly sized anis
|
||||
*
|
||||
* 8 8/26/99 9:45a Dave
|
||||
* First pass at easter eggs and cheats.
|
||||
*
|
||||
* 7 7/16/99 1:49p Dave
|
||||
* 8 bit aabitmaps. yay.
|
||||
*
|
||||
* 6 7/13/99 1:15p Dave
|
||||
* 32 bit support. Whee!
|
||||
*
|
||||
* 5 6/10/99 10:34a Dave
|
||||
* Removed unnecessary assert.
|
||||
*
|
||||
* 4 11/30/98 1:07p Dave
|
||||
* 16 bit conversion, first run.
|
||||
*
|
||||
* 3 10/22/98 6:14p Dave
|
||||
* Optimized some #includes in Anim folder. Put in the beginnings of
|
||||
* parse/localization support for externalized strings and tstrings.tbl
|
||||
*
|
||||
* 2 10/07/98 10:52a Dave
|
||||
* Initial checkin.
|
||||
*
|
||||
* 1 10/07/98 10:48a Dave
|
||||
*
|
||||
* 38 6/23/98 4:18p Hoffoss
|
||||
* Fixed some bugs with AC release build.
|
||||
*
|
||||
* 37 5/18/98 5:59p Hoffoss
|
||||
* Made command briefing advanced now once the speech stops and animation
|
||||
* has fully played once, whichever is longer.
|
||||
*
|
||||
* 36 5/14/98 6:29p Hoffoss
|
||||
* Fixed some warnings a release rebuild all turned up.
|
||||
*
|
||||
* 35 5/07/98 3:11a Lawrance
|
||||
* Implement custom streaming code
|
||||
*
|
||||
* 34 4/27/98 3:36p Dave
|
||||
*
|
||||
* 33 3/25/98 8:43p Hoffoss
|
||||
* Changed anim_play() to not be so complex when you try and call it.
|
||||
*
|
||||
* 32 2/05/98 9:21p John
|
||||
* Some new Direct3D code. Added code to monitor a ton of stuff in the
|
||||
* game.
|
||||
*
|
||||
* 31 1/19/98 11:37p Lawrance
|
||||
* Fixing Optimization build warnings
|
||||
*
|
||||
* 30 1/19/98 3:09p Hoffoss
|
||||
* Only free an anim instance if it is actually playing.
|
||||
*
|
||||
* 29 1/14/98 6:43p Lawrance
|
||||
* Add ref_count to anim struct, so we don't free multiple times
|
||||
*
|
||||
* 28 12/30/97 6:44p John
|
||||
* Made g3_Draw_bitmap functions account for aspect of bitmap.
|
||||
*
|
||||
* 27 12/27/97 2:35p John
|
||||
* Restructed some code so that if the memory-mapped file open fails, it
|
||||
* will still read it the old-fashioned, non-memory mapped way.
|
||||
*
|
||||
* 26 12/24/97 9:10p Lawrance
|
||||
* take out some debugging statements
|
||||
*
|
||||
* 25 12/24/97 8:57p Lawrance
|
||||
* Added anim_ignore_next_frametime()
|
||||
*
|
||||
* 24 12/07/97 2:06p Dave
|
||||
* Removed some debug frame-checking code.
|
||||
*
|
||||
* 23 12/06/97 2:55p Dave
|
||||
*
|
||||
* 22 11/29/97 2:05p John
|
||||
* made g3_draw_bitmap and g3_draw_rotated bitmap take w&h, not w/2 & h/2,
|
||||
* like they used to incorrectly assume. Added code to model to read in
|
||||
* thruster radius's.
|
||||
*
|
||||
* 21 11/20/97 5:36p Dave
|
||||
* Hooked in a bunch of main hall changes (including sound). Made it
|
||||
* possible to reposition (rewind/ffwd)
|
||||
* sound buffer pointers. Fixed animation direction change framerate
|
||||
* problem.
|
||||
*
|
||||
* 20 11/20/97 4:33p Sandeep
|
||||
* ALAN: ensure instance->paused gets initialized
|
||||
*
|
||||
* 19 11/20/97 4:12p Lawrance
|
||||
* when paused, don't increment time_elapsed
|
||||
*
|
||||
* 18 11/19/97 8:28p Dave
|
||||
* Hooked in Main Hall screen. Put in Anim support for ping ponging
|
||||
* animations as well as general reversal of anim direction.
|
||||
*
|
||||
* 17 9/11/97 4:17p Allender
|
||||
* use _MAX_PATH instead of MAX_FILENAME_LENGTH for anim_play since it is
|
||||
* called from MoviePlayer with full path
|
||||
*
|
||||
* 16 9/11/97 10:49a Lawrance
|
||||
* improve anim_show_next_frame()
|
||||
*
|
||||
* 15 9/10/97 4:59p Lawrance
|
||||
* improve comments to anim_play() function
|
||||
*
|
||||
* 14 9/03/97 4:19p John
|
||||
* changed bmpman to only accept ani and pcx's. made passing .pcx or .ani
|
||||
* to bm_load functions not needed. Made bmpman keep track of palettes
|
||||
* for bitmaps not mapped into game palettes.
|
||||
*
|
||||
* 13 8/30/97 2:11p Lawrance
|
||||
* allow animations to loop
|
||||
*
|
||||
* 12 8/25/97 11:13p Lawrance
|
||||
* support framerate independent playback with the option of now advancing
|
||||
* more than one frame at a time
|
||||
*
|
||||
* 11 8/22/97 8:20a Lawrance
|
||||
* display scrolling text properly, with indicator that text exitsts to be
|
||||
* scrolled
|
||||
*
|
||||
* 10 8/21/97 5:11p Lawrance
|
||||
* frame numbering for ANI's now is from 0 -> total_frames-1.
|
||||
*
|
||||
* 9 8/19/97 9:30a Lawrance
|
||||
* print out reason if file doesn't open right
|
||||
*
|
||||
* 8 7/28/97 10:42p Lawrance
|
||||
* re-did interface to unpack_frame() to make more general
|
||||
*
|
||||
* 7 7/21/97 11:41a Lawrance
|
||||
* make playback time of .ani files keyed of frametime
|
||||
*
|
||||
* 6 7/20/97 6:57p Lawrance
|
||||
* supporting new RLE format
|
||||
*
|
||||
* 5 7/11/97 11:54a John
|
||||
* added rotated 3d bitmaps.
|
||||
*
|
||||
* 4 6/27/97 4:36p Lawrance
|
||||
* update pal translation table when gr_screen.signature changes
|
||||
*
|
||||
* 3 6/26/97 3:00p Lawrance
|
||||
* fix bug with playing 3d anims
|
||||
*
|
||||
* 2 6/26/97 12:12a Lawrance
|
||||
* supporting anti-aliased bitmap animations
|
||||
*
|
||||
* 1 6/23/97 5:09p Lawrance
|
||||
*
|
||||
* 24 6/03/97 5:53p Lawrance
|
||||
* don't unload bitmap after bm_create
|
||||
*
|
||||
* $NoKeywords: $
|
||||
*/
|
||||
|
||||
|
||||
#include "anim/animplay.h"
|
||||
#include "globalincs/linklist.h"
|
||||
@@ -1007,12 +734,12 @@ anim *anim_load(char *real_filename, int cf_dir_type, int file_mapped)
|
||||
|
||||
Assert ( real_filename != NULL );
|
||||
|
||||
strcpy( name, real_filename );
|
||||
strcpy_s( name, real_filename );
|
||||
char *p = strchr( name, '.' );
|
||||
if ( p ) {
|
||||
*p = 0;
|
||||
}
|
||||
strcat( name, ".ani" );
|
||||
strcat_s( name, ".ani" );
|
||||
|
||||
ptr = first_anim;
|
||||
while (ptr) {
|
||||
@@ -1034,7 +761,7 @@ anim *anim_load(char *real_filename, int cf_dir_type, int file_mapped)
|
||||
ptr->next = first_anim;
|
||||
first_anim = ptr;
|
||||
Assert(strlen(name) < _MAX_PATH - 1);
|
||||
strcpy(ptr->name, name);
|
||||
strcpy_s(ptr->name, name);
|
||||
ptr->instance_count = 0;
|
||||
ptr->width = 0;
|
||||
ptr->height = 0;
|
||||
@@ -1242,7 +969,7 @@ int anim_write_frames_out(char *filename)
|
||||
int i,j;
|
||||
ubyte **row_data;
|
||||
|
||||
strcpy(root_name, filename);
|
||||
strcpy_s(root_name, filename);
|
||||
root_name[strlen(filename)-4] = 0;
|
||||
|
||||
source_anim = anim_load(filename);
|
||||
@@ -1255,9 +982,9 @@ int anim_write_frames_out(char *filename)
|
||||
|
||||
for ( i = 0; i < source_anim->total_frames; i++ ) {
|
||||
anim_get_next_raw_buffer(ai, 0, 0, 16);
|
||||
strcpy(pcxname, root_name);
|
||||
strcpy_s(pcxname, root_name);
|
||||
sprintf(buf,"%04d",i);
|
||||
strcat(pcxname, buf);
|
||||
strcat_s(pcxname, buf);
|
||||
|
||||
for ( j = 0; j < source_anim->height; j++ ) {
|
||||
row_data[j] = &ai->frame[j*source_anim->width];
|
||||
@@ -1292,12 +1019,12 @@ void anim_display_info(char *real_filename)
|
||||
int i, uncompressed, compressed, *key_frame_nums=NULL, tmp;
|
||||
char filename[MAX_FILENAME_LEN];
|
||||
|
||||
strcpy( filename, real_filename );
|
||||
strcpy_s( filename, real_filename );
|
||||
char *p = strchr( filename, '.' );
|
||||
if ( p ) {
|
||||
*p = 0;
|
||||
}
|
||||
strcat( filename, ".ani" );
|
||||
strcat_s( filename, ".ani" );
|
||||
|
||||
fp = cfopen(filename, "rb");
|
||||
if ( !fp ) {
|
||||
@@ -1358,11 +1085,9 @@ void anim_reverse_direction(anim_instance *ai)
|
||||
{
|
||||
int temp;
|
||||
|
||||
if(!(ai->parent->flags & ANF_ALL_KEYFRAMES)){
|
||||
// you're not allowed to call anim_reverse_direction(...) unless every frame is a keyframe!!!!
|
||||
// The God of Delta-RLE demands it be thus.
|
||||
Int3();
|
||||
}
|
||||
// you're not allowed to call anim_reverse_direction(...) unless every frame is a keyframe!!!!
|
||||
// The God of Delta-RLE demands it be thus.
|
||||
Assertion( ai->parent->flags & ANF_ALL_KEYFRAMES, "Ani was set to play backwards. In order to enable this, all frames of the animation MUST be keyframes.");
|
||||
|
||||
// flip the animation direction
|
||||
if(ai->direction == ANIM_DIRECT_FORWARD){
|
||||
|
||||
+1
-114
@@ -7,120 +7,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Anim/AnimPlay.h $
|
||||
* $Revision: 2.6.2.1 $
|
||||
* $Date: 2006-09-08 06:14:43 $
|
||||
* $Author: taylor $
|
||||
*
|
||||
* Header file for playing back anim files
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.6 2005/07/13 02:50:48 Goober5000
|
||||
* remove PreProcDefine #includes in FS2
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.5 2005/04/05 05:53:14 taylor
|
||||
* s/vector/vec3d/g, better support for different compilers (Jens Granseuer)
|
||||
*
|
||||
* Revision 2.4 2004/08/11 05:06:18 Kazan
|
||||
* added preprocdefines.h to prevent what happened with fred -- make sure to make all fred2 headers include this file as the _first_ include -- i have already modified fs2 files to do this
|
||||
*
|
||||
* Revision 2.3 2003/12/08 22:30:02 randomtiger
|
||||
* Put render state and other direct D3D calls repetition check back in, provides speed boost.
|
||||
* Fixed bug that caused fullscreen only crash with DXT textures
|
||||
* Put dithering back in for tgas and jpgs
|
||||
*
|
||||
* Revision 2.2 2003/11/11 02:15:41 Goober5000
|
||||
* ubercommit - basically spelling and language fixes with some additional
|
||||
* warnings disabled
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.1 2002/08/01 01:41:04 penguin
|
||||
* The big include file move
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:21 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
* Revision 1.2 2002/05/03 22:07:07 mharris
|
||||
* got some stuff to compile
|
||||
*
|
||||
* Revision 1.1 2002/05/02 18:03:04 mharris
|
||||
* Initial checkin - converted filenames and includes to lower case
|
||||
*
|
||||
*
|
||||
* 3 10/22/98 6:14p Dave
|
||||
* Optimized some #includes in Anim folder. Put in the beginnings of
|
||||
* parse/localization support for externalized strings and tstrings.tbl
|
||||
*
|
||||
* 2 10/07/98 10:52a Dave
|
||||
* Initial checkin.
|
||||
*
|
||||
* 1 10/07/98 10:48a Dave
|
||||
*
|
||||
* 11 5/07/98 3:11a Lawrance
|
||||
* Implement custom streaming code
|
||||
*
|
||||
* 10 4/27/98 3:36p Dave
|
||||
*
|
||||
* 9 3/25/98 8:43p Hoffoss
|
||||
* Changed anim_play() to not be so complex when you try and call it.
|
||||
*
|
||||
* 8 12/24/97 8:57p Lawrance
|
||||
* Added anim_ignore_next_frametime()
|
||||
*
|
||||
* 7 11/19/97 8:28p Dave
|
||||
* Hooked in Main Hall screen. Put in Anim support for ping ponging
|
||||
* animations as well as general reversal of anim direction.
|
||||
*
|
||||
* 6 8/30/97 2:11p Lawrance
|
||||
* allow animations to loop
|
||||
*
|
||||
* 5 8/25/97 11:13p Lawrance
|
||||
* support framerate independent playback with the option of now advancing
|
||||
* more than one frame at a time
|
||||
*
|
||||
* 4 7/21/97 11:41a Lawrance
|
||||
* make playback time of .ani files keyed of frametime
|
||||
*
|
||||
* 3 7/20/97 6:57p Lawrance
|
||||
* supporting new RLE format
|
||||
*
|
||||
* 2 6/26/97 12:12a Lawrance
|
||||
* supporting anti-aliased bitmap animations
|
||||
*
|
||||
* 1 6/23/97 5:09p Lawrance
|
||||
*
|
||||
* 10 5/19/97 2:28p Lawrance
|
||||
* changes some variables to flags
|
||||
*
|
||||
* 9 5/15/97 5:58p Lawrance
|
||||
* fix some bugs that were present with animations when playing multiple
|
||||
* missions
|
||||
*
|
||||
* 8 5/15/97 4:42p Lawrance
|
||||
* suporting anims in-game
|
||||
*
|
||||
* 7 5/15/97 11:46a Lawrance
|
||||
* add function to check if an anim is playing
|
||||
*
|
||||
* 6 2/28/97 12:17p Lawrance
|
||||
* supporting mapping file to memory
|
||||
*
|
||||
* 5 2/25/97 11:06a Lawrance
|
||||
* moved some higher level functions to from PackUnpack to AnimPlay
|
||||
*
|
||||
* 4 2/19/97 9:27p Lawrance
|
||||
* added pause capability to anim playback
|
||||
*
|
||||
* 3 2/17/97 4:19p Lawrance
|
||||
* using frame numbers instead of percentages for accessing keyframes
|
||||
*
|
||||
* 2 2/17/97 3:01p Lawrance
|
||||
* code for playing back an anim
|
||||
*
|
||||
* $NoKeywords: $
|
||||
*/
|
||||
|
||||
|
||||
#ifndef __ANIMPLAY_H__
|
||||
#define __ANIMPLAY_H__
|
||||
|
||||
+2
-363
@@ -7,220 +7,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Anim/PackUnpack.cpp $
|
||||
* $Revision: 2.13.2.2 $
|
||||
* $Date: 2007-10-28 16:32:06 $
|
||||
* $Author: taylor $
|
||||
*
|
||||
* Code for handling packing and unpacking in Hoffoss's RLE format, used for
|
||||
* Anim files. Also handles Anim loading, creating Anim instances (for
|
||||
* utilizing an Anim), and getting getting frames of the Anim.
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.13.2.1 2006/06/22 14:59:44 taylor
|
||||
* fix various things that Valgrind has been complaining about
|
||||
*
|
||||
* Revision 2.13 2006/03/21 00:27:27 taylor
|
||||
* some minor cleanup
|
||||
*
|
||||
* Revision 2.12 2006/01/22 19:57:35 wmcoolmon
|
||||
* 0...1...2...4?
|
||||
*
|
||||
* Revision 2.11 2005/11/13 06:40:19 taylor
|
||||
* add support for 8/16/24/32 bit output from ani frame decoder
|
||||
*
|
||||
* Revision 2.10 2005/05/24 03:13:36 taylor
|
||||
* extra check to make sure that RLE reading never goes over frame size in new ANI formats
|
||||
*
|
||||
* Revision 2.9 2005/05/23 05:58:31 taylor
|
||||
* quick catch for some corrupted anis, only a partial fix but it will do until something
|
||||
* a bit more heavy duty comes along in the near future
|
||||
*
|
||||
* Revision 2.8 2005/05/12 17:49:10 taylor
|
||||
* use vm_malloc(), vm_free(), vm_realloc(), vm_strdup() rather than system named macros
|
||||
* fixes various problems and is past time to make the switch
|
||||
*
|
||||
* Revision 2.7 2004/07/26 20:47:23 Kazan
|
||||
* remove MCD complete
|
||||
*
|
||||
* Revision 2.6 2004/07/12 16:32:41 Kazan
|
||||
* MCD - define _MCD_CHECK to use memory tracking
|
||||
*
|
||||
* Revision 2.5 2004/03/05 09:01:53 Goober5000
|
||||
* Uber pass at reducing #includes
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.4 2004/02/14 00:18:29 randomtiger
|
||||
* Please note that from now on OGL will only run with a registry set by Launcher v4. See forum for details.
|
||||
* OK, these changes effect a lot of file, I suggest everyone updates ASAP:
|
||||
* Removal of many files from project.
|
||||
* Removal of meanless Gr_bitmap_poly variable.
|
||||
* Removal of glide, directdraw, software modules all links to them, and all code specific to those paths.
|
||||
* Removal of redundant Fred paths that arent needed for Fred OGL.
|
||||
* Have seriously tidied the graphics initialisation code and added generic non standard mode functionality.
|
||||
* Fixed many D3D non standard mode bugs and brought OGL up to the same level.
|
||||
* Removed texture section support for D3D8, voodoo 2 and 3 cards will no longer run under fs2_open in D3D, same goes for any card with a maximum texture size less than 1024.
|
||||
*
|
||||
* Revision 2.3 2003/10/24 17:35:04 randomtiger
|
||||
* Implemented support for 32bit TGA and JPG for D3D
|
||||
* Also 32 bit PCX, but it still has some bugs to be worked out
|
||||
* Moved convert_24_to_16 out of the bitmap pfunction structures and into packunpack.cpp because thats the only place that uses it.
|
||||
*
|
||||
* Revision 2.2 2003/03/18 10:07:00 unknownplayer
|
||||
* The big DX/main line merge. This has been uploaded to the main CVS since I can't manage to get it to upload to the DX branch. Apologies to all who may be affected adversely, but I'll work to debug it as fast as I can.
|
||||
*
|
||||
* Revision 2.1.2.1 2002/11/04 03:02:27 randomtiger
|
||||
*
|
||||
* I have made some fairly drastic changes to the bumpman system. Now functionality can be engine dependant.
|
||||
* This is so D3D8 can call its own loading code that will allow good efficient loading and use of textures that it desparately needs without
|
||||
* turning bumpman.cpp into a total hook infested nightmare. Note the new bumpman code is still relying on a few of the of the old functions and all of the old bumpman arrays.
|
||||
*
|
||||
* I have done this by adding to the gr_screen list of function pointers that are set up by the engines init functions.
|
||||
* I have named the define calls the same name as the original 'bm_' functions so that I havent had to change names all through the code.
|
||||
*
|
||||
* Rolled back to an old version of bumpman and made a few changes.
|
||||
* Added new files: grd3dbumpman.cpp and .h
|
||||
* Moved the bitmap init function to after the 3D engine is initialised
|
||||
* Added includes where needed
|
||||
* Disabled (for now) the D3D8 TGA loading - RT
|
||||
*
|
||||
* Revision 2.1 2002/08/01 01:41:04 penguin
|
||||
* The big include file move
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:21 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
* Revision 1.1 2002/05/02 18:03:04 mharris
|
||||
* Initial checkin - converted filenames and includes to lower case
|
||||
*
|
||||
*
|
||||
* 12 7/30/99 10:10p Dave
|
||||
* Fixed loading bar in 32 bit mode.
|
||||
*
|
||||
* 11 7/18/99 1:59p Johnson
|
||||
* Fixed potential anim locking problem.
|
||||
*
|
||||
* 10 7/16/99 1:49p Dave
|
||||
* 8 bit aabitmaps. yay.
|
||||
*
|
||||
* 9 7/13/99 1:15p Dave
|
||||
* 32 bit support. Whee!
|
||||
*
|
||||
* 8 4/09/99 2:21p Dave
|
||||
* Multiplayer beta stuff. CD checking.
|
||||
*
|
||||
* 7 1/14/99 12:48a Dave
|
||||
* Todo list bug fixes. Made a pass at putting briefing icons back into
|
||||
* FRED. Sort of works :(
|
||||
*
|
||||
* 6 12/01/98 5:53p Dave
|
||||
* Simplified the way pixel data is swizzled. Fixed tga bitmaps to work
|
||||
* properly in D3D and Glide.
|
||||
*
|
||||
* 5 12/01/98 8:06a Dave
|
||||
* Temporary checkin to fix some texture transparency problems in d3d.
|
||||
*
|
||||
* 4 11/30/98 1:07p Dave
|
||||
* 16 bit conversion, first run.
|
||||
*
|
||||
* 3 10/22/98 6:14p Dave
|
||||
* Optimized some #includes in Anim folder. Put in the beginnings of
|
||||
* parse/localization support for externalized strings and tstrings.tbl
|
||||
*
|
||||
* 2 10/07/98 10:52a Dave
|
||||
* Initial checkin.
|
||||
*
|
||||
* 1 10/07/98 10:48a Dave
|
||||
*
|
||||
* 30 5/14/98 3:38p John
|
||||
* Added in more non-darkening colors for Adam. Had to fix some bugs in
|
||||
* BmpMan and Ani stuff to get this to work.
|
||||
*
|
||||
* 29 5/07/98 3:11a Lawrance
|
||||
* Implement custom streaming code
|
||||
*
|
||||
* 28 11/19/97 8:28p Dave
|
||||
* Hooked in Main Hall screen. Put in Anim support for ping ponging
|
||||
* animations as well as general reversal of anim direction.
|
||||
*
|
||||
* 27 9/09/97 3:39p Sandeep
|
||||
* warning level 4 bugs
|
||||
*
|
||||
* 26 8/22/97 8:21a Lawrance
|
||||
* short circuit key frame check if keyframe matches frame we are
|
||||
* searching for
|
||||
*
|
||||
* 25 8/21/97 5:11p Lawrance
|
||||
* frame numbering for ANI's now is from 0 -> total_frames-1.
|
||||
*
|
||||
* 24 8/19/97 10:59a Lawrance
|
||||
* fix problem with accessing key frames
|
||||
*
|
||||
* 23 7/28/97 10:42p Lawrance
|
||||
* re-did interface to unpack_frame() to make more general
|
||||
*
|
||||
* 22 7/28/97 10:52a Lawrance
|
||||
* correctly set bitmap flags in anim_get_frame()
|
||||
*
|
||||
* 21 7/21/97 5:10p Lawrance
|
||||
* fix problem that was causing infinite recursion
|
||||
*
|
||||
* 20 7/20/97 6:57p Lawrance
|
||||
* supporting new RLE format
|
||||
*
|
||||
* 19 6/27/97 4:36p Lawrance
|
||||
* update pal translation table when gr_screen.signature changes
|
||||
*
|
||||
* 18 6/26/97 12:12a Lawrance
|
||||
* supporting anti-aliased bitmap animations
|
||||
*
|
||||
* 17 6/25/97 3:03p Lawrance
|
||||
* fix palette translation problem with anti-alised bitmaps
|
||||
*
|
||||
* 16 5/19/97 2:28p Lawrance
|
||||
* changes some variables to flags
|
||||
*
|
||||
* 15 5/15/97 4:42p Lawrance
|
||||
* supporting animations in-game
|
||||
*
|
||||
* 14 2/25/97 11:06a Lawrance
|
||||
* moved some higher level functions to from PackUnpack to AnimPlay
|
||||
*
|
||||
* 13 2/19/97 9:51p Lawrance
|
||||
* made keyframe decompression more effecient, moved
|
||||
* default anim FPS to header file
|
||||
*
|
||||
* 12 2/19/97 4:00p Lawrance
|
||||
* don't assert when cannot find anim filename, return a NULL instead
|
||||
*
|
||||
* 11 2/17/97 4:17p Hoffoss
|
||||
* modified packing internal format and added random access function to an
|
||||
* Anim frame.
|
||||
*
|
||||
* 10 2/17/97 2:59p Lawrance
|
||||
* integrating into game
|
||||
*
|
||||
* 9 2/14/97 11:27p Lawrance
|
||||
* optimized unpacking some more (Jason)
|
||||
*
|
||||
* 8 2/14/97 11:09p Hoffoss
|
||||
* Made optimizations.
|
||||
*
|
||||
* 7 2/14/97 10:48p Hoffoss
|
||||
* fixed bug.
|
||||
*
|
||||
* 6 2/14/97 10:38p Lawrance
|
||||
* fixing bugs
|
||||
*
|
||||
* 5 2/14/97 5:38p Hoffoss
|
||||
* Changes to get AnimCoverter project to compile and link.
|
||||
*
|
||||
* 4 2/14/97 3:29p Hoffoss
|
||||
* Added header for MSDEV to fill in.
|
||||
*
|
||||
* $NoKeywords: $
|
||||
*/
|
||||
|
||||
|
||||
#include "anim/packunpack.h"
|
||||
#include "bmpman/bmpman.h"
|
||||
@@ -381,154 +168,6 @@ ubyte *anim_get_next_raw_buffer(anim_instance *inst, int xlate_pal, int aabitmap
|
||||
return inst->frame;
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
// anim_get_frame()
|
||||
//
|
||||
// Get a bitmap id from the anim_instance for the specified frame_num
|
||||
//
|
||||
// input: *inst => pointer to anim instance
|
||||
// frame_num => frame number to get (first frame is 0)
|
||||
// xlate_pal => DEFAULT PARM (value 1): whether to translate the palette
|
||||
// to the current game palette
|
||||
//
|
||||
int anim_get_frame(anim_instance *inst, int frame_num, int xlate_pal)
|
||||
{
|
||||
/*
|
||||
int bm, bitmap_flags, key = 0, offset = 0;
|
||||
int idx;
|
||||
|
||||
if ((frame_num < 0) || (frame_num >= inst->parent->total_frames)) // illegal frame number
|
||||
return -1;
|
||||
|
||||
int need_reset = 0;
|
||||
if ( anim_instance_is_streamed(inst) ) {
|
||||
if ( inst->file_offset < 0 ) {
|
||||
need_reset = 1;
|
||||
}
|
||||
} else {
|
||||
if ( !inst->data ) {
|
||||
need_reset = 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (need_reset || (inst->frame_num >= inst->parent->total_frames)) { // reset to valid info
|
||||
inst->data = inst->parent->data;
|
||||
inst->file_offset = inst->parent->file_offset;
|
||||
inst->frame_num = 0;
|
||||
}
|
||||
|
||||
bitmap_flags = 0;
|
||||
if (inst->parent->flags & ANF_XPARENT) {
|
||||
// bitmap_flags = BMP_XPARENT;
|
||||
bitmap_flags = 0;
|
||||
}
|
||||
|
||||
if ( inst->frame_num == frame_num ) {
|
||||
bm = bm_create(16, inst->parent->width, inst->parent->height, inst->frame, bitmap_flags);
|
||||
bm_unload(bm);
|
||||
return bm;
|
||||
}
|
||||
|
||||
if (inst->parent->flags & ANF_XPARENT){
|
||||
// bitmap_flags = BMP_XPARENT;
|
||||
bitmap_flags = 0;
|
||||
} else {
|
||||
bitmap_flags = 0;
|
||||
}
|
||||
|
||||
idx = 0;
|
||||
key = 0;
|
||||
while(idx < inst->parent->num_keys){
|
||||
if (( (inst->parent->keys[idx].frame_num-1) <= frame_num) && ( (inst->parent->keys[idx].frame_num-1) > key)) { // find closest key
|
||||
key = inst->parent->keys[idx].frame_num - 1;
|
||||
offset = inst->parent->keys[idx].offset;
|
||||
|
||||
if ( key == frame_num )
|
||||
break;
|
||||
}
|
||||
idx++;
|
||||
}
|
||||
|
||||
if ( key == frame_num ) {
|
||||
inst->frame_num = key;
|
||||
|
||||
if ( anim_instance_is_streamed(inst) ) {
|
||||
inst->file_offset = inst->parent->file_offset + offset;
|
||||
} else {
|
||||
inst->data = inst->parent->data + offset;
|
||||
}
|
||||
|
||||
anim_check_for_palette_change(inst);
|
||||
|
||||
if ( anim_instance_is_streamed(inst) ) {
|
||||
if ( xlate_pal ){
|
||||
inst->file_offset = unpack_frame_from_file(inst, inst->frame, inst->parent->width*inst->parent->height, inst->parent->palette_translation);
|
||||
} else {
|
||||
inst->file_offset = unpack_frame_from_file(inst, inst->frame, inst->parent->width*inst->parent->height, NULL);
|
||||
}
|
||||
} else {
|
||||
if ( xlate_pal ){
|
||||
inst->data = unpack_frame(inst, inst->data, inst->frame, inst->parent->width*inst->parent->height, inst->parent->palette_translation);
|
||||
} else {
|
||||
inst->data = unpack_frame(inst, inst->data, inst->frame, inst->parent->width*inst->parent->height, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
goto create_bitmap;
|
||||
}
|
||||
|
||||
if (key > inst->frame_num) // best key is closer than current position
|
||||
{
|
||||
inst->frame_num = key;
|
||||
|
||||
if ( anim_instance_is_streamed(inst) ) {
|
||||
inst->file_offset = inst->parent->file_offset + offset;
|
||||
} else {
|
||||
inst->data = inst->parent->data + offset;
|
||||
}
|
||||
|
||||
anim_check_for_palette_change(inst);
|
||||
|
||||
if ( anim_instance_is_streamed(inst) ) {
|
||||
if ( xlate_pal )
|
||||
inst->file_offset = unpack_frame_from_file(inst, inst->frame, inst->parent->width*inst->parent->height, inst->parent->palette_translation);
|
||||
else
|
||||
inst->file_offset = unpack_frame_from_file(inst, inst->frame, inst->parent->width*inst->parent->height, NULL);
|
||||
} else {
|
||||
if ( xlate_pal )
|
||||
inst->data = unpack_frame(inst, inst->data, inst->frame, inst->parent->width*inst->parent->height, inst->parent->palette_translation);
|
||||
else
|
||||
inst->data = unpack_frame(inst, inst->data, inst->frame, inst->parent->width*inst->parent->height, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
while (inst->frame_num != frame_num) {
|
||||
anim_check_for_palette_change(inst);
|
||||
|
||||
if ( anim_instance_is_streamed(inst) ) {
|
||||
if ( xlate_pal )
|
||||
inst->file_offset = unpack_frame_from_file(inst, inst->frame, inst->parent->width*inst->parent->height, inst->parent->palette_translation);
|
||||
else
|
||||
inst->file_offset = unpack_frame_from_file(inst, inst->frame, inst->parent->width*inst->parent->height, NULL);
|
||||
} else {
|
||||
if ( xlate_pal )
|
||||
inst->data = unpack_frame(inst, inst->data, inst->frame, inst->parent->width*inst->parent->height, inst->parent->palette_translation);
|
||||
else
|
||||
inst->data = unpack_frame(inst, inst->data, inst->frame, inst->parent->width*inst->parent->height, NULL);
|
||||
}
|
||||
inst->frame_num++;
|
||||
}
|
||||
|
||||
create_bitmap:
|
||||
|
||||
bm = bm_create(16, inst->parent->width, inst->parent->height, inst->frame, bitmap_flags);
|
||||
bm_unload(bm);
|
||||
return bm;
|
||||
*/
|
||||
Int3();
|
||||
return -1;
|
||||
}
|
||||
|
||||
// frame = frame pixel data to pack
|
||||
// save = memory to store packed data to
|
||||
// size = number of bytes to pack
|
||||
@@ -1386,7 +1025,7 @@ int unpack_frame_from_file(anim_instance *ai, ubyte *frame, int size, ubyte *pal
|
||||
}
|
||||
}
|
||||
else {
|
||||
// Int3(); // unknown packing method
|
||||
// unknown packing method
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
+1
-158
@@ -7,163 +7,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Anim/PackUnpack.h $
|
||||
* $Revision: 2.6 $
|
||||
* $Date: 2006-03-21 00:27:27 $
|
||||
* $Author: taylor $
|
||||
*
|
||||
* Code for handling packing and unpacking in Hoffoss's RLE format, used for
|
||||
* Anim files. Also handles Anim loading, creating Anim instances (for
|
||||
* utilizing an Anim), and getting getting frames of the Anim.
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.5 2005/07/13 02:50:48 Goober5000
|
||||
* remove PreProcDefine #includes in FS2
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.4 2005/04/05 05:53:14 taylor
|
||||
* s/vector/vec3d/g, better support for different compilers (Jens Granseuer)
|
||||
*
|
||||
* Revision 2.3 2004/08/11 05:06:18 Kazan
|
||||
* added preprocdefines.h to prevent what happened with fred -- make sure to make all fred2 headers include this file as the _first_ include -- i have already modified fs2 files to do this
|
||||
*
|
||||
* Revision 2.2 2004/03/05 09:01:53 Goober5000
|
||||
* Uber pass at reducing #includes
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.1 2002/08/01 01:41:04 penguin
|
||||
* The big include file move
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:21 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
* Revision 1.2 2002/05/03 22:07:07 mharris
|
||||
* got some stuff to compile
|
||||
*
|
||||
* Revision 1.1 2002/05/02 18:03:04 mharris
|
||||
* Initial checkin - converted filenames and includes to lower case
|
||||
*
|
||||
*
|
||||
* 7 7/16/99 1:49p Dave
|
||||
* 8 bit aabitmaps. yay.
|
||||
*
|
||||
* 6 1/14/99 12:48a Dave
|
||||
* Todo list bug fixes. Made a pass at putting briefing icons back into
|
||||
* FRED. Sort of works :(
|
||||
*
|
||||
* 5 11/30/98 1:07p Dave
|
||||
* 16 bit conversion, first run.
|
||||
*
|
||||
* 4 10/22/98 6:14p Dave
|
||||
* Optimized some #includes in Anim folder. Put in the beginnings of
|
||||
* parse/localization support for externalized strings and tstrings.tbl
|
||||
*
|
||||
* 3 10/16/98 3:42p Andsager
|
||||
* increase MAX_WEAPONS and MAX_SHIPS and som header files
|
||||
*
|
||||
* 2 10/07/98 10:52a Dave
|
||||
* Initial checkin.
|
||||
*
|
||||
* 1 10/07/98 10:48a Dave
|
||||
*
|
||||
* 32 5/18/98 5:59p Hoffoss
|
||||
* Made command briefing advanced now once the speech stops and animation
|
||||
* has fully played once, whichever is longer.
|
||||
*
|
||||
* 31 5/07/98 3:11a Lawrance
|
||||
* Implement custom streaming code
|
||||
*
|
||||
* 30 1/14/98 6:43p Lawrance
|
||||
* Add ref_count to anim struct, so we don't free multiple times
|
||||
*
|
||||
* 29 11/19/97 8:28p Dave
|
||||
* Hooked in Main Hall screen. Put in Anim support for ping ponging
|
||||
* animations as well as general reversal of anim direction.
|
||||
*
|
||||
* 28 8/30/97 2:11p Lawrance
|
||||
* allow animations to loop
|
||||
*
|
||||
* 27 8/25/97 11:13p Lawrance
|
||||
* support framerate independent playback with the option of now advancing
|
||||
* more than one frame at a time
|
||||
*
|
||||
* 26 8/21/97 5:11p Lawrance
|
||||
* frame numbering for ANI's now is from 0 -> total_frames-1.
|
||||
*
|
||||
* 25 7/28/97 10:42p Lawrance
|
||||
* re-did interface to unpack_frame() to make more general
|
||||
*
|
||||
* 24 7/21/97 11:41a Lawrance
|
||||
* make playback time of .ani files keyed of frametime
|
||||
*
|
||||
* 23 7/20/97 6:57p Lawrance
|
||||
* supporting new RLE format
|
||||
*
|
||||
* 22 6/27/97 4:36p Lawrance
|
||||
* update pal translation table when gr_screen.signature changes
|
||||
*
|
||||
* 21 6/26/97 12:12a Lawrance
|
||||
* supporting anti-aliased bitmap animations
|
||||
*
|
||||
* 20 6/25/97 3:03p Lawrance
|
||||
* fix palette translation problem with anti-alised bitmaps
|
||||
*
|
||||
* 19 5/27/97 3:48p Lawrance
|
||||
* don't re-create a bitmap if using the same frame of animation
|
||||
*
|
||||
* 18 5/21/97 11:06a Lawrance
|
||||
* enabling a user-defined transparent value
|
||||
*
|
||||
* 17 5/19/97 3:21p Lawrance
|
||||
* add fps parm, version num to anim header
|
||||
*
|
||||
* 16 5/19/97 2:28p Lawrance
|
||||
* changes some variables to flags
|
||||
*
|
||||
* 15 5/15/97 4:42p Lawrance
|
||||
* supporting animations in-game
|
||||
*
|
||||
* 14 3/01/97 2:08p Lawrance
|
||||
* not using windows.h, since memory mapping details moved to cfile
|
||||
*
|
||||
* 13 2/28/97 12:17p Lawrance
|
||||
* supporting mapping file to memory
|
||||
*
|
||||
* 12 2/25/97 11:06a Lawrance
|
||||
* moved some higher level functions to from PackUnpack to AnimPlay
|
||||
*
|
||||
* 11 2/19/97 9:51p Lawrance
|
||||
* made keyframe decompression more effecient, moved
|
||||
* default anim FPS to header file
|
||||
*
|
||||
* 10 2/19/97 4:01p Lawrance
|
||||
* load_anim returns int, not void
|
||||
*
|
||||
* 9 2/17/97 4:19p Lawrance
|
||||
* changed stop and start to be actual frame numbers, not percentages
|
||||
*
|
||||
* 8 2/17/97 4:17p Hoffoss
|
||||
* modified packing internal format and added random access function to an
|
||||
* Anim frame.
|
||||
*
|
||||
* 7 2/17/97 2:59p Lawrance
|
||||
* integrating into game
|
||||
*
|
||||
* 6 2/14/97 11:09p Hoffoss
|
||||
* Made optimizations.
|
||||
*
|
||||
* 5 2/14/97 10:48p Hoffoss
|
||||
* fixed bug.
|
||||
*
|
||||
* 4 2/14/97 10:38p Lawrance
|
||||
* fixing bugs
|
||||
*
|
||||
* 3 2/14/97 3:29p Hoffoss
|
||||
* Added header for MSDEV to fill in.
|
||||
*
|
||||
* $NoKeywords: $
|
||||
*/
|
||||
|
||||
|
||||
#ifndef __PACKUNPACK_H__
|
||||
#define __PACKUNPACK_H__
|
||||
@@ -262,7 +106,6 @@ void anim_init();
|
||||
anim_instance *init_anim_instance(anim *ptr, int bpp);
|
||||
void free_anim_instance(anim_instance *inst);
|
||||
int anim_get_next_frame(anim_instance *inst);
|
||||
int anim_get_frame(anim_instance *inst, int frame_num, int xlate_pal=1);
|
||||
ubyte *anim_get_next_raw_buffer(anim_instance *inst, int xlate_pal, int aabitmap, int bpp);
|
||||
void anim_set_palette(anim *a);
|
||||
void anim_check_for_palette_change(anim_instance *inst);
|
||||
|
||||
+8
-428
@@ -7,426 +7,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Asteroid/Asteroid.cpp $
|
||||
* $Revision: 2.35.2.12 $
|
||||
* $Date: 2007-12-28 02:10:34 $
|
||||
* $Author: Backslash $
|
||||
*
|
||||
* C module for asteroid code
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.35.2.11 2007/09/02 02:07:38 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 2.35.2.10 2007/05/28 18:27:32 wmcoolmon
|
||||
* Added armor support for asteroid, debris, ship, and beam damage
|
||||
*
|
||||
* Revision 2.35.2.9 2007/02/20 04:19:09 Goober5000
|
||||
* the great big duplicate model removal commit
|
||||
*
|
||||
* Revision 2.35.2.8 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 2.35.2.7 2006/12/07 17:53:08 taylor
|
||||
* a little clean up for bits of code that isn't used
|
||||
*
|
||||
* Revision 2.35.2.6 2006/11/15 00:36:08 taylor
|
||||
* various bits of little cleanup
|
||||
* get rid of some more compiler warnings
|
||||
*
|
||||
* Revision 2.35.2.5 2006/09/11 01:15:03 taylor
|
||||
* fixes for stuff_string() bounds checking
|
||||
*
|
||||
* Revision 2.35.2.4 2006/08/27 18:12:38 taylor
|
||||
* make Species_info[] and Asteroid_info[] dynamic
|
||||
*
|
||||
* Revision 2.35.2.3 2006/08/19 04:38:46 taylor
|
||||
* maybe optimize the (PI/2), (PI*2) and (RAND_MAX/2) stuff a little bit
|
||||
*
|
||||
* Revision 2.35.2.2 2006/07/06 04:06:00 Goober5000
|
||||
* 1) complete (almost) changeover to reorganized texture mapping system
|
||||
* 2) finally fix texture animation; textures now animate at the correct speed
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.35.2.1 2006/07/04 07:42:09 Goober5000
|
||||
* --in preparation for fixing an annoying animated texture bug, reorganize the various texture structs and glow point structs and clarify several parts of the texture code :P
|
||||
* --this breaks animated glow maps, and animated regular maps still aren't fixed, but these will be remedied shortly
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.35 2006/05/13 07:02:27 taylor
|
||||
* add lazy (ie, faster) checking of asteroid collisions for time-to-impact
|
||||
*
|
||||
* Revision 2.34 2006/01/26 03:23:29 Goober5000
|
||||
* pare down the pragmas some more
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.33 2006/01/13 03:30:59 Goober5000
|
||||
* übercommit of custom IFF stuff :)
|
||||
*
|
||||
* Revision 2.32 2005/11/21 02:43:30 Goober5000
|
||||
* change from "setting" to "profile"; this way makes more sense
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.31 2005/11/21 00:46:05 Goober5000
|
||||
* add ai_settings.tbl
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.30 2005/10/11 12:24:04 taylor
|
||||
* little cleaner since the two sets weren't needed
|
||||
*
|
||||
* Revision 2.29 2005/10/10 17:21:03 taylor
|
||||
* remove NO_NETWORK
|
||||
*
|
||||
* Revision 2.28 2005/10/08 15:37:26 taylor
|
||||
* fix several asteroid problems, little code duplication but this actually works and is less error prone than the previous method
|
||||
*
|
||||
* Revision 2.27 2005/09/25 22:29:35 Kazan
|
||||
* my bad
|
||||
*
|
||||
* Revision 2.26 2005/09/25 22:23:39 Kazan
|
||||
* correct an error
|
||||
*
|
||||
* Revision 2.25 2005/09/25 20:55:28 Goober5000
|
||||
* oh noes!
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.24 2005/09/25 20:31:42 Goober5000
|
||||
* okay; everything should be good to go
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.23 2005/09/25 08:25:14 Goober5000
|
||||
* Okay, everything should now work again. :p Still have to do a little more with the asteroids.
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.20 2005/07/22 10:18:36 Goober5000
|
||||
* CVS header tweaks
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.19 2005/07/13 02:50:48 Goober5000
|
||||
* remove PreProcDefine #includes in FS2
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.18 2005/07/13 02:01:28 Goober5000
|
||||
* fixed a bunch of "issues" caused by me with the species stuff
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.17 2005/07/13 00:44:20 Goober5000
|
||||
* improved species support and removed need for #define
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.16 2005/06/01 09:34:59 taylor
|
||||
* newline fix
|
||||
*
|
||||
* Revision 2.15 2005/04/28 05:29:28 wmcoolmon
|
||||
* Removed FS2_DEMO defines that looked like they wouldn't cause the universe to collapse
|
||||
*
|
||||
* Revision 2.14 2005/04/28 01:32:57 wmcoolmon
|
||||
* Switch stuff_string_white to stuff_string (I don't see why _white was used in the first place)
|
||||
*
|
||||
* Revision 2.13 2005/04/15 11:41:28 taylor
|
||||
* stupid <expletive-delete> terminal, I <expletive-deleted> <expletive-deleted>!!!
|
||||
*
|
||||
* Revision 2.12 2005/04/15 11:36:55 taylor
|
||||
* new GCC = new warning messages, yippeeee!!
|
||||
*
|
||||
* Revision 2.11 2005/04/05 05:53:14 taylor
|
||||
* s/vector/vec3d/g, better support for different compilers (Jens Granseuer)
|
||||
*
|
||||
* Revision 2.10 2005/03/02 21:24:43 taylor
|
||||
* more network/inferno goodness for Windows, takes care of a few warnings too
|
||||
*
|
||||
* Revision 2.9 2004/07/26 20:47:23 Kazan
|
||||
* remove MCD complete
|
||||
*
|
||||
* Revision 2.8 2004/07/12 16:32:41 Kazan
|
||||
* MCD - define _MCD_CHECK to use memory tracking
|
||||
*
|
||||
* Revision 2.7 2004/03/31 05:42:25 Goober5000
|
||||
* got rid of all those nasty warnings from xlocale and so forth; also added comments
|
||||
* to indicate which warnings were being disabled
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.6 2004/03/05 09:01:53 Goober5000
|
||||
* Uber pass at reducing #includes
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.5 2004/02/14 00:18:29 randomtiger
|
||||
* Please note that from now on OGL will only run with a registry set by Launcher v4. See forum for details.
|
||||
* OK, these changes effect a lot of file, I suggest everyone updates ASAP:
|
||||
* Removal of many files from project.
|
||||
* Removal of meanless Gr_bitmap_poly variable.
|
||||
* Removal of glide, directdraw, software modules all links to them, and all code specific to those paths.
|
||||
* Removal of redundant Fred paths that arent needed for Fred OGL.
|
||||
* Have seriously tidied the graphics initialisation code and added generic non standard mode functionality.
|
||||
* Fixed many D3D non standard mode bugs and brought OGL up to the same level.
|
||||
* Removed texture section support for D3D8, voodoo 2 and 3 cards will no longer run under fs2_open in D3D, same goes for any card with a maximum texture size less than 1024.
|
||||
*
|
||||
* Revision 2.4 2003/11/17 06:52:51 bobboau
|
||||
* got assert to work again
|
||||
*
|
||||
* Revision 2.3 2003/10/15 22:03:23 Kazan
|
||||
* Da Species Update :D
|
||||
*
|
||||
* Revision 2.2 2003/04/29 01:03:22 Goober5000
|
||||
* implemented the custom hitpoints mod
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.1 2002/08/01 01:41:04 penguin
|
||||
* The big include file move
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:21 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
* Revision 1.3 2002/05/10 20:42:43 mharris
|
||||
* use "ifndef NO_NETWORK" all over the place
|
||||
*
|
||||
* Revision 1.2 2002/05/03 22:07:08 mharris
|
||||
* got some stuff to compile
|
||||
*
|
||||
* Revision 1.1 2002/05/02 18:03:04 mharris
|
||||
* Initial checkin - converted filenames and includes to lower case
|
||||
*
|
||||
*
|
||||
* 31 9/08/99 10:52a Mikek
|
||||
* Reduce the number of asteroids that can be thrown at a target at
|
||||
* Medium+.
|
||||
*
|
||||
* 30 9/06/99 12:46a Andsager
|
||||
* Add weapon_explosion_ani LOD
|
||||
*
|
||||
* 29 9/05/99 3:13p Mikek
|
||||
* Slightly decrease number of asteroids thrown at escorted ships.
|
||||
*
|
||||
* 28 8/26/99 8:51p Dave
|
||||
* Gave multiplayer TvT messaging a heavy dose of sanity. Cheat codes.
|
||||
*
|
||||
* 27 7/30/99 7:01p Dave
|
||||
* Dogfight escort gauge. Fixed up laser rendering in Glide.
|
||||
*
|
||||
* 26 7/19/99 8:58p Andsager
|
||||
* Don't try to throw at objnum -1
|
||||
*
|
||||
* 25 7/15/99 9:20a Andsager
|
||||
* FS2_DEMO initial checkin
|
||||
*
|
||||
* 24 7/09/99 5:54p Dave
|
||||
* Seperated cruiser types into individual types. Added tons of new
|
||||
* briefing icons. Campaign screen.
|
||||
*
|
||||
* 23 6/10/99 11:06a Andsager
|
||||
* Mission designed selection of asteroid types.
|
||||
*
|
||||
* 22 6/09/99 2:55p Andsager
|
||||
* Allow multiple asteroid subtypes (of large, medium, small) and follow
|
||||
* family.
|
||||
*
|
||||
* 21 6/08/99 7:19p Dave
|
||||
* Fixed asteroid lighting. Was because on non-darkening textures in Glide
|
||||
* only. Dumb.
|
||||
*
|
||||
* 20 6/07/99 1:18p Andsager
|
||||
* Make asteroids choose consistent texture from large to small. Modify
|
||||
* fireball radius of dying asteroids.
|
||||
*
|
||||
* 19 5/03/99 10:50p Andsager
|
||||
* Make Asteroid_obj_list. Change get_nearest_turret_objnum() to use
|
||||
* Asteroid_obj_list, Ship_obj_list and Missile_obj_list vs.
|
||||
* obj_used_list.
|
||||
*
|
||||
* 18 4/23/99 12:01p Johnson
|
||||
* Added SIF_HUGE_SHIP
|
||||
*
|
||||
* 17 4/21/99 6:15p Dave
|
||||
* Did some serious housecleaning in the beam code. Made it ready to go
|
||||
* for anti-fighter "pulse" weapons. Fixed collision pair creation. Added
|
||||
* a handy macro for recalculating collision pairs for a given object.
|
||||
*
|
||||
* 16 4/16/99 2:34p Andsager
|
||||
* Second pass on debris fields
|
||||
*
|
||||
* 15 4/15/99 5:27p Andsager
|
||||
* Fix explosion sound for Ships debris
|
||||
*
|
||||
* 14 4/15/99 5:00p Andsager
|
||||
* Frist pass on Debris field
|
||||
*
|
||||
* 13 2/07/99 8:51p Andsager
|
||||
* Add inner bound to asteroid field. Inner bound tries to stay astroid
|
||||
* free. Wrap when within and don't throw at ships inside.
|
||||
*
|
||||
* 12 1/20/99 6:04p Dave
|
||||
* Another bit of stuff for beam weapons. Ships will properly use them
|
||||
* now, although they're really deadly.
|
||||
*
|
||||
* 11 1/06/99 2:24p Dave
|
||||
* Stubs and release build fixes.
|
||||
*
|
||||
* 10 12/03/98 3:14p Andsager
|
||||
* Check in code that checks rotating submodel actually has ship subsystem
|
||||
*
|
||||
* 9 11/19/98 11:07p Andsager
|
||||
* Check in of physics and collision detection of rotating submodels
|
||||
*
|
||||
* 8 11/13/98 10:12a Andsager
|
||||
* simplify collision code
|
||||
*
|
||||
* 7 11/05/98 5:55p Dave
|
||||
* Big pass at reducing #includes
|
||||
*
|
||||
* 6 10/23/98 3:51p Dave
|
||||
* Full support for tstrings.tbl and foreign languages. All that remains
|
||||
* is to make it active in Fred.
|
||||
*
|
||||
* 5 10/23/98 1:11p Andsager
|
||||
* Make ship sparks emit correctly from rotating structures.
|
||||
*
|
||||
* 4 10/16/98 1:22p Andsager
|
||||
* clean up header files
|
||||
*
|
||||
* 3 10/13/98 9:28a Dave
|
||||
* Started neatening up freespace.h. Many variables renamed and
|
||||
* reorganized. Added AlphaColors.[h,cpp]
|
||||
*
|
||||
* 2 10/07/98 10:52a Dave
|
||||
* Initial checkin.
|
||||
*
|
||||
* 1 10/07/98 10:48a Dave
|
||||
*
|
||||
* 80 7/14/98 3:30p Dave
|
||||
*
|
||||
* 79 5/18/98 12:05p Mike
|
||||
* Make sm1-06a a little harder.
|
||||
*
|
||||
* 78 5/06/98 12:36p Lawrance
|
||||
* disable ambient asteroid sound for now
|
||||
*
|
||||
* 77 4/30/98 12:49a Allender
|
||||
* deal with asteroid problems in multiplayer
|
||||
*
|
||||
* 76 4/27/98 1:46p Mike
|
||||
* Make asteroid_density have no meaning.
|
||||
*
|
||||
* 75 4/24/98 11:59a Dan
|
||||
* fix bug where a null vector would occur when death_hit_pos was assinged
|
||||
* to asteroid_pos
|
||||
*
|
||||
* 74 4/23/98 4:43p Andsager
|
||||
* Don't call asteroid_update_collide() on creating asteroids since it
|
||||
* creates sets of collisions pairs. Pairs are created when objects are
|
||||
* merged in obj_merge_created_list()
|
||||
*
|
||||
* 73 4/21/98 1:23a Mike
|
||||
* Tone down difficulty in asteroid toss missions.
|
||||
*
|
||||
* 72 4/16/98 11:57a John
|
||||
* Removed debug and unused registry values.
|
||||
*
|
||||
* 71 4/08/98 1:27a Lawrance
|
||||
* Fix typo.
|
||||
*
|
||||
* 70 4/08/98 1:17a Lawrance
|
||||
* Fix bug with red and white brackets being drawn on top of one another.
|
||||
*
|
||||
* 69 4/02/98 6:28p Lawrance
|
||||
* remove asteroid code from demo
|
||||
*
|
||||
* 68 4/02/98 5:11p Mike
|
||||
* Quick out of asteroid code if none present.
|
||||
*
|
||||
* 67 4/02/98 1:34p Mike
|
||||
* Minor difficulty balance, made a bit easier.
|
||||
*
|
||||
* 66 4/02/98 1:29p Andsager
|
||||
*
|
||||
* 65 4/01/98 5:34p John
|
||||
* Made only the used POFs page in for a level. Reduced some interp
|
||||
* arrays. Made custom detail level work differently.
|
||||
*
|
||||
* 64 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.
|
||||
*
|
||||
* 63 3/30/98 4:02p John
|
||||
* Made machines with < 32 MB of RAM use every other frame of certain
|
||||
* bitmaps. Put in code to keep track of how much RAM we've malloc'd.
|
||||
*
|
||||
* 62 3/30/98 2:38p Mike
|
||||
* Add asteroid_density to detail level support.
|
||||
* No force explosion damage in training missions.
|
||||
* Make cargo deathrolls shorter.
|
||||
*
|
||||
* 61 3/30/98 10:07a Lawrance
|
||||
* Um, make asteroids work again.
|
||||
*
|
||||
* 60 3/29/98 12:55a Lawrance
|
||||
* Get demo build working with limited set of data.
|
||||
*
|
||||
* 59 3/26/98 9:19a Lawrance
|
||||
* Support multiple asteroid pofs
|
||||
*
|
||||
* 58 3/25/98 3:44p Andsager
|
||||
* Fixed bug in asteroid_sub_create, where last_pos field was invalid in
|
||||
* its creation frame but needed for collision in that frame.
|
||||
*
|
||||
* 57 3/25/98 2:03p Sandeep
|
||||
* Remove "f" from top of file.
|
||||
*
|
||||
* 56 3/25/98 1:50p Mike
|
||||
* Asteroid destruction (sm1-06a) balancing.
|
||||
*
|
||||
* 55 3/25/98 10:43a Andsager
|
||||
* Hack for ship_asteroid collisions when erroneous relative_vel >150
|
||||
*
|
||||
* 54 3/23/98 12:20p Andsager
|
||||
* Enable collision from rotation in ship_debris and ship_debris
|
||||
* collisions.
|
||||
*
|
||||
* 53 3/22/98 4:09p Andsager
|
||||
* Make moment of inertia based on model.
|
||||
*
|
||||
* 52 3/21/98 3:33p Lawrance
|
||||
* When asteroid collides with an escort ship, make the sound carry
|
||||
* farther
|
||||
*
|
||||
* 51 3/19/98 12:09p John
|
||||
* Fixed a bug using 6 characters. r_heavy was using local coordinates
|
||||
* instead of world so all asteroid-ship and debris-ship hitpos's were in
|
||||
* the wrong spot. Ok, I rearreanged some code to make it clearer also.
|
||||
*
|
||||
* 50 3/17/98 5:55p Lawrance
|
||||
* Support object linked sounds for asteroids.
|
||||
*
|
||||
* 49 3/17/98 3:44p Mike
|
||||
* Make asteroids-thrown-at-target not only happen when an asteroid wraps.
|
||||
*
|
||||
* 48 3/17/98 9:53a Lawrance
|
||||
* Asteroid area effect only affect ships
|
||||
*
|
||||
* 47 3/17/98 9:25a Allender
|
||||
* some minor asteroid changes for multiplayer
|
||||
*
|
||||
* 46 3/17/98 12:16a Allender
|
||||
* asteroids in multiplayer -- minor problems with position being correct
|
||||
*
|
||||
* 45 3/14/98 1:44p Mike
|
||||
* Todolist items 3365..3368. Make child asteroids collide properly.
|
||||
* Make asteroid throwing less bunchy, toss asteroids earlier, make
|
||||
* facing-ness not break mission balance.
|
||||
*
|
||||
* 44 3/13/98 9:06a John
|
||||
* Made missile thrusters use a different min dist for scaling. Made
|
||||
* missilies not use lighting.
|
||||
*
|
||||
* 43 3/12/98 4:01p Lawrance
|
||||
* Only show warning brackets for cruiser/capital ships on the same team
|
||||
*
|
||||
* $NoKeywords: $
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#include "asteroid/asteroid.h"
|
||||
@@ -460,7 +41,6 @@
|
||||
#include "network/multi.h"
|
||||
#include "parse/scripting.h"
|
||||
|
||||
#include <vector>
|
||||
|
||||
|
||||
//WMC - we want asteroid ability with demo!!
|
||||
@@ -481,7 +61,7 @@ int Num_asteroids = 0;
|
||||
int Asteroid_throw_objnum = -1; // Object index of ship to throw asteroids at.
|
||||
int Next_asteroid_throw;
|
||||
|
||||
std::vector<asteroid_info> Asteroid_info;
|
||||
SCP_vector< asteroid_info > Asteroid_info;
|
||||
asteroid Asteroids[MAX_ASTEROIDS];
|
||||
asteroid_field Asteroid_field;
|
||||
|
||||
@@ -527,7 +107,7 @@ int asteroid_obj_list_add(int objnum)
|
||||
index = cur_asteroid - Asteroids;
|
||||
|
||||
Assert(index >= 0 && index < MAX_ASTEROID_OBJS);
|
||||
Assert(!Asteroid_objs[index].flags & ASTEROID_OBJ_USED);
|
||||
Assert(!(Asteroid_objs[index].flags & ASTEROID_OBJ_USED));
|
||||
|
||||
Asteroid_objs[index].flags = 0;
|
||||
Asteroid_objs[index].objnum = objnum;
|
||||
@@ -1929,7 +1509,7 @@ void asteroid_test_collide(object *asteroid_obj, object *ship_obj, mc_info *mc,
|
||||
asteroid_ray_dist = vm_vec_mag_quick(&asteroid_obj->phys_info.desired_vel) * ASTEROID_MIN_COLLIDE_TIME;
|
||||
asteroid_fvec = asteroid_obj->phys_info.desired_vel;
|
||||
|
||||
if(IS_VEC_NULL(&asteroid_fvec)){
|
||||
if(IS_VEC_NULL_SQ_SAFE(&asteroid_fvec)){
|
||||
terminus = asteroid_obj->pos;
|
||||
} else {
|
||||
vm_vec_normalize(&asteroid_fvec);
|
||||
@@ -2004,7 +1584,7 @@ void asteroid_update_collide_flag(object *asteroid_objp)
|
||||
asp->collide_objsig = -1;
|
||||
|
||||
// multiplayer dogfight
|
||||
if((Game_mode & GM_MULTIPLAYER) && (Netgame.type_flags & NG_TYPE_DOGFIGHT)){
|
||||
if(MULTI_DOGFIGHT){
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -2164,7 +1744,7 @@ void asteroid_parse_tbl()
|
||||
return;
|
||||
}
|
||||
|
||||
read_file_text("asteroid.tbl");
|
||||
read_file_text("asteroid.tbl", CF_TYPE_TABLES);
|
||||
reset_parse();
|
||||
|
||||
required_string("#Asteroid Types");
|
||||
@@ -2214,7 +1794,7 @@ void asteroid_parse_tbl()
|
||||
|
||||
if ( VALID_FNAME(impact_ani_file) ) {
|
||||
int num_frames;
|
||||
Asteroid_impact_explosion_ani = bm_load_animation( impact_ani_file, &num_frames, NULL, 1);
|
||||
Asteroid_impact_explosion_ani = bm_load_animation( impact_ani_file, &num_frames, NULL, NULL, 1);
|
||||
}
|
||||
|
||||
required_string("$Impact Explosion Radius:");
|
||||
@@ -2454,7 +2034,7 @@ void asteroid_page_in()
|
||||
|
||||
// Page in textures
|
||||
for (j=0; j<asip->modelp[k]->n_textures; j++ ) {
|
||||
asip->modelp[k]->maps[j].base_map.PageIn();
|
||||
asip->modelp[k]->maps[j].PageIn();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+14
-168
@@ -7,170 +7,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Asteroid/Asteroid.h $
|
||||
* $Revision: 2.12.2.4 $
|
||||
* $Date: 2007-05-28 18:27:32 $
|
||||
* $Author: wmcoolmon $
|
||||
*
|
||||
* Header file for asteroids
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.12.2.3 2006/11/15 00:36:08 taylor
|
||||
* various bits of little cleanup
|
||||
* get rid of some more compiler warnings
|
||||
*
|
||||
* Revision 2.12.2.2 2006/09/11 01:15:04 taylor
|
||||
* fixes for stuff_string() bounds checking
|
||||
*
|
||||
* Revision 2.12.2.1 2006/08/27 18:12:39 taylor
|
||||
* make Species_info[] and Asteroid_info[] dynamic
|
||||
*
|
||||
* Revision 2.12 2005/09/25 20:31:42 Goober5000
|
||||
* okay; everything should be good to go
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.11 2005/09/25 08:25:14 Goober5000
|
||||
* Okay, everything should now work again. :p Still have to do a little more with the asteroids.
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.9 2005/07/13 02:50:48 Goober5000
|
||||
* remove PreProcDefine #includes in FS2
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.8 2005/07/13 02:01:28 Goober5000
|
||||
* fixed a bunch of "issues" caused by me with the species stuff
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.7 2005/07/13 00:44:20 Goober5000
|
||||
* improved species support and removed need for #define
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.6 2005/04/05 05:53:14 taylor
|
||||
* s/vector/vec3d/g, better support for different compilers (Jens Granseuer)
|
||||
*
|
||||
* Revision 2.5 2004/08/11 05:06:18 Kazan
|
||||
* added preprocdefines.h to prevent what happened with fred -- make sure to make all fred2 headers include this file as the _first_ include -- i have already modified fs2 files to do this
|
||||
*
|
||||
* Revision 2.4 2004/03/05 09:01:53 Goober5000
|
||||
* Uber pass at reducing #includes
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.3 2003/10/15 22:03:23 Kazan
|
||||
* Da Species Update :D
|
||||
*
|
||||
* Revision 2.2 2003/04/29 01:03:22 Goober5000
|
||||
* implemented the custom hitpoints mod
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.1 2002/08/01 01:41:04 penguin
|
||||
* The big include file move
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:21 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
* Revision 1.2 2002/05/03 22:07:08 mharris
|
||||
* got some stuff to compile
|
||||
*
|
||||
* Revision 1.1 2002/05/02 18:03:04 mharris
|
||||
* Initial checkin - converted filenames and includes to lower case
|
||||
*
|
||||
*
|
||||
* 12 6/09/99 2:55p Andsager
|
||||
* Allow multiple asteroid subtypes (of large, medium, small) and follow
|
||||
* family.
|
||||
*
|
||||
* 11 6/07/99 1:18p Andsager
|
||||
* Make asteroids choose consistent texture from large to small. Modify
|
||||
* fireball radius of dying asteroids.
|
||||
*
|
||||
* 10 5/03/99 10:50p Andsager
|
||||
* Make Asteroid_obj_list. Change get_nearest_turret_objnum() to use
|
||||
* Asteroid_obj_list, Ship_obj_list and Missile_obj_list vs.
|
||||
* obj_used_list.
|
||||
*
|
||||
* 9 4/16/99 2:34p Andsager
|
||||
* Second pass on debris fields
|
||||
*
|
||||
* 8 4/15/99 5:00p Andsager
|
||||
* Frist pass on Debris field
|
||||
*
|
||||
* 7 3/31/99 9:51a Andsager
|
||||
* Add for generalization to debris field
|
||||
*
|
||||
* 6 2/07/99 8:51p Andsager
|
||||
* Add inner bound to asteroid field. Inner bound tries to stay astroid
|
||||
* free. Wrap when within and don't throw at ships inside.
|
||||
*
|
||||
* 5 1/20/99 6:04p Dave
|
||||
* Another bit of stuff for beam weapons. Ships will properly use them
|
||||
* now, although they're really deadly.
|
||||
*
|
||||
* 4 11/05/98 5:55p Dave
|
||||
* Big pass at reducing #includes
|
||||
*
|
||||
* 3 10/16/98 1:22p Andsager
|
||||
* clean up header files
|
||||
*
|
||||
* 2 10/07/98 10:52a Dave
|
||||
* Initial checkin.
|
||||
*
|
||||
* 1 10/07/98 10:48a Dave
|
||||
*
|
||||
* 17 3/26/98 9:19a Lawrance
|
||||
* Support multiple asteroid pofs
|
||||
*
|
||||
* 16 3/17/98 12:16a Allender
|
||||
* asteroids in multiplayer -- minor problems with position being correct
|
||||
*
|
||||
* 15 3/14/98 1:44p Mike
|
||||
* Todolist items 3365..3368. Make child asteroids collide properly.
|
||||
* Make asteroid throwing less bunchy, toss asteroids earlier, make
|
||||
* facing-ness not break mission balance.
|
||||
*
|
||||
* 14 3/11/98 12:13a Lawrance
|
||||
* Auto-target asteroids if no hostile ships present
|
||||
*
|
||||
* 13 3/08/98 4:16p Hoffoss
|
||||
*
|
||||
* 12 3/07/98 3:48p Lawrance
|
||||
* Show offscreen indicators for asteroids
|
||||
*
|
||||
* 11 3/04/98 11:59p Lawrance
|
||||
* create an asteroid.tbl, read all asteroid data from there
|
||||
*
|
||||
* 10 3/04/98 4:11p Lawrance
|
||||
* Have area effects affect asteroids, have asteroids cast an area effect,
|
||||
* fix ship shockwaves
|
||||
*
|
||||
* 9 3/03/98 12:48a Lawrance
|
||||
* Ensure collide_objnum is still valid each frame.
|
||||
*
|
||||
* 8 3/02/98 11:35p Lawrance
|
||||
* Keep track of asteroids that will impact ships on the escort view.
|
||||
*
|
||||
* 7 2/26/98 10:07p Hoffoss
|
||||
* Rewrote state saving and restoring to fix bugs and simplify the code.
|
||||
*
|
||||
* 6 2/26/98 4:22p Lawrance
|
||||
* Change wrapping behavior, make vel random
|
||||
*
|
||||
* 5 2/20/98 8:31p Lawrance
|
||||
* delay creation of sub-asteroids
|
||||
*
|
||||
* 4 2/19/98 4:33p Lawrance
|
||||
* hook in new sounds and custom explosion animation
|
||||
*
|
||||
* 3 2/19/98 12:46a Lawrance
|
||||
* Further work on asteroids.
|
||||
*
|
||||
* 2 2/10/98 6:43p Lawrance
|
||||
* Moved asteroid code to a separate lib.
|
||||
*
|
||||
* 1 2/10/98 6:05p Lawrance
|
||||
*
|
||||
* $NoKeywords: $
|
||||
*/
|
||||
|
||||
|
||||
#ifndef __ASTEROID_H__
|
||||
#define __ASTEROID_H__
|
||||
@@ -178,13 +15,12 @@
|
||||
#include "globalincs/pstypes.h"
|
||||
#include "globalincs/globals.h" // for NAME_LENGTH
|
||||
|
||||
#include <vector>
|
||||
|
||||
struct object;
|
||||
struct polymodel;
|
||||
struct collision_info_struct;
|
||||
|
||||
#define MAX_ASTEROIDS 256
|
||||
#define MAX_ASTEROIDS 512
|
||||
|
||||
#define NUM_DEBRIS_SIZES 3
|
||||
#define NUM_DEBRIS_POFS 3 // Number of POFs per debris size
|
||||
@@ -228,7 +64,17 @@ typedef struct asteroid_info {
|
||||
polymodel *modelp[NUM_DEBRIS_POFS];
|
||||
int model_num[NUM_DEBRIS_POFS];
|
||||
|
||||
asteroid_info() { memset(this, 0, sizeof(asteroid_info)); damage_type_idx = -1; };
|
||||
asteroid_info( )
|
||||
: num_detail_levels( 0 ), max_speed( 0 ), damage_type_idx( -1 ),
|
||||
inner_rad( 0 ), outer_rad( 0 ), damage( 0 ), blast( 0 ),
|
||||
initial_asteroid_strength( 0 )
|
||||
{
|
||||
name[ 0 ] = NULL;
|
||||
memset( pof_files, 0, sizeof( pof_files ) );
|
||||
memset( detail_distance, 0, sizeof( detail_distance ) );
|
||||
memset( modelp, 0, sizeof( modelp ) );
|
||||
memset( model_num, 0, sizeof( model_num ) );
|
||||
}
|
||||
} asteroid_info;
|
||||
|
||||
|
||||
@@ -275,7 +121,7 @@ typedef struct asteroid_field {
|
||||
int field_debris_type[MAX_ACTIVE_DEBRIS_TYPES]; // one of the debris type defines above
|
||||
} asteroid_field;
|
||||
|
||||
extern std::vector<asteroid_info> Asteroid_info;
|
||||
extern SCP_vector< asteroid_info > Asteroid_info;
|
||||
extern asteroid Asteroids[MAX_ASTEROIDS];
|
||||
extern asteroid_field Asteroid_field;
|
||||
|
||||
|
||||
+225
-302
@@ -2,148 +2,7 @@
|
||||
// Derek Meek
|
||||
// 4-30-2004
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Autopilot/Autopilot.cpp $
|
||||
* $Revision: 1.23.2.18 $
|
||||
* $Date: 2008-01-08 01:41:12 $
|
||||
* $Author: Kazan $
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 1.23.2.17 2007/10/28 16:33:05 taylor
|
||||
* tisk tisk
|
||||
*
|
||||
* Revision 1.23.2.16 2007/10/20 23:28:48 Kazan
|
||||
* Enemy cargo containers should not prevent autopilot.
|
||||
* Fix build problem in parselo (strrchr returns const char* not char*, need to explicitly cast - raises error in MSVC2005)
|
||||
* Update MSVC2005 "code" project to reflect removal/addition of fs2netd related files
|
||||
*
|
||||
* Revision 1.23.2.15 2007/10/17 20:58:25 taylor
|
||||
* fix mismatched parameters (Mantis #1470)
|
||||
*
|
||||
* Revision 1.23.2.14 2007/09/02 02:07:38 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.23.2.13 2007/08/04 22:29:58 Goober5000
|
||||
* fix case-sensitive #include (Linux)
|
||||
*
|
||||
* Revision 1.23.2.12 2007/08/03 01:35:35 Goober5000
|
||||
* fix warning
|
||||
*
|
||||
* Revision 1.23.2.11 2007/07/25 20:45:16 Kazan
|
||||
* I <3 making stupid bugs (return camera to normal when not using cutscene bars)
|
||||
*
|
||||
* Revision 1.23.2.10 2007/07/25 14:51:14 Kazan
|
||||
* two-part autopilot warp, add +No_Cutscene_Bars optional flag to autopilot.tbl
|
||||
*
|
||||
* Revision 1.23.2.9 2007/07/24 20:31:00 Kazan
|
||||
* oops
|
||||
*
|
||||
* Revision 1.23.2.8 2007/07/24 20:08:28 Kazan
|
||||
* Make asteroid/debris fields interrupt autopilot, add "hazards near" message to autopilot.tbl, add use-nav-cinematics sexp, fix mantis #1441
|
||||
*
|
||||
* Revision 1.23.2.7 2007/07/24 13:03:14 Kazan
|
||||
* Resolve Mantis 1281
|
||||
*
|
||||
* Revision 1.23.2.6 2007/07/23 16:08:23 Kazan
|
||||
* Autopilot updates, minor misc fixes, working MSVC2005 project files
|
||||
*
|
||||
* Revision 1.23.2.5 2007/02/12 00:23:39 taylor
|
||||
* get rid of non-standard itoa(), make use of the proper sprintf() instead
|
||||
*
|
||||
* Revision 1.23.2.4 2006/11/03 18:44:11 Kazan
|
||||
* prevent autopilot initialization while player is gliding
|
||||
*
|
||||
* Revision 1.23.2.3 2006/09/11 01:00:27 taylor
|
||||
* various small compiler warning and strict compiling fixes
|
||||
*
|
||||
* Revision 1.23.2.2 2006/07/27 19:17:33 Kazan
|
||||
* Lock player primaries during autopilot
|
||||
*
|
||||
* Revision 1.23.2.1 2006/07/26 14:53:38 Kazan
|
||||
* Resolve Mantis #1010
|
||||
*
|
||||
* Revision 1.23 2006/02/25 21:42:31 Goober5000
|
||||
* fixes from last commit
|
||||
*
|
||||
* Revision 1.22 2005/08/23 09:18:08 Goober5000
|
||||
* ensure init/reset of goals works cleanly
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 1.21 2005/07/23 16:25:32 Goober5000
|
||||
* remove an extraneous extern
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 1.20 2005/07/13 02:30:52 Goober5000
|
||||
* removed autopilot #define
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 1.19 2005/04/19 23:03:42 wmcoolmon
|
||||
* Lock time compression when autopilot is engaged
|
||||
*
|
||||
* Revision 1.18 2005/04/05 05:53:14 taylor
|
||||
* s/vector/vec3d/g, better support for different compilers (Jens Granseuer)
|
||||
*
|
||||
* Revision 1.17 2005/03/25 06:57:32 wmcoolmon
|
||||
* Big, massive, codebase commit. I have not removed the old ai files as the ones I uploaded aren't up-to-date (But should work with the rest of the codebase)
|
||||
*
|
||||
* Revision 1.16 2005/03/03 06:05:26 wmcoolmon
|
||||
* Merge of WMC's codebase. "Features and bugs, making Goober say "Grr!", as release would be stalled now for two months for sure"
|
||||
*
|
||||
* Revision 1.15 2005/01/31 23:27:51 taylor
|
||||
* merge with Linux/OSX tree - p0131-2
|
||||
*
|
||||
* Revision 1.14 2004/10/03 21:41:10 Kazan
|
||||
* Autopilot convergence collision fix for ai_fly_to_ship() and ai_waypoints() -- mathematically expensive, only usable by autopilot
|
||||
*
|
||||
* Revision 1.13 2004/09/28 22:51:41 Kazan
|
||||
* fix autopilot formation bug
|
||||
*
|
||||
* Revision 1.12 2004/09/28 19:54:31 Kazan
|
||||
* | is binary or, || is boolean or - please use the right one
|
||||
* autopilot velocity ramping biasing
|
||||
* made debugged+k kill guardianed ships
|
||||
*
|
||||
* Revision 1.11 2004/07/29 23:41:21 Kazan
|
||||
* bugfixes
|
||||
*
|
||||
* Revision 1.10 2004/07/27 18:52:10 Kazan
|
||||
* squished another
|
||||
*
|
||||
* Revision 1.9 2004/07/27 18:04:09 Kazan
|
||||
* i love it when bugs go crunch (autopilot ai fixup)
|
||||
*
|
||||
* Revision 1.8 2004/07/26 20:47:24 Kazan
|
||||
* remove MCD complete
|
||||
*
|
||||
* Revision 1.7 2004/07/26 17:54:04 Kazan
|
||||
* Autopilot system completed -- i am dropping plans for GUI nav map
|
||||
* Fixed FPS counter during time compression
|
||||
*
|
||||
* Revision 1.6 2004/07/25 19:27:51 Kazan
|
||||
* only disable afterburning during AIM_WAYPOINTS and AIM_FLY_TO_SHIP while AutoPilotEngaged
|
||||
*
|
||||
* Revision 1.5 2004/07/25 18:46:28 Kazan
|
||||
* -fred_no_warn has become -no_warn and applies to both fred and fs2
|
||||
* added new ai directive (last commit) and disabled afterburners while performing AIM_WAYPOINTS or AIM_FLY_TO_SHIP
|
||||
* fixed player ship speed bug w/ player-use-ai, now stays in formation correctly and manages speed
|
||||
* made -radar_reduce ignore itself if no parameter is given (ignoring launcher bug)
|
||||
*
|
||||
* Revision 1.4 2004/07/25 00:31:27 Kazan
|
||||
* i have absolutely nothing to say about that subject
|
||||
*
|
||||
* Revision 1.3 2004/07/12 16:32:42 Kazan
|
||||
* MCD - define _MCD_CHECK to use memory tracking
|
||||
*
|
||||
* 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!
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#include "autopilot/autopilot.h"
|
||||
@@ -180,6 +39,7 @@ extern int Cmdline_autopilot_interruptable;
|
||||
// Module variables
|
||||
bool AutoPilotEngaged;
|
||||
bool UseCutsceneBars;
|
||||
bool LockWeaponsDuringAutopilot;
|
||||
int CurrentNav;
|
||||
float ramp_bias;
|
||||
NavPoint Navs[MAX_NAVPOINTS];
|
||||
@@ -196,6 +56,9 @@ bool CinematicStarted, CameraMoving;
|
||||
vec3d cameraPos, cameraTarget;
|
||||
std::map<int,int> autopilot_wings;
|
||||
|
||||
int AutopilotMinEnemyDistance;
|
||||
int AutopilotMinAsteroidDistance;
|
||||
|
||||
// used for ramping time compression;
|
||||
int start_dist;
|
||||
|
||||
@@ -290,12 +153,7 @@ char* NavPoint::GetInteralName()
|
||||
}
|
||||
|
||||
// ********************************************************************************************
|
||||
// Tell us if autopilot is allowed
|
||||
// This needs:
|
||||
// * Nav point selected
|
||||
// * No enemies within X distance
|
||||
// * Destination > 1,000 meters away
|
||||
bool CanAutopilot(bool send_msg)
|
||||
bool CanAutopilot(vec3d targetPos, bool send_msg)
|
||||
{
|
||||
if (CurrentNav == -1)
|
||||
{
|
||||
@@ -303,99 +161,69 @@ bool CanAutopilot(bool send_msg)
|
||||
send_autopilot_msgID(NP_MSG_FAIL_NOSEL);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
if (object_get_gliding(Player_obj))
|
||||
{
|
||||
if (send_msg)
|
||||
send_autopilot_msgID(NP_MSG_FAIL_GLIDING);
|
||||
return false;
|
||||
}
|
||||
|
||||
// You cannot autopilot if you're within 1000 meters of your destination nav point
|
||||
if (vm_vec_dist_quick(&Player_obj->pos, Navs[CurrentNav].GetPosition()) < 1000)
|
||||
{
|
||||
if (vm_vec_dist_quick(&targetPos, Navs[CurrentNav].GetPosition()) < 1000) {
|
||||
if (send_msg)
|
||||
send_autopilot_msgID(NP_MSG_FAIL_TOCLOSE);
|
||||
return false;
|
||||
}
|
||||
|
||||
// see if any hostiles are nearby
|
||||
for (ship_obj *so = GET_FIRST(&Ship_obj_list); so != END_OF_LIST(&Ship_obj_list); so = GET_NEXT(so))
|
||||
{
|
||||
object *other_objp = &Objects[so->objnum];
|
||||
|
||||
// attacks player?
|
||||
if (iff_x_attacks_y(obj_team(other_objp), obj_team(Player_obj))
|
||||
&& !(Ship_info[Ships[other_objp->instance].ship_info_index].flags & SIF_CARGO))
|
||||
if ( AutopilotMinEnemyDistance > 0 ) {
|
||||
// see if any hostiles are nearby
|
||||
for (ship_obj *so = GET_FIRST(&Ship_obj_list); so != END_OF_LIST(&Ship_obj_list); so = GET_NEXT(so))
|
||||
{
|
||||
// Cannot autopilot if enemy within 5,000 meters
|
||||
if (vm_vec_dist_quick(&Player_obj->pos, &other_objp->pos) < 5000)
|
||||
object *other_objp = &Objects[so->objnum];
|
||||
// attacks player?
|
||||
if (iff_x_attacks_y(obj_team(other_objp), obj_team(Player_obj))
|
||||
&& !(Ship_info[Ships[other_objp->instance].ship_info_index].flags & SIF_CARGO)) // ignore cargo
|
||||
{
|
||||
if (send_msg)
|
||||
send_autopilot_msgID(NP_MSG_FAIL_HOSTILES);
|
||||
return false;
|
||||
// Cannot autopilot if enemy within AutopilotMinEnemyDistance meters
|
||||
if (vm_vec_dist_quick(&targetPos, &other_objp->pos) < AutopilotMinEnemyDistance) {
|
||||
if (send_msg)
|
||||
send_autopilot_msgID(NP_MSG_FAIL_HOSTILES);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//check for asteroids
|
||||
for (int n=0; n<MAX_ASTEROIDS; n++)
|
||||
{
|
||||
// asteroid
|
||||
if (Asteroids[n].flags & AF_USED)
|
||||
{
|
||||
// Cannot autopilot if asteroid within 1,000 meters
|
||||
if (vm_vec_dist_quick(&Player_obj->pos, &Objects[Asteroids[n].objnum].pos) < 1000)
|
||||
{
|
||||
if (send_msg)
|
||||
send_autopilot_msgID(NP_MSG_FAIL_HAZARD);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// ********************************************************************************************
|
||||
// Tell us if autopilot is allowed at a certain position (only performs checks based on that position)
|
||||
// This needs:
|
||||
// * Nav point selected
|
||||
// * No enemies within X distance
|
||||
// * Destination > 1,000 meters away
|
||||
bool CanAutopilotPos(vec3d targetPos)
|
||||
{
|
||||
// You cannot autopilot if you're within 1000 meters of your destination nav point
|
||||
if (vm_vec_dist_quick(&targetPos, Navs[CurrentNav].GetPosition()) < 1000)
|
||||
return false;
|
||||
// see if any hostiles are nearby
|
||||
for (ship_obj *so = GET_FIRST(&Ship_obj_list); so != END_OF_LIST(&Ship_obj_list); so = GET_NEXT(so))
|
||||
{
|
||||
object *other_objp = &Objects[so->objnum];
|
||||
// attacks player?
|
||||
if (iff_x_attacks_y(obj_team(other_objp), obj_team(Player_obj))
|
||||
&& !(Ship_info[Ships[other_objp->instance].ship_info_index].flags & SIF_CARGO)) // ignore cargo
|
||||
{
|
||||
// Cannot autopilot if enemy within 5,000 meters
|
||||
if (vm_vec_dist_quick(&targetPos, &other_objp->pos) < 5000)
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
//check for asteroids
|
||||
for (int n=0; n<MAX_ASTEROIDS; n++)
|
||||
{
|
||||
// asteroid
|
||||
if (Asteroids[n].flags & AF_USED)
|
||||
if ( AutopilotMinAsteroidDistance > 0 ) {
|
||||
//check for asteroids
|
||||
for (int n=0; n<MAX_ASTEROIDS; n++)
|
||||
{
|
||||
// Cannot autopilot if asteroid within 1,000 meters
|
||||
if (vm_vec_dist_quick(&targetPos, &Objects[Asteroids[n].objnum].pos) < 1000)
|
||||
return false;
|
||||
// asteroid
|
||||
if (Asteroids[n].flags & AF_USED)
|
||||
{
|
||||
// Cannot autopilot if asteroid within AutopilotMinAsteroidDistance meters
|
||||
if (vm_vec_dist_quick(&targetPos, &Objects[Asteroids[n].objnum].pos) < AutopilotMinAsteroidDistance) {
|
||||
if (send_msg)
|
||||
send_autopilot_msgID(NP_MSG_FAIL_HAZARD);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// check for support ships
|
||||
// cannot autopilot if support ship present
|
||||
if ( ship_find_repair_ship(Player_obj) != NULL ) {
|
||||
if (send_msg)
|
||||
send_autopilot_msgID(NP_MSG_FAIL_SUPPORT_PRESENT);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
extern object* Autopilot_flight_leader;
|
||||
// ********************************************************************************************
|
||||
// Engages autopilot
|
||||
// This does:
|
||||
@@ -404,13 +232,54 @@ bool CanAutopilotPos(vec3d targetPos)
|
||||
// * Lock time compression -WMC
|
||||
// * 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()
|
||||
bool StartAutopilot()
|
||||
{
|
||||
// Check for support ship and dismiss it if it is not doing anything.
|
||||
// If the support ship is doing something then tell the user such.
|
||||
bool done = false;
|
||||
while (!done) {
|
||||
object* support_ship_op = ship_find_repair_ship(Player_obj);
|
||||
if ( support_ship_op == NULL ) {
|
||||
// no more
|
||||
done = true;
|
||||
break;
|
||||
}
|
||||
|
||||
Assert( support_ship_op->type == OBJ_SHIP );
|
||||
Assert( support_ship_op->instance >= 0 );
|
||||
Assert( support_ship_op->instance < MAX_SHIPS );
|
||||
Assert( Ships[support_ship_op->instance].ai_index != -1 );
|
||||
|
||||
ai_info* support_ship_aip = &(Ai_info[Ships[support_ship_op->instance].ai_index]);
|
||||
|
||||
// is support ship trying to rearm-repair
|
||||
if ( ai_find_goal_index( support_ship_aip->goals, AI_GOAL_REARM_REPAIR ) == -1 ) {
|
||||
// no, so tell it to depart
|
||||
ai_add_ship_goal_player( AIG_TYPE_PLAYER_SHIP, AI_GOAL_WARP, -1, NULL, support_ship_aip );
|
||||
} else {
|
||||
// yes
|
||||
send_autopilot_msgID(NP_MSG_FAIL_SUPPORT_WORKING);
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
if (!CanAutopilot())
|
||||
return;
|
||||
return false;
|
||||
|
||||
AutoPilotEngaged = true;
|
||||
|
||||
// find the ship that is "leading" all of the ships when the player starts
|
||||
// autopilot
|
||||
// by default the ship that is leading the autopilot session the player's
|
||||
// wing leader (if the player is the wing leader then it will be the
|
||||
// player).
|
||||
// TODO:implement a way to allow a FREDer to say a different ship is leader
|
||||
Autopilot_flight_leader = get_wing_leader(Player_ship->wingnum);
|
||||
if ( Autopilot_flight_leader == NULL ) {
|
||||
// force player to be the leader if he doesn't have a wing
|
||||
Autopilot_flight_leader = Player_obj;
|
||||
}
|
||||
|
||||
if (The_mission.flags & MISSION_FLAG_USE_AP_CINEMATICS)
|
||||
LockAPConv = timestamp(); // lock convergence instantly
|
||||
else
|
||||
@@ -439,7 +308,7 @@ void StartAutopilot()
|
||||
capship_spreads[1] = 0.0f;
|
||||
capship_spreads[2] = 0.0f;
|
||||
|
||||
std::vector<int> capIndexes;
|
||||
SCP_vector<int> capIndexes;
|
||||
|
||||
// empty the autopilot wings map
|
||||
autopilot_wings.clear();
|
||||
@@ -469,10 +338,20 @@ void StartAutopilot()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// damp speed_cap to 90% of actual -- to make sure ships stay in formation
|
||||
if (The_mission.flags & MISSION_FLAG_USE_AP_CINEMATICS)
|
||||
speed_cap = 0.90f * speed_cap;
|
||||
|
||||
if ( speed_cap < 1.0f ) {
|
||||
/* We need to deal with this so that incorrectly flagged ships will not
|
||||
cause the engine to fail to limit all the ships speeds correctly. */
|
||||
Warning(LOCATION, "Ship speed cap is way too small (%f)!\n"
|
||||
"This is normally caused by a ship that has nav-carry-status set, but cannot move itself (like a Cargo container).\n"
|
||||
"Speed cap has been set to 1.0 m/s.",
|
||||
speed_cap);
|
||||
speed_cap = 1.0f;
|
||||
}
|
||||
|
||||
ramp_bias = speed_cap/50.0f;
|
||||
|
||||
// assign ship goals
|
||||
@@ -538,10 +417,10 @@ void StartAutopilot()
|
||||
vm_vector_2_matrix(&Objects[Ships[i].objnum].orient, &norm1, NULL, NULL);
|
||||
}
|
||||
|
||||
// snap wings into formation them into formation
|
||||
// snap wings into formation
|
||||
if (The_mission.flags & MISSION_FLAG_USE_AP_CINEMATICS && // only if using cinematics
|
||||
(Ships[i].wingnum != -1 && Wings[Ships[i].wingnum].flags & WF_NAV_CARRY) // only if in a wing
|
||||
&& Player_obj != &Objects[Ships[i].objnum]) //only if not player object
|
||||
&& Autopilot_flight_leader != &Objects[Ships[i].objnum]) //only if not flight leader's object
|
||||
{
|
||||
ai_info *aip = &Ai_info[Ships[i].ai_index];
|
||||
int wingnum = aip->wing, wing_index = get_wing_index(&Objects[Ships[i].objnum], wingnum);
|
||||
@@ -560,33 +439,34 @@ void StartAutopilot()
|
||||
switch (wcount % 2)
|
||||
{
|
||||
case 1: // back-left
|
||||
vm_vec_add(&perp, &zero, &Player_obj->orient.vec.rvec);
|
||||
vm_vec_add(&perp, &zero, &Autopilot_flight_leader->orient.vec.rvec);
|
||||
//vm_vec_sub(&perp, &perp, &Player_obj->orient.vec.fvec);
|
||||
vm_vec_normalize(&perp);
|
||||
vm_vec_scale(&perp, -166.0f*j); // 166m is supposedly the optimal range according to tolwyn
|
||||
vm_vec_add(&goal_point, &Player_obj->pos, &perp);
|
||||
vm_vec_add(&goal_point, &Autopilot_flight_leader->pos, &perp);
|
||||
break;
|
||||
|
||||
default: //back-right
|
||||
case 0:
|
||||
vm_vec_add(&perp, &zero, &Player_obj->orient.vec.rvec);
|
||||
vm_vec_add(&perp, &zero, &Autopilot_flight_leader->orient.vec.rvec);
|
||||
//vm_vec_sub(&perp, &perp, &Player_obj->orient.vec.fvec);
|
||||
vm_vec_normalize(&perp);
|
||||
vm_vec_scale(&perp, 166.0f*j);
|
||||
vm_vec_add(&goal_point, &Player_obj->pos, &perp);
|
||||
vm_vec_add(&goal_point, &Autopilot_flight_leader->pos, &perp);
|
||||
break;
|
||||
}
|
||||
autopilot_wings[wingnum] = wcount;
|
||||
wcount++;
|
||||
}
|
||||
Objects[Ships[i].objnum].pos = goal_point;
|
||||
if (vm_vec_dist_quick(&Player_obj->pos, &Objects[Ships[i].objnum].pos) > distance)
|
||||
if (vm_vec_dist_quick(&Autopilot_flight_leader->pos, &Objects[Ships[i].objnum].pos) > distance)
|
||||
{
|
||||
distance = vm_vec_dist_quick(&Player_obj->pos, &Objects[Ships[i].objnum].pos);
|
||||
distance = vm_vec_dist_quick(&Autopilot_flight_leader->pos, &Objects[Ships[i].objnum].pos);
|
||||
}
|
||||
}
|
||||
// lock primary and secondary weapons
|
||||
//Ships[i].flags2 |= (SF2_PRIMARIES_LOCKED | SF2_SECONDARIES_LOCKED);
|
||||
if ( LockWeaponsDuringAutopilot )
|
||||
Ships[i].flags2 |= (SF2_PRIMARIES_LOCKED | SF2_SECONDARIES_LOCKED);
|
||||
|
||||
// clear the ship goals and cap the waypoint speed
|
||||
ai_clear_ship_goals(&Ai_info[Ships[i].ai_index]);
|
||||
@@ -681,9 +561,9 @@ void StartAutopilot()
|
||||
vec3d right, front, up, offset;
|
||||
for (i = 0; i < (int)capIndexes.size(); i++)
|
||||
{
|
||||
vm_vec_add(&right, &Player_obj->orient.vec.rvec, &zero);
|
||||
vm_vec_add(&front, &Player_obj->orient.vec.fvec, &zero);
|
||||
vm_vec_add(&up, &Player_obj->orient.vec.uvec, &zero);
|
||||
vm_vec_add(&right, &Autopilot_flight_leader->orient.vec.rvec, &zero);
|
||||
vm_vec_add(&front, &Autopilot_flight_leader->orient.vec.fvec, &zero);
|
||||
vm_vec_add(&up, &Autopilot_flight_leader->orient.vec.uvec, &zero);
|
||||
vm_vec_add(&offset, &zero, &zero);
|
||||
if (Ship_info[Ships[capIndexes[i]].ship_info_index].flags & (SIF_CAPITAL | SIF_SUPERCAP))
|
||||
{
|
||||
@@ -751,7 +631,7 @@ void StartAutopilot()
|
||||
vm_vec_scale(&up, (1+((float)floor((float)capship_placed[1]/3))));
|
||||
|
||||
// move ourselves up and out of the way of the smaller ships
|
||||
vm_vec_add(&perp, &Player_obj->orient.vec.uvec, &zero);
|
||||
vm_vec_add(&perp, &Autopilot_flight_leader->orient.vec.uvec, &zero);
|
||||
vm_vec_scale(&perp, capship_spreads[2]);
|
||||
vm_vec_add(&up, &up, &perp);
|
||||
|
||||
@@ -806,7 +686,7 @@ void StartAutopilot()
|
||||
vm_vec_scale(&front, 2*(1+((float)floor((float)capship_placed[2]/3))));
|
||||
|
||||
// move "out" by 166*(wcount-1) so we don't bump into fighters
|
||||
vm_vec_add(&perp, &Player_obj->orient.vec.rvec, &zero);
|
||||
vm_vec_add(&perp, &Autopilot_flight_leader->orient.vec.rvec, &zero);
|
||||
vm_vec_scale(&perp, 166.0f*float(wcount-1));
|
||||
if ( (capship_placed[2] % 2) == 0)
|
||||
vm_vec_add(&right, &right, &perp);
|
||||
@@ -828,16 +708,16 @@ void StartAutopilot()
|
||||
// global scale the position by 50%
|
||||
//vm_vec_scale(&offset, 1.5);
|
||||
|
||||
vm_vec_add(&Objects[Ships[capIndexes[i]].objnum].pos, &Player_obj->pos, &offset);
|
||||
vm_vec_add(&Objects[Ships[capIndexes[i]].objnum].pos, &Autopilot_flight_leader->pos, &offset);
|
||||
|
||||
if (vm_vec_dist_quick(&Player_obj->pos, &Objects[Ships[i].objnum].pos) > distance)
|
||||
if (vm_vec_dist_quick(&Autopilot_flight_leader->pos, &Objects[Ships[i].objnum].pos) > distance)
|
||||
{
|
||||
distance = vm_vec_dist_quick(&Player_obj->pos, &Objects[Ships[i].objnum].pos);
|
||||
distance = vm_vec_dist_quick(&Autopilot_flight_leader->pos, &Objects[Ships[i].objnum].pos);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ftemp = floor(Player_obj->phys_info.max_vel.xyz.z/speed_cap);
|
||||
ftemp = floor(Autopilot_flight_leader->phys_info.max_vel.xyz.z/speed_cap);
|
||||
if (ftemp >= 2.0f && ftemp < 4.0f)
|
||||
tc_factor = 2;
|
||||
else if (ftemp >= 4.0f && ftemp < 8.0f)
|
||||
@@ -849,11 +729,11 @@ void StartAutopilot()
|
||||
|
||||
tpos = *Navs[CurrentNav].GetPosition();
|
||||
// determine distance toward nav at which camera will be
|
||||
vm_vec_sub(&pos, &tpos, &Player_obj->pos);
|
||||
vm_vec_sub(&pos, &tpos, &Autopilot_flight_leader->pos);
|
||||
vm_vec_normalize(&pos); // pos is now a unit vector in the direction we will be moving the camera
|
||||
//norm1 = pos;
|
||||
vm_vec_scale(&pos, 5*speed_cap*tc_factor); // pos is now scaled by 5 times the speed (5 seconds ahead)
|
||||
vm_vec_add(&pos, &pos, &Player_obj->pos); // pos is now 5*speed cap in front of player ship
|
||||
vm_vec_add(&pos, &pos, &Autopilot_flight_leader->pos); // pos is now 5*speed cap in front of player ship
|
||||
|
||||
switch (myrand()%24)
|
||||
// 8 different ways of getting perp points
|
||||
@@ -864,74 +744,74 @@ void StartAutopilot()
|
||||
case 9:
|
||||
case 16:
|
||||
if (capship_placed[0] == 0)
|
||||
vm_vec_sub(&perp, &zero, &Player_obj->orient.vec.uvec);
|
||||
vm_vec_sub(&perp, &zero, &Autopilot_flight_leader->orient.vec.uvec);
|
||||
else
|
||||
{ // become up-left
|
||||
vm_vec_add(&perp, &zero, &Player_obj->orient.vec.uvec);
|
||||
vm_vec_sub(&perp, &perp, &Player_obj->orient.vec.rvec);
|
||||
vm_vec_add(&perp, &zero, &Autopilot_flight_leader->orient.vec.uvec);
|
||||
vm_vec_sub(&perp, &perp, &Autopilot_flight_leader->orient.vec.rvec);
|
||||
}
|
||||
break;
|
||||
|
||||
case 2: // up
|
||||
case 10:
|
||||
case 23:
|
||||
vm_vec_add(&perp, &perp, &Player_obj->orient.vec.uvec);
|
||||
vm_vec_add(&perp, &perp, &Autopilot_flight_leader->orient.vec.uvec);
|
||||
if (capshipPresent) // become up-right
|
||||
vm_vec_add(&perp, &perp, &Player_obj->orient.vec.rvec);
|
||||
vm_vec_add(&perp, &perp, &Autopilot_flight_leader->orient.vec.rvec);
|
||||
break;
|
||||
|
||||
case 3: // left
|
||||
case 11:
|
||||
case 22:
|
||||
vm_vec_sub(&perp, &zero, &Player_obj->orient.vec.rvec);
|
||||
vm_vec_sub(&perp, &zero, &Autopilot_flight_leader->orient.vec.rvec);
|
||||
break;
|
||||
|
||||
case 4: // up-left
|
||||
case 12:
|
||||
case 21:
|
||||
vm_vec_sub(&perp, &zero, &Player_obj->orient.vec.rvec);
|
||||
vm_vec_add(&perp, &perp, &Player_obj->orient.vec.uvec);
|
||||
vm_vec_sub(&perp, &zero, &Autopilot_flight_leader->orient.vec.rvec);
|
||||
vm_vec_add(&perp, &perp, &Autopilot_flight_leader->orient.vec.uvec);
|
||||
break;
|
||||
|
||||
case 5: // up-right
|
||||
case 13:
|
||||
case 20:
|
||||
vm_vec_add(&perp, &zero, &Player_obj->orient.vec.rvec);
|
||||
vm_vec_add(&perp, &perp, &Player_obj->orient.vec.uvec);
|
||||
vm_vec_add(&perp, &zero, &Autopilot_flight_leader->orient.vec.rvec);
|
||||
vm_vec_add(&perp, &perp, &Autopilot_flight_leader->orient.vec.uvec);
|
||||
break;
|
||||
|
||||
case 6: // down-left
|
||||
case 14:
|
||||
case 19:
|
||||
vm_vec_sub(&perp, &zero, &Player_obj->orient.vec.rvec);
|
||||
vm_vec_sub(&perp, &zero, &Autopilot_flight_leader->orient.vec.rvec);
|
||||
if (capship_placed[0] < 2)
|
||||
vm_vec_sub(&perp, &perp, &Player_obj->orient.vec.uvec);
|
||||
vm_vec_sub(&perp, &perp, &Autopilot_flight_leader->orient.vec.uvec);
|
||||
else
|
||||
vm_vec_add(&perp, &perp, &Player_obj->orient.vec.uvec);
|
||||
vm_vec_add(&perp, &perp, &Autopilot_flight_leader->orient.vec.uvec);
|
||||
break;
|
||||
|
||||
case 7: // down-right
|
||||
case 15:
|
||||
case 18:
|
||||
vm_vec_add(&perp, &zero, &Player_obj->orient.vec.rvec);
|
||||
vm_vec_add(&perp, &zero, &Autopilot_flight_leader->orient.vec.rvec);
|
||||
if (capship_placed[0] < 1)
|
||||
vm_vec_sub(&perp, &perp, &Player_obj->orient.vec.uvec);
|
||||
vm_vec_sub(&perp, &perp, &Autopilot_flight_leader->orient.vec.uvec);
|
||||
else
|
||||
vm_vec_add(&perp, &perp, &Player_obj->orient.vec.uvec);
|
||||
vm_vec_add(&perp, &perp, &Autopilot_flight_leader->orient.vec.uvec);
|
||||
break;
|
||||
|
||||
default:
|
||||
case 0: // right
|
||||
case 8:
|
||||
case 17:
|
||||
perp = Player_obj->orient.vec.rvec;
|
||||
perp = Autopilot_flight_leader->orient.vec.rvec;
|
||||
break;
|
||||
|
||||
}
|
||||
vm_vec_normalize(&perp);
|
||||
//vm_vec_scale(&perp, 2*radius+distance);
|
||||
|
||||
vm_vec_scale(&perp, Player_obj->radius+radius);
|
||||
vm_vec_scale(&perp, Autopilot_flight_leader->radius+radius);
|
||||
|
||||
// randomly scale up/down by up to 20%
|
||||
j = 20-myrand()%40; // [-20,20]
|
||||
@@ -971,16 +851,8 @@ void StartAutopilot()
|
||||
camMovingTime = int(4.5*float(tc_factor));
|
||||
set_time_compression((float)tc_factor);
|
||||
}
|
||||
}
|
||||
|
||||
// ********************************************************************************************
|
||||
// Checks if autopilot should automatically die
|
||||
// Returns true if:
|
||||
// * Targetted waypoint < 10,000 meters away
|
||||
// * Enemy < 10,000 meters
|
||||
bool Autopilot_AutoDiable()
|
||||
{
|
||||
return !CanAutopilot();
|
||||
return true;
|
||||
}
|
||||
|
||||
// ********************************************************************************************
|
||||
@@ -993,6 +865,8 @@ void EndAutoPilot()
|
||||
{
|
||||
AutoPilotEngaged = false;
|
||||
|
||||
Autopilot_flight_leader = NULL;
|
||||
|
||||
set_time_compression(1);
|
||||
lock_time_compression(false);
|
||||
Player_use_ai = 0;
|
||||
@@ -1004,8 +878,7 @@ void EndAutoPilot()
|
||||
{
|
||||
Cutscene_bar_flags &= ~CUB_CUTSCENE;
|
||||
}
|
||||
Viewer_mode &= ~VM_FREECAMERA;
|
||||
hud_set_draw(1);
|
||||
cam_reset_camera();
|
||||
CinematicStarted = false;
|
||||
}
|
||||
|
||||
@@ -1041,8 +914,10 @@ void EndAutoPilot()
|
||||
)
|
||||
{
|
||||
//unlock their weaponry
|
||||
//Ships[i].flags2 &= ~(SF2_PRIMARIES_LOCKED | SF2_SECONDARIES_LOCKED);
|
||||
if ( LockWeaponsDuringAutopilot )
|
||||
Ships[i].flags2 &= ~(SF2_PRIMARIES_LOCKED | SF2_SECONDARIES_LOCKED);
|
||||
Ai_info[Ships[i].ai_index].waypoint_speed_cap = -1; // uncap their speed
|
||||
Ai_info[Ships[i].ai_index].mode = AIM_NONE; // make AI re-evaluate current ship mode
|
||||
|
||||
for (j = 0; j < MAX_AI_GOALS; j++)
|
||||
{
|
||||
@@ -1059,7 +934,7 @@ void EndAutoPilot()
|
||||
{
|
||||
for (j = 0; j < MAX_AI_GOALS; j++)
|
||||
{
|
||||
ai_goal *aigp = &Wings[i].ai_goals[j];
|
||||
ai_goal *aigp = &Wings[Ships[i].wingnum].ai_goals[j];
|
||||
|
||||
if ( ((aigp->ship_name != NULL) && !stricmp(aigp->ship_name, goal_name))
|
||||
&& (aigp->ai_mode == goal) )
|
||||
@@ -1102,45 +977,69 @@ void EndAutoPilot()
|
||||
|
||||
// ********************************************************************************************
|
||||
|
||||
void camera_face(vec3d &loc)
|
||||
camera* nav_get_set_camera()
|
||||
{
|
||||
vec3d destvec;
|
||||
matrix cam_orient;
|
||||
vm_vec_sub(&destvec, &loc, Free_camera->get_position());
|
||||
vm_vector_2_matrix(&cam_orient, &destvec, &Player_obj->orient.vec.uvec, &Player_obj->orient.vec.rvec);
|
||||
Free_camera->set_rotation(&cam_orient, 0.0f, 0.0f);
|
||||
static camid nav_camera;
|
||||
if(!nav_camera.isValid())
|
||||
{
|
||||
nav_camera = cam_create("Nav camera");
|
||||
}
|
||||
|
||||
cam_set_camera(nav_camera);
|
||||
|
||||
return nav_camera.getCamera();
|
||||
}
|
||||
|
||||
void nav_warp(bool prewarp=false)
|
||||
{
|
||||
// ok... find our end distance - norm1 is still a unit vector in the direction from the player to the navpoint
|
||||
vec3d targetPos, tpos=Player_obj->pos, pos;
|
||||
|
||||
vm_vec_sub(&pos, Navs[CurrentNav].GetPosition(), &Player_obj->pos);
|
||||
/* ok... find our end distance - norm1 is still a unit vector in the
|
||||
direction from the flight leader to the navpoint */
|
||||
vec3d targetPos, tpos=Autopilot_flight_leader->pos, pos, velocity;
|
||||
|
||||
/* calculate a vector that we can use to make a path from the flight
|
||||
leader's location to the nav point */
|
||||
vm_vec_sub(&pos, Navs[CurrentNav].GetPosition(), &Autopilot_flight_leader->pos);
|
||||
vm_vec_normalize(&pos);
|
||||
velocity = pos; // make a copy for later when we do setup veleocity vector
|
||||
vm_vec_scale(&pos, 250.0f); // we move by increments of 250
|
||||
|
||||
while (CanAutopilotPos(tpos))
|
||||
/* using the vector of the flight leaders's path, simulate moving the
|
||||
flight along this path by checking the autopilot conditions as specific
|
||||
intervals along the path*/
|
||||
while (CanAutopilot(tpos))
|
||||
{
|
||||
vm_vec_add(&tpos, &tpos, &pos);
|
||||
}
|
||||
vm_vec_sub(&targetPos, &tpos, &Player_obj->pos); //targetPos is actually a projection in a the direction toward the nav
|
||||
vm_vec_sub(&targetPos, &tpos, &Autopilot_flight_leader->pos);
|
||||
/* targetPos is actually a vector that describes the exact 3D movement that
|
||||
the flgith leader needs to execute to reach the location that the auto
|
||||
pilot is to shut off */
|
||||
|
||||
// Check if we are actually just setting up for the cinimatic shot of the
|
||||
// flight flying on autopilot. Only jump halfway. Also we also need to
|
||||
// put the camera in the correct position to show the player this cinimatic
|
||||
if (prewarp)
|
||||
{
|
||||
vm_vec_scale(&targetPos, 0.5);
|
||||
vm_vec_add(&cameraPos, &cameraPos, &targetPos);
|
||||
}
|
||||
|
||||
/* calcuate the speed that everyone is supposed to be going so that there
|
||||
is no need for anyone to accelerate or decelerate (most obvious with
|
||||
the player's fighter slowing down as it changes the camera pan speed). */
|
||||
Assert( Ai_info[Ships[Autopilot_flight_leader->instance].ai_index].waypoint_speed_cap > 0 );
|
||||
vm_vec_scale(&velocity, (float)Ai_info[Ships[Autopilot_flight_leader->instance].ai_index].waypoint_speed_cap);
|
||||
|
||||
// Find all ships that are supposed to autopilot with the player and move them
|
||||
// to the cinimatic location or the final destination
|
||||
for (int i = 0; i < MAX_SHIPS; i++)
|
||||
{
|
||||
if (Ships[i].objnum != -1 &&
|
||||
(Ships[i].flags2 & SF2_NAVPOINT_CARRY ||
|
||||
(Ships[i].wingnum != -1 && Wings[Ships[i].wingnum].flags & WF_NAV_CARRY)
|
||||
)
|
||||
)
|
||||
if (Ships[i].objnum != -1
|
||||
&& (Ships[i].flags2 & SF2_NAVPOINT_CARRY
|
||||
|| (Ships[i].wingnum != -1 && Wings[Ships[i].wingnum].flags & WF_NAV_CARRY)))
|
||||
{
|
||||
vm_vec_add(&Objects[Ships[i].objnum].pos, &Objects[Ships[i].objnum].pos, &targetPos);
|
||||
Objects[Ships[i].objnum].phys_info.vel = velocity;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1163,11 +1062,13 @@ void NavSystem_Do()
|
||||
{
|
||||
if (The_mission.flags & MISSION_FLAG_USE_AP_CINEMATICS)
|
||||
{
|
||||
camera *cam = nav_get_set_camera();
|
||||
if (CinematicStarted)
|
||||
{
|
||||
// update our cinematic and possibly perform warp
|
||||
//if (!CameraMoving)
|
||||
camera_face(Player_obj->pos);
|
||||
if(cam != NULL)
|
||||
cam->set_rotation_facing(&Player_obj->pos);
|
||||
|
||||
if (timestamp() >= MoveCamera && !CameraMoving && vm_vec_mag(&cameraTarget) > 0.0f)
|
||||
{
|
||||
@@ -1177,7 +1078,7 @@ void NavSystem_Do()
|
||||
}
|
||||
|
||||
|
||||
if (timestamp() >= EndAPCinematic || Autopilot_AutoDiable())
|
||||
if (timestamp() >= EndAPCinematic || !CanAutopilot())
|
||||
{
|
||||
nav_warp();
|
||||
EndAutoPilot();
|
||||
@@ -1191,18 +1092,20 @@ void NavSystem_Do()
|
||||
Cutscene_bar_flags |= CUB_CUTSCENE;
|
||||
Cutscene_bar_flags &= ~CUB_GRADUAL;
|
||||
}
|
||||
Viewer_mode |= VM_FREECAMERA;
|
||||
hud_set_draw(0);
|
||||
nav_warp(true);
|
||||
|
||||
Free_camera->set_position(&cameraPos);
|
||||
camera_face(Player_obj->pos);
|
||||
if(cam != NULL)
|
||||
{
|
||||
cam->set_position(&cameraPos);
|
||||
cam->set_rotation_facing(&Autopilot_flight_leader->pos);
|
||||
}
|
||||
|
||||
CinematicStarted = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Autopilot_AutoDiable())
|
||||
if (!CanAutopilot())
|
||||
EndAutoPilot();
|
||||
|
||||
}
|
||||
@@ -1275,7 +1178,10 @@ void NavSystem_Do()
|
||||
}
|
||||
}
|
||||
|
||||
// autopilot linking
|
||||
/* Link in any ships that need to be linked in when the player gets close
|
||||
enough. Always done by the player because: "making sure the AI fighters
|
||||
are where they're supposed to be at all times is like herding cats" -Woolie Wool
|
||||
*/
|
||||
for (int i = 0; i < MAX_SHIPS; i++)
|
||||
{
|
||||
if (Ships[i].objnum != -1 && Ships[i].flags2 & SF2_NAVPOINT_NEEDSLINK)
|
||||
@@ -1325,7 +1231,7 @@ void send_autopilot_msg(char *msg, char *snd)
|
||||
// send/play
|
||||
if (audio_handle != -1)
|
||||
{
|
||||
audiostream_play(audio_handle, Master_event_music_volume, 0);
|
||||
audiostream_play(audio_handle, (Master_event_music_volume * aav_music_volume), 0);
|
||||
}
|
||||
|
||||
if (strlen(msg) != 0 && strcmp(msg, "none"))
|
||||
@@ -1355,7 +1261,7 @@ void NavSystem_Init()
|
||||
void parse_autopilot_table(char *filename)
|
||||
{
|
||||
int rval;
|
||||
std::vector<std::string> lines;
|
||||
SCP_vector<std::string> lines;
|
||||
|
||||
// open localization
|
||||
lcl_ext_open();
|
||||
@@ -1370,7 +1276,7 @@ void parse_autopilot_table(char *filename)
|
||||
if (filename == NULL)
|
||||
read_file_text_from_array(defaults_get_file("autopilot.tbl"));
|
||||
else
|
||||
read_file_text(filename);
|
||||
read_file_text(filename, CF_TYPE_TABLES);
|
||||
|
||||
reset_parse();
|
||||
|
||||
@@ -1381,6 +1287,21 @@ void parse_autopilot_table(char *filename)
|
||||
required_string("$Link Distance:");
|
||||
stuff_int(&NavLinkDistance);
|
||||
|
||||
if (optional_string("$Interrupt autopilot if enemy within distance:"))
|
||||
stuff_int(&AutopilotMinEnemyDistance);
|
||||
else
|
||||
AutopilotMinEnemyDistance = 5000;
|
||||
|
||||
if (optional_string("$Interrupt autopilot if asteroid within distance:"))
|
||||
stuff_int(&AutopilotMinAsteroidDistance);
|
||||
else
|
||||
AutopilotMinAsteroidDistance = 1000;
|
||||
|
||||
if (optional_string("$Lock Weapons During Autopilot:"))
|
||||
stuff_boolean(&LockWeaponsDuringAutopilot);
|
||||
else
|
||||
LockWeaponsDuringAutopilot = false;
|
||||
|
||||
// optional no cutscene bars
|
||||
if (optional_string("+No_Cutscene_Bars"))
|
||||
UseCutsceneBars = false;
|
||||
@@ -1389,7 +1310,9 @@ void parse_autopilot_table(char *filename)
|
||||
Cmdline_autopilot_interruptable = 0;
|
||||
|
||||
// No Nav selected message
|
||||
char *msg_tags[] = { "$No Nav Selected:", "$Gliding:", "$Too Close:", "$Hostiles:", "$Linked:", "$Hazard:" };
|
||||
char *msg_tags[] = { "$No Nav Selected:", "$Gliding:",
|
||||
"$Too Close:", "$Hostiles:", "$Linked:", "$Hazard:",
|
||||
"$Support Present:", "$Support Working:" };
|
||||
for (int i = 0; i < NP_NUM_MESSAGES; i++)
|
||||
{
|
||||
required_string(msg_tags[i]);
|
||||
@@ -1671,7 +1594,7 @@ unsigned int DistanceTo(char *nav)
|
||||
|
||||
unsigned int DistanceTo(int nav)
|
||||
{
|
||||
if (nav > MAX_NAVPOINTS && nav < 0)
|
||||
if (nav >= MAX_NAVPOINTS && nav < 0)
|
||||
return 0xFFFFFFFF;
|
||||
|
||||
return (uint)vm_vec_dist_quick(&Player_obj->pos, Navs[nav].GetPosition());
|
||||
@@ -1688,7 +1611,7 @@ bool IsVisited(char *nav)
|
||||
|
||||
bool IsVisited(int nav)
|
||||
{
|
||||
if (nav > MAX_NAVPOINTS && nav < 0)
|
||||
if (nav >= MAX_NAVPOINTS && nav < 0)
|
||||
return 0;
|
||||
|
||||
if (Navs[nav].flags & NP_VISITED)
|
||||
|
||||
+18
-58
@@ -2,56 +2,13 @@
|
||||
// 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 "object/object.h"
|
||||
#include <map>
|
||||
|
||||
// milliseconds between updates
|
||||
@@ -81,13 +38,15 @@ struct NavPoint
|
||||
};
|
||||
|
||||
|
||||
#define NP_NUM_MESSAGES 6
|
||||
#define NP_MSG_FAIL_NOSEL 0
|
||||
#define NP_MSG_FAIL_GLIDING 1
|
||||
#define NP_MSG_FAIL_TOCLOSE 2
|
||||
#define NP_MSG_FAIL_HOSTILES 3
|
||||
#define NP_MSG_MISC_LINKED 4
|
||||
#define NP_MSG_FAIL_HAZARD 5
|
||||
#define NP_MSG_FAIL_SUPPORT_PRESENT 6
|
||||
#define NP_MSG_FAIL_SUPPORT_WORKING 7
|
||||
#define NP_NUM_MESSAGES 8
|
||||
|
||||
struct NavMessage
|
||||
{
|
||||
@@ -106,27 +65,28 @@ extern std::map<int,int> autopilot_wings;
|
||||
bool Sel_NextNav();
|
||||
|
||||
|
||||
// Tell us is autopilot is allow
|
||||
// Tell us if autopilot is allowed
|
||||
// This needs:
|
||||
// * Nav point selected
|
||||
// * No enemies within 5,000 meters
|
||||
// * No enemies within AutopilotMinEnemyDistance meters
|
||||
// * No asteroids within AutopilotMinAsteroidDistance meters
|
||||
// * Destination > 1,000 meters away
|
||||
bool CanAutopilot(bool send_msg=false);
|
||||
bool CanAutopilotPos(vec3d targetPos);
|
||||
// * Support ship not present or is actively leaving
|
||||
bool CanAutopilot(vec3d targetPos, bool send_msg=false);
|
||||
|
||||
// Check if autopilot is allowed at player's current position
|
||||
// See CanAutopilot(vec3d, bool) for more information
|
||||
inline bool CanAutopilot(bool send_msg=false) { return CanAutopilot(Player_obj->pos, send_msg); }
|
||||
|
||||
// Engages autopilot
|
||||
// This does:
|
||||
// * Checks if Autopilot is allowed. See CanAutopilot() for conditions.
|
||||
// * Control switched from player to AI
|
||||
// * Time compression to 32x
|
||||
// * Tell AI to fly to 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();
|
||||
// * Sets max waypoint speed to the best-speed of the slowest ship tagged
|
||||
// Returns false if autopilot cannot be started. True otherwise.
|
||||
bool StartAutopilot();
|
||||
|
||||
// Disengages autopilot
|
||||
// this does:
|
||||
|
||||
+15
-69
@@ -7,64 +7,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* $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__
|
||||
@@ -87,17 +30,18 @@
|
||||
#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
|
||||
#define BM_TYPE_PNG 5 // PNG
|
||||
#define BM_TYPE_JPG 6 // 32 bit jpeg
|
||||
#define BM_TYPE_ANI 7 // in-house ANI format
|
||||
#define BM_TYPE_EFF 8 // 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)
|
||||
#define BM_TYPE_DXT1 9 // 24 bit with switchable alpha (compressed)
|
||||
#define BM_TYPE_DXT3 10 // 32 bit with 4 bit alpha (compressed)
|
||||
#define BM_TYPE_DXT5 11 // 32 bit with 8 bit alpha (compressed)
|
||||
#define BM_TYPE_CUBEMAP_DDS 12 // generic DDS cubemap (uncompressed cubemap surface)
|
||||
#define BM_TYPE_CUBEMAP_DXT1 13 // 24-bit cubemap (compressed cubemap surface)
|
||||
#define BM_TYPE_CUBEMAP_DXT3 14 // 32-bit cubemap (compressed cubemap surface)
|
||||
#define BM_TYPE_CUBEMAP_DXT5 15 // 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
|
||||
@@ -109,8 +53,9 @@ 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
|
||||
int num_frames; // used for animation -- number of frames in the animation
|
||||
ubyte fps; // used for animation -- frames per second
|
||||
int keyframe; // used for animation -- keyframe info
|
||||
|
||||
struct {
|
||||
// stuff for static animations
|
||||
@@ -174,6 +119,7 @@ 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_png( 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 );
|
||||
|
||||
+243
-1076
File diff suppressed because it is too large.
Load diff
+8
-429
@@ -7,432 +7,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Bmpman/BmpMan.h $
|
||||
*
|
||||
* $Revision: 2.37.2.6 $
|
||||
* $Date: 2007-03-22 20:14:16 $
|
||||
* $Author: taylor $
|
||||
*
|
||||
* Prototypes for Bitmap Manager functions
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.37.2.5 2007/02/11 09:51:21 taylor
|
||||
* remove some dead code
|
||||
* better texture memory handling (a work in-progress)
|
||||
* new image finding/loading
|
||||
* get rid of -pcx32 and -jpgtga
|
||||
* change the game_busy() reporting during bitmap page-in to only catch one frame of an animation
|
||||
* fix numerous little bugs in gropenglbmpman relating to -img2dds
|
||||
*
|
||||
* Revision 2.37.2.4 2007/01/07 12:07:40 taylor
|
||||
* fix bm_page_in_texture() so that it will load all frames of an animation (caused slowdowns in-game with it)
|
||||
*
|
||||
* Revision 2.37.2.3 2006/07/05 23:41:02 Goober5000
|
||||
* spelling
|
||||
*
|
||||
* Revision 2.37.2.2 2006/07/05 23:36:55 Goober5000
|
||||
* cvs comment tweaks
|
||||
*
|
||||
* Revision 2.37.2.1 2006/06/22 14:59:44 taylor
|
||||
* fix various things that Valgrind has been complaining about
|
||||
*
|
||||
* Revision 2.37 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.36 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.35 2006/02/16 05:00:01 taylor
|
||||
* various bmpman related fixes
|
||||
* - some new error checking (and fixes related to that) and cleanup
|
||||
* - fix EFFs not getting released/unloaded properly (was in a local tree but apparently missed CVS)
|
||||
* - minor fixes for bm_release() to produce a more properly cleaned slot
|
||||
* - use fast unloading for page_in stuff since we don't actually want really want the load count changing for texture maps
|
||||
* and to make sure that we free the memory usage regardless of load count
|
||||
*
|
||||
* Revision 2.34 2006/01/21 02:22:04 wmcoolmon
|
||||
* Scripting updates; Special scripting image list; Better operator meta; Orientation type; Wing type; Texture type. Fix for MSVC7 compiling.
|
||||
*
|
||||
* Revision 2.33 2005/12/06 03:05:53 taylor
|
||||
* add base support for 8-bit DDS images
|
||||
* clean up some DDS error messages and other minor bug/comment fixes
|
||||
* move bitmap stuff from pstypes.h, it makes more sense here anyway
|
||||
* start of 8-bit palette conversion, needs work but is here for WMCoolmon to look at and play with
|
||||
*
|
||||
* Revision 2.32 2005/12/04 19:07:48 wmcoolmon
|
||||
* Final commit of codebase
|
||||
*
|
||||
* Revision 2.31 2005/11/08 01:03:59 wmcoolmon
|
||||
* More warnings instead of Int3s/Asserts, better Lua scripting, weapons_expl.tbl is no longer needed nor read, added "$Disarmed ImpactSnd:", fire-beam fix
|
||||
*
|
||||
* Revision 2.30 2005/09/26 04:53:19 Goober5000
|
||||
* moved these per taylor's recommendation
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.29 2005/09/26 04:08:53 Goober5000
|
||||
* some more cleanup
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.28 2005/09/26 02:15:02 Goober5000
|
||||
* okay, this should all be working :)
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.27 2005/09/25 05:13:07 Goober5000
|
||||
* hopefully complete species upgrade
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.26 2005/09/24 07:07:17 Goober5000
|
||||
* another species overhaul
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.25 2005/08/20 20:34:49 taylor
|
||||
* some bmpman and render_target function name changes so that they make sense
|
||||
* always use bm_set_render_target() rather than the gr_ version so that the graphics state is set properly
|
||||
* save the original gamma ramp on OGL init so that it can be restored on exit
|
||||
*
|
||||
* Revision 2.24 2005/07/13 02:50:49 Goober5000
|
||||
* remove PreProcDefine #includes in FS2
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.23 2005/06/19 02:28:55 taylor
|
||||
* add a _fast version of bm_unload() to be used in modelinterp and future graphics API code
|
||||
* clean up some modelinterp code to not use memcpy() everywhere so it's more platform compatible and matches old code (Jens Granseuer)
|
||||
* NaN check to catch shards-of-death and prevent hitting an Assert() (Jens Granseuer)
|
||||
* fix jumpnode code to catch model errors and close a memory leak
|
||||
* make the call to bm_unload_all() after model_free_all() since we will get bmpman screwups otherwise
|
||||
* don't show hardware sound RAM when using OpenAL build, it will always be 0
|
||||
* print top-right memory figures in debug builds slighly further over when 1024+ res
|
||||
*
|
||||
* Revision 2.22 2005/04/24 12:56:42 taylor
|
||||
* really are too many changes here:
|
||||
* - remove all bitmap section support and fix problems with previous attempt
|
||||
* ( code/bmpman/bmpman.cpp, code/bmpman/bmpman.h, code/globalincs/pstypes.h,
|
||||
* code/graphics/2d.cpp, code/graphics/2d.h code/graphics/grd3dbmpman.cpp,
|
||||
* code/graphics/grd3dinternal.h, code/graphics/grd3drender.cpp, code/graphics/grd3dtexture.cpp,
|
||||
* code/graphics/grinternal.h, code/graphics/gropengl.cpp, code/graphics/gropengl.h,
|
||||
* code/graphics/gropengllight.cpp, code/graphics/gropengltexture.cpp, code/graphics/gropengltexture.h,
|
||||
* code/graphics/tmapper.h, code/network/multi_pinfo.cpp, code/radar/radarorb.cpp
|
||||
* code/render/3ddraw.cpp )
|
||||
* - use CLAMP() define in gropengl.h for gropengllight instead of single clamp() function
|
||||
* - remove some old/outdated code from gropengl.cpp and gropengltexture.cpp
|
||||
*
|
||||
* Revision 2.21 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.20 2005/03/07 13:10:19 bobboau
|
||||
* commit of render target code, d3d should be totaly functional,
|
||||
* OGL still needs implementation.
|
||||
*
|
||||
* Revision 2.19 2005/02/10 14:38:50 taylor
|
||||
* fix an issue with bm_set_components()
|
||||
* abs is for ints fabsf is for floats (camera.cpp)
|
||||
* make the in-cockpit stuff OGL friendly
|
||||
*
|
||||
* Revision 2.18 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
|
||||
*
|
||||
* Revision 2.17 2004/11/21 15:59:45 Kazan
|
||||
* conflict res
|
||||
*
|
||||
* Revision 2.16 2004/10/31 21:26:27 taylor
|
||||
* bmpman merge, EFF animation support, better page in stuff, dozen or so smaller fixes and cleanup
|
||||
*
|
||||
* Revision 2.15 2004/10/06 22:02:54 Kazan
|
||||
* interface corruption fix - thanks taylor (MAX_BITMAPS upped to 7000)
|
||||
*
|
||||
* Revision 2.14 2004/08/11 05:06:18 Kazan
|
||||
* added preprocdefines.h to prevent what happened with fred -- make sure to make all fred2 headers include this file as the _first_ include -- i have already modified fs2 files to do this
|
||||
*
|
||||
* Revision 2.13 2004/05/06 22:35:26 taylor
|
||||
* DDS mipmap reading, remove unneeded bm_unlock() during page in
|
||||
*
|
||||
* Revision 2.12 2004/04/01 15:31:20 taylor
|
||||
* don't use interface anis as ship textures
|
||||
*
|
||||
* Revision 2.11 2004/03/05 09:01:54 Goober5000
|
||||
* Uber pass at reducing #includes
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.10 2003/12/04 20:39:08 randomtiger
|
||||
* 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
|
||||
*
|
||||
* Revision 2.9 2003/11/19 20:37:22 randomtiger
|
||||
* 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.
|
||||
*
|
||||
* Revision 2.8 2003/11/07 18:31:01 randomtiger
|
||||
* 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.
|
||||
*
|
||||
* Revision 2.7 2003/10/24 17:35:04 randomtiger
|
||||
* Implemented support for 32bit TGA and JPG for D3D
|
||||
* Also 32 bit PCX, but it still has some bugs to be worked out
|
||||
* Moved convert_24_to_16 out of the bitmap pfunction structures and into packunpack.cpp because thats the only place that uses it.
|
||||
*
|
||||
* Revision 2.6 2003/08/16 03:52:22 bobboau
|
||||
* 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
|
||||
*
|
||||
* Revision 2.5 2003/08/12 03:18:32 bobboau
|
||||
* Specular 'shine' mapping;
|
||||
* useing a phong lighting model I have made specular highlights
|
||||
* that are mapped to the model,
|
||||
* rendering them is still slow, but they look real purdy
|
||||
*
|
||||
* also 4 new (untested) comand lines, the XX is a floating point value
|
||||
* -spec_exp XX
|
||||
* the n value, you can set this from 0 to 200 (actualy more than that, but this is the recomended range), it will make the highlights bigger or smaller, defalt is 16.0 so start playing around there
|
||||
* -spec_point XX
|
||||
* -spec_static XX
|
||||
* -spec_tube XX
|
||||
* these are factors for the three diferent types of lights that FS uses, defalt is 1.0,
|
||||
* static is the local stars,
|
||||
* point is weapons/explosions/warp in/outs,
|
||||
* tube is beam weapons,
|
||||
* for thouse of you who think any of these lights are too bright you can configure them you're self for personal satisfaction
|
||||
*
|
||||
* Revision 2.4 2003/03/18 10:07:00 unknownplayer
|
||||
* The big DX/main line merge. This has been uploaded to the main CVS since I can't manage to get it to upload to the DX branch. Apologies to all who may be affected adversely, but I'll work to debug it as fast as I can.
|
||||
*
|
||||
* Revision 2.3 2003/01/19 01:07:41 bobboau
|
||||
* redid the way glow maps are handled; you now must set a global variable before you render a poly that uses a glow map, then set it to -1 when you're done with it
|
||||
* fixed a few other misc bugs too
|
||||
*
|
||||
* Revision 2.2 2003/01/18 19:55:16 phreak
|
||||
* fixed around the bmpman system to now accept compressed textures
|
||||
*
|
||||
* Revision 2.1 2003/01/05 23:41:50 bobboau
|
||||
* disabled decals (for now), removed the warp ray thingys,
|
||||
* made some better error mesages while parseing weapons and ships tbls,
|
||||
* and... oh ya, added glow mapping
|
||||
*
|
||||
* Revision 2.0.2.10 2002/11/04 21:24:59 randomtiger
|
||||
*
|
||||
* When running in D3D all ani's are memory mapped for speed, this takes up more memory but stops gametime locking of textures which D3D8 hates.
|
||||
* Added new command line tag Cmdline_d3dlowmem for people who dont want to make use of this because they have no memory.
|
||||
* Cleaned up some more texture stuff enabled console debug for D3D.
|
||||
*
|
||||
* Revision 2.0.2.9 2002/11/04 16:04:20 randomtiger
|
||||
*
|
||||
* Tided up some bumpman stuff and added a few function points to gr_screen. - RT
|
||||
*
|
||||
* Revision 2.0.2.8 2002/11/04 03:02:28 randomtiger
|
||||
*
|
||||
* I have made some fairly drastic changes to the bumpman system. Now functionality can be engine dependant.
|
||||
* This is so D3D8 can call its own loading code that will allow good efficient loading and use of textures that it desparately needs without
|
||||
* turning bumpman.cpp into a total hook infested nightmare. Note the new bumpman code is still relying on a few of the of the old functions and all of the old bumpman arrays.
|
||||
*
|
||||
* I have done this by adding to the gr_screen list of function pointers that are set up by the engines init functions.
|
||||
* I have named the define calls the same name as the original 'bm_' functions so that I havent had to change names all through the code.
|
||||
*
|
||||
* Rolled back to an old version of bumpman and made a few changes.
|
||||
* Added new files: grd3dbumpman.cpp and .h
|
||||
* Moved the bitmap init function to after the 3D engine is initialised
|
||||
* Added includes where needed
|
||||
* Disabled (for now) the D3D8 TGA loading - RT
|
||||
*
|
||||
* Revision 2.0.2.7 2002/10/26 01:24:22 randomtiger
|
||||
* Fixed debug bitmap compiling bug.
|
||||
* Fixed tga bug. - RT
|
||||
*
|
||||
* Revision 2.0.2.6 2002/10/22 17:46:17 randomtiger
|
||||
* Fixed new TGA code texturing bug. - RT
|
||||
*
|
||||
* Revision 2.0.2.5 2002/10/21 16:33:40 randomtiger
|
||||
* Added D3D only 32 bit TGA functionality. Will load a texture as big as your graphics card allows. Code not finished yet and will forge the beginnings of the new texture system. - RT
|
||||
*
|
||||
* Revision 2.0.2.4 2002/10/19 23:56:39 randomtiger
|
||||
* Changed generic bitmap code to allow maximum dimensions to be determined by 3D's engines maximum texture size query.
|
||||
* Defaults to 256 as it was before. Also added base code for reworking the texture code to be more efficient. - RT
|
||||
*
|
||||
* Revision 2.0.2.3 2002/10/02 11:40:19 randomtiger
|
||||
* Bmpmap has been reverted to an old non d3d8 version.
|
||||
* All d3d8 code is now in the proper place.
|
||||
* PCX code is now working to an extent. Problems with alpha though.
|
||||
* Ani's work slowly with alpha problems.
|
||||
* Also I have done a bit of tidying - RT
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:21 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
* Revision 1.1 2002/05/02 18:03:04 mharris
|
||||
* Initial checkin - converted filenames and includes to lower case
|
||||
*
|
||||
*
|
||||
* 16 8/10/99 6:54p Dave
|
||||
* Mad optimizations. Added paging to the nebula effect.
|
||||
*
|
||||
* 15 8/06/99 1:52p Dave
|
||||
* Bumped up MAX_BITMAPS for the demo.
|
||||
*
|
||||
* 14 7/15/99 9:20a Andsager
|
||||
* FS2_DEMO initial checkin
|
||||
*
|
||||
* 13 7/13/99 1:15p Dave
|
||||
* 32 bit support. Whee!
|
||||
*
|
||||
* 12 6/29/99 10:35a Dave
|
||||
* Interface polygon bitmaps! Whee!
|
||||
*
|
||||
* 11 6/16/99 4:06p Dave
|
||||
* New pilot info popup. Added new draw-bitmap-as-poly function.
|
||||
*
|
||||
* 10 5/05/99 9:02p Dave
|
||||
* Fixed D3D aabitmap rendering. Spiffed up nebula effect a bit (added
|
||||
* rotations, tweaked values, made bitmap selection more random). Fixed
|
||||
* D3D beam weapon clipping problem. Added D3d frame dumping.
|
||||
*
|
||||
* 9 2/08/99 5:07p Dave
|
||||
* FS2 chat server support. FS2 specific validated missions.
|
||||
*
|
||||
* 8 2/05/99 12:52p Dave
|
||||
* Fixed Glide nondarkening textures.
|
||||
*
|
||||
* 7 2/03/99 11:44a Dave
|
||||
* Fixed d3d transparent textures.
|
||||
*
|
||||
* 6 12/06/98 2:36p Dave
|
||||
* Drastically improved nebula fogging.
|
||||
*
|
||||
* 5 12/01/98 4:46p Dave
|
||||
* Put in targa bitmap support (16 bit).
|
||||
*
|
||||
* 4 12/01/98 8:06a Dave
|
||||
* Temporary checkin to fix some texture transparency problems in d3d.
|
||||
*
|
||||
* 3 11/30/98 1:07p Dave
|
||||
* 16 bit conversion, first run.
|
||||
*
|
||||
* 2 10/07/98 10:52a Dave
|
||||
* Initial checkin.
|
||||
*
|
||||
* 1 10/07/98 10:48a Dave
|
||||
*
|
||||
* 32 4/16/98 6:31p Hoffoss
|
||||
* Added function to get filename of a bitmap handle, which we don't have
|
||||
* yet and I need.
|
||||
*
|
||||
* 31 4/02/98 11:40a Lawrance
|
||||
* check for #ifdef DEMO instead of #ifdef DEMO_RELEASE
|
||||
*
|
||||
* 30 3/30/98 4:02p John
|
||||
* Made machines with < 32 MB of RAM use every other frame of certain
|
||||
* bitmaps. Put in code to ke7ep track of how much RAM we've malloc'd.
|
||||
*
|
||||
* 29 3/29/98 4:05p John
|
||||
* New paging code that loads everything necessary at level startup.
|
||||
*
|
||||
* 28 3/26/98 5:21p John
|
||||
* Added new code to preload all bitmaps at the start of a level.
|
||||
* Commented it out, though.
|
||||
*
|
||||
* 27 3/24/98 6:18p John
|
||||
* Hacked MAX_BITMAPS up to 3500
|
||||
*
|
||||
* 26 3/10/98 4:18p John
|
||||
* Cleaned up graphics lib. Took out most unused gr functions. Made D3D
|
||||
* & Glide have popups and print screen. Took out all >8bpp software
|
||||
* support. Made Fred zbuffer. Made zbuffer allocate dynamically to
|
||||
* support Fred. Made zbuffering key off of functions rather than one
|
||||
* global variable.
|
||||
*
|
||||
* 25 3/02/98 6:46p John
|
||||
* Upped MAX_BITMAPS to 2000
|
||||
*
|
||||
* 24 3/02/98 6:00p John
|
||||
* Moved MAX_BITMAPS into BmpMan.h so the stuff in the graphics code that
|
||||
* is dependent on it won't break if it changes. Made ModelCache slots
|
||||
* be equal to MAX_OBJECTS which is what it is.
|
||||
*
|
||||
* 23 2/06/98 8:25p John
|
||||
* Added code for new bitmaps since last frame
|
||||
*
|
||||
* 22 2/06/98 8:10p John
|
||||
* Added code to show amout of texture usage each frame.
|
||||
*
|
||||
* 21 1/29/98 11:48a John
|
||||
* Added new counter measure rendering as model code. Made weapons be
|
||||
* able to have impact explosion.
|
||||
*
|
||||
* 20 1/11/98 2:14p John
|
||||
* Changed a lot of stuff that had to do with bitmap loading. Made cfile
|
||||
* not do callbacks, I put that in global code. Made only bitmaps that
|
||||
* need to load for a level load.
|
||||
*
|
||||
* 19 9/03/97 4:19p John
|
||||
* changed bmpman to only accept ani and pcx's. made passing .pcx or .ani
|
||||
* to bm_load functions not needed. Made bmpman keep track of palettes
|
||||
* for bitmaps not mapped into game palettes.
|
||||
*
|
||||
* 18 8/25/97 11:14p Lawrance
|
||||
* added support for .ani files in bm_load_animation()
|
||||
*
|
||||
* 17 7/16/97 3:07p John
|
||||
*
|
||||
* 16 6/17/97 8:58p Lawrance
|
||||
* fixed bug with not nulling bm.data with USER bitmaps
|
||||
*
|
||||
* 15 6/12/97 2:44a Lawrance
|
||||
* changed bm_unlock() to take an index into bm_bitmaps(). Added
|
||||
* ref_count to bitmap_entry struct
|
||||
*
|
||||
* 14 5/20/97 10:36a John
|
||||
* Fixed problem with user bitmaps and direct3d caching.
|
||||
*
|
||||
* 13 3/24/97 3:25p John
|
||||
* Cleaned up and restructured model_collide code and fvi code. In fvi
|
||||
* made code that finds uvs work.. Added bm_get_pixel to BmpMan.
|
||||
*
|
||||
* 12 2/17/97 5:18p John
|
||||
* Added a bunch of RCS headers to a bunch of old files that don't have
|
||||
* them.
|
||||
*
|
||||
* $NoKeywords: $
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _BMPMAN_H
|
||||
#define _BMPMAN_H
|
||||
@@ -553,10 +128,10 @@ int bm_release( int n, int clear_render_targets = 0 );
|
||||
// It returns a negative number if it couldn't load
|
||||
// the bitmap. On success, it returns the bitmap
|
||||
// number of the first frame and nframes is set.
|
||||
extern int bm_load_animation( char * filename, int * nframes = NULL, int *fps = NULL, int can_drop_frames = 0, int dir_type = CF_TYPE_ANY );
|
||||
extern int bm_load_animation( char * filename, int * nframes = NULL, int *fps = NULL, int *keyframe = NULL, int can_drop_frames = 0, int dir_type = CF_TYPE_ANY );
|
||||
|
||||
//Loads either animation (bm_load_animation) or still image (bm_load)
|
||||
extern int bm_load_either(char *filename, int *nframes = NULL, int *fps = NULL, int can_drop_frames = 0, int dir_type = CF_TYPE_ANY);
|
||||
extern int bm_load_either(char *filename, int *nframes = NULL, int *fps = NULL, int *keyframe = NULL, int can_drop_frames = 0, int dir_type = CF_TYPE_ANY);
|
||||
|
||||
// This locks down a bitmap and returns a pointer to a bitmap
|
||||
// that can be accessed until you call bm_unlock. Only lock
|
||||
@@ -569,6 +144,9 @@ extern bitmap * bm_lock( int bitmapnum, ubyte bpp, ubyte flags );
|
||||
// will also change when the bitmap's data changes.
|
||||
extern uint bm_get_signature( int bitmapnum);
|
||||
|
||||
//gets the image type
|
||||
ubyte bm_get_type(int handle);
|
||||
|
||||
// Unlocks a bitmap
|
||||
extern void bm_unlock( int bitmapnum );
|
||||
|
||||
@@ -694,7 +272,8 @@ void bm_get_components(ubyte *pixel, ubyte *r, ubyte *g, ubyte *b, ubyte *a);
|
||||
extern int GLOWMAP; //this holds a reference to a map that is a fully lit version of its index -Bobboau
|
||||
extern int SPECMAP; //this holds a reference to a map that is for specular mapping -Bobboau
|
||||
extern int ENVMAP; //this holds a reference to a map that is for environment mapping -Bobboau
|
||||
extern int BUMPMAP; //blah blah bumpmapping
|
||||
extern int NORMMAP; // normal mapping
|
||||
extern int HEIGHTMAP; // height map for normal mapping
|
||||
|
||||
int bm_is_compressed(int num);
|
||||
int bm_get_tcache_type(int num);
|
||||
|
||||
+837
-287
File diff suppressed because it is too large.
Load diff
+118
-36
@@ -5,66 +5,137 @@
|
||||
#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
|
||||
{
|
||||
private:
|
||||
friend class avd_camera;
|
||||
protected:
|
||||
char name[NAME_LENGTH];
|
||||
int sig;
|
||||
int flags;
|
||||
|
||||
vec3d position;
|
||||
vec3d *desired_position; //NULL unless we're trying to move somewhere
|
||||
vec3d translation_velocity;
|
||||
vec3d translation_vel_limit;
|
||||
vec3d translation_acc_limit;
|
||||
object_h object_host;
|
||||
int object_host_submodel;
|
||||
|
||||
matrix orientation;
|
||||
matrix *desired_orientation; //NULL unless we're trying to point somewhere
|
||||
vec3d rotation_rate;
|
||||
vec3d rotation_vel_limit;
|
||||
vec3d rotation_acc_limit;
|
||||
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);
|
||||
camera(char *in_name=NULL, int in_signature=-1);
|
||||
~camera();
|
||||
void clear();
|
||||
void reset();
|
||||
|
||||
//Set'
|
||||
//Set
|
||||
void set_name(char *in_name);
|
||||
void set_position(vec3d *in_position = NULL, float in_translation_time = 0.0f, float in_translation_acceleration_time = 0.0f);
|
||||
void set_translation_velocity(vec3d *in_velocity);
|
||||
void set_rotation(matrix *in_orientation = NULL, float in_rotation_time = 0.0f, float in_rotation_acceleration_time = 0.0f);
|
||||
void set_rotation(angles *in_angles, float in_rotation_time = 0.0f, float in_rotation_acceleration_time = 0.0f);
|
||||
void set_rotation_facing(vec3d *in_target, float in_rotation_time = 0.0f, float in_rotation_acceleration_time = 0.0f);
|
||||
void set_rotation_velocity(vec3d *in_rotation_rate);
|
||||
|
||||
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
|
||||
//These return values should never ever be changed, I do this in the interest of speed.
|
||||
char *get_name() {return name;}
|
||||
vec3d *get_position() {return &position;}
|
||||
matrix *get_orientation() {return &orientation;}
|
||||
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];
|
||||
SCP_vector<std::string> text_lines;
|
||||
struct { int x; int y; } text_pos;
|
||||
|
||||
float display_time;
|
||||
float fade_time;
|
||||
color text_color;
|
||||
int text_fontnum;
|
||||
|
||||
//Done with set
|
||||
char imageanim[MAX_FILENAME_LEN];
|
||||
int image_id;
|
||||
int image_pos[2];
|
||||
struct { int x; int y; int w; int h; } image_pos;
|
||||
|
||||
//Time this has been displayed
|
||||
float time_displayed;
|
||||
@@ -72,31 +143,42 @@ private:
|
||||
//When to end it
|
||||
float time_displayed_end;
|
||||
|
||||
bool post_shaded;
|
||||
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(int in_x_pos, int in_y_pos, char* in_text = NULL, char* in_imageanim = NULL,
|
||||
float in_display_time = 0, float in_fade_time = 0.0f, color *in_text_color = NULL, int in_text_fontnum = -1,
|
||||
bool center_x = false, bool center_y = false, int in_width = 0, int in_height = 0, bool post_shaded=false);
|
||||
~subtitle();
|
||||
|
||||
subtitle(const subtitle &sub) { clone(sub); }
|
||||
const subtitle &operator=(const subtitle &sub);
|
||||
|
||||
void do_frame(float frametime);
|
||||
bool is_post_shaded( ) { return post_shaded; }
|
||||
};
|
||||
|
||||
//Some global stuff
|
||||
extern std::vector<subtitle> Subtitles;
|
||||
extern std::vector<camera> Cameras;
|
||||
//Preset cameras
|
||||
extern camera* Free_camera;
|
||||
extern camera* Current_camera;
|
||||
extern SCP_vector<subtitle> Subtitles;
|
||||
extern float VIEWER_ZOOM_DEFAULT;
|
||||
extern float Sexp_fov;
|
||||
|
||||
//Helpful functions
|
||||
void cameras_init();
|
||||
void cameras_close();
|
||||
void cameras_do_frame(float frametime);
|
||||
int cameras_lookup(char *name);
|
||||
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);
|
||||
void subtitles_do_frame_post_shaded(float frametime);
|
||||
|
||||
#endif // _CAMERA_H
|
||||
+40
-430
@@ -7,355 +7,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/CFile/cfile.cpp $
|
||||
* $Revision: 2.40.2.7 $
|
||||
* $Date: 2007-11-21 07:27:45 $
|
||||
* $Author: Goober5000 $
|
||||
*
|
||||
* Utilities for operating on files
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.40.2.6 2007/04/11 18:21:20 taylor
|
||||
* cleanup of chcksum stuff (works properly on 64-bit systems now)
|
||||
* add chksum support for VPs, both a startup in debug builds, and via cmdline option (-verify_vps)
|
||||
* little cleanup in cmdline.cpp (get rid of the remaining "fix bugs" crap)
|
||||
*
|
||||
* Revision 2.40.2.5 2007/03/22 20:22:44 taylor
|
||||
* a little better error handling for cf_exists_full()
|
||||
* add a cf_exists_full_ext() which can find a series of extensions and returns true if any of them exist
|
||||
* use cf_exists_full_ext() for eventmusic file checks (to check for ogg and wav)
|
||||
* get rid of SPM hack, it's wrong (just commented out for now though)
|
||||
* fix a bunch of bugs in cf_find_file_location_ext():
|
||||
* - try to handle files with multiple periods a bit better (for the wav files like: blah_1.5.wav)
|
||||
* - load issue with finding incorrect files by mistake
|
||||
* - prevent finding different file types in various paths/roots
|
||||
*
|
||||
* Revision 2.40.2.4 2007/02/11 09:32:19 taylor
|
||||
* forgot to remove .avi and .mpg from CF_TYPE_ROOT
|
||||
*
|
||||
* Revision 2.40.2.3 2007/02/11 09:25:42 taylor
|
||||
* some CFILE cleanup and slight directory order reorg
|
||||
* add cfopen_special() for quickly opening files that have already been found with cf_find_file_location_ext()
|
||||
* remove NO_SOUND
|
||||
*
|
||||
* Revision 2.40.2.2 2006/12/26 05:11:57 taylor
|
||||
* add .ogg files to movie locations
|
||||
*
|
||||
* Revision 2.40.2.1 2006/07/28 02:43:48 taylor
|
||||
* don't lowercase the dir for chdir on non-Win32 since it could be, and probably is, case sensitive
|
||||
*
|
||||
* Revision 2.40 2006/04/20 06:32:00 Goober5000
|
||||
* proper capitalization according to Volition
|
||||
*
|
||||
* Revision 2.39 2006/04/16 05:28:10 taylor
|
||||
* extra safety check when creating a default path string, filename is optional be we need to available if root0 is missing (CFILE not initted yet)
|
||||
* fix that crazy compiler<->constructor<->linker<->server.txt deal caused by some bad code and a freaky link thing in freespace.cpp
|
||||
*
|
||||
* Revision 2.38 2006/04/12 00:53:26 taylor
|
||||
* DDS now works well on the interface, but I forgot to every commit the CFILE change so that they are actually usable :)
|
||||
*
|
||||
* Revision 2.37 2006/02/16 05:07:50 taylor
|
||||
* minor 64-bit related fixage
|
||||
*
|
||||
* Revision 2.36 2006/02/13 00:20:45 Goober5000
|
||||
* more tweaks, plus clarification of checks for the existence of files
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.35 2006/01/17 02:33:20 wmcoolmon
|
||||
* data/scripts directory
|
||||
*
|
||||
* Revision 2.34 2005/12/28 22:06:47 taylor
|
||||
* fix up cf_find_file_location() and related elements so that it's safer (based on WMC's work, but actually safe this time ;))
|
||||
*
|
||||
* Revision 2.33 2005/12/06 03:13:49 taylor
|
||||
* fix quite a few CFILE issues:
|
||||
* use #define's for path lengths when possible so it's easier to move between functions
|
||||
* fix huge Cfile_stack[] issue (how the hell did that get through :v: QA?)
|
||||
* add Int3() check on cfopen() so it's easier to know if it get's called before cfile is ready to use
|
||||
* move path separators to pstypes.h
|
||||
* fix possible string overruns when setting up CFILE roots
|
||||
* make sure we don't try to init current directory again thinking it's a CD-ROM
|
||||
* add the list of VP roots to debug log, this will undoubtedly be useful
|
||||
* when -nosound is use go ahead and set -nomusic too to both checks are correct
|
||||
* add list of cmdline options to debug log
|
||||
* fix possible overwrite issues with get_version_string() and remove '(fs2_open)' from string plus change OGL->OpenGL, D3D->Direct3D
|
||||
*
|
||||
* Revision 2.32 2005/10/17 00:13:28 wmcoolmon
|
||||
* Some cfile changes that slipped by
|
||||
*
|
||||
* Revision 2.31 2005/10/16 23:15:46 wmcoolmon
|
||||
* Hardened cfile against array overflows
|
||||
*
|
||||
* Revision 2.30 2005/04/19 06:22:20 taylor
|
||||
* 8 months I've been meaning to put this in the Linux tree, me == moron
|
||||
*
|
||||
* Revision 2.29 2005/04/05 05:53:14 taylor
|
||||
* s/vector/vec3d/g, better support for different compilers (Jens Granseuer)
|
||||
*
|
||||
* Revision 2.28 2005/03/02 03:13:00 taylor
|
||||
* that one should never have slipped passed me (Linux specific)
|
||||
*
|
||||
* Revision 2.27 2005/01/30 18:32:41 taylor
|
||||
* merge with Linux/OSX tree - p0130
|
||||
* remove extra brace in cfile.cpp
|
||||
*
|
||||
* Revision 2.26 2005/01/30 12:50:08 taylor
|
||||
* merge with Linux/OSX tree - p0130
|
||||
*
|
||||
* Revision 2.25 2005/01/09 21:40:07 wmcoolmon
|
||||
* Fix for music directory parent
|
||||
*
|
||||
* Revision 2.24 2004/12/25 00:22:54 wmcoolmon
|
||||
* Added .ogg in proper directories
|
||||
*
|
||||
* Revision 2.23 2004/10/31 21:29:00 taylor
|
||||
* EFF animation support
|
||||
*
|
||||
* Revision 2.22 2004/10/09 18:08:33 taylor
|
||||
* almost forgot this for the IBX stuff
|
||||
*
|
||||
* Revision 2.21 2004/07/26 20:47:25 Kazan
|
||||
* remove MCD complete
|
||||
*
|
||||
* Revision 2.20 2004/07/17 09:03:29 taylor
|
||||
* make sure avi and mpg movies get added to file cache
|
||||
*
|
||||
* Revision 2.19 2004/07/12 16:32:42 Kazan
|
||||
* MCD - define _MCD_CHECK to use memory tracking
|
||||
*
|
||||
* Revision 2.18 2004/06/22 23:14:09 wmcoolmon
|
||||
* Nonworking OGG support for sound (not music) added, disabled load-only-used-weapons code, modification to sound system registry code.
|
||||
* OGG code has been commented out, so you don't need the SDK yet.
|
||||
*
|
||||
* Revision 2.17 2004/05/26 02:29:44 wmcoolmon
|
||||
* Scratch that - .tbm is a better extension
|
||||
*
|
||||
* Revision 2.16 2004/05/26 02:26:14 wmcoolmon
|
||||
* Added table chunk extension
|
||||
*
|
||||
* Revision 2.15 2004/05/06 22:12:14 taylor
|
||||
* make sure JPG and DDS files are added to the file cache for maps and effects
|
||||
*
|
||||
* Revision 2.14 2004/03/05 09:01:54 Goober5000
|
||||
* Uber pass at reducing #includes
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.13 2004/02/04 09:02:45 Goober5000
|
||||
* got rid of unnecessary double semicolons
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.12 2003/08/27 01:36:22 Goober5000
|
||||
* fixed a strange thing that Bobboau inexplicably put in
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.11 2003/08/25 04:39:17 Goober5000
|
||||
* fixed unreachable code
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.10 2003/08/22 07:35:07 bobboau
|
||||
* specular code should be bugless now,
|
||||
* cell shadeing has been added activated via the comand line '-cell',
|
||||
* 3D shockwave models, and a transparency method I'm calling edge and center alpha that could be usefull for other things, ask for details
|
||||
*
|
||||
* Revision 2.9 2003/08/20 08:12:08 wmcoolmon
|
||||
* Made cfile_delete return 0 on failure, 1 on success
|
||||
*
|
||||
* Revision 2.8 2003/03/18 10:07:00 unknownplayer
|
||||
* The big DX/main line merge. This has been uploaded to the main CVS since I can't manage to get it to upload to the DX branch. Apologies to all who may be affected adversely, but I'll work to debug it as fast as I can.
|
||||
*
|
||||
* Revision 2.7 2002/11/10 16:29:53 DTP
|
||||
* -DTP reworked mod support,
|
||||
*
|
||||
* Revision 2.6 2002/11/04 08:32:38 DTP
|
||||
* Made sure, that VP and Plain files dont get added twice to the search order. Side-effect of Mod support.
|
||||
*
|
||||
* Revision 2.5 2002/10/30 06:31:05 DTP
|
||||
* doh!, used upper case in include, dont know how much it matters for *nix systems, but here it is
|
||||
*
|
||||
* Revision 2.4 2002/10/27 23:59:28 DTP
|
||||
* DTP; started basic implementation of mod-support
|
||||
* plain files only for now. fs2_open.exe -mod X will look for files in fs2/ X /all-legal-subdirectories. no checking/creating dirs yet. directories must be there.
|
||||
*
|
||||
* Revision 2.3.2.1 2002/09/24 18:56:41 randomtiger
|
||||
* DX8 branch commit
|
||||
*
|
||||
* This is the scub of UP's previous code with the more up to date RT code.
|
||||
* For full details check previous dev e-mails
|
||||
*
|
||||
* Revision 2.3 2002/08/01 01:41:04 penguin
|
||||
* The big include file move
|
||||
*
|
||||
* Revision 2.2 2002/07/29 19:04:48 penguin
|
||||
* added #ifdef _WIN32 around windows-specific system headers
|
||||
*
|
||||
* Revision 2.1 2002/07/07 19:55:58 penguin
|
||||
* Back-port to MSVC
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:21 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
* Revision 1.7 2002/05/21 15:37:14 mharris
|
||||
* Cosmetics - reformat Pathtypes to line up again
|
||||
*
|
||||
* Revision 1.6 2002/05/17 06:45:53 mharris
|
||||
* More porting tweaks. It links! but segfaults...
|
||||
*
|
||||
* Revision 1.5 2002/05/17 02:56:19 mharris
|
||||
* first crack at unix compatibity
|
||||
*
|
||||
* Revision 1.4 2002/05/16 06:03:29 mharris
|
||||
* Unix port changes
|
||||
*
|
||||
* Revision 1.3 2002/05/09 22:58:08 mharris
|
||||
* Added ifdef WIN32 around change-drive functions
|
||||
*
|
||||
* Revision 1.2 2002/05/07 13:23:17 mharris
|
||||
* Port tweaks
|
||||
*
|
||||
* Revision 1.1 2002/05/02 18:03:04 mharris
|
||||
* Initial checkin - converted filenames and includes to lower case
|
||||
*
|
||||
*
|
||||
* 20 9/08/99 10:01p Dave
|
||||
* Make sure game won't run in a drive's root directory. Make sure
|
||||
* standalone routes suqad war messages properly to the host.
|
||||
*
|
||||
* 19 9/08/99 12:03a Dave
|
||||
* Make squad logos render properly in D3D all the time. Added intel anim
|
||||
* directory.
|
||||
*
|
||||
* 18 9/06/99 2:35p Dave
|
||||
* Rename briefing and debriefing voice direcrory paths properly.
|
||||
*
|
||||
* 17 9/03/99 1:31a Dave
|
||||
* CD checking by act. Added support to play 2 cutscenes in a row
|
||||
* seamlessly. Fixed super low level cfile bug related to files in the
|
||||
* root directory of a CD. Added cheat code to set campaign mission # in
|
||||
* main hall.
|
||||
*
|
||||
* 16 8/31/99 9:46a Dave
|
||||
* Support for new cfile cbanims directory.
|
||||
*
|
||||
* 15 8/06/99 11:20a Johns
|
||||
* Don't call game_cd_changed() in a demo or multiplayer beta build.
|
||||
*
|
||||
* 14 6/08/99 2:33p Dave
|
||||
* Fixed release build warning. Put in hud config stuff.
|
||||
*
|
||||
* 13 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.
|
||||
*
|
||||
* 12 4/30/99 12:18p Dave
|
||||
* Several minor bug fixes.
|
||||
*
|
||||
* 11 4/07/99 5:54p Dave
|
||||
* Fixes for encryption in updatelauncher.
|
||||
*
|
||||
* 10 3/28/99 5:58p Dave
|
||||
* Added early demo code. Make objects move. Nice and framerate
|
||||
* independant, but not much else. Don't use yet unless you're me :)
|
||||
*
|
||||
* 9 2/22/99 10:31p Andsager
|
||||
* Get rid of unneeded includes.
|
||||
*
|
||||
* 8 1/12/99 3:15a Dave
|
||||
* Barracks screen support for selecting squad logos. We need real artwork
|
||||
* :)
|
||||
*
|
||||
* 7 11/30/98 1:07p Dave
|
||||
* 16 bit conversion, first run.
|
||||
*
|
||||
* 6 10/29/98 10:41a Dave
|
||||
* Change the way cfile initializes exe directory.
|
||||
*
|
||||
* 5 10/13/98 9:19a Andsager
|
||||
* Add localization support to cfile. Optional parameter with cfopen that
|
||||
* looks for localized files.
|
||||
*
|
||||
* 4 10/12/98 9:54a Dave
|
||||
* Fixed a few file organization things.
|
||||
*
|
||||
* 3 10/07/98 6:27p Dave
|
||||
* Globalized mission and campaign file extensions. Removed Silent Threat
|
||||
* special code. Moved \cache \players and \multidata into the \data
|
||||
* directory.
|
||||
*
|
||||
* 2 10/07/98 10:52a Dave
|
||||
* Initial checkin.
|
||||
*
|
||||
* 1 10/07/98 10:48a Dave
|
||||
*
|
||||
* 110 9/17/98 10:31a Hoffoss
|
||||
* Changed code to use location of executable as root rather than relying
|
||||
* on the cwd being set correctly. This is most helpful in the case of
|
||||
* Fred launching due to the user double-clicking on an .fsm file in
|
||||
* explorer or something (where the cwd is probably the location of the
|
||||
* .fsm file).
|
||||
*
|
||||
* 109 9/11/98 4:14p Dave
|
||||
* Fixed file checksumming of < file_size. Put in more verbose kicking and
|
||||
* PXO stats store reporting.
|
||||
*
|
||||
* 108 9/09/98 5:53p Dave
|
||||
* Put in new tracker packets in API. Change cfile to be able to checksum
|
||||
* portions of a file.
|
||||
*
|
||||
* 107 9/04/98 3:51p Dave
|
||||
* Put in validated mission updating and application during stats
|
||||
* updating.
|
||||
*
|
||||
* 106 8/31/98 2:06p Dave
|
||||
* Make cfile sort the ordering or vp files. Added support/checks for
|
||||
* recognizing "mission disk" players.
|
||||
*
|
||||
* 105 8/20/98 5:30p Dave
|
||||
* Put in handy multiplayer logfile system. Now need to put in useful
|
||||
* applications of it all over the code.
|
||||
*
|
||||
* 104 8/12/98 4:53p Dave
|
||||
* Put in 32 bit checksumming for PXO missions. No validation on the
|
||||
* actual tracker yet, though.
|
||||
*
|
||||
* 103 6/17/98 9:30a Allender
|
||||
* fixed red alert replay stats clearing problem
|
||||
*
|
||||
* 102 6/05/98 9:46a Lawrance
|
||||
* check for CD change on cfopen()
|
||||
*
|
||||
* 101 5/19/98 1:19p Allender
|
||||
* new low level reliable socket reading code. Make all missions/campaign
|
||||
* load/save to data missions folder (i.e. we are rid of the player
|
||||
* missions folder)
|
||||
*
|
||||
* 100 5/13/98 10:22p John
|
||||
* Added cfile functions to read/write rle compressed blocks of data.
|
||||
* Made palman use it for .clr files. Made alphacolors calculate on the
|
||||
* fly rather than caching to/from disk.
|
||||
*
|
||||
* 99 5/11/98 10:59a John
|
||||
* Moved the low-level file reading code into cfilearchive.cpp.
|
||||
*
|
||||
* 98 5/06/98 5:30p John
|
||||
* Removed unused cfilearchiver. Removed/replaced some unused/little used
|
||||
* graphics functions, namely gradient_h and _v and pixel_sp. Put in new
|
||||
* DirectX header files and libs that fixed the Direct3D alpha blending
|
||||
* problems.
|
||||
*
|
||||
* 97 5/03/98 11:53a John
|
||||
* Fixed filename case mangling.
|
||||
*
|
||||
* 96 5/03/98 8:33a John
|
||||
* Made sure there weren't any more broken function lurking around like
|
||||
* the one Allender fixed.
|
||||
*
|
||||
* 95 5/02/98 11:05p Allender
|
||||
* fix cfilelength for pack files
|
||||
*
|
||||
*
|
||||
* $NoKeywords: $
|
||||
*/
|
||||
|
||||
#define _CFILE_INTERNAL
|
||||
|
||||
#include <stdlib.h>
|
||||
@@ -398,10 +50,10 @@ char Cfile_user_dir[CFILE_ROOT_DIRECTORY_LEN] = "";
|
||||
cf_pathtype Pathtypes[CF_MAX_PATH_TYPES] = {
|
||||
// What type this is Path Extensions Parent type
|
||||
{ CF_TYPE_INVALID, NULL, NULL, CF_TYPE_INVALID },
|
||||
// Root must be index 1!!
|
||||
// Root must be index 1!!
|
||||
{ CF_TYPE_ROOT, "", ".mve .ogg", CF_TYPE_ROOT },
|
||||
{ CF_TYPE_DATA, "data", ".cfg .log .txt", CF_TYPE_ROOT },
|
||||
{ CF_TYPE_MAPS, "data" DIR_SEPARATOR_STR "maps", ".pcx .ani .eff .tga .jpg .dds", CF_TYPE_DATA },
|
||||
{ CF_TYPE_MAPS, "data" DIR_SEPARATOR_STR "maps", ".pcx .ani .eff .tga .jpg .png .dds", CF_TYPE_DATA },
|
||||
{ CF_TYPE_TEXT, "data" DIR_SEPARATOR_STR "text", ".txt .net", CF_TYPE_DATA },
|
||||
{ CF_TYPE_MODELS, "data" DIR_SEPARATOR_STR "models", ".pof", CF_TYPE_DATA },
|
||||
{ CF_TYPE_TABLES, "data" DIR_SEPARATOR_STR "tables", ".tbl .tbm", CF_TYPE_DATA },
|
||||
@@ -417,22 +69,22 @@ cf_pathtype Pathtypes[CF_MAX_PATH_TYPES] = {
|
||||
{ CF_TYPE_VOICE_TRAINING, "data" DIR_SEPARATOR_STR "voice" DIR_SEPARATOR_STR "training", ".wav .ogg", CF_TYPE_VOICE },
|
||||
{ CF_TYPE_MUSIC, "data" DIR_SEPARATOR_STR "music", ".wav .ogg", CF_TYPE_DATA },
|
||||
{ CF_TYPE_MOVIES, "data" DIR_SEPARATOR_STR "movies", ".mve .msb .ogg", CF_TYPE_DATA },
|
||||
{ CF_TYPE_INTERFACE, "data" DIR_SEPARATOR_STR "interface", ".pcx .ani .dds .tga .eff", CF_TYPE_DATA },
|
||||
{ CF_TYPE_INTERFACE, "data" DIR_SEPARATOR_STR "interface", ".pcx .ani .dds .tga .eff .png .jpg", CF_TYPE_DATA },
|
||||
{ CF_TYPE_FONT, "data" DIR_SEPARATOR_STR "fonts", ".vf .ttf", CF_TYPE_DATA },
|
||||
{ CF_TYPE_EFFECTS, "data" DIR_SEPARATOR_STR "effects", ".ani .eff .pcx .neb .tga .jpg .dds", CF_TYPE_DATA },
|
||||
{ CF_TYPE_HUD, "data" DIR_SEPARATOR_STR "hud", ".ani .pcx .tga .dds", CF_TYPE_DATA },
|
||||
{ CF_TYPE_EFFECTS, "data" DIR_SEPARATOR_STR "effects", ".ani .eff .pcx .neb .tga .jpg .png .dds .sdr", CF_TYPE_DATA },
|
||||
{ CF_TYPE_HUD, "data" DIR_SEPARATOR_STR "hud", ".pcx .ani .eff .tga .jpg .png .dds", CF_TYPE_DATA },
|
||||
{ CF_TYPE_PLAYERS, "data" DIR_SEPARATOR_STR "players", ".hcf", CF_TYPE_DATA },
|
||||
{ CF_TYPE_PLAYER_IMAGES, "data" DIR_SEPARATOR_STR "players" DIR_SEPARATOR_STR "images", ".pcx .dds", CF_TYPE_PLAYERS },
|
||||
{ CF_TYPE_SQUAD_IMAGES, "data" DIR_SEPARATOR_STR "players" DIR_SEPARATOR_STR "squads", ".pcx .dds", CF_TYPE_PLAYERS },
|
||||
{ CF_TYPE_PLAYER_IMAGES, "data" DIR_SEPARATOR_STR "players" DIR_SEPARATOR_STR "images", ".pcx .png .dds", CF_TYPE_PLAYERS },
|
||||
{ CF_TYPE_SQUAD_IMAGES, "data" DIR_SEPARATOR_STR "players" DIR_SEPARATOR_STR "squads", ".pcx .png .dds", CF_TYPE_PLAYERS },
|
||||
{ CF_TYPE_SINGLE_PLAYERS, "data" DIR_SEPARATOR_STR "players" DIR_SEPARATOR_STR "single", ".pl2 .cs2 .plr .csg .css", CF_TYPE_PLAYERS },
|
||||
{ CF_TYPE_MULTI_PLAYERS, "data" DIR_SEPARATOR_STR "players" DIR_SEPARATOR_STR "multi", ".plr", CF_TYPE_PLAYERS },
|
||||
{ CF_TYPE_CACHE, "data" DIR_SEPARATOR_STR "cache", ".clr .tmp .ibx", CF_TYPE_DATA }, //clr=cached color
|
||||
{ CF_TYPE_MULTI_CACHE, "data" DIR_SEPARATOR_STR "multidata", ".pcx .dds .fs2 .txt", CF_TYPE_DATA },
|
||||
{ CF_TYPE_MULTI_PLAYERS, "data" DIR_SEPARATOR_STR "players" DIR_SEPARATOR_STR "multi", ".plr", CF_TYPE_PLAYERS },
|
||||
{ CF_TYPE_CACHE, "data" DIR_SEPARATOR_STR "cache", ".clr .tmp .ibx .tsb", CF_TYPE_DATA }, //clr=cached color
|
||||
{ CF_TYPE_MULTI_CACHE, "data" DIR_SEPARATOR_STR "multidata", ".pcx .png .dds .fs2 .txt", CF_TYPE_DATA },
|
||||
{ CF_TYPE_MISSIONS, "data" DIR_SEPARATOR_STR "missions", ".fs2 .fc2 .ntl .ssv", CF_TYPE_DATA },
|
||||
{ CF_TYPE_CONFIG, "data" DIR_SEPARATOR_STR "config", ".cfg", CF_TYPE_DATA },
|
||||
{ CF_TYPE_DEMOS, "data" DIR_SEPARATOR_STR "demos", ".fsd", CF_TYPE_DATA },
|
||||
{ CF_TYPE_CBANIMS, "data" DIR_SEPARATOR_STR "cbanims", ".ani", CF_TYPE_DATA },
|
||||
{ CF_TYPE_INTEL_ANIMS, "data" DIR_SEPARATOR_STR "intelanims", ".ani", CF_TYPE_DATA },
|
||||
{ CF_TYPE_CBANIMS, "data" DIR_SEPARATOR_STR "cbanims", ".pcx .ani .eff .tga .jpg .png .dds", CF_TYPE_DATA },
|
||||
{ CF_TYPE_INTEL_ANIMS, "data" DIR_SEPARATOR_STR "intelanims", ".pcx .ani .eff .tga .jpg .png .dds", CF_TYPE_DATA },
|
||||
{ CF_TYPE_SCRIPTS, "data" DIR_SEPARATOR_STR "scripts", ".lua .lc", CF_TYPE_DATA },
|
||||
{ CF_TYPE_FICTION, "data" DIR_SEPARATOR_STR "fiction", ".txt", CF_TYPE_DATA },
|
||||
};
|
||||
@@ -495,9 +147,14 @@ int cfile_in_root_dir(char *exe_path)
|
||||
token_count++;
|
||||
tok = strtok(NULL, DIR_SEPARATOR_STR);
|
||||
} while(tok != NULL);
|
||||
|
||||
// root directory if we have <= 1 slash
|
||||
|
||||
#ifdef SCP_UNIX
|
||||
// /freespace works, / does not
|
||||
if(token_count <= 1) {
|
||||
#else
|
||||
// C:/freespace works, C:/ does not
|
||||
if(token_count <= 2){
|
||||
#endif
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -627,15 +284,13 @@ int cfile_push_chdir(int type)
|
||||
cf_create_default_path_string( dir, sizeof(dir)-1, type, NULL );
|
||||
|
||||
#ifdef _WIN32
|
||||
_strlwr(dir);
|
||||
char *colon_pos = strchr(dir, ':');
|
||||
|
||||
char *Drive = strchr(dir, ':');
|
||||
|
||||
if (Drive) {
|
||||
if (!cfile_chdrive( *(Drive - 1) - 'a' + 1, 1))
|
||||
if (colon_pos) {
|
||||
if (!cfile_chdrive( tolower(*(colon_pos - 1)) - 'a' + 1, 1))
|
||||
return 1;
|
||||
|
||||
Path = Drive+1;
|
||||
Path = colon_pos+1;
|
||||
} else
|
||||
#endif // _WIN32
|
||||
{
|
||||
@@ -649,7 +304,9 @@ int cfile_push_chdir(int type)
|
||||
// This chdir might get a critical error!
|
||||
e = _chdir( Path );
|
||||
if (e) {
|
||||
cfile_chdrive( OriginalDirectory[0] - 'a' + 1, 1 );
|
||||
#ifdef _WIN32
|
||||
cfile_chdrive( tolower(OriginalDirectory[0]) - 'a' + 1, 1 );
|
||||
#endif // _WIN32
|
||||
return 2;
|
||||
}
|
||||
|
||||
@@ -667,14 +324,12 @@ int cfile_chdir(char *dir)
|
||||
_getcwd(OriginalDirectory, CFILE_ROOT_DIRECTORY_LEN-1);
|
||||
|
||||
#ifdef _WIN32
|
||||
_strlwr(dir);
|
||||
|
||||
char *Drive = strchr(dir, ':');
|
||||
if (Drive) {
|
||||
if (!cfile_chdrive( *(Drive - 1) - 'a' + 1, 1))
|
||||
char *colon_pos = strchr(dir, ':');
|
||||
if (colon_pos) {
|
||||
if (!cfile_chdrive( tolower(*(colon_pos - 1)) - 'a' + 1, 1))
|
||||
return 1;
|
||||
|
||||
Path = Drive+1;
|
||||
Path = colon_pos+1;
|
||||
} else
|
||||
#endif // _WIN32
|
||||
{
|
||||
@@ -688,7 +343,9 @@ int cfile_chdir(char *dir)
|
||||
// This chdir might get a critical error!
|
||||
e = _chdir( Path );
|
||||
if (e) {
|
||||
cfile_chdrive( OriginalDirectory[0] - 'a' + 1, 1 );
|
||||
#ifdef _WIN32
|
||||
cfile_chdrive( tolower(OriginalDirectory[0]) - 'a' + 1, 1 );
|
||||
#endif // _WIN32
|
||||
return 2;
|
||||
}
|
||||
|
||||
@@ -780,10 +437,10 @@ char *cf_add_ext(char *filename, char *ext)
|
||||
flen = strlen(filename);
|
||||
elen = strlen(ext);
|
||||
Assert(flen < MAX_PATH_LEN);
|
||||
strcpy(path, filename);
|
||||
strcpy_s(path, filename);
|
||||
if ((flen < 4) || stricmp(path + flen - elen, ext)) {
|
||||
Assert(flen + elen < MAX_PATH_LEN);
|
||||
strcat(path, ext);
|
||||
strcat_s(path, ext);
|
||||
}
|
||||
|
||||
return path;
|
||||
@@ -1013,7 +670,7 @@ CFILE *cfopen(char *file_path, char *mode, int type, int dir_type, bool localize
|
||||
if ( strpbrk(file_path,"/\\:") ) {
|
||||
#endif
|
||||
// Full path given?
|
||||
strcpy(longname, file_path );
|
||||
strcpy_s(longname, file_path );
|
||||
} else {
|
||||
// Path type given?
|
||||
Assert( dir_type != CF_TYPE_ANY );
|
||||
@@ -1052,12 +709,12 @@ CFILE *cfopen(char *file_path, char *mode, int type, int dir_type, bool localize
|
||||
}
|
||||
happy_mode[i] = '\0';
|
||||
if(need_b)
|
||||
strcat(happy_mode, "b");
|
||||
strcat_s(happy_mode, "b");
|
||||
//*****END PROCESSING OF MODE*****
|
||||
}
|
||||
else
|
||||
{
|
||||
strcpy(happy_mode, mode);
|
||||
strcpy_s(happy_mode, mode);
|
||||
}
|
||||
|
||||
FILE *fp = fopen(longname, happy_mode);
|
||||
@@ -1073,7 +730,7 @@ CFILE *cfopen(char *file_path, char *mode, int type, int dir_type, bool localize
|
||||
|
||||
int offset, size;
|
||||
char copy_file_path[MAX_PATH_LEN]; // FIX change in memory from cf_find_file_location
|
||||
strcpy(copy_file_path, file_path);
|
||||
strcpy_s(copy_file_path, file_path);
|
||||
|
||||
|
||||
if ( cf_find_file_location( copy_file_path, dir_type, sizeof(longname) - 1, longname, &size, &offset, localize ) ) {
|
||||
@@ -1161,53 +818,6 @@ CFILE *cfopen_special(char *file_path, char *mode, const int size, const int off
|
||||
// it's a normal file
|
||||
return cf_open_fill_cfblock(fp, dir_type);
|
||||
}
|
||||
|
||||
/* char longname[_MAX_PATH];
|
||||
|
||||
if ( !cfile_inited ) {
|
||||
Int3();
|
||||
return NULL;
|
||||
}
|
||||
|
||||
//================================================
|
||||
// Check that all the parameters make sense
|
||||
Assert( file_path && strlen(file_path) );
|
||||
Assert( mode != NULL );
|
||||
|
||||
if ( (ext_num <= 0) || (!ext_list) ) {
|
||||
Int3();
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// cfopen_ext() only supports reading files, not creating them
|
||||
if ( strchr(mode, 'w') ) {
|
||||
Int3();
|
||||
return NULL;
|
||||
}
|
||||
|
||||
//================================================
|
||||
// Search for file on disk, on cdrom, or in a packfile
|
||||
|
||||
int offset, size;
|
||||
char copy_file_path[MAX_PATH_LEN]; // FIX change in memory from cf_find_file_location
|
||||
strcpy(copy_file_path, file_path);
|
||||
|
||||
if ( cf_find_file_location_ext(copy_file_path, ext_num, ext_list, dir_type, sizeof(longname) - 1, longname, &size, &offset, localize) ) {
|
||||
// Fount it, now create a cfile out of it
|
||||
FILE *fp = fopen( longname, "rb" );
|
||||
|
||||
if ( fp ) {
|
||||
if ( offset ) {
|
||||
// Found it in a pack file
|
||||
return cf_open_packed_cfblock(fp, dir_type, offset, size );
|
||||
} else {
|
||||
// Found it in a normal file
|
||||
return cf_open_fill_cfblock(fp, dir_type);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;*/
|
||||
}
|
||||
|
||||
|
||||
|
||||
+1
-417
@@ -7,423 +7,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/CFile/cfile.h $
|
||||
* $Revision: 2.17.2.5 $
|
||||
* $Date: 2007-11-21 07:27:45 $
|
||||
* $Author: Goober5000 $
|
||||
*
|
||||
* <insert description of file here>
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.17.2.4 2007/04/11 18:21:20 taylor
|
||||
* cleanup of chcksum stuff (works properly on 64-bit systems now)
|
||||
* add chksum support for VPs, both a startup in debug builds, and via cmdline option (-verify_vps)
|
||||
* little cleanup in cmdline.cpp (get rid of the remaining "fix bugs" crap)
|
||||
*
|
||||
* Revision 2.17.2.3 2007/03/22 20:22:44 taylor
|
||||
* a little better error handling for cf_exists_full()
|
||||
* add a cf_exists_full_ext() which can find a series of extensions and returns true if any of them exist
|
||||
* use cf_exists_full_ext() for eventmusic file checks (to check for ogg and wav)
|
||||
* get rid of SPM hack, it's wrong (just commented out for now though)
|
||||
* fix a bunch of bugs in cf_find_file_location_ext():
|
||||
* - try to handle files with multiple periods a bit better (for the wav files like: blah_1.5.wav)
|
||||
* - load issue with finding incorrect files by mistake
|
||||
* - prevent finding different file types in various paths/roots
|
||||
*
|
||||
* Revision 2.17.2.2 2007/02/11 09:25:42 taylor
|
||||
* some CFILE cleanup and slight directory order reorg
|
||||
* add cfopen_special() for quickly opening files that have already been found with cf_find_file_location_ext()
|
||||
* remove NO_SOUND
|
||||
*
|
||||
* Revision 2.17.2.1 2006/08/27 18:01:45 taylor
|
||||
* various small cleanup and speedup changes
|
||||
* add a cf_find_file_location_ext() function, which you can pass a filename and a list of extensions and it will search for all of them at once
|
||||
*
|
||||
* Revision 2.17 2006/02/13 00:20:45 Goober5000
|
||||
* more tweaks, plus clarification of checks for the existence of files
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.16 2006/01/17 02:33:20 wmcoolmon
|
||||
* data/scripts directory
|
||||
*
|
||||
* Revision 2.15 2005/12/28 22:06:47 taylor
|
||||
* fix up cf_find_file_location() and related elements so that it's safer (based on WMC's work, but actually safe this time ;))
|
||||
*
|
||||
* Revision 2.14 2005/12/06 03:13:49 taylor
|
||||
* fix quite a few CFILE issues:
|
||||
* use #define's for path lengths when possible so it's easier to move between functions
|
||||
* fix huge Cfile_stack[] issue (how the hell did that get through :v: QA?)
|
||||
* add Int3() check on cfopen() so it's easier to know if it get's called before cfile is ready to use
|
||||
* move path separators to pstypes.h
|
||||
* fix possible string overruns when setting up CFILE roots
|
||||
* make sure we don't try to init current directory again thinking it's a CD-ROM
|
||||
* add the list of VP roots to debug log, this will undoubtedly be useful
|
||||
* when -nosound is use go ahead and set -nomusic too to both checks are correct
|
||||
* add list of cmdline options to debug log
|
||||
* fix possible overwrite issues with get_version_string() and remove '(fs2_open)' from string plus change OGL->OpenGL, D3D->Direct3D
|
||||
*
|
||||
* Revision 2.13 2005/10/16 23:15:46 wmcoolmon
|
||||
* Hardened cfile against array overflows
|
||||
*
|
||||
* Revision 2.12 2005/07/13 02:50:49 Goober5000
|
||||
* remove PreProcDefine #includes in FS2
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.11 2005/04/05 05:53:14 taylor
|
||||
* s/vector/vec3d/g, better support for different compilers (Jens Granseuer)
|
||||
*
|
||||
* Revision 2.10 2005/01/30 12:50:08 taylor
|
||||
* merge with Linux/OSX tree - p0130
|
||||
*
|
||||
* Revision 2.9 2004/08/11 05:06:19 Kazan
|
||||
* added preprocdefines.h to prevent what happened with fred -- make sure to make all fred2 headers include this file as the _first_ include -- i have already modified fs2 files to do this
|
||||
*
|
||||
* Revision 2.8 2004/05/26 21:02:26 wmcoolmon
|
||||
* Added weapons_expl modular table, updated cfilesystem to work with modular tables, fixed loading order, fixed ship loading error messages
|
||||
*
|
||||
* Revision 2.7 2003/08/20 08:12:08 wmcoolmon
|
||||
* Made cfile_delete return 0 on failure, 1 on success
|
||||
*
|
||||
* Revision 2.6 2002/11/10 16:29:53 DTP
|
||||
* -DTP reworked mod support,
|
||||
*
|
||||
* Revision 2.5 2002/11/02 23:06:59 DTP
|
||||
* DOh,uhmm, define error again, this is getting to me.
|
||||
*
|
||||
* Revision 2.4 2002/11/02 23:04:46 DTP
|
||||
* DOh, fixed that define, learn to count DTP :)
|
||||
*
|
||||
* Revision 2.3 2002/10/27 23:59:28 DTP
|
||||
* DTP; started basic implementation of mod-support
|
||||
* plain files only for now. fs2_open.exe -mod X will look for files in fs2/ X /all-legal-subdirectories. no checking/creating dirs yet. directories must be there.
|
||||
*
|
||||
* Revision 2.2 2002/08/01 01:41:04 penguin
|
||||
* The big include file move
|
||||
*
|
||||
* Revision 2.1 2002/07/07 19:55:58 penguin
|
||||
* Back-port to MSVC
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:21 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
* Revision 1.3 2002/05/16 06:03:29 mharris
|
||||
* Unix port changes
|
||||
*
|
||||
* Revision 1.2 2002/05/09 22:58:08 mharris
|
||||
* Added ifdef WIN32 around change-drive functions
|
||||
*
|
||||
* Revision 1.1 2002/05/02 18:03:04 mharris
|
||||
* Initial checkin - converted filenames and includes to lower case
|
||||
*
|
||||
*
|
||||
* 11 9/08/99 12:03a Dave
|
||||
* Make squad logos render properly in D3D all the time. Added intel anim
|
||||
* directory.
|
||||
*
|
||||
* 10 8/31/99 9:46a Dave
|
||||
* Support for new cfile cbanims directory.
|
||||
*
|
||||
* 9 5/19/99 4:07p Dave
|
||||
* Moved versioning code into a nice isolated common place. Fixed up
|
||||
* updating code on the pxo screen. Fixed several stub problems.
|
||||
*
|
||||
* 8 3/28/99 5:58p Dave
|
||||
* Added early demo code. Make objects move. Nice and framerate
|
||||
* independant, but not much else. Don't use yet unless you're me :)
|
||||
*
|
||||
* 7 3/24/99 4:05p Dave
|
||||
* Put in support for assigning the player to a specific squadron with a
|
||||
* specific logo. Preliminary work for doing pos/orient checksumming in
|
||||
* multiplayer to reduce bandwidth.
|
||||
*
|
||||
* 6 1/12/99 3:15a Dave
|
||||
* Barracks screen support for selecting squad logos. We need real artwork
|
||||
* :)
|
||||
*
|
||||
* 5 10/29/98 10:41a Dave
|
||||
* Change the way cfile initializes exe directory.
|
||||
*
|
||||
* 4 10/13/98 9:19a Andsager
|
||||
* Add localization support to cfile. Optional parameter with cfopen that
|
||||
* looks for localized files.
|
||||
*
|
||||
* 3 10/12/98 9:54a Dave
|
||||
* Fixed a few file organization things.
|
||||
*
|
||||
* 2 10/07/98 10:52a Dave
|
||||
* Initial checkin.
|
||||
*
|
||||
* 1 10/07/98 10:48a Dave
|
||||
*
|
||||
* 84 9/09/98 5:53p Dave
|
||||
* Put in new tracker packets in API. Change cfile to be able to checksum
|
||||
* portions of a file.
|
||||
*
|
||||
* 83 8/12/98 4:53p Dave
|
||||
* Put in 32 bit checksumming for PXO missions. No validation on the
|
||||
* actual tracker yet, though.
|
||||
*
|
||||
* 82 5/19/98 1:19p Allender
|
||||
* new low level reliable socket reading code. Make all missions/campaign
|
||||
* load/save to data missions folder (i.e. we are rid of the player
|
||||
* missions folder)
|
||||
*
|
||||
* 81 5/13/98 10:22p John
|
||||
* Added cfile functions to read/write rle compressed blocks of data.
|
||||
* Made palman use it for .clr files. Made alphacolors calculate on the
|
||||
* fly rather than caching to/from disk.
|
||||
*
|
||||
* 80 5/01/98 10:21a John
|
||||
* Added code to find all pack files in all trees. Added code to create
|
||||
* any directories that we write to.
|
||||
*
|
||||
* 79 4/30/98 10:29p John
|
||||
* Added code to refresh filelist if cd-rom changed or packfiles created
|
||||
* or deleted.
|
||||
*
|
||||
* 78 4/30/98 10:06p John
|
||||
* Started adding code for splitting the maps data tree for hardware
|
||||
* textures.
|
||||
*
|
||||
* 77 4/30/98 9:43p John
|
||||
* Restructured some stuff.
|
||||
*
|
||||
* 76 4/30/98 8:23p John
|
||||
* Fixed some bugs with Fred caused by my new cfile code.
|
||||
*
|
||||
* 75 4/30/98 4:53p John
|
||||
* Restructured and cleaned up cfile code. Added capability to read off
|
||||
* of CD-ROM drive and out of multiple pack files.
|
||||
*
|
||||
* 74 4/20/98 6:04p Dave
|
||||
* Implement multidata cache flushing and xferring mission files to
|
||||
* multidata. Make sure observers can't change hud config. Fix pilot image
|
||||
* viewing in popup. Put in game status field. Tweaked multi options.
|
||||
*
|
||||
* 73 4/01/98 6:06p Hoffoss
|
||||
* Added a command briefing directory for those voice files.
|
||||
*
|
||||
* 72 3/31/98 4:51p Dave
|
||||
* Removed medals screen and multiplayer buttons from demo version. Put in
|
||||
* new pilot popup screen. Make ships in mp team vs. team have proper team
|
||||
* ids. Make mp respawns a permanent option saved in the player file.
|
||||
*
|
||||
* 71 3/26/98 6:01p Dave
|
||||
* Put in file checksumming routine in cfile. Made pilot pic xferring more
|
||||
* robust. Cut header size of voice data packets in half. Put in
|
||||
* restricted game host query system.
|
||||
*
|
||||
* 70 3/10/98 2:27p Hoffoss
|
||||
* Added change directory with history stack functions, so you can switch
|
||||
* to a new directory, do something, and restore to what it was. useful
|
||||
* for Fred.
|
||||
*
|
||||
* 69 3/07/98 3:48p Lawrance
|
||||
* get save game working, allow restore from main menu
|
||||
*
|
||||
* 68 2/26/98 10:07p Hoffoss
|
||||
* Rewrote state saving and restoring to fix bugs and simplify the code.
|
||||
*
|
||||
* 67 2/20/98 4:43p Dave
|
||||
* Finished support for multiplayer player data files. Split off
|
||||
* multiplayer campaign functionality.
|
||||
*
|
||||
* 66 2/19/98 6:26p Dave
|
||||
* Fixed a few file xfer bugs. Tweaked mp team select screen. Put in
|
||||
* initial support for player data uploading.
|
||||
*
|
||||
* 65 2/06/98 3:47p Allender
|
||||
* subtitling for movies
|
||||
*
|
||||
* 64 2/05/98 10:15p Lawrance
|
||||
* Add support for .svg filenames.
|
||||
*
|
||||
* 63 1/12/98 10:07p Hoffoss
|
||||
* Made tab cycle properly in debriefing screen and put in aux. pilot
|
||||
* image directory.
|
||||
*
|
||||
* 62 1/11/98 2:45p John
|
||||
* Changed .lst to .clt
|
||||
*
|
||||
* 61 1/11/98 2:14p John
|
||||
* Changed a lot of stuff that had to do with bitmap loading. Made cfile
|
||||
* not do callbacks, I put that in global code. Made only bitmaps that
|
||||
* need to load for a level load.
|
||||
*
|
||||
* 60 1/02/98 4:41p Allender
|
||||
* added new mission folder for "player" missions
|
||||
*
|
||||
* 59 12/28/97 12:42p John
|
||||
* Put in support for reading archive files; Made missionload use the
|
||||
* cf_get_file_list function. Moved demos directory out of data tree.
|
||||
*
|
||||
* 58 12/17/97 10:16p Allender
|
||||
* implemented a "no callback" flag to tell the cfile code not to use the
|
||||
* cf_callback on files which specify this flag
|
||||
*
|
||||
* 57 12/08/97 6:23p Lawrance
|
||||
* add cflush()
|
||||
*
|
||||
* 56 12/07/97 4:30p John
|
||||
* Fixed bug with cfile versioning if two files use it at once. Added
|
||||
* code to cfile so I could display a loading box while loading.
|
||||
*
|
||||
* 55 11/24/97 9:28a Hoffoss
|
||||
* Moved define of CF_TYPE_MULTI_PLAYERS so it's in order. I started to
|
||||
* add it because I couldn't find it, so that's indication enough it
|
||||
* needed it.
|
||||
*
|
||||
* 54 11/20/97 1:07a Lawrance
|
||||
* add support for voice/debriefings directory
|
||||
*
|
||||
* 53 11/19/97 7:27p Hoffoss
|
||||
* Added version checking read functions.
|
||||
*
|
||||
* 52 11/18/97 10:53a Hoffoss
|
||||
*
|
||||
* 51 11/17/97 6:07p Hoffoss
|
||||
* Make get_file_list() allow filtering via a callback function.
|
||||
*
|
||||
* 50 11/16/97 2:29p John
|
||||
* added versioning to nebulas; put nebula code into freespace.
|
||||
*
|
||||
* 49 11/15/97 6:10p Lawrance
|
||||
* add in support for new voice directories
|
||||
*
|
||||
* 48 11/11/97 4:54p Dave
|
||||
* Put in support for single vs. multiplayer pilots. Put in initial player
|
||||
* selection screen (no command line option yet). Started work on
|
||||
* multiplayer campaign file save gaming.
|
||||
*
|
||||
* 47 11/07/97 4:00p Hoffoss
|
||||
* Capitalized directory names, changed the player/image directory to work
|
||||
* like the rest, and forced the player/images directory to be created.
|
||||
*
|
||||
* 46 11/06/97 5:38p Hoffoss
|
||||
* Added a new player image directory and added support for it.
|
||||
*
|
||||
* 45 11/04/97 7:46p Lawrance
|
||||
* Add support for data\interface\HUD directory
|
||||
*
|
||||
* 44 10/29/97 6:22p Hoffoss
|
||||
* Added some new file listing functions.
|
||||
*
|
||||
* 43 10/28/97 10:54a Lawrance
|
||||
* support for 8b22k and 16b11k directories under the sound directory
|
||||
*
|
||||
* 42 10/14/97 11:34p Lawrance
|
||||
* add function to get full path for a given filename
|
||||
*
|
||||
* 41 9/24/97 5:30p Lawrance
|
||||
* add directory for voices
|
||||
*
|
||||
* 40 9/20/97 8:16a John
|
||||
* Made .clr files go into the Cache directory. Replaced cfopen(name,NULL)
|
||||
* to delete a file with cf_delete.
|
||||
*
|
||||
* 39 9/09/97 6:50p Hoffoss
|
||||
* Fixed bug with mission saving.
|
||||
*
|
||||
* 38 9/05/97 4:52p Lawrance
|
||||
* fix prototype for cfread_angles() and cfwrite_angles()
|
||||
*
|
||||
* 37 8/29/97 4:47p Dave
|
||||
* Added an extension for state transfer status files.
|
||||
*
|
||||
* 36 8/21/97 12:14p Dave
|
||||
* Changed demo file extension from .keg to .fsd
|
||||
*
|
||||
* 35 8/19/97 5:51p Hoffoss
|
||||
* Fixes to cfopen to not check the default directory first, but check it
|
||||
* last. Also tracks info as to where a file is located when opened.
|
||||
*
|
||||
* 34 8/17/97 10:22p Hoffoss
|
||||
* Fixed several bugs in Fred with Undo feature. In the process, recoded
|
||||
* a lot of CFile.cpp.
|
||||
*
|
||||
* 33 8/17/97 12:47p Hoffoss
|
||||
* Changed code so I can force missions to load from the missions
|
||||
* directory regardless of it's extension.
|
||||
*
|
||||
* 32 8/13/97 1:39p Adam
|
||||
* make .ani files available in the data/effects directory
|
||||
*
|
||||
* 31 8/13/97 12:24p Lawrance
|
||||
* Add support for effects directory
|
||||
*
|
||||
* 30 7/30/97 5:23p Dave
|
||||
* Added file extensions for demo stuff
|
||||
*
|
||||
* 29 7/28/97 10:42p Lawrance
|
||||
* added ctmpfile(), analog to tmpfile()
|
||||
*
|
||||
* 28 7/16/97 5:29p John
|
||||
* added palette table caching and made scaler and liner no light tmapper
|
||||
* do alpha blending in 8 bpp mode.
|
||||
*
|
||||
* 27 6/05/97 4:53p John
|
||||
* First rev of new antialiased font stuff.
|
||||
*
|
||||
* 26 6/05/97 1:22p Allender
|
||||
* added .ntl as an extension for nettest program
|
||||
*
|
||||
* 25 4/25/97 11:31a Allender
|
||||
* Campaign state now saved in campaign save file in player directory.
|
||||
* Made some global variables follow naming convention. Solidified
|
||||
* continuing campaigns based on new structure
|
||||
*
|
||||
* 24 4/17/97 9:01p Allender
|
||||
* start of campaign stuff. Campaigns now stored in external file (no
|
||||
* filenames in code). Continuing campaign won't work at this point
|
||||
*
|
||||
* 23 4/03/97 4:26p Lawrance
|
||||
* adding .wav search to music directory
|
||||
*
|
||||
* 22 4/01/97 9:26a Allender
|
||||
* added support for descent style fonts although they are not used in the
|
||||
* game yet
|
||||
*
|
||||
* 21 3/04/97 8:17a John
|
||||
* Fixed movie code to not require a file handle. Used CFILE instead.
|
||||
* Took cfile_get_handle or whatever out.
|
||||
*
|
||||
* 20 3/03/97 8:57a Lawrance
|
||||
* took out cf_returnfp()
|
||||
*
|
||||
* 19 3/01/97 2:09p Lawrance
|
||||
* supporting memory mapped files, moved cfile implementation details into
|
||||
* .cpp file
|
||||
*
|
||||
* 18 2/17/97 3:00p Lawrance
|
||||
* added .ani type to MAPS_EXT and INTERFACE_EXT
|
||||
*
|
||||
* 17 2/07/97 9:00a Lawrance
|
||||
* added cfread_uint() and cwrite_uint()
|
||||
*
|
||||
* 16 2/04/97 9:29a Allender
|
||||
* added cfwrite* functions
|
||||
*
|
||||
* 15 1/22/97 10:48a Lawrance
|
||||
* supporting AVI playback
|
||||
*
|
||||
* 14 12/23/96 10:56a John
|
||||
* Totally restructured the POF stuff to support multiple
|
||||
* detail levels in one POF file.
|
||||
*
|
||||
*
|
||||
* 13 11/20/96 10:00a Hoffoss
|
||||
* Added cfile_chdir() function.
|
||||
*
|
||||
* 12 11/13/96 10:14a Allender
|
||||
* added small routines to read basic data types. Also changed code to
|
||||
* try to find extensions in more than 1 directory.
|
||||
*
|
||||
* 11 11/11/96 3:21p Allender
|
||||
* added extension for movies
|
||||
*
|
||||
* $NoKeywords: $
|
||||
*/
|
||||
|
||||
|
||||
#ifndef __CFILE_H__
|
||||
#define __CFILE_H__
|
||||
|
||||
@@ -7,95 +7,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/CFile/CfileArchive.cpp $
|
||||
* $Revision: 2.7 $
|
||||
* $Date: 2005-07-24 18:31:17 $
|
||||
* $Author: taylor $
|
||||
*
|
||||
* Low-level code for reading data out of large archive files or normal files. All
|
||||
* reads/seeks come through here.
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.6 2004/07/26 20:47:25 Kazan
|
||||
* remove MCD complete
|
||||
*
|
||||
* Revision 2.5 2004/07/12 16:32:42 Kazan
|
||||
* MCD - define _MCD_CHECK to use memory tracking
|
||||
*
|
||||
* Revision 2.4 2004/03/05 09:01:54 Goober5000
|
||||
* Uber pass at reducing #includes
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.3 2003/03/19 09:05:25 Goober5000
|
||||
* more housecleaning, this time for debug warnings
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.2 2002/08/01 01:41:04 penguin
|
||||
* The big include file move
|
||||
*
|
||||
* Revision 2.1 2002/07/29 19:17:21 penguin
|
||||
* added #ifdef _WIN32 around windows-specific system headers
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:21 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
* Revision 1.1 2002/05/02 18:03:04 mharris
|
||||
* Initial checkin - converted filenames and includes to lower case
|
||||
*
|
||||
*
|
||||
* 4 2/22/99 10:31p Andsager
|
||||
* Get rid of unneeded includes.
|
||||
*
|
||||
* 3 1/06/99 2:24p Dave
|
||||
* Stubs and release build fixes.
|
||||
*
|
||||
* 2 10/07/98 10:52a Dave
|
||||
* Initial checkin.
|
||||
*
|
||||
* 1 10/07/98 10:48a Dave
|
||||
*
|
||||
* 12 5/14/98 8:10p Lawrance
|
||||
* Fix bug with trying to read past the end of a file (when from a
|
||||
* packfile).
|
||||
*
|
||||
* 11 5/11/98 11:48a John
|
||||
* fixed bug with memory mapped files
|
||||
*
|
||||
* 10 5/11/98 10:59a John
|
||||
* added in debug code
|
||||
*
|
||||
* 9 5/11/98 10:59a John
|
||||
* Moved the low-level file reading code into cfilearchive.cpp.
|
||||
*
|
||||
* 8 4/30/98 4:53p John
|
||||
* Restructured and cleaned up cfile code. Added capability to read off
|
||||
* of CD-ROM drive and out of multiple pack files.
|
||||
*
|
||||
* 7 4/20/98 11:49a Hoffoss
|
||||
* Fixed bug with directory name getting.
|
||||
*
|
||||
* 6 4/10/98 12:18a Hoffoss
|
||||
* Make pilot image search in pack file possible.
|
||||
*
|
||||
* 5 1/19/98 9:37p Allender
|
||||
* Great Compiler Warning Purge of Jan, 1998. Used pragma's in a couple
|
||||
* of places since I was unsure of what to do with code.
|
||||
*
|
||||
* 4 12/30/97 5:31p Lawrance
|
||||
* fixed problem for people that didn't have a VP file
|
||||
*
|
||||
* 3 12/30/97 4:31p Sandeep
|
||||
* Changed pakfile format
|
||||
*
|
||||
* 2 12/28/97 12:42p John
|
||||
* Put in support for reading archive files; Made missionload use the
|
||||
* cf_get_file_list function. Moved demos directory out of data tree.
|
||||
*
|
||||
* 1 12/28/97 11:48a John
|
||||
*
|
||||
* $NoKeywords: $
|
||||
*/
|
||||
|
||||
|
||||
#define _CFILE_INTERNAL
|
||||
|
||||
|
||||
@@ -7,52 +7,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/CFile/CfileArchive.h $
|
||||
* $Revision: 2.3 $
|
||||
* $Date: 2005-07-13 02:50:49 $
|
||||
* $Author: Goober5000 $
|
||||
*
|
||||
* External def's for CfileArchive.cpp. This should only be used
|
||||
* internally by cfile stuff.
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.2 2004/08/11 05:06:19 Kazan
|
||||
* added preprocdefines.h to prevent what happened with fred -- make sure to make all fred2 headers include this file as the _first_ include -- i have already modified fs2 files to do this
|
||||
*
|
||||
* Revision 2.1 2002/07/07 19:55:58 penguin
|
||||
* Back-port to MSVC
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:21 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
* Revision 1.2 2002/05/17 02:56:19 mharris
|
||||
* first crack at unix compatibity
|
||||
*
|
||||
* Revision 1.1 2002/05/02 18:03:04 mharris
|
||||
* Initial checkin - converted filenames and includes to lower case
|
||||
*
|
||||
*
|
||||
* 2 10/07/98 10:52a Dave
|
||||
* Initial checkin.
|
||||
*
|
||||
* 1 10/07/98 10:48a Dave
|
||||
*
|
||||
* 4 5/11/98 10:59a John
|
||||
* Moved the low-level file reading code into cfilearchive.cpp.
|
||||
*
|
||||
* 3 4/30/98 4:53p John
|
||||
* Restructured and cleaned up cfile code. Added capability to read off
|
||||
* of CD-ROM drive and out of multiple pack files.
|
||||
*
|
||||
* 2 12/28/97 12:42p John
|
||||
* Put in support for reading archive files; Made missionload use the
|
||||
* cf_get_file_list function. Moved demos directory out of data tree.
|
||||
*
|
||||
* 1 12/28/97 11:48a John
|
||||
*
|
||||
* $NoKeywords: $
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _CFILEARCHIVE_H
|
||||
#define _CFILEARCHIVE_H
|
||||
|
||||
@@ -7,76 +7,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/CFile/CfileList.cpp $
|
||||
* $Revision: 2.6.2.2 $
|
||||
* $Date: 2007-05-20 02:51:26 $
|
||||
* $Author: taylor $
|
||||
*
|
||||
* Code for doing directory lists and sorts
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.6.2.1 2006/08/19 04:16:49 taylor
|
||||
* "byte" was the same as "ubyte", but since "byte" has to be an extra #define on everything but Windows, lets just get rid of it
|
||||
*
|
||||
* Revision 2.6 2005/01/31 23:27:51 taylor
|
||||
* merge with Linux/OSX tree - p0131-2
|
||||
*
|
||||
* Revision 2.5 2004/07/26 20:47:25 Kazan
|
||||
* remove MCD complete
|
||||
*
|
||||
* Revision 2.4 2004/07/17 09:26:00 taylor
|
||||
* add CF_SORT_REVERSE to real sort routine, makes CF_SORT_TIME work again
|
||||
*
|
||||
* Revision 2.3 2004/07/12 16:32:42 Kazan
|
||||
* MCD - define _MCD_CHECK to use memory tracking
|
||||
*
|
||||
* Revision 2.2 2002/08/01 01:41:04 penguin
|
||||
* The big include file move
|
||||
*
|
||||
* Revision 2.1 2002/07/29 19:37:21 penguin
|
||||
* added #ifdef _WIN32 around windows-specific system headers
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:21 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
* Revision 1.1 2002/05/02 18:03:04 mharris
|
||||
* Initial checkin - converted filenames and includes to lower case
|
||||
*
|
||||
*
|
||||
* 3 2/22/99 10:31p Andsager
|
||||
* Get rid of unneeded includes.
|
||||
*
|
||||
* 2 10/07/98 10:52a Dave
|
||||
* Initial checkin.
|
||||
*
|
||||
* 1 10/07/98 10:48a Dave
|
||||
*
|
||||
* 6 5/13/98 10:22p John
|
||||
* Added cfile functions to read/write rle compressed blocks of data.
|
||||
* Made palman use it for .clr files. Made alphacolors calculate on the
|
||||
* fly rather than caching to/from disk.
|
||||
*
|
||||
* 5 5/06/98 5:30p John
|
||||
* Removed unused cfilearchiver. Removed/replaced some unused/little used
|
||||
* graphics functions, namely gradient_h and _v and pixel_sp. Put in new
|
||||
* DirectX header files and libs that fixed the Direct3D alpha blending
|
||||
* problems.
|
||||
*
|
||||
* 4 4/30/98 4:53p John
|
||||
* Restructured and cleaned up cfile code. Added capability to read off
|
||||
* of CD-ROM drive and out of multiple pack files.
|
||||
*
|
||||
* 3 4/10/98 12:18a Hoffoss
|
||||
* Make pilot image search in pack file possible.
|
||||
*
|
||||
* 2 3/30/98 10:36p Allender
|
||||
* be sure to call _findclose() when done reading a file list
|
||||
*
|
||||
* 1 12/28/97 11:48a John
|
||||
*
|
||||
* $NoKeywords: $
|
||||
*/
|
||||
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
@@ -173,7 +104,7 @@ void cf_sort_filenames( int n, char **list, int sort, file_list_info *info )
|
||||
t = list[n - 1 - i];
|
||||
|
||||
if (list[i] != t) {
|
||||
strcpy(buffer, list[i]);
|
||||
strcpy_s(buffer, list[i]);
|
||||
strcpy(list[i], t);
|
||||
strcpy(t, buffer);
|
||||
|
||||
|
||||
+67
-317
@@ -7,248 +7,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/CFile/CfileSystem.cpp $
|
||||
* $Revision: 2.34.2.6 $
|
||||
* $Date: 2007-05-28 19:44:57 $
|
||||
* $Author: taylor $
|
||||
*
|
||||
* Functions to keep track of and find files that can exist
|
||||
* on the harddrive, cd-rom, or in a pack file on either of those.
|
||||
* This keeps a list of all the files in packfiles or on CD-rom
|
||||
* and when you need a file you call one function which then searches
|
||||
* all those locations, inherently enforcing precedence orders.
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.34.2.5 2007/04/11 18:21:20 taylor
|
||||
* cleanup of chcksum stuff (works properly on 64-bit systems now)
|
||||
* add chksum support for VPs, both a startup in debug builds, and via cmdline option (-verify_vps)
|
||||
* little cleanup in cmdline.cpp (get rid of the remaining "fix bugs" crap)
|
||||
*
|
||||
* Revision 2.34.2.4 2007/03/22 20:22:44 taylor
|
||||
* a little better error handling for cf_exists_full()
|
||||
* add a cf_exists_full_ext() which can find a series of extensions and returns true if any of them exist
|
||||
* use cf_exists_full_ext() for eventmusic file checks (to check for ogg and wav)
|
||||
* get rid of SPM hack, it's wrong (just commented out for now though)
|
||||
* fix a bunch of bugs in cf_find_file_location_ext():
|
||||
* - try to handle files with multiple periods a bit better (for the wav files like: blah_1.5.wav)
|
||||
* - load issue with finding incorrect files by mistake
|
||||
* - prevent finding different file types in various paths/roots
|
||||
*
|
||||
* Revision 2.34.2.3 2007/02/09 23:56:49 taylor
|
||||
* add the number of files that CFILE is going to try and use in each root to the debug info
|
||||
* optimizations for cf_find_file_location_ext()
|
||||
*
|
||||
* Revision 2.34.2.2 2006/08/27 18:01:45 taylor
|
||||
* various small cleanup and speedup changes
|
||||
* add a cf_find_file_location_ext() function, which you can pass a filename and a list of extensions and it will search for all of them at once
|
||||
*
|
||||
* Revision 2.34.2.1 2006/07/28 02:44:17 taylor
|
||||
* include CF_TYPE_PLAYERS in special pilot path consideration, prevents moddirs from always getting and empty data/players/
|
||||
*
|
||||
* Revision 2.34 2006/04/16 05:28:10 taylor
|
||||
* extra safety check when creating a default path string, filename is optional be we need to available if root0 is missing (CFILE not initted yet)
|
||||
* fix that crazy compiler<->constructor<->linker<->server.txt deal caused by some bad code and a freaky link thing in freespace.cpp
|
||||
*
|
||||
* Revision 2.33 2005/12/28 22:06:47 taylor
|
||||
* fix up cf_find_file_location() and related elements so that it's safer (based on WMC's work, but actually safe this time ;))
|
||||
*
|
||||
* Revision 2.32 2005/12/06 03:13:49 taylor
|
||||
* fix quite a few CFILE issues:
|
||||
* use #define's for path lengths when possible so it's easier to move between functions
|
||||
* fix huge Cfile_stack[] issue (how the hell did that get through :v: QA?)
|
||||
* add Int3() check on cfopen() so it's easier to know if it get's called before cfile is ready to use
|
||||
* move path separators to pstypes.h
|
||||
* fix possible string overruns when setting up CFILE roots
|
||||
* make sure we don't try to init current directory again thinking it's a CD-ROM
|
||||
* add the list of VP roots to debug log, this will undoubtedly be useful
|
||||
* when -nosound is use go ahead and set -nomusic too to both checks are correct
|
||||
* add list of cmdline options to debug log
|
||||
* fix possible overwrite issues with get_version_string() and remove '(fs2_open)' from string plus change OGL->OpenGL, D3D->Direct3D
|
||||
*
|
||||
* Revision 2.31 2005/11/16 21:25:34 taylor
|
||||
* switch from strchr() to strrchr() for extension checks in order to allow for multiple periods in a filename
|
||||
*
|
||||
* Revision 2.30 2005/10/23 11:44:07 taylor
|
||||
* fix memory errors from new[]/delete[] mismatch
|
||||
*
|
||||
* Revision 2.29 2005/10/23 05:37:59 wmcoolmon
|
||||
* Ack, missed testing compile under an Inferno build
|
||||
*
|
||||
* Revision 2.28 2005/10/17 00:13:28 wmcoolmon
|
||||
* Some cfile changes that slipped by
|
||||
*
|
||||
* Revision 2.27 2005/10/16 23:15:46 wmcoolmon
|
||||
* Hardened cfile against array overflows
|
||||
*
|
||||
* Revision 2.26 2005/05/12 17:49:10 taylor
|
||||
* use vm_malloc(), vm_free(), vm_realloc(), vm_strdup() rather than system named macros
|
||||
* fixes various problems and is past time to make the switch
|
||||
*
|
||||
* Revision 2.25 2005/01/30 12:50:08 taylor
|
||||
* merge with Linux/OSX tree - p0130
|
||||
*
|
||||
* Revision 2.24 2004/11/21 11:27:31 taylor
|
||||
* some 64-bit OS comaptibility fixes
|
||||
*
|
||||
* Revision 2.23 2004/10/31 21:28:38 taylor
|
||||
* support new pilot code, Linux code tree merge, don't use same pilot directory for Inferno builds
|
||||
*
|
||||
* Revision 2.22 2004/07/26 20:47:25 Kazan
|
||||
* remove MCD complete
|
||||
*
|
||||
* Revision 2.21 2004/07/17 09:26:00 taylor
|
||||
* add CF_SORT_REVERSE to real sort routine, makes CF_SORT_TIME work again
|
||||
*
|
||||
* Revision 2.20 2004/07/12 16:32:42 Kazan
|
||||
* MCD - define _MCD_CHECK to use memory tracking
|
||||
*
|
||||
* Revision 2.19 2004/05/26 22:02:36 wmcoolmon
|
||||
* Fixed cf_matches_spec; small bug was introduced.
|
||||
*
|
||||
* Revision 2.18 2004/05/26 21:02:26 wmcoolmon
|
||||
* Added weapons_expl modular table, updated cfilesystem to work with modular tables, fixed loading order, fixed ship loading error messages
|
||||
*
|
||||
* Revision 2.17 2004/05/03 21:22:19 Kazan
|
||||
* 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)
|
||||
*
|
||||
* Revision 2.16 2004/05/01 21:47:43 Kazan
|
||||
* bah! stupid me "NULL" not "null" - i hate when i do that
|
||||
*
|
||||
* Revision 2.15 2004/05/01 21:45:31 Kazan
|
||||
* changed delete[] to free(), checked for null, if null ERROR
|
||||
*
|
||||
* Revision 2.14 2004/05/01 19:49:31 Kazan
|
||||
* delete[] str_temp
|
||||
* A null check on str_temp is not needed - take a close look at the for loop
|
||||
*
|
||||
* Revision 2.13 2004/05/01 19:33:20 taylor
|
||||
* add CF_TYPE_MISSIONS to physical check to avoid network transfer problems
|
||||
*
|
||||
* Revision 2.12 2004/05/01 17:10:37 Kazan
|
||||
* Multiple -mod - "-mod ModA,ModB,ModC" in order of priority
|
||||
* Giving you:
|
||||
* Root: ModA
|
||||
* Root: ModB
|
||||
* Root: ModC
|
||||
* Root: Fs2Default
|
||||
* Root: CDRom
|
||||
*
|
||||
* Revision 2.11 2004/04/26 00:26:37 taylor
|
||||
* use absolute moddir path, faster cfilesystem searching
|
||||
*
|
||||
* Revision 2.10 2004/04/03 18:11:19 Kazan
|
||||
* FRED fixes
|
||||
*
|
||||
* Revision 2.9 2004/03/05 09:01:54 Goober5000
|
||||
* Uber pass at reducing #includes
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.8 2003/09/14 18:32:41 wmcoolmon
|
||||
* Added "-safeloading" command line parameter, which uses old fs2_retail-style loading code -C
|
||||
*
|
||||
* Revision 2.7 2003/08/20 08:14:50 wmcoolmon
|
||||
* Modified find_file_location to speed up file loading.
|
||||
*
|
||||
* Revision 2.6 2002/11/10 16:28:08 DTP
|
||||
* -DTP reworked mod support,
|
||||
*
|
||||
* Revision 2.5 2002/10/30 06:29:45 DTP
|
||||
* doh!, used upper case in include, dont know how much it matters for *nix systems, but here it is
|
||||
*
|
||||
* Revision 2.4 2002/10/30 06:26:11 DTP
|
||||
* DTP Implemented basic VP files handling. mission and campaign files inside VP files found in mod dir still not supported, cheking / creating directories not implented either
|
||||
*
|
||||
* Revision 2.3 2002/08/01 01:41:04 penguin
|
||||
* The big include file move
|
||||
*
|
||||
* Revision 2.2 2002/07/29 19:52:48 penguin
|
||||
* added #ifdef _WIN32 around windows-specific system headers
|
||||
*
|
||||
* Revision 2.1 2002/07/07 19:55:58 penguin
|
||||
* Back-port to MSVC
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:21 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
* Revision 1.6 2002/05/24 16:44:10 mharris
|
||||
* Fix unix "find files" operations so they return relative path
|
||||
*
|
||||
* Revision 1.5 2002/05/21 15:38:00 mharris
|
||||
* Unix glob changes -- still needs some work as we are getting full pathnames
|
||||
*
|
||||
* Revision 1.4 2002/05/17 23:38:33 mharris
|
||||
* Fixed silly bug in unix find-files code
|
||||
*
|
||||
* Revision 1.3 2002/05/16 06:03:29 mharris
|
||||
* Unix port changes
|
||||
*
|
||||
* Revision 1.2 2002/05/07 13:22:52 mharris
|
||||
* Added errno.h include
|
||||
*
|
||||
* Revision 1.1 2002/05/02 18:03:04 mharris
|
||||
* Initial checkin - converted filenames and includes to lower case
|
||||
*
|
||||
*
|
||||
* 6 9/08/99 10:01p Dave
|
||||
* Make sure game won't run in a drive's root directory. Make sure
|
||||
* standalone routes suqad war messages properly to the host.
|
||||
*
|
||||
* 5 9/03/99 1:31a Dave
|
||||
* CD checking by act. Added support to play 2 cutscenes in a row
|
||||
* seamlessly. Fixed super low level cfile bug related to files in the
|
||||
* root directory of a CD. Added cheat code to set campaign mission # in
|
||||
* main hall.
|
||||
*
|
||||
* 4 2/22/99 10:31p Andsager
|
||||
* Get rid of unneeded includes.
|
||||
*
|
||||
* 3 10/13/98 9:19a Andsager
|
||||
* Add localization support to cfile. Optional parameter with cfopen that
|
||||
* looks for localized files.
|
||||
*
|
||||
* 2 10/07/98 10:52a Dave
|
||||
* Initial checkin.
|
||||
*
|
||||
* 1 10/07/98 10:48a Dave
|
||||
*
|
||||
* 14 8/31/98 2:06p Dave
|
||||
* Make cfile sort the ordering or vp files. Added support/checks for
|
||||
* recognizing "mission disk" players.
|
||||
*
|
||||
* 13 6/23/98 4:18p Hoffoss
|
||||
* Fixed some bugs with AC release build.
|
||||
*
|
||||
* 12 5/20/98 10:46p John
|
||||
* Added code that doesn't include duplicate filenames in any file list
|
||||
* functions.
|
||||
*
|
||||
* 11 5/14/98 2:14p Lawrance2
|
||||
* Use filespec filtering for packfiles
|
||||
*
|
||||
* 10 5/03/98 11:53a John
|
||||
* Fixed filename case mangling.
|
||||
*
|
||||
* 9 5/02/98 11:06p Allender
|
||||
* correctly deal with pack pathnames
|
||||
*
|
||||
* 8 5/01/98 11:41a Allender
|
||||
* Fixed bug with mission saving in Fred.
|
||||
*
|
||||
* 7 5/01/98 10:21a John
|
||||
* Added code to find all pack files in all trees. Added code to create
|
||||
* any directories that we write to.
|
||||
*
|
||||
* 6 4/30/98 10:21p John
|
||||
* Added code to cleanup cfilesystem
|
||||
*
|
||||
* 5 4/30/98 10:18p John
|
||||
* added source safe header
|
||||
*
|
||||
* $NoKeywords: $
|
||||
*/
|
||||
|
||||
|
||||
#include "globalincs/pstypes.h"
|
||||
|
||||
@@ -256,7 +15,6 @@
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
#include <vector>
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <io.h>
|
||||
@@ -397,7 +155,7 @@ cf_root *cf_create_root()
|
||||
// return the # of packfiles which exist
|
||||
int cf_get_packfile_count(cf_root *root)
|
||||
{
|
||||
char filespec[MAX_PATH_LEN];
|
||||
SCP_string filespec;
|
||||
int i;
|
||||
int packfile_count;
|
||||
|
||||
@@ -405,34 +163,24 @@ int cf_get_packfile_count(cf_root *root)
|
||||
packfile_count = 0;
|
||||
for (i=CF_TYPE_ROOT; i<CF_MAX_PATH_TYPES; i++ )
|
||||
{
|
||||
strcpy( filespec, root->path );
|
||||
filespec = root->path;
|
||||
|
||||
if(strlen(Pathtypes[i].path))
|
||||
{
|
||||
if(strlen(filespec) + strlen(Pathtypes[i].path) + strlen(DIR_SEPARATOR_STR)
|
||||
>= sizeof(filespec))
|
||||
filespec += Pathtypes[ i ].path;
|
||||
if ( filespec[ filespec.length( ) - 1 ] != DIR_SEPARATOR_CHAR )
|
||||
{
|
||||
Warning(LOCATION, "Path '%s' too long to add '%s' safely.", filespec, Pathtypes[i].path);
|
||||
continue;
|
||||
}
|
||||
strcat( filespec, Pathtypes[i].path );
|
||||
if ( filespec[strlen(filespec)-1] != DIR_SEPARATOR_CHAR )
|
||||
{
|
||||
strcat( filespec, DIR_SEPARATOR_STR );
|
||||
filespec += DIR_SEPARATOR_STR;
|
||||
}
|
||||
}
|
||||
|
||||
#if defined _WIN32
|
||||
if(strlen(filespec) + 4 >= sizeof(filespec)) {
|
||||
Warning(LOCATION, "Could not concatenate '*.vp' to filespec; path too long.");
|
||||
continue;
|
||||
}
|
||||
strcat( filespec, "*.vp" );
|
||||
filespec += "*.vp";
|
||||
|
||||
int find_handle;
|
||||
_finddata_t find;
|
||||
|
||||
find_handle = _findfirst( filespec, &find );
|
||||
find_handle = _findfirst( filespec.c_str( ), &find );
|
||||
|
||||
if (find_handle != -1) {
|
||||
do {
|
||||
@@ -445,15 +193,11 @@ int cf_get_packfile_count(cf_root *root)
|
||||
_findclose( find_handle );
|
||||
}
|
||||
#elif defined SCP_UNIX
|
||||
if(strlen(filespec) + 10 >= sizeof(filespec)) {
|
||||
Warning(LOCATION, "Could not concatenate '*.vp' to filespec; path too long.");
|
||||
continue;
|
||||
}
|
||||
strcat( filespec, "*.[vV][pP]" );
|
||||
filespec += "*.[vV][pP]";
|
||||
|
||||
glob_t globinfo;
|
||||
memset(&globinfo, 0, sizeof(globinfo));
|
||||
int status = glob(filespec, 0, NULL, &globinfo);
|
||||
int status = glob(filespec.c_str( ), 0, NULL, &globinfo);
|
||||
if (status == 0) {
|
||||
for (unsigned int j = 0; j < globinfo.gl_pathc; j++) {
|
||||
// Determine if this is a regular file
|
||||
@@ -513,17 +257,17 @@ void cf_build_pack_list( cf_root *root )
|
||||
// now just setup all the root info
|
||||
root_index = 0;
|
||||
for (i = CF_TYPE_ROOT; i < CF_MAX_PATH_TYPES; i++) {
|
||||
strcpy( filespec, root->path );
|
||||
strcpy_s( filespec, root->path );
|
||||
|
||||
if ( strlen(Pathtypes[i].path) ) {
|
||||
strcat( filespec, Pathtypes[i].path );
|
||||
strcat_s( filespec, Pathtypes[i].path );
|
||||
|
||||
if ( filespec[strlen(filespec)-1] != DIR_SEPARATOR_CHAR )
|
||||
strcat( filespec, DIR_SEPARATOR_STR );
|
||||
strcat_s( filespec, DIR_SEPARATOR_STR );
|
||||
}
|
||||
|
||||
#if defined _WIN32
|
||||
strcat( filespec, "*.vp" );
|
||||
strcat_s( filespec, "*.vp" );
|
||||
|
||||
int find_handle;
|
||||
_finddata_t find;
|
||||
@@ -540,15 +284,15 @@ void cf_build_pack_list( cf_root *root )
|
||||
rptr_sort = &temp_roots_sort[root_index++];
|
||||
|
||||
// fill in all the proper info
|
||||
strcpy(rptr_sort->path, root->path);
|
||||
strcpy_s(rptr_sort->path, root->path);
|
||||
|
||||
if(strlen(Pathtypes[i].path)) {
|
||||
|
||||
strcat(rptr_sort->path, Pathtypes[i].path );
|
||||
strcat(rptr_sort->path, DIR_SEPARATOR_STR);
|
||||
strcat_s(rptr_sort->path, Pathtypes[i].path );
|
||||
strcat_s(rptr_sort->path, DIR_SEPARATOR_STR);
|
||||
}
|
||||
|
||||
strcat(rptr_sort->path, find.name );
|
||||
strcat_s(rptr_sort->path, find.name );
|
||||
rptr_sort->roottype = CF_ROOTTYPE_PACK;
|
||||
rptr_sort->cf_type = i;
|
||||
}
|
||||
@@ -558,7 +302,7 @@ void cf_build_pack_list( cf_root *root )
|
||||
_findclose( find_handle );
|
||||
}
|
||||
#elif defined SCP_UNIX
|
||||
strcat( filespec, "*.[vV][pP]" );
|
||||
strcat_s( filespec, "*.[vV][pP]" );
|
||||
glob_t globinfo;
|
||||
|
||||
memset(&globinfo, 0, sizeof(globinfo));
|
||||
@@ -579,7 +323,7 @@ void cf_build_pack_list( cf_root *root )
|
||||
rptr_sort = &temp_roots_sort[root_index++];
|
||||
|
||||
// fill in all the proper info
|
||||
strcpy(rptr_sort->path, globinfo.gl_pathv[j] );
|
||||
strcpy_s(rptr_sort->path, globinfo.gl_pathv[j] );
|
||||
rptr_sort->roottype = CF_ROOTTYPE_PACK;
|
||||
rptr_sort->cf_type = i;
|
||||
}
|
||||
@@ -600,7 +344,7 @@ void cf_build_pack_list( cf_root *root )
|
||||
cf_root *new_root;
|
||||
for (i = 0; i < temp_root_count; i++) {
|
||||
new_root = cf_create_root();
|
||||
strcpy( new_root->path, root->path );
|
||||
strcpy_s( new_root->path, root->path );
|
||||
|
||||
#ifndef NDEBUG
|
||||
uint chksum = 0;
|
||||
@@ -610,7 +354,7 @@ void cf_build_pack_list( cf_root *root )
|
||||
|
||||
// mwa -- 4/2/98 put in the next 2 lines because the path name needs to be there
|
||||
// to find the files.
|
||||
strcpy(new_root->path, temp_roots_sort[i].path);
|
||||
strcpy_s(new_root->path, temp_roots_sort[i].path);
|
||||
new_root->roottype = CF_ROOTTYPE_PACK;
|
||||
}
|
||||
|
||||
@@ -649,7 +393,7 @@ void cf_build_root_list(char *cdrom_dir)
|
||||
|
||||
// do we already have a slash? as in the case of a root directory install
|
||||
if ( (strlen(root->path) < (CF_MAX_PATHNAME_LENGTH-1)) && (root->path[strlen(root->path)-1] != DIR_SEPARATOR_CHAR) ) {
|
||||
strcat(root->path, DIR_SEPARATOR_STR); // put trailing backslash on for easier path construction
|
||||
strcat_s(root->path, DIR_SEPARATOR_STR); // put trailing backslash on for easier path construction
|
||||
}
|
||||
|
||||
strncat(root->path, str_temp, (CF_MAX_PATHNAME_LENGTH - strlen(root->path) - 1));
|
||||
@@ -667,7 +411,7 @@ void cf_build_root_list(char *cdrom_dir)
|
||||
|
||||
// do we already have a slash? as in the case of a root directory install
|
||||
if( (strlen(root->path) < (CF_MAX_PATHNAME_LENGTH-1)) && (root->path[strlen(root->path)-1] != DIR_SEPARATOR_CHAR) ) {
|
||||
strcat(root->path, DIR_SEPARATOR_STR); // put trailing backslash on for easier path construction
|
||||
strcat_s(root->path, DIR_SEPARATOR_STR); // put trailing backslash on for easier path construction
|
||||
}
|
||||
root->roottype = CF_ROOTTYPE_PATH;
|
||||
|
||||
@@ -702,7 +446,7 @@ void cf_build_root_list(char *cdrom_dir)
|
||||
|
||||
// do we already have a slash? as in the case of a root directory install
|
||||
if ( (strlen(root->path) < (CF_MAX_PATHNAME_LENGTH-1)) && (root->path[strlen(root->path)-1] != DIR_SEPARATOR_CHAR) ) {
|
||||
strcat(root->path, DIR_SEPARATOR_STR); // put trailing backslash on for easier path construction
|
||||
strcat_s(root->path, DIR_SEPARATOR_STR); // put trailing backslash on for easier path construction
|
||||
}
|
||||
|
||||
strncat(root->path, str_temp, (CF_MAX_PATHNAME_LENGTH - strlen(root->path) - 1));
|
||||
@@ -719,7 +463,7 @@ void cf_build_root_list(char *cdrom_dir)
|
||||
|
||||
// do we already have a slash? as in the case of a root directory install
|
||||
if ( (strlen(root->path) < (CF_MAX_PATHNAME_LENGTH-1)) && (root->path[strlen(root->path)-1] != DIR_SEPARATOR_CHAR) ) {
|
||||
strcat(root->path, DIR_SEPARATOR_STR); // put trailing backslash on for easier path construction
|
||||
strcat_s(root->path, DIR_SEPARATOR_STR); // put trailing backslash on for easier path construction
|
||||
}
|
||||
|
||||
root->roottype = CF_ROOTTYPE_PATH;
|
||||
@@ -737,7 +481,7 @@ void cf_build_root_list(char *cdrom_dir)
|
||||
// Check the real CD if one...
|
||||
if ( cdrom_dir && (strlen(cdrom_dir) < CF_MAX_PATHNAME_LENGTH) ) {
|
||||
root = cf_create_root();
|
||||
strcpy( root->path, cdrom_dir );
|
||||
strcpy_s( root->path, cdrom_dir );
|
||||
root->roottype = CF_ROOTTYPE_PATH;
|
||||
|
||||
//======================================================
|
||||
@@ -782,17 +526,17 @@ void cf_search_root_path(int root_index)
|
||||
continue;
|
||||
}
|
||||
|
||||
strcpy( search_path, root->path );
|
||||
strcpy_s( search_path, root->path );
|
||||
|
||||
if(strlen(Pathtypes[i].path)) {
|
||||
strcat( search_path, Pathtypes[i].path );
|
||||
strcat_s( search_path, Pathtypes[i].path );
|
||||
if ( search_path[strlen(search_path)-1] != DIR_SEPARATOR_CHAR ) {
|
||||
strcat( search_path, DIR_SEPARATOR_STR );
|
||||
strcat_s( search_path, DIR_SEPARATOR_STR );
|
||||
}
|
||||
}
|
||||
|
||||
#if defined _WIN32
|
||||
strcat( search_path, "*.*" );
|
||||
strcat_s( search_path, "*.*" );
|
||||
|
||||
int find_handle;
|
||||
_finddata_t find;
|
||||
@@ -809,7 +553,7 @@ void cf_search_root_path(int root_index)
|
||||
// Found a file!!!!
|
||||
cf_file *file = cf_create_file();
|
||||
|
||||
strcpy( file->name_ext, find.name );
|
||||
strcpy_s( file->name_ext, find.name );
|
||||
file->root_index = root_index;
|
||||
file->pathtype_index = i;
|
||||
file->write_time = find.time_write;
|
||||
@@ -856,7 +600,7 @@ void cf_search_root_path(int root_index)
|
||||
// Found a file!!!!
|
||||
cf_file *file = cf_create_file();
|
||||
|
||||
strcpy( file->name_ext, dir->d_name );
|
||||
strcpy_s( file->name_ext, dir->d_name );
|
||||
file->root_index = root_index;
|
||||
file->pathtype_index = i;
|
||||
|
||||
@@ -931,7 +675,7 @@ void cf_search_root_pack(int root_index)
|
||||
|
||||
char search_path[CF_MAX_PATHNAME_LENGTH];
|
||||
|
||||
strcpy( search_path, "" );
|
||||
strcpy_s( search_path, "" );
|
||||
|
||||
// Go through all the files
|
||||
int i;
|
||||
@@ -954,9 +698,9 @@ void cf_search_root_pack(int root_index)
|
||||
*p = 0;
|
||||
} else {
|
||||
if ( strlen(search_path) && (search_path[strlen(search_path)-1] != DIR_SEPARATOR_CHAR) ) {
|
||||
strcat( search_path, DIR_SEPARATOR_STR );
|
||||
strcat_s( search_path, DIR_SEPARATOR_STR );
|
||||
}
|
||||
strcat( search_path, find.filename );
|
||||
strcat_s( search_path, find.filename );
|
||||
}
|
||||
|
||||
//mprintf(( "Current dir = '%s'\n", search_path ));
|
||||
@@ -972,7 +716,7 @@ void cf_search_root_pack(int root_index)
|
||||
if ( is_ext_in_list( Pathtypes[j].extensions, ext ) ) {
|
||||
// Found a file!!!!
|
||||
cf_file *file = cf_create_file();
|
||||
strcpy( file->name_ext, find.filename );
|
||||
strcpy_s( file->name_ext, find.filename );
|
||||
file->root_index = root_index;
|
||||
file->pathtype_index = j;
|
||||
file->write_time = (time_t)find.write_time;
|
||||
@@ -1221,12 +965,12 @@ int cf_find_file_location( char *filespec, int pathtype, int max_out, char *pack
|
||||
strncpy( pack_filename, r->path, max_out );
|
||||
|
||||
if (f->pack_offset < 1) {
|
||||
SAFE_STRCAT( pack_filename, Pathtypes[f->pathtype_index].path, max_out );
|
||||
strcat_s( pack_filename, max_out, Pathtypes[f->pathtype_index].path );
|
||||
|
||||
if ( pack_filename[strlen(pack_filename)-1] != DIR_SEPARATOR_CHAR )
|
||||
SAFE_STRCAT( pack_filename, DIR_SEPARATOR_STR, max_out );
|
||||
strcat_s( pack_filename, max_out, DIR_SEPARATOR_STR );
|
||||
|
||||
SAFE_STRCAT( pack_filename, f->name_ext, max_out );
|
||||
strcat_s( pack_filename, max_out, f->name_ext );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1250,13 +994,13 @@ int cf_find_file_location( char *filespec, int pathtype, int max_out, char *pack
|
||||
|
||||
if (f->pack_offset < 1) {
|
||||
if ( strlen(Pathtypes[f->pathtype_index].path) ) {
|
||||
SAFE_STRCAT( pack_filename, Pathtypes[f->pathtype_index].path, max_out );
|
||||
strcat_s( pack_filename, max_out, Pathtypes[f->pathtype_index].path );
|
||||
|
||||
if ( pack_filename[strlen(pack_filename)-1] != DIR_SEPARATOR_CHAR )
|
||||
SAFE_STRCAT( pack_filename, DIR_SEPARATOR_STR, max_out );
|
||||
strcat_s( pack_filename, max_out, DIR_SEPARATOR_STR );
|
||||
}
|
||||
|
||||
SAFE_STRCAT( pack_filename, f->name_ext, max_out );
|
||||
strcat_s( pack_filename, max_out, f->name_ext );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1360,7 +1104,7 @@ int cf_find_file_location_ext( char *filename, const int ext_num, const char **e
|
||||
if ( p && (strlen(p) > 2) )
|
||||
(*p) = 0;
|
||||
|
||||
SAFE_STRCAT( filespec, ext_list[cur_ext], sizeof(filespec)-1 );
|
||||
strcat_s( filespec, ext_list[cur_ext] );
|
||||
|
||||
cf_create_default_path_string( longname, sizeof(longname)-1, search_order[i], filespec, localize );
|
||||
|
||||
@@ -1420,11 +1164,11 @@ int cf_find_file_location_ext( char *filename, const int ext_num, const char **e
|
||||
// (FIXME: this assumes that everything in ext_list[] is the same length!)
|
||||
uint filespec_len_big = filespec_len + strlen(ext_list[0]);
|
||||
|
||||
std::vector<cf_file*> file_list_index;
|
||||
SCP_vector< cf_file* > file_list_index;
|
||||
int last_root_index = -1;
|
||||
int last_path_index = -1;
|
||||
|
||||
file_list_index.reserve(Num_files);
|
||||
file_list_index.reserve( MIN(ext_num * 4, Num_files) );
|
||||
|
||||
// next, run though and pick out base matches
|
||||
for (i = 0; i < Num_files; i++) {
|
||||
@@ -1482,7 +1226,7 @@ int cf_find_file_location_ext( char *filename, const int ext_num, const char **e
|
||||
for (i = 0; i < file_list_size; i++) {
|
||||
cf_file *f = file_list_index[i];
|
||||
|
||||
SAFE_STRCAT( filespec, ext_list[cur_ext], sizeof(filespec)-1 );
|
||||
strcat_s( filespec, ext_list[cur_ext] );
|
||||
|
||||
if (localize) {
|
||||
// create localized filespec
|
||||
@@ -1502,12 +1246,12 @@ int cf_find_file_location_ext( char *filename, const int ext_num, const char **e
|
||||
strncpy( pack_filename, r->path, max_out );
|
||||
|
||||
if (f->pack_offset < 1) {
|
||||
SAFE_STRCAT( pack_filename, Pathtypes[f->pathtype_index].path, max_out );
|
||||
strcat_s( pack_filename, max_out, Pathtypes[f->pathtype_index].path );
|
||||
|
||||
if ( pack_filename[strlen(pack_filename)-1] != DIR_SEPARATOR_CHAR )
|
||||
SAFE_STRCAT( pack_filename, DIR_SEPARATOR_STR, max_out );
|
||||
strcat_s( pack_filename, max_out, DIR_SEPARATOR_STR );
|
||||
|
||||
SAFE_STRCAT( pack_filename, f->name_ext, max_out );
|
||||
strcat_s( pack_filename, max_out, f->name_ext );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1535,13 +1279,13 @@ int cf_find_file_location_ext( char *filename, const int ext_num, const char **e
|
||||
if (f->pack_offset < 1) {
|
||||
|
||||
if ( strlen(Pathtypes[f->pathtype_index].path) ) {
|
||||
SAFE_STRCAT( pack_filename, Pathtypes[f->pathtype_index].path, max_out );
|
||||
strcat_s( pack_filename, max_out, Pathtypes[f->pathtype_index].path );
|
||||
|
||||
if ( pack_filename[strlen(pack_filename)-1] != DIR_SEPARATOR_CHAR )
|
||||
SAFE_STRCAT( pack_filename, DIR_SEPARATOR_STR, max_out );
|
||||
strcat_s( pack_filename, max_out, DIR_SEPARATOR_STR );
|
||||
}
|
||||
|
||||
SAFE_STRCAT( pack_filename, f->name_ext, max_out );
|
||||
strcat_s( pack_filename, max_out, f->name_ext );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1612,7 +1356,7 @@ int cf_file_already_in_list( int num_files, char **list, char *filename )
|
||||
|
||||
char name_no_extension[MAX_PATH_LEN];
|
||||
|
||||
strcpy(name_no_extension, filename );
|
||||
strcpy_s(name_no_extension, filename );
|
||||
char *p = strrchr( name_no_extension, '.' );
|
||||
if ( p ) *p = 0;
|
||||
|
||||
@@ -1662,6 +1406,9 @@ int cf_get_file_list( int max, char **list, int pathtype, char *filter, int sort
|
||||
if (num_files >= max)
|
||||
break;
|
||||
|
||||
if (strcmp(strstr(filter, "."), strstr(find.name,".")) != 0)
|
||||
continue;
|
||||
|
||||
if ( strlen(find.name) >= MAX_FILENAME_LEN )
|
||||
continue;
|
||||
|
||||
@@ -1807,7 +1554,7 @@ int cf_file_already_in_list_preallocated( int num_files, char arr[][MAX_FILENAME
|
||||
|
||||
char name_no_extension[MAX_PATH_LEN];
|
||||
|
||||
strcpy(name_no_extension, filename );
|
||||
strcpy_s(name_no_extension, filename );
|
||||
char *p = strrchr( name_no_extension, '.' );
|
||||
if ( p ) *p = 0;
|
||||
|
||||
@@ -1866,6 +1613,9 @@ int cf_get_file_list_preallocated( int max, char arr[][MAX_FILENAME_LEN], char *
|
||||
break;
|
||||
|
||||
if (!(find.attrib & _A_SUBDIR)) {
|
||||
|
||||
if (strcmp(strstr(filter, "."), strstr(find.name,".")) != 0)
|
||||
continue;
|
||||
|
||||
if ( strlen(find.name) >= MAX_FILENAME_LEN )
|
||||
continue;
|
||||
@@ -2037,26 +1787,26 @@ int cf_create_default_path_string( char *path, uint path_max, int pathtype, char
|
||||
strncpy(path, root->path, path_max);
|
||||
}
|
||||
|
||||
SAFE_STRCAT(path, Pathtypes[pathtype].path, path_max);
|
||||
strcat_s(path, path_max, Pathtypes[pathtype].path);
|
||||
|
||||
// Don't add slash for root directory
|
||||
if (Pathtypes[pathtype].path[0] != '\0') {
|
||||
if ( path[strlen(path)-1] != DIR_SEPARATOR_CHAR ) {
|
||||
SAFE_STRCAT(path, DIR_SEPARATOR_STR, path_max);
|
||||
strcat_s(path, path_max, DIR_SEPARATOR_STR);
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef INF_BUILD
|
||||
// keep pilot files separated for an Inferno build since they aren't compatible
|
||||
if ( pathtype == CF_TYPE_SINGLE_PLAYERS ) {
|
||||
SAFE_STRCAT(path, "inferno", path_max);
|
||||
SAFE_STRCAT(path, DIR_SEPARATOR_STR, path_max);
|
||||
if ( pathtype == CF_TYPE_SINGLE_PLAYERS || pathtype == CF_TYPE_MULTI_PLAYERS ) {
|
||||
strcat_s(path, path_max, "inferno");
|
||||
strcat_s(path, path_max, DIR_SEPARATOR_STR);
|
||||
}
|
||||
#endif
|
||||
|
||||
// add filename
|
||||
if (filename) {
|
||||
SAFE_STRCAT(path, filename, path_max);
|
||||
strcat_s(path, path_max, filename);
|
||||
|
||||
// localize filename
|
||||
if (localize) {
|
||||
|
||||
@@ -7,58 +7,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/CFile/CfileSystem.h $
|
||||
* $Revision: 2.5 $
|
||||
* $Date: 2006-04-20 06:32:00 $
|
||||
* $Author: Goober5000 $
|
||||
*
|
||||
* Functions to keep track of and find files that can exist
|
||||
* on the harddrive, cd-rom, or in a pack file on either of those.
|
||||
* This keeps a list of all the files in packfiles or on CD-rom
|
||||
* and when you need a file you call one function which then searches
|
||||
* all those locations, inherently enforcing precedence orders.
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.4 2005/10/16 23:15:46 wmcoolmon
|
||||
* Hardened cfile against array overflows
|
||||
*
|
||||
* Revision 2.3 2005/07/13 02:50:49 Goober5000
|
||||
* remove PreProcDefine #includes in FS2
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.2 2004/08/11 05:06:19 Kazan
|
||||
* added preprocdefines.h to prevent what happened with fred -- make sure to make all fred2 headers include this file as the _first_ include -- i have already modified fs2 files to do this
|
||||
*
|
||||
* Revision 2.1 2004/03/05 09:01:54 Goober5000
|
||||
* Uber pass at reducing #includes
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:21 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
* Revision 1.1 2002/05/02 18:03:04 mharris
|
||||
* Initial checkin - converted filenames and includes to lower case
|
||||
*
|
||||
*
|
||||
* 3 10/13/98 9:19a Andsager
|
||||
* Add localization support to cfile. Optional parameter with cfopen that
|
||||
* looks for localized files.
|
||||
*
|
||||
* 2 10/07/98 10:52a Dave
|
||||
* Initial checkin.
|
||||
*
|
||||
* 1 10/07/98 10:48a Dave
|
||||
*
|
||||
* 5 5/01/98 10:21a John
|
||||
* Added code to find all pack files in all trees. Added code to create
|
||||
* any directories that we write to.
|
||||
*
|
||||
* 4 4/30/98 10:21p John
|
||||
* Added code to cleanup cfilesystem
|
||||
*
|
||||
* $NoKeywords: $
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _CFILESYSTEM_H
|
||||
#define _CFILESYSTEM_H
|
||||
|
||||
@@ -7,40 +7,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* $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>
|
||||
@@ -127,7 +94,13 @@ int write_index(char *hf, char *df)
|
||||
d = fopen(df, "a+b");
|
||||
|
||||
if ( (h == NULL) || (d == NULL) )
|
||||
{
|
||||
if ( h )
|
||||
fclose( h );
|
||||
if ( d )
|
||||
fclose( d );
|
||||
return 0;
|
||||
}
|
||||
|
||||
for (i = 0; i < Num_files; i++) {
|
||||
fread(tmp_data, 32+4+4+4, 1, h);
|
||||
|
||||
@@ -3,47 +3,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* $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"
|
||||
|
||||
+185
-971
File diff suppressed because it is too large.
Load diff
+14
-599
@@ -8,597 +8,7 @@
|
||||
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Cmdline/cmdline.h $
|
||||
|
||||
* $Revision: 2.89.2.9 $
|
||||
* $Date: 2008-01-08 01:41:13 $
|
||||
* $Author: Kazan $
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.89.2.8 2007/10/15 06:43:08 taylor
|
||||
* FS2NetD v.2 (still a work in progress, but is ~98% complete)
|
||||
*
|
||||
* Revision 2.89.2.7 2007/04/11 18:21:22 taylor
|
||||
* cleanup of chcksum stuff (works properly on 64-bit systems now)
|
||||
* add chksum support for VPs, both a startup in debug builds, and via cmdline option (-verify_vps)
|
||||
* little cleanup in cmdline.cpp (get rid of the remaining "fix bugs" crap)
|
||||
*
|
||||
* Revision 2.89.2.6 2007/04/06 12:55:37 karajorma
|
||||
* Add the -cap_object_update command line to force multiplayer clients to a more server friendly object update setting.
|
||||
*
|
||||
* Revision 2.89.2.5 2007/02/11 09:24:08 taylor
|
||||
* remove -pcx32 and -jpgtga
|
||||
*
|
||||
* Revision 2.89.2.4 2006/11/15 00:21:40 taylor
|
||||
* clean up some cmdline options which were/weren't FSO only
|
||||
* add back the "-32bit" option, for retail compatibility (doesn't do anything, it's just there to avoid the unknown option message)
|
||||
* add "-debug_window" to turn on the Windows-only extra debug output window (it's off by default now, only logging to file instead)
|
||||
*
|
||||
* Revision 2.89.2.3 2006/07/08 18:09:41 taylor
|
||||
* remove -allslev
|
||||
* make CTRL-SHIFT-S hotkey work in mission simulator (it's a toggle, so you can turn it on or off while on the screen)
|
||||
* fix a bug where blank lines would show up in the campaign list for branch/alternate type missions that are otherwise marked as not completed
|
||||
*
|
||||
* Revision 2.89.2.2 2006/06/18 17:21:49 taylor
|
||||
* add a -disable_fbo troubleshooting option for those ATI users having trouble with FBOs, but can still use envmapping otherwise
|
||||
*
|
||||
* Revision 2.89.2.1 2006/06/15 00:16:23 taylor
|
||||
* remove previous attempts at the Y bug fix, it's now back to the retail code for that
|
||||
*
|
||||
* Revision 2.89 2006/05/27 17:17:57 taylor
|
||||
* few things:
|
||||
* - comment out that -fixbugs and -nocrash crap, that's just stupid
|
||||
* - move -env off of the experimental list (since it's working pretty well in OGL)
|
||||
* - remove -nobeampierce
|
||||
* - remove -max_subdivide (didn't do anything)
|
||||
* - remove -rt (didn't do anything, and per-coder cmdline options should never be in CVS)
|
||||
* - move -cache_bitmaps to game speed rather than graphics
|
||||
* - add options for env and spec map scaling for envmaps (temporary, to be removed before official 3.6.8)
|
||||
* - add option for new alpha blend mode so that artists can still test with it but not mess up normal users with the bad MediaVPs
|
||||
* - remove -d3d_particle (it's obsolete now)
|
||||
*
|
||||
* Revision 2.88 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.87 2006/04/05 13:47:01 taylor
|
||||
* remove -tga16, it's obsolete now
|
||||
* add a temporary -no_emissive_light option to not use emission type light in OGL
|
||||
*
|
||||
* Revision 2.86 2006/03/18 10:17:58 taylor
|
||||
* we already have a variable to show the framerate so lets just use the one
|
||||
*
|
||||
* Revision 2.85 2006/02/24 07:36:49 taylor
|
||||
* try and make some sense out of that cmdline option mess, maybe it will stay sane for a few days at least :)
|
||||
*
|
||||
* Revision 2.84 2006/01/10 18:37:45 randomtiger
|
||||
* Improvements to voice recognition system.
|
||||
* Also function put on -voicer launcher option.
|
||||
*
|
||||
* Revision 2.83 2005/11/24 06:37:47 phreak
|
||||
* Added -missile_lighting command line
|
||||
*
|
||||
* Revision 2.82 2005/11/23 00:43:20 phreak
|
||||
* Command lines for rearm countdown timer.
|
||||
*
|
||||
* Revision 2.81 2005/11/21 00:46:06 Goober5000
|
||||
* add ai_settings.tbl
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.80 2005/11/13 06:55:38 taylor
|
||||
* cmdline option cleanup:
|
||||
* remove from launcher -pcx32, -cell, -UseNewAI
|
||||
* remove from game -loadonlyused, -dxt, -pcx2dds
|
||||
* rename -d3dmipmap, -d3d_no_vsync, -dnoshowvid to non API specific sounding names
|
||||
* add -nograb into help output under Linux/OSX
|
||||
* add -loadallweps and -img2dds
|
||||
*
|
||||
* Revision 2.79 2005/10/30 20:00:22 taylor
|
||||
* same basic cleanup and self-sanity changes
|
||||
* split up WinMain() and main() so it doesn't resemble ifdef hell
|
||||
* rename WinMainSub() to game_main() and move anything that should have been in WinMain() to WinMain()
|
||||
*
|
||||
* Revision 2.78 2005/10/23 11:45:06 taylor
|
||||
* add -ogl_shine to adjust the OGL shininess value so that people can play around and find the best value to use
|
||||
*
|
||||
* Revision 2.77 2005/10/22 04:28:16 unknownplayer
|
||||
* Added -UseNewAI command line option to force the game to always use
|
||||
* the SCP AI changes. As of now there's some problem in gr_d3d_set_render_target
|
||||
* that crashes the game when it gets to a mission.
|
||||
*
|
||||
* Revision 2.76 2005/10/12 05:43:40 taylor
|
||||
* temporary cmdline option, -y_bug_fix, to switch between original code (default) and previous attempt at the Y-bug fix
|
||||
*
|
||||
* Revision 2.75 2005/09/30 09:47:06 taylor
|
||||
* remove -rlm, it's always on now since there was never a complaint and pretty much everyone uses it
|
||||
* add -cache_bitmaps and have bitmap caching between levels off by default
|
||||
* when -cache_bitmaps is used then use C-BMP for top-right memory listing, and just BMP otherwise
|
||||
*
|
||||
* Revision 2.74 2005/09/21 03:55:31 Goober5000
|
||||
* add option for warp flash; mess with the cmdlines a bit
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.73 2005/07/25 05:24:16 Goober5000
|
||||
* cleaned up some command line and mission flag stuff
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.72 2005/07/13 02:50:49 Goober5000
|
||||
* remove PreProcDefine #includes in FS2
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.71 2005/07/07 16:32:33 taylor
|
||||
* compiler warning fixes
|
||||
* add -noibx troubleshooting cmdline option to disable use of IBX files
|
||||
* don't try to set thuster object number is only one thruster bank is specified (default method should go into affect)
|
||||
*
|
||||
* Revision 2.70 2005/06/29 18:46:13 taylor
|
||||
* add option to not scale up movies to fit window/screen, default is to scale
|
||||
* (arguably not a bug but I said I would get it in before 3.6.5 and forgot)
|
||||
*
|
||||
* Revision 2.69 2005/03/13 23:07:35 taylor
|
||||
* enable 32-bit to 16-bit TGA conversion with -tga16 cmdline option (experimental)
|
||||
* fix crash when upgrading from original campaign stats file to current
|
||||
*
|
||||
* Revision 2.68 2005/02/16 10:00:13 wmcoolmon
|
||||
* "-ingame" command line option
|
||||
*
|
||||
* Revision 2.67 2005/01/30 12:50:08 taylor
|
||||
* merge with Linux/OSX tree - p0130
|
||||
*
|
||||
* Revision 2.66 2005/01/29 16:30:46 phreak
|
||||
* smart shield command line stuff. this will be changed in the future, but i want people to test it.
|
||||
* -phreak
|
||||
*
|
||||
* Revision 2.65 2005/01/21 08:29:04 taylor
|
||||
* add -rlm cmdline option to switch to local viewpoint lighting calculations (OGL only for now)
|
||||
*
|
||||
* Revision 2.64 2004/12/24 19:36:12 Goober5000
|
||||
* resorted command-line options and added an option for WMC's ballistic gauge
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.63 2004/11/23 19:29:13 taylor
|
||||
* fix 2d warp in D3D, add cmdline option for 3d warp
|
||||
*
|
||||
* Revision 2.62 2004/09/10 13:51:20 et1
|
||||
* Command line option for TBP for warp stuff, "-tbpwarpeffects"
|
||||
*
|
||||
* Revision 2.61 2004/08/11 05:06:19 Kazan
|
||||
* added preprocdefines.h to prevent what happened with fred -- make sure to make all fred2 headers include this file as the _first_ include -- i have already modified fs2 files to do this
|
||||
*
|
||||
* Revision 2.60 2004/08/02 22:40:59 phreak
|
||||
* added -orbradar to enable orb rendering for the radar
|
||||
*
|
||||
* Revision 2.59 2004/08/01 02:31:18 phreak
|
||||
* -phreak command line changed to -dualscanlines
|
||||
*
|
||||
* Revision 2.58 2004/07/25 18:46:28 Kazan
|
||||
* -fred_no_warn has become -no_warn and applies to both fred and fs2
|
||||
* added new ai directive (last commit) and disabled afterburners while performing AIM_WAYPOINTS or AIM_FLY_TO_SHIP
|
||||
* fixed player ship speed bug w/ player-use-ai, now stays in formation correctly and manages speed
|
||||
* made -radar_reduce ignore itself if no parameter is given (ignoring launcher bug)
|
||||
*
|
||||
* Revision 2.57 2004/07/05 05:09:15 bobboau
|
||||
* FVF code, only the data that is needed is sent off to the card,,
|
||||
* OGL can take advantage of this if they want but it won't break
|
||||
* anything if they don't. also state block code has been implemented,
|
||||
* that's totaly internal to D3D no high level code is involved.
|
||||
*
|
||||
* Revision 2.56 2004/06/19 22:15:48 wmcoolmon
|
||||
* Added -nomotion debris command line option; also re-ordered categories.
|
||||
*
|
||||
* Revision 2.55 2004/06/06 12:25:19 randomtiger
|
||||
* Added new compression option -pcx32dds, build posted in RSB forum.
|
||||
* Changed flag because of launcher bug, have fixed launcher bug, will distribute later.
|
||||
* Also removed experimental flag from launcher flag list, stupid people were reporting bugs on unfinished code.
|
||||
*
|
||||
* Revision 2.54 2004/04/26 18:23:47 Kazan
|
||||
* -no_fps_capping
|
||||
*
|
||||
* Revision 2.53 2004/04/26 00:23:26 taylor
|
||||
* novbo and snd_preload cmdline options, fix moddir getting appended space
|
||||
*
|
||||
* Revision 2.52 2004/04/18 19:39:12 randomtiger
|
||||
* Added -2d_poof command which allows access to 2D poof rendering
|
||||
* Added -radar_reduce to launcher flag description structure
|
||||
*
|
||||
* Revision 2.51 2004/04/03 18:11:20 Kazan
|
||||
* FRED fixes
|
||||
*
|
||||
* Revision 2.50 2004/03/20 14:47:12 randomtiger
|
||||
* Added base for a general dynamic batching solution.
|
||||
* Fixed NO_DSHOW_CODE code path bug.
|
||||
*
|
||||
* Revision 2.49 2004/03/19 14:51:54 randomtiger
|
||||
* New command line parameter: -d3d_lesstmem causes D3D to bypass V's secondry texture system.
|
||||
*
|
||||
* Revision 2.48 2004/03/19 11:44:04 randomtiger
|
||||
* 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.
|
||||
*
|
||||
* Revision 2.47 2004/02/27 04:09:55 bobboau
|
||||
* fixed a Z buffer error in HTL submodel rendering,
|
||||
* and glow points,
|
||||
* and other stuff
|
||||
*
|
||||
* Revision 2.46 2004/02/16 11:47:31 randomtiger
|
||||
* Removed a lot of files that we dont need anymore.
|
||||
* Changed htl to be on by default, command now -nohtl
|
||||
* Changed D3D to use a 2D vertex for 2D operations which should cut down on redundant data having to go though the system.
|
||||
* Added small change to all -start_mission flag to take you to any mission by filename, very useful for testing.
|
||||
* Removed old dshow code and took away timerbar compile flag condition since it uses a runtime flag now.
|
||||
*
|
||||
* Revision 2.45 2004/01/29 01:34:00 randomtiger
|
||||
* 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.
|
||||
*
|
||||
* Revision 2.44 2004/01/24 14:31:27 randomtiger
|
||||
* 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.
|
||||
*
|
||||
* Revision 2.43 2003/12/08 22:30:02 randomtiger
|
||||
* Put render state and other direct D3D calls repetition check back in, provides speed boost.
|
||||
* Fixed bug that caused fullscreen only crash with DXT textures
|
||||
* Put dithering back in for tgas and jpgs
|
||||
*
|
||||
* Revision 2.42 2003/12/04 20:39:09 randomtiger
|
||||
* 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
|
||||
*
|
||||
* Revision 2.41 2003/12/03 19:27:00 randomtiger
|
||||
* 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
|
||||
*
|
||||
* Revision 2.40 2003/11/29 10:52:09 randomtiger
|
||||
* Turned off D3D file mapping, its using too much memory which may be hurting older systems and doesnt seem to be providing much of a speed benifit.
|
||||
* Added stats command for ingame stats on memory usage.
|
||||
* Trys to play intro.mve and intro.avi, just to be safe since its not set by table.
|
||||
* Added fix for fonts wrapping round in non standard hi res modes.
|
||||
* Changed D3D mipmapping to a good value to suit htl mode.
|
||||
* Added new fog colour method which makes use of the bitmap, making this htl feature backcompatible again.
|
||||
*
|
||||
* Revision 2.39 2003/11/19 20:37:23 randomtiger
|
||||
* 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.
|
||||
*
|
||||
* Revision 2.38 2003/11/15 18:09:33 randomtiger
|
||||
* 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
|
||||
*
|
||||
* Revision 2.37 2003/11/09 06:31:38 Kazan
|
||||
* 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
|
||||
*
|
||||
* Revision 2.36 2003/11/09 04:09:18 Goober5000
|
||||
* edited for language
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.35 2003/11/08 22:25:47 Kazan
|
||||
* Timerbar was enabled in both release and debug - so i made it a command line option "-timerbar"
|
||||
* DONT MESS WITH OTHER PEOPLES INCLUDE PATHS
|
||||
* DONT MESS WITH EXEC NAMES (leave it fs2_open_r and fs2_open_d) or paths!
|
||||
*
|
||||
* Revision 2.34 2003/11/03 18:07:26 randomtiger
|
||||
* Added -d3d_no_vsync command to make turning off vsync optional.
|
||||
* Removed 32bit command, it doesnt do anything.
|
||||
* Made aa multisample reg check safe.
|
||||
*
|
||||
* Revision 2.33 2003/10/27 23:04:20 randomtiger
|
||||
* 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.
|
||||
*
|
||||
* Revision 2.32 2003/10/24 17:35:04 randomtiger
|
||||
* Implemented support for 32bit TGA and JPG for D3D
|
||||
* Also 32 bit PCX, but it still has some bugs to be worked out
|
||||
* Moved convert_24_to_16 out of the bitmap pfunction structures and into packunpack.cpp because thats the only place that uses it.
|
||||
*
|
||||
* Revision 2.31 2003/10/17 17:18:42 randomtiger
|
||||
* Big restructure for D3D and new modules grd3dlight and grd3dsetup
|
||||
*
|
||||
* Revision 2.30 2003/10/12 03:41:37 Kazan
|
||||
* #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)
|
||||
*
|
||||
* Revision 2.29 2003/09/25 21:12:22 Kazan
|
||||
* ##Kazan## FS2NetD Completed! Just needs some thorough bug checking (i don't think there are any serious bugs)
|
||||
* Also D3D8 Screenshots work now.
|
||||
*
|
||||
* Revision 2.28 2003/09/23 02:42:52 Kazan
|
||||
* ##KAZAN## - FS2NetD Support! (FS2 Open PXO) -- Game Server Listing, and mission validation completed - stats storing to come - needs fs2open_pxo.cfg file [VP-able]
|
||||
*
|
||||
* Revision 2.27 2003/09/14 19:00:02 wmcoolmon
|
||||
* Changed "nospec" and "cell" to "Cmdline_nospec" and "Cmdline_cell"
|
||||
*
|
||||
* Revision 2.26 2003/09/14 18:32:24 wmcoolmon
|
||||
* Added "-safeloading" command line parameter, which uses old fs2_retail-style loading code -C
|
||||
*
|
||||
* Revision 2.25 2003/09/13 06:02:05 Goober5000
|
||||
* clean rollback of all of argv's stuff
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.23 2003/08/22 07:35:08 bobboau
|
||||
* specular code should be bugless now,
|
||||
* cell shadeing has been added activated via the comand line '-cell',
|
||||
* 3D shockwave models, and a transparency method I'm calling edge and center alpha that could be usefull for other things, ask for details
|
||||
*
|
||||
* Revision 2.22 2003/08/21 20:54:37 randomtiger
|
||||
* Fixed switching - RT
|
||||
*
|
||||
* Revision 2.21 2003/08/12 03:18:33 bobboau
|
||||
* Specular 'shine' mapping;
|
||||
* useing a phong lighting model I have made specular highlights
|
||||
* that are mapped to the model,
|
||||
* rendering them is still slow, but they look real purdy
|
||||
*
|
||||
* also 4 new (untested) comand lines, the XX is a floating point value
|
||||
* -spec_exp XX
|
||||
* the n value, you can set this from 0 to 200 (actualy more than that, but this is the recomended range), it will make the highlights bigger or smaller, defalt is 16.0 so start playing around there
|
||||
* -spec_point XX
|
||||
* -spec_static XX
|
||||
* -spec_tube XX
|
||||
* these are factors for the three diferent types of lights that FS uses, defalt is 1.0,
|
||||
* static is the local stars,
|
||||
* point is weapons/explosions/warp in/outs,
|
||||
* tube is beam weapons,
|
||||
* for thouse of you who think any of these lights are too bright you can configure them you're self for personal satisfaction
|
||||
*
|
||||
* Revision 2.20 2003/08/09 06:07:23 bobboau
|
||||
* slightly better implementation of the new zbuffer thing, it now checks only three diferent formats defalting to the 16 bit if neither the 24 or 32 bit versions are suported
|
||||
*
|
||||
* Revision 2.19 2003/03/29 09:42:05 Goober5000
|
||||
* made beams default shield piercing again
|
||||
* also added a beam no pierce command line flag
|
||||
* and fixed something else which I forgot :P
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.18 2003/03/18 10:07:00 unknownplayer
|
||||
* The big DX/main line merge. This has been uploaded to the main CVS since I can't manage to get it to upload to the DX branch. Apologies to all who may be affected adversely, but I'll work to debug it as fast as I can.
|
||||
*
|
||||
* Revision 2.17 2003/02/22 04:13:17 wmcoolmon
|
||||
* Added "-dshowvid" command-line option, which must be set in order for movies to play.
|
||||
*
|
||||
* Revision 2.16 2002/12/21 13:39:25 DTP
|
||||
* did bit more house keeping. modfied Phreaks fps cmdline a bit, so that we dont have to specific build code.libs for fred, but can use the same code.lib for both fs2_open.exe and fred2_open.exe
|
||||
*
|
||||
* Revision 2.15 2002/12/17 03:08:18 DTP
|
||||
* fix to Show_framerate. seems it will call an unresolved external error during fred builds. modified my ifndefs a bit, dsw modified to include preprocessor tag FRED.
|
||||
*
|
||||
* Revision 2.14 2002/12/17 02:22:34 DTP
|
||||
* wrong name :)
|
||||
*
|
||||
* Revision 2.13 2002/12/17 02:21:06 DTP
|
||||
* cleaned up after phreak :). it will make a mess in debug builds. added a couple of ifndef _debugs.
|
||||
*
|
||||
* Revision 2.12 2002/11/10 16:30:53 DTP
|
||||
* -DTP reworked mod support,
|
||||
*
|
||||
* Revision 2.11 2002/10/31 21:14:16 DTP
|
||||
* DTP Quickly added something needed to cmdline.h, since otherwise we can not compile the code as it misses some externals. Thought a rollback rolled all back.
|
||||
*
|
||||
* Revision 2.10 2002/10/30 20:22:30 inquisitor
|
||||
* Bad Committ, Rolling back
|
||||
*
|
||||
* Revision 2.7 2002/10/22 23:02:39 randomtiger
|
||||
* Made Phreaks alternative scanning style optional under the command line tag "-phreak"
|
||||
* Fixed bug that changes HUD colour when targetting debris in a full nebula. - RT
|
||||
*
|
||||
* Revision 2.6 2002/10/19 03:50:28 randomtiger
|
||||
* Added special pause mode for easier action screenshots.
|
||||
* Added new command line parameter for accessing all single missions in tech room. - RT
|
||||
*
|
||||
* Revision 2.5 2002/08/27 13:38:57 penguin
|
||||
* Moved DirectX8 stuff to directx8 branch; reverted to previous
|
||||
*
|
||||
* Revision 2.3.2.4 2002/11/10 11:32:29 randomtiger
|
||||
*
|
||||
* Made D3D8 mipmapping optional on command line flag -d3dmipmip, off by default.
|
||||
* When on is now less blury. - RT
|
||||
*
|
||||
* Revision 2.3.2.3 2002/11/04 23:53:24 randomtiger
|
||||
*
|
||||
* Added new command line parameter -d3dlauncher which brings up the launcher.
|
||||
* This is needed since FS2 DX8 now stores the last successful details in the registry and
|
||||
* uses them to choose the adapter and mode to run in unless its windowed or they are not set.
|
||||
* Added some code for Antialiasing but it messes up the font but hopefully that can be fixed later. - RT
|
||||
*
|
||||
* Revision 2.3.2.2 2002/11/04 21:24:59 randomtiger
|
||||
*
|
||||
* When running in D3D all ani's are memory mapped for speed, this takes up more memory but stops gametime locking of textures which D3D8 hates.
|
||||
* Added new command line tag Cmdline_d3dlowmem for people who dont want to make use of this because they have no memory.
|
||||
* Cleaned up some more texture stuff enabled console debug for D3D.
|
||||
*
|
||||
* Revision 2.3.2.1 2002/08/27 13:19:02 penguin
|
||||
* Moved to directx8 branch
|
||||
*
|
||||
* Revision 2.4 2002/08/18 19:48:28 randomtiger
|
||||
* Added new lib files: strmiids and ddraw to get dshow working
|
||||
* Added new command line parameter to active direct show movie play: -dshowvid
|
||||
* Uncommented movie_play calls and includes
|
||||
*
|
||||
* Revision 2.3 2002/08/07 00:44:13 DTP
|
||||
* Implented -GF4FIX commandline switch
|
||||
*
|
||||
* Revision 2.2 2002/07/29 06:35:15 DTP
|
||||
* added -almission commandline arguement, will autoload mission i.e fs2_open.exe -almission kickass will autoload kickass.fs2 which should be a multiplayer mission.
|
||||
*
|
||||
* Revision 2.1 2002/07/07 19:55:58 penguin
|
||||
* Back-port to MSVC
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:21 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
* Revision 1.2 2002/05/08 17:29:17 mharris
|
||||
* more port tweaks
|
||||
*
|
||||
* Revision 1.1 2002/05/02 18:03:04 mharris
|
||||
* Initial checkin - converted filenames and includes to lower case
|
||||
*
|
||||
*
|
||||
* 8 8/26/99 8:51p Dave
|
||||
* Gave multiplayer TvT messaging a heavy dose of sanity. Cheat codes.
|
||||
*
|
||||
* 7 7/15/99 3:07p Dave
|
||||
* 32 bit detection support. Mouse coord commandline.
|
||||
*
|
||||
* 6 7/13/99 1:15p Dave
|
||||
* 32 bit support. Whee!
|
||||
*
|
||||
* 5 6/22/99 9:37p Dave
|
||||
* Put in pof spewing.
|
||||
*
|
||||
* 4 1/12/99 5:45p Dave
|
||||
* Moved weapon pipeline in multiplayer to almost exclusively client side.
|
||||
* Very good results. Bandwidth goes down, playability goes up for crappy
|
||||
* connections. Fixed object update problem for ship subsystems.
|
||||
*
|
||||
* 3 11/17/98 11:12a Dave
|
||||
* Removed player identification by address. Now assign explicit id #'s.
|
||||
*
|
||||
* 2 10/07/98 10:52a Dave
|
||||
* Initial checkin.
|
||||
*
|
||||
* 1 10/07/98 10:48a Dave
|
||||
*
|
||||
* 27 9/15/98 4:04p Allender
|
||||
* added back in the -ip_addr command line switch because it needs to be
|
||||
* in the standalone server only executable
|
||||
*
|
||||
* 26 9/14/98 11:28a Allender
|
||||
* support for server bashing of address when received from client. Added
|
||||
* a cmdline.cfg file to process command line arguments from a file
|
||||
*
|
||||
* 25 9/08/98 2:20p Allender
|
||||
* temporary code to force IP address to a specific value.
|
||||
*
|
||||
* 24 8/20/98 5:30p Dave
|
||||
* Put in handy multiplayer logfile system. Now need to put in useful
|
||||
* applications of it all over the code.
|
||||
*
|
||||
* 23 8/07/98 10:40a Allender
|
||||
* new command line flags for starting netgames. Only starting currently
|
||||
* works, and PXO isn't implemented yet
|
||||
*
|
||||
* 22 7/24/98 11:14a Allender
|
||||
* start of new command line options for version 1.04
|
||||
*
|
||||
* 21 5/21/98 1:50a Dave
|
||||
* Remove obsolete command line functions. Reduce shield explosion packets
|
||||
* drastically. Tweak PXO screen even more. Fix file xfer system so that
|
||||
* we can guarantee file uniqueness.
|
||||
*
|
||||
* 20 5/18/98 9:10p Dave
|
||||
* Put in many new PXO features. Fixed skill level bashing in multiplayer.
|
||||
* Removed several old command line options. Put in network config files.
|
||||
*
|
||||
* 19 5/09/98 7:16p Dave
|
||||
* Put in CD checking. Put in standalone host password. Made pilot into
|
||||
* popup scrollable.
|
||||
*
|
||||
* 18 4/23/98 8:27p Allender
|
||||
* basic support for cutscene playback. Into movie code in place. Tech
|
||||
* room can view cutscenes stored in CDROM_dir variable
|
||||
*
|
||||
* 17 3/14/98 2:48p Dave
|
||||
* Cleaned up observer joining code. Put in support for file xfers to
|
||||
* ingame joiners (observers or not). Revamped and reinstalled pseudo
|
||||
* lag/loss system.
|
||||
*
|
||||
* 16 1/31/98 4:32p Dave
|
||||
* Put in new support for VMT player validation, game logging in and game
|
||||
* logging out.
|
||||
*
|
||||
* 15 12/10/97 4:45p Dave
|
||||
* Added in more detailed support for multiplayer packet lag/loss. Fixed
|
||||
* some multiplayer stuff. Added some controls to the standalone.
|
||||
*
|
||||
* 14 12/09/97 6:14p Lawrance
|
||||
* add -nomusic flag
|
||||
*
|
||||
* 13 11/28/97 7:04p Dave
|
||||
* Emergency checkin due to big system crash.
|
||||
*
|
||||
* 12 11/28/97 5:06p Dave
|
||||
* Put in facilities for simulating multiplayer lag.
|
||||
*
|
||||
* 11 11/24/97 5:42p Dave
|
||||
* Fixed a file xfer buffer free/malloc problem. Lengthened command line
|
||||
* switch string parse length.
|
||||
*
|
||||
* 10 11/12/97 4:39p Dave
|
||||
* Put in multiplayer campaign support parsing, loading and saving. Made
|
||||
* command-line variables better named. Changed some things on the initial
|
||||
* pilot select screen.
|
||||
*
|
||||
* 9 11/11/97 4:54p Dave
|
||||
* Put in support for single vs. multiplayer pilots. Put in initial player
|
||||
* selection screen (no command line option yet). Started work on
|
||||
* multiplayer campaign file save gaming.
|
||||
*
|
||||
* 8 9/18/97 10:13p Dave
|
||||
* Added -gimmemedals, which gives the current pilot all the medals in the
|
||||
* game (debug)
|
||||
*
|
||||
* 7 9/18/97 9:20a Dave
|
||||
* Minor modifications
|
||||
*
|
||||
* 6 9/15/97 11:40p Lawrance
|
||||
* remove demo granularity switch
|
||||
*
|
||||
* 5 9/03/97 5:03p Lawrance
|
||||
* add support for -nosound command line parm
|
||||
*
|
||||
* 4 8/21/97 4:55p Dave
|
||||
* Added a switch for multiplayer chat streaming. Added a section for
|
||||
* global command line vars.
|
||||
*
|
||||
* 3 8/06/97 2:26p Dave
|
||||
* Made the command line parse more robust. Made it easier to add and
|
||||
* process new command-line switches.
|
||||
*
|
||||
* 2 8/04/97 3:13p Dave
|
||||
* Added command line functions. See cmdline.cpp for directions on adding
|
||||
* new switches
|
||||
*
|
||||
* 1 8/04/97 9:58a Dave
|
||||
*
|
||||
* $NoKeywords: $
|
||||
*/
|
||||
#ifndef FS_CMDLINE_HEADER_FILE
|
||||
#define FS_CMDLINE_HEADER_FILE
|
||||
|
||||
@@ -637,6 +47,7 @@ extern int Cmdline_start_netgame;
|
||||
extern int Cmdline_timeout;
|
||||
extern int Cmdline_use_last_pilot;
|
||||
extern int Cmdline_window;
|
||||
extern int Cmdline_fullscreen_window;
|
||||
extern char *Cmdline_res;
|
||||
|
||||
|
||||
@@ -650,18 +61,21 @@ extern float Cmdline_ogl_spec;
|
||||
extern float static_light_factor;
|
||||
extern float static_point_factor;
|
||||
extern float static_tube_factor;
|
||||
extern int Cmdline_2d_poof;
|
||||
extern int Cmdline_alpha_env;
|
||||
extern int Cmdline_ambient_factor;
|
||||
extern int Cmdline_cell;
|
||||
extern int Cmdline_decals;
|
||||
extern int Cmdline_env;
|
||||
extern int Cmdline_mipmap;
|
||||
extern int Cmdline_missile_lighting;
|
||||
extern int Cmdline_noglow;
|
||||
extern int Cmdline_glow;
|
||||
extern int Cmdline_nomotiondebris;
|
||||
extern int Cmdline_noscalevid; // disables fit-to-window for movies - taylor
|
||||
extern int Cmdline_nospec;
|
||||
extern int Cmdline_spec;
|
||||
extern int Cmdline_normal;
|
||||
extern int Cmdline_height;
|
||||
extern int Cmdline_enable_3d_shockwave;
|
||||
extern int Cmdline_postprocess;
|
||||
extern int Cmdline_bloom_intensity;
|
||||
|
||||
// Game Speed related
|
||||
extern int Cmdline_cache_bitmaps;
|
||||
@@ -679,6 +93,7 @@ extern int Cmdline_targetinfo;
|
||||
// Gameplay related
|
||||
extern int Cmdline_3dwarp;
|
||||
extern int Cmdline_ship_choice_3d;
|
||||
extern int Cmdline_weapon_choice_3d;
|
||||
extern int Cmdline_warp_flash;
|
||||
extern int Cmdline_autopilot_interruptable;
|
||||
|
||||
@@ -689,9 +104,6 @@ extern int Cmdline_voice_recognition;
|
||||
|
||||
// MOD related
|
||||
extern char *Cmdline_mod; // DTP for mod support
|
||||
extern int Cmdline_tbp;
|
||||
extern int Cmdline_wcsaga;
|
||||
|
||||
// Multiplayer/Network related
|
||||
extern char *Cmdline_almission; // DTP for autoload mission (for multi only)
|
||||
extern int Cmdline_ingamejoin;
|
||||
@@ -702,7 +114,6 @@ extern int Cmdline_objupd;
|
||||
|
||||
// Troubleshooting
|
||||
extern int Cmdline_d3d_lesstmem;
|
||||
extern int Cmdline_FRED2_htl;
|
||||
extern int Cmdline_load_all_weapons;
|
||||
extern int Cmdline_nohtl;
|
||||
extern int Cmdline_noibx;
|
||||
@@ -711,7 +122,9 @@ extern int Cmdline_no_set_gamma;
|
||||
extern int Cmdline_novbo;
|
||||
extern int Cmdline_safeloading;
|
||||
extern int Cmdline_no_fbo;
|
||||
extern int Cmdline_verify_vps;
|
||||
extern int Cmdline_noglsl;
|
||||
extern int Cmdline_ati_color_swap;
|
||||
extern int Cmdline_no_3d_sound;
|
||||
|
||||
// Developer/Testing related
|
||||
extern char *Cmdline_start_mission;
|
||||
@@ -719,12 +132,14 @@ extern int Cmdline_dis_collisions;
|
||||
extern int Cmdline_dis_weapons;
|
||||
extern int Cmdline_noparseerrors;
|
||||
extern int Cmdline_nowarn;
|
||||
extern int Cmdline_extra_warn;
|
||||
extern int Cmdline_show_mem_usage;
|
||||
extern int Cmdline_show_pos;
|
||||
extern int Cmdline_show_stats;
|
||||
extern int Cmdline_timerbar;
|
||||
extern int Cmdline_save_render_targets;
|
||||
extern int Cmdline_debug_window;
|
||||
extern int Cmdline_verify_vps;
|
||||
#ifdef SCP_UNIX
|
||||
extern int Cmdline_no_grab;
|
||||
#endif
|
||||
|
||||
+1
-233
@@ -7,239 +7,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/CMeasure/CMeasure.cpp $
|
||||
* $Revision: 2.9 $
|
||||
* $Date: 2005-12-04 19:07:48 $
|
||||
* $Author: wmcoolmon $
|
||||
*
|
||||
* Counter measures. Created by Mike Kulas, May 12, 1997.
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.8 2005/11/21 02:43:30 Goober5000
|
||||
* change from "setting" to "profile"; this way makes more sense
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.7 2005/11/21 00:46:06 Goober5000
|
||||
* add ai_settings.tbl
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.6 2005/04/05 05:53:15 taylor
|
||||
* s/vector/vec3d/g, better support for different compilers (Jens Granseuer)
|
||||
*
|
||||
* Revision 2.5 2004/07/26 20:47:25 Kazan
|
||||
* remove MCD complete
|
||||
*
|
||||
* Revision 2.4 2004/07/12 16:32:43 Kazan
|
||||
* MCD - define _MCD_CHECK to use memory tracking
|
||||
*
|
||||
* Revision 2.3 2004/03/05 09:01:57 Goober5000
|
||||
* Uber pass at reducing #includes
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.2 2003/03/18 10:07:00 unknownplayer
|
||||
* The big DX/main line merge. This has been uploaded to the main CVS since I can't manage to get it to upload to the DX branch. Apologies to all who may be affected adversely, but I'll work to debug it as fast as I can.
|
||||
*
|
||||
* Revision 2.1.2.1 2002/09/24 18:56:41 randomtiger
|
||||
* DX8 branch commit
|
||||
*
|
||||
* This is the scub of UP's previous code with the more up to date RT code.
|
||||
* For full details check previous dev e-mails
|
||||
*
|
||||
* Revision 2.1 2002/08/01 01:41:04 penguin
|
||||
* The big include file move
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:21 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
* Revision 1.2 2002/05/03 22:07:08 mharris
|
||||
* got some stuff to compile
|
||||
*
|
||||
* Revision 1.1 2002/05/02 18:03:04 mharris
|
||||
* Initial checkin - converted filenames and includes to lower case
|
||||
*
|
||||
*
|
||||
* 5 9/05/99 11:25p Mikek
|
||||
* Debug code (only on NDEBUG). Don't drop countermeasures if
|
||||
* Ai_firing_enabled not set.
|
||||
*
|
||||
* 4 11/05/98 5:55p Dave
|
||||
* Big pass at reducing #includes
|
||||
*
|
||||
* 3 10/13/98 9:28a Dave
|
||||
* Started neatening up freespace.h. Many variables renamed and
|
||||
* reorganized. Added AlphaColors.[h,cpp]
|
||||
*
|
||||
* 2 10/07/98 10:52a Dave
|
||||
* Initial checkin.
|
||||
*
|
||||
* 1 10/07/98 10:48a Dave
|
||||
*
|
||||
* 44 4/29/98 9:36p Allender
|
||||
* ingame join tweaks. added network message for countermeasures
|
||||
*
|
||||
* 43 4/13/98 5:11p Mike
|
||||
* More improvement to countermeasure code.
|
||||
*
|
||||
* 42 4/13/98 2:14p Mike
|
||||
* Countermeasure balance testing for Jim.
|
||||
*
|
||||
* 41 4/10/98 11:02p Mike
|
||||
* Make countermeasures less effective against aspect seekers than against
|
||||
* heat seekers.
|
||||
* Make AI ships match bank with each other when attacking a faraway
|
||||
* target.
|
||||
* Make ships not do silly loop-de-loop sometimes when attacking a faraway
|
||||
* target.
|
||||
*
|
||||
* 40 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.
|
||||
*
|
||||
* 39 3/17/98 3:49p John
|
||||
* Turned off lighting on counter measures.
|
||||
*
|
||||
* 38 2/26/98 10:07p Hoffoss
|
||||
* Rewrote state saving and restoring to fix bugs and simplify the code.
|
||||
*
|
||||
* 37 2/23/98 5:44p Johnson
|
||||
* Resolve build error.
|
||||
*
|
||||
* 36 2/23/98 4:30p Mike
|
||||
* Make homing missiles detonate after they pass up their target. Make
|
||||
* countermeasures less effective.
|
||||
*
|
||||
* 35 2/09/98 8:04p Lawrance
|
||||
* Add objnum to cmeasure struct, correctly set source_objnum
|
||||
*
|
||||
* 34 2/05/98 11:20p Lawrance
|
||||
* save/restore countermeasure data
|
||||
*
|
||||
* 33 2/05/98 12:51a Mike
|
||||
* Early asteroid stuff.
|
||||
*
|
||||
* 32 2/04/98 12:20p Mike
|
||||
* Make countermeasures detonate in a smaller radius. Make all in radius,
|
||||
* not just homing one, detonate.
|
||||
*
|
||||
* 31 1/29/98 11:48a John
|
||||
* Added new counter measure rendering as model code. Made weapons be
|
||||
* able to have impact explosion.
|
||||
*
|
||||
* 30 1/29/98 11:11a John
|
||||
* Put in code to show dummy counter measure object.
|
||||
*
|
||||
* 29 1/23/98 5:06p John
|
||||
* Took L out of vertex structure used B (blue) instead. Took all small
|
||||
* fireballs out of fireball types and used particles instead. Fixed some
|
||||
* debris explosion things. Restructured fireball code. Restructured
|
||||
* some lighting code. Made dynamic lighting on by default. Made groups
|
||||
* of lasers only cast one light. Made fireballs not cast light.
|
||||
*
|
||||
* 28 1/23/98 9:43a Mike
|
||||
* Debug-C to disallow countermeasure firing.
|
||||
* Fix bug in countermeasure tracking by aspect seekers.
|
||||
*
|
||||
* 27 1/20/98 9:47a Mike
|
||||
* Suppress optimized compiler warnings.
|
||||
* Some secondary weapon work.
|
||||
*
|
||||
* 26 1/16/98 11:43a Mike
|
||||
* Fix countermeasures.
|
||||
*
|
||||
* 25 12/30/97 6:44p John
|
||||
* Made g3_Draw_bitmap functions account for aspect of bitmap.
|
||||
*
|
||||
* 24 11/29/97 2:05p John
|
||||
* made g3_draw_bitmap and g3_draw_rotated bitmap take w&h, not w/2 & h/2,
|
||||
* like they used to incorrectly assume. Added code to model to read in
|
||||
* thruster radius's.
|
||||
*
|
||||
* 23 10/27/97 3:24p Lawrance
|
||||
* ensure countermeasures keep their initial velocity
|
||||
*
|
||||
* 22 9/14/97 4:50p Lawrance
|
||||
* added some demo debugging code
|
||||
*
|
||||
* 21 9/04/97 5:09p Andsager
|
||||
* implement physics using moment of inertia and mass (from BSPgen).
|
||||
* Added to phys_info struct. Updated ship_info, polymodel structs.
|
||||
* Updated weapon ($Mass and $Force) and ship ($Mass -> $Density) tables
|
||||
*
|
||||
* 20 8/20/97 11:09a Mike
|
||||
* Make countermeasure lifetime based on skill level.
|
||||
*
|
||||
* 19 8/13/97 9:50p Allender
|
||||
* split *_move into *_process_pre and *_process_post functions.
|
||||
* process_pre functions called before object is moved. _process_post
|
||||
* functions called after object is moved. Reordered code in ship_post
|
||||
* and weapon_post for multiplayer
|
||||
*
|
||||
* 18 8/13/97 4:45p Allender
|
||||
* fixed ship_fire_primary and fire_secondary to not take parameter for
|
||||
* determining whether to count ammo or not. Fixed countermeasure firing
|
||||
* for multiplayer
|
||||
*
|
||||
* 17 8/13/97 12:06p Lawrance
|
||||
* supporting multiple types of fireball explosions
|
||||
*
|
||||
* 16 8/11/97 6:03p Mike
|
||||
* Make ships with no shields not claim to have shields in target box.
|
||||
*
|
||||
* 15 8/08/97 4:29p Allender
|
||||
* countermeasure stuff for multiplayer
|
||||
*
|
||||
* 14 7/31/97 5:55p John
|
||||
* made so you pass flags to obj_create.
|
||||
* Added new collision code that ignores any pairs that will never
|
||||
* collide.
|
||||
*
|
||||
* 13 7/15/97 12:03p Andsager
|
||||
* New physics stuff
|
||||
*
|
||||
* 12 7/11/97 11:54a John
|
||||
* added rotated 3d bitmaps.
|
||||
*
|
||||
* 11 6/24/97 10:04a Allender
|
||||
* major multiplayer improvements. Better sequencing before game.
|
||||
* Dealing with weapon/fireball/counter measure objects between
|
||||
* client/host.
|
||||
*
|
||||
* 10 6/24/97 12:38a Lawrance
|
||||
* fix minor bug with cycling cmeasure
|
||||
*
|
||||
* 9 6/05/97 1:37a Lawrance
|
||||
* change syntax of a snd_play()
|
||||
*
|
||||
* 8 5/22/97 5:45p Mike
|
||||
* Better countermeasure firing, key off availability, specify in
|
||||
* weapons.tbl
|
||||
*
|
||||
* 7 5/22/97 12:06p Lawrance
|
||||
* include Sound.h for playing sound fx
|
||||
*
|
||||
* 6 5/22/97 12:04p Lawrance
|
||||
* added soundhook for cmeasure cycle
|
||||
*
|
||||
* 5 5/15/97 5:05p Mike
|
||||
* In the midst of changing subsystem targetnig from type-based to
|
||||
* pointer-based.
|
||||
* Also allowed you to view a target while dead.
|
||||
*
|
||||
* 4 5/14/97 4:08p Lawrance
|
||||
* removing my_index from game arrays
|
||||
*
|
||||
* 3 5/14/97 10:50a Mike
|
||||
* More countermeasure stuff.
|
||||
*
|
||||
* 2 5/12/97 5:58p Mike
|
||||
* Add countermeasures.
|
||||
*
|
||||
* 1 5/12/97 2:23p Mike
|
||||
*
|
||||
* $NoKeywords: $
|
||||
*/
|
||||
|
||||
|
||||
#include "cmeasure/cmeasure.h"
|
||||
//#include "freespace2/freespace.h"
|
||||
|
||||
+1
-121
@@ -7,127 +7,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/CMeasure/CMeasure.h $
|
||||
* $Revision: 2.6 $
|
||||
* $Date: 2005-12-04 19:07:48 $
|
||||
* $Author: wmcoolmon $
|
||||
*
|
||||
* Counter measures. Created by Mike Kulas, May 12, 1997.
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.5 2005/07/13 02:50:50 Goober5000
|
||||
* remove PreProcDefine #includes in FS2
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.4 2005/04/05 05:53:15 taylor
|
||||
* s/vector/vec3d/g, better support for different compilers (Jens Granseuer)
|
||||
*
|
||||
* Revision 2.3 2004/08/11 05:06:19 Kazan
|
||||
* added preprocdefines.h to prevent what happened with fred -- make sure to make all fred2 headers include this file as the _first_ include -- i have already modified fs2 files to do this
|
||||
*
|
||||
* Revision 2.2 2004/03/05 09:01:57 Goober5000
|
||||
* Uber pass at reducing #includes
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.1 2002/08/01 01:41:04 penguin
|
||||
* The big include file move
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:21 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
* Revision 1.1 2002/05/02 18:03:04 mharris
|
||||
* Initial checkin - converted filenames and includes to lower case
|
||||
*
|
||||
*
|
||||
* 3 11/05/98 5:55p Dave
|
||||
* Big pass at reducing #includes
|
||||
*
|
||||
* 2 10/07/98 10:52a Dave
|
||||
* Initial checkin.
|
||||
*
|
||||
* 1 10/07/98 10:48a Dave
|
||||
*
|
||||
* 20 4/11/98 5:17p Jim
|
||||
* Reduced countermeasure firing rate from 2 times per second to 3 times
|
||||
* per second.
|
||||
*
|
||||
* 19 4/10/98 11:02p Mike
|
||||
* Make countermeasures less effective against aspect seekers than against
|
||||
* heat seekers.
|
||||
* Make AI ships match bank with each other when attacking a faraway
|
||||
* target.
|
||||
* Make ships not do silly loop-de-loop sometimes when attacking a faraway
|
||||
* target.
|
||||
*
|
||||
* 18 4/01/98 5:34p John
|
||||
* Made only the used POFs page in for a level. Reduced some interp
|
||||
* arrays. Made custom detail level work differently.
|
||||
*
|
||||
* 17 2/26/98 10:07p Hoffoss
|
||||
* Rewrote state saving and restoring to fix bugs and simplify the code.
|
||||
*
|
||||
* 16 2/23/98 4:30p Mike
|
||||
* Make homing missiles detonate after they pass up their target. Make
|
||||
* countermeasures less effective.
|
||||
*
|
||||
* 15 2/09/98 8:04p Lawrance
|
||||
* Add objnum to cmeasure struct, correctly set source_objnum
|
||||
*
|
||||
* 14 2/05/98 11:20p Lawrance
|
||||
* save/restore countermeasure data
|
||||
*
|
||||
* 13 1/29/98 11:48a John
|
||||
* Added new counter measure rendering as model code. Made weapons be
|
||||
* able to have impact explosion.
|
||||
*
|
||||
* 12 1/16/98 11:43a Mike
|
||||
* Fix countermeasures.
|
||||
*
|
||||
* 11 8/13/97 9:50p Allender
|
||||
* split *_move into *_process_pre and *_process_post functions.
|
||||
* process_pre functions called before object is moved. _process_post
|
||||
* functions called after object is moved. Reordered code in ship_post
|
||||
* and weapon_post for multiplayer
|
||||
*
|
||||
* 10 8/13/97 4:45p Allender
|
||||
* fixed ship_fire_primary and fire_secondary to not take parameter for
|
||||
* determining whether to count ammo or not. Fixed countermeasure firing
|
||||
* for multiplayer
|
||||
*
|
||||
* 9 8/08/97 4:29p Allender
|
||||
* countermeasure stuff for multiplayer
|
||||
*
|
||||
* 8 7/09/97 12:04a Mike
|
||||
* Error prevention in matrix_interpolate().
|
||||
*
|
||||
* 7 6/24/97 10:04a Allender
|
||||
* major multiplayer improvements. Better sequencing before game.
|
||||
* Dealing with weapon/fireball/counter measure objects between
|
||||
* client/host.
|
||||
*
|
||||
* 6 5/22/97 5:45p Mike
|
||||
* Better countermeasure firing, key off availability, specify in
|
||||
* weapons.tbl
|
||||
*
|
||||
* 5 5/15/97 5:05p Mike
|
||||
* In the midst of changing subsystem targetnig from type-based to
|
||||
* pointer-based.
|
||||
* Also allowed you to view a target while dead.
|
||||
*
|
||||
* 4 5/14/97 4:08p Lawrance
|
||||
* removing my_index from game arrays
|
||||
*
|
||||
* 3 5/14/97 10:50a Mike
|
||||
* More countermeasure stuff.
|
||||
*
|
||||
* 2 5/12/97 5:58p Mike
|
||||
* Add countermeasures.
|
||||
*
|
||||
* 1 5/12/97 2:23p Mike
|
||||
*
|
||||
* $NoKeywords: $
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _CMEASURE_H
|
||||
#define _CMEASURE_H
|
||||
|
||||
@@ -7,371 +7,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/ControlConfig/ControlsConfig.cpp $
|
||||
* $Revision: 2.18.2.1 $
|
||||
* $Date: 2007-12-28 02:10:35 $
|
||||
* $Author: Backslash $
|
||||
*
|
||||
* C module for keyboard, joystick and mouse configuration
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.18 2005/10/10 17:14:30 taylor
|
||||
* remove NO_NETWORK
|
||||
* fix controlconfig so that axes can be set to joystick/mouse using the mouse (required when no joystick attached)
|
||||
*
|
||||
* Revision 2.17 2005/07/22 10:18:37 Goober5000
|
||||
* CVS header tweaks
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.16 2005/07/13 02:50:50 Goober5000
|
||||
* remove PreProcDefine #includes in FS2
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.15 2005/07/07 16:36:57 taylor
|
||||
* various compiler warning fixes (some of these from dizzy)
|
||||
*
|
||||
* Revision 2.14 2005/07/02 19:42:14 taylor
|
||||
* ton of non-standard resolution fixes
|
||||
*
|
||||
* Revision 2.13 2005/05/12 17:49:11 taylor
|
||||
* use vm_malloc(), vm_free(), vm_realloc(), vm_strdup() rather than system named macros
|
||||
* fixes various problems and is past time to make the switch
|
||||
*
|
||||
* Revision 2.12 2005/04/28 05:29:28 wmcoolmon
|
||||
* Removed FS2_DEMO defines that looked like they wouldn't cause the universe to collapse
|
||||
*
|
||||
* Revision 2.11 2005/04/17 05:38:28 taylor
|
||||
* updated Linux joystick code that's a bit less insane speed wise
|
||||
* remove ability to build without joystick support, no reason to keep it around
|
||||
* fix unusable warning flag with libjpeg building
|
||||
*
|
||||
* Revision 2.10 2005/03/02 21:24:43 taylor
|
||||
* more network/inferno goodness for Windows, takes care of a few warnings too
|
||||
*
|
||||
* Revision 2.9 2004/07/29 19:37:50 Kazan
|
||||
* unbug the JS bug i caused --- kazan
|
||||
*
|
||||
* Revision 2.8 2004/07/26 20:47:26 Kazan
|
||||
* remove MCD complete
|
||||
*
|
||||
* Revision 2.7 2004/07/25 00:31:28 Kazan
|
||||
* i have absolutely nothing to say about that subject
|
||||
*
|
||||
* Revision 2.6 2004/07/12 16:32:43 Kazan
|
||||
* MCD - define _MCD_CHECK to use memory tracking
|
||||
*
|
||||
* Revision 2.5 2004/03/05 09:01:58 Goober5000
|
||||
* Uber pass at reducing #includes
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.4 2003/11/11 02:15:43 Goober5000
|
||||
* ubercommit - basically spelling and language fixes with some additional
|
||||
* warnings disabled
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.3 2003/04/05 11:09:21 Goober5000
|
||||
* fixed some fiddly bits with scrolling and ui stuff
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.2 2003/03/18 10:07:00 unknownplayer
|
||||
* The big DX/main line merge. This has been uploaded to the main CVS since I can't manage to get it to upload to the DX branch. Apologies to all who may be affected adversely, but I'll work to debug it as fast as I can.
|
||||
*
|
||||
* Revision 2.1.2.1 2002/09/24 18:56:41 randomtiger
|
||||
* DX8 branch commit
|
||||
*
|
||||
* This is the scub of UP's previous code with the more up to date RT code.
|
||||
* For full details check previous dev e-mails
|
||||
*
|
||||
* Revision 2.1 2002/08/01 01:41:04 penguin
|
||||
* The big include file move
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:21 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
* Revision 1.4 2002/05/16 06:06:23 mharris
|
||||
* ifndef NO_JOYSTICK
|
||||
*
|
||||
* Revision 1.3 2002/05/10 20:42:43 mharris
|
||||
* use "ifndef NO_NETWORK" all over the place
|
||||
*
|
||||
* Revision 1.2 2002/05/10 06:08:08 mharris
|
||||
* Porting... added ifndef NO_SOUND
|
||||
*
|
||||
* Revision 1.1 2002/05/02 18:03:04 mharris
|
||||
* Initial checkin - converted filenames and includes to lower case
|
||||
*
|
||||
*
|
||||
* 13 10/14/99 2:50p Jefff
|
||||
* localization fixes
|
||||
*
|
||||
* 12 8/16/99 9:50a Jefff
|
||||
* fixed loading of tab bitmaps
|
||||
*
|
||||
* 11 8/11/99 3:21p Jefff
|
||||
* added tab highlights on conflict
|
||||
*
|
||||
* 10 7/26/99 5:25p Jefff
|
||||
* removed invalidation of key binding for demo builds
|
||||
*
|
||||
* 9 7/19/99 2:13p Dave
|
||||
* Added some new strings for Heiko.
|
||||
*
|
||||
* 8 7/15/99 9:20a Andsager
|
||||
* FS2_DEMO initial checkin
|
||||
*
|
||||
* 7 6/19/99 2:46p Dave
|
||||
* New control config screen.
|
||||
*
|
||||
* 6 1/30/99 5:08p Dave
|
||||
* More new hi-res stuff.Support for nice D3D textures.
|
||||
*
|
||||
* 5 1/15/99 11:29a Neilk
|
||||
* Fixed D3D screen/texture pixel formatting problem.
|
||||
*
|
||||
* 4 11/05/98 4:18p Dave
|
||||
* First run nebula support. Beefed up localization a bit. Removed all
|
||||
* conditional compiles for foreign versions. Modified mission file
|
||||
* format.
|
||||
*
|
||||
* 3 10/13/98 9:28a Dave
|
||||
* Started neatening up freespace.h. Many variables renamed and
|
||||
* reorganized. Added AlphaColors.[h,cpp]
|
||||
*
|
||||
* 2 10/07/98 10:52a Dave
|
||||
* Initial checkin.
|
||||
*
|
||||
* 1 10/07/98 10:48a Dave
|
||||
*
|
||||
* 61 8/09/98 11:55a Lawrance
|
||||
* if GRAVIS_OEM is defined, map the throttle axis by default
|
||||
*
|
||||
* 60 6/19/98 3:51p Lawrance
|
||||
* localize control text
|
||||
*
|
||||
* 59 6/17/98 11:04a Lawrance
|
||||
* localize the control config strings
|
||||
*
|
||||
* 58 6/13/98 5:19p Hoffoss
|
||||
* externalized control config texts.
|
||||
*
|
||||
* 57 6/09/98 5:15p Lawrance
|
||||
* French/German localization
|
||||
*
|
||||
* 56 6/09/98 10:31a Hoffoss
|
||||
* Created index numbers for all xstr() references. Any new xstr() stuff
|
||||
* added from here on out should be added to the end if the list. The
|
||||
* current list count can be found in FreeSpace.cpp (search for
|
||||
* XSTR_SIZE).
|
||||
*
|
||||
* 55 6/01/98 11:43a John
|
||||
* JAS & MK: Classified all strings for localization.
|
||||
*
|
||||
* 54 5/26/98 11:10a Lawrance
|
||||
* Fix bug where window controls get disabled when F1 pressed twice
|
||||
*
|
||||
* 53 5/20/98 10:35p Hoffoss
|
||||
* Fixed bug with mouse buttons not working when action isn't continuous.
|
||||
*
|
||||
* 52 5/19/98 4:08p Allender
|
||||
* kill default binding for Z axis
|
||||
*
|
||||
* 51 5/19/98 12:56p Hoffoss
|
||||
* Added some code to help prevent triple-clicking for binding the mouse
|
||||
* button to an action (why people triple click is beyond me,
|
||||
* though).
|
||||
*
|
||||
* 50 5/19/98 11:11a Lawrance
|
||||
* Ensure X and Y axis have defaults!
|
||||
*
|
||||
* 49 5/18/98 4:53p Hoffoss
|
||||
* Some force feedback tweaks and pilot initializations there should have
|
||||
* been happening, but weren't, and not are!
|
||||
*
|
||||
* 48 5/18/98 10:15a Lawrance
|
||||
* Only do hud squad msg key check when necessary
|
||||
*
|
||||
* 47 5/18/98 10:08a Lawrance
|
||||
* deal with overlap between hud squad msg number keys and CC_CONTINUOUS
|
||||
* keys
|
||||
*
|
||||
* 46 5/17/98 5:44p Hoffoss
|
||||
* Made throttle never bound by default (ask Sandeep why if interested).
|
||||
*
|
||||
* 45 5/14/98 5:32p Hoffoss
|
||||
* Improved axis binding code some more.
|
||||
*
|
||||
* 44 5/13/98 7:15p Hoffoss
|
||||
* Fixed remaining bugs with axis binding.
|
||||
*
|
||||
* 43 5/13/98 1:17a Hoffoss
|
||||
* Added joystick axes configurability.
|
||||
*
|
||||
* 42 5/12/98 3:49p Hoffoss
|
||||
* Fixed bug where double mouse click would bind mouse button right away.
|
||||
*
|
||||
* 41 5/11/98 5:43p Hoffoss
|
||||
* Made num lock not bindable.
|
||||
*
|
||||
* 40 5/11/98 5:29p Hoffoss
|
||||
* Added mouse button mapped to joystick button support.
|
||||
*
|
||||
* 39 5/07/98 6:25p Dave
|
||||
* Fix strange boundary conditions which arise when players die/respawn
|
||||
* while the game is being ended. Spiff up the chatbox doskey thing a bit.
|
||||
*
|
||||
* 38 5/05/98 1:48a Lawrance
|
||||
* Add in missing help overlays
|
||||
*
|
||||
* 37 4/27/98 10:11a Lawrance
|
||||
* Add in disabled beep for missing buttons
|
||||
*
|
||||
* 36 4/25/98 2:59p Hoffoss
|
||||
* Fixed typo that was causing a bug.
|
||||
*
|
||||
* 35 4/22/98 1:51a Lawrance
|
||||
* Take out multiplayer key from demo key config
|
||||
*
|
||||
* 34 4/16/98 4:29p Hoffoss
|
||||
* Fixed bank_when_pressed functionality when using alt or shift for it.
|
||||
*
|
||||
* 33 4/15/98 11:06a Lawrance
|
||||
* fix bug with a multi key showing up in demo, remove obsolete bindings
|
||||
* from demo and full version
|
||||
*
|
||||
* 32 4/14/98 2:45p Hoffoss
|
||||
* Made hitting escape to exit screen not play failed sound.
|
||||
*
|
||||
* 31 4/14/98 2:27p Hoffoss
|
||||
* Made certain actions be hidden in demo build.
|
||||
*
|
||||
* 30 4/13/98 2:38p Hoffoss
|
||||
* Added a tooltip handler and make binding attempts with illegal keys
|
||||
* show a popup.
|
||||
*
|
||||
* 29 4/11/98 7:59p Lawrance
|
||||
* Add support for help overlays
|
||||
*
|
||||
* 28 4/09/98 4:12p Hoffoss
|
||||
* Changed check_control() to automatically register a control as used if
|
||||
* it detects it being used.
|
||||
*
|
||||
* 27 4/08/98 11:11a Hoffoss
|
||||
* Fixed some bugs that showed up due to fixing other bugs the other day
|
||||
* with controls.
|
||||
*
|
||||
* 26 4/07/98 3:47p Hoffoss
|
||||
* Fixed continuous controls checking with respect to modifiers.
|
||||
*
|
||||
* 25 4/06/98 11:17a Hoffoss
|
||||
* Fixed num lock/pause interplay bug.
|
||||
*
|
||||
* 24 4/03/98 3:51p Hoffoss
|
||||
* Fixed some bugs, and made changed Interplay requested regarding search
|
||||
* mode.
|
||||
*
|
||||
* 23 3/31/98 4:12p Hoffoss
|
||||
* Made control used status clear at mission init time.
|
||||
*
|
||||
* 22 3/23/98 11:28a Hoffoss
|
||||
* Fixed flashing question mark bug.
|
||||
*
|
||||
* 21 3/21/98 11:30a John
|
||||
* Fixed bug where joymouse caused you to stay in binding mode when
|
||||
* binding joystick button 1 to something.
|
||||
*
|
||||
* 20 3/20/98 3:37p Hoffoss
|
||||
* Tried to fix mitri's bug, failed miserably.
|
||||
*
|
||||
* 19 3/19/98 5:04p Dave
|
||||
* Put in support for targeted multiplayer text and voice messaging (all,
|
||||
* friendly, hostile, individual).
|
||||
*
|
||||
* 18 3/18/98 12:03p John
|
||||
* Marked all the new strings as externalized or not.
|
||||
*
|
||||
* 17 3/18/98 10:16a Hoffoss
|
||||
* Fixed warning.
|
||||
*
|
||||
* 16 3/17/98 11:15a Hoffoss
|
||||
* Made question mark that appears when you are in bind mode flash.
|
||||
*
|
||||
* 15 3/17/98 10:48a Hoffoss
|
||||
* Allowed a special hack for "bank while pressed" action to use alt and
|
||||
* shift keys standalone.
|
||||
*
|
||||
* 14 3/12/98 3:22p Hoffoss
|
||||
* Fixed 2 bugs with one solution! Yay! Failed sound on bind fixed and
|
||||
* pad enter now not translated to enter.
|
||||
*
|
||||
* 13 3/11/98 5:28p Hoffoss
|
||||
* Added control config debug display info to possibly aid in tracking
|
||||
* down a bug.
|
||||
*
|
||||
* 12 2/26/98 10:07p Hoffoss
|
||||
* Rewrote state saving and restoring to fix bugs and simplify the code.
|
||||
*
|
||||
* 11 2/22/98 12:19p John
|
||||
* Externalized some strings
|
||||
*
|
||||
* 10 2/20/98 3:39p Hoffoss
|
||||
* Updated code for new control config screen artwork.
|
||||
*
|
||||
* 9 2/09/98 2:50p Hoffoss
|
||||
* Made 'none' show up as gray instead of normal color, to distinguish it
|
||||
* from actions with bound keys.
|
||||
*
|
||||
* 8 2/07/98 10:04p Hoffoss
|
||||
* Changed color and placement of "more" indicator.
|
||||
*
|
||||
* 7 2/05/98 10:42a Hoffoss
|
||||
* Fixed bug where while in bind mode, you could change the line selected
|
||||
* using the mouse, and binding would work on the new line instead.
|
||||
*
|
||||
* 6 2/03/98 5:05p Hoffoss
|
||||
* Added "clear other" button to clear all conflicting bindings with
|
||||
* selected action.
|
||||
*
|
||||
* 5 1/22/98 4:53p Hoffoss
|
||||
* Made training messages/directives display a joystick button in place of
|
||||
* a keypress if there is no keypress bound to the action.
|
||||
*
|
||||
* 4 1/20/98 4:20p Hoffoss
|
||||
* Removed confusing behavior of clear button clearing out the other
|
||||
* binding in a conflict.
|
||||
*
|
||||
* 3 1/08/98 12:11p Hoffoss
|
||||
* Changed Rudder axis to Roll axis, added new function we can use to
|
||||
* check what joystick axes are valid with.
|
||||
*
|
||||
* 2 12/24/97 3:37p Hoffoss
|
||||
* Moved control config stuff to seperate library to Fred can access it as
|
||||
* well.
|
||||
*
|
||||
* 1 12/24/97 11:58a Hoffoss
|
||||
*
|
||||
* 98 12/22/97 2:15p Hoffoss
|
||||
* Fixed bug where joystick axis lines weren't being displayed.
|
||||
*
|
||||
* 97 12/16/97 2:44p Hoffoss
|
||||
* Added clear button to control config screen.
|
||||
*
|
||||
* 96 12/12/97 3:07p Hoffoss
|
||||
* Changed how deleting bindings work. Each control of an action can be
|
||||
* deleted independently or both at once.
|
||||
*
|
||||
* 95 12/07/97 2:36p John
|
||||
* Made warp out be Alt+J instead of J
|
||||
*
|
||||
* 94 12/03/97 4:59p Hoffoss
|
||||
* Added reset sound and change control config sounds around.
|
||||
*
|
||||
* 93 12/03/97 4:16p Hoffoss
|
||||
* Changed sound stuff used in interface screens for interface purposes.
|
||||
*
|
||||
* $NoKeywords: $
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#include "freespace2/freespace.h"
|
||||
@@ -1804,7 +1440,7 @@ void control_config_do_frame(float frametime)
|
||||
Ui_window.process(0);
|
||||
|
||||
if (k == KEY_ESC) {
|
||||
strcpy(bound_string, XSTR( "Canceled", 206));
|
||||
strcpy_s(bound_string, XSTR( "Canceled", 206));
|
||||
bound_timestamp = timestamp(2500);
|
||||
control_config_do_cancel();
|
||||
|
||||
@@ -1819,7 +1455,7 @@ void control_config_do_frame(float frametime)
|
||||
if (bind) {
|
||||
if (Axis_override >= 0) {
|
||||
control_config_bind_axis(z, Axis_override);
|
||||
strcpy(bound_string, Joy_axis_text[Axis_override]);
|
||||
strcpy_s(bound_string, Joy_axis_text[Axis_override]);
|
||||
gr_force_fit_string(bound_string, 39, Conflict_wnd_coords[gr_screen.res][CONTROL_W_COORD]);
|
||||
bound_timestamp = timestamp(2500);
|
||||
control_config_conflict_check();
|
||||
@@ -1855,7 +1491,7 @@ void control_config_do_frame(float frametime)
|
||||
}
|
||||
|
||||
if (k == KEY_ESC) {
|
||||
strcpy(bound_string, XSTR( "Canceled", 206));
|
||||
strcpy_s(bound_string, XSTR( "Canceled", 206));
|
||||
bound_timestamp = timestamp(2500);
|
||||
control_config_do_cancel();
|
||||
|
||||
@@ -1885,7 +1521,7 @@ void control_config_do_frame(float frametime)
|
||||
Assert(!(z & JOY_AXIS));
|
||||
control_config_bind_key(z, k);
|
||||
|
||||
strcpy(bound_string, textify_scancode(k));
|
||||
strcpy_s(bound_string, textify_scancode(k));
|
||||
gr_force_fit_string(bound_string, 39, Conflict_wnd_coords[gr_screen.res][CONTROL_W_COORD]);
|
||||
bound_timestamp = timestamp(2500);
|
||||
control_config_conflict_check();
|
||||
@@ -1899,7 +1535,7 @@ void control_config_do_frame(float frametime)
|
||||
Assert(!(z & JOY_AXIS));
|
||||
control_config_bind_joy(z, i);
|
||||
|
||||
strcpy(bound_string, Joy_button_text[i]);
|
||||
strcpy_s(bound_string, Joy_button_text[i]);
|
||||
gr_force_fit_string(bound_string, 39, Conflict_wnd_coords[gr_screen.res][CONTROL_W_COORD]);
|
||||
bound_timestamp = timestamp(2500);
|
||||
control_config_conflict_check();
|
||||
@@ -1922,7 +1558,7 @@ void control_config_do_frame(float frametime)
|
||||
Assert(!(z & JOY_AXIS));
|
||||
control_config_bind_joy(z, i);
|
||||
|
||||
strcpy(bound_string, Joy_button_text[i]);
|
||||
strcpy_s(bound_string, Joy_button_text[i]);
|
||||
gr_force_fit_string(bound_string, 39, Conflict_wnd_coords[gr_screen.res][CONTROL_W_COORD]);
|
||||
bound_timestamp = timestamp(2500);
|
||||
control_config_conflict_check();
|
||||
@@ -2265,9 +1901,9 @@ void control_config_do_frame(float frametime)
|
||||
gr_printf(x - w / 2, y - font_height, str);
|
||||
|
||||
if (Control_config[i].hasXSTR)
|
||||
strcpy(buf, XSTR(Control_config[i].text, CONTROL_CONFIG_XSTR + i));
|
||||
strcpy_s(buf, XSTR(Control_config[i].text, CONTROL_CONFIG_XSTR + i));
|
||||
else
|
||||
strcpy(buf, Control_config[i].text);
|
||||
strcpy_s(buf, Control_config[i].text);
|
||||
|
||||
gr_force_fit_string(buf, 255, Conflict_wnd_coords[gr_screen.res][CONTROL_W_COORD]);
|
||||
gr_get_string_size(&w, NULL, buf);
|
||||
@@ -2315,7 +1951,7 @@ void control_config_do_frame(float frametime)
|
||||
|
||||
gr_set_color_fast(c);
|
||||
if (Cc_lines[line].label) {
|
||||
strcpy(buf, Cc_lines[line].label);
|
||||
strcpy_s(buf, Cc_lines[line].label);
|
||||
gr_force_fit_string(buf, 255, Control_list_ctrl_w[gr_screen.res]);
|
||||
gr_printf(Control_list_coords[gr_screen.res][CONTROL_X_COORD], y, buf);
|
||||
}
|
||||
@@ -2333,7 +1969,7 @@ void control_config_do_frame(float frametime)
|
||||
|
||||
} else {
|
||||
if (k >= 0) {
|
||||
strcpy(buf, textify_scancode(k));
|
||||
strcpy_s(buf, textify_scancode(k));
|
||||
if (Conflicts[z].key >= 0) {
|
||||
if (c == &Color_text_normal)
|
||||
gr_set_color_fast(&Color_text_error);
|
||||
@@ -2365,7 +2001,7 @@ void control_config_do_frame(float frametime)
|
||||
}
|
||||
|
||||
if (j >= 0) {
|
||||
strcpy(buf, Joy_button_text[j]);
|
||||
strcpy_s(buf, Joy_button_text[j]);
|
||||
if (Conflicts[z].joy >= 0) {
|
||||
if (c == &Color_text_normal)
|
||||
gr_set_color_fast(&Color_text_error);
|
||||
|
||||
@@ -7,315 +7,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/ControlConfig/ControlsConfig.h $
|
||||
* $Revision: 2.15.2.1 $
|
||||
* $Date: 2007-12-28 02:10:34 $
|
||||
* $Author: Backslash $
|
||||
*
|
||||
* Header file for keyboard, joystick and mouse configuration
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.15 2006/02/25 21:46:59 Goober5000
|
||||
* spelling
|
||||
*
|
||||
* Revision 2.14 2005/10/11 05:24:33 wmcoolmon
|
||||
* Gliding
|
||||
*
|
||||
* Revision 2.13 2005/07/13 02:50:50 Goober5000
|
||||
* remove PreProcDefine #includes in FS2
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.12 2005/07/13 02:30:52 Goober5000
|
||||
* removed autopilot #define
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.11 2005/03/03 06:05:27 wmcoolmon
|
||||
* Merge of WMC's codebase. "Features and bugs, making Goober say "Grr!", as release would be stalled now for two months for sure"
|
||||
*
|
||||
* Revision 2.10 2005/01/16 22:39:08 wmcoolmon
|
||||
* Added VM_TOPDOWN view; Added 2D mission mode, add 16384 to mission +Flags to use.
|
||||
*
|
||||
* Revision 2.9 2004/08/11 05:06:19 Kazan
|
||||
* added preprocdefines.h to prevent what happened with fred -- make sure to make all fred2 headers include this file as the _first_ include -- i have already modified fs2 files to do this
|
||||
*
|
||||
* Revision 2.8 2004/07/25 00:31:28 Kazan
|
||||
* i have absolutely nothing to say about that subject
|
||||
*
|
||||
* Revision 2.7 2004/05/03 21:22:19 Kazan
|
||||
* 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)
|
||||
*
|
||||
* Revision 2.6 2004/04/06 03:09:01 phreak
|
||||
* added a control config option for the wireframe hud targetbox i enabled ages ago
|
||||
*
|
||||
* Revision 2.5 2003/11/11 02:15:43 Goober5000
|
||||
* ubercommit - basically spelling and language fixes with some additional
|
||||
* warnings disabled
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.4 2002/12/02 23:52:02 Goober5000
|
||||
* fixed misspelling
|
||||
*
|
||||
* Revision 2.3 2002/12/02 20:47:28 Goober5000
|
||||
* fixed misspelling of "category" as "catagory"
|
||||
*
|
||||
* Revision 2.2 2002/10/19 19:29:27 bobboau
|
||||
* initial commit, trying to get most of my stuff into FSO, there should be most of my fighter beam, beam rendering, beam shield hit, ABtrails, and ssm stuff. one thing you should be happy to know is the beam texture tileing is now set in the beam section section of the weapon table entry
|
||||
*
|
||||
* Revision 2.1 2002/10/17 20:40:50 randomtiger
|
||||
* Added ability to remove HUD ingame on keypress shift O
|
||||
* So I've added a new key to the bind list and made use of already existing hud removal code.
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:21 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
* Revision 1.1 2002/05/02 18:03:04 mharris
|
||||
* Initial checkin - converted filenames and includes to lower case
|
||||
*
|
||||
*
|
||||
* 6 8/22/99 5:53p Dave
|
||||
* Scoring fixes. Added self destruct key. Put callsigns in the logfile
|
||||
* instead of ship designations for multiplayer players.
|
||||
*
|
||||
* 5 8/19/99 10:59a Dave
|
||||
* Packet loss detection.
|
||||
*
|
||||
* 4 8/01/99 12:39p Dave
|
||||
* Added HUD contrast control key (for nebula).
|
||||
*
|
||||
* 3 11/05/98 4:18p Dave
|
||||
* First run nebula support. Beefed up localization a bit. Removed all
|
||||
* conditional compiles for foreign versions. Modified mission file
|
||||
* format.
|
||||
*
|
||||
* 2 10/07/98 10:52a Dave
|
||||
* Initial checkin.
|
||||
*
|
||||
* 1 10/07/98 10:48a Dave
|
||||
*
|
||||
* 26 6/13/98 5:19p Hoffoss
|
||||
* externalized control config texts.
|
||||
*
|
||||
* 25 5/15/98 8:37p Lawrance
|
||||
* Add 'equalize recharge rates' and 'target ship that sent last
|
||||
* transmission' key bindings
|
||||
*
|
||||
* 24 5/14/98 5:32p Hoffoss
|
||||
* Improved axis binding code some more.
|
||||
*
|
||||
* 23 5/13/98 7:15p Hoffoss
|
||||
* Fixed remaining bugs with axis binding.
|
||||
*
|
||||
* 22 5/13/98 1:17a Hoffoss
|
||||
* Added joystick axes configurability.
|
||||
*
|
||||
* 21 4/30/98 9:43p Hoffoss
|
||||
* Added new actions for free look movement which are default bounded to
|
||||
* the hat.
|
||||
*
|
||||
* 20 4/25/98 1:59p Lawrance
|
||||
* fix merge typo
|
||||
*
|
||||
* 19 4/25/98 1:24p Lawrance
|
||||
* Add time compression keys to key config
|
||||
*
|
||||
* 18 4/25/98 12:43p Allender
|
||||
* added new shortcut key for attack my subsystem
|
||||
*
|
||||
* 17 4/18/98 5:00p Dave
|
||||
* Put in observer zoom key. Made mission sync screen more informative.
|
||||
*
|
||||
* 16 4/10/98 12:47p Allender
|
||||
* changed working on replay popup. Don't reference repair in comm menu.
|
||||
* Added Shift-R for repair me
|
||||
*
|
||||
* 15 4/08/98 11:11a Hoffoss
|
||||
* Fixed some bugs that showed up due to fixing other bugs the other day
|
||||
* with controls.
|
||||
*
|
||||
* 14 3/31/98 4:15p Hoffoss
|
||||
* Disabled the show objectives action.
|
||||
*
|
||||
* 13 3/23/98 12:27p Hoffoss
|
||||
* Whoops, changed order in list but forget to actually change the number.
|
||||
*
|
||||
* 12 3/23/98 11:35a Hoffoss
|
||||
* Fixed #defines that were out of sync.
|
||||
*
|
||||
* 11 3/19/98 5:04p Dave
|
||||
* Put in support for targeted multiplayer text and voice messaging (all,
|
||||
* friendly, hostile, individual).
|
||||
*
|
||||
* 10 3/11/98 5:28p Hoffoss
|
||||
* Added control config debug display info to possibly aid in tracking
|
||||
* down a bug.
|
||||
*
|
||||
* 9 2/28/98 7:02p Lawrance
|
||||
* overhaul on-line help
|
||||
*
|
||||
* 8 2/26/98 12:33a Lawrance
|
||||
* Added back slew mode, lots of changes to external and chase views.
|
||||
*
|
||||
* 7 2/02/98 6:59p Lawrance
|
||||
* Adding new targeting keys (bomb, uninspected cargo, new ship, live
|
||||
* turrets).
|
||||
*
|
||||
* 6 1/30/98 10:40a Lawrance
|
||||
* remove any binding references to hotkey screen
|
||||
*
|
||||
* 5 1/28/98 6:19p Dave
|
||||
* Reduced standalone memory usage ~8 megs. Put in support for handling
|
||||
* multiplayer submenu handling for endgame, etc.
|
||||
*
|
||||
* 4 1/22/98 4:53p Hoffoss
|
||||
* Made training messages/directives display a joystick button in place of
|
||||
* a keypress if there is no keypress bound to the action.
|
||||
*
|
||||
* 3 1/02/98 4:42p Allender
|
||||
* removed unused key bindings from control config list
|
||||
*
|
||||
* 2 12/30/97 4:47p Allender
|
||||
* work with ignore my target command. Added new keyboard hotkey. Made
|
||||
* it work globally
|
||||
*
|
||||
* 1 12/24/97 11:59a Hoffoss
|
||||
*
|
||||
* 41 11/24/97 10:20p Lawrance
|
||||
* Add key 'KEY_N' to target next ship on monitoring view
|
||||
*
|
||||
* 40 11/21/97 5:57p Hoffoss
|
||||
* Fixed bug where timef type controls weren't checking joystick buttons.
|
||||
*
|
||||
* 39 11/20/97 1:08a Lawrance
|
||||
* add support for 'R' key - target closest friendly repair ship
|
||||
*
|
||||
* 38 11/17/97 6:40p Lawrance
|
||||
* Changed 'I' key to toggle of extended target info, moved target closest
|
||||
* locked missile to 'L'
|
||||
*
|
||||
* 37 11/02/97 1:15p Hoffoss
|
||||
* Externed an array I need elsewhere.
|
||||
*
|
||||
* 36 10/28/97 12:12a Lawrance
|
||||
* remove unused keys (Alt-H and Alt-F)
|
||||
*
|
||||
* 35 10/24/97 11:00p Hoffoss
|
||||
* Controls config screen much improved.
|
||||
*
|
||||
* 34 10/22/97 4:50p Hoffoss
|
||||
* Disabled throttle by default.
|
||||
*
|
||||
* 33 10/21/97 7:05p Hoffoss
|
||||
* Overhauled the key/joystick control structure and usage throughout the
|
||||
* entire FreeSpace code. The whole system is very different now.
|
||||
*
|
||||
* 32 10/18/97 7:19p Hoffoss
|
||||
* Added timestamp recording when a key is pressed.
|
||||
*
|
||||
* 31 9/14/97 10:24p Lawrance
|
||||
* add damage screen popup window
|
||||
*
|
||||
* 30 9/10/97 6:02p Hoffoss
|
||||
* Added code to check for key-pressed sexp operator in FreeSpace as part
|
||||
* of training mission stuff.
|
||||
*
|
||||
* 29 9/09/97 9:18a Hoffoss
|
||||
* Added message token translation (phase 1) to FreeSpace for training
|
||||
* missions support.
|
||||
*
|
||||
* 28 8/31/97 6:38p Lawrance
|
||||
* pass in frametime to do_frame loop
|
||||
*
|
||||
* 27 8/29/97 5:02p Sandeep
|
||||
* fixed joystick support for shield config
|
||||
*
|
||||
* 26 8/25/97 12:24a Lawrance
|
||||
* added keys for shield management
|
||||
*
|
||||
* 25 8/22/97 10:44p Sandeep
|
||||
* Added Configurable support for energy management keys, keyboard and
|
||||
* joystick
|
||||
*
|
||||
* 24 8/21/97 5:03p Sandeep
|
||||
* Fixed joystick functions past "Target Closest Hostile Targeting Self"
|
||||
* bug.
|
||||
*
|
||||
* 23 8/20/97 4:22p Sandeep
|
||||
* Add support for joystick mapping to all keyboard configurable commands.
|
||||
* Changed pilot file to allow support for new joystick, incompatible
|
||||
* version 33
|
||||
*
|
||||
* 22 8/07/97 11:27p Lawrance
|
||||
* add support for 4th joystick axis (rudder), add new option to roll ship
|
||||
*
|
||||
* 21 7/08/97 11:37a Lawrance
|
||||
* add joystick support for afterburners
|
||||
*
|
||||
* 20 7/01/97 11:52a Lawrance
|
||||
* add targeting key, allow player to clear all bindings
|
||||
*
|
||||
* 19 6/24/97 12:38a Lawrance
|
||||
* added in some new joystick bindings
|
||||
*
|
||||
* 18 6/17/97 8:57p Lawrance
|
||||
* added target previous hostile/friendly
|
||||
*
|
||||
* 17 6/03/97 1:39a Allender
|
||||
* made macros for joystick button id's
|
||||
*
|
||||
* 16 5/28/97 9:53a Lawrance
|
||||
* move goals keys and squadmate message key from function keys to
|
||||
* assignable keys
|
||||
*
|
||||
* 15 5/26/97 5:49p Lawrance
|
||||
* supporting max range on radar
|
||||
*
|
||||
* 14 5/26/97 3:31p Lawrance
|
||||
* assign key bindings for view modes and view controls
|
||||
*
|
||||
* 13 5/14/97 10:50a Mike
|
||||
* More countermeasure stuff.
|
||||
*
|
||||
* 12 4/24/97 2:40p Lawrance
|
||||
* add key for targeting closest ship attacking self
|
||||
*
|
||||
* 11 4/05/97 3:46p Allender
|
||||
* lots 'o messaging stuff. Make shortcut keys for squadmate messaging
|
||||
* work. Make menus a little more dynamic
|
||||
*
|
||||
* 10 4/01/97 7:50p Lawrance
|
||||
* added many new keys, don't allow Shft or Alt as action keys, only allow
|
||||
* Ctrl as an action key
|
||||
*
|
||||
* 9 3/10/97 8:30a Lawrance
|
||||
* changed -/+ 5% throttle keys to 1/3 2/3 throttle keys
|
||||
*
|
||||
* 8 12/18/96 6:09p Lawrance
|
||||
* allowing shift+alt+ctrl modifiers on keyboard bindings
|
||||
*
|
||||
* 7 12/18/96 10:18a Lawrance
|
||||
* integrating joystick axis configuration
|
||||
*
|
||||
* 6 12/17/96 11:10a Lawrance
|
||||
* added targeting of subsystem in reticle
|
||||
*
|
||||
* 5 12/06/96 12:27a Lawrance
|
||||
* adding support for joystick configuration
|
||||
*
|
||||
* 4 12/05/96 2:47p Lawrance
|
||||
* changed how keyboard configuration was done to make code more easily
|
||||
* changeable
|
||||
*
|
||||
* 3 12/03/96 10:11p Lawrance
|
||||
* Integrating keyboard configuration
|
||||
*
|
||||
* 2 12/03/96 3:45p Lawrance
|
||||
*
|
||||
* $NoKeywords: $
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef CONTROLS_CONFIG_H
|
||||
#define CONTROLS_CONFIG_H
|
||||
|
||||
@@ -7,425 +7,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/ControlConfig/ControlsConfigCommon.cpp $
|
||||
* $Revision: 2.14.2.2 $
|
||||
* $Date: 2007-12-28 02:10:35 $
|
||||
* $Author: Backslash $
|
||||
*
|
||||
* C module for keyboard, joystick and mouse configuration common stuff (between Fred and FreeSpace)
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.14.2.1 2006/07/20 01:51:20 Goober5000
|
||||
* tweak control text
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.14 2006/02/25 21:46:59 Goober5000
|
||||
* spelling
|
||||
*
|
||||
* Revision 2.13 2005/10/11 05:24:33 wmcoolmon
|
||||
* Gliding
|
||||
*
|
||||
* Revision 2.12 2005/07/13 02:30:52 Goober5000
|
||||
* removed autopilot #define
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.11 2005/03/03 06:05:27 wmcoolmon
|
||||
* Merge of WMC's codebase. "Features and bugs, making Goober say "Grr!", as release would be stalled now for two months for sure"
|
||||
*
|
||||
* Revision 2.10 2005/01/16 22:39:08 wmcoolmon
|
||||
* Added VM_TOPDOWN view; Added 2D mission mode, add 16384 to mission +Flags to use.
|
||||
*
|
||||
* Revision 2.9 2004/07/26 20:47:26 Kazan
|
||||
* remove MCD complete
|
||||
*
|
||||
* Revision 2.8 2004/07/25 00:31:28 Kazan
|
||||
* i have absolutely nothing to say about that subject
|
||||
*
|
||||
* Revision 2.7 2004/07/12 16:32:43 Kazan
|
||||
* MCD - define _MCD_CHECK to use memory tracking
|
||||
*
|
||||
* Revision 2.6 2004/05/03 21:22:19 Kazan
|
||||
* 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)
|
||||
*
|
||||
* Revision 2.5 2004/04/06 03:09:01 phreak
|
||||
* added a control config option for the wireframe hud targetbox i enabled ages ago
|
||||
*
|
||||
* Revision 2.4 2003/11/11 02:15:43 Goober5000
|
||||
* ubercommit - basically spelling and language fixes with some additional
|
||||
* warnings disabled
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.3 2002/10/19 19:29:27 bobboau
|
||||
* initial commit, trying to get most of my stuff into FSO, there should be most of my fighter beam, beam rendering, beam shield hit, ABtrails, and ssm stuff. one thing you should be happy to know is the beam texture tileing is now set in the beam section section of the weapon table entry
|
||||
*
|
||||
* Revision 2.2 2002/10/17 20:40:50 randomtiger
|
||||
* Added ability to remove HUD ingame on keypress shift O
|
||||
* So I've added a new key to the bind list and made use of already existing hud removal code.
|
||||
*
|
||||
* Revision 2.1 2002/08/01 01:41:04 penguin
|
||||
* The big include file move
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:21 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
* Revision 1.1 2002/05/02 18:03:04 mharris
|
||||
* Initial checkin - converted filenames and includes to lower case
|
||||
*
|
||||
*
|
||||
* 14 11/01/99 3:36p Jefff
|
||||
* had scan code texts for y and z in german swapped
|
||||
*
|
||||
* 13 11/01/99 2:16p Jefff
|
||||
* minor key name change in german
|
||||
*
|
||||
* 12 10/29/99 6:10p Jefff
|
||||
* squashed the y/z german issues once and for all
|
||||
*
|
||||
* 11 10/28/99 11:16p Jefff
|
||||
* Changed some german key names. Made key translations always use the
|
||||
* english table.
|
||||
*
|
||||
* 10 10/28/99 2:05a Jefff
|
||||
* revised some german key names. changed some y/z switch stuff.
|
||||
*
|
||||
* 9 10/25/99 5:39p Jefff
|
||||
* swap init binding for y and z keys in German builds
|
||||
*
|
||||
* 8 9/01/99 2:56p Jefff
|
||||
* a few control key description changes
|
||||
*
|
||||
* 7 8/22/99 5:53p Dave
|
||||
* Scoring fixes. Added self destruct key. Put callsigns in the logfile
|
||||
* instead of ship designations for multiplayer players.
|
||||
*
|
||||
* 6 8/19/99 10:59a Dave
|
||||
* Packet loss detection.
|
||||
*
|
||||
* 5 8/01/99 12:39p Dave
|
||||
* Added HUD contrast control key (for nebula).
|
||||
*
|
||||
* 4 7/23/99 2:57p Andsager
|
||||
* fix translate_key_to_index to work with localization
|
||||
*
|
||||
* 3 11/05/98 4:18p Dave
|
||||
* First run nebula support. Beefed up localization a bit. Removed all
|
||||
* conditional compiles for foreign versions. Modified mission file
|
||||
* format.
|
||||
*
|
||||
* 2 10/07/98 10:52a Dave
|
||||
* Initial checkin.
|
||||
*
|
||||
* 1 10/07/98 10:48a Dave
|
||||
*
|
||||
* 41 6/19/98 3:51p Lawrance
|
||||
* localize control text
|
||||
*
|
||||
* 40 6/17/98 11:05a Lawrance
|
||||
* localize the control config strings
|
||||
*
|
||||
* 39 5/24/98 2:28p Hoffoss
|
||||
* Because we never really care about if the left or the right shift or
|
||||
* alt key was used, but rather than either shift or alt was used, made
|
||||
* both map to the left one. Solves some problems, causes none.
|
||||
*
|
||||
* 38 5/22/98 11:21a Hoffoss
|
||||
* Added bank when pressed back in.
|
||||
*
|
||||
* 37 5/15/98 8:37p Lawrance
|
||||
* Add 'equalize recharge rates' and 'target ship that sent last
|
||||
* transmission' key bindings
|
||||
*
|
||||
* 36 5/13/98 7:15p Hoffoss
|
||||
* Fixed remaining bugs with axis binding.
|
||||
*
|
||||
* 35 5/13/98 1:17a Hoffoss
|
||||
* Added joystick axes configurability.
|
||||
*
|
||||
* 34 5/12/98 11:25a Hoffoss
|
||||
* Disabled bank when pressed action.
|
||||
*
|
||||
* 33 5/09/98 10:48p Lawrance
|
||||
* change text for view bindings
|
||||
*
|
||||
* 32 5/09/98 4:52p Lawrance
|
||||
* Implement padlock view (up/rear/left/right)
|
||||
*
|
||||
* 31 4/30/98 9:43p Hoffoss
|
||||
* Added new actions for free look movement which are default bounded to
|
||||
* the hat.
|
||||
*
|
||||
* 30 4/25/98 1:25p Lawrance
|
||||
* Add time compression keys to key config
|
||||
*
|
||||
* 29 4/25/98 12:43p Allender
|
||||
* added new shortcut key for attack my subsystem
|
||||
*
|
||||
* 28 4/18/98 5:00p Dave
|
||||
* Put in observer zoom key. Made mission sync screen more informative.
|
||||
*
|
||||
* 27 4/17/98 1:24a Lawrance
|
||||
* fix spelling error
|
||||
*
|
||||
* 26 4/15/98 11:06a Lawrance
|
||||
* fix bug with a multi key showing up in demo, remove obsolete bindings
|
||||
* from demo and full version
|
||||
*
|
||||
* 25 4/10/98 12:47p Allender
|
||||
* changed working on replay popup. Don't reference repair in comm menu.
|
||||
* Added Shift-R for repair me
|
||||
*
|
||||
* 24 4/08/98 11:11a Hoffoss
|
||||
* Fixed some bugs that showed up due to fixing other bugs the other day
|
||||
* with controls.
|
||||
*
|
||||
* 23 4/07/98 4:06p Lawrance
|
||||
* Change binding next for bomb targeting
|
||||
*
|
||||
* 22 4/07/98 1:52p Lawrance
|
||||
* fix error in binding text for energy keys
|
||||
*
|
||||
* 21 4/06/98 11:17a Hoffoss
|
||||
* Fixed num lock/pause interplay bug.
|
||||
*
|
||||
* 20 4/01/98 6:46p Lawrance
|
||||
* change text for Alt+J
|
||||
*
|
||||
* 19 3/31/98 4:15p Hoffoss
|
||||
* Disabled the show objectives action.
|
||||
*
|
||||
* 18 3/25/98 2:16p Dave
|
||||
* Select random default image for newly created pilots. Fixed several
|
||||
* multi-pause messaging bugs. Begin work on online help for multiplayer
|
||||
* keys.
|
||||
*
|
||||
* 17 3/19/98 5:04p Dave
|
||||
* Put in support for targeted multiplayer text and voice messaging (all,
|
||||
* friendly, hostile, individual).
|
||||
*
|
||||
* 16 3/17/98 11:25a Hoffoss
|
||||
* Fixed some of the action's names.
|
||||
*
|
||||
* 15 3/17/98 10:48a Hoffoss
|
||||
* Allowed a special hack for "bank while pressed" action to use alt and
|
||||
* shift keys standalone.
|
||||
*
|
||||
* 14 2/28/98 9:47p Lawrance
|
||||
* change some binding text
|
||||
*
|
||||
* 13 2/28/98 7:02p Lawrance
|
||||
* overhaul on-line help
|
||||
*
|
||||
* 12 2/26/98 12:33a Lawrance
|
||||
* Added back slew mode, lots of changes to external and chase views.
|
||||
*
|
||||
* 11 2/23/98 11:25a Sandeep
|
||||
* added default keys
|
||||
*
|
||||
* 10 2/22/98 6:27p Lawrance
|
||||
* External mode takes precedence over chase mode. Fix bug with repair
|
||||
* ships docking in chase mode.
|
||||
*
|
||||
* 9 2/22/98 12:19p John
|
||||
* Externalized some strings
|
||||
*
|
||||
* 8 2/02/98 6:59p Lawrance
|
||||
* Adding new targeting keys (bomb, uninspected cargo, new ship, live
|
||||
* turrets).
|
||||
*
|
||||
* 7 1/27/98 4:24p Allender
|
||||
* moved hotkey selection to F3 instead of X. Made palette flash
|
||||
* disappear in multiplayer pause menu
|
||||
*
|
||||
* 6 1/22/98 4:53p Hoffoss
|
||||
* Made training messages/directives display a joystick button in place of
|
||||
* a keypress if there is no keypress bound to the action.
|
||||
*
|
||||
* 5 1/22/98 4:15p Hoffoss
|
||||
* Added code to allow popup to tell player he needs to bind a key for the
|
||||
* training mission.
|
||||
*
|
||||
* 4 1/02/98 4:42p Allender
|
||||
* removed unused key bindings from control config list
|
||||
*
|
||||
* 3 12/30/97 4:47p Allender
|
||||
* work with ignore my target command. Added new keyboard hotkey. Made
|
||||
* it work globally
|
||||
*
|
||||
* 2 12/24/97 3:37p Hoffoss
|
||||
* Moved control config stuff to seperate library to Fred can access it as
|
||||
* well.
|
||||
*
|
||||
* 1 12/24/97 3:27p Hoffoss
|
||||
*
|
||||
* 1 12/24/97 11:58a Hoffoss
|
||||
*
|
||||
* 98 12/22/97 2:15p Hoffoss
|
||||
* Fixed bug where joystick axis lines weren't being displayed.
|
||||
*
|
||||
* 97 12/16/97 2:44p Hoffoss
|
||||
* Added clear button to control config screen.
|
||||
*
|
||||
* 96 12/12/97 3:07p Hoffoss
|
||||
* Changed how deleting bindings work. Each control of an action can be
|
||||
* deleted independently or both at once.
|
||||
*
|
||||
* 95 12/07/97 2:36p John
|
||||
* Made warp out be Alt+J instead of J
|
||||
*
|
||||
* 94 12/03/97 4:59p Hoffoss
|
||||
* Added reset sound and change control config sounds around.
|
||||
*
|
||||
* 93 12/03/97 4:16p Hoffoss
|
||||
* Changed sound stuff used in interface screens for interface purposes.
|
||||
*
|
||||
* 92 12/01/97 5:25p Hoffoss
|
||||
* Routed interface sound playing through a special function that will
|
||||
* only allow one instance of the sound to play at a time, avoiding
|
||||
* over-mixing problems.
|
||||
*
|
||||
* 91 12/01/97 3:38p Hoffoss
|
||||
* Changed placement of 'More' indicator.
|
||||
*
|
||||
* 90 11/25/97 3:49p Hoffoss
|
||||
* Changed subhilighting to happen when mouse is over line, rather than
|
||||
* mouse button down but not up again yet.
|
||||
*
|
||||
* 89 11/24/97 10:20p Lawrance
|
||||
* Add key 'KEY_N' to target next ship on monitoring view
|
||||
*
|
||||
* 88 11/24/97 6:15p Lawrance
|
||||
* fix button scroll problem
|
||||
*
|
||||
* 87 11/23/97 6:15p Hoffoss
|
||||
* Make exiting the controls config screen save the pilot, so changes keep
|
||||
* even if programs crashes or something.
|
||||
*
|
||||
* 86 11/21/97 5:57p Hoffoss
|
||||
* Fixed bug where timef type controls weren't checking joystick buttons.
|
||||
*
|
||||
* 85 11/21/97 4:06p Hoffoss
|
||||
* Fixed bug with enabling of axis are reversed.
|
||||
*
|
||||
* 84 11/20/97 4:47p Hoffoss
|
||||
* Swapped throttle and rudder, which apparently were backwards.
|
||||
*
|
||||
* 83 11/20/97 4:00p Lawrance
|
||||
* set z to a valid value
|
||||
*
|
||||
* 82 11/20/97 3:52p Hoffoss
|
||||
* Made "None" appear if no control is bound to function.
|
||||
*
|
||||
* 81 11/20/97 2:10p Hoffoss
|
||||
* Added defaults for joystick buttons 2 and 3.
|
||||
*
|
||||
* 80 11/20/97 1:08a Lawrance
|
||||
* add support for 'R' key - target closest friendly repair ship
|
||||
*
|
||||
* 79 11/19/97 8:33p Hoffoss
|
||||
* New controls config screen baby!
|
||||
*
|
||||
* 78 11/17/97 7:09p Hoffoss
|
||||
* Made chase view control a trigger type.
|
||||
*
|
||||
* 77 11/17/97 6:40p Lawrance
|
||||
* Changed 'I' key to toggle of extended target info, moved target closest
|
||||
* locked missile to 'L'
|
||||
*
|
||||
* 76 11/17/97 3:26p Jasen
|
||||
* Adjusted coordinates for the help button .ani location
|
||||
*
|
||||
* 75 11/16/97 3:51p Hoffoss
|
||||
* Added more button to config screen when scrolling allowed.
|
||||
*
|
||||
* 74 11/16/97 3:20p Hoffoss
|
||||
* Added various suggestions from the Todolist.
|
||||
*
|
||||
* 73 11/14/97 4:33p Mike
|
||||
* Change Debug key to backquote (from F11).
|
||||
* Balance a ton of subsystems in ships.tbl.
|
||||
* Change "Heavy Laser" to "Disruptor".
|
||||
*
|
||||
* 72 11/12/97 2:54p Hoffoss
|
||||
* Made modifiers non-stand alone, added support for red tabs on
|
||||
* conflicts.
|
||||
*
|
||||
* 71 10/30/97 6:01p Hoffoss
|
||||
* Changed screen to utilize the new text color standards.
|
||||
*
|
||||
* 70 10/29/97 7:25p Hoffoss
|
||||
* Added crude support for UI button double click checking.
|
||||
*
|
||||
* 69 10/29/97 6:32p Hoffoss
|
||||
* Changed some interface apperances.
|
||||
*
|
||||
* 68 10/29/97 4:54p Hoffoss
|
||||
* Changed scan_code_text element for Enter to 'Enter' instead of 'a' with
|
||||
* a caret over it (what's that all about?)
|
||||
*
|
||||
* 67 10/28/97 10:42a Hoffoss
|
||||
* Fixed handling of continuous controls that have modifiers to the key.
|
||||
*
|
||||
* 66 10/28/97 10:03a Hoffoss
|
||||
* Fixed bug with continuous type controls not registering if pressed and
|
||||
* released too quickly. Also some other little changes.
|
||||
*
|
||||
* 65 10/28/97 12:12a Lawrance
|
||||
* remove unused keys (Alt-H and Alt-F)
|
||||
*
|
||||
* 64 10/27/97 12:23p Hoffoss
|
||||
* Improved warning system and fixed coloring bug.
|
||||
*
|
||||
* 63 10/27/97 11:39a Hoffoss
|
||||
* Added control conflicts checking.
|
||||
*
|
||||
* 62 10/26/97 3:20p Hoffoss
|
||||
* Added many missing features to control config screen.
|
||||
*
|
||||
* 61 10/25/97 5:41p Hoffoss
|
||||
* More functionality added to the controls config screen.
|
||||
*
|
||||
* 60 10/24/97 11:00p Hoffoss
|
||||
* Controls config screen much improved.
|
||||
*
|
||||
* 59 10/22/97 4:50p Hoffoss
|
||||
* Disabled throttle by default.
|
||||
*
|
||||
* 58 10/22/97 11:00a Hoffoss
|
||||
* Changed VIEW_SLEW and VIEW_EXTERNAL to be continuous rather than
|
||||
* trigger actions.
|
||||
*
|
||||
* 57 10/21/97 7:05p Hoffoss
|
||||
* Overhauled the key/joystick control structure and usage throughout the
|
||||
* entire FreeSpace code. The whole system is very different now.
|
||||
*
|
||||
* 56 10/18/97 7:19p Hoffoss
|
||||
* Added timestamp recording when a key is pressed.
|
||||
*
|
||||
* 55 10/13/97 4:33p Hoffoss
|
||||
* Made training messages go away after time.
|
||||
*
|
||||
* 54 10/13/97 3:24p Hoffoss
|
||||
* Made it so training message text can be arbitrarily bolded.
|
||||
*
|
||||
* 53 9/24/97 4:52p Hoffoss
|
||||
* Changed training message key token handling, and implemented a new
|
||||
* training message system method to test out for a while.
|
||||
*
|
||||
* 52 9/14/97 10:24p Lawrance
|
||||
* add damage screen popup window
|
||||
*
|
||||
* 51 9/10/97 6:02p Hoffoss
|
||||
* Added code to check for key-pressed sexp operator in FreeSpace as part
|
||||
* of training mission stuff.
|
||||
*
|
||||
* 50 9/09/97 3:39p Sandeep
|
||||
* warning level 4 bugs
|
||||
* $NoKeywords: $
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#include "controlconfig/controlsconfig.h"
|
||||
#include "io/key.h"
|
||||
@@ -887,28 +469,30 @@ char *textify_scancode(int code)
|
||||
if (code < 0)
|
||||
return "None";
|
||||
|
||||
int keycode = code & KEY_MASK;
|
||||
|
||||
*text = 0;
|
||||
if (code & KEY_ALTED) {
|
||||
if (code & KEY_ALTED && !(keycode == KEY_LALT || keycode == KEY_RALT)) {
|
||||
if(Lcl_gr){
|
||||
strcat(text, "Alt-");
|
||||
strcat_s(text, "Alt-");
|
||||
} else if(Lcl_fr){
|
||||
strcat(text, "Alt-");
|
||||
strcat_s(text, "Alt-");
|
||||
} else {
|
||||
strcat(text, "Alt-");
|
||||
strcat_s(text, "Alt-");
|
||||
}
|
||||
}
|
||||
|
||||
if (code & KEY_SHIFTED) {
|
||||
if (code & KEY_SHIFTED && !(keycode == KEY_LSHIFT || keycode == KEY_RSHIFT)) {
|
||||
if(Lcl_gr){
|
||||
strcat(text, "Shift-");
|
||||
strcat_s(text, "Shift-");
|
||||
} else if(Lcl_fr){
|
||||
strcat(text, "Maj.-");
|
||||
strcat_s(text, "Maj.-");
|
||||
} else {
|
||||
strcat(text, "Shift-");
|
||||
strcat_s(text, "Shift-");
|
||||
}
|
||||
}
|
||||
|
||||
strcat(text, Scan_code_text[code & KEY_MASK]);
|
||||
strcat_s(text, Scan_code_text[keycode]);
|
||||
return text;
|
||||
}
|
||||
//XSTR:ON
|
||||
|
||||
@@ -7,29 +7,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Cryptstring/cryptstring.cpp $
|
||||
* $Revision: 2.2 $
|
||||
* $Date: 2005-09-08 00:09:32 $
|
||||
* $Author: taylor $
|
||||
*
|
||||
* Applet for crypting strings.
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.1 2002/08/01 01:41:04 penguin
|
||||
* The big include file move
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:21 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
* Revision 1.1 2002/05/02 18:03:04 mharris
|
||||
* Initial checkin - converted filenames and includes to lower case
|
||||
*
|
||||
*
|
||||
* 2 10/23/98 6:21p Dave
|
||||
*
|
||||
* $NoKeywords: $
|
||||
*/
|
||||
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
+50
-267
@@ -7,239 +7,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Cutscene/Cutscenes.cpp $
|
||||
* $Revision: 2.18.2.4 $
|
||||
* $Date: 2007-09-02 02:07:39 $
|
||||
* $Author: Goober5000 $
|
||||
* $Revision: 2.18.2.4 $
|
||||
* $Date: 2007-09-02 02:07:39 $
|
||||
* $Author: Goober5000 $
|
||||
*
|
||||
* Code for the cutscenes viewer screen
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.18.2.3 2007/03/22 20:54:00 taylor
|
||||
* give a better msg when movies can't play because they are user-disabled with the cmdline option
|
||||
*
|
||||
* Revision 2.18.2.2 2007/02/09 23:58:28 taylor
|
||||
* add the "show all" hotkey to the cutscene viewer
|
||||
*
|
||||
* Revision 2.18.2.1 2006/09/11 01:15:04 taylor
|
||||
* fixes for stuff_string() bounds checking
|
||||
*
|
||||
* Revision 2.18 2006/05/09 09:21:15 taylor
|
||||
* fix incorrect button locations, it matches the correct layout of the other techroom screens now
|
||||
* (thought Backslash was going to fix this, but I got tired of waiting. :))
|
||||
*
|
||||
* Revision 2.17 2005/07/02 19:42:14 taylor
|
||||
* ton of non-standard resolution fixes
|
||||
*
|
||||
* Revision 2.16 2005/05/12 17:49:11 taylor
|
||||
* use vm_malloc(), vm_free(), vm_realloc(), vm_strdup() rather than system named macros
|
||||
* fixes various problems and is past time to make the switch
|
||||
*
|
||||
* Revision 2.15 2005/02/23 04:51:55 taylor
|
||||
* some bm_unload() -> bm_release() changes to save bmpman slots
|
||||
*
|
||||
* Revision 2.14 2005/01/31 23:27:51 taylor
|
||||
* merge with Linux/OSX tree - p0131-2
|
||||
*
|
||||
* Revision 2.13 2004/07/26 20:47:26 Kazan
|
||||
* remove MCD complete
|
||||
*
|
||||
* Revision 2.12 2004/07/12 16:32:43 Kazan
|
||||
* MCD - define _MCD_CHECK to use memory tracking
|
||||
*
|
||||
* Revision 2.11 2004/04/26 13:11:11 taylor
|
||||
* mark view cutscenes ignoring extension and file case
|
||||
*
|
||||
* Revision 2.10 2004/03/05 09:01:58 Goober5000
|
||||
* Uber pass at reducing #includes
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.9 2004/02/20 04:29:53 bobboau
|
||||
* pluged memory leaks,
|
||||
* 3D HTL lasers (they work perfictly)
|
||||
* and posably fixed Turnsky's shinemap bug
|
||||
*
|
||||
* Revision 2.8 2004/01/24 15:52:25 randomtiger
|
||||
* 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.
|
||||
*
|
||||
* Revision 2.7 2003/08/21 20:54:38 randomtiger
|
||||
* Fixed switching - RT
|
||||
*
|
||||
* Revision 2.6 2003/07/15 02:58:08 phreak
|
||||
* the cutscene section in the techroom does not append *.mve onto a filename
|
||||
*
|
||||
* Revision 2.5 2003/03/18 10:07:01 unknownplayer
|
||||
* The big DX/main line merge. This has been uploaded to the main CVS since I can't manage to get it to upload to the DX branch. Apologies to all who may be affected adversely, but I'll work to debug it as fast as I can.
|
||||
*
|
||||
* Revision 2.4 2002/08/27 13:38:57 penguin
|
||||
* Moved DirectX8 stuff to directx8 branch; reverted to previous
|
||||
*
|
||||
* Revision 2.2.2.4 2002/09/24 18:56:41 randomtiger
|
||||
* DX8 branch commit
|
||||
*
|
||||
* This is the scub of UP's previous code with the more up to date RT code.
|
||||
* For full details check previous dev e-mails
|
||||
*
|
||||
* Revision 2.2.2.3 2002/08/28 21:47:02 randomtiger
|
||||
* Tiny change to DX branch to keep movie code optional (default off)
|
||||
*
|
||||
* Revision 2.2.2.2 2002/08/28 12:39:35 randomtiger
|
||||
* OK, this should be a commit to the DX branch or Im going to be in a lot of trouble.
|
||||
* The movie and dx8show files have been cleaned up big time.
|
||||
* My debug system is in but has NO EFFECT at all unless a compiler flag is turned on, check h file for details.
|
||||
* Aside from that a few changes to help the movie code work properly.
|
||||
* Works on most things including GF4 and Voodoo 3. However may not work properly on a voodoo 2.
|
||||
* Im going to leave this as a bug for now, serves you right for buying voodoo!
|
||||
*
|
||||
* Revision 2.2.2.1 2002/08/27 13:19:26 penguin
|
||||
* Moved to directx8 branch
|
||||
*
|
||||
* Revision 2.3 2002/08/18 19:48:29 randomtiger
|
||||
* Added new lib files: strmiids and ddraw to get dshow working
|
||||
* Added new command line parameter to active direct show movie play: -dshowvid
|
||||
* Uncommented movie_play calls and includes
|
||||
*
|
||||
* Revision 2.2 2002/08/01 01:41:04 penguin
|
||||
* The big include file move
|
||||
*
|
||||
* Revision 2.1 2002/07/07 19:55:58 penguin
|
||||
* Back-port to MSVC
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:21 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
* Revision 1.4 2002/05/16 00:39:47 mharris
|
||||
* Added ifdef WIN32 around cd stuff
|
||||
*
|
||||
* Revision 1.3 2002/05/13 21:43:37 mharris
|
||||
* A little more network and sound cleanup
|
||||
*
|
||||
* Revision 1.2 2002/05/07 02:57:33 mharris
|
||||
* make Buttons[] static
|
||||
*
|
||||
* Revision 1.1 2002/05/02 18:03:04 mharris
|
||||
* Initial checkin - converted filenames and includes to lower case
|
||||
*
|
||||
*
|
||||
* 15 6/16/00 3:15p Jefff
|
||||
* sim of the year dvd version changes, a few german soty localization
|
||||
* fixes
|
||||
*
|
||||
* 14 10/13/99 10:20a Jefff
|
||||
* fixed bug where intro cutscene showed 2x after getting bad ending
|
||||
*
|
||||
* 13 10/06/99 10:30a Jefff
|
||||
* OEM updates
|
||||
*
|
||||
* 12 9/30/99 6:01p Jefff
|
||||
* OEM updates
|
||||
*
|
||||
* 11 9/07/99 1:10p Mikek
|
||||
* Make movie check not hang in ~RELEASE_REAL build.
|
||||
*
|
||||
* 10 9/06/99 6:38p Dave
|
||||
* Improved CD detection code.
|
||||
*
|
||||
* 9 9/06/99 1:16a Dave
|
||||
* Make sure the user sees the intro movie.
|
||||
*
|
||||
* 8 9/03/99 1:31a Dave
|
||||
* CD checking by act. Added support to play 2 cutscenes in a row
|
||||
* seamlessly. Fixed super low level cfile bug related to files in the
|
||||
* root directory of a CD. Added cheat code to set campaign mission # in
|
||||
* main hall.
|
||||
*
|
||||
* 7 7/19/99 2:13p Dave
|
||||
* Added some new strings for Heiko.
|
||||
*
|
||||
* 6 6/01/99 3:52p Dave
|
||||
* View footage screen. Fixed xstrings to not display the & symbol. Popup,
|
||||
* dead popup, pxo find player popup, pxo private room popup.
|
||||
*
|
||||
* 5 1/30/99 5:08p Dave
|
||||
* More new hi-res stuff.Support for nice D3D textures.
|
||||
*
|
||||
* 4 10/23/98 3:51p Dave
|
||||
* Full support for tstrings.tbl and foreign languages. All that remains
|
||||
* is to make it active in Fred.
|
||||
*
|
||||
* 3 10/13/98 9:28a Dave
|
||||
* Started neatening up freespace.h. Many variables renamed and
|
||||
* reorganized. Added AlphaColors.[h,cpp]
|
||||
*
|
||||
* 2 10/07/98 10:52a Dave
|
||||
* Initial checkin.
|
||||
*
|
||||
* 1 10/07/98 10:48a Dave
|
||||
*
|
||||
* 18 6/09/98 10:31a Hoffoss
|
||||
* Created index numbers for all xstr() references. Any new xstr() stuff
|
||||
* added from here on out should be added to the end if the list. The
|
||||
* current list count can be found in FreeSpace.cpp (search for
|
||||
* XSTR_SIZE).
|
||||
*
|
||||
* 17 6/01/98 11:43a John
|
||||
* JAS & MK: Classified all strings for localization.
|
||||
*
|
||||
* 16 5/24/98 9:01p Lawrance
|
||||
* Add commit sounds when accept is pressed
|
||||
*
|
||||
* 15 5/21/98 8:05p Allender
|
||||
* fix possible bug with number of cutscenes shown in the list
|
||||
*
|
||||
* 14 5/21/98 12:35a Lawrance
|
||||
* Tweak how CD is checked for
|
||||
*
|
||||
* 13 5/20/98 1:34p Hoffoss
|
||||
* Added cutscene description rendering.
|
||||
*
|
||||
* 12 5/19/98 12:19p Mike
|
||||
* Cheat codes!
|
||||
*
|
||||
* 11 5/12/98 4:17p Hoffoss
|
||||
* Make ctrl-arrows (up/down) switch between tech room screens.
|
||||
*
|
||||
* 10 5/11/98 8:04p Hoffoss
|
||||
* Fixed minor bugs.
|
||||
*
|
||||
* 9 5/10/98 10:05p Allender
|
||||
* only show cutscenes which have been seen before. Made Fred able to
|
||||
* write missions anywhere, defaulting to player misison folder, not data
|
||||
* mission folder. Fix FreeSpace code to properly read missions from
|
||||
* correct locations
|
||||
*
|
||||
* 8 5/08/98 5:30p Lawrance
|
||||
* add CD checks for movie playing
|
||||
*
|
||||
* 7 5/08/98 4:07p Allender
|
||||
* more cutscene stuff
|
||||
*
|
||||
* 6 5/07/98 2:33p Hoffoss
|
||||
* Removed help and options buttons.
|
||||
*
|
||||
* 5 4/30/98 4:53p John
|
||||
* Restructured and cleaned up cfile code. Added capability to read off
|
||||
* of CD-ROM drive and out of multiple pack files.
|
||||
*
|
||||
* 4 4/23/98 8:27p Allender
|
||||
* basic support for cutscene playback. Into movie code in place. Tech
|
||||
* room can view cutscenes stored in CDROM_dir variable
|
||||
*
|
||||
* 3 4/21/98 7:07p Hoffoss
|
||||
* Fixed problem where when switching screens flashes old tab hilight once
|
||||
* before switching to new state.
|
||||
*
|
||||
* 2 4/17/98 6:33p Hoffoss
|
||||
* Made changes to the tech room group of screens. Cutscenes screen is
|
||||
* now in a new file.
|
||||
*
|
||||
* $NoKeywords: $
|
||||
*/
|
||||
|
||||
|
||||
#include "cutscene/cutscenes.h"
|
||||
#include "ui/ui.h"
|
||||
@@ -267,15 +35,20 @@ char *Cutscene_mask_name[GR_NUM_RESOLUTIONS] = {
|
||||
"2_ViewFootage-m"
|
||||
};
|
||||
|
||||
int Num_cutscenes;
|
||||
int Cutscenes_viewable;
|
||||
int Description_index;
|
||||
cutscene_info Cutscenes[MAX_CUTSCENES];
|
||||
SCP_vector<cutscene_info> Cutscenes;
|
||||
|
||||
//extern int All_movies_enabled; // If set, all movies may be viewed. Keyed off cheat code.
|
||||
void cutscene_close(){
|
||||
for(int i = 0; i<MAX_CUTSCENES; i++)
|
||||
if(Cutscenes[i].description)vm_free(Cutscenes[i].description);
|
||||
void cutscene_close()
|
||||
{
|
||||
for(size_t i = 0; i < Cutscenes.size(); i++)
|
||||
{
|
||||
if(Cutscenes[i].description)
|
||||
{
|
||||
vm_free(Cutscenes[i].description);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// initialization stuff for cutscenes
|
||||
@@ -284,6 +57,7 @@ void cutscene_init()
|
||||
atexit(cutscene_close);
|
||||
char buf[MULTITEXT_LENGTH];
|
||||
int rval;
|
||||
cutscene_info cutinfo;
|
||||
|
||||
// open localization
|
||||
lcl_ext_open();
|
||||
@@ -294,28 +68,34 @@ void cutscene_init()
|
||||
return;
|
||||
}
|
||||
|
||||
read_file_text("cutscenes.tbl");
|
||||
read_file_text("cutscenes.tbl", CF_TYPE_TABLES);
|
||||
reset_parse();
|
||||
|
||||
// parse in all the cutscenes
|
||||
Num_cutscenes = 0;
|
||||
Cutscenes.clear();
|
||||
skip_to_string("#Cutscenes");
|
||||
ignore_white_space();
|
||||
while ( required_string_either("#End", "$Filename:") ) {
|
||||
Assert ( Num_cutscenes < MAX_CUTSCENES );
|
||||
|
||||
while ( required_string_either("#End", "$Filename:") )
|
||||
{
|
||||
memset(&cutinfo, 0, sizeof(cutscene_info));
|
||||
|
||||
required_string("$Filename:");
|
||||
stuff_string( Cutscenes[Num_cutscenes].filename, F_PATHNAME, MAX_FILENAME_LEN );
|
||||
stuff_string( cutinfo.filename, F_PATHNAME, MAX_FILENAME_LEN );
|
||||
|
||||
required_string("$Name:");
|
||||
stuff_string( Cutscenes[Num_cutscenes].name, F_NAME, NAME_LENGTH );
|
||||
stuff_string( cutinfo.name, F_NAME, NAME_LENGTH );
|
||||
|
||||
required_string("$Description:");
|
||||
stuff_string(buf, F_MULTITEXT, sizeof(buf));
|
||||
drop_white_space(buf);
|
||||
compact_multitext_string(buf);
|
||||
Cutscenes[Num_cutscenes].description = vm_strdup(buf);
|
||||
required_string("$cd:");
|
||||
stuff_int( &Cutscenes[Num_cutscenes].cd );
|
||||
cutinfo.description = vm_strdup(buf);
|
||||
|
||||
Num_cutscenes++;
|
||||
required_string("$cd:");
|
||||
stuff_int( &cutinfo.cd );
|
||||
|
||||
Cutscenes.push_back(cutinfo);
|
||||
}
|
||||
|
||||
required_string("#End");
|
||||
@@ -333,9 +113,8 @@ int cutscenes_get_cd_num( char *filename )
|
||||
#if defined(OEM_BUILD)
|
||||
return 0; // only 1 cd for OEM
|
||||
#else
|
||||
int i;
|
||||
|
||||
for (i = 0; i < Num_cutscenes; i++ ) {
|
||||
for (size_t i = 0; i < Cutscenes.size(); i++ ) {
|
||||
if ( !stricmp(Cutscenes[i].filename, filename) ) {
|
||||
return (Cutscenes[i].cd - 1);
|
||||
}
|
||||
@@ -348,14 +127,13 @@ int cutscenes_get_cd_num( char *filename )
|
||||
// marks a cutscene as viewable
|
||||
void cutscene_mark_viewable(char *filename)
|
||||
{
|
||||
int i;
|
||||
char cut_file[MAX_FILENAME_LEN];
|
||||
char file[MAX_FILENAME_LEN];
|
||||
|
||||
Assert(filename);
|
||||
Assert(filename!=NULL);
|
||||
|
||||
// strip off extension
|
||||
strcpy( file, filename );
|
||||
strcpy_s( file, filename );
|
||||
char *p = strchr( file, '.' );
|
||||
if ( p ) {
|
||||
*p = 0;
|
||||
@@ -364,9 +142,9 @@ void cutscene_mark_viewable(char *filename)
|
||||
// change to lower case
|
||||
strlwr(file);
|
||||
|
||||
for (i = 0; i < Num_cutscenes; i++ ) {
|
||||
for (size_t i = 0; i < Cutscenes.size(); i++ ) {
|
||||
// change the cutscene file name to lower case
|
||||
strcpy(cut_file, Cutscenes[i].filename);
|
||||
strcpy_s(cut_file, Cutscenes[i].filename);
|
||||
strlwr(cut_file);
|
||||
|
||||
// see if the stripped filename matches the cutscene filename
|
||||
@@ -390,7 +168,7 @@ void cutscene_mark_viewable(char *filename)
|
||||
#define EXIT_BUTTON 7
|
||||
|
||||
static int Num_files;
|
||||
static int Cutscene_list[MAX_CUTSCENES];
|
||||
static SCP_vector<int> Cutscene_list;
|
||||
//static int Stats_scroll_offset; // not used - taylor
|
||||
static int Selected_line = 0; // line that is currently selected for binding
|
||||
static int Scroll_offset;
|
||||
@@ -556,7 +334,7 @@ void cutscenes_screen_play()
|
||||
Assert( (Selected_line >= 0) && (Selected_line < Num_files) );
|
||||
which_cutscene = Cutscene_list[Selected_line];
|
||||
|
||||
strcpy(name, Cutscenes[which_cutscene].filename );
|
||||
strcpy_s(name, Cutscenes[which_cutscene].filename );
|
||||
// full_name = cf_add_ext(name, NOX(".mve"));
|
||||
|
||||
main_hall_stop_music();
|
||||
@@ -730,9 +508,10 @@ void cutscenes_screen_init()
|
||||
// Cutscenes_viewable = 0xffffffff; // Cheat code enables all movies.
|
||||
|
||||
Num_files = 0;
|
||||
for ( i = 0; i < Num_cutscenes; i++ ) {
|
||||
if ( Cutscenes_viewable & (1<<i) ) {
|
||||
Cutscene_list[Num_files] = i;
|
||||
Cutscene_list.clear();
|
||||
for (size_t j = 0; j < Cutscenes.size(); j++ ) {
|
||||
if ( Cutscenes_viewable & (1<<j) ) {
|
||||
Cutscene_list.push_back((int)j);
|
||||
Num_files++;
|
||||
}
|
||||
}
|
||||
@@ -792,8 +571,9 @@ void cutscenes_screen_do_frame()
|
||||
case KEY_CTRLED | KEY_SHIFTED | KEY_S:
|
||||
{
|
||||
Num_files = 0;
|
||||
for (i = 0; i < Num_cutscenes; i++) {
|
||||
Cutscene_list[Num_files] = i;
|
||||
Cutscene_list.clear();
|
||||
for (size_t t = 0; t < Cutscenes.size(); t++) {
|
||||
Cutscene_list.push_back((int)t);
|
||||
Num_files++;
|
||||
}
|
||||
|
||||
@@ -863,14 +643,17 @@ void cutscenes_screen_do_frame()
|
||||
}
|
||||
|
||||
if (Description_index != Selected_line) {
|
||||
char *src;
|
||||
char *src = NULL;
|
||||
|
||||
Description_index = Selected_line;
|
||||
Text_size = 0;
|
||||
src = Cutscenes[Cutscene_list[Description_index]].description;
|
||||
if (src) {
|
||||
Text_size = split_str(src, Cutscene_desc_coords[gr_screen.res][2], Text_line_size, Text_lines, Cutscene_max_text_lines[gr_screen.res]);
|
||||
Assert(Text_size >= 0 && Text_size < Cutscene_max_text_lines[gr_screen.res]);
|
||||
if ( Description_index < (int)Cutscene_list.size( ) &&
|
||||
(int)Cutscene_list[ Description_index ] < (int)Cutscenes.size( ) ) {
|
||||
src = Cutscenes[Cutscene_list[Description_index]].description;
|
||||
if (src) {
|
||||
Text_size = split_str(src, Cutscene_desc_coords[gr_screen.res][2], Text_line_size, Text_lines, Cutscene_max_text_lines[gr_screen.res]);
|
||||
Assert(Text_size >= 0 && Text_size < Cutscene_max_text_lines[gr_screen.res]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -7,58 +7,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Cutscene/Cutscenes.h $
|
||||
* $Revision: 2.4 $
|
||||
* $Date: 2005-07-13 02:50:50 $
|
||||
* $Author: Goober5000 $
|
||||
*
|
||||
* Code for the cutscenes viewer screen
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.3 2004/08/11 05:06:20 Kazan
|
||||
* added preprocdefines.h to prevent what happened with fred -- make sure to make all fred2 headers include this file as the _first_ include -- i have already modified fs2 files to do this
|
||||
*
|
||||
* Revision 2.2 2004/03/05 09:01:58 Goober5000
|
||||
* Uber pass at reducing #includes
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.1 2002/08/01 01:41:04 penguin
|
||||
* The big include file move
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:21 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
* Revision 1.1 2002/05/02 18:03:04 mharris
|
||||
* Initial checkin - converted filenames and includes to lower case
|
||||
*
|
||||
*
|
||||
* 2 10/07/98 10:52a Dave
|
||||
* Initial checkin.
|
||||
*
|
||||
* 1 10/07/98 10:48a Dave
|
||||
*
|
||||
* 6 5/21/98 12:35a Lawrance
|
||||
* Tweak how CD is checked for
|
||||
*
|
||||
* 5 5/10/98 10:05p Allender
|
||||
* only show cutscenes which have been seen before. Made Fred able to
|
||||
* write missions anywhere, defaulting to player misison folder, not data
|
||||
* mission folder. Fix FreeSpace code to properly read missions from
|
||||
* correct locations
|
||||
*
|
||||
* 4 5/08/98 5:30p Lawrance
|
||||
* add cutscenes_validate_cd()
|
||||
*
|
||||
* 3 5/08/98 4:07p Allender
|
||||
* more cutscene stuff
|
||||
*
|
||||
* 2 4/17/98 6:33p Hoffoss
|
||||
* Made changes to the tech room group of screens. Cutscenes screen is
|
||||
* now in a new file.
|
||||
*
|
||||
* $NoKeywords: $
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _FREESPACE_CUTSCENES_SCREEN_HEADER_FILE
|
||||
#define _FREESPACE_CUTSCENES_SCREEN_HEADER_FILE
|
||||
@@ -66,8 +15,6 @@
|
||||
#include "globalincs/globals.h"
|
||||
#include "globalincs/pstypes.h"
|
||||
|
||||
#define MAX_CUTSCENES 10
|
||||
|
||||
// this cutscene is always available.
|
||||
#define INTRO_CUTSCENE_FLAG (1<<0)
|
||||
|
||||
@@ -79,8 +26,7 @@ typedef struct cutscene_info
|
||||
int cd;
|
||||
} cutscene_info;
|
||||
|
||||
extern cutscene_info Cutscenes[MAX_CUTSCENES];
|
||||
extern int Num_cutscenes;
|
||||
extern SCP_vector<cutscene_info> Cutscenes;
|
||||
extern int Cutscenes_viewable;
|
||||
|
||||
// initializa table data
|
||||
|
||||
@@ -1,19 +1,4 @@
|
||||
/*
|
||||
* $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"
|
||||
|
||||
@@ -316,7 +301,7 @@ static void dispatchDecoder16(ushort **pFrame, unsigned char codeType, unsigned
|
||||
y = far_p_table[k*2+1];
|
||||
|
||||
copyFrame(*pFrame, *pFrame + x + y*g_width);
|
||||
*pDataRemain--;
|
||||
(*pDataRemain)--;
|
||||
break;
|
||||
|
||||
case 0x3:
|
||||
@@ -327,7 +312,7 @@ static void dispatchDecoder16(ushort **pFrame, unsigned char codeType, unsigned
|
||||
y = far_n_table[k*2+1];
|
||||
|
||||
copyFrame(*pFrame, *pFrame + x + y*g_width);
|
||||
*pDataRemain--;
|
||||
(*pDataRemain)--;
|
||||
break;
|
||||
|
||||
case 0x4:
|
||||
@@ -338,7 +323,7 @@ static void dispatchDecoder16(ushort **pFrame, unsigned char codeType, unsigned
|
||||
y = close_table[k*2+1];
|
||||
|
||||
copyFrame(*pFrame, *pFrame + (backBuf2 - backBuf1) + x + y*g_width);
|
||||
*pDataRemain--;
|
||||
(*pDataRemain)--;
|
||||
break;
|
||||
|
||||
case 0x5:
|
||||
|
||||
@@ -1,16 +1,4 @@
|
||||
/*
|
||||
* $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"
|
||||
|
||||
@@ -220,21 +208,21 @@ static void dispatchDecoder8(ubyte **pFrame, ubyte codeType, ubyte **pData, int
|
||||
relFar(*(*pData)++, 1, &x, &y);
|
||||
copyFrame(*pFrame, *pFrame + x + y*g_width);
|
||||
*pFrame += 8;
|
||||
*pDataRemain--;
|
||||
(*pDataRemain)--;
|
||||
break;
|
||||
|
||||
case 0x3:
|
||||
relFar(*(*pData)++, -1, &x, &y);
|
||||
copyFrame(*pFrame, *pFrame + x + y*g_width);
|
||||
*pFrame += 8;
|
||||
*pDataRemain--;
|
||||
(*pDataRemain)--;
|
||||
break;
|
||||
|
||||
case 0x4:
|
||||
relClose(*(*pData)++, &x, &y);
|
||||
copyFrame(*pFrame, *pFrame + ((ubyte *)g_vBackBuf2 - (ubyte *)g_vBackBuf1) + x + y*g_width);
|
||||
*pFrame += 8;
|
||||
*pDataRemain--;
|
||||
(*pDataRemain)--;
|
||||
break;
|
||||
|
||||
case 0x5:
|
||||
@@ -521,7 +509,7 @@ static void dispatchDecoder8(ubyte **pFrame, ubyte codeType, ubyte **pData, int
|
||||
}
|
||||
|
||||
(*pData)++;
|
||||
*pDataRemain--;
|
||||
(*pDataRemain)--;
|
||||
*pFrame -= (8*g_width - 8);
|
||||
break;
|
||||
|
||||
|
||||
+3
-103
@@ -7,105 +7,10 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* $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"
|
||||
@@ -148,7 +53,7 @@ int movie_find(char *filename, char *out_name)
|
||||
memset( tmp_name, 0, sizeof(tmp_name) );
|
||||
|
||||
// remove extension
|
||||
strcpy( tmp_name, filename );
|
||||
strcpy_s( tmp_name, filename );
|
||||
char *p = strrchr(tmp_name, '.');
|
||||
if ( p ) *p = 0;
|
||||
|
||||
@@ -187,7 +92,7 @@ bool movie_play(char *name)
|
||||
rc = movie_find(name, full_name);
|
||||
|
||||
if (rc == MOVIE_NONE) {
|
||||
strcpy(full_name, name);
|
||||
strcpy_s(full_name, name);
|
||||
char *p = strrchr(full_name, '.');
|
||||
if ( p ) *p = 0;
|
||||
|
||||
@@ -211,11 +116,6 @@ bool movie_play(char *name)
|
||||
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) {
|
||||
|
||||
+1
-12
@@ -7,18 +7,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/cutscene/movie.h $
|
||||
* $Revision: 2.6.2.1 $
|
||||
* $Date: 2007-02-11 09:23:14 $
|
||||
* $Author: taylor $
|
||||
*
|
||||
* movie player header
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
*
|
||||
* $NoKeywords: $
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _MOVIE_HEADER_FILE
|
||||
#define _MOVIE_HEADER_FILE
|
||||
|
||||
@@ -1,24 +1,4 @@
|
||||
/*
|
||||
* $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] =
|
||||
{
|
||||
@@ -75,5 +55,3 @@ void mveaudio_uncompress(short *buffer, unsigned char *data, int length)
|
||||
sendWord(&buffer, nCurOffsets[1]);
|
||||
processSwath(buffer, data, swath, nCurOffsets);
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -1,19 +1,4 @@
|
||||
/*
|
||||
* $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"
|
||||
@@ -78,11 +63,12 @@ MVEFILE *mvefile_open(char *filename)
|
||||
char *p = strchr( lower_name, '.' );
|
||||
if ( p ) *p = 0;
|
||||
|
||||
SAFE_STRCAT( lower_name, ".mve", sizeof(lower_name) );
|
||||
strcat_s( lower_name, ".mve" );
|
||||
|
||||
// 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)) ) {
|
||||
file->stream = cfopen(lower_name, "rb", CFILE_NORMAL, CF_TYPE_ANY);
|
||||
if ( file->stream ) {
|
||||
cf_opened = 1;
|
||||
}
|
||||
|
||||
|
||||
+1
-13
@@ -1,16 +1,4 @@
|
||||
/*
|
||||
* $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
|
||||
|
||||
+22
-84
@@ -1,37 +1,4 @@
|
||||
/*
|
||||
* $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>
|
||||
@@ -42,6 +9,7 @@
|
||||
#include "graphics/gropengl.h"
|
||||
#include "graphics/gropengltexture.h"
|
||||
#include "graphics/gropenglextension.h"
|
||||
#include "graphics/gropenglstate.h"
|
||||
|
||||
#include "globalincs/pstypes.h"
|
||||
#include "cutscene/mvelib.h"
|
||||
@@ -51,7 +19,7 @@
|
||||
#include "osapi/osapi.h"
|
||||
#include "io/timer.h"
|
||||
#include "sound/sound.h"
|
||||
#include "sound/ds.h"
|
||||
#include "sound/openal.h"
|
||||
#include "bmpman/bmpman.h"
|
||||
//#include "sound/audiostr.h"
|
||||
|
||||
@@ -77,7 +45,6 @@ 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;
|
||||
@@ -93,7 +60,6 @@ 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;
|
||||
@@ -259,7 +225,6 @@ void mve_audio_createbuf(ubyte minor, ubyte *data)
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef USE_OPENAL
|
||||
int flags, desired_buffer, sample_rate;
|
||||
|
||||
mas = (mve_audio_t *) vm_malloc ( sizeof(mve_audio_t) );
|
||||
@@ -310,7 +275,6 @@ void mve_audio_createbuf(ubyte minor, ubyte *data)
|
||||
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;
|
||||
|
||||
@@ -321,7 +285,6 @@ void mve_audio_createbuf(ubyte minor, ubyte *data)
|
||||
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 );
|
||||
@@ -333,7 +296,6 @@ void mve_audio_play()
|
||||
if (status != AL_PLAYING && bqueued > 0) {
|
||||
OpenAL_ErrorPrint( alSourcePlay(mas->source_id) );
|
||||
}
|
||||
#endif // USE_OPENAL
|
||||
}
|
||||
}
|
||||
|
||||
@@ -343,7 +305,6 @@ static void mve_audio_stop()
|
||||
if (!audiobuf_created)
|
||||
return;
|
||||
|
||||
#ifdef USE_OPENAL
|
||||
ALint p = 0;
|
||||
|
||||
mve_audio_playing = 0;
|
||||
@@ -364,7 +325,6 @@ static void mve_audio_stop()
|
||||
vm_free(mas);
|
||||
mas = NULL;
|
||||
}
|
||||
#endif // USE_OPENAL
|
||||
}
|
||||
|
||||
int mve_audio_data(ubyte major, ubyte *data)
|
||||
@@ -374,7 +334,6 @@ int mve_audio_data(ubyte major, ubyte *data)
|
||||
int nsamp;
|
||||
|
||||
if (mve_audio_canplay) {
|
||||
#ifdef USE_OPENAL
|
||||
chan = mve_get_ushort(data + 2);
|
||||
nsamp = mve_get_ushort(data + 4);
|
||||
|
||||
@@ -441,7 +400,6 @@ int mve_audio_data(ubyte major, ubyte *data)
|
||||
mprintf(("MVE: Buffer overrun: Queue full\n"));
|
||||
}
|
||||
}
|
||||
#endif // USE_OPENAL
|
||||
}
|
||||
|
||||
return 1;
|
||||
@@ -529,13 +487,8 @@ int mve_video_createbuf(ubyte minor, ubyte *data)
|
||||
gl_screenYH = g_screenY + g_height;
|
||||
gl_screenXW = g_screenX + g_width;
|
||||
|
||||
if (GL_texture_target == GL_TEXTURE_RECTANGLE_ARB) {
|
||||
gl_screenU = (GLfloat)g_width;
|
||||
gl_screenV = (GLfloat)g_height;
|
||||
} else {
|
||||
gl_screenU = i2fl(g_width) / i2fl(wp2);
|
||||
gl_screenV = i2fl(g_height) / i2fl(hp2);
|
||||
}
|
||||
gl_screenU = i2fl(g_width) / i2fl(wp2);
|
||||
gl_screenV = i2fl(g_height) / i2fl(hp2);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -620,9 +573,7 @@ void mve_video_display()
|
||||
}
|
||||
|
||||
if (gr_screen.mode == GR_OPENGL) {
|
||||
glBindTexture(GL_texture_target, GLtex);
|
||||
|
||||
glTexSubImage2D(GL_texture_target, 0, 0, 0, g_width, g_height, GL_BGRA, GL_UNSIGNED_SHORT_1_5_5_5_REV, pixelbuf);
|
||||
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);
|
||||
@@ -693,10 +644,7 @@ int mve_video_init(ubyte *data)
|
||||
memset(pixelbuf, 0, g_screenWidth * g_screenHeight * 2);
|
||||
|
||||
if (gr_screen.mode == GR_OPENGL) {
|
||||
// set the appropriate texture target
|
||||
if ( Is_Extension_Enabled(OGL_ARB_TEXTURE_RECTANGLE) && !Is_Extension_Enabled(OGL_ARB_TEXTURE_NON_POWER_OF_TWO) )
|
||||
opengl_set_texture_target( GL_TEXTURE_RECTANGLE_ARB );
|
||||
|
||||
opengl_set_texture_target(GL_TEXTURE_2D);
|
||||
opengl_tcache_get_adjusted_texture_size(g_screenWidth, g_screenHeight, &wp2, &hp2);
|
||||
|
||||
glGenTextures(1, &GLtex);
|
||||
@@ -709,34 +657,26 @@ int mve_video_init(ubyte *data)
|
||||
return 0;
|
||||
}
|
||||
|
||||
// disable everything but what we need
|
||||
opengl_switch_arb(-1, 0);
|
||||
opengl_switch_arb(0, 1);
|
||||
|
||||
gr_set_lighting(false, false);
|
||||
|
||||
glBindTexture(GL_texture_target, GLtex);
|
||||
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
glDepthFunc(GL_ALWAYS);
|
||||
glDepthMask(GL_FALSE);
|
||||
glDisable(GL_DEPTH_TEST);
|
||||
glTexParameteri(GL_texture_target, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
||||
glTexParameteri(GL_texture_target, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
||||
glTexParameteri(GL_texture_target, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
|
||||
glTexParameteri(GL_texture_target, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
|
||||
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_texture_target, 0, GL_RGB5_A1, wp2, hp2, 0, GL_BGRA_EXT, GL_UNSIGNED_SHORT_1_5_5_5_REV, NULL);
|
||||
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);
|
||||
|
||||
@@ -836,12 +776,10 @@ void mve_shutdown()
|
||||
glPopMatrix();
|
||||
}
|
||||
|
||||
glBindTexture(GL_texture_target, 0);
|
||||
GL_state.Texture.Disable();
|
||||
GL_state.Texture.Delete(GLtex);
|
||||
glDeleteTextures(1, &GLtex);
|
||||
GLtex = 0;
|
||||
|
||||
opengl_switch_arb(-1, 0);
|
||||
opengl_set_texture_target();
|
||||
}
|
||||
|
||||
if (pixelbuf != NULL) {
|
||||
|
||||
+60
-94
@@ -1,31 +1,4 @@
|
||||
/*
|
||||
* $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
|
||||
@@ -41,11 +14,13 @@
|
||||
#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 "sound/openal.h"
|
||||
#include "bmpman/bmpman.h"
|
||||
#include "cutscene/oggplayer.h"
|
||||
#include "io/timer.h"
|
||||
@@ -360,21 +335,8 @@ static void OGG_video_init(theora_info *tinfo)
|
||||
g_screenHeight = tinfo->frame_height;
|
||||
|
||||
|
||||
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 (gr_screen.mode == GR_OPENGL) {
|
||||
// set the appropriate texture target
|
||||
if ( Is_Extension_Enabled(OGL_ARB_TEXTURE_RECTANGLE) && !Is_Extension_Enabled(OGL_ARB_TEXTURE_NON_POWER_OF_TWO) )
|
||||
opengl_set_texture_target( GL_TEXTURE_RECTANGLE_ARB );
|
||||
|
||||
opengl_set_texture_target(GL_TEXTURE_2D);
|
||||
opengl_tcache_get_adjusted_texture_size(g_screenWidth, g_screenHeight, &wp2, &hp2);
|
||||
|
||||
glGenTextures(1, &GLtex);
|
||||
@@ -387,22 +349,22 @@ static void OGG_video_init(theora_info *tinfo)
|
||||
return;
|
||||
}
|
||||
|
||||
// disable everything but what we need
|
||||
opengl_switch_arb(-1, 0);
|
||||
opengl_switch_arb(0, 1);
|
||||
|
||||
gr_set_lighting(false, false);
|
||||
|
||||
glBindTexture(GL_texture_target, GLtex);
|
||||
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
glDepthFunc(GL_ALWAYS);
|
||||
glDepthMask(GL_FALSE);
|
||||
glDisable(GL_DEPTH_TEST);
|
||||
glTexParameteri(GL_texture_target, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
||||
glTexParameteri(GL_texture_target, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
||||
glTexParameteri(GL_texture_target, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
|
||||
glTexParameteri(GL_texture_target, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
|
||||
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;
|
||||
@@ -422,17 +384,19 @@ static void OGG_video_init(theora_info *tinfo)
|
||||
scale_video = 1;
|
||||
}
|
||||
|
||||
// NOTE: using NULL instead of pixelbuf crashes some drivers, but then so does pixelbuf
|
||||
glTexImage2D(GL_texture_target, 0, GL_RGB8, wp2, hp2, 0, GL_BGR, GL_UNSIGNED_BYTE, 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?
|
||||
|
||||
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;
|
||||
}
|
||||
#endif
|
||||
|
||||
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);
|
||||
@@ -448,13 +412,8 @@ static void OGG_video_init(theora_info *tinfo)
|
||||
gl_screenYH = g_screenY + g_screenHeight;
|
||||
gl_screenXW = g_screenX + g_screenWidth;
|
||||
|
||||
if (GL_texture_target == GL_TEXTURE_RECTANGLE_ARB) {
|
||||
gl_screenU = (GLfloat)wp2;
|
||||
gl_screenV = (GLfloat)hp2;
|
||||
} else {
|
||||
gl_screenU = i2fl(g_screenWidth) / i2fl(wp2);
|
||||
gl_screenV = i2fl(g_screenHeight) / i2fl(hp2);
|
||||
}
|
||||
gl_screenU = i2fl(g_screenWidth) / i2fl(wp2);
|
||||
gl_screenV = i2fl(g_screenHeight) / i2fl(hp2);
|
||||
}
|
||||
|
||||
video_inited = 1;
|
||||
@@ -462,8 +421,9 @@ static void OGG_video_init(theora_info *tinfo)
|
||||
|
||||
static void OGG_video_close()
|
||||
{
|
||||
if (!video_inited)
|
||||
if ( !video_inited ) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (gr_screen.mode == GR_OPENGL) {
|
||||
if (scale_video) {
|
||||
@@ -471,15 +431,13 @@ static void OGG_video_close()
|
||||
glPopMatrix();
|
||||
}
|
||||
|
||||
opengl_switch_arb(-1, 0);
|
||||
|
||||
glBindTexture(GL_texture_target, 0);
|
||||
GL_state.Texture.Disable();
|
||||
GL_state.Texture.Delete(GLtex);
|
||||
glDeleteTextures(1, &GLtex);
|
||||
GLtex = 0;
|
||||
|
||||
opengl_set_texture_target();
|
||||
|
||||
glEnable(GL_DEPTH_TEST);
|
||||
GLtex = 0;
|
||||
}
|
||||
|
||||
if (pixelbuf != NULL) {
|
||||
@@ -578,9 +536,7 @@ static void OGG_video_draw(theora_state *tstate)
|
||||
convert_YUV_to_RGB(&yuv);
|
||||
|
||||
if (gr_screen.mode == GR_OPENGL) {
|
||||
glBindTexture(GL_texture_target, GLtex);
|
||||
|
||||
glTexSubImage2D(GL_texture_target, 0, 0, 0, g_screenWidth, g_screenHeight, GL_BGR, GL_UNSIGNED_BYTE, pixelbuf);
|
||||
glTexSubImage2D(GL_state.Texture.GetTarget(), 0, 0, 0, g_screenWidth, g_screenHeight, GL_BGR, GL_UNSIGNED_BYTE, pixelbuf);
|
||||
|
||||
glBegin(GL_QUADS);
|
||||
glTexCoord2f(0, 0);
|
||||
@@ -595,8 +551,6 @@ static void OGG_video_draw(theora_state *tstate)
|
||||
glTexCoord2f(gl_screenU, 0);
|
||||
glVertex2i(gl_screenXW, g_screenY);
|
||||
glEnd();
|
||||
} else {
|
||||
// TODO: FIXME!!!
|
||||
}
|
||||
|
||||
gr_flip();
|
||||
@@ -685,7 +639,7 @@ THEORAFILE *theora_open(char *filename)
|
||||
char *p = strchr( lower_name, '.' );
|
||||
if ( p ) *p = 0;
|
||||
|
||||
SAFE_STRCAT( lower_name, ".ogg", sizeof(lower_name) );
|
||||
strcat_s( lower_name, ".ogg" );
|
||||
|
||||
// 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
|
||||
@@ -770,12 +724,14 @@ THEORAFILE *theora_open(char *filename)
|
||||
movie->vorbis_p = 0;
|
||||
}
|
||||
|
||||
int ret;
|
||||
|
||||
// we're expecting more header packets.
|
||||
while ( (movie->theora_p < 3) || (movie->vorbis_p && (movie->vorbis_p < 3)) ) {
|
||||
int ret;
|
||||
|
||||
ret = ogg_stream_packetout(&movie->t_osstate, &movie->opacket);
|
||||
// look for further theora headers
|
||||
while ( (movie->theora_p < 3) && (ret = ogg_stream_packetout(&movie->t_osstate, &movie->opacket)) ){
|
||||
while ( (movie->theora_p < 3) && (ret) ){
|
||||
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;
|
||||
@@ -783,10 +739,14 @@ THEORAFILE *theora_open(char *filename)
|
||||
|
||||
if (++movie->theora_p == 3)
|
||||
break;
|
||||
|
||||
ret = ogg_stream_packetout(&movie->t_osstate, &movie->opacket);
|
||||
}
|
||||
|
||||
ret = ogg_stream_packetout(&movie->v_osstate, &movie->opacket);
|
||||
|
||||
// look for more vorbis header packets
|
||||
while ( movie->vorbis_p && (movie->vorbis_p < 3) && (ret = ogg_stream_packetout(&movie->v_osstate, &movie->opacket)) ) {
|
||||
while ( movie->vorbis_p && (movie->vorbis_p < 3) && (ret) ) {
|
||||
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;
|
||||
@@ -794,6 +754,8 @@ THEORAFILE *theora_open(char *filename)
|
||||
|
||||
if (++movie->vorbis_p == 3)
|
||||
break;
|
||||
|
||||
ret = ogg_stream_packetout(&movie->v_osstate, &movie->opacket);
|
||||
}
|
||||
|
||||
// The header pages/packets will arrive before anything else we care about, or the stream is not obeying spec
|
||||
@@ -801,7 +763,7 @@ THEORAFILE *theora_open(char *filename)
|
||||
if ( ogg_sync_pageout(&movie->osyncstate, &movie->opage) > 0 ) {
|
||||
OGG_queue_page(movie); // demux into the appropriate stream
|
||||
} else {
|
||||
int ret = OGG_buffer_data(movie); // someone needs more data
|
||||
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));
|
||||
@@ -851,6 +813,10 @@ void theora_play(THEORAFILE *movie)
|
||||
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);
|
||||
@@ -879,15 +845,15 @@ void theora_play(THEORAFILE *movie)
|
||||
|
||||
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);
|
||||
float val = pcm[j][i] * 32767.0f + 0.5f;
|
||||
|
||||
if (val > 32767)
|
||||
val = 32767;
|
||||
if (val > 32767.0f)
|
||||
val = 32767.0f;
|
||||
|
||||
if (val < -32768)
|
||||
val = -32768;
|
||||
if (val < -32768.0f)
|
||||
val = -32768.0f;
|
||||
|
||||
audiobuf[count++] = val;
|
||||
audiobuf[count++] = (short)val;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,16 +1,4 @@
|
||||
/*
|
||||
* $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
|
||||
|
||||
@@ -45,10 +45,10 @@ int dds_read_header(char *filename, CFILE *img_cfp, int *width, int *height, int
|
||||
Assert(filename != NULL);
|
||||
|
||||
// make sure there is an extension
|
||||
strcpy(real_name, filename);
|
||||
strcpy_s(real_name, filename);
|
||||
char *p = strchr(real_name, '.');
|
||||
if (p) { *p=0; }
|
||||
strcat(real_name, ".dds");
|
||||
strcat_s(real_name, ".dds");
|
||||
|
||||
// try to open the file
|
||||
ddsfile = cfopen(real_name, "rb");
|
||||
@@ -284,10 +284,10 @@ int dds_read_bitmap(char *filename, ubyte *data, ubyte *bpp, int cf_type)
|
||||
Assert(filename != NULL);
|
||||
|
||||
// make sure there is an extension
|
||||
strcpy(real_name, filename);
|
||||
strcpy_s(real_name, filename);
|
||||
char *p = strchr(real_name, '.');
|
||||
if (p) { *p = 0; }
|
||||
strcat(real_name, ".dds");
|
||||
strcat_s(real_name, ".dds");
|
||||
|
||||
// open it up and go to the data section
|
||||
cfp = cfopen(real_name, "rb", CFILE_NORMAL, cf_type);
|
||||
@@ -356,12 +356,12 @@ void dds_save_image(int width, int height, int bpp, int num_mipmaps, ubyte *data
|
||||
} else {
|
||||
Assert( strlen(filename) < MAX_FILENAME_LEN-5 );
|
||||
|
||||
strcpy(real_filename, filename);
|
||||
strcpy_s(real_filename, filename);
|
||||
|
||||
char *p = strchr(real_filename, '.');
|
||||
if (p) { *p = 0; }
|
||||
|
||||
strcat(real_filename, ".dds");
|
||||
strcat_s(real_filename, ".dds");
|
||||
}
|
||||
|
||||
CFILE *image = cfopen( real_filename, "wb", CFILE_NORMAL, CF_TYPE_CACHE );
|
||||
|
||||
+90
-387
@@ -7,330 +7,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Debris/Debris.cpp $
|
||||
* $Revision: 2.23.2.8 $
|
||||
* $Date: 2007-02-20 04:19:09 $
|
||||
* $Author: Goober5000 $
|
||||
*
|
||||
* Code for the pieces of exploding object debris.
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.23.2.7 2007/02/12 00:22:05 taylor
|
||||
* some generic_bitmap fixes to go with new changes (not in CVS just yet, don't freak out)
|
||||
* make use of VALID_FNAME() where possible
|
||||
* fix an animation time issue (sub-second animation playback caused div-by-0)
|
||||
*
|
||||
* Revision 2.23.2.6 2007/02/11 09:21:12 taylor
|
||||
* remove NO_SOUND
|
||||
* fix debris recycling
|
||||
*
|
||||
* Revision 2.23.2.5 2006/09/11 01:00:27 taylor
|
||||
* various small compiler warning and strict compiling fixes
|
||||
*
|
||||
* Revision 2.23.2.4 2006/08/27 18:12:40 taylor
|
||||
* make Species_info[] and Asteroid_info[] dynamic
|
||||
*
|
||||
* Revision 2.23.2.3 2006/08/19 04:22:33 taylor
|
||||
* an int wrap-around issue could (and was) make debris not have electrical arcs (or lighting or sounds) since it would always fail this check
|
||||
*
|
||||
* Revision 2.23.2.2 2006/07/06 04:06:00 Goober5000
|
||||
* 1) complete (almost) changeover to reorganized texture mapping system
|
||||
* 2) finally fix texture animation; textures now animate at the correct speed
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.23.2.1 2006/07/04 07:42:09 Goober5000
|
||||
* --in preparation for fixing an annoying animated texture bug, reorganize the various texture structs and glow point structs and clarify several parts of the texture code :P
|
||||
* --this breaks animated glow maps, and animated regular maps still aren't fixed, but these will be remedied shortly
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.23 2006/01/26 03:23:29 Goober5000
|
||||
* pare down the pragmas some more
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.22 2005/12/29 08:08:33 wmcoolmon
|
||||
* Codebase commit, most notably including objecttypes.tbl
|
||||
*
|
||||
* Revision 2.21 2005/10/30 06:44:56 wmcoolmon
|
||||
* Codebase commit - nebula.tbl, scripting, new dinky explosion/shockwave stuff, moving muzzle flashes
|
||||
*
|
||||
* Revision 2.20 2005/10/10 17:21:03 taylor
|
||||
* remove NO_NETWORK
|
||||
*
|
||||
* Revision 2.19 2005/09/25 05:13:05 Goober5000
|
||||
* hopefully complete species upgrade
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.18 2005/09/24 07:07:15 Goober5000
|
||||
* another species overhaul
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.17 2005/07/22 10:18:37 Goober5000
|
||||
* CVS header tweaks
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.16 2005/07/13 02:50:51 Goober5000
|
||||
* remove PreProcDefine #includes in FS2
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.15 2005/07/13 02:01:28 Goober5000
|
||||
* fixed a bunch of "issues" caused by me with the species stuff
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.14 2005/07/13 00:44:21 Goober5000
|
||||
* improved species support and removed need for #define
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.13 2005/04/05 05:53:15 taylor
|
||||
* s/vector/vec3d/g, better support for different compilers (Jens Granseuer)
|
||||
*
|
||||
* Revision 2.12 2005/03/27 12:28:32 Goober5000
|
||||
* clarified max hull/shield strength names and added ship guardian thresholds
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.11 2005/03/02 21:24:43 taylor
|
||||
* more network/inferno goodness for Windows, takes care of a few warnings too
|
||||
*
|
||||
* Revision 2.10 2005/01/30 09:27:39 Goober5000
|
||||
* nitpicked some boolean tests, and fixed two small bugs
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.9 2004/07/26 20:47:26 Kazan
|
||||
* remove MCD complete
|
||||
*
|
||||
* Revision 2.8 2004/07/12 16:32:44 Kazan
|
||||
* MCD - define _MCD_CHECK to use memory tracking
|
||||
*
|
||||
* Revision 2.7 2004/07/01 01:52:20 phreak
|
||||
* function pointer radar update.
|
||||
* will enable us to make different radar styles that we can switch between
|
||||
*
|
||||
* Revision 2.6 2004/03/31 05:42:26 Goober5000
|
||||
* got rid of all those nasty warnings from xlocale and so forth; also added comments
|
||||
* to indicate which warnings were being disabled
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.5 2004/03/05 09:01:59 Goober5000
|
||||
* Uber pass at reducing #includes
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.4 2003/10/15 22:03:24 Kazan
|
||||
* Da Species Update :D
|
||||
*
|
||||
* Revision 2.3 2003/04/29 01:03:22 Goober5000
|
||||
* implemented the custom hitpoints mod
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.2 2003/03/19 12:29:01 unknownplayer
|
||||
* Woohoo! Killed two birds with one stone!
|
||||
* Fixed the 'black screen around dialog boxes' problem and also the much more serious freezing problem experienced by Goober5000. It wasn't a crash, just an infinite loop. DX8 merge is GO! once again :)
|
||||
*
|
||||
* Revision 2.1 2002/08/01 01:41:04 penguin
|
||||
* The big include file move
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:21 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
* Revision 1.4 2002/05/13 21:43:37 mharris
|
||||
* A little more network and sound cleanup
|
||||
*
|
||||
* Revision 1.3 2002/05/10 20:42:43 mharris
|
||||
* use "ifndef NO_NETWORK" all over the place
|
||||
*
|
||||
* Revision 1.2 2002/05/03 22:07:08 mharris
|
||||
* got some stuff to compile
|
||||
*
|
||||
* Revision 1.1 2002/05/02 18:03:04 mharris
|
||||
* Initial checkin - converted filenames and includes to lower case
|
||||
*
|
||||
*
|
||||
* 16 8/01/99 1:13p Dave
|
||||
* Fixed objsnd problem with hull debris pieces.
|
||||
*
|
||||
* 15 7/01/99 4:23p Dave
|
||||
* Full support for multiple linked ambient engine sounds. Added "big
|
||||
* damage" flag.
|
||||
*
|
||||
* 14 7/01/99 11:44a Dave
|
||||
* Updated object sound system to allow multiple obj sounds per ship.
|
||||
* Added hit-by-beam sound. Added killed by beam sound.
|
||||
*
|
||||
* 13 5/18/99 11:50a Andsager
|
||||
* Remove unused object type OBJ_GHOST_SAVE
|
||||
*
|
||||
* 12 5/14/99 11:50a Andsager
|
||||
* Added vaporize for SMALL ships hit by HUGE beams. Modified dying
|
||||
* frame. Enlarged debris shards and range at which visible.
|
||||
*
|
||||
* 11 4/23/99 12:01p Johnson
|
||||
* Added SIF_HUGE_SHIP
|
||||
*
|
||||
* 10 2/26/99 4:14p Dave
|
||||
* Put in the ability to have multiple shockwaves for ships.
|
||||
*
|
||||
* 9 1/20/99 6:04p Dave
|
||||
* Another bit of stuff for beam weapons. Ships will properly use them
|
||||
* now, although they're really deadly.
|
||||
*
|
||||
* 8 12/03/98 3:14p Andsager
|
||||
* Check in code that checks rotating submodel actually has ship subsystem
|
||||
*
|
||||
* 7 11/19/98 11:07p Andsager
|
||||
* Check in of physics and collision detection of rotating submodels
|
||||
*
|
||||
* 6 11/13/98 10:13a Andsager
|
||||
* simplify collision code
|
||||
*
|
||||
* 5 11/05/98 5:55p Dave
|
||||
* Big pass at reducing #includes
|
||||
*
|
||||
* 4 10/23/98 1:11p Andsager
|
||||
* Make ship sparks emit correctly from rotating structures.
|
||||
*
|
||||
* 3 10/16/98 1:22p Andsager
|
||||
* clean up header files
|
||||
*
|
||||
* 2 10/07/98 10:52a Dave
|
||||
* Initial checkin.
|
||||
*
|
||||
* 1 10/07/98 10:48a Dave
|
||||
*
|
||||
* 119 8/28/98 3:28p Dave
|
||||
* EMP effect done. AI effects may need some tweaking as required.
|
||||
*
|
||||
* 118 5/03/98 5:41p Mike
|
||||
* Add Framecount to nprintf.
|
||||
*
|
||||
* 117 4/15/98 10:00p Allender
|
||||
* make debris have own signature set.
|
||||
*
|
||||
* 116 4/15/98 9:42a Adam
|
||||
* added 2 more explosion types (1, actually, but placeholder for 2)
|
||||
*
|
||||
* 115 4/13/98 4:52p Allender
|
||||
* remove AI_frametime and us flFrametime instead. Make lock warning work
|
||||
* in multiplayer for aspect seeking missiles. Debris fixups
|
||||
*
|
||||
* 114 4/10/98 12:16p Allender
|
||||
* fix ship hit kill and debris packets
|
||||
*
|
||||
* 113 4/09/98 5:43p Allender
|
||||
* multiplayer network object fixes. debris and self destructed ships
|
||||
* should all sync up. Fix problem where debris pieces (hull pieces) were
|
||||
* not getting a net signature
|
||||
*
|
||||
* 112 4/01/98 5:34p John
|
||||
* Made only the used POFs page in for a level. Reduced some interp
|
||||
* arrays. Made custom detail level work differently.
|
||||
*
|
||||
* 111 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.
|
||||
*
|
||||
* 110 3/26/98 5:21p John
|
||||
* Added new code to preload all bitmaps at the start of a level.
|
||||
* Commented it out, though.
|
||||
*
|
||||
* 109 3/23/98 12:20p Andsager
|
||||
* Enable collision from rotation in ship_debris and ship_debris
|
||||
* collisions.
|
||||
*
|
||||
* 108 3/19/98 12:09p John
|
||||
* Fixed a bug using 6 characters. r_heavy was using local coordinates
|
||||
* instead of world so all asteroid-ship and debris-ship hitpos's were in
|
||||
* the wrong spot. Ok, I rearreanged some code to make it clearer also.
|
||||
*
|
||||
*
|
||||
* 107 3/12/98 6:47p John
|
||||
* MAde arcs on debris further than objrad*50 not render.
|
||||
*
|
||||
* 106 3/09/98 2:10p Andsager
|
||||
* Put in checks for debris (other) with excessive velocity.
|
||||
*
|
||||
* 105 2/26/98 10:07p Hoffoss
|
||||
* Rewrote state saving and restoring to fix bugs and simplify the code.
|
||||
*
|
||||
* 104 2/22/98 12:19p John
|
||||
* Externalized some strings
|
||||
*
|
||||
* 103 2/20/98 8:31p Lawrance
|
||||
* Add radius parm to sound_play_3d()
|
||||
*
|
||||
* 102 2/10/98 6:43p Lawrance
|
||||
* Moved asteroid code to a separate lib.
|
||||
*
|
||||
* 101 2/07/98 2:14p Mike
|
||||
* Improve asteroid splitting. Add ship:asteroid collisions. Timestamp
|
||||
* ship:debris collisions.
|
||||
*
|
||||
* 100 2/06/98 7:45p John
|
||||
* Reversed order of asteroid models so blown up ones are smaller.
|
||||
*
|
||||
* 99 2/06/98 7:28p John
|
||||
* Made debris and particles not get created if > 200 m from eye. Added
|
||||
* max_velocity to asteroid's physics info for aiding in throwing out
|
||||
* collision pairs.
|
||||
*
|
||||
* 98 2/06/98 3:08p Mike
|
||||
* More asteroid stuff, including resolving conflicts between the two
|
||||
* asteroid_field structs!
|
||||
*
|
||||
* 97 2/06/98 12:25a Mike
|
||||
* More asteroid stuff.
|
||||
*
|
||||
* 96 2/05/98 9:41p Mike
|
||||
* Asteroid work, intermediate checkin to resolve compile errors.
|
||||
*
|
||||
* 95 2/05/98 9:21p John
|
||||
* Some new Direct3D code. Added code to monitor a ton of stuff in the
|
||||
* game.
|
||||
*
|
||||
* 94 2/05/98 12:51a Mike
|
||||
* Early asteroid stuff.
|
||||
*
|
||||
* 93 2/03/98 6:01p Andsager
|
||||
* Fix excessive rotvel in debris_create. Check using physics function
|
||||
* check_rotvel_limit.
|
||||
*
|
||||
* 92 2/03/98 11:14a Andsager
|
||||
* Temp check in to stop debris being created with excess rotvel
|
||||
*
|
||||
* 91 2/02/98 4:45p Mike
|
||||
* Increase translational and rotational velocity imparted to debris
|
||||
* pieces at request of Adam.
|
||||
*
|
||||
* 90 1/30/98 2:56p John
|
||||
* Made debris arcs jump around. Made only 2/3 of the chunks have arcing
|
||||
*
|
||||
* 89 1/30/98 11:48a John
|
||||
* Made debris arcs cast light. Added sound effects for them.
|
||||
*
|
||||
* 88 1/29/98 5:50p John
|
||||
* Made electrical arcing on debris pieces be persistent from frame to
|
||||
* frame
|
||||
*
|
||||
* 87 1/29/98 8:39a Andsager
|
||||
* Changed mass and moment of intertia based area vs. volume
|
||||
*
|
||||
* 86 1/27/98 11:02a John
|
||||
* Added first rev of sparks. Made all code that calls model_render call
|
||||
* clear_instance first. Made debris pieces not render by default when
|
||||
* clear_instance is called.
|
||||
*
|
||||
* 85 1/24/98 4:49p Lawrance
|
||||
* Only delete hull piece if you can find an old one that isn't already
|
||||
* about to die.
|
||||
*
|
||||
* 84 1/23/98 5:06p John
|
||||
* Took L out of vertex structure used B (blue) instead. Took all small
|
||||
* fireballs out of fireball types and used particles instead. Fixed some
|
||||
* debris explosion things. Restructured fireball code. Restructured
|
||||
* some lighting code. Made dynamic lighting on by default. Made groups
|
||||
* of lasers only cast one light. Made fireballs not cast light.
|
||||
*
|
||||
* $NoKeywords: $
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#include "debris/debris.h"
|
||||
@@ -346,6 +23,7 @@
|
||||
#include "io/timer.h"
|
||||
#include "species_defs/species_defs.h"
|
||||
#include "ship/ship.h"
|
||||
#include "ship/shipfx.h"
|
||||
#include "radar/radarsetup.h"
|
||||
#include "network/multi.h"
|
||||
#include "network/multimsgs.h"
|
||||
@@ -493,14 +171,18 @@ void debris_render(object * obj)
|
||||
|
||||
Assert(db->flags & DEBRIS_USED);
|
||||
|
||||
texture_info *tbase = NULL;
|
||||
|
||||
// Swap in a different texture depending on the species
|
||||
if (db->species >= 0)
|
||||
{
|
||||
pm = model_get( db->model_num );
|
||||
|
||||
if ( pm && (pm->n_textures == 1) ) {
|
||||
swapped = pm->maps[0].base_map.GetTexture();
|
||||
pm->maps[0].base_map.SetTexture(Species_info[db->species].debris_texture.bitmap_id);
|
||||
//WMC - Someday, we should have glowing debris.
|
||||
if ( pm != NULL && (pm->n_textures == 1) ) {
|
||||
tbase = &pm->maps[0].textures[TM_BASE_TYPE];
|
||||
swapped = tbase->GetTexture();
|
||||
tbase->SetTexture(Species_info[db->species].debris_texture.bitmap_id);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -523,8 +205,8 @@ void debris_render(object * obj)
|
||||
submodel_render( db->model_num, db->submodel_num, &obj->orient, &obj->pos, MR_NO_LIGHTING );
|
||||
}
|
||||
|
||||
if ((swapped!=-1) && pm) {
|
||||
pm->maps[0].base_map.SetTexture(swapped);
|
||||
if (tbase != NULL && (swapped!=-1) && pm) {
|
||||
tbase->SetTexture(swapped);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -573,7 +255,7 @@ void maybe_delete_debris(debris *db)
|
||||
{
|
||||
object *objp;
|
||||
|
||||
if (timestamp_elapsed(db->next_distance_check)) {
|
||||
if (timestamp_elapsed(db->next_distance_check) && timestamp_elapsed(db->must_survive_until)) {
|
||||
if (!(Game_mode & GM_MULTIPLAYER)) { // In single player game, just check against player.
|
||||
if (vm_vec_dist_quick(&Player_obj->pos, &Objects[db->objnum].pos) > MAX_DEBRIS_DIST)
|
||||
db->lifeleft = 0.1f;
|
||||
@@ -790,12 +472,15 @@ object *debris_create(object *source_obj, int model_num, int submodel_num, vec3d
|
||||
debris *db;
|
||||
polymodel *pm;
|
||||
int vaporize;
|
||||
physics_info *pi = NULL;
|
||||
ship_info *sip = NULL;
|
||||
|
||||
parent_objnum = OBJ_INDEX(source_obj);
|
||||
|
||||
Assert( (source_obj->type == OBJ_SHIP ) || (source_obj->type == OBJ_GHOST));
|
||||
Assert( source_obj->instance >= 0 && source_obj->instance < MAX_SHIPS );
|
||||
shipp = &Ships[source_obj->instance];
|
||||
sip = &Ship_info[shipp->ship_info_index];
|
||||
vaporize = (shipp->flags &SF_VAPORIZE);
|
||||
|
||||
if ( !hull_flag ) {
|
||||
@@ -835,14 +520,45 @@ object *debris_create(object *source_obj, int model_num, int submodel_num, vec3d
|
||||
|
||||
db = &Debris[n];
|
||||
|
||||
// Create Debris piece n!
|
||||
if ( hull_flag ) {
|
||||
if (rand() < RAND_MAX/6) // Make some pieces blow up shortly after explosion.
|
||||
db->lifeleft = 2.0f * ((float) myrand()/(float) RAND_MAX) + 0.5f;
|
||||
else
|
||||
db->lifeleft = -1.0f; // large hull pieces stay around forever
|
||||
} else {
|
||||
db->lifeleft = (i2fl(myrand())/i2fl(RAND_MAX))*2.0f+0.1f;
|
||||
//WMC - We must survive until now, at least.
|
||||
db->must_survive_until = timestamp();
|
||||
|
||||
if(hull_flag && sip->debris_min_lifetime >= 0.0f && sip->debris_max_lifetime >= 0.0f)
|
||||
{
|
||||
db->lifeleft = (( sip->debris_max_lifetime - sip->debris_min_lifetime ) * frand()) + sip->debris_min_lifetime;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Create Debris piece n!
|
||||
if ( hull_flag ) {
|
||||
if (rand() < RAND_MAX/6) // Make some pieces blow up shortly after explosion.
|
||||
db->lifeleft = 2.0f * ((float) myrand()/(float) RAND_MAX) + 0.5f;
|
||||
else
|
||||
db->lifeleft = -1.0f; // large hull pieces stay around forever
|
||||
} else {
|
||||
db->lifeleft = (i2fl(myrand())/i2fl(RAND_MAX))*2.0f+0.1f;
|
||||
}
|
||||
}
|
||||
|
||||
//WMC - Oh noes, we may need to change lifeleft
|
||||
if(hull_flag)
|
||||
{
|
||||
if(sip->debris_min_lifetime >= 0.0f && sip->debris_max_lifetime >= 0.0f)
|
||||
{
|
||||
db->must_survive_until = timestamp(fl2i(sip->debris_min_lifetime * 1000.0f));
|
||||
db->lifeleft = (( sip->debris_max_lifetime - sip->debris_min_lifetime ) * frand()) + sip->debris_min_lifetime;
|
||||
}
|
||||
else if(sip->debris_min_lifetime >= 0.0f)
|
||||
{
|
||||
db->must_survive_until = timestamp(fl2i(sip->debris_min_lifetime * 1000.0f));
|
||||
if(db->lifeleft < sip->debris_min_lifetime)
|
||||
db->lifeleft = sip->debris_min_lifetime;
|
||||
}
|
||||
else if(sip->debris_max_lifetime >= 0.0f)
|
||||
{
|
||||
if(db->lifeleft > sip->debris_max_lifetime)
|
||||
db->lifeleft = sip->debris_max_lifetime;
|
||||
}
|
||||
}
|
||||
|
||||
// increase lifetime for vaporized debris
|
||||
@@ -860,6 +576,7 @@ object *debris_create(object *source_obj, int model_num, int submodel_num, vec3d
|
||||
db->species = Ship_info[shipp->ship_info_index].species;
|
||||
db->next_distance_check = (myrand() % 2000) + 4*DEBRIS_DISTANCE_CHECK_TIME;
|
||||
db->parent_alt_name = shipp->alt_type_index;
|
||||
db->damage_mult = 1.0f;
|
||||
|
||||
for (i=0; i<MAX_DEBRIS_ARCS; i++ ) {
|
||||
db->arc_timestamp[i] = timestamp(-1);
|
||||
@@ -867,8 +584,8 @@ object *debris_create(object *source_obj, int model_num, int submodel_num, vec3d
|
||||
}
|
||||
|
||||
if ( db->is_hull ) {
|
||||
// Only make 1/2 of the pieces have arcs
|
||||
if ( myrand() < RAND_MAX_2 ) {
|
||||
// Percent of debris pieces with arcs controlled via table (default 50%)
|
||||
if (frand() < sip->debris_arc_percent) {
|
||||
db->arc_frequency = 1000;
|
||||
} else {
|
||||
db->arc_frequency = 0;
|
||||
@@ -907,6 +624,7 @@ object *debris_create(object *source_obj, int model_num, int submodel_num, vec3d
|
||||
db->objnum = objnum;
|
||||
|
||||
obj = &Objects[objnum];
|
||||
pi = &obj->phys_info;
|
||||
|
||||
// assign the network signature. The signature will be 0 for non-hull pieces, but since that
|
||||
// is our invalid signature, it should be okay.
|
||||
@@ -923,6 +641,24 @@ object *debris_create(object *source_obj, int model_num, int submodel_num, vec3d
|
||||
} else
|
||||
obj->hull_strength = 10.0f;
|
||||
|
||||
if (hull_flag) {
|
||||
if(sip->debris_min_hitpoints >= 0.0f && sip->debris_max_hitpoints >= 0.0f)
|
||||
{
|
||||
obj->hull_strength = (( sip->debris_max_hitpoints - sip->debris_min_hitpoints ) * frand()) + sip->debris_min_hitpoints;
|
||||
}
|
||||
else if(sip->debris_min_hitpoints >= 0.0f)
|
||||
{
|
||||
if(obj->hull_strength < sip->debris_min_hitpoints)
|
||||
obj->hull_strength = sip->debris_min_hitpoints;
|
||||
}
|
||||
else if(sip->debris_max_hitpoints >= 0.0f)
|
||||
{
|
||||
if(obj->hull_strength > sip->debris_max_hitpoints)
|
||||
obj->hull_strength = sip->debris_max_hitpoints;
|
||||
}
|
||||
db->damage_mult = sip->debris_damage_mult;
|
||||
}
|
||||
|
||||
Num_debris_pieces++;
|
||||
|
||||
vec3d rotvel, radial_vel, to_center;
|
||||
@@ -988,44 +724,6 @@ object *debris_create(object *source_obj, int model_num, int submodel_num, vec3d
|
||||
vm_vec_add (&obj->phys_info.vel, &radial_vel, &source_obj->phys_info.vel);
|
||||
vm_vec_add2(&obj->phys_info.vel, &vel_from_rotvel);
|
||||
|
||||
#ifdef DEBRIS_SPEED_DEBUG
|
||||
// check that debris is not created with too high a velocity
|
||||
if (hull_flag)
|
||||
{
|
||||
int ship_type = Ship_info[Ships[source_obj->instance].ship_info_index].class_type;
|
||||
if(ship_type > -1)
|
||||
{
|
||||
if(vm_vec_mag_squared(&obj->phys_info.vel) > Ship_types[ship_type].debris_max_speed) {
|
||||
float scale = Ship_types[ship_type].debris_max_speed / vm_vec_mag(&obj->phys_info.vel);
|
||||
vm_vec_scale(&obj->phys_info.vel, scale);
|
||||
}
|
||||
}
|
||||
/*
|
||||
if (ship_info_flag & (SIF_SMALL_SHIP | SIF_NOT_FLYABLE | SIF_HARMLESS))
|
||||
{
|
||||
if (vm_vec_mag_squared(&obj->phys_info.vel) > MAX_SPEED_SMALL_DEBRIS*MAX_SPEED_SMALL_DEBRIS) {
|
||||
float scale = MAX_SPEED_SMALL_DEBRIS / vm_vec_mag(&obj->phys_info.vel);
|
||||
vm_vec_scale(&obj->phys_info.vel, scale);
|
||||
}
|
||||
} else if (ship_info_flag & SIF_BIG_SHIP) {
|
||||
if (vm_vec_mag_squared(&obj->phys_info.vel) > MAX_SPEED_BIG_DEBRIS*MAX_SPEED_BIG_DEBRIS) {
|
||||
float scale = MAX_SPEED_BIG_DEBRIS / vm_vec_mag(&obj->phys_info.vel);
|
||||
vm_vec_scale(&obj->phys_info.vel, scale);
|
||||
}
|
||||
} else if (ship_info_flag & SIF_HUGE_SHIP) {
|
||||
if (vm_vec_mag_squared(&obj->phys_info.vel) > MAX_SPEED_CAPITAL_DEBRIS*MAX_SPEED_CAPITAL_DEBRIS) {
|
||||
float scale = MAX_SPEED_CAPITAL_DEBRIS / vm_vec_mag(&obj->phys_info.vel);
|
||||
vm_vec_scale(&obj->phys_info.vel, scale);
|
||||
}
|
||||
*/
|
||||
}
|
||||
else
|
||||
{
|
||||
Warning(LOCATION, "Ship does not have a type!");
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
// vm_vec_scale_add(&obj->phys_info.vel, &radial_vel, &source_obj->phys_info.vel, frand()/2.0f + 0.5f);
|
||||
// nprintf(("Andsager","object vel from rotvel: %0.2f, %0.2f, %0.2f\n",vel_from_rotvel.x, vel_from_rotvel.y, vel_from_rotvel.z));
|
||||
|
||||
@@ -1039,26 +737,31 @@ object *debris_create(object *source_obj, int model_num, int submodel_num, vec3d
|
||||
vm_vec_rand_vec_quick(&rotvel);
|
||||
vm_vec_scale(&rotvel, scale);
|
||||
|
||||
obj->phys_info.flags |= PF_DEAD_DAMP;
|
||||
obj->phys_info.rotvel = rotvel;
|
||||
pi->flags |= PF_DEAD_DAMP;
|
||||
pi->rotvel = rotvel;
|
||||
check_rotvel_limit( &obj->phys_info );
|
||||
|
||||
// check that debris is not created with too high a velocity
|
||||
if (hull_flag)
|
||||
{
|
||||
shipfx_debris_limit_speed(db, shipp);
|
||||
}
|
||||
|
||||
// blow out his reverse thrusters. Or drag, same thing.
|
||||
obj->phys_info.rotdamp = 10000.0f;
|
||||
obj->phys_info.side_slip_time_const = 10000.0f;
|
||||
obj->phys_info.flags |= (PF_REDUCED_DAMP | PF_DEAD_DAMP); // set damping equal for all axis and not changable
|
||||
pi->rotdamp = 10000.0f;
|
||||
pi->side_slip_time_const = 10000.0f;
|
||||
pi->flags |= (PF_REDUCED_DAMP | PF_DEAD_DAMP); // set damping equal for all axis and not changable
|
||||
|
||||
vm_vec_zero(&obj->phys_info.max_vel); // make so he can't turn on his own VOLITION anymore.
|
||||
vm_vec_zero(&obj->phys_info.max_rotvel); // make so he can't change speed on his own VOLITION anymore.
|
||||
vm_vec_zero(&pi->max_vel); // make so he can't turn on his own VOLITION anymore.
|
||||
vm_vec_zero(&pi->max_rotvel); // make so he can't change speed on his own VOLITION anymore.
|
||||
|
||||
|
||||
// ensure vel is valid
|
||||
Assert( !vm_is_vec_nan(&obj->phys_info.vel) );
|
||||
|
||||
// if ( hull_flag ) {
|
||||
// vm_vec_zero(&obj->phys_info.vel);
|
||||
// vm_vec_zero(&obj->phys_info.rotvel);
|
||||
// vm_vec_zero(&pi->vel);
|
||||
// vm_vec_zero(&pi->rotvel);
|
||||
// }
|
||||
|
||||
return obj;
|
||||
|
||||
+3
-146
@@ -7,152 +7,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Debris/Debris.h $
|
||||
* $Revision: 2.5 $
|
||||
* $Date: 2005-07-13 02:50:51 $
|
||||
* $Author: Goober5000 $
|
||||
*
|
||||
* Code for the pieces of exploding object debris.
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.4 2005/04/28 05:29:29 wmcoolmon
|
||||
* Removed FS2_DEMO defines that looked like they wouldn't cause the universe to collapse
|
||||
*
|
||||
* Revision 2.3 2005/04/05 05:53:15 taylor
|
||||
* s/vector/vec3d/g, better support for different compilers (Jens Granseuer)
|
||||
*
|
||||
* Revision 2.2 2004/08/11 05:06:20 Kazan
|
||||
* added preprocdefines.h to prevent what happened with fred -- make sure to make all fred2 headers include this file as the _first_ include -- i have already modified fs2 files to do this
|
||||
*
|
||||
* Revision 2.1 2004/03/05 09:01:59 Goober5000
|
||||
* Uber pass at reducing #includes
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:21 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
* Revision 1.1 2002/05/02 18:03:04 mharris
|
||||
* Initial checkin - converted filenames and includes to lower case
|
||||
*
|
||||
*
|
||||
* 6 7/15/99 9:20a Andsager
|
||||
* FS2_DEMO initial checkin
|
||||
*
|
||||
* 5 7/01/99 11:44a Dave
|
||||
* Updated object sound system to allow multiple obj sounds per ship.
|
||||
* Added hit-by-beam sound. Added killed by beam sound.
|
||||
*
|
||||
* 4 11/05/98 5:55p Dave
|
||||
* Big pass at reducing #includes
|
||||
*
|
||||
* 3 10/16/98 1:22p Andsager
|
||||
* clean up header files
|
||||
*
|
||||
* 2 10/07/98 10:52a Dave
|
||||
* Initial checkin.
|
||||
*
|
||||
* 1 10/07/98 10:48a Dave
|
||||
*
|
||||
* 29 4/02/98 6:30p Lawrance
|
||||
* reduce max debris piece if DEMO defined
|
||||
*
|
||||
* 28 4/02/98 11:40a Lawrance
|
||||
* check for #ifdef DEMO instead of #ifdef DEMO_RELEASE
|
||||
*
|
||||
* 27 2/26/98 10:07p Hoffoss
|
||||
* Rewrote state saving and restoring to fix bugs and simplify the code.
|
||||
*
|
||||
* 26 2/19/98 12:46a Lawrance
|
||||
* Further work on asteroids.
|
||||
*
|
||||
* 25 2/10/98 6:43p Lawrance
|
||||
* Moved asteroid code to a separate lib.
|
||||
*
|
||||
* 24 2/06/98 3:08p Mike
|
||||
* More asteroid stuff, including resolving conflicts between the two
|
||||
* asteroid_field structs!
|
||||
*
|
||||
* 23 2/05/98 12:51a Mike
|
||||
* Early asteroid stuff.
|
||||
*
|
||||
* 22 1/29/98 5:50p John
|
||||
* Made electrical arcing on debris pieces be persistent from frame to
|
||||
* frame
|
||||
*
|
||||
* 21 1/21/98 7:18p Lawrance
|
||||
* Fix bug with creating debris before the mission starts.
|
||||
*
|
||||
* 20 12/22/97 9:56p Andsager
|
||||
* Implement ship:debris collisions. Generalize and move
|
||||
* ship_ship_or_debris_hit struct from CollideShipShip to ObjCollide.h
|
||||
*
|
||||
* 19 11/19/97 5:57p Mike
|
||||
* Make debris go away if more than N units away from the nearest player.
|
||||
* Make speed of a docked object not read zero if it's moving.
|
||||
*
|
||||
* 18 10/01/97 10:52a Mike
|
||||
* Change debris prototype to take an additional parameter to give debris
|
||||
* more thrust when it is created.
|
||||
*
|
||||
* 17 9/20/97 9:25a John
|
||||
* fixed bug with species specific debris shards.
|
||||
*
|
||||
* 16 8/13/97 9:50p Allender
|
||||
* split *_move into *_process_pre and *_process_post functions.
|
||||
* process_pre functions called before object is moved. _process_post
|
||||
* functions called after object is moved. Reordered code in ship_post
|
||||
* and weapon_post for multiplayer
|
||||
*
|
||||
* 15 7/24/97 8:35a Allender
|
||||
* allow ships to blow up before missions starts. Made some debris system
|
||||
* items available in other modules
|
||||
*
|
||||
* 14 7/13/97 5:53p Lawrance
|
||||
* save model name in debris
|
||||
*
|
||||
* 13 7/02/97 11:48a Lawrance
|
||||
* update debris to delay persistant sound
|
||||
*
|
||||
* 12 6/06/97 4:13p Lawrance
|
||||
* leave debris chunks from very large ships persistant, scale fireball
|
||||
* lifetime by ship radius
|
||||
*
|
||||
* 11 6/06/97 12:12p Lawrance
|
||||
* limit hull debris pieces, destroying oldest debris to make way for new
|
||||
* debris.
|
||||
*
|
||||
* 10 5/14/97 4:08p Lawrance
|
||||
* removing my_index from game arrays
|
||||
*
|
||||
* 9 4/03/97 12:23a Mike
|
||||
* Make debris collidable-with. Can hit it, too.
|
||||
* Make AI ships stop firing when target enters death roll.
|
||||
*
|
||||
* 8 3/31/97 11:11a John
|
||||
* added ship species specific debris.
|
||||
*
|
||||
* 7 3/25/97 3:55p Lawrance
|
||||
* allowing debris to be targeted and shown on radar
|
||||
*
|
||||
* 6 2/27/97 12:07p John
|
||||
* Added code to suppord debris chunks after a ship is exploded..
|
||||
*
|
||||
* 5 2/26/97 2:18p Lawrance
|
||||
* adding Debris[] to save/restore
|
||||
*
|
||||
* 4 2/10/97 12:38p John
|
||||
* made all ships blow up into debris pieces when exploded.
|
||||
*
|
||||
* 3 2/07/97 10:45a John
|
||||
* Initial bare bones implementation of blowing off turrets.
|
||||
*
|
||||
* 2 2/07/97 9:30a John
|
||||
*
|
||||
* 1 2/06/97 4:13p John
|
||||
*
|
||||
* $NoKeywords: $
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _DEBRIS_H
|
||||
#define _DEBRIS_H
|
||||
@@ -173,6 +28,7 @@ typedef struct debris {
|
||||
int team; // Team of the ship where the debris came from
|
||||
int objnum; // What object this is linked to
|
||||
float lifeleft; // When 0 or less object dies
|
||||
int must_survive_until; //WMC - timestamp of earliest point that it can be murthered.
|
||||
int model_num; // What model this uses
|
||||
int submodel_num; // What submodel this uses
|
||||
int next_fireball; // When to start a fireball
|
||||
@@ -187,6 +43,7 @@ typedef struct debris {
|
||||
int arc_timestamp[MAX_DEBRIS_ARCS]; // When this times out, the spark goes away. -1 is not used
|
||||
int arc_frequency; // Starts at 0, gets bigger
|
||||
char parent_alt_name;
|
||||
float damage_mult;
|
||||
|
||||
} debris;
|
||||
|
||||
|
||||
+14
-131
@@ -7,124 +7,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/DebugConsole/Console.cpp $
|
||||
* $Revision: 2.6.2.2 $
|
||||
* $Date: 2007-02-18 21:26:52 $
|
||||
* $Author: Goober5000 $
|
||||
*
|
||||
* Routines for managing the debug console window.
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.6.2.1 2006/09/08 06:14:43 taylor
|
||||
* fix things that strict compiling balked at (from compiling with -ansi and -pedantic)
|
||||
*
|
||||
* Revision 2.6 2005/04/25 00:07:22 wmcoolmon
|
||||
* Bumped console printing buffer size so people can play with the neb2 command
|
||||
*
|
||||
* Revision 2.5 2004/07/26 20:47:27 Kazan
|
||||
* remove MCD complete
|
||||
*
|
||||
* Revision 2.4 2004/07/12 16:32:44 Kazan
|
||||
* MCD - define _MCD_CHECK to use memory tracking
|
||||
*
|
||||
* Revision 2.3 2004/03/05 09:01:58 Goober5000
|
||||
* Uber pass at reducing #includes
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.2 2003/03/18 10:07:01 unknownplayer
|
||||
* The big DX/main line merge. This has been uploaded to the main CVS since I can't manage to get it to upload to the DX branch. Apologies to all who may be affected adversely, but I'll work to debug it as fast as I can.
|
||||
*
|
||||
* Revision 2.1.2.1 2002/09/24 18:56:41 randomtiger
|
||||
* DX8 branch commit
|
||||
*
|
||||
* This is the scub of UP's previous code with the more up to date RT code.
|
||||
* For full details check previous dev e-mails
|
||||
*
|
||||
* Revision 2.1 2002/08/01 01:41:04 penguin
|
||||
* The big include file move
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:21 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
* Revision 1.1 2002/05/02 18:03:04 mharris
|
||||
* Initial checkin - converted filenames and includes to lower case
|
||||
*
|
||||
*
|
||||
* 4 6/04/99 10:35a Dave
|
||||
*
|
||||
* 3 10/13/98 9:28a Dave
|
||||
* Started neatening up freespace.h. Many variables renamed and
|
||||
* reorganized. Added AlphaColors.[h,cpp]
|
||||
*
|
||||
* 2 10/07/98 10:52a Dave
|
||||
* Initial checkin.
|
||||
*
|
||||
* 1 10/07/98 10:48a Dave
|
||||
*
|
||||
* 17 2/05/98 11:43a Allender
|
||||
* enhcanced network statistic collection. Made callback in debug console
|
||||
* to do networking if player is in the console
|
||||
*
|
||||
* 16 1/22/98 6:42p John
|
||||
* Move game_flush out of debug console into freespace. Made object
|
||||
* pair code throw out some weapons that turn. Added stats for how many
|
||||
* object pair are actually checked.
|
||||
*
|
||||
* 15 1/16/98 11:56a Allender
|
||||
* ability to scroll back in debug console, and call game_flush() when
|
||||
* leaving
|
||||
*
|
||||
* 14 1/10/98 1:14p John
|
||||
* Added explanation to debug console commands
|
||||
*
|
||||
* 13 12/21/97 4:39p John
|
||||
* fixed bug in name compare
|
||||
*
|
||||
* 12 12/21/97 4:33p John
|
||||
* Made debug console functions a class that registers itself
|
||||
* automatically, so you don't need to add the function to
|
||||
* debugfunctions.cpp.
|
||||
*
|
||||
* 11 9/13/97 9:31a Lawrance
|
||||
* if playing a demo, clear key filter then reset it once done with debug
|
||||
* console
|
||||
*
|
||||
* 10 9/09/97 3:39p Sandeep
|
||||
* warning level 4 bugs
|
||||
*
|
||||
* 9 6/13/97 3:50p John
|
||||
* sped up debug console printf
|
||||
*
|
||||
* 8 6/13/97 3:27p John
|
||||
* made debug console pretty
|
||||
*
|
||||
* 7 6/09/97 9:24a John
|
||||
* Changed the way fonts are set.
|
||||
*
|
||||
* 6 5/29/97 3:09p John
|
||||
* Took out debug menu.
|
||||
* Made software scaler draw larger bitmaps.
|
||||
* Optimized Direct3D some.
|
||||
*
|
||||
* 5 5/13/97 4:07p John
|
||||
* made numbers also be marked as strings.
|
||||
*
|
||||
* 4 4/28/97 5:24p John
|
||||
* made so : and \ don't get parsed out in debug console.
|
||||
*
|
||||
* 3 4/24/97 11:49a John
|
||||
* added new lighting commands to console.
|
||||
*
|
||||
* 2 4/24/97 10:36a John
|
||||
* moved the debug console stuff into it's own lib... made it compile with
|
||||
* Fred.
|
||||
*
|
||||
* 1 4/24/97 10:16a John
|
||||
* Initial rev
|
||||
*
|
||||
* $NoKeywords: $
|
||||
*/
|
||||
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
@@ -286,7 +169,7 @@ void scanner_downshift_word()
|
||||
int offset = 'a' - 'A';
|
||||
char * tp;
|
||||
|
||||
strcpy( scanner_word_string, scanner_token_string );
|
||||
strcpy_s( scanner_word_string, scanner_token_string );
|
||||
|
||||
tp = scanner_word_string;
|
||||
do {
|
||||
@@ -606,7 +489,7 @@ void debug_output( char c )
|
||||
if ( debug_y >= DROWS ) {
|
||||
int i;
|
||||
for (i=1; i<DROWS; i++ )
|
||||
strcpy( debug_text[i-1], debug_text[i] );
|
||||
strcpy_s( debug_text[i-1], debug_text[i] );
|
||||
debug_y = DROWS-1;
|
||||
debug_x = 0;
|
||||
debug_text[debug_y][debug_x] = 0;
|
||||
@@ -628,7 +511,7 @@ void debug_output( char c )
|
||||
if ( debug_y >= DROWS ) {
|
||||
int i;
|
||||
for (i=1; i<DROWS; i++ )
|
||||
strcpy( debug_text[i-1], debug_text[i] );
|
||||
strcpy_s( debug_text[i-1], debug_text[i] );
|
||||
debug_y = DROWS-1;
|
||||
debug_x = 0;
|
||||
debug_text[debug_y][debug_x] = 0;
|
||||
@@ -711,7 +594,7 @@ void debug_console( void (*_func)() )
|
||||
|
||||
case KEY_F3:
|
||||
if ( last_oldcommand > -1 ) {
|
||||
strcpy( command_line, oldcommand_line[last_oldcommand] );
|
||||
strcpy_s( command_line, oldcommand_line[last_oldcommand] );
|
||||
command_line_pos = strlen(command_line);
|
||||
command_line[command_line_pos] = 0;
|
||||
}
|
||||
@@ -723,7 +606,7 @@ void debug_console( void (*_func)() )
|
||||
command_scroll = last_oldcommand;
|
||||
|
||||
if ( command_scroll > -1 ) {
|
||||
strcpy( command_line, oldcommand_line[command_scroll] );
|
||||
strcpy_s( command_line, oldcommand_line[command_scroll] );
|
||||
command_line_pos = strlen(command_line);
|
||||
command_line[command_line_pos] = 0;
|
||||
}
|
||||
@@ -736,7 +619,7 @@ void debug_console( void (*_func)() )
|
||||
if (command_scroll>last_oldcommand)
|
||||
command_scroll = -1;
|
||||
if ( command_scroll > -1 ) {
|
||||
strcpy( command_line, oldcommand_line[command_scroll] );
|
||||
strcpy_s( command_line, oldcommand_line[command_scroll] );
|
||||
command_line_pos = strlen(command_line);
|
||||
command_line[command_line_pos] = 0;
|
||||
}
|
||||
@@ -757,13 +640,13 @@ void debug_console( void (*_func)() )
|
||||
if ( !found ) {
|
||||
if ( last_oldcommand < DEBUG_HISTORY-1 ) {
|
||||
last_oldcommand++;
|
||||
strcpy( oldcommand_line[last_oldcommand], command_line);
|
||||
strcpy_s( oldcommand_line[last_oldcommand], command_line);
|
||||
} else {
|
||||
int i;
|
||||
for (i=0; i<last_oldcommand; i++ ) {
|
||||
strcpy( oldcommand_line[i], oldcommand_line[i+1] );
|
||||
int iLoop;
|
||||
for (iLoop=0; iLoop<last_oldcommand; iLoop++ ) {
|
||||
strcpy_s( oldcommand_line[iLoop], oldcommand_line[iLoop+1] );
|
||||
}
|
||||
strcpy( oldcommand_line[last_oldcommand], command_line);
|
||||
strcpy_s( oldcommand_line[last_oldcommand], command_line);
|
||||
}
|
||||
}
|
||||
// int i;
|
||||
@@ -788,8 +671,8 @@ void debug_console( void (*_func)() )
|
||||
}
|
||||
}
|
||||
|
||||
strcpy( debug_text[debug_y], ">" );
|
||||
strcat( debug_text[debug_y], command_line );
|
||||
strcpy_s( debug_text[debug_y], ">" );
|
||||
strcat_s( debug_text[debug_y], command_line );
|
||||
debug_draw();
|
||||
|
||||
if ( _func ){
|
||||
|
||||
@@ -59,23 +59,23 @@ void dbugfile_init()
|
||||
path[path_len + 1] = '\0';
|
||||
}
|
||||
|
||||
strcpy(dbugfile_filename, path);
|
||||
strcpy_s(dbugfile_filename, path);
|
||||
|
||||
#endif
|
||||
|
||||
strcat(dbugfile_filename, "DBUG-");
|
||||
strcpy(big_buffer, "DBUGFILE Active: ");
|
||||
strcat_s(dbugfile_filename, "DBUG-");
|
||||
strcpy_s(big_buffer, "DBUGFILE Active: ");
|
||||
|
||||
#ifdef _WIN32
|
||||
{
|
||||
unsigned long len = 512;
|
||||
GetUserName(temp_buff, &len);
|
||||
|
||||
strcat(dbugfile_filename, temp_buff);
|
||||
strcat(big_buffer, temp_buff);
|
||||
strcat_s(dbugfile_filename, temp_buff);
|
||||
strcat_s(big_buffer, temp_buff);
|
||||
|
||||
strcat(dbugfile_filename, "-");
|
||||
strcat(big_buffer, " ");
|
||||
strcat_s(dbugfile_filename, "-");
|
||||
strcat_s(big_buffer, " ");
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -83,19 +83,19 @@ void dbugfile_init()
|
||||
|
||||
// Display operating system-style date and time.
|
||||
_strdate( temp_buff);
|
||||
strcat(dbugfile_filename, "D(");
|
||||
strcat(dbugfile_filename,temp_buff);
|
||||
strcat(big_buffer,temp_buff);
|
||||
strcat_s(dbugfile_filename, "D(");
|
||||
strcat_s(dbugfile_filename,temp_buff);
|
||||
strcat_s(big_buffer,temp_buff);
|
||||
|
||||
strcat(dbugfile_filename, ") T(");
|
||||
strcat(big_buffer, " ");
|
||||
strcat_s(dbugfile_filename, ") T(");
|
||||
strcat_s(big_buffer, " ");
|
||||
|
||||
_strtime( temp_buff);
|
||||
strcat(dbugfile_filename,temp_buff);
|
||||
strcat(big_buffer,temp_buff);
|
||||
strcat_s(dbugfile_filename,temp_buff);
|
||||
strcat_s(big_buffer,temp_buff);
|
||||
|
||||
strcat(dbugfile_filename, ").txt");
|
||||
strcat(big_buffer, "\n");
|
||||
strcat_s(dbugfile_filename, ").txt");
|
||||
strcat_s(big_buffer, "\n");
|
||||
|
||||
// Remove invalid slash chars
|
||||
int len = strlen(dbugfile_filename);
|
||||
@@ -178,7 +178,7 @@ void dbugfile_init()
|
||||
char exe_name[MAX_PATH];
|
||||
|
||||
GetModuleFileName(NULL, exe_name, MAX_PATH);
|
||||
strcat(exe_name, "\n");
|
||||
strcat_s(exe_name, "\n");
|
||||
fwrite(exe_name, sizeof(char) * strlen(exe_name), 1, fp);
|
||||
|
||||
|
||||
@@ -396,8 +396,8 @@ void dbugfile_print_matrix_3x3(int line, char *file, float *matrix, char *text)
|
||||
void dbugfile_print_counter(int line, char *file, int counter_num, char *string)
|
||||
{
|
||||
char buffer[1000];
|
||||
strcpy(buffer, string);
|
||||
strcat(buffer, " %d");
|
||||
strcpy_s(buffer, string);
|
||||
strcat_s(buffer, " %d");
|
||||
|
||||
dbugfile_sprintf(line, file, buffer, dbugfile_counters[counter_num]);
|
||||
}
|
||||
|
||||
@@ -6,56 +6,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/debugconsole/timerbar.h $
|
||||
* $Revision: 1.11 $
|
||||
* $Date: 2006-04-20 06:32:00 $
|
||||
* $Author: Goober5000 $
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 1.10 2005/07/13 02:50:50 Goober5000
|
||||
* remove PreProcDefine #includes in FS2
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 1.9 2004/08/11 05:06:20 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.8 2004/02/16 11:47:31 randomtiger
|
||||
* Removed a lot of files that we dont need anymore.
|
||||
* Changed htl to be on by default, command now -nohtl
|
||||
* Changed D3D to use a 2D vertex for 2D operations which should cut down on redundant data having to go though the system.
|
||||
* Added small change to all -start_mission flag to take you to any mission by filename, very useful for testing.
|
||||
* Removed old dshow code and took away timerbar compile flag condition since it uses a runtime flag now.
|
||||
*
|
||||
* Revision 1.7 2003/11/19 20:37:23 randomtiger
|
||||
* 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.
|
||||
*
|
||||
* Revision 1.6 2003/11/09 06:31:39 Kazan
|
||||
* 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
|
||||
*
|
||||
* Revision 1.5 2003/11/09 04:09:17 Goober5000
|
||||
* edited for language
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 1.4 2003/11/08 22:25:47 Kazan
|
||||
* Timerbar was enabled in both release and debug - so i made it a command line option "-timerbar"
|
||||
* DONT MESS WITH OTHER PEOPLES INCLUDE PATHS
|
||||
* DONT MESS WITH EXEC NAMES (leave it fs2_open_r and fs2_open_d) or paths!
|
||||
*
|
||||
*
|
||||
* $NoKeywords: $
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _TIMERBAR_HEADER_
|
||||
#define _TIMERBAR_HEADER_
|
||||
|
||||
+3
-64
@@ -7,68 +7,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Demo/Demo.cpp $
|
||||
* $Revision: 2.8.2.1 $
|
||||
* $Date: 2007-09-02 18:52:50 $
|
||||
* $Author: Goober5000 $
|
||||
*
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.8 2005/05/12 17:49:11 taylor
|
||||
* use vm_malloc(), vm_free(), vm_realloc(), vm_strdup() rather than system named macros
|
||||
* fixes various problems and is past time to make the switch
|
||||
*
|
||||
* Revision 2.7 2005/04/05 05:53:15 taylor
|
||||
* s/vector/vec3d/g, better support for different compilers (Jens Granseuer)
|
||||
*
|
||||
* Revision 2.6 2005/01/31 23:27:52 taylor
|
||||
* merge with Linux/OSX tree - p0131-2
|
||||
*
|
||||
* Revision 2.5 2004/07/26 20:47:27 Kazan
|
||||
* remove MCD complete
|
||||
*
|
||||
* Revision 2.4 2004/07/12 16:32:45 Kazan
|
||||
* MCD - define _MCD_CHECK to use memory tracking
|
||||
*
|
||||
* Revision 2.3 2004/03/05 09:01:59 Goober5000
|
||||
* Uber pass at reducing #includes
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.2 2002/08/01 01:41:04 penguin
|
||||
* The big include file move
|
||||
*
|
||||
* Revision 2.1 2002/07/07 19:55:58 penguin
|
||||
* Back-port to MSVC
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:21 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
* Revision 1.1 2002/05/02 18:03:04 mharris
|
||||
* Initial checkin - converted filenames and includes to lower case
|
||||
*
|
||||
*
|
||||
* 6 8/26/99 8:51p Dave
|
||||
* Gave multiplayer TvT messaging a heavy dose of sanity. Cheat codes.
|
||||
*
|
||||
* 5 6/16/99 10:20a Dave
|
||||
* Added send-message-list sexpression.
|
||||
*
|
||||
* 4 4/16/99 5:54p Dave
|
||||
* Support for on/off style "stream" weapons. Real early support for
|
||||
* target-painting lasers.
|
||||
*
|
||||
* 3 3/29/99 6:17p Dave
|
||||
* More work on demo system. Got just about everything in except for
|
||||
* blowing ships up, secondary weapons and player death/warpout.
|
||||
*
|
||||
* 2 3/28/99 5:58p Dave
|
||||
* Added early demo code. Make objects move. Nice and framerate
|
||||
* independant, but not much else. Don't use yet unless you're me :)
|
||||
*
|
||||
*
|
||||
* $NoKeywords: $
|
||||
*/
|
||||
|
||||
|
||||
#include "demo/demo.h"
|
||||
#include "ship/ship.h"
|
||||
@@ -315,7 +254,7 @@ int demo_start_record(char *file)
|
||||
}
|
||||
|
||||
// open the outfile
|
||||
strcpy(full_name, file);
|
||||
strcpy_s(full_name, file);
|
||||
cf_add_ext(full_name, ".fsd");
|
||||
Demo_file = cfopen(full_name, "wb", CFILE_NORMAL, CF_TYPE_DEMOS);
|
||||
if(Demo_file == NULL){
|
||||
@@ -359,7 +298,7 @@ int demo_start_playback(char *file)
|
||||
}
|
||||
|
||||
// open the outfile
|
||||
strcpy(full_name, file);
|
||||
strcpy_s(full_name, file);
|
||||
cf_add_ext(full_name, ".fsd");
|
||||
Demo_file = cfopen(full_name, "rb", CFILE_NORMAL, CF_TYPE_DEMOS);
|
||||
if(Demo_file == NULL){
|
||||
|
||||
+1
-29
@@ -7,35 +7,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Demo/Demo.h $
|
||||
* $Revision: 2.2 $
|
||||
* $Date: 2005-07-13 02:50:51 $
|
||||
* $Author: Goober5000 $
|
||||
*
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.1 2004/08/11 05:06:21 Kazan
|
||||
* added preprocdefines.h to prevent what happened with fred -- make sure to make all fred2 headers include this file as the _first_ include -- i have already modified fs2 files to do this
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:21 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
* Revision 1.1 2002/05/02 18:03:04 mharris
|
||||
* Initial checkin - converted filenames and includes to lower case
|
||||
*
|
||||
*
|
||||
* 3 3/29/99 6:17p Dave
|
||||
* More work on demo system. Got just about everything in except for
|
||||
* blowing ships up, secondary weapons and player death/warpout.
|
||||
*
|
||||
* 2 3/28/99 5:58p Dave
|
||||
* Added early demo code. Make objects move. Nice and framerate
|
||||
* independant, but not much else. Don't use yet unless you're me :)
|
||||
*
|
||||
*
|
||||
* $NoKeywords: $
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#ifndef _FS2_DEMO_SYSTEM_HEADER_FILE
|
||||
|
||||
@@ -1,350 +0,0 @@
|
||||
#include <windows.h>
|
||||
#include <dshow.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "osapi/osapi.h"
|
||||
#include "directx/dx8show.h"
|
||||
#include "debugconsole/dbugfile.h"
|
||||
#include "graphics/2d.h"
|
||||
|
||||
#include <commctrl.h>
|
||||
#include <commdlg.h>
|
||||
#include <tchar.h>
|
||||
//#include <atlbase.h> // No dependecy on ATL!!!
|
||||
|
||||
|
||||
|
||||
enum PLAYSTATE {Stopped, Paused, Running, Init};
|
||||
void Msg(TCHAR *szFormat, ...);
|
||||
|
||||
// Local
|
||||
//HRESULT InitPlayerWindow(HWND ghApp);
|
||||
HRESULT InitVideoWindow(HWND ghApp, long w, long h);
|
||||
//bool HandleGraphEvent(void);
|
||||
void CheckVisibility(void);
|
||||
void CloseInterfaces(void);
|
||||
|
||||
//
|
||||
// Constants
|
||||
//
|
||||
#define VOLUME_FULL 0L
|
||||
#define VOLUME_SILENCE -10000L
|
||||
|
||||
#define WM_GRAPHNOTIFY WM_USER
|
||||
|
||||
char error_buffer[512];
|
||||
char *ParseDShowError(HRESULT hr)
|
||||
{
|
||||
#ifndef NDEBUG
|
||||
AMGetErrorText(hr, error_buffer, 512);
|
||||
return error_buffer;
|
||||
#else
|
||||
return "DShow error";
|
||||
#endif
|
||||
}
|
||||
|
||||
//
|
||||
// Macros
|
||||
//
|
||||
#define SAFE_RELEASE(x) { if (x) x->Release(); x = NULL; }
|
||||
|
||||
#define JIF(x) if (FAILED(hr=(x))) \
|
||||
{Msg(TEXT("FAILED(hr=0x%x) in ") TEXT(#x) " (%s) " TEXT("\n"), hr, ParseDShowError(hr)); return hr;}
|
||||
|
||||
#define LIF(x) if (FAILED(hr=(x))) \
|
||||
{Msg(TEXT("FAILED(hr=0x%x) in ") TEXT(#x) TEXT("\n"), hr);}
|
||||
|
||||
//
|
||||
// Global data
|
||||
//
|
||||
BOOL g_bAudioOnly=FALSE;
|
||||
LONG g_lVolume=VOLUME_FULL;
|
||||
//DWORD g_dwGraphRegister=0;
|
||||
PLAYSTATE g_psCurrent=Stopped;
|
||||
|
||||
// DirectShow interfaces
|
||||
IGraphBuilder *pGB = NULL;
|
||||
IMediaControl *pMC = NULL;
|
||||
IMediaEventEx *pME = NULL;
|
||||
IVideoWindow *pVW = NULL;
|
||||
IBasicAudio *pBA = NULL;
|
||||
IBasicVideo *pBV = NULL;
|
||||
IMediaSeeking *pMS = NULL;
|
||||
IMediaPosition *pMP = NULL;
|
||||
|
||||
/*
|
||||
void PassMsgToVideoWindow(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
if (pVW)
|
||||
pVW->NotifyOwnerMessage((long) hWnd, message, wParam, lParam);
|
||||
}
|
||||
|
||||
void SetCurrentState(PLAYSTATE state)
|
||||
{
|
||||
g_psCurrent = state;
|
||||
}
|
||||
|
||||
PLAYSTATE GetCurrentState()
|
||||
{
|
||||
return g_psCurrent;
|
||||
}
|
||||
|
||||
BOOL IsAudioOnly()
|
||||
{
|
||||
return g_bAudioOnly;
|
||||
}
|
||||
*/
|
||||
|
||||
HRESULT PlayMovieInWindow(HWND ghApp, LPTSTR szFile)
|
||||
{
|
||||
// USES_CONVERSION;
|
||||
WCHAR wFile[MAX_PATH];
|
||||
HRESULT hr;
|
||||
|
||||
// Clear open dialog remnants before calling RenderFile()
|
||||
UpdateWindow(ghApp);
|
||||
|
||||
// Convert filename to wide character string
|
||||
// wcscpy(wFile, T2W(szFile)); // requires ATL
|
||||
swprintf(wFile, L"%S", szFile); // Uses libc to convert instead
|
||||
|
||||
// Get the interface for DirectShow's GraphBuilder
|
||||
JIF(CoCreateInstance(CLSID_FilterGraph, NULL, CLSCTX_INPROC_SERVER,
|
||||
IID_IGraphBuilder, (void **)&pGB));
|
||||
|
||||
if(SUCCEEDED(hr))
|
||||
{
|
||||
HRESULT load_attempt = pGB->RenderFile(wFile, NULL);
|
||||
|
||||
// f%#$ing DivX6...
|
||||
// SetForegroundWindow(ghApp);
|
||||
|
||||
// Have the graph builder construct its the appropriate graph automatically
|
||||
if(FAILED(load_attempt))
|
||||
{
|
||||
return load_attempt;
|
||||
}
|
||||
|
||||
// QueryInterface for DirectShow interfaces
|
||||
JIF(pGB->QueryInterface(IID_IMediaControl, (void **)&pMC));
|
||||
JIF(pGB->QueryInterface(IID_IMediaEventEx, (void **)&pME));
|
||||
JIF(pGB->QueryInterface(IID_IMediaSeeking, (void **)&pMS));
|
||||
JIF(pGB->QueryInterface(IID_IMediaPosition, (void **)&pMP));
|
||||
|
||||
// Query for video interfaces, which may not be relevant for audio files
|
||||
JIF(pGB->QueryInterface(IID_IVideoWindow, (void **)&pVW));
|
||||
JIF(pGB->QueryInterface(IID_IBasicVideo, (void **)&pBV));
|
||||
|
||||
// Query for audio interfaces, which may not be relevant for video-only files
|
||||
JIF(pGB->QueryInterface(IID_IBasicAudio, (void **)&pBA));
|
||||
|
||||
// Is this an audio-only file (no video component)?
|
||||
CheckVisibility();
|
||||
|
||||
// Have the graph signal event via window callbacks for performance
|
||||
JIF(pME->SetNotifyWindow((OAHWND)ghApp, WM_GRAPHNOTIFY, 0));
|
||||
|
||||
long width, height;
|
||||
pBV->get_VideoWidth(&width);
|
||||
pBV->get_VideoHeight(&height);
|
||||
|
||||
// JIF(InitVideoWindow(ghApp,width, height));
|
||||
|
||||
if (!g_bAudioOnly)
|
||||
{
|
||||
JIF(pVW->put_Owner((OAHWND)ghApp));
|
||||
JIF(pVW->put_WindowStyle(WS_CHILD | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_VISIBLE));
|
||||
JIF(InitVideoWindow(ghApp, width, height));
|
||||
JIF(pVW->SetWindowForeground(OATRUE));
|
||||
JIF(pVW->put_MessageDrain((OAHWND)ghApp));
|
||||
}
|
||||
|
||||
// Run the graph to play the media file
|
||||
JIF(pMC->Run());
|
||||
g_psCurrent=Running;
|
||||
}
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
||||
extern int Cmdline_window;
|
||||
extern int Cmdline_noscalevid;
|
||||
HRESULT InitVideoWindow(HWND ghApp, long video_w, long video_h)
|
||||
{
|
||||
HRESULT hr = S_OK;
|
||||
RECT rect;
|
||||
|
||||
GetClientRect(ghApp, &rect);
|
||||
|
||||
int screen_w = rect.right;
|
||||
int screen_h = rect.bottom;
|
||||
|
||||
int video_rescale_w;
|
||||
int video_rescale_h;
|
||||
|
||||
if (Cmdline_noscalevid && (video_w < screen_w) && (video_h < screen_h)) {
|
||||
video_rescale_w = video_w;
|
||||
video_rescale_h = video_h;
|
||||
} else {
|
||||
video_rescale_w = (video_w * screen_w) / video_w;
|
||||
video_rescale_h = (video_rescale_w * video_h) / video_w;
|
||||
}
|
||||
|
||||
int extra_w = (screen_w - video_rescale_w) / 2;
|
||||
int extra_h = (screen_h - video_rescale_h) / 2;
|
||||
|
||||
if (Cmdline_window)
|
||||
{
|
||||
rect.right += GetSystemMetrics(SM_CXFIXEDFRAME) * 2;
|
||||
rect.bottom += 2 * GetSystemMetrics(SM_CYFIXEDFRAME) + GetSystemMetrics(SM_CYCAPTION);
|
||||
}
|
||||
|
||||
if(SetWindowPos(ghApp, 0, 0, 0, rect.right, rect.bottom, SWP_NOMOVE | SWP_NOOWNERZORDER) == FALSE) {
|
||||
|
||||
MessageBox(ghApp,"Failed SetWindowPos","Error", MB_OK);
|
||||
}
|
||||
|
||||
JIF(pVW->SetWindowPosition(extra_w, extra_h, video_rescale_w, video_rescale_h));
|
||||
return hr;
|
||||
}
|
||||
|
||||
void CheckVisibility(void)
|
||||
{
|
||||
long lVisible;
|
||||
HRESULT hr;
|
||||
|
||||
if ((!pVW) || (!pBV))
|
||||
{
|
||||
// Audio-only files have no video interfaces. This might also
|
||||
// be a file whose video component uses an unknown video codec.
|
||||
g_bAudioOnly = TRUE;
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Clear the global flag
|
||||
g_bAudioOnly = FALSE;
|
||||
}
|
||||
|
||||
hr = pVW->get_Visible(&lVisible);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
|
||||
// If this is an audio-only clip, get_Visible() won't work.
|
||||
//
|
||||
// Also, if this video is encoded with an unsupported codec,
|
||||
// we won't see any video, although the audio will work if it is
|
||||
// of a supported format.
|
||||
//
|
||||
if (hr == E_NOINTERFACE)
|
||||
{
|
||||
g_bAudioOnly = TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
Msg(TEXT("Failed(%08lx) in pVW->get_Visible()!\r\n"), hr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool OpenClip(HWND ghApp, char *g_szFileName)
|
||||
{
|
||||
// Reset status variables
|
||||
g_psCurrent = Stopped;
|
||||
g_lVolume = VOLUME_FULL;
|
||||
|
||||
// Start playing the media file
|
||||
HRESULT hr = PlayMovieInWindow(ghApp, g_szFileName);
|
||||
|
||||
// If we couldn't play the clip, clean up
|
||||
if (FAILED(hr)) {
|
||||
CloseClip(ghApp);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void CloseClip(HWND ghApp)
|
||||
{
|
||||
HRESULT hr;
|
||||
|
||||
// Stop media playback
|
||||
if(pMC)
|
||||
hr = pMC->Stop();
|
||||
|
||||
// Clear global flags
|
||||
g_psCurrent = Stopped;
|
||||
g_bAudioOnly = TRUE;
|
||||
|
||||
// Free DirectShow interfaces
|
||||
CloseInterfaces();
|
||||
|
||||
// No current media state
|
||||
g_psCurrent = Init;
|
||||
}
|
||||
|
||||
|
||||
void CloseInterfaces(void)
|
||||
{
|
||||
// Relinquish ownership (IMPORTANT!) after hiding video window
|
||||
if (pVW) {
|
||||
pVW->put_Visible(OAFALSE);
|
||||
pVW->put_Owner(NULL);
|
||||
}
|
||||
|
||||
// Disable event callbacks
|
||||
if (pME)
|
||||
pME->SetNotifyWindow((OAHWND)NULL, 0, 0);
|
||||
|
||||
// Release and zero DirectShow interfaces
|
||||
SAFE_RELEASE(pME);
|
||||
SAFE_RELEASE(pMS);
|
||||
SAFE_RELEASE(pMP);
|
||||
SAFE_RELEASE(pMC);
|
||||
SAFE_RELEASE(pBA);
|
||||
SAFE_RELEASE(pBV);
|
||||
SAFE_RELEASE(pVW);
|
||||
SAFE_RELEASE(pGB);
|
||||
}
|
||||
|
||||
void Msg(TCHAR *szFormat, ...)
|
||||
{
|
||||
TCHAR szBuffer[512]; // Large buffer for very long filenames (like HTTP)
|
||||
|
||||
// Format the input string
|
||||
va_list pArgs;
|
||||
va_start(pArgs, szFormat);
|
||||
_vstprintf(szBuffer, szFormat, pArgs);
|
||||
va_end(pArgs);
|
||||
|
||||
// Display a message box with the formatted string
|
||||
MessageBox(NULL, szBuffer, TEXT("PlayWnd Sample"), MB_OK);
|
||||
}
|
||||
|
||||
// returns true when finished
|
||||
bool dx8show_stream_movie(void)
|
||||
{
|
||||
LONG evCode, evParam1, evParam2;
|
||||
HRESULT hr=S_OK;
|
||||
|
||||
// Make sure that we don't access the media event interface
|
||||
// after it has already been released.
|
||||
if (!pME) {
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
// Process all queued events
|
||||
while(SUCCEEDED(pME->GetEvent(&evCode, &evParam1,&evParam2, 0))) {
|
||||
// Free memory associated with callback, since we're not using it
|
||||
hr = pME->FreeEventParams(evCode, evParam1, evParam2);
|
||||
|
||||
// If this is the end of the clip, reset to beginning
|
||||
if(EC_COMPLETE == evCode)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
|
||||
#ifndef _DX8SHOW_HEADER_FILE
|
||||
#define _DX8SHOW_HEADER_FILE
|
||||
|
||||
bool OpenClip(HWND ghApp, char *g_szFileName);
|
||||
void CloseClip(HWND ghApp);
|
||||
bool dx8show_stream_movie(void);
|
||||
void PassMsgToVideoWindow(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,864 +0,0 @@
|
||||
/*==========================================================================;
|
||||
*
|
||||
* Copyright (C) 1995,1996 Microsoft Corporation. All Rights Reserved.
|
||||
*
|
||||
* File: dsound.h
|
||||
* Content: DirectSound include file
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
|
||||
#ifndef __DSOUND_INCLUDED__
|
||||
#define __DSOUND_INCLUDED__
|
||||
|
||||
#include "directx/vd3dtypes.h"
|
||||
|
||||
#define COM_NO_WINDOWS_H
|
||||
#include <objbase.h>
|
||||
|
||||
#define _FACDS 0x878
|
||||
#define MAKE_DSHRESULT(code) MAKE_HRESULT(1, _FACDS, code)
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif // __cplusplus
|
||||
|
||||
// Direct Sound Component GUID {47D4D946-62E8-11cf-93BC-444553540000}
|
||||
DEFINE_GUID(CLSID_DirectSound, 0x47d4d946, 0x62e8, 0x11cf, 0x93, 0xbc, 0x44, 0x45, 0x53, 0x54, 0x0, 0x0);
|
||||
|
||||
// DirectSound Capture Component GUID {B0210780-89CD-11d0-AF08-00A0C925CD16}
|
||||
DEFINE_GUID(CLSID_DirectSoundCapture, 0xb0210780, 0x89cd, 0x11d0, 0xaf, 0x8, 0x0, 0xa0, 0xc9, 0x25, 0xcd, 0x16);
|
||||
|
||||
//
|
||||
// Structures
|
||||
//
|
||||
|
||||
#ifdef __cplusplus
|
||||
// 'struct' not 'class' per the way DECLARE_INTERFACE_ is defined
|
||||
struct IDirectSound;
|
||||
struct IDirectSoundBuffer;
|
||||
struct IDirectSound3DListener;
|
||||
struct IDirectSound3DBuffer;
|
||||
struct IDirectSoundCapture;
|
||||
struct IDirectSoundCaptureBuffer;
|
||||
struct IDirectSoundNotify;
|
||||
#endif // __cplusplus
|
||||
|
||||
typedef struct IDirectSound *LPDIRECTSOUND;
|
||||
typedef struct IDirectSoundBuffer *LPDIRECTSOUNDBUFFER;
|
||||
typedef struct IDirectSound3DListener *LPDIRECTSOUND3DLISTENER;
|
||||
typedef struct IDirectSound3DBuffer *LPDIRECTSOUND3DBUFFER;
|
||||
typedef struct IDirectSoundCapture *LPDIRECTSOUNDCAPTURE;
|
||||
typedef struct IDirectSoundCaptureBuffer *LPDIRECTSOUNDCAPTUREBUFFER;
|
||||
typedef struct IDirectSoundNotify *LPDIRECTSOUNDNOTIFY;
|
||||
|
||||
typedef struct _DSCAPS
|
||||
{
|
||||
DWORD dwSize;
|
||||
DWORD dwFlags;
|
||||
DWORD dwMinSecondarySampleRate;
|
||||
DWORD dwMaxSecondarySampleRate;
|
||||
DWORD dwPrimaryBuffers;
|
||||
DWORD dwMaxHwMixingAllBuffers;
|
||||
DWORD dwMaxHwMixingStaticBuffers;
|
||||
DWORD dwMaxHwMixingStreamingBuffers;
|
||||
DWORD dwFreeHwMixingAllBuffers;
|
||||
DWORD dwFreeHwMixingStaticBuffers;
|
||||
DWORD dwFreeHwMixingStreamingBuffers;
|
||||
DWORD dwMaxHw3DAllBuffers;
|
||||
DWORD dwMaxHw3DStaticBuffers;
|
||||
DWORD dwMaxHw3DStreamingBuffers;
|
||||
DWORD dwFreeHw3DAllBuffers;
|
||||
DWORD dwFreeHw3DStaticBuffers;
|
||||
DWORD dwFreeHw3DStreamingBuffers;
|
||||
DWORD dwTotalHwMemBytes;
|
||||
DWORD dwFreeHwMemBytes;
|
||||
DWORD dwMaxContigFreeHwMemBytes;
|
||||
DWORD dwUnlockTransferRateHwBuffers;
|
||||
DWORD dwPlayCpuOverheadSwBuffers;
|
||||
DWORD dwReserved1;
|
||||
DWORD dwReserved2;
|
||||
} DSCAPS, *LPDSCAPS;
|
||||
|
||||
typedef const DSCAPS *LPCDSCAPS;
|
||||
|
||||
typedef struct _DSBCAPS
|
||||
{
|
||||
DWORD dwSize;
|
||||
DWORD dwFlags;
|
||||
DWORD dwBufferBytes;
|
||||
DWORD dwUnlockTransferRate;
|
||||
DWORD dwPlayCpuOverhead;
|
||||
} DSBCAPS, *LPDSBCAPS;
|
||||
|
||||
typedef const DSBCAPS *LPCDSBCAPS;
|
||||
|
||||
typedef struct _DSBUFFERDESC
|
||||
{
|
||||
DWORD dwSize;
|
||||
DWORD dwFlags;
|
||||
DWORD dwBufferBytes;
|
||||
DWORD dwReserved;
|
||||
LPWAVEFORMATEX lpwfxFormat;
|
||||
} DSBUFFERDESC, *LPDSBUFFERDESC;
|
||||
|
||||
typedef const DSBUFFERDESC *LPCDSBUFFERDESC;
|
||||
|
||||
typedef struct _DS3DBUFFER
|
||||
{
|
||||
DWORD dwSize;
|
||||
D3DVECTOR vPosition;
|
||||
D3DVECTOR vVelocity;
|
||||
DWORD dwInsideConeAngle;
|
||||
DWORD dwOutsideConeAngle;
|
||||
D3DVECTOR vConeOrientation;
|
||||
LONG lConeOutsideVolume;
|
||||
D3DVALUE flMinDistance;
|
||||
D3DVALUE flMaxDistance;
|
||||
DWORD dwMode;
|
||||
} DS3DBUFFER, *LPDS3DBUFFER;
|
||||
|
||||
typedef const DS3DBUFFER *LPCDS3DBUFFER;
|
||||
|
||||
typedef struct _DS3DLISTENER
|
||||
{
|
||||
DWORD dwSize;
|
||||
D3DVECTOR vPosition;
|
||||
D3DVECTOR vVelocity;
|
||||
D3DVECTOR vOrientFront;
|
||||
D3DVECTOR vOrientTop;
|
||||
D3DVALUE flDistanceFactor;
|
||||
D3DVALUE flRolloffFactor;
|
||||
D3DVALUE flDopplerFactor;
|
||||
} DS3DLISTENER, *LPDS3DLISTENER;
|
||||
|
||||
typedef const DS3DLISTENER *LPCDS3DLISTENER;
|
||||
|
||||
typedef struct _DSCCAPS
|
||||
{
|
||||
DWORD dwSize;
|
||||
DWORD dwFlags;
|
||||
DWORD dwFormats;
|
||||
DWORD dwChannels;
|
||||
} DSCCAPS, *LPDSCCAPS;
|
||||
|
||||
typedef const DSCCAPS *LPCDSCCAPS;
|
||||
|
||||
typedef struct _DSCBUFFERDESC
|
||||
{
|
||||
DWORD dwSize;
|
||||
DWORD dwFlags;
|
||||
DWORD dwBufferBytes;
|
||||
DWORD dwReserved;
|
||||
LPWAVEFORMATEX lpwfxFormat;
|
||||
} DSCBUFFERDESC, *LPDSCBUFFERDESC;
|
||||
|
||||
typedef const DSCBUFFERDESC *LPCDSCBUFFERDESC;
|
||||
|
||||
typedef struct _DSCBCAPS
|
||||
{
|
||||
DWORD dwSize;
|
||||
DWORD dwFlags;
|
||||
DWORD dwBufferBytes;
|
||||
DWORD dwReserved;
|
||||
} DSCBCAPS, *LPDSCBCAPS;
|
||||
|
||||
typedef const DSCBCAPS *LPCDSCBCAPS;
|
||||
|
||||
typedef struct _DSBPOSITIONNOTIFY
|
||||
{
|
||||
DWORD dwOffset;
|
||||
HANDLE hEventNotify;
|
||||
} DSBPOSITIONNOTIFY, *LPDSBPOSITIONNOTIFY;
|
||||
|
||||
typedef const DSBPOSITIONNOTIFY *LPCDSBPOSITIONNOTIFY;
|
||||
|
||||
//
|
||||
// Compatibility typedefs
|
||||
//
|
||||
|
||||
typedef LPDIRECTSOUND *LPLPDIRECTSOUND;
|
||||
typedef LPDIRECTSOUNDBUFFER *LPLPDIRECTSOUNDBUFFER;
|
||||
typedef LPDIRECTSOUND3DLISTENER *LPLPDIRECTSOUND3DLISTENER;
|
||||
typedef LPDIRECTSOUND3DBUFFER *LPLPDIRECTSOUND3DBUFFER;
|
||||
typedef LPDIRECTSOUNDCAPTURE *LPLPDIRECTSOUNDCAPTURE;
|
||||
typedef LPDIRECTSOUNDCAPTUREBUFFER *LPLPDIRECTSOUNDCAPTUREBUFFER;
|
||||
typedef LPDIRECTSOUNDNOTIFY *LPLPDIRECTSOUNDNOTIFY;
|
||||
typedef LPVOID *LPLPVOID;
|
||||
typedef const WAVEFORMATEX *LPCWAVEFORMATEX;
|
||||
|
||||
//
|
||||
// DirectSound API
|
||||
//
|
||||
|
||||
typedef BOOL (CALLBACK *LPDSENUMCALLBACKW)(LPGUID, LPCWSTR, LPCWSTR, LPVOID);
|
||||
typedef BOOL (CALLBACK *LPDSENUMCALLBACKA)(LPGUID, LPCSTR, LPCSTR, LPVOID);
|
||||
|
||||
extern HRESULT WINAPI DirectSoundCreate(LPGUID, LPDIRECTSOUND *, LPUNKNOWN);
|
||||
extern HRESULT WINAPI DirectSoundEnumerateW(LPDSENUMCALLBACKW, LPVOID);
|
||||
extern HRESULT WINAPI DirectSoundEnumerateA(LPDSENUMCALLBACKA, LPVOID);
|
||||
|
||||
extern HRESULT WINAPI DirectSoundCaptureCreate(LPGUID, LPDIRECTSOUNDCAPTURE *, LPUNKNOWN);
|
||||
extern HRESULT WINAPI DirectSoundCaptureEnumerateW(LPDSENUMCALLBACKW, LPVOID);
|
||||
extern HRESULT WINAPI DirectSoundCaptureEnumerateA(LPDSENUMCALLBACKA, LPVOID);
|
||||
|
||||
#ifdef UNICODE
|
||||
#define LPDSENUMCALLBACK LPDSENUMCALLBACKW
|
||||
#define DirectSoundEnumerate DirectSoundEnumerateW
|
||||
#define DirectSoundCaptureEnumerate DirectSoundCaptureEnumerateW
|
||||
#else // UNICODE
|
||||
#define LPDSENUMCALLBACK LPDSENUMCALLBACKA
|
||||
#define DirectSoundEnumerate DirectSoundEnumerateA
|
||||
#define DirectSoundCaptureEnumerate DirectSoundCaptureEnumerateA
|
||||
#endif // UNICODE
|
||||
|
||||
//
|
||||
// IDirectSound
|
||||
//
|
||||
|
||||
DEFINE_GUID(IID_IDirectSound, 0x279AFA83, 0x4981, 0x11CE, 0xA5, 0x21, 0x00, 0x20, 0xAF, 0x0B, 0xE5, 0x60);
|
||||
|
||||
#undef INTERFACE
|
||||
#define INTERFACE IDirectSound
|
||||
|
||||
DECLARE_INTERFACE_(IDirectSound, IUnknown)
|
||||
{
|
||||
// IUnknown methods
|
||||
STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID FAR *) PURE;
|
||||
STDMETHOD_(ULONG,AddRef) (THIS) PURE;
|
||||
STDMETHOD_(ULONG,Release) (THIS) PURE;
|
||||
|
||||
// IDirectSound methods
|
||||
STDMETHOD(CreateSoundBuffer) (THIS_ LPCDSBUFFERDESC, LPDIRECTSOUNDBUFFER *, LPUNKNOWN) PURE;
|
||||
STDMETHOD(GetCaps) (THIS_ LPDSCAPS) PURE;
|
||||
STDMETHOD(DuplicateSoundBuffer) (THIS_ LPDIRECTSOUNDBUFFER, LPDIRECTSOUNDBUFFER *) PURE;
|
||||
STDMETHOD(SetCooperativeLevel) (THIS_ HWND, DWORD) PURE;
|
||||
STDMETHOD(Compact) (THIS) PURE;
|
||||
STDMETHOD(GetSpeakerConfig) (THIS_ LPDWORD) PURE;
|
||||
STDMETHOD(SetSpeakerConfig) (THIS_ DWORD) PURE;
|
||||
STDMETHOD(Initialize) (THIS_ LPGUID) PURE;
|
||||
};
|
||||
|
||||
#if !defined(__cplusplus) || defined(CINTERFACE)
|
||||
#define IDirectSound_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
|
||||
#define IDirectSound_AddRef(p) (p)->lpVtbl->AddRef(p)
|
||||
#define IDirectSound_Release(p) (p)->lpVtbl->Release(p)
|
||||
#define IDirectSound_CreateSoundBuffer(p,a,b,c) (p)->lpVtbl->CreateSoundBuffer(p,a,b,c)
|
||||
#define IDirectSound_GetCaps(p,a) (p)->lpVtbl->GetCaps(p,a)
|
||||
#define IDirectSound_DuplicateSoundBuffer(p,a,b) (p)->lpVtbl->DuplicateSoundBuffer(p,a,b)
|
||||
#define IDirectSound_SetCooperativeLevel(p,a,b) (p)->lpVtbl->SetCooperativeLevel(p,a,b)
|
||||
#define IDirectSound_Compact(p) (p)->lpVtbl->Compact(p)
|
||||
#define IDirectSound_GetSpeakerConfig(p,a) (p)->lpVtbl->GetSpeakerConfig(p,a)
|
||||
#define IDirectSound_SetSpeakerConfig(p,b) (p)->lpVtbl->SetSpeakerConfig(p,b)
|
||||
#define IDirectSound_Initialize(p,a) (p)->lpVtbl->Initialize(p,a)
|
||||
#else // !defined(__cplusplus) || defined(CINTERFACE)
|
||||
#define IDirectSound_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
|
||||
#define IDirectSound_AddRef(p) (p)->AddRef()
|
||||
#define IDirectSound_Release(p) (p)->Release()
|
||||
#define IDirectSound_CreateSoundBuffer(p,a,b,c) (p)->CreateSoundBuffer(a,b,c)
|
||||
#define IDirectSound_GetCaps(p,a) (p)->GetCaps(a)
|
||||
#define IDirectSound_DuplicateSoundBuffer(p,a,b) (p)->DuplicateSoundBuffer(a,b)
|
||||
#define IDirectSound_SetCooperativeLevel(p,a,b) (p)->SetCooperativeLevel(a,b)
|
||||
#define IDirectSound_Compact(p) (p)->Compact()
|
||||
#define IDirectSound_GetSpeakerConfig(p,a) (p)->GetSpeakerConfig(a)
|
||||
#define IDirectSound_SetSpeakerConfig(p,b) (p)->SetSpeakerConfig(b)
|
||||
#define IDirectSound_Initialize(p,a) (p)->Initialize(a)
|
||||
#endif // !defined(__cplusplus) || defined(CINTERFACE)
|
||||
|
||||
//
|
||||
// IDirectSoundBuffer
|
||||
//
|
||||
|
||||
DEFINE_GUID(IID_IDirectSoundBuffer, 0x279AFA85, 0x4981, 0x11CE, 0xA5, 0x21, 0x00, 0x20, 0xAF, 0x0B, 0xE5, 0x60);
|
||||
|
||||
#undef INTERFACE
|
||||
#define INTERFACE IDirectSoundBuffer
|
||||
|
||||
DECLARE_INTERFACE_(IDirectSoundBuffer, IUnknown)
|
||||
{
|
||||
// IUnknown methods
|
||||
STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID FAR *) PURE;
|
||||
STDMETHOD_(ULONG,AddRef) (THIS) PURE;
|
||||
STDMETHOD_(ULONG,Release) (THIS) PURE;
|
||||
|
||||
// IDirectSoundBuffer methods
|
||||
STDMETHOD(GetCaps) (THIS_ LPDSBCAPS) PURE;
|
||||
STDMETHOD(GetCurrentPosition) (THIS_ LPDWORD, LPDWORD) PURE;
|
||||
STDMETHOD(GetFormat) (THIS_ LPWAVEFORMATEX, DWORD, LPDWORD) PURE;
|
||||
STDMETHOD(GetVolume) (THIS_ LPLONG) PURE;
|
||||
STDMETHOD(GetPan) (THIS_ LPLONG) PURE;
|
||||
STDMETHOD(GetFrequency) (THIS_ LPDWORD) PURE;
|
||||
STDMETHOD(GetStatus) (THIS_ LPDWORD) PURE;
|
||||
STDMETHOD(Initialize) (THIS_ LPDIRECTSOUND, LPCDSBUFFERDESC) PURE;
|
||||
STDMETHOD(Lock) (THIS_ DWORD, DWORD, LPVOID *, LPDWORD, LPVOID *, LPDWORD, DWORD) PURE;
|
||||
STDMETHOD(Play) (THIS_ DWORD, DWORD, DWORD) PURE;
|
||||
STDMETHOD(SetCurrentPosition) (THIS_ DWORD) PURE;
|
||||
STDMETHOD(SetFormat) (THIS_ LPCWAVEFORMATEX) PURE;
|
||||
STDMETHOD(SetVolume) (THIS_ LONG) PURE;
|
||||
STDMETHOD(SetPan) (THIS_ LONG) PURE;
|
||||
STDMETHOD(SetFrequency) (THIS_ DWORD) PURE;
|
||||
STDMETHOD(Stop) (THIS) PURE;
|
||||
STDMETHOD(Unlock) (THIS_ LPVOID, DWORD, LPVOID, DWORD) PURE;
|
||||
STDMETHOD(Restore) (THIS) PURE;
|
||||
};
|
||||
|
||||
#if !defined(__cplusplus) || defined(CINTERFACE)
|
||||
#define IDirectSoundBuffer_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
|
||||
#define IDirectSoundBuffer_AddRef(p) (p)->lpVtbl->AddRef(p)
|
||||
#define IDirectSoundBuffer_Release(p) (p)->lpVtbl->Release(p)
|
||||
#define IDirectSoundBuffer_GetCaps(p,a) (p)->lpVtbl->GetCaps(p,a)
|
||||
#define IDirectSoundBuffer_GetCurrentPosition(p,a,b) (p)->lpVtbl->GetCurrentPosition(p,a,b)
|
||||
#define IDirectSoundBuffer_GetFormat(p,a,b,c) (p)->lpVtbl->GetFormat(p,a,b,c)
|
||||
#define IDirectSoundBuffer_GetVolume(p,a) (p)->lpVtbl->GetVolume(p,a)
|
||||
#define IDirectSoundBuffer_GetPan(p,a) (p)->lpVtbl->GetPan(p,a)
|
||||
#define IDirectSoundBuffer_GetFrequency(p,a) (p)->lpVtbl->GetFrequency(p,a)
|
||||
#define IDirectSoundBuffer_GetStatus(p,a) (p)->lpVtbl->GetStatus(p,a)
|
||||
#define IDirectSoundBuffer_Initialize(p,a,b) (p)->lpVtbl->Initialize(p,a,b)
|
||||
#define IDirectSoundBuffer_Lock(p,a,b,c,d,e,f,g) (p)->lpVtbl->Lock(p,a,b,c,d,e,f,g)
|
||||
#define IDirectSoundBuffer_Play(p,a,b,c) (p)->lpVtbl->Play(p,a,b,c)
|
||||
#define IDirectSoundBuffer_SetCurrentPosition(p,a) (p)->lpVtbl->SetCurrentPosition(p,a)
|
||||
#define IDirectSoundBuffer_SetFormat(p,a) (p)->lpVtbl->SetFormat(p,a)
|
||||
#define IDirectSoundBuffer_SetVolume(p,a) (p)->lpVtbl->SetVolume(p,a)
|
||||
#define IDirectSoundBuffer_SetPan(p,a) (p)->lpVtbl->SetPan(p,a)
|
||||
#define IDirectSoundBuffer_SetFrequency(p,a) (p)->lpVtbl->SetFrequency(p,a)
|
||||
#define IDirectSoundBuffer_Stop(p) (p)->lpVtbl->Stop(p)
|
||||
#define IDirectSoundBuffer_Unlock(p,a,b,c,d) (p)->lpVtbl->Unlock(p,a,b,c,d)
|
||||
#define IDirectSoundBuffer_Restore(p) (p)->lpVtbl->Restore(p)
|
||||
#else // !defined(__cplusplus) || defined(CINTERFACE)
|
||||
#define IDirectSoundBuffer_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
|
||||
#define IDirectSoundBuffer_AddRef(p) (p)->AddRef()
|
||||
#define IDirectSoundBuffer_Release(p) (p)->Release()
|
||||
#define IDirectSoundBuffer_GetCaps(p,a) (p)->GetCaps(a)
|
||||
#define IDirectSoundBuffer_GetCurrentPosition(p,a,b) (p)->GetCurrentPosition(a,b)
|
||||
#define IDirectSoundBuffer_GetFormat(p,a,b,c) (p)->GetFormat(a,b,c)
|
||||
#define IDirectSoundBuffer_GetVolume(p,a) (p)->GetVolume(a)
|
||||
#define IDirectSoundBuffer_GetPan(p,a) (p)->GetPan(a)
|
||||
#define IDirectSoundBuffer_GetFrequency(p,a) (p)->GetFrequency(a)
|
||||
#define IDirectSoundBuffer_GetStatus(p,a) (p)->GetStatus(a)
|
||||
#define IDirectSoundBuffer_Initialize(p,a,b) (p)->Initialize(a,b)
|
||||
#define IDirectSoundBuffer_Lock(p,a,b,c,d,e,f,g) (p)->Lock(a,b,c,d,e,f,g)
|
||||
#define IDirectSoundBuffer_Play(p,a,b,c) (p)->Play(a,b,c)
|
||||
#define IDirectSoundBuffer_SetCurrentPosition(p,a) (p)->SetCurrentPosition(a)
|
||||
#define IDirectSoundBuffer_SetFormat(p,a) (p)->SetFormat(a)
|
||||
#define IDirectSoundBuffer_SetVolume(p,a) (p)->SetVolume(a)
|
||||
#define IDirectSoundBuffer_SetPan(p,a) (p)->SetPan(a)
|
||||
#define IDirectSoundBuffer_SetFrequency(p,a) (p)->SetFrequency(a)
|
||||
#define IDirectSoundBuffer_Stop(p) (p)->Stop()
|
||||
#define IDirectSoundBuffer_Unlock(p,a,b,c,d) (p)->Unlock(a,b,c,d)
|
||||
#define IDirectSoundBuffer_Restore(p) (p)->Restore()
|
||||
#endif // !defined(__cplusplus) || defined(CINTERFACE)
|
||||
|
||||
//
|
||||
// IDirectSound3DListener
|
||||
//
|
||||
|
||||
DEFINE_GUID(IID_IDirectSound3DListener, 0x279AFA84, 0x4981, 0x11CE, 0xA5, 0x21, 0x00, 0x20, 0xAF, 0x0B, 0xE5, 0x60);
|
||||
|
||||
#undef INTERFACE
|
||||
#define INTERFACE IDirectSound3DListener
|
||||
|
||||
DECLARE_INTERFACE_(IDirectSound3DListener, IUnknown)
|
||||
{
|
||||
// IUnknown methods
|
||||
STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID FAR *) PURE;
|
||||
STDMETHOD_(ULONG,AddRef) (THIS) PURE;
|
||||
STDMETHOD_(ULONG,Release) (THIS) PURE;
|
||||
|
||||
// IDirectSound3D methods
|
||||
STDMETHOD(GetAllParameters) (THIS_ LPDS3DLISTENER) PURE;
|
||||
STDMETHOD(GetDistanceFactor) (THIS_ LPD3DVALUE) PURE;
|
||||
STDMETHOD(GetDopplerFactor) (THIS_ LPD3DVALUE) PURE;
|
||||
STDMETHOD(GetOrientation) (THIS_ LPD3DVECTOR, LPD3DVECTOR) PURE;
|
||||
STDMETHOD(GetPosition) (THIS_ LPD3DVECTOR) PURE;
|
||||
STDMETHOD(GetRolloffFactor) (THIS_ LPD3DVALUE) PURE;
|
||||
STDMETHOD(GetVelocity) (THIS_ LPD3DVECTOR) PURE;
|
||||
STDMETHOD(SetAllParameters) (THIS_ LPCDS3DLISTENER, DWORD) PURE;
|
||||
STDMETHOD(SetDistanceFactor) (THIS_ D3DVALUE, DWORD) PURE;
|
||||
STDMETHOD(SetDopplerFactor) (THIS_ D3DVALUE, DWORD) PURE;
|
||||
STDMETHOD(SetOrientation) (THIS_ D3DVALUE, D3DVALUE, D3DVALUE, D3DVALUE, D3DVALUE, D3DVALUE, DWORD) PURE;
|
||||
STDMETHOD(SetPosition) (THIS_ D3DVALUE, D3DVALUE, D3DVALUE, DWORD) PURE;
|
||||
STDMETHOD(SetRolloffFactor) (THIS_ D3DVALUE, DWORD) PURE;
|
||||
STDMETHOD(SetVelocity) (THIS_ D3DVALUE, D3DVALUE, D3DVALUE, DWORD) PURE;
|
||||
STDMETHOD(CommitDeferredSettings) (THIS) PURE;
|
||||
};
|
||||
|
||||
#if !defined(__cplusplus) || defined(CINTERFACE)
|
||||
#define IDirectSound3DListener_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
|
||||
#define IDirectSound3DListener_AddRef(p) (p)->lpVtbl->AddRef(p)
|
||||
#define IDirectSound3DListener_Release(p) (p)->lpVtbl->Release(p)
|
||||
#define IDirectSound3DListener_GetAllParameters(p,a) (p)->lpVtbl->GetAllParameters(p,a)
|
||||
#define IDirectSound3DListener_GetDistanceFactor(p,a) (p)->lpVtbl->GetDistanceFactor(p,a)
|
||||
#define IDirectSound3DListener_GetDopplerFactor(p,a) (p)->lpVtbl->GetDopplerFactor(p,a)
|
||||
#define IDirectSound3DListener_GetOrientation(p,a,b) (p)->lpVtbl->GetOrientation(p,a,b)
|
||||
#define IDirectSound3DListener_GetPosition(p,a) (p)->lpVtbl->GetPosition(p,a)
|
||||
#define IDirectSound3DListener_GetRolloffFactor(p,a) (p)->lpVtbl->GetRolloffFactor(p,a)
|
||||
#define IDirectSound3DListener_GetVelocity(p,a) (p)->lpVtbl->GetVelocity(p,a)
|
||||
#define IDirectSound3DListener_SetAllParameters(p,a,b) (p)->lpVtbl->SetAllParameters(p,a,b)
|
||||
#define IDirectSound3DListener_SetDistanceFactor(p,a,b) (p)->lpVtbl->SetDistanceFactor(p,a,b)
|
||||
#define IDirectSound3DListener_SetDopplerFactor(p,a,b) (p)->lpVtbl->SetDopplerFactor(p,a,b)
|
||||
#define IDirectSound3DListener_SetOrientation(p,a,b,c,d,e,f,g) (p)->lpVtbl->SetOrientation(p,a,b,c,d,e,f,g)
|
||||
#define IDirectSound3DListener_SetPosition(p,a,b,c,d) (p)->lpVtbl->SetPosition(p,a,b,c,d)
|
||||
#define IDirectSound3DListener_SetRolloffFactor(p,a,b) (p)->lpVtbl->SetRolloffFactor(p,a,b)
|
||||
#define IDirectSound3DListener_SetVelocity(p,a,b,c,d) (p)->lpVtbl->SetVelocity(p,a,b,c,d)
|
||||
#define IDirectSound3DListener_CommitDeferredSettings(p) (p)->lpVtbl->CommitDeferredSettings(p)
|
||||
#else // !defined(__cplusplus) || defined(CINTERFACE)
|
||||
#define IDirectSound3DListener_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
|
||||
#define IDirectSound3DListener_AddRef(p) (p)->AddRef()
|
||||
#define IDirectSound3DListener_Release(p) (p)->Release()
|
||||
#define IDirectSound3DListener_GetAllParameters(p,a) (p)->GetAllParameters(a)
|
||||
#define IDirectSound3DListener_GetDistanceFactor(p,a) (p)->GetDistanceFactor(a)
|
||||
#define IDirectSound3DListener_GetDopplerFactor(p,a) (p)->GetDopplerFactor(a)
|
||||
#define IDirectSound3DListener_GetOrientation(p,a,b) (p)->GetOrientation(a,b)
|
||||
#define IDirectSound3DListener_GetPosition(p,a) (p)->GetPosition(a)
|
||||
#define IDirectSound3DListener_GetRolloffFactor(p,a) (p)->GetRolloffFactor(a)
|
||||
#define IDirectSound3DListener_GetVelocity(p,a) (p)->GetVelocity(a)
|
||||
#define IDirectSound3DListener_SetAllParameters(p,a,b) (p)->SetAllParameters(a,b)
|
||||
#define IDirectSound3DListener_SetDistanceFactor(p,a,b) (p)->SetDistanceFactor(a,b)
|
||||
#define IDirectSound3DListener_SetDopplerFactor(p,a,b) (p)->SetDopplerFactor(a,b)
|
||||
#define IDirectSound3DListener_SetOrientation(p,a,b,c,d,e,f,g) (p)->SetOrientation(a,b,c,d,e,f,g)
|
||||
#define IDirectSound3DListener_SetPosition(p,a,b,c,d) (p)->SetPosition(a,b,c,d)
|
||||
#define IDirectSound3DListener_SetRolloffFactor(p,a,b) (p)->SetRolloffFactor(a,b)
|
||||
#define IDirectSound3DListener_SetVelocity(p,a,b,c,d) (p)->SetVelocity(a,b,c,d)
|
||||
#define IDirectSound3DListener_CommitDeferredSettings(p) (p)->CommitDeferredSettings()
|
||||
#endif // !defined(__cplusplus) || defined(CINTERFACE)
|
||||
|
||||
//
|
||||
// IDirectSound3DBuffer
|
||||
//
|
||||
|
||||
DEFINE_GUID(IID_IDirectSound3DBuffer, 0x279AFA86, 0x4981, 0x11CE, 0xA5, 0x21, 0x00, 0x20, 0xAF, 0x0B, 0xE5, 0x60);
|
||||
|
||||
#undef INTERFACE
|
||||
#define INTERFACE IDirectSound3DBuffer
|
||||
|
||||
DECLARE_INTERFACE_(IDirectSound3DBuffer, IUnknown)
|
||||
{
|
||||
// IUnknown methods
|
||||
STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID *) PURE;
|
||||
STDMETHOD_(ULONG,AddRef) (THIS) PURE;
|
||||
STDMETHOD_(ULONG,Release) (THIS) PURE;
|
||||
|
||||
// IDirectSoundBuffer3D methods
|
||||
STDMETHOD(GetAllParameters) (THIS_ LPDS3DBUFFER) PURE;
|
||||
STDMETHOD(GetConeAngles) (THIS_ LPDWORD, LPDWORD) PURE;
|
||||
STDMETHOD(GetConeOrientation) (THIS_ LPD3DVECTOR) PURE;
|
||||
STDMETHOD(GetConeOutsideVolume) (THIS_ LPLONG) PURE;
|
||||
STDMETHOD(GetMaxDistance) (THIS_ LPD3DVALUE) PURE;
|
||||
STDMETHOD(GetMinDistance) (THIS_ LPD3DVALUE) PURE;
|
||||
STDMETHOD(GetMode) (THIS_ LPDWORD) PURE;
|
||||
STDMETHOD(GetPosition) (THIS_ LPD3DVECTOR) PURE;
|
||||
STDMETHOD(GetVelocity) (THIS_ LPD3DVECTOR) PURE;
|
||||
STDMETHOD(SetAllParameters) (THIS_ LPCDS3DBUFFER, DWORD) PURE;
|
||||
STDMETHOD(SetConeAngles) (THIS_ DWORD, DWORD, DWORD) PURE;
|
||||
STDMETHOD(SetConeOrientation) (THIS_ D3DVALUE, D3DVALUE, D3DVALUE, DWORD) PURE;
|
||||
STDMETHOD(SetConeOutsideVolume) (THIS_ LONG, DWORD) PURE;
|
||||
STDMETHOD(SetMaxDistance) (THIS_ D3DVALUE, DWORD) PURE;
|
||||
STDMETHOD(SetMinDistance) (THIS_ D3DVALUE, DWORD) PURE;
|
||||
STDMETHOD(SetMode) (THIS_ DWORD, DWORD) PURE;
|
||||
STDMETHOD(SetPosition) (THIS_ D3DVALUE, D3DVALUE, D3DVALUE, DWORD) PURE;
|
||||
STDMETHOD(SetVelocity) (THIS_ D3DVALUE, D3DVALUE, D3DVALUE, DWORD) PURE;
|
||||
};
|
||||
|
||||
#if !defined(__cplusplus) || defined(CINTERFACE)
|
||||
#define IDirectSound3DBuffer_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
|
||||
#define IDirectSound3DBuffer_AddRef(p) (p)->lpVtbl->AddRef(p)
|
||||
#define IDirectSound3DBuffer_Release(p) (p)->lpVtbl->Release(p)
|
||||
#define IDirectSound3DBuffer_GetAllParameters(p,a) (p)->lpVtbl->GetAllParameters(p,a)
|
||||
#define IDirectSound3DBuffer_GetConeAngles(p,a,b) (p)->lpVtbl->GetConeAngles(p,a,b)
|
||||
#define IDirectSound3DBuffer_GetConeOrientation(p,a) (p)->lpVtbl->GetConeOrientation(p,a)
|
||||
#define IDirectSound3DBuffer_GetConeOutsideVolume(p,a) (p)->lpVtbl->GetConeOutsideVolume(p,a)
|
||||
#define IDirectSound3DBuffer_GetPosition(p,a) (p)->lpVtbl->GetPosition(p,a)
|
||||
#define IDirectSound3DBuffer_GetMinDistance(p,a) (p)->lpVtbl->GetMinDistance(p,a)
|
||||
#define IDirectSound3DBuffer_GetMaxDistance(p,a) (p)->lpVtbl->GetMaxDistance(p,a)
|
||||
#define IDirectSound3DBuffer_GetMode(p,a) (p)->lpVtbl->GetMode(p,a)
|
||||
#define IDirectSound3DBuffer_GetVelocity(p,a) (p)->lpVtbl->GetVelocity(p,a)
|
||||
#define IDirectSound3DBuffer_SetAllParameters(p,a,b) (p)->lpVtbl->SetAllParameters(p,a,b)
|
||||
#define IDirectSound3DBuffer_SetConeAngles(p,a,b,c) (p)->lpVtbl->SetConeAngles(p,a,b,c)
|
||||
#define IDirectSound3DBuffer_SetConeOrientation(p,a,b,c,d) (p)->lpVtbl->SetConeOrientation(p,a,b,c,d)
|
||||
#define IDirectSound3DBuffer_SetConeOutsideVolume(p,a,b)(p)->lpVtbl->SetConeOutsideVolume(p,a,b)
|
||||
#define IDirectSound3DBuffer_SetPosition(p,a,b,c,d) (p)->lpVtbl->SetPosition(p,a,b,c,d)
|
||||
#define IDirectSound3DBuffer_SetMinDistance(p,a,b) (p)->lpVtbl->SetMinDistance(p,a,b)
|
||||
#define IDirectSound3DBuffer_SetMaxDistance(p,a,b) (p)->lpVtbl->SetMaxDistance(p,a,b)
|
||||
#define IDirectSound3DBuffer_SetMode(p,a,b) (p)->lpVtbl->SetMode(p,a,b)
|
||||
#define IDirectSound3DBuffer_SetVelocity(p,a,b,c,d) (p)->lpVtbl->SetVelocity(p,a,b,c,d)
|
||||
#else // !defined(__cplusplus) || defined(CINTERFACE)
|
||||
#define IDirectSound3DBuffer_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
|
||||
#define IDirectSound3DBuffer_AddRef(p) (p)->AddRef()
|
||||
#define IDirectSound3DBuffer_Release(p) (p)->Release()
|
||||
#define IDirectSound3DBuffer_GetAllParameters(p,a) (p)->GetAllParameters(a)
|
||||
#define IDirectSound3DBuffer_GetConeAngles(p,a,b) (p)->GetConeAngles(a,b)
|
||||
#define IDirectSound3DBuffer_GetConeOrientation(p,a) (p)->GetConeOrientation(a)
|
||||
#define IDirectSound3DBuffer_GetConeOutsideVolume(p,a) (p)->GetConeOutsideVolume(a)
|
||||
#define IDirectSound3DBuffer_GetPosition(p,a) (p)->GetPosition(a)
|
||||
#define IDirectSound3DBuffer_GetMinDistance(p,a) (p)->GetMinDistance(a)
|
||||
#define IDirectSound3DBuffer_GetMaxDistance(p,a) (p)->GetMaxDistance(a)
|
||||
#define IDirectSound3DBuffer_GetMode(p,a) (p)->GetMode(a)
|
||||
#define IDirectSound3DBuffer_GetVelocity(p,a) (p)->GetVelocity(a)
|
||||
#define IDirectSound3DBuffer_SetAllParameters(p,a,b) (p)->SetAllParameters(a,b)
|
||||
#define IDirectSound3DBuffer_SetConeAngles(p,a,b,c) (p)->SetConeAngles(a,b,c)
|
||||
#define IDirectSound3DBuffer_SetConeOrientation(p,a,b,c,d) (p)->SetConeOrientation(a,b,c,d)
|
||||
#define IDirectSound3DBuffer_SetConeOutsideVolume(p,a,b)(p)->SetConeOutsideVolume(a,b)
|
||||
#define IDirectSound3DBuffer_SetPosition(p,a,b,c,d) (p)->SetPosition(a,b,c,d)
|
||||
#define IDirectSound3DBuffer_SetMinDistance(p,a,b) (p)->SetMinDistance(a,b)
|
||||
#define IDirectSound3DBuffer_SetMaxDistance(p,a,b) (p)->SetMaxDistance(a,b)
|
||||
#define IDirectSound3DBuffer_SetMode(p,a,b) (p)->SetMode(a,b)
|
||||
#define IDirectSound3DBuffer_SetVelocity(p,a,b,c,d) (p)->SetVelocity(a,b,c,d)
|
||||
#endif // !defined(__cplusplus) || defined(CINTERFACE)
|
||||
|
||||
//
|
||||
// IDirectSoundCapture
|
||||
//
|
||||
|
||||
DEFINE_GUID(IID_IDirectSoundCapture, 0xb0210781, 0x89cd, 0x11d0, 0xaf, 0x8, 0x0, 0xa0, 0xc9, 0x25, 0xcd, 0x16);
|
||||
|
||||
#undef INTERFACE
|
||||
#define INTERFACE IDirectSoundCapture
|
||||
|
||||
DECLARE_INTERFACE_(IDirectSoundCapture, IUnknown)
|
||||
{
|
||||
// IUnknown methods
|
||||
STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID *) PURE;
|
||||
STDMETHOD_(ULONG,AddRef) (THIS) PURE;
|
||||
STDMETHOD_(ULONG,Release) (THIS) PURE;
|
||||
|
||||
// IDirectSoundCapture methods
|
||||
STDMETHOD(CreateCaptureBuffer) (THIS_ LPCDSCBUFFERDESC, LPDIRECTSOUNDCAPTUREBUFFER *, LPUNKNOWN) PURE;
|
||||
STDMETHOD(GetCaps) (THIS_ LPDSCCAPS ) PURE;
|
||||
STDMETHOD(Initialize) (THIS_ LPGUID) PURE;
|
||||
};
|
||||
|
||||
#if !defined(__cplusplus) || defined(CINTERFACE)
|
||||
#define IDirectSoundCapture_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
|
||||
#define IDirectSoundCapture_AddRef(p) (p)->lpVtbl->AddRef(p)
|
||||
#define IDirectSoundCapture_Release(p) (p)->lpVtbl->Release(p)
|
||||
#define IDirectSoundCapture_CreateCaptureBuffer(p,a,b,c) (p)->lpVtbl->CreateCaptureBuffer(p,a,b,c)
|
||||
#define IDirectSoundCapture_GetCaps(p,a) (p)->lpVtbl->GetCaps(p,a)
|
||||
#define IDirectSoundCapture_Initialize(p,a) (p)->lpVtbl->Initialize(p,a)
|
||||
#else // !defined(__cplusplus) || defined(CINTERFACE)
|
||||
#define IDirectSoundCapture_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
|
||||
#define IDirectSoundCapture_AddRef(p) (p)->AddRef()
|
||||
#define IDirectSoundCapture_Release(p) (p)->Release()
|
||||
#define IDirectSoundCapture_CreateCaptureBuffer(p,a,b,c) (p)->CreateCaptureBuffer(a,b,c)
|
||||
#define IDirectSoundCapture_GetCaps(p,a) (p)->GetCaps(a)
|
||||
#define IDirectSoundCapture_Initialize(p,a) (p)->Initialize(a)
|
||||
#endif // !defined(__cplusplus) || defined(CINTERFACE)
|
||||
|
||||
//
|
||||
// IDirectSoundCaptureBuffer
|
||||
//
|
||||
|
||||
DEFINE_GUID(IID_IDirectSoundCaptureBuffer, 0xb0210782, 0x89cd, 0x11d0, 0xaf, 0x8, 0x0, 0xa0, 0xc9, 0x25, 0xcd, 0x16);
|
||||
|
||||
#undef INTERFACE
|
||||
#define INTERFACE IDirectSoundCaptureBuffer
|
||||
|
||||
DECLARE_INTERFACE_(IDirectSoundCaptureBuffer, IUnknown)
|
||||
{
|
||||
// IUnknown methods
|
||||
STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID *) PURE;
|
||||
STDMETHOD_(ULONG,AddRef) (THIS) PURE;
|
||||
STDMETHOD_(ULONG,Release) (THIS) PURE;
|
||||
|
||||
// IDirectSoundCaptureBuffer methods
|
||||
STDMETHOD(GetCaps) (THIS_ LPDSCBCAPS ) PURE;
|
||||
STDMETHOD(GetCurrentPosition) (THIS_ LPDWORD, LPDWORD ) PURE;
|
||||
STDMETHOD(GetFormat) (THIS_ LPWAVEFORMATEX, DWORD, LPDWORD ) PURE;
|
||||
STDMETHOD(GetStatus) (THIS_ LPDWORD ) PURE;
|
||||
STDMETHOD(Initialize) (THIS_ LPDIRECTSOUNDCAPTURE, LPCDSCBUFFERDESC) PURE;
|
||||
STDMETHOD(Lock) (THIS_ DWORD, DWORD, LPVOID *, LPDWORD, LPVOID *, LPDWORD, DWORD) PURE;
|
||||
STDMETHOD(Start) (THIS_ DWORD) PURE;
|
||||
STDMETHOD(Stop) (THIS) PURE;
|
||||
STDMETHOD(Unlock) (THIS_ LPVOID, DWORD, LPVOID, DWORD) PURE;
|
||||
};
|
||||
|
||||
#if !defined(__cplusplus) || defined(CINTERFACE)
|
||||
#define IDirectSoundCaptureBuffer_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
|
||||
#define IDirectSoundCaptureBuffer_AddRef(p) (p)->lpVtbl->AddRef(p)
|
||||
#define IDirectSoundCaptureBuffer_Release(p) (p)->lpVtbl->Release(p)
|
||||
#define IDirectSoundCaptureBuffer_GetCaps(p,a) (p)->lpVtbl->GetCaps(p,a)
|
||||
#define IDirectSoundCaptureBuffer_GetCurrentPosition(p,a,b) (p)->lpVtbl->GetCurrentPosition(p,a,b)
|
||||
#define IDirectSoundCaptureBuffer_GetFormat(p,a,b,c) (p)->lpVtbl->GetFormat(p,a,b,c)
|
||||
#define IDirectSoundCaptureBuffer_GetStatus(p,a) (p)->lpVtbl->GetStatus(p,a)
|
||||
#define IDirectSoundCaptureBuffer_Initialize(p,a,b) (p)->lpVtbl->Initialize(p,a,b)
|
||||
#define IDirectSoundCaptureBuffer_Lock(p,a,b,c,d,e,f,g) (p)->lpVtbl->Lock(p,a,b,c,d,e,f,g)
|
||||
#define IDirectSoundCaptureBuffer_Start(p,a) (p)->lpVtbl->Start(p,a)
|
||||
#define IDirectSoundCaptureBuffer_Stop(p) (p)->lpVtbl->Stop(p)
|
||||
#define IDirectSoundCaptureBuffer_Unlock(p,a,b,c,d) (p)->lpVtbl->Unlock(p,a,b,c,d)
|
||||
#else // !defined(__cplusplus) || defined(CINTERFACE)
|
||||
#define IDirectSoundCaptureBuffer_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
|
||||
#define IDirectSoundCaptureBuffer_AddRef(p) (p)->AddRef()
|
||||
#define IDirectSoundCaptureBuffer_Release(p) (p)->Release()
|
||||
#define IDirectSoundCaptureBuffer_GetCaps(p,a) (p)->GetCaps(a)
|
||||
#define IDirectSoundCaptureBuffer_GetCurrentPosition(p,a,b) (p)->GetCurrentPosition(a,b)
|
||||
#define IDirectSoundCaptureBuffer_GetFormat(p,a,b,c) (p)->GetFormat(a,b,c)
|
||||
#define IDirectSoundCaptureBuffer_GetStatus(p,a) (p)->GetStatus(a)
|
||||
#define IDirectSoundCaptureBuffer_Initialize(p,a,b) (p)->Initialize(a,b)
|
||||
#define IDirectSoundCaptureBuffer_Lock(p,a,b,c,d,e,f,g) (p)->Lock(a,b,c,d,e,f,g)
|
||||
#define IDirectSoundCaptureBuffer_Start(p,a) (p)->Start(a)
|
||||
#define IDirectSoundCaptureBuffer_Stop(p) (p)->Stop()
|
||||
#define IDirectSoundCaptureBuffer_Unlock(p,a,b,c,d) (p)->Unlock(a,b,c,d)
|
||||
#endif // !defined(__cplusplus) || defined(CINTERFACE)
|
||||
|
||||
//
|
||||
// IDirectSoundNotify
|
||||
//
|
||||
|
||||
DEFINE_GUID(IID_IDirectSoundNotify, 0xb0210783, 0x89cd, 0x11d0, 0xaf, 0x8, 0x0, 0xa0, 0xc9, 0x25, 0xcd, 0x16);
|
||||
|
||||
#undef INTERFACE
|
||||
#define INTERFACE IDirectSoundNotify
|
||||
|
||||
DECLARE_INTERFACE_(IDirectSoundNotify, IUnknown)
|
||||
{
|
||||
// IUnknown methods
|
||||
STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID *) PURE;
|
||||
STDMETHOD_(ULONG,AddRef) (THIS) PURE;
|
||||
STDMETHOD_(ULONG,Release) (THIS) PURE;
|
||||
|
||||
// IDirectSoundNotify methods
|
||||
STDMETHOD(SetNotificationPositions) (THIS_ DWORD, LPCDSBPOSITIONNOTIFY) PURE;
|
||||
};
|
||||
|
||||
#if !defined(__cplusplus) || defined(CINTERFACE)
|
||||
#define IDirectSoundNotify_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
|
||||
#define IDirectSoundNotify_AddRef(p) (p)->lpVtbl->AddRef(p)
|
||||
#define IDirectSoundNotify_Release(p) (p)->lpVtbl->Release(p)
|
||||
#define IDirectSoundNotify_SetNotificationPositions(p,a,b) (p)->lpVtbl->SetNotificationPositions(p,a,b)
|
||||
#else // !defined(__cplusplus) || defined(CINTERFACE)
|
||||
#define IDirectSoundNotify_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
|
||||
#define IDirectSoundNotify_AddRef(p) (p)->AddRef()
|
||||
#define IDirectSoundNotify_Release(p) (p)->Release()
|
||||
#define IDirectSoundNotify_SetNotificationPositions(p,a,b) (p)->SetNotificationPositions(a,b)
|
||||
#endif // !defined(__cplusplus) || defined(CINTERFACE)
|
||||
|
||||
//
|
||||
// IKsPropertySet
|
||||
//
|
||||
|
||||
#ifndef _IKsPropertySet_
|
||||
#define _IKsPropertySet_
|
||||
|
||||
#ifdef __cplusplus
|
||||
// 'struct' not 'class' per the way DECLARE_INTERFACE_ is defined
|
||||
struct IKsPropertySet;
|
||||
#endif // __cplusplus
|
||||
|
||||
typedef struct IKsPropertySet *LPKSPROPERTYSET;
|
||||
|
||||
#define KSPROPERTY_SUPPORT_GET 0x00000001
|
||||
#define KSPROPERTY_SUPPORT_SET 0x00000002
|
||||
|
||||
DEFINE_GUID(IID_IKsPropertySet, 0x31efac30, 0x515c, 0x11d0, 0xa9, 0xaa, 0x00, 0xaa, 0x00, 0x61, 0xbe, 0x93);
|
||||
|
||||
#undef INTERFACE
|
||||
#define INTERFACE IKsPropertySet
|
||||
|
||||
DECLARE_INTERFACE_(IKsPropertySet, IUnknown)
|
||||
{
|
||||
// IUnknown methods
|
||||
STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID *) PURE;
|
||||
STDMETHOD_(ULONG,AddRef) (THIS) PURE;
|
||||
STDMETHOD_(ULONG,Release) (THIS) PURE;
|
||||
|
||||
// IKsPropertySet methods
|
||||
STDMETHOD(Get) (THIS_ REFGUID, ULONG, LPVOID, ULONG, LPVOID, ULONG, PULONG) PURE;
|
||||
STDMETHOD(Set) (THIS_ REFGUID, ULONG, LPVOID, ULONG, LPVOID, ULONG) PURE;
|
||||
STDMETHOD(QuerySupport) (THIS_ REFGUID, ULONG, PULONG) PURE;
|
||||
};
|
||||
|
||||
#if !defined(__cplusplus) || defined(CINTERFACE)
|
||||
#define IKsPropertySet_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
|
||||
#define IKsPropertySet_AddRef(p) (p)->lpVtbl->AddRef(p)
|
||||
#define IKsPropertySet_Release(p) (p)->lpVtbl->Release(p)
|
||||
#define IKsPropertySet_Get(p,a,b,c,d,e,f,g) (p)->lpVtbl->Get(p,a,b,c,d,e,f,g)
|
||||
#define IKsPropertySet_Set(p,a,b,c,d,e,f) (p)->lpVtbl->Set(p,a,b,c,d,e,f)
|
||||
#define IKsPropertySet_QuerySupport(p,a,b,c) (p)->lpVtbl->QuerySupport(p,a,b,c)
|
||||
#else // !defined(__cplusplus) || defined(CINTERFACE)
|
||||
#define IKsPropertySet_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
|
||||
#define IKsPropertySet_AddRef(p) (p)->AddRef()
|
||||
#define IKsPropertySet_Release(p) (p)->Release()
|
||||
#define IKsPropertySet_Get(p,a,b,c,d,e,f,g) (p)->Get(a,b,c,d,e,f,g)
|
||||
#define IKsPropertySet_Set(p,a,b,c,d,e,f) (p)->Set(a,b,c,d,e,f)
|
||||
#define IKsPropertySet_QuerySupport(p,a,b,c) (p)->QuerySupport(a,b,c)
|
||||
#endif // !defined(__cplusplus) || defined(CINTERFACE)
|
||||
|
||||
#endif // _IKsPropertySet_
|
||||
|
||||
//
|
||||
// Return Codes
|
||||
//
|
||||
|
||||
#define DS_OK 0
|
||||
|
||||
// The call failed because resources (such as a priority level)
|
||||
// were already being used by another caller.
|
||||
#define DSERR_ALLOCATED MAKE_DSHRESULT(10)
|
||||
|
||||
// The control (vol,pan,etc.) requested by the caller is not available.
|
||||
#define DSERR_CONTROLUNAVAIL MAKE_DSHRESULT(30)
|
||||
|
||||
// An invalid parameter was passed to the returning function
|
||||
#define DSERR_INVALIDPARAM E_INVALIDARG
|
||||
|
||||
// This call is not valid for the current state of this object
|
||||
#define DSERR_INVALIDCALL MAKE_DSHRESULT(50)
|
||||
|
||||
// An undetermined error occured inside the DirectSound subsystem
|
||||
#define DSERR_GENERIC E_FAIL
|
||||
|
||||
// The caller does not have the priority level required for the function to
|
||||
// succeed.
|
||||
#define DSERR_PRIOLEVELNEEDED MAKE_DSHRESULT(70)
|
||||
|
||||
// Not enough free memory is available to complete the operation
|
||||
#define DSERR_OUTOFMEMORY E_OUTOFMEMORY
|
||||
|
||||
// The specified WAVE format is not supported
|
||||
#define DSERR_BADFORMAT MAKE_DSHRESULT(100)
|
||||
|
||||
// The function called is not supported at this time
|
||||
#define DSERR_UNSUPPORTED E_NOTIMPL
|
||||
|
||||
// No sound driver is available for use
|
||||
#define DSERR_NODRIVER MAKE_DSHRESULT(120)
|
||||
|
||||
// This object is already initialized
|
||||
#define DSERR_ALREADYINITIALIZED MAKE_DSHRESULT(130)
|
||||
|
||||
// This object does not support aggregation
|
||||
#define DSERR_NOAGGREGATION CLASS_E_NOAGGREGATION
|
||||
|
||||
// The buffer memory has been lost, and must be restored.
|
||||
#define DSERR_BUFFERLOST MAKE_DSHRESULT(150)
|
||||
|
||||
// Another app has a higher priority level, preventing this call from
|
||||
// succeeding.
|
||||
#define DSERR_OTHERAPPHASPRIO MAKE_DSHRESULT(160)
|
||||
|
||||
// This object has not been initialized
|
||||
#define DSERR_UNINITIALIZED MAKE_DSHRESULT(170)
|
||||
|
||||
// The requested COM interface is not available
|
||||
#define DSERR_NOINTERFACE E_NOINTERFACE
|
||||
|
||||
//
|
||||
// Flags
|
||||
//
|
||||
|
||||
#define DSCAPS_PRIMARYMONO 0x00000001
|
||||
#define DSCAPS_PRIMARYSTEREO 0x00000002
|
||||
#define DSCAPS_PRIMARY8BIT 0x00000004
|
||||
#define DSCAPS_PRIMARY16BIT 0x00000008
|
||||
#define DSCAPS_CONTINUOUSRATE 0x00000010
|
||||
#define DSCAPS_EMULDRIVER 0x00000020
|
||||
#define DSCAPS_CERTIFIED 0x00000040
|
||||
#define DSCAPS_SECONDARYMONO 0x00000100
|
||||
#define DSCAPS_SECONDARYSTEREO 0x00000200
|
||||
#define DSCAPS_SECONDARY8BIT 0x00000400
|
||||
#define DSCAPS_SECONDARY16BIT 0x00000800
|
||||
|
||||
#define DSBPLAY_LOOPING 0x00000001
|
||||
|
||||
#define DSBSTATUS_PLAYING 0x00000001
|
||||
#define DSBSTATUS_BUFFERLOST 0x00000002
|
||||
#define DSBSTATUS_LOOPING 0x00000004
|
||||
|
||||
#define DSBLOCK_FROMWRITECURSOR 0x00000001
|
||||
#define DSBLOCK_ENTIREBUFFER 0x00000002
|
||||
|
||||
#define DSSCL_NORMAL 0x00000001
|
||||
#define DSSCL_PRIORITY 0x00000002
|
||||
#define DSSCL_EXCLUSIVE 0x00000003
|
||||
#define DSSCL_WRITEPRIMARY 0x00000004
|
||||
|
||||
#define DS3DMODE_NORMAL 0x00000000
|
||||
#define DS3DMODE_HEADRELATIVE 0x00000001
|
||||
#define DS3DMODE_DISABLE 0x00000002
|
||||
|
||||
#define DS3D_IMMEDIATE 0x00000000
|
||||
#define DS3D_DEFERRED 0x00000001
|
||||
|
||||
#define DS3D_MINDISTANCEFACTOR 0.0f
|
||||
#define DS3D_MAXDISTANCEFACTOR 10.0f
|
||||
#define DS3D_DEFAULTDISTANCEFACTOR 1.0f
|
||||
|
||||
#define DS3D_MINROLLOFFFACTOR 0.0f
|
||||
#define DS3D_MAXROLLOFFFACTOR 10.0f
|
||||
#define DS3D_DEFAULTROLLOFFFACTOR 1.0f
|
||||
|
||||
#define DS3D_MINDOPPLERFACTOR 0.0f
|
||||
#define DS3D_MAXDOPPLERFACTOR 10.0f
|
||||
#define DS3D_DEFAULTDOPPLERFACTOR 1.0f
|
||||
|
||||
#define DS3D_DEFAULTMINDISTANCE 1.0f
|
||||
#define DS3D_DEFAULTMAXDISTANCE 1000000000.0f
|
||||
|
||||
#define DS3D_MINCONEANGLE 0
|
||||
#define DS3D_MAXCONEANGLE 360
|
||||
#define DS3D_DEFAULTCONEANGLE 360
|
||||
|
||||
#define DS3D_DEFAULTCONEOUTSIDEVOLUME 0
|
||||
|
||||
#define DSBCAPS_PRIMARYBUFFER 0x00000001
|
||||
#define DSBCAPS_STATIC 0x00000002
|
||||
#define DSBCAPS_LOCHARDWARE 0x00000004
|
||||
#define DSBCAPS_LOCSOFTWARE 0x00000008
|
||||
#define DSBCAPS_CTRL3D 0x00000010
|
||||
#define DSBCAPS_CTRLFREQUENCY 0x00000020
|
||||
#define DSBCAPS_CTRLPAN 0x00000040
|
||||
#define DSBCAPS_CTRLVOLUME 0x00000080
|
||||
#define DSBCAPS_CTRLPOSITIONNOTIFY 0x00000100
|
||||
#define DSBCAPS_CTRLDEFAULT 0x000000E0
|
||||
#define DSBCAPS_CTRLALL 0x000001F0
|
||||
#define DSBCAPS_STICKYFOCUS 0x00004000
|
||||
#define DSBCAPS_GLOBALFOCUS 0x00008000
|
||||
#define DSBCAPS_GETCURRENTPOSITION2 0x00010000
|
||||
#define DSBCAPS_MUTE3DATMAXDISTANCE 0x00020000
|
||||
|
||||
#define DSCBCAPS_WAVEMAPPED 0x80000000
|
||||
|
||||
#define DSSPEAKER_HEADPHONE 0x00000001
|
||||
#define DSSPEAKER_MONO 0x00000002
|
||||
#define DSSPEAKER_QUAD 0x00000003
|
||||
#define DSSPEAKER_STEREO 0x00000004
|
||||
#define DSSPEAKER_SURROUND 0x00000005
|
||||
|
||||
#define DSSPEAKER_GEOMETRY_MIN 0x00000005 // 5 degrees
|
||||
#define DSSPEAKER_GEOMETRY_NARROW 0x0000000A // 10 degrees
|
||||
#define DSSPEAKER_GEOMETRY_WIDE 0x00000014 // 20 degrees
|
||||
#define DSSPEAKER_GEOMETRY_MAX 0x000000B4 // 180 degrees
|
||||
|
||||
#define DSSPEAKER_COMBINED(c, g) ((DWORD)(((BYTE)(c)) | ((DWORD)((BYTE)(g))) << 16))
|
||||
#define DSSPEAKER_CONFIG(a) ((BYTE)(a))
|
||||
#define DSSPEAKER_GEOMETRY(a) ((BYTE)(((DWORD)(a) >> 16) & 0x00FF))
|
||||
|
||||
#define DSCCAPS_EMULDRIVER 0x00000020
|
||||
|
||||
#define DSCBLOCK_ENTIREBUFFER 0x00000001
|
||||
|
||||
#define DSCBSTATUS_CAPTURING 0x00000001
|
||||
#define DSCBSTATUS_LOOPING 0x00000002
|
||||
|
||||
#define DSCBSTART_LOOPING 0x00000001
|
||||
|
||||
#define DSBFREQUENCY_MIN 100
|
||||
#define DSBFREQUENCY_MAX 100000
|
||||
#define DSBFREQUENCY_ORIGINAL 0
|
||||
|
||||
#define DSBPAN_LEFT -10000
|
||||
#define DSBPAN_CENTER 0
|
||||
#define DSBPAN_RIGHT 10000
|
||||
|
||||
#define DSBVOLUME_MIN -10000
|
||||
#define DSBVOLUME_MAX 0
|
||||
|
||||
#define DSBSIZE_MIN 4
|
||||
#define DSBSIZE_MAX 0x0FFFFFFF
|
||||
|
||||
#define DSBPN_OFFSETSTOP 0xFFFFFFFF
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
#endif // __cplusplus
|
||||
|
||||
#endif // __DSOUND_INCLUDED__
|
||||
@@ -7,78 +7,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/ExceptionHandler/ExceptionHandler.cpp $
|
||||
* $Revision: 2.10.2.1 $
|
||||
* $Date: 2006-11-15 00:26:03 $
|
||||
* $Author: taylor $
|
||||
*
|
||||
* Main file for dealing with exception handling
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.10 2006/01/26 03:23:29 Goober5000
|
||||
* pare down the pragmas some more
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.9 2006/01/20 07:10:33 Goober5000
|
||||
* reordered #include files to quash Microsoft warnings
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.8 2005/01/31 23:27:52 taylor
|
||||
* merge with Linux/OSX tree - p0131-2
|
||||
*
|
||||
* Revision 2.7 2004/07/26 20:47:27 Kazan
|
||||
* remove MCD complete
|
||||
*
|
||||
* Revision 2.6 2004/07/12 16:32:45 Kazan
|
||||
* MCD - define _MCD_CHECK to use memory tracking
|
||||
*
|
||||
* Revision 2.5 2004/03/31 05:42:26 Goober5000
|
||||
* got rid of all those nasty warnings from xlocale and so forth; also added comments
|
||||
* to indicate which warnings were being disabled
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.4 2004/03/06 23:28:22 bobboau
|
||||
* fixed motion debris
|
||||
* animated laser textures
|
||||
* and added a new error check called a safepoint, mostly for tracking the 'Y bug'
|
||||
*
|
||||
* Revision 2.3 2003/11/11 02:15:43 Goober5000
|
||||
* ubercommit - basically spelling and language fixes with some additional
|
||||
* warnings disabled
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.2 2003/11/06 20:22:03 Kazan
|
||||
* slight change to .dsp - leave the release target as fs2_open_r.exe already
|
||||
* added myself to credit
|
||||
* killed some of the stupid 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 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)
|
||||
*
|
||||
* Revision 2.1 2003/03/02 05:10:42 penguin
|
||||
* Added #ifdef _MSC_VER around strange exception-handling code
|
||||
* - penguin
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:22 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
* Revision 1.1 2002/05/02 18:03:05 mharris
|
||||
* Initial checkin - converted filenames and includes to lower case
|
||||
*
|
||||
*
|
||||
* 1 6/29/99 7:42p Dave
|
||||
*
|
||||
* 3 1/19/99 9:07a Allender
|
||||
* removed compiler warning pragma's since we are already ignoring them in
|
||||
* vtypes.h
|
||||
*
|
||||
* 2 1/18/99 4:34p Allender
|
||||
* added the exception handler routines from Game Developer for structured
|
||||
* exception handling in vsdk code
|
||||
*
|
||||
* $NoKeywords: $
|
||||
*/
|
||||
|
||||
|
||||
// Copyright © 1998 Bruce Dawson.
|
||||
/*
|
||||
@@ -87,6 +16,8 @@ information after crashes. See exceptionhandler.h for information
|
||||
on how to hook it in.
|
||||
*/
|
||||
|
||||
#ifdef GAME_ERRORLOG_TXT
|
||||
|
||||
#ifdef _WIN32
|
||||
|
||||
#include "globalincs/pstypes.h"
|
||||
@@ -578,3 +509,4 @@ int __cdecl RecordExceptionInfo(PEXCEPTION_POINTERS data, const char *Message)
|
||||
}
|
||||
|
||||
#endif // _WIN32
|
||||
#endif
|
||||
@@ -7,44 +7,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/ExceptionHandler/ExceptionHandler.h $
|
||||
* $Revision: 2.4 $
|
||||
* $Date: 2005-07-13 02:50:52 $
|
||||
* $Author: Goober5000 $
|
||||
*
|
||||
* Header file for program exception handling
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.3 2005/04/12 05:26:36 taylor
|
||||
* many, many compiler warning and header fixes (Jens Granseuer)
|
||||
* fix free on possible NULL in modelinterp.cpp (Jens Granseuer)
|
||||
*
|
||||
* Revision 2.2 2004/08/11 05:06:22 Kazan
|
||||
* added preprocdefines.h to prevent what happened with fred -- make sure to make all fred2 headers include this file as the _first_ include -- i have already modified fs2 files to do this
|
||||
*
|
||||
* Revision 2.1 2002/07/07 19:55:58 penguin
|
||||
* Back-port to MSVC
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:22 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
* Revision 1.2 2002/05/07 02:58:10 mharris
|
||||
* ifdef around pragma
|
||||
*
|
||||
* Revision 1.1 2002/05/02 18:03:05 mharris
|
||||
* Initial checkin - converted filenames and includes to lower case
|
||||
*
|
||||
*
|
||||
* 1 6/29/99 7:42p Dave
|
||||
*
|
||||
* 2 1/18/99 4:34p Allender
|
||||
* added the exception handler routines from Game Developer for structured
|
||||
* exception handling in vsdk code
|
||||
*
|
||||
* $NoKeywords: $
|
||||
*/
|
||||
|
||||
#ifdef GAME_ERRORLOG_TXT
|
||||
|
||||
#ifndef __EXCEPTION_HANDLER_H
|
||||
#define __EXCEPTION_HANDLER_H
|
||||
@@ -105,3 +69,4 @@ int __cdecl RecordExceptionInfo(PEXCEPTION_POINTERS data, const char *Message);
|
||||
|
||||
|
||||
#endif // __EXCEPTION_HANDLER_H
|
||||
#endif
|
||||
@@ -0,0 +1,106 @@
|
||||
#ifndef EXTERNALCODE_H_INCLUDED_
|
||||
#define EXTERNALCODE_H_INCLUDED_
|
||||
|
||||
#include "globalincs/pstypes.h"
|
||||
|
||||
/* We must have windows.h anywhere SCP_ExternalCode is used under windows */
|
||||
#ifdef _WIN32
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
/* This class loads external libraries for FSO use.
|
||||
* Different platforms have different ways of doing this, so use your ifdefs!
|
||||
*/
|
||||
class SCP_ExternalCode
|
||||
{
|
||||
public:
|
||||
SCP_ExternalCode( )
|
||||
#ifdef _WIN32
|
||||
: m_dll( NULL )
|
||||
#endif
|
||||
{
|
||||
}
|
||||
|
||||
virtual ~SCP_ExternalCode( )
|
||||
{
|
||||
#ifdef _WIN32
|
||||
if ( m_dll )
|
||||
::FreeLibrary( m_dll );
|
||||
#endif
|
||||
}
|
||||
|
||||
protected:
|
||||
BOOL LoadExternal( const char* externlib )
|
||||
{
|
||||
if ( !externlib )
|
||||
return FALSE;
|
||||
|
||||
#ifdef _WIN32
|
||||
m_dll = ::LoadLibrary( externlib );
|
||||
|
||||
if ( m_dll )
|
||||
return TRUE;
|
||||
#endif
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void* LoadFunction( const char* functionname )
|
||||
{
|
||||
#ifdef _WIN32
|
||||
if ( m_dll != NULL && functionname != NULL )
|
||||
return ::GetProcAddress( m_dll, functionname );
|
||||
#endif
|
||||
return NULL;
|
||||
}
|
||||
private:
|
||||
#ifdef _WIN32
|
||||
HMODULE m_dll;
|
||||
#endif
|
||||
};
|
||||
|
||||
/* These are available if you're compiling an external DLL
|
||||
* So far we have trackir, and speech is on the way
|
||||
*/
|
||||
#ifdef _WIN32
|
||||
# define SCP_EXT_CALLCONV __cdecl
|
||||
# ifdef SCPDLL_EXTERNAL_LIB
|
||||
# define SCPDLL_EXTERNAL __declspec( dllexport )
|
||||
# else
|
||||
# define SCPDLL_EXTERNAL __declspec( dllimport )
|
||||
# endif
|
||||
/* Must be in a CPP file in your DLL code
|
||||
* If you want to write your own, you shouldn't.
|
||||
*/
|
||||
# define SCPDLL_DLLMAIN( ) \
|
||||
SCP_EXTERN_C BOOL APIENTRY DllMain( HANDLE, DWORD, LPVOID ) { return TRUE; }
|
||||
#else
|
||||
# define SCP_EXT_CALLCONV
|
||||
# define SCPDLL_EXTERNAL
|
||||
# define SCPDLL_DLLMAIN( )
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
# define SCP_EXTERN_C extern "C"
|
||||
#else
|
||||
# define SCP_EXTERN_C
|
||||
#endif
|
||||
|
||||
/* Version information */
|
||||
typedef struct _SCPDLL_Version
|
||||
{
|
||||
int major;
|
||||
int minor;
|
||||
int patch;
|
||||
} SCPDLL_Version;
|
||||
|
||||
typedef int ( SCP_EXT_CALLCONV *SCPDLL_PFVERSION )( SCPDLL_Version* );
|
||||
|
||||
/* Must be in a CPP file in your DLL code */
|
||||
#define SCPDLL_VERSION_FUNCTION( Major, Minor, Patch ) \
|
||||
SCP_EXTERN_C int SCPDLL_EXTERNAL SCPDLL_GetVersion( SCPDLL_Version* v ) { \
|
||||
if ( !v ) return -1;\
|
||||
v->major = Major; v->minor = Minor; v->patch = Patch;\
|
||||
return 0; }
|
||||
|
||||
#endif /* EXTERNALCODE_H_INCLUDED_ */
|
||||
@@ -0,0 +1,4 @@
|
||||
#include "trackirpublic.h"
|
||||
|
||||
/* The TrackIR Interface */
|
||||
TrackIRDLL gTirDll_TrackIR;
|
||||
@@ -0,0 +1,170 @@
|
||||
#ifndef TRACKIRPUBLIC_H_INCLUDED_
|
||||
#define TRACKIRPUBLIC_H_INCLUDED_
|
||||
|
||||
#include "external_dll/externalcode.h"
|
||||
#include "globalincs/pstypes.h"
|
||||
|
||||
#define TRACKIRBRIDGEDLLNAME "scptrackir.dll"
|
||||
|
||||
#define SCP_INITRESULT_SUCCESS 0
|
||||
#define SCP_INITRESULT_BADKEY 1
|
||||
#define SCP_INITRESULT_BADPATH 2
|
||||
#define SCP_INITRESULT_PATHTOOLONG 3
|
||||
#define SCP_INITRESULT_NODLL 4
|
||||
#define SCP_INITRESULT_BADSIGNATURE 5
|
||||
#define SCP_INITRESULT_UNABLETOREGISTER 6
|
||||
#define SCP_INITRESULT_BADDATAFIELDS 7
|
||||
#define SCP_INITRESULT_BADREGISTRATION 8
|
||||
#define SCP_INITRESULT_BADTRANSMISSION 9
|
||||
|
||||
/* Exported functions */
|
||||
/* HWND comes from externalcode.h */
|
||||
/* These are function pointer prototypes provided for library loading */
|
||||
|
||||
/* Only one function doesn't return an int or a float */
|
||||
typedef int ( SCP_EXT_CALLCONV *SCPTRACKIR_PFINIT )( HWND );
|
||||
|
||||
/* All other trackir functions return an int or a float
|
||||
* and take no parameters
|
||||
*/
|
||||
typedef int ( SCP_EXT_CALLCONV *SCPTRACKIR_PFINTVOID )( );
|
||||
typedef float ( SCP_EXT_CALLCONV *SCPTRACKIR_PFFLOATVOID )( );
|
||||
|
||||
class TrackIRDLL : public SCP_ExternalCode
|
||||
{
|
||||
public:
|
||||
TrackIRDLL( )
|
||||
{
|
||||
/* Load the DLL and functions
|
||||
* If this is done globally, we'll be found by MSPDBDEBUGGING :)
|
||||
*/
|
||||
|
||||
Reset( );
|
||||
|
||||
if ( !LoadExternal( TRACKIRBRIDGEDLLNAME ) )
|
||||
return;
|
||||
|
||||
m_Init = (SCPTRACKIR_PFINIT)LoadFunction( "SCPTIR_Init" );
|
||||
m_Close = (SCPTRACKIR_PFINTVOID)LoadFunction( "SCPTIR_Close" );
|
||||
m_Query = (SCPTRACKIR_PFINTVOID)LoadFunction( "SCPTIR_Query" );
|
||||
|
||||
m_GetX = (SCPTRACKIR_PFFLOATVOID)LoadFunction( "SCPTIR_GetX" );
|
||||
m_GetY = (SCPTRACKIR_PFFLOATVOID)LoadFunction( "SCPTIR_GetY" );
|
||||
m_GetZ = (SCPTRACKIR_PFFLOATVOID)LoadFunction( "SCPTIR_GetZ" );
|
||||
m_GetRoll = (SCPTRACKIR_PFFLOATVOID)LoadFunction( "SCPTIR_GetRoll" );
|
||||
m_GetPitch = (SCPTRACKIR_PFFLOATVOID)LoadFunction( "SCPTIR_GetPitch" );
|
||||
m_GetYaw = (SCPTRACKIR_PFFLOATVOID)LoadFunction( "SCPTIR_GetYaw" );
|
||||
m_enabled = true;
|
||||
}
|
||||
|
||||
bool Enabled( )
|
||||
{
|
||||
return m_enabled;
|
||||
}
|
||||
|
||||
virtual ~TrackIRDLL( )
|
||||
{
|
||||
/* Prevent further use of the DLL */
|
||||
Reset( );
|
||||
}
|
||||
|
||||
void Reset( )
|
||||
{
|
||||
m_Init = NULL;
|
||||
m_Close = NULL;
|
||||
m_Query = NULL;
|
||||
m_GetX = NULL;
|
||||
m_GetY = NULL;
|
||||
m_GetZ = NULL;
|
||||
m_GetPitch = NULL;
|
||||
m_GetRoll = NULL;
|
||||
m_GetYaw = NULL;
|
||||
m_enabled = false;
|
||||
}
|
||||
|
||||
/* Returns 0 on success */
|
||||
int Init( HWND hwnd )
|
||||
{
|
||||
if ( m_Init )
|
||||
return m_Init( hwnd );
|
||||
return 0;
|
||||
}
|
||||
|
||||
int Close( )
|
||||
{
|
||||
if ( m_Close )
|
||||
return m_Close( );
|
||||
return 0;
|
||||
}
|
||||
|
||||
int Query( )
|
||||
{
|
||||
if ( m_Query )
|
||||
return m_Query( );
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
float GetX( )
|
||||
{
|
||||
if ( m_GetX )
|
||||
return m_GetX( );
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
float GetY( )
|
||||
{
|
||||
if ( m_GetY )
|
||||
return m_GetY( );
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
float GetZ( )
|
||||
{
|
||||
if ( m_GetZ )
|
||||
return m_GetZ( );
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
float GetPitch( )
|
||||
{
|
||||
if ( m_GetPitch )
|
||||
return m_GetPitch( );
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
float GetRoll( )
|
||||
{
|
||||
if ( m_GetRoll )
|
||||
return m_GetRoll( );
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
float GetYaw( )
|
||||
{
|
||||
if ( m_GetYaw )
|
||||
return m_GetYaw( );
|
||||
return 0.0f;
|
||||
}
|
||||
private:
|
||||
/* Functions */
|
||||
SCPTRACKIR_PFINIT m_Init;
|
||||
SCPTRACKIR_PFINTVOID m_Close;
|
||||
SCPTRACKIR_PFINTVOID m_Query;
|
||||
|
||||
SCPTRACKIR_PFFLOATVOID m_GetX;
|
||||
SCPTRACKIR_PFFLOATVOID m_GetY;
|
||||
SCPTRACKIR_PFFLOATVOID m_GetZ;
|
||||
SCPTRACKIR_PFFLOATVOID m_GetPitch;
|
||||
SCPTRACKIR_PFFLOATVOID m_GetRoll;
|
||||
SCPTRACKIR_PFFLOATVOID m_GetYaw;
|
||||
|
||||
bool m_enabled;
|
||||
};
|
||||
|
||||
/* Added to trackirpublic.h */
|
||||
#ifndef SCPDLL_EXTERNAL_LIB
|
||||
extern TrackIRDLL gTirDll_TrackIR;
|
||||
#endif
|
||||
|
||||
#endif /* TRACKIRPUBLIC_H_INCLUDED_ */
|
||||
+29
-492
@@ -7,476 +7,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Fireball/FireBalls.cpp $
|
||||
* $Revision: 2.33.2.4 $
|
||||
* $Date: 2007-09-02 02:07:39 $
|
||||
* $Author: Goober5000 $
|
||||
*
|
||||
* Code to move, render and otherwise deal with fireballs.
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.33.2.3 2007/07/28 21:31:04 Goober5000
|
||||
* this should really be capitalized
|
||||
*
|
||||
* Revision 2.33.2.2 2007/02/11 09:53:33 taylor
|
||||
* support for tbl specified fireball explosion color ("$Light color:")
|
||||
*
|
||||
* Revision 2.33.2.1 2006/09/11 01:12:50 taylor
|
||||
* fixes for stuff_string() bounds checking
|
||||
* stict compiler build fixes
|
||||
*
|
||||
* Revision 2.33 2006/02/25 21:46:59 Goober5000
|
||||
* spelling
|
||||
*
|
||||
* Revision 2.32 2006/02/13 00:20:45 Goober5000
|
||||
* more tweaks, plus clarification of checks for the existence of files
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.31 2006/01/20 07:10:33 Goober5000
|
||||
* reordered #include files to quash Microsoft warnings
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.30 2005/12/29 08:08:33 wmcoolmon
|
||||
* Codebase commit, most notably including objecttypes.tbl
|
||||
*
|
||||
* 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/12/01 07:45:21 Goober5000
|
||||
* bypass annoying warnings when loading optional models
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.27 2005/10/20 17:50:00 taylor
|
||||
* fix player warpout
|
||||
* basic code cleanup (that previous braces change did nothing for readability)
|
||||
* spell "plyr" correctly
|
||||
* tweak warp shrink time to better match WMC's other changes and avoid the skipping during shrink
|
||||
*
|
||||
* Revision 2.26 2005/04/05 05:53:15 taylor
|
||||
* s/vector/vec3d/g, better support for different compilers (Jens Granseuer)
|
||||
*
|
||||
* Revision 2.25 2005/03/19 18:02:33 bobboau
|
||||
* added new graphic functions for state blocks
|
||||
* also added a class formanageing a new effect
|
||||
*
|
||||
* Revision 2.24 2005/03/14 03:24:25 taylor
|
||||
* speedup grow/shrink time for the warp to avoid the big size skips
|
||||
*
|
||||
* Revision 2.23 2005/03/10 08:00:02 taylor
|
||||
* change min/max to MIN/MAX to fix GCC problems
|
||||
* add lab stuff to Makefile
|
||||
* build unbreakage for everything that's not MSVC++ 6
|
||||
* lots of warning fixes
|
||||
* fix OpenGL rendering problem with ship insignias
|
||||
* no Warnings() in non-debug mode for Linux (like Windows)
|
||||
* some campaign savefile fixage to stop reverting everyones data
|
||||
*
|
||||
* Revision 2.22 2005/03/01 06:55:40 bobboau
|
||||
* oh, hey look I've commited something :D
|
||||
* animation system, weapon models detail box alt-tab bug, probly other stuff
|
||||
*
|
||||
* Revision 2.21 2005/02/23 05:05:39 taylor
|
||||
* compiler warning fixes (for MSVC++ 6)
|
||||
* have the warp effect only load as many LODs as will get used
|
||||
* head off strange bug in release when corrupt soundtrack number gets used
|
||||
* (will still Assert in debug)
|
||||
* don't ever try and save a campaign savefile in multi or standalone modes
|
||||
* first try at 32bit->16bit color conversion for TGA code (for TGA only ship textures)
|
||||
*
|
||||
* Revision 2.20 2005/01/30 09:27:39 Goober5000
|
||||
* nitpicked some boolean tests, and fixed two small bugs
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.19 2004/11/01 20:57:03 taylor
|
||||
* make use of Knossos_warp_ani_used flag - thanks Goober5000
|
||||
*
|
||||
* Revision 2.18 2004/10/31 02:26:15 Goober5000
|
||||
* whoops
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.17 2004/10/31 02:04:33 Goober5000
|
||||
* added Knossos_warp_ani_used flag for taylor
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.16 2004/09/17 07:12:22 Goober5000
|
||||
* changed around the logic for the 3D warp effect
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.15 2004/08/23 04:32:39 Goober5000
|
||||
* warp effect is back to FS2 default
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.14 2004/07/26 20:47:28 Kazan
|
||||
* remove MCD complete
|
||||
*
|
||||
* Revision 2.13 2004/07/12 16:32:45 Kazan
|
||||
* MCD - define _MCD_CHECK to use memory tracking
|
||||
*
|
||||
* Revision 2.12 2004/05/12 22:49:14 phreak
|
||||
* renamed the warp model variable from 'wm' to 'Warp_model'
|
||||
*
|
||||
* Revision 2.11 2004/03/17 04:07:29 bobboau
|
||||
* 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
|
||||
*
|
||||
* Revision 2.10 2004/03/05 09:02:00 Goober5000
|
||||
* Uber pass at reducing #includes
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.9 2004/02/14 00:18:30 randomtiger
|
||||
* Please note that from now on OGL will only run with a registry set by Launcher v4. See forum for details.
|
||||
* OK, these changes effect a lot of file, I suggest everyone updates ASAP:
|
||||
* Removal of many files from project.
|
||||
* Removal of meanless Gr_bitmap_poly variable.
|
||||
* Removal of glide, directdraw, software modules all links to them, and all code specific to those paths.
|
||||
* Removal of redundant Fred paths that arent needed for Fred OGL.
|
||||
* Have seriously tidied the graphics initialisation code and added generic non standard mode functionality.
|
||||
* Fixed many D3D non standard mode bugs and brought OGL up to the same level.
|
||||
* Removed texture section support for D3D8, voodoo 2 and 3 cards will no longer run under fs2_open in D3D, same goes for any card with a maximum texture size less than 1024.
|
||||
*
|
||||
* Revision 2.8 2003/11/16 04:09:19 Goober5000
|
||||
* language
|
||||
*
|
||||
* Revision 2.7 2003/11/11 03:56:10 bobboau
|
||||
* lots of bug fixing, much of it in nebula and bitmap drawing
|
||||
*
|
||||
* Revision 2.6 2003/10/23 18:03:23 randomtiger
|
||||
* Bobs changes (take 2)
|
||||
*
|
||||
* Revision 2.5 2003/03/19 06:23:27 Goober5000
|
||||
* added warp-effect sexp
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.4 2003/03/18 01:44:30 Goober5000
|
||||
* fixed some misspellings
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.3 2002/12/07 01:37:41 bobboau
|
||||
* initial decals code, if you are worried a bug is being caused by the decals code it's only references are in,
|
||||
* collideshipweapon.cpp line 262, beam.cpp line 2771, and modelinterp.cpp line 2949.
|
||||
* it needs a better renderer, but is in prety good shape for now,
|
||||
* I also (think) I squashed a bug in the warpmodel code
|
||||
*
|
||||
* Revision 2.2 2002/11/14 04:18:16 bobboau
|
||||
* added warp model and type 1 glow points
|
||||
* and well as made the new glow file type,
|
||||
* some general improvement to fighter beams,
|
||||
*
|
||||
* Revision 2.1 2002/08/01 01:41:04 penguin
|
||||
* The big include file move
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:22 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
* Revision 1.2 2002/05/03 22:07:08 mharris
|
||||
* got some stuff to compile
|
||||
*
|
||||
* Revision 1.1 2002/05/02 18:03:07 mharris
|
||||
* Initial checkin - converted filenames and includes to lower case
|
||||
*
|
||||
*
|
||||
* 19 9/14/99 1:27a Andsager
|
||||
* Better LOD for fireballs when behind. Move point ahead to get vertex
|
||||
* ahead and then find size.
|
||||
*
|
||||
* 18 9/12/99 11:42p Dave
|
||||
*
|
||||
* 17 9/13/99 10:09a Andsager
|
||||
* Add debug console commands to lower model render detail and fireball
|
||||
* LOD for big ship explosiosns.
|
||||
*
|
||||
* 16 9/09/99 8:53p Dave
|
||||
* Fixed multiplayer degenerate orientation case problem. Make sure warp
|
||||
* effect never goes lower than LOD 1.
|
||||
*
|
||||
* 15 9/07/99 12:20a Andsager
|
||||
* LOD less agressive at lower hardware detail level
|
||||
*
|
||||
* 14 9/06/99 6:47p Jamesa
|
||||
* Fixed build error.
|
||||
*
|
||||
* 13 9/06/99 3:23p Andsager
|
||||
* Make fireball and weapon expl ani LOD choice look at resolution of the
|
||||
* bitmap
|
||||
*
|
||||
* 12 9/01/99 10:09a Dave
|
||||
* Pirate bob.
|
||||
*
|
||||
* 11 8/31/99 10:13p Andsager
|
||||
* Add Knossos warp effect fireball
|
||||
*
|
||||
* 10 8/30/99 9:59a Dave
|
||||
* Removed explosion LOD stuff.
|
||||
*
|
||||
* 9 8/28/99 4:54p Dave
|
||||
* Fixed directives display for multiplayer clients for wings with
|
||||
* multiple waves. Fixed hud threat indicator rendering color.
|
||||
*
|
||||
* 8 8/27/99 9:07p Dave
|
||||
* LOD explosions. Improved beam weapon accuracy.
|
||||
*
|
||||
* 7 7/09/99 5:54p Dave
|
||||
* Seperated cruiser types into individual types. Added tons of new
|
||||
* briefing icons. Campaign screen.
|
||||
*
|
||||
* 6 4/28/99 11:13p Dave
|
||||
* Temporary checkin of artillery code.
|
||||
*
|
||||
* 5 4/23/99 12:01p Johnson
|
||||
* Added SIF_HUGE_SHIP
|
||||
*
|
||||
* 4 11/05/98 5:55p Dave
|
||||
* Big pass at reducing #includes
|
||||
*
|
||||
* 3 10/23/98 3:51p Dave
|
||||
* Full support for tstrings.tbl and foreign languages. All that remains
|
||||
* is to make it active in Fred.
|
||||
*
|
||||
* 2 10/07/98 10:52a Dave
|
||||
* Initial checkin.
|
||||
*
|
||||
* 1 10/07/98 10:48a Dave
|
||||
*
|
||||
* 75 5/18/98 2:49p Lawrance
|
||||
* Allow up to double instance of sound for warp holes
|
||||
*
|
||||
* 74 5/15/98 3:54p John
|
||||
* Added code so that only "perishable" fireballs get removed.
|
||||
*
|
||||
* 73 4/15/98 9:42a Adam
|
||||
* added 2 more explosion types (1, actually, but placeholder for 2)
|
||||
*
|
||||
* 72 4/12/98 9:56a John
|
||||
* Made lighting detail flags work. Made explosions cast light on
|
||||
* highest.
|
||||
*
|
||||
* 71 4/09/98 7:58p John
|
||||
* Cleaned up tmapper code a bit. Put NDEBUG around some ndebug stuff.
|
||||
* Took out XPARENT flag settings in all the alpha-blended texture stuff.
|
||||
*
|
||||
* 70 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.
|
||||
*
|
||||
* 69 3/30/98 4:02p John
|
||||
* Made machines with < 32 MB of RAM use every other frame of certain
|
||||
* bitmaps. Put in code to keep track of how much RAM we've malloc'd.
|
||||
*
|
||||
* 68 3/29/98 12:39p John
|
||||
* Made warp in glow page in
|
||||
*
|
||||
* 67 3/27/98 2:17p Lawrance
|
||||
* Don't play warphole closing for non-capital sized warp effects
|
||||
*
|
||||
* 66 3/26/98 5:44p Lawrance
|
||||
* take out debug comments for warphole sounds playing
|
||||
*
|
||||
* 65 3/26/98 5:21p John
|
||||
* Added new code to preload all bitmaps at the start of a level.
|
||||
* Commented it out, though.
|
||||
*
|
||||
* 64 3/25/98 5:30p Lawrance
|
||||
* Fix bug that was not playing wormhole open sound effect at correct
|
||||
* volume
|
||||
*
|
||||
* 63 3/25/98 10:56a Lawrance
|
||||
* Make a sound for warphole close as well as warphole open, move to
|
||||
* fireball lib
|
||||
*
|
||||
* 62 3/18/98 12:36p John
|
||||
* Made hardware have nicer looking warp effect
|
||||
*
|
||||
* 61 3/18/98 12:01p John
|
||||
* Made warp grid grow faster
|
||||
*
|
||||
* 60 2/26/98 10:07p Hoffoss
|
||||
* Rewrote state saving and restoring to fix bugs and simplify the code.
|
||||
*
|
||||
* 59 2/22/98 12:19p John
|
||||
* Externalized some strings
|
||||
*
|
||||
* 58 2/19/98 4:32p Lawrance
|
||||
* Add asteroid explosion
|
||||
*
|
||||
* 57 2/12/98 11:53p Lawrance
|
||||
* comment out use of current_frame since not used anywhere
|
||||
*
|
||||
* 56 2/05/98 9:21p John
|
||||
* Some new Direct3D code. Added code to monitor a ton of stuff in the
|
||||
* game.
|
||||
*
|
||||
* 55 1/23/98 5:06p John
|
||||
* Took L out of vertex structure used B (blue) instead. Took all small
|
||||
* fireballs out of fireball types and used particles instead. Fixed some
|
||||
* debris explosion things. Restructured fireball code. Restructured
|
||||
* some lighting code. Made dynamic lighting on by default. Made groups
|
||||
* of lasers only cast one light. Made fireballs not cast light.
|
||||
*
|
||||
* 54 1/19/98 9:37p Allender
|
||||
* Great Compiler Warning Purge of Jan, 1998. Used pragma's in a couple
|
||||
* of places since I was unsure of what to do with code.
|
||||
*
|
||||
* 53 1/15/98 4:58p John
|
||||
* Made warp effect use a looping ani. Made the scaling up & down be in
|
||||
* software.
|
||||
*
|
||||
* 52 1/15/98 2:32p John
|
||||
* Added code to optionally take a velocity for a fireball.
|
||||
*
|
||||
* 51 1/11/98 2:15p John
|
||||
* Changed a lot of stuff that had to do with bitmap loading. Made cfile
|
||||
* not do callbacks, I put that in global code. Made only bitmaps that
|
||||
* need to load for a level load.
|
||||
*
|
||||
* 50 1/02/98 5:04p John
|
||||
* Several explosion related changes. Made fireballs not be used as
|
||||
* ani's. Made ship spark system expell particles. Took away impact
|
||||
* explosion for weapon hitting ship... this needs to get added to weapon
|
||||
* info and makes shield hit more obvious. Only make sparks when hit
|
||||
* hull, not shields.
|
||||
*
|
||||
* 49 12/31/97 4:48p John
|
||||
* added some debug info
|
||||
*
|
||||
* 48 12/30/97 6:44p John
|
||||
* Made g3_Draw_bitmap functions account for aspect of bitmap.
|
||||
*
|
||||
* 47 12/08/97 11:15a John
|
||||
* added parameter to warpout for life.
|
||||
*
|
||||
* 46 12/02/97 3:59p John
|
||||
* Added first rev of thruster glow, along with variable levels of
|
||||
* translucency, which retquired some restructing of palman.
|
||||
*
|
||||
* 45 11/30/97 2:03p John
|
||||
* made warp effect not use an ani for height map.
|
||||
*
|
||||
* 44 11/16/97 12:20p John
|
||||
* added code to make ships instantly warp in/out if fireball effect
|
||||
* fails. But, made it so the fireball effect will kill off old sparks
|
||||
* so it can go, so this should never happen.
|
||||
*
|
||||
* 43 11/16/97 10:48a John
|
||||
* added code to remove the oldest fireball if there weren't enough slots
|
||||
* for a new one.
|
||||
*
|
||||
* 42 11/01/97 1:49p John
|
||||
* added code to page fireballs in during level load. Made player warpout
|
||||
* use Adam's new camera movement pattern. Make ships docked to warping
|
||||
* out ships render correctly.
|
||||
*
|
||||
* 41 10/29/97 5:05p John
|
||||
* Changed dynamic lighting to only rotate and calculate lighting for
|
||||
* point lights that are close to an object. Changed lower framerate cap
|
||||
* from 4 to .5.
|
||||
*
|
||||
* 40 10/24/97 6:24p John
|
||||
* added code to return the life left of a fireball
|
||||
*
|
||||
* 39 9/14/97 4:49p Lawrance
|
||||
* add some demo debugging code
|
||||
*
|
||||
* 38 9/12/97 4:02p John
|
||||
* put in ship warp out effect.
|
||||
* put in dynamic lighting for warp in/out
|
||||
*
|
||||
* 37 9/09/97 4:49p John
|
||||
* Almost done ship warp in code
|
||||
*
|
||||
* 36 9/08/97 8:39a John
|
||||
* added in code structure for grid
|
||||
*
|
||||
* 35 9/03/97 5:04p Lawrance
|
||||
* add error checking when restoring structs
|
||||
*
|
||||
* 34 9/03/97 4:32p John
|
||||
* changed bmpman to only accept ani and pcx's. made passing .pcx or .ani
|
||||
* to bm_load functions not needed. Made bmpman keep track of palettes
|
||||
* for bitmaps not mapped into game palettes.
|
||||
*
|
||||
* 33 8/29/97 2:26p John
|
||||
* first rev of ship warp in effect. Nothing more than a fireball inside
|
||||
* of freespace, but textest.cpp contains the correct effect code that
|
||||
* needs to be transferred into the game next.
|
||||
*
|
||||
* 32 8/21/97 5:11p Lawrance
|
||||
* frame numbering for ANI's now is from 0 -> total_frames-1.
|
||||
*
|
||||
* 31 8/13/97 9:50p Allender
|
||||
* split *_move into *_process_pre and *_process_post functions.
|
||||
* process_pre functions called before object is moved. _process_post
|
||||
* functions called after object is moved. Reordered code in ship_post
|
||||
* and weapon_post for multiplayer
|
||||
*
|
||||
* 30 8/13/97 12:06p Lawrance
|
||||
* supporting multiple types of fireball explosions
|
||||
*
|
||||
* 29 8/05/97 10:18a Lawrance
|
||||
* my_rand() being used temporarily instead of rand()
|
||||
*
|
||||
* 28 7/31/97 5:55p John
|
||||
* made so you pass flags to obj_create.
|
||||
* Added new collision code that ignores any pairs that will never
|
||||
* collide.
|
||||
*
|
||||
* 27 7/24/97 9:54a Lawrance
|
||||
* don't free fireball system if not inited
|
||||
*
|
||||
* 26 7/23/97 11:35a Lawrance
|
||||
* ensure fireball animations are always freed properly
|
||||
*
|
||||
* 25 7/21/97 11:41a Lawrance
|
||||
* clean up fireballs at the end of each level
|
||||
*
|
||||
* 24 7/20/97 6:58p Lawrance
|
||||
* call anim_get_frame() to take advantage of key-framed animation
|
||||
*
|
||||
* 23 7/11/97 3:57p John
|
||||
* made fireballs translucent. alpha=1.3x intesity. only for d3d.
|
||||
*
|
||||
* 22 7/11/97 12:08p John
|
||||
* made fireballs randomly be rotated.
|
||||
*
|
||||
* 21 7/11/97 11:54a John
|
||||
* added rotated 3d bitmaps.
|
||||
*
|
||||
* 20 7/11/97 11:19a Lawrance
|
||||
* fix mem leaks, move save code from State.cpp here
|
||||
*
|
||||
* 19 7/10/97 1:51p Lawrance
|
||||
* sorting anim fireballs
|
||||
*
|
||||
* 18 6/24/97 6:21p John
|
||||
* added detail flags.
|
||||
* sped up motion debris system a bit.
|
||||
*
|
||||
* 17 5/14/97 4:08p Lawrance
|
||||
* removing my_index from game arrays
|
||||
*
|
||||
* 16 5/05/97 10:40p Mike
|
||||
* Make missile exhaust trails look a tad nicer.
|
||||
*
|
||||
* 15 3/11/97 10:47p Mike
|
||||
* Add a slew of secondary weapons.
|
||||
* Support exhaust blobs.
|
||||
* Add weapons that spawn weapons.
|
||||
* Add remotely detonatable weapons.
|
||||
* Add heat-seeking missiles.
|
||||
*
|
||||
* 14 2/17/97 5:18p John
|
||||
* Added a bunch of RCS headers to a bunch of old files that don't have
|
||||
* them.
|
||||
*
|
||||
* $NoKeywords: $
|
||||
*/
|
||||
|
||||
|
||||
#include "fireball/fireballs.h"
|
||||
#include "graphics/tmapper.h"
|
||||
@@ -491,13 +22,12 @@
|
||||
#include "globalincs/pstypes.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <vector>
|
||||
|
||||
|
||||
// make use of the LOD checker for tbl/tbm parsing (from weapons.cpp)
|
||||
extern std::vector<lod_checker> LOD_checker;
|
||||
extern SCP_vector<lod_checker> LOD_checker;
|
||||
|
||||
static std::vector<color> LOD_color;
|
||||
static SCP_vector<color> LOD_color;
|
||||
|
||||
int Warp_model;
|
||||
int Knossos_warp_ani_used;
|
||||
@@ -542,7 +72,9 @@ void fireball_play_warphole_open_sound(int ship_class, fireball *fb)
|
||||
|
||||
sound_index = SND_WARP_IN;
|
||||
|
||||
if((ship_class >= 0) && (ship_class < Num_ship_classes)){
|
||||
if(fb->warp_open_sound_index > -1) {
|
||||
sound_index = fb->warp_open_sound_index;
|
||||
} else if((ship_class >= 0) && (ship_class < Num_ship_classes)){
|
||||
if ( Ship_info[ship_class].flags & SIF_HUGE_SHIP ) {
|
||||
sound_index = SND_CAPITAL_WARP_IN;
|
||||
fb->flags |= FBF_WARP_CAPITAL_SIZE;
|
||||
@@ -551,10 +83,6 @@ void fireball_play_warphole_open_sound(int ship_class, fireball *fb)
|
||||
fb->flags |= FBF_WARP_CRUISER_SIZE;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
sound_index = fb->warp_open_sound_index;
|
||||
}
|
||||
|
||||
snd_play_3d(&Snds[sound_index], &fireball_objp->pos, &Eye_position, fireball_objp->radius, NULL, 0, 1.0f, SND_PRIORITY_DOUBLE_INSTANCE, NULL, range_multiplier); // play warp sound effect
|
||||
}
|
||||
@@ -570,10 +98,10 @@ void fireball_play_warphole_close_sound(fireball *fb)
|
||||
|
||||
sound_index = SND_WARP_OUT;
|
||||
|
||||
if ( fb->flags & FBF_WARP_CAPITAL_SIZE ) {
|
||||
sound_index = SND_CAPITAL_WARP_OUT;
|
||||
} else if ( fb->flags & FBF_WARP_VIA_SEXP ) {
|
||||
if ( fb->warp_close_sound_index > -1 ) {
|
||||
sound_index = fb->warp_close_sound_index;
|
||||
} else if ( fb->flags & FBF_WARP_CAPITAL_SIZE ) {
|
||||
sound_index = SND_CAPITAL_WARP_OUT;
|
||||
} else {
|
||||
// AL 27-3-98: Decided that warphole closing is only required for capital ship sized warp effects.
|
||||
return;
|
||||
@@ -635,7 +163,7 @@ void parse_fireball_tbl(char *filename)
|
||||
return;
|
||||
}
|
||||
|
||||
read_file_text(filename);
|
||||
read_file_text(filename, CF_TYPE_TABLES);
|
||||
reset_parse();
|
||||
|
||||
required_string("#Start");
|
||||
@@ -725,7 +253,7 @@ void fireball_parse_tbl()
|
||||
// we assume that entries in fireball.tbl are in the correct order
|
||||
for (i = 0; i < (int)LOD_checker.size(); i++) {
|
||||
if ( (i < MAX_FIREBALL_TYPES) && (LOD_checker[i].override < 0) ) {
|
||||
strcpy( Fireball_info[i].lod[0].filename, LOD_checker[i].filename );
|
||||
strcpy_s( Fireball_info[i].lod[0].filename, LOD_checker[i].filename );
|
||||
Fireball_info[i].lod_count = LOD_checker[i].num_lods;
|
||||
Num_fireball_types++;
|
||||
|
||||
@@ -744,7 +272,7 @@ void fireball_parse_tbl()
|
||||
for (i = 0; i < (int)LOD_checker.size(); i++) {
|
||||
// try entry replacement
|
||||
if ( (LOD_checker[i].override >= 0) && (LOD_checker[i].override < Num_fireball_types) ) {
|
||||
strcpy( Fireball_info[LOD_checker[i].override].lod[0].filename, LOD_checker[i].filename );
|
||||
strcpy_s( Fireball_info[LOD_checker[i].override].lod[0].filename, LOD_checker[i].filename );
|
||||
Fireball_info[LOD_checker[i].override].lod_count = LOD_checker[i].num_lods;
|
||||
|
||||
if (LOD_color[i].alpha == 255) {
|
||||
@@ -782,7 +310,7 @@ void fireball_load_data()
|
||||
if ( (i == FIREBALL_WARP) && (idx > MAX_WARP_LOD) )
|
||||
continue;
|
||||
|
||||
fd->lod[idx].bitmap_id = bm_load_animation( fd->lod[idx].filename, &fd->lod[idx].num_frames, &fd->lod[idx].fps, 1 );
|
||||
fd->lod[idx].bitmap_id = bm_load_animation( fd->lod[idx].filename, &fd->lod[idx].num_frames, &fd->lod[idx].fps, NULL, 1 );
|
||||
if ( fd->lod[idx].bitmap_id < 0 ) {
|
||||
Error(LOCATION, "Could not load %s anim file\n", fd->lod[idx].filename);
|
||||
}
|
||||
@@ -1095,7 +623,7 @@ int fireball_is_warp(object * obj)
|
||||
return 0;
|
||||
}
|
||||
|
||||
// mabye play sound effect for warp hole closing
|
||||
// maybe play sound effect for warp hole closing
|
||||
void fireball_maybe_play_warp_close_sound(fireball *fb)
|
||||
{
|
||||
float life_left;
|
||||
@@ -1192,14 +720,13 @@ int fireball_get_lod(vec3d *pos, fireball_info *fd, float size)
|
||||
}
|
||||
|
||||
// start the frame
|
||||
extern float Viewer_zoom;
|
||||
extern int G3_count;
|
||||
|
||||
if(!G3_count){
|
||||
g3_start_frame(1);
|
||||
must_stop = 1;
|
||||
}
|
||||
g3_set_view_matrix(&Eye_position, &Eye_matrix, Viewer_zoom);
|
||||
g3_set_view_matrix(&Eye_position, &Eye_matrix, Eye_fov);
|
||||
|
||||
// get extents of the rotated bitmap
|
||||
g3_rotate_vertex(&v, pos);
|
||||
@@ -1395,7 +922,9 @@ int fireball_create( vec3d * pos, int fireball_type, int render_type, int parent
|
||||
}
|
||||
|
||||
if ( fb->fireball_render_type == FIREBALL_WARP_EFFECT ) {
|
||||
Assert( warp_lifetime > 4.0f ); // Warp lifetime must be at least 4 seconds!
|
||||
Assert( warp_lifetime >= 4.0f ); // Warp lifetime must be at least 4 seconds!
|
||||
if ( warp_lifetime < 4.0f )
|
||||
warp_lifetime = 4.0f;
|
||||
fb->total_time = warp_lifetime; // in seconds
|
||||
} else {
|
||||
fb->total_time = i2fl(fl->num_frames) / fl->fps; // in seconds
|
||||
@@ -1497,13 +1026,21 @@ void fireball_get_color(int idx, float *red, float *green, float *blue)
|
||||
|
||||
int fireball_ship_explosion_type(ship_info *sip)
|
||||
{
|
||||
Assert( sip != NULL );
|
||||
|
||||
int index = -1;
|
||||
int ship_fireballs = sip->explosion_bitmap_anims.size();
|
||||
int objecttype_fireballs = Ship_types[sip->class_type].explosion_bitmap_anims.size();
|
||||
int ship_fireballs = (int)sip->explosion_bitmap_anims.size();
|
||||
int objecttype_fireballs = -1;
|
||||
|
||||
if (sip->class_type >= 0) {
|
||||
objecttype_fireballs = (int)Ship_types[sip->class_type].explosion_bitmap_anims.size();
|
||||
}
|
||||
|
||||
if(ship_fireballs > 0){
|
||||
index = sip->explosion_bitmap_anims[rand()%ship_fireballs];
|
||||
} else if(objecttype_fireballs > 0){
|
||||
index = Ship_types[sip->class_type].explosion_bitmap_anims[rand()%objecttype_fireballs];
|
||||
}
|
||||
|
||||
return index;
|
||||
}
|
||||
}
|
||||
+3
-209
@@ -7,214 +7,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Fireball/FireBalls.h $
|
||||
* $Revision: 2.14.2.2 $
|
||||
* $Date: 2007-11-22 05:02:28 $
|
||||
* $Author: taylor $
|
||||
*
|
||||
* Prototypes for fireball functions
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.14.2.1 2007/02/11 09:53:33 taylor
|
||||
* support for tbl specified fireball explosion color ("$Light color:")
|
||||
*
|
||||
* Revision 2.14 2005/07/13 02:50:52 Goober5000
|
||||
* remove PreProcDefine #includes in FS2
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.13 2005/04/05 05:53:15 taylor
|
||||
* s/vector/vec3d/g, better support for different compilers (Jens Granseuer)
|
||||
*
|
||||
* Revision 2.12 2005/03/19 18:02:33 bobboau
|
||||
* added new graphic functions for state blocks
|
||||
* also added a class formanageing a new effect
|
||||
*
|
||||
* Revision 2.11 2004/10/31 02:04:33 Goober5000
|
||||
* added Knossos_warp_ani_used flag for taylor
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.10 2004/09/17 07:12:22 Goober5000
|
||||
* changed around the logic for the 3D warp effect
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.9 2004/08/23 04:32:39 Goober5000
|
||||
* warp effect is back to FS2 default
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.8 2004/08/11 05:06:22 Kazan
|
||||
* added preprocdefines.h to prevent what happened with fred -- make sure to make all fred2 headers include this file as the _first_ include -- i have already modified fs2 files to do this
|
||||
*
|
||||
* Revision 2.7 2004/05/12 22:49:13 phreak
|
||||
* renamed the warp model variable from 'wm' to 'Warp_model'
|
||||
*
|
||||
* Revision 2.6 2004/03/17 04:07:29 bobboau
|
||||
* 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
|
||||
*
|
||||
* Revision 2.5 2004/03/05 09:02:00 Goober5000
|
||||
* Uber pass at reducing #includes
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.4 2003/03/19 06:23:27 Goober5000
|
||||
* added warp-effect sexp
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.3 2003/03/02 05:12:39 penguin
|
||||
* Moved "extern int wm" declaration inside the header #ifdef block
|
||||
* - penguin
|
||||
*
|
||||
* Revision 2.2 2002/11/14 04:18:16 bobboau
|
||||
* added warp model and type 1 glow points
|
||||
* and well as made the new glow file type,
|
||||
* some general improvement to fighter beams,
|
||||
*
|
||||
* Revision 2.1 2002/08/01 01:41:04 penguin
|
||||
* The big include file move
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:22 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
* Revision 1.1 2002/05/02 18:03:07 mharris
|
||||
* Initial checkin - converted filenames and includes to lower case
|
||||
*
|
||||
*
|
||||
* 8 9/13/99 10:09a Andsager
|
||||
* Add debug console commands to lower model render detail and fireball
|
||||
* LOD for big ship explosiosns.
|
||||
*
|
||||
* 7 9/06/99 6:57p Jamesa
|
||||
* Cranked down num large fireball explosions.
|
||||
*
|
||||
* 6 9/06/99 6:14p Jamesa
|
||||
* Reduced max fireball types.
|
||||
*
|
||||
* 5 8/31/99 10:13p Andsager
|
||||
* Add Knossos warp effect fireball
|
||||
*
|
||||
* 4 4/28/99 11:13p Dave
|
||||
* Temporary checkin of artillery code.
|
||||
*
|
||||
* 3 11/05/98 5:55p Dave
|
||||
* Big pass at reducing #includes
|
||||
*
|
||||
* 2 10/07/98 10:52a Dave
|
||||
* Initial checkin.
|
||||
*
|
||||
* 1 10/07/98 10:48a Dave
|
||||
*
|
||||
* 34 5/15/98 3:54p John
|
||||
* Added code so that only "perishable" fireballs get removed.
|
||||
*
|
||||
* 33 4/15/98 9:42a Adam
|
||||
* added 2 more explosion types (1, actually, but placeholder for 2)
|
||||
*
|
||||
* 32 4/12/98 9:56a John
|
||||
* Made lighting detail flags work. Made explosions cast light on
|
||||
* highest.
|
||||
*
|
||||
* 31 3/30/98 4:02p John
|
||||
* Made machines with < 32 MB of RAM use every other frame of certain
|
||||
* bitmaps. Put in code to keep track of how much RAM we've malloc'd.
|
||||
*
|
||||
* 30 3/18/98 12:36p John
|
||||
* Made hardware have nicer looking warp effect
|
||||
*
|
||||
* 29 2/26/98 10:07p Hoffoss
|
||||
* Rewrote state saving and restoring to fix bugs and simplify the code.
|
||||
*
|
||||
* 28 2/19/98 4:32p Lawrance
|
||||
* Add asteroid explosion
|
||||
*
|
||||
* 27 1/23/98 5:06p John
|
||||
* Took L out of vertex structure used B (blue) instead. Took all small
|
||||
* fireballs out of fireball types and used particles instead. Fixed some
|
||||
* debris explosion things. Restructured fireball code. Restructured
|
||||
* some lighting code. Made dynamic lighting on by default. Made groups
|
||||
* of lasers only cast one light. Made fireballs not cast light.
|
||||
*
|
||||
* 26 1/15/98 4:58p John
|
||||
* Made warp effect use a looping ani. Made the scaling up & down be in
|
||||
* software.
|
||||
*
|
||||
* 25 1/15/98 2:32p John
|
||||
* Added code to optionally take a velocity for a fireball.
|
||||
*
|
||||
* 24 1/02/98 5:04p John
|
||||
* Several explosion related changes. Made fireballs not be used as
|
||||
* ani's. Made ship spark system expell particles. Took away impact
|
||||
* explosion for weapon hitting ship... this needs to get added to weapon
|
||||
* info and makes shield hit more obvious. Only make sparks when hit
|
||||
* hull, not shields.
|
||||
*
|
||||
* 23 12/08/97 11:15a John
|
||||
* added parameter to warpout for life.
|
||||
*
|
||||
* 22 11/01/97 1:49p John
|
||||
* added code to page fireballs in during level load. Made player warpout
|
||||
* use Adam's new camera movement pattern. Make ships docked to warping
|
||||
* out ships render correctly.
|
||||
*
|
||||
* 21 10/24/97 6:24p John
|
||||
* added code to return the life left of a fireball
|
||||
*
|
||||
* 20 9/14/97 4:49p Lawrance
|
||||
* extern Num_fireballs
|
||||
*
|
||||
* 19 9/12/97 4:02p John
|
||||
* put in ship warp out effect.
|
||||
* put in dynamic lighting for warp in/out
|
||||
*
|
||||
* 18 9/09/97 4:49p John
|
||||
* Almost done ship warp in code
|
||||
*
|
||||
* 17 9/03/97 4:32p John
|
||||
* changed bmpman to only accept ani and pcx's. made passing .pcx or .ani
|
||||
* to bm_load functions not needed. Made bmpman keep track of palettes
|
||||
* for bitmaps not mapped into game palettes.
|
||||
*
|
||||
* 16 8/29/97 2:26p John
|
||||
* first rev of ship warp in effect. Nothing more than a fireball inside
|
||||
* of freespace, but textest.cpp contains the correct effect code that
|
||||
* needs to be transferred into the game next.
|
||||
*
|
||||
* 15 8/13/97 9:50p Allender
|
||||
* split *_move into *_process_pre and *_process_post functions.
|
||||
* process_pre functions called before object is moved. _process_post
|
||||
* functions called after object is moved. Reordered code in ship_post
|
||||
* and weapon_post for multiplayer
|
||||
*
|
||||
* 14 8/13/97 12:06p Lawrance
|
||||
* supporting multiple types of fireball explosions
|
||||
*
|
||||
* 13 7/21/97 11:41a Lawrance
|
||||
* clean up fireballs at the end of each level
|
||||
*
|
||||
* 12 7/11/97 11:19a Lawrance
|
||||
* fix mem leaks, move save code from State.cpp here
|
||||
*
|
||||
* 11 7/10/97 1:51p Lawrance
|
||||
* sorting anim fireballs
|
||||
*
|
||||
* 10 5/14/97 4:08p Lawrance
|
||||
* removing my_index from game arrays
|
||||
*
|
||||
* 9 3/11/97 10:47p Mike
|
||||
* Add a slew of secondary weapons.
|
||||
* Support exhaust blobs.
|
||||
* Add weapons that spawn weapons.
|
||||
* Add remotely detonatable weapons.
|
||||
* Add heat-seeking missiles.
|
||||
*
|
||||
* 8 2/17/97 5:18p John
|
||||
* Added a bunch of RCS headers to a bunch of old files that don't have
|
||||
* them.
|
||||
*
|
||||
* $NoKeywords: $
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _FIREBALLS_H
|
||||
#define _FIREBALLS_H
|
||||
@@ -243,6 +36,7 @@ struct ship_info;
|
||||
#define FIREBALL_NUM_LARGE_EXPLOSIONS 2
|
||||
|
||||
extern int fireball_used[MAX_FIREBALL_TYPES];
|
||||
extern int Num_fireball_types;
|
||||
|
||||
// all this moved here by Goober5000 because it makes more sense in the H file
|
||||
typedef struct fireball_lod {
|
||||
@@ -289,7 +83,7 @@ void fireball_process_post(object * obj, float frame_time);
|
||||
// reversed is for warp_in/out effects
|
||||
// Velocity: If not NULL, the fireball will move at a constant velocity.
|
||||
// warp_lifetime: If warp_lifetime > 0.0f then makes the explosion loop so it lasts this long. Only works for warp effect
|
||||
int fireball_create(vec3d *pos, int fireball_type, int render_type, int parent_obj, float size, int reversed=0, vec3d *velocity=NULL, float warp_lifetime=0.0f, int ship_class=-1, matrix *orient=NULL, int low_res=0, int extra_flags=0, int warp_open_sound=0, int warp_close_sound=0);
|
||||
int fireball_create(vec3d *pos, int fireball_type, int render_type, int parent_obj, float size, int reversed=0, vec3d *velocity=NULL, float warp_lifetime=0.0f, int ship_class=-1, matrix *orient=NULL, int low_res=0, int extra_flags=0, int warp_open_sound=-1, int warp_close_sound=-1);
|
||||
void fireball_render_plane(int plane);
|
||||
void fireball_close();
|
||||
void fireball_level_close();
|
||||
|
||||
+12
-266
@@ -7,264 +7,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Fireball/WarpInEffect.cpp $
|
||||
* $Revision: 2.32.2.5 $
|
||||
* $Date: 2007-11-22 05:02:28 $
|
||||
* $Author: taylor $
|
||||
*
|
||||
* Code for rendering the warp in effects for ships
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.32.2.4 2006/11/16 01:07:23 taylor
|
||||
* do no culling on the warp effect model_render call properly (doesn't appear to break anything now that it actually set to not cull)
|
||||
*
|
||||
* Revision 2.32.2.3 2006/10/27 21:37:11 taylor
|
||||
* more cleanup of warp_global crap
|
||||
* scale render/detail box limits with detail level setting
|
||||
* make sure that we reset culling and zbuffer after each model buffer that gets rendered
|
||||
*
|
||||
* Revision 2.32.2.2 2006/10/27 06:42:29 taylor
|
||||
* rename set_warp_globals() to model_set_warp_globals()
|
||||
* remove two old/unused MR flags (MR_ALWAYS_REDRAW, used for caching that doesn't work; MR_SHOW_DAMAGE, didn't do anything)
|
||||
* add MR_FULL_DETAIL to render an object regardless of render/detail box setting
|
||||
* change "model_current_LOD" to a global "Interp_detail_level" and the static "Interp_detail_level" to "Interp_detail_level_locked", a bit more descriptive
|
||||
* minor bits of cleanup
|
||||
* change a couple of vm_vec_scale_add2() calls to just vm_vec_add2() calls in ship.cpp, since that was the final result anyway
|
||||
*
|
||||
* Revision 2.32.2.1 2006/07/21 16:08:03 taylor
|
||||
* little cleanup
|
||||
*
|
||||
* Revision 2.32 2006/03/31 10:20:01 wmcoolmon
|
||||
* Prelim. BSG warpin effect stuff
|
||||
*
|
||||
* Revision 2.31 2005/09/21 03:55:32 Goober5000
|
||||
* add option for warp flash; mess with the cmdlines a bit
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.30 2005/08/25 22:40:02 taylor
|
||||
* basic cleaning, removing old/useless code, sanity stuff, etc:
|
||||
* - very minor performance boost from not doing stupid things :)
|
||||
* - minor change to 3d shockwave sizing to better approximate 2d effect movements
|
||||
* - for shields, Gobal_tris was only holding half as many as the game can/will use, buffer is now set to full size to avoid possible rendering issues
|
||||
* - removed extra tcache_set on OGL spec map code, not sure how that slipped in
|
||||
*
|
||||
* Revision 2.29 2005/07/25 05:24:17 Goober5000
|
||||
* cleaned up some command line and mission flag stuff
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.28 2005/07/23 17:27:50 Goober5000
|
||||
* remove Bobboau's extra warp thing
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.27 2005/05/22 22:47:19 phreak
|
||||
* compile warning fixage.
|
||||
*
|
||||
* Revision 2.26 2005/04/05 05:53:15 taylor
|
||||
* s/vector/vec3d/g, better support for different compilers (Jens Granseuer)
|
||||
*
|
||||
* Revision 2.25 2005/03/25 06:57:33 wmcoolmon
|
||||
* Big, massive, codebase commit. I have not removed the old ai files as the ones I uploaded aren't up-to-date (But should work with the rest of the codebase)
|
||||
*
|
||||
* Revision 2.24 2005/03/19 18:02:33 bobboau
|
||||
* added new graphic functions for state blocks
|
||||
* also added a class formanageing a new effect
|
||||
*
|
||||
* Revision 2.23 2005/01/01 19:47:26 taylor
|
||||
* make use of MR_NO_FOGGING to render models without fog
|
||||
*
|
||||
* Revision 2.22 2004/11/23 19:29:13 taylor
|
||||
* fix 2d warp in D3D, add cmdline option for 3d warp
|
||||
*
|
||||
* Revision 2.21 2004/09/17 07:12:22 Goober5000
|
||||
* changed around the logic for the 3D warp effect
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.20 2004/08/23 04:32:39 Goober5000
|
||||
* warp effect is back to FS2 default
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.19 2004/07/26 20:47:28 Kazan
|
||||
* remove MCD complete
|
||||
*
|
||||
* Revision 2.18 2004/07/17 09:29:13 taylor
|
||||
* make old warpmap and new glow bitmap 3D unlit to render right in OGL
|
||||
*
|
||||
* Revision 2.17 2004/07/12 16:32:46 Kazan
|
||||
* MCD - define _MCD_CHECK to use memory tracking
|
||||
*
|
||||
* Revision 2.16 2004/07/05 05:09:18 bobboau
|
||||
* FVF code, only the data that is needed is sent off to the card,,
|
||||
* OGL can take advantage of this if they want but it won't break
|
||||
* anything if they don't. also state block code has been implemented,
|
||||
* that's totaly internal to D3D no high level code is involved.
|
||||
*
|
||||
* Revision 2.15 2004/05/12 22:49:13 phreak
|
||||
* renamed the warp model variable from 'wm' to 'Warp_model'
|
||||
*
|
||||
* Revision 2.14 2004/05/08 01:08:48 Goober5000
|
||||
* small fix
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.13 2004/03/17 04:07:29 bobboau
|
||||
* 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
|
||||
*
|
||||
* Revision 2.12 2004/03/05 09:02:00 Goober5000
|
||||
* Uber pass at reducing #includes
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.11 2003/11/16 04:09:19 Goober5000
|
||||
* language
|
||||
*
|
||||
* Revision 2.10 2003/11/11 03:56:10 bobboau
|
||||
* lots of bug fixing, much of it in nebula and bitmap drawing
|
||||
*
|
||||
* Revision 2.9 2003/09/26 14:37:13 bobboau
|
||||
* 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.
|
||||
*
|
||||
* Revision 2.8 2003/08/31 06:00:41 bobboau
|
||||
* an asortment of bugfixes, mostly with the specular code,
|
||||
* HUD flickering should be completly gone now
|
||||
*
|
||||
* Revision 2.7 2003/03/19 23:06:40 Goober5000
|
||||
* bit o' housecleaning
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.6 2003/03/19 22:49:32 Goober5000
|
||||
* added some mission flags
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.5 2003/03/19 06:23:27 Goober5000
|
||||
* added warp-effect sexp
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.4 2003/03/18 01:44:30 Goober5000
|
||||
* fixed some misspellings
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.3 2003/01/05 23:41:50 bobboau
|
||||
* disabled decals (for now), removed the warp ray thingys,
|
||||
* made some better error mesages while parseing weapons and ships tbls,
|
||||
* and... oh ya, added glow mapping
|
||||
*
|
||||
* Revision 2.2 2002/11/14 04:18:16 bobboau
|
||||
* added warp model and type 1 glow points
|
||||
* and well as made the new glow file type,
|
||||
* some general improvement to fighter beams,
|
||||
*
|
||||
* Revision 2.1 2002/08/01 01:41:04 penguin
|
||||
* The big include file move
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:22 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
* Revision 1.2 2002/05/03 22:07:08 mharris
|
||||
* got some stuff to compile
|
||||
*
|
||||
* Revision 1.1 2002/05/02 18:03:07 mharris
|
||||
* Initial checkin - converted filenames and includes to lower case
|
||||
*
|
||||
*
|
||||
* 3 7/22/99 1:22p Dave
|
||||
* Enable proper zbuffering for warpin glow effect.
|
||||
*
|
||||
* 2 10/07/98 10:52a Dave
|
||||
* Initial checkin.
|
||||
*
|
||||
* 1 10/07/98 10:48a Dave
|
||||
*
|
||||
* 23 4/08/98 8:20p John
|
||||
* Made "Apex" of warp effect not move.
|
||||
*
|
||||
* 22 3/30/98 4:02p John
|
||||
* Made machines with < 32 MB of RAM use every other frame of certain
|
||||
* bitmaps. Put in code to keep track of how much RAM we've malloc'd.
|
||||
*
|
||||
* 21 3/29/98 12:39p John
|
||||
* Made warp in glow page in
|
||||
*
|
||||
* 20 3/26/98 5:21p John
|
||||
* Added new code to preload all bitmaps at the start of a level.
|
||||
* Commented it out, though.
|
||||
*
|
||||
* 19 3/18/98 12:36p John
|
||||
* Made hardware have nicer looking warp effect
|
||||
*
|
||||
* 18 3/16/98 4:51p John
|
||||
* Added low-level code to clip all polygons against an arbritary plane.
|
||||
* Took out all old model_interp_zclip and used this new method instead.
|
||||
*
|
||||
* 17 3/10/98 4:18p John
|
||||
* Cleaned up graphics lib. Took out most unused gr functions. Made D3D
|
||||
* & Glide have popups and print screen. Took out all >8bpp software
|
||||
* support. Made Fred zbuffer. Made zbuffer allocate dynamically to
|
||||
* support Fred. Made zbuffering key off of functions rather than one
|
||||
* global variable.
|
||||
*
|
||||
* 16 3/04/98 7:07p John
|
||||
* Added debug code to try to normalize a zerolength vector.
|
||||
*
|
||||
* 15 2/26/98 3:28p John
|
||||
* fixed optimize compiler warning
|
||||
*
|
||||
* 14 2/24/98 6:36p John
|
||||
* Made warp effect draw as a 4 poly cone.
|
||||
*
|
||||
* 13 2/22/98 12:19p John
|
||||
* Externalized some strings
|
||||
*
|
||||
* 12 1/15/98 9:07p John
|
||||
* Added noise to warp effect glow.
|
||||
*
|
||||
* 11 1/15/98 4:58p John
|
||||
* Made warp effect use a looping ani. Made the scaling up & down be in
|
||||
* software.
|
||||
*
|
||||
* 10 12/30/97 6:44p John
|
||||
* Made g3_Draw_bitmap functions account for aspect of bitmap.
|
||||
*
|
||||
* 9 12/08/97 11:15a John
|
||||
* added parameter to warpout for life.
|
||||
*
|
||||
* 8 12/05/97 3:46p John
|
||||
* made ship thruster glow scale instead of being an animation.
|
||||
*
|
||||
* 7 12/02/97 3:59p John
|
||||
* Added first rev of thruster glow, along with variable levels of
|
||||
* translucency, which retquired some restructing of palman.
|
||||
*
|
||||
* 6 10/24/97 12:18p John
|
||||
* sped up warp effect by decreasing number of polys with distance.
|
||||
*
|
||||
* 5 9/15/97 5:45p John
|
||||
* took out chunk stuff.
|
||||
* made pofview display thrusters as blue polies.
|
||||
*
|
||||
* 4 9/12/97 4:02p John
|
||||
* put in ship warp out effect.
|
||||
* put in dynamic lighting for warp in/out
|
||||
*
|
||||
* 3 9/09/97 4:49p John
|
||||
* Almost done ship warp in code
|
||||
*
|
||||
* 2 9/08/97 8:39a John
|
||||
* added in code structure for grid
|
||||
*
|
||||
* 1 9/05/97 10:07a John
|
||||
*
|
||||
* $NoKeywords: $
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#include "math/vecmat.h"
|
||||
@@ -318,7 +61,7 @@ void warpin_render(object *obj, matrix *orient, vec3d *pos, int texture_bitmap_n
|
||||
|
||||
if (Warp_glow_bitmap >= 0) {
|
||||
float r = radius;
|
||||
bool render_it = (Cmdline_warp_flash == 1);
|
||||
bool render_it = true;
|
||||
|
||||
#define OUT_PERCENT1 0.80f
|
||||
#define OUT_PERCENT2 0.90f
|
||||
@@ -326,12 +69,15 @@ void warpin_render(object *obj, matrix *orient, vec3d *pos, int texture_bitmap_n
|
||||
#define IN_PERCENT1 0.10f
|
||||
#define IN_PERCENT2 0.20f
|
||||
|
||||
if ( (life_percent >= IN_PERCENT1) && (life_percent < IN_PERCENT2) ) {
|
||||
r *= (life_percent - IN_PERCENT1) / (IN_PERCENT2 - IN_PERCENT1);
|
||||
render_it = true;
|
||||
} else if ( (life_percent >= OUT_PERCENT1) && (life_percent < OUT_PERCENT2) ) {
|
||||
r *= (OUT_PERCENT2 - life_percent) / (OUT_PERCENT2 - OUT_PERCENT1);
|
||||
render_it = true;
|
||||
if (Cmdline_warp_flash)
|
||||
{
|
||||
if ( (life_percent >= IN_PERCENT1) && (life_percent < IN_PERCENT2) ) {
|
||||
r *= (life_percent - IN_PERCENT1) / (IN_PERCENT2 - IN_PERCENT1);
|
||||
//render_it = true;
|
||||
} else if ( (life_percent >= OUT_PERCENT1) && (life_percent < OUT_PERCENT2) ) {
|
||||
r *= (OUT_PERCENT2 - life_percent) / (OUT_PERCENT2 - OUT_PERCENT1);
|
||||
//render_it = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (render_it) {
|
||||
@@ -423,7 +169,7 @@ void warpin_render(object *obj, matrix *orient, vec3d *pos, int texture_bitmap_n
|
||||
gr_set_cull(cull);
|
||||
}
|
||||
|
||||
if (Warp_ball_bitmap > -1) {
|
||||
if (Warp_ball_bitmap > -1 && Cmdline_warp_flash == 1) {
|
||||
flash_ball warp_ball(20, .1f,.25f, &vmd_z_vector, &vmd_zero_vector, 4.0f, 0.5f);
|
||||
float adg = (2.0f * life_percent) - 1.0f;
|
||||
float pct = (powf(adg, 4.0f) - powf(adg, 128.0f)) * 4.0f;
|
||||
|
||||
@@ -0,0 +1,406 @@
|
||||
/*
|
||||
* Created by Hassan "Karajorma" Kazmi for the FreeSpace2 Source Code Project.
|
||||
* You may not sell or otherwise commercially exploit the source or things you
|
||||
* create based on the source.
|
||||
*/
|
||||
|
||||
// AltShipClassDlg.cpp : implementation file
|
||||
//
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "fred.h"
|
||||
#include "AltShipClassDlg.h"
|
||||
#include "globalincs/linklist.h"
|
||||
#include "ship/ship.h"
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define new DEBUG_NEW
|
||||
#undef THIS_FILE
|
||||
static char THIS_FILE[] = __FILE__;
|
||||
#endif
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// AltShipClassDlg dialog
|
||||
|
||||
|
||||
AltShipClassDlg::AltShipClassDlg(CWnd* pParent /*=NULL*/)
|
||||
: CDialog(AltShipClassDlg::IDD, pParent)
|
||||
{
|
||||
//{{AFX_DATA_INIT(AltShipClassDlg)
|
||||
m_selected_variable = -1;
|
||||
m_selected_class = -1;
|
||||
//}}AFX_DATA_INIT
|
||||
|
||||
multi_edit = false;
|
||||
player_ships_only = true;
|
||||
num_string_variables = 0;
|
||||
|
||||
memset(string_variable_indices, -1, sizeof (int)*MAX_SEXP_VARIABLES);
|
||||
memset(ship_class_indices, -1, sizeof (int)*MAX_SHIP_CLASSES);
|
||||
}
|
||||
|
||||
|
||||
void AltShipClassDlg::DoDataExchange(CDataExchange* pDX)
|
||||
{
|
||||
CDialog::DoDataExchange(pDX);
|
||||
//{{AFX_DATA_MAP(AltShipClassDlg)
|
||||
DDX_Control(pDX, IDC_DEFAULT_TO_CLASS, m_default_to_class);
|
||||
DDX_Control(pDX, IDC_ALT_CLASS_LIST, m_alt_class_list);
|
||||
DDX_Control(pDX, IDC_SET_FROM_SHIP_CLASS, m_set_from_ship_class);
|
||||
DDX_Control(pDX, IDC_SET_FROM_VARIABLES, m_set_from_variables);
|
||||
DDX_CBIndex(pDX, IDC_SET_FROM_VARIABLES, m_selected_variable);
|
||||
DDX_CBIndex(pDX, IDC_SET_FROM_SHIP_CLASS, m_selected_class);
|
||||
//}}AFX_DATA_MAP
|
||||
}
|
||||
|
||||
|
||||
BEGIN_MESSAGE_MAP(AltShipClassDlg, CDialog)
|
||||
//{{AFX_MSG_MAP(AltShipClassDlg)
|
||||
ON_BN_CLICKED(IDC_ALT_CLASS_ADD, OnAltClassAdd)
|
||||
ON_BN_CLICKED(IDC_ALT_CLASS_INSERT, OnAltClassInsert)
|
||||
ON_BN_CLICKED(IDC_ALT_CLASS_DELETE, OnAltClassDelete)
|
||||
ON_BN_CLICKED(IDC_ALT_CLASS_UP, OnMoveUp)
|
||||
ON_BN_CLICKED(IDC_ALT_CLASS_DOWN, OnMoveDown)
|
||||
ON_CBN_SELENDOK(IDC_SET_FROM_SHIP_CLASS, OnSelendokSetFromShipClass)
|
||||
ON_CBN_SELENDOK(IDC_SET_FROM_VARIABLES, OnSelendokSetFromVariables)
|
||||
ON_LBN_SELCHANGE(IDC_ALT_CLASS_LIST, OnSelchangeAltClassList)
|
||||
ON_BN_CLICKED(IDC_DEFAULT_TO_CLASS, OnDefaultToClass)
|
||||
//}}AFX_MSG_MAP
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// AltShipClassDlg message handlers
|
||||
|
||||
|
||||
BOOL AltShipClassDlg::OnInitDialog()
|
||||
{
|
||||
int i, count;
|
||||
char buff[TOKEN_LENGTH + TOKEN_LENGTH + 2]; // VariableName[VariableValue]
|
||||
|
||||
CDialog::OnInitDialog();
|
||||
|
||||
// have we got multiple selected ships?
|
||||
num_selected_ships = 0;
|
||||
object *objp;
|
||||
|
||||
objp = GET_FIRST(&obj_used_list);
|
||||
while (objp != END_OF_LIST(&obj_used_list)) {
|
||||
if ((objp->type == OBJ_START) || (objp->type == OBJ_SHIP)) {
|
||||
if (objp->flags & OF_MARKED) {
|
||||
m_selected_ships[num_selected_ships++] = objp->instance;
|
||||
}
|
||||
}
|
||||
objp = GET_NEXT(objp);
|
||||
}
|
||||
|
||||
Assert (num_selected_ships > 0);
|
||||
Assert (Objects[cur_object_index].flags & OF_MARKED);
|
||||
|
||||
if (num_selected_ships > 1)
|
||||
{
|
||||
multi_edit = true;
|
||||
}
|
||||
|
||||
// Fill the variable combo box
|
||||
m_set_from_variables.ResetContent();
|
||||
m_set_from_variables.AddString("Set From Ship Class");
|
||||
for (i=0; i < MAX_SEXP_VARIABLES; i++)
|
||||
{
|
||||
if (Sexp_variables[i].type & SEXP_VARIABLE_STRING)
|
||||
{
|
||||
sprintf(buff, "%s[%s]", Sexp_variables[i].variable_name, Sexp_variables[i].text);
|
||||
m_set_from_variables.AddString(buff);
|
||||
string_variable_indices[num_string_variables++] = i;
|
||||
}
|
||||
}
|
||||
m_set_from_variables.SetCurSel(0);
|
||||
if (!num_string_variables) {
|
||||
m_set_from_variables.EnableWindow(FALSE);
|
||||
}
|
||||
|
||||
// Fill the ship classes combo box
|
||||
m_set_from_ship_class.ResetContent();
|
||||
// Add the default entry if we need one followed by all the ship classes
|
||||
if (num_string_variables) {
|
||||
m_set_from_ship_class.AddString("Set From Variable");
|
||||
}
|
||||
count = 0;
|
||||
for (i=0; i<Num_ship_classes; i++)
|
||||
{
|
||||
if (player_ships_only && !(Ship_info[i].flags & SIF_PLAYER_SHIP)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
ship_class_indices[count++] = i;
|
||||
m_set_from_ship_class.AddString(Ship_info[i].name);
|
||||
}
|
||||
m_set_from_ship_class.SetCurSel(num_string_variables?1:0); // Set to the first ship class
|
||||
|
||||
// Set up the actual list of alt classes
|
||||
alt_class_pool.clear();
|
||||
alt_class_pool = Ships[Objects[cur_object_index].instance].s_alt_classes;
|
||||
alt_class_list_rebuild();
|
||||
|
||||
return TRUE; // return TRUE unless you set the focus to a control
|
||||
// EXCEPTION: OCX Property Pages should return FALSE
|
||||
}
|
||||
|
||||
|
||||
void AltShipClassDlg::alt_class_list_rebuild()
|
||||
{
|
||||
int i, j;
|
||||
char buff[TOKEN_LENGTH + TOKEN_LENGTH + 2]; // VariableName[VariableValue]
|
||||
|
||||
j = m_alt_class_list.GetCount();
|
||||
for ( i=0; i < j ; i++) {
|
||||
m_alt_class_list.DeleteString(0);
|
||||
}
|
||||
|
||||
for (i = 0; i < (int)alt_class_pool.size() ; i++) {
|
||||
// Default classes should be at the end of the list
|
||||
if(alt_class_pool[i].default_to_this_class && (i < (int)alt_class_pool.size() - 1) ) {
|
||||
// Int3();
|
||||
// TO DO : we should fix this.
|
||||
}
|
||||
|
||||
if (alt_class_pool[i].variable_index != -1) {
|
||||
Assert (alt_class_pool[i].variable_index > -1 && alt_class_pool[i].variable_index < MAX_SEXP_VARIABLES);
|
||||
Assert (Sexp_variables[alt_class_pool[i].variable_index].type & SEXP_VARIABLE_STRING);
|
||||
|
||||
sprintf(buff, "%s[%s]", Sexp_variables[alt_class_pool[i].variable_index].variable_name, Sexp_variables[alt_class_pool[i].variable_index].text);
|
||||
|
||||
// add it to the list
|
||||
m_alt_class_list.AddString(buff);
|
||||
}
|
||||
else {
|
||||
if (alt_class_pool[i].ship_class >= 0 && alt_class_pool[i].ship_class < MAX_SHIP_CLASSES) {
|
||||
m_alt_class_list.AddString(Ship_info[alt_class_pool[i].ship_class].name);
|
||||
}
|
||||
else {
|
||||
m_alt_class_list.AddString("Invalid Ship Class");
|
||||
Int3();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void AltShipClassDlg::OnCancel()
|
||||
{
|
||||
// TODO: Add extra cleanup here
|
||||
|
||||
CDialog::OnCancel();
|
||||
}
|
||||
|
||||
void AltShipClassDlg::OnOK()
|
||||
{
|
||||
// TODO: Add extra validation here
|
||||
|
||||
for (int i=0; i < num_selected_ships; i++) {
|
||||
Ships[m_selected_ships[i]].s_alt_classes = alt_class_pool;
|
||||
}
|
||||
|
||||
CDialog::OnOK();
|
||||
}
|
||||
|
||||
void AltShipClassDlg::OnAltClassAdd()
|
||||
{
|
||||
alt_class new_list_item;
|
||||
|
||||
alt_class_update_entry(new_list_item);
|
||||
|
||||
alt_class_pool.push_back(new_list_item);
|
||||
alt_class_list_rebuild();
|
||||
}
|
||||
|
||||
void AltShipClassDlg::OnAltClassInsert()
|
||||
{
|
||||
int index;
|
||||
alt_class new_list_item;
|
||||
alt_class_update_entry(new_list_item);
|
||||
|
||||
index = m_alt_class_list.GetCurSel();
|
||||
|
||||
// If nothing is selected just add it
|
||||
if ( index == -1) {
|
||||
alt_class_pool.push_back(new_list_item);
|
||||
}
|
||||
// Stick it in front of the current selection
|
||||
else {
|
||||
alt_class_pool.insert(alt_class_pool.begin() + index, new_list_item );
|
||||
}
|
||||
|
||||
alt_class_list_rebuild();
|
||||
|
||||
// If we inserted the user will probably want to edit the selection
|
||||
if (index > -1) {
|
||||
m_alt_class_list.SetCurSel(index);
|
||||
}
|
||||
}
|
||||
|
||||
// Updates the currently selected list entry
|
||||
void AltShipClassDlg::alt_class_update_entry(alt_class &list_item)
|
||||
{
|
||||
int index;
|
||||
|
||||
// Add a string variable to the list
|
||||
if (num_string_variables && m_set_from_variables.GetCurSel() > 0) {
|
||||
index = string_variable_indices[m_set_from_variables.GetCurSel() -1];
|
||||
|
||||
Assert (index >= 0);
|
||||
list_item.variable_index = index;
|
||||
list_item.ship_class = ship_info_lookup(Sexp_variables[index].text);
|
||||
}
|
||||
// Add a ship class to the list
|
||||
else {
|
||||
index = m_set_from_ship_class.GetCurSel();
|
||||
|
||||
// Correct the index if the first entry isn't actually a ship class
|
||||
if (num_string_variables) {
|
||||
Assert (index > 0);
|
||||
index--;
|
||||
}
|
||||
|
||||
list_item.variable_index = -1;
|
||||
list_item.ship_class = ship_class_indices[index];
|
||||
}
|
||||
|
||||
// check the default tickbox
|
||||
list_item.default_to_this_class = m_default_to_class.GetCheck() ? true:false;
|
||||
}
|
||||
|
||||
void AltShipClassDlg::OnAltClassDelete()
|
||||
{
|
||||
int index = m_alt_class_list.GetCurSel();
|
||||
|
||||
// Nothing selected
|
||||
if (index == -1) {
|
||||
return;
|
||||
}
|
||||
|
||||
Assert (index < (int) alt_class_pool.size());
|
||||
alt_class_pool.erase(alt_class_pool.begin()+index);
|
||||
alt_class_list_rebuild();
|
||||
}
|
||||
|
||||
void AltShipClassDlg::OnMoveUp()
|
||||
{
|
||||
int index = m_alt_class_list.GetCurSel();
|
||||
|
||||
// Nothing selected or already at the top
|
||||
if (index < 1) {
|
||||
return;
|
||||
}
|
||||
|
||||
std::swap(alt_class_pool[index], alt_class_pool[index-1]);
|
||||
alt_class_list_rebuild();
|
||||
m_alt_class_list.SetCurSel(index-1);
|
||||
}
|
||||
|
||||
void AltShipClassDlg::OnMoveDown()
|
||||
{
|
||||
int index = m_alt_class_list.GetCurSel();
|
||||
|
||||
// Nothing selected or already at the bottom
|
||||
if (index == -1 || (index >= m_alt_class_list.GetCount() - 1) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
std::swap(alt_class_pool[index], alt_class_pool[index++]);
|
||||
alt_class_list_rebuild();
|
||||
m_alt_class_list.SetCurSel(index);
|
||||
}
|
||||
|
||||
void AltShipClassDlg::OnSelendokSetFromShipClass()
|
||||
{
|
||||
int current_selection;
|
||||
|
||||
if (m_set_from_ship_class.GetCurSel() == 0 && num_string_variables) {
|
||||
m_set_from_variables.SetCurSel(1);
|
||||
}
|
||||
else {
|
||||
m_set_from_variables.SetCurSel(0);
|
||||
}
|
||||
|
||||
// if a list entry is selected we should update it
|
||||
current_selection = m_alt_class_list.GetCurSel();
|
||||
if (current_selection >= 0) {
|
||||
alt_class_update_entry(alt_class_pool[m_alt_class_list.GetCurSel()]);
|
||||
alt_class_list_rebuild();
|
||||
}
|
||||
}
|
||||
|
||||
void AltShipClassDlg::OnSelendokSetFromVariables()
|
||||
{
|
||||
int current_selection;
|
||||
|
||||
if (m_set_from_variables.GetCurSel() == 0) {
|
||||
m_set_from_ship_class.SetCurSel(num_string_variables ? 1 : 0);
|
||||
}
|
||||
else {
|
||||
m_set_from_ship_class.SetCurSel(0);
|
||||
}
|
||||
|
||||
// if a list entry is selected we should update it
|
||||
current_selection = m_alt_class_list.GetCurSel();
|
||||
if (current_selection >= 0) {
|
||||
alt_class_update_entry(alt_class_pool[m_alt_class_list.GetCurSel()]);
|
||||
alt_class_list_rebuild();
|
||||
}
|
||||
}
|
||||
|
||||
void AltShipClassDlg::OnSelchangeAltClassList()
|
||||
{
|
||||
int i;
|
||||
int variable_selection = 0;
|
||||
int ship_selection = 0;
|
||||
int index = m_alt_class_list.GetCurSel();
|
||||
|
||||
// Selected nothing
|
||||
if (index == -1) {
|
||||
return;
|
||||
}
|
||||
|
||||
// If we have a variable selected
|
||||
if (alt_class_pool[index].variable_index != -1) {
|
||||
for (i=0; i < MAX_SEXP_VARIABLES; i++)
|
||||
{
|
||||
if (string_variable_indices[i] == alt_class_pool[index].variable_index) {
|
||||
variable_selection = i+1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
// Ship selected
|
||||
else {
|
||||
for (i=0; i < MAX_SHIP_CLASSES; i++) {
|
||||
if (ship_class_indices[i] == alt_class_pool[index].ship_class) {
|
||||
ship_selection = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// if we have string variables in the mission the first entry on the list won't be a ship
|
||||
if (num_string_variables) {
|
||||
ship_selection++;
|
||||
}
|
||||
}
|
||||
|
||||
m_set_from_variables.SetCurSel(variable_selection);
|
||||
m_set_from_ship_class.SetCurSel(ship_selection);
|
||||
m_default_to_class.SetCheck(alt_class_pool[index].default_to_this_class ? 1:0);
|
||||
}
|
||||
|
||||
void AltShipClassDlg::OnDefaultToClass()
|
||||
{
|
||||
int index = m_alt_class_list.GetCurSel();
|
||||
|
||||
// Nothing selected
|
||||
if (index == -1) {
|
||||
return;
|
||||
}
|
||||
|
||||
alt_class_pool[index].default_to_this_class = m_default_to_class.GetCheck() ? true:false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,86 @@
|
||||
/*
|
||||
* Created by Hassan "Karajorma" Kazmi for the FreeSpace2 Source Code Project.
|
||||
* You may not sell or otherwise commercially exploit the source or things you
|
||||
* create based on the source.
|
||||
*/
|
||||
|
||||
#if !defined(AFX_AltShipClassDlg_H__2FE2C917_C7DA_4C05_A11F_DCC46BFB26BB__INCLUDED_)
|
||||
#define AFX_AltShipClassDlg_H__2FE2C917_C7DA_4C05_A11F_DCC46BFB26BB__INCLUDED_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
// AltShipClassDlg.h : header file
|
||||
//
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// AltShipClassDlg dialog
|
||||
|
||||
class AltShipClassDlg : public CDialog
|
||||
{
|
||||
// Construction
|
||||
public:
|
||||
AltShipClassDlg(CWnd* pParent = NULL); // standard constructor
|
||||
|
||||
// Dialog Data
|
||||
//{{AFX_DATA(AltShipClassDlg)
|
||||
enum { IDD = IDD_ALT_SHIP_CLASS };
|
||||
CButton m_default_to_class;
|
||||
CListBox m_alt_class_list;
|
||||
CComboBox m_set_from_ship_class;
|
||||
CComboBox m_set_from_variables;
|
||||
int m_selected_variable;
|
||||
int m_selected_class;
|
||||
//}}AFX_DATA
|
||||
|
||||
|
||||
// Overrides
|
||||
// ClassWizard generated virtual function overrides
|
||||
//{{AFX_VIRTUAL(AltShipClassDlg)
|
||||
protected:
|
||||
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
// Implementation
|
||||
protected:
|
||||
|
||||
// Generated message map functions
|
||||
//{{AFX_MSG(AltShipClassDlg)
|
||||
virtual BOOL OnInitDialog();
|
||||
virtual void OnCancel();
|
||||
virtual void OnOK();
|
||||
afx_msg void OnAltClassAdd();
|
||||
afx_msg void OnAltClassInsert();
|
||||
afx_msg void OnAltClassDelete();
|
||||
afx_msg void OnMoveUp();
|
||||
afx_msg void OnMoveDown();
|
||||
afx_msg void OnSelendokSetFromShipClass();
|
||||
afx_msg void OnSelendokSetFromVariables();
|
||||
afx_msg void OnSelchangeAltClassList();
|
||||
afx_msg void OnDefaultToClass();
|
||||
//}}AFX_MSG
|
||||
DECLARE_MESSAGE_MAP()
|
||||
|
||||
private:
|
||||
|
||||
bool player_ships_only; // Whether we only add player ships to the alt classes or if we can add any ship
|
||||
|
||||
SCP_vector<alt_class> alt_class_pool;
|
||||
int num_string_variables; // Number of string variables in the mission
|
||||
int string_variable_indices[MAX_SEXP_VARIABLES]; // maps string variables to their index in Sexp_variables
|
||||
int ship_class_indices[MAX_SHIP_CLASSES]; // maps ships in the ships combobox to their index in Ship_info
|
||||
|
||||
|
||||
// variables to handle selection of multiple ships
|
||||
bool multi_edit;
|
||||
int m_selected_ships[MAX_SHIPS];
|
||||
int num_selected_ships;
|
||||
|
||||
void AltShipClassDlg::alt_class_list_rebuild();
|
||||
void AltShipClassDlg::alt_class_update_entry(alt_class &list_item);
|
||||
};
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // !defined(AFX_AltShipClassDlg_H__2FE2C917_C7DA_4C05_A11F_DCC46BFB26BB__INCLUDED_)
|
||||
@@ -0,0 +1,116 @@
|
||||
// FictionViewerDlg.cpp : implementation file
|
||||
//
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "fred.h"
|
||||
#include "FictionViewerDlg.h"
|
||||
#include "missionui/fictionviewer.h"
|
||||
#include "gamesnd/eventmusic.h"
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define new DEBUG_NEW
|
||||
#undef THIS_FILE
|
||||
static char THIS_FILE[] = __FILE__;
|
||||
#endif
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// FictionViewerDlg dialog
|
||||
|
||||
|
||||
FictionViewerDlg::FictionViewerDlg(CWnd* pParent /*=NULL*/)
|
||||
: CDialog(FictionViewerDlg::IDD, pParent)
|
||||
{
|
||||
//{{AFX_DATA_INIT(FictionViewerDlg)
|
||||
m_story_file = _T("");
|
||||
m_font_file = _T("");
|
||||
m_fiction_music = 0;
|
||||
//}}AFX_DATA_INIT
|
||||
}
|
||||
|
||||
|
||||
void FictionViewerDlg::DoDataExchange(CDataExchange* pDX)
|
||||
{
|
||||
CDialog::DoDataExchange(pDX);
|
||||
//{{AFX_DATA_MAP(FictionViewerDlg)
|
||||
DDX_Text(pDX, IDC_STORY_FILE, m_story_file);
|
||||
DDX_Text(pDX, IDC_FONT_FILE, m_font_file);
|
||||
DDX_CBIndex(pDX, IDC_FICTION_MUSIC, m_fiction_music);
|
||||
//}}AFX_DATA_MAP
|
||||
}
|
||||
|
||||
|
||||
BEGIN_MESSAGE_MAP(FictionViewerDlg, CDialog)
|
||||
//{{AFX_MSG_MAP(FictionViewerDlg)
|
||||
//}}AFX_MSG_MAP
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// FictionViewerDlg message handlers
|
||||
|
||||
BOOL FictionViewerDlg::OnInitDialog()
|
||||
{
|
||||
int i;
|
||||
CComboBox *box;
|
||||
|
||||
box = (CComboBox *) GetDlgItem(IDC_FICTION_MUSIC);
|
||||
box->AddString("None");
|
||||
for (i=0; i<Num_music_files; i++){
|
||||
box->AddString(Spooled_music[i].name);
|
||||
}
|
||||
|
||||
// init variables
|
||||
m_story_file = _T(fiction_file());
|
||||
m_font_file = _T(fiction_font());
|
||||
m_fiction_music = Mission_music[SCORE_FICTION_VIEWER] + 1;
|
||||
|
||||
CDialog::OnInitDialog();
|
||||
UpdateData(FALSE);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void FictionViewerDlg::OnOK()
|
||||
{
|
||||
UpdateData(TRUE);
|
||||
|
||||
// load it up
|
||||
fiction_viewer_reset();
|
||||
fiction_viewer_load((char *)(LPCSTR) m_story_file, (char *)(LPCSTR) m_font_file);
|
||||
|
||||
// set music
|
||||
Mission_music[SCORE_FICTION_VIEWER] = m_fiction_music - 1;
|
||||
|
||||
CDialog::OnOK();
|
||||
}
|
||||
|
||||
void FictionViewerDlg::OnCancel()
|
||||
{
|
||||
// TODO: Add extra cleanup here
|
||||
|
||||
CDialog::OnCancel();
|
||||
}
|
||||
|
||||
void FictionViewerDlg::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 FictionViewerDlg::query_modified()
|
||||
{
|
||||
return strcmp(m_story_file, fiction_file()) || strcmp(m_font_file, fiction_font()) || m_fiction_music != (Mission_music[SCORE_FICTION_VIEWER] + 1);
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
#if !defined(AFX_FICTIONVIEWERDLG_H__46BAD1B6_F9DC_4414_9C33_18EC17FD491F__INCLUDED_)
|
||||
#define AFX_FICTIONVIEWERDLG_H__46BAD1B6_F9DC_4414_9C33_18EC17FD491F__INCLUDED_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
// FictionViewerDlg.h : header file
|
||||
//
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// FictionViewerDlg dialog
|
||||
|
||||
class FictionViewerDlg : public CDialog
|
||||
{
|
||||
// Construction
|
||||
public:
|
||||
FictionViewerDlg(CWnd* pParent = NULL); // standard constructor
|
||||
int query_modified();
|
||||
void OnOK();
|
||||
void OnCancel();
|
||||
|
||||
// Dialog Data
|
||||
//{{AFX_DATA(FictionViewerDlg)
|
||||
enum { IDD = IDD_FICTION_VIEWER };
|
||||
CString m_story_file;
|
||||
CString m_font_file;
|
||||
int m_fiction_music;
|
||||
//}}AFX_DATA
|
||||
|
||||
|
||||
// Overrides
|
||||
// ClassWizard generated virtual function overrides
|
||||
//{{AFX_VIRTUAL(FictionViewerDlg)
|
||||
protected:
|
||||
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
// Implementation
|
||||
protected:
|
||||
|
||||
// Generated message map functions
|
||||
//{{AFX_MSG(FictionViewerDlg)
|
||||
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_FICTIONVIEWERDLG_H__46BAD1B6_F9DC_4414_9C33_18EC17FD491F__INCLUDED_)
|
||||
@@ -78,8 +78,8 @@ void CAddVariableDlg::OnOK()
|
||||
// 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);
|
||||
// strcpy_s(temp_name, m_variable_name);
|
||||
// strcpy_s(temp_value, m_default_value);
|
||||
// SEXP_VARIABLE_NUMBER SEXP_VARIABLE_STRING
|
||||
// int type;
|
||||
//
|
||||
@@ -285,4 +285,4 @@ void CAddVariableDlg::set_variable_type()
|
||||
((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);
|
||||
}
|
||||
}
|
||||
@@ -7,47 +7,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* $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"
|
||||
@@ -119,9 +79,9 @@ BOOL adjust_grid_dlg::OnInitDialog()
|
||||
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);
|
||||
m_spinx.SetRange(SHRT_MIN, SHRT_MAX);
|
||||
m_spiny.SetRange(SHRT_MIN, SHRT_MAX);
|
||||
m_spinz.SetRange(SHRT_MIN, SHRT_MAX);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
@@ -7,44 +7,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* $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
|
||||
|
||||
@@ -85,4 +85,4 @@ void BackgroundChooser::OnClose()
|
||||
int BackgroundChooser::GetChosenBackground()
|
||||
{
|
||||
return m_chosenBackground;
|
||||
}
|
||||
}
|
||||
+44
-203
@@ -7,201 +7,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Fred2/BgBitmapDlg.cpp $
|
||||
* $Revision: 1.5.2.7 $
|
||||
* $Date: 2007-09-02 02:07:39 $
|
||||
* $Author: Goober5000 $
|
||||
*
|
||||
* Background space images manager dialog
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 1.5.2.6 2007/05/28 18:27:32 wmcoolmon
|
||||
* Added armor support for asteroid, debris, ship, and beam damage
|
||||
*
|
||||
* Revision 1.5.2.5 2006/11/24 22:40:15 Goober5000
|
||||
* FRED again updates backgrounds while the user is editing them
|
||||
*
|
||||
* Revision 1.5.2.4 2006/11/15 00:30:10 taylor
|
||||
* clean up skybox model selection and usage to work better with FRED
|
||||
* make sure to go ahead and set the skybox model when it's set/changed in FRED
|
||||
* go ahead and load/set the envmap when it's set/changed in FRED
|
||||
* get rid of extra envmap image types, only DDS is actually supported (not sure what the hell I was thinking there)
|
||||
*
|
||||
* Revision 1.5.2.3 2006/10/24 13:44:54 taylor
|
||||
* add envmap selection to background editor
|
||||
* change skybox selection to be a text entry or browse instead of only text entry
|
||||
* allow envmap selected in background editor to be used by FRED
|
||||
* make texture replacement work in FRED for ships (Mantis bug #1068)
|
||||
*
|
||||
* Revision 1.5.2.2 2006/08/06 18:47:12 Goober5000
|
||||
* add the multiple background feature
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 1.5.2.1 2006/07/20 21:15:11 karajorma
|
||||
* Fix for Mantis 996
|
||||
*
|
||||
* Revision 1.5 2006/04/20 06:32:01 Goober5000
|
||||
* proper capitalization according to Volition
|
||||
*
|
||||
* Revision 1.4 2006/02/25 21:46:59 Goober5000
|
||||
* spelling
|
||||
*
|
||||
* Revision 1.3 2006/02/20 07:30:14 taylor
|
||||
* updated to newest dynamic starfield code
|
||||
* - this mainly is to just better support SEXP based starfield bitmap changes (preloading, better in-mission stuff loading)
|
||||
* - also fixes index_buffer related double-free()
|
||||
* - done waste memory for env index buffer if env is not enabled
|
||||
* - address a couple of bm load/release issues and comment a little to tell why
|
||||
*
|
||||
* Revision 1.2 2006/01/30 06:27:59 taylor
|
||||
* dynamic starfield bitmaps
|
||||
*
|
||||
* Revision 1.1 2006/01/19 02:27:31 Goober5000
|
||||
* import FRED2 back into fs2_open module
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 1.11 2005/12/22 01:44:43 phreak
|
||||
* Extra error code for background importing
|
||||
*
|
||||
* Revision 1.10 2005/12/21 00:28:43 phreak
|
||||
* Import background button for mission bitmaps.
|
||||
*
|
||||
* Revision 1.9 2005/07/25 06:51:33 Goober5000
|
||||
* mission flag changes for FRED
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 1.8 2005/04/12 02:18:52 phreak
|
||||
* Ambient lighting sliders now work in the background editor.
|
||||
*
|
||||
* Revision 1.7 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.6 2005/03/20 20:23:47 phreak
|
||||
* Get the Background Bitmap Dialog to generate the vertex buffers the background bitmaps need to draw
|
||||
* This will get the backgrounds drawing again.
|
||||
*
|
||||
* Revision 1.5 2004/09/29 17:26:32 Kazan
|
||||
* PreProfDefines.h includes for fred2
|
||||
*
|
||||
* Revision 1.4 2003/10/23 23:52:26 phreak
|
||||
* changed the background bitmap dialog so the user can specify custom skyboxes
|
||||
*
|
||||
* Revision 1.3 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.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
|
||||
*
|
||||
*
|
||||
* 11 7/02/99 4:30p Dave
|
||||
* Much more sophisticated lightning support.
|
||||
*
|
||||
* 10 6/08/99 5:42p Dave
|
||||
* Fixed background bitmap division stuff.
|
||||
*
|
||||
* 9 6/03/99 6:42p Dave
|
||||
*
|
||||
* 8 6/03/99 6:37p Dave
|
||||
* More TNT fun. Made perspective bitmaps more flexible.
|
||||
*
|
||||
* 7 5/09/99 6:00p Dave
|
||||
* Lots of cool new effects. E3 build tweaks.
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* 18 4/13/98 10:25p Hoffoss
|
||||
* Added a flag for subspace missions, and for aboard the Galatea or
|
||||
* Bastion.
|
||||
*
|
||||
* 17 1/14/98 8:56a John
|
||||
* Removed old nebula palette code that didn't matter what HUD colors were
|
||||
* loaded.
|
||||
*
|
||||
* 16 12/08/97 4:48p Hoffoss
|
||||
* Moved starfield editor controls to background editor.
|
||||
*
|
||||
* 15 11/25/97 4:48p Johnson
|
||||
* Fixed bug with nebula selection.
|
||||
*
|
||||
* 14 11/25/97 11:40a Hoffoss
|
||||
* Added support for nebula placement editing.
|
||||
*
|
||||
* 13 11/23/97 6:06p Hoffoss
|
||||
* Renamed background bitmap editor to just background editor.
|
||||
*
|
||||
* 12 11/21/97 2:55p Hoffoss
|
||||
* Added Nebula support to Fred. Implemented loading and saving nebula
|
||||
* info to/from mission files.
|
||||
*
|
||||
* 11 6/11/97 3:26p Hoffoss
|
||||
* Added better verification of bitmap filename to BG editor.
|
||||
*
|
||||
* 10 4/17/97 2:01p Hoffoss
|
||||
* All dialog box window states are saved between sessions now.
|
||||
*
|
||||
* 9 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.
|
||||
*
|
||||
* 8 3/27/97 2:24p Hoffoss
|
||||
* Fixed bug in image not updating when new image selected from listbox of
|
||||
* combo box.
|
||||
*
|
||||
* 7 3/21/97 4:24p Hoffoss
|
||||
* Fixed bug in changing image to an external image file.
|
||||
*
|
||||
* 6 3/17/97 1:54p Hoffoss
|
||||
* fixed bugs in BG editor, and added delete button functionality.
|
||||
*
|
||||
* 5 3/12/97 4:33p Hoffoss
|
||||
* added spin controls to orient editor, light intensity level can be
|
||||
* specified in BG editor.
|
||||
*
|
||||
* 4 2/21/97 5:34p Hoffoss
|
||||
* Added extensive modification detection and fixed a bug in initial
|
||||
* orders 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: $
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#include "stdafx.h"
|
||||
@@ -260,6 +66,12 @@ bg_bitmap_dlg::bg_bitmap_dlg(CWnd* pParent) : CDialog(bg_bitmap_dlg::IDD, pParen
|
||||
b_scale_x = 1.0f; b_scale_y = 1.0f;
|
||||
b_div_x = 1; b_div_y = 1;
|
||||
b_index = -1;
|
||||
m_sky_flag_1 = The_mission.skybox_flags & MR_NO_LIGHTING ? 1 : 0;
|
||||
m_sky_flag_2 = The_mission.skybox_flags & MR_ALL_XPARENT ? 1 : 0;
|
||||
m_sky_flag_3 = The_mission.skybox_flags & MR_NO_ZBUFFER ? 1 : 0;
|
||||
m_sky_flag_4 = The_mission.skybox_flags & MR_NO_CULL ? 1 : 0;
|
||||
m_sky_flag_5 = The_mission.skybox_flags & MR_NO_GLOWMAPS ? 1 : 0;
|
||||
m_sky_flag_6 = The_mission.skybox_flags & MR_FORCE_CLAMP ? 1 : 0;
|
||||
//}}AFX_DATA_INIT
|
||||
}
|
||||
|
||||
@@ -312,6 +124,12 @@ void bg_bitmap_dlg::DoDataExchange(CDataExchange* pDX)
|
||||
DDV_MinMaxInt(pDX, b_div_y, 1, 5);
|
||||
DDX_Text(pDX, IDC_SKYBOX_FNAME, m_skybox_model);
|
||||
DDX_Text(pDX, IDC_ENVMAP, m_envmap);
|
||||
DDX_Check(pDX, IDC_SKY_FLAG_NO_LIGHTING, m_sky_flag_1);
|
||||
DDX_Check(pDX, IDC_SKY_FLAG_XPARENT, m_sky_flag_2);
|
||||
DDX_Check(pDX, IDC_SKY_FLAG_NO_ZBUFF, m_sky_flag_3);
|
||||
DDX_Check(pDX, IDC_SKY_FLAG_NO_CULL, m_sky_flag_4);
|
||||
DDX_Check(pDX, IDC_SKY_FLAG_NO_GLOW, m_sky_flag_5);
|
||||
DDX_Check(pDX, IDC_SKY_FLAG_CLAMP, m_sky_flag_6);
|
||||
//}}AFX_DATA_MAP
|
||||
}
|
||||
|
||||
@@ -542,14 +360,15 @@ void bg_bitmap_dlg::OnClose()
|
||||
}
|
||||
|
||||
// get the bitmap name
|
||||
strcpy(Neb2_texture_name, Neb2_bitmap_filenames[m_neb2_texture]);
|
||||
strcpy_s(Neb2_texture_name, Neb2_bitmap_filenames[m_neb2_texture]);
|
||||
|
||||
// init the nebula
|
||||
neb2_level_init();
|
||||
} else {
|
||||
The_mission.flags &= ~MISSION_FLAG_FULLNEB; Nebula_index = m_nebula_index - 1;
|
||||
The_mission.flags &= ~MISSION_FLAG_FULLNEB;
|
||||
Nebula_index = m_nebula_index - 1;
|
||||
Neb2_awacs = -1.0f;
|
||||
strcpy(Neb2_texture_name, "");
|
||||
strcpy_s(Neb2_texture_name, "");
|
||||
}
|
||||
|
||||
// check for no ship trails -C
|
||||
@@ -580,6 +399,28 @@ void bg_bitmap_dlg::OnClose()
|
||||
string_copy(The_mission.skybox_model, m_skybox_model, NAME_LENGTH, 1);
|
||||
string_copy(The_mission.envmap_name, m_envmap, NAME_LENGTH, 1);
|
||||
|
||||
//store the skybox flags
|
||||
The_mission.skybox_flags = 0;
|
||||
|
||||
if(m_sky_flag_1) {
|
||||
The_mission.skybox_flags |= MR_NO_LIGHTING;
|
||||
}
|
||||
if(m_sky_flag_2) {
|
||||
The_mission.skybox_flags |= MR_ALL_XPARENT;
|
||||
}
|
||||
if(m_sky_flag_3) {
|
||||
The_mission.skybox_flags |= MR_NO_ZBUFFER;
|
||||
}
|
||||
if(m_sky_flag_4) {
|
||||
The_mission.skybox_flags |= MR_NO_CULL;
|
||||
}
|
||||
if(m_sky_flag_5) {
|
||||
The_mission.skybox_flags |= MR_NO_GLOWMAPS;
|
||||
}
|
||||
if(m_sky_flag_6) {
|
||||
The_mission.skybox_flags |= MR_FORCE_CLAMP;
|
||||
}
|
||||
|
||||
// close sun data
|
||||
sun_data_close();
|
||||
|
||||
@@ -820,7 +661,7 @@ void bg_bitmap_dlg::sun_data_save_current()
|
||||
UpdateData(TRUE);
|
||||
|
||||
// store the data
|
||||
strcpy(sle->filename, s_name);
|
||||
strcpy_s(sle->filename, s_name);
|
||||
sle->ang.p = (float) fl_radian(s_pitch);
|
||||
sle->ang.b = (float) fl_radian(s_bank);
|
||||
sle->ang.h = (float) fl_radian(s_heading);
|
||||
@@ -873,7 +714,7 @@ void bg_bitmap_dlg::OnAddSun()
|
||||
sun_data_save_current();
|
||||
|
||||
// select the first sun by default
|
||||
strcpy(sle.filename, stars_get_name_FRED(0, true));
|
||||
strcpy_s(sle.filename, stars_get_name_FRED(0, true));
|
||||
|
||||
sle.ang.p = 0;
|
||||
sle.ang.b = 0;
|
||||
@@ -984,7 +825,7 @@ void bg_bitmap_dlg::bitmap_data_save_current()
|
||||
UpdateData(TRUE);
|
||||
|
||||
// store the data
|
||||
strcpy(sle->filename, b_name);
|
||||
strcpy_s(sle->filename, b_name);
|
||||
sle->ang.p = (float) fl_radian(b_pitch);
|
||||
sle->ang.b = (float) fl_radian(b_bank);
|
||||
sle->ang.h = (float) fl_radian(b_heading);
|
||||
@@ -1040,7 +881,7 @@ void bg_bitmap_dlg::OnAddBitmap()
|
||||
bitmap_data_save_current();
|
||||
|
||||
// select the first bitmap by default
|
||||
strcpy(sle.filename, stars_get_name_FRED(0, false));
|
||||
strcpy_s(sle.filename, stars_get_name_FRED(0, false));
|
||||
|
||||
sle.ang.p = 0;
|
||||
sle.ang.b = 0;
|
||||
@@ -1350,7 +1191,7 @@ void bg_bitmap_dlg::OnImportBackground()
|
||||
if (cfd.DoModal() == IDCANCEL)
|
||||
return;
|
||||
|
||||
strcpy(filename, cfd.GetPathName());
|
||||
strcpy_s(filename, cfd.GetPathName());
|
||||
|
||||
if ((rval = setjmp(parse_abort)) != 0) {
|
||||
mprintf(("BGBITMAPDLG: Unable to parse '%s'! Error code = %i.\n", filename, rval));
|
||||
|
||||
+7
-131
@@ -7,137 +7,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* $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
|
||||
@@ -207,6 +77,12 @@ public:
|
||||
int b_div_x;
|
||||
int b_div_y;
|
||||
int b_index;
|
||||
int m_sky_flag_1;
|
||||
int m_sky_flag_2;
|
||||
int m_sky_flag_3;
|
||||
int m_sky_flag_4;
|
||||
int m_sky_flag_5;
|
||||
int m_sky_flag_6;
|
||||
CString m_skybox_model;
|
||||
CString m_envmap;
|
||||
//}}AFX_DATA
|
||||
|
||||
@@ -7,206 +7,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Fred2/BriefingEditorDlg.cpp $
|
||||
* $Revision: 1.4.2.2 $
|
||||
* $Date: 2007-04-08 08:28:20 $
|
||||
* $Author: karajorma $
|
||||
*
|
||||
* Briefing editor dialog box class.
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 1.4.2.1 2007/03/07 22:36:51 karajorma
|
||||
* Make .ogg selectable in FRED.
|
||||
*
|
||||
* Revision 1.4 2006/05/30 02:13:22 Goober5000
|
||||
* add substitute music boxes to FRED, and reset music properly when mission is cleared
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 1.3 2006/02/04 07:05:03 Goober5000
|
||||
* fixed several IFF bugs in FRED (plus one or two other bugs)
|
||||
* --Goober5000
|
||||
*
|
||||
* 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.13 2006/01/14 05:24:18 Goober5000
|
||||
* first pass at converting FRED to use new IFF stuff
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 1.12 2005/12/29 08:21:00 wmcoolmon
|
||||
* No my widdle FRED, I didn't forget about you ^_^ (codebase commit)
|
||||
*
|
||||
* Revision 1.11 2005/12/29 00:55:25 phreak
|
||||
* Briefing icons are now able to be flipped. Left becomes right and vice versa.
|
||||
*
|
||||
* Revision 1.10 2005/10/22 05:54:48 wmcoolmon
|
||||
* Fixed cf_find_file_location
|
||||
*
|
||||
* Revision 1.9 2005/09/29 05:18:59 Goober5000
|
||||
* the FRED stuff
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 1.8 2005/07/13 01:03:10 Goober5000
|
||||
* improved species support and removed need for #define
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 1.7 2005/04/13 20:11:06 chhogg
|
||||
* Changed vector to vec3d for Fred.
|
||||
*
|
||||
* Revision 1.6 2005/03/06 23:19:27 wmcoolmon
|
||||
* Fixed the last of the jump node errors
|
||||
*
|
||||
* Revision 1.5 2005/03/06 22:43:14 wmcoolmon
|
||||
* Fixx0red some of the jump node errors
|
||||
*
|
||||
* Revision 1.4 2005/01/29 05:40:27 Goober5000
|
||||
* regular docking should work again in FRED now (multiple docking still isn't done yet)
|
||||
* --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
|
||||
*
|
||||
*
|
||||
* 9 7/19/99 3:01p Dave
|
||||
* Fixed icons. Added single transport icon.
|
||||
*
|
||||
* 8 7/18/99 5:19p Dave
|
||||
* Jump node icon. Fixed debris fogging. Framerate warning stuff.
|
||||
*
|
||||
* 7 7/09/99 5:54p Dave
|
||||
* Seperated cruiser types into individual types. Added tons of new
|
||||
* briefing icons. Campaign screen.
|
||||
*
|
||||
* 6 5/20/99 1:46p Andsager
|
||||
* Add briefing view copy and paste between stages
|
||||
*
|
||||
* 5 4/23/99 12:01p Johnson
|
||||
* Added SIF_HUGE_SHIP
|
||||
*
|
||||
* 4 11/30/98 5:32p Dave
|
||||
* Fixed up Fred support for software mode.
|
||||
*
|
||||
* 3 10/16/98 4:28p Andsager
|
||||
* Fix fred dependency
|
||||
*
|
||||
* 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:02p Dave
|
||||
*
|
||||
* 1 10/07/98 3:00p Dave
|
||||
*
|
||||
* 63 5/21/98 4:20p Dave
|
||||
* Fixed bug with briefing editor when no current stage selected.
|
||||
*
|
||||
* 62 5/21/98 12:58a Hoffoss
|
||||
* Fixed warnings optimized build turned up.
|
||||
*
|
||||
* 61 5/14/98 4:47p Hoffoss
|
||||
* Made it so when you switch to a new team's debriefing (via menu), it
|
||||
* updates the camera position to what it should be for new briefing
|
||||
* stage.
|
||||
*
|
||||
* 60 4/30/98 8:23p John
|
||||
* Fixed some bugs with Fred caused by my new cfile code.
|
||||
*
|
||||
* 59 4/22/98 9:56a Sandeep
|
||||
*
|
||||
* 58 4/20/98 4:40p Hoffoss
|
||||
* Added a button to 4 editors to play the chosen wave file.
|
||||
*
|
||||
* 57 4/16/98 2:49p Johnson
|
||||
* Fixed initialization for new icons in briefing.
|
||||
*
|
||||
* 56 4/07/98 6:32p Dave
|
||||
* Fixed function I forget to change back.
|
||||
*
|
||||
* 55 4/07/98 6:27p Dave
|
||||
* Implemented a more boiler-plate solution to the multiple team briefing
|
||||
* problem in this editor.
|
||||
*
|
||||
* 54 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.
|
||||
*
|
||||
* 53 4/06/98 5:37p Hoffoss
|
||||
* Added sexp tree support to briefings in Fred.
|
||||
*
|
||||
* 52 4/06/98 10:43a John
|
||||
* Fixed bugs with inserting/deleting stages
|
||||
*
|
||||
* 51 4/03/98 12:39p Hoffoss
|
||||
* Changed starting directory for browse buttons in several editors.
|
||||
*
|
||||
* 50 4/03/98 11:34a John
|
||||
* Fixed the stuff I broke in Fred from the new briefing
|
||||
*
|
||||
* 49 3/26/98 6:40p Lawrance
|
||||
* Don't store icon text for briefings
|
||||
*
|
||||
* 48 3/21/98 7:36p Lawrance
|
||||
* Move jump nodes to own lib.
|
||||
*
|
||||
* 47 3/19/98 4:24p Hoffoss
|
||||
* Added remaining support for command brief screen (ANI and WAVE file
|
||||
* playing).
|
||||
*
|
||||
* 46 3/17/98 2:00p Hoffoss
|
||||
* Added ability to make an icon from a jump node in briefing editor.
|
||||
*
|
||||
* 45 2/18/98 6:44p Hoffoss
|
||||
* Added support for lines between icons in briefings for Fred.
|
||||
*
|
||||
* 44 2/09/98 9:25p Allender
|
||||
* team v team support. multiple pools and briefings
|
||||
*
|
||||
* 43 2/04/98 4:31p Allender
|
||||
* support for multiple briefings and debriefings. Changes to mission
|
||||
* type (now a bitfield). Bitfield defs for multiplayer modes
|
||||
*
|
||||
* 42 1/28/98 7:19p Lawrance
|
||||
* Get fading/highlighting animations working
|
||||
*
|
||||
* 41 12/28/97 5:52p Lawrance
|
||||
* Add support for debriefing success/fail music.
|
||||
*
|
||||
* 40 11/04/97 4:33p Hoffoss
|
||||
* Made saving keep the current briefing state intact.
|
||||
*
|
||||
* 39 11/04/97 11:31a Duncan
|
||||
* Made make icon button gray if at max icons already.
|
||||
*
|
||||
* 38 11/03/97 4:07p Jasen
|
||||
* Fixed bug in briefing editor caused by changes in TEAM_* defines in the
|
||||
* past and whoever made these changes failed to update this editor along
|
||||
* with it.
|
||||
*
|
||||
* 37 10/19/97 11:32p Hoffoss
|
||||
* Added support for briefing cuts in Fred.
|
||||
*
|
||||
* 36 10/12/97 11:23p Mike
|
||||
* About ten fixes/changes in the docking system.
|
||||
* Also, renamed SIF_REARM_REPAIR to SIF_SUPPORT.
|
||||
*
|
||||
* 35 9/30/97 5:56p Hoffoss
|
||||
* Added music selection combo boxes to Fred.
|
||||
*
|
||||
* $NoKeywords: $
|
||||
*/
|
||||
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "FRED.h"
|
||||
@@ -226,6 +27,7 @@
|
||||
#include "object/objectdock.h"
|
||||
#include "iff_defs/iff_defs.h"
|
||||
#include "sound/audiostr.h"
|
||||
#include "localization/localize.h"
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define new DEBUG_NEW
|
||||
@@ -365,6 +167,11 @@ void briefing_editor_dlg::OnInitMenu(CMenu* pMenu)
|
||||
// put a check next to the currently selected item
|
||||
m->CheckMenuItem(m_current_briefing, MF_BYPOSITION | MF_CHECKED );
|
||||
|
||||
// Karajorma - it might be nice to autobalance the briefings and debriefings but I'm not doing anything till I
|
||||
// understand how the how system works better. disabling the option for now.
|
||||
m = pMenu->GetSubMenu(1);
|
||||
m->EnableMenuItem(ID_AUTOBALANCE, MF_GRAYED);
|
||||
|
||||
CDialog::OnInitMenu(pMenu);
|
||||
}
|
||||
|
||||
@@ -508,10 +315,11 @@ void briefing_editor_dlg::update_data(int update)
|
||||
Briefing = save_briefing;
|
||||
|
||||
Mission_music[SCORE_BRIEFING] = m_briefing_music - 1;
|
||||
strcpy(The_mission.substitute_briefing_music_name, m_substitute_briefing_music);
|
||||
strcpy_s(The_mission.substitute_briefing_music_name, m_substitute_briefing_music);
|
||||
if (m_last_stage >= 0) {
|
||||
ptr = &Briefing->stages[m_last_stage];
|
||||
deconvert_multiline_string(buf3, m_text, MAX_BRIEF_LEN);
|
||||
lcl_fred_replace_stuff(buf3, MAX_BRIEF_LEN);
|
||||
if (stricmp(ptr->new_text, buf3))
|
||||
set_modified();
|
||||
|
||||
@@ -564,6 +372,18 @@ void briefing_editor_dlg::update_data(int update)
|
||||
break;
|
||||
}
|
||||
|
||||
//WMC - Safeguard against broken lines
|
||||
i = ptr->num_lines;
|
||||
while(i--)
|
||||
{
|
||||
if(ptr->lines[i].start_icon < 0 || ptr->lines[i].end_icon < 0 || ptr->lines[i].start_icon >= ptr->num_icons || ptr->lines[i].end_icon >= ptr->num_icons)
|
||||
{
|
||||
ptr->num_lines--;
|
||||
for(l = i; l < ptr->num_lines; l++)
|
||||
ptr->lines[l] = ptr->lines[l+1];
|
||||
}
|
||||
}
|
||||
|
||||
if (m_last_icon >= 0) {
|
||||
valid = (m_id != ptr->icons[m_last_icon].id);
|
||||
if (m_id >= 0) {
|
||||
@@ -609,10 +429,10 @@ void briefing_editor_dlg::update_data(int update)
|
||||
set_modified();
|
||||
reset_icon_loop(m_last_stage);
|
||||
while (get_next_icon(m_id))
|
||||
strcpy(iconp->label, buf);
|
||||
strcpy_s(iconp->label, buf);
|
||||
}
|
||||
|
||||
strcpy(ptr->icons[m_last_icon].label, buf);
|
||||
strcpy_s(ptr->icons[m_last_icon].label, buf);
|
||||
if ( m_hilight )
|
||||
ptr->icons[m_last_icon].flags |= BI_HIGHLIGHT;
|
||||
else
|
||||
@@ -653,10 +473,10 @@ void briefing_editor_dlg::update_data(int update)
|
||||
set_modified();
|
||||
reset_icon_loop(m_last_stage);
|
||||
while (get_next_icon(m_id))
|
||||
strcpy(iconp->text, buf2);
|
||||
strcpy_s(iconp->text, buf2);
|
||||
}
|
||||
|
||||
strcpy(ptr->icons[m_last_icon].text, buf2);
|
||||
strcpy_s(ptr->icons[m_last_icon].text, buf2);
|
||||
*/
|
||||
}
|
||||
}
|
||||
@@ -1034,7 +854,7 @@ void briefing_editor_dlg::copy_stage(int from, int to)
|
||||
{
|
||||
if ((from < 0) || (from >= Briefing->num_stages)) {
|
||||
strcpy(Briefing->stages[to].new_text, "<Text here>");
|
||||
strcpy(Briefing->stages[to].voice, "none.wav");
|
||||
strcpy_s(Briefing->stages[to].voice, "none.wav");
|
||||
Briefing->stages[to].camera_pos = view_pos;
|
||||
Briefing->stages[to].camera_orient = view_orient;
|
||||
Briefing->stages[to].camera_time = 500;
|
||||
@@ -1045,7 +865,7 @@ void briefing_editor_dlg::copy_stage(int from, int to)
|
||||
|
||||
// Copy all the data in the stage structure.
|
||||
strcpy( Briefing->stages[to].new_text, Briefing->stages[from].new_text );
|
||||
strcpy( Briefing->stages[to].voice, Briefing->stages[from].voice );
|
||||
strcpy_s( Briefing->stages[to].voice, Briefing->stages[from].voice );
|
||||
Briefing->stages[to].camera_pos = Briefing->stages[from].camera_pos;
|
||||
Briefing->stages[to].camera_orient = Briefing->stages[from].camera_orient;
|
||||
Briefing->stages[to].camera_time = Briefing->stages[from].camera_time;
|
||||
@@ -1517,7 +1337,7 @@ void briefing_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);
|
||||
*pResult = m_tree.end_label_edit(pTVDispInfo->item);
|
||||
}
|
||||
|
||||
BOOL briefing_editor_dlg::DestroyWindow()
|
||||
|
||||
@@ -7,130 +7,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* $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__
|
||||
|
||||
@@ -181,7 +181,7 @@ void campaign_editor::load_campaign()
|
||||
load_tree(0);
|
||||
|
||||
if (!strlen(Campaign.filename))
|
||||
strcpy(Campaign.filename, BUILTIN_CAMPAIGN);
|
||||
strcpy_s(Campaign.filename, BUILTIN_CAMPAIGN);
|
||||
|
||||
if (mission_campaign_load(Campaign.filename, NULL, 0)) {
|
||||
MessageBox("Couldn't open Campaign file!", "Error");
|
||||
@@ -353,9 +353,9 @@ void campaign_editor::load_tree(int save_first)
|
||||
m_num_links++;
|
||||
|
||||
if (Links[i].from == Links[i].to) {
|
||||
strcpy(text, "Repeat mission");
|
||||
strcpy_s(text, "Repeat mission");
|
||||
} else if ( (Links[i].to == -1) && (Links[i].from != -1) ) {
|
||||
strcpy(text, "End of Campaign");
|
||||
strcpy_s(text, "End of Campaign");
|
||||
} else {
|
||||
sprintf(text, "Branch to %s", Campaign.missions[Links[i].to].name);
|
||||
}
|
||||
@@ -400,7 +400,7 @@ 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);
|
||||
*pResult = m_tree.end_label_edit(pTVDispInfo->item);
|
||||
}
|
||||
|
||||
int campaign_editor::handler(int code, int node, char *str)
|
||||
|
||||
@@ -48,13 +48,14 @@ 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(2000, mission_filenames, CF_TYPE_MISSIONS, "*.fs2");
|
||||
num_files = cf_get_file_list_preallocated(2000, mission_filenames_arr, mission_filenames, CF_TYPE_MISSIONS, "*.fs2");
|
||||
Skip_packfile_search = 0;
|
||||
|
||||
i=0;
|
||||
|
||||
@@ -148,7 +148,7 @@ void campaign_tree_view::OnDraw(CDC* pDC)
|
||||
Elements[i].box.top = y - By / 2;
|
||||
Elements[i].box.bottom = Elements[i].box.top + By;
|
||||
|
||||
strcpy(str, Campaign.missions[i].name);
|
||||
strcpy_s(str, Campaign.missions[i].name);
|
||||
str[strlen(str) - 4] = 0; // strip extension from filename
|
||||
GetTextExtentPoint32(pDC->m_hDC, str, strlen(str), &size);
|
||||
if (size.cx > CELL_TEXT_WIDTH) {
|
||||
|
||||
@@ -7,142 +7,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* $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"
|
||||
@@ -381,7 +246,7 @@ void campaign_tree_wnd::OnCpgnFileNew()
|
||||
Campaign.filename[0] = 0;
|
||||
Campaign.num_missions = 0;
|
||||
Campaign.num_players = 0;
|
||||
strcpy(Campaign.name, "Unnamed");
|
||||
strcpy_s(Campaign.name, "Unnamed");
|
||||
Campaign.desc = NULL;
|
||||
Campaign_tree_viewp->free_links();
|
||||
Campaign_tree_formp->initialize();
|
||||
@@ -561,7 +426,7 @@ int campaign_tree_wnd::fred_check_sexp(int sexp, int type, char *msg, ...)
|
||||
if (!z)
|
||||
return 0;
|
||||
|
||||
convert_sexp_to_string(sexp, buf2, SEXP_ERROR_CHECK_MODE);
|
||||
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);
|
||||
|
||||
|
||||
@@ -7,76 +7,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* $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
|
||||
@@ -137,4 +68,4 @@ public:
|
||||
extern int Mission_filename_cb_format;
|
||||
extern int Campaign_modified;
|
||||
extern int Bypass_clear_mission;
|
||||
extern campaign_tree_wnd *Campaign_wnd;
|
||||
extern campaign_tree_wnd *Campaign_wnd;
|
||||
+5
-64
@@ -7,74 +7,14 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* $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"
|
||||
#include "localization/localize.h"
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define new DEBUG_NEW
|
||||
@@ -158,6 +98,7 @@ void cmd_brief_dlg::update_data(int update)
|
||||
free(last_cmd_brief->stage[m_last_stage].text);
|
||||
|
||||
deconvert_multiline_string(buf, m_text, CMD_BRIEF_TEXT_MAX);
|
||||
lcl_fred_replace_stuff(buf, 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);
|
||||
@@ -323,8 +264,8 @@ 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");
|
||||
strcpy_s(Cur_cmd_brief->stage[to].ani_filename, "<default>");
|
||||
strcpy_s(Cur_cmd_brief->stage[to].wave_filename, "none");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
+1
-45
@@ -7,51 +7,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* $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"
|
||||
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
#include "object/waypoint.h"
|
||||
#include "globalincs/linklist.h"
|
||||
#include "parse/parselo.h"
|
||||
#include "iff_defs/iff_defs.h"
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define new DEBUG_NEW
|
||||
@@ -56,7 +57,7 @@ END_MESSAGE_MAP()
|
||||
|
||||
void create_wing_dlg::OnOK()
|
||||
{
|
||||
char msg[512];
|
||||
CString msg;
|
||||
int i;
|
||||
object *ptr;
|
||||
|
||||
@@ -70,14 +71,14 @@ void create_wing_dlg::OnOK()
|
||||
|
||||
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);
|
||||
msg.Format("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) {
|
||||
if ((ptr->type == OBJ_SHIP) || (ptr->type == OBJ_START)){
|
||||
i = ptr->instance;
|
||||
if (!strnicmp(m_name, Ships[i].ship_name, strlen(m_name))) {
|
||||
char *namep;
|
||||
@@ -103,11 +104,33 @@ void create_wing_dlg::OnOK()
|
||||
ptr = GET_NEXT(ptr);
|
||||
}
|
||||
|
||||
for (i=0; i<MAX_WAYPOINT_LISTS; i++)
|
||||
for (i=0; i<Num_iffs; i++) {
|
||||
if (!stricmp(m_name, Iff_info[i].iff_name)) {
|
||||
msg.Format("The name \"%s\" is already being used by a team", m_name);
|
||||
MessageBox(msg);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
for ( i=0; i < (int)Ai_tp_list.size(); i++) {
|
||||
if (!stricmp(m_name, Ai_tp_list[i].name)) {
|
||||
msg.Format("The name \"%s\" is already being used by a target priority group", m_name);
|
||||
MessageBox(msg);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (!stricmp(m_name.Left(1), "<")) {
|
||||
MessageBox("Wing names not allowed to begin with <");
|
||||
return;
|
||||
}
|
||||
|
||||
CDialog::OnOK();
|
||||
}
|
||||
@@ -117,20 +117,20 @@ void CustomWingNames::OnOK()
|
||||
|
||||
|
||||
// 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);
|
||||
strcpy_s(Starting_wing_names[0], m_starting_1);
|
||||
strcpy_s(Starting_wing_names[1], m_starting_2);
|
||||
strcpy_s(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);
|
||||
strcpy_s(Squadron_wing_names[0], m_squadron_1);
|
||||
strcpy_s(Squadron_wing_names[1], m_squadron_2);
|
||||
strcpy_s(Squadron_wing_names[2], m_squadron_3);
|
||||
strcpy_s(Squadron_wing_names[3], m_squadron_4);
|
||||
strcpy_s(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);
|
||||
strcpy_s(TVT_wing_names[0], m_tvt_1);
|
||||
strcpy_s(TVT_wing_names[1], m_tvt_2);
|
||||
|
||||
update_custom_wing_indexes();
|
||||
|
||||
|
||||
@@ -7,118 +7,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* $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"
|
||||
@@ -128,6 +17,7 @@
|
||||
#include "parse/sexp.h"
|
||||
#include "cfile/cfile.h"
|
||||
#include "sound/audiostr.h"
|
||||
#include "localization/localize.h"
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define new DEBUG_NEW
|
||||
@@ -211,6 +101,11 @@ void debriefing_editor_dlg::OnInitMenu(CMenu* pMenu)
|
||||
// put a check next to the currently selected item
|
||||
m->CheckMenuItem(m_current_debriefing, MF_BYPOSITION | MF_CHECKED );
|
||||
|
||||
// Karajorma - it might be nice to autobalance the briefings and debriefings but I'm not doing anything till I
|
||||
// understand how the how system works better. disabling the option for now.
|
||||
m = pMenu->GetSubMenu(1);
|
||||
m->EnableMenuItem(ID_AUTOBALANCE, MF_GRAYED);
|
||||
|
||||
CDialog::OnInitMenu(pMenu);
|
||||
}
|
||||
|
||||
@@ -278,7 +173,9 @@ void debriefing_editor_dlg::update_data(int update)
|
||||
|
||||
ptr->formula = m_tree.save_tree();
|
||||
deconvert_multiline_string(ptr->new_text, m_text, MAX_DEBRIEF_LEN);
|
||||
lcl_fred_replace_stuff(ptr->new_text, MAX_DEBRIEF_LEN);
|
||||
deconvert_multiline_string(ptr->new_recommendation_text, m_rec_text, MAX_RECOMMENDATION_LEN);
|
||||
lcl_fred_replace_stuff(ptr->new_recommendation_text,MAX_RECOMMENDATION_LEN);
|
||||
string_copy(ptr->voice, m_voice, MAX_FILENAME_LEN);
|
||||
}
|
||||
|
||||
@@ -459,7 +356,7 @@ 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");
|
||||
strcpy_s(Debriefing->stages[to].voice, "none.wav");
|
||||
Debriefing->stages[to].formula = -1;
|
||||
return;
|
||||
}
|
||||
@@ -471,7 +368,7 @@ void debriefing_editor_dlg::copy_stage(int from, int to, int clear_formula)
|
||||
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_s( Debriefing->stages[to].voice, Debriefing->stages[from].voice );
|
||||
strcpy( Debriefing->stages[to].new_recommendation_text, Debriefing->stages[from].new_recommendation_text );
|
||||
}
|
||||
|
||||
@@ -497,7 +394,7 @@ 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);
|
||||
*pResult = m_tree.end_label_edit(pTVDispInfo->item);
|
||||
}
|
||||
|
||||
void debriefing_editor_dlg::OnClose()
|
||||
|
||||
@@ -7,67 +7,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* $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
|
||||
|
||||
+1
-31
@@ -7,37 +7,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* $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"
|
||||
|
||||
+1
-35
@@ -7,41 +7,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* $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
|
||||
|
||||
@@ -520,7 +520,7 @@ void DumpStats::get_ship_weapon_selection(CString &buffer)
|
||||
buffer += temp;
|
||||
|
||||
// ships
|
||||
for (j=0; j<Team_data[i].number_choices; j++) {
|
||||
for (j=0; j<Team_data[i].num_ship_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;
|
||||
|
||||
@@ -535,11 +535,11 @@ void DumpStats::get_ship_weapon_selection(CString &buffer)
|
||||
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;
|
||||
}
|
||||
for (j=0; j<Team_data[i].num_weapon_choices; j++) {
|
||||
//if (Team_data[i].weaponry_pool[j] > 0)
|
||||
temp.Format("\tWeapon name: %s, count %d\r\n", Weapon_info[Team_data[i].weaponry_pool[j]].name, Team_data[i].weaponry_count[j]);
|
||||
buffer += temp;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loaded 100 of 903 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user