mirror of
https://github.com/scp-fs2open/fs2open.github.com.git
synced 2026-11-07 22:56:30 -10:00
Compare commits
8
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0744732ccb | ||
|
|
89d3aba76f | ||
|
|
a1e488a931 | ||
|
|
be6ee814c2 | ||
|
|
ea6130e542 | ||
|
|
48a566a2d5 | ||
|
|
dab5b293d4 | ||
|
|
2a2cd3c873 |
No files matched your search
@@ -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 '#'
|
||||
@@ -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".
|
||||
@@ -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
|
||||
@@ -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'
|
||||
@@ -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.
|
||||
@@ -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
|
||||
@@ -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.
|
||||
@@ -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"
|
||||
@@ -1,4 +0,0 @@
|
||||
drevil:nNwcK94cKMqZI:fs2source
|
||||
inquisitor:Jh.dOjaiO2jHk:fs2source
|
||||
anonymous:EqQXnO5cz9yBA:fs2source
|
||||
|
||||
@@ -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".
|
||||
@@ -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".
|
||||
@@ -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.
|
||||
@@ -1,3 +0,0 @@
|
||||
drevil
|
||||
inquisitor
|
||||
|
||||
@@ -0,0 +1,80 @@
|
||||
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
|
||||
+461
-125
@@ -1,6 +1,11 @@
|
||||
TARGET = libcode.a
|
||||
TARGET = fs2
|
||||
|
||||
CXXFLAGS = -DWIN32 -D_DEBUG \
|
||||
LDFLAGS = -g
|
||||
LDLIBS = -L/usr/X11R6/lib -lSDL -lGL -lGLU -lpthread
|
||||
|
||||
CXXFLAGS = \
|
||||
-g \
|
||||
-I/usr/local/include/SDL \
|
||||
-Iwindows_stub \
|
||||
-IAnim -IAsteroid -IBmpman -ICFile -ICmdline -ICMeasure -IControlConfig \
|
||||
-ICutscene -IDebris -IDebugConsole -IDirectX -IFireball -IGameHelp -IFREESPACE2 \
|
||||
@@ -8,40 +13,96 @@ CXXFLAGS = -DWIN32 -D_DEBUG \
|
||||
-ILighting -IMath -IMenuUI -IMission -IMissionUI -IModel -INetwork -IObject \
|
||||
-IObserver -IOsApi -IPalman -IParse -IParticle -IPcxUtils -IPhysics -IPlayerman \
|
||||
-IPopup -IRadar -IRender -IShip -ISound -IStarfield -IStats -ITgaUtils -IUI -IVCodec \
|
||||
-fno-exceptions \
|
||||
-IWeapon -ILocalization -INebula -IDemo -IInetfile -IExceptionHandler \
|
||||
-D_DEBUG -DNO_CD_CHECK -UNDEBUG
|
||||
-D_DEBUG -DNO_CD_CHECK -UNDEBUG \
|
||||
-DNO_DIRECT3D -DNO_SOUND -DNO_JOYSTICK -DNO_NETWORK
|
||||
|
||||
# removed from OBJFILES
|
||||
# CFile/cfile.o \
|
||||
# CFile/CfileArchive.o \
|
||||
# CFile/CfileList.o \
|
||||
# CFile/CfileSystem.o \
|
||||
|
||||
OBJFILES = \
|
||||
ANIM_OBJFILES = \
|
||||
Anim/animplay.o \
|
||||
Anim/packunpack.o \
|
||||
Asteroid/asteroid.o \
|
||||
Bmpman/bmpman.o \
|
||||
Cmdline/cmdline.o \
|
||||
CMeasure/cmeasure.o \
|
||||
Anim/packunpack.o
|
||||
|
||||
ASTEROID_OBJFILES = \
|
||||
Asteroid/asteroid.o
|
||||
|
||||
BMPMAN_OBJFILES = \
|
||||
Bmpman/bmpman.o
|
||||
|
||||
CFILE_OBJFILES = \
|
||||
CFile/cfile.o \
|
||||
CFile/cfilearchive.o \
|
||||
CFile/cfilelist.o \
|
||||
CFile/cfilesystem.o
|
||||
|
||||
CMDLINE_OBJFILES = \
|
||||
Cmdline/cmdline.o
|
||||
|
||||
CMEASURE_OBJFILES = \
|
||||
CMeasure/cmeasure.o
|
||||
|
||||
CONTROLCONFIG_OBJFILES = \
|
||||
ControlConfig/controlsconfig.o \
|
||||
ControlConfig/controlsconfigcommon.o \
|
||||
Cutscene/cutscenes.o \
|
||||
Debris/debris.o \
|
||||
DebugConsole/console.o \
|
||||
ControlConfig/controlsconfigcommon.o
|
||||
|
||||
CUTSCENE_OBJFILES = \
|
||||
Cutscene/cutscenes.o
|
||||
|
||||
DEBRIS_OBJFILES = \
|
||||
Debris/debris.o
|
||||
|
||||
DEBUGCONSOLE_OBJFILES = \
|
||||
DebugConsole/console.o
|
||||
|
||||
DEMO_OBJFILES = \
|
||||
Demo/demo.o
|
||||
|
||||
EXCEPTIONHANDLER_OBJFILES = \
|
||||
ExceptionHandler/exceptionhandler.o
|
||||
|
||||
FIREBALL_OBJFILES = \
|
||||
Fireball/fireballs.o \
|
||||
Fireball/warpineffect.o \
|
||||
Fireball/warpineffect.o
|
||||
|
||||
GAMEHELP_OBJFILES = \
|
||||
GameHelp/contexthelp.o \
|
||||
GameHelp/gameplayhelp.o \
|
||||
GameSequence/gamesequence.o \
|
||||
Gamesnd/eventmusic.o \
|
||||
Gamesnd/gamesnd.o \
|
||||
Glide/glide.o \
|
||||
GameHelp/gameplayhelp.o
|
||||
|
||||
GAMESEQUENCE_OBJFILES = \
|
||||
GameSequence/gamesequence.o
|
||||
|
||||
# Gamesnd/eventmusic.o
|
||||
# Gamesnd/gamesnd.o
|
||||
GAMESND_OBJFILES =
|
||||
|
||||
GLIDE_OBJFILES =
|
||||
#GLIDE_OBJFILES = \
|
||||
# Glide/glide.o
|
||||
|
||||
# GlobalIncs/windebug.o
|
||||
GLOBALINCS_OBJFILES = \
|
||||
GlobalIncs/alphacolors.o \
|
||||
GlobalIncs/crypt.o \
|
||||
GlobalIncs/systemvars.o \
|
||||
GlobalIncs/version.o \
|
||||
GlobalIncs/windebug.o \
|
||||
GlobalIncs/version.o
|
||||
|
||||
# Graphics/grd3d.o
|
||||
# Graphics/grd3drender.o
|
||||
# Graphics/grd3dtexture.o
|
||||
# Graphics/grdirectdraw.o
|
||||
# Graphics/grglide.o
|
||||
# Graphics/grglidetexture.o
|
||||
# Graphics/grsoft.o
|
||||
# Graphics/scaler.o
|
||||
# Graphics/tmapgenericscans.o
|
||||
# Graphics/tmapscantiled128x128.o
|
||||
# Graphics/tmapscantiled16x16.o
|
||||
# Graphics/tmapscantiled256x256.o
|
||||
# Graphics/tmapscantiled32x32.o
|
||||
# Graphics/tmapscantiled64x64.o
|
||||
# Graphics/tmapscanline.o
|
||||
# Graphics/tmapper.o
|
||||
GRAPHICS_OBJFILES = \
|
||||
Graphics/2d.o \
|
||||
Graphics/aaline.o \
|
||||
Graphics/bitblt.o \
|
||||
@@ -49,28 +110,15 @@ OBJFILES = \
|
||||
Graphics/colors.o \
|
||||
Graphics/font.o \
|
||||
Graphics/gradient.o \
|
||||
Graphics/grd3d.o \
|
||||
Graphics/grd3drender.o \
|
||||
Graphics/grd3dtexture.o \
|
||||
Graphics/grdirectdraw.o \
|
||||
Graphics/grglide.o \
|
||||
Graphics/grglidetexture.o \
|
||||
Graphics/gropengl.o \
|
||||
Graphics/grsoft.o \
|
||||
Graphics/grzbuffer.o \
|
||||
Graphics/line.o \
|
||||
Graphics/pixel.o \
|
||||
Graphics/rect.o \
|
||||
Graphics/scaler.o \
|
||||
Graphics/shade.o \
|
||||
Graphics/tmapgenericscans.o \
|
||||
Graphics/tmapper.o \
|
||||
Graphics/tmapscanline.o \
|
||||
Graphics/tmapscantiled128x128.o \
|
||||
Graphics/tmapscantiled16x16.o \
|
||||
Graphics/tmapscantiled256x256.o \
|
||||
Graphics/tmapscantiled32x32.o \
|
||||
Graphics/tmapscantiled64x64.o \
|
||||
Graphics/shade.o
|
||||
|
||||
# Hud/hudobserver.o
|
||||
HUD_OBJFILES = \
|
||||
Hud/hud.o \
|
||||
Hud/hudartillery.o \
|
||||
Hud/hudbrackets.o \
|
||||
@@ -79,40 +127,61 @@ OBJFILES = \
|
||||
Hud/hudets.o \
|
||||
Hud/hudlock.o \
|
||||
Hud/hudmessage.o \
|
||||
Hud/hudobserver.o \
|
||||
Hud/hudreticle.o \
|
||||
Hud/hudshield.o \
|
||||
Hud/hudsquadmsg.o \
|
||||
Hud/hudtarget.o \
|
||||
Hud/hudtargetbox.o \
|
||||
Hud/hudwingmanstatus.o \
|
||||
Io/joy.o \
|
||||
Io/joy_ff.o \
|
||||
Hud/hudwingmanstatus.o
|
||||
|
||||
INETFILE_OBJFILES = \
|
||||
Inetfile/cftp.o \
|
||||
Inetfile/chttpget.o \
|
||||
Inetfile/inetgetfile.o
|
||||
|
||||
# Io/joy.o
|
||||
# Io/joy_ff.o
|
||||
# Io/swff_lib.o
|
||||
IO_OBJFILES = \
|
||||
Io/key.o \
|
||||
Io/keycontrol.o \
|
||||
Io/mouse.o \
|
||||
Io/swff_lib.o \
|
||||
Io/timer.o \
|
||||
JumpNode/jumpnode.o \
|
||||
Lighting/lighting.o \
|
||||
Io/xmouse.o
|
||||
|
||||
JUMPNODE_OBJFILES = \
|
||||
JumpNode/jumpnode.o
|
||||
|
||||
LIGHTING_OBJFILES = \
|
||||
Lighting/lighting.o
|
||||
|
||||
LOCALIZATION_OBJFILES = \
|
||||
Localization/fhash.o \
|
||||
Localization/localize.o
|
||||
|
||||
MATH_OBJFILES = \
|
||||
Math/fix.o \
|
||||
Math/floating.o \
|
||||
Math/fvi.o \
|
||||
Math/spline.o \
|
||||
Math/staticrand.o \
|
||||
Math/vecmat.o \
|
||||
Math/vecmat.o
|
||||
|
||||
# MenuUI/optionsmenumulti.o
|
||||
MENUUI_OBJFILES = \
|
||||
MenuUI/barracks.o \
|
||||
MenuUI/credits.o \
|
||||
MenuUI/fishtank.o \
|
||||
MenuUI/mainhallmenu.o \
|
||||
MenuUI/mainhalltemp.o \
|
||||
MenuUI/optionsmenu.o \
|
||||
MenuUI/optionsmenumulti.o \
|
||||
MenuUI/playermenu.o \
|
||||
MenuUI/readyroom.o \
|
||||
MenuUI/snazzyui.o \
|
||||
MenuUI/techmenu.o \
|
||||
MenuUI/trainingmenu.o \
|
||||
MenuUI/trainingmenu.o
|
||||
|
||||
MISSION_OBJFILES = \
|
||||
Mission/missionbriefcommon.o \
|
||||
Mission/missioncampaign.o \
|
||||
Mission/missiongoals.o \
|
||||
@@ -122,8 +191,10 @@ OBJFILES = \
|
||||
Mission/missionlog.o \
|
||||
Mission/missionmessage.o \
|
||||
Mission/missionparse.o \
|
||||
Mission/missiontraining.o \
|
||||
MissionUI/chatbox.o \
|
||||
Mission/missiontraining.o
|
||||
|
||||
# MissionUI/chatbox.o
|
||||
MISSIONUI_OBJFILES = \
|
||||
MissionUI/missionbrief.o \
|
||||
MissionUI/missioncmdbrief.o \
|
||||
MissionUI/missiondebrief.o \
|
||||
@@ -134,11 +205,52 @@ OBJFILES = \
|
||||
MissionUI/missionshipchoice.o \
|
||||
MissionUI/missionstats.o \
|
||||
MissionUI/missionweaponchoice.o \
|
||||
MissionUI/redalert.o \
|
||||
MissionUI/redalert.o
|
||||
|
||||
MODEL_OBJFILES = \
|
||||
Model/modelcollide.o \
|
||||
Model/modelinterp.o \
|
||||
Model/modeloctant.o \
|
||||
Model/modelread.o \
|
||||
Model/modelread.o
|
||||
|
||||
NEBULA_OBJFILES = \
|
||||
Nebula/neb.o \
|
||||
Nebula/neblightning.o
|
||||
|
||||
# Network/multi.o
|
||||
# Network/multi_campaign.o
|
||||
# Network/multi_data.o
|
||||
# Network/multi_dogfight.o
|
||||
# Network/multi_endgame.o
|
||||
# Network/multi_ingame.o
|
||||
# Network/multi_kick.o
|
||||
# Network/multi_log.o
|
||||
# Network/multimsgs.o
|
||||
# Network/multi_obj.o
|
||||
# Network/multi_observer.o
|
||||
# Network/multi_oo.o
|
||||
# Network/multi_options.o
|
||||
# Network/multi_pause.o
|
||||
# Network/multi_pinfo.o
|
||||
# Network/multi_ping.o
|
||||
# Network/multi_pmsg.o
|
||||
# Network/multi_rate.o
|
||||
# Network/multi_respawn.o
|
||||
# Network/multi_team.o
|
||||
# Network/multi_update.o
|
||||
# Network/multi_voice.o
|
||||
# Network/multi_xfer.o
|
||||
# Network/multilag.o
|
||||
# Network/multiteamselect.o
|
||||
# Network/multiui.o
|
||||
# Network/psnet.o
|
||||
# Network/psnet2.o
|
||||
# Network/stand_gui.o
|
||||
NETWORK_OBJFILES = \
|
||||
Network/multiutil.o
|
||||
|
||||
# Object/objectsnd.o
|
||||
OBJECT_OBJFILES = \
|
||||
Object/collidedebrisship.o \
|
||||
Object/collidedebrisweapon.o \
|
||||
Object/collideshipship.o \
|
||||
@@ -146,29 +258,52 @@ OBJFILES = \
|
||||
Object/collideweaponweapon.o \
|
||||
Object/objcollide.o \
|
||||
Object/object.o \
|
||||
Object/objectsnd.o \
|
||||
Object/objectsort.o \
|
||||
Observer/observer.o \
|
||||
OsApi/osapi.o \
|
||||
OsApi/osregistry.o \
|
||||
OsApi/outwnd.o \
|
||||
Palman/palman.o \
|
||||
Object/objectsort.o
|
||||
|
||||
OBSERVER_OBJFILES = \
|
||||
Observer/observer.o
|
||||
|
||||
OSAPI_OBJFILES = \
|
||||
OsApi/osapi_unix.o \
|
||||
OsApi/osregistry_unix.o \
|
||||
OsApi/outwnd_unix.o
|
||||
|
||||
PALMAN_OBJFILES = \
|
||||
Palman/palman.o
|
||||
|
||||
PARSE_OBJFILES = \
|
||||
Parse/encrypt.o \
|
||||
Parse/parselo.o \
|
||||
Parse/sexp.o \
|
||||
Particle/particle.o \
|
||||
PcxUtils/pcxutils.o \
|
||||
Physics/physics.o \
|
||||
Parse/sexp.o
|
||||
|
||||
PARTICLE_OBJFILES = \
|
||||
Particle/particle.o
|
||||
|
||||
PCXUTILS_OBJFILES = \
|
||||
PcxUtils/pcxutils.o
|
||||
|
||||
PHYSICS_OBJFILES = \
|
||||
Physics/physics.o
|
||||
|
||||
PLAYERMAN_OBJFILES = \
|
||||
Playerman/managepilot.o \
|
||||
Playerman/playercontrol.o \
|
||||
Playerman/playercontrol.o
|
||||
|
||||
POPUP_OBJFILES = \
|
||||
Popup/popup.o \
|
||||
Popup/popupdead.o \
|
||||
Radar/radar.o \
|
||||
Popup/popupdead.o
|
||||
|
||||
RADAR_OBJFILES = \
|
||||
Radar/radar.o
|
||||
|
||||
RENDER_OBJFILES = \
|
||||
Render/3dclipper.o \
|
||||
Render/3ddraw.o \
|
||||
Render/3dlaser.o \
|
||||
Render/3dmath.o \
|
||||
Render/3dsetup.o \
|
||||
Render/3dsetup.o
|
||||
|
||||
SHIP_OBJFILES = \
|
||||
Ship/afterburner.o \
|
||||
Ship/ai.o \
|
||||
Ship/aibig.o \
|
||||
@@ -179,7 +314,9 @@ OBJFILES = \
|
||||
Ship/ship.o \
|
||||
Ship/shipcontrails.o \
|
||||
Ship/shipfx.o \
|
||||
Ship/shiphit.o \
|
||||
Ship/shiphit.o
|
||||
|
||||
SOUND_OBJFILES = \
|
||||
Sound/acm.o \
|
||||
Sound/audiostr.o \
|
||||
Sound/ds.o \
|
||||
@@ -190,13 +327,22 @@ OBJFILES = \
|
||||
Sound/rtvoice.o \
|
||||
Sound/sound.o \
|
||||
Sound/winmidi.o \
|
||||
Sound/winmidi_base.o \
|
||||
Sound/winmidi_base.o
|
||||
|
||||
STARFIELD_OBJFILES = \
|
||||
Starfield/nebula.o \
|
||||
Starfield/starfield.o \
|
||||
Starfield/supernova.o \
|
||||
Starfield/supernova.o
|
||||
|
||||
STATS_OBJFILES = \
|
||||
Stats/medals.o \
|
||||
Stats/scoring.o \
|
||||
Stats/stats.o \
|
||||
Stats/stats.o
|
||||
|
||||
TGAUTILS_OBJFILES = \
|
||||
TgaUtils/tgautils.o
|
||||
|
||||
UI_OBJFILES = \
|
||||
UI/button.o \
|
||||
UI/checkbox.o \
|
||||
UI/gadget.o \
|
||||
@@ -210,8 +356,12 @@ OBJFILES = \
|
||||
UI/slider2.o \
|
||||
UI/uidraw.o \
|
||||
UI/uimouse.o \
|
||||
UI/window.o \
|
||||
VCodec/codec1.o \
|
||||
UI/window.o
|
||||
|
||||
VCODEC_OBJFILES = \
|
||||
VCodec/codec1.o
|
||||
|
||||
WEAPON_OBJFILES = \
|
||||
Weapon/beam.o \
|
||||
Weapon/corkscrew.o \
|
||||
Weapon/emp.o \
|
||||
@@ -220,66 +370,252 @@ OBJFILES = \
|
||||
Weapon/shockwave.o \
|
||||
Weapon/swarm.o \
|
||||
Weapon/trails.o \
|
||||
Weapon/weapons.o \
|
||||
Nebula/neb.o \
|
||||
Nebula/neblightning.o \
|
||||
Localization/fhash.o \
|
||||
Localization/localize.o \
|
||||
TgaUtils/tgautils.o \
|
||||
Demo/demo.o \
|
||||
Inetfile/cftp.o \
|
||||
Inetfile/chttpget.o \
|
||||
Inetfile/inetgetfile.o \
|
||||
ExceptionHandler/exceptionhandler.o \
|
||||
Network/multi.o \
|
||||
Network/multi_campaign.o \
|
||||
Network/multi_data.o \
|
||||
Network/multi_dogfight.o \
|
||||
Network/multi_endgame.o \
|
||||
Network/multi_ingame.o \
|
||||
Network/multi_kick.o \
|
||||
Network/multi_log.o \
|
||||
Network/multi_obj.o \
|
||||
Network/multi_observer.o \
|
||||
Network/multi_oo.o \
|
||||
Network/multi_options.o \
|
||||
Network/multi_pause.o \
|
||||
Network/multi_pinfo.o \
|
||||
Network/multi_ping.o \
|
||||
Network/multi_pmsg.o \
|
||||
Network/multi_rate.o \
|
||||
Network/multi_respawn.o \
|
||||
Network/multi_team.o \
|
||||
Network/multi_update.o \
|
||||
Network/multi_voice.o \
|
||||
Network/multi_xfer.o \
|
||||
Network/multilag.o \
|
||||
Network/multimsgs.o \
|
||||
Network/multiteamselect.o \
|
||||
Network/multiui.o \
|
||||
Network/multiutil.o \
|
||||
Network/psnet.o \
|
||||
Network/psnet2.o \
|
||||
Network/stand_gui.o
|
||||
Weapon/weapons.o
|
||||
|
||||
# SOUND_OBJFILES
|
||||
# INETFILE_OBJFILES
|
||||
# EXCEPTIONHANDLER_OBJFILES
|
||||
OBJFILES = \
|
||||
ANIM_OBJFILES \
|
||||
ASTEROID_OBJFILES \
|
||||
BMPMAN_OBJFILES \
|
||||
CFILE_OBJFILES \
|
||||
CMDLINE_OBJFILES \
|
||||
CMEASURE_OBJFILES \
|
||||
CONTROLCONFIG_OBJFILES \
|
||||
CUTSCENE_OBJFILES \
|
||||
DEBRIS_OBJFILES \
|
||||
DEBUGCONSOLE_OBJFILES \
|
||||
FIREBALL_OBJFILES \
|
||||
GAMEHELP_OBJFILES \
|
||||
GAMESEQUENCE_OBJFILES \
|
||||
GAMESND_OBJFILES \
|
||||
GLIDE_OBJFILES \
|
||||
GLOBALINCS_OBJFILES \
|
||||
GRAPHICS_OBJFILES \
|
||||
HUD_OBJFILES \
|
||||
IO_OBJFILES \
|
||||
JUMPNODE_OBJFILES \
|
||||
LIGHTING_OBJFILES \
|
||||
MATH_OBJFILES \
|
||||
MENUUI_OBJFILES \
|
||||
MISSION_OBJFILES \
|
||||
MISSIONUI_OBJFILES \
|
||||
MODEL_OBJFILES \
|
||||
NETWORK_OBJFILES \
|
||||
OBJECT_OBJFILES \
|
||||
OBSERVER_OBJFILES \
|
||||
OSAPI_OBJFILES \
|
||||
PALMAN_OBJFILES \
|
||||
PARSE_OBJFILES \
|
||||
PARTICLE_OBJFILES \
|
||||
PCXUTILS_OBJFILES \
|
||||
PHYSICS_OBJFILES \
|
||||
PLAYERMAN_OBJFILES \
|
||||
POPUP_OBJFILES \
|
||||
RADAR_OBJFILES \
|
||||
RENDER_OBJFILES \
|
||||
SHIP_OBJFILES \
|
||||
STARFIELD_OBJFILES \
|
||||
STATS_OBJFILES \
|
||||
UI_OBJFILES \
|
||||
VCODEC_OBJFILES \
|
||||
WEAPON_OBJFILES \
|
||||
NEBULA_OBJFILES \
|
||||
LOCALIZATION_OBJFILES \
|
||||
TGAUTILS_OBJFILES \
|
||||
DEMO_OBJFILES
|
||||
|
||||
# SOUND_OBJFILES
|
||||
# INETFILE_OBJFILES
|
||||
# EXCEPTIONHANDLER_OBJFILES
|
||||
LIB_OBJFILES = \
|
||||
$(ANIM_OBJFILES) \
|
||||
$(ASTEROID_OBJFILES) \
|
||||
$(BMPMAN_OBJFILES) \
|
||||
$(CFILE_OBJFILES) \
|
||||
$(CMDLINE_OBJFILES) \
|
||||
$(CMEASURE_OBJFILES) \
|
||||
$(CONTROLCONFIG_OBJFILES) \
|
||||
$(CUTSCENE_OBJFILES) \
|
||||
$(DEBRIS_OBJFILES) \
|
||||
$(DEBUGCONSOLE_OBJFILES) \
|
||||
$(FIREBALL_OBJFILES) \
|
||||
$(GAMEHELP_OBJFILES) \
|
||||
$(GAMESEQUENCE_OBJFILES) \
|
||||
$(GAMESND_OBJFILES) \
|
||||
$(GLIDE_OBJFILES) \
|
||||
$(GLOBALINCS_OBJFILES) \
|
||||
$(GRAPHICS_OBJFILES) \
|
||||
$(HUD_OBJFILES) \
|
||||
$(IO_OBJFILES) \
|
||||
$(JUMPNODE_OBJFILES) \
|
||||
$(LIGHTING_OBJFILES) \
|
||||
$(MATH_OBJFILES) \
|
||||
$(MENUUI_OBJFILES) \
|
||||
$(MISSION_OBJFILES) \
|
||||
$(MISSIONUI_OBJFILES) \
|
||||
$(MODEL_OBJFILES) \
|
||||
$(NETWORK_OBJFILES) \
|
||||
$(OBJECT_OBJFILES) \
|
||||
$(OBSERVER_OBJFILES) \
|
||||
$(OSAPI_OBJFILES) \
|
||||
$(PALMAN_OBJFILES) \
|
||||
$(PARSE_OBJFILES) \
|
||||
$(PARTICLE_OBJFILES) \
|
||||
$(PCXUTILS_OBJFILES) \
|
||||
$(PHYSICS_OBJFILES) \
|
||||
$(PLAYERMAN_OBJFILES) \
|
||||
$(POPUP_OBJFILES) \
|
||||
$(RADAR_OBJFILES) \
|
||||
$(RENDER_OBJFILES) \
|
||||
$(SHIP_OBJFILES) \
|
||||
$(STARFIELD_OBJFILES) \
|
||||
$(STATS_OBJFILES) \
|
||||
$(UI_OBJFILES) \
|
||||
$(VCODEC_OBJFILES) \
|
||||
$(WEAPON_OBJFILES) \
|
||||
$(NEBULA_OBJFILES) \
|
||||
$(LOCALIZATION_OBJFILES) \
|
||||
$(TGAUTILS_OBJFILES) \
|
||||
$(DEMO_OBJFILES)
|
||||
|
||||
FREESPACE2_OBJFILES = \
|
||||
FREESPACE2/freespace.o \
|
||||
FREESPACE2/levelpaging.o
|
||||
|
||||
STUB_OBJFILES = \
|
||||
windows_stub/stubs.o
|
||||
|
||||
# ==============================
|
||||
.PHONY: all clean code
|
||||
.PHONY: all clean code \
|
||||
ANIM_OBJFILES \
|
||||
ASTEROID_OBJFILES \
|
||||
BMPMAN_OBJFILES \
|
||||
CMDLINE_OBJFILES \
|
||||
CMEASURE_OBJFILES \
|
||||
CONTROLCONFIG_OBJFILES \
|
||||
CUTSCENE_OBJFILES \
|
||||
DEBRIS_OBJFILES \
|
||||
DEBUGCONSOLE_OBJFILES \
|
||||
FIREBALL_OBJFILES \
|
||||
GAMEHELP_OBJFILES \
|
||||
GAMESEQUENCE_OBJFILES \
|
||||
GAMESND_OBJFILES \
|
||||
GLIDE_OBJFILES \
|
||||
GLOBALINCS_OBJFILES \
|
||||
GRAPHICS_OBJFILES \
|
||||
HUD_OBJFILES \
|
||||
IO_OBJFILES \
|
||||
JUMPNODE_OBJFILES \
|
||||
LIGHTING_OBJFILES \
|
||||
MATH_OBJFILES \
|
||||
MENUUI_OBJFILES \
|
||||
MISSION_OBJFILES \
|
||||
MISSIONUI_OBJFILES \
|
||||
MODEL_OBJFILES \
|
||||
OBJECT_OBJFILES \
|
||||
OBSERVER_OBJFILES \
|
||||
OSAPI_OBJFILES \
|
||||
PALMAN_OBJFILES \
|
||||
PARSE_OBJFILES \
|
||||
PARTICLE_OBJFILES \
|
||||
PCXUTILS_OBJFILES \
|
||||
PHYSICS_OBJFILES \
|
||||
PLAYERMAN_OBJFILES \
|
||||
POPUP_OBJFILES \
|
||||
RADAR_OBJFILES \
|
||||
RENDER_OBJFILES \
|
||||
SHIP_OBJFILES \
|
||||
SOUND_OBJFILES \
|
||||
STARFIELD_OBJFILES \
|
||||
STATS_OBJFILES \
|
||||
UI_OBJFILES \
|
||||
VCODEC_OBJFILES \
|
||||
WEAPON_OBJFILES \
|
||||
NEBULA_OBJFILES \
|
||||
LOCALIZATION_OBJFILES \
|
||||
TGAUTILS_OBJFILES \
|
||||
DEMO_OBJFILES \
|
||||
INETFILE_OBJFILES \
|
||||
EXCEPTIONHANDLER_OBJFILES \
|
||||
NETWORK_OBJFILES
|
||||
|
||||
.cpp.o:
|
||||
$(CXX) $(CXXFLAGS) -E $< > $@
|
||||
# $(CXX) $(CXXFLAGS) -c $<
|
||||
$(CXX) $(CXXFLAGS) -c -o $@ $<
|
||||
|
||||
|
||||
all: $(TARGET)
|
||||
|
||||
clean:
|
||||
rm -f $(TARGET) core *.o *~
|
||||
rm -f $(TARGET) libcode.a core *.o *~
|
||||
find -name *.o -exec rm {} \;
|
||||
find -name *~ -exec rm {} \;
|
||||
|
||||
code: $(TARGET)
|
||||
code: libcode.a
|
||||
|
||||
|
||||
# ==============================
|
||||
libcode.a: $(OBJFILES)
|
||||
libcode.a: $(LIB_OBJFILES)
|
||||
$(AR) -r $@ $(LIB_OBJFILES)
|
||||
# $(CXX) -o $@ $(LIB_OBJFILES)
|
||||
|
||||
fs2: libcode.a $(FREESPACE2_OBJFILES) $(STUB_OBJFILES)
|
||||
$(CXX) $(LDFLAGS) -o $@ $(FREESPACE2_OBJFILES) $(STUB_OBJFILES) $(LDLIBS) -L. -lcode
|
||||
|
||||
|
||||
# exceptions to the rule...
|
||||
FREESPACE2/freespace.o: FREESPACE2/freespace.cpp
|
||||
$(CXX) $(CXXFLAGS) -fexceptions -c -o $@ $<
|
||||
|
||||
ANIM_OBJFILES: $(ANIM_OBJFILES)
|
||||
ASTEROID_OBJFILES: $(ASTEROID_OBJFILES)
|
||||
BMPMAN_OBJFILES: $(BMPMAN_OBJFILES)
|
||||
CMDLINE_OBJFILES: $(CMDLINE_OBJFILES)
|
||||
CMEASURE_OBJFILES: $(CMEASURE_OBJFILES)
|
||||
CONTROLCONFIG_OBJFILES: $(CONTROLCONFIG_OBJFILES)
|
||||
CUTSCENE_OBJFILES: $(CUTSCENE_OBJFILES)
|
||||
DEBRIS_OBJFILES: $(DEBRIS_OBJFILES)
|
||||
DEBUGCONSOLE_OBJFILES: $(DEBUGCONSOLE_OBJFILES)
|
||||
FIREBALL_OBJFILES: $(FIREBALL_OBJFILES)
|
||||
GAMEHELP_OBJFILES: $(GAMEHELP_OBJFILES)
|
||||
GAMESEQUENCE_OBJFILES: $(GAMESEQUENCE_OBJFILES)
|
||||
GAMESND_OBJFILES: $(GAMESND_OBJFILES)
|
||||
GLIDE_OBJFILES: $(GLIDE_OBJFILES)
|
||||
GLOBALINCS_OBJFILES: $(GLOBALINCS_OBJFILES)
|
||||
GRAPHICS_OBJFILES: $(GRAPHICS_OBJFILES)
|
||||
HUD_OBJFILES: $(HUD_OBJFILES)
|
||||
IO_OBJFILES: $(IO_OBJFILES)
|
||||
JUMPNODE_OBJFILES: $(JUMPNODE_OBJFILES)
|
||||
LIGHTING_OBJFILES: $(LIGHTING_OBJFILES)
|
||||
MATH_OBJFILES: $(MATH_OBJFILES)
|
||||
MENUUI_OBJFILES: $(MENUUI_OBJFILES)
|
||||
MISSION_OBJFILES: $(MISSION_OBJFILES)
|
||||
MISSIONUI_OBJFILES: $(MISSIONUI_OBJFILES)
|
||||
MODEL_OBJFILES: $(MODEL_OBJFILES)
|
||||
OBJECT_OBJFILES: $(OBJECT_OBJFILES)
|
||||
OBSERVER_OBJFILES: $(OBSERVER_OBJFILES)
|
||||
OSAPI_OBJFILES: $(OSAPI_OBJFILES)
|
||||
PALMAN_OBJFILES: $(PALMAN_OBJFILES)
|
||||
PARSE_OBJFILES: $(PARSE_OBJFILES)
|
||||
PARTICLE_OBJFILES: $(PARTICLE_OBJFILES)
|
||||
PCXUTILS_OBJFILES: $(PCXUTILS_OBJFILES)
|
||||
PHYSICS_OBJFILES: $(PHYSICS_OBJFILES)
|
||||
PLAYERMAN_OBJFILES: $(PLAYERMAN_OBJFILES)
|
||||
POPUP_OBJFILES: $(POPUP_OBJFILES)
|
||||
RADAR_OBJFILES: $(RADAR_OBJFILES)
|
||||
RENDER_OBJFILES: $(RENDER_OBJFILES)
|
||||
SHIP_OBJFILES: $(SHIP_OBJFILES)
|
||||
SOUND_OBJFILES: $(SOUND_OBJFILES)
|
||||
STARFIELD_OBJFILES: $(STARFIELD_OBJFILES)
|
||||
STATS_OBJFILES: $(STATS_OBJFILES)
|
||||
UI_OBJFILES: $(UI_OBJFILES)
|
||||
VCODEC_OBJFILES: $(VCODEC_OBJFILES)
|
||||
WEAPON_OBJFILES: $(WEAPON_OBJFILES)
|
||||
NEBULA_OBJFILES: $(NEBULA_OBJFILES)
|
||||
LOCALIZATION_OBJFILES: $(LOCALIZATION_OBJFILES)
|
||||
TGAUTILS_OBJFILES: $(TGAUTILS_OBJFILES)
|
||||
DEMO_OBJFILES: $(DEMO_OBJFILES)
|
||||
INETFILE_OBJFILES: $(INETFILE_OBJFILES)
|
||||
EXCEPTIONHANDLER_OBJFILES: $(EXCEPTIONHANDLER_OBJFILES)
|
||||
NETWORK_OBJFILES: $(NETWORK_OBJFILES)
|
||||
@@ -9,8 +9,8 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Anim/AnimPlay.cpp $
|
||||
* $Revision: 1.1 $
|
||||
* $Date: 2002-06-03 03:25:56 $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:21 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
* C module for playing back anim files
|
||||
|
||||
@@ -9,13 +9,16 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Anim/AnimPlay.h $
|
||||
* $Revision: 1.1 $
|
||||
* $Date: 2002-06-03 03:25:56 $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:21 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
* Header file for playing back anim files
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 1.2 2002/05/03 22:07:07 mharris
|
||||
* got some stuff to compile
|
||||
*
|
||||
* Revision 1.1 2002/05/02 18:03:04 mharris
|
||||
* Initial checkin - converted filenames and includes to lower case
|
||||
*
|
||||
@@ -96,6 +99,8 @@
|
||||
#ifndef __ANIMPLAY_H__
|
||||
#define __ANIMPLAY_H__
|
||||
|
||||
#include "pstypes.h"
|
||||
|
||||
struct anim;
|
||||
struct anim_info;
|
||||
struct anim_instance;
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Anim/PackUnpack.cpp $
|
||||
* $Revision: 1.1 $
|
||||
* $Date: 2002-06-03 03:25:56 $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:21 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
* Code for handling packing and unpacking in Hoffoss's RLE format, used for
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Anim/PackUnpack.h $
|
||||
* $Revision: 1.1 $
|
||||
* $Date: 2002-06-03 03:25:56 $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:21 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
* Code for handling packing and unpacking in Hoffoss's RLE format, used for
|
||||
@@ -18,6 +18,9 @@
|
||||
* utilizing an Anim), and getting getting frames of the Anim.
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 1.2 2002/05/03 22:07:07 mharris
|
||||
* got some stuff to compile
|
||||
*
|
||||
* Revision 1.1 2002/05/02 18:03:04 mharris
|
||||
* Initial checkin - converted filenames and includes to lower case
|
||||
*
|
||||
@@ -195,7 +198,7 @@ typedef struct anim {
|
||||
int file_offset; // file offset to start of frame data
|
||||
int cache_file_offset;
|
||||
ubyte *cache;
|
||||
} anim;
|
||||
} anim_t;
|
||||
|
||||
// the direction to play the anim (forwards or backwards)
|
||||
#define ANIM_DIRECT_FORWARD 0
|
||||
@@ -227,7 +230,7 @@ typedef struct anim_instance {
|
||||
int paused; // pause the anim
|
||||
int file_offset; // current offset into frame (like data, put offset into file)
|
||||
int loop_count; // starts at 0, and is incremented each time it loops
|
||||
} anim_instance;
|
||||
} anim_instance_t;
|
||||
|
||||
extern int packer_code;
|
||||
|
||||
|
||||
@@ -9,13 +9,19 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Asteroid/Asteroid.cpp $
|
||||
* $Revision: 1.1 $
|
||||
* $Date: 2002-06-03 03:25:56 $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:21 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
* C module for asteroid code
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 1.3 2002/05/10 20:42:43 mharris
|
||||
* use "ifndef NO_NETWORK" all over the place
|
||||
*
|
||||
* Revision 1.2 2002/05/03 22:07:08 mharris
|
||||
* got some stuff to compile
|
||||
*
|
||||
* Revision 1.1 2002/05/02 18:03:04 mharris
|
||||
* Initial checkin - converted filenames and includes to lower case
|
||||
*
|
||||
@@ -270,12 +276,17 @@
|
||||
#include "linklist.h"
|
||||
#include "hudescort.h"
|
||||
#include "shiphit.h"
|
||||
#include "multiutil.h"
|
||||
#include "staticrand.h"
|
||||
#include "multimsgs.h"
|
||||
#include "systemvars.h"
|
||||
#include "localize.h"
|
||||
#include "scoring.h"
|
||||
#include "hudtarget.h"
|
||||
|
||||
#ifndef NO_NETWORK
|
||||
#include "multiutil.h"
|
||||
#include "multimsgs.h"
|
||||
#include "multi.h"
|
||||
#endif
|
||||
|
||||
#ifndef FS2_DEMO
|
||||
|
||||
@@ -415,15 +426,15 @@ int asteroid_in_inner_bound_with_axes(asteroid_field *asfieldp, vector *pos, flo
|
||||
Assert(asfieldp->has_inner_bound);
|
||||
|
||||
int rval = 0;
|
||||
if ( (pos->x > asfieldp->inner_min_bound.x - delta) && (pos->x < asfieldp->inner_max_bound.x + delta) ) {
|
||||
if ( (pos->xyz.x > asfieldp->inner_min_bound.xyz.x - delta) && (pos->xyz.x < asfieldp->inner_max_bound.xyz.x + delta) ) {
|
||||
rval += 1;
|
||||
}
|
||||
|
||||
if ( (pos->y > asfieldp->inner_min_bound.y - delta) && (pos->y < asfieldp->inner_max_bound.y + delta) ) {
|
||||
if ( (pos->xyz.y > asfieldp->inner_min_bound.xyz.y - delta) && (pos->xyz.y < asfieldp->inner_max_bound.xyz.y + delta) ) {
|
||||
rval += 2;
|
||||
}
|
||||
|
||||
if ( (pos->z > asfieldp->inner_min_bound.z - delta) && (pos->z < asfieldp->inner_max_bound.z + delta) ) {
|
||||
if ( (pos->xyz.z > asfieldp->inner_min_bound.xyz.z - delta) && (pos->xyz.z < asfieldp->inner_max_bound.xyz.z + delta) ) {
|
||||
rval += 4;
|
||||
}
|
||||
|
||||
@@ -536,9 +547,9 @@ object *asteroid_create(asteroid_field *asfieldp, int asteroid_type, int asteroi
|
||||
signature = 0;
|
||||
rand_base = 0;
|
||||
if ( Game_mode & GM_NORMAL ) {
|
||||
pos.x = asfieldp->min_bound.x + delta_bound.x * frand();
|
||||
pos.y = asfieldp->min_bound.y + delta_bound.y * frand();
|
||||
pos.z = asfieldp->min_bound.z + delta_bound.z * frand();
|
||||
pos.xyz.x = asfieldp->min_bound.xyz.x + delta_bound.xyz.x * frand();
|
||||
pos.xyz.y = asfieldp->min_bound.xyz.y + delta_bound.xyz.y * frand();
|
||||
pos.xyz.z = asfieldp->min_bound.xyz.z + delta_bound.xyz.z * frand();
|
||||
|
||||
inner_bound_pos_fixup(asfieldp, &pos);
|
||||
// vm_set_identity(&orient);
|
||||
@@ -546,18 +557,20 @@ object *asteroid_create(asteroid_field *asfieldp, int asteroid_type, int asteroi
|
||||
angs.b = frand() * 2*PI;
|
||||
angs.h = frand() * 2*PI;
|
||||
} else {
|
||||
#ifndef NO_NETWORK
|
||||
signature = multi_assign_network_signature( MULTI_SIG_ASTEROID );
|
||||
rand_base = signature;
|
||||
|
||||
pos.x = asfieldp->min_bound.x + delta_bound.x * static_randf( rand_base++ );
|
||||
pos.y = asfieldp->min_bound.y + delta_bound.y * static_randf( rand_base++ );
|
||||
pos.z = asfieldp->min_bound.z + delta_bound.z * static_randf( rand_base++ );
|
||||
pos.xyz.x = asfieldp->min_bound.xyz.x + delta_bound.xyz.x * static_randf( rand_base++ );
|
||||
pos.xyz.y = asfieldp->min_bound.xyz.y + delta_bound.xyz.y * static_randf( rand_base++ );
|
||||
pos.xyz.z = asfieldp->min_bound.xyz.z + delta_bound.xyz.z * static_randf( rand_base++ );
|
||||
|
||||
inner_bound_pos_fixup(asfieldp, &pos);
|
||||
// vm_set_identity(&orient);
|
||||
angs.p = static_randf( rand_base++ ) * 2*PI;
|
||||
angs.b = static_randf( rand_base++ ) * 2*PI;
|
||||
angs.h = static_randf( rand_base++ ) * 2*PI;
|
||||
#endif
|
||||
}
|
||||
|
||||
vm_angles_2_matrix(&orient, &angs);
|
||||
@@ -620,14 +633,14 @@ object *asteroid_create(asteroid_field *asfieldp, int asteroid_type, int asteroi
|
||||
// Fill in the max_vel field, so the collision pair stuff knows
|
||||
// how fast this can move maximum in order to throw out collisions.
|
||||
// This is in local coordinates, so Z is forward velocity.
|
||||
objp->phys_info.max_vel.x = 0.0f;
|
||||
objp->phys_info.max_vel.y = 0.0f;
|
||||
objp->phys_info.max_vel.z = vm_vec_mag(&objp->phys_info.desired_vel);
|
||||
objp->phys_info.max_vel.xyz.x = 0.0f;
|
||||
objp->phys_info.max_vel.xyz.y = 0.0f;
|
||||
objp->phys_info.max_vel.xyz.z = vm_vec_mag(&objp->phys_info.desired_vel);
|
||||
|
||||
objp->phys_info.mass = asip->modelp[asteroid_subtype]->rad * 700.0f;
|
||||
objp->phys_info.I_body_inv.rvec.x = 1.0f / (objp->phys_info.mass*asip->modelp[asteroid_subtype]->rad);
|
||||
objp->phys_info.I_body_inv.uvec.y = objp->phys_info.I_body_inv.rvec.x;
|
||||
objp->phys_info.I_body_inv.fvec.z = objp->phys_info.I_body_inv.rvec.x;
|
||||
objp->phys_info.I_body_inv.vec.rvec.xyz.x = 1.0f / (objp->phys_info.mass*asip->modelp[asteroid_subtype]->rad);
|
||||
objp->phys_info.I_body_inv.vec.uvec.xyz.y = objp->phys_info.I_body_inv.vec.rvec.xyz.x;
|
||||
objp->phys_info.I_body_inv.vec.fvec.xyz.z = objp->phys_info.I_body_inv.vec.rvec.xyz.x;
|
||||
objp->hull_strength = asip->initial_hull_strength * (0.8f + (float)Game_skill_level/NUM_SKILL_LEVELS)/2.0f;
|
||||
|
||||
// ensure vel is valid
|
||||
@@ -652,9 +665,11 @@ void asteroid_sub_create(object *parent_objp, int asteroid_type, vector *relvec)
|
||||
if (new_objp == NULL)
|
||||
return;
|
||||
|
||||
#ifndef NO_NETWORK
|
||||
if ( MULTIPLAYER_MASTER ){
|
||||
send_asteroid_create( new_objp, parent_objp, asteroid_type, relvec );
|
||||
}
|
||||
#endif
|
||||
|
||||
// Now, bash some values.
|
||||
vm_vec_scale_add(&new_objp->pos, &parent_objp->pos, relvec, 0.5f * parent_objp->radius);
|
||||
@@ -859,38 +874,40 @@ void asteroid_level_init()
|
||||
// 0 from this function. We will force a wrap on the clients when server tells us
|
||||
int asteroid_should_wrap(object *objp, asteroid_field *asfieldp)
|
||||
{
|
||||
#ifndef NO_NETWORK
|
||||
if ( MULTIPLAYER_CLIENT )
|
||||
return 0;
|
||||
#endif
|
||||
|
||||
if (objp->pos.x < asfieldp->min_bound.x) {
|
||||
if (objp->pos.xyz.x < asfieldp->min_bound.xyz.x) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (objp->pos.y < asfieldp->min_bound.y) {
|
||||
if (objp->pos.xyz.y < asfieldp->min_bound.xyz.y) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (objp->pos.z < asfieldp->min_bound.z) {
|
||||
if (objp->pos.xyz.z < asfieldp->min_bound.xyz.z) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (objp->pos.x > asfieldp->max_bound.x) {
|
||||
if (objp->pos.xyz.x > asfieldp->max_bound.xyz.x) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (objp->pos.y > asfieldp->max_bound.y) {
|
||||
if (objp->pos.xyz.y > asfieldp->max_bound.xyz.y) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (objp->pos.z > asfieldp->max_bound.z) {
|
||||
if (objp->pos.xyz.z > asfieldp->max_bound.xyz.z) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
// check against inner bound
|
||||
if (asfieldp->has_inner_bound) {
|
||||
if ( (objp->pos.x > asfieldp->inner_min_bound.x) && (objp->pos.x < asfieldp->inner_max_bound.x)
|
||||
&& (objp->pos.y > asfieldp->inner_min_bound.y) && (objp->pos.y < asfieldp->inner_max_bound.y)
|
||||
&& (objp->pos.z > asfieldp->inner_min_bound.z) && (objp->pos.z < asfieldp->inner_max_bound.z) ) {
|
||||
if ( (objp->pos.xyz.x > asfieldp->inner_min_bound.xyz.x) && (objp->pos.xyz.x < asfieldp->inner_max_bound.xyz.x)
|
||||
&& (objp->pos.xyz.y > asfieldp->inner_min_bound.xyz.y) && (objp->pos.xyz.y < asfieldp->inner_max_bound.xyz.y)
|
||||
&& (objp->pos.xyz.z > asfieldp->inner_min_bound.xyz.z) && (objp->pos.xyz.z < asfieldp->inner_max_bound.xyz.z) ) {
|
||||
|
||||
return 1;
|
||||
}
|
||||
@@ -902,28 +919,28 @@ int asteroid_should_wrap(object *objp, asteroid_field *asfieldp)
|
||||
// Wrap an asteroid from one end of the asteroid field to the other
|
||||
void asteroid_wrap_pos(object *objp, asteroid_field *asfieldp)
|
||||
{
|
||||
if (objp->pos.x < asfieldp->min_bound.x) {
|
||||
objp->pos.x = asfieldp->max_bound.x + (objp->pos.x - asfieldp->min_bound.x);
|
||||
if (objp->pos.xyz.x < asfieldp->min_bound.xyz.x) {
|
||||
objp->pos.xyz.x = asfieldp->max_bound.xyz.x + (objp->pos.xyz.x - asfieldp->min_bound.xyz.x);
|
||||
}
|
||||
|
||||
if (objp->pos.y < asfieldp->min_bound.y) {
|
||||
objp->pos.y = asfieldp->max_bound.y + (objp->pos.y - asfieldp->min_bound.y);
|
||||
if (objp->pos.xyz.y < asfieldp->min_bound.xyz.y) {
|
||||
objp->pos.xyz.y = asfieldp->max_bound.xyz.y + (objp->pos.xyz.y - asfieldp->min_bound.xyz.y);
|
||||
}
|
||||
|
||||
if (objp->pos.z < asfieldp->min_bound.z) {
|
||||
objp->pos.z = asfieldp->max_bound.z + (objp->pos.z - asfieldp->min_bound.z);
|
||||
if (objp->pos.xyz.z < asfieldp->min_bound.xyz.z) {
|
||||
objp->pos.xyz.z = asfieldp->max_bound.xyz.z + (objp->pos.xyz.z - asfieldp->min_bound.xyz.z);
|
||||
}
|
||||
|
||||
if (objp->pos.x > asfieldp->max_bound.x) {
|
||||
objp->pos.x = asfieldp->min_bound.x + (objp->pos.x - asfieldp->max_bound.x);
|
||||
if (objp->pos.xyz.x > asfieldp->max_bound.xyz.x) {
|
||||
objp->pos.xyz.x = asfieldp->min_bound.xyz.x + (objp->pos.xyz.x - asfieldp->max_bound.xyz.x);
|
||||
}
|
||||
|
||||
if (objp->pos.y > asfieldp->max_bound.y) {
|
||||
objp->pos.y = asfieldp->min_bound.y + (objp->pos.y - asfieldp->max_bound.y);
|
||||
if (objp->pos.xyz.y > asfieldp->max_bound.xyz.y) {
|
||||
objp->pos.xyz.y = asfieldp->min_bound.xyz.y + (objp->pos.xyz.y - asfieldp->max_bound.xyz.y);
|
||||
}
|
||||
|
||||
if (objp->pos.z > asfieldp->max_bound.z) {
|
||||
objp->pos.z = asfieldp->min_bound.z + (objp->pos.z - asfieldp->max_bound.z);
|
||||
if (objp->pos.xyz.z > asfieldp->max_bound.xyz.z) {
|
||||
objp->pos.xyz.z = asfieldp->min_bound.xyz.z + (objp->pos.xyz.z - asfieldp->max_bound.xyz.z);
|
||||
}
|
||||
|
||||
// wrap on inner bound, check all 3 axes as needed, use of rand ok for multiplayer with send_asteroid_throw()
|
||||
@@ -962,9 +979,9 @@ void asteroid_aim_at_target(object *objp, object *asteroid_objp, float delta_tim
|
||||
vm_vec_rand_vec_quick(&rand_vec);
|
||||
vm_vec_scale_add2(&predicted_center_pos, &rand_vec, objp->radius/2.0f);
|
||||
|
||||
vm_vec_add2(&rand_vec, &objp->orient.fvec);
|
||||
vm_vec_add2(&rand_vec, &objp->orient.vec.fvec);
|
||||
if (vm_vec_mag_quick(&rand_vec) < 0.1f)
|
||||
vm_vec_add2(&rand_vec, &objp->orient.rvec);
|
||||
vm_vec_add2(&rand_vec, &objp->orient.vec.rvec);
|
||||
vm_vec_normalize(&rand_vec);
|
||||
|
||||
speed = Asteroid_info[0].max_speed * (frand()/2.0f + 0.5f);
|
||||
@@ -1017,9 +1034,11 @@ void maybe_throw_asteroid(int count)
|
||||
// this line gives too many collision pairs.
|
||||
// asteroid_update_collide(objp);
|
||||
|
||||
#ifndef NO_NETWORK
|
||||
if ( MULTIPLAYER_MASTER ) {
|
||||
send_asteroid_throw( objp );
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1071,7 +1090,7 @@ void asteroid_maybe_reposition(object *objp, asteroid_field *asfieldp)
|
||||
|
||||
// only wrap if player won't see asteroid disappear/reverse direction
|
||||
dist = vm_vec_normalized_dir(&vec_to_asteroid, &objp->pos, &Eye_position);
|
||||
dot = vm_vec_dot(&Eye_matrix.fvec, &vec_to_asteroid);
|
||||
dot = vm_vec_dot(&Eye_matrix.vec.fvec, &vec_to_asteroid);
|
||||
|
||||
if ((dot < 0.7f) || (dist > 3000.0f)) {
|
||||
if (Num_asteroids > MAX_ASTEROIDS-10) {
|
||||
@@ -1082,7 +1101,7 @@ void asteroid_maybe_reposition(object *objp, asteroid_field *asfieldp)
|
||||
Asteroids[objp->instance].target_objnum = -1;
|
||||
|
||||
vm_vec_normalized_dir(&vec_to_asteroid, &objp->pos, &Eye_position);
|
||||
dot = vm_vec_dot(&Eye_matrix.fvec, &vec_to_asteroid);
|
||||
dot = vm_vec_dot(&Eye_matrix.vec.fvec, &vec_to_asteroid);
|
||||
dist = vm_vec_dist_quick(&objp->pos, &Eye_position);
|
||||
|
||||
if (( dot > 0.7f) && (dist < 3000.0f)) {
|
||||
@@ -1098,8 +1117,10 @@ void asteroid_maybe_reposition(object *objp, asteroid_field *asfieldp)
|
||||
|
||||
asteroid_update_collide(objp);
|
||||
|
||||
#ifndef NO_NETWORK
|
||||
if ( MULTIPLAYER_MASTER )
|
||||
send_asteroid_throw( objp );
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1119,12 +1140,12 @@ void asteroid_process_pre( object *objp, float frame_time)
|
||||
v = &objp->phys_info.vel;
|
||||
vv = &objp->phys_info.desired_vel;
|
||||
|
||||
//nprintf(("AI", "Frm %i: Obj #%2i: Hull: %5.1f Vel: %5.1f %5.1f %5.1f Des: %5.1f %5.1f %5.1f\n", Framecount, objp-Objects, objp->hull_strength, v->x, v->y, v->z, vv->x, vv->y, vv->z));
|
||||
//nprintf(("AI", "Frm %i: Obj #%2i: Hull: %5.1f Vel: %5.1f %5.1f %5.1f Des: %5.1f %5.1f %5.1f\n", Framecount, objp-Objects, objp->hull_strength, v->xyz.x, v->xyz.y, v->xyz.z, vv->xyz.x, vv->xyz.y, vv->xyz.z));
|
||||
|
||||
// Make vel chase desired_vel
|
||||
lerp(&objp->phys_info.vel.x, objp->phys_info.vel.x, objp->phys_info.desired_vel.x, flFrametime);
|
||||
lerp(&objp->phys_info.vel.y, objp->phys_info.vel.y, objp->phys_info.desired_vel.y, flFrametime);
|
||||
lerp(&objp->phys_info.vel.z, objp->phys_info.vel.z, objp->phys_info.desired_vel.z, flFrametime);
|
||||
lerp(&objp->phys_info.vel.xyz.x, objp->phys_info.vel.xyz.x, objp->phys_info.desired_vel.xyz.x, flFrametime);
|
||||
lerp(&objp->phys_info.vel.xyz.y, objp->phys_info.vel.xyz.y, objp->phys_info.desired_vel.xyz.y, flFrametime);
|
||||
lerp(&objp->phys_info.vel.xyz.z, objp->phys_info.vel.xyz.z, objp->phys_info.desired_vel.xyz.z, flFrametime);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1244,7 +1265,8 @@ int asteroid_check_collision(object *pasteroid, object *other_obj, vector *hitpo
|
||||
pm = model_get(Ships[heavy_obj->instance].modelnum);
|
||||
|
||||
// turn off all rotating submodels and test for collision
|
||||
for (int i=0; i<num_rotating_submodels; i++) {
|
||||
int i;
|
||||
for (i=0; i<num_rotating_submodels; i++) {
|
||||
pm->submodel[submodel_list[i]].blown_off = 1;
|
||||
}
|
||||
|
||||
@@ -1561,9 +1583,11 @@ void asteroid_hit( object * asteroid_obj, object * other_obj, vector * hitpos, f
|
||||
return;
|
||||
}
|
||||
|
||||
#ifndef NO_NETWORK
|
||||
if ( MULTIPLAYER_MASTER ){
|
||||
send_asteroid_hit( asteroid_obj, other_obj, hitpos, damage );
|
||||
}
|
||||
#endif
|
||||
|
||||
asteroid_obj->hull_strength -= damage;
|
||||
|
||||
@@ -1698,8 +1722,9 @@ void asteroid_maybe_break_up(object *asteroid_obj)
|
||||
|
||||
// multiplayer clients won't go through the following code. asteroid_sub_create will send
|
||||
// a create packet to the client in the above named function
|
||||
#ifndef NO_NETWORK
|
||||
if ( !MULTIPLAYER_CLIENT ) {
|
||||
|
||||
#endif
|
||||
switch (asp->type) {
|
||||
case ASTEROID_TYPE_SMALL:
|
||||
break;
|
||||
@@ -1746,7 +1771,9 @@ void asteroid_maybe_break_up(object *asteroid_obj)
|
||||
default:
|
||||
Int3();
|
||||
}
|
||||
#ifndef NO_NETWORK
|
||||
}
|
||||
#endif
|
||||
|
||||
asp->final_death_time = timestamp(-1);
|
||||
}
|
||||
@@ -1850,10 +1877,12 @@ void asteroid_update_collide_flag(object *asteroid_objp)
|
||||
asp->collide_objnum = -1;
|
||||
asp->collide_objsig = -1;
|
||||
|
||||
#ifndef NO_NETWORK
|
||||
// multiplayer dogfight
|
||||
if((Game_mode & GM_MULTIPLAYER) && (Netgame.type_flags & NG_TYPE_DOGFIGHT)){
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
num_escorts = hud_escort_num_ships_on_list();
|
||||
|
||||
@@ -2070,12 +2099,12 @@ int set_asteroid_throw_objnum()
|
||||
float radius = ship_objp->radius*2.0f;
|
||||
|
||||
if (Ship_info[Ships[ship_objp->instance].ship_info_index].flags & (SIF_HUGE_SHIP | SIF_BIG_SHIP)) {
|
||||
if (ship_objp->pos.x + radius > Asteroid_field.min_bound.x)
|
||||
if (ship_objp->pos.y + radius > Asteroid_field.min_bound.y)
|
||||
if (ship_objp->pos.z + radius > Asteroid_field.min_bound.z)
|
||||
if (ship_objp->pos.x - radius < Asteroid_field.max_bound.x)
|
||||
if (ship_objp->pos.y - radius < Asteroid_field.max_bound.y)
|
||||
if (ship_objp->pos.z - radius < Asteroid_field.max_bound.z)
|
||||
if (ship_objp->pos.xyz.x + radius > Asteroid_field.min_bound.xyz.x)
|
||||
if (ship_objp->pos.xyz.y + radius > Asteroid_field.min_bound.xyz.y)
|
||||
if (ship_objp->pos.xyz.z + radius > Asteroid_field.min_bound.xyz.z)
|
||||
if (ship_objp->pos.xyz.x - radius < Asteroid_field.max_bound.xyz.x)
|
||||
if (ship_objp->pos.xyz.y - radius < Asteroid_field.max_bound.xyz.y)
|
||||
if (ship_objp->pos.xyz.z - radius < Asteroid_field.max_bound.xyz.z)
|
||||
if (!asteroid_in_inner_bound(&Asteroid_field, &ship_objp->pos, radius))
|
||||
return so->objnum;
|
||||
}
|
||||
|
||||
@@ -9,13 +9,16 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Asteroid/Asteroid.h $
|
||||
* $Revision: 1.1 $
|
||||
* $Date: 2002-06-03 03:25:56 $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:21 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
* Header file for asteroids
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 1.2 2002/05/03 22:07:08 mharris
|
||||
* got some stuff to compile
|
||||
*
|
||||
* Revision 1.1 2002/05/02 18:03:04 mharris
|
||||
* Initial checkin - converted filenames and includes to lower case
|
||||
*
|
||||
@@ -204,13 +207,13 @@ typedef struct asteroid {
|
||||
typedef enum {
|
||||
DG_ASTEROID,
|
||||
DG_SHIP
|
||||
} debris_genre;
|
||||
} debris_genre_t;
|
||||
|
||||
// TYPEDEF FOR FIELD TYPE
|
||||
typedef enum {
|
||||
FT_ACTIVE,
|
||||
FT_PASSIVE
|
||||
} field_type;
|
||||
} field_type_t;
|
||||
|
||||
#define MAX_ACTIVE_DEBRIS_TYPES 3
|
||||
|
||||
@@ -223,8 +226,8 @@ typedef struct asteroid_field {
|
||||
vector vel; // Average asteroid moves at this velocity.
|
||||
float speed; // Average speed of field
|
||||
int num_initial_asteroids; // Number of asteroids at creation.
|
||||
field_type field_type; // active throws and wraps, passive does not
|
||||
debris_genre debris_genre; // type of debris (ship or asteroid) [generic type]
|
||||
field_type_t field_type; // active throws and wraps, passive does not
|
||||
debris_genre_t debris_genre; // type of debris (ship or asteroid) [generic type]
|
||||
int field_debris_type[MAX_ACTIVE_DEBRIS_TYPES]; // one of the debris type defines above
|
||||
} asteroid_field;
|
||||
|
||||
|
||||
@@ -9,13 +9,22 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Bmpman/BmpMan.cpp $
|
||||
* $Revision: 1.1 $
|
||||
* $Date: 2002-06-03 03:25:56 $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:21 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
* Code to load and manage all bitmaps for the game
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 1.4 2002/05/21 15:36:25 mharris
|
||||
* Added ifdef WIN32
|
||||
*
|
||||
* Revision 1.3 2002/05/09 13:49:30 mharris
|
||||
* Added ifndef NO_DIRECT3D
|
||||
*
|
||||
* Revision 1.2 2002/05/03 22:07:08 mharris
|
||||
* got some stuff to compile
|
||||
*
|
||||
* Revision 1.1 2002/05/02 18:03:04 mharris
|
||||
* Initial checkin - converted filenames and includes to lower case
|
||||
*
|
||||
@@ -461,6 +470,7 @@
|
||||
* $NoKeywords: $
|
||||
*/
|
||||
|
||||
#include <ctype.h>
|
||||
#include "pstypes.h"
|
||||
#include "pcxutils.h"
|
||||
#include "bmpman.h"
|
||||
@@ -831,10 +841,10 @@ int bm_create( int bpp, int w, int h, void * data, int flags )
|
||||
bm_bitmaps[n].type = BM_TYPE_USER;
|
||||
bm_bitmaps[n].palette_checksum = 0;
|
||||
|
||||
bm_bitmaps[n].bm.w = short(w);
|
||||
bm_bitmaps[n].bm.h = short(h);
|
||||
bm_bitmaps[n].bm.rowsize = short(w);
|
||||
bm_bitmaps[n].bm.bpp = unsigned char(bpp);
|
||||
bm_bitmaps[n].bm.w = (short) w;
|
||||
bm_bitmaps[n].bm.h = (short) h;
|
||||
bm_bitmaps[n].bm.rowsize = (short) w;
|
||||
bm_bitmaps[n].bm.bpp = (unsigned char) bpp;
|
||||
bm_bitmaps[n].bm.flags = 0;
|
||||
bm_bitmaps[n].bm.flags |= flags;
|
||||
bm_bitmaps[n].bm.data = 0;
|
||||
@@ -1312,7 +1322,7 @@ static void bm_convert_format( int bitmapnum, bitmap *bmp, ubyte bpp, ubyte flag
|
||||
g /= Gr_t_green.scale;
|
||||
b /= Gr_t_blue.scale;
|
||||
a /= Gr_t_alpha.scale;
|
||||
((ushort*)bmp->data)[idx] = unsigned short((a<<Gr_t_alpha.shift) | (r << Gr_t_red.shift) | (g << Gr_t_green.shift) | (b << Gr_t_blue.shift));
|
||||
((ushort*)bmp->data)[idx] = (unsigned short)((a<<Gr_t_alpha.shift) | (r << Gr_t_red.shift) | (g << Gr_t_green.shift) | (b << Gr_t_blue.shift));
|
||||
break;
|
||||
default:
|
||||
Int3();
|
||||
@@ -1718,11 +1728,11 @@ bitmap * bm_lock( int handle, ubyte bpp, ubyte flags )
|
||||
int pal_changed = 0;
|
||||
int rle_changed = 0;
|
||||
int fake_xparent_changed = 0;
|
||||
if ( (bmp->data == NULL) || (bpp != bmp->bpp) || pal_changed || rle_changed || fake_xparent_changed ) {
|
||||
if ( (bmp->data == 0) || (bpp != bmp->bpp) || pal_changed || rle_changed || fake_xparent_changed ) {
|
||||
Assert(be->ref_count == 1);
|
||||
|
||||
if ( be->type != BM_TYPE_USER ) {
|
||||
if ( bmp->data == NULL ) {
|
||||
if ( bmp->data == 0 ) {
|
||||
nprintf (("BmpMan","Loading %s for the first time.\n", be->filename));
|
||||
} else if ( bpp != bmp->bpp ) {
|
||||
nprintf (("BmpMan","Reloading %s from bitdepth %d to bitdepth %d\n", be->filename, bmp->bpp, bpp));
|
||||
@@ -2130,8 +2140,10 @@ void bm_page_in_start()
|
||||
|
||||
}
|
||||
|
||||
#ifndef NO_DIRECT3D
|
||||
extern void gr_d3d_preload_init();
|
||||
extern int gr_d3d_preload(int bitmap_num, int is_aabitmap );
|
||||
#endif
|
||||
|
||||
void bm_page_in_stop()
|
||||
{
|
||||
@@ -2147,9 +2159,10 @@ void bm_page_in_stop()
|
||||
Bm_ram_freed = 0;
|
||||
#endif
|
||||
|
||||
#ifndef NO_DIRECT3D
|
||||
int d3d_preloading = 1;
|
||||
|
||||
gr_d3d_preload_init();
|
||||
#endif
|
||||
|
||||
for (i = 0; i < MAX_BITMAPS; i++) {
|
||||
if ( bm_bitmaps[i].type != BM_TYPE_NONE ) {
|
||||
@@ -2177,12 +2190,14 @@ void bm_page_in_stop()
|
||||
}
|
||||
bm_unlock( bm_bitmaps[i].handle );
|
||||
|
||||
#ifndef NO_DIRECT3D
|
||||
if ( d3d_preloading ) {
|
||||
if ( !gr_d3d_preload(bm_bitmaps[i].handle, (bm_bitmaps[i].preloaded==2) ) ) {
|
||||
mprintf(( "Out of VRAM. Done preloading.\n" ));
|
||||
d3d_preloading = 0;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
n++;
|
||||
#ifdef BMPMAN_NDEBUG
|
||||
@@ -2238,7 +2253,9 @@ void bm_24_to_16(int bit_24, ushort *bit_16)
|
||||
bm_set_components((ubyte*)bit_16, (ubyte*)&pixel[0], (ubyte*)&pixel[1], (ubyte*)&pixel[2], &alpha);
|
||||
}
|
||||
|
||||
#ifndef NO_DIRECT3D
|
||||
extern int D3D_32bit;
|
||||
#endif
|
||||
|
||||
void (*bm_set_components)(ubyte *pixel, ubyte *r, ubyte *g, ubyte *b, ubyte *a) = NULL;
|
||||
|
||||
@@ -2320,19 +2337,27 @@ void BM_SELECT_SCREEN_FORMAT()
|
||||
Gr_current_alpha = &Gr_alpha;
|
||||
|
||||
// setup pointers
|
||||
#ifdef WIN32
|
||||
if(gr_screen.mode == GR_GLIDE){
|
||||
bm_set_components = bm_set_components_argb;
|
||||
} else if(gr_screen.mode == GR_DIRECT3D){
|
||||
if(Bm_pixel_format == BM_PIXEL_FORMAT_D3D){
|
||||
bm_set_components = bm_set_components_d3d;
|
||||
} else {
|
||||
#ifndef NO_DIRECT3D
|
||||
if(D3D_32bit){
|
||||
bm_set_components = bm_set_components_argb_d3d_32_screen;
|
||||
} else {
|
||||
bm_set_components = bm_set_components_argb_d3d_16_screen;
|
||||
}
|
||||
#else
|
||||
bm_set_components = bm_set_components_argb_d3d_16_screen;
|
||||
#endif // ifndef NO_DIRECT3D
|
||||
}
|
||||
}
|
||||
#else
|
||||
bm_set_components = bm_set_components_argb_d3d_16_screen;
|
||||
#endif // ifdef WIN32
|
||||
}
|
||||
|
||||
void BM_SELECT_TEX_FORMAT()
|
||||
@@ -2343,19 +2368,27 @@ void BM_SELECT_TEX_FORMAT()
|
||||
Gr_current_alpha = &Gr_t_alpha;
|
||||
|
||||
// setup pointers
|
||||
#ifdef WIN32
|
||||
if(gr_screen.mode == GR_GLIDE){
|
||||
bm_set_components = bm_set_components_argb;
|
||||
} else if(gr_screen.mode == GR_DIRECT3D){
|
||||
if(Bm_pixel_format == BM_PIXEL_FORMAT_D3D){
|
||||
bm_set_components = bm_set_components_d3d;
|
||||
} else {
|
||||
#ifndef NO_DIRECT3D
|
||||
if(D3D_32bit){
|
||||
bm_set_components = bm_set_components_argb_d3d_32_tex;
|
||||
} else {
|
||||
bm_set_components = bm_set_components_argb_d3d_16_tex;
|
||||
}
|
||||
#else
|
||||
bm_set_components = bm_set_components_argb_d3d_16_tex;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
#else
|
||||
bm_set_components = bm_set_components_argb_d3d_16_tex;
|
||||
#endif // ifdef WIN32
|
||||
}
|
||||
|
||||
void BM_SELECT_ALPHA_TEX_FORMAT()
|
||||
@@ -2366,19 +2399,27 @@ void BM_SELECT_ALPHA_TEX_FORMAT()
|
||||
Gr_current_alpha = &Gr_ta_alpha;
|
||||
|
||||
// setup pointers
|
||||
#ifdef WIN32
|
||||
if(gr_screen.mode == GR_GLIDE){
|
||||
bm_set_components = bm_set_components_argb;
|
||||
} else if(gr_screen.mode == GR_DIRECT3D){
|
||||
if(Bm_pixel_format == BM_PIXEL_FORMAT_D3D){
|
||||
bm_set_components = bm_set_components_d3d;
|
||||
} else {
|
||||
#ifndef NO_DIRECT3D
|
||||
if(D3D_32bit){
|
||||
bm_set_components = bm_set_components_argb_d3d_32_tex;
|
||||
} else {
|
||||
bm_set_components = bm_set_components_argb_d3d_16_tex;
|
||||
}
|
||||
#else
|
||||
bm_set_components = bm_set_components_argb_d3d_16_tex;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
#else
|
||||
bm_set_components = bm_set_components_argb_d3d_16_tex;
|
||||
#endif // ifdef WIN32
|
||||
}
|
||||
|
||||
// set the rgba components of a pixel, any of the parameters can be -1
|
||||
@@ -2460,10 +2501,12 @@ void bm_get_components(ubyte *pixel, ubyte *r, ubyte *g, ubyte *b, ubyte *a)
|
||||
{
|
||||
int bit_32 = 0;
|
||||
|
||||
#ifndef NO_DIRECT3D
|
||||
// pick a byte size - 32 bits only if 32 bit mode d3d and screen format
|
||||
if(D3D_32bit && (Gr_current_red == &Gr_red)){
|
||||
bit_32 = 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
if(r != NULL){
|
||||
if(bit_32){
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Bmpman/BmpMan.h $
|
||||
* $Revision: 1.1 $
|
||||
* $Date: 2002-06-03 03:25:56 $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:21 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
* Prototypes for Bitmap Manager functions
|
||||
|
||||
+165
-57
@@ -9,13 +9,31 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/CFile/cfile.cpp $
|
||||
* $Revision: 1.1 $
|
||||
* $Date: 2002-06-03 03:25:56 $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:21 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
* Utilities for operating on files
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 1.7 2002/05/21 15:37:14 mharris
|
||||
* Cosmetics - reformat Pathtypes to line up again
|
||||
*
|
||||
* Revision 1.6 2002/05/17 06:45:53 mharris
|
||||
* More porting tweaks. It links! but segfaults...
|
||||
*
|
||||
* Revision 1.5 2002/05/17 02:56:19 mharris
|
||||
* first crack at unix compatibity
|
||||
*
|
||||
* Revision 1.4 2002/05/16 06:03:29 mharris
|
||||
* Unix port changes
|
||||
*
|
||||
* Revision 1.3 2002/05/09 22:58:08 mharris
|
||||
* Added ifdef WIN32 around change-drive functions
|
||||
*
|
||||
* Revision 1.2 2002/05/07 13:23:17 mharris
|
||||
* Port tweaks
|
||||
*
|
||||
* Revision 1.1 2002/05/02 18:03:04 mharris
|
||||
* Initial checkin - converted filenames and includes to lower case
|
||||
*
|
||||
@@ -170,6 +188,12 @@
|
||||
#include <windows.h>
|
||||
#include <winbase.h> /* needed for memory mapping of file functions */
|
||||
|
||||
#ifdef unix
|
||||
#include <sys/stat.h>
|
||||
#include <glob.h>
|
||||
#include <sys/mman.h>
|
||||
#endif
|
||||
|
||||
#include "pstypes.h"
|
||||
#include "cfile.h"
|
||||
#include "encrypt.h"
|
||||
@@ -186,45 +210,47 @@ char Cfile_root_dir[CFILE_ROOT_DIRECTORY_LEN] = "";
|
||||
// Each path must have a valid parent that can be tracable all the way back to the root
|
||||
// so that we can create directories when we need to.
|
||||
//
|
||||
// Please make sure extensions are all lower-case, or we'll break unix compatibility
|
||||
//
|
||||
cf_pathtype Pathtypes[CF_MAX_PATH_TYPES] = {
|
||||
// What type this is Path Extensions Parent type
|
||||
{ CF_TYPE_INVALID, NULL, NULL, CF_TYPE_INVALID },
|
||||
// What type this is Path Extensions Parent type
|
||||
{ CF_TYPE_INVALID, NULL, NULL, CF_TYPE_INVALID },
|
||||
// Root must be index 1!!
|
||||
{ CF_TYPE_ROOT, "", ".mve", CF_TYPE_ROOT },
|
||||
{ CF_TYPE_DATA, "Data", ".cfg .log .txt", CF_TYPE_ROOT },
|
||||
{ CF_TYPE_MAPS, "Data\\Maps", ".pcx .ani .tga", CF_TYPE_DATA },
|
||||
{ CF_TYPE_TEXT, "Data\\Text", ".txt .net", CF_TYPE_DATA },
|
||||
{ CF_TYPE_MISSIONS, "Data\\Missions", ".fs2 .fc2 .ntl .ssv", CF_TYPE_DATA },
|
||||
{ CF_TYPE_MODELS, "Data\\Models", ".pof", CF_TYPE_DATA },
|
||||
{ CF_TYPE_TABLES, "Data\\Tables", ".tbl", CF_TYPE_DATA },
|
||||
{ CF_TYPE_SOUNDS, "Data\\Sounds", ".wav", CF_TYPE_DATA },
|
||||
{ CF_TYPE_SOUNDS_8B22K, "Data\\Sounds\\8b22k", ".wav", CF_TYPE_SOUNDS },
|
||||
{ CF_TYPE_SOUNDS_16B11K, "Data\\Sounds\\16b11k", ".wav", CF_TYPE_SOUNDS },
|
||||
{ CF_TYPE_VOICE, "Data\\Voice", "", CF_TYPE_DATA },
|
||||
{ CF_TYPE_VOICE_BRIEFINGS, "Data\\Voice\\Briefing", ".wav", CF_TYPE_VOICE },
|
||||
{ CF_TYPE_VOICE_CMD_BRIEF, "Data\\Voice\\Command_briefings",".wav", CF_TYPE_VOICE },
|
||||
{ CF_TYPE_VOICE_DEBRIEFINGS, "Data\\Voice\\Debriefing", ".wav", CF_TYPE_VOICE },
|
||||
{ CF_TYPE_VOICE_PERSONAS, "Data\\Voice\\Personas", ".wav", CF_TYPE_VOICE },
|
||||
{ CF_TYPE_VOICE_SPECIAL, "Data\\Voice\\Special", ".wav", CF_TYPE_VOICE },
|
||||
{ CF_TYPE_VOICE_TRAINING, "Data\\Voice\\Training", ".wav", CF_TYPE_VOICE },
|
||||
{ CF_TYPE_MUSIC, "Data\\Music", ".wav", CF_TYPE_VOICE },
|
||||
{ CF_TYPE_MOVIES, "Data\\Movies", ".mve .msb", CF_TYPE_DATA },
|
||||
{ CF_TYPE_INTERFACE, "Data\\Interface", ".pcx .ani .tga", CF_TYPE_DATA },
|
||||
{ CF_TYPE_FONT, "Data\\Fonts", ".vf", CF_TYPE_DATA },
|
||||
{ CF_TYPE_EFFECTS, "Data\\Effects", ".ani .pcx .neb .tga", CF_TYPE_DATA },
|
||||
{ CF_TYPE_HUD, "Data\\Hud", ".ani .pcx .tga", CF_TYPE_DATA },
|
||||
{ CF_TYPE_PLAYER_MAIN, "Data\\Players", "", CF_TYPE_DATA },
|
||||
{ CF_TYPE_PLAYER_IMAGES_MAIN, "Data\\Players\\Images", ".pcx", CF_TYPE_PLAYER_MAIN },
|
||||
{ CF_TYPE_CACHE, "Data\\Cache", ".clr .tmp", CF_TYPE_DATA }, //clr=cached color
|
||||
{ CF_TYPE_PLAYERS, "Data\\Players", ".hcf", CF_TYPE_DATA },
|
||||
{ CF_TYPE_SINGLE_PLAYERS, "Data\\Players\\Single", ".plr .csg .css", CF_TYPE_PLAYERS },
|
||||
{ CF_TYPE_MULTI_PLAYERS, "Data\\Players\\Multi", ".plr", CF_TYPE_DATA },
|
||||
{ CF_TYPE_MULTI_CACHE, "Data\\MultiData", ".pcx .fs2", CF_TYPE_DATA },
|
||||
{ CF_TYPE_CONFIG, "Data\\Config", ".cfg", CF_TYPE_DATA },
|
||||
{ CF_TYPE_SQUAD_IMAGES_MAIN, "Data\\Players\\Squads", ".pcx", CF_TYPE_DATA },
|
||||
{ CF_TYPE_DEMOS, "Data\\Demos", ".fsd", CF_TYPE_DATA },
|
||||
{ CF_TYPE_CBANIMS, "Data\\CBAnims", ".ani", CF_TYPE_DATA },
|
||||
{ CF_TYPE_INTEL_ANIMS, "Data\\IntelAnims", ".ani", CF_TYPE_DATA },
|
||||
{ CF_TYPE_ROOT, "", ".mve", CF_TYPE_ROOT },
|
||||
{ CF_TYPE_DATA, "data", ".cfg .log .txt", CF_TYPE_ROOT },
|
||||
{ CF_TYPE_MAPS, "data" DIR_SEPARATOR_STR "maps", ".pcx .ani .tga", CF_TYPE_DATA },
|
||||
{ CF_TYPE_TEXT, "data" DIR_SEPARATOR_STR "text", ".txt .net", CF_TYPE_DATA },
|
||||
{ CF_TYPE_MISSIONS, "data" DIR_SEPARATOR_STR "missions", ".fs2 .fc2 .ntl .ssv", CF_TYPE_DATA },
|
||||
{ CF_TYPE_MODELS, "data" DIR_SEPARATOR_STR "models", ".pof", CF_TYPE_DATA },
|
||||
{ CF_TYPE_TABLES, "data" DIR_SEPARATOR_STR "tables", ".tbl", CF_TYPE_DATA },
|
||||
{ CF_TYPE_SOUNDS, "data" DIR_SEPARATOR_STR "sounds", ".wav", CF_TYPE_DATA },
|
||||
{ CF_TYPE_SOUNDS_8B22K, "data" DIR_SEPARATOR_STR "sounds" DIR_SEPARATOR_STR "8b22k", ".wav", CF_TYPE_SOUNDS },
|
||||
{ CF_TYPE_SOUNDS_16B11K, "data" DIR_SEPARATOR_STR "sounds" DIR_SEPARATOR_STR "16b11k", ".wav", CF_TYPE_SOUNDS },
|
||||
{ CF_TYPE_VOICE, "data" DIR_SEPARATOR_STR "voice", "", CF_TYPE_DATA },
|
||||
{ CF_TYPE_VOICE_BRIEFINGS, "data" DIR_SEPARATOR_STR "voice" DIR_SEPARATOR_STR "briefing", ".wav", CF_TYPE_VOICE },
|
||||
{ CF_TYPE_VOICE_CMD_BRIEF, "data" DIR_SEPARATOR_STR "voice" DIR_SEPARATOR_STR "command_briefings", ".wav", CF_TYPE_VOICE },
|
||||
{ CF_TYPE_VOICE_DEBRIEFINGS, "data" DIR_SEPARATOR_STR "voice" DIR_SEPARATOR_STR "debriefing", ".wav", CF_TYPE_VOICE },
|
||||
{ CF_TYPE_VOICE_PERSONAS, "data" DIR_SEPARATOR_STR "voice" DIR_SEPARATOR_STR "personas", ".wav", CF_TYPE_VOICE },
|
||||
{ CF_TYPE_VOICE_SPECIAL, "data" DIR_SEPARATOR_STR "voice" DIR_SEPARATOR_STR "special", ".wav", CF_TYPE_VOICE },
|
||||
{ CF_TYPE_VOICE_TRAINING, "data" DIR_SEPARATOR_STR "voice" DIR_SEPARATOR_STR "training", ".wav", CF_TYPE_VOICE },
|
||||
{ CF_TYPE_MUSIC, "data" DIR_SEPARATOR_STR "music", ".wav", CF_TYPE_VOICE },
|
||||
{ CF_TYPE_MOVIES, "data" DIR_SEPARATOR_STR "movies", ".mve .msb", CF_TYPE_DATA },
|
||||
{ CF_TYPE_INTERFACE, "data" DIR_SEPARATOR_STR "interface", ".pcx .ani .tga", CF_TYPE_DATA },
|
||||
{ CF_TYPE_FONT, "data" DIR_SEPARATOR_STR "fonts", ".vf", CF_TYPE_DATA },
|
||||
{ CF_TYPE_EFFECTS, "data" DIR_SEPARATOR_STR "effects", ".ani .pcx .neb .tga", CF_TYPE_DATA },
|
||||
{ CF_TYPE_HUD, "data" DIR_SEPARATOR_STR "hud", ".ani .pcx .tga", CF_TYPE_DATA },
|
||||
{ CF_TYPE_PLAYER_MAIN, "data" DIR_SEPARATOR_STR "players", "", CF_TYPE_DATA },
|
||||
{ CF_TYPE_PLAYER_IMAGES_MAIN, "data" DIR_SEPARATOR_STR "players" DIR_SEPARATOR_STR "images", ".pcx", CF_TYPE_PLAYER_MAIN },
|
||||
{ CF_TYPE_CACHE, "data" DIR_SEPARATOR_STR "cache", ".clr .tmp", CF_TYPE_DATA }, //clr=cached color
|
||||
{ CF_TYPE_PLAYERS, "data" DIR_SEPARATOR_STR "players", ".hcf", CF_TYPE_DATA },
|
||||
{ CF_TYPE_SINGLE_PLAYERS, "data" DIR_SEPARATOR_STR "players" DIR_SEPARATOR_STR "single", ".plr .csg .css", CF_TYPE_PLAYERS },
|
||||
{ CF_TYPE_MULTI_PLAYERS, "data" DIR_SEPARATOR_STR "players" DIR_SEPARATOR_STR "multi", ".plr", CF_TYPE_DATA },
|
||||
{ CF_TYPE_MULTI_CACHE, "data" DIR_SEPARATOR_STR "multidata", ".pcx .fs2", CF_TYPE_DATA },
|
||||
{ CF_TYPE_CONFIG, "data" DIR_SEPARATOR_STR "config", ".cfg", CF_TYPE_DATA },
|
||||
{ CF_TYPE_SQUAD_IMAGES_MAIN, "data" DIR_SEPARATOR_STR "players" DIR_SEPARATOR_STR "squads", ".pcx", CF_TYPE_DATA },
|
||||
{ CF_TYPE_DEMOS, "data" DIR_SEPARATOR_STR "demos", ".fsd", CF_TYPE_DATA },
|
||||
{ CF_TYPE_CBANIMS, "data" DIR_SEPARATOR_STR "cbanims", ".ani", CF_TYPE_DATA },
|
||||
{ CF_TYPE_INTEL_ANIMS, "data" DIR_SEPARATOR_STR "intelanims", ".ani", CF_TYPE_DATA },
|
||||
};
|
||||
|
||||
|
||||
@@ -246,7 +272,13 @@ char *Cfile_cdrom_dir = NULL;
|
||||
int cfget_cfile_block();
|
||||
CFILE *cf_open_fill_cfblock(FILE * fp, int type);
|
||||
CFILE *cf_open_packed_cfblock(FILE *fp, int type, int offset, int size);
|
||||
|
||||
#if defined WIN32
|
||||
CFILE *cf_open_mapped_fill_cfblock(HANDLE hFile, int type);
|
||||
#elif defined unix
|
||||
CFILE *cf_open_mapped_fill_cfblock(FILE *fp, int type);
|
||||
#endif
|
||||
|
||||
void cf_chksum_long_init();
|
||||
|
||||
void cfile_close()
|
||||
@@ -271,13 +303,13 @@ int cfile_in_root_dir(char *exe_path)
|
||||
strncpy(path_copy, exe_path, 2047);
|
||||
|
||||
// count how many slashes there are in the path
|
||||
tok = strtok(path_copy, "\\");
|
||||
tok = strtok(path_copy, DIR_SEPARATOR_STR);
|
||||
if(tok == NULL){
|
||||
return 1;
|
||||
}
|
||||
do {
|
||||
token_count++;
|
||||
tok = strtok(NULL, "\\");
|
||||
tok = strtok(NULL, DIR_SEPARATOR_STR);
|
||||
} while(tok != NULL);
|
||||
|
||||
// root directory if we have <= 1 slash
|
||||
@@ -311,12 +343,16 @@ int cfile_init(char *exe_dir, char *cdrom_dir)
|
||||
|
||||
// are we in a root directory?
|
||||
if(cfile_in_root_dir(buf)){
|
||||
#if defined WIN32
|
||||
MessageBox((HWND)NULL, "Freespace2/Fred2 cannot be run from a drive root directory!", "Error", MB_OK);
|
||||
#elif defined unix
|
||||
fprintf(stderr, "Error: Freespace2/Fred2 cannot be run from a drive root directory!\n");
|
||||
#endif
|
||||
return 1;
|
||||
}
|
||||
|
||||
while (i--) {
|
||||
if (buf[i] == '\\'){
|
||||
if (buf[i] == DIR_SEPARATOR_CHAR){
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -325,7 +361,11 @@ int cfile_init(char *exe_dir, char *cdrom_dir)
|
||||
buf[i] = 0;
|
||||
cfile_chdir(buf);
|
||||
} else {
|
||||
#if defined WIN32
|
||||
MessageBox((HWND)NULL, "Error trying to determine executable root directory!", "Error", MB_OK);
|
||||
#elif defined unix
|
||||
fprintf(stderr, "Error trying to determine executable root directory!\n");
|
||||
#endif
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -357,6 +397,7 @@ void cfile_refresh()
|
||||
}
|
||||
|
||||
|
||||
#ifdef WIN32
|
||||
// Changes to a drive if valid.. 1=A, 2=B, etc
|
||||
// If flag, then changes to it.
|
||||
// Returns 0 if not-valid, 1 if valid.
|
||||
@@ -381,6 +422,7 @@ int cfile_chdrive( int DriveNum, int flag )
|
||||
|
||||
return Valid;
|
||||
}
|
||||
#endif // ifdef WIN32
|
||||
|
||||
// push current directory on a 'stack' (so we can restore it) and change the directory
|
||||
int cfile_push_chdir(int type)
|
||||
@@ -397,14 +439,16 @@ int cfile_push_chdir(int type)
|
||||
|
||||
cf_create_default_path_string( dir, type, NULL );
|
||||
_strlwr(dir);
|
||||
|
||||
Drive = strchr(dir, ':');
|
||||
|
||||
if (Drive) {
|
||||
#ifdef WIN32
|
||||
if (!cfile_chdrive( *(Drive - 1) - 'a' + 1, 1))
|
||||
return 1;
|
||||
|
||||
Path = Drive+1;
|
||||
|
||||
#endif
|
||||
} else {
|
||||
Path = dir;
|
||||
}
|
||||
@@ -416,7 +460,9 @@ int cfile_push_chdir(int type)
|
||||
// This chdir might get a critical error!
|
||||
e = _chdir( Path );
|
||||
if (e) {
|
||||
#ifdef WIN32
|
||||
cfile_chdrive( OriginalDirectory[0] - 'a' + 1, 1 );
|
||||
#endif
|
||||
return 2;
|
||||
}
|
||||
|
||||
@@ -436,11 +482,12 @@ int cfile_chdir(char *dir)
|
||||
|
||||
Drive = strchr(dir, ':');
|
||||
if (Drive) {
|
||||
#ifdef WIN32
|
||||
if (!cfile_chdrive( *(Drive - 1) - 'a' + 1, 1))
|
||||
return 1;
|
||||
|
||||
Path = Drive+1;
|
||||
|
||||
#endif
|
||||
} else {
|
||||
Path = dir;
|
||||
}
|
||||
@@ -452,7 +499,9 @@ int cfile_chdir(char *dir)
|
||||
// This chdir might get a critical error!
|
||||
e = _chdir( Path );
|
||||
if (e) {
|
||||
#ifdef WIN32
|
||||
cfile_chdrive( OriginalDirectory[0] - 'a' + 1, 1 );
|
||||
#endif
|
||||
return 2;
|
||||
}
|
||||
|
||||
@@ -472,7 +521,6 @@ int cfile_flush_dir(int dir_type)
|
||||
{
|
||||
int find_handle;
|
||||
int del_count;
|
||||
_finddata_t find;
|
||||
|
||||
Assert( CF_TYPE_SPECIFIED(dir_type) );
|
||||
|
||||
@@ -482,8 +530,10 @@ int cfile_flush_dir(int dir_type)
|
||||
}
|
||||
|
||||
// proceed to delete the files
|
||||
find_handle = _findfirst( "*", &find );
|
||||
del_count = 0;
|
||||
#if defined WIN32
|
||||
_finddata_t find;
|
||||
find_handle = _findfirst( "*", &find );
|
||||
if (find_handle != -1) {
|
||||
do {
|
||||
if (!(find.attrib & _A_SUBDIR) && !(find.attrib & _A_RDONLY)) {
|
||||
@@ -496,6 +546,27 @@ int cfile_flush_dir(int dir_type)
|
||||
} while (!_findnext(find_handle, &find));
|
||||
_findclose( find_handle );
|
||||
}
|
||||
#elif defined unix
|
||||
glob_t globinfo;
|
||||
memset(&globinfo, 0, sizeof(globinfo));
|
||||
int status = glob("*", 0, NULL, &globinfo);
|
||||
if (status == 0) {
|
||||
for (unsigned int i = 0; i < globinfo.gl_pathc; i++) {
|
||||
// Determine if this is a regular file
|
||||
struct stat statbuf;
|
||||
memset(&statbuf, 0, sizeof(statbuf));
|
||||
stat(globinfo.gl_pathv[i], &statbuf);
|
||||
if (S_ISREG(statbuf.st_mode)) {
|
||||
// delete the file
|
||||
cf_delete(globinfo.gl_pathv[i], dir_type);
|
||||
|
||||
// increment the deleted count
|
||||
del_count++;
|
||||
}
|
||||
}
|
||||
globfree(&globinfo);
|
||||
}
|
||||
#endif
|
||||
|
||||
// pop the directory back
|
||||
cfile_pop_dir();
|
||||
@@ -577,6 +648,7 @@ int cf_exist( char *filename, int dir_type )
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef WIN32
|
||||
void cf_attrib(char *filename, int set, int clear, int dir_type)
|
||||
{
|
||||
char longname[MAX_PATH_LEN];
|
||||
@@ -594,6 +666,7 @@ void cf_attrib(char *filename, int set, int clear, int dir_type)
|
||||
}
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
int cf_rename(char *old_name, char *name, int dir_type)
|
||||
{
|
||||
@@ -746,6 +819,7 @@ CFILE *cfopen(char *file_path, char *mode, int type, int dir_type, bool localize
|
||||
|
||||
// Can't open memory mapped files out of pack files
|
||||
if ( offset == 0 ) {
|
||||
#if defined WIN32
|
||||
HANDLE hFile;
|
||||
|
||||
hFile = CreateFile(longname, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
|
||||
@@ -753,6 +827,12 @@ CFILE *cfopen(char *file_path, char *mode, int type, int dir_type, bool localize
|
||||
if (hFile != INVALID_HANDLE_VALUE) {
|
||||
return cf_open_mapped_fill_cfblock(hFile, dir_type);
|
||||
}
|
||||
#elif defined unix
|
||||
FILE *fp = fopen( longname, "rb" );
|
||||
if (fp) {
|
||||
return cf_open_mapped_fill_cfblock(fp, dir_type);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
} else {
|
||||
@@ -842,6 +922,7 @@ int cfclose( CFILE * cfile )
|
||||
result = 0;
|
||||
if ( cb->data ) {
|
||||
// close memory mapped file
|
||||
#if defined WIN32
|
||||
result = UnmapViewOfFile((void*)cb->data);
|
||||
Assert(result);
|
||||
result = CloseHandle(cb->hInFile);
|
||||
@@ -849,6 +930,10 @@ int cfclose( CFILE * cfile )
|
||||
result = CloseHandle(cb->hMapFile);
|
||||
Assert(result); // Ensure file handle is closed properly
|
||||
result = 0;
|
||||
#elif defined unix
|
||||
result = munmap(cb->data, cb->data_length);
|
||||
Assert(result);
|
||||
#endif
|
||||
|
||||
} else if ( cb->fp != NULL ) {
|
||||
Assert(cb->fp != NULL);
|
||||
@@ -888,7 +973,13 @@ CFILE *cf_open_fill_cfblock(FILE *fp, int type)
|
||||
cfbp->fp = fp;
|
||||
cfbp->dir_type = type;
|
||||
|
||||
#if defined WIN32
|
||||
cf_init_lowlevel_read_code(cfp,0,filelength(fileno(fp)) );
|
||||
#elif defined unix
|
||||
struct stat statbuf;
|
||||
fstat(fileno(fp), &statbuf);
|
||||
cf_init_lowlevel_read_code(cfp, 0, statbuf.st_size );
|
||||
#endif
|
||||
|
||||
return cfp;
|
||||
}
|
||||
@@ -935,7 +1026,11 @@ CFILE *cf_open_packed_cfblock(FILE *fp, int type, int offset, int size)
|
||||
//
|
||||
// returns: ptr CFILE structure.
|
||||
//
|
||||
#if defined WIN32
|
||||
CFILE *cf_open_mapped_fill_cfblock(HANDLE hFile, int type)
|
||||
#elif defined unix
|
||||
CFILE *cf_open_mapped_fill_cfblock(FILE *fp, int type)
|
||||
#endif
|
||||
{
|
||||
int cfile_block_index;
|
||||
|
||||
@@ -951,11 +1046,13 @@ CFILE *cf_open_mapped_fill_cfblock(HANDLE hFile, int type)
|
||||
cfp = &Cfile_list[cfile_block_index];
|
||||
cfp->id = cfile_block_index;
|
||||
cfbp->fp = NULL;
|
||||
#if defined WIN32
|
||||
cfbp->hInFile = hFile;
|
||||
#endif
|
||||
cfbp->dir_type = type;
|
||||
|
||||
cf_init_lowlevel_read_code(cfp,0 , 0 );
|
||||
|
||||
#if defined WIN32
|
||||
cfbp->hMapFile = CreateFileMapping(cfbp->hInFile, NULL, PAGE_READONLY, 0, 0, NULL);
|
||||
if (cfbp->hMapFile == NULL) {
|
||||
nprintf(("Error", "Could not create file-mapping object.\n"));
|
||||
@@ -964,6 +1061,17 @@ CFILE *cf_open_mapped_fill_cfblock(HANDLE hFile, int type)
|
||||
|
||||
cfbp->data = (ubyte*)MapViewOfFile(cfbp->hMapFile, FILE_MAP_READ, 0, 0, 0);
|
||||
Assert( cfbp->data != NULL );
|
||||
#elif defined unix
|
||||
cfbp->fp = fp;
|
||||
cfbp->data = mmap(NULL, // start
|
||||
cfbp->data_length, // length
|
||||
PROT_READ, // prot
|
||||
MAP_SHARED, // flags
|
||||
fileno(fp), // fd
|
||||
0); // offset
|
||||
Assert( cfbp->data != NULL );
|
||||
#endif
|
||||
|
||||
return cfp;
|
||||
}
|
||||
}
|
||||
@@ -1091,14 +1199,14 @@ void cfread_vector(vector *vec, CFILE *file, int ver, vector *deflt)
|
||||
if (deflt)
|
||||
*vec = *deflt;
|
||||
else
|
||||
vec->x = vec->y = vec->z = 0.0f;
|
||||
vec->xyz.x = vec->xyz.y = vec->xyz.z = 0.0f;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
vec->x = cfread_float(file, ver, deflt ? deflt->x : NULL);
|
||||
vec->y = cfread_float(file, ver, deflt ? deflt->y : NULL);
|
||||
vec->z = cfread_float(file, ver, deflt ? deflt->z : NULL);
|
||||
vec->xyz.x = cfread_float(file, ver, deflt ? deflt->xyz.x : 0.0f);
|
||||
vec->xyz.y = cfread_float(file, ver, deflt ? deflt->xyz.y : 0.0f);
|
||||
vec->xyz.z = cfread_float(file, ver, deflt ? deflt->xyz.z : 0.0f);
|
||||
}
|
||||
|
||||
void cfread_angles(angles *ang, CFILE *file, int ver, angles *deflt)
|
||||
@@ -1112,9 +1220,9 @@ void cfread_angles(angles *ang, CFILE *file, int ver, angles *deflt)
|
||||
return;
|
||||
}
|
||||
|
||||
ang->p = cfread_float(file, ver, deflt ? deflt->p : NULL);
|
||||
ang->b = cfread_float(file, ver, deflt ? deflt->b : NULL);
|
||||
ang->h = cfread_float(file, ver, deflt ? deflt->h : NULL);
|
||||
ang->p = cfread_float(file, ver, deflt ? deflt->p : 0.0f);
|
||||
ang->b = cfread_float(file, ver, deflt ? deflt->b : 0.0f);
|
||||
ang->h = cfread_float(file, ver, deflt ? deflt->h : 0.0f);
|
||||
}
|
||||
|
||||
char cfread_char(CFILE *file, int ver, char deflt)
|
||||
@@ -1193,13 +1301,13 @@ int cfwrite_ubyte(ubyte b, CFILE *file)
|
||||
|
||||
int cfwrite_vector(vector *vec, CFILE *file)
|
||||
{
|
||||
if(!cfwrite_float(vec->x, file)){
|
||||
if(!cfwrite_float(vec->xyz.x, file)){
|
||||
return 0;
|
||||
}
|
||||
if(!cfwrite_float(vec->y, file)){
|
||||
if(!cfwrite_float(vec->xyz.y, file)){
|
||||
return 0;
|
||||
}
|
||||
return cfwrite_float(vec->z, file);
|
||||
return cfwrite_float(vec->xyz.z, file);
|
||||
}
|
||||
|
||||
int cfwrite_angles(angles *ang, CFILE *file)
|
||||
|
||||
@@ -9,13 +9,19 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/CFile/cfile.h $
|
||||
* $Revision: 1.1 $
|
||||
* $Date: 2002-06-03 03:25:56 $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:21 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
* <insert description of file here>
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 1.3 2002/05/16 06:03:29 mharris
|
||||
* Unix port changes
|
||||
*
|
||||
* Revision 1.2 2002/05/09 22:58:08 mharris
|
||||
* Added ifdef WIN32 around change-drive functions
|
||||
*
|
||||
* Revision 1.1 2002/05/02 18:03:04 mharris
|
||||
* Initial checkin - converted filenames and includes to lower case
|
||||
*
|
||||
@@ -334,6 +340,16 @@
|
||||
#include <time.h>
|
||||
#include "pstypes.h"
|
||||
|
||||
#if defined WIN32
|
||||
#define DIR_SEPARATOR_CHAR '\\'
|
||||
#define DIR_SEPARATOR_STR "\\"
|
||||
#elif defined unix
|
||||
#define DIR_SEPARATOR_CHAR '/'
|
||||
#define DIR_SEPARATOR_STR "/"
|
||||
#else
|
||||
#error unknown OS
|
||||
#endif
|
||||
|
||||
#define CF_EOF (-1)
|
||||
|
||||
#define CF_SEEK_SET (0)
|
||||
@@ -591,7 +607,10 @@ int cf_find_file_location( char *filespec, int pathtype, char *pack_filename, in
|
||||
|
||||
// Functions to change directories
|
||||
int cfile_chdir(char *dir);
|
||||
|
||||
#ifdef WIN32
|
||||
int cfile_chdrive(int DriveNum, int flag);
|
||||
#endif
|
||||
|
||||
// push current directory on a 'stack' (so we can restore it) and change the directory
|
||||
int cfile_push_chdir(int type);
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/CFile/CfileArchive.cpp $
|
||||
* $Revision: 1.1 $
|
||||
* $Date: 2002-06-03 03:25:56 $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:21 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
* Low-level code for reading data out of large archive files or normal files. All
|
||||
|
||||
@@ -9,14 +9,17 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/CFile/CfileArchive.h $
|
||||
* $Revision: 1.1 $
|
||||
* $Date: 2002-06-03 03:25:56 $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:21 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
* External def's for CfileArchive.cpp. This should only be used
|
||||
* internally by cfile stuff.
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 1.2 2002/05/17 02:56:19 mharris
|
||||
* first crack at unix compatibity
|
||||
*
|
||||
* Revision 1.1 2002/05/02 18:03:04 mharris
|
||||
* Initial checkin - converted filenames and includes to lower case
|
||||
*
|
||||
@@ -60,8 +63,13 @@ typedef struct Cfile_block {
|
||||
int dir_type; // directory location
|
||||
FILE *fp; // File pointer if opening an individual file
|
||||
void *data; // Pointer for memory-mapped file access. NULL if not mem-mapped.
|
||||
#ifdef WIN32
|
||||
HANDLE hInFile; // Handle from CreateFile()
|
||||
HANDLE hMapFile; // Handle from CreateFileMapping()
|
||||
#else
|
||||
// int fd; // file descriptor
|
||||
size_t data_length; // length of data for mmap
|
||||
#endif
|
||||
int lib_offset;
|
||||
int raw_position;
|
||||
int size; // for packed files
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/CFile/CfileList.cpp $
|
||||
* $Revision: 1.1 $
|
||||
* $Date: 2002-06-03 03:25:56 $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:21 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
* Code for doing directory lists and sorts
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/CFile/CfileSystem.cpp $
|
||||
* $Revision: 1.1 $
|
||||
* $Date: 2002-06-03 03:25:56 $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:21 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
* Functions to keep track of and find files that can exist
|
||||
@@ -20,6 +20,21 @@
|
||||
* all those locations, inherently enforcing precedence orders.
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 1.6 2002/05/24 16:44:10 mharris
|
||||
* Fix unix "find files" operations so they return relative path
|
||||
*
|
||||
* Revision 1.5 2002/05/21 15:38:00 mharris
|
||||
* Unix glob changes -- still needs some work as we are getting full pathnames
|
||||
*
|
||||
* Revision 1.4 2002/05/17 23:38:33 mharris
|
||||
* Fixed silly bug in unix find-files code
|
||||
*
|
||||
* Revision 1.3 2002/05/16 06:03:29 mharris
|
||||
* Unix port changes
|
||||
*
|
||||
* Revision 1.2 2002/05/07 13:22:52 mharris
|
||||
* Added errno.h include
|
||||
*
|
||||
* Revision 1.1 2002/05/02 18:03:04 mharris
|
||||
* Initial checkin - converted filenames and includes to lower case
|
||||
*
|
||||
@@ -89,6 +104,12 @@
|
||||
#include <direct.h>
|
||||
#include <windows.h>
|
||||
#include <winbase.h> /* needed for memory mapping of file functions */
|
||||
#include <errno.h>
|
||||
|
||||
#ifdef unix
|
||||
#include <glob.h>
|
||||
#include <sys/stat.h>
|
||||
#endif
|
||||
|
||||
#include "pstypes.h"
|
||||
//#include "outwnd.h"
|
||||
@@ -98,7 +119,6 @@
|
||||
#include "cfilesystem.h"
|
||||
#include "localize.h"
|
||||
|
||||
|
||||
#define CF_ROOTTYPE_PATH 0
|
||||
#define CF_ROOTTYPE_PACK 1
|
||||
|
||||
@@ -222,9 +242,10 @@ int cf_get_packfile_count(cf_root *root)
|
||||
|
||||
if(strlen(Pathtypes[i].path)){
|
||||
strcat( filespec, Pathtypes[i].path );
|
||||
strcat( filespec, "\\" );
|
||||
strcat( filespec, DIR_SEPARATOR_STR );
|
||||
}
|
||||
|
||||
#if defined WIN32
|
||||
strcat( filespec, "*.vp" );
|
||||
|
||||
int find_handle;
|
||||
@@ -242,7 +263,26 @@ int cf_get_packfile_count(cf_root *root)
|
||||
|
||||
_findclose( find_handle );
|
||||
}
|
||||
}
|
||||
#elif defined unix
|
||||
strcat( filespec, "*.[vV][pP]" );
|
||||
|
||||
glob_t globinfo;
|
||||
memset(&globinfo, 0, sizeof(globinfo));
|
||||
int status = glob(filespec, 0, NULL, &globinfo);
|
||||
if (status == 0) {
|
||||
for (unsigned int j = 0; j < globinfo.gl_pathc; j++) {
|
||||
// Determine if this is a regular file
|
||||
struct stat statbuf;
|
||||
memset(&statbuf, 0, sizeof(statbuf));
|
||||
stat(globinfo.gl_pathv[j], &statbuf);
|
||||
if (S_ISREG(statbuf.st_mode)) {
|
||||
packfile_count++;
|
||||
}
|
||||
}
|
||||
globfree(&globinfo);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
return packfile_count;
|
||||
}
|
||||
@@ -291,8 +331,10 @@ void cf_build_pack_list( cf_root *root )
|
||||
|
||||
if(strlen(Pathtypes[i].path)){
|
||||
strcat( filespec, Pathtypes[i].path );
|
||||
strcat( filespec, "\\" );
|
||||
strcat( filespec, DIR_SEPARATOR_STR );
|
||||
}
|
||||
|
||||
#if defined WIN32
|
||||
strcat( filespec, "*.vp" );
|
||||
|
||||
int find_handle;
|
||||
@@ -314,7 +356,7 @@ void cf_build_pack_list( cf_root *root )
|
||||
|
||||
if(strlen(Pathtypes[i].path)){
|
||||
strcat(rptr_sort->path, Pathtypes[i].path );
|
||||
strcat(rptr_sort->path, "\\");
|
||||
strcat(rptr_sort->path, DIR_SEPARATOR_STR);
|
||||
}
|
||||
|
||||
strcat(rptr_sort->path, find.name );
|
||||
@@ -326,6 +368,32 @@ void cf_build_pack_list( cf_root *root )
|
||||
|
||||
_findclose( find_handle );
|
||||
}
|
||||
#elif defined unix
|
||||
strcat( filespec, "*.[vV][pP]" );
|
||||
glob_t globinfo;
|
||||
memset(&globinfo, 0, sizeof(globinfo));
|
||||
int status = glob(filespec, 0, NULL, &globinfo);
|
||||
if (status == 0) {
|
||||
for (unsigned int j = 0; j < globinfo.gl_pathc; j++) {
|
||||
// Determine if this is a regular file
|
||||
struct stat statbuf;
|
||||
memset(&statbuf, 0, sizeof(statbuf));
|
||||
stat(globinfo.gl_pathv[j], &statbuf);
|
||||
if (S_ISREG(statbuf.st_mode)) {
|
||||
Assert(root_index < temp_root_count);
|
||||
|
||||
// get a temp pointer
|
||||
rptr_sort = &temp_roots_sort[root_index++];
|
||||
|
||||
// fill in all the proper info
|
||||
strcpy(rptr_sort->path, globinfo.gl_pathv[j] );
|
||||
rptr_sort->roottype = CF_ROOTTYPE_PACK;
|
||||
rptr_sort->cf_type = i;
|
||||
}
|
||||
}
|
||||
globfree(&globinfo);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
// these should always be the same
|
||||
@@ -368,8 +436,8 @@ void cf_build_root_list(char *cdrom_dir)
|
||||
}
|
||||
|
||||
// do we already have a slash? as in the case of a root directory install
|
||||
if(strlen(root->path) && (root->path[strlen(root->path)-1] != '\\')){
|
||||
strcat(root->path, "\\"); // put trailing backslash on for easier path construction
|
||||
if(strlen(root->path) && (root->path[strlen(root->path)-1] != DIR_SEPARATOR_CHAR)){
|
||||
strcat(root->path, DIR_SEPARATOR_STR); // put trailing backslash on for easier path construction
|
||||
}
|
||||
root->roottype = CF_ROOTTYPE_PATH;
|
||||
|
||||
@@ -425,9 +493,10 @@ void cf_search_root_path(int root_index)
|
||||
|
||||
if(strlen(Pathtypes[i].path)){
|
||||
strcat( search_path, Pathtypes[i].path );
|
||||
strcat( search_path, "\\" );
|
||||
strcat( search_path, DIR_SEPARATOR_STR );
|
||||
}
|
||||
|
||||
#if defined WIN32
|
||||
strcat( search_path, "*.*" );
|
||||
|
||||
int find_handle;
|
||||
@@ -463,7 +532,39 @@ void cf_search_root_path(int root_index)
|
||||
|
||||
_findclose( find_handle );
|
||||
}
|
||||
|
||||
#elif defined unix
|
||||
strcat( search_path, "*" );
|
||||
glob_t globinfo;
|
||||
memset(&globinfo, 0, sizeof(globinfo));
|
||||
int status = glob(search_path, 0, NULL, &globinfo);
|
||||
if (status == 0) {
|
||||
for (unsigned int j = 0; j < globinfo.gl_pathc; j++) {
|
||||
// Determine if this is a regular file
|
||||
struct stat statbuf;
|
||||
memset(&statbuf, 0, sizeof(statbuf));
|
||||
stat(globinfo.gl_pathv[j], &statbuf);
|
||||
if (S_ISREG(statbuf.st_mode)) {
|
||||
char *ext = strchr(globinfo.gl_pathv[j], '.' );
|
||||
if ( ext ) {
|
||||
if ( is_ext_in_list( Pathtypes[i].extensions, ext ) ) {
|
||||
// Found a file!!!!
|
||||
cf_file *file = cf_create_file();
|
||||
|
||||
strcpy( file->name_ext, globinfo.gl_pathv[j] );
|
||||
file->root_index = root_index;
|
||||
file->pathtype_index = i;
|
||||
file->write_time = statbuf.st_mtime;
|
||||
file->size = statbuf.st_size;
|
||||
file->pack_offset = 0; // Mark as a non-packed file
|
||||
|
||||
//mprintf(( "Found file '%s'\n", file->name_ext ));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
globfree(&globinfo);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -520,13 +621,13 @@ void cf_search_root_pack(int root_index)
|
||||
if ( !stricmp( find.filename, ".." )) {
|
||||
int l = strlen(search_path);
|
||||
char *p = &search_path[l-1];
|
||||
while( (p > search_path) && (*p != '\\') ) {
|
||||
while( (p > search_path) && (*p != DIR_SEPARATOR_CHAR) ) {
|
||||
p--;
|
||||
}
|
||||
*p = 0;
|
||||
} else {
|
||||
if ( strlen(search_path) ) {
|
||||
strcat( search_path, "\\" );
|
||||
strcat( search_path, DIR_SEPARATOR_STR );
|
||||
}
|
||||
strcat( search_path, find.filename );
|
||||
}
|
||||
@@ -596,9 +697,11 @@ void cf_build_secondary_filelist(char *cdrom_dir)
|
||||
// Init the path types
|
||||
for (i=0; i<CF_MAX_PATH_TYPES; i++ ) {
|
||||
Assert( Pathtypes[i].index == i );
|
||||
if ( Pathtypes[i].extensions ) {
|
||||
strlwr(Pathtypes[i].extensions);
|
||||
}
|
||||
// [mharris] can't modify constant strings, why do this anyhow???
|
||||
// just need to make sure exts are all lc in the definition...
|
||||
// if ( Pathtypes[i].extensions ) {
|
||||
// strlwr(Pathtypes[i].extensions);
|
||||
// }
|
||||
}
|
||||
|
||||
// Init the root blocks
|
||||
@@ -669,7 +772,15 @@ int cf_find_file_location( char *filespec, int pathtype, char *pack_filename, in
|
||||
if ( strpbrk(filespec,"/\\:") ) { // do we have a full path already?
|
||||
FILE *fp = fopen(filespec, "rb" );
|
||||
if (fp) {
|
||||
if ( size ) *size = filelength(fileno(fp));
|
||||
if ( size ) {
|
||||
#if defined WIN32
|
||||
*size = filelength(fileno(fp));
|
||||
#elif defined unix
|
||||
struct stat statbuf;
|
||||
fstat(fileno(fp), &statbuf);
|
||||
*size = statbuf.st_size;
|
||||
#endif
|
||||
}
|
||||
if ( offset ) *offset = 0;
|
||||
if ( pack_filename ) {
|
||||
strcpy( pack_filename, filespec );
|
||||
@@ -702,7 +813,15 @@ int cf_find_file_location( char *filespec, int pathtype, char *pack_filename, in
|
||||
|
||||
FILE *fp = fopen(longname, "rb" );
|
||||
if (fp) {
|
||||
if ( size ) *size = filelength(fileno(fp));
|
||||
if ( size ) {
|
||||
#if defined WIN32
|
||||
*size = filelength(fileno(fp));
|
||||
#elif defined unix
|
||||
struct stat statbuf;
|
||||
fstat(fileno(fp), &statbuf);
|
||||
*size = statbuf.st_size;
|
||||
#endif
|
||||
}
|
||||
if ( offset ) *offset = 0;
|
||||
if ( pack_filename ) {
|
||||
strcpy( pack_filename, longname );
|
||||
@@ -737,7 +856,7 @@ int cf_find_file_location( char *filespec, int pathtype, char *pack_filename, in
|
||||
strcpy( pack_filename, r->path );
|
||||
if ( f->pack_offset < 1 ) {
|
||||
strcat( pack_filename, Pathtypes[f->pathtype_index].path );
|
||||
strcat( pack_filename, "\\" );
|
||||
strcat( pack_filename, DIR_SEPARATOR_STR );
|
||||
strcat( pack_filename, f->name_ext );
|
||||
}
|
||||
}
|
||||
@@ -759,7 +878,7 @@ int cf_find_file_location( char *filespec, int pathtype, char *pack_filename, in
|
||||
|
||||
if(strlen(Pathtypes[f->pathtype_index].path)){
|
||||
strcat( pack_filename, Pathtypes[f->pathtype_index].path );
|
||||
strcat( pack_filename, "\\" );
|
||||
strcat( pack_filename, DIR_SEPARATOR_STR );
|
||||
}
|
||||
|
||||
strcat( pack_filename, f->name_ext );
|
||||
@@ -822,7 +941,6 @@ int cf_get_file_list( int max, char **list, int pathtype, char *filter, int sort
|
||||
{
|
||||
char *ptr;
|
||||
int i, l, find_handle, num_files = 0, own_flag = 0;
|
||||
_finddata_t find;
|
||||
|
||||
if (max < 1) {
|
||||
Get_file_list_filter = NULL;
|
||||
@@ -840,6 +958,8 @@ int cf_get_file_list( int max, char **list, int pathtype, char *filter, int sort
|
||||
|
||||
cf_create_default_path_string( filespec, pathtype, filter );
|
||||
|
||||
#if defined WIN32
|
||||
_finddata_t find;
|
||||
find_handle = _findfirst( filespec, &find );
|
||||
if (find_handle != -1) {
|
||||
do {
|
||||
@@ -869,6 +989,43 @@ int cf_get_file_list( int max, char **list, int pathtype, char *filter, int sort
|
||||
_findclose( find_handle );
|
||||
}
|
||||
|
||||
#elif defined unix
|
||||
char base_filespec[MAX_PATH_LEN];
|
||||
cf_create_default_path_string( base_filespec, pathtype );
|
||||
int base_filespec_len = strlen(base_filespec);
|
||||
glob_t globinfo;
|
||||
memset(&globinfo, 0, sizeof(globinfo));
|
||||
int status = glob(filespec, 0, NULL, &globinfo);
|
||||
if (status == 0) {
|
||||
for (unsigned int i = 0; i < globinfo.gl_pathc; i++) {
|
||||
// Determine if this is a regular file
|
||||
struct stat statbuf;
|
||||
memset(&statbuf, 0, sizeof(statbuf));
|
||||
stat(globinfo.gl_pathv[i], &statbuf);
|
||||
if (S_ISREG(statbuf.st_mode)) {
|
||||
if ( !Get_file_list_filter || (*Get_file_list_filter)(globinfo.gl_pathv[i]) ) {
|
||||
char *found_file = globinfo.gl_pathv[i];
|
||||
Assert(strncmp(found_file, base_filespec, base_filespec_len) == 0);
|
||||
found_file += base_filespec_len;
|
||||
ptr = strrchr(found_file, '.');
|
||||
if (ptr)
|
||||
l = ptr - found_file;
|
||||
else
|
||||
l = strlen(found_file);
|
||||
|
||||
list[num_files] = (char *)malloc(l + 1);
|
||||
strncpy(list[num_files], found_file, l);
|
||||
list[num_files][l] = 0;
|
||||
if (info)
|
||||
info[num_files].write_time = statbuf.st_mtime;
|
||||
|
||||
num_files++;
|
||||
}
|
||||
}
|
||||
globfree(&globinfo);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
// Search all the packfiles and CD.
|
||||
if ( !Skip_packfile_search ) {
|
||||
@@ -977,8 +1134,11 @@ int cf_get_file_list_preallocated( int max, char arr[][MAX_FILENAME_LEN], char *
|
||||
char filespec[MAX_PATH_LEN];
|
||||
|
||||
cf_create_default_path_string( filespec, pathtype, filter );
|
||||
mprintf(("cf_get_file_list_preallocated looking for type=%d, filter=\"%s\"\n",
|
||||
pathtype, filter));
|
||||
|
||||
// Search the default directories
|
||||
#if defined WIN32
|
||||
int find_handle;
|
||||
_finddata_t find;
|
||||
|
||||
@@ -1010,7 +1170,44 @@ int cf_get_file_list_preallocated( int max, char arr[][MAX_FILENAME_LEN], char *
|
||||
|
||||
_findclose( find_handle );
|
||||
}
|
||||
|
||||
|
||||
#elif defined unix
|
||||
char base_filespec[MAX_PATH_LEN];
|
||||
cf_create_default_path_string( base_filespec, pathtype );
|
||||
int base_filespec_len = strlen(base_filespec);
|
||||
glob_t globinfo;
|
||||
memset(&globinfo, 0, sizeof(globinfo));
|
||||
int status = glob(filespec, 0, NULL, &globinfo);
|
||||
if (status == 0) {
|
||||
for (unsigned int i = 0; i < globinfo.gl_pathc; i++) {
|
||||
// Determine if this is a regular file
|
||||
struct stat statbuf;
|
||||
memset(&statbuf, 0, sizeof(statbuf));
|
||||
stat(globinfo.gl_pathv[i], &statbuf);
|
||||
if (S_ISREG(statbuf.st_mode)) {
|
||||
if ( !Get_file_list_filter || (*Get_file_list_filter)(globinfo.gl_pathv[i]) ) {
|
||||
|
||||
char *found_file = globinfo.gl_pathv[i];
|
||||
Assert(strncmp(found_file, base_filespec, base_filespec_len) == 0);
|
||||
found_file += base_filespec_len;
|
||||
|
||||
strncpy(arr[num_files], found_file, MAX_FILENAME_LEN - 1 );
|
||||
char *ptr = strrchr(arr[num_files], '.');
|
||||
if ( ptr ) {
|
||||
*ptr = 0;
|
||||
}
|
||||
|
||||
if (info) {
|
||||
info[num_files].write_time = statbuf.st_mtime;
|
||||
}
|
||||
|
||||
num_files++;
|
||||
}
|
||||
}
|
||||
}
|
||||
globfree(&globinfo);
|
||||
}
|
||||
#endif
|
||||
|
||||
// Search all the packfiles and CD.
|
||||
if ( !Skip_packfile_search ) {
|
||||
@@ -1095,7 +1292,7 @@ void cf_create_default_path_string( char *path, int pathtype, char *filename, bo
|
||||
|
||||
// Don't add slash for root directory
|
||||
if (Pathtypes[pathtype].path[0] != '\0') {
|
||||
strcat(path, "\\");
|
||||
strcat(path, DIR_SEPARATOR_STR);
|
||||
}
|
||||
|
||||
// add filename
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/CFile/CfileSystem.h $
|
||||
* $Revision: 1.1 $
|
||||
* $Date: 2002-06-03 03:25:56 $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:21 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
* Functions to keep track of and find files that can exist
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Cfilearchiver/CfileArchiver.cpp $
|
||||
* $Revision: 1.1 $
|
||||
* $Date: 2002-06-03 03:25:56 $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:21 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
* Program to create an archive file for use with cfile stuff
|
||||
|
||||
@@ -9,11 +9,17 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Cmdline/cmdline.cpp $
|
||||
* $Revision: 1.1 $
|
||||
* $Date: 2002-06-03 03:25:56 $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:21 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 1.3 2002/05/08 17:29:17 mharris
|
||||
* more port tweaks
|
||||
*
|
||||
* Revision 1.2 2002/05/07 13:22:14 mharris
|
||||
* added pstypes.h include
|
||||
*
|
||||
* Revision 1.1 2002/05/02 18:03:04 mharris
|
||||
* Initial checkin - converted filenames and includes to lower case
|
||||
*
|
||||
@@ -190,6 +196,7 @@
|
||||
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include "pstypes.h"
|
||||
#include "cmdline.h"
|
||||
#include "linklist.h"
|
||||
#include "systemvars.h"
|
||||
@@ -408,10 +415,8 @@ void os_init_cmdline(char *cmdline)
|
||||
}
|
||||
|
||||
|
||||
|
||||
os_parse_parms(cmdline);
|
||||
os_validate_parms(cmdline);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -477,9 +482,39 @@ char *cmdline_parm::str()
|
||||
}
|
||||
|
||||
// external entry point into this modules
|
||||
#ifdef WIN32
|
||||
int parse_cmdline(char *cmdline)
|
||||
#else
|
||||
int parse_cmdline(int argc, char *argv[])
|
||||
#endif
|
||||
{
|
||||
#ifdef WIN32
|
||||
os_init_cmdline(cmdline);
|
||||
#else
|
||||
if (argc > 1) {
|
||||
// kind of silly -- combine arg list into single string for parsing,
|
||||
// but it fits with the win32-centric existing code.
|
||||
char *cmdline = NULL;
|
||||
unsigned int arglen = 0;
|
||||
int i;
|
||||
for (i = 1; i < argc; i++)
|
||||
arglen += strlen(argv[i]);
|
||||
if (argc > 2)
|
||||
arglen += argc - 2; // leave room for the separators
|
||||
cmdline = new char [arglen+1];
|
||||
i = 1;
|
||||
strcpy(cmdline, argv[i]);
|
||||
for ( ; i < argc; i++) {
|
||||
strcat(cmdline, " ");
|
||||
strcat(cmdline, argv[i]);
|
||||
}
|
||||
os_init_cmdline(cmdline);
|
||||
delete [] cmdline;
|
||||
} else {
|
||||
// no cmdline args
|
||||
os_init_cmdline("");
|
||||
}
|
||||
#endif
|
||||
|
||||
// is this a standalone server??
|
||||
if (standalone_arg.found()) {
|
||||
|
||||
@@ -9,11 +9,14 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Cmdline/cmdline.h $
|
||||
* $Revision: 1.1 $
|
||||
* $Date: 2002-06-03 03:25:56 $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:21 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 1.2 2002/05/08 17:29:17 mharris
|
||||
* more port tweaks
|
||||
*
|
||||
* Revision 1.1 2002/05/02 18:03:04 mharris
|
||||
* Initial checkin - converted filenames and includes to lower case
|
||||
*
|
||||
@@ -151,7 +154,11 @@
|
||||
#ifndef FS_CMDLINE_HEADER_FILE
|
||||
#define FS_CMDLINE_HEADER_FILE
|
||||
|
||||
#ifdef WIN32
|
||||
int parse_cmdline(char *cmdline);
|
||||
#else
|
||||
int parse_cmdline(int argc, char *argv[]);
|
||||
#endif
|
||||
|
||||
// COMMAND LINE SETTINGS
|
||||
// This section is for reference by all the *_init() functions. For example, the multiplayer init function
|
||||
|
||||
@@ -9,13 +9,16 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/CMeasure/CMeasure.cpp $
|
||||
* $Revision: 1.1 $
|
||||
* $Date: 2002-06-03 03:25:56 $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:21 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
* Counter measures. Created by Mike Kulas, May 12, 1997.
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 1.2 2002/05/03 22:07:08 mharris
|
||||
* got some stuff to compile
|
||||
*
|
||||
* Revision 1.1 2002/05/02 18:03:04 mharris
|
||||
* Initial checkin - converted filenames and includes to lower case
|
||||
*
|
||||
@@ -445,7 +448,7 @@ int cmeasure_create( object * source_obj, vector * pos, int cm_type, int rand_va
|
||||
|
||||
vector vel, rand_vec;
|
||||
|
||||
vm_vec_scale_add(&vel, &source_obj->phys_info.vel, &source_obj->orient.fvec, -25.0f);
|
||||
vm_vec_scale_add(&vel, &source_obj->phys_info.vel, &source_obj->orient.vec.fvec, -25.0f);
|
||||
|
||||
static_randvec(arand+1, &rand_vec);
|
||||
|
||||
@@ -460,8 +463,8 @@ int cmeasure_create( object * source_obj, vector * pos, int cm_type, int rand_va
|
||||
obj->phys_info.side_slip_time_const = 10000.0f;
|
||||
|
||||
vm_vec_zero(&obj->phys_info.max_vel); // make so he can't turn on his own VOLITION anymore.
|
||||
obj->phys_info.max_vel.z = -25.0f;
|
||||
vm_vec_copy_scale(&obj->phys_info.desired_vel, &obj->orient.fvec, obj->phys_info.max_vel.z );
|
||||
obj->phys_info.max_vel.xyz.z = -25.0f;
|
||||
vm_vec_copy_scale(&obj->phys_info.desired_vel, &obj->orient.vec.fvec, obj->phys_info.max_vel.xyz.z );
|
||||
|
||||
vm_vec_zero(&obj->phys_info.max_rotvel); // make so he can't change speed on his own VOLITION anymore.
|
||||
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/CMeasure/CMeasure.h $
|
||||
* $Revision: 1.1 $
|
||||
* $Date: 2002-06-03 03:25:56 $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:21 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
* Counter measures. Created by Mike Kulas, May 12, 1997.
|
||||
|
||||
@@ -9,13 +9,22 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/ControlConfig/ControlsConfig.cpp $
|
||||
* $Revision: 1.1 $
|
||||
* $Date: 2002-06-03 03:25:56 $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:21 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
* C module for keyboard, joystick and mouse configuration
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 1.4 2002/05/16 06:06:23 mharris
|
||||
* ifndef NO_JOYSTICK
|
||||
*
|
||||
* Revision 1.3 2002/05/10 20:42:43 mharris
|
||||
* use "ifndef NO_NETWORK" all over the place
|
||||
*
|
||||
* Revision 1.2 2002/05/10 06:08:08 mharris
|
||||
* Porting... added ifndef NO_SOUND
|
||||
*
|
||||
* Revision 1.1 2002/05/02 18:03:04 mharris
|
||||
* Initial checkin - converted filenames and includes to lower case
|
||||
*
|
||||
@@ -310,13 +319,16 @@
|
||||
#include "font.h"
|
||||
#include "hud.h"
|
||||
#include "managepilot.h"
|
||||
#include "multi_pmsg.h"
|
||||
#include "contexthelp.h"
|
||||
#include "popup.h"
|
||||
#include "uidefs.h"
|
||||
#include "multiutil.h"
|
||||
#include "alphacolors.h"
|
||||
|
||||
#ifndef NO_NETWORK
|
||||
#include "multi_pmsg.h"
|
||||
#include "multiutil.h"
|
||||
#endif
|
||||
|
||||
#define NUM_SYSTEM_KEYS 14
|
||||
#define NUM_BUTTONS 19
|
||||
#define NUM_TABS 4
|
||||
@@ -1137,12 +1149,15 @@ int control_config_clear_all()
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifndef NO_JOYSTICK
|
||||
extern Joy_info joystick;
|
||||
#endif
|
||||
|
||||
int control_config_axis_default(int axis)
|
||||
{
|
||||
Assert(axis >= 0);
|
||||
|
||||
#ifndef NO_JOYSTICK
|
||||
if ( axis > 1 ) {
|
||||
if (Axis_map_to_defaults[axis] < 0)
|
||||
return -1;
|
||||
@@ -1152,6 +1167,9 @@ int control_config_axis_default(int axis)
|
||||
}
|
||||
|
||||
return Axis_map_to_defaults[axis];
|
||||
#else
|
||||
return -1;
|
||||
#endif
|
||||
}
|
||||
|
||||
int control_config_do_reset()
|
||||
@@ -1328,7 +1346,7 @@ void control_config_do_bind()
|
||||
CC_Buttons[gr_screen.res][CANCEL_BUTTON].button.set_hotkey(KEY_ESC);
|
||||
|
||||
for (i=0; i<JOY_TOTAL_BUTTONS; i++){
|
||||
joy_down_count(i); // clear checking status of all joystick buttons
|
||||
joy_down_count(i, 1); // clear checking status of all joystick buttons
|
||||
}
|
||||
|
||||
control_config_detect_axis_reset();
|
||||
@@ -1356,7 +1374,7 @@ void control_config_do_search()
|
||||
CC_Buttons[gr_screen.res][CANCEL_BUTTON].button.set_hotkey(KEY_ESC);
|
||||
|
||||
for (i=0; i<JOY_TOTAL_BUTTONS; i++){
|
||||
joy_down_count(i); // clear checking status of all joystick buttons
|
||||
joy_down_count(i, 1); // clear checking status of all joystick buttons
|
||||
}
|
||||
|
||||
Binding_mode = 0;
|
||||
@@ -1704,7 +1722,7 @@ void control_config_do_frame(float frametime)
|
||||
bind = 1;
|
||||
|
||||
for (i=0; i<JOY_TOTAL_BUTTONS; i++)
|
||||
if (joy_down_count(i))
|
||||
if (joy_down_count(i, 1))
|
||||
bind = 1;
|
||||
|
||||
if (bind) {
|
||||
@@ -1785,7 +1803,7 @@ void control_config_do_frame(float frametime)
|
||||
}
|
||||
|
||||
for (i=0; i<JOY_TOTAL_BUTTONS; i++)
|
||||
if (joy_down_count(i)) {
|
||||
if (joy_down_count(i, 1)) {
|
||||
z = Cc_lines[Selected_line].cc_index;
|
||||
Assert(!(z & JOY_AXIS));
|
||||
control_config_bind_joy(z, i);
|
||||
@@ -1870,7 +1888,7 @@ void control_config_do_frame(float frametime)
|
||||
}
|
||||
|
||||
for (i=0; i<JOY_TOTAL_BUTTONS; i++)
|
||||
if (joy_down_count(i)) {
|
||||
if (joy_down_count(i, 1)) {
|
||||
j = i;
|
||||
for (i=0; i<CCFG_MAX; i++)
|
||||
if (Control_config[i].joy_id == j) {
|
||||
@@ -2378,13 +2396,15 @@ int check_control(int id, int key)
|
||||
|
||||
last_key = key;
|
||||
|
||||
#ifndef NO_NETWORK
|
||||
// if we're in multiplayer text enter (for chat) mode, check to see if we should ignore controls
|
||||
if ((Game_mode & GM_MULTIPLAYER) && multi_ignore_controls()){
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (Control_config[id].type == CC_TYPE_CONTINUOUS) {
|
||||
if (joy_down(Control_config[id].joy_id) || joy_down_count(Control_config[id].joy_id)) {
|
||||
if (joy_down(Control_config[id].joy_id) || joy_down_count(Control_config[id].joy_id, 1)) {
|
||||
control_used(id);
|
||||
return 1;
|
||||
}
|
||||
@@ -2424,7 +2444,7 @@ int check_control(int id, int key)
|
||||
return 0;
|
||||
}
|
||||
|
||||
if ((Control_config[id].key_id == key) || joy_down_count(Control_config[id].joy_id) || mouse_down_count(1 << Control_config[id].joy_id)) {
|
||||
if ((Control_config[id].key_id == key) || joy_down_count(Control_config[id].joy_id, 1) || mouse_down_count(1 << Control_config[id].joy_id)) {
|
||||
control_used(id);
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/ControlConfig/ControlsConfig.h $
|
||||
* $Revision: 1.1 $
|
||||
* $Date: 2002-06-03 03:25:56 $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:21 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
* Header file for keyboard, joystick and mouse configuration
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/ControlConfig/ControlsConfigCommon.cpp $
|
||||
* $Revision: 1.1 $
|
||||
* $Date: 2002-06-03 03:25:56 $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:21 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
* C module for keyboard, joystick and mouse configuration common stuff (between Fred and FreeSpace)
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Cryptstring/cryptstring.cpp $
|
||||
* $Revision: 1.1 $
|
||||
* $Date: 2002-06-03 03:25:56 $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:21 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
* Applet for crypting strings.
|
||||
|
||||
@@ -9,13 +9,22 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Cutscene/Cutscenes.cpp $
|
||||
* $Revision: 1.1 $
|
||||
* $Date: 2002-06-03 03:25:56 $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:21 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
* Code for the cutscenes viewer screen
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 1.4 2002/05/16 00:39:47 mharris
|
||||
* Added ifdef WIN32 around cd stuff
|
||||
*
|
||||
* Revision 1.3 2002/05/13 21:43:37 mharris
|
||||
* A little more network and sound cleanup
|
||||
*
|
||||
* Revision 1.2 2002/05/07 02:57:33 mharris
|
||||
* make Buttons[] static
|
||||
*
|
||||
* Revision 1.1 2002/05/02 18:03:04 mharris
|
||||
* Initial checkin - converted filenames and includes to lower case
|
||||
*
|
||||
@@ -163,7 +172,7 @@ int Cutscenes_viewable;
|
||||
int Description_index;
|
||||
cutscene_info Cutscenes[MAX_CUTSCENES];
|
||||
|
||||
extern int All_movies_enabled; // If set, all movies may be viewed. Keyed off cheat code.
|
||||
//extern int All_movies_enabled; // If set, all movies may be viewed. Keyed off cheat code.
|
||||
|
||||
// initialization stuff for cutscenes
|
||||
void cutscene_init()
|
||||
@@ -214,6 +223,7 @@ void cutscene_init()
|
||||
// returns -1 on failure.
|
||||
int cutscenes_get_cd_num( char *filename )
|
||||
{
|
||||
#ifdef WIN32
|
||||
#if defined(OEM_BUILD)
|
||||
return 0; // only 1 cd for OEM
|
||||
#else
|
||||
@@ -227,6 +237,9 @@ int cutscenes_get_cd_num( char *filename )
|
||||
|
||||
return -1;
|
||||
#endif // defined(OEM_BUILD)
|
||||
#else // !WIN32
|
||||
return -1;
|
||||
#endif // ifdef WIN32
|
||||
}
|
||||
|
||||
// marks a cutscene as viewable
|
||||
@@ -263,7 +276,7 @@ static int Background_bitmap;
|
||||
static UI_BUTTON List_region;
|
||||
static UI_WINDOW Ui_window;
|
||||
|
||||
ui_button_info Buttons[GR_NUM_RESOLUTIONS][NUM_BUTTONS] = {
|
||||
static ui_button_info Buttons[GR_NUM_RESOLUTIONS][NUM_BUTTONS] = {
|
||||
{ // GR_640
|
||||
ui_button_info("TDB_00", 7, 5, 37, 7, 0), // tech database 1
|
||||
ui_button_info("TDB_01", 7, 19, 37, 23, 1), // tech database 2
|
||||
@@ -344,6 +357,7 @@ static char *Text_lines[MAX_TEXT_LINES];
|
||||
|
||||
int cutscenes_validate_cd(char *mve_name, int prompt_for_cd)
|
||||
{
|
||||
#ifdef WIN32
|
||||
int cd_present = 0;
|
||||
int cd_drive_num;
|
||||
int cd_mve_is_on;
|
||||
@@ -411,6 +425,9 @@ int cutscenes_validate_cd(char *mve_name, int prompt_for_cd)
|
||||
}
|
||||
|
||||
return cd_present;
|
||||
#else // !WIN32
|
||||
return 0;
|
||||
#endif // ifdef WIN32
|
||||
}
|
||||
|
||||
void cutscenes_screen_play()
|
||||
@@ -585,8 +602,8 @@ void cutscenes_screen_init()
|
||||
//Cutscenes_viewable = 0xffffffff; // makes all cutscenes viewble.
|
||||
#endif
|
||||
|
||||
if (All_movies_enabled)
|
||||
Cutscenes_viewable = 0xffffffff; // Cheat code enables all movies.
|
||||
// if (All_movies_enabled)
|
||||
// Cutscenes_viewable = 0xffffffff; // Cheat code enables all movies.
|
||||
|
||||
Num_files = 0;
|
||||
for ( i = 0; i < Num_cutscenes; i++ ) {
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Cutscene/Cutscenes.h $
|
||||
* $Revision: 1.1 $
|
||||
* $Date: 2002-06-03 03:25:56 $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:21 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
* Code for the cutscenes viewer screen
|
||||
|
||||
@@ -9,13 +9,22 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Debris/Debris.cpp $
|
||||
* $Revision: 1.1 $
|
||||
* $Date: 2002-06-03 03:25:56 $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:21 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
* Code for the pieces of exploding object debris.
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 1.4 2002/05/13 21:43:37 mharris
|
||||
* A little more network and sound cleanup
|
||||
*
|
||||
* Revision 1.3 2002/05/10 20:42:43 mharris
|
||||
* use "ifndef NO_NETWORK" all over the place
|
||||
*
|
||||
* Revision 1.2 2002/05/03 22:07:08 mharris
|
||||
* got some stuff to compile
|
||||
*
|
||||
* Revision 1.1 2002/05/02 18:03:04 mharris
|
||||
* Initial checkin - converted filenames and includes to lower case
|
||||
*
|
||||
@@ -219,14 +228,17 @@
|
||||
#include "objectsnd.h"
|
||||
#include "linklist.h"
|
||||
#include "systemvars.h"
|
||||
#include "multi.h"
|
||||
#include "multimsgs.h"
|
||||
#include "particle.h"
|
||||
#include "freespace.h"
|
||||
#include "multiutil.h"
|
||||
#include "objcollide.h"
|
||||
#include "timer.h"
|
||||
|
||||
#ifndef NO_NETWORK
|
||||
#include "multi.h"
|
||||
#include "multimsgs.h"
|
||||
#include "multiutil.h"
|
||||
#endif
|
||||
|
||||
#define MAX_LIFE 10.0f
|
||||
#define MIN_RADIUS_FOR_PERSISTANT_DEBRIS 50 // ship radius at which debris from it becomes persistant
|
||||
#define DEBRIS_SOUND_DELAY 2000 // time to start debris sound after created
|
||||
@@ -270,8 +282,10 @@ static void debris_start_death_roll(object *debris_obj, debris *debris_p)
|
||||
{
|
||||
if (debris_p->is_hull) {
|
||||
// tell everyone else to blow up the piece of debris
|
||||
#ifndef NO_NETWORK
|
||||
if( MULTIPLAYER_MASTER )
|
||||
send_debris_update_packet(debris_obj,DEBRIS_UPDATE_NUKE);
|
||||
#endif
|
||||
|
||||
int fireball_type = FIREBALL_EXPLOSION_LARGE1 + rand()%FIREBALL_NUM_LARGE_EXPLOSIONS;
|
||||
fireball_create( &debris_obj->pos, fireball_type, OBJ_INDEX(debris_obj), debris_obj->radius*1.75f);
|
||||
@@ -495,7 +509,9 @@ void debris_process_post(object * obj, float frame_time)
|
||||
radar_plot_object( obj );
|
||||
|
||||
if ( timestamp_elapsed(db->sound_delay) ) {
|
||||
#ifndef NO_SOUND
|
||||
obj_snd_assign(objnum, SND_DEBRIS, &vmd_zero_vector, 0);
|
||||
#endif
|
||||
db->sound_delay = 0;
|
||||
}
|
||||
} else {
|
||||
@@ -775,9 +791,11 @@ object *debris_create(object *source_obj, int model_num, int submodel_num, vecto
|
||||
// assign the network signature. The signature will be 0 for non-hull pieces, but since that
|
||||
// is our invalid signature, it should be okay.
|
||||
obj->net_signature = 0;
|
||||
#ifndef NO_NETWORK
|
||||
if ( (Game_mode & GM_MULTIPLAYER) && hull_flag ) {
|
||||
obj->net_signature = multi_get_next_network_signature( MULTI_SIG_DEBRIS );
|
||||
}
|
||||
#endif
|
||||
|
||||
// -- No long need shield: bset_shield_strength(obj, 100.0f); // Hey! Set to some meaningful value!
|
||||
|
||||
@@ -952,10 +970,12 @@ void debris_hit(object *debris_obj, object *other_obj, vector *hitpos, float dam
|
||||
particle_emit( &pe, PARTICLE_FIRE, 0 );
|
||||
}
|
||||
|
||||
#ifndef NO_NETWORK
|
||||
// multiplayer clients bail here
|
||||
if(MULTIPLAYER_CLIENT){
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
if ( damage < 0.0f ) {
|
||||
damage = 0.0f;
|
||||
@@ -967,9 +987,11 @@ void debris_hit(object *debris_obj, object *other_obj, vector *hitpos, float dam
|
||||
debris_start_death_roll(debris_obj, debris_p );
|
||||
} else {
|
||||
// otherwise, give all the other players an update on the debris
|
||||
#ifndef NO_NETWORK
|
||||
if(MULTIPLAYER_MASTER){
|
||||
send_debris_update_packet(debris_obj,DEBRIS_UPDATE_UPDATE);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1087,7 +1109,8 @@ int debris_check_collision(object *pdebris, object *other_obj, vector *hitpos, c
|
||||
pm = model_get(Ships[heavy_obj->instance].modelnum);
|
||||
|
||||
// turn off all rotating submodels and test for collision
|
||||
for (int i=0; i<num_rotating_submodels; i++) {
|
||||
int i;
|
||||
for (i=0; i<num_rotating_submodels; i++) {
|
||||
pm->submodel[submodel_list[i]].blown_off = 1;
|
||||
}
|
||||
|
||||
@@ -1247,25 +1270,25 @@ int debris_get_team(object *objp)
|
||||
void calc_debris_physics_properties( physics_info *pi, vector *mins, vector *maxs )
|
||||
{
|
||||
float dx, dy, dz, mass;
|
||||
dx = maxs->x - mins->x;
|
||||
dy = maxs->y - mins->y;
|
||||
dz = maxs->z - mins->z;
|
||||
dx = maxs->xyz.x - mins->xyz.x;
|
||||
dy = maxs->xyz.y - mins->xyz.y;
|
||||
dz = maxs->xyz.z - mins->xyz.z;
|
||||
|
||||
// John, with new bspgen, just set pi->mass = mass
|
||||
mass = 0.12f * dx * dy * dz;
|
||||
pi->mass = (float) pow(mass, 0.6666667f) * 4.65f;
|
||||
|
||||
pi->I_body_inv.rvec.x = 12.0f / (pi->mass * (dy*dy + dz*dz));
|
||||
pi->I_body_inv.rvec.y = 0.0f;
|
||||
pi->I_body_inv.rvec.z = 0.0f;
|
||||
pi->I_body_inv.vec.rvec.xyz.x = 12.0f / (pi->mass * (dy*dy + dz*dz));
|
||||
pi->I_body_inv.vec.rvec.xyz.y = 0.0f;
|
||||
pi->I_body_inv.vec.rvec.xyz.z = 0.0f;
|
||||
|
||||
pi->I_body_inv.uvec.x = 0.0f;
|
||||
pi->I_body_inv.uvec.y = 12.0f / (pi->mass * (dx*dx + dz*dz));
|
||||
pi->I_body_inv.uvec.z = 0.0f;
|
||||
pi->I_body_inv.vec.uvec.xyz.x = 0.0f;
|
||||
pi->I_body_inv.vec.uvec.xyz.y = 12.0f / (pi->mass * (dx*dx + dz*dz));
|
||||
pi->I_body_inv.vec.uvec.xyz.z = 0.0f;
|
||||
|
||||
pi->I_body_inv.fvec.x = 0.0f;
|
||||
pi->I_body_inv.fvec.y = 0.0f;
|
||||
pi->I_body_inv.fvec.z = 12.0f / (pi->mass * (dx*dx + dy*dy));
|
||||
pi->I_body_inv.vec.fvec.xyz.x = 0.0f;
|
||||
pi->I_body_inv.vec.fvec.xyz.y = 0.0f;
|
||||
pi->I_body_inv.vec.fvec.xyz.z = 12.0f / (pi->mass * (dx*dx + dy*dy));
|
||||
}
|
||||
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Debris/Debris.h $
|
||||
* $Revision: 1.1 $
|
||||
* $Date: 2002-06-03 03:25:56 $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:21 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
* Code for the pieces of exploding object debris.
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/DebugConsole/Console.cpp $
|
||||
* $Revision: 1.1 $
|
||||
* $Date: 2002-06-03 03:25:56 $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:21 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
* Routines for managing the debug console window.
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Demo/Demo.cpp $
|
||||
* $Revision: 1.1 $
|
||||
* $Date: 2002-06-03 03:25:56 $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:21 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
*
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Demo/Demo.h $
|
||||
* $Revision: 1.1 $
|
||||
* $Date: 2002-06-03 03:25:56 $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:21 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
*
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* Content: Direct3D internal include file
|
||||
*@@BEGIN_MSINTERNAL
|
||||
*
|
||||
* $Id: vd3di.h,v 1.1 2002-06-03 03:25:56 penguin Exp $
|
||||
* $Id: vd3di.h,v 2.0 2002-06-03 04:02:21 penguin Exp $
|
||||
*
|
||||
* History:
|
||||
* Date By Reason
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/ExceptionHandler/ExceptionHandler.cpp $
|
||||
* $Revision: 1.1 $
|
||||
* $Date: 2002-06-03 03:25:57 $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:22 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
* Main file for dealing with exception handling
|
||||
|
||||
@@ -9,13 +9,16 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/ExceptionHandler/ExceptionHandler.h $
|
||||
* $Revision: 1.1 $
|
||||
* $Date: 2002-06-03 03:25:57 $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:22 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
* Header file for program exception handling
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 1.2 2002/05/07 02:58:10 mharris
|
||||
* ifdef around pragma
|
||||
*
|
||||
* Revision 1.1 2002/05/02 18:03:05 mharris
|
||||
* Initial checkin - converted filenames and includes to lower case
|
||||
*
|
||||
@@ -29,7 +32,9 @@
|
||||
* $NoKeywords: $
|
||||
*/
|
||||
|
||||
#ifdef MSVC
|
||||
#pragma once // Include this file only once
|
||||
#endif
|
||||
|
||||
#ifndef __EXCEPTION_HANDLER_H
|
||||
#define __EXCEPTION_HANDLER_H
|
||||
|
||||
@@ -9,13 +9,16 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Fireball/FireBalls.cpp $
|
||||
* $Revision: 1.1 $
|
||||
* $Date: 2002-06-03 03:25:57 $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:22 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
* Code to move, render and otherwise deal with fireballs.
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 1.2 2002/05/03 22:07:08 mharris
|
||||
* got some stuff to compile
|
||||
*
|
||||
* Revision 1.1 2002/05/02 18:03:07 mharris
|
||||
* Initial checkin - converted filenames and includes to lower case
|
||||
*
|
||||
@@ -921,7 +924,7 @@ int fireball_get_lod(vector *pos, fireball_info *fd, float size)
|
||||
vector temp;
|
||||
|
||||
behind = 1;
|
||||
vm_vec_scale_add(&temp, &Eye_position, &Eye_matrix.fvec, dist);
|
||||
vm_vec_scale_add(&temp, &Eye_position, &Eye_matrix.vec.fvec, dist);
|
||||
g3_rotate_vertex(&v, &temp);
|
||||
|
||||
// if still behind, bail and go with default
|
||||
@@ -1088,8 +1091,8 @@ int fireball_create( vector * pos, int fireball_type, int parent_obj, float size
|
||||
if (reverse) {
|
||||
fb->orient = 1;
|
||||
// if warp out, then reverse the orientation
|
||||
vm_vec_scale( &obj->orient.fvec, -1.0f ); // Reverse the forward vector
|
||||
vm_vec_scale( &obj->orient.rvec, -1.0f ); // Reverse the right vector
|
||||
vm_vec_scale( &obj->orient.vec.fvec, -1.0f ); // Reverse the forward vector
|
||||
vm_vec_scale( &obj->orient.vec.rvec, -1.0f ); // Reverse the right vector
|
||||
} else {
|
||||
fb->orient = 0;
|
||||
}
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Fireball/FireBalls.h $
|
||||
* $Revision: 1.1 $
|
||||
* $Date: 2002-06-03 03:25:57 $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:22 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
* Prototypes for fireball functions
|
||||
|
||||
@@ -9,13 +9,16 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Fireball/WarpInEffect.cpp $
|
||||
* $Revision: 1.1 $
|
||||
* $Date: 2002-06-03 03:25:57 $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:22 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
* Code for rendering the warp in effects for ships
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 1.2 2002/05/03 22:07:08 mharris
|
||||
* got some stuff to compile
|
||||
*
|
||||
* Revision 1.1 2002/05/02 18:03:07 mharris
|
||||
* Initial checkin - converted filenames and includes to lower case
|
||||
*
|
||||
@@ -172,28 +175,28 @@ void warpin_render(matrix *orient, vector *pos, int texture_bitmap_num, float ra
|
||||
|
||||
vector center;
|
||||
|
||||
vm_vec_scale_add( ¢er, pos, &orient->fvec, -(max_radius/2.5f)/3.0f );
|
||||
vm_vec_scale_add( ¢er, pos, &orient->vec.fvec, -(max_radius/2.5f)/3.0f );
|
||||
|
||||
vector vecs[5];
|
||||
vertex verts[5];
|
||||
|
||||
vm_vec_scale_add( &vecs[0], ¢er, &orient->uvec, radius );
|
||||
vm_vec_scale_add2( &vecs[0], &orient->rvec, -radius );
|
||||
vm_vec_scale_add2( &vecs[0], &orient->fvec, Grid_depth );
|
||||
vm_vec_scale_add( &vecs[0], ¢er, &orient->vec.uvec, radius );
|
||||
vm_vec_scale_add2( &vecs[0], &orient->vec.rvec, -radius );
|
||||
vm_vec_scale_add2( &vecs[0], &orient->vec.fvec, Grid_depth );
|
||||
|
||||
vm_vec_scale_add( &vecs[1], ¢er, &orient->uvec, radius );
|
||||
vm_vec_scale_add2( &vecs[1], &orient->rvec, radius );
|
||||
vm_vec_scale_add2( &vecs[1], &orient->fvec, Grid_depth );
|
||||
vm_vec_scale_add( &vecs[1], ¢er, &orient->vec.uvec, radius );
|
||||
vm_vec_scale_add2( &vecs[1], &orient->vec.rvec, radius );
|
||||
vm_vec_scale_add2( &vecs[1], &orient->vec.fvec, Grid_depth );
|
||||
|
||||
vm_vec_scale_add( &vecs[2], ¢er, &orient->uvec, -radius );
|
||||
vm_vec_scale_add2( &vecs[2], &orient->rvec, radius );
|
||||
vm_vec_scale_add2( &vecs[2], &orient->fvec, Grid_depth );
|
||||
vm_vec_scale_add( &vecs[2], ¢er, &orient->vec.uvec, -radius );
|
||||
vm_vec_scale_add2( &vecs[2], &orient->vec.rvec, radius );
|
||||
vm_vec_scale_add2( &vecs[2], &orient->vec.fvec, Grid_depth );
|
||||
|
||||
vm_vec_scale_add( &vecs[3], ¢er, &orient->uvec, -radius );
|
||||
vm_vec_scale_add2( &vecs[3], &orient->rvec, -radius );
|
||||
vm_vec_scale_add2( &vecs[3], &orient->fvec, Grid_depth );
|
||||
vm_vec_scale_add( &vecs[3], ¢er, &orient->vec.uvec, -radius );
|
||||
vm_vec_scale_add2( &vecs[3], &orient->vec.rvec, -radius );
|
||||
vm_vec_scale_add2( &vecs[3], &orient->vec.fvec, Grid_depth );
|
||||
|
||||
// vm_vec_scale_add( &vecs[4], ¢er, &orient->fvec, -Grid_depth );
|
||||
// vm_vec_scale_add( &vecs[4], ¢er, &orient->vec.fvec, -Grid_depth );
|
||||
vecs[4] = center;
|
||||
|
||||
verts[0].u = 0.01f; verts[0].v = 0.01f;
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -9,8 +9,8 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/FREESPACE2/FreeSpace.h $
|
||||
* $Revision: 1.1 $
|
||||
* $Date: 2002-06-03 03:25:57 $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:22 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
* FreeSpace, the game, not the project, header information.
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Freespace2/LevelPaging.cpp $
|
||||
* $Revision: 1.1 $
|
||||
* $Date: 2002-06-03 03:25:57 $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:22 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
* Code to page in all the bitmaps at the beginning of a level.
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/FREESPACE2/LevelPaging.h $
|
||||
* $Revision: 1.1 $
|
||||
* $Date: 2002-06-03 03:25:57 $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:22 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
* Code to page in all the bitmaps at the beginning of a level.
|
||||
|
||||
@@ -9,13 +9,16 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/GameHelp/ContextHelp.cpp $
|
||||
* $Revision: 1.1 $
|
||||
* $Date: 2002-06-03 03:25:57 $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:22 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
* Functions to drive the context-sensitive help
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 1.2 2002/05/03 22:07:08 mharris
|
||||
* got some stuff to compile
|
||||
*
|
||||
* Revision 1.1 2002/05/02 18:03:07 mharris
|
||||
* Initial checkin - converted filenames and includes to lower case
|
||||
*
|
||||
@@ -510,23 +513,23 @@ void parse_helptbl()
|
||||
for (i=0; i<help_overlaylist[overlay_id].plinelist[GR_640][currcount].vtxcount; i++) {
|
||||
stuff_int(&a);
|
||||
stuff_int(&b);
|
||||
help_overlaylist[overlay_id].plinelist[GR_640][currcount].vtx[i].x = (float)a;
|
||||
help_overlaylist[overlay_id].plinelist[GR_640][currcount].vtx[i].y = (float)b;
|
||||
help_overlaylist[overlay_id].plinelist[GR_640][currcount].vtx[i].z = 0.0f;
|
||||
help_overlaylist[overlay_id].plinelist[GR_640][currcount].vtx[i].xyz.x = (float)a;
|
||||
help_overlaylist[overlay_id].plinelist[GR_640][currcount].vtx[i].xyz.y = (float)b;
|
||||
help_overlaylist[overlay_id].plinelist[GR_640][currcount].vtx[i].xyz.z = 0.0f;
|
||||
help_overlaylist[overlay_id].plinelist[GR_640][currcount].pvtx[i] = &help_overlaylist[overlay_id].plinelist[GR_640][currcount].vtx[i];
|
||||
}
|
||||
// get 1024x768 vertex coordinates
|
||||
for (i=0; i<help_overlaylist[overlay_id].plinelist[GR_640][currcount].vtxcount; i++) {
|
||||
stuff_int(&a);
|
||||
stuff_int(&b);
|
||||
help_overlaylist[overlay_id].plinelist[GR_1024][currcount].vtx[i].x = (float)a;
|
||||
help_overlaylist[overlay_id].plinelist[GR_1024][currcount].vtx[i].y = (float)b;
|
||||
help_overlaylist[overlay_id].plinelist[GR_1024][currcount].vtx[i].z = 0.0f;
|
||||
help_overlaylist[overlay_id].plinelist[GR_1024][currcount].vtx[i].xyz.x = (float)a;
|
||||
help_overlaylist[overlay_id].plinelist[GR_1024][currcount].vtx[i].xyz.y = (float)b;
|
||||
help_overlaylist[overlay_id].plinelist[GR_1024][currcount].vtx[i].xyz.z = 0.0f;
|
||||
help_overlaylist[overlay_id].plinelist[GR_1024][currcount].pvtx[i] = &help_overlaylist[overlay_id].plinelist[GR_1024][currcount].vtx[i];
|
||||
}
|
||||
}
|
||||
|
||||
//mprintf(("Found pline - start location (%f,%f), end location (%f,%f)\n", help_overlaylist[overlay_id].plinelist[GR_640][currcount].vtx[0].x, help_overlaylist[overlay_id].plinelist[GR_640][currcount].vtx[0].y, help_overlaylist[overlay_id].plinelist[GR_640][currcount].vtx[2].x, help_overlaylist[overlay_id].plinelist[GR_640][currcount].vtx[2].y));
|
||||
//mprintf(("Found pline - start location (%f,%f), end location (%f,%f)\n", help_overlaylist[overlay_id].plinelist[GR_640][currcount].vtx[0].xyz.x, help_overlaylist[overlay_id].plinelist[GR_640][currcount].vtx[0].xyz.y, help_overlaylist[overlay_id].plinelist[GR_640][currcount].vtx[2].xyz.x, help_overlaylist[overlay_id].plinelist[GR_640][currcount].vtx[2].xyz.y));
|
||||
help_overlaylist[overlay_id].plinecount++;
|
||||
|
||||
} else if (optional_string("+text")) {
|
||||
@@ -668,11 +671,11 @@ void nudgetext_y(int textnum, int amount)
|
||||
}
|
||||
void nudgepline_x(int plinenum, int plinevert, int amount)
|
||||
{
|
||||
help_overlaylist[current_helpid].plinelist[gr_screen.res][plinenum].vtx[plinevert].x += amount;
|
||||
help_overlaylist[current_helpid].plinelist[gr_screen.res][plinenum].vtx[plinevert].xyz.x += amount;
|
||||
}
|
||||
void nudgepline_y(int plinenum, int plinevert, int amount)
|
||||
{
|
||||
help_overlaylist[current_helpid].plinelist[gr_screen.res][plinenum].vtx[plinevert].y += amount;
|
||||
help_overlaylist[current_helpid].plinelist[gr_screen.res][plinenum].vtx[plinevert].xyz.y += amount;
|
||||
}
|
||||
void nudgerbracket_x(int num, int amount)
|
||||
{
|
||||
@@ -708,7 +711,7 @@ void showplinepos(int plinenum)
|
||||
dc_printf("pline %d on overlay %d vertices are now ", plinenum, current_helpid, help_overlaylist[current_helpid].textlist[gr_screen.res][plinenum].y_coord );
|
||||
for (i=0; i<help_overlaylist[current_helpid].plinelist[GR_640][plinenum].vtxcount; i++)
|
||||
{
|
||||
dc_printf("(%3.0f %3.0f) ", help_overlaylist[current_helpid].plinelist[gr_screen.res][plinenum].vtx[i].x, help_overlaylist[current_helpid].plinelist[gr_screen.res][plinenum].vtx[i].y);
|
||||
dc_printf("(%3.0f %3.0f) ", help_overlaylist[current_helpid].plinelist[gr_screen.res][plinenum].vtx[i].xyz.x, help_overlaylist[current_helpid].plinelist[gr_screen.res][plinenum].vtx[i].xyz.y);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/GameHelp/GameplayHelp.cpp $
|
||||
* $Revision: 1.1 $
|
||||
* $Date: 2002-06-03 03:25:57 $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:22 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
* Module for displaying in-game help
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/GameHelp/GameplayHelp.h $
|
||||
* $Revision: 1.1 $
|
||||
* $Date: 2002-06-03 03:25:57 $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:22 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
* Header for displaying in-game help
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/GameSequence/GameSequence.cpp $
|
||||
* $Revision: 1.1 $
|
||||
* $Date: 2002-06-03 03:25:57 $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:22 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
* File to control Game Sequencing
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/GameSequence/GameSequence.h $
|
||||
* $Revision: 1.1 $
|
||||
* $Date: 2002-06-03 03:25:57 $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:22 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
* Header file for Game Sequencing items
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Gamesnd/EventMusic.cpp $
|
||||
* $Revision: 1.1 $
|
||||
* $Date: 2002-06-03 03:25:57 $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:22 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
* C module for high-level control of event driven music
|
||||
|
||||
@@ -9,13 +9,16 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Gamesnd/EventMusic.h $
|
||||
* $Revision: 1.1 $
|
||||
* $Date: 2002-06-03 03:25:57 $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:22 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
* Header file for high-level control of event driven music
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 1.2 2002/05/10 06:08:08 mharris
|
||||
* Porting... added ifndef NO_SOUND
|
||||
*
|
||||
* Revision 1.1 2002/05/02 18:03:07 mharris
|
||||
* Initial checkin - converted filenames and includes to lower case
|
||||
*
|
||||
@@ -184,6 +187,8 @@ typedef struct tagSOUNDTRACK_INFO {
|
||||
extern SOUNDTRACK_INFO Soundtracks[MAX_SOUNDTRACKS];
|
||||
extern int Num_soundtracks;
|
||||
|
||||
#ifndef NO_SOUND
|
||||
|
||||
void event_music_init();
|
||||
void event_music_close();
|
||||
void event_music_level_init(int force_soundtrack = -1);
|
||||
@@ -217,4 +222,47 @@ int event_music_player_respawn();
|
||||
int event_music_player_respawn_as_observer();
|
||||
void event_music_hostile_ship_destroyed();
|
||||
|
||||
#else
|
||||
|
||||
#define event_music_init()
|
||||
#define event_music_close()
|
||||
#define event_music_level_init(force_soundtrack) ((void)(force_soundtrack))
|
||||
#define event_music_level_close()
|
||||
#define event_music_do_frame()
|
||||
#define event_music_disable()
|
||||
#define event_music_enable()
|
||||
#define event_music_pause()
|
||||
#define event_music_unpause()
|
||||
#define event_music_set_volume_all(volume) ((void)(volume))
|
||||
#define event_music_parse_musictbl()
|
||||
#define event_music_change_pattern(new_pattern) ((void)(new_pattern))
|
||||
#define event_music_return_current_pattern() (0)
|
||||
#define event_music_first_pattern()
|
||||
#define event_music_battle_start() (0)
|
||||
#define event_music_enemy_arrival() (0)
|
||||
#define event_music_friendly_arrival() (0)
|
||||
#define event_music_arrival(team) ((void)(team))
|
||||
#define event_music_primary_goals_met() (0)
|
||||
#define event_music_primary_goal_failed() (0)
|
||||
#define event_music_player_death() (0)
|
||||
#define event_music_start_default()
|
||||
inline void event_music_get_info(char *outbuf)
|
||||
{
|
||||
if (outbuf) *outbuf = '\0';
|
||||
}
|
||||
inline void event_music_get_soundtrack_name(char *outbuf)
|
||||
{
|
||||
if (outbuf) *outbuf = '\0';
|
||||
}
|
||||
#define event_music_next_soundtrack(delta) (0)
|
||||
#define event_music_set_soundtrack(name) ((void)(name))
|
||||
#define event_music_set_score(score_index, name) ((void)((score_index), (name)))
|
||||
#define event_music_get_spooled_music_index(name) (-1)
|
||||
#define event_music_reset_choices()
|
||||
#define event_music_player_respawn() (0)
|
||||
#define event_music_player_respawn_as_observer() (0)
|
||||
#define event_music_hostile_ship_destroyed()
|
||||
|
||||
#endif // ifndef NO_SOUND
|
||||
|
||||
#endif /* __EVENT_MUSIC_H__ */
|
||||
@@ -9,8 +9,8 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Gamesnd/GameSnd.cpp $
|
||||
* $Revision: 1.1 $
|
||||
* $Date: 2002-06-03 03:25:57 $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:22 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
* Routines to keep track of which sound files go where
|
||||
|
||||
@@ -9,13 +9,16 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Gamesnd/GameSnd.h $
|
||||
* $Revision: 1.1 $
|
||||
* $Date: 2002-06-03 03:25:57 $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:22 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
* Routines to keep track of which sound files go where
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 1.2 2002/05/10 06:08:08 mharris
|
||||
* Porting... added ifndef NO_SOUND
|
||||
*
|
||||
* Revision 1.1 2002/05/02 18:03:07 mharris
|
||||
* Initial checkin - converted filenames and includes to lower case
|
||||
*
|
||||
@@ -320,6 +323,8 @@
|
||||
#include "sound.h"
|
||||
#include "missionparse.h"
|
||||
|
||||
#ifndef NO_SOUND
|
||||
|
||||
void gamesnd_parse_soundstbl(); // Loads in general game sounds from sounds.tbl
|
||||
void gamesnd_init_sounds(); // initializes the Snds[] and Snds_iface[] array
|
||||
void gamesnd_load_gameplay_sounds();
|
||||
@@ -333,6 +338,24 @@ void gamesnd_play_error_beep();
|
||||
|
||||
void common_play_highlight_sound(); // called from interface code
|
||||
|
||||
#else
|
||||
|
||||
#define gamesnd_parse_soundstbl()
|
||||
#define gamesnd_init_sounds()
|
||||
#define gamesnd_load_gameplay_sounds()
|
||||
#define gamesnd_unload_gameplay_sounds()
|
||||
#define gamesnd_load_interface_sounds()
|
||||
#define gamesnd_unload_interface_sounds()
|
||||
#define gamesnd_preload_common_sounds()
|
||||
#define gamesnd_play_iface(n) ((void)(n))
|
||||
#define gamesnd_play_error_beep()
|
||||
|
||||
// this is a callback, so it needs to be a real function
|
||||
void common_play_highlight_sound();
|
||||
|
||||
#endif // ifndef NO_SOUND
|
||||
|
||||
|
||||
// Misc_sounds[] holds handles for misc sounds in the game (list appears in sounds.tbl)
|
||||
#define MAX_GAME_SOUNDS 200
|
||||
#define MAX_INTERFACE_SOUNDS 70
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/glide/Glide.cpp $
|
||||
* $Revision: 1.1 $
|
||||
* $Date: 2002-06-03 03:25:57 $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:22 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
* Code for dynamically loading glide libraries
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
** All Rights Reserved.
|
||||
**
|
||||
**
|
||||
** $Header: /cvs/cvsroot/fs2open/fs2_open/code/glide/glidesys.h,v 1.1 2002-06-03 03:25:57 penguin Exp $
|
||||
** $Header: /cvs/cvsroot/fs2open/fs2_open/code/glide/glidesys.h,v 2.0 2002-06-03 04:02:22 penguin Exp $
|
||||
** $Log: not supported by cvs2svn $
|
||||
** Revision 1.1 2002/05/02 18:03:07 mharris
|
||||
** Initial checkin - converted filenames and includes to lower case
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
** All Rights Reserved.
|
||||
**
|
||||
**
|
||||
** $Header: /cvs/cvsroot/fs2open/fs2_open/code/glide/glideutl.h,v 1.1 2002-06-03 03:25:57 penguin Exp $
|
||||
** $Header: /cvs/cvsroot/fs2open/fs2_open/code/glide/glideutl.h,v 2.0 2002-06-03 04:02:22 penguin Exp $
|
||||
** $Log: not supported by cvs2svn $
|
||||
** Revision 1.1 2002/05/02 18:03:07 mharris
|
||||
** Initial checkin - converted filenames and includes to lower case
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
** All Rights Reserved.
|
||||
**
|
||||
**
|
||||
** $Header: /cvs/cvsroot/fs2open/fs2_open/code/glide/sst1vid.h,v 1.1 2002-06-03 03:25:57 penguin Exp $
|
||||
** $Header: /cvs/cvsroot/fs2open/fs2_open/code/glide/sst1vid.h,v 2.0 2002-06-03 04:02:22 penguin Exp $
|
||||
** $Log: not supported by cvs2svn $
|
||||
** Revision 1.1 2002/05/02 18:03:07 mharris
|
||||
** Initial checkin - converted filenames and includes to lower case
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/GlobalIncs/crypt.cpp $
|
||||
* $Revision: 1.1 $
|
||||
* $Date: 2002-06-03 03:25:57 $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:22 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
* Files for cypting stuff
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/GlobalIncs/crypt.h $
|
||||
* $Revision: 1.1 $
|
||||
* $Date: 2002-06-03 03:25:57 $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:22 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
* Header for crypt stuff
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/GlobalIncs/LinkList.h $
|
||||
* $Revision: 1.1 $
|
||||
* $Date: 2002-06-03 03:25:57 $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:22 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
* Macros to handle doubly linked lists
|
||||
|
||||
@@ -9,13 +9,22 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/GlobalIncs/PsTypes.h $
|
||||
* $Revision: 1.1 $
|
||||
* $Date: 2002-06-03 03:25:57 $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:22 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
* Header file containg global typedefs, constants and macros
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 1.4 2002/05/09 13:50:20 mharris
|
||||
* define AsmInt3() to abort()
|
||||
*
|
||||
* Revision 1.3 2002/05/04 04:52:22 mharris
|
||||
* 1st draft at porting
|
||||
*
|
||||
* Revision 1.2 2002/05/03 22:07:08 mharris
|
||||
* got some stuff to compile
|
||||
*
|
||||
* Revision 1.1 2002/05/02 18:03:07 mharris
|
||||
* Initial checkin - converted filenames and includes to lower case
|
||||
*
|
||||
@@ -213,6 +222,7 @@
|
||||
#include <memory.h>
|
||||
#include <malloc.h>
|
||||
#include <string.h>
|
||||
#include "config.h"
|
||||
|
||||
// value to represent an uninitialized state in any int or uint
|
||||
#define UNINITIALIZED 0x7f8e6d9c
|
||||
@@ -230,7 +240,16 @@
|
||||
|
||||
#define LOCAL static // make module local varilable static.
|
||||
|
||||
#if defined( WINDOWS ) && defined( MSVC )
|
||||
typedef __int64 longlong;
|
||||
typedef unsigned __int64 ulonglong;
|
||||
#elif defined ( __GNUC__ )
|
||||
typedef long long longlong;
|
||||
typedef unsigned long long ulonglong;
|
||||
#else
|
||||
#error unknown compiler/architecture
|
||||
#endif
|
||||
|
||||
typedef long fix;
|
||||
typedef unsigned char ubyte;
|
||||
typedef unsigned short ushort;
|
||||
@@ -247,7 +266,7 @@ typedef struct vector {
|
||||
union {
|
||||
struct {
|
||||
float x,y,z;
|
||||
};
|
||||
} xyz;
|
||||
float a1d[3];
|
||||
};
|
||||
} vector;
|
||||
@@ -268,13 +287,13 @@ typedef struct vert2df {
|
||||
|
||||
typedef struct angles {
|
||||
float p, b, h;
|
||||
} angles;
|
||||
} angles_t;
|
||||
|
||||
typedef struct matrix {
|
||||
union {
|
||||
struct {
|
||||
vector rvec, uvec, fvec;
|
||||
};
|
||||
} vec;
|
||||
float a2d[3][3];
|
||||
float a1d[9];
|
||||
};
|
||||
@@ -366,7 +385,11 @@ void gr_activate(int);
|
||||
|
||||
// define to call from Warning function above since it calls Int3, so without this, we
|
||||
// get put into infinite dialog boxes
|
||||
#define AsmInt3() _asm { int 3 }
|
||||
#ifdef WIN32
|
||||
#define AsmInt3() _asm { int 3 }
|
||||
#else
|
||||
#define AsmInt3() abort()
|
||||
#endif
|
||||
|
||||
#else
|
||||
#if defined(NDEBUG)
|
||||
@@ -503,13 +526,13 @@ void dc_printf( char *format, ... );
|
||||
//======================================================================================
|
||||
|
||||
|
||||
|
||||
#include "config.h"
|
||||
#include "fix.h"
|
||||
#include "floating.h"
|
||||
|
||||
// Some constants for stuff
|
||||
#define MAX_FILENAME_LEN 32 // Length for filenames, ie "title.pcx"
|
||||
#define MAX_PATH_LEN 128 // Length for pathnames, ie "c:\bitmaps\title.pcx"
|
||||
// #define MAX_FILENAME_LEN 32 // Length for filenames, ie "title.pcx"
|
||||
// #define MAX_PATH_LEN 128 // Length for pathnames, ie "c:\bitmaps\title.pcx"
|
||||
|
||||
// contants and defined for byteswapping routines (useful for mac)
|
||||
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/GlobalIncs/SystemVars.cpp $
|
||||
* $Revision: 1.1 $
|
||||
* $Date: 2002-06-03 03:25:57 $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:22 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
* Variables and constants common to FreeSpace and Fred.
|
||||
|
||||
@@ -9,13 +9,16 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/GlobalIncs/SystemVars.h $
|
||||
* $Revision: 1.1 $
|
||||
* $Date: 2002-06-03 03:25:57 $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:22 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
* Variables and constants common to FreeSpace and Fred.
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 1.2 2002/05/03 22:07:08 mharris
|
||||
* got some stuff to compile
|
||||
*
|
||||
* Revision 1.1 2002/05/02 18:03:07 mharris
|
||||
* Initial checkin - converted filenames and includes to lower case
|
||||
*
|
||||
@@ -225,12 +228,12 @@
|
||||
|
||||
|
||||
typedef struct vei {
|
||||
angles angles; // Angles defining viewer location.
|
||||
angles_t angles; // Angles defining viewer location.
|
||||
float distance; // Distance from which to view, plus 2x radius.
|
||||
} vei;
|
||||
|
||||
typedef struct vci {
|
||||
angles angles;
|
||||
angles_t angles;
|
||||
float distance; // Distance from which to view, plus 3x radius
|
||||
} vci;
|
||||
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/GlobalIncs/version.cpp $
|
||||
* $Revision: 1.1 $
|
||||
* $Date: 2002-06-03 03:25:57 $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:22 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
*
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/GlobalIncs/version.h $
|
||||
* $Revision: 1.1 $
|
||||
* $Date: 2002-06-03 03:25:57 $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:22 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
*
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/GlobalIncs/WinDebug.cpp $
|
||||
* $Revision: 1.1 $
|
||||
* $Date: 2002-06-03 03:25:57 $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:22 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
* Debug stuff
|
||||
|
||||
@@ -9,13 +9,25 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Graphics/2d.cpp $
|
||||
* $Revision: 1.1 $
|
||||
* $Date: 2002-06-03 03:25:57 $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:22 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
* Main file for 2d primitives.
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 1.5 2002/05/26 14:10:29 mharris
|
||||
* More testing
|
||||
*
|
||||
* Revision 1.4 2002/05/17 23:44:22 mharris
|
||||
* Removed Int3()'s from opengl calls
|
||||
*
|
||||
* Revision 1.3 2002/05/17 02:52:38 mharris
|
||||
* More porting hacks
|
||||
*
|
||||
* Revision 1.2 2002/05/03 22:07:08 mharris
|
||||
* got some stuff to compile
|
||||
*
|
||||
* Revision 1.1 2002/05/02 18:03:07 mharris
|
||||
* Initial checkin - converted filenames and includes to lower case
|
||||
*
|
||||
@@ -428,6 +440,7 @@
|
||||
#include <windows.h>
|
||||
#include <windowsx.h>
|
||||
|
||||
#include "pstypes.h"
|
||||
#include "osapi.h"
|
||||
#include "2d.h"
|
||||
#include "3d.h"
|
||||
@@ -485,6 +498,7 @@ void gr_close()
|
||||
palette_flush();
|
||||
|
||||
switch( gr_screen.mode ) {
|
||||
#ifdef WIN32
|
||||
case GR_SOFTWARE:
|
||||
gr_soft_cleanup();
|
||||
break;
|
||||
@@ -498,8 +512,8 @@ void gr_close()
|
||||
case GR_GLIDE:
|
||||
gr_glide_cleanup();
|
||||
break;
|
||||
#endif
|
||||
case GR_OPENGL:
|
||||
Int3();
|
||||
gr_opengl_cleanup();
|
||||
break;
|
||||
default:
|
||||
@@ -531,7 +545,6 @@ DCF(gr,"Changes graphics mode")
|
||||
} else if ( !strcmp( Dc_arg, "g")) {
|
||||
mode = GR_GLIDE;
|
||||
} else if ( !strcmp( Dc_arg, "o")) {
|
||||
Int3();
|
||||
mode = GR_OPENGL;
|
||||
} else {
|
||||
// print usage, not stats
|
||||
@@ -577,7 +590,6 @@ DCF(gr,"Changes graphics mode")
|
||||
dc_printf( "3Dfx Glide\n" );
|
||||
break;
|
||||
case GR_OPENGL:
|
||||
Int3();
|
||||
dc_printf( "OpenGl\n" );
|
||||
break;
|
||||
default:
|
||||
@@ -663,6 +675,8 @@ void gr_set_palette( char *name, ubyte * palette, int restrict_font_to_128 )
|
||||
|
||||
//void gr_test();
|
||||
|
||||
#if defined( WINDOWS ) && defined( MSVC )
|
||||
|
||||
#define CPUID _asm _emit 0fh _asm _emit 0a2h
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
@@ -680,7 +694,7 @@ void gr_detect_cpu(int *cpu, int *mmx, int *amd3d, int *katmai )
|
||||
|
||||
char cpu_vender[16];
|
||||
memset( cpu_vender, 0, sizeof(cpu_vender) );
|
||||
|
||||
|
||||
_asm {
|
||||
|
||||
// Check for prescence of
|
||||
@@ -818,6 +832,22 @@ done_checking_cpuid:
|
||||
}
|
||||
*/
|
||||
}
|
||||
#else
|
||||
// TEMP mharris FIXME
|
||||
void gr_detect_cpu(int *cpu, int *mmx, int *amd3d, int *katmai )
|
||||
{
|
||||
if (cpu)
|
||||
*cpu = 0;
|
||||
if (mmx)
|
||||
*mmx = 0;
|
||||
if (amd3d)
|
||||
*amd3d = 0;
|
||||
if (katmai)
|
||||
*katmai = 0;
|
||||
}
|
||||
#endif // if defined( WINDOWS ) && defined( MSVC )
|
||||
|
||||
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
@@ -838,6 +868,7 @@ int gr_init(int res, int mode, int depth, int fred_x, int fred_y)
|
||||
// If already inited, shutdown the previous graphics
|
||||
if ( Gr_inited ) {
|
||||
switch( gr_screen.mode ) {
|
||||
#ifdef WIN32
|
||||
case GR_SOFTWARE:
|
||||
gr_soft_cleanup();
|
||||
break;
|
||||
@@ -851,8 +882,8 @@ int gr_init(int res, int mode, int depth, int fred_x, int fred_y)
|
||||
case GR_GLIDE:
|
||||
gr_glide_cleanup();
|
||||
break;
|
||||
#endif
|
||||
case GR_OPENGL:
|
||||
Int3();
|
||||
gr_opengl_cleanup();
|
||||
break;
|
||||
default:
|
||||
@@ -862,7 +893,7 @@ int gr_init(int res, int mode, int depth, int fred_x, int fred_y)
|
||||
first_time = 1;
|
||||
}
|
||||
|
||||
#if defined(HARDWARE_ONLY)
|
||||
#if defined(HARDWARE_ONLY) && defined(WIN32)
|
||||
if(!Fred_running && !Pofview_running && !Nebedit_running && !Is_standalone){
|
||||
if((mode != GR_GLIDE) && (mode != GR_DIRECT3D)){
|
||||
mprintf(("Forcing glide startup!\n"));
|
||||
@@ -920,10 +951,12 @@ int gr_init(int res, int mode, int depth, int fred_x, int fred_y)
|
||||
gr_screen.clip_height = gr_screen.max_h;
|
||||
|
||||
switch( gr_screen.mode ) {
|
||||
#ifdef WIN32
|
||||
case GR_SOFTWARE:
|
||||
Assert(Fred_running || Pofview_running || Is_standalone || Nebedit_running);
|
||||
gr_soft_init();
|
||||
break;
|
||||
// directdraw, direct3d,
|
||||
case GR_DIRECTDRAW:
|
||||
Int3();
|
||||
gr_directdraw_init();
|
||||
@@ -952,16 +985,17 @@ int gr_init(int res, int mode, int depth, int fred_x, int fred_y)
|
||||
}
|
||||
gr_glide_init();
|
||||
break;
|
||||
#endif // ifdef WIN32
|
||||
case GR_OPENGL:
|
||||
Int3();
|
||||
gr_opengl_init();
|
||||
break;
|
||||
default:
|
||||
Int3(); // Invalid graphics mode
|
||||
}
|
||||
|
||||
memmove( Gr_current_palette, Gr_original_palette, 768 );
|
||||
gr_set_palette_internal(Gr_current_palette_name, Gr_current_palette,0);
|
||||
// memmove( Gr_current_palette, Gr_original_palette, 768 );
|
||||
// gr_set_palette_internal(Gr_current_palette_name, Gr_current_palette,0);
|
||||
gr_set_palette_internal(Gr_current_palette_name, NULL, 0);
|
||||
|
||||
gr_set_gamma(Gr_gamma);
|
||||
|
||||
@@ -991,6 +1025,7 @@ void gr_force_windowed()
|
||||
if ( !Gr_inited ) return;
|
||||
|
||||
switch( gr_screen.mode ) {
|
||||
#ifdef WIN32
|
||||
case GR_SOFTWARE:
|
||||
{
|
||||
extern void gr_soft_force_windowed();
|
||||
@@ -1012,8 +1047,8 @@ void gr_force_windowed()
|
||||
gr_glide_force_windowed();
|
||||
}
|
||||
break;
|
||||
#endif // ifdef WIN32
|
||||
case GR_OPENGL:
|
||||
Int3();
|
||||
break;
|
||||
|
||||
default:
|
||||
@@ -1030,6 +1065,7 @@ void gr_activate(int active)
|
||||
if ( !Gr_inited ) return;
|
||||
|
||||
switch( gr_screen.mode ) {
|
||||
#ifdef WIN32
|
||||
case GR_SOFTWARE:
|
||||
{
|
||||
extern void gr_soft_activate(int active);
|
||||
@@ -1059,8 +1095,8 @@ void gr_activate(int active)
|
||||
return;
|
||||
}
|
||||
break;
|
||||
#endif // ifdef WIN32
|
||||
case GR_OPENGL:
|
||||
Int3();
|
||||
break;
|
||||
default:
|
||||
Int3(); // Invalid graphics mode
|
||||
@@ -1154,7 +1190,11 @@ void gr_bitmap(int x, int y)
|
||||
|
||||
// old school bitmaps
|
||||
switch(gr_screen.mode){
|
||||
#ifdef WIN32
|
||||
case GR_SOFTWARE:
|
||||
grx_bitmap(x, y);
|
||||
break;
|
||||
|
||||
case GR_DIRECTDRAW:
|
||||
grx_bitmap(x, y);
|
||||
break;
|
||||
@@ -1167,6 +1207,8 @@ void gr_bitmap(int x, int y)
|
||||
gr_glide_bitmap(x, y);
|
||||
break;
|
||||
|
||||
#endif // ifdef WIN32
|
||||
|
||||
case GR_OPENGL:
|
||||
gr_opengl_bitmap(x, y);
|
||||
break;
|
||||
@@ -1176,7 +1218,11 @@ void gr_bitmap(int x, int y)
|
||||
void gr_bitmap_ex(int x, int y, int w, int h, int sx, int sy)
|
||||
{
|
||||
switch(gr_screen.mode){
|
||||
#ifdef WIN32
|
||||
case GR_SOFTWARE:
|
||||
grx_bitmap_ex(x, y, w, h, sx, sy);
|
||||
break;
|
||||
|
||||
case GR_DIRECTDRAW:
|
||||
grx_bitmap_ex(x, y, w, h, sx, sy);
|
||||
break;
|
||||
@@ -1188,6 +1234,7 @@ void gr_bitmap_ex(int x, int y, int w, int h, int sx, int sy)
|
||||
case GR_GLIDE:
|
||||
gr_glide_bitmap_ex(x, y, w, h, sx, sy);
|
||||
break;
|
||||
#endif // ifdef WIN32
|
||||
|
||||
case GR_OPENGL:
|
||||
gr_opengl_bitmap_ex(x, y, w, h, sx, sy);
|
||||
@@ -1204,9 +1251,9 @@ void gr_pline_helper(vector *out, vector *in1, vector *in2, int thickness)
|
||||
slope = vmd_zero_vector;
|
||||
} else {
|
||||
vm_vec_sub(&slope, in2, in1);
|
||||
float temp = -slope.x;
|
||||
slope.x = slope.y;
|
||||
slope.y = temp;
|
||||
float temp = -slope.xyz.x;
|
||||
slope.xyz.x = slope.xyz.y;
|
||||
slope.xyz.y = temp;
|
||||
vm_vec_normalize(&slope);
|
||||
}
|
||||
|
||||
@@ -1258,8 +1305,8 @@ void gr_pline_special(vector **pts, int num_pts, int thickness)
|
||||
vm_vec_add(&e2, &s2, &dir); // end 2
|
||||
|
||||
// stuff coords
|
||||
v[0].sx = (float)ceil(s1.x);
|
||||
v[0].sy = (float)ceil(s1.y);
|
||||
v[0].sx = (float)ceil(s1.xyz.x);
|
||||
v[0].sy = (float)ceil(s1.xyz.y);
|
||||
v[0].sw = 0.0f;
|
||||
v[0].u = 0.5f;
|
||||
v[0].v = 0.5f;
|
||||
@@ -1269,8 +1316,8 @@ void gr_pline_special(vector **pts, int num_pts, int thickness)
|
||||
v[0].g = gr_screen.current_color.green;
|
||||
v[0].b = gr_screen.current_color.blue;
|
||||
|
||||
v[1].sx = (float)ceil(s2.x);
|
||||
v[1].sy = (float)ceil(s2.y);
|
||||
v[1].sx = (float)ceil(s2.xyz.x);
|
||||
v[1].sy = (float)ceil(s2.xyz.y);
|
||||
v[1].sw = 0.0f;
|
||||
v[1].u = 0.5f;
|
||||
v[1].v = 0.5f;
|
||||
@@ -1280,8 +1327,8 @@ void gr_pline_special(vector **pts, int num_pts, int thickness)
|
||||
v[1].g = gr_screen.current_color.green;
|
||||
v[1].b = gr_screen.current_color.blue;
|
||||
|
||||
v[2].sx = (float)ceil(e2.x);
|
||||
v[2].sy = (float)ceil(e2.y);
|
||||
v[2].sx = (float)ceil(e2.xyz.x);
|
||||
v[2].sy = (float)ceil(e2.xyz.y);
|
||||
v[2].sw = 0.0f;
|
||||
v[2].u = 0.5f;
|
||||
v[2].v = 0.5f;
|
||||
@@ -1291,8 +1338,8 @@ void gr_pline_special(vector **pts, int num_pts, int thickness)
|
||||
v[2].g = gr_screen.current_color.green;
|
||||
v[2].b = gr_screen.current_color.blue;
|
||||
|
||||
v[3].sx = (float)ceil(e1.x);
|
||||
v[3].sy = (float)ceil(e1.y);
|
||||
v[3].sx = (float)ceil(e1.xyz.x);
|
||||
v[3].sy = (float)ceil(e1.xyz.y);
|
||||
v[3].sw = 0.0f;
|
||||
v[3].u = 0.5f;
|
||||
v[3].v = 0.5f;
|
||||
@@ -1308,8 +1355,8 @@ void gr_pline_special(vector **pts, int num_pts, int thickness)
|
||||
// if we're past the first section, draw a "patch" triangle to fill any gaps
|
||||
if(idx > 0){
|
||||
// stuff coords
|
||||
v[0].sx = (float)ceil(s1.x);
|
||||
v[0].sy = (float)ceil(s1.y);
|
||||
v[0].sx = (float)ceil(s1.xyz.x);
|
||||
v[0].sy = (float)ceil(s1.xyz.y);
|
||||
v[0].sw = 0.0f;
|
||||
v[0].u = 0.5f;
|
||||
v[0].v = 0.5f;
|
||||
@@ -1319,8 +1366,8 @@ void gr_pline_special(vector **pts, int num_pts, int thickness)
|
||||
v[0].g = gr_screen.current_color.green;
|
||||
v[0].b = gr_screen.current_color.blue;
|
||||
|
||||
v[1].sx = (float)ceil(s2.x);
|
||||
v[1].sy = (float)ceil(s2.y);
|
||||
v[1].sx = (float)ceil(s2.xyz.x);
|
||||
v[1].sy = (float)ceil(s2.xyz.y);
|
||||
v[1].sw = 0.0f;
|
||||
v[1].u = 0.5f;
|
||||
v[1].v = 0.5f;
|
||||
@@ -1331,8 +1378,8 @@ void gr_pline_special(vector **pts, int num_pts, int thickness)
|
||||
v[1].b = gr_screen.current_color.blue;
|
||||
|
||||
|
||||
v[2].sx = (float)ceil(last_e2.x);
|
||||
v[2].sy = (float)ceil(last_e2.y);
|
||||
v[2].sx = (float)ceil(last_e2.xyz.x);
|
||||
v[2].sy = (float)ceil(last_e2.xyz.y);
|
||||
v[2].sw = 0.0f;
|
||||
v[2].u = 0.5f;
|
||||
v[2].v = 0.5f;
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Graphics/2d.h $
|
||||
* $Revision: 1.1 $
|
||||
* $Date: 2002-06-03 03:25:57 $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:22 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
* Header file for 2d primitives.
|
||||
|
||||
@@ -9,13 +9,16 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Graphics/aaline.cpp $
|
||||
* $Revision: 1.1 $
|
||||
* $Date: 2002-06-03 03:25:57 $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:22 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
* Code to draw antialiased lines
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 1.2 2002/05/03 22:07:08 mharris
|
||||
* got some stuff to compile
|
||||
*
|
||||
* Revision 1.1 2002/05/02 18:03:07 mharris
|
||||
* Initial checkin - converted filenames and includes to lower case
|
||||
*
|
||||
@@ -237,6 +240,7 @@ void aaline_init_tables()
|
||||
// less than 1.0 and less total bits are sufficient.
|
||||
// Some of the steps here are not needed. This was originally
|
||||
// written to simulate exact hardware behavior.
|
||||
#if defined( WINDOWS ) && defined( MSVC )
|
||||
long int fix_xy_mult(long int oa, fix_xy ob)
|
||||
{
|
||||
int retval;
|
||||
@@ -250,6 +254,9 @@ long int fix_xy_mult(long int oa, fix_xy ob)
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
#else
|
||||
long int fix_xy_mult(long int oa, fix_xy ob);
|
||||
#endif // if defined( WINDOWS ) && defined( MSVC )
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -9,13 +9,16 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Graphics/Bitblt.cpp $
|
||||
* $Revision: 1.1 $
|
||||
* $Date: 2002-06-03 03:25:57 $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:22 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
* Code to do software bitblt type stuff
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 1.2 2002/05/03 22:07:08 mharris
|
||||
* got some stuff to compile
|
||||
*
|
||||
* Revision 1.1 2002/05/02 18:03:07 mharris
|
||||
* Initial checkin - converted filenames and includes to lower case
|
||||
*
|
||||
@@ -37,6 +40,7 @@
|
||||
* $NoKeywords: $
|
||||
*/
|
||||
|
||||
#include "pstypes.h"
|
||||
#include "osapi.h"
|
||||
#include "2d.h"
|
||||
#include "bmpman.h"
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Graphics/Bitblt.h $
|
||||
* $Revision: 1.1 $
|
||||
* $Date: 2002-06-03 03:25:57 $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:22 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
* Include file for software bitblt type stuff
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Graphics/Circle.cpp $
|
||||
* $Revision: 1.1 $
|
||||
* $Date: 2002-06-03 03:25:57 $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:22 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
* Code to draw circles.
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Graphics/Circle.h $
|
||||
* $Revision: 1.1 $
|
||||
* $Date: 2002-06-03 03:25:57 $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:22 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
* Header file for circle.cpp
|
||||
|
||||
@@ -9,13 +9,22 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Graphics/Colors.cpp $
|
||||
* $Revision: 1.1 $
|
||||
* $Date: 2002-06-03 03:25:57 $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:22 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
* Functions to deal with colors & alphacolors
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 1.4 2002/05/26 14:10:29 mharris
|
||||
* More testing
|
||||
*
|
||||
* Revision 1.3 2002/05/24 16:45:06 mharris
|
||||
* Increased MAX_ALPHACOLORS (dunno why unix port affected this but...)
|
||||
*
|
||||
* Revision 1.2 2002/05/21 15:40:04 mharris
|
||||
* Added some debug mprintfs
|
||||
*
|
||||
* Revision 1.1 2002/05/02 18:03:07 mharris
|
||||
* Initial checkin - converted filenames and includes to lower case
|
||||
*
|
||||
@@ -175,7 +184,7 @@
|
||||
#include "systemvars.h"
|
||||
|
||||
//#define MAX_ALPHACOLORS 36
|
||||
#define MAX_ALPHACOLORS 72
|
||||
#define MAX_ALPHACOLORS 256
|
||||
|
||||
alphacolor Alphacolors[MAX_ALPHACOLORS];
|
||||
static int Alphacolors_intited = 0;
|
||||
@@ -408,7 +417,11 @@ void grx_init_alphacolor( color *clr, int r, int g, int b, int alpha, int type )
|
||||
|
||||
if ( n==-1 ) {
|
||||
for (n=0; n<MAX_ALPHACOLORS; n++ ) {
|
||||
if (!Alphacolors[n].used) break;
|
||||
if (!Alphacolors[n].used) {
|
||||
mprintf(("Creating alphacolor #%d %02x/%02x/%02x/%02x\n",
|
||||
n, r, g, b, alpha));
|
||||
break;
|
||||
}
|
||||
}
|
||||
if ( n == MAX_ALPHACOLORS )
|
||||
Error( LOCATION, "Out of alphacolors!\n" );
|
||||
@@ -470,6 +483,10 @@ void grx_init_color( color * dst, int r, int g, int b )
|
||||
|
||||
void grx_set_color_fast( color * dst )
|
||||
{
|
||||
// mprintf(("grx_set_color_fast: %02x/%02x/%02x/%02x (isalpha=%d, magic=%04x)\n",
|
||||
// dst->red, dst->green, dst->blue, dst->alpha,
|
||||
// dst->is_alphacolor, dst->magic));
|
||||
|
||||
if ( dst->magic != 0xAC01 ) return;
|
||||
|
||||
if ( dst->screen_sig != gr_screen.signature ) {
|
||||
@@ -485,7 +502,15 @@ void grx_set_color_fast( color * dst )
|
||||
if ( dst->is_alphacolor ) {
|
||||
Assert( dst->alphacolor > -1 );
|
||||
Assert( dst->alphacolor <= MAX_ALPHACOLORS );
|
||||
Assert( Alphacolors[dst->alphacolor].used );
|
||||
|
||||
|
||||
///FIXME--THIS IS TEMP ONLY
|
||||
///FIXME--THIS IS TEMP ONLY
|
||||
///FIXME--THIS IS TEMP ONLY
|
||||
// Assert( Alphacolors[dst->alphacolor].used );
|
||||
///////////////////////
|
||||
|
||||
|
||||
|
||||
// Current_alphacolor = &Alphacolors[dst->alphacolor];
|
||||
Current_alphacolor = NULL;
|
||||
@@ -497,6 +522,8 @@ void grx_set_color_fast( color * dst )
|
||||
|
||||
void grx_set_color( int r, int g, int b )
|
||||
{
|
||||
// mprintf(("grx_set_color: %02x/%02x/%02x\n", r, g, b));
|
||||
|
||||
Assert((r >= 0) && (r < 256));
|
||||
Assert((g >= 0) && (g < 256));
|
||||
Assert((b >= 0) && (b < 256));
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Graphics/Colors.h $
|
||||
* $Revision: 1.1 $
|
||||
* $Date: 2002-06-03 03:25:57 $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:22 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
* Functions to deal with colors & alphacolors
|
||||
|
||||
@@ -9,13 +9,16 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Graphics/Font.cpp $
|
||||
* $Revision: 1.1 $
|
||||
* $Date: 2002-06-03 03:25:57 $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:22 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
* source file for font stuff
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 1.2 2002/05/16 13:43:25 mharris
|
||||
* ifdef WIN32 around (unused?) win-specific code
|
||||
*
|
||||
* Revision 1.1 2002/05/02 18:03:07 mharris
|
||||
* Initial checkin - converted filenames and includes to lower case
|
||||
*
|
||||
@@ -629,6 +632,7 @@ void gr8_string(int sx, int sy, char *s )
|
||||
gr_unlock();
|
||||
}
|
||||
|
||||
#ifdef WIN32
|
||||
HFONT MyhFont = NULL;
|
||||
extern HDC hDibDC;
|
||||
|
||||
@@ -717,6 +721,7 @@ void gr_get_string_size_win(int *w, int *h, char *text)
|
||||
if (h)
|
||||
*h += size.cy;
|
||||
}
|
||||
#endif
|
||||
|
||||
char grx_printf_text[2048];
|
||||
|
||||
@@ -847,7 +852,7 @@ int gr_create_font(char * typeface)
|
||||
for (x1=0; x1<fnt->char_data[i].byte_width; x1++ ) {
|
||||
uint c = *fp++;
|
||||
if ( c > 14 ) c = 14;
|
||||
fnt->bm_data[(x+x1)+(y+y1)*fnt->bm_w] = unsigned char(c);
|
||||
fnt->bm_data[(x+x1)+(y+y1)*fnt->bm_w] = (unsigned char)(c);
|
||||
}
|
||||
}
|
||||
x += fnt->char_data[i].byte_width;
|
||||
|
||||
@@ -9,13 +9,16 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Graphics/Font.h $
|
||||
* $Revision: 1.1 $
|
||||
* $Date: 2002-06-03 03:25:57 $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:22 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
* header file for font stuff
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 1.2 2002/05/03 22:07:08 mharris
|
||||
* got some stuff to compile
|
||||
*
|
||||
* Revision 1.1 2002/05/02 18:03:07 mharris
|
||||
* Initial checkin - converted filenames and includes to lower case
|
||||
*
|
||||
@@ -86,6 +89,8 @@
|
||||
#ifndef _FONT_H
|
||||
#define _FONT_H
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#define MAX_FONTS 3
|
||||
|
||||
#define FONT_VERSION 0
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Graphics/Gradient.cpp $
|
||||
* $Revision: 1.1 $
|
||||
* $Date: 2002-06-03 03:25:57 $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:22 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
* Routines to draw rectangular gradients.
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Graphics/Gradient.h $
|
||||
* $Revision: 1.1 $
|
||||
* $Date: 2002-06-03 03:25:57 $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:22 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
* Prototype for Gradient.cpp
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Graphics/GrD3D.cpp $
|
||||
* $Revision: 1.1 $
|
||||
* $Date: 2002-06-03 03:25:57 $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:22 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
* Code for our Direct3D renderer
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Graphics/GrD3D.h $
|
||||
* $Revision: 1.1 $
|
||||
* $Date: 2002-06-03 03:25:57 $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:22 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
* Include file for our Direct3D renderer
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Graphics/GrD3DInternal.h $
|
||||
* $Revision: 1.1 $
|
||||
* $Date: 2002-06-03 03:25:57 $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:22 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
* Prototypes for the variables used internally by the Direct3D renderer
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Graphics/GrD3DRender.cpp $
|
||||
* $Revision: 1.1 $
|
||||
* $Date: 2002-06-03 03:25:57 $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:22 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
* Code to actually render stuff using Direct3D
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Graphics/GrD3DTexture.cpp $
|
||||
* $Revision: 1.1 $
|
||||
* $Date: 2002-06-03 03:25:57 $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:22 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
* Code to manage loading textures into VRAM for Direct3D
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Graphics/GrDirectDraw.cpp $
|
||||
* $Revision: 1.1 $
|
||||
* $Date: 2002-06-03 03:25:57 $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:22 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
* Code for software 8-bpp rendering using DirectDraw
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Graphics/GrDirectDraw.h $
|
||||
* $Revision: 1.1 $
|
||||
* $Date: 2002-06-03 03:25:57 $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:22 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
* Include file for software 8-bpp rendering using DirectDraw
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Graphics/GrGlide.cpp $
|
||||
* $Revision: 1.1 $
|
||||
* $Date: 2002-06-03 03:25:57 $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:22 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
* Code that uses 3DFX's Glide graphics library
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Graphics/GrGlide.h $
|
||||
* $Revision: 1.1 $
|
||||
* $Date: 2002-06-03 03:25:57 $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:22 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
* Include file for a 3DFX's Glide graphics lib
|
||||
|
||||
Loaded 100 of 504 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user