Compare commits

...
Author SHA1 Message Date
Goober5000 1be8163269 revert the directory move 2008-02-09 21:33:46 +00:00
Goober5000 4c326553b1 remove extraneous fs2_open folder from all branches and tags 2008-02-09 19:21:05 +00:00
(no author) 57978fdc75 This commit was manufactured by cvs2svn to create tag 'fs2_open_3_3'. 2002-11-10 20:40:03 +00:00
inquisitor d860dc0011 Bumped to 3.3 2002-11-10 20:40:02 +00:00
DTP d5d8e66dee DTP bumped back MAX_SHIP_TYPES to 130 2002-11-10 19:57:36 +00:00
DTP ad4843b8ea -DTP reworked mod support, 2002-11-10 16:32:42 +00:00
DTP 3162ede091 -DTP reworked mod support, 2002-11-10 16:30:53 +00:00
phreak f9e3871b3e Parser error handling for fighter flak, it didn't want flak on player weapons, now it doesn't care 2002-11-06 23:22:05 +00:00
phreak 53abc32182 Fighter flak code, it doesn't blow up in your face anymore! 2002-11-06 23:21:06 +00:00
DTP 39267bcb05 Made sure, that VP and Plain files dont get added twice to the search order. Side-effect of Mod support. 2002-11-04 08:32:38 +00:00
DTP 7398df34ec DOh,uhmm, define error again, this is getting to me. 2002-11-02 23:06:59 +00:00
DTP 62c8792c2a DOh, fixed that define, learn to count DTP :) 2002-11-02 23:04:46 +00:00
inquisitor e561a547a7 Cleaned up the presentation a little, added HLP and VW, and, no offense to Kazan, removed Kazan. 2002-11-02 22:25:26 +00:00
DTP 5128907c07 DOH forgot \n 2002-11-02 22:11:35 +00:00
DTP 5ddef96ccc shameless self promotion 2002-11-02 22:10:48 +00:00
DTP e75251141a DTP Bumped Max_exited_ships from 200 to double that of MAX_SHIPS = 800 . make sense ehh. for logging effect. 2002-10-31 21:56:44 +00:00
DTP 4f419025fe DTP Quickly added something needed to cmdline.h, since otherwise we can not compile the code as it misses some externals. Thought a rollback rolled all back. 2002-10-31 21:14:16 +00:00
penguin c6cf69e4a3 Hopelessly out of date, and only applied to Linux anyhow 2002-10-31 03:49:35 +00:00
penguin 10e444df95 updated 2002-10-31 03:46:27 +00:00
inquisitor eeab39d62d Bad Committ, Rolling back 2002-10-30 20:22:30 +00:00
DTP 28e46d411b doh!, used upper case in include, dont know how much it matters for *nix systems, but here it is 2002-10-30 06:31:05 +00:00
DTP 1195eb3ada DTP Implemented basic VP files handling. mission and campaign files inside VP files found in mod dir still not supported, cheking / creating directories not implented either 2002-10-30 06:26:11 +00:00
sesquipedalian 5f779fae4c no message 2002-10-29 22:41:48 +00:00
DTP cdb274654e Crap, somebody may restore cmdline.h to 2 version before this. 2002-10-28 02:28:52 +00:00
DTP b486c02ac8 DTP; started basic implementation of mod-support
plain files only for now. fs2_open.exe -mod X will look for files in fs2/ X /all-legal-subdirectories. no checking/creating dirs yet. directories must be there.
2002-10-27 23:59:28 +00:00
randomtiger 9bcb08776c Made Phreaks alternative scanning style optional under the command line tag "-phreak"
Fixed bug that changes HUD colour when targetting debris in a full nebula. - RT
2002-10-22 23:02:40 +00:00
randomtiger d36c788e00 Fixed lighting bug that caused special pause to crash on debug build.
Also added TAB functionality for special pause that toggles HUD. - RT
2002-10-22 17:42:09 +00:00
bobboau 00bbac6ae1 inital commit, trying to get most of my stuff into FSO, there should be most of my fighter beam, beam rendering, beam sheild hit, ABtrails, and ssm stuff. one thing you should be happy to know is the beam texture tileing is now set in the beam section section of the weapon table entry 2002-10-19 19:29:29 +00:00
randomtiger 40db1ce831 Added special pause mode for easier action screenshots.
Added new command line parameter for accessing all single missions in tech room. - RT
2002-10-19 03:50:29 +00:00
randomtiger bbf18d5667 Added ability to remove HUD ingame on keypress shift O
So I've added a new key to the bind list and made use of already existing hud removal code.
2002-10-17 20:40:51 +00:00
phreak 377f78db0f screenshots, yay! 2002-10-14 19:49:08 +00:00
phreak ad96da3537 further optimizations 2002-10-13 21:43:24 +00:00
phreak db8cf9134f fixed text 2002-10-12 17:48:11 +00:00
phreak 0d65873a0b dont use this one 2002-10-11 21:35:51 +00:00
phreak c38ff6302d first run at opengl for w32, only useful in main hall, barracks and campaign room 2002-10-11 21:31:17 +00:00
randomtiger abc9a3ddb1 Added us fs2_open people to the credits. Worth looking at just for that.
Added timer bar code, by default its not compiled in.
Use TIMEBAR_ACTIVE in project and dependancy code settings to activate.
Added the new timebar files with the new code.
2002-10-05 16:46:10 +00:00
phreak 650c4dea46 did glare stuff in game_sunspot_process() 2002-09-20 20:09:01 +00:00
phreak a2d1cf8f37 glare parser stuff in stars_init() 2002-09-20 20:05:29 +00:00
phreak 23c449af6c added glare variable for ambient suns
if glare is 0 then the sun glare whiteout is not shown when looking at the sun
2002-09-20 20:04:54 +00:00
phreak 2d548f46bf lead indicator for dumbfire missiles 2002-09-20 20:02:00 +00:00
phreak c3c4ce064c extra effects during cargo scan 2002-09-20 20:01:30 +00:00
randomtiger fb7a0d5257 Tiny change to DX branch to keep movie code optional (default off) 2002-08-28 21:47:02 +00:00
randomtiger f8351a9818 Woh! I sure as hell didnt modify all these files it says I did.
I will put this down to the branch! Note: I did start from a fresh checkout!
2002-08-28 10:51:04 +00:00
penguin 5aefddd246 Moved DirectX8 stuff to directx8 branch; reverted to previous 2002-08-27 13:38:58 +00:00
randomtiger facefe5872 Added new lib files: strmiids and ddraw to get dshow working
Added new command line parameter to active direct show movie play: -dshowvid
Uncommented movie_play calls and includes
2002-08-18 19:48:29 +00:00
penguin ef794efbb3 Added #include, needed for FRED 2002-08-15 04:41:17 +00:00
penguin 573a1f2fa3 updated 2002-08-13 04:31:25 +00:00
penguin a763d84b56 1. Disable CD checking
2. Add CVS tag to version string
2002-08-13 03:34:00 +00:00
penguin c06ccbb602 Bumped to version 3.2 2002-08-13 03:32:25 +00:00
drevil ffd8a5ae2a Rebuilding admin files 2002-08-11 23:08:20 +00:00
drevil aa753d5d6e Trash syncmail, it's worthless, use logaccum stuff instead 2002-08-11 23:05:15 +00:00
drevil 1cf042064f Yet more updates for syncmail 2002-08-11 22:36:01 +00:00
drevil a4e14a94d2 Correct arguments to syncmail 2002-08-11 22:22:35 +00:00
drevil 5871d644cc Change which module syncinfo "hooks" to 2002-08-11 22:20:56 +00:00
drevil 145a149873 Updated syncmail to current CVS version 2002-08-11 22:17:16 +00:00
drevil 7492c51ee6 corrected path to syncmail 2002-08-11 22:04:47 +00:00
drevil be4954a69e Adding syncmail cvs commit notification 2002-08-11 22:02:45 +00:00
DTP 875a95b82e Implented -GF4FIX commandline switch & #include "cmdline/cmdline.h" 2002-08-07 00:45:25 +00:00
DTP f6b129577b Implented -GF4FIX commandline switch 2002-08-07 00:44:13 +00:00
penguin 4d30bbba3e Updated 2002-08-06 21:21:42 +00:00
phreak 8823dc67eb added wireframe targetbox feature 2002-08-06 16:50:44 +00:00
phreak 8690c9d7f6 added Targetbox_wire variable to check what mode the
hud targetbox uses
2002-08-06 16:50:13 +00:00
phreak f70d242903 added keybing for wireframe hud,
fixed previous missile cheat
2002-08-06 16:49:22 +00:00
penguin 5b4306dbd6 Use text strings for wingmen names instead of ANI 2002-08-06 04:39:26 +00:00
penguin 013870fc6a inserted "class" keyword on "friend" definitions (ANSI C++ ) 2002-08-06 03:50:48 +00:00
penguin 0e3d4e562f Fixed problem w/ compile options for Debug mode 2002-08-06 02:43:02 +00:00
penguin 48d1ec4575 Removed a couple more include dirs I missed 2002-08-06 01:49:47 +00:00
penguin 32ad077676 Renamed ccode members to cc_or and cc_and 2002-08-06 01:49:08 +00:00
penguin 9942308fc8 Moved ChangeLog to top-level directory 2002-08-04 05:43:13 +00:00
80 changed files with 7120 additions and 975 deletions

No files matched your search

-13
View File
@@ -1,13 +0,0 @@
# The "checkoutlist" file is used to support additional version controlled
# administrative files in $CVSROOT/CVSROOT, such as template files.
#
# The first entry on a line is a filename which will be checked out from
# the corresponding RCS file in the $CVSROOT/CVSROOT directory.
# The remainder of the line is an error message to use if the file cannot
# be checked out.
#
# File format:
#
# [<whitespace>]<filename><whitespace><error message><end-of-line>
#
# comment lines begin with '#'
-15
View File
@@ -1,15 +0,0 @@
# The "commitinfo" file is used to control pre-commit checks.
# The filter on the right is invoked with the repository and a list
# of files to check. A non-zero exit of the filter program will
# cause the commit to be aborted.
#
# The first entry on a line is a regular expression which is tested
# against the directory that the change is being committed to, relative
# to the $CVSROOT. For the first match that is found, then the remainder
# of the line is the name of the filter to run.
#
# If the repository name does not match any of the regular expressions in this
# file, the "DEFAULT" line is used, if it is specified.
#
# If the name "ALL" appears as a regular expression it is always used
# in addition to the first matching regex or "DEFAULT".
-14
View File
@@ -1,14 +0,0 @@
# Set this to "no" if pserver shouldn't check system users/passwords
#SystemAuth=no
# Put CVS lock files in this directory rather than directly in the repository.
#LockDir=/var/lock/cvs
# Set `TopLevelAdmin' to `yes' to create a CVS directory at the top
# level of the new working directory when using the `cvs checkout'
# command.
#TopLevelAdmin=no
# Set `LogHistory' to `all' or `TOFEWGCMAR' to log all transactions to the
# history file, or a subset as needed (ie `TMAR' logs all write operations)
#LogHistory=TOFEWGCMAR
-23
View File
@@ -1,23 +0,0 @@
# This file affects handling of files based on their names.
#
# The -t/-f options allow one to treat directories of files
# as a single file, or to transform a file in other ways on
# its way in and out of CVS.
#
# The -m option specifies whether CVS attempts to merge files.
#
# The -k option specifies keyword expansion (e.g. -kb for binary).
#
# Format of wrapper file ($CVSROOT/CVSROOT/cvswrappers or .cvswrappers)
#
# wildcard [option value][option value]...
#
# where option is one of
# -f from cvs filter value: path to filter
# -t to cvs filter value: path to filter
# -m update methodology value: MERGE or COPY
# -k expansion mode value: b, o, kkv, &c
#
# and value is a single-quote delimited value.
# For example:
#*.gif -k 'b'
-21
View File
@@ -1,21 +0,0 @@
# The "editinfo" file is used to allow verification of logging
# information. It works best when a template (as specified in the
# rcsinfo file) is provided for the logging procedure. Given a
# template with locations for, a bug-id number, a list of people who
# reviewed the code before it can be checked in, and an external
# process to catalog the differences that were code reviewed, the
# following test can be applied to the code:
#
# Making sure that the entered bug-id number is correct.
# Validating that the code that was reviewed is indeed the code being
# checked in (using the bug-id number or a seperate review
# number to identify this particular code set.).
#
# If any of the above test failed, then the commit would be aborted.
#
# Actions such as mailing a copy of the report to each reviewer are
# better handled by an entry in the loginfo file.
#
# One thing that should be noted is the the ALL keyword is not
# supported. There can be only one entry that matches a given
# repository.
-26
View File
@@ -1,26 +0,0 @@
# The "loginfo" file controls where "cvs commit" log information
# is sent. The first entry on a line is a regular expression which must match
# the directory that the change is being made to, relative to the
# $CVSROOT. If a match is found, then the remainder of the line is a filter
# program that should expect log information on its standard input.
#
# If the repository name does not match any of the regular expressions in this
# file, the "DEFAULT" line is used, if it is specified.
#
# If the name ALL appears as a regular expression it is always used
# in addition to the first matching regex or DEFAULT.
#
# You may specify a format string as part of the
# filter. The string is composed of a `%' followed
# by a single format character, or followed by a set of format
# characters surrounded by `{' and `}' as separators. The format
# characters are:
#
# s = file name
# V = old version number (pre-checkin)
# v = new version number (post-checkin)
#
# For example:
#DEFAULT (echo ""; id; echo %s; date; cat) >> $CVSROOT/CVSROOT/commitlog
# or
#DEFAULT (echo ""; id; echo %{sVv}; date; cat) >> $CVSROOT/CVSROOT/commitlog
-26
View File
@@ -1,26 +0,0 @@
# Three different line formats are valid:
# key -a aliases...
# key [options] directory
# key [options] directory files...
#
# Where "options" are composed of:
# -i prog Run "prog" on "cvs commit" from top-level of module.
# -o prog Run "prog" on "cvs checkout" of module.
# -e prog Run "prog" on "cvs export" of module.
# -t prog Run "prog" on "cvs rtag" of module.
# -u prog Run "prog" on "cvs update" of module.
# -d dir Place module in directory "dir" instead of module name.
# -l Top-level directory only -- do not recurse.
#
# NOTE: If you change any of the "Run" options above, you'll have to
# release and re-checkout any working directories of these modules.
#
# And "directory" is a path to a directory relative to $CVSROOT.
#
# The "-a" option specifies an alias. An alias is interpreted as if
# everything on the right of the "-a" had been typed on the command line.
#
# You can encode a module within a module by using the special '&'
# character to interpose another module into the current module. This
# can be useful for creating a module that consists of many directories
# spread out over the entire source repository.
-12
View File
@@ -1,12 +0,0 @@
# The "notify" file controls where notifications from watches set by
# "cvs watch add" or "cvs edit" are sent. The first entry on a line is
# a regular expression which is tested against the directory that the
# change is being made to, relative to the $CVSROOT. If it matches,
# then the remainder of the line is a filter program that should contain
# one occurrence of %s for the user to notify, and information on its
# standard input.
#
# "ALL" or "DEFAULT" can be used in place of the regular expression.
#
# For example:
#ALL mail %s -s "CVS notification"
-9
View File
@@ -1,9 +0,0 @@
drevil:f76FWdDTUBG5c:fs2source
mysterial:f7nJUwoIhmSrg:fs2source
wmcoolmon:f7JRB.js9Q1sE:fs2source
inquisitor:f7BVkOvwjDlWk:fs2source
penguin:Jh.dOjaiO2jHk:fs2source
DTP:f7M92Z/6/uep.:fs2source
unknownplayer:f79BgAn.IzJs6:fs2source
phreak:f7WQyGiT/jzlM:fs2source
anonymous:oIKtWP1q6GDt6:fs2source
-13
View File
@@ -1,13 +0,0 @@
# The "rcsinfo" file is used to control templates with which the editor
# is invoked on commit and import.
#
# The first entry on a line is a regular expression which is tested
# against the directory that the change is being made to, relative to the
# $CVSROOT. For the first match that is found, then the remainder of the
# line is the name of the file that contains the template.
#
# If the repository name does not match any of the regular expressions in this
# file, the "DEFAULT" line is used, if it is specified.
#
# If the name "ALL" appears as a regular expression it is always used
# in addition to the first matching regex or "DEFAULT".
-20
View File
@@ -1,20 +0,0 @@
# The "taginfo" file is used to control pre-tag checks.
# The filter on the right is invoked with the following arguments:
#
# $1 -- tagname
# $2 -- operation "add" for tag, "mov" for tag -F, and "del" for tag -d
# $3 -- repository
# $4-> file revision [file revision ...]
#
# A non-zero exit of the filter program will cause the tag to be aborted.
#
# The first entry on a line is a regular expression which is tested
# against the directory that the change is being committed to, relative
# to the $CVSROOT. For the first match that is found, then the remainder
# of the line is the name of the filter to run.
#
# If the repository name does not match any of the regular expressions in this
# file, the "DEFAULT" line is used, if it is specified.
#
# If the name "ALL" appears as a regular expression it is always used
# in addition to the first matching regex or "DEFAULT".
-21
View File
@@ -1,21 +0,0 @@
# The "verifymsg" file is used to allow verification of logging
# information. It works best when a template (as specified in the
# rcsinfo file) is provided for the logging procedure. Given a
# template with locations for, a bug-id number, a list of people who
# reviewed the code before it can be checked in, and an external
# process to catalog the differences that were code reviewed, the
# following test can be applied to the code:
#
# Making sure that the entered bug-id number is correct.
# Validating that the code that was reviewed is indeed the code being
# checked in (using the bug-id number or a seperate review
# number to identify this particular code set.).
#
# If any of the above test failed, then the commit would be aborted.
#
# Actions such as mailing a copy of the report to each reviewer are
# better handled by an entry in the loginfo file.
#
# One thing that should be noted is the the ALL keyword is not
# supported. There can be only one entry that matches a given
# repository.
-4
View File
@@ -1,4 +0,0 @@
drevil
inquisitor
mysterial
penguin
@@ -1,3 +1,761 @@
ChangeLog for fs2_open. All times are UTC.
Updated 2002-10-31 03:46
2002-10-30 22:57 randomtiger
* code/: code.dsp (1.6.2.8), graphics/grd3d.cpp (2.2.2.18),
graphics/grd3dinternal.h (2.1.2.7), graphics/grd3dtexture.cpp
(2.1.2.16), model/modelinterp.cpp (2.3.2.1):
Changed DX8 code to not use set render and texture states if they
are already set to that value. Disabled buffer saving and
restoring code when windowed to stop DX8 debug runs from crashing.
- RT
2002-10-30 20:22 inquisitor
* code/cmdline/cmdline.h (2.10):
Bad Committ, Rolling back
2002-10-30 06:29 DTP
* code/cfile/: cfilesystem.cpp (2.5), cfile.cpp (2.5):
doh!, used upper case in include, dont know how much it matters for
*nix systems, but here it is
2002-10-30 06:26 DTP
* code/cfile/cfilesystem.cpp (2.4):
DTP Implemented basic VP files handling. mission and campaign files
inside VP files found in mod dir still not supported, cheking /
creating directories not implented either
2002-10-29 22:41 sesquipedalian
* code/parse/: sexp.cpp (2.3), sexp.h (2.3):
no message
2002-10-28 02:28 DTP
* code/cmdline/cmdline.h (2.9):
Crap, somebody may restore cmdline.h to 2 version before this.
2002-10-28 00:40 randomtiger
* code/graphics/grd3d.cpp (2.2.2.17):
Implemented screen saving code for restoring when drawing popups, a
bit slow but works. - RT
2002-10-27 23:59 DTP
* code/cfile/: cfile.cpp (2.4), cfile.h (2.3):
DTP; started basic implementation of mod-support plain files only
for now. fs2_open.exe -mod X will look for files in fs2/ X
/all-legal-subdirectories. no checking/creating dirs yet.
directories must be there.
2002-10-27 23:55 DTP
* code/cmdline/: cmdline.cpp (2.9), cmdline.h (2.8):
DTP; started basic implementation of mod-support plain files only
for now. fs2_open.exe -mod X will look for files in fs2/ X
/all-legal-subdirectories. no checking/creating dirs yet.
directories must be there.
2002-10-26 09:55 unknownplayer
* code/: freespace2/freespace.cpp (2.6.2.5), nebula/neb.cpp
(2.1.2.1):
Fixed the nebula flicker bug. Check the NO_DIRECT3D conditional
compile sections in the future for bits of code which may cause
problems due to hacks correcting for DirectX5 that no longer apply.
2002-10-26 01:24 randomtiger
* code/: bmpman/bmpman.cpp (2.2.2.10), bmpman/bmpman.h (2.0.2.7),
graphics/grd3d.cpp (2.2.2.16), graphics/grd3drender.cpp (2.3.2.15),
graphics/grd3dtexture.cpp (2.1.2.15):
Fixed debug bitmap compiling bug. Fixed tga bug. - RT
2002-10-22 23:02 randomtiger
* code/: cmdline/cmdline.cpp (2.8), cmdline/cmdline.h (2.7),
debugconsole/timerbar.h (1.2), hud/hudtargetbox.cpp (2.4),
model/modelinterp.cpp (2.5):
Made Phreaks alternative scanning style optional under the command
line tag "-phreak" Fixed bug that changes HUD colour when
targetting debris in a full nebula. - RT
2002-10-22 17:46 randomtiger
* Freespace2.dsp (1.7.2.4), code/bmpman/bmpman.cpp (2.2.2.9),
code/bmpman/bmpman.h (2.0.2.6), code/graphics/grd3dtexture.cpp
(2.1.2.14):
Fixed new TGA code texturing bug. - RT
2002-10-22 17:42 randomtiger
* code/: freespace2/freespace.cpp (2.13),
missionui/missionpause.cpp (2.3):
Fixed lighting bug that caused special pause to crash on debug
build. Also added TAB functionality for special pause that toggles
HUD. - RT
2002-10-21 16:33 randomtiger
* code/: bmpman/bmpman.cpp (2.2.2.8), bmpman/bmpman.h (2.0.2.5),
graphics/grd3d.cpp (2.2.2.15), graphics/grd3dinternal.h (2.1.2.6),
graphics/grd3drender.cpp (2.3.2.14), graphics/grd3dtexture.cpp
(2.1.2.13):
Added D3D only 32 bit TGA functionality. Will load a texture as big
as your graphics card allows. Code not finished yet and will forge
the beginnings of the new texture system. - RT
2002-10-20 22:21 randomtiger
* code/: bmpman/bmpman.cpp (2.2.2.7), graphics/grd3d.cpp
(2.2.2.14), graphics/grd3drender.cpp (2.3.2.13), palman/palman.cpp
(2.1.2.1):
Some incomplete code to handle background drawing when message
boxes are drawn. It doesnt work but its a good base for someone to
start from. - RT
2002-10-19 23:56 randomtiger
* code/: bmpman/bmpman.cpp (2.2.2.6), bmpman/bmpman.h (2.0.2.4),
globalincs/pstypes.h (2.4.2.3), graphics/grd3d.cpp (2.2.2.13),
graphics/grd3dtexture.cpp (2.1.2.12):
Changed generic bitmap code to allow maximum dimensions to be
determined by 3D's engines maximum texture size query. Defaults to
256 as it was before. Also added base code for reworking the
texture code to be more efficient. - RT
2002-10-19 19:29 bobboau
* code/: controlconfig/controlsconfig.h (2.2),
controlconfig/controlsconfigcommon.cpp (2.3), model/model.h (2.5),
model/modelinterp.cpp (2.4), model/modelread.cpp (2.4),
model/modelsinc.h (2.4), object/object.cpp (2.2), osapi/outwnd.cpp
(2.2), physics/physics.cpp (2.2), physics/physics.h (2.2),
playerman/playercontrol.cpp (2.2), ship/ai.h (2.2), ship/aibig.cpp
(2.2), ship/aicode.cpp (2.8), ship/ship.cpp (2.7), ship/ship.h
(2.4), ship/shipcontrails.cpp (2.3), ship/shipcontrails.h (2.1),
ship/shiphit.cpp (2.6), starfield/starfield.cpp (2.3),
weapon/beam.cpp (2.4), weapon/beam.h (2.3), weapon/weapon.h (2.2),
weapon/weapons.cpp (2.2):
inital commit, trying to get most of my stuff into FSO, there
should be most of my fighter beam, beam rendering, beam sheild hit,
ABtrails, and ssm stuff. one thing you should be happy to know is
the beam texture tileing is now set in the beam section section of
the weapon table entry
2002-10-19 03:50 randomtiger
* code/: cmdline/cmdline.cpp (2.7), cmdline/cmdline.h (2.6),
freespace2/freespace.cpp (2.12), io/keycontrol.cpp (2.4),
menuui/readyroom.cpp (2.2), missionui/missionpause.cpp (2.2),
missionui/missionpause.h (2.2):
Added special pause mode for easier action screenshots. Added new
command line parameter for accessing all single missions in tech
room. - RT
2002-10-17 20:40 randomtiger
* code/: controlconfig/controlsconfig.h (2.1),
controlconfig/controlsconfigcommon.cpp (2.2), hud/hud.cpp (2.2),
hud/hud.h (2.2), io/keycontrol.cpp (2.3),
mission/missionmessage.cpp (2.2):
Added ability to remove HUD ingame on keypress shift O So I've
added a new key to the bind list and made use of already existing
hud removal code.
2002-10-16 00:41 randomtiger
* code/graphics/: 2d.cpp (2.3.2.8), 2d.h (2.1.2.2), grd3d.cpp
(2.2.2.12), grd3d.h (2.0.2.4), grd3drender.cpp (2.3.2.12):
Fixed small bug that was stopping unactive text from displaying
greyed out Also added ability to run FS2 DX8 in 640x480, however I
needed to make a small change to 2d.cpp which invloved calling the
resolution processing code after initialising the device for D3D
only. This is because D3D8 for the moment has its own internal
launcher. Also I added a fair bit of documentation and tidied some
stuff up. - RT
2002-10-14 21:52 randomtiger
* code/: bmpman/bmpman.cpp (2.2.2.5), graphics/grd3d.cpp
(2.2.2.11), graphics/grd3drender.cpp (2.3.2.11),
graphics/grd3dtexture.cpp (2.1.2.11):
Finally tracked down and killed off that 8 bit alpha bug. So the
font, HUD and 8 bit ani's now work fine. - RT
2002-10-14 19:49 phreak
* code/graphics/gropenglw32x.cpp (1.4):
screenshots, yay!
2002-10-13 21:43 phreak
* code/graphics/gropenglw32x.cpp (1.3):
further optimizations
2002-10-12 17:48 phreak
* code/graphics/gropenglw32x.cpp (1.2):
fixed text
2002-10-11 21:35 phreak
* code/graphics/gropenglw32.cpp (1.2):
dont use this one
2002-10-11 21:30 phreak
* code/graphics/: gropenglw32.cpp (1.1), gropenglw32x.cpp (1.1):
first run at opengl for w32, only useful in main hall, barracks and
campaign room
2002-10-11 18:50 randomtiger
* code/graphics/: 2d.cpp (2.3.2.7), 2d.h (2.1.2.1), grd3d.cpp
(2.2.2.10), grd3d.h (2.0.2.3), grd3dinternal.h (2.1.2.5),
grd3drender.cpp (2.3.2.10), grd3dtexture.cpp (2.1.2.10):
Checked in fix for 16 bit problem, thanks to Righteous1 Removed a
fair bit of code that was used by the 16 bit code path which no
longer exists. 32 bit and 16 bit should now work in exactly the
same way. - RT
2002-10-08 14:33 randomtiger
* code/: graphics/grd3d.cpp (2.2.2.9), graphics/grd3drender.cpp
(2.3.2.9), graphics/grd3dtexture.cpp (2.1.2.9), osapi/outwnd.cpp
(2.1.2.1):
OK, I've fixed the z-buffer problem. However I have abandoned
using w-buffer for now because of problems. I think I know how to
solve it but Im not sure it would make much difference given the
way FS2 engine works. I have left code in there of use if anyone
wants to turn their hand to it. However for now we just need to
crack of the alpha problem then we will have FS2 fully wokring in
DX8 on GF4 in 32 bit.
2002-10-05 16:46 randomtiger
* code/: code.dsp (1.10), debugconsole/timerbar.cpp (1.1),
debugconsole/timerbar.h (1.1), freespace2/freespace.cpp (2.11),
globalincs/systemvars.h (2.2), graphics/grd3d.cpp (2.3),
graphics/grd3dinternal.h (2.2), graphics/grd3drender.cpp (2.4),
menuui/credits.cpp (2.3):
Added us fs2_open people to the credits. Worth looking at just for
that. Added timer bar code, by default its not compiled in. Use
TIMEBAR_ACTIVE in project and dependancy code settings to activate.
Added the new timebar files with the new code.
2002-10-04 00:48 randomtiger
* code/graphics/: grd3d.cpp (2.2.2.8), grd3dinternal.h (2.1.2.4),
grd3drender.cpp (2.3.2.8), grd3dtexture.cpp (2.1.2.8):
Fixed video memory leaks Added code to cope with lost device, not
tested Got rid of some DX5 stuff we definately dont need Moved some
enum's into internal,h because gr_d3d_set_state should be able to
be called from any dx file Cleaned up some stuff - RT
2002-10-03 08:32 unknownplayer
* code/: graphics/grd3d.cpp (2.2.2.7), graphics/grd3dtexture.cpp
(2.1.2.7), osapi/osapi.cpp (2.2.2.2):
Hacked in a windowed mode so we can properly debug this without
using monitors (although I drool at the concept of having that!)
2002-10-02 17:52 randomtiger
* code/: debugconsole/dbugfile.cpp (2.1.2.3),
debugconsole/dbugfile.h (2.1.2.3), graphics/grd3d.cpp (2.2.2.6),
graphics/grd3drender.cpp (2.3.2.7), graphics/grd3dtexture.cpp
(2.1.2.6):
Fixed blue lighting bug. Put filtering flag set back in that I
accidentally removed Added some new functionality to my debuging
system - RT
2002-10-02 11:40 randomtiger
* code/: code.dsp (1.6.2.7), bmpman/bmpman.cpp (2.2.2.4),
bmpman/bmpman.h (2.0.2.3), graphics/2d.cpp (2.3.2.6),
graphics/grd3d.cpp (2.2.2.5), graphics/grd3d.h (2.0.2.2),
graphics/grd3dinternal.h (2.1.2.3), graphics/grd3drender.cpp
(2.3.2.6), graphics/grd3dtexture.cpp (2.1.2.5),
pcxutils/pcxutils.cpp (2.1.2.2):
Bmpmap has been reverted to an old non d3d8 version. All d3d8 code
is now in the proper place. PCX code is now working to an extent.
Problems with alpha though. Ani's work slowly with alpha problems.
Also I have done a bit of tidying - RT
2002-09-28 22:13 randomtiger
* code/: anim/animplay.cpp (2.1.2.2), bmpman/bmpman.cpp (2.2.2.3),
graphics/grd3d.cpp (2.2.2.4), graphics/grd3dinternal.h (2.1.2.2),
graphics/grd3drender.cpp (2.3.2.5), graphics/grd3dtexture.cpp
(2.1.2.4), weapon/weapons.cpp (2.1.2.2):
Sorted out some bits and pieces. The background nebula blends now
which is nice. – RT
2002-09-28 12:20 randomtiger
* code/graphics/: grd3d.cpp (2.2.2.3), grd3drender.cpp (2.3.2.4),
grd3dtexture.cpp (2.1.2.3):
Just a tiny code change that lets stuff work in 16 bit. For some
reason 16 bit code was taking a different code path for displaying
textures. So until I unstand why, Im cutting off that codepath
because it isnt easy to convert into DX8.
2002-09-28 00:18 randomtiger
* code/: bmpman/bmpman.cpp (2.2.2.2), bmpman/bmpman.h (2.0.2.2),
graphics/grd3drender.cpp (2.3.2.3), graphics/grd3dtexture.cpp
(2.1.2.2):
Did some work on trying to get textures to load from pcx, define
TX_ATTEMPT for access to it. Converted some DX7 blending calls to
DX8 which a fair difference to ingame visuals.
- RT
2002-09-24 18:56 randomtiger
* Freespace2.dsp (1.7.2.3), code/code.dsp (1.6.2.6),
code/anim/animplay.cpp (2.1.2.1), code/bmpman/bmpman.cpp (2.2.2.1),
code/bmpman/bmpman.h (2.0.2.1), code/cfile/cfile.cpp (2.3.2.1),
code/cmeasure/cmeasure.cpp (2.1.2.1),
code/controlconfig/controlsconfig.cpp (2.1.2.1),
code/cutscene/cutscenes.cpp (2.2.2.4), code/cutscene/movie.cpp
(2.1.2.4), code/cutscene/movie.h (2.1.2.2),
code/debugconsole/console.cpp (2.1.2.1),
code/debugconsole/dbugfile.cpp (2.1.2.2),
code/debugconsole/dbugfile.h (2.1.2.2),
code/freespace2/freespace.cpp (2.6.2.4),
code/freespace2/freespace.rc (2.0.2.1),
code/freespace2/freespaceresource.h (2.0.2.1),
code/gamehelp/gameplayhelp.cpp (2.1.2.1), code/globalincs/pstypes.h
(2.4.2.2), code/graphics/2d.cpp (2.3.2.5), code/graphics/bitblt.cpp
(2.1.2.1), code/graphics/grd3d.cpp (2.2.2.2), code/graphics/grd3d.h
(2.0.2.1), code/graphics/grd3dinternal.h (2.1.2.1),
code/graphics/grd3drender.cpp (2.3.2.2),
code/graphics/grd3dtexture.cpp (2.1.2.1),
code/graphics/grdirectdraw.cpp (2.1.2.2), code/hud/hudconfig.cpp
(2.2.2.1), code/hud/hudmessage.cpp (2.1.2.1),
code/menuui/barracks.cpp (2.2.2.1), code/menuui/credits.cpp
(2.2.2.1), code/menuui/mainhallmenu.cpp (2.3.2.4),
code/menuui/mainhalltemp.cpp (2.1.2.1), code/menuui/optionsmenu.cpp
(2.1.2.1), code/menuui/playermenu.cpp (2.2.2.1),
code/menuui/readyroom.cpp (2.1.2.1), code/menuui/techmenu.cpp
(2.1.2.1), code/menuui/trainingmenu.cpp (2.1.2.1),
code/mission/missioncampaign.cpp (2.3.2.3),
code/mission/missiongoals.cpp (2.1.2.1),
code/mission/missionhotkey.cpp (2.1.2.1),
code/mission/missionload.cpp (2.1.2.1),
code/missionui/missionbrief.cpp (2.1.2.1),
code/missionui/missioncmdbrief.cpp (2.1.2.1),
code/missionui/missiondebrief.cpp (2.2.2.1),
code/missionui/missionloopbrief.cpp (2.1.2.1),
code/missionui/missionpause.cpp (2.1.2.1),
code/missionui/missionshipchoice.cpp (2.1.2.1),
code/missionui/missionweaponchoice.cpp (2.1.2.1),
code/missionui/redalert.cpp (2.1.2.1),
code/network/multi_dogfight.cpp (2.1.2.1),
code/network/multi_ingame.cpp (2.1.2.1),
code/network/multi_pinfo.cpp (2.1.2.1),
code/network/multiteamselect.cpp (2.2.2.1),
code/network/multiui.cpp (2.4.2.1), code/pcxutils/pcxutils.cpp
(2.1.2.1), code/popup/popup.cpp (2.1.2.1), code/render/3ddraw.cpp
(2.2.2.1), code/ship/ship.cpp (2.6.2.1), code/stats/medals.cpp
(2.2.2.1), code/ui/gadget.cpp (2.1.2.1), code/weapon/weapons.cpp
(2.1.2.1):
DX8 branch commit
This is the scub of UP's previous code with the more up to date RT
code. For full details check previous dev e-mails
2002-09-20 20:09 phreak
* code/freespace2/freespace.cpp (2.10):
did glare stuff in game_sunspot_process()
2002-09-20 20:05 phreak
* code/starfield/starfield.cpp (2.2):
glare parser stuff in stars_init()
2002-09-20 20:04 phreak
* code/starfield/starfield.h (2.2):
added glare variable for ambient suns if glare is 0 then the sun
glare whiteout is not shown when looking at the sun
2002-09-20 20:02 phreak
* code/hud/hudtarget.cpp (2.2):
lead indicator for dumbfire missiles
2002-09-20 20:01 phreak
* code/hud/hudtargetbox.cpp (2.3):
extra effects during cargo scan
2002-09-10 21:58 unknownplayer
* code/graphics/directx8/GrD3d81Stubs.cpp (1.1):
file GrD3d81Stubs.cpp was initially added on branch directx8.
2002-09-10 21:58 unknownplayer
* code/: freespace2/freespace.cpp (2.6.2.3), graphics/2d.cpp
(2.3.2.4), graphics/grdirectdraw.cpp (2.1.2.1),
graphics/directx8/GrD3D81.cpp (1.2.2.4),
graphics/directx8/GrD3D81.h (1.1.2.4),
graphics/directx8/GrD3d81Stubs.cpp (1.1.2.1):
Added the DX8 stub file, plus new CODE!
2002-09-08 02:36 unknownplayer
* code/: code.dsp (1.6.2.5), graphics/2d.cpp (2.3.2.3),
graphics/grd3d.cpp (2.2.2.1), graphics/grd3drender.cpp (2.3.2.1),
graphics/directx8/GrD3D81.cpp (1.2.2.3),
graphics/directx8/GrD3D81.h (1.1.2.3):
Framework for the new D3DRENDER class is in place, and gr_screen
function structures are now there too. The way it's done is
probably kind of inefficient, but until we're further along
actually drawing polygons we should keep it that way for
consistency's sake.
2002-09-01 08:18 unknownplayer
* Freespace2.dsp (1.7.2.2), code/code.dsp (1.6.2.4),
code/globalincs/pstypes.h (2.4.2.1), code/graphics/2d.cpp
(2.3.2.2), code/graphics/directx8/GrD3D81.cpp (1.2.2.2),
code/graphics/directx8/GrD3D81.h (1.1.2.2),
code/menuui/mainhallmenu.cpp (2.3.2.3):
Started writing some code for the new DX8.1 class and hit a serious
snag to do with window handling and DirectDraw (and possibly my
unfamiliarity with DX). It seems we may need to make some changes
further up the code because we no longer use DX through DD in 8.1
and the V code did that a lot (to go fullscreen and such check out
the device creation code)
2002-08-31 04:50 unknownplayer
* code/: code.dsp (1.6.2.3), graphics/2d.cpp (2.3.2.1),
graphics/directx8/GrD3D81.cpp (1.2.2.1),
graphics/directx8/GrD3D81.h (1.1.2.1):
Removed some older DX81 stuff I added before and changed some other
things. I'm currently thinking that I'm going to run with putting
everything into a specialized class with the d3d_init and
d3d_cleanup functions as gods. (Creation / Destruction functions -
i.e. gods :)
2002-08-31 04:48 unknownplayer
* code/graphics/directx8/grd3d81internal.h (1.2.2.1):
These are all officially now out of FS2 unless you have a specific
reason to need them. I'm running with the idea that we make a C++
class and use that as an effective way to control the code.
Rewriting V's stuff is just insanely difficult.
2002-08-28 21:47 randomtiger
* Freespace2.dsp (1.10), code/cutscene/cutscenes.cpp (2.2.2.3),
code/cutscene/movie.cpp (2.1.2.3):
Tiny change to DX branch to keep movie code optional (default off)
2002-08-28 12:39 randomtiger
* code/: code.dsp (1.6.2.2), cutscene/cutscenes.cpp (2.2.2.2),
cutscene/movie.cpp (2.1.2.2), debugconsole/dbugfile.cpp (2.1.2.1),
debugconsole/dbugfile.h (2.1.2.1), directx/dx8show.cpp (1.1.2.2),
directx/dx8show.h (1.1.2.2), freespace2/freespace.cpp (2.6.2.2),
menuui/mainhallmenu.cpp (2.3.2.2), mission/missioncampaign.cpp
(2.3.2.2), osapi/osapi.cpp (2.2.2.1), osapi/osapi.h (2.2.2.1):
OK, this should be a commit to the DX branch or Im going to be in a
lot of trouble. The movie and dx8show files have been cleaned up
big time. My debug system is in but has NO EFFECT at all unless a
compiler flag is turned on, check h file for details. Aside from
that a few changes to help the movie code work properly. Works on
most things including GF4 and Voodoo 3. However may not work
properly on a voodoo 2. Im going to leave this as a bug for now,
serves you right for buying voodoo!
2002-08-28 10:51 randomtiger
* code/: code.dsp (1.9), debugconsole/dbugfile.cpp (2.1),
debugconsole/dbugfile.h (2.1), freespace2/freespace.cpp (2.9):
Woh! I sure as hell didnt modify all these files it says I did. I
will put this down to the branch! Note: I did start from a fresh
checkout!
2002-08-27 13:38 penguin
* Freespace2.dsp (1.9), code/code.dsp (1.8),
code/cmdline/cmdline.cpp (2.6), code/cmdline/cmdline.h (2.5),
code/cutscene/cutscenes.cpp (2.4), code/cutscene/movie.cpp (2.2),
code/cutscene/movie.h (2.2), code/directx/DShow.h (1.2),
code/directx/ddraw.lib (1.2), code/directx/dx8show.cpp (1.2),
code/directx/dx8show.h (1.2), code/directx/dxguid.lib (1.2),
code/directx/strmiids.lib (1.2), code/freespace2/freespace.cpp
(2.8), code/menuui/mainhallmenu.cpp (2.5),
code/mission/missioncampaign.cpp (2.5):
Moved DirectX8 stuff to directx8 branch; reverted to previous
2002-08-27 13:25 penguin
* code/directx/: DShow.h (1.1.2.1), ddraw.lib (1.1.2.1),
dx8show.cpp (1.1.2.1), dx8show.h (1.1.2.1), dxguid.lib (1.1.2.1),
strmiids.lib (1.1.2.1):
Moved to directx8 branch
2002-08-27 13:21 penguin
* code/: freespace2/freespace.cpp (2.6.2.1),
menuui/mainhallmenu.cpp (2.3.2.1), mission/missioncampaign.cpp
(2.3.2.1), code.dsp (1.6.2.1), cmdline/cmdline.cpp (2.4.2.1),
cmdline/cmdline.h (2.3.2.1), cutscene/cutscenes.cpp (2.2.2.1),
cutscene/movie.cpp (2.1.2.1), cutscene/movie.h (2.1.2.1),
Freespace2.dsp (1.7.2.1):
Moved to directx8 branch
2002-08-18 19:48 randomtiger
* Freespace2.dsp (1.8), code/code.dsp (1.7),
code/cmdline/cmdline.cpp (2.5), code/cmdline/cmdline.h (2.4),
code/cutscene/cutscenes.cpp (2.3), code/cutscene/movie.cpp (2.1),
code/cutscene/movie.h (2.1), code/directx/DShow.h (1.1),
code/directx/ddraw.lib (1.1), code/directx/dx8show.cpp (1.1),
code/directx/dx8show.h (1.1), code/directx/dxguid.lib (1.1),
code/directx/strmiids.lib (1.1), code/freespace2/freespace.cpp
(2.7), code/menuui/mainhallmenu.cpp (2.4),
code/mission/missioncampaign.cpp (2.4):
Added new lib files: strmiids and ddraw to get dshow working Added
new command line parameter to active direct show movie play:
-dshowvid Uncommented movie_play calls and includes
2002-08-15 04:41 penguin
* code/globalincs/systemvars.h (2.1):
Added #include, needed for FRED
2002-08-13 03:40 penguin
RELEASED: fs2_open 3.2 (tag: fs2_open3_2)
2002-08-13 03:34 penguin
* code/freespace2/freespace.cpp (2.6):
1. Disable CD checking
2. Add CVS tag to version string
2002-08-13 03:32 penguin
* code/globalincs/version.h (2.2):
Bumped to version 3.2
2002-08-07 00:45 DTP
* code/graphics/grd3drender.cpp (2.3):
Implented -GF4FIX commandline switch & #include "cmdline/cmdline.h"
2002-08-07 00:44 DTP
* code/cmdline/: cmdline.cpp (2.4), cmdline.h (2.3):
Implented -GF4FIX commandline switch
2002-08-06 16:50 phreak
* code/hud/hudtargetbox.cpp (2.2):
added wireframe targetbox feature
2002-08-06 16:50 phreak
* code/hud/hudtargetbox.h (2.1):
added Targetbox_wire variable to check what mode the hud targetbox
uses
2002-08-06 16:49 phreak
* code/io/keycontrol.cpp (2.2):
added keybing for wireframe hud, fixed previous missile cheat
2002-08-06 04:39 penguin
* code/hud/hudwingmanstatus.cpp (2.2):
Use text strings for wingmen names instead of ANI
2002-08-06 03:50 penguin
* code/ui/ui.h (2.2):
inserted "class" keyword on "friend" definitions (ANSI C++ )
2002-08-06 02:42 penguin
* Freespace2.dsp (1.7), code/code.dsp (1.6):
Fixed problem w/ compile options for Debug mode
2002-08-06 01:49 penguin
* code/Makefile (2.4):
Removed a couple more include dirs I missed
2002-08-06 01:49 penguin
* code/: globalincs/pstypes.h (2.4), render/3dclipper.cpp (2.2),
render/3ddraw.cpp (2.2):
Renamed ccode members to cc_or and cc_and
2002-08-04 05:43 penguin
* ChangeLog (1.1), code/ChangeLog (1.3):
Moved ChangeLog to top-level directory
2002-08-04 05:13 penguin
RELEASED: fs2_open 3.1 (tag: fs2_open3_1)
2002-08-04 05:13 penguin
* code/network/stand_gui.cpp (2.3):
Change version display
* code/menuui/playermenu.cpp (2.2):
Display fs2_open version instead of "Freespace 2"
* code/menuui/mainhallmenu.cpp (2.3):
Change version display location
* code/globalincs/version.h (2.1):
Update version number to 3.1
* code/freespace2/freespace.cpp (2.5):
Don't write version to registry; change way version string is
formatted
* code/ChangeLog (1.1), ChangeLog (1.2):
Moved ChangeLog to top-level directory
2002-08-03 19:42 randomtiger
* code/graphics/grd3drender.cpp (2.2):
Fixed Geforce 4 bug that caused font and hall video distortion.
Very small change in 'gr_d3d_aabitmap_ex_internal'
Tested and works on the following systems
OUTSIDER Voodoo 3 win98 OUTSIDER Geforce 2 win2000 Me Geforce 4 PNY
4600 XP JBX-Phoenix Geforce 4 PNY XP Mehrunes GeForce 3 XP
WMCoolmon nVidia TNT2 M64 win2000 Orange GeForce 4 4200 XP
ShadowWolf_IH Monster2 win98 ShadowWolf_IH voodoo 2 win98
2002-08-03 18:34 wmcoolmon
* code/code.dsp (1.5), Freespace2.dsp (1.6):
Fixed Win32 debug configuration
2002-08-03 17:42 wmcoolmon
* Freespace2.dsp (1.5), code/code.dsp (1.4):
Sync with makefile 1.4
2002-08-01 04:04 penguin
* code/ChangeLog (1.2):
updated
2002-08-01 02:00 penguin
* fs2_open.w32.mak (1.4):
The big include file move
====
NOTE:
====
below this point, all files are relative to the 'code' directory
2002-08-01 01:41 penguin
* Makefile (2.3), anim/animplay.cpp (2.1), anim/animplay.h (2.1),
@@ -1107,3 +1865,4 @@
# generated by cvs2cl.pl
# cvs2cl.pl -r -S --utc -f ChangeLog2
+3 -3
View File
@@ -69,7 +69,7 @@ LINK32=link.exe
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c
# ADD CPP /nologo /G5 /MTd /W4 /Gm /Gi /GX /ZI /Od /I "." /D "WIN32" /D "_WINDOWS" /D "_DEBUG" /D "NO_CD_CHECK" /D "USE_DX81" /U "NDEBUG" /Fr /YX /FD /GZ /c
# ADD CPP /nologo /G5 /MTd /W4 /Gm /Gi /GX /ZI /Od /I "code" /D "WIN32" /D "_WINDOWS" /D "_DEBUG" /D "NO_CD_CHECK" /D "USE_DX81" /U "NDEBUG" /Fr /YX /FD /GZ /c
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x409 /d "_DEBUG"
@@ -79,10 +79,10 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo /o"debug/profile/Freespace2.bsc" "./debug/profile/*.sbr"
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib winmm.lib vfw32.lib msacm32.lib comctl32.lib code.lib /nologo /subsystem:windows /debug /debugtype:both /machine:I386 /nodefaultlib:"libc.lib" /nodefaultlib:"libcd.lib" /out:"Debug/fs2_open.exe" /libpath:"debug"
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib winmm.lib vfw32.lib msacm32.lib comctl32.lib code.lib /nologo /subsystem:windows /debug /debugtype:both /machine:I386 /nodefaultlib:"libc.lib" /nodefaultlib:"libcd.lib" /out:"debug\fs2_open_debug.exe" /libpath:"debug"
# SUBTRACT LINK32 /pdb:none /incremental:no /map
# Begin Custom Build - Copying $(InputPath) to c:\games\freespace2
InputPath=.\Debug\fs2_open.exe
InputPath=.\debug\fs2_open_debug.exe
SOURCE="$(InputPath)"
"c:\games\freespace2\fs2_open.exe" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
-81
View File
@@ -1,81 +0,0 @@
README for fs2_open, Release 0.1
WARNINGS:
========
This is very much an pre-alpha build. Don't expect too much from it!
In particular, do not run this in the same directory as existing pilot
files or anything else that you don't want to get destroyed...
I have tried to modify as little code as possible to keep the existing
Windows code from breaking, but I have not verified that this code
will still work on Windows. Some changes may be necessary.
There are occasional crashes and segfaults from time to time.
All of this was tested on my system only. I don't know if any
assumptions about my hardware have crept into the code. I guess it
goes without saying that this will only work on x86-based Linux
systems :-)
STATUS:
=======
Most 2D graphics appear to be working, although very slowly.
Improving the performance of the 2D graphic system is a high priority.
3D graphics are in a very primitive state right now. No texturing is
done, so all objects (ships, lasers, explosions, etc.) look "ghostly."
Nebula missions do not work at all.
Sound, joystick, and network are all disabled.
REQUIREMENTS:
=============
The only "non-standard" package that you will need (as far as I can
tell) is the SDL library, available at http://www.libsdl.org I think
SDL requires XFree86 release 4 or higher.
INSTALLING:
===========
There is no configure script, no options, etc. -- just a Makefile. It
is likely that you will need to adjust it to match your configuration,
in particular the location of the SDL files.
If everything is right, you should be able to run 'make' from the
fs2_open/code directory and create an 'fs2' executable.
RUNNING:
========
The fs2 executable should be copied (or symlinked) to the same
directory as the *.VP files. All the *.VP files that you need should
be here -- the code isn't smart enough to look in your CD for command
brief ANIs, etc.
It only runs in windowed mode, no full screen.
I have never run it in high-resolution mode (1024x768), so all bets
are off if you try it.
There seems to be a bug in some of the 'glob' routines that scan for
files in the 'data' directory, so you will have better results if you:
1. Keep everything in the *.VP file (i.e., no mods)
2. Only have one player file
I recommend that background graphics be turned off via the "Options"
screen or it will look very odd. Your in-game framerate will be
significantly higher if you turn off (or set to 'popup') as many HUD
gauges as possible.
Due to the painful slowness of the 2D UI, you might need to hold the
mouse button down a little longer to get buttons to activate.
===
Mike Harris (HLP penguin)
02 June 2002
+1 -2
View File
@@ -91,9 +91,8 @@ LDLIBS = -L/usr/X11R6/lib -lSDL -lGL -lGLU -lpthread
CXXFLAGS = \
-g \
-I/usr/local/include/SDL \
-I. -Iwindows_stub \
-I. \
-fno-exceptions \
-IWeapon -ILocalization -INebula -IDemo -IInetfile -IExceptionHandler \
-D_DEBUG -DNO_CD_CHECK -UNDEBUG \
-DNO_DIRECT3D $(SOUND_DEF) $(JOYSTICK_DEF) $(NETWORK_DEF) $(OPENGL_DEF)
+18 -3
View File
@@ -9,13 +9,26 @@
/*
* $Logfile: /Freespace2/code/CFile/cfile.cpp $
* $Revision: 2.3 $
* $Date: 2002-08-01 01:41:04 $
* $Author: penguin $
* $Revision: 2.7 $
* $Date: 2002-11-10 16:29:53 $
* $Author: DTP $
*
* Utilities for operating on files
*
* $Log: not supported by cvs2svn $
* Revision 2.6 2002/11/04 08:32:38 DTP
* Made sure, that VP and Plain files dont get added twice to the search order. Side-effect of Mod support.
*
* Revision 2.5 2002/10/30 06:31:05 DTP
* doh!, used upper case in include, dont know how much it matters for *nix systems, but here it is
*
* Revision 2.4 2002/10/27 23:59:28 DTP
* DTP; started basic implementation of mod-support
* plain files only for now. fs2_open.exe -mod X will look for files in fs2/ X /all-legal-subdirectories. no checking/creating dirs yet. directories must be there.
*
* Revision 2.3 2002/08/01 01:41:04 penguin
* The big include file move
*
* Revision 2.2 2002/07/29 19:04:48 penguin
* added #ifdef _WIN32 around windows-specific system headers
*
@@ -206,6 +219,7 @@
#include <sys/mman.h>
#endif
#include "cmdline/cmdline.h"
#include "globalincs/pstypes.h"
#include "cfile/cfile.h"
#include "parse/encrypt.h"
@@ -1768,3 +1782,4 @@ int cflush(CFILE *cfile)
+43 -29
View File
@@ -9,13 +9,26 @@
/*
* $Logfile: /Freespace2/code/CFile/cfile.h $
* $Revision: 2.2 $
* $Date: 2002-08-01 01:41:04 $
* $Author: penguin $
* $Revision: 2.6 $
* $Date: 2002-11-10 16:29:53 $
* $Author: DTP $
*
* <insert description of file here>
*
* $Log: not supported by cvs2svn $
* Revision 2.5 2002/11/02 23:06:59 DTP
* DOh,uhmm, define error again, this is getting to me.
*
* Revision 2.4 2002/11/02 23:04:46 DTP
* DOh, fixed that define, learn to count DTP :)
*
* Revision 2.3 2002/10/27 23:59:28 DTP
* DTP; started basic implementation of mod-support
* plain files only for now. fs2_open.exe -mod X will look for files in fs2/ X /all-legal-subdirectories. no checking/creating dirs yet. directories must be there.
*
* Revision 2.2 2002/08/01 01:41:04 penguin
* The big include file move
*
* Revision 2.1 2002/07/07 19:55:58 penguin
* Back-port to MSVC
*
@@ -378,44 +391,45 @@ typedef struct {
#define CF_TYPE_ANY -1 // Used to check in any directory
#define CF_TYPE_INVALID 0
#define CF_TYPE_ROOT 1 // Root must be 1!!
#define CF_TYPE_DATA 2
#define CF_TYPE_MAPS 3
#define CF_TYPE_TEXT 4
#define CF_TYPE_MISSIONS 5
#define CF_TYPE_MODELS 6
#define CF_TYPE_TABLES 7
#define CF_TYPE_SOUNDS 8
#define CF_TYPE_SOUNDS_8B22K 9
#define CF_TYPE_SOUNDS_16B11K 10
#define CF_TYPE_VOICE 11
#define CF_TYPE_INVALID 0
#define CF_TYPE_ROOT 1 // Root must be 1!!
#define CF_TYPE_DATA 2
#define CF_TYPE_MAPS 3
#define CF_TYPE_TEXT 4
#define CF_TYPE_MISSIONS 5
#define CF_TYPE_MODELS 6
#define CF_TYPE_TABLES 7
#define CF_TYPE_SOUNDS 8
#define CF_TYPE_SOUNDS_8B22K 9
#define CF_TYPE_SOUNDS_16B11K 10
#define CF_TYPE_VOICE 11
#define CF_TYPE_VOICE_BRIEFINGS 12
#define CF_TYPE_VOICE_CMD_BRIEF 13
#define CF_TYPE_VOICE_DEBRIEFINGS 14
#define CF_TYPE_VOICE_PERSONAS 15
#define CF_TYPE_VOICE_SPECIAL 16
#define CF_TYPE_VOICE_SPECIAL 16
#define CF_TYPE_VOICE_TRAINING 17
#define CF_TYPE_MUSIC 18
#define CF_TYPE_MOVIES 19
#define CF_TYPE_INTERFACE 20
#define CF_TYPE_FONT 21
#define CF_TYPE_EFFECTS 22
#define CF_TYPE_HUD 23
#define CF_TYPE_MUSIC 18
#define CF_TYPE_MOVIES 19
#define CF_TYPE_INTERFACE 20
#define CF_TYPE_FONT 21
#define CF_TYPE_EFFECTS 22
#define CF_TYPE_HUD 23
#define CF_TYPE_PLAYER_MAIN 24
#define CF_TYPE_PLAYER_IMAGES_MAIN 25
#define CF_TYPE_CACHE 26
#define CF_TYPE_PLAYERS 27
#define CF_TYPE_CACHE 26
#define CF_TYPE_PLAYERS 27
#define CF_TYPE_SINGLE_PLAYERS 28
#define CF_TYPE_MULTI_PLAYERS 29
#define CF_TYPE_MULTI_PLAYERS 29
#define CF_TYPE_MULTI_CACHE 30
#define CF_TYPE_CONFIG 31
#define CF_TYPE_CONFIG 31
#define CF_TYPE_SQUAD_IMAGES_MAIN 32
#define CF_TYPE_DEMOS 33
#define CF_TYPE_CBANIMS 34
#define CF_TYPE_DEMOS 33
#define CF_TYPE_CBANIMS 34
#define CF_TYPE_INTEL_ANIMS 35
#define CF_MAX_PATH_TYPES 36 // Can be as high as you'd like
#define CF_MAX_PATH_TYPES 36 // Can be as high as you'd like //DTP; yeah but beware alot of things uses CF_MAX_PATH_TYPES
// TRUE if type is specified and valid
#define CF_TYPE_SPECIFIED(path_type) (((path_type)>CF_TYPE_INVALID) && ((path_type)<CF_MAX_PATH_TYPES))
+65 -40
View File
@@ -9,9 +9,9 @@
/*
* $Logfile: /Freespace2/code/CFile/CfileSystem.cpp $
* $Revision: 2.3 $
* $Date: 2002-08-01 01:41:04 $
* $Author: penguin $
* $Revision: 2.6 $
* $Date: 2002-11-10 16:28:08 $
* $Author: DTP $
*
* Functions to keep track of and find files that can exist
* on the harddrive, cd-rom, or in a pack file on either of those.
@@ -20,6 +20,15 @@
* all those locations, inherently enforcing precedence orders.
*
* $Log: not supported by cvs2svn $
* Revision 2.5 2002/10/30 06:29:45 DTP
* doh!, used upper case in include, dont know how much it matters for *nix systems, but here it is
*
* Revision 2.4 2002/10/30 06:26:11 DTP
* DTP Implemented basic VP files handling. mission and campaign files inside VP files found in mod dir still not supported, cheking / creating directories not implented either
*
* Revision 2.3 2002/08/01 01:41:04 penguin
* The big include file move
*
* Revision 2.2 2002/07/29 19:52:48 penguin
* added #ifdef _WIN32 around windows-specific system headers
*
@@ -123,6 +132,7 @@
#include <sys/stat.h>
#endif
#include "cmdline/cmdline.h"
#include "globalincs/pstypes.h"
#include "cfile/cfile.h"
#include "cfile/cfilesystem.h"
@@ -248,10 +258,11 @@ int cf_get_packfile_count(cf_root *root)
packfile_count = 0;
for (i=CF_TYPE_ROOT; i<CF_MAX_PATH_TYPES; i++ ) {
strcpy( filespec, root->path );
if(strlen(Pathtypes[i].path)){
strcat( filespec, Pathtypes[i].path );
strcat( filespec, DIR_SEPARATOR_STR );
if(strlen(Pathtypes[i].path)) {
strcat( filespec, Pathtypes[i].path );
strcat( filespec, DIR_SEPARATOR_STR );
// }
}
#if defined _WIN32
@@ -337,11 +348,13 @@ void cf_build_pack_list( cf_root *root )
root_index = 0;
for (i=CF_TYPE_ROOT; i<CF_MAX_PATH_TYPES; i++ ) {
strcpy( filespec, root->path );
if(strlen(Pathtypes[i].path)){
strcat( filespec, Pathtypes[i].path );
if(strlen(Pathtypes[i].path)) {
strcat( filespec, Pathtypes[i].path );
strcat( filespec, DIR_SEPARATOR_STR );
}
#if defined _WIN32
strcat( filespec, "*.vp" );
@@ -362,12 +375,13 @@ void cf_build_pack_list( cf_root *root )
// fill in all the proper info
strcpy(rptr_sort->path, root->path);
if(strlen(Pathtypes[i].path)) {
if(strlen(Pathtypes[i].path)){
strcat(rptr_sort->path, Pathtypes[i].path );
strcat(rptr_sort->path, Pathtypes[i].path );
strcat(rptr_sort->path, DIR_SEPARATOR_STR);
}
strcat(rptr_sort->path, find.name );
rptr_sort->roottype = CF_ROOTTYPE_PACK;
rptr_sort->cf_type = i;
@@ -434,12 +448,17 @@ void cf_build_root_list(char *cdrom_dir)
cf_root *root;
//======================================================
// First, check the current directory.
// strcpy( root->path, "d:\\projects\\freespace\\" );
if(Cmdline_mod) {
strcat(Cmdline_mod, DIR_SEPARATOR_STR);
cf_root *modroot;
modroot = cf_create_root();
strcpy(modroot->path,Cmdline_mod);
modroot->roottype = CF_ROOTTYPE_PATH;
cf_build_pack_list(modroot);
}
root = cf_create_root();
if ( !_getcwd(root->path, CF_MAX_PATHNAME_LENGTH ) ) {
Error(LOCATION, "Can't get current working directory -- %d", errno );
}
@@ -448,6 +467,8 @@ void cf_build_root_list(char *cdrom_dir)
if(strlen(root->path) && (root->path[strlen(root->path)-1] != DIR_SEPARATOR_CHAR)){
strcat(root->path, DIR_SEPARATOR_STR); // put trailing backslash on for easier path construction
}
root->roottype = CF_ROOTTYPE_PATH;
//======================================================
@@ -500,7 +521,7 @@ void cf_search_root_path(int root_index)
strcpy( search_path, root->path );
if(strlen(Pathtypes[i].path)){
if(strlen(Pathtypes[i].path)) {
strcat( search_path, Pathtypes[i].path );
strcat( search_path, DIR_SEPARATOR_STR );
}
@@ -593,9 +614,7 @@ typedef struct VP_FILE {
} VP_FILE;
void cf_search_root_pack(int root_index)
{
int i;
{
cf_root *root = cf_get_root(root_index);
//mprintf(( "Searching root pack '%s'\n", root->path ));
@@ -621,6 +640,7 @@ void cf_search_root_pack(int root_index)
strcpy( search_path, "" );
// Go through all the files
int i;
for (i=0; i<VP_header.num_files; i++ ) {
VP_FILE find;
@@ -644,38 +664,35 @@ void cf_search_root_pack(int root_index)
//mprintf(( "Current dir = '%s'\n", search_path ));
} else {
int j;
int j;
for (j=CF_TYPE_ROOT; j<CF_MAX_PATH_TYPES; j++ ) {
if ( !stricmp( search_path, Pathtypes[j].path )) {
char *ext = strchr( find.filename, '.' );
if ( ext ) {
if ( is_ext_in_list( Pathtypes[j].extensions, ext ) ) {
// Found a file!!!!
cf_file *file = cf_create_file();
strcpy( file->name_ext, find.filename );
file->root_index = root_index;
file->pathtype_index = j;
file->write_time = find.write_time;
file->size = find.size;
file->pack_offset = find.offset; // Mark as a non-packed file
file->pack_offset = find.offset; // Mark as a packed file
//mprintf(( "Found pack file '%s'\n", file->name_ext ));
}
}
}
}
}
}
fclose(fp);
}
void cf_build_file_list()
{
int i;
@@ -705,7 +722,7 @@ void cf_build_secondary_filelist(char *cdrom_dir)
// Init the path types
for (i=0; i<CF_MAX_PATH_TYPES; i++ ) {
Assert( Pathtypes[i].index == i );
//Assert( Pathtypes[i].index == i );
// [mharris] can't modify constant strings, why do this anyhow???
// just need to make sure exts are all lc in the definition...
// if ( Pathtypes[i].extensions ) {
@@ -868,8 +885,8 @@ int cf_find_file_location( char *filespec, int pathtype, char *pack_filename, in
strcat( pack_filename, DIR_SEPARATOR_STR );
strcat( pack_filename, f->name_ext );
}
}
return 1;
}
return 1;
}
// restore original filespec
strcpy(filespec, temp);
@@ -892,12 +909,13 @@ int cf_find_file_location( char *filespec, int pathtype, char *pack_filename, in
strcat( pack_filename, f->name_ext );
}
}
return 1;
}
return 1;
}
}
return 0;
return 0;
}
@@ -953,6 +971,7 @@ int cf_get_file_list( int max, char **list, int pathtype, char *filter, int sort
if (max < 1) {
Get_file_list_filter = NULL;
return 0;
}
@@ -973,6 +992,7 @@ int cf_get_file_list( int max, char **list, int pathtype, char *filter, int sort
if (find_handle != -1) {
do {
if (num_files >= max)
break;
if (!(find.attrib & _A_SUBDIR)) {
@@ -1047,8 +1067,9 @@ int cf_get_file_list( int max, char **list, int pathtype, char *filter, int sort
}
if (num_files >= max)
break;
break;
if ( !cf_matches_spec( filter,f->name_ext)) {
continue;
}
@@ -1091,6 +1112,7 @@ int cf_get_file_list( int max, char **list, int pathtype, char *filter, int sort
}
Get_file_list_filter = NULL;
return num_files;
}
@@ -1124,6 +1146,7 @@ int cf_get_file_list_preallocated( int max, char arr[][MAX_FILENAME_LEN], char *
if (max < 1) {
Get_file_list_filter = NULL;
return 0;
}
@@ -1154,7 +1177,7 @@ int cf_get_file_list_preallocated( int max, char arr[][MAX_FILENAME_LEN], char *
find_handle = _findfirst( filespec, &find );
if (find_handle != -1) {
do {
if (num_files >= max)
if (num_files >= max)
break;
if (!(find.attrib & _A_SUBDIR)) {
@@ -1229,6 +1252,7 @@ int cf_get_file_list_preallocated( int max, char arr[][MAX_FILENAME_LEN], char *
}
if (num_files >= max)
break;
if ( !cf_matches_spec( filter,f->name_ext)) {
@@ -1269,6 +1293,7 @@ int cf_get_file_list_preallocated( int max, char arr[][MAX_FILENAME_LEN], char *
}
Get_file_list_filter = NULL;
return num_files;
}
@@ -1301,7 +1326,7 @@ void cf_create_default_path_string( char *path, int pathtype, char *filename, bo
// Don't add slash for root directory
if (Pathtypes[pathtype].path[0] != '\0') {
strcat(path, DIR_SEPARATOR_STR);
strcat(path, DIR_SEPARATOR_STR);
}
// add filename
+54 -6
View File
@@ -9,11 +9,35 @@
/*
* $Logfile: /Freespace2/code/Cmdline/cmdline.cpp $
* $Revision: 2.3 $
* $Date: 2002-08-01 01:41:04 $
* $Author: penguin $
* $Revision: 2.11 $
* $Date: 2002-11-10 16:32:42 $
* $Author: DTP $
*
* $Log: not supported by cvs2svn $
* Revision 2.10 2002/11/10 16:30:53 DTP
* -DTP reworked mod support,
*
* Revision 2.9 2002/10/27 23:55:36 DTP
* DTP; started basic implementation of mod-support
* plain files only for now. fs2_open.exe -mod X will look for files in fs2/ X /all-legal-subdirectories. no checking/creating dirs yet. directories must be there.
*
* Revision 2.8 2002/10/22 23:02:39 randomtiger
* Made Phreaks alternative scanning style optional under the command line tag "-phreak"
* Fixed bug that changes HUD colour when targetting debris in a full nebula. - RT
*
* Revision 2.7 2002/10/19 03:50:28 randomtiger
* Added special pause mode for easier action screenshots.
* Added new command line parameter for accessing all single missions in tech room. - RT
*
* Revision 2.6 2002/08/27 13:38:57 penguin
* Moved DirectX8 stuff to directx8 branch; reverted to previous
*
* Revision 2.4 2002/08/07 00:44:13 DTP
* Implented -GF4FIX commandline switch
*
* Revision 2.3 2002/08/01 01:41:04 penguin
* The big include file move
*
* 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.
*
@@ -251,8 +275,10 @@ cmdline_parm mouse_coords("-coords", NULL);
cmdline_parm timeout("-timeout", NULL);
cmdline_parm d3d_window("-window", NULL);
cmdline_parm almission_arg("-almission", NULL); //DTP for autoload Multi mission
cmdline_parm gf4fix_arg("-GF4FIX", NULL); //DTP for random tigers GF4fix
cmdline_parm allslev_arg("-ALLSLEV", NULL); //Give access to all single player missions
cmdline_parm phreak_arg("-phreak", NULL); // Change to phreaks options including new targetting code
cmdline_parm mod_arg("-mod", NULL); //DTP modsupport
int Cmdline_multi_stream_chat_to_file = 0;
int Cmdline_freespace_no_sound = 0;
@@ -270,7 +296,8 @@ char *Cmdline_game_password = NULL;
char *Cmdline_rank_above= NULL;
char *Cmdline_rank_below = NULL;
char *Cmdline_connect_addr = NULL;
char *Cmdline_almission = NULL; //DTP FOR AUTO-LOAD Multi MISSION
char *Cmdline_almission = NULL; //DTP for autoload multi mission.
char *Cmdline_mod = NULL; //DTP for mod arguement
int Cmdline_multi_log = 0;
int Cmdline_server_firing = 0;
int Cmdline_client_dodamage = 0;
@@ -280,6 +307,12 @@ int Cmdline_mouse_coords = 0;
int Cmdline_timeout = -1;
int Cmdline_window = 0;
int Cmdline_gf4fix = 0; // DTP for randomstigers GF4 fix.
int Cmdline_allslev = 0;
int Cmdline_phreak = 0;
static cmdline_parm Parm_list(NULL, NULL);
static int Parm_list_inited = 0;
@@ -643,6 +676,21 @@ int parse_cmdline(int argc, char *argv[])
Cmdline_use_last_pilot = 1;
Cmdline_start_netgame = 1;
}
if (gf4fix_arg.found() ) {
Cmdline_gf4fix = 1;
}
if (allslev_arg.found() ) {
Cmdline_allslev = 1;
}
if(phreak_arg.found() ) {
Cmdline_phreak = 1;
}
if(mod_arg.found() ) {
Cmdline_mod = mod_arg.str();
}
return 1;
}
+30 -3
View File
@@ -5,15 +5,39 @@
* or otherwise commercially exploit the source or things you created based on the
* source.
*
*/
/*
* $Logfile: /Freespace2/code/Cmdline/cmdline.h $
* $Revision: 2.2 $
* $Date: 2002-07-29 06:35:15 $
* $Revision: 2.12 $
* $Date: 2002-11-10 16:30:53 $
* $Author: DTP $
*
* $Log: not supported by cvs2svn $
* Revision 2.11 2002/10/31 21:14:16 DTP
* DTP Quickly added something needed to cmdline.h, since otherwise we can not compile the code as it misses some externals. Thought a rollback rolled all back.
*
* Revision 2.10 2002/10/30 20:22:30 inquisitor
* Bad Committ, Rolling back
*
* Revision 2.7 2002/10/22 23:02:39 randomtiger
* Made Phreaks alternative scanning style optional under the command line tag "-phreak"
* Fixed bug that changes HUD colour when targetting debris in a full nebula. - RT
*
* Revision 2.6 2002/10/19 03:50:28 randomtiger
* Added special pause mode for easier action screenshots.
* Added new command line parameter for accessing all single missions in tech room. - RT
*
* Revision 2.5 2002/08/27 13:38:57 penguin
* Moved DirectX8 stuff to directx8 branch; reverted to previous
*
* Revision 2.3 2002/08/07 00:44:13 DTP
* Implented -GF4FIX commandline switch
*
* Revision 2.2 2002/07/29 06:35:15 DTP
* added -almission commandline arguement, will autoload mission i.e fs2_open.exe -almission kickass will autoload kickass.fs2 which should be a multiplayer mission.
*
* Revision 2.1 2002/07/07 19:55:58 penguin
* Back-port to MSVC
*
@@ -198,6 +222,9 @@ extern int Cmdline_timeout;
extern int Cmdline_window;
extern char *Cmdline_almission; //DTP for autoload mission
extern int Cmdline_gf4fix; //DTP for Random tigers GF4fix.
extern int Cmdline_allslev;
extern int Cmdline_phreak;
extern char *Cmdline_mod; //DTP for mod support
#endif
+17 -1
View File
@@ -64,7 +64,7 @@ LIB32=link.exe -lib
# PROP Intermediate_Dir "..\Debug\Profile"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
# ADD CPP /nologo /G5 /MTd /W4 /Gm /Gi /GX /ZI /Od /I "." /FI"PSTypes.h" /D "_WINDOWS" /D "WIN32" /D "_DEBUG" /D "USE_DX81" /U "NDEBUG" /FR /YX /FD /GZ /c
# ADD CPP /nologo /G5 /MTd /W4 /Gm /Gi /GX /ZI /Od /I "." /D "_WINDOWS" /D "WIN32" /D "_DEBUG" /U "NDEBUG" /FR /YX /FD /GZ /c
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
@@ -227,6 +227,22 @@ SOURCE=.\Debris\Debris.h
SOURCE=.\DebugConsole\Console.cpp
# End Source File
# Begin Source File
SOURCE=.\debugconsole\dbugfile.cpp
# End Source File
# Begin Source File
SOURCE=.\debugconsole\dbugfile.h
# End Source File
# Begin Source File
SOURCE=.\debugconsole\timerbar.cpp
# End Source File
# Begin Source File
SOURCE=.\debugconsole\timerbar.h
# End Source File
# End Group
# Begin Group "DirectX"
+18 -4
View File
@@ -9,13 +9,20 @@
/*
* $Logfile: /Freespace2/code/ControlConfig/ControlsConfig.h $
* $Revision: 2.0 $
* $Date: 2002-06-03 04:02:21 $
* $Author: penguin $
* $Revision: 2.2 $
* $Date: 2002-10-19 19:29:27 $
* $Author: bobboau $
*
* Header file for keyboard, joystick and mouse configuration
*
* $Log: not supported by cvs2svn $
* 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
*
@@ -445,8 +452,15 @@ typedef struct config_item {
#define MULTI_SELF_DESTRUCT 106
#define TOGGLE_HUD 107
#define RIGHT_SLIDE_THRUST 108
#define LEFT_SLIDE_THRUST 109
#define UP_SLIDE_THRUST 110
#define DOWN_SLIDE_THRUST 111
// this should be the total number of control action defines above (or last define + 1)
#define CCFG_MAX 107
#define CCFG_MAX 112
extern int Failed_key_index;
extern int Invert_heading;
@@ -9,13 +9,20 @@
/*
* $Logfile: /Freespace2/code/ControlConfig/ControlsConfigCommon.cpp $
* $Revision: 2.1 $
* $Date: 2002-08-01 01:41:04 $
* $Author: penguin $
* $Revision: 2.3 $
* $Date: 2002-10-19 19:29:27 $
* $Author: bobboau $
*
* C module for keyboard, joystick and mouse configuration common stuff (between Fred and FreeSpace)
*
* $Log: not supported by cvs2svn $
* Revision 2.2 2002/10/17 20:40:50 randomtiger
* Added ability to remove HUD ingame on keypress shift O
* So I've added a new key to the bind list and made use of already existing hud removal code.
*
* Revision 2.1 2002/08/01 01:41:04 penguin
* The big include file move
*
* Revision 2.0 2002/06/03 04:02:21 penguin
* Warpcore CVS sync
*
@@ -536,6 +543,13 @@ config_item Control_config[CCFG_MAX + 1] = {
{ KEY_SHIFTED | KEY_N, -1, COMPUTER_TAB, "(Multiplayer) Toggle network info"},
{ KEY_SHIFTED | KEY_END, -1, COMPUTER_TAB, "(Multiplayer) Self destruct"},
// Misc
{ KEY_SHIFTED | KEY_O, -1, COMPUTER_TAB, "Toggle HUD"},
{ KEY_SHIFTED | KEY_3, -1, SHIP_TAB, "Right Thrust", CC_TYPE_CONTINUOUS},
{ KEY_SHIFTED | KEY_1, -1, SHIP_TAB, "Left Thrust", CC_TYPE_CONTINUOUS},
{ KEY_SHIFTED | KEY_PADPLUS, -1, SHIP_TAB, "Up Thrust", CC_TYPE_CONTINUOUS},
{ KEY_SHIFTED | KEY_PADENTER, -1, SHIP_TAB, "Down Thrust", CC_TYPE_CONTINUOUS},
{ -1, -1, -1, "" }
};
+5 -2
View File
@@ -9,13 +9,16 @@
/*
* $Logfile: /Freespace2/code/Cutscene/Cutscenes.cpp $
* $Revision: 2.2 $
* $Date: 2002-08-01 01:41:04 $
* $Revision: 2.4 $
* $Date: 2002-08-27 13:38:57 $
* $Author: penguin $
*
* Code for the cutscenes viewer screen
*
* $Log: not supported by cvs2svn $
* Revision 2.2 2002/08/01 01:41:04 penguin
* The big include file move
*
* Revision 2.1 2002/07/07 19:55:58 penguin
* Back-port to MSVC
*
+254
View File
@@ -0,0 +1,254 @@
#ifdef _WIN32
#include <windows.h>
#endif
#include <time.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/timeb.h>
#include "dbugfile.h"
bool dbugfile_init_var = false;
char dbugfile_filename[512];
void dbugfile_output(char *buffer)
{
if(dbugfile_init_var == false)
{
return;
}
FILE *fp = fopen(dbugfile_filename, "a");
if(fp == NULL)
{
return;
}
fwrite(buffer, sizeof(char) * strlen(buffer), 1, fp);
fclose(fp);
}
void dbugfile_init()
{
char big_buffer[1000];
char temp_buff[512];
strcpy(dbugfile_filename, "DBUG-");
strcpy(big_buffer, "DBUGFILE Active: ");
#ifdef _WIN32
{
unsigned long len = 512;
GetUserName(temp_buff, &len);
strcat(dbugfile_filename, temp_buff);
strcat(big_buffer, temp_buff);
strcat(dbugfile_filename, "-");
strcat(big_buffer, " ");
}
#endif
_tzset();
// Display operating system-style date and time.
_strtime( temp_buff);
strcat(dbugfile_filename, "(");
strcat(dbugfile_filename,temp_buff);
strcat(big_buffer,temp_buff);
strcat(dbugfile_filename, ")-(");
strcat(big_buffer, " ");
_strdate( temp_buff);
strcat(dbugfile_filename,temp_buff);
strcat(big_buffer,temp_buff);
strcat(dbugfile_filename, ").txt");
strcat(big_buffer, "\n");
// Remove invalid slash chars
int len = strlen(dbugfile_filename);
while(len >= 0)
{
if(dbugfile_filename[len] == '/' || dbugfile_filename[len] == ':')
{
dbugfile_filename[len] = '-';
}
len--;
}
// open file
FILE *fp = fopen(dbugfile_filename, "w");
if(fp == NULL)
{
return;
}
fwrite(big_buffer, sizeof(char) * strlen(big_buffer), 1, fp);
#ifdef _WIN32
// detect OS type
OSVERSIONINFO version_info;
version_info.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
if(GetVersionEx(&version_info) != false)
{
char *error = "Error in detecting OS version";
char *version = error;
switch(version_info.dwMajorVersion)
{
case 4:
{
if(version_info.dwMinorVersion == 0)
{
version = "Windows 95";
}
else if(version_info.dwMinorVersion == 10)
{
version = "Windows 98";
}
else if(version_info.dwMinorVersion == 90)
{
version = "Windows Me";
}
break;
}
case 5:
{
if(version_info.dwMinorVersion == 0)
{
version = "Windows 2000";
}
else if(version_info.dwMinorVersion == 1)
{
version = "Windows XP";
}
break;
}
}
char *release_type = NULL;
#ifdef _DEBUG
release_type = "Debug";
#else
release_type = "Release";
#endif
sprintf(big_buffer, "OS: %s %s\n", version, release_type);
}
fwrite(big_buffer, sizeof(char) * strlen(big_buffer), 1, fp);
#endif
fclose(fp);
dbugfile_init_var = true;
}
void dbugfile_deinit()
{
dbugfile_output("Normal end");
dbugfile_init_var = false;
}
void dbugfile_sprintf(int line, char *file, const char *format, ...)
{
if(dbugfile_init_var == false)
{
return;
}
// find last slash (for PC) to crop file path
char *ptr = strrchr(file, '\\');
if(ptr == NULL)
{
ptr = file;
}
else
{
ptr++;
}
char buffer[1000];
int i = sprintf(buffer, "[%s,%4d] ", ptr, line);
va_list ap;
char *p, *sval;
long ival;
double dval;
// Add each extra parameter to string
va_start(ap, format);
for(p = (char *) format; *p; p++)
{
if(*p != '%')
{
*(buffer + i) = *p;
i++;
continue;
}
p++;
switch(*p)
{
case 'd':
{
ival = va_arg(ap, int);
i += sprintf(buffer+i,"%d", ival);
break;
}
case 'c':
{
ival = va_arg(ap, char);
buffer[i] = (char) ival;
i++;
break;
}
case 'x':
{
ival = va_arg(ap, int);
i += sprintf(buffer+i,"%x", ival);
break;
}
case 'f':
{
dval = va_arg(ap, double);
i += sprintf(buffer+i,"%f", dval);
break;
}
case 's':
{
for(sval = va_arg(ap, char *); *sval; sval++)
{
*(buffer + i++) = *sval;
}
break;
}
default:
{
i += sprintf(buffer+i,"N/A: %%%c", *p);
break;
}
}
}
va_end(ap);
i += sprintf(buffer + i, "\n");
dbugfile_output(buffer);
}
+41
View File
@@ -0,0 +1,41 @@
#ifndef _DBUGFILE_HEADER_
#define _DBUGFILE_HEADER_
void dbugfile_init();
void dbugfile_deinit();
void dbugfile_sprintf(int line, char *file, const char *format, ...);
#ifdef DBUGFILE_ACTIVE
#define DBUGFILE_INIT() dbugfile_init();
#define DBUGFILE_DEINIT() dbugfile_deinit();
#define DBUGFILE_OUTPUT_0(t) dbugfile_sprintf(__LINE__, __FILE__, t);
#define DBUGFILE_OUTPUT_1(t,a) dbugfile_sprintf(__LINE__, __FILE__, t,a);
#define DBUGFILE_OUTPUT_2(t,a,b) dbugfile_sprintf(__LINE__, __FILE__, t,a,b);
#define DBUGFILE_OUTPUT_3(t,a,b,c) dbugfile_sprintf(__LINE__, __FILE__, t,a,b,c);
#define DBUGFILE_OUTPUT_4(t,a,b,c,d) dbugfile_sprintf(__LINE__, __FILE__, t,a,b,c,d);
#define DBUGFILE_OUTPUT_5(t,a,b,c,d,e) dbugfile_sprintf(__LINE__, __FILE__, t,a,b,c,d,e);
#define DBUGFILE_OUTPUT_6(t,a,b,c,d,e,f) dbugfile_sprintf(__LINE__, __FILE__, t,a,b,c,d,e,f;
#define DBUGFILE_OUTPUT_7(t,a,b,c,d,e,f,g) dbugfile_sprintf(__LINE__, __FILE__, t,a,b,c,d,e,f,g);
#define DBUGFILE_OUTPUT_9(t,a,b,c,d,e,f,g,h) dbugfile_sprintf(__LINE__, __FILE__, t,a,b,c,d,e,f,g,h);
#else
#define DBUGFILE_INIT() ;
#define DBUGFILE_DEINIT() ;
#define DBUGFILE_OUTPUT_0(t) ;
#define DBUGFILE_OUTPUT_1(t,a) ;
#define DBUGFILE_OUTPUT_2(t,a,b) ;
#define DBUGFILE_OUTPUT_3(t,a,b,c) ;
#define DBUGFILE_OUTPUT_4(t,a,b,c,d) ;
#define DBUGFILE_OUTPUT_5(t,a,b,c,d,e) ;
#define DBUGFILE_OUTPUT_6(t,a,b,c,d,e,f) ;
#define DBUGFILE_OUTPUT_7(t,a,b,c,d,e,f,g) ;
#define DBUGFILE_OUTPUT_9(t,a,b,c,d,e,f,g,h) ;
#endif
#endif
+148
View File
@@ -0,0 +1,148 @@
#ifdef _WIN32
#include <windows.h>
#include <winbase.h>
#include "dbugfile.h"
#include "timerbar.h"
typedef struct
{
LARGE_INTEGER start_value;
LARGE_INTEGER total_value;
LARGE_INTEGER average;
LARGE_INTEGER frame_total;
} timerbar_profile;
timerbar_profile profiles[TIMERBAR_COLOUR_MAX];
int timerbar_current_profile = 0;
LARGE_INTEGER timerbar_ultimate_start_value;
LARGE_INTEGER timerbar_last_start_value;
void (*draw_func_ptr)(int colour, float x, float y, float w, float h) = NULL;
void timerbar_start_frame()
{
timerbar_current_profile = 0;
if(QueryPerformanceCounter(&timerbar_ultimate_start_value) == FALSE)
{
DBUGFILE_OUTPUT_0("QueryPerformanceCounter not supported by hardware");
draw_func_ptr = NULL;
}
timerbar_last_start_value = timerbar_ultimate_start_value;
}
const int WIDTH = 480;
const float WIDTHF = ((float) WIDTH) * 1.05f;
void timerbar_conv_and_draw(int colour, int xpos, int xwidth, int yrow)
{
float fxpos = (float) xpos;
float fxwidth = (float) xwidth;
draw_func_ptr(colour,
fxpos / WIDTHF,
yrow * 0.01f,
fxwidth / WIDTHF,
0.005f);
}
void timerbar_end_frame()
{
// Now we want to draw the bars
if(draw_func_ptr == NULL)
{
// we have not been given a draw function so we are going to have to quit
return;
}
timerbar_switch_type(-1);
int last_xpos = 0;
int y_pos = 0;
for(int i = 0; i < TIMERBAR_COLOUR_MAX; i++)
{
// Nothing to render this frame
if(profiles[i].frame_total.QuadPart == 0)
{
continue;
}
int xsize = (int) profiles[i].frame_total.QuadPart / 60;
// break condition in else
while(1)
{
// if bar runs over
if(last_xpos + xsize > WIDTH)
{
int rem_len = WIDTH - last_xpos;
// Draw from current position to the end of the bar
timerbar_conv_and_draw(i, last_xpos, rem_len, y_pos);
xsize -= rem_len;
last_xpos = 0;
y_pos++;
}
else
{
// Draw whats left and break for the next bar
timerbar_conv_and_draw(i,last_xpos, xsize, y_pos);
last_xpos += xsize;
break;
}
}
// reset for next frame
profiles[i].frame_total.QuadPart = 0;
}
}
void timerbar_switch_type(int num)
{
if(num >= TIMERBAR_COLOUR_MAX)
{
return;
}
// Calculate old profile's total
LARGE_INTEGER now;
if(QueryPerformanceCounter(&now) == FALSE)
{
DBUGFILE_OUTPUT_0("QueryPerformanceCounter not supported by hardware");
}
profiles[timerbar_current_profile].frame_total.QuadPart =
(now.QuadPart - timerbar_last_start_value.QuadPart);
if(num != -1)
{
// Switch to new profile
timerbar_current_profile = num;
}
// Update time to count from
if(QueryPerformanceCounter(&timerbar_last_start_value) == FALSE)
{
DBUGFILE_OUTPUT_0("QueryPerformanceCounter not supported by hardware");
}
}
void timerbar_set_draw_func(void (*new_draw_func_ptr)(int colour, float x, float y, float w, float h))
{
draw_func_ptr = new_draw_func_ptr;
}
#endif
+34
View File
@@ -0,0 +1,34 @@
#ifndef _TIMERBAR_HEADER_
#define _TIMERBAR_HEADER_
enum
{
TIMERBAR_COLOUR_RED,
TIMERBAR_COLOUR_GREEN,
TIMERBAR_COLOUR_BLUE,
TIMERBAR_COLOUR_MAX,
};
void timerbar_start_frame();
void timerbar_end_frame();
void timerbar_switch_type(int num);
void timerbar_set_draw_func(void (*new_draw_func_ptr)(int colour, float x, float y, float w, float h));
#ifdef TIMEBAR_ACTIVE
#define TIMERBAR_SET_DRAW_FUNC(f) timerbar_set_draw_func(f);
#define TIMERBAR_START_FRAME() timerbar_start_frame();
#define TIMERBAR_END_FRAME() timerbar_end_frame();
#define TIMERBAR_SWITCH_TYPE(n) timerbar_switch_type(n);
#else
#define TIMERBAR_SET_DRAW_FUNC(f) ;
#define TIMERBAR_START_FRAME() ;
#define TIMERBAR_END_FRAME() ;
#define TIMERBAR_SWITCH_TYPE(n) ;
#endif
#endif
+178 -84
View File
@@ -9,13 +9,51 @@
/*
* $Logfile: /Freespace2/code/Freespace2/FreeSpace.cpp $
* $Revision: 2.5 $
* $Date: 2002-08-04 05:11:05 $
* $Author: penguin $
* $Revision: 2.13 $
* $Date: 2002-10-22 17:42:09 $
* $Author: randomtiger $
*
* Freespace main body
*
* $Log: not supported by cvs2svn $
* Revision 2.12 2002/10/19 03:50:28 randomtiger
* Added special pause mode for easier action screenshots.
* Added new command line parameter for accessing all single missions in tech room. - RT
*
* Revision 2.11 2002/10/05 16:46:09 randomtiger
* Added us fs2_open people to the credits. Worth looking at just for that.
* Added timer bar code, by default its not compiled in.
* Use TIMEBAR_ACTIVE in project and dependancy code settings to activate.
* Added the new timebar files with the new code.
*
* Revision 2.10 2002/09/20 20:09:01 phreak
* did glare stuff in game_sunspot_process()
*
<<<<<<< freespace.cpp
*
*
* Revision 2.51 2002/08/04 2`:08:55 PhReAk
* Draw mem usage - will be needed for increasing original limits
*
* Revision 2.51 2002/08/04 20:04:35 PhReAk
* Draw FPS when running debug build
*
=======
* Revision 2.9 2002/08/28 10:51:04 randomtiger
* Woh! I sure as hell didnt modify all these files it says I did.
* I will put this down to the branch! Note: I did start from a fresh checkout!
*
* Revision 2.8 2002/08/27 13:38:57 penguin
* Moved DirectX8 stuff to directx8 branch; reverted to previous
*
* Revision 2.6 2002/08/13 03:34:00 penguin
* 1. Disable CD checking
* 2. Add CVS tag to version string
*
>>>>>>> 2.9
* Revision 2.5 2002/08/04 05:11:05 penguin
* Don't write version to registry; change way version string is formatted
*
* Revision 2.4 2002/08/01 01:41:04 penguin
* The big include file move
*
@@ -482,6 +520,8 @@
*
*/
static const char RCS_Name[] = "$Name: not supported by cvs2svn $";
#include <stdlib.h>
#include <time.h>
@@ -638,6 +678,8 @@
#include "hud/hudshield.h"
#include "ship/shiphit.h"
#include "missionui/missionloopbrief.h"
#include "debugconsole/dbugfile.h"
#include "debugconsole/timerbar.h"
#ifdef NDEBUG
#ifdef FRED
@@ -737,14 +779,16 @@ float frametimes[FRAME_FILTER];
float frametotal = 0.0f;
float flFrametime;
#ifdef RELEASE_REAL
int Show_framerate = 0;
#else
#ifndef NDEBUG
int Show_framerate = 1;
int Show_mem = 1;
#else
int Show_framerate = 0;
int Show_mem = 0;
#endif
int Framerate_cap = 120;
int Show_mem = 0;
int Show_cpu = 0;
int Show_target_debug_info = 0;
int Show_target_weapons = 0;
@@ -1002,7 +1046,7 @@ void game_do_training_checks();
void game_shutdown(void);
void game_show_event_debug(float frametime);
void game_event_debug_init();
void game_frame();
void game_frame(int paused = false);
void demo_upsell_show_screens();
void game_start_subspace_ambient_sound();
void game_stop_subspace_ambient_sound();
@@ -1258,6 +1302,7 @@ DCF(sn_glare, "")
}
float Supernova_last_glare = 0.0f;
extern starfield_bitmap *stars_lookup_sun(starfield_bitmap_instance *s);
void game_sunspot_process(float frametime)
{
int n_lights, idx;
@@ -1325,6 +1370,7 @@ void game_sunspot_process(float frametime)
Sun_drew = 0;
} else {
if ( Sun_drew ) {
starfield_bitmap* sbm;
// check sunspots for all suns
n_lights = light_get_global_count();
@@ -1336,10 +1382,17 @@ void game_sunspot_process(float frametime)
vector light_dir;
light_get_global_dir(&light_dir, idx);
float dot = vm_vec_dot( &light_dir, &Eye_matrix.vec.fvec )*0.5f+0.5f;
Sun_spot_goal += (float)pow(dot,85.0f);
sbm=stars_lookup_sun(&Suns[idx]);
if (!sbm)
continue;
//only do sunglare stuff if this sun has one
if (sbm->glare)
{
float dot = vm_vec_dot( &light_dir, &Eye_matrix.vec.fvec )*0.5f+0.5f;
Sun_spot_goal += (float)pow(dot,85.0f);
}
// draw the glow for this sun
stars_draw_sun_glow(idx);
} else {
@@ -4239,7 +4292,7 @@ void game_render_hud_3d(vector *eye_pos, matrix *eye_orient)
}
void game_frame()
void game_frame(int paused)
{
int actually_playing;
fix total_time1, total_time2;
@@ -4267,83 +4320,96 @@ void game_frame()
}
#endif
// start timing frame
timing_frame_start();
total_time1 = timer_get_fixed_seconds();
// var to hold which state we are in
actually_playing = game_actually_playing();
// start timing frame
timing_frame_start();
#ifndef NO_NETWORK
if ((!(Game_mode & GM_MULTIPLAYER)) || ((Game_mode & GM_MULTIPLAYER) && !(Net_player->flags & NETINFO_FLAG_OBSERVER))) {
if (!(Game_mode & GM_STANDALONE_SERVER)){
Assert( OBJ_INDEX(Player_obj) >= 0 );
total_time1 = timer_get_fixed_seconds();
if(paused)
{
// Reset the lights here or they just keep on increasing
light_reset();
}
else
{
// var to hold which state we are in
actually_playing = game_actually_playing();
#ifndef NO_NETWORK
if ((!(Game_mode & GM_MULTIPLAYER)) || ((Game_mode & GM_MULTIPLAYER) && !(Net_player->flags & NETINFO_FLAG_OBSERVER))) {
if (!(Game_mode & GM_STANDALONE_SERVER)){
Assert( OBJ_INDEX(Player_obj) >= 0 );
}
}
}
#else
Assert( OBJ_INDEX(Player_obj) >= 0 );
#endif // ifndef NO_NETWORK
if (Missiontime > Entry_delay_time){
Pre_player_entry = 0;
} else {
; //nprintf(("AI", "Framecount = %i, time = %7.3f\n", Framecount, f2fl(Missiontime)));
}
// Note: These are done even before the player enters, else buffers can overflow.
if (! (Game_mode & GM_STANDALONE_SERVER)){
radar_frame_init();
}
shield_frame_init();
if ( Player->control_mode != PCM_NORMAL )
camera_move();
if ( !Pre_player_entry && actually_playing ) {
if (! (Game_mode & GM_STANDALONE_SERVER) ) {
if( (!popup_running_state()) && (!popupdead_is_active()) ){
game_process_keys();
// don't read flying controls if we're playing a demo back
if(!(Game_mode & GM_DEMO_PLAYBACK)){
read_player_controls( Player_obj, flFrametime);
#else
Assert( OBJ_INDEX(Player_obj) >= 0 );
#endif // ifndef NO_NETWORK
if (Missiontime > Entry_delay_time){
Pre_player_entry = 0;
} else {
; //nprintf(("AI", "Framecount = %i, time = %7.3f\n", Framecount, f2fl(Missiontime)));
}
// Note: These are done even before the player enters, else buffers can overflow.
if (! (Game_mode & GM_STANDALONE_SERVER)){
radar_frame_init();
}
shield_frame_init();
if ( Player->control_mode != PCM_NORMAL )
camera_move();
if ( !Pre_player_entry && actually_playing ) {
if (! (Game_mode & GM_STANDALONE_SERVER) ) {
if( (!popup_running_state()) && (!popupdead_is_active()) ){
game_process_keys();
// don't read flying controls if we're playing a demo back
if(!(Game_mode & GM_DEMO_PLAYBACK)){
read_player_controls( Player_obj, flFrametime);
}
}
#ifndef NO_NETWORK
// if we're not the master, we may have to send the server-critical ship status button_info bits
if ((Game_mode & GM_MULTIPLAYER) && !(Net_player->flags & NETINFO_FLAG_AM_MASTER) && !(Net_player->flags & NETINFO_FLAG_OBSERVER)){
multi_maybe_send_ship_status();
}
#endif // ifndef NO_NETWORK
}
#ifndef NO_NETWORK
// if we're not the master, we may have to send the server-critical ship status button_info bits
if ((Game_mode & GM_MULTIPLAYER) && !(Net_player->flags & NETINFO_FLAG_AM_MASTER) && !(Net_player->flags & NETINFO_FLAG_OBSERVER)){
multi_maybe_send_ship_status();
}
#endif // ifndef NO_NETWORK
}
}
// Reset the whack stuff
game_whack_reset();
// These two lines must be outside of Pre_player_entry code,
// otherwise too many lights are added.
light_reset();
#ifndef NO_NETWORK
if ((Game_mode & GM_MULTIPLAYER) && (Netgame.game_state == NETGAME_STATE_SERVER_TRANSFER)){
return;
}
#endif // ifndef NO_NETWORK
game_simulation_frame();
// Reset the whack stuff
game_whack_reset();
// These two lines must be outside of Pre_player_entry code,
// otherwise too many lights are added.
light_reset();
#ifndef NO_NETWORK
if ((Game_mode & GM_MULTIPLAYER) && (Netgame.game_state == NETGAME_STATE_SERVER_TRANSFER)){
return;
}
#endif // ifndef NO_NETWORK
game_simulation_frame();
// if not actually in a game play state, then return. This condition could only be true in
// a multiplayer game.
if (!actually_playing ) {
Assert( Game_mode & GM_MULTIPLAYER );
return;
}
// if not actually in a game play state, then return. This condition could only be true in
// a multiplayer game.
if ( !actually_playing ) {
Assert( Game_mode & GM_MULTIPLAYER );
return;
}
TIMERBAR_SWITCH_TYPE(TIMERBAR_D3DCODE);
if (!Pre_player_entry) {
if (! (Game_mode & GM_STANDALONE_SERVER)) {
clear_time1 = timer_get_fixed_seconds();
@@ -4458,7 +4524,7 @@ void game_frame()
nebl_process();
total_time2 = timer_get_fixed_seconds();
// Got some timing numbers
Timing_total = f2fl( total_time2 - total_time1 ) * 1000.0f;
Timing_clear = f2fl( clear_time2 - clear_time1 ) * 1000.0f;
@@ -4473,6 +4539,8 @@ void game_frame()
demo_close();
}
#endif
TIMERBAR_SWITCH_TYPE(TIMERBAR_DEFAULT);
}
#define MAX_FRAMETIME (F1_0/4) // Frametime gets saturated at this. Changed by MK on 11/1/97.
@@ -6483,6 +6551,14 @@ void game_do_state(int state)
break;
case GS_STATE_GAME_PAUSED:
if(pause_get_type() == PAUSE_TYPE_VIEWER) {
read_player_controls( Player_obj, flFrametime);
// game_process_keys();
game_frame(true);
}
pause_do(0);
break;
@@ -7093,6 +7169,7 @@ int PASCAL WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPSTR szCmdLine, int nCmdSh
int main(int argc, char *argv[])
#endif
{
DBUGFILE_INIT();
int result = -1;
#ifdef _WIN32
@@ -7114,6 +7191,7 @@ int main(int argc, char *argv[])
}
#endif
DBUGFILE_DEINIT()
return result;
}
@@ -7826,14 +7904,29 @@ void get_version_string(char *str)
{
//XSTR:OFF
if ( FS_VERSION_BUILD == 0 ) {
sprintf(str,"fs2_open %d.%d", FS_VERSION_MAJOR, FS_VERSION_MINOR);
sprintf(str,"V%d.%d", FS_VERSION_MAJOR, FS_VERSION_MINOR);
} else {
sprintf(str,"fs2_open %d.%d.%d", FS_VERSION_MAJOR, FS_VERSION_MINOR, FS_VERSION_BUILD );
sprintf(str,"V%d.%d.%d", FS_VERSION_MAJOR, FS_VERSION_MINOR, FS_VERSION_BUILD );
}
#ifdef _DEBUG
strcat(str, " Dbg");
#endif
// append the CVS "release" version in the $Name variable, but
// only do this if it's been tagged
int rcs_name_len = strlen(RCS_Name);
if (rcs_name_len > 11) {
char buffer[100];
strcpy(buffer, RCS_Name + 7);
buffer[rcs_name_len-9] = 0;
strcat(str, " Build: ");
strcat(str, buffer);
} else {
strcat(str, " (fs2_open)");
}
//XSTR:ON
/*
HMODULE hMod;
@@ -8607,7 +8700,8 @@ int game_do_cd_check_specific(char *volume_name, int cdnum)
// only need to do this in RELEASE_REAL
int game_do_cd_mission_check(char *filename)
{
#ifdef RELEASE_REAL
//#ifdef RELEASE_REAL
#if 0
int cd_num;
int cd_present = 0;
int cd_drive_num;
+6 -3
View File
@@ -9,13 +9,16 @@
/*
* $Logfile: /Freespace2/code/GlobalIncs/PsTypes.h $
* $Revision: 2.3 $
* $Date: 2002-08-01 01:41:04 $
* $Revision: 2.4 $
* $Date: 2002-08-06 01:49:08 $
* $Author: penguin $
*
* Header file containg global typedefs, constants and macros
*
* $Log: not supported by cvs2svn $
* Revision 2.3 2002/08/01 01:41:04 penguin
* The big include file move
*
* Revision 2.2 2002/07/22 01:04:37 penguin
* took out GAME_CD_CHECK define
*
@@ -269,7 +272,7 @@ typedef unsigned int uint;
//Stucture to store clipping codes in a word
typedef struct ccodes {
ubyte or,and; //or is low byte, and is high byte
ubyte cc_or, cc_and; //or is low byte, and is high byte
} ccodes;
typedef struct vector {
+16 -3
View File
@@ -9,13 +9,19 @@
/*
* $Logfile: /Freespace2/code/GlobalIncs/SystemVars.h $
* $Revision: 2.0 $
* $Date: 2002-06-03 04:02:22 $
* $Author: penguin $
* $Revision: 2.2 $
* $Date: 2002-10-05 16:46:09 $
* $Author: randomtiger $
*
* Variables and constants common to FreeSpace and Fred.
*
* $Log: not supported by cvs2svn $
* Revision 2.1 2002/08/15 04:41:17 penguin
* Added #include, needed for FRED
*
* Revision 2.0 2002/06/03 04:02:22 penguin
* Warpcore CVS sync
*
* Revision 1.2 2002/05/03 22:07:08 mharris
* got some stuff to compile
*
@@ -192,6 +198,7 @@
#ifndef _SYSTEMVARS_H
#define _SYSTEMVARS_H
#include "globalincs/pstypes.h"
#include "math.h"
#define GM_MULTIPLAYER (1 << 0)
@@ -346,4 +353,10 @@ int current_detail_level();
extern int TotalRam;
void windebug_memwatch_init();
enum
{
TIMERBAR_DEFAULT,
TIMERBAR_D3DCODE,
};
#endif
+10 -4
View File
@@ -9,12 +9,18 @@
/*
* $Logfile: /Freespace2/code/GlobalIncs/version.h $
* $Revision: 2.1 $
* $Date: 2002-08-04 05:11:36 $
* $Author: penguin $
* $Revision: 2.3 $
* $Date: 2002-11-10 20:40:02 $
* $Author: inquisitor $
*
*
* $Log: not supported by cvs2svn $
* Revision 2.2 2002/08/13 03:32:25 penguin
* Bumped to version 3.2
*
* Revision 2.1 2002/08/04 05:11:36 penguin
* Update version number to 3.1
*
* Revision 2.0 2002/06/03 04:02:22 penguin
* Warpcore CVS sync
*
@@ -123,7 +129,7 @@
// Major.Minor.Bugfix
#define FS_VERSION_MAJOR 3 // major version
#define FS_VERSION_MINOR 1 // increase by 1 for minor revs
#define FS_VERSION_MINOR 3 // increase by 1 for minor revs
#define FS_VERSION_BUILD 0 // bugfix release
#define VERSION_LOC_FNAME "version.nfo"
+12 -3
View File
@@ -9,13 +9,16 @@
/*
* $Logfile: /Freespace2/code/Graphics/GrD3D.cpp $
* $Revision: 2.2 $
* $Date: 2002-08-01 01:41:05 $
* $Author: penguin $
* $Revision: 2.3 $
* $Date: 2002-10-05 16:46:09 $
* $Author: randomtiger $
*
* Code for our Direct3D renderer
*
* $Log: not supported by cvs2svn $
* Revision 2.2 2002/08/01 01:41:05 penguin
* The big include file move
*
* Revision 2.1 2002/07/30 14:29:15 unknownplayer
*
* Started work on DX8.1 implementation. Updated the project files to encompass
@@ -209,6 +212,7 @@
#include "globalincs/systemvars.h"
#include "cfile/cfile.h"
#include "cmdline/cmdline.h"
#include "debugconsole/timerbar.h"
LPDIRECTDRAW lpDD1 = NULL;
@@ -791,7 +795,10 @@ void d3d_stop_frame()
In_frame--;
TIMERBAR_END_FRAME();
ddrval = lpD3DDevice->EndScene();
TIMERBAR_START_FRAME();
if (ddrval != D3D_OK ) {
//mprintf(( "Failed to end scene!\n%s\n", d3d_error_string(ddrval) ));
return;
@@ -2818,6 +2825,8 @@ void gr_d3d_init()
gr_clear();
gr_flip();
Mouse_hidden--;
TIMERBAR_SET_DRAW_FUNC(d3d_render_timer_bar);
}
char* d3d_error_string(HRESULT error)
+7 -3
View File
@@ -9,13 +9,16 @@
/*
* $Logfile: /Freespace2/code/Graphics/GrD3DInternal.h $
* $Revision: 2.1 $
* $Date: 2002-08-01 01:41:05 $
* $Author: penguin $
* $Revision: 2.2 $
* $Date: 2002-10-05 16:46:09 $
* $Author: randomtiger $
*
* Prototypes for the variables used internally by the Direct3D renderer
*
* $Log: not supported by cvs2svn $
* Revision 2.1 2002/08/01 01:41:05 penguin
* The big include file move
*
* Revision 2.0 2002/06/03 04:02:22 penguin
* Warpcore CVS sync
*
@@ -217,6 +220,7 @@ void gr_d3d_set_palette(ubyte *new_palette, int restrict_alphacolor);
void gr_d3d_diamond(int x, int y, int width, int height);
void gr_d3d_print_screen(char *filename);
void d3d_render_timer_bar(int colour, float x, float y, float w, float h);
// Functions used to render. Calls either DrawPrim or Execute buffer code
HRESULT d3d_SetRenderState( D3DRENDERSTATETYPE dwRenderStateType, DWORD dwRenderState );
+79 -8
View File
@@ -9,13 +9,32 @@
/*
* $Logfile: /Freespace2/code/Graphics/GrD3DRender.cpp $
* $Revision: 2.2 $
* $Date: 2002-08-03 19:42:17 $
* $Revision: 2.4 $
* $Date: 2002-10-05 16:46:09 $
* $Author: randomtiger $
*
* Code to actually render stuff using Direct3D
*
* $Log: not supported by cvs2svn $
* Revision 2.3 2002/08/07 00:45:25 DTP
* Implented -GF4FIX commandline switch & #include "cmdline/cmdline.h"
*
* Revision 2.2 2002/08/03 19:42:17 randomtiger
* Fixed Geforce 4 bug that caused font and hall video distortion.
* Very small change in 'gr_d3d_aabitmap_ex_internal'
*
* Tested and works on the following systems
*
* OUTSIDER Voodoo 3 win98
* OUTSIDER Geforce 2 win2000
* Me Geforce 4 PNY 4600 XP
* JBX-Phoenix Geforce 4 PNY XP
* Mehrunes GeForce 3 XP
* WMCoolmon nVidia TNT2 M64 win2000
* Orange GeForce 4 4200 XP
* ShadowWolf_IH Monster2 win98
* ShadowWolf_IH voodoo 2 win98
*
* Revision 2.1 2002/08/01 01:41:05 penguin
* The big include file move
*
@@ -326,6 +345,8 @@
#include "cfile/cfile.h"
#include "nebula/neb.h"
#include "render/3d.h"
#include "cmdline/cmdline.h" //DTP for random tigers GF4fix, and the commandline switch.
#include "debugconsole/timerbar.h"
typedef enum gr_texture_source {
TEXTURE_SOURCE_NONE,
@@ -1489,19 +1510,30 @@ void gr_d3d_aabitmap_ex_internal(int x,int y,int w,int h,int sx,int sy)
bm_get_info( gr_screen.current_bitmap, &bw, &bh );
// Rendition
// Rendition
if ( D3d_rendition_uvs ) {
u0 = u_scale*(i2fl(sx)+0.5f)/i2fl(bw);
v0 = v_scale*(i2fl(sy)+0.5f)/i2fl(bh);
u1 = u_scale*(i2fl(sx+w)+0.5f)/i2fl(bw);
v1 = v_scale*(i2fl(sy+h)+0.5f)/i2fl(bh);
} else {
u0 = u_scale*i2fl((sx)-0.5f)/i2fl(bw);
v0 = v_scale*i2fl((sy)-0.5f)/i2fl(bh);
//} else { //DTP; commented out, for easy re-editing
// u0 = u_scale*i2fl((sx)-0.5f)/i2fl(bw);
// v0 = v_scale*i2fl((sy)-0.5f)/i2fl(bh);
u1 = u_scale*i2fl((sx+w)-0.5f)/i2fl(bw);
v1 = v_scale*i2fl((sy+h)-0.5f)/i2fl(bh);
// u1 = u_scale*i2fl((sx+w)-0.5f)/i2fl(bw);
// v1 = v_scale*i2fl((sy+h)-0.5f)/i2fl(bh);
//}
} else if (!Cmdline_gf4fix) { //DTP if not set at commandline do the original code
u0 = u_scale*i2fl(sx)/i2fl(bw);
v0 = v_scale*i2fl(sy)/i2fl(bh);
u1 = u_scale*i2fl(sx+w)/i2fl(bw);
v1 = v_scale*i2fl(sy+h)/i2fl(bh);
} else { //DTP; these next 4 lines is random tigers Fix. activated by setting -GF4FIX in the commandline.
u0 = u_scale*(i2fl(sx)-0.5f)/i2fl(bw);
v0 = v_scale*(i2fl(sy)-0.5f)/i2fl(bh);
u1 = u_scale*(i2fl(sx+w)-0.5f)/i2fl(bw);
v1 = v_scale*(i2fl(sy+h)-0.5f)/i2fl(bh);
}
x1 = i2fl(x+gr_screen.offset_x);
@@ -2269,5 +2301,44 @@ void gr_d3d_print_screen(char *filename)
}
void d3d_render_timer_bar(int colour, float x, float y, float w, float h)
{
static D3DCOLOR pre_set_colours[TIMERBAR_COLOUR_MAX] =
{
0xffff0000, // red
0xff00ff00, // green
0xff0000ff, // blue
};
D3DTLVERTEX d3d_verts[4];
static float max_fw = (float) gr_screen.max_w;
static float max_fh = (float) gr_screen.max_h;
d3d_verts[0].rhw = 1;
d3d_verts[0].color = pre_set_colours[colour];
d3d_verts[0].sx = max_fw * x;
d3d_verts[0].sy = max_fh * y;
d3d_verts[1].rhw = 1;
d3d_verts[1].color = pre_set_colours[colour];
d3d_verts[1].sx = max_fw * (x + w);
d3d_verts[1].sy = max_fh * y;
d3d_verts[2].rhw = 1;
d3d_verts[2].color = pre_set_colours[colour];
d3d_verts[2].sx = max_fw * (x + w);
d3d_verts[2].sy = max_fh * (y + h);
d3d_verts[3].rhw = 1;
d3d_verts[3].color = pre_set_colours[colour];
d3d_verts[3].sx = max_fw * x;
d3d_verts[3].sy = max_fh * (y + h);
gr_d3d_set_state(TEXTURE_SOURCE_NONE, ALPHA_BLEND_NONE, ZBUFFER_TYPE_NONE);
d3d_DrawPrimitive(D3DPT_TRIANGLEFAN,D3DVT_TLVERTEX,(LPVOID)d3d_verts,4,NULL);
}
File diff suppressed because it is too large. Load diff
+17 -4
View File
@@ -9,13 +9,16 @@
/*
* $Logfile: /Freespace2/code/Hud/HUD.cpp $
* $Revision: 2.1 $
* $Date: 2002-08-01 01:41:05 $
* $Author: penguin $
* $Revision: 2.2 $
* $Date: 2002-10-17 20:40:50 $
* $Author: randomtiger $
*
* C module that contains all the HUD functions at a high level
*
* $Log: not supported by cvs2svn $
* Revision 2.1 2002/08/01 01:41:05 penguin
* The big include file move
*
* Revision 2.0 2002/06/03 04:02:23 penguin
* Warpcore CVS sync
*
@@ -372,12 +375,15 @@
#define HUD_NEW_ALPHA_NORMAL_HI 190
#define HUD_NEW_ALPHA_BRIGHT_HI 255
// This is used to prevent drawing of hud (and pause popup)
// globals that will control the color of the HUD gauges
int HUD_color_red = 0;
int HUD_color_green = 255;
int HUD_color_blue = 0;
int HUD_color_alpha = HUD_COLOR_ALPHA_DEFAULT; // 1 -> HUD_COLOR_ALPHA_USER_MAX
int HUD_draw = 1;
int HUD_contrast = 0; // high or lo contrast (for nebula, etc)
color HUD_color_defaults[HUD_NUM_COLOR_LEVELS]; // array of colors with different alpha blending
@@ -959,11 +965,18 @@ void HUD_init()
// default to high contrast in the nebula
HUD_contrast = 0;
HUD_draw = 1;
if(The_mission.flags & MISSION_FLAG_FULLNEB){
HUD_contrast = 1;
}
}
void hud_toggle_draw()
{
HUD_draw = !HUD_draw;
}
// return !0 if HUD is disabled (ie no gauges are shown/usable), otherwise return 0
int hud_disabled()
{
@@ -971,7 +984,7 @@ int hud_disabled()
//return 1;
//}
return 0;
return !HUD_draw;
}
// Determine if we should popup the weapons gauge on the HUD.
+7 -3
View File
@@ -9,13 +9,16 @@
/*
* $Logfile: /Freespace2/code/Hud/HUD.h $
* $Revision: 2.1 $
* $Date: 2002-08-01 01:41:05 $
* $Author: penguin $
* $Revision: 2.2 $
* $Date: 2002-10-17 20:40:50 $
* $Author: randomtiger $
*
* Header file for functions that contain HUD functions at a high level
*
* $Log: not supported by cvs2svn $
* Revision 2.1 2002/08/01 01:41:05 penguin
* The big include file move
*
* Revision 2.0 2002/06/03 04:02:23 penguin
* Warpcore CVS sync
*
@@ -404,6 +407,7 @@ void hud_subspace_notify_abort();
// render multiplayer text message currently being entered if any
void hud_maybe_render_multi_text();
void hud_toggle_draw();
int hud_disabled();
int hud_support_find_closest( int objnum );
+95 -7
View File
@@ -9,13 +9,16 @@
/*
* $Logfile: /Freespace2/code/Hud/HUDtarget.cpp $
* $Revision: 2.1 $
* $Date: 2002-08-01 01:41:05 $
* $Author: penguin $
* $Revision: 2.2 $
* $Date: 2002-09-20 20:02:00 $
* $Author: phreak $
*
* C module to provide HUD targeting functions
*
* $Log: not supported by cvs2svn $
* Revision 2.1 2002/08/01 01:41:05 penguin
* The big include file move
*
* Revision 2.0 2002/06/03 04:02:23 penguin
* Warpcore CVS sync
*
@@ -3912,6 +3915,7 @@ void hud_show_lead_indicator(vector *target_world_pos)
polymodel *po;
ship_weapon *swp;
weapon_info *wip;
weapon_info *tmp=NULL;
float dist_to_target, time_to_target, target_moved_dist, prange, srange;
int bank_to_fire, indicator_frame, frame_offset;
@@ -3972,17 +3976,41 @@ void hud_show_lead_indicator(vector *target_world_pos)
srange = ship_get_secondary_weapon_range(Player_ship);
if ( swp->current_secondary_bank >= 0 ) {
weapon_info *wip;
int bank = swp->current_secondary_bank;
wip = &Weapon_info[swp->secondary_bank_weapons[bank]];
if ( wip->wi_flags & WIF_HOMING_ASPECT ) {
tmp = &Weapon_info[swp->secondary_bank_weapons[bank]];
if ( tmp->wi_flags & WIF_HOMING_ASPECT ) {
if ( !Player->target_in_lock_cone ) {
srange = -1.0f;
}
}
}
frame_offset=hudtarget_lead_indicator_pick_frame(prange, srange, dist_to_target);
//frame_offset=hudtarget_lead_indicator_pick_frame(prange, srange, dist_to_target);
if (dist_to_target < prange)
{
frame_offset=2;
if (tmp)
{
if ((dist_to_target < srange) && (tmp->wi_flags & WIF_HOMING_HEAT))
{
frame_offset=1;
}
}
}
else
{
frame_offset=-1;
if (tmp)
{
if((dist_to_target < srange) && (tmp->wi_flags & WIF_HOMING_HEAT))
{
frame_offset=0;
}
}
}
if ( frame_offset < 0 ) {
return;
}
@@ -4027,6 +4055,66 @@ void hud_show_lead_indicator(vector *target_world_pos)
}
}
}
//do dumbfire lead indicator - color is orange (255,128,0) - bright, (192,96,0) - dim
//phreak changed 9/01/02
if(swp->current_secondary_bank>=0)
{
int bank=swp->current_secondary_bank;
wip=&Weapon_info[swp->secondary_bank_weapons[bank]];
//get out of here if the secondary weapon is a homer or if its out of range
if ( (wip->wi_flags & WIF_HOMING_HEAT) || (wip->wi_flags & WIF_HOMING_ASPECT))
return;
double max_dist=wip->lifetime*wip->max_speed;
if (dist_to_target > max_dist)
return;
}
//give it the "in secondary range frame
indicator_frame = Lead_indicator_gauge.first_frame;
Assert(wip->max_speed != 0);
time_to_target = dist_to_target / wip->max_speed;
target_moved_dist = targetp->phys_info.speed * time_to_target;
target_moving_direction = targetp->phys_info.vel;
// if we've reached here, the lead target indicator will be displayed
Players[Player_num].lead_indicator_active = 1;
// test if the target is moving at all
if ( vm_vec_mag_quick(&targetp->phys_info.vel) < 0.1f) // Find distance!
Players[Player_num].lead_target_pos = *target_world_pos;
else {
vm_vec_normalize(&target_moving_direction);
vm_vec_scale(&target_moving_direction,target_moved_dist);
vm_vec_add(&Players[Player_num].lead_target_pos, target_world_pos, &target_moving_direction );
polish_predicted_target_pos(target_world_pos, &Players[Player_num].lead_target_pos, dist_to_target, &last_delta_vector, 1); // Not used:, float time_to_enemy)
}
g3_rotate_vertex(&lead_target_vertex,&Players[Player_num].lead_target_pos);
if (lead_target_vertex.codes == 0) { // on screen
g3_project_vertex(&lead_target_vertex);
if (!(lead_target_vertex.flags & PF_OVERFLOW)) {
if ( hud_gauge_maybe_flash(HUD_LEAD_INDICATOR) == 1 ) {
hud_set_iff_color(targetp, 0);
} else {
hud_set_iff_color(targetp, 1);
}
if ( indicator_frame >= 0 ) {
GR_AABITMAP(indicator_frame, fl2i(lead_target_vertex.sx - Lead_indicator_half[gr_screen.res][0]), fl2i(lead_target_vertex.sy - Lead_indicator_half[gr_screen.res][1]));
}
}
}
}
// hud_cease_subsystem_targeting() will cease targeting the current targets subsystems
+127 -12
View File
@@ -9,13 +9,28 @@
/*
* $Logfile: /Freespace2/code/Hud/HUDtargetbox.cpp $
* $Revision: 2.1 $
* $Date: 2002-08-01 01:41:06 $
* $Author: penguin $
* $Revision: 2.4 $
* $Date: 2002-10-22 23:02:40 $
* $Author: randomtiger $
*
* C module for drawing the target monitor box on the HUD
*
* $Log: not supported by cvs2svn $
* Revision 2.3 2002/09/20 20:01:30 phreak
* extra effects during cargo scan
*
* Revision 2.2 2002/08/06 16:50:44 phreak
* added wireframe targetbox feature
*
* Revision 2.2 2002/08/04 23:17:40 phreak
* Did the toggling code for wireframes -> CTRL+SHIFT+Q
*
* Revision 2.2 2002/08/04 21:53:13 phreak
* Changed hud_render_target_asteroid, ...weapon, ...ship to render in wireframe
*
* Revision 2.1 2002/08/01 01:41:06 penguin
* The big include file move
*
* Revision 2.0 2002/06/03 04:02:23 penguin
* Warpcore CVS sync
*
@@ -228,6 +243,7 @@
#include "network/multi.h"
#include "weapon/emp.h"
#include "localization/localize.h"
#include "cmdline/cmdline.h"
int Target_window_coords[GR_NUM_RESOLUTIONS][4] =
{
@@ -368,6 +384,8 @@ int Targetbox_flash_flags;
// during the game.
int Targetbox_show_extra_info = 1;
int Targetbox_wire=0;
// Different target states. This drives the text display right below the hull integrity on the targetbox.
#define TS_DIS 0
#define TS_OK 1
@@ -794,11 +812,14 @@ void hud_render_target_asteroid(object *target_objp)
float time_to_impact, factor;
int subtype;
int flags=0; //draw flags for wireframe
asteroidp = &Asteroids[target_objp->instance];
target_team = obj_team(target_objp);
subtype = asteroidp->asteroid_subtype;
time_to_impact = asteroid_time_to_impact(target_objp);
if ( Detail.targetview_model ) {
// take the forward orientation to be the vector from the player to the current target
@@ -817,7 +838,20 @@ void hud_render_target_asteroid(object *target_objp)
hud_render_target_setup(&camera_eye, &camera_orient, 0.5f);
model_clear_instance(Asteroid_info[asteroidp->type].model_num[subtype]);
model_render(Asteroid_info[asteroidp->type].model_num[subtype], &target_objp->orient, &obj_pos, MR_NO_LIGHTING | MR_LOCK_DETAIL );
if (Targetbox_wire!=0)
{
if (time_to_impact>=0)
model_set_outline_color(255,255,255);
else
model_set_outline_color(64,64,0);
flags = MR_SHOW_OUTLINE;
if (Targetbox_wire==1)
flags |=MR_NO_POLYS;
}
model_render(Asteroid_info[asteroidp->type].model_num[subtype], &target_objp->orient, &obj_pos, flags |MR_NO_LIGHTING | MR_LOCK_DETAIL );
hud_render_target_close();
}
@@ -860,7 +894,7 @@ void hud_render_target_asteroid(object *target_objp)
emp_hud_printf(Targetbox_coords[gr_screen.res][TBOX_NAME][0], Targetbox_coords[gr_screen.res][TBOX_NAME][1], EG_TBOX_NAME, hud_name);
time_to_impact = asteroid_time_to_impact(target_objp);
if ( time_to_impact >= 0 ) {
emp_hud_printf(Targetbox_coords[gr_screen.res][TBOX_CLASS][0], Targetbox_coords[gr_screen.res][TBOX_CLASS][1], EG_TBOX_CLASS, NOX("impact: %.1f sec"), time_to_impact);
}
@@ -1180,12 +1214,26 @@ void hud_maybe_render_cargo_scan(ship_info *target_sip)
gr_line(x1, y1, x2, y1);
// RT Changed this to be optional
if(Cmdline_phreak) {
// added 2nd horizontal scan line - phreak
y1 = fl2i(Cargo_scan_coords[gr_screen.res][1] + Cargo_scan_coords[gr_screen.res][3] - ( (i2fl(Player->cargo_inspect_time) / scan_time) * Cargo_scan_coords[gr_screen.res][3] ));
gr_line(x1, y1, x2, y1);
}
// draw vertical scan line
x1 = fl2i(0.5f + Cargo_scan_coords[gr_screen.res][0] + ( (i2fl(Player->cargo_inspect_time) / scan_time) * Cargo_scan_coords[gr_screen.res][2] ));
y1 = Cargo_scan_coords[gr_screen.res][1];
y2 = y1 + Cargo_scan_coords[gr_screen.res][3];
gr_line(x1, y1-3, x1, y2-1);
// RT Changed this to be optional
if(Cmdline_phreak) {
// added 2nd vertical scan line - phreak
x1 = fl2i(0.5f + Cargo_scan_coords[gr_screen.res][2] + Cargo_scan_coords[gr_screen.res][0] - ( (i2fl(Player->cargo_inspect_time) / scan_time) * Cargo_scan_coords[gr_screen.res][2] ));
gr_line(x1, y1-3, x1, y2-1);
}
}
// Get the eye position for an object at the origin, called from hud_render_target_ship()
@@ -1231,6 +1279,7 @@ void hud_render_target_ship(object *target_objp)
target_shipp = &Ships[target_objp->instance];
target_sip = &Ship_info[target_shipp->ship_info_index];
int flags=0;
if ( Detail.targetview_model ) {
// take the forward orientation to be the vector from the player to the current target
vm_vec_sub(&orient_vec, &target_objp->pos, &Player_obj->pos);
@@ -1253,11 +1302,41 @@ void hud_render_target_ship(object *target_objp)
// model_clear_instance(target_sip->modelnum);
ship_model_start( target_objp );
if (Targetbox_wire!=0)
{
//set team colors
if (target_shipp->team==Player_ship->team)
{
model_set_outline_color(0,255,0);
}
else if (((Player_ship->team==TEAM_TRAITOR) && (target_shipp->team==TEAM_FRIENDLY)) ||
(target_shipp->team==TEAM_HOSTILE) || (target_shipp->team==TEAM_NEUTRAL))
{
model_set_outline_color(255,0,0);
}
else if (target_shipp->team==TEAM_UNKNOWN)
{
model_set_outline_color(255,0,255);
}
else
{
model_set_outline_color(255,255,255);
}
//if a ship is tagged, it overrides team colors
if (ship_is_tagged(target_objp))
{
model_set_outline_color(255,255,0);
}
flags = MR_SHOW_OUTLINE;
if (Targetbox_wire==1)
flags |=MR_NO_POLYS;
}
// maybe render a special hud-target-only model
if(target_sip->modelnum_hud >= 0){
model_render( target_sip->modelnum_hud, &target_objp->orient, &obj_pos, MR_NO_LIGHTING | MR_LOCK_DETAIL | MR_AUTOCENTER);
model_render( target_sip->modelnum_hud, &target_objp->orient, &obj_pos, flags | MR_NO_LIGHTING | MR_LOCK_DETAIL | MR_AUTOCENTER);
} else {
model_render( target_sip->modelnum, &target_objp->orient, &obj_pos, MR_NO_LIGHTING | MR_LOCK_DETAIL | MR_AUTOCENTER);
model_render( target_sip->modelnum, &target_objp->orient, &obj_pos, flags | MR_NO_LIGHTING | MR_LOCK_DETAIL | MR_AUTOCENTER);
}
ship_model_stop( target_objp );
@@ -1293,6 +1372,8 @@ void hud_render_target_ship(object *target_objp)
hud_blit_target_foreground();
hud_blit_target_integrity(0,OBJ_INDEX(target_objp));
hud_set_gauge_color(HUD_TARGET_MONITOR);
hud_render_target_ship_info(target_objp);
hud_maybe_render_cargo_scan(target_sip);
}
@@ -1311,13 +1392,13 @@ void hud_render_target_debris(object *target_objp)
vector orient_vec, up_vector;
int target_team, base_index;
float factor;
int flags=0;
debrisp = &Debris[target_objp->instance];
//target_sip = &Ship_info[debrisp->ship_info_index];
target_team = obj_team(target_objp);
if ( Detail.targetview_model ) {
// take the forward orientation to be the vector from the player to the current target
vm_vec_sub(&orient_vec, &target_objp->pos, &Player_obj->pos);
@@ -1333,17 +1414,24 @@ void hud_render_target_debris(object *target_objp)
// the objects position
vm_vec_copy_scale(&obj_pos,&orient_vec,factor);
if (Targetbox_wire!=0)
{
model_set_outline_color(255,255,255);
flags = MR_SHOW_OUTLINE;
if (Targetbox_wire==1)
flags |=MR_NO_POLYS;
}
hud_render_target_setup(&camera_eye, &camera_orient, 0.5f);
model_clear_instance(debrisp->model_num);
submodel_render( debrisp->model_num, debrisp->submodel_num, &target_objp->orient, &obj_pos, MR_NO_LIGHTING | MR_LOCK_DETAIL );
// This calls the colour that doesnt get reset
submodel_render( debrisp->model_num, debrisp->submodel_num, &target_objp->orient, &obj_pos, flags | MR_NO_LIGHTING | MR_LOCK_DETAIL );
hud_render_target_close();
}
HUD_reset_clip();
hud_blit_target_foreground();
hud_blit_target_integrity(1);
// hud_set_default_color();
hud_set_gauge_color(HUD_TARGET_MONITOR);
// take ship "copies" into account before printing out ship class information
base_index = debrisp->ship_info_index;
@@ -1380,6 +1468,7 @@ void hud_render_target_weapon(object *target_objp)
int target_team, is_homing, is_player_missile, missile_view, viewed_model_num, w, h;
float factor;
char outstr[100]; // temp buffer
int flags=0;
target_team = obj_team(target_objp);
@@ -1408,6 +1497,31 @@ void hud_render_target_weapon(object *target_objp)
viewed_model_num = Ships[wp->homing_object->instance].modelnum;
}
if (Targetbox_wire!=0)
{
if (target_team==Player_ship->team)
{
model_set_outline_color(0,255,0);
}
else if (((Player_ship->team==TEAM_TRAITOR) && (target_team==TEAM_FRIENDLY)) ||
(target_team==TEAM_HOSTILE) || (target_team==TEAM_NEUTRAL))
{
model_set_outline_color(128,128,0);
}
else if (target_team==TEAM_UNKNOWN)
{
model_set_outline_color(255,0,255);
}
else
{
model_set_outline_color(255,255,255);
}
flags = MR_SHOW_OUTLINE;
if (Targetbox_wire==1)
flags |=MR_NO_POLYS;
}
// take the forward orientation to be the vector from the player to the current target
vm_vec_sub(&orient_vec, &viewed_obj->pos, &viewer_obj->pos);
vm_vec_normalize(&orient_vec);
@@ -1427,7 +1541,8 @@ void hud_render_target_weapon(object *target_objp)
hud_render_target_setup(&camera_eye, &camera_orient, View_zoom/3);
model_clear_instance(viewed_model_num);
model_render( viewed_model_num, &viewed_obj->orient, &obj_pos, MR_NO_LIGHTING | MR_LOCK_DETAIL );
model_render( viewed_model_num, &viewed_obj->orient, &obj_pos, flags | MR_NO_LIGHTING | MR_LOCK_DETAIL | MR_AUTOCENTER);
hud_render_target_close();
}
+13 -3
View File
@@ -9,13 +9,20 @@
/*
* $Logfile: /Freespace2/code/Hud/HUDtargetbox.h $
* $Revision: 2.0 $
* $Date: 2002-06-03 04:02:23 $
* $Author: penguin $
* $Revision: 2.1 $
* $Date: 2002-08-06 16:50:13 $
* $Author: phreak $
*
* Header file for drawing the target monitor box on the HUD
*
* $Log: not supported by cvs2svn $
* Revision 2.0 2002/06/03 04:02:23 penguin
* Warpcore CVS sync
*
* Revision 1.2 2002/08/04 22:46:55 PhReAk
* Added "Targetbox_wire" variable to toggle if wireframes are on=1 or off=0
*
*
* Revision 1.1 2002/05/02 18:03:08 mharris
* Initial checkin - converted filenames and includes to lower case
*
@@ -145,6 +152,9 @@ extern int Target_window_coords[GR_NUM_RESOLUTIONS][4];
// during the game.
extern int Targetbox_show_extra_info;
//used to track if the player has wireframe hud target box turned on
extern int Targetbox_wire;
void hud_targetbox_init();
void hud_targetbox_init_flash();
void hud_render_target_model();
+13 -12
View File
@@ -9,13 +9,16 @@
/*
* $Logfile: /Freespace2/code/Hud/HUDWingmanStatus.cpp $
* $Revision: 2.1 $
* $Date: 2002-08-01 01:41:06 $
* $Revision: 2.2 $
* $Date: 2002-08-06 04:39:26 $
* $Author: penguin $
*
* Module for the wingman status gauge
*
* $Log: not supported by cvs2svn $
* Revision 2.1 2002/08/01 01:41:06 penguin
* The big include file move
*
* Revision 2.0 2002/06/03 04:02:23 penguin
* Warpcore CVS sync
*
@@ -172,6 +175,13 @@ static int HUD_wingman_flash_duration[HUD_WINGMAN_MAX_WINGS][HUD_WINGMAN_MAX_SHI
static int HUD_wingman_flash_next[HUD_WINGMAN_MAX_WINGS][HUD_WINGMAN_MAX_SHIPS_PER_WINGS];
static int HUD_wingman_flash_is_bright;
//XSTR:OFF
// Text versions of wingman names (instead of bitmaps in winman5.ani)
static char *Wingman_status_name_abbr[6] = { "alp", "bet", "gam", "del", "eps", "zet" };
//XSTR:ON
// coords to draw wingman status icons, for 1-5 wings (0-4)
int HUD_wingman_left_coords[GR_NUM_RESOLUTIONS][5][2] = {
{ // GR_640
@@ -691,8 +701,6 @@ void hud_wingman_status_blit_dots(int wing_index, int screen_index, int num_wing
}
// draw wing name
bitmap = Wingman_status_frames[WINGMAN_STATUS_NAMES].first_frame + wing_index;
if ( num_wings_to_draw == 1 ) {
sx = HUD_wingman_status_single_coords[gr_screen.res][0][0] - 8;
sy = HUD_wingman_status_single_coords[gr_screen.res][0][1] + 26;
@@ -700,15 +708,8 @@ void hud_wingman_status_blit_dots(int wing_index, int screen_index, int num_wing
sx = HUD_wingman_status_name_coords[gr_screen.res][screen_pos][0];
sy = HUD_wingman_status_name_coords[gr_screen.res][screen_pos][1];
}
// hud_set_default_color();
hud_set_gauge_color(HUD_WINGMEN_STATUS);
if ( bitmap > -1 ) {
GR_AABITMAP(bitmap, sx, sy);
// gr_set_bitmap(bitmap);
// gr_aabitmap(sx, sy);
}
gr_string(sx, sy, Wingman_status_name_abbr[wing_index]);
}
int hud_wingman_status_wingmen_exist(int num_wings_to_draw)
+67 -10
View File
@@ -9,13 +9,30 @@
/*
* $Logfile: /Freespace2/code/Io/KeyControl.cpp $
* $Revision: 2.1 $
* $Date: 2002-08-01 01:41:06 $
* $Author: penguin $
* $Revision: 2.4 $
* $Date: 2002-10-19 03:50:29 $
* $Author: randomtiger $
*
* Routines to read and deal with keyboard input.
*
* $Log: not supported by cvs2svn $
* Revision 2.3 2002/10/17 20:40:51 randomtiger
* Added ability to remove HUD ingame on keypress shift O
* So I've added a new key to the bind list and made use of already existing hud removal code.
*
* Revision 2.2 2002/08/06 16:49:22 phreak
* added keybing for wireframe hud,
* fixed previous missile cheat
*
*
* Revision 2.2 2002/08/04 23:15:40 PhReAk
* Fixed previous missile cheat, commented out beam_test(x) lines
* in process_debug_keys(). beam_test(x) caused assertion failure in
* beam.cpp apprx line 3147. Also added toggle for wire_hud in process_player_ship_keys()
*
* Revision 2.1 2002/08/01 01:41:06 penguin
* The big include file move
*
* Revision 2.0 2002/06/03 04:02:24 penguin
* Warpcore CVS sync
*
@@ -348,6 +365,7 @@
#include "mission/missionmessage.h"
#include "menuui/mainhallmenu.h"
#include "ship/aigoals.h"
#include "missionui/missionpause.h"
// --------------------------------------------------------------
// Global to file
@@ -511,7 +529,9 @@ int Normal_key_set[] = {
TOGGLE_HUD_CONTRAST,
MULTI_TOGGLE_NETINFO,
MULTI_SELF_DESTRUCT
MULTI_SELF_DESTRUCT,
TOGGLE_HUD
};
int Dead_key_set[] = {
@@ -635,7 +655,9 @@ int Non_critical_key_set[] = {
TOGGLE_HUD_CONTRAST,
MULTI_TOGGLE_NETINFO,
MULTI_SELF_DESTRUCT
MULTI_SELF_DESTRUCT,
TOGGLE_HUD
};
@@ -1066,7 +1088,7 @@ void process_debug_keys(int k)
break;
}
/*
case KEY_DEBUGGED + KEY_SHIFTED + KEY_9: {
case KEY_DEBUGGED1 + KEY_SHIFTED + KEY_9:
ship* shipp;
@@ -1079,7 +1101,7 @@ void process_debug_keys(int k)
HUD_sourced_printf(HUD_SOURCE_HIDDEN, XSTR( "Secondary Weapon forced to %s", 18), Weapon_info[shipp->weapons.secondary_bank_weapons[shipp->weapons.current_secondary_bank]].name);
break;
}
*/
#ifndef FS2_DEMO
case KEY_DEBUGGED + KEY_U: {
@@ -1251,7 +1273,7 @@ void process_debug_keys(int k)
HUD_sourced_printf(HUD_SOURCE_HIDDEN, XSTR( "Skill level set to %s.", 25), Skill_level_names(Game_skill_level));
break;
// kill all missiles
/*// kill all missiles
case KEY_DEBUGGED + KEY_SHIFTED + KEY_1:
beam_test(1);
break;
@@ -1288,7 +1310,7 @@ void process_debug_keys(int k)
break;
case KEY_DEBUGGED + KEY_CTRLED + KEY_3:
beam_test_new(3);
break;
break;*/
#ifndef NO_SOUND
case KEY_DEBUGGED + KEY_T: {
@@ -1368,6 +1390,7 @@ void process_debug_keys(int k)
break;
}
} // end switch
}
@@ -1499,6 +1522,17 @@ void process_player_ship_keys(int k)
return;
}
//phreak 2002/08/04 - put this here for now
if (k==KEY_SHIFTED + KEY_CTRLED + KEY_Q)
{
extern int Targetbox_wire;
Targetbox_wire++;
if (Targetbox_wire==3)
Targetbox_wire=0;
}
// pass the key to the squadmate messaging code. If the messaging code took the key, then return
// from here immediately since we don't want to do further key processing.
if ( hud_squadmsg_read_key(k) )
@@ -1857,9 +1891,25 @@ void game_process_keys()
gameseq_post_event( GS_EVENT_DEBUG_PAUSE_GAME );
break;
case KEY_PAUSE:
case KEY_ALTED + KEY_PAUSE:
if( Game_mode & GM_DEAD_BLEW_UP ||
Game_mode & GM_DEAD_DIED) {
break;
}
pause_set_type(PAUSE_TYPE_VIEWER);
game_process_pause_key();
break;
case KEY_PAUSE:
if( Game_mode & GM_DEAD_BLEW_UP ||
Game_mode & GM_DEAD_DIED) {
break;
}
pause_set_type(PAUSE_TYPE_NORMAL);
game_process_pause_key();
break;
} // end switch
} while (k);
@@ -2155,6 +2205,8 @@ int button_function_critical(int n, net_player *p = NULL)
// return !0 if the action is allowed, otherwise return 0
int button_allowed(int n)
{
// RT Commented this out cos it was disabling use of keys when HUD is off
#if 0
if ( hud_disabled() ) {
switch (n) {
case SHOW_GOALS:
@@ -2173,6 +2225,7 @@ int button_allowed(int n)
return 0;
}
}
#endif
return 1;
}
@@ -2828,6 +2881,10 @@ int button_function(int n)
}
break;
#endif
case TOGGLE_HUD:
gamesnd_play_iface(SND_USER_SELECT);
hud_toggle_draw();
break;
// following are not handled here, but we need to bypass the Int3()
case LAUNCH_COUNTERMEASURE:
+71 -6
View File
@@ -9,13 +9,28 @@
/*
* $Logfile: /Freespace2/code/MenuUI/Credits.cpp $
* $Revision: 2.2 $
* $Date: 2002-08-01 01:41:06 $
* $Author: penguin $
* $Revision: 2.6 $
* $Date: 2002-11-02 22:25:26 $
* $Author: inquisitor $
*
* C source file for displaying game credits
*
* $Log: not supported by cvs2svn $
* Revision 2.5 2002/11/02 22:11:35 DTP
* DOH forgot \n
*
* Revision 2.4 2002/11/02 22:10:48 DTP
* shameless self promotion
*
* Revision 2.3 2002/10/05 16:46:10 randomtiger
* Added us fs2_open people to the credits. Worth looking at just for that.
* Added timer bar code, by default its not compiled in.
* Use TIMEBAR_ACTIVE in project and dependancy code settings to activate.
* Added the new timebar files with the new code.
*
* Revision 2.2 2002/08/01 01:41:06 penguin
* The big include file move
*
* Revision 2.1 2002/07/07 19:55:59 penguin
* Back-port to MSVC
*
@@ -172,6 +187,40 @@
#include "globalincs/alphacolors.h"
#include "localization/localize.h"
// This is the fs2_open credit list, please only add yourself if you have actually contributed code// Rules!
char *fs2_open_credit_text =
"FS2_OPEN STAFF:\n"
"\n"
"\n"
"Project leader:\n"
"Edward \"Inquisitor\" Gardner\n"
"\n"
"Programmers:\n"
"\n"
"\"Bobboau\"\n"
"Dennis \"DTP\" Pedersen\n"
"Joe \"Righteous1\" Dowd\n"
"Mike \"penguin\" Harris\n"
"\"Mysterial\"\n"
"\"PhReAk\"\n"
"Thomas \"Random Tiger\" Whittaker\n"
"Will \"Unknown PLayer\" Rousnel\n"
"\"WMCoolmon\"\n"
"Web support:\n"
"Icefire and the staff at Volitionwatch.com\n"
"Alex \"Thunder\" Avery and the staff at Hard Light Productions\n"
"\nSpecial thanks to:\n"
"\n"
"Volition for making FS2 such a great game\n"
"Dave Baranec for giving us the code and keeping us sanity checked\n"
"\n\n\n\n";
char *unmodified_credits = "ORIGINAL VOLITION STAFF:\n\n\n";
char *mod_check = "Design:";
#define CREDITS_MUSIC_DELAY 2000
#define CREDITS_SCROLL_RATE 15.0f
#define CREDITS_ARTWORK_DISPLAY_TIME 9.0f
@@ -374,7 +423,7 @@ void credits_init()
if(fp != NULL){
int size;
size = cfilelength(fp);
Credit_text = (char *) malloc(size + 200);
Credit_text = (char *) malloc(size + 200 + strlen(fs2_open_credit_text) + strlen(unmodified_credits));
cfclose(fp);
// open localization and parse
@@ -383,9 +432,25 @@ void credits_init()
reset_parse();
// keep reading everything in
strcpy(Credit_text,"");
while(!check_for_string_raw("#end")){
strcpy(Credit_text,fs2_open_credit_text);
bool first_run = true;
while(!check_for_string_raw("#end")){
stuff_string_line(line, 511);
// This is a bit odd but it means if a total conversion uses different credits the
// Volition credit wont happen
if(first_run == true)
{
if(strcmp(line, mod_check) == 0)
{
strcat(Credit_text, unmodified_credits);
}
first_run = false;
}
linep1 = line;
do {
+5 -2
View File
@@ -9,13 +9,16 @@
/*
* $Logfile: /Freespace2/code/MenuUI/MainHallMenu.cpp $
* $Revision: 2.3 $
* $Date: 2002-08-04 05:12:10 $
* $Revision: 2.5 $
* $Date: 2002-08-27 13:38:58 $
* $Author: penguin $
*
* Header file for main-hall menu code
*
* $Log: not supported by cvs2svn $
* Revision 2.3 2002/08/04 05:12:10 penguin
* Change version display location
*
* Revision 2.2 2002/08/01 01:41:06 penguin
* The big include file move
*
+8 -4
View File
@@ -9,13 +9,16 @@
/*
* $Logfile: /Freespace2/code/MenuUI/ReadyRoom.cpp $
* $Revision: 2.1 $
* $Date: 2002-08-01 01:41:06 $
* $Author: penguin $
* $Revision: 2.2 $
* $Date: 2002-10-19 03:50:29 $
* $Author: randomtiger $
*
* Ready Room code, which is the UI screen for selecting Campaign/mission to play next mainly.
*
* $Log: not supported by cvs2svn $
* Revision 2.1 2002/08/01 01:41:06 penguin
* The big include file move
*
* Revision 2.0 2002/06/03 04:02:24 penguin
* Warpcore CVS sync
*
@@ -102,6 +105,7 @@
#include "cfile/cfilesystem.h"
#include "freespace2/freespace.h"
#include "globalincs/alphacolors.h"
#include "cmdline/cmdline.h"
#define MAX_MISSIONS 1024
@@ -592,7 +596,7 @@ int build_campaign_mission_list_do_frame()
Campaign_mission_flags[Num_campaign_missions_with_info] = 0;
// Only allow missions already completed
if (Campaign.missions[Num_campaign_missions_with_info].completed) {
if (Campaign.missions[Num_campaign_missions_with_info].completed || Cmdline_allslev) {
if (!get_mission_info(Campaign.missions[Num_campaign_missions_with_info].name)) {
// add to list
Campaign_mission_names[Num_campaign_missions_with_info] = strdup(The_mission.name);
+5 -2
View File
@@ -9,13 +9,16 @@
/*
* $Logfile: /Freespace2/code/Mission/MissionCampaign.cpp $
* $Revision: 2.3 $
* $Date: 2002-08-01 01:41:06 $
* $Revision: 2.5 $
* $Date: 2002-08-27 13:38:58 $
* $Author: penguin $
*
* source for dealing with campaigns
*
* $Log: not supported by cvs2svn $
* Revision 2.3 2002/08/01 01:41:06 penguin
* The big include file move
*
* Revision 2.2 2002/07/29 20:12:31 penguin
* added #ifdef _WIN32 around windows-specific system headers
*
+10 -3
View File
@@ -9,13 +9,16 @@
/*
* $Logfile: /Freespace2/code/Mission/MissionMessage.cpp $
* $Revision: 2.1 $
* $Date: 2002-08-01 01:41:07 $
* $Author: penguin $
* $Revision: 2.2 $
* $Date: 2002-10-17 20:40:51 $
* $Author: randomtiger $
*
* Controls messaging to player during the mission
*
* $Log: not supported by cvs2svn $
* Revision 2.1 2002/08/01 01:41:07 penguin
* The big include file move
*
* Revision 2.0 2002/06/03 04:02:25 penguin
* Warpcore CVS sync
*
@@ -1246,6 +1249,10 @@ void message_play_anim( message_q *q )
message_kill_all( 0 );
}
if ( hud_disabled() ) {
return;
}
if ( hud_gauge_active(HUD_TALKING_HEAD) ) {
int anim_start_frame;
anim_play_struct aps;
+79 -23
View File
@@ -9,12 +9,19 @@
/*
* $Logfile: /Freespace2/code/MissionUI/MissionPause.cpp $
* $Revision: 2.1 $
* $Date: 2002-08-01 01:41:07 $
* $Author: penguin $
* $Revision: 2.3 $
* $Date: 2002-10-22 17:42:09 $
* $Author: randomtiger $
*
*
* $Log: not supported by cvs2svn $
* Revision 2.2 2002/10/19 03:50:29 randomtiger
* Added special pause mode for easier action screenshots.
* Added new command line parameter for accessing all single missions in tech room. - RT
*
* Revision 2.1 2002/08/01 01:41:07 penguin
* The big include file move
*
* Revision 2.0 2002/06/03 04:02:25 penguin
* Warpcore CVS sync
*
@@ -51,7 +58,8 @@
#include "object/object.h"
#include "graphics/font.h"
#include "globalincs/alphacolors.h"
#include "weapon/beam.h"
#include "weapon/beam.h"
#include "controlconfig/controlsconfig.h"
#ifndef NO_NETWORK
#include "network/multi_pause.h"
@@ -95,6 +103,7 @@ UI_CHECKBOX Pause_ai_render;
UI_CHECKBOX Pause_firing;
UI_CHECKBOX Pause_external_view_mode_check;
UI_BUTTON Pause_continue;
int Pause_type = PAUSE_TYPE_NORMAL;
// if we're already paused
int Paused = 0;
@@ -121,6 +130,16 @@ extern int game_single_step;
// PAUSE FUNCTIONS
//
int pause_get_type()
{
return Pause_type;
}
void pause_set_type(int type)
{
Pause_type = type;
}
// initialize the pause screen
void pause_init(int multi)
{
@@ -139,7 +158,10 @@ void pause_init(int multi)
#ifndef NO_NETWORK
if(!(Game_mode & GM_STANDALONE_SERVER)){
#endif
Pause_saved_screen = gr_save_screen();
if(Pause_type == PAUSE_TYPE_NORMAL) {
Pause_saved_screen = gr_save_screen();
}
// pause all game music
audiostream_pause_all();
@@ -181,22 +203,35 @@ void pause_do(int multi)
else
#endif
{
// RENDER A GAME FRAME HERE AS THE BACKGROUND
gr_restore_screen(Pause_saved_screen);
if (Pause_background_bitmap >= 0) {
gr_set_bitmap(Pause_background_bitmap);
if(multi){
gr_bitmap(0,0);
} else {
// draw the bitmap
gr_bitmap(Please_wait_coords[gr_screen.res][0], Please_wait_coords[gr_screen.res][1]);
// RENDER A GAME FRAME HERE AS THE BACKGROUND (if normal pause)
// draw "Paused" on it
gr_set_color_fast(&Color_normal);
gr_set_font(FONT2);
gr_get_string_size(&str_w, &str_h, pause_str);
gr_string((gr_screen.max_w - str_w) / 2, (gr_screen.max_h - str_h) / 2, pause_str);
gr_set_font(FONT1);
if(Pause_type == PAUSE_TYPE_NORMAL) {
// Fall back to viewer just incase saved screen is invalid
if(Pause_saved_screen == -1){
Pause_type = PAUSE_TYPE_VIEWER;
}
else if(Pause_type == PAUSE_TYPE_NORMAL) {
gr_restore_screen(Pause_saved_screen);
}
}
if(Pause_type == PAUSE_TYPE_NORMAL){
if (Pause_background_bitmap >= 0) {
gr_set_bitmap(Pause_background_bitmap);
if(multi){
gr_bitmap(0,0);
} else {
// draw the bitmap
gr_bitmap(Please_wait_coords[gr_screen.res][0], Please_wait_coords[gr_screen.res][1]);
// draw "Paused" on it
gr_set_color_fast(&Color_normal);
gr_set_font(FONT2);
gr_get_string_size(&str_w, &str_h, pause_str);
gr_string((gr_screen.max_w - str_w) / 2, (gr_screen.max_h - str_h) / 2, pause_str);
gr_set_font(FONT1);
}
}
}
@@ -210,8 +245,24 @@ void pause_do(int multi)
{
// otherwise process the ui window here
k = Pause_win.process() & ~KEY_DEBUGGED;
switch (k) {
switch (k) {
case KEY_TAB:
hud_toggle_draw();
break;
// case VIEW_EXTERNAL:
case KEY_ENTER:
if(Pause_type != PAUSE_TYPE_VIEWER) {
break;
}
extern int button_function_demo_valid(int n);
button_function_demo_valid(VIEW_EXTERNAL);
break;
case KEY_ESC:
case KEY_ALTED + KEY_PAUSE:
case KEY_PAUSE:
gameseq_post_event(GS_EVENT_PREVIOUS_STATE);
break;
@@ -223,7 +274,9 @@ void pause_do(int multi)
// a very unique case where we shouldn't be doing the page flip because we're inside of popup code
if(!popup_active()){
gr_flip();
if(Pause_type == PAUSE_TYPE_NORMAL) {
gr_flip();
}
} else {
// this should only be happening in a very unique multiplayer case
Assert(Game_mode & GM_MULTIPLAYER);
@@ -250,7 +303,10 @@ void pause_close(int multi)
else
#endif
{
gr_free_screen(Pause_saved_screen);
if(Pause_saved_screen != -1) {
gr_free_screen(Pause_saved_screen);
Pause_saved_screen = -1;
}
if (Pause_background_bitmap){
bm_unload(Pause_background_bitmap);
+15 -3
View File
@@ -9,12 +9,15 @@
/*
* $Logfile: /Freespace2/code/MissionUI/MissionPause.h $
* $Revision: 2.1 $
* $Date: 2002-08-01 01:41:07 $
* $Author: penguin $
* $Revision: 2.2 $
* $Date: 2002-10-19 03:50:29 $
* $Author: randomtiger $
*
*
* $Log: not supported by cvs2svn $
* Revision 2.1 2002/08/01 01:41:07 penguin
* The big include file move
*
* Revision 2.0 2002/06/03 04:02:25 penguin
* Warpcore CVS sync
*
@@ -64,4 +67,13 @@ void pause_debug_do();
// debug pause close
void pause_debug_close();
enum
{
PAUSE_TYPE_NORMAL,
PAUSE_TYPE_VIEWER,
};
void pause_set_type(int type);
int pause_get_type();
#endif
+27 -10
View File
@@ -9,13 +9,16 @@
/*
* $Logfile: /Freespace2/code/Model/MODEL.H $
* $Revision: 2.4 $
* $Date: 2002-08-01 01:41:07 $
* $Author: penguin $
* $Revision: 2.5 $
* $Date: 2002-10-19 19:29:27 $
* $Author: bobboau $
*
* header file for information about polygon models
*
* $Log: not supported by cvs2svn $
* Revision 2.4 2002/08/01 01:41:07 penguin
* The big include file move
*
* Revision 2.3 2002/07/29 08:31:52 DTP
* Forgot to Bump MAX_MODEL_SUBSYSTEMS from 128 to 200
*
@@ -518,7 +521,7 @@ typedef struct model_tmap_vert {
// only be two slots for each docking bay
#define MAX_SLOTS 25
#define MAX_THRUSTER_SLOTS 10
#define MAX_THRUSTER_SLOTS 30
typedef struct w_bank {
int num_slots;
@@ -538,11 +541,19 @@ typedef struct thruster_bank {
} thruster_bank;
typedef struct glow_bank { // glow bank struckture -Bobboau
int num_slots;
vector pnt[MAX_THRUSTER_SLOTS];
vector norm[MAX_THRUSTER_SLOTS];
float radius[MAX_THRUSTER_SLOTS];
int glow_bitmap;
int type;
int glow_timestamp;
int on_time;
int off_time;
int disp_time;
int is_on;
int submodel_parent;
int LOD;
int num_slots;
vector pnt[MAX_THRUSTER_SLOTS];
vector norm[MAX_THRUSTER_SLOTS];
float radius[MAX_THRUSTER_SLOTS];
int glow_bitmap;
} glow_bank;
// defines for docking bay things. The types are essentially flags since docking bays can probably
@@ -682,6 +693,12 @@ typedef struct polymodel {
int n_textures;
int original_textures[MAX_MODEL_TEXTURES]; // what gets read in from file
int textures[MAX_MODEL_TEXTURES]; // what textures you draw with. reset to original_textures by model_set_instance
int numframes[MAX_MODEL_TEXTURES]; // flag for weather this texture is an ani-Bobboau
int fps[MAX_MODEL_TEXTURES]; // flag for weather this texture is an ani-Bobboau
int is_ani[MAX_MODEL_TEXTURES]; // flag for weather this texture is an ani-Bobboau
int ambient[MAX_MODEL_TEXTURES]; // ambient light-Bobboau
int transparent[MAX_MODEL_TEXTURES]; // flag this texture as being a transparent blend-Bobboau
vector autocenter; // valid only if PM_FLAG_AUTOCEN is set
@@ -1081,7 +1098,7 @@ int model_which_octant( vector *pnt, int model_num,matrix *model_orient, vector
// scale the engines thrusters by this much
// Only enabled if MR_SHOW_THRUSTERS is on
void model_set_thrust(int model_num, float length, int bitmapnum, int glow_bitmapnum=-1, float glow_noise=1.0f);
void model_set_thrust(int model_num, vector length, int bitmapnum, int glow_bitmapnum=-1, float glow_noise=1.0f);
//=========================================================
// model caching
+152 -49
View File
@@ -9,13 +9,19 @@
/*
* $Logfile: /Freespace2/code/Model/ModelInterp.cpp $
* $Revision: 2.3 $
* $Date: 2002-08-01 01:41:07 $
* $Author: penguin $
* $Revision: 2.5 $
* $Date: 2002-10-22 23:02:40 $
* $Author: randomtiger $
*
* Rendering models, I think.
*
* $Log: not supported by cvs2svn $
* Revision 2.4 2002/10/19 19:29:27 bobboau
* inital commit, trying to get most of my stuff into FSO, there should be most of my fighter beam, beam rendering, beam sheild hit, ABtrails, and ssm stuff. one thing you should be happy to know is the beam texture tileing is now set in the beam section section of the weapon table entry
*
* Revision 2.3 2002/08/01 01:41:07 penguin
* The big include file move
*
* Revision 2.2 2002/07/10 18:42:14 wmcoolmon
* Added Bobboau's glow code; all comments include "-Bobboau"
*
@@ -256,7 +262,8 @@
#include "object/object.h" // For MAX_OBJECTS
#include "mission/missionparse.h"
#include "nebula/neb.h"
#include "math/staticrand.h"
#include "globalincs/alphacolors.h"
// Some debug variables used externally for displaying stats
#ifndef NDEBUG
@@ -326,6 +333,8 @@ static float Interp_thrust_scale = 0.1f;
static int Interp_thrust_bitmap = -1;
static int Interp_thrust_glow_bitmap = -1;
static float Interp_thrust_glow_noise = 1.0f;
static float Interp_thrust_scale_x = 0.0f;//added -bobboau
static float Interp_thrust_scale_y = 0.0f;//added -bobboau
static int Interp_objnum = -1;
@@ -454,6 +463,8 @@ void model_notify_dead_ship(int objnum)
void interp_clear_instance()
{
Interp_thrust_scale = 0.1f;
Interp_thrust_scale_x = 0.0f;//added-Bobboau
Interp_thrust_scale_y = 0.0f;//added-Bobboau
Interp_thrust_bitmap = -1;
Interp_thrust_glow_bitmap = -1;
Interp_thrust_glow_noise = 1.0f;
@@ -461,9 +472,11 @@ void interp_clear_instance()
}
// Scales the engines thrusters by this much
void model_set_thrust( int model_num, float length, int bitmap, int glow_bitmap, float glow_noise )
void model_set_thrust( int model_num, vector length /*<-I did that-Bobboau*/, int bitmap, int glow_bitmap, float glow_noise )
{
Interp_thrust_scale = length;
Interp_thrust_scale = length.xyz.z;
Interp_thrust_scale_x = length.xyz.x;
Interp_thrust_scale_y = length.xyz.y;
Interp_thrust_bitmap = bitmap;
Interp_thrust_glow_bitmap = glow_bitmap;
Interp_thrust_glow_noise = glow_noise;
@@ -818,7 +831,7 @@ void model_interp_tmappoly(ubyte * p,polymodel * pm)
// Assert( verts[i].normnum == verts[i].vertnum );
if ( Interp_flags & MR_NO_LIGHTING ) {
if ( (Interp_flags & MR_NO_LIGHTING) || (pm->ambient[w(p+40)])) { //gets the ambient glow to work
if ( D3D_enabled ) {
Interp_list[i]->r = 191;
Interp_list[i]->g = 191;
@@ -925,14 +938,22 @@ void model_interp_tmappoly(ubyte * p,polymodel * pm)
if((Interp_flags & MR_FORCE_TEXTURE) && (Interp_forced_bitmap >= 0)){
texture = Interp_forced_bitmap;
} else {
texture = pm->textures[w(p+40)];
if (pm->is_ani[w(p+40)]){
texture = pm->textures[w(p+40)] + ((timestamp() / (int)(pm->fps[w(p+40)])) % pm->numframes[w(p+40)]);//here is were it picks the texture to render for ani-Bobboau
}else{
texture = pm->textures[w(p+40)];//here is were it picks the texture to render for normal-Bobboau
}
}
// muzzle flashes draw xparent
if(Interp_flags & MR_ALL_XPARENT){
gr_set_bitmap( texture, GR_ALPHABLEND_FILTER, GR_BITBLT_MODE_NORMAL, Interp_xparent_alpha );
} else {
gr_set_bitmap( texture );
if(pm->transparent[w(p+40)]){ //trying to get transperent textures-Bobboau
gr_set_bitmap( texture, GR_ALPHABLEND_FILTER, GR_BITBLT_MODE_NORMAL, 0.8f );
}else{
gr_set_bitmap( texture );
}
}
}
} else {
@@ -1928,6 +1949,26 @@ void model_render(int model_num, matrix *orient, vector * pos, uint flags, int o
{
polymodel *pm = model_get(model_num);
for (int i = 0; i < pm->n_glows; i++ ) { //glow point blink code -Bobboau
glow_bank *bank = &pm->glows[i];
if (bank->glow_timestamp == 0)
bank->glow_timestamp=timestamp();
if(bank->off_time){
if(bank->is_on){
if( timestamp_elapsed(bank->glow_timestamp + bank->on_time + bank->disp_time) ){
bank->glow_timestamp=timestamp();
bank->is_on=0;
}
}else{
if( timestamp_elapsed(bank->glow_timestamp + bank->off_time + bank->disp_time) ){
bank->glow_timestamp=timestamp();
bank->is_on=1;
}
}
}
}
// maybe turn off (hardware) culling
if(flags & MR_NO_CULL){
gr_set_cull(0);
@@ -2536,6 +2577,9 @@ void model_really_render(int model_num, matrix *orient, vector * pos, uint flags
polymodel * pm;
uint save_gr_zbuffering_mode;
int zbuf_mode;
int objnum = light_ignore_id;
ship *shipp = &Ships[Objects[objnum].instance];
MONITOR_INC( NumModelsRend, 1 );
@@ -2779,54 +2823,77 @@ void model_really_render(int model_num, matrix *orient, vector * pos, uint flags
d3d_zbias(0);
}
#endif
//start rendering glow points -Bobboau
if ( (pm->n_glows) /*&& (Interp_flags & MR_SHOW_THRUSTERS) /*&& (Detail.engine_glows)*/ ) {
//start rendering glow points -Bobboau
if ( (pm->n_glows) /*&& (Interp_flags & MR_SHOW_THRUSTERS) /*&& (Detail.engine_glows)*/ ) {
for (i = 0; i < pm->n_glows; i++ ) {
glow_bank *bank = &pm->glows[i];
int j;
if(bank->is_on){
for ( j=0; j<bank->num_slots; j++ ) {
float d;
vector tempv;
vm_vec_sub(&tempv,&View_position,&bank->pnt[j]);
vm_vec_normalize(&tempv);
for ( j=0; j<bank->num_slots; j++ ) {
int flick;
if(pm->submodel[pm->detail[0]].num_arcs){
flick = static_rand(timestamp()%20)%(pm->submodel[pm->detail[0]].num_arcs + j); //the more damage, the more arcs, the more likely the lights will fail
}else{
flick = 1;
}
d = vm_vec_dot(&tempv,&bank->norm[j]);
if(flick == 1){
float d;
vector tempv;
vm_vec_sub(&tempv,&View_position,&bank->pnt[j]);
vm_vec_normalize(&tempv);
if ( d > 0.0f) {
vertex p;
d = vm_vec_dot(&tempv,&bank->norm[j]);
if ( d > 0.0f) {
vertex p;
// Make glow bitmap fade in/out quicker from sides.
d *= 3.0f;
if ( d > 1.0f ) d = 1.0f;
// fade them in the nebula as well
if(The_mission.flags & MISSION_FLAG_FULLNEB){
d *= (1.0f - Interp_fog_level);
}
float w = bank->radius[j];
// disable fogging
gr_fog_set(GR_FOGMODE_NONE, 0, 0, 0);
g3_rotate_vertex( &p, &bank->pnt[j] );
//need to rotate the vertex if it's parent is rotated
/*if(shipp->subsys_list.submodel_info_1.movement_axis){
matrix m;
// Make glow bitmap fade in/out quicker from sides.
d *= 3.0f;
if ( d > 1.0f ) d = 1.0f;
vm_angles_2_matrix(&m, &pm->submodel[submodel_num].angs)
}*/
// fade them in the nebula as well
if(The_mission.flags & MISSION_FLAG_FULLNEB){
d *= (1.0f - Interp_fog_level);
}
if(bank->submodel_parent)
gr_set_bitmap( bank->glow_bitmap, GR_ALPHABLEND_FILTER, GR_BITBLT_MODE_NORMAL, d );
{
extern int Gr_scaler_zbuffering;
Gr_scaler_zbuffering = 1;
g3_draw_bitmap(&p,0,w*0.5f, TMAP_FLAG_TEXTURED );
//g3_draw_rotated_bitmap(&p,0.0f,w,w, TMAP_FLAG_TEXTURED );
Gr_scaler_zbuffering = 0;
}//setbitmap
}//d>0
}//flick
}//for slot
}//bank is on
}//for bank
}//any glow banks
float w = bank->radius[j];
// disable fogging
gr_fog_set(GR_FOGMODE_NONE, 0, 0, 0);
g3_rotate_vertex( &p, &bank->pnt[j] );
gr_set_bitmap( bank->glow_bitmap, GR_ALPHABLEND_FILTER, GR_BITBLT_MODE_NORMAL, d );
{
extern int Gr_scaler_zbuffering;
Gr_scaler_zbuffering = 1;
g3_draw_bitmap(&p,0,w*0.5f, TMAP_FLAG_TEXTURED );
//g3_draw_rotated_bitmap(&p,0.0f,w,w, TMAP_FLAG_TEXTURED );
Gr_scaler_zbuffering = 0;
}
}
}
}
}
//end rendering glow points
//end rendering glow points
// Draw the thruster glow
if ( (Interp_thrust_glow_bitmap != -1) && (Interp_flags & MR_SHOW_THRUSTERS) /*&& (Detail.engine_glows)*/ ) {
@@ -2859,9 +2926,39 @@ void model_really_render(int model_num, matrix *orient, vector * pos, uint flags
#define NOISE_SCALE 0.5f
#define MIN_SCALE 3.4f
#define MAX_SCALE 4.7f
float scale = MIN_SCALE;
float scale = MIN_SCALE, x=0.0f, y=0.0f, z=0.0f;
scale = (Interp_thrust_scale-0.1f)*(MAX_SCALE-MIN_SCALE)+MIN_SCALE;
// if(abs(bank->norm->y + Interp_thrust_scale_y) > 0){
// if(abs(bank->norm->x + Interp_thrust_scale_x) > 0)
// if(abs(bank->norm->z + Interp_thrust_scale) > 0)
x = ((-bank->norm[j].xyz.x + Interp_thrust_scale_x) * Interp_thrust_scale_x);
// x = (x * Interp_thrust_scale_x)/2;
if((bank->norm[j].xyz.x < 0.0f) /*&& (Interp_thrust_scale_x < 0.0f)*/){
x = -x;
}
y = ((-bank->norm[j].xyz.y + Interp_thrust_scale_y) * Interp_thrust_scale_y);
// y = (y * Interp_thrust_scale_y)/2;
if((bank->norm[j].xyz.y < 0.0f) /*&& (Interp_thrust_scale_y < 0.0f)*/){
y = -y;
}
z = ((-bank->norm[j].xyz.z + Interp_thrust_scale) * Interp_thrust_scale);
// z = (z * Interp_thrust_scale)/2;
if((bank->norm[j].xyz.z < 0.0f) /*&& (Interp_thrust_scale < 0.0f)*/){
z = -z;
}
#ifndef NDEBUG
if ( &Objects[objnum] == Player_obj ){
gr_set_color_fast(&Color_bright_blue);
gr_printf((i * 200), (20 +(j * 10)), "x %0.2f, y %0.2f, z %0.2f", x, y, z);
}
#endif
scale = ((bank->norm[j].xyz.x * x)+(bank->norm[j].xyz.y * y)+(bank->norm[j].xyz.z * z))*(MAX_SCALE-MIN_SCALE)+MIN_SCALE;
//getting thruster glows to grow baised on witch direction they are pointing -Bobboau
float w = bank->radius[j]*(scale+Interp_thrust_glow_noise*NOISE_SCALE );
@@ -2992,6 +3089,12 @@ void submodel_render(int model_num, int submodel_num, matrix *orient, vector * p
}
g3_done_instance();
// turn off fog after each model renders, RT This fixes HUD being fogged when debris is in target box
if(The_mission.flags & MISSION_FLAG_FULLNEB){
gr_fog_set(GR_FOGMODE_NONE, 0, 0, 0);
}
}
+95 -9
View File
@@ -9,13 +9,16 @@
/*
* $Logfile: /Freespace2/code/Model/ModelRead.cpp $
* $Revision: 2.3 $
* $Date: 2002-08-01 01:41:07 $
* $Author: penguin $
* $Revision: 2.4 $
* $Date: 2002-10-19 19:29:27 $
* $Author: bobboau $
*
* file which reads and deciphers POF information
*
* $Log: not supported by cvs2svn $
* Revision 2.3 2002/08/01 01:41:07 penguin
* The big include file move
*
* Revision 2.2 2002/07/10 18:42:14 wmcoolmon
* Added Bobboau's glow code; all comments include "-Bobboau"
*
@@ -1660,6 +1663,7 @@ int read_model_file(polymodel * pm, char *filename, int n_subsystems, model_subs
}
case ID_GLOW:{ //start glowpoint reading -Bobboau
//
char props[MAX_PROP_LEN];
pm->n_glows = cfread_int(fp);
pm->glows = (glow_bank *)malloc(sizeof(glow_bank) * pm->n_glows);
@@ -1667,7 +1671,14 @@ int read_model_file(polymodel * pm, char *filename, int n_subsystems, model_subs
for (int q = 0; q < pm->n_glows; q++ ) {
glow_bank *bank = &pm->glows[q];
bank->type=1;
bank->is_on=1;
bank->glow_timestamp=0;
bank->disp_time=0;
bank->on_time=1000;
bank->off_time=0;
bank->LOD=0;
bank->submodel_parent=-1;
bank->num_slots = cfread_int(fp);
cfread_string_len( props, MAX_PROP_LEN, fp );
@@ -1688,7 +1699,54 @@ int read_model_file(polymodel * pm, char *filename, int n_subsystems, model_subs
}
}
for (j = 0; j < bank->num_slots; j++) {
cfread_vector( &(bank->pnt[j]), fp );
cfread_vector( &(bank->norm[j]), fp );
bank->radius[j] = cfread_float( fp );
//mprintf(( "Rad = %.2f\n", rad ));
}
//mprintf(( "Num slots = %d\n", bank->num_slots ));
}
break;
} //end glowpoint reading -Bobboau
case ID_GLOX:{ //experimental glowpoints, so I can test code for things I have to use a hex editor for -Bobboau
//
char props[MAX_PROP_LEN];
pm->n_glows = cfread_int(fp);
pm->glows = (glow_bank *)malloc(sizeof(glow_bank) * pm->n_glows);
Assert( pm->glows != NULL );
for (int q = 0; q < pm->n_glows; q++ ) {
glow_bank *bank = &pm->glows[q];
bank->type=1;
bank->is_on=1;
bank->glow_timestamp=0;
bank->disp_time = cfread_int(fp);
bank->on_time = cfread_int(fp);
bank->off_time = cfread_int(fp);
bank->LOD=0;
bank->submodel_parent=-1;
bank->num_slots = cfread_int(fp);
cfread_string_len( props, MAX_PROP_LEN, fp );
// look for $glow_texture=xxx
int length = strlen(props);
if (length > 0) {
int base_length = strlen("$glow_texture=");
Assert( strstr( (const char *)&props, "$glow_texture=") != NULL );
Assert( length > base_length );
char *glow_texture_name = props + base_length;
if (glow_texture_name[0] == '$') {
glow_texture_name++;
}
bank->glow_bitmap = bm_load( glow_texture_name );
if (bank->glow_bitmap < 0) {
Error( LOCATION, "Couldn't open texture '%s'\nreferenced by model '%s'\n", glow_texture_name, pm->filename );
}
}
for (j = 0; j < bank->num_slots; j++) {
cfread_vector( &(bank->pnt[j]), fp );
cfread_vector( &(bank->norm[j]), fp );
bank->radius[j] = cfread_float( fp );
@@ -1743,7 +1801,7 @@ int read_model_file(polymodel * pm, char *filename, int n_subsystems, model_subs
if ( (bank->wash_info_index == -1) && (n_subsystems > 0) ) {
if (table_error) {
Warning(LOCATION, "No engine wash table entry in ships.tbl for ship model %s", filename);
// Warning(LOCATION, "No engine wash table entry in ships.tbl for ship model %s", filename);
} else {
Warning(LOCATION, "Inconsistent model: Engine wash engine subsystem does not match any ship subsytem names for ship model %s", filename);
}
@@ -1792,7 +1850,7 @@ int read_model_file(polymodel * pm, char *filename, int n_subsystems, model_subs
n_slots = cfread_int( fp );
subsystemp->turret_gun_sobj = physical_parent;
Assert(n_slots < MAX_TFP); // only MAX_TFP firing points per model_subsystem
Assert(n_slots <= MAX_TFP); // only MAX_TFP firing points per model_subsystem
for (j = 0; j < n_slots; j++ ) {
cfread_vector( &subsystemp->turret_firing_point[j], fp );
}
@@ -1873,13 +1931,41 @@ int read_model_file(polymodel * pm, char *filename, int n_subsystems, model_subs
char tmp_name[256];
cfread_string_len(tmp_name,127,fp);
pm->transparent[i]=0; //it's transparent
pm->ambient[i]=0; //ambient glow
pm->is_ani[i]=0; //animated textures
if ( strstr(tmp_name, "thruster") || strstr(tmp_name, "invisible") ) {
// Don't load textures for thruster animations or invisible textures
pm->textures[i] = -1;
} else {
if(strstr(tmp_name, "trans")){
pm->transparent[i]=1;
nprintf(("%s is transparent, oooow\n",tmp_name));
}
if(strstr(tmp_name, "amb")){
pm->ambient[i]=1;
nprintf(("%s is amient, aaaahhh\n",tmp_name));
}
pm->textures[i] = bm_load( tmp_name );
if (pm->textures[i]<0) {
Error( LOCATION, "Couldn't open texture '%s'\nreferenced by model '%s'\n", tmp_name, pm->filename );
if (pm->textures[i]<0) { //if I couldn't find the PCX see if there is an ani-Bobboau
nprintf(("couldn't find %s.pcx",tmp_name));
pm->is_ani[i] = 1; //this is an animated texture
pm->textures[i] = bm_load_animation(tmp_name, &pm->numframes[i], &pm->fps[i], 1);
if(pm->textures[i]<0){
Warning( LOCATION, "Couldn't open texture '%s'\nreferenced by model '%s'\n", tmp_name, pm->filename );
pm->textures[i] = -1;
pm->is_ani[i] = 0; //this isn't an animated texture after all
nprintf((" or %s.ani\n",tmp_name));
}else{
mprintf(("but I did find %s.ani, ", tmp_name));
mprintf(("with %d frames, ", pm->numframes[i]));
mprintf(("and a rate of %d\n", pm->fps[i]));
}
}
}
pm->original_textures[i] = pm->textures[i];
@@ -2243,7 +2329,7 @@ int model_load(char *filename, int n_subsystems, model_subsystem *subsystems)
for (j=0; j<sm1->num_details; j++ ) {
if ( sm1->details[j] == -1 ) {
Warning( LOCATION, "Model '%s' could find all detail levels for submodel '%s'", pm->filename, sm1->name );
// Warning( LOCATION, "Model '%s' could find all detail levels for submodel '%s'", pm->filename, sm1->name );
sm1->num_details = 0;
}
}
+1
View File
@@ -65,6 +65,7 @@
#define ID_INSG 0x47534e49 // GSNI (INSG): insignia information
#define ID_ACEN 0x4e454341 // NECA (ACEN): autocentering information
#define ID_GLOW 0x574f4c47 // WOLG (GLOW): glow points -Bobboau
#define ID_GLOX 0x584f4c47 // experimental glow points will be gone as soon as we get a proper pof editor -Bobboau
#elif BYTE_ORDER == BIG_ENDIAN
+24 -5
View File
@@ -9,13 +9,16 @@
/*
* $Logfile: /Freespace2/code/Object/Object.cpp $
* $Revision: 2.1 $
* $Date: 2002-08-01 01:41:08 $
* $Author: penguin $
* $Revision: 2.2 $
* $Date: 2002-10-19 19:29:27 $
* $Author: bobboau $
*
* Code to manage objects
*
* $Log: not supported by cvs2svn $
* Revision 2.1 2002/08/01 01:41:08 penguin
* The big include file move
*
* Revision 2.0 2002/06/03 04:02:27 penguin
* Warpcore CVS sync
*
@@ -1089,6 +1092,7 @@ float Avg_delay_total;
void obj_player_fire_stuff( object *objp, control_info ci )
{
ship *shipp;
int has_fired = -1; //stop fireing stuff-Bobboau
Assert( objp->flags & OF_PLAYER_SHIP);
@@ -1110,11 +1114,13 @@ void obj_player_fire_stuff( object *objp, control_info ci )
}
// fire non-streaming primaries here
ship_fire_primary( objp, 0 );
ship_fire_primary( objp, 0 );
has_fired = -1;
} else {
// unflag the ship as having the trigger down
if(shipp != NULL){
shipp->flags &= ~(SF_TRIGGER_DOWN);
has_fired = -1;
}
}
@@ -1146,10 +1152,17 @@ void obj_player_fire_stuff( object *objp, control_info ci )
if ( ci.afterburner_stop ){
afterburners_stop( objp, 1 );
}
if(has_fired == -1){
ship_stop_fire_primary(objp); //if it hasn't fired do the "has just stoped fireing" stuff
}
}
void obj_move_call_physics(object *objp, float frametime)
{
int has_fired = -1; //stop fireing stuff-Bobboau
// Do physics for objects with OF_PHYSICS flag set and with some engine strength remaining.
if ( objp->flags & OF_PHYSICS ) {
// only set phys info if ship is not dead
@@ -1248,10 +1261,16 @@ obj_maybe_fire:
// fire streaming weapons for ships in here - ALL PLAYERS, regardless of client, single player, server, whatever.
// do stream weapon firing for all ships themselves.
if(objp->type == OBJ_SHIP){
ship_fire_primary(objp, 1, 0);
has_fired = ship_fire_primary(objp, 1, 0);
}
}
}
if(has_fired == -1){
// mprintf(("stoped 1\n"));
ship_stop_fire_primary(objp); //if it hasn't fired do the "has just stoped fireing" stuff
}
}
+10 -8
View File
@@ -9,13 +9,16 @@
/*
* $Logfile: /Freespace2/code/OsApi/OutWnd.cpp $
* $Revision: 2.1 $
* $Date: 2002-08-01 01:41:09 $
* $Author: penguin $
* $Revision: 2.2 $
* $Date: 2002-10-19 19:29:28 $
* $Author: bobboau $
*
* Routines for debugging output
*
* $Log: not supported by cvs2svn $
* Revision 2.1 2002/08/01 01:41:09 penguin
* The big include file move
*
* Revision 2.0 2002/06/03 04:02:27 penguin
* Warpcore CVS sync
*
@@ -199,7 +202,7 @@ int Outwnd_no_filter_file = 0; // 0 = .cfg file found, 1 = not found and warnin
// used for file logging
#ifndef NDEBUG
int Log_debug_output_to_file = 0;
int Log_debug_output_to_file = 1;
FILE *Log_fp;
char *Freespace_logfilename = "fs.log";
#endif
@@ -451,7 +454,7 @@ void outwnd_print(char *id, char *tmp)
outwnd_filter_struct *temp;
if(gr_screen.mode == GR_DIRECT3D){
return;
// return; //it doesn't print while playing if this is in-Bobboau
}
if (!outwnd_inited)
@@ -473,7 +476,6 @@ void outwnd_print(char *id, char *tmp)
if (!stricmp(id, outwnd_filter[i]->name))
break;
if (i == outwnd_filter_count) // new id found that's not yet in filter list
{
// Only create new filters if there was a filter file
@@ -562,10 +564,10 @@ void outwnd_print(char *id, char *tmp)
sptr++;
}
if(gr_screen.mode == GR_DIRECT3D){
/* if(gr_screen.mode == GR_DIRECT3D){
return;
}
*/// it doesn't print while playing if this is in-Bobboau
if ( outwnd_disabled ){
return;
}
+62 -3
View File
@@ -9,13 +9,16 @@
/*
* $Logfile: /Freespace2/code/parse/SEXP.CPP $
* $Revision: 2.2 $
* $Date: 2002-08-01 01:41:09 $
* $Author: penguin $
* $Revision: 2.3 $
* $Date: 2002-10-29 22:41:48 $
* $Author: sesquipedalian $
*
* main sexpression generator
*
* $Log: not supported by cvs2svn $
* Revision 2.2 2002/08/01 01:41:09 penguin
* The big include file move
*
* Revision 2.1 2002/07/13 09:16:18 wmcoolmon
* Added initial code for "ship-lights-on" and "ship-lights-off" SEXPs
*
@@ -520,6 +523,8 @@ sexp_oper Operators[] = {
{ "ship-vanish", OP_SHIP_VANISH, 1, INT_MAX },
{ "ship-lights-on", OP_SHIP_LIGHTS_ON, 1, 1 }, //-WMCoolmon
{ "ship-lights-off", OP_SHIP_LIGHTS_OFF, 1, 1 }, //-WMCoolmon
{ "shields-on", OP_SHIELDS_ON, 1, INT_MAX }, //-Sesquipedalian
{ "shields-off", OP_SHIELDS_OFF, 1, INT_MAX }, //-Sesquipedalian
{ "turret-tagged-only", OP_TURRET_TAGGED_ONLY_ALL, 1, 1 },
{ "turret-tagged-clear", OP_TURRET_TAGGED_CLEAR_ALL, 1, 1 },
{ "subsys-set-random", OP_SUBSYS_SET_RANDOM, 3, INT_MAX },
@@ -5915,6 +5920,49 @@ void sexp_ship_lights_off(int node) //-WMCoolmon
//Insert sexp here
}
void sexp_shields_off(int n, int shields_off ) //-Sesquipedalian
{
char *ship_name;
object *objp;
int num;
for ( ; n != -1; n = CDR(n) ) {
ship_name = CTEXT(n);
// check to see if ship destroyed or departed. In either case, do nothing.
if ( mission_log_get_time(LOG_SHIP_DEPART, ship_name, NULL, NULL) || mission_log_get_time(LOG_SHIP_DESTROYED, ship_name, NULL, NULL) )
continue;
// get the ship num. If we get a -1 for the number here, ship has yet to arrive. Store this ship
// in a list until created
num = ship_name_lookup(ship_name);
if ( num != -1 ) {
objp = &Objects[Ships[num].objnum];
if ( shields_off )
objp->flags |= OF_NO_SHIELDS;
else
objp->flags &= ~OF_NO_SHIELDS;
} else {
p_object *parse_obj;
parse_obj = mission_parse_get_arrival_ship( ship_name );
if ( parse_obj ) {
if ( shields_off )
parse_obj->flags |= P_OF_NO_SHIELDS;
else
parse_obj->flags &= ~P_OF_NO_SHIELDS;
break;
#ifndef NDEBUG
} else {
Int3(); // get allender -- could be a potential problem here
#endif
}
}
}
}
int sexp_key_pressed(int node)
{
@@ -7660,6 +7708,13 @@ int eval_sexp(int cur_node)
sexp_val = 1;
sexp_ship_lights_off(node);
//-Sesquipedalian
case OP_SHIELDS_ON:
case OP_SHIELDS_OFF:
sexp_shields_off( node, (op_num==OP_SHIELDS_OFF?1:0) );
sexp_val = 1;
break;
case OP_SEND_MESSAGE:
sexp_send_message( node );
sexp_val = 1;
@@ -8288,6 +8343,8 @@ int query_operator_return_type(int op)
case OP_SHIP_LIGHTS_ON:
case OP_SHIP_LIGHTS_OFF:
case OP_SHIP_NO_GUARDIAN:
case OP_SHIELDS_ON:
case OP_SHIELDS_OFF:
case OP_RED_ALERT:
case OP_MODIFY_VARIABLE:
case OP_BEAM_FIRE:
@@ -8434,6 +8491,8 @@ int query_operator_argument_type(int op, int argnum)
case OP_SHIP_VANISH:
case OP_SHIP_LIGHTS_ON:
case OP_SHIP_LIGHTS_OFF:
case OP_SHIELDS_ON:
case OP_SHIELDS_OFF:
case OP_SHIP_NO_GUARDIAN:
case OP_SECONDARIES_DEPLETED:
case OP_SPECIAL_WARP_DISTANCE:
+9 -3
View File
@@ -9,13 +9,16 @@
/*
* $Source: /cvs/cvsroot/fs2open/fs2_open/code/parse/sexp.h,v $
* $Revision: 2.2 $
* $Author: penguin $
* $Date: 2002-08-01 01:41:09 $
* $Revision: 2.3 $
* $Author: sesquipedalian $
* $Date: 2002-10-29 22:41:48 $
*
* header for sexpression parsing
*
* $Log: not supported by cvs2svn $
* Revision 2.2 2002/08/01 01:41:09 penguin
* The big include file move
*
* Revision 2.1 2002/07/13 09:16:18 wmcoolmon
* Added initial code for "ship-lights-on" and "ship-lights-off" SEXPs
*
@@ -531,6 +534,9 @@
#define OP_SHIP_VANISH (0X0055 | OP_CATAGORY_CHANGE | OP_NONCAMPAIGN_FLAG)
#define OP_SHIP_LIGHTS_ON (0x0056 | OP_CATAGORY_CHANGE | OP_NONCAMPAIGN_FLAG) //-WMCoolmon
#define OP_SHIP_LIGHTS_OFF (0x0057 | OP_CATAGORY_CHANGE | OP_NONCAMPAIGN_FLAG) //-WMCoolmon
#define OP_SHIELDS_ON (0x0058 | OP_CATAGORY_CHANGE | OP_NONCAMPAIGN_FLAG) //-Sesquipedalian
#define OP_SHIELDS_OFF (0x0059 | OP_CATAGORY_CHANGE | OP_NONCAMPAIGN_FLAG) //-Sesquipedalian
#define OP_CHANGE_AI_LEVEL (0x0060 | OP_CATAGORY_CHANGE | OP_NONCAMPAIGN_FLAG) //-Sesquipedalian
// debugging sexpressions
+10 -3
View File
@@ -9,13 +9,16 @@
/*
* $Logfile: /Freespace2/code/Physics/Physics.cpp $
* $Revision: 2.1 $
* $Date: 2002-08-01 01:41:09 $
* $Author: penguin $
* $Revision: 2.2 $
* $Date: 2002-10-19 19:29:28 $
* $Author: bobboau $
*
* Physics stuff
*
* $Log: not supported by cvs2svn $
* Revision 2.1 2002/08/01 01:41:09 penguin
* The big include file move
*
* Revision 2.0 2002/06/03 04:02:27 penguin
* Warpcore CVS sync
*
@@ -426,6 +429,8 @@ void physics_init( physics_info * pi )
pi->afterburner_decay = 1;
pi->forward_thrust = 0.0f;
pi->vert_thrust = 0.0f; //added these two in order to get side and forward thrusters
pi->side_thrust = 0.0f; //to glow broighter when the ship is moveing in the right direction -Bobboau
pi->flags = 0;
@@ -904,6 +909,8 @@ void physics_read_flying_controls( matrix * orient, physics_info * pi, control_i
pi->desired_rotvel.xyz.z = ci->bank * pi->max_rotvel.xyz.z + delta_bank;
pi->forward_thrust = ci->forward;
pi->vert_thrust = ci->vertical; //added these two in order to get side and forward thrusters
pi->side_thrust = ci->sideways; //to glow broighter when the ship is moveing in the right direction -Bobboau
if ( pi->flags & PF_AFTERBURNER_ON ) {
goal_vel.xyz.x = ci->sideways*pi->afterburner_max_vel.xyz.x;
+8 -3
View File
@@ -9,13 +9,16 @@
/*
* $Logfile: /Freespace2/code/Physics/Physics.h $
* $Revision: 2.1 $
* $Date: 2002-08-01 01:41:09 $
* $Author: penguin $
* $Revision: 2.2 $
* $Date: 2002-10-19 19:29:28 $
* $Author: bobboau $
*
* Clues to the meaning of life on Shivan planet Sphlighesphlaightseh
*
* $Log: not supported by cvs2svn $
* Revision 2.1 2002/08/01 01:41:09 penguin
* The big include file move
*
* Revision 2.0 2002/06/03 04:02:27 penguin
* Warpcore CVS sync
*
@@ -192,6 +195,8 @@ typedef struct physics_info {
vector desired_vel; // in world coord
vector desired_rotvel; // in local coord
float forward_thrust; // How much the forward thruster is applied. 0-1.
float side_thrust; // How much the forward thruster is +x. 0-1.
float vert_thrust; // How much the forward thruster is +y. 0-1.
// Data that changes each frame. Physics fills these in each frame.
vector vel; // The current velocity vector of this object
+8 -6
View File
@@ -9,13 +9,16 @@
/*
* $Logfile: /Freespace2/code/Playerman/PlayerControl.cpp $
* $Revision: 2.1 $
* $Date: 2002-08-01 01:41:09 $
* $Author: penguin $
* $Revision: 2.2 $
* $Date: 2002-10-19 19:29:28 $
* $Author: bobboau $
*
* Routines to deal with player ship movement
*
* $Log: not supported by cvs2svn $
* Revision 2.1 2002/08/01 01:41:09 penguin
* The big include file move
*
* Revision 2.0 2002/06/03 04:02:27 penguin
* Warpcore CVS sync
*
@@ -676,6 +679,8 @@ void do_view_external(float frame_time)
void do_thrust_keys(control_info *ci)
{
ci->forward = check_control_timef(FORWARD_THRUST) - check_control_timef(REVERSE_THRUST);
ci->sideways = (check_control_timef(RIGHT_SLIDE_THRUST) - check_control_timef(LEFT_SLIDE_THRUST));//for slideing-Bobboau
ci->vertical = (check_control_timef(UP_SLIDE_THRUST) - check_control_timef(DOWN_SLIDE_THRUST));//for slideing-Bobboau
}
// called by single and multiplayer modes to reset information inside of control info structure
@@ -824,9 +829,6 @@ void read_keyboard_controls( control_info * ci, float frame_time, physics_info *
ci->pitch += kh;
ci->sideways = (key_down_timef(KEY_PAD3) - key_down_timef(KEY_PAD1));
ci->vertical = (key_down_timef(KEY_PADPLUS) - key_down_timef(KEY_PADENTER));
do_thrust_keys(ci);
}
+15 -11
View File
@@ -9,13 +9,16 @@
/*
* $Logfile: /Freespace2/code/Render/3dClipper.cpp $
* $Revision: 2.1 $
* $Date: 2002-08-01 01:41:09 $
* $Revision: 2.2 $
* $Date: 2002-08-06 01:49:08 $
* $Author: penguin $
*
* Polygon clipping functions
*
* $Log: not supported by cvs2svn $
* Revision 2.1 2002/08/01 01:41:09 penguin
* The big include file move
*
* Revision 2.0 2002/06/03 04:02:27 penguin
* Warpcore CVS sync
*
@@ -259,7 +262,8 @@ int clip_plane(int plane_flag,vertex **src,vertex **dest,int *nv,ccodes *cc,uint
src[*nv] = src[0];
src[*nv+1] = src[1];
cc->and = 0xff; cc->or = 0;
cc->cc_and = 0xff;
cc->cc_or = 0;
for (i=1;i<=*nv;i++) {
@@ -268,16 +272,16 @@ int clip_plane(int plane_flag,vertex **src,vertex **dest,int *nv,ccodes *cc,uint
if (! (src[i-1]->codes & plane_flag)) { //prev not off?
*dest = clip_edge(plane_flag,src[i-1],src[i],flags);
cc->or |= (*dest)->codes;
cc->and &= (*dest)->codes;
cc->cc_or |= (*dest)->codes;
cc->cc_and &= (*dest)->codes;
dest++;
}
if (! (src[i+1]->codes & plane_flag)) {
*dest = clip_edge(plane_flag,src[i+1],src[i],flags);
cc->or |= (*dest)->codes;
cc->and &= (*dest)->codes;
cc->cc_or |= (*dest)->codes;
cc->cc_and &= (*dest)->codes;
dest++;
}
@@ -290,8 +294,8 @@ int clip_plane(int plane_flag,vertex **src,vertex **dest,int *nv,ccodes *cc,uint
*dest++ = src[i];
cc->or |= src[i]->codes;
cc->and &= src[i]->codes;
cc->cc_or |= src[i]->codes;
cc->cc_and &= src[i]->codes;
}
}
@@ -306,11 +310,11 @@ vertex **clip_polygon(vertex **src,vertex **dest,int *nv,ccodes *cc,uint flags)
for (plane_flag=1;plane_flag<=CC_OFF_USER;plane_flag<<=1)
if (cc->or & plane_flag) {
if (cc->cc_or & plane_flag) {
*nv = clip_plane(plane_flag,src,dest,nv,cc,flags);
if (cc->and) //clipped away
if (cc->cc_and) //clipped away
return dest;
t = src; src = dest; dest = t;
+25 -20
View File
@@ -9,13 +9,16 @@
/*
* $Logfile: /Freespace2/code/Render/3ddraw.cpp $
* $Revision: 2.1 $
* $Date: 2002-08-01 01:41:09 $
* $Revision: 2.2 $
* $Date: 2002-08-06 01:49:08 $
* $Author: penguin $
*
* 3D rendering primitives
*
* $Log: not supported by cvs2svn $
* Revision 2.1 2002/08/01 01:41:09 penguin
* The big include file move
*
* Revision 2.0 2002/06/03 04:02:27 penguin
* Warpcore CVS sync
*
@@ -323,7 +326,8 @@ int g3_draw_poly(int nv,vertex **pointlist,uint tmap_flags)
Assert( G3_count == 1 );
cc.or = 0; cc.and = 0xff;
cc.cc_or = 0;
cc.cc_and = 0xff;
bufptr = Vbuf0;
@@ -332,19 +336,19 @@ int g3_draw_poly(int nv,vertex **pointlist,uint tmap_flags)
p = bufptr[i] = pointlist[i];
cc.and &= p->codes;
cc.or |= p->codes;
cc.cc_and &= p->codes;
cc.cc_or |= p->codes;
}
if (cc.and)
if (cc.cc_and)
return 1; //all points off screen
if (cc.or) {
if (cc.cc_or) {
Assert( G3_count == 1 );
bufptr = clip_polygon(Vbuf0,Vbuf1,&nv,&cc,tmap_flags);
if (nv && !(cc.or&CC_BEHIND) && !cc.and) {
if (nv && !(cc.cc_or & CC_BEHIND) && !cc.cc_and) {
for (i=0;i<nv;i++) {
vertex *p = bufptr[i];
@@ -405,7 +409,7 @@ int g3_draw_poly_constant_sw(int nv,vertex **pointlist,uint tmap_flags, float co
Assert( G3_count == 1 );
cc.or = 0; cc.and = 0xff;
cc.cc_or = 0; cc.cc_and = 0xff;
bufptr = Vbuf0;
@@ -414,19 +418,19 @@ int g3_draw_poly_constant_sw(int nv,vertex **pointlist,uint tmap_flags, float co
p = bufptr[i] = pointlist[i];
cc.and &= p->codes;
cc.or |= p->codes;
cc.cc_and &= p->codes;
cc.cc_or |= p->codes;
}
if (cc.and)
if (cc.cc_and)
return 1; //all points off screen
if (cc.or) {
if (cc.cc_or) {
Assert( G3_count == 1 );
bufptr = clip_polygon(Vbuf0, Vbuf1, &nv, &cc, tmap_flags);
if (nv && !(cc.or&CC_BEHIND) && !cc.and) {
if (nv && !(cc.cc_or & CC_BEHIND) && !cc.cc_and) {
for (i=0;i<nv;i++) {
vertex *p = bufptr[i];
@@ -812,7 +816,8 @@ float g3_draw_poly_constant_sw_area(int nv, vertex **pointlist, uint tmap_flags,
Assert( G3_count == 1 );
cc.or = 0; cc.and = 0xff;
cc.cc_or = 0;
cc.cc_and = 0xff;
bufptr = Vbuf0;
@@ -821,20 +826,20 @@ float g3_draw_poly_constant_sw_area(int nv, vertex **pointlist, uint tmap_flags,
p = bufptr[i] = pointlist[i];
cc.and &= p->codes;
cc.or |= p->codes;
cc.cc_and &= p->codes;
cc.cc_or |= p->codes;
}
if (cc.and){
if (cc.cc_and){
return 0.0f; //all points off screen
}
if (cc.or) {
if (cc.cc_or) {
Assert( G3_count == 1 );
bufptr = clip_polygon(Vbuf0, Vbuf1, &nv, &cc, tmap_flags);
if (nv && !(cc.or&CC_BEHIND) && !cc.and) {
if (nv && !(cc.cc_or & CC_BEHIND) && !cc.cc_and) {
for (i=0;i<nv;i++) {
vertex *p = bufptr[i];
+7 -4
View File
@@ -9,11 +9,14 @@
/*
* $Logfile: /Freespace2/code/Ship/ai.h $
* $Revision: 2.1 $
* $Date: 2002-08-01 01:41:09 $
* $Author: penguin $
* $Revision: 2.2 $
* $Date: 2002-10-19 19:29:28 $
* $Author: bobboau $
*
* $Log: not supported by cvs2svn $
* 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
*
@@ -697,7 +700,7 @@ extern void ai_find_path(object *pl_objp, int objnum, int path_num, int exit_fla
extern float ai_path();
extern void evade_weapon();
extern int might_collide_with_ship(object *obj1, object *obj2, float dot_to_enemy, float dist_to_enemy, float duration);
extern void ai_fire_primary_weapon(object *objp);
extern int ai_fire_primary_weapon(object *objp); //changed to return weather it fired-Bobboau
extern int ai_fire_secondary_weapon(object *objp, int priority1 = -1, int priority2 = -1);
extern float ai_get_weapon_dist(ship_weapon *swp);
extern void turn_towards_point(object *objp, vector *point, vector *slide_vec, float bank_override);
+19 -5
View File
@@ -9,13 +9,16 @@
/*
* $Logfile: /Freespace2/code/Ship/AiBig.cpp $
* $Revision: 2.1 $
* $Date: 2002-08-01 01:41:09 $
* $Author: penguin $
* $Revision: 2.2 $
* $Date: 2002-10-19 19:29:28 $
* $Author: bobboau $
*
* C module for AI code related to large ships
*
* $Log: not supported by cvs2svn $
* 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
*
@@ -997,6 +1000,7 @@ void ai_big_maybe_fire_weapons(float dist_to_enemy, float dot_to_enemy, vector *
{
ai_info *aip;
ship_weapon *swp;
int has_fired = -1;
aip = &Ai_info[Ships[Pl_objp->instance].ai_index];
swp = &Ships[Pl_objp->instance].weapons;
@@ -1016,8 +1020,13 @@ void ai_big_maybe_fire_weapons(float dist_to_enemy, float dot_to_enemy, vector *
Assert(tswp->current_primary_bank < tswp->num_primary_banks);
weapon_info *wip = &Weapon_info[tswp->primary_bank_weapons[tswp->current_primary_bank]];
if (dist_to_enemy < wip->max_speed * wip->lifetime)
ai_fire_primary_weapon(Pl_objp);
if (dist_to_enemy < wip->max_speed * wip->lifetime){
has_fired = 1;
if(! ai_fire_primary_weapon(Pl_objp)){
has_fired = -1;
// ship_stop_fire_primary(Pl_objp);
}
}
int priority1, priority2;
@@ -1081,6 +1090,11 @@ void ai_big_maybe_fire_weapons(float dist_to_enemy, float dot_to_enemy, vector *
} else {
aip->time_enemy_in_range *= (1.0f - flFrametime);
}
if(has_fired == -1){ //stuff that hapens when the ship stops fireing
ship_stop_fire_primary(Pl_objp);
}
}
// switch ai ship into chase mode
+25 -10
View File
@@ -9,13 +9,16 @@
/*
* $Logfile: /Freespace2/code/Ship/AiCode.cpp $
* $Revision: 2.7 $
* $Date: 2002-08-01 01:41:09 $
* $Author: penguin $
* $Revision: 2.8 $
* $Date: 2002-10-19 19:29:28 $
* $Author: bobboau $
*
* AI code that does interesting stuff
*
* $Log: not supported by cvs2svn $
* Revision 2.7 2002/08/01 01:41:09 penguin
* The big include file move
*
* Revision 2.6 2002/07/18 14:36:53 unknownplayer
* no message
*
@@ -5686,7 +5689,9 @@ void set_primary_weapon_linkage(object *objp)
// --------------------------------------------------------------------------
// Fire the current primary weapon.
// *objp is the object to fire from.
void ai_fire_primary_weapon(object *objp)
//I changed this to return a true false flag on weather
//it did or did not fire the weapon sorry if this screws you up-Bobboau
int ai_fire_primary_weapon(object *objp)
{
ship *shipp = &Ships[objp->instance];
ship_weapon *swp = &shipp->weapons;
@@ -5703,12 +5708,12 @@ void ai_fire_primary_weapon(object *objp)
if (Num_weapons > (int) (0.9f * MAX_WEAPONS)) {
if (frand() > 0.5f) {
nprintf(("AI", "Frame %i, %s not fire.\n", Framecount, shipp->ship_name));
return;
return 0;
}
}
if (!Ai_firing_enabled){
return;
return 0;
}
if (aip->target_objnum != -1){
@@ -5759,11 +5764,11 @@ void ai_fire_primary_weapon(object *objp)
type = aip->targeted_subsys->system_info->type;
if (ship_get_subsystem_strength(&Ships[tobjp->instance], type) == 0.0f) {
aip->target_objnum = -1;
return;
return 0;
}
} else {
aip->target_objnum = -1;
return;
return 0;
}
}
}
@@ -5777,7 +5782,7 @@ void ai_fire_primary_weapon(object *objp)
if (!(Weapon_info[swp->primary_bank_weapons[swp->current_primary_bank]].wi_flags & WIF_PUNCTURE)) {
//nprintf(("AI", "Ship %s not firing at protected ship %s because not using disruptor.\n", Ships[objp->instance].ship_name, Ships[enemy_objp->instance].ship_name));
swp->next_primary_fire_stamp[swp->current_primary_bank] = timestamp(1000);
return;
return 0;
}
/*
@@ -5804,6 +5809,7 @@ void ai_fire_primary_weapon(object *objp)
shipp->flags |= SF_TRIGGER_DOWN;
ship_fire_primary(objp, 1);
shipp->flags &= ~SF_TRIGGER_DOWN;
return 1;//if it got down to here then it tryed to fire
}
// --------------------------------------------------------------------------
@@ -8054,6 +8060,7 @@ void ai_chase()
ship_weapon *swp = &shipp->weapons;
ai_info *aip = &Ai_info[shipp->ai_index];
int enemy_sip_flags;
int has_fired = -1;
if (aip->mode != AIM_CHASE) {
Int3();
@@ -8525,7 +8532,11 @@ void ai_chase()
else
scale = 0.0f;
if (dist_to_enemy < pwip->max_speed * (1.0f + scale)) {
ai_fire_primary_weapon(Pl_objp);
has_fired = 1;
if(! ai_fire_primary_weapon(Pl_objp)){
has_fired = -1;
// ship_stop_fire_primary(Pl_objp);
}
}
// Don't fire secondaries at a protected ship.
@@ -8606,6 +8617,10 @@ void ai_chase()
} else
aip->time_enemy_in_range *= (1.0f - flFrametime);
if(has_fired == -1){
ship_stop_fire_primary(Pl_objp);
}
}
// Make the object *objp move so that the point *dp on the object moves towards the point *vp
+407 -69
View File
@@ -9,13 +9,19 @@
/*
* $Logfile: /Freespace2/code/Ship/Ship.cpp $
* $Revision: 2.6 $
* $Date: 2002-08-01 01:41:10 $
* $Author: penguin $
* $Revision: 2.8 $
* $Date: 2002-11-06 23:21:06 $
* $Author: phreak $
*
* Ship (and other object) handling functions
*
* $Log: not supported by cvs2svn $
* Revision 2.7 2002/10/19 19:29:29 bobboau
* inital commit, trying to get most of my stuff into FSO, there should be most of my fighter beam, beam rendering, beam sheild hit, ABtrails, and ssm stuff. one thing you should be happy to know is the beam texture tileing is now set in the beam section section of the weapon table entry
*
* Revision 2.6 2002/08/01 01:41:10 penguin
* The big include file move
*
* Revision 2.5 2002/07/30 18:11:25 wmcoolmon
* Fixed a bug I added in ship_do_rearm_frame
*
@@ -747,6 +753,8 @@
#include "missionui/missionshipchoice.h"
#include "hud/hudartillery.h"
#include "weapon/flak.h" //phreak addded 11/05/02 for flak primaries
#ifndef NO_NETWORK
#include "network/multi.h"
#include "network/multiutil.h"
@@ -1466,10 +1474,40 @@ int parse_ship()
required_string("+Aburn Rec Rate:");
stuff_float(&sip->afterburner_recover_rate);
if(optional_string("$Trails:")){//optional values aplyed to ABtrails -Bobboau
char bitmap_name[MAX_FILENAME_LEN] = "";
required_string("+Bitmap:");
stuff_string(bitmap_name, F_NAME, NULL);
sip->ABbitmap = bm_load(bitmap_name);
required_string("+Width:");
stuff_float(&sip->ABwidth_factor);
required_string("+Alpha:");
stuff_float(&sip->ABAlpha_factor);
required_string("+Life:");
stuff_float(&sip->ABlife);
}else{
sip->ABbitmap = -1; //defalts for no ABtrails-Bobboau
sip->ABwidth_factor = 1.0f;
sip->ABAlpha_factor = 1.0f;
sip->ABlife = 5.0f;
}
} else {
sip->afterburner_max_vel.xyz.x = 0.0f;
sip->afterburner_max_vel.xyz.y = 0.0f;
sip->afterburner_max_vel.xyz.z = 0.0f;
sip->ABbitmap = -1; //defalts for no ABtrails-Bobboau
sip->ABwidth_factor = 1.0f;
sip->ABAlpha_factor = 1.0f;
sip->ABlife = 5.0f;
}
required_string("$Countermeasures:");
@@ -2556,13 +2594,27 @@ void ship_render(object * obj)
// ship_get_subsystem_strength( shipp, SUBSYSTEM_ENGINE)>ENGINE_MIN_STR
if ( (shipp->thruster_bitmap > -1) && (!(shipp->flags & SF_DISABLED)) && (!ship_subsys_disrupted(shipp, SUBSYSTEM_ENGINE)) ) {
float ft;
vector ft;//model_set_thrust now uses a vector as a scaleing paramiter
// Add noise to thruster geometry.
ft = obj->phys_info.forward_thrust;
ft *= (1.0f + frand()/5.0f - 1.0f/10.0f);
if (ft > 1.0f)
ft = 1.0f;
ft.xyz.z = obj->phys_info.forward_thrust;
ft.xyz.x = obj->phys_info.side_thrust;
ft.xyz.y = obj->phys_info.vert_thrust;
ft.xyz.z *= (1.0f + frand()/5.0f - 1.0f/10.0f);
ft.xyz.y *= (1.0f + frand()/5.0f - 1.0f/10.0f);
ft.xyz.x *= (1.0f + frand()/5.0f - 1.0f/10.0f);
if (ft.xyz.z > 1.0f)
ft.xyz.z = 1.0f;
if (ft.xyz.x > 1.0f)
ft.xyz.x = 1.0f;
if (ft.xyz.y > 1.0f)
ft.xyz.y = 1.0f;
if (ft.xyz.z < -1.0f)
ft.xyz.z = -1.0f;
if (ft.xyz.x < -1.0f)
ft.xyz.x = -1.0f;
if (ft.xyz.y < -1.0f)
ft.xyz.y = -1.0f;
model_set_thrust( shipp->modelnum, ft, shipp->thruster_bitmap, shipp->thruster_glow_bitmap, shipp->thruster_glow_noise );
render_flags |= MR_SHOW_THRUSTERS;
@@ -4719,6 +4771,40 @@ int ship_create(matrix *orient, vector *pos, int ship_type)
shipp->wing_status_wing_index = -1; // wing index (0-4) in wingman status gauge
shipp->wing_status_wing_pos = -1; // wing position (0-5) in wingman status gauge
trail_info *ci;
//first try at ABtrails -Bobboau
shipp->ab_count = 0;
if(sip->flags & SIF_AFTERBURNER){
for(int h = 0; h < pm->n_thrusters; h++){
for(int j = 0; j < pm->thrusters->num_slots; j++){
// this means you've reached the max # of AB trails for a ship
Assert(sip->ct_count <= MAX_SHIP_CONTRAILS);
ci = &shipp->ab_info[shipp->ab_count++];
// ci = &sip->ct_info[sip->ct_count++];
ci->pt = pm->thrusters[h].pnt[j];//offset
ci->w_start = pm->thrusters[h].radius[j] * sip->ABwidth_factor;//width * table loaded width factor
ci->w_end = 0.05f;//end width
ci->a_start = 1.0f * sip->ABAlpha_factor;//start alpha * table loaded alpha factor
ci->a_end = 0.0f;//end alpha
ci->max_life = sip->ABlife;// table loaded max life
ci->stamp = 60; //spew time???
ci->bitmap = sip->ABbitmap; //table loaded bitmap used on this ships burner trails
}
}
}//end AB trails -Bobboau
// call the contrail system
ct_ship_create(shipp);
@@ -5077,11 +5163,103 @@ void ship_fire_tracer(int weapon_objnum)
particle_create(&pinfo);
}
int ship_stop_fire_primary_bank(object * obj, int bank_to_stop){//stops a single primary bank-Bobboau
ship *shipp;
ship_weapon *swp;
if(obj == NULL){
return 0;
}
if(obj->type != OBJ_SHIP){
return 0;
}
shipp = &Ships[obj->instance];
// mprintf(("stoping weapon on ship %s\n", shipp->ship_name));
if(shipp->was_firing_last_frame[bank_to_stop] == 0)return 0;
swp = &shipp->weapons;
shipp->was_firing_last_frame[bank_to_stop] = 0;
int weapon = swp->primary_bank_weapons[bank_to_stop];
weapon_info* winfo_p = &Weapon_info[weapon];
shipp->life_left[bank_to_stop] = winfo_p->b_info.beam_life; //for fighter beams
shipp->life_total[bank_to_stop] = winfo_p->b_info.beam_life; //for fighter beams
shipp->warmdown_stamp[bank_to_stop] = -1; //for fighter beams
shipp->warmup_stamp[bank_to_stop] = -1; //for fighter beams
snd_stop(shipp->fighter_beam_loop_sound[bank_to_stop]);
shipp->fighter_beam_loop_sound[bank_to_stop] = -1;//stops the beam looping sound -bobboau
/* if ( obj == Player_obj ){
HUD_printf("stoped bank %d", bank_to_stop);
}*/
return 1;
}
int ship_stop_fire_primary(object * obj){ //stuff to do when the ship has stoped fireing all primary weapons-Bobboau
int num_primary_banks = 0, bank_to_stop = 0;
ship *shipp;
ship_weapon *swp;
if(obj == NULL){
return 0;
}
if(obj->type != OBJ_SHIP){
return 0;
}
shipp = &Ships[obj->instance];
mprintf(("stoping weapon on ship %s\n", shipp->ship_name));
// if(shipp->was_firing_last_frame[bank_to_stop] == 0)return 0;
swp = &shipp->weapons;
if ( shipp->flags & SF_PRIMARY_LINKED ) {
num_primary_banks = swp->num_primary_banks;
} else {
num_primary_banks = min(1, swp->num_primary_banks);
}
for ( int i = 0; i < num_primary_banks; i++ ) {
if(shipp->was_firing_last_frame[bank_to_stop]){
ship_stop_fire_primary_bank(obj, bank_to_stop);
}
}
/* if ( obj == Player_obj ){
HUD_printf("stoped all");
}*/
return 1;
}
// Multiplicative delay factors for increasing skill levels.
float Ship_fire_delay_scale_hostile[NUM_SKILL_LEVELS] = {4.0f, 2.5f, 1.75f, 1.25f, 1.0f};
float Ship_fire_delay_scale_friendly[NUM_SKILL_LEVELS] = {2.0f, 1.4f, 1.25f, 1.1f, 1.0f};
int tracers[MAX_SHIPS][4][4];
int tracers[MAX_SHIPS][4][4];
float ship_get_subsystem_strength( ship *shipp, int type );
// fires a primary weapon for the given object. It also handles multiplayer cases.
// in multiplayer, the starting network signature, and number of banks fired are sent
@@ -5126,6 +5304,9 @@ int ship_fire_primary(object * obj, int stream_weapons, int force)
shipp = &Ships[n];
swp = &shipp->weapons;
//if (shipp->targeting_laser_objnum != -1)
//shipp->targeting_laser_objnum = -1; // erase old laser obj num if it has any -Bobboau
// bogus
if((shipp->ship_info_index < 0) || (shipp->ship_info_index >= Num_ship_types)){
return 0;
@@ -5182,7 +5363,6 @@ int ship_fire_primary(object * obj, int stream_weapons, int force)
ship_start_targeting_laser(shipp);
}
// if we're firing stream weapons and this is a non stream weapon, skip it
if(stream_weapons && !(winfo_p->wi_flags & WIF_STREAM)){
continue;
@@ -5199,6 +5379,7 @@ int ship_fire_primary(object * obj, int stream_weapons, int force)
}
have_timeout = 1;
// ship_stop_fire_primary_bank(obj, bank_to_fire);
continue;
}
@@ -5206,7 +5387,7 @@ int ship_fire_primary(object * obj, int stream_weapons, int force)
// do timestamp stuff for next firing time
float next_fire_delay = (float) winfo_p->fire_wait * 1000.0f;
if (!(obj->flags & OF_PLAYER_SHIP)) {
if (!(obj->flags & OF_PLAYER_SHIP) ) {
if (shipp->team == Ships[Player_obj->instance].team){
next_fire_delay *= Ship_fire_delay_scale_friendly[Game_skill_level];
} else {
@@ -5220,7 +5401,7 @@ int ship_fire_primary(object * obj, int stream_weapons, int force)
// rolled around, subtract out up to half the previous frametime.
// Note, unless we track whether the fire button has been held down, and not tapped, it's hard to
// know how much time to subtract off. It could be this fire is "late" because the user didn't want to fire.
if (next_fire_delay > 0.0f) {
if ((next_fire_delay > 0.0f)) {
if (obj->flags & OF_PLAYER_SHIP) {
int t = timestamp_until(swp->next_primary_fire_stamp[bank_to_fire]);
if (t < 0) {
@@ -5251,16 +5432,82 @@ int ship_fire_primary(object * obj, int stream_weapons, int force)
if ( ship_maybe_play_primary_fail_sound() ) {
}
}
ship_stop_fire_primary_bank(obj, bank_to_fire);
continue;
}
polymodel *po = model_get( Ship_info[shipp->ship_info_index].modelnum );
if (winfo_p->wi_flags & WIF_BEAM){
if ( obj == Player_obj ) {//beam sounds for the player
if((shipp->fighter_beam_loop_sound[bank_to_fire] == -1) && (winfo_p->b_info.beam_loop_sound >= 0)){
sound_played = winfo_p->launch_snd;
if ( obj == Player_obj ) {
if ( winfo_p->launch_snd != -1 ) {
weapon_info *wip;
ship_weapon *swp;
if(shipp->fighter_beam_loop_sound[bank_to_fire] == -1 ){
shipp->fighter_beam_loop_sound[bank_to_fire] = snd_play_looping( &Snds[winfo_p->launch_snd], 0.0f, -1, -1, 1.0f, SND_PRIORITY_MUST_PLAY );
}
if(!(snd_is_playing(shipp->fighter_beam_loop_sound[bank_to_fire])) ){
shipp->fighter_beam_loop_sound[bank_to_fire] = -1;
}
swp = &Player_ship->weapons;
if (swp->current_primary_bank >= 0) {
wip = &Weapon_info[swp->primary_bank_weapons[swp->current_primary_bank]];
joy_ff_play_primary_shoot((int) ((wip->armor_factor + wip->shield_factor * 0.2f) * (wip->damage * wip->damage - 7.5f) * 0.45f + 0.6f) * 10 + 2000);
}
}
}
}
}else{//beam sounds for other fighters
//if the fighter doesn't have a fighter beam sound from being fired last frame give it one
if(!(snd_is_playing(shipp->fighter_beam_loop_sound[bank_to_fire])) ){
snd_stop(shipp->fighter_beam_loop_sound[bank_to_fire]);
shipp->fighter_beam_loop_sound[bank_to_fire] = -1;
}
vector pos, temp = obj->pos, temp2 = obj->pos;
vm_vec_unrotate(&temp2, &temp, &obj->orient);
vm_vec_add2(&temp, &temp2);
vm_vec_scale_add(&temp, &temp2, &obj->orient.vec.fvec, 10000);
switch(vm_vec_dist_to_line(&View_position, &obj->pos, &temp, &pos, NULL)){
// behind the beam, so use the start pos
case -1:
pos = obj->pos;
break;
// use the closest point
case 0:
// already calculated in vm_vec_dist_to_line(...)
break;
// past the beam, so use the shot pos
case 1:
pos = temp;
break;
}
if((shipp->fighter_beam_loop_sound[bank_to_fire] == -1)){
shipp->fighter_beam_loop_sound[bank_to_fire] = snd_play_3d( &Snds[winfo_p->launch_snd], &pos, &View_position, 0.0f, NULL, 1, 1.0, SND_PRIORITY_SINGLE_INSTANCE, NULL, 1.0f, 1);
}else{//the fighter has a beam sound already, update it
snd_update_3d_pos(shipp->fighter_beam_loop_sound[bank_to_fire], &Snds[winfo_p->launch_snd], &pos);
}
}//end of sound beam stuff
}
if ( po->n_guns > 0 ) {
int num_slots = po->gun_banks[bank_to_fire].num_slots;
if(winfo_p->wi_flags & WIF_BEAM){ // the big change I made for fighter beams, if there beams fill out the Fire_Info for a targeting laser then fire it, for each point in the weapon bank -Bobboau
//mprintf(("I am going to fire a fighter beam\n"));
// fail unless we're forcing (energy based primaries)
if ( (shipp->weapon_energy < num_slots*winfo_p->energy_consumed*flFrametime) && !force) {
swp->next_primary_fire_stamp[bank_to_fire] = timestamp(swp->next_primary_fire_stamp[bank_to_fire]);
@@ -5268,6 +5515,7 @@ int ship_fire_primary(object * obj, int stream_weapons, int force)
if ( ship_maybe_play_primary_fail_sound() ) {
}
}
ship_stop_fire_primary_bank(obj, bank_to_fire);
continue;
}
@@ -5275,9 +5523,70 @@ int ship_fire_primary(object * obj, int stream_weapons, int force)
// deplete the weapon reserve energy by the amount of energy used to fire the weapon and the number of points and do it by the time it's been fireing becase this is a beam -Bobboau
shipp->weapon_energy -= num_slots*winfo_p->energy_consumed*flFrametime;
beam_fire_info fbfire_info;
//int j = (timestamp()/100)%num_slots; // fireing point cycleing for TBP
for ( int j = 0; j < num_slots; j++ ){
fighter_beam_fire_info fbfire_info;
if(shipp->was_firing_last_frame[bank_to_fire] == 1){
if(shipp->warmup_stamp[bank_to_fire] < timestamp())
shipp->warmup_stamp[bank_to_fire] = -1;
shipp->life_left[bank_to_fire] -= flFrametime;
}else{
shipp->warmup_stamp[bank_to_fire] = timestamp() + winfo_p->b_info.beam_warmup;
shipp->life_left[bank_to_fire] = winfo_p->b_info.beam_life; //for fighter beams
shipp->life_total[bank_to_fire] = winfo_p->b_info.beam_life; //for fighter beams
shipp->warmdown_stamp[bank_to_fire] = -1; //for fighter beams
/* if ( obj == Player_obj ){
HUD_printf("first frame");
}*/
}
/* shipp->warmup_stamp[bank_to_fire] = -1;
shipp->life_left[bank_to_fire] = 0.0f; //for fighter beams
shipp->life_total[bank_to_fire] = 0.0f; //for fighter beams
shipp->warmdown_stamp[bank_to_fire] = -1; //for fighter beams
*/
// if ( obj == Player_obj ){
fbfire_info.fighter_beam_loop_sound = -1;
// }else{
// fbfire_info.fighter_beam_loop_sound = shipp->fighter_beam_loop_sound[bank_to_fire]; //fighterbeam loop sound -Bobboau
// }
fbfire_info.life_left = shipp->life_left[bank_to_fire]; //for fighter beams
fbfire_info.life_total = shipp->life_total[bank_to_fire]; //for fighter beams
fbfire_info.warmdown_stamp = shipp->warmdown_stamp[bank_to_fire]; //for fighter beams
fbfire_info.warmup_stamp = shipp->warmup_stamp[bank_to_fire]; //for fighter beams
//mprintf(("preliminary fighter beam data\n"));
// if ( obj == Player_obj ){
// HUD_printf("warmup %d, life left %0.3f", shipp->warmup_stamp[bank_to_fire], shipp->life_left[bank_to_fire]);
// }
int points;
if (winfo_p->b_info.beam_shots){
if (winfo_p->b_info.beam_shots > num_slots){
points = num_slots;
}else{
points = winfo_p->b_info.beam_shots;
}
}else{
points = num_slots;
}
int j; // fireing point cycleing for TBP
//mprintf(("I am about to fire a fighter beam\n"));
for ( int v = 0; v < points; v++ ){
//mprintf(("I am about to fire a fighter beam2\n"));
if(winfo_p->b_info.beam_shots){
j = ( (timestamp()/(int)((winfo_p->fire_wait * 2000.0f) / num_slots)) + v)%num_slots;
}else{
j=v;
}
//mprintf(("I am about to fire a fighter beam3\n"));
fbfire_info.accuracy = 0.0f;
fbfire_info.beam_info_index = shipp->weapons.primary_bank_weapons[bank_to_fire];
fbfire_info.beam_info_override = NULL;
@@ -5286,98 +5595,132 @@ int ship_fire_primary(object * obj, int stream_weapons, int force)
fbfire_info.target_subsys = NULL;
fbfire_info.turret = NULL;
fbfire_info.targeting_laser_offset = po->gun_banks[bank_to_fire].pnt[j];
winfo_p->b_info.beam_type = BEAM_TYPE_C;
//mprintf(("I am about to fire a fighter beam4\n"));
beam_fire_targeting(&fbfire_info);
//shipp->targeting_laser_objnum = beam_fire_targeting(&fire_info);
}
}else{ //if this insn't a fighter beam, do it normaly -Bobboau
//Assert (!(winfo_p->wi_flags & WIF_BEAM))
//mprintf(("I have fired a fighter beam, type %d\n", winfo_p->b_info.beam_type));
}
else{ //if this insn't a fighter beam, do it normaly -Bobboau
//Assert (!(winfo_p->wi_flags & WIF_BEAM))
// fail unless we're forcing (energy based primaries)
if ( (shipp->weapon_energy < num_slots*winfo_p->energy_consumed) && !force) {
swp->next_primary_fire_stamp[bank_to_fire] = timestamp(swp->next_primary_fire_stamp[bank_to_fire]);
if ( obj == Player_obj ) {
swp->next_primary_fire_stamp[bank_to_fire] = timestamp(swp->next_primary_fire_stamp[bank_to_fire]);
if ( ship_maybe_play_primary_fail_sound() ) {
}
}
ship_stop_fire_primary_bank(obj, bank_to_fire);
continue;
}
// deplete the weapon reserve energy by the amount of energy used to fire the weapon
// deplete the weapon reserve energy by the amount of energy used to fire the weapon
shipp->weapon_energy -= num_slots*winfo_p->energy_consumed;
if(shipp->weapon_energy < 0.0f){
shipp->weapon_energy = 0.0f;
}
// Mark all these weapons as in the same group
int new_group_id = weapon_create_group_id();
for ( j = 0; j < num_slots; j++ ) {
pnt = po->gun_banks[bank_to_fire].pnt[j];
vm_vec_unrotate(&gun_point, &pnt, &obj->orient);
vm_vec_add(&firing_pos, &gun_point, &obj->pos);
// create the weapon -- the network signature for multiplayer is created inside
// of weapon_create
weapon_objnum = weapon_create( &firing_pos, &obj->orient, weapon, OBJ_INDEX(obj),0, new_group_id );
weapon_set_tracking_info(weapon_objnum, OBJ_INDEX(obj), aip->target_objnum, aip->current_target_is_locked, aip->targeted_subsys);
if (winfo_p->wi_flags & WIF_FLAK)
{
object* target=&Objects[aip->target_objnum];
vector predicted_pos;
float flak_range=(winfo_p->lifetime)*(winfo_p->max_speed);
float range_to_target;
float wepstr=ship_get_subsystem_strength(shipp, SUBSYSTEM_WEAPONS);
set_predicted_enemy_pos(&predicted_pos,obj,target,aip);
range_to_target=vm_vec_dist(&predicted_pos, &obj->pos);
//if we have a target and its in range
if ((target) && (range_to_target < flak_range))
{
//set flak range to range of ship
flak_pick_range(&Objects[weapon_objnum],&predicted_pos,wepstr);
}
else
{
flak_set_range(&Objects[weapon_objnum],&firing_pos,flak_range-20);
}
if ((winfo_p->muzzle_flash>=0) && (((shipp==Player_ship) && (vm_vec_mag(&Player_obj->phys_info.vel)>=45)) || (shipp!=Player_ship)))
{
flak_muzzle_flash(&firing_pos,&obj->orient.vec.fvec, swp->primary_bank_weapons[bank_to_fire]);
}
}
// create the muzzle flash effect
shipfx_flash_create( obj, shipp, &pnt, &obj->orient.vec.fvec, 1, weapon );
// maybe shudder the ship - if its me
if((winfo_p->wi_flags & WIF_SHUDDER) && (obj == Player_obj) && !(Game_mode & GM_STANDALONE_SERVER)){
// calculate some arbitrary value between 100
// (mass * velocity) / 10
game_shudder_apply(500, (winfo_p->mass * winfo_p->max_speed) / 10.0f);
}
num_fired++;
}
}
}
if(shipp->weapon_energy < 0.0f){
shipp->weapon_energy = 0.0f;
}
}
banks_fired |= (1<<bank_to_fire); // mark this bank as fired.
}
// Only play the weapon fired sound if it hasn't been played yet. This is to
// avoid playing the same sound multiple times when banks are linked with the
// same weapon.
if ( sound_played != winfo_p->launch_snd ) {
sound_played = winfo_p->launch_snd;
if ( obj == Player_obj ) {
if ( winfo_p->launch_snd != -1 ) {
weapon_info *wip;
ship_weapon *swp;
// HACK
if(winfo_p->launch_snd == SND_AUTOCANNON_SHOT){
snd_play( &Snds[winfo_p->launch_snd], 0.0f, 1.0f, SND_PRIORITY_TRIPLE_INSTANCE );
} else {
snd_play( &Snds[winfo_p->launch_snd], 0.0f, 1.0f, SND_PRIORITY_MUST_PLAY );
}
// snd_play( &Snds[winfo_p->launch_snd] );
if (!(winfo_p->wi_flags & WIF_BEAM)){
if ( sound_played != winfo_p->launch_snd ) {
sound_played = winfo_p->launch_snd;
if ( obj == Player_obj ) {
if ( winfo_p->launch_snd != -1 ) {
weapon_info *wip;
ship_weapon *swp;
swp = &Player_ship->weapons;
if (swp->current_primary_bank >= 0) {
wip = &Weapon_info[swp->primary_bank_weapons[swp->current_primary_bank]];
joy_ff_play_primary_shoot((int) ((wip->armor_factor + wip->shield_factor * 0.2f) * (wip->damage * wip->damage - 7.5f) * 0.45f + 0.6f) * 10 + 2000);
// HACK
if(winfo_p->launch_snd == SND_AUTOCANNON_SHOT){
snd_play( &Snds[winfo_p->launch_snd], 0.0f, 1.0f, SND_PRIORITY_TRIPLE_INSTANCE );
} else {
snd_play( &Snds[winfo_p->launch_snd], 0.0f, 1.0f, SND_PRIORITY_MUST_PLAY );
}
// snd_play( &Snds[winfo_p->launch_snd] );
swp = &Player_ship->weapons;
if (swp->current_primary_bank >= 0) {
wip = &Weapon_info[swp->primary_bank_weapons[swp->current_primary_bank]];
joy_ff_play_primary_shoot((int) ((wip->armor_factor + wip->shield_factor * 0.2f) * (wip->damage * wip->damage - 7.5f) * 0.45f + 0.6f) * 10 + 2000);
}
}
}else {
if ( winfo_p->launch_snd != -1 ) {
snd_play_3d( &Snds[winfo_p->launch_snd], &obj->pos, &View_position );
}
}
}
else {
if ( winfo_p->launch_snd != -1 ) {
snd_play_3d( &Snds[winfo_p->launch_snd], &obj->pos, &View_position );
}
}
}
}
}
shipp->was_firing_last_frame[bank_to_fire] = 1;
} // end for (go to next primary bank)
#ifndef NO_NETWORK
// if multiplayer and we're client-side firing, send the packet
// if((Game_mode & GM_MULTIPLAYER) && (Netgame.debug_flags & NETD_FLAG_CLIENT_FIRING)){
if(Game_mode & GM_MULTIPLAYER){
@@ -5386,7 +5729,6 @@ int ship_fire_primary(object * obj, int stream_weapons, int force)
send_NEW_primary_fired_packet( shipp, banks_fired );
}
}
#endif
// post a primary fired event
if(Game_mode & GM_DEMO_RECORD){
@@ -5398,7 +5740,6 @@ int ship_fire_primary(object * obj, int stream_weapons, int force)
// in multiplayer -- only the server needs to keep track of the stats. Call the cool
// function to find the player given the object *. It had better return a valid player
// or our internal structure as messed up.
#ifndef NO_NETWORK
if( Game_mode & GM_MULTIPLAYER ) {
if ( Net_player->flags & NETINFO_FLAG_AM_MASTER ) {
int player_num;
@@ -5408,10 +5749,7 @@ int ship_fire_primary(object * obj, int stream_weapons, int force)
Net_players[player_num].player->stats.mp_shots_fired += num_fired;
}
}
else
#endif
{
} else {
Player->stats.mp_shots_fired += num_fired;
}
}
@@ -5464,7 +5802,7 @@ void ship_stop_targeting_laser(ship *shipp)
void ship_process_targeting_lasers()
{
beam_fire_info fire_info;
fighter_beam_fire_info fire_info;
ship_obj *so;
ship *shipp;
polymodel *m;
+38 -5
View File
@@ -9,13 +9,22 @@
/*
* $Logfile: /Freespace2/code/Ship/Ship.h $
* $Revision: 2.3 $
* $Date: 2002-08-01 01:41:10 $
* $Author: penguin $
* $Revision: 2.6 $
* $Date: 2002-11-10 19:57:36 $
* $Author: DTP $
*
* all sorts of cool stuff about ships
*
* $Log: not supported by cvs2svn $
* Revision 2.5 2002/10/31 21:56:44 DTP
* DTP Bumped Max_exited_ships from 200 to double that of MAX_SHIPS = 800 . make sense ehh. for logging effect.
*
* Revision 2.4 2002/10/19 19:29:29 bobboau
* inital commit, trying to get most of my stuff into FSO, there should be most of my fighter beam, beam rendering, beam sheild hit, ABtrails, and ssm stuff. one thing you should be happy to know is the beam texture tileing is now set in the beam section section of the weapon table entry
*
* Revision 2.3 2002/08/01 01:41:10 penguin
* The big include file move
*
* Revision 2.2 2002/07/29 08:24:42 DTP
* Bumped all MAX_SHIPS, and SHIP_LIMIT to 400.(let the mission designers decide what is good, and what is bad
*
@@ -666,6 +675,22 @@ typedef struct ship {
// Special warpout objnum (warpout at knossos)
int special_warp_objnum;
int fighter_beam_loop_sound[MAX_PRIMARY_BANKS]; //loop sound used by fighter beams -Bobboau
int warmup_stamp[MAX_PRIMARY_BANKS];
int warmdown_stamp[MAX_PRIMARY_BANKS];
float life_left[MAX_PRIMARY_BANKS];
float life_total[MAX_PRIMARY_BANKS];
int was_firing_last_frame[MAX_PRIMARY_BANKS];
int nameplate; //nameplate texture for this ship
short ABtrail_num[MAX_SHIP_CONTRAILS]; //after burner trails -Bobboau
trail_info ab_info[MAX_SHIP_CONTRAILS];
int ab_count;
} ship;
// structure and array def for ships that have exited the game. Keeps track of certain useful
@@ -677,7 +702,7 @@ typedef struct ship {
#define SEF_BEEN_TAGGED (1<<4)
#define SEF_RED_ALERT_CARRY (1<<5)
#define MAX_EXITED_SHIPS 200
#define MAX_EXITED_SHIPS 800 //DTP changed for MAX_SHIPS sake. double of max_ships.
typedef struct exited_ship {
char ship_name[NAME_LENGTH];
@@ -872,6 +897,13 @@ typedef struct ship_info {
// rgb shield color
ubyte shield_color[3];
//optional ABtrail values
int ABbitmap; //the bitmap used
float ABwidth_factor; //a number that the width (set by the thruster glow width) will be multiplyed by
float ABAlpha_factor; //allows you to set how starting trasparency value
float ABlife; //how long the trails live for
} ship_info;
extern int num_wings;
@@ -901,7 +933,7 @@ extern engine_wash_info Engine_wash_info[MAX_ENGINE_WASH_TYPES];
// DO NOT CHANGE THIS - IT WILL LIKELY BREAK FREESPACE2 PXO SUPPORT
// TALK TO DAVE B FIRST
// ****************************************************************
#define MAX_SHIP_TYPES 200 //DTP bumped from 130 to 200
#define MAX_SHIP_TYPES 130 //DTP bumped from 130 to 200
#define MAX_SHIPS_PER_WING 6
@@ -1022,6 +1054,7 @@ extern int ship_check_collision_fast( object * obj, object * other_obj, vector *
extern int ship_get_num_ships();
extern int ship_fire_primary_debug(object *objp); // Fire the debug laser.
extern int ship_stop_fire_primary(object * obj);
extern int ship_fire_primary(object * objp, int stream_weapons, int force = 0);
extern int ship_fire_secondary(object * objp, int allow_swarm = 0 );
extern int ship_launch_countermeasure(object *objp, int rand_val = -1);
+225 -55
View File
@@ -9,22 +9,13 @@
/*
* $Logfile: /Freespace2/code/Ship/ShipContrails.cpp $
* $Revision: 2.2 $
* $Date: 2002-08-01 01:41:10 $
* $Author: penguin $
* $Revision: 2.3 $
* $Date: 2002-10-19 19:29:29 $
* $Author: bobboau $
*
* all sorts of cool stuff about ships
*
* $Log: not supported by cvs2svn $
* Revision 2.1 2002/07/15 02:11:00 wmcoolmon
* Added support for toggling ship trails
*
* 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 4/25/99 3:02p Dave
* Build defines for the E3 build.
@@ -47,15 +38,15 @@
* $NoKeywords: $
*/
#include "ship/shipcontrails.h"
#include "Ship/ShipContrails.h"
#include "object/object.h"
#include "ship/ship.h"
#include "globalincs/linklist.h"
#include "Ship/Ship.h"
#include "globalincs/LinkList.h"
#include "render/3d.h"
#include "globalincs/alphacolors.h"
#include "weapon/trails.h"
#include "bmpman/bmpman.h"
#include "mission/missionparse.h"
#include "globalincs/AlphaColors.h"
#include "weapon/Trails.h"
#include "bmpman/Bmpman.h"
#include "mission/MissionParse.h"
// ----------------------------------------------------------------------------------------------
// CONTRAIL DEFINES/VARS
@@ -77,6 +68,18 @@ void ct_update_contrails(ship *shipp);
// create new contrails
void ct_create_contrails(ship *shipp);
// determine if the ship has AB trails
int ct_has_ABtrails(ship *shipp);
// update active ABtrails - moving existing ones, adding new ones where necessary
void ct_update_ABtrails(ship *shipp);
// create new ABtrails
void ct_create_ABtrails(ship *shipp);
void ct_ship_process_ABtrails(ship *shipp);
// ----------------------------------------------------------------------------------------------
// CONTRAIL FUNCTIONS
//
@@ -101,6 +104,12 @@ void ct_ship_create(ship *shipp)
for(idx=0; idx<MAX_SHIP_CONTRAILS; idx++){
shipp->trail_num[idx] = (short)-1;
}
for(idx=0; idx<MAX_SHIP_CONTRAILS; idx++){
shipp->ABtrail_num[idx] = (short)-1;
}
}
// call when a ship is deleted to free up its contrail stuff
@@ -115,12 +124,20 @@ void ct_ship_delete(ship *shipp)
trail_object_died(shipp->trail_num[idx]);
shipp->trail_num[idx] = (short)-1;
}
if(shipp->ABtrail_num[idx] >= 0){
trail_object_died(shipp->ABtrail_num[idx]);
shipp->ABtrail_num[idx] = (short)-1;
}
}
}
// call each frame for processing a ship's contrails
void ct_ship_process(ship *shipp)
{
if(shipp->ab_info->bitmap != -1){// if it has no bitmap, it has no trails -Bobboau
ct_ship_process_ABtrails(shipp);//seems like as good a place as any -Bobboau
}
#ifdef MULTIPLAYER_BETA_BUILD
return;
#else
@@ -130,11 +147,11 @@ void ct_ship_process(ship *shipp)
Assert(shipp != NULL);
Assert(shipp->objnum >= 0);
objp = &Objects[shipp->objnum];
// if ship trails are not enabled - do nothing
if(!(The_mission.flags & MISSION_FLAG_SHIP_TRAILS)){
// if not a fullneb mission - do nothing
if(The_mission.flags & MISSION_FLAG_FULLNEB){
return;
}
}
// if this is not a ship, we don't care
if((objp->type != OBJ_SHIP) || (Ship_info[Ships[objp->instance].ship_info_index].ct_count <= 0)){
@@ -149,14 +166,13 @@ void ct_ship_process(ship *shipp)
// kill any active trails he has
for(idx=0; idx<MAX_SHIP_CONTRAILS; idx++){
if(shipp->trail_num[idx] >= 0){
trail_object_died(shipp->trail_num[idx]);
shipp->trail_num[idx] = (short)-1;
//lets make sure it only erases nebula trails in nebula missions
trail_object_died(shipp->trail_num[idx]);
shipp->trail_num[idx] = (short)-1;
}
}
}
// were done
return;
}
// if the object already has contrails
if(ct_has_contrails(shipp)){
@@ -166,6 +182,7 @@ void ct_ship_process(ship *shipp)
else {
ct_create_contrails(shipp);
}
#endif
}
@@ -206,10 +223,10 @@ void ct_update_contrails(ship *shipp)
ship_info *sip;
object *objp;
// if ship trails are not enabled - do nothing
if(!(The_mission.flags & MISSION_FLAG_SHIP_TRAILS)){
// if not a fullneb mission - do nothing
if(!(The_mission.flags & MISSION_FLAG_FULLNEB)){
return;
}
}
// get object and ship info
Assert(shipp != NULL);
@@ -224,20 +241,20 @@ void ct_update_contrails(ship *shipp)
// process each contrail
for(idx=0; idx<MAX_SHIP_CONTRAILS; idx++){
// if this is a valid contrail
if(shipp->trail_num[idx] >= 0){
// get the point for the contrail
vm_vec_rotate(&v1, &sip->ct_info[idx].pt, &m);
vm_vec_add2(&v1, &objp->pos);
// if the spew stamp has elapsed
if(trail_stamp_elapsed(shipp->trail_num[idx])){
trail_add_segment(shipp->trail_num[idx], &v1);
trail_set_stamp(shipp->trail_num[idx]);
} else {
trail_set_segment(shipp->trail_num[idx], &v1);
}
}
}
if(shipp->trail_num[idx] >= 0){
// get the point for the contrail
vm_vec_rotate(&v1, &sip->ct_info[idx].pt, &m);
vm_vec_add2(&v1, &objp->pos);
// if the spew stamp has elapsed
if(trail_stamp_elapsed(shipp->trail_num[idx])){
trail_add_segment(shipp->trail_num[idx], &v1);
trail_set_stamp(shipp->trail_num[idx]);
} else {
trail_set_segment(shipp->trail_num[idx], &v1);
}
}
}
#endif
}
@@ -253,10 +270,11 @@ void ct_create_contrails(ship *shipp)
ship_info *sip;
object *objp;
// if ship trails are not enabled - do nothing
if(!(The_mission.flags & MISSION_FLAG_SHIP_TRAILS)){
// if not a fullneb mission - do nothing
if(!(The_mission.flags & MISSION_FLAG_FULLNEB)){
return;
}
}
// get object and ship info
Assert(shipp != NULL);
@@ -268,14 +286,166 @@ void ct_create_contrails(ship *shipp)
// get the inverse rotation matrix
vm_copy_transpose_matrix(&m, &objp->orient);
for(idx=0; idx<sip->ct_count; idx++){
shipp->trail_num[idx] = (short)trail_create(sip->ct_info[idx]);
// add the point
vm_vec_rotate(&v1, &sip->ct_info[idx].pt, &m);
vm_vec_add2(&v1, &objp->pos);
trail_add_segment(shipp->trail_num[idx], &v1);
trail_add_segment(shipp->trail_num[idx], &v1);
for(idx=0; idx<sip->ct_count; idx++){
//if (this is a neb mision and this is a neb trail) or an ABtrail -Bobboau
shipp->trail_num[idx] = (short)trail_create(sip->ct_info[idx]);
// add the point
vm_vec_rotate(&v1, &sip->ct_info[idx].pt, &m);
vm_vec_add2(&v1, &objp->pos);
trail_add_segment(shipp->trail_num[idx], &v1);
trail_add_segment(shipp->trail_num[idx], &v1);
}
#endif
}
// call each frame for processing a ship's ABtrails
void ct_ship_process_ABtrails(ship *shipp)
{
int idx;
object *objp;
Assert(shipp != NULL);
Assert(shipp->objnum >= 0);
objp = &Objects[shipp->objnum];
// if this is not a ship, we don't care
if((objp->type != OBJ_SHIP) || (Ship_info[Ships[objp->instance].ship_info_index].ct_count <= 0)){
return;
}
Assert(objp->instance >= 0);
shipp = &Ships[objp->instance];
if(!(objp->phys_info.flags & PF_AFTERBURNER_ON)){ //if the after burners aren't on -Bobboau
for(idx=0; idx<MAX_SHIP_CONTRAILS; idx++){
trail_object_died(shipp->ABtrail_num[idx]);
shipp->ABtrail_num[idx] = (short)-1;
}
}
// if the object already has ABtrails
if(ct_has_ABtrails(shipp)){
ct_update_ABtrails(shipp);
}
// otherwise add new ones
else {
ct_create_ABtrails(shipp);
}
/* if(shipp->ab_info->stamp > timestamp( (int)(shipp->ab_info->max_life * 1000) ) ){
for(idx=0; idx<MAX_SHIP_CONTRAILS; idx++){
if(shipp->ABtrail_num[idx] >= 0){
trail_object_died(shipp->ABtrail_num[idx]);
shipp->ABtrail_num[idx] = (short)-1;
}
}
}
*/
}
// create new ABtrails
void ct_create_ABtrails(ship *shipp)
{
vector v1;
int idx;
matrix m;
ship_info *sip;
object *objp;
// get object and ship info
Assert(shipp != NULL);
Assert(shipp->objnum >= 0);
Assert(shipp->ship_info_index >= 0);
objp = &Objects[shipp->objnum];
sip = &Ship_info[shipp->ship_info_index];
// get the inverse rotation matrix
vm_copy_transpose_matrix(&m, &objp->orient);
if(objp->phys_info.flags & PF_AFTERBURNER_ON){//AB trails-Bobboau
for(idx=0; idx<shipp->ab_count; idx++){
shipp->ABtrail_num[idx] = (short)trail_create(shipp->ab_info[idx]);
// get the point for the contrail
vm_vec_rotate(&v1, &shipp->ab_info[idx].pt, &m);
vm_vec_add2(&v1, &objp->pos);
// if the spew stamp has elapsed
if(trail_stamp_elapsed(shipp->ABtrail_num[idx])){
trail_add_segment(shipp->ABtrail_num[idx], &v1);
trail_set_stamp(shipp->ABtrail_num[idx]);
} else {
trail_set_segment(shipp->ABtrail_num[idx], &v1);
}
}
/* if( objp == Player_obj){
HUD_printf("trailnum %d", shipp->ABtrail_num[0]);
}
*/
}
}
// update active ABtrails - moving existing ones, adding new ones where necessary
void ct_update_ABtrails(ship *shipp)
{
vector v1;
matrix m;
int idx;
ship_info *sip;
object *objp;
// get object and ship info
Assert(shipp != NULL);
Assert(shipp->objnum >= 0);
Assert(shipp->ship_info_index >= 0);
objp = &Objects[shipp->objnum];
sip = &Ship_info[shipp->ship_info_index];
// get the inverse rotation matrix
vm_copy_transpose_matrix(&m, &objp->orient);
for(idx=0; idx<MAX_SHIP_CONTRAILS; idx++){
if(objp->phys_info.flags & PF_AFTERBURNER_ON){//ABtrails
if(shipp->ABtrail_num[idx] >= 0){
// get the point for the contrail
vm_vec_rotate(&v1, &shipp->ab_info[idx].pt, &m);
vm_vec_add2(&v1, &objp->pos);
// if the spew stamp has elapsed
if(trail_stamp_elapsed(shipp->ABtrail_num[idx])){
trail_add_segment(shipp->ABtrail_num[idx], &v1);
trail_set_stamp(shipp->ABtrail_num[idx]);
} else {
trail_set_segment(shipp->ABtrail_num[idx], &v1);
}
}
}
}
}
// if a ship has active ABtrails
int ct_has_ABtrails(ship *shipp)
{
int idx;
for(idx=0; idx<MAX_SHIP_CONTRAILS; idx++){
if(shipp->ABtrail_num[idx] >= 0){
return 1;
}
}
// no contrails
return 0;
}
+15 -3
View File
@@ -9,13 +9,16 @@
/*
* $Logfile: /Freespace2/code/Ship/ShipContrails.h $
* $Revision: 2.0 $
* $Date: 2002-06-03 04:02:28 $
* $Author: penguin $
* $Revision: 2.1 $
* $Date: 2002-10-19 19:29:29 $
* $Author: bobboau $
*
* all sorts of cool stuff about ships
*
* $Log: not supported by cvs2svn $
* 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
*
@@ -60,4 +63,13 @@ void ct_ship_delete(ship *shipp);
// call each frame for processing a ship's contrails
void ct_ship_process(ship *shipp);
// determine if the ship has AB trails
int ct_has_ABtrails(ship *shipp);
// update active ABtrails - moving existing ones, adding new ones where necessary
void ct_update_ABtrails(ship *shipp);
// create new ABtrails
void ct_create_ABtrails(ship *shipp);
#endif
+13 -4
View File
@@ -9,13 +9,16 @@
/*
* $Logfile: /Freespace2/code/Ship/ShipHit.cpp $
* $Revision: 2.5 $
* $Date: 2002-08-01 01:41:10 $
* $Author: penguin $
* $Revision: 2.6 $
* $Date: 2002-10-19 19:29:29 $
* $Author: bobboau $
*
* Code to deal with a ship getting hit by something, be it a missile, dog, or ship.
*
* $Log: not supported by cvs2svn $
* Revision 2.5 2002/08/01 01:41:10 penguin
* The big include file move
*
* Revision 2.4 2002/07/29 20:48:51 penguin
* Moved extern declaration of ssm_create outside of block (it wouldn't compile w/ gcc)
*
@@ -1644,6 +1647,8 @@ void ship_generic_kill_stuff( object *objp, float percent_killed )
ai_announce_ship_dying(objp);
ship_stop_fire_primary(objp); //mostly for stopping fighter beam looping sounds -Bobboau
sp->flags |= SF_DYING;
objp->phys_info.flags |= (PF_DEAD_DAMP | PF_REDUCED_DAMP);
delta_time = (int) (DEATHROLL_TIME);
@@ -2458,12 +2463,16 @@ void ship_apply_local_damage(object *ship_obj, object *other_obj, vector *hitpos
}
mprintf(("Level 2 TAGGED %s for %f seconds\n", Ships[ship_obj->instance].ship_name, Ships[ship_obj->instance].level2_tag_left));
} else if (Weapon_info[Weapons[other_obj->instance].weapon_info_index].tag_level == 3) {
// tag C creates an SSM strike, yay -Bobboau
struct ssm_firing_info;
extern void ssm_create(vector *target, vector *start, int ssm_index, ssm_firing_info *override);
HUD_sourced_printf(HUD_SOURCE_HIDDEN, XSTR( "Firing artillery", 1570));
vector temp;
vm_vec_unrotate(&temp, &ship_obj->pos, &Objects[other_obj->instance].orient);
//vm_vec_add2(&temp, &Objects[aip->artillery_objnum].pos);
ssm_create(&temp, &Objects[ship_obj->instance].pos, 0, NULL);
ssm_create(&temp, &Objects[ship_obj->instance].pos, Weapon_info[Weapons[other_obj->instance].weapon_info_index].SSM_index, NULL);
}
}
+29 -6
View File
@@ -9,14 +9,20 @@
/*
* $Logfile: /Freespace2/code/Starfield/StarField.cpp $
* $Revision: 2.1 $
* $Date: 2002-08-01 01:41:10 $
* $Author: penguin $
* $Revision: 2.3 $
* $Date: 2002-10-19 19:29:29 $
* $Author: bobboau $
*
* Code to handle and draw starfields, background space image bitmaps, floating
* debris, etc.
*
* $Log: not supported by cvs2svn $
* Revision 2.2 2002/09/20 20:05:29 phreak
* glare parser stuff in stars_init()
*
* Revision 2.1 2002/08/01 01:41:10 penguin
* The big include file move
*
* Revision 2.0 2002/06/03 04:02:29 penguin
* Warpcore CVS sync
*
@@ -358,6 +364,7 @@ void stars_init()
char filename[MAX_FILENAME_LEN+1] = "";
char glow_filename[MAX_FILENAME_LEN+1] = "";
float r, g, b, i;
int sun_glare;
// parse stars.tbl
read_file_text("stars.tbl");
@@ -432,6 +439,7 @@ void stars_init()
stuff_float(&b);
stuff_float(&i);
sun_glare=!optional_string("$NoGlare:");
if(count < MAX_STARFIELD_BITMAPS){
bm = &Sun_bitmaps[count++];
strcpy(bm->filename, filename);
@@ -445,6 +453,7 @@ void stars_init()
bm->g = g;
bm->b = b;
bm->i = i;
bm->glare=sun_glare;
// if fred is running we should lock the bitmap now
if(Fred_running){
@@ -1007,7 +1016,11 @@ void subspace_render()
Interp_subspace_offset_u = 1.0f - subspace_offset_u;
Interp_subspace_offset_v = 0.0f;
model_set_thrust( Subspace_model_inner, 1.0f, -1, Subspace_glow_bitmap, Noise[framenum] );
vector temp;
temp.xyz.x = 1.0f;
temp.xyz.y = 1.0f;
temp.xyz.z = 1.0f;
model_set_thrust( Subspace_model_inner, temp, -1, Subspace_glow_bitmap, Noise[framenum] );
render_flags |= MR_SHOW_THRUSTERS;
model_render( Subspace_model_outer, &tmp, &Eye_position, render_flags ); //MR_NO_CORRECT|MR_SHOW_OUTLINE
@@ -1019,7 +1032,12 @@ void subspace_render()
Interp_subspace_offset_u = 1.0f - subspace_offset_u;
Interp_subspace_offset_v = 0.0f;
model_set_thrust( Subspace_model_inner, 1.0f, -1, Subspace_glow_bitmap, Noise[framenum] );
vector temp;
temp.xyz.x = 1.0f;
temp.xyz.y = 1.0f;
temp.xyz.z = 1.0f;
model_set_thrust( Subspace_model_inner, temp, -1, Subspace_glow_bitmap, Noise[framenum] );
render_flags |= MR_SHOW_THRUSTERS;
model_render( Subspace_model_outer, &tmp, &Eye_position, render_flags ); //MR_NO_CORRECT|MR_SHOW_OUTLINE
@@ -1033,7 +1051,12 @@ void subspace_render()
model_set_outline_color(255,255,255);
model_set_thrust( Subspace_model_inner, 1.0f, -1, Subspace_glow_bitmap, Noise[framenum] );
// vector temp;
temp.xyz.x = 1.0f;
temp.xyz.y = 1.0f;
temp.xyz.z = 1.0f;
model_set_thrust( Subspace_model_inner, temp, -1, Subspace_glow_bitmap, Noise[framenum] );
render_flags |= MR_SHOW_THRUSTERS;
model_render( Subspace_model_inner, &tmp, &Eye_position, render_flags ); //MR_NO_CORRECT|MR_SHOW_OUTLINE
+7 -3
View File
@@ -9,14 +9,17 @@
/*
* $Logfile: /Freespace2/code/Starfield/StarField.h $
* $Revision: 2.1 $
* $Date: 2002-08-01 01:41:10 $
* $Author: penguin $
* $Revision: 2.2 $
* $Date: 2002-09-20 20:04:54 $
* $Author: phreak $
*
* Code to handle and draw starfields, background space image bitmaps, floating
* debris, etc.
*
* $Log: not supported by cvs2svn $
* Revision 2.1 2002/08/01 01:41:10 penguin
* The big include file move
*
* Revision 2.0 2002/06/03 04:02:29 penguin
* Warpcore CVS sync
*
@@ -134,6 +137,7 @@ typedef struct starfield_bitmap {
int glow_bitmap; // only for suns
int xparent;
float r, g, b, i; // only for suns
int glare; // only for suns
} starfield_bitmap;
// starfield bitmap instance
+39 -36
View File
@@ -9,13 +9,16 @@
/*
* $Logfile: /Freespace2/code/Ui/UI.H $
* $Revision: 2.1 $
* $Date: 2002-08-01 01:41:10 $
* $Revision: 2.2 $
* $Date: 2002-08-06 03:50:48 $
* $Author: penguin $
*
* Include file for our user interface.
*
* $Log: not supported by cvs2svn $
* Revision 2.1 2002/08/01 01:41:10 penguin
* The big include file move
*
* Revision 2.0 2002/06/03 04:02:29 penguin
* Warpcore CVS sync
*
@@ -379,17 +382,17 @@ class UI_DOT_SLIDER_NEW;
class UI_GADGET
{
friend UI_WINDOW;
friend UI_BUTTON;
friend UI_KEYTRAP;
friend UI_CHECKBOX;
friend UI_RADIO;
friend UI_SCROLLBAR;
friend UI_LISTBOX;
friend UI_INPUTBOX;
// friend UI_SLIDER;
friend UI_DOT_SLIDER;
friend UI_DOT_SLIDER_NEW;
friend class UI_WINDOW;
friend class UI_BUTTON;
friend class UI_KEYTRAP;
friend class UI_CHECKBOX;
friend class UI_RADIO;
friend class UI_SCROLLBAR;
friend class UI_LISTBOX;
friend class UI_INPUTBOX;
// friend class UI_SLIDER;
friend class UI_DOT_SLIDER;
friend class UI_DOT_SLIDER_NEW;
protected:
char *bm_filename;
@@ -513,10 +516,10 @@ typedef struct UI_XSTR {
class UI_BUTTON : public UI_GADGET
{
friend UI_SCROLLBAR;
// friend UI_SLIDER;
friend UI_DOT_SLIDER;
friend UI_DOT_SLIDER_NEW;
friend class UI_SCROLLBAR;
// friend class UI_SLIDER;
friend class UI_DOT_SLIDER;
friend class UI_DOT_SLIDER_NEW;
char *text;
int position; // indicates position of button (0 - up, 1 - down by mouse click 2 - down by keypress
@@ -711,8 +714,8 @@ class UI_RADIO : public UI_GADGET
class UI_SCROLLBAR : public UI_GADGET
{
friend UI_LISTBOX;
friend UI_BUTTON;
friend class UI_LISTBOX;
friend class UI_BUTTON;
int horz;
int start;
int stop;
@@ -749,7 +752,7 @@ class UI_SCROLLBAR : public UI_GADGET
class UI_SLIDER2 : public UI_GADGET
{
friend UI_BUTTON;
friend class UI_BUTTON;
private:
int numberItems; // total range
int numberPositions; // total positions (height - bitmapbuttonheight)
@@ -807,7 +810,7 @@ class UI_SLIDER2 : public UI_GADGET
// to be phased out eventually in FS2
class UI_DOT_SLIDER : public UI_GADGET
{
friend UI_BUTTON;
friend class UI_BUTTON;
UI_BUTTON button;
UI_BUTTON up_button;
@@ -827,7 +830,7 @@ class UI_DOT_SLIDER : public UI_GADGET
class UI_DOT_SLIDER_NEW : public UI_GADGET
{
friend UI_BUTTON;
friend class UI_BUTTON;
UI_BUTTON button;
UI_BUTTON up_button;
UI_BUTTON down_button;
@@ -900,19 +903,19 @@ class UI_LISTBOX : public UI_GADGET
class UI_WINDOW
{
friend UI_GADGET;
friend UI_BUTTON;
friend UI_KEYTRAP;
friend UI_CHECKBOX;
friend UI_RADIO;
friend UI_SCROLLBAR;
friend UI_LISTBOX;
friend UI_INPUTBOX;
// friend UI_SLIDER;
friend UI_SLIDER2;
friend UI_DOT_SLIDER;
friend UI_DOT_SLIDER_NEW;
friend UI_ICON;
friend class UI_GADGET;
friend class UI_BUTTON;
friend class UI_KEYTRAP;
friend class UI_CHECKBOX;
friend class UI_RADIO;
friend class UI_SCROLLBAR;
friend class UI_LISTBOX;
friend class UI_INPUTBOX;
// friend class UI_SLIDER;
friend class UI_SLIDER2;
friend class UI_DOT_SLIDER;
friend class UI_DOT_SLIDER_NEW;
friend class UI_ICON;
protected:
int flags;
@@ -1007,7 +1010,7 @@ void ui_sort_filenames( int n, char **list );
/*
class UI_SLIDER : public UI_GADGET
{
friend UI_BUTTON;
friend class UI_BUTTON;
int horz;
int position;
int window_size;
+75 -34
View File
@@ -9,13 +9,16 @@
/*
* $Logfile: /Freespace2/code/Weapon/Beam.cpp $
* $Revision: 2.3 $
* $Date: 2002-08-01 01:41:10 $
* $Author: penguin $
* $Revision: 2.4 $
* $Date: 2002-10-19 19:29:29 $
* $Author: bobboau $
*
* all sorts of cool stuff about ships
*
* $Log: not supported by cvs2svn $
* Revision 2.3 2002/08/01 01:41:10 penguin
* The big include file move
*
* Revision 2.2 2002/07/26 03:11:24 wmcoolmon
* Added Bobboau's beam tiling code
*
@@ -299,6 +302,8 @@
#include "hud/hudmessage.h"
#include "io/key.h"
#include "lighting/lighting.h"
#include "hud/hudshield.h"
// ------------------------------------------------------------------------------------------------
// BEAM WEAPON DEFINES/VARS
@@ -751,7 +756,7 @@ int beam_fire(beam_fire_info *fire_info)
// this allows it to work smoothly in multiplayer (detect "trigger down". every frame just create a targeting laser firing straight out of the
// object. this way you get all the advantages of nice rendering and collisions).
// NOTE : only references beam_info_index and shooter
int beam_fire_targeting(beam_fire_info *fire_info)
int beam_fire_targeting(fighter_beam_fire_info *fire_info)
{
beam *new_item;
weapon_info *wip;
@@ -823,6 +828,7 @@ int beam_fire_targeting(beam_fire_info *fire_info)
new_item->framecount = 0;
new_item->flags = 0;
new_item->shot_index = 0;
new_item->shrink = 1.0f;
new_item->team = (char)firing_ship->team;
// type c is a very special weapon type - binfo has no meaning
@@ -1367,8 +1373,10 @@ void beam_move_all_post()
#define R_VERTICES() do { g3_rotate_vertex(verts[0], &bottom1); g3_rotate_vertex(verts[1], &bottom2); g3_rotate_vertex(verts[2], &top2); g3_rotate_vertex(verts[3], &top1); } while(0);
#define P_VERTICES() do { for(idx=0; idx<4; idx++){ g3_project_vertex(verts[idx]); } } while(0);
int poly_beam = 0;
float U_offset =0.0f; // beam texture offset -Bobboau
void beam_render(beam_weapon_info *bwi, vector *start, vector *shot, float shrink)
{
{
mprintf(("about to render a beam\n"));
int idx, s_idx;
vertex h1[4]; // halves of a beam section
vertex *verts[4] = { &h1[0], &h1[1], &h1[2], &h1[3] };
@@ -1404,10 +1412,20 @@ void beam_render(beam_weapon_info *bwi, vector *start, vector *shot, float shrin
P_VERTICES();
STUFF_VERTICES(); // stuff the beam with creamy goodness (texture coords)
//U_offset = ( ( ((float)timestamp() * bwi->sections[s_idx].translation)/1000.0f) - (float)(timestamp() * (int)bwi->sections[s_idx].translation /1000));
length = vm_vec_dist(start, shot); // beam tileing -Bobboau
u_scale = length / bwi->sections[s_idx].width /2; // beam tileing, might make a tileing factor in beam index later -Bobboau
verts[1]->u = verts[1]->u * u_scale; // beam tileing -Bobboau
verts[2]->u = verts[2]->u * u_scale; // beam tileing -Bobboau
if (bwi->sections[s_idx].tile_type == 1){
u_scale = length / (bwi->sections[s_idx].width /2) / bwi->sections[s_idx].tile_factor; // beam tileing, might make a tileing factor in beam index later -Bobboau
}else{
u_scale = bwi->sections[s_idx].tile_factor;
}
verts[1]->u = (u_scale + (U_offset * bwi->sections[s_idx].translation)); // beam tileing -Bobboau
verts[2]->u = (u_scale + (U_offset * bwi->sections[s_idx].translation)); // beam tileing -Bobboau
verts[3]->u = (0 + (U_offset * bwi->sections[s_idx].translation));
verts[0]->u = (0 + (U_offset * bwi->sections[s_idx].translation));
// set the right texture with additive alpha, and draw the poly
gr_set_bitmap(bwi->sections[s_idx].texture, GR_ALPHABLEND_FILTER, GR_BITBLT_MODE_NORMAL, 0.9999f);
@@ -1416,6 +1434,7 @@ void beam_render(beam_weapon_info *bwi, vector *start, vector *shot, float shrin
// turn backface culling back on
gr_set_cull(1);
mprintf(("it should have rendered\n"));
}
// generate particles for the muzzle glow
@@ -1549,7 +1568,13 @@ void beam_render_muzzle_glow(beam *b)
// render all beam weapons
void beam_render_all()
{
beam *moveup;
beam *moveup;
U_offset = U_offset + flFrametime; //moves the U value of texture coods in beams if desired-Bobboau
if(U_offset > 1.0f){
U_offset = U_offset - 1.0f; //keeps it below 1.0-Bobboau
}
// traverse through all active beams
moveup = GET_FIRST(&Beam_used_list);
@@ -2268,12 +2293,14 @@ void beam_jitter_aim(beam *b, float aim)
// collide a beam with a ship, returns 1 if we can ignore all future collisions between the 2 objects
int beam_collide_ship(obj_pair *pair)
{
mprintf(("about to do beam colision\n"));
beam *b;
ship *shipp;
ship_info *sip;
mc_info test_collide;
int model_num;
float widest;
weapon_info *bwi;
// bogus
if(pair == NULL){
@@ -2319,14 +2346,15 @@ int beam_collide_ship(obj_pair *pair)
Beam_test_ship++;
#endif
shipp = &Ships[pair->b->instance];
sip = &Ship_info[shipp->ship_info_index];
// bad
Assert(pair->b->type == OBJ_SHIP);
Assert(pair->b->instance >= 0);
if((pair->b->type != OBJ_SHIP) || (pair->b->instance < 0)){
if((pair->b->type != OBJ_SHIP) || ((pair->b->instance) < 0)){
return 1;
}
shipp = &Ships[pair->b->instance];
sip = &Ship_info[shipp->ship_info_index];
// get the widest portion of the beam
widest = beam_get_widest(b);
@@ -2339,29 +2367,44 @@ int beam_collide_ship(obj_pair *pair)
test_collide.p0 = &b->last_start;
test_collide.p1 = &b->last_shot;
weapon_info * bwi = &Weapon_info[b->weapon_info_index];
bwi = &Weapon_info[b->weapon_info_index];
// maybe do a sphere line
if(widest > pair->b->radius * BEAM_AREA_PERCENT){
test_collide.radius = beam_get_widest(b) * 0.5f;
if ( get_shield_strength(&Objects[shipp->objnum]) && (bwi->b_info.beam_type == BEAM_TYPE_C) ){ //check shields for type c beams -Bobboau
//HUD_printf("BC shpere sheild");
//if the shields have any juce check them otherwise check the model
if ( (get_shield_strength(&Objects[shipp->objnum])) && (bwi->shield_factor >= 0) ){ //check shields for beams wich have a positive sheild factor -Bobboau
test_collide.flags = MC_CHECK_SHIELD | MC_CHECK_SPHERELINE;
}else{
//HUD_printf("BC shpere hull");
test_collide.flags = MC_CHECK_MODEL | MC_CHECK_SPHERELINE;
}
} else {
if ( get_shield_strength(&Objects[shipp->objnum]) && (bwi->b_info.beam_type == BEAM_TYPE_C) ){ //check shields for type c beams -Bobboau
//HUD_printf("BC ray sheild");
if ( (get_shield_strength(&Objects[shipp->objnum])) && (bwi->shield_factor >= 0) ){ //check shields for type c beams -Bobboau
test_collide.flags = MC_CHECK_SHIELD | MC_CHECK_RAY;
}else{
//HUD_printf("BC ray hull");
test_collide.flags = MC_CHECK_MODEL | MC_CHECK_RAY;
}
}
model_collide(&test_collide);
if(test_collide.flags & MC_CHECK_SHIELD){ //if we're checking sheilds
int quad = get_quadrant(&test_collide.hit_point);//find wich quadrant we hit
if(Objects[shipp->objnum].shields[quad] < (bwi->damage * bwi->shield_factor * 2.0f)){
//then if the beam does more damage than that quadrant can take
//if(!(ship_is_shield_up(&Objects[shipp->objnum], get_quadrant(&test_collide.hit_point)))){
//go through the shield and hit the hull -Bobboau
if(widest > pair->b->radius * BEAM_AREA_PERCENT){
test_collide.radius = beam_get_widest(b) * 0.5f;
test_collide.flags = MC_CHECK_MODEL | MC_CHECK_SPHERELINE;
} else {
test_collide.flags = MC_CHECK_MODEL | MC_CHECK_RAY;
}
model_collide(&test_collide);
Objects[shipp->objnum].shields[quad]=0.0f; //for good measure-Bobboau
}
}
// if we got a hit
if(test_collide.num_hits){
@@ -2378,6 +2421,7 @@ int beam_collide_ship(obj_pair *pair)
return 0;
}
// collide a beam with an asteroid, returns 1 if we can ignore all future collisions between the 2 objects
int beam_collide_asteroid(obj_pair *pair)
{
@@ -2622,15 +2666,15 @@ int beam_collide_early_out(object *a, object *b)
break;
case OBJ_ASTEROID:
// targeting lasers only hit ships
if(bwi->b_info.beam_type == BEAM_TYPE_C){
/* if(bwi->b_info.beam_type == BEAM_TYPE_C){
return 1;
}
}*/
break;
case OBJ_DEBRIS:
// targeting lasers only hit ships
if(bwi->b_info.beam_type == BEAM_TYPE_C){
/* if(bwi->b_info.beam_type == BEAM_TYPE_C){
return 1;
}
}*/
// don't ever collide with non hull pieces
if(!Debris[b->instance].is_hull){
return 1;
@@ -2638,9 +2682,9 @@ int beam_collide_early_out(object *a, object *b)
break;
case OBJ_WEAPON:
// targeting lasers only hit ships
if(bwi->b_info.beam_type == BEAM_TYPE_C){
/* if(bwi->b_info.beam_type == BEAM_TYPE_C){
return 1;
}
}*/
// don't ever collide against laser weapons - duh
if(Weapon_info[Weapons[b->instance].weapon_info_index].subtype == WP_LASER){
return 1;
@@ -2681,16 +2725,13 @@ void beam_add_collision(beam *b, object *hit_object, mc_info *cinfo)
if( (cinfo->flags & MC_CHECK_SHIELD) && cinfo->num_hits ){ //beam sheild hit code -Bobboau
quadrant_num = get_quadrant(&cinfo->hit_point);
// if (!(hit_object->flags & SF_DYING) && ship_is_shield_up(hit_object,quadrant_num) ) {
HUD_printf("you should see sheild hits");
add_shield_point(hit_object->instance, cinfo->shield_hit_tri, &cinfo->hit_point);
if (!(hit_object->flags & SF_DYING) ) {
add_shield_point(hit_object-Objects, cinfo->shield_hit_tri, &cinfo->hit_point);
bc->quadrant=quadrant_num;
// hud_shield_quadrant_hit(hit_object, quadrant_num);
// gr_printf(10, 50, "shield hit %f", quadrant_num);
// }
hud_shield_quadrant_hit(hit_object, quadrant_num);
}
}
// done
return;
}
@@ -2847,7 +2888,7 @@ void beam_handle_collisions(beam *b)
case OBJ_SHIP:
// hit the ship - again, the innards of this code handle multiplayer cases
// maybe vaporize ship.
ship_apply_local_damage(&Objects[target], &Objects[b->objnum], &b->f_collisions[idx].cinfo.hit_point_world, beam_get_ship_damage(b, &Objects[target]), -1);
ship_apply_local_damage(&Objects[target], &Objects[b->objnum], &b->f_collisions[idx].cinfo.hit_point_world, beam_get_ship_damage(b, &Objects[target]), b->f_collisions[idx].quadrant);
// if this is the first hit on the player ship. whack him
if((do_damage) && !(b->f_collisions[idx].quadrant)){ //I didn't want the beam wacking things if it's hitting just sheilds -Bobboau
+24 -4
View File
@@ -9,13 +9,16 @@
/*
* $Logfile: /Freespace2/code/Weapon/Beam.h $
* $Revision: 2.2 $
* $Date: 2002-08-01 01:41:10 $
* $Author: penguin $
* $Revision: 2.3 $
* $Date: 2002-10-19 19:29:29 $
* $Author: bobboau $
*
* all sorts of cool stuff about ships
*
* $Log: not supported by cvs2svn $
* Revision 2.2 2002/08/01 01:41:10 penguin
* The big include file move
*
* Revision 2.1 2002/07/25 04:50:48 wmcoolmon
* Added Bobboau's fighter-beam code.
*
@@ -155,6 +158,23 @@ typedef struct beam_fire_info {
int num_shots; // (optional), only used for type D weapons
} beam_fire_info;
typedef struct fighter_beam_fire_info {
int beam_info_index; // weapon info index
object *shooter; // whos shooting
vector targeting_laser_offset; // offset from the center of the object (for targeting lasers only)
ship_subsys *turret; // where he's shooting from
float accuracy; // 0.0 to 1.0 (only really effects targeting on small ships)
object *target; // whos getting shot
ship_subsys *target_subsys; // (optional), specific subsystem to be targeted on the target
beam_info *beam_info_override; // (optional), pass this in to override all beam movement info (for multiplayer)
int num_shots; // (optional), only used for type D weapons
int fighter_beam_loop_sound; //loop sound used by fighter beams -Bobboau
int warmup_stamp;
int warmdown_stamp;
float life_left;
float life_total;
} fighter_beam_fire_info;
// collision info
typedef struct beam_collision {
mc_info cinfo; // collision info
@@ -182,7 +202,7 @@ int beam_fire(beam_fire_info *fire_info);
// this allows it to work smoothly in multiplayer (detect "trigger down". every frame just create a targeting laser firing straight out of the
// object. this way you get all the advantages of nice rendering and collisions).
// NOTE : only references beam_info_index and shooter
int beam_fire_targeting(beam_fire_info *fire_info);
int beam_fire_targeting(fighter_beam_fire_info *fire_info);
// return an object index of the guy who's firing this beam
int beam_get_parent(object *bm);
+10 -3
View File
@@ -9,13 +9,16 @@
/*
* $Logfile: /Freespace2/code/Weapon/Weapon.h $
* $Revision: 2.1 $
* $Date: 2002-08-01 01:41:11 $
* $Author: penguin $
* $Revision: 2.2 $
* $Date: 2002-10-19 19:29:29 $
* $Author: bobboau $
*
* <insert description of file here>
*
* $Log: not supported by cvs2svn $
* Revision 2.1 2002/08/01 01:41:11 penguin
* The big include file move
*
* Revision 2.0 2002/06/03 04:02:29 penguin
* Warpcore CVS sync
*
@@ -418,6 +421,9 @@ typedef struct beam_weapon_section_info {
ubyte rgba_outer[4]; // for non-textured beams
float flicker; // how much it flickers (0.0 to 1.0)
float z_add; // is this necessary?
float tile_factor; // texture tile factor -Bobboau
int tile_type; // is this beam tiled by it's length, or not
float translation; // makes the beam texture move -Bobboau
} beam_weapon_section_info;
typedef struct beam_weapon_info {
@@ -528,6 +534,7 @@ typedef struct weapon_info {
// muzzle flash
int muzzle_flash; // muzzle flash stuff
int SSM_index; // wich entry in the SSM,tbl it uses -Bobboau
} weapon_info;
// Data structure to track the active missiles
+38 -8
View File
@@ -9,13 +9,19 @@
/*
* $Logfile: /Freespace2/code/Weapon/Weapons.cpp $
* $Revision: 2.1 $
* $Date: 2002-08-01 01:41:11 $
* $Author: penguin $
* $Revision: 2.3 $
* $Date: 2002-11-06 23:22:05 $
* $Author: phreak $
*
* Code to handle the weapon systems
*
* $Log: not supported by cvs2svn $
* Revision 2.2 2002/10/19 19:29:29 bobboau
* inital commit, trying to get most of my stuff into FSO, there should be most of my fighter beam, beam rendering, beam sheild hit, ABtrails, and ssm stuff. one thing you should be happy to know is the beam texture tileing is now set in the beam section section of the weapon table entry
*
* Revision 2.1 2002/08/01 01:41:11 penguin
* The big include file move
*
* Revision 2.0 2002/06/03 04:02:29 penguin
* Warpcore CVS sync
*
@@ -748,10 +754,10 @@ void parse_wi_flags(weapon_info *weaponp)
Assert(!(weaponp->wi_flags & WIF_CORKSCREW) && !(weaponp->wi_flags & WIF_FLAK));
}
// make sure flak guns are only placed on turrets
if(weaponp->wi_flags & WIF_FLAK){
Assert(weaponp->wi_flags & WIF_BIG_ONLY);
}
// make sure flak guns are only placed on turrets - commented out phreak 11/05/02
// if(weaponp->wi_flags & WIF_FLAK){
// Assert(weaponp->wi_flags & WIF_BIG_ONLY);
// }
}
// function to parse the information for a specific weapon type.
@@ -1290,6 +1296,19 @@ int parse_weapon()
required_string("+Zadd:");
stuff_float(&i.z_add);
i.tile_type = 0;
i.tile_factor = 1.0f;
if( optional_string("+Tile Factor:")){ //beam texture tileing factor -Bobboau
stuff_float(&(i.tile_factor));
stuff_int(&(i.tile_type));
}
i.translation = 0.0f;
if( optional_string("+Translation:")){ //beam texture moveing stuff -Bobboau
stuff_float(&(i.translation));
}
// maybe copy it
if(wip->b_info.beam_num_sections < MAX_BEAM_SECTIONS - 1){
wip->b_info.sections[wip->b_info.beam_num_sections++] = i;
@@ -1306,6 +1325,12 @@ int parse_weapon()
wip->wi_flags |= WIF_TAG;
}
wip->SSM_index =-1; // tag C SSM index, wich entry in the SSM table this weapon calls -Bobboau
if( optional_string("$SSM:")){
stuff_int(&wip->SSM_index);
} // SSM index -Bobboau
return 0;
}
@@ -1563,7 +1588,12 @@ void weapon_render(object *obj)
if (ft > 1.0f)
ft = 1.0f;
model_set_thrust( wip->model_num, ft, wp->thruster_bitmap, wp->thruster_glow_bitmap, wp->thruster_glow_noise);
vector temp;
temp.xyz.x = ft;
temp.xyz.y = ft;
temp.xyz.z = ft;
model_set_thrust( wip->model_num, temp, wp->thruster_bitmap, wp->thruster_glow_bitmap, wp->thruster_glow_noise);
render_flags |= MR_SHOW_THRUSTERS;
}