mirror of
https://github.com/scp-fs2open/fs2open.github.com.git
synced 2026-11-08 07:28:22 -10:00
Compare commits
244
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d8f9376d55 | ||
|
|
2c95fa52f8 | ||
|
|
993740e06f | ||
|
|
da67b2b53c | ||
|
|
7d08fec7cc | ||
|
|
6ec2c31678 | ||
|
|
e469a54429 | ||
|
|
2352055d98 | ||
|
|
7892625474 | ||
|
|
58a1497614 | ||
|
|
76d94278a8 | ||
|
|
47b2c3cd88 | ||
|
|
1f55e87876 | ||
|
|
cdd1a0b743 | ||
|
|
f864a28bb3 | ||
|
|
993a176572 | ||
|
|
414a344f33 | ||
|
|
28848dcbc8 | ||
|
|
ea32341410 | ||
|
|
ad53507f1c | ||
|
|
8f9e7cf941 | ||
|
|
1f1339cb01 | ||
|
|
e5eafea546 | ||
|
|
373d2c201c | ||
|
|
ec63b64b1f | ||
|
|
e6da9a6d68 | ||
|
|
4fac9708ec | ||
|
|
71d4bd62b2 | ||
|
|
3e96899ace | ||
|
|
51c590c6a6 | ||
|
|
e7d1452827 | ||
|
|
137e7a8cdd | ||
|
|
77f769b328 | ||
|
|
c85cb1377b | ||
|
|
f3362d6a2f | ||
|
|
043310f88a | ||
|
|
46f524706c | ||
|
|
7b7df3caba | ||
|
|
a47ff4d7a5 | ||
|
|
70fc3119e7 | ||
|
|
830be35c58 | ||
|
|
2fff39194f | ||
|
|
fffa377d2f | ||
|
|
a819e73388 | ||
|
|
0562965e69 | ||
|
|
7928823b96 | ||
|
|
3b92333b16 | ||
|
|
7238ae9025 | ||
|
|
f6634e882c | ||
|
|
f99a3916de | ||
|
|
cc9f972e80 | ||
|
|
609da60af3 | ||
|
|
7b794ea056 | ||
|
|
3f66617c68 | ||
|
|
f8f60965a9 | ||
|
|
6f0832c6d8 | ||
|
|
33c321d328 | ||
|
|
16fdb53870 | ||
|
|
b5ab80797d | ||
|
|
1385a9c6ac | ||
|
|
a11c390fd5 | ||
|
|
a498b79b2d | ||
|
|
6a22f2443e | ||
|
|
cd2597f3a2 | ||
|
|
d32a38c267 | ||
|
|
64bcc9942e | ||
|
|
cf750429cb | ||
|
|
32843f18f8 | ||
|
|
d7bd110ffe | ||
|
|
36176b8eb4 | ||
|
|
8c94fbd199 | ||
|
|
d9e1e01afc | ||
|
|
8edec19426 | ||
|
|
5419f3b5de | ||
|
|
6df0403964 | ||
|
|
2bef522bfc | ||
|
|
4e86a928b3 | ||
|
|
254b4f6603 | ||
|
|
7373203236 | ||
|
|
55a4c34bab | ||
|
|
b060ac5928 | ||
|
|
ab27958761 | ||
|
|
dca1600f46 | ||
|
|
218ac8a0d7 | ||
|
|
cac96f1a44 | ||
|
|
55948f0db1 | ||
|
|
c80033de55 | ||
|
|
dd378506ee | ||
|
|
9e890d8df5 | ||
|
|
f4030700dc | ||
|
|
b7f924ea6b | ||
|
|
c5c4fd08e9 | ||
|
|
bf7871905e | ||
|
|
28ef47c26f | ||
|
|
7a6e12df06 | ||
|
|
97130623dc | ||
|
|
a1ad295557 | ||
|
|
ecc552eda8 | ||
|
|
56d7afd8a0 | ||
|
|
46e465b1d2 | ||
|
|
4c52cb0441 | ||
|
|
4da09ccefc | ||
|
|
389921bd48 | ||
|
|
e9f6827211 | ||
|
|
042d935a80 | ||
|
|
1f7fee5baa | ||
|
|
ff33077291 | ||
|
|
70c909302c | ||
|
|
900f57bc94 | ||
|
|
41fabe25bd | ||
|
|
1e634da6dd | ||
|
|
a4386862f5 | ||
|
|
7435ddd89b | ||
|
|
f1e5508023 | ||
|
|
0fd8e46ea2 | ||
|
|
cb4764e8d0 | ||
|
|
0c55ff682b | ||
|
|
8659222b82 | ||
|
|
64b2332534 | ||
|
|
303278228a | ||
|
|
16baec8877 | ||
|
|
0b7cc9aa9d | ||
|
|
77bc1ed93b | ||
|
|
d2969046d4 | ||
|
|
b3c67343e5 | ||
|
|
f26624902f | ||
|
|
f96196c271 | ||
|
|
f47b3c0fd0 | ||
|
|
170ac43ebe | ||
|
|
93e0b43b03 | ||
|
|
b9c9069c5a | ||
|
|
fdc9b42d14 | ||
|
|
6cb690996d | ||
|
|
eb63396934 | ||
|
|
f1aa394d29 | ||
|
|
415969fca0 | ||
|
|
dfbd9ad9d0 | ||
|
|
a50424930b | ||
|
|
9843ff7b49 | ||
|
|
7ea79b3ed4 | ||
|
|
b783b7e364 | ||
|
|
60d0011159 | ||
|
|
e730044cc1 | ||
|
|
60ea566ecc | ||
|
|
fd797419dd | ||
|
|
3a5a785f51 | ||
|
|
65564198ef | ||
|
|
def0b0ceb0 | ||
|
|
01776721ab | ||
|
|
6f7d012184 | ||
|
|
7d4d468e58 | ||
|
|
d1a870b372 | ||
|
|
680e55e493 | ||
|
|
c779bae39a | ||
|
|
5a4fafec31 | ||
|
|
cfcc94c2bb | ||
|
|
8d1c8fad7c | ||
|
|
c6cc437092 | ||
|
|
6a30e96439 | ||
|
|
95d7869aa6 | ||
|
|
95a26b87ce | ||
|
|
6c0bfdd0b7 | ||
|
|
0e19a3a614 | ||
|
|
35350315b7 | ||
|
|
8f97380d75 | ||
|
|
fe6bac98c7 | ||
|
|
77c5502b19 | ||
|
|
065eb6f1d5 | ||
|
|
103e4b2b22 | ||
|
|
cb4e5b551f | ||
|
|
c22d9a7e99 | ||
|
|
2b52cf3896 | ||
|
|
5b16bd3748 | ||
|
|
40bbe0cd39 | ||
|
|
661dc39d9c | ||
|
|
07c240e9a1 | ||
|
|
93f20cb8e4 | ||
|
|
e512f60386 | ||
|
|
59442ea786 | ||
|
|
ee8a7f67a7 | ||
|
|
c2c24787da | ||
|
|
60f69cb79b | ||
|
|
3bc70fc2c2 | ||
|
|
f09a3c0a09 | ||
|
|
f15a879898 | ||
|
|
984f3f0aa7 | ||
|
|
1559d18757 | ||
|
|
c2c0ca0eeb | ||
|
|
754c35f2f5 | ||
|
|
2bbd5a806b | ||
|
|
5891192fda | ||
|
|
5effb36530 | ||
|
|
bc72cea911 | ||
|
|
ec8886cf09 | ||
|
|
bce0cc4ca0 | ||
|
|
66eaf28ac8 | ||
|
|
d728b3d745 | ||
|
|
11426ed5a2 | ||
|
|
386abb7000 | ||
|
|
476fb7bbfc | ||
|
|
c825720ae0 | ||
|
|
6e407fff7b | ||
|
|
11b24d23aa | ||
|
|
2135e20299 | ||
|
|
123277167b | ||
|
|
4a9f85674f | ||
|
|
719579177e | ||
|
|
3f6a1f33d4 | ||
|
|
688dee73c2 | ||
|
|
5fa10d82f4 | ||
|
|
4cde77929f | ||
|
|
41f66ee2f3 | ||
|
|
2ee9db9479 | ||
|
|
f87883712e | ||
|
|
ea22ebfe09 | ||
|
|
0edd905be5 | ||
|
|
47e2ff7500 | ||
|
|
c011621363 | ||
|
|
8c47d95901 | ||
|
|
e08be40462 | ||
|
|
d7022ad67b | ||
|
|
38f435eba8 | ||
|
|
6f429c16ee | ||
|
|
dfaebd0908 | ||
|
|
d6abb06544 | ||
|
|
d950369202 | ||
|
|
745fc385e9 | ||
|
|
f02a1caced | ||
|
|
e547962d31 | ||
|
|
31fe8e2a4c | ||
|
|
1b1dc86fb6 | ||
|
|
7539390fc3 | ||
|
|
ad7b508184 | ||
|
|
0fa37a5b62 | ||
|
|
1cbfc73384 | ||
|
|
c58ae29dd5 | ||
|
|
96e442b564 | ||
|
|
e817f867af | ||
|
|
8c8c96bb89 | ||
|
|
f0e7af10bb | ||
|
|
4e44bcfdef | ||
|
|
d4cea3a9ff | ||
|
|
f06b7dfd20 | ||
|
|
6dd4f692e2 |
No files matched your search
@@ -0,0 +1,29 @@
|
||||
Original source (Freespace 2) by Volition, Inc.; see "credits.tbl"
|
||||
|
||||
Modifications by the FreeSpace Source Code Project (FSSCP)
|
||||
http://fs2source.warpcore.org
|
||||
|
||||
FS2_OPEN STAFF:
|
||||
|
||||
Project leader:
|
||||
Edward "Inquisitor" Gardner
|
||||
|
||||
Programmers:
|
||||
"Bobboau"
|
||||
Dennis "DTP" Pedersen
|
||||
Ian "Goober5000" Warfield
|
||||
Joe "Righteous1" Dowd
|
||||
Mike "penguin" Harris
|
||||
"Mysterial"
|
||||
"PhReAk"
|
||||
Thomas "Random Tiger" Whittaker
|
||||
Will "Unknown PLayer" Rousnel
|
||||
"WMCoolmon"
|
||||
|
||||
Web support:
|
||||
Icefire and the staff at Volitionwatch.com
|
||||
Alex "Thunder" Avery and the staff at Hard Light Productions
|
||||
|
||||
Special thanks to:
|
||||
Volition for making FS2 such a great game
|
||||
Dave Baranec for giving us the code and keeping us sanity checked
|
||||
@@ -0,0 +1,13 @@
|
||||
Volition Copyright (applies to original FreeSpace2 source code
|
||||
developed and released by Volition):
|
||||
|
||||
"Copyright (C) Volition, Inc. 1999. All rights reserved.
|
||||
|
||||
All source code herein is the property of Volition, Inc. You may not
|
||||
sell or otherwise commercially exploit the source or things you
|
||||
created based on the source."
|
||||
|
||||
|
||||
Modifications by members of the FreeSpace Source Code Project are
|
||||
released under whatever terms the individual authors choose, but the
|
||||
above notice continues to apply to all fs2_open code.
|
||||
Binary file not shown.
@@ -43,7 +43,7 @@ RSC=rc.exe
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c
|
||||
# ADD CPP /nologo /G5 /MT /W4 /GX /Zi /Ot /Ow /Og /Oi /Oy /I "code" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "WIN32" /U "_DEBUG" /YX /FD /c
|
||||
# ADD CPP /nologo /G5 /MT /W4 /GX /Zi /Ot /Ow /Og /Oi /Oy /I "code" /D "_MBCS" /D "NDEBUG" /D "_WINDOWS" /D "WIN32" /D "USE_OPENGL" /U "_DEBUG" /FR /YX /FD /c
|
||||
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD BASE RSC /l 0x409 /d "NDEBUG"
|
||||
@@ -69,7 +69,7 @@ LINK32=link.exe
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c
|
||||
# ADD CPP /nologo /G5 /MTd /W4 /Gm /Gi /GX /ZI /Od /I "code" /D "WIN32" /D "_WINDOWS" /D "_DEBUG" /D "NO_CD_CHECK" /D "USE_DX81" /U "NDEBUG" /Fr /YX /FD /GZ /c
|
||||
# ADD CPP /nologo /G5 /MTd /W4 /Gm /Gi /GX /ZI /Od /I "code" /D "WIN32" /D "_WINDOWS" /D "_DEBUG" /D "NO_CD_CHECK" /D "USE_DX81" /D "USE_OPENGL" /U "NDEBUG" /Fr /YX /FD /GZ /c
|
||||
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
|
||||
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
|
||||
# ADD BASE RSC /l 0x409 /d "_DEBUG"
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
This is still in pretty rough form.
|
||||
|
||||
|
||||
=== for people building fs2_open:
|
||||
|
||||
Win32-MSVC:
|
||||
Use the Freespace2.dsw workspace and build within the IDE.
|
||||
|
||||
|
||||
Win32-MinGW:
|
||||
make
|
||||
|
||||
|
||||
Linux and other unix variants (NOT YET COMPLETE)
|
||||
./configure [options] (options tbd)
|
||||
make -f makefile.linux
|
||||
|
||||
|
||||
|
||||
=== for the project maintainers (people who need to
|
||||
=== keep the makefiles up to date):
|
||||
|
||||
aclocal
|
||||
autoconf
|
||||
automake
|
||||
./configure
|
||||
make
|
||||
@@ -0,0 +1,5 @@
|
||||
# Makefile.am for fs2_open (top level)
|
||||
#
|
||||
# This file uses GNU Automake to generate makefiles
|
||||
|
||||
SUBDIRS = code
|
||||
@@ -0,0 +1,506 @@
|
||||
# Makefile.in generated by automake 1.7.2 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
|
||||
# Free Software Foundation, Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
@SET_MAKE@
|
||||
|
||||
# Makefile.am for fs2_open (top level)
|
||||
#
|
||||
# This file uses GNU Automake to generate makefiles
|
||||
|
||||
srcdir = @srcdir@
|
||||
top_srcdir = @top_srcdir@
|
||||
VPATH = @srcdir@
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
top_builddir = .
|
||||
|
||||
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
||||
INSTALL = @INSTALL@
|
||||
install_sh_DATA = $(install_sh) -c -m 644
|
||||
install_sh_PROGRAM = $(install_sh) -c
|
||||
install_sh_SCRIPT = $(install_sh) -c
|
||||
INSTALL_HEADER = $(INSTALL_DATA)
|
||||
transform = $(program_transform_name)
|
||||
NORMAL_INSTALL = :
|
||||
PRE_INSTALL = :
|
||||
POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
host_triplet = @host@
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AMDEP_FALSE = @AMDEP_FALSE@
|
||||
AMDEP_TRUE = @AMDEP_TRUE@
|
||||
AMTAR = @AMTAR@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AWK = @AWK@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CXX = @CXX@
|
||||
CXXDEPMODE = @CXXDEPMODE@
|
||||
CXXFLAGS = @CXXFLAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
DX8_INCLUDE = @DX8_INCLUDE@
|
||||
DX8_LIB = @DX8_LIB@
|
||||
ECHO_C = @ECHO_C@
|
||||
ECHO_N = @ECHO_N@
|
||||
ECHO_T = @ECHO_T@
|
||||
EXEEXT = @EXEEXT@
|
||||
FS2_GRSOFT_FALSE = @FS2_GRSOFT_FALSE@
|
||||
FS2_GRSOFT_TRUE = @FS2_GRSOFT_TRUE@
|
||||
FS2_JOYSTICK_FALSE = @FS2_JOYSTICK_FALSE@
|
||||
FS2_JOYSTICK_TRUE = @FS2_JOYSTICK_TRUE@
|
||||
FS2_NETWORKING_FALSE = @FS2_NETWORKING_FALSE@
|
||||
FS2_NETWORKING_TRUE = @FS2_NETWORKING_TRUE@
|
||||
FS2_OS_UNIX_FALSE = @FS2_OS_UNIX_FALSE@
|
||||
FS2_OS_UNIX_TRUE = @FS2_OS_UNIX_TRUE@
|
||||
FS2_OS_WIN32_FALSE = @FS2_OS_WIN32_FALSE@
|
||||
FS2_OS_WIN32_TRUE = @FS2_OS_WIN32_TRUE@
|
||||
FS2_SOUND_FALSE = @FS2_SOUND_FALSE@
|
||||
FS2_SOUND_TRUE = @FS2_SOUND_TRUE@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBS = @LIBS@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
OBJEXT = @OBJEXT@
|
||||
PACKAGE = @PACKAGE@
|
||||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
||||
PACKAGE_NAME = @PACKAGE_NAME@
|
||||
PACKAGE_STRING = @PACKAGE_STRING@
|
||||
PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
||||
PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||
SET_MAKE = @SET_MAKE@
|
||||
SHELL = @SHELL@
|
||||
STRIP = @STRIP@
|
||||
VERSION = @VERSION@
|
||||
ac_ct_CXX = @ac_ct_CXX@
|
||||
ac_ct_STRIP = @ac_ct_STRIP@
|
||||
am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
|
||||
am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
|
||||
am__include = @am__include@
|
||||
am__quote = @am__quote@
|
||||
bindir = @bindir@
|
||||
build = @build@
|
||||
build_alias = @build_alias@
|
||||
build_cpu = @build_cpu@
|
||||
build_os = @build_os@
|
||||
build_vendor = @build_vendor@
|
||||
datadir = @datadir@
|
||||
exec_prefix = @exec_prefix@
|
||||
host = @host@
|
||||
host_alias = @host_alias@
|
||||
host_cpu = @host_cpu@
|
||||
host_os = @host_os@
|
||||
host_vendor = @host_vendor@
|
||||
includedir = @includedir@
|
||||
infodir = @infodir@
|
||||
install_sh = @install_sh@
|
||||
libdir = @libdir@
|
||||
libexecdir = @libexecdir@
|
||||
localstatedir = @localstatedir@
|
||||
mandir = @mandir@
|
||||
oldincludedir = @oldincludedir@
|
||||
prefix = @prefix@
|
||||
program_transform_name = @program_transform_name@
|
||||
sbindir = @sbindir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
sysconfdir = @sysconfdir@
|
||||
target_alias = @target_alias@
|
||||
|
||||
SUBDIRS = code
|
||||
subdir = .
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
|
||||
CONFIG_CLEAN_FILES =
|
||||
DIST_SOURCES =
|
||||
|
||||
RECURSIVE_TARGETS = info-recursive dvi-recursive pdf-recursive \
|
||||
ps-recursive install-info-recursive uninstall-info-recursive \
|
||||
all-recursive install-data-recursive install-exec-recursive \
|
||||
installdirs-recursive install-recursive uninstall-recursive \
|
||||
check-recursive installcheck-recursive
|
||||
DIST_COMMON = README AUTHORS COPYING ChangeLog INSTALL Makefile.am \
|
||||
Makefile.in NEWS aclocal.m4 config.guess config.sub configure \
|
||||
configure.in depcomp install-sh missing mkinstalldirs
|
||||
DIST_SUBDIRS = $(SUBDIRS)
|
||||
all: all-recursive
|
||||
|
||||
.SUFFIXES:
|
||||
|
||||
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
|
||||
configure.lineno
|
||||
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
|
||||
cd $(top_srcdir) && \
|
||||
$(AUTOMAKE) --gnu Makefile
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)
|
||||
|
||||
$(top_builddir)/config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
$(SHELL) ./config.status --recheck
|
||||
$(srcdir)/configure: $(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES)
|
||||
cd $(srcdir) && $(AUTOCONF)
|
||||
|
||||
$(ACLOCAL_M4): configure.in
|
||||
cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
|
||||
uninstall-info-am:
|
||||
|
||||
# This directory's subdirectories are mostly independent; you can cd
|
||||
# into them and run `make' without going through this Makefile.
|
||||
# To change the values of `make' variables: instead of editing Makefiles,
|
||||
# (1) if the variable is set in `config.status', edit `config.status'
|
||||
# (which will cause the Makefiles to be regenerated when you run `make');
|
||||
# (2) otherwise, pass the desired values on the `make' command line.
|
||||
$(RECURSIVE_TARGETS):
|
||||
@set fnord $$MAKEFLAGS; amf=$$2; \
|
||||
dot_seen=no; \
|
||||
target=`echo $@ | sed s/-recursive//`; \
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
echo "Making $$target in $$subdir"; \
|
||||
if test "$$subdir" = "."; then \
|
||||
dot_seen=yes; \
|
||||
local_target="$$target-am"; \
|
||||
else \
|
||||
local_target="$$target"; \
|
||||
fi; \
|
||||
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|
||||
|| case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
|
||||
done; \
|
||||
if test "$$dot_seen" = "no"; then \
|
||||
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
|
||||
fi; test -z "$$fail"
|
||||
|
||||
mostlyclean-recursive clean-recursive distclean-recursive \
|
||||
maintainer-clean-recursive:
|
||||
@set fnord $$MAKEFLAGS; amf=$$2; \
|
||||
dot_seen=no; \
|
||||
case "$@" in \
|
||||
distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
|
||||
*) list='$(SUBDIRS)' ;; \
|
||||
esac; \
|
||||
rev=''; for subdir in $$list; do \
|
||||
if test "$$subdir" = "."; then :; else \
|
||||
rev="$$subdir $$rev"; \
|
||||
fi; \
|
||||
done; \
|
||||
rev="$$rev ."; \
|
||||
target=`echo $@ | sed s/-recursive//`; \
|
||||
for subdir in $$rev; do \
|
||||
echo "Making $$target in $$subdir"; \
|
||||
if test "$$subdir" = "."; then \
|
||||
local_target="$$target-am"; \
|
||||
else \
|
||||
local_target="$$target"; \
|
||||
fi; \
|
||||
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|
||||
|| case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
|
||||
done && test -z "$$fail"
|
||||
tags-recursive:
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
|
||||
done
|
||||
ctags-recursive:
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
|
||||
done
|
||||
|
||||
ETAGS = etags
|
||||
ETAGSFLAGS =
|
||||
|
||||
CTAGS = ctags
|
||||
CTAGSFLAGS =
|
||||
|
||||
tags: TAGS
|
||||
|
||||
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
mkid -fID $$unique
|
||||
|
||||
TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
tags=; \
|
||||
here=`pwd`; \
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
if test "$$subdir" = .; then :; else \
|
||||
test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \
|
||||
fi; \
|
||||
done; \
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
test -z "$(ETAGS_ARGS)$$tags$$unique" \
|
||||
|| $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
$$tags $$unique
|
||||
|
||||
ctags: CTAGS
|
||||
CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
tags=; \
|
||||
here=`pwd`; \
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|
||||
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
|
||||
$$tags $$unique
|
||||
|
||||
GTAGS:
|
||||
here=`$(am__cd) $(top_builddir) && pwd` \
|
||||
&& cd $(top_srcdir) \
|
||||
&& gtags -i $(GTAGS_ARGS) $$here
|
||||
|
||||
distclean-tags:
|
||||
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
|
||||
top_distdir = .
|
||||
distdir = $(PACKAGE)-$(VERSION)
|
||||
|
||||
am__remove_distdir = \
|
||||
{ test ! -d $(distdir) \
|
||||
|| { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \
|
||||
&& rm -fr $(distdir); }; }
|
||||
|
||||
GZIP_ENV = --best
|
||||
distuninstallcheck_listfiles = find . -type f -print
|
||||
distcleancheck_listfiles = find . -type f -print
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
$(am__remove_distdir)
|
||||
mkdir $(distdir)
|
||||
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
|
||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
|
||||
list='$(DISTFILES)'; for file in $$list; do \
|
||||
case $$file in \
|
||||
$(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
|
||||
$(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
|
||||
esac; \
|
||||
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
|
||||
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
|
||||
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
|
||||
dir="/$$dir"; \
|
||||
$(mkinstalldirs) "$(distdir)$$dir"; \
|
||||
else \
|
||||
dir=''; \
|
||||
fi; \
|
||||
if test -d $$d/$$file; then \
|
||||
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
|
||||
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
|
||||
fi; \
|
||||
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
|
||||
else \
|
||||
test -f $(distdir)/$$file \
|
||||
|| cp -p $$d/$$file $(distdir)/$$file \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
if test "$$subdir" = .; then :; else \
|
||||
test -d $(distdir)/$$subdir \
|
||||
|| mkdir $(distdir)/$$subdir \
|
||||
|| exit 1; \
|
||||
(cd $$subdir && \
|
||||
$(MAKE) $(AM_MAKEFLAGS) \
|
||||
top_distdir="$(top_distdir)" \
|
||||
distdir=../$(distdir)/$$subdir \
|
||||
distdir) \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
-find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
|
||||
! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
|
||||
! -type d ! -perm -400 -exec chmod a+r {} \; -o \
|
||||
! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \
|
||||
|| chmod -R a+r $(distdir)
|
||||
dist-gzip: distdir
|
||||
$(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
|
||||
$(am__remove_distdir)
|
||||
|
||||
dist dist-all: distdir
|
||||
$(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
|
||||
$(am__remove_distdir)
|
||||
|
||||
# This target untars the dist file and tries a VPATH configuration. Then
|
||||
# it guarantees that the distribution is self-contained by making another
|
||||
# tarfile.
|
||||
distcheck: dist
|
||||
$(am__remove_distdir)
|
||||
GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(AMTAR) xf -
|
||||
chmod -R a-w $(distdir); chmod a+w $(distdir)
|
||||
mkdir $(distdir)/=build
|
||||
mkdir $(distdir)/=inst
|
||||
chmod a-w $(distdir)
|
||||
dc_install_base=`$(am__cd) $(distdir)/=inst && pwd` \
|
||||
&& dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
|
||||
&& cd $(distdir)/=build \
|
||||
&& ../configure --srcdir=.. --prefix="$$dc_install_base" \
|
||||
$(DISTCHECK_CONFIGURE_FLAGS) \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) dvi \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) check \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) install \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) installcheck \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) uninstall \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
|
||||
distuninstallcheck \
|
||||
&& chmod -R a-w "$$dc_install_base" \
|
||||
&& ({ \
|
||||
(cd ../.. && $(mkinstalldirs) "$$dc_destdir") \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
|
||||
distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
|
||||
} || { rm -rf "$$dc_destdir"; exit 1; }) \
|
||||
&& rm -rf "$$dc_destdir" \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) dist-gzip \
|
||||
&& rm -f $(distdir).tar.gz \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) distcleancheck
|
||||
$(am__remove_distdir)
|
||||
@echo "$(distdir).tar.gz is ready for distribution" | \
|
||||
sed 'h;s/./=/g;p;x;p;x'
|
||||
distuninstallcheck:
|
||||
cd $(distuninstallcheck_dir) \
|
||||
&& test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
|
||||
|| { echo "ERROR: files left after uninstall:" ; \
|
||||
if test -n "$(DESTDIR)"; then \
|
||||
echo " (check DESTDIR support)"; \
|
||||
fi ; \
|
||||
$(distuninstallcheck_listfiles) ; \
|
||||
exit 1; } >&2
|
||||
distcleancheck: distclean
|
||||
if test '$(srcdir)' = . ; then \
|
||||
echo "ERROR: distcleancheck can only run from a VPATH build" ; \
|
||||
exit 1 ; \
|
||||
fi
|
||||
test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
|
||||
|| { echo "ERROR: files left in build directory after distclean:" ; \
|
||||
$(distcleancheck_listfiles) ; \
|
||||
exit 1; } >&2
|
||||
check-am: all-am
|
||||
check: check-recursive
|
||||
all-am: Makefile
|
||||
installdirs: installdirs-recursive
|
||||
installdirs-am:
|
||||
|
||||
install: install-recursive
|
||||
install-exec: install-exec-recursive
|
||||
install-data: install-data-recursive
|
||||
uninstall: uninstall-recursive
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
|
||||
installcheck: installcheck-recursive
|
||||
install-strip:
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
INSTALL_STRIP_FLAG=-s \
|
||||
`test -z '$(STRIP)' || \
|
||||
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
|
||||
distclean-generic:
|
||||
-rm -f Makefile $(CONFIG_CLEAN_FILES)
|
||||
|
||||
maintainer-clean-generic:
|
||||
@echo "This command is intended for maintainers to use"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
clean: clean-recursive
|
||||
|
||||
clean-am: clean-generic mostlyclean-am
|
||||
|
||||
distclean: distclean-recursive
|
||||
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
|
||||
distclean-am: clean-am distclean-generic distclean-tags
|
||||
|
||||
dvi: dvi-recursive
|
||||
|
||||
dvi-am:
|
||||
|
||||
info: info-recursive
|
||||
|
||||
info-am:
|
||||
|
||||
install-data-am:
|
||||
|
||||
install-exec-am:
|
||||
|
||||
install-info: install-info-recursive
|
||||
|
||||
install-man:
|
||||
|
||||
installcheck-am:
|
||||
|
||||
maintainer-clean: maintainer-clean-recursive
|
||||
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
|
||||
-rm -rf autom4te.cache
|
||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
||||
|
||||
mostlyclean: mostlyclean-recursive
|
||||
|
||||
mostlyclean-am: mostlyclean-generic
|
||||
|
||||
pdf: pdf-recursive
|
||||
|
||||
pdf-am:
|
||||
|
||||
ps: ps-recursive
|
||||
|
||||
ps-am:
|
||||
|
||||
uninstall-am: uninstall-info-am
|
||||
|
||||
uninstall-info: uninstall-info-recursive
|
||||
|
||||
.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am clean \
|
||||
clean-generic clean-recursive ctags ctags-recursive dist \
|
||||
dist-all dist-gzip distcheck distclean distclean-generic \
|
||||
distclean-recursive distclean-tags distcleancheck distdir \
|
||||
distuninstallcheck dvi dvi-am dvi-recursive info info-am \
|
||||
info-recursive install install-am install-data install-data-am \
|
||||
install-data-recursive install-exec install-exec-am \
|
||||
install-exec-recursive install-info install-info-am \
|
||||
install-info-recursive install-man install-recursive \
|
||||
install-strip installcheck installcheck-am installdirs \
|
||||
installdirs-am installdirs-recursive maintainer-clean \
|
||||
maintainer-clean-generic maintainer-clean-recursive mostlyclean \
|
||||
mostlyclean-generic mostlyclean-recursive pdf pdf-am \
|
||||
pdf-recursive ps ps-am ps-recursive tags tags-recursive \
|
||||
uninstall uninstall-am uninstall-info-am \
|
||||
uninstall-info-recursive uninstall-recursive
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
||||
@@ -0,0 +1,3 @@
|
||||
This file is required to keep autoconf/automake from complaining.
|
||||
|
||||
See the ChangeLog for what's new.
|
||||
@@ -0,0 +1,4 @@
|
||||
This file is required to keep autoconf/automake from complaining.
|
||||
|
||||
See the ChangeLog to see what's new.
|
||||
See the INSTALL file for instructions on how to build fs2_open.
|
||||
@@ -1,700 +0,0 @@
|
||||
TARGET = fs2
|
||||
|
||||
ifeq ($(USE_SOUND), 1)
|
||||
SOUND_DEF=
|
||||
SOUND_OBJS= \
|
||||
gamesnd/eventmusic.o \
|
||||
gamesnd/gamesnd.o \
|
||||
object/objectsnd.o \
|
||||
sound/acm.o \
|
||||
sound/audiostr.o \
|
||||
sound/ds.o \
|
||||
sound/ds3d.o \
|
||||
sound/dscap.o \
|
||||
sound/midifile.o \
|
||||
sound/rbaudio.o \
|
||||
sound/rtvoice.o \
|
||||
sound/sound.o \
|
||||
sound/winmidi.o \
|
||||
sound/winmidi_base.o \
|
||||
vcodec/codec1.o
|
||||
else
|
||||
SOUND_DEF=-DNO_SOUND
|
||||
SOUND_OBJS=
|
||||
endif # USE_SOUND
|
||||
|
||||
|
||||
ifeq ($(USE_JOYSTICK), 1)
|
||||
JOYSTICK_DEF=
|
||||
JOYSTICK_OBJS= \
|
||||
io/joy.o \
|
||||
io/joy_ff.o \
|
||||
io/swff_lib.o
|
||||
else
|
||||
JOYSTICK_DEF=-DNO_JOYSTICK
|
||||
JOYSTICK_OBJS=
|
||||
endif # USE_JOYSTICK
|
||||
|
||||
|
||||
ifeq ($(USE_NETWORK), 1)
|
||||
# no support for standalone server yet... (UI is Win32 specific)
|
||||
NETWORK_DEF=-DNO_STANDALONE
|
||||
NETWORK_OBJS= \
|
||||
hud/hudobserver.o \
|
||||
network/multi.o \
|
||||
network/multimsgs.o \
|
||||
network/multiteamselect.o \
|
||||
network/multiui.o \
|
||||
network/multiutil.o \
|
||||
network/multi_campaign.o \
|
||||
network/multi_data.o \
|
||||
network/multi_dogfight.o \
|
||||
network/multi_endgame.o \
|
||||
network/multi_ingame.o \
|
||||
network/multi_kick.o \
|
||||
network/multi_log.o \
|
||||
network/multi_obj.o \
|
||||
network/multi_observer.o \
|
||||
network/multi_options.o \
|
||||
network/multi_pause.o \
|
||||
network/multi_pinfo.o \
|
||||
network/multi_ping.o \
|
||||
network/multi_pmsg.o \
|
||||
network/multi_rate.o \
|
||||
network/multi_respawn.o \
|
||||
network/multi_team.o \
|
||||
network/multi_voice.o \
|
||||
network/multi_xfer.o \
|
||||
network/psnet.o \
|
||||
network/psnet2.o \
|
||||
menuui/optionsmenumulti.o \
|
||||
missionui/chatbox.o
|
||||
#
|
||||
# Network/stand_gui.o
|
||||
#
|
||||
else
|
||||
NETWORK_DEF=-DNO_NETWORK -DNO_STANDALONE
|
||||
NETWORK_OBJS=
|
||||
endif # USE_NETWORK
|
||||
|
||||
|
||||
ifeq ($(USE_OPENGL), 0)
|
||||
OPENGL_DEF=
|
||||
else
|
||||
OPENGL_DEF=-DUSE_OPENGL
|
||||
endif # USE_OPENGL
|
||||
|
||||
|
||||
LDFLAGS = -g
|
||||
LDLIBS = -L/usr/X11R6/lib -lSDL -lGL -lGLU -lpthread
|
||||
|
||||
CXXFLAGS = \
|
||||
-g \
|
||||
-I/usr/local/include/SDL \
|
||||
-I. \
|
||||
-fno-exceptions \
|
||||
-D_DEBUG -DNO_CD_CHECK -UNDEBUG \
|
||||
-DNO_DIRECT3D $(SOUND_DEF) $(JOYSTICK_DEF) $(NETWORK_DEF) $(OPENGL_DEF)
|
||||
|
||||
ANIM_OBJFILES = \
|
||||
anim/animplay.o \
|
||||
anim/packunpack.o
|
||||
|
||||
ASTEROID_OBJFILES = \
|
||||
asteroid/asteroid.o
|
||||
|
||||
BMPMAN_OBJFILES = \
|
||||
bmpman/bmpman.o
|
||||
|
||||
CFILE_OBJFILES = \
|
||||
cfile/cfile.o \
|
||||
cfile/cfilearchive.o \
|
||||
cfile/cfilelist.o \
|
||||
cfile/cfilesystem.o
|
||||
|
||||
CMDLINE_OBJFILES = \
|
||||
cmdline/cmdline.o
|
||||
|
||||
CMEASURE_OBJFILES = \
|
||||
cmeasure/cmeasure.o
|
||||
|
||||
CONTROLCONFIG_OBJFILES = \
|
||||
controlconfig/controlsconfig.o \
|
||||
controlconfig/controlsconfigcommon.o
|
||||
|
||||
CUTSCENE_OBJFILES = \
|
||||
cutscene/cutscenes.o
|
||||
|
||||
DEBRIS_OBJFILES = \
|
||||
debris/debris.o
|
||||
|
||||
DEBUGCONSOLE_OBJFILES = \
|
||||
debugconsole/console.o
|
||||
|
||||
DEMO_OBJFILES = \
|
||||
demo/demo.o
|
||||
|
||||
EXCEPTIONHANDLER_OBJFILES = \
|
||||
exceptionhandler/exceptionhandler.o
|
||||
|
||||
FIREBALL_OBJFILES = \
|
||||
fireball/fireballs.o \
|
||||
fireball/warpineffect.o
|
||||
|
||||
GAMEHELP_OBJFILES = \
|
||||
gamehelp/contexthelp.o \
|
||||
gamehelp/gameplayhelp.o
|
||||
|
||||
GAMESEQUENCE_OBJFILES = \
|
||||
gamesequence/gamesequence.o
|
||||
|
||||
# gamesnd/eventmusic.o
|
||||
# gamesnd/gamesnd.o
|
||||
GAMESND_OBJFILES =
|
||||
|
||||
# glide/glide.o
|
||||
GLIDE_OBJFILES =
|
||||
|
||||
# globalincs/windebug.o
|
||||
GLOBALINCS_OBJFILES = \
|
||||
globalincs/alphacolors.o \
|
||||
globalincs/crypt.o \
|
||||
globalincs/systemvars.o \
|
||||
globalincs/version.o
|
||||
|
||||
# graphics/grd3d.o
|
||||
# graphics/grd3drender.o
|
||||
# graphics/grd3dtexture.o
|
||||
# graphics/grdirectdraw.o
|
||||
# graphics/grglide.o
|
||||
# graphics/grglidetexture.o
|
||||
# graphics/grsoft.o
|
||||
# graphics/scaler.o
|
||||
# graphics/tmapgenericscans.o
|
||||
# graphics/tmapscantiled128x128.o
|
||||
# graphics/tmapscantiled16x16.o
|
||||
# graphics/tmapscantiled256x256.o
|
||||
# graphics/tmapscantiled32x32.o
|
||||
# graphics/tmapscantiled64x64.o
|
||||
# graphics/tmapscanline.o
|
||||
# graphics/tmapper.o
|
||||
GRAPHICS_OBJFILES = \
|
||||
graphics/2d.o \
|
||||
graphics/aaline.o \
|
||||
graphics/bitblt.o \
|
||||
graphics/circle.o \
|
||||
graphics/colors.o \
|
||||
graphics/font.o \
|
||||
graphics/gradient.o \
|
||||
graphics/gropengl.o \
|
||||
graphics/grzbuffer.o \
|
||||
graphics/line.o \
|
||||
graphics/pixel.o \
|
||||
graphics/rect.o \
|
||||
graphics/shade.o
|
||||
|
||||
# hud/hudobserver.o
|
||||
HUD_OBJFILES = \
|
||||
hud/hud.o \
|
||||
hud/hudartillery.o \
|
||||
hud/hudbrackets.o \
|
||||
hud/hudconfig.o \
|
||||
hud/hudescort.o \
|
||||
hud/hudets.o \
|
||||
hud/hudlock.o \
|
||||
hud/hudmessage.o \
|
||||
hud/hudreticle.o \
|
||||
hud/hudshield.o \
|
||||
hud/hudsquadmsg.o \
|
||||
hud/hudtarget.o \
|
||||
hud/hudtargetbox.o \
|
||||
hud/hudwingmanstatus.o
|
||||
|
||||
INETFILE_OBJFILES = \
|
||||
inetfile/cftp.o \
|
||||
inetfile/chttpget.o \
|
||||
inetfile/inetgetfile.o
|
||||
|
||||
# io/joy.o
|
||||
# io/joy_ff.o
|
||||
# io/swff_lib.o
|
||||
IO_OBJFILES = \
|
||||
io/key.o \
|
||||
io/keycontrol.o \
|
||||
io/mouse.o \
|
||||
io/timer.o \
|
||||
io/xmouse.o
|
||||
|
||||
JUMPNODE_OBJFILES = \
|
||||
jumpnode/jumpnode.o
|
||||
|
||||
LIGHTING_OBJFILES = \
|
||||
lighting/lighting.o
|
||||
|
||||
LOCALIZATION_OBJFILES = \
|
||||
localization/fhash.o \
|
||||
localization/localize.o
|
||||
|
||||
MATH_OBJFILES = \
|
||||
math/fix.o \
|
||||
math/floating.o \
|
||||
math/fvi.o \
|
||||
math/spline.o \
|
||||
math/staticrand.o \
|
||||
math/vecmat.o
|
||||
|
||||
# menuui/optionsmenumulti.o
|
||||
MENUUI_OBJFILES = \
|
||||
menuui/barracks.o \
|
||||
menuui/credits.o \
|
||||
menuui/fishtank.o \
|
||||
menuui/mainhallmenu.o \
|
||||
menuui/mainhalltemp.o \
|
||||
menuui/optionsmenu.o \
|
||||
menuui/playermenu.o \
|
||||
menuui/readyroom.o \
|
||||
menuui/snazzyui.o \
|
||||
menuui/techmenu.o \
|
||||
menuui/trainingmenu.o
|
||||
|
||||
MISSION_OBJFILES = \
|
||||
mission/missionbriefcommon.o \
|
||||
mission/missioncampaign.o \
|
||||
mission/missiongoals.o \
|
||||
mission/missiongrid.o \
|
||||
mission/missionhotkey.o \
|
||||
mission/missionload.o \
|
||||
mission/missionlog.o \
|
||||
mission/missionmessage.o \
|
||||
mission/missionparse.o \
|
||||
mission/missiontraining.o
|
||||
|
||||
# missionui/chatbox.o
|
||||
MISSIONUI_OBJFILES = \
|
||||
missionui/missionbrief.o \
|
||||
missionui/missioncmdbrief.o \
|
||||
missionui/missiondebrief.o \
|
||||
missionui/missionloopbrief.o \
|
||||
missionui/missionpause.o \
|
||||
missionui/missionrecommend.o \
|
||||
missionui/missionscreencommon.o \
|
||||
missionui/missionshipchoice.o \
|
||||
missionui/missionstats.o \
|
||||
missionui/missionweaponchoice.o \
|
||||
missionui/redalert.o
|
||||
|
||||
MODEL_OBJFILES = \
|
||||
model/modelcollide.o \
|
||||
model/modelinterp.o \
|
||||
model/modeloctant.o \
|
||||
model/modelread.o
|
||||
|
||||
NEBULA_OBJFILES = \
|
||||
nebula/neb.o \
|
||||
nebula/neblightning.o
|
||||
|
||||
# network/multi.o
|
||||
# network/multi_campaign.o
|
||||
# network/multi_data.o
|
||||
# network/multi_dogfight.o
|
||||
# network/multi_endgame.o
|
||||
# network/multi_ingame.o
|
||||
# network/multi_kick.o
|
||||
# network/multi_log.o
|
||||
# network/multimsgs.o
|
||||
# network/multi_obj.o
|
||||
# network/multi_observer.o
|
||||
# network/multi_oo.o
|
||||
# network/multi_options.o
|
||||
# network/multi_pause.o
|
||||
# network/multi_pinfo.o
|
||||
# network/multi_ping.o
|
||||
# network/multi_pmsg.o
|
||||
# network/multi_rate.o
|
||||
# network/multi_respawn.o
|
||||
# network/multi_team.o
|
||||
# network/multi_update.o
|
||||
# network/multi_voice.o
|
||||
# network/multi_xfer.o
|
||||
# network/multilag.o
|
||||
# network/multiteamselect.o
|
||||
# network/multiui.o
|
||||
# network/psnet.o
|
||||
# network/psnet2.o
|
||||
# network/stand_gui.o
|
||||
NETWORK_OBJFILES = \
|
||||
network/multiutil.o
|
||||
|
||||
# object/objectsnd.o
|
||||
OBJECT_OBJFILES = \
|
||||
object/collidedebrisship.o \
|
||||
object/collidedebrisweapon.o \
|
||||
object/collideshipship.o \
|
||||
object/collideshipweapon.o \
|
||||
object/collideweaponweapon.o \
|
||||
object/objcollide.o \
|
||||
object/object.o \
|
||||
object/objectsort.o
|
||||
|
||||
OBSERVER_OBJFILES = \
|
||||
observer/observer.o
|
||||
|
||||
OSAPI_OBJFILES = \
|
||||
osapi/osapi_unix.o \
|
||||
osapi/osregistry_unix.o \
|
||||
osapi/outwnd_unix.o
|
||||
|
||||
PALMAN_OBJFILES = \
|
||||
palman/palman.o
|
||||
|
||||
PARSE_OBJFILES = \
|
||||
parse/encrypt.o \
|
||||
parse/parselo.o \
|
||||
parse/sexp.o
|
||||
|
||||
PARTICLE_OBJFILES = \
|
||||
particle/particle.o
|
||||
|
||||
PCXUTILS_OBJFILES = \
|
||||
pcxutils/pcxutils.o
|
||||
|
||||
PHYSICS_OBJFILES = \
|
||||
physics/physics.o
|
||||
|
||||
PLAYERMAN_OBJFILES = \
|
||||
playerman/managepilot.o \
|
||||
playerman/playercontrol.o
|
||||
|
||||
POPUP_OBJFILES = \
|
||||
popup/popup.o \
|
||||
popup/popupdead.o
|
||||
|
||||
RADAR_OBJFILES = \
|
||||
radar/radar.o
|
||||
|
||||
RENDER_OBJFILES = \
|
||||
render/3dclipper.o \
|
||||
render/3ddraw.o \
|
||||
render/3dlaser.o \
|
||||
render/3dmath.o \
|
||||
render/3dsetup.o
|
||||
|
||||
SHIP_OBJFILES = \
|
||||
ship/afterburner.o \
|
||||
ship/ai.o \
|
||||
ship/aibig.o \
|
||||
ship/aicode.o \
|
||||
ship/aigoals.o \
|
||||
ship/awacs.o \
|
||||
ship/shield.o \
|
||||
ship/ship.o \
|
||||
ship/shipcontrails.o \
|
||||
ship/shipfx.o \
|
||||
ship/shiphit.o
|
||||
|
||||
SOUND_OBJFILES = \
|
||||
sound/acm.o \
|
||||
sound/audiostr.o \
|
||||
sound/ds.o \
|
||||
sound/ds3d.o \
|
||||
sound/dscap.o \
|
||||
sound/midifile.o \
|
||||
sound/rbaudio.o \
|
||||
sound/rtvoice.o \
|
||||
sound/sound.o \
|
||||
sound/winmidi.o \
|
||||
sound/winmidi_base.o
|
||||
|
||||
STARFIELD_OBJFILES = \
|
||||
starfield/nebula.o \
|
||||
starfield/starfield.o \
|
||||
starfield/supernova.o
|
||||
|
||||
STATS_OBJFILES = \
|
||||
stats/medals.o \
|
||||
stats/scoring.o \
|
||||
stats/stats.o
|
||||
|
||||
TGAUTILS_OBJFILES = \
|
||||
tgautils/tgautils.o
|
||||
|
||||
UI_OBJFILES = \
|
||||
ui/button.o \
|
||||
ui/checkbox.o \
|
||||
ui/gadget.o \
|
||||
ui/icon.o \
|
||||
ui/inputbox.o \
|
||||
ui/keytrap.o \
|
||||
ui/listbox.o \
|
||||
ui/radio.o \
|
||||
ui/scroll.o \
|
||||
ui/slider.o \
|
||||
ui/slider2.o \
|
||||
ui/uidraw.o \
|
||||
ui/uimouse.o \
|
||||
ui/window.o
|
||||
|
||||
VCODEC_OBJFILES = \
|
||||
vcodec/codec1.o
|
||||
|
||||
WEAPON_OBJFILES = \
|
||||
weapon/beam.o \
|
||||
weapon/corkscrew.o \
|
||||
weapon/emp.o \
|
||||
weapon/flak.o \
|
||||
weapon/muzzleflash.o \
|
||||
weapon/shockwave.o \
|
||||
weapon/swarm.o \
|
||||
weapon/trails.o \
|
||||
weapon/weapons.o
|
||||
|
||||
# SOUND_OBJFILES
|
||||
# INETFILE_OBJFILES
|
||||
# EXCEPTIONHANDLER_OBJFILES
|
||||
OBJFILES = \
|
||||
ANIM_OBJFILES \
|
||||
ASTEROID_OBJFILES \
|
||||
BMPMAN_OBJFILES \
|
||||
CFILE_OBJFILES \
|
||||
CMDLINE_OBJFILES \
|
||||
CMEASURE_OBJFILES \
|
||||
CONTROLCONFIG_OBJFILES \
|
||||
CUTSCENE_OBJFILES \
|
||||
DEBRIS_OBJFILES \
|
||||
DEBUGCONSOLE_OBJFILES \
|
||||
FIREBALL_OBJFILES \
|
||||
GAMEHELP_OBJFILES \
|
||||
GAMESEQUENCE_OBJFILES \
|
||||
GAMESND_OBJFILES \
|
||||
GLIDE_OBJFILES \
|
||||
GLOBALINCS_OBJFILES \
|
||||
GRAPHICS_OBJFILES \
|
||||
HUD_OBJFILES \
|
||||
IO_OBJFILES \
|
||||
JUMPNODE_OBJFILES \
|
||||
LIGHTING_OBJFILES \
|
||||
MATH_OBJFILES \
|
||||
MENUUI_OBJFILES \
|
||||
MISSION_OBJFILES \
|
||||
MISSIONUI_OBJFILES \
|
||||
MODEL_OBJFILES \
|
||||
NETWORK_OBJFILES \
|
||||
OBJECT_OBJFILES \
|
||||
OBSERVER_OBJFILES \
|
||||
OSAPI_OBJFILES \
|
||||
PALMAN_OBJFILES \
|
||||
PARSE_OBJFILES \
|
||||
PARTICLE_OBJFILES \
|
||||
PCXUTILS_OBJFILES \
|
||||
PHYSICS_OBJFILES \
|
||||
PLAYERMAN_OBJFILES \
|
||||
POPUP_OBJFILES \
|
||||
RADAR_OBJFILES \
|
||||
RENDER_OBJFILES \
|
||||
SHIP_OBJFILES \
|
||||
STARFIELD_OBJFILES \
|
||||
STATS_OBJFILES \
|
||||
UI_OBJFILES \
|
||||
VCODEC_OBJFILES \
|
||||
WEAPON_OBJFILES \
|
||||
NEBULA_OBJFILES \
|
||||
LOCALIZATION_OBJFILES \
|
||||
TGAUTILS_OBJFILES \
|
||||
DEMO_OBJFILES
|
||||
|
||||
# SOUND_OBJFILES
|
||||
# INETFILE_OBJFILES
|
||||
# EXCEPTIONHANDLER_OBJFILES
|
||||
LIB_OBJFILES = \
|
||||
$(ANIM_OBJFILES) \
|
||||
$(ASTEROID_OBJFILES) \
|
||||
$(BMPMAN_OBJFILES) \
|
||||
$(CFILE_OBJFILES) \
|
||||
$(CMDLINE_OBJFILES) \
|
||||
$(CMEASURE_OBJFILES) \
|
||||
$(CONTROLCONFIG_OBJFILES) \
|
||||
$(CUTSCENE_OBJFILES) \
|
||||
$(DEBRIS_OBJFILES) \
|
||||
$(DEBUGCONSOLE_OBJFILES) \
|
||||
$(FIREBALL_OBJFILES) \
|
||||
$(GAMEHELP_OBJFILES) \
|
||||
$(GAMESEQUENCE_OBJFILES) \
|
||||
$(GAMESND_OBJFILES) \
|
||||
$(GLIDE_OBJFILES) \
|
||||
$(GLOBALINCS_OBJFILES) \
|
||||
$(GRAPHICS_OBJFILES) \
|
||||
$(HUD_OBJFILES) \
|
||||
$(IO_OBJFILES) \
|
||||
$(JUMPNODE_OBJFILES) \
|
||||
$(LIGHTING_OBJFILES) \
|
||||
$(MATH_OBJFILES) \
|
||||
$(MENUUI_OBJFILES) \
|
||||
$(MISSION_OBJFILES) \
|
||||
$(MISSIONUI_OBJFILES) \
|
||||
$(MODEL_OBJFILES) \
|
||||
$(NETWORK_OBJFILES) \
|
||||
$(OBJECT_OBJFILES) \
|
||||
$(OBSERVER_OBJFILES) \
|
||||
$(OSAPI_OBJFILES) \
|
||||
$(PALMAN_OBJFILES) \
|
||||
$(PARSE_OBJFILES) \
|
||||
$(PARTICLE_OBJFILES) \
|
||||
$(PCXUTILS_OBJFILES) \
|
||||
$(PHYSICS_OBJFILES) \
|
||||
$(PLAYERMAN_OBJFILES) \
|
||||
$(POPUP_OBJFILES) \
|
||||
$(RADAR_OBJFILES) \
|
||||
$(RENDER_OBJFILES) \
|
||||
$(SHIP_OBJFILES) \
|
||||
$(STARFIELD_OBJFILES) \
|
||||
$(STATS_OBJFILES) \
|
||||
$(UI_OBJFILES) \
|
||||
$(VCODEC_OBJFILES) \
|
||||
$(WEAPON_OBJFILES) \
|
||||
$(NEBULA_OBJFILES) \
|
||||
$(LOCALIZATION_OBJFILES) \
|
||||
$(TGAUTILS_OBJFILES) \
|
||||
$(DEMO_OBJFILES) \
|
||||
$(SOUND_OBJS) \
|
||||
$(JOYSTICK_OBJS) \
|
||||
$(NETWORK_OBJS)
|
||||
|
||||
FREESPACE2_OBJFILES = \
|
||||
freespace2/freespace.o \
|
||||
freespace2/levelpaging.o
|
||||
|
||||
STUB_OBJFILES = \
|
||||
windows_stub/stubs.o
|
||||
|
||||
# ==============================
|
||||
.PHONY: all clean code \
|
||||
ANIM_OBJFILES \
|
||||
ASTEROID_OBJFILES \
|
||||
BMPMAN_OBJFILES \
|
||||
CMDLINE_OBJFILES \
|
||||
CMEASURE_OBJFILES \
|
||||
CONTROLCONFIG_OBJFILES \
|
||||
CUTSCENE_OBJFILES \
|
||||
DEBRIS_OBJFILES \
|
||||
DEBUGCONSOLE_OBJFILES \
|
||||
FIREBALL_OBJFILES \
|
||||
GAMEHELP_OBJFILES \
|
||||
GAMESEQUENCE_OBJFILES \
|
||||
GAMESND_OBJFILES \
|
||||
GLIDE_OBJFILES \
|
||||
GLOBALINCS_OBJFILES \
|
||||
GRAPHICS_OBJFILES \
|
||||
HUD_OBJFILES \
|
||||
IO_OBJFILES \
|
||||
JUMPNODE_OBJFILES \
|
||||
LIGHTING_OBJFILES \
|
||||
MATH_OBJFILES \
|
||||
MENUUI_OBJFILES \
|
||||
MISSION_OBJFILES \
|
||||
MISSIONUI_OBJFILES \
|
||||
MODEL_OBJFILES \
|
||||
OBJECT_OBJFILES \
|
||||
OBSERVER_OBJFILES \
|
||||
OSAPI_OBJFILES \
|
||||
PALMAN_OBJFILES \
|
||||
PARSE_OBJFILES \
|
||||
PARTICLE_OBJFILES \
|
||||
PCXUTILS_OBJFILES \
|
||||
PHYSICS_OBJFILES \
|
||||
PLAYERMAN_OBJFILES \
|
||||
POPUP_OBJFILES \
|
||||
RADAR_OBJFILES \
|
||||
RENDER_OBJFILES \
|
||||
SHIP_OBJFILES \
|
||||
SOUND_OBJFILES \
|
||||
STARFIELD_OBJFILES \
|
||||
STATS_OBJFILES \
|
||||
UI_OBJFILES \
|
||||
VCODEC_OBJFILES \
|
||||
WEAPON_OBJFILES \
|
||||
NEBULA_OBJFILES \
|
||||
LOCALIZATION_OBJFILES \
|
||||
TGAUTILS_OBJFILES \
|
||||
DEMO_OBJFILES \
|
||||
INETFILE_OBJFILES \
|
||||
EXCEPTIONHANDLER_OBJFILES \
|
||||
NETWORK_OBJFILES
|
||||
|
||||
.cpp.o:
|
||||
$(CXX) $(CXXFLAGS) -c -o $@ $<
|
||||
|
||||
|
||||
all: $(TARGET)
|
||||
|
||||
clean:
|
||||
rm -f $(TARGET) libcode.a core *.o *~
|
||||
find -name *.o -exec rm {} \;
|
||||
find -name *~ -exec rm {} \;
|
||||
|
||||
code: libcode.a
|
||||
|
||||
|
||||
# ==============================
|
||||
libcode.a: $(LIB_OBJFILES)
|
||||
$(AR) -r $@ $(LIB_OBJFILES)
|
||||
# $(CXX) -o $@ $(LIB_OBJFILES)
|
||||
|
||||
fs2: libcode.a $(FREESPACE2_OBJFILES) $(STUB_OBJFILES)
|
||||
$(CXX) $(LDFLAGS) -o $@ $(FREESPACE2_OBJFILES) $(STUB_OBJFILES) $(LDLIBS) -L. -lcode
|
||||
|
||||
|
||||
# exceptions to the rule...
|
||||
freespace2/freespace.o: freespace2/freespace.cpp
|
||||
$(CXX) $(CXXFLAGS) -fexceptions -c -o $@ $<
|
||||
|
||||
ANIM_OBJFILES: $(ANIM_OBJFILES)
|
||||
ASTEROID_OBJFILES: $(ASTEROID_OBJFILES)
|
||||
BMPMAN_OBJFILES: $(BMPMAN_OBJFILES)
|
||||
CMDLINE_OBJFILES: $(CMDLINE_OBJFILES)
|
||||
CMEASURE_OBJFILES: $(CMEASURE_OBJFILES)
|
||||
CONTROLCONFIG_OBJFILES: $(CONTROLCONFIG_OBJFILES)
|
||||
CUTSCENE_OBJFILES: $(CUTSCENE_OBJFILES)
|
||||
DEBRIS_OBJFILES: $(DEBRIS_OBJFILES)
|
||||
DEBUGCONSOLE_OBJFILES: $(DEBUGCONSOLE_OBJFILES)
|
||||
FIREBALL_OBJFILES: $(FIREBALL_OBJFILES)
|
||||
GAMEHELP_OBJFILES: $(GAMEHELP_OBJFILES)
|
||||
GAMESEQUENCE_OBJFILES: $(GAMESEQUENCE_OBJFILES)
|
||||
GAMESND_OBJFILES: $(GAMESND_OBJFILES)
|
||||
GLIDE_OBJFILES: $(GLIDE_OBJFILES)
|
||||
GLOBALINCS_OBJFILES: $(GLOBALINCS_OBJFILES)
|
||||
GRAPHICS_OBJFILES: $(GRAPHICS_OBJFILES)
|
||||
HUD_OBJFILES: $(HUD_OBJFILES)
|
||||
IO_OBJFILES: $(IO_OBJFILES)
|
||||
JUMPNODE_OBJFILES: $(JUMPNODE_OBJFILES)
|
||||
LIGHTING_OBJFILES: $(LIGHTING_OBJFILES)
|
||||
MATH_OBJFILES: $(MATH_OBJFILES)
|
||||
MENUUI_OBJFILES: $(MENUUI_OBJFILES)
|
||||
MISSION_OBJFILES: $(MISSION_OBJFILES)
|
||||
MISSIONUI_OBJFILES: $(MISSIONUI_OBJFILES)
|
||||
MODEL_OBJFILES: $(MODEL_OBJFILES)
|
||||
OBJECT_OBJFILES: $(OBJECT_OBJFILES)
|
||||
OBSERVER_OBJFILES: $(OBSERVER_OBJFILES)
|
||||
OSAPI_OBJFILES: $(OSAPI_OBJFILES)
|
||||
PALMAN_OBJFILES: $(PALMAN_OBJFILES)
|
||||
PARSE_OBJFILES: $(PARSE_OBJFILES)
|
||||
PARTICLE_OBJFILES: $(PARTICLE_OBJFILES)
|
||||
PCXUTILS_OBJFILES: $(PCXUTILS_OBJFILES)
|
||||
PHYSICS_OBJFILES: $(PHYSICS_OBJFILES)
|
||||
PLAYERMAN_OBJFILES: $(PLAYERMAN_OBJFILES)
|
||||
POPUP_OBJFILES: $(POPUP_OBJFILES)
|
||||
RADAR_OBJFILES: $(RADAR_OBJFILES)
|
||||
RENDER_OBJFILES: $(RENDER_OBJFILES)
|
||||
SHIP_OBJFILES: $(SHIP_OBJFILES)
|
||||
SOUND_OBJFILES: $(SOUND_OBJFILES)
|
||||
STARFIELD_OBJFILES: $(STARFIELD_OBJFILES)
|
||||
STATS_OBJFILES: $(STATS_OBJFILES)
|
||||
UI_OBJFILES: $(UI_OBJFILES)
|
||||
VCODEC_OBJFILES: $(VCODEC_OBJFILES)
|
||||
WEAPON_OBJFILES: $(WEAPON_OBJFILES)
|
||||
NEBULA_OBJFILES: $(NEBULA_OBJFILES)
|
||||
LOCALIZATION_OBJFILES: $(LOCALIZATION_OBJFILES)
|
||||
TGAUTILS_OBJFILES: $(TGAUTILS_OBJFILES)
|
||||
DEMO_OBJFILES: $(DEMO_OBJFILES)
|
||||
INETFILE_OBJFILES: $(INETFILE_OBJFILES)
|
||||
EXCEPTIONHANDLER_OBJFILES: $(EXCEPTIONHANDLER_OBJFILES)
|
||||
NETWORK_OBJFILES: $(NETWORK_OBJFILES)
|
||||
@@ -0,0 +1,305 @@
|
||||
# code/Makefile.am for fs2_open
|
||||
#
|
||||
# $Id: Makefile.am,v 1.2 2003-03-11 19:00:05 penguin Exp $
|
||||
|
||||
noinst_PROGRAMS = fs2
|
||||
|
||||
fs2_SOURCES = \
|
||||
anim/animplay.cpp \
|
||||
anim/packunpack.cpp \
|
||||
asteroid/asteroid.cpp \
|
||||
bmpman/bmpman.cpp \
|
||||
cfile/cfile.cpp \
|
||||
cfile/cfilearchive.cpp \
|
||||
cfile/cfilelist.cpp \
|
||||
cfile/cfilesystem.cpp \
|
||||
cmdline/cmdline.cpp \
|
||||
cmeasure/cmeasure.cpp \
|
||||
controlconfig/controlsconfig.cpp \
|
||||
controlconfig/controlsconfigcommon.cpp \
|
||||
cutscene/cutscenes.cpp \
|
||||
debris/debris.cpp \
|
||||
debugconsole/console.cpp \
|
||||
decals/decals.cpp \
|
||||
demo/demo.cpp \
|
||||
exceptionhandler/exceptionhandler.cpp \
|
||||
fireball/fireballs.cpp \
|
||||
fireball/warpineffect.cpp \
|
||||
freespace2/freespace.cpp \
|
||||
freespace2/levelpaging.cpp \
|
||||
gamehelp/contexthelp.cpp \
|
||||
gamehelp/gameplayhelp.cpp \
|
||||
gamesequence/gamesequence.cpp \
|
||||
globalincs/alphacolors.cpp \
|
||||
globalincs/crypt.cpp \
|
||||
globalincs/systemvars.cpp \
|
||||
globalincs/version.cpp \
|
||||
graphics/2d.cpp \
|
||||
graphics/aaline.cpp \
|
||||
graphics/bitblt.cpp \
|
||||
graphics/circle.cpp \
|
||||
graphics/colors.cpp \
|
||||
graphics/font.cpp \
|
||||
graphics/gradient.cpp \
|
||||
graphics/gropengl.cpp \
|
||||
graphics/grzbuffer.cpp \
|
||||
graphics/line.cpp \
|
||||
graphics/pixel.cpp \
|
||||
graphics/rect.cpp \
|
||||
graphics/scaler.cpp \
|
||||
graphics/shade.cpp \
|
||||
hud/hud.cpp \
|
||||
hud/hudartillery.cpp \
|
||||
hud/hudbrackets.cpp \
|
||||
hud/hudconfig.cpp \
|
||||
hud/hudescort.cpp \
|
||||
hud/hudets.cpp \
|
||||
hud/hudlock.cpp \
|
||||
hud/hudmessage.cpp \
|
||||
hud/hudreticle.cpp \
|
||||
hud/hudshield.cpp \
|
||||
hud/hudsquadmsg.cpp \
|
||||
hud/hudtarget.cpp \
|
||||
hud/hudtargetbox.cpp \
|
||||
hud/hudwingmanstatus.cpp \
|
||||
io/key.cpp \
|
||||
io/keycontrol.cpp \
|
||||
io/mouse.cpp \
|
||||
io/timer.cpp \
|
||||
jumpnode/jumpnode.cpp \
|
||||
lighting/lighting.cpp \
|
||||
localization/fhash.cpp \
|
||||
localization/localize.cpp \
|
||||
math/fix.cpp \
|
||||
math/floating.cpp \
|
||||
math/fvi.cpp \
|
||||
math/spline.cpp \
|
||||
math/staticrand.cpp \
|
||||
math/vecmat.cpp \
|
||||
menuui/barracks.cpp \
|
||||
menuui/credits.cpp \
|
||||
menuui/fishtank.cpp \
|
||||
menuui/mainhallmenu.cpp \
|
||||
menuui/mainhalltemp.cpp \
|
||||
menuui/optionsmenu.cpp \
|
||||
menuui/playermenu.cpp \
|
||||
menuui/readyroom.cpp \
|
||||
menuui/snazzyui.cpp \
|
||||
menuui/techmenu.cpp \
|
||||
menuui/trainingmenu.cpp \
|
||||
mission/missionbriefcommon.cpp \
|
||||
mission/missioncampaign.cpp \
|
||||
mission/missiongoals.cpp \
|
||||
mission/missiongrid.cpp \
|
||||
mission/missionhotkey.cpp \
|
||||
mission/missionload.cpp \
|
||||
mission/missionlog.cpp \
|
||||
mission/missionmessage.cpp \
|
||||
mission/missionparse.cpp \
|
||||
mission/missiontraining.cpp \
|
||||
missionui/missionbrief.cpp \
|
||||
missionui/missioncmdbrief.cpp \
|
||||
missionui/missiondebrief.cpp \
|
||||
missionui/missionloopbrief.cpp \
|
||||
missionui/missionpause.cpp \
|
||||
missionui/missionrecommend.cpp \
|
||||
missionui/missionscreencommon.cpp \
|
||||
missionui/missionshipchoice.cpp \
|
||||
missionui/missionstats.cpp \
|
||||
missionui/missionweaponchoice.cpp \
|
||||
missionui/redalert.cpp \
|
||||
model/modelcollide.cpp \
|
||||
model/modelinterp.cpp \
|
||||
model/modeloctant.cpp \
|
||||
model/modelread.cpp \
|
||||
nebula/neb.cpp \
|
||||
nebula/neblightning.cpp \
|
||||
object/collidedebrisship.cpp \
|
||||
object/collidedebrisweapon.cpp \
|
||||
object/collideshipship.cpp \
|
||||
object/collideshipweapon.cpp \
|
||||
object/collideweaponweapon.cpp \
|
||||
object/objcollide.cpp \
|
||||
object/object.cpp \
|
||||
object/objectsort.cpp \
|
||||
observer/observer.cpp \
|
||||
palman/palman.cpp \
|
||||
parse/encrypt.cpp \
|
||||
parse/parselo.cpp \
|
||||
parse/sexp.cpp \
|
||||
particle/particle.cpp \
|
||||
pcxutils/pcxutils.cpp \
|
||||
physics/physics.cpp \
|
||||
playerman/managepilot.cpp \
|
||||
playerman/playercontrol.cpp \
|
||||
popup/popup.cpp \
|
||||
popup/popupdead.cpp \
|
||||
radar/radar.cpp \
|
||||
render/3dclipper.cpp \
|
||||
render/3ddraw.cpp \
|
||||
render/3dlaser.cpp \
|
||||
render/3dmath.cpp \
|
||||
render/3dsetup.cpp \
|
||||
ship/afterburner.cpp \
|
||||
ship/ai.cpp \
|
||||
ship/aibig.cpp \
|
||||
ship/aicode.cpp \
|
||||
ship/aigoals.cpp \
|
||||
ship/awacs.cpp \
|
||||
ship/shield.cpp \
|
||||
ship/ship.cpp \
|
||||
ship/shipcontrails.cpp \
|
||||
ship/shipfx.cpp \
|
||||
ship/shiphit.cpp \
|
||||
starfield/nebula.cpp \
|
||||
starfield/starfield.cpp \
|
||||
starfield/supernova.cpp \
|
||||
stats/medals.cpp \
|
||||
stats/scoring.cpp \
|
||||
stats/stats.cpp \
|
||||
tgautils/tgautils.cpp \
|
||||
ui/button.cpp \
|
||||
ui/checkbox.cpp \
|
||||
ui/gadget.cpp \
|
||||
ui/icon.cpp \
|
||||
ui/inputbox.cpp \
|
||||
ui/keytrap.cpp \
|
||||
ui/listbox.cpp \
|
||||
ui/radio.cpp \
|
||||
ui/scroll.cpp \
|
||||
ui/slider.cpp \
|
||||
ui/slider2.cpp \
|
||||
ui/uidraw.cpp \
|
||||
ui/uimouse.cpp \
|
||||
ui/window.cpp \
|
||||
weapon/beam.cpp \
|
||||
weapon/corkscrew.cpp \
|
||||
weapon/emp.cpp \
|
||||
weapon/flak.cpp \
|
||||
weapon/muzzleflash.cpp \
|
||||
weapon/shockwave.cpp \
|
||||
weapon/swarm.cpp \
|
||||
weapon/trails.cpp \
|
||||
weapon/weapons.cpp
|
||||
|
||||
|
||||
## conditional includes follow:
|
||||
|
||||
## joystic support sources
|
||||
if FS2_JOYSTICK
|
||||
fs2_SOURCES += \
|
||||
io/joy.cpp \
|
||||
io/joy_ff.cpp \
|
||||
io/swff_lib.cpp
|
||||
endif # FS2_JOYSTICK
|
||||
|
||||
## networking support sources
|
||||
if FS2_NETWORKING
|
||||
fs2_SOURCES += \
|
||||
hud/hudobserver.cpp \
|
||||
network/multi.cpp \
|
||||
network/multimsgs.cpp \
|
||||
network/multiteamselect.cpp \
|
||||
network/multiui.cpp \
|
||||
network/multiutil.cpp \
|
||||
network/multi_campaign.cpp \
|
||||
network/multi_data.cpp \
|
||||
network/multi_dogfight.cpp \
|
||||
network/multi_endgame.cpp \
|
||||
network/multi_ingame.cpp \
|
||||
network/multi_kick.cpp \
|
||||
network/multi_log.cpp \
|
||||
network/multi_obj.cpp \
|
||||
network/multi_observer.cpp \
|
||||
network/multi_options.cpp \
|
||||
network/multi_pause.cpp \
|
||||
network/multi_pinfo.cpp \
|
||||
network/multi_ping.cpp \
|
||||
network/multi_pmsg.cpp \
|
||||
network/multi_rate.cpp \
|
||||
network/multi_respawn.cpp \
|
||||
network/multi_team.cpp \
|
||||
network/multi_voice.cpp \
|
||||
network/multi_xfer.cpp \
|
||||
network/psnet.cpp \
|
||||
network/psnet2.cpp \
|
||||
menuui/optionsmenumulti.cpp \
|
||||
missionui/chatbox.cpp
|
||||
endif # FS2_NETWORKING
|
||||
|
||||
## sound support sources
|
||||
if FS2_SOUND
|
||||
fs2_SOURCES += \
|
||||
gamesnd/eventmusic.cpp \
|
||||
gamesnd/gamesnd.cpp \
|
||||
object/objectsnd.cpp \
|
||||
sound/acm.cpp \
|
||||
sound/audiostr.cpp \
|
||||
sound/ds.cpp \
|
||||
sound/ds3d.cpp \
|
||||
sound/dscap.cpp \
|
||||
sound/midifile.cpp \
|
||||
sound/rbaudio.cpp \
|
||||
sound/rtvoice.cpp \
|
||||
sound/sound.cpp \
|
||||
sound/winmidi.cpp \
|
||||
sound/winmidi_base.cpp \
|
||||
vcodec/codec1.cpp
|
||||
endif # FS2_SOUND
|
||||
|
||||
## software-rendering support sources
|
||||
if FS2_GRSOFT
|
||||
fs2_SOURCES += \
|
||||
graphics/grsoft.cpp \
|
||||
graphics/tmapper.cpp
|
||||
endif # FS2_GRSOFT
|
||||
|
||||
## Win32-specific sources
|
||||
if FS2_OS_WIN32
|
||||
fs2_SOURCES += \
|
||||
cutscene/movie.cpp \
|
||||
directx/dx8show.cpp \
|
||||
ddsutils/ddsutils.cpp \
|
||||
globalincs/windebug.cpp \
|
||||
glide/glide.cpp \
|
||||
graphics/grd3d.cpp \
|
||||
graphics/grd3drender.cpp \
|
||||
graphics/grd3dtexture.cpp \
|
||||
graphics/grdirectdraw.cpp \
|
||||
graphics/grglide.cpp \
|
||||
graphics/grglidetexture.cpp \
|
||||
network/stand_gui.cpp \
|
||||
osapi/osapi.cpp \
|
||||
osapi/osregistry.cpp \
|
||||
osapi/outwnd.cpp
|
||||
endif # FS2_OS_WIN32
|
||||
|
||||
## Unix-specific sources
|
||||
if FS2_OS_UNIX
|
||||
fs2_SOURCES += \
|
||||
io/xmouse.cpp \
|
||||
osapi/osapi_unix.cpp \
|
||||
osapi/osregistry_unix.cpp \
|
||||
osapi/outwnd_unix.cpp
|
||||
endif # FS2_OS_UNIX
|
||||
|
||||
|
||||
## compiler flags
|
||||
# INCLUDES = -I.
|
||||
AM_CXXFLAGS = -fno-exceptions @DX8_INCLUDE@
|
||||
AM_LDFLAGS = -L/c/dx8/lib @DX8_LIB@
|
||||
|
||||
LDADD =
|
||||
|
||||
if FS2_OS_WIN32
|
||||
## Win32 libraries needed
|
||||
LDADD += \
|
||||
-lgdi32 -lole32 -lwsock32 -lwinmm -lmsacm32 -lopengl32 \
|
||||
-lcomctl32 -lstrmiids -ldxguid -lddraw -ldinput
|
||||
endif
|
||||
|
||||
|
||||
if FS2_OS_UNIX
|
||||
## Unix libraries needed
|
||||
## -- TODO --
|
||||
endif
|
||||
File diff suppressed because it is too large.
Load diff
+286
-28
@@ -9,13 +9,42 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Bmpman/BmpMan.cpp $
|
||||
* $Revision: 2.2 $
|
||||
* $Date: 2002-08-01 01:41:04 $
|
||||
* $Author: penguin $
|
||||
* $Revision: 2.11 $
|
||||
* $Date: 2003-01-19 01:07:41 $
|
||||
* $Author: bobboau $
|
||||
*
|
||||
* Code to load and manage all bitmaps for the game
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.10 2003/01/18 19:55:16 phreak
|
||||
* fixed around the bmpman system to now accept compressed textures
|
||||
*
|
||||
* Revision 2.9 2003/01/09 22:23:38 inquisitor
|
||||
* Rollback to 2.7 to fix glow code issue that phreak noticed.
|
||||
* -Quiz
|
||||
*
|
||||
* Revision 2.7 2003/01/05 23:41:50 bobboau
|
||||
* disabled decals (for now), removed the warp ray thingys,
|
||||
* made some better error mesages while parseing weapons and ships tbls,
|
||||
* and... oh ya, added glow mapping
|
||||
*
|
||||
* Revision 2.6 2002/12/02 23:26:08 Goober5000
|
||||
* fixed misspelling
|
||||
*
|
||||
* Revision 2.5 2002/12/02 20:46:41 Goober5000
|
||||
* fixed misspelling of "category" as "catagory"
|
||||
*
|
||||
* Revision 2.4 2002/11/22 20:55:27 phreak
|
||||
* changed around some page-in functions to work with opengl
|
||||
* changed bm_set_components_opengl
|
||||
* -phreak
|
||||
*
|
||||
* Revision 2.3 2002/11/18 21:27:13 phreak
|
||||
* added bm_select_components functions for OpenGL -phreak
|
||||
*
|
||||
* Revision 2.2 2002/08/01 01:41:04 penguin
|
||||
* The big include file move
|
||||
*
|
||||
* Revision 2.1 2002/07/07 19:55:58 penguin
|
||||
* Back-port to MSVC
|
||||
*
|
||||
@@ -250,7 +279,7 @@
|
||||
* Added code to print the number of bitmap slots in use between levels.
|
||||
*
|
||||
* 82 2/16/98 3:54p John
|
||||
* Changed a bunch of mprintfs to catagorize to BmpInfo
|
||||
* Changed a bunch of mprintfs to categorize to BmpInfo
|
||||
*
|
||||
* 81 2/13/98 5:00p John
|
||||
* Made user bitmaps not get wrote to level cache file.
|
||||
@@ -491,11 +520,17 @@
|
||||
#include "graphics/grinternal.h"
|
||||
#include "tgautils/tgautils.h"
|
||||
#include "ship/ship.h"
|
||||
#include "ddsutils/ddsutils.h"
|
||||
|
||||
#ifndef NDEBUG
|
||||
#define BMPMAN_NDEBUG
|
||||
#endif
|
||||
|
||||
extern int Texture_compression_enabled;
|
||||
|
||||
int GLOWMAP = -1;
|
||||
|
||||
|
||||
// keep this defined to use per-ship nondarkening pixels
|
||||
#define BMPMAN_SPECIAL_NONDARK
|
||||
|
||||
@@ -506,6 +541,9 @@ int bm_inited = 0;
|
||||
#define BM_TYPE_USER 2
|
||||
#define BM_TYPE_ANI 3 // in-house ANI format
|
||||
#define BM_TYPE_TGA 4 // 16 bit targa
|
||||
#define BM_TYPE_DXT1 5 // 24 bit with switchable alpha (compressed)
|
||||
#define BM_TYPE_DXT3 6 // 32 bit with 4 bit alpha (compressed)
|
||||
#define BM_TYPE_DXT5 7 // 32 bit with 8 bit alpha (compressed)
|
||||
|
||||
typedef union bm_extra_info {
|
||||
struct {
|
||||
@@ -544,6 +582,7 @@ typedef struct bitmap_entry {
|
||||
// Data for animations and user bitmaps
|
||||
bm_extra_info info;
|
||||
|
||||
int mem_taken; //how much memory it takes up
|
||||
#ifdef BMPMAN_NDEBUG
|
||||
// bookeeping
|
||||
ubyte used_last_frame; // If set, then it was used last frame
|
||||
@@ -751,8 +790,6 @@ void bm_init()
|
||||
#endif
|
||||
bm_free_data(i); // clears flags, bbp, data, etc
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
#ifdef BMPMAN_NDEBUG
|
||||
@@ -899,16 +936,15 @@ int bm_load_sub(char *real_filename, char *ext, int *handle)
|
||||
}
|
||||
|
||||
// try and find the file
|
||||
/*
|
||||
CFILE *test = cfopen(filename, "rb");
|
||||
if(test != NULL){
|
||||
cfclose(test);
|
||||
return 0;
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
// could not be found
|
||||
return 0;
|
||||
return -1;
|
||||
}
|
||||
|
||||
// This loads a bitmap so we can draw with it later.
|
||||
@@ -922,8 +958,10 @@ int bm_load( char * real_filename )
|
||||
int w, h, bpp;
|
||||
char filename[MAX_FILENAME_LEN];
|
||||
int tga = 0;
|
||||
int dds = 0;
|
||||
int handle;
|
||||
int found = 0;
|
||||
unsigned char type;
|
||||
|
||||
if ( !bm_inited ) bm_init();
|
||||
|
||||
@@ -940,23 +978,51 @@ int bm_load( char * real_filename )
|
||||
//Int3();
|
||||
*p = 0;
|
||||
}
|
||||
|
||||
// try and find a compressed tex first
|
||||
// unless we're cant do so
|
||||
if (Texture_compression_enabled)
|
||||
{
|
||||
switch(bm_load_sub(filename, ".dds", &handle)){
|
||||
// error
|
||||
case -1:
|
||||
break;
|
||||
|
||||
// found as a file
|
||||
case 0:
|
||||
found = 1;
|
||||
dds=1;
|
||||
strcat(filename, ".dds");
|
||||
break;
|
||||
|
||||
// found as pre-existing
|
||||
case 1:
|
||||
found = 1;
|
||||
return handle;
|
||||
}
|
||||
}
|
||||
|
||||
// try and find the pcx file
|
||||
switch(bm_load_sub(filename, ".pcx", &handle)){
|
||||
// error
|
||||
case -1:
|
||||
break;
|
||||
if (!found)
|
||||
{
|
||||
|
||||
// found as a file
|
||||
case 0:
|
||||
found = 1;
|
||||
strcat(filename, ".pcx");
|
||||
break;
|
||||
// try and find the pcx file
|
||||
switch(bm_load_sub(filename, ".pcx", &handle)){
|
||||
// error
|
||||
case -1:
|
||||
break;
|
||||
|
||||
// found as a file
|
||||
case 0:
|
||||
found = 1;
|
||||
strcat(filename, ".pcx");
|
||||
break;
|
||||
|
||||
// found as pre-existing
|
||||
|
||||
// found as pre-existing
|
||||
case 1:
|
||||
found = 1;
|
||||
return handle;
|
||||
}
|
||||
}
|
||||
|
||||
if(!found){
|
||||
@@ -979,13 +1045,45 @@ int bm_load( char * real_filename )
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (dds)
|
||||
{
|
||||
int ct;
|
||||
int dds_error=dds_read_header ( filename, &w, &h, &bpp, &ct);
|
||||
if (dds_error != DDS_ERROR_NONE)
|
||||
{
|
||||
mprintf(("Couldn't open '%s -- error description %s\n", filename, dds_error_string(dds_error)));
|
||||
return -1;
|
||||
}
|
||||
mprintf(("Found a .dds file! %s\n", filename));
|
||||
switch (ct)
|
||||
{
|
||||
case DDS_DXT1:
|
||||
type=BM_TYPE_DXT1;
|
||||
break;
|
||||
|
||||
case DDS_DXT3:
|
||||
type=BM_TYPE_DXT3;
|
||||
break;
|
||||
|
||||
case DDS_DXT5:
|
||||
type=BM_TYPE_DXT5;
|
||||
break;
|
||||
|
||||
default:
|
||||
Error(LOCATION, "bad DDS file compression. Not using DXT1,3,5 %s", filename);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
// if its a tga file
|
||||
if(tga){
|
||||
else if(tga){
|
||||
int tga_error=targa_read_header( filename, &w, &h, &bpp, NULL );
|
||||
if ( tga_error != TARGA_ERROR_NONE ) {
|
||||
mprintf(( "Couldn't open '%s'\n", filename ));
|
||||
return -1;
|
||||
}
|
||||
type = BM_TYPE_TGA;
|
||||
}
|
||||
// if its a pcx file
|
||||
else {
|
||||
@@ -994,6 +1092,7 @@ int bm_load( char * real_filename )
|
||||
mprintf(( "Couldn't open '%s'\n", filename ));
|
||||
return -1;
|
||||
}
|
||||
type=BM_TYPE_PCX;
|
||||
}
|
||||
|
||||
// Error( LOCATION, "Unknown bitmap type %s\n", filename );
|
||||
@@ -1019,7 +1118,7 @@ int bm_load( char * real_filename )
|
||||
|
||||
// Mark the slot as filled, because cf_read might load a new bitmap
|
||||
// into this slot.
|
||||
bm_bitmaps[n].type = tga ? (ubyte)BM_TYPE_TGA : (ubyte)BM_TYPE_PCX;
|
||||
bm_bitmaps[n].type = type;
|
||||
bm_bitmaps[n].signature = Bm_next_signature++;
|
||||
Assert ( strlen(filename) < MAX_FILENAME_LEN );
|
||||
strncpy(bm_bitmaps[n].filename, filename, MAX_FILENAME_LEN-1 );
|
||||
@@ -1670,6 +1769,35 @@ void bm_lock_tga( int handle, int bitmapnum, bitmap_entry *be, bitmap *bmp, ubyt
|
||||
bm_convert_format( bitmapnum, bmp, bpp, flags );
|
||||
}
|
||||
|
||||
//lock a dds file
|
||||
void bm_lock_dds( int handle, int bitmapnum, bitmap_entry *be, bitmap *bmp, ubyte bpp, ubyte flags )
|
||||
{
|
||||
uint data;
|
||||
int size;
|
||||
int error;
|
||||
|
||||
Assert(Texture_compression_enabled);
|
||||
Assert(&be->bm == bmp);
|
||||
#ifdef BMPMAN_NDEBUG
|
||||
Assert( be->data_size > 0 );
|
||||
#endif
|
||||
|
||||
//data is malloc'ed in the function
|
||||
error=dds_read_bitmap( be->filename, &size, &data );
|
||||
if (error != DDS_ERROR_NONE)
|
||||
{
|
||||
Error(LOCATION, "error loading %s -- %s", be->filename, dds_error_string(error));
|
||||
}
|
||||
|
||||
bmp->bpp=bpp;
|
||||
bmp->data=data;
|
||||
bmp->flags =0;
|
||||
be->mem_taken=size;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
MONITOR( NumBitmapPage );
|
||||
MONITOR( SizeBitmapPage );
|
||||
|
||||
@@ -1703,9 +1831,19 @@ bitmap * bm_lock( int handle, ubyte bpp, ubyte flags )
|
||||
} else {
|
||||
if(flags & BMP_AABITMAP){
|
||||
Assert( bpp == 8 );
|
||||
} else {
|
||||
} else if ((flags & BMP_TEX_NONCOMP) && (!(flags & BMP_TEX_COMP))) {
|
||||
Assert( bpp == 16 );
|
||||
}
|
||||
else if (flags & BMP_TEX_DXT1){
|
||||
Assert(bpp==24);
|
||||
}
|
||||
else if (flags & (BMP_TEX_DXT3 | BMP_TEX_DXT5)){
|
||||
Assert(bpp==32);
|
||||
}
|
||||
else
|
||||
{
|
||||
Assert(0); //?
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1788,6 +1926,12 @@ bitmap * bm_lock( int handle, ubyte bpp, ubyte flags )
|
||||
bm_lock_tga( handle, bitmapnum, be, bmp, bpp, flags );
|
||||
break;
|
||||
|
||||
case BM_TYPE_DXT1:
|
||||
case BM_TYPE_DXT3:
|
||||
case BM_TYPE_DXT5:
|
||||
bm_lock_dds( handle, bitmapnum, be, bmp, bpp, flags );
|
||||
break;
|
||||
|
||||
default:
|
||||
Warning(LOCATION, "Unsupported type in bm_lock -- %d\n", be->type );
|
||||
return NULL;
|
||||
@@ -2050,6 +2194,8 @@ DCF(bmpman,"Shows/changes bitmap caching parameters and usage")
|
||||
}
|
||||
}
|
||||
|
||||
extern int OGL_inited;
|
||||
|
||||
// Marks a texture as being used for this level
|
||||
void bm_page_in_texture( int bitmapnum, int nframes )
|
||||
{
|
||||
@@ -2059,7 +2205,27 @@ void bm_page_in_texture( int bitmapnum, int nframes )
|
||||
|
||||
bm_bitmaps[n+i].preloaded = 1;
|
||||
|
||||
if ( D3D_enabled ) {
|
||||
//check if its compressed
|
||||
if (OGL_inited)
|
||||
{
|
||||
switch (bm_bitmaps[n+i].type)
|
||||
{
|
||||
case BM_TYPE_DXT1:
|
||||
bm_bitmaps[n+i].used_flags = BMP_TEX_DXT1;
|
||||
continue;
|
||||
|
||||
case BM_TYPE_DXT3:
|
||||
bm_bitmaps[n+i].used_flags = BMP_TEX_DXT3;
|
||||
continue;
|
||||
|
||||
case BM_TYPE_DXT5:
|
||||
bm_bitmaps[n+i].used_flags = BMP_TEX_DXT5;
|
||||
continue;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
if ( D3D_enabled || OGL_inited ) {
|
||||
bm_bitmaps[n+i].used_flags = BMP_TEX_OTHER;
|
||||
} else {
|
||||
bm_bitmaps[n+i].used_flags = 0;
|
||||
@@ -2077,7 +2243,7 @@ void bm_page_in_nondarkening_texture( int bitmapnum, int nframes )
|
||||
|
||||
bm_bitmaps[n+i].preloaded = 4;
|
||||
|
||||
if ( D3D_enabled ) {
|
||||
if ( D3D_enabled || OGL_inited ) {
|
||||
bm_bitmaps[n+i].used_flags = BMP_TEX_NONDARK;
|
||||
} else {
|
||||
bm_bitmaps[n+i].used_flags = 0;
|
||||
@@ -2096,7 +2262,26 @@ void bm_page_in_xparent_texture( int bitmapnum, int nframes)
|
||||
|
||||
bm_bitmaps[n+i].preloaded = 3;
|
||||
|
||||
if ( D3D_enabled ) {
|
||||
//check if its compressed
|
||||
if (OGL_inited)
|
||||
{
|
||||
switch (bm_bitmaps[n+i].type)
|
||||
{
|
||||
case BM_TYPE_DXT1:
|
||||
bm_bitmaps[n+i].used_flags = BMP_TEX_DXT1;
|
||||
continue;
|
||||
|
||||
case BM_TYPE_DXT3:
|
||||
bm_bitmaps[n+i].used_flags = BMP_TEX_DXT3;
|
||||
continue;
|
||||
|
||||
case BM_TYPE_DXT5:
|
||||
bm_bitmaps[n+i].used_flags = BMP_TEX_DXT5;
|
||||
continue;
|
||||
}
|
||||
|
||||
}
|
||||
if ( D3D_enabled || OGL_inited ) {
|
||||
// bm_bitmaps[n+i].used_flags = BMP_NO_PALETTE_MAP;
|
||||
bm_bitmaps[n+i].used_flags = BMP_TEX_XPARENT;
|
||||
} else {
|
||||
@@ -2115,7 +2300,7 @@ void bm_page_in_aabitmap( int bitmapnum, int nframes )
|
||||
|
||||
bm_bitmaps[n+i].preloaded = 2;
|
||||
|
||||
if ( D3D_enabled ) {
|
||||
if ( D3D_enabled || OGL_inited ) {
|
||||
bm_bitmaps[n+i].used_flags = BMP_AABITMAP;
|
||||
} else {
|
||||
bm_bitmaps[n+i].used_flags = 0;
|
||||
@@ -2238,7 +2423,10 @@ int bm_get_cache_slot( int bitmap_id, int separate_ani_frames )
|
||||
{
|
||||
int n = bitmap_id % MAX_BITMAPS;
|
||||
|
||||
Assert( bm_bitmaps[n].handle == bitmap_id ); // INVALID BITMAP HANDLE
|
||||
if( bm_bitmaps[n].handle != bitmap_id ){//this should rightfully squash the invalid bitmap handel bug for the glow mapping
|
||||
mprintf(("bitmap handel %d is not equil to bitmap id %d",bm_bitmaps[n].handle,bitmap_id));
|
||||
return -1; // INVALID BITMAP HANDLE
|
||||
}
|
||||
|
||||
bitmap_entry *be = &bm_bitmaps[n];
|
||||
|
||||
@@ -2334,6 +2522,22 @@ void bm_set_components_argb_d3d_32_tex(ubyte *pixel, ubyte *rv, ubyte *gv, ubyte
|
||||
}
|
||||
}
|
||||
|
||||
void bm_set_components_opengl(ubyte *pixel, ubyte *rv, ubyte *gv, ubyte *bv, ubyte *av)
|
||||
{
|
||||
// rgba
|
||||
*((ushort*)pixel) |= (ushort)(( (int)*rv / Gr_current_red->scale ) << Gr_current_red->shift);
|
||||
*((ushort*)pixel) |= (ushort)(( (int)*gv / Gr_current_green->scale ) << Gr_current_green->shift);
|
||||
*((ushort*)pixel) |= (ushort)(( (int)*bv / Gr_current_blue->scale ) << Gr_current_blue->shift);
|
||||
*((ushort*)pixel) &= ~(0x8000);
|
||||
if (*((ushort*)pixel) == (ushort)Gr_current_green->mask) {
|
||||
*((ushort*)pixel) = 0;
|
||||
} else {
|
||||
if(*av){
|
||||
*((ushort*)pixel) |= 0x8000;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// for selecting pixel formats
|
||||
void BM_SELECT_SCREEN_FORMAT()
|
||||
{
|
||||
@@ -2361,6 +2565,13 @@ void BM_SELECT_SCREEN_FORMAT()
|
||||
#endif // ifndef NO_DIRECT3D
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef USE_OPENGL
|
||||
else if (gr_screen.mode == GR_OPENGL)
|
||||
{
|
||||
bm_set_components = bm_set_components_opengl;
|
||||
}
|
||||
#endif
|
||||
#else
|
||||
bm_set_components = bm_set_components_argb_d3d_16_screen;
|
||||
#endif // ifdef WIN32
|
||||
@@ -2392,6 +2603,12 @@ void BM_SELECT_TEX_FORMAT()
|
||||
#endif
|
||||
}
|
||||
}
|
||||
#ifdef USE_OPENGL
|
||||
else if (gr_screen.mode == GR_OPENGL)
|
||||
{
|
||||
bm_set_components = bm_set_components_opengl;
|
||||
}
|
||||
#endif
|
||||
#else
|
||||
bm_set_components = bm_set_components_argb_d3d_16_tex;
|
||||
#endif // ifdef WIN32
|
||||
@@ -2423,6 +2640,12 @@ void BM_SELECT_ALPHA_TEX_FORMAT()
|
||||
#endif
|
||||
}
|
||||
}
|
||||
#ifdef USE_OPENGL
|
||||
else if (gr_screen.mode == GR_OPENGL)
|
||||
{
|
||||
bm_set_components = bm_set_components_opengl;
|
||||
}
|
||||
#endif
|
||||
#else
|
||||
bm_set_components = bm_set_components_argb_d3d_16_tex;
|
||||
#endif // ifdef WIN32
|
||||
@@ -2611,3 +2834,38 @@ void bm_get_section_size(int bitmapnum, int sx, int sy, int *w, int *h)
|
||||
*w = sx < (sections->num_x - 1) ? MAX_BMAP_SECTION_SIZE : bw - sections->sx[sx];
|
||||
*h = sy < (sections->num_y - 1) ? MAX_BMAP_SECTION_SIZE : bh - sections->sy[sy];
|
||||
}
|
||||
|
||||
int bm_is_compressed(int num)
|
||||
{
|
||||
int n=num % MAX_BITMAPS;
|
||||
|
||||
//duh
|
||||
if (!Texture_compression_enabled)
|
||||
return 0;
|
||||
|
||||
Assert(num==bm_bitmaps[n].handle);
|
||||
|
||||
switch (bm_bitmaps[n].type)
|
||||
{
|
||||
case BM_TYPE_DXT1:
|
||||
return 1;
|
||||
case BM_TYPE_DXT3:
|
||||
return 2;
|
||||
case BM_TYPE_DXT5:
|
||||
return 3;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
//needed only for compressed bitmaps
|
||||
int bm_get_size(int num)
|
||||
{
|
||||
int n=num % MAX_BITMAPS;
|
||||
|
||||
if (!bm_is_compressed(num))
|
||||
return 0;
|
||||
|
||||
Assert(num==bm_bitmaps[n].handle);
|
||||
|
||||
return bm_bitmaps[n].mem_taken;
|
||||
}
|
||||
@@ -9,13 +9,24 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Bmpman/BmpMan.h $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:21 $
|
||||
* $Author: penguin $
|
||||
* $Revision: 2.3 $
|
||||
* $Date: 2003-01-19 01:07:41 $
|
||||
* $Author: bobboau $
|
||||
*
|
||||
* Prototypes for Bitmap Manager functions
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.2 2003/01/18 19:55:16 phreak
|
||||
* fixed around the bmpman system to now accept compressed textures
|
||||
*
|
||||
* Revision 2.1 2003/01/05 23:41:50 bobboau
|
||||
* disabled decals (for now), removed the warp ray thingys,
|
||||
* made some better error mesages while parseing weapons and ships tbls,
|
||||
* and... oh ya, added glow mapping
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:21 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
* Revision 1.1 2002/05/02 18:03:04 mharris
|
||||
* Initial checkin - converted filenames and includes to lower case
|
||||
*
|
||||
@@ -351,4 +362,9 @@ void bm_get_components(ubyte *pixel, ubyte *r, ubyte *g, ubyte *b, ubyte *a);
|
||||
// given a bitmap and a section, return the size (w, h)
|
||||
void bm_get_section_size(int bitmapnum, int sx, int sy, int *w, int *h);
|
||||
|
||||
extern int GLOWMAP; //this holds a reference to a map that is a fully lit version of it's index -Bobboau
|
||||
|
||||
int bm_is_compressed(int num);
|
||||
int bm_get_size(int num);
|
||||
|
||||
#endif
|
||||
@@ -9,11 +9,30 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Cmdline/cmdline.cpp $
|
||||
* $Revision: 2.11 $
|
||||
* $Date: 2002-11-10 16:32:42 $
|
||||
* $Author: DTP $
|
||||
* $Revision: 2.17 $
|
||||
* $Date: 2003-02-22 04:13:17 $
|
||||
* $Author: wmcoolmon $
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.16 2002/12/21 13:39:25 DTP
|
||||
* did bit more house keeping. modfied Phreaks fps cmdline a bit, so that we dont have to specific build code.libs for fred, but can use the same code.lib for both fs2_open.exe and fred2_open.exe
|
||||
*
|
||||
* Revision 2.15 2002/12/17 03:08:18 DTP
|
||||
* fix to Show_framerate. seems it will call an unresolved external error during fred builds. modified my ifndefs a bit, dsw modified to include preprocessor tag FRED.
|
||||
*
|
||||
* Revision 2.14 2002/12/17 02:22:34 DTP
|
||||
* wrong name :)
|
||||
*
|
||||
* Revision 2.13 2002/12/17 02:21:06 DTP
|
||||
* cleaned up after phreak :). it will make a mess in debug builds. added a couple of ifndef _debugs.
|
||||
*
|
||||
* Revision 2.12 2002/12/14 17:09:08 phreak
|
||||
* added a command line that displays frames per second when enabled.
|
||||
* use "-fps"
|
||||
*
|
||||
* Revision 2.11 2002/11/10 16:32:42 DTP
|
||||
* -DTP reworked mod support,
|
||||
*
|
||||
* Revision 2.10 2002/11/10 16:30:53 DTP
|
||||
* -DTP reworked mod support,
|
||||
*
|
||||
@@ -278,7 +297,9 @@ cmdline_parm almission_arg("-almission", NULL); //DTP for autoload Multi mission
|
||||
cmdline_parm gf4fix_arg("-GF4FIX", NULL); //DTP for random tigers GF4fix
|
||||
cmdline_parm allslev_arg("-ALLSLEV", NULL); //Give access to all single player missions
|
||||
cmdline_parm phreak_arg("-phreak", NULL); // Change to phreaks options including new targetting code
|
||||
cmdline_parm dshowvid_arg("-dshowvid", NULL); // Allows video streaming
|
||||
cmdline_parm mod_arg("-mod", NULL); //DTP modsupport
|
||||
cmdline_parm fps_arg("-fps", NULL);
|
||||
|
||||
int Cmdline_multi_stream_chat_to_file = 0;
|
||||
int Cmdline_freespace_no_sound = 0;
|
||||
@@ -310,6 +331,8 @@ int Cmdline_window = 0;
|
||||
int Cmdline_gf4fix = 0; // DTP for randomstigers GF4 fix.
|
||||
int Cmdline_allslev = 0;
|
||||
int Cmdline_phreak = 0;
|
||||
int Cmdline_dshowvid = 0;
|
||||
int Cmdline_show_fps = 0;
|
||||
|
||||
|
||||
|
||||
@@ -688,9 +711,20 @@ int parse_cmdline(int argc, char *argv[])
|
||||
Cmdline_phreak = 1;
|
||||
}
|
||||
|
||||
if(dshowvid_arg.found() ) {
|
||||
Cmdline_dshowvid = 1;
|
||||
}
|
||||
|
||||
if(mod_arg.found() ) {
|
||||
Cmdline_mod = mod_arg.str();
|
||||
}
|
||||
|
||||
|
||||
if (fps_arg.found())
|
||||
{
|
||||
Cmdline_show_fps = 1;
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -10,11 +10,26 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Cmdline/cmdline.h $
|
||||
* $Revision: 2.12 $
|
||||
* $Date: 2002-11-10 16:30:53 $
|
||||
* $Author: DTP $
|
||||
* $Revision: 2.17 $
|
||||
* $Date: 2003-02-22 04:13:17 $
|
||||
* $Author: wmcoolmon $
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.16 2002/12/21 13:39:25 DTP
|
||||
* did bit more house keeping. modfied Phreaks fps cmdline a bit, so that we dont have to specific build code.libs for fred, but can use the same code.lib for both fs2_open.exe and fred2_open.exe
|
||||
*
|
||||
* Revision 2.15 2002/12/17 03:08:18 DTP
|
||||
* fix to Show_framerate. seems it will call an unresolved external error during fred builds. modified my ifndefs a bit, dsw modified to include preprocessor tag FRED.
|
||||
*
|
||||
* Revision 2.14 2002/12/17 02:22:34 DTP
|
||||
* wrong name :)
|
||||
*
|
||||
* Revision 2.13 2002/12/17 02:21:06 DTP
|
||||
* cleaned up after phreak :). it will make a mess in debug builds. added a couple of ifndef _debugs.
|
||||
*
|
||||
* Revision 2.12 2002/11/10 16:30:53 DTP
|
||||
* -DTP reworked mod support,
|
||||
*
|
||||
* Revision 2.11 2002/10/31 21:14:16 DTP
|
||||
* DTP Quickly added something needed to cmdline.h, since otherwise we can not compile the code as it misses some externals. Thought a rollback rolled all back.
|
||||
*
|
||||
@@ -225,6 +240,10 @@ extern char *Cmdline_almission; //DTP for autoload mission
|
||||
extern int Cmdline_gf4fix; //DTP for Random tigers GF4fix.
|
||||
extern int Cmdline_allslev;
|
||||
extern int Cmdline_phreak;
|
||||
extern int Cmdline_dshowvid; //WMC Toggles movie playing support
|
||||
extern char *Cmdline_mod; //DTP for mod support
|
||||
extern int Cmdline_show_fps;//DTP moved here because it is the correct place for it to be.
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
+51
-7
@@ -41,7 +41,7 @@ RSC=rc.exe
|
||||
# PROP Intermediate_Dir "..\Release\Profile"
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
|
||||
# ADD CPP /nologo /G5 /MT /W4 /GX /Zi /Ot /Ow /Og /Oi /Oy /Ob2 /I "." /D "_WINDOWS" /D "WIN32" /D "NDEBUG" /U "_DEBUG" /YX /FD /c
|
||||
# ADD CPP /nologo /G5 /MT /W4 /GX /Zi /Ot /Ow /Og /Oi /Oy /Ob2 /I "." /D "NDEBUG" /D "_WINDOWS" /D "WIN32" /D "USE_OPENGL" /U "_DEBUG" /FR /YX /FD /c
|
||||
# ADD BASE RSC /l 0x409 /d "NDEBUG"
|
||||
# ADD RSC /l 0x409 /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
@@ -64,7 +64,7 @@ LIB32=link.exe -lib
|
||||
# PROP Intermediate_Dir "..\Debug\Profile"
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
|
||||
# ADD CPP /nologo /G5 /MTd /W4 /Gm /Gi /GX /ZI /Od /I "." /D "_WINDOWS" /D "WIN32" /D "_DEBUG" /U "NDEBUG" /FR /YX /FD /GZ /c
|
||||
# ADD CPP /nologo /G5 /MTd /W4 /Gm /Gi /GX /ZI /Od /I "." /D "_WINDOWS" /D "WIN32" /D "_DEBUG" /D "USE_OPENGL" /U "NDEBUG" /FR /YX /FD /GZ /c
|
||||
# ADD BASE RSC /l 0x409 /d "_DEBUG"
|
||||
# ADD RSC /l 0x409 /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
@@ -207,6 +207,14 @@ SOURCE=.\Cutscene\Cutscenes.cpp
|
||||
|
||||
SOURCE=.\Cutscene\Cutscenes.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\cutscene\movie.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\cutscene\movie.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Debris"
|
||||
|
||||
@@ -249,6 +257,14 @@ SOURCE=.\debugconsole\timerbar.h
|
||||
# PROP Default_Filter ""
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\directx\dx8show.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\directx\dx8show.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\DirectX\vasync.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
@@ -317,10 +333,6 @@ SOURCE=.\DirectX\vdvp.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\DirectX\vDdraw.lib
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\DirectX\vDinput.lib
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
@@ -329,7 +341,15 @@ SOURCE=.\DirectX\vDsound.lib
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\DirectX\vDxguid.lib
|
||||
SOURCE=.\directx\ddraw.lib
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\directx\dxguid.lib
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\directx\strmiids.lib
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Fireball"
|
||||
@@ -2491,5 +2511,29 @@ SOURCE=.\Network\stand_gui.cpp
|
||||
SOURCE=.\Network\stand_gui.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Decals"
|
||||
|
||||
# PROP Default_Filter ""
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\decals\decals.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\decals\decals.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "ddsutils"
|
||||
|
||||
# PROP Default_Filter ""
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\ddsutils\ddsutils.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\ddsutils\ddsutils.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# End Target
|
||||
# End Project
|
||||
@@ -9,13 +9,19 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/ControlConfig/ControlsConfig.h $
|
||||
* $Revision: 2.2 $
|
||||
* $Date: 2002-10-19 19:29:27 $
|
||||
* $Author: bobboau $
|
||||
* $Revision: 2.4 $
|
||||
* $Date: 2002-12-02 23:52:02 $
|
||||
* $Author: Goober5000 $
|
||||
*
|
||||
* Header file for keyboard, joystick and mouse configuration
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.3 2002/12/02 20:47:28 Goober5000
|
||||
* fixed misspelling of "category" as "catagory"
|
||||
*
|
||||
* Revision 2.2 2002/10/19 19:29:27 bobboau
|
||||
* inital commit, trying to get most of my stuff into FSO, there should be most of my fighter beam, beam rendering, beam sheild hit, ABtrails, and ssm stuff. one thing you should be happy to know is the beam texture tileing is now set in the beam section section of the weapon table entry
|
||||
*
|
||||
* Revision 2.1 2002/10/17 20:40:50 randomtiger
|
||||
* Added ability to remove HUD ingame on keypress shift O
|
||||
* So I've added a new key to the bind list and made use of already existing hud removal code.
|
||||
@@ -299,7 +305,7 @@
|
||||
typedef struct config_item {
|
||||
short key_default; // default key bound to action
|
||||
short joy_default; // default joystick button bound to action
|
||||
char tab; // what tab (catagory) it belongs in
|
||||
char tab; // what tab (category) it belongs in
|
||||
char *text; // describes the action in the config screen
|
||||
char type; // manner control should be checked in
|
||||
short key_id; // actual key bound to action
|
||||
|
||||
@@ -0,0 +1,175 @@
|
||||
#include <windows.h>
|
||||
|
||||
#include "movie.h"
|
||||
#include "directx/dx8show.h"
|
||||
#include "osapi/osapi.h"
|
||||
#include "cmdline/cmdline.h"
|
||||
#include "graphics/2d.h"
|
||||
#include "debugconsole/dbugfile.h"
|
||||
#include "graphics/gropengl.h"
|
||||
|
||||
bool movie_shutdown_fgx = false;
|
||||
|
||||
void movie_set_shutdown_fgx(bool state)
|
||||
{
|
||||
movie_shutdown_fgx = state;
|
||||
}
|
||||
|
||||
bool movie_play(char *name, int unknown_value)
|
||||
{
|
||||
// This should not be uncommented
|
||||
if(!Cmdline_dshowvid)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
** Check file exists
|
||||
*/
|
||||
FILE *fp = fopen(name,"rb");
|
||||
DBUGFILE_OUTPUT_1("About to play: %s",name);
|
||||
|
||||
if(fp == NULL)
|
||||
{
|
||||
DBUGFILE_OUTPUT_0("MOVIE ERROR: Cant open movie file");
|
||||
return true;
|
||||
}
|
||||
|
||||
fclose(fp);
|
||||
|
||||
if(movie_shutdown_fgx == true)
|
||||
{
|
||||
gr_activate(0);
|
||||
}
|
||||
|
||||
|
||||
#ifdef _WIN32
|
||||
|
||||
if (gr_screen.mode==GR_OPENGL)
|
||||
{
|
||||
gr_opengl_cleanup(0);
|
||||
}
|
||||
|
||||
os_app_activate_set(false);
|
||||
|
||||
dx8show_set_hwnd((void *) os_get_window());
|
||||
|
||||
// ShowWindow((HWND) os_get_window(),SW_HIDE);
|
||||
// ShowWindow((HWND) os_get_window(),SW_MINIMIZE);
|
||||
|
||||
dx8show_play_cutscene(name);
|
||||
|
||||
// ShowWindow((HWND) os_get_window(),SW_RESTORE);
|
||||
// ShowWindow((HWND) os_get_window(),SW_SHOW);
|
||||
|
||||
os_app_activate_set(true);
|
||||
|
||||
/*
|
||||
// Comment this back in if the freespace window isnt coming back after the movie ends
|
||||
|
||||
if((HWND) os_get_window() != NULL)
|
||||
{
|
||||
if(GetForegroundWindow() != (HWND) os_get_window())
|
||||
{
|
||||
DBUGFILE_OUTPUT_0("Using SetForegroundWindow last");
|
||||
SetForegroundWindow((HWND) os_get_window());
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
if (gr_screen.mode==GR_OPENGL)
|
||||
{
|
||||
gr_opengl_init(1);
|
||||
}
|
||||
#endif // _WIN32
|
||||
|
||||
|
||||
if(movie_shutdown_fgx == true)
|
||||
{
|
||||
gr_activate(1);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool movie_play_two(char *name1, char *name2, int unknown_value)
|
||||
{
|
||||
bool result = true;
|
||||
|
||||
// This should not be uncommented
|
||||
if(!Cmdline_dshowvid)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
** Check file exists
|
||||
*/
|
||||
FILE *fp = fopen(name1,"rb");
|
||||
DBUGFILE_OUTPUT_1("About to play: %s",name1);
|
||||
|
||||
if(fp == NULL)
|
||||
{
|
||||
DBUGFILE_OUTPUT_0("MOVIE ERROR: Cant open movie file");
|
||||
|
||||
/*
|
||||
** Check second file exists
|
||||
*/
|
||||
FILE *fp2 = fopen(name2,"rb");
|
||||
DBUGFILE_OUTPUT_1("About to play: %s",name2);
|
||||
|
||||
if(fp2 == NULL)
|
||||
{
|
||||
DBUGFILE_OUTPUT_0("MOVIE ERROR: Cant open movie file");
|
||||
return true;
|
||||
}
|
||||
|
||||
fclose(fp2);
|
||||
}
|
||||
|
||||
fclose(fp);
|
||||
|
||||
if(movie_shutdown_fgx == true)
|
||||
{
|
||||
gr_activate(0);
|
||||
}
|
||||
|
||||
#ifdef _WIN32
|
||||
|
||||
if (gr_screen.mode==GR_OPENGL)
|
||||
{
|
||||
gr_opengl_cleanup();
|
||||
}
|
||||
|
||||
os_app_activate_set(false);
|
||||
|
||||
dx8show_play_cutscene(name1);
|
||||
|
||||
{
|
||||
MSG msg;
|
||||
while(PeekMessage(&msg, (HWND) os_get_window(), 0, 0, PM_REMOVE))
|
||||
{
|
||||
TranslateMessage(&msg);
|
||||
DispatchMessage(&msg);
|
||||
}
|
||||
}
|
||||
|
||||
dx8show_play_cutscene(name2);
|
||||
|
||||
os_app_activate_set(true);
|
||||
|
||||
if (gr_screen.mode==GR_OPENGL)
|
||||
{
|
||||
gr_opengl_init(1);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
if(movie_shutdown_fgx == true)
|
||||
{
|
||||
gr_activate(1);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
#ifndef _MOVIE_HEADER_FILE
|
||||
#define _MOVIE_HEADER_FILE
|
||||
|
||||
void movie_set_shutdown_fgx(bool state);
|
||||
bool movie_play(char *name, int unknown_value = 0);
|
||||
bool movie_play_two(char *name1, char *name2, int unknown_value = 0);
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,175 @@
|
||||
#include "ddsutils/ddsutils.h"
|
||||
#include "cfile/cfile.h"
|
||||
|
||||
int Texture_compression_enabled=0;
|
||||
|
||||
static int dds_read_header_internal(LPDDSURFACEDESC2 lpddsd, char *filename, int *width, int *height, int *bpp, int *compression_type)
|
||||
{
|
||||
char code[5];
|
||||
CFILE *ddsfile;
|
||||
char real_name[MAX_FILENAME_LEN];
|
||||
char *p;
|
||||
int retval=DDS_ERROR_NONE;
|
||||
int ct;
|
||||
int bits=0;
|
||||
|
||||
//this better not happen.. ever
|
||||
Assert(filename!=NULL);
|
||||
|
||||
//make sure there is an extension
|
||||
strcpy(real_name, filename);
|
||||
p=strchr(real_name, '.');
|
||||
if (p) *p=0;
|
||||
strcat(real_name, ".dds");
|
||||
|
||||
memset(code,0,sizeof(code));
|
||||
//try to open the file
|
||||
ddsfile = cfopen(real_name, "rb");
|
||||
|
||||
//file not found
|
||||
if (!ddsfile)
|
||||
{
|
||||
return DDS_ERROR_INVALID_FILENAME;
|
||||
}
|
||||
|
||||
//read the code
|
||||
cfread(code,1,4,ddsfile);
|
||||
code[4]=0;
|
||||
|
||||
//check it
|
||||
if (strncmp(code,DDS_FILECODE,4)!=0)
|
||||
{
|
||||
return DDS_ERROR_BAD_HEADER;
|
||||
}
|
||||
|
||||
//read the header
|
||||
cfread(lpddsd,sizeof(DDSURFACEDESC2),1,ddsfile);
|
||||
|
||||
//stuff important info
|
||||
if (width) *width=lpddsd->dwWidth;
|
||||
if (height) *height=lpddsd->dwHeight;
|
||||
|
||||
switch(lpddsd->ddpfPixelFormat.dwFourCC)
|
||||
{
|
||||
case FOURCC_DXT1:
|
||||
bits=24;
|
||||
ct=DDS_DXT1;
|
||||
break;
|
||||
|
||||
case FOURCC_DXT3:
|
||||
bits=32;
|
||||
ct=DDS_DXT3;
|
||||
break;
|
||||
|
||||
case FOURCC_DXT5:
|
||||
bits=32;
|
||||
ct=DDS_DXT5;
|
||||
break;
|
||||
|
||||
//dxt2 and dxt4 aren't supported
|
||||
case FOURCC_DXT2:
|
||||
case FOURCC_DXT4:
|
||||
retval=DDS_ERROR_INVALID_FORMAT;
|
||||
ct=DDS_DXT_INVALID;
|
||||
break;
|
||||
|
||||
//none of the above
|
||||
default:
|
||||
retval=DDS_ERROR_UNCOMPRESSED;
|
||||
ct=DDS_DXT_INVALID;
|
||||
break;
|
||||
}
|
||||
|
||||
if (bpp) *bpp=bits;
|
||||
if (compression_type) *compression_type=ct;
|
||||
|
||||
//close file and return
|
||||
cfclose(ddsfile);
|
||||
return retval;
|
||||
}
|
||||
|
||||
int dds_read_header(char *filename, int *width, int *height, int *bpp, int *compression_type)
|
||||
{
|
||||
DDSURFACEDESC2 ddsd;
|
||||
return dds_read_header_internal(&ddsd, filename, width, height, bpp, compression_type);
|
||||
}
|
||||
|
||||
//reads pixel info from a dds file
|
||||
int dds_read_bitmap(char *filename, int *size, uint* data)
|
||||
{
|
||||
int retval;
|
||||
DDSURFACEDESC2 ddsd;
|
||||
int w,h,ct,bpp;
|
||||
CFILE *cfp;
|
||||
ubyte* tmp;
|
||||
|
||||
//this must be set
|
||||
Assert(size!=NULL);
|
||||
|
||||
//read the header -- if its at this stage, it should be legal.
|
||||
retval=dds_read_header_internal(&ddsd, filename, &w, &h, &bpp, &ct);
|
||||
Assert(retval==DDS_ERROR_NONE);
|
||||
|
||||
//get some more info from the surface
|
||||
*size=ddsd.dwMipMapCount > 1 ? ddsd.dwLinearSize * 2 : ddsd.dwLinearSize;
|
||||
|
||||
//open it up and go to the data section
|
||||
cfp=cfopen(filename,"rb");
|
||||
cfseek(cfp,DDS_OFFSET, CF_SEEK_SET);
|
||||
|
||||
//get the data
|
||||
tmp=(ubyte*)malloc(*size);
|
||||
|
||||
if (!tmp)
|
||||
{
|
||||
cfclose(cfp);
|
||||
return DDS_ERROR_NO_MEM; //barf
|
||||
}
|
||||
|
||||
cfread(tmp,1,*size,cfp);
|
||||
|
||||
*data=(uint)tmp;
|
||||
//we look done here
|
||||
cfclose(cfp);
|
||||
return DDS_ERROR_NONE;
|
||||
}
|
||||
|
||||
//returns string representation of DDS_** error code
|
||||
const char *dds_error_string(int code)
|
||||
{
|
||||
switch (code)
|
||||
{
|
||||
case DDS_ERROR_NONE:
|
||||
return "No error";
|
||||
|
||||
case DDS_ERROR_NO_MEM:
|
||||
return "Insufficient memory";
|
||||
|
||||
case DDS_ERROR_INVALID_FILENAME:
|
||||
return "File not found";
|
||||
|
||||
case DDS_ERROR_BAD_HEADER:
|
||||
return "Filecode did not equal \"DDS \"";
|
||||
|
||||
case DDS_ERROR_INVALID_FORMAT:
|
||||
return "File was compressed, but it was DXT2 or DXT4";
|
||||
|
||||
case DDS_ERROR_UNCOMPRESSED:
|
||||
return "*.DDS files must be compressed and use DXT1, DXT3, or DXT5 compression";
|
||||
|
||||
default:
|
||||
return "Abort, retry, fail?";
|
||||
}
|
||||
|
||||
//get a warning otherwise
|
||||
return "Abort, retry, fail?";
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,119 @@
|
||||
//header file to load .dds files
|
||||
//these use dxtc texture compression
|
||||
|
||||
#ifndef __DDS_H
|
||||
#define __DDS_H
|
||||
|
||||
#include "globalincs/pstypes.h"
|
||||
#include "directx/vddraw.h"
|
||||
|
||||
#define DDS_ERROR_NONE 0 //everything went fine
|
||||
#define DDS_ERROR_INVALID_FILENAME 1 //bad filename
|
||||
#define DDS_ERROR_NO_MEM 2 //not enough mem to load
|
||||
#define DDS_ERROR_UNCOMPRESSED 3 //not using dxtc compression
|
||||
#define DDS_ERROR_INVALID_FORMAT 4 //can only use dxtc1, dxtc3, dxtc5
|
||||
#define DDS_ERROR_BAD_HEADER 5 //header was not "DDS "
|
||||
|
||||
|
||||
#define DDS_DXT_INVALID -1
|
||||
#define DDS_DXT1 1
|
||||
#define DDS_DXT3 3
|
||||
#define DDS_DXT5 5
|
||||
|
||||
#ifndef MAKEFOURCC
|
||||
#define MAKEFOURCC(ch0, ch1, ch2, ch3) \
|
||||
((DWORD)(BYTE)(ch0) | ((DWORD)(BYTE)(ch1) << 8) | \
|
||||
((DWORD)(BYTE)(ch2) << 16) | ((DWORD)(BYTE)(ch3) << 24 ))
|
||||
#endif //defined(MAKEFOURCC)
|
||||
|
||||
// FOURCC codes for DX compressed-texture pixel formats
|
||||
#define FOURCC_DXT1 (MAKEFOURCC('D','X','T','1'))
|
||||
#define FOURCC_DXT2 (MAKEFOURCC('D','X','T','2'))
|
||||
#define FOURCC_DXT3 (MAKEFOURCC('D','X','T','3'))
|
||||
#define FOURCC_DXT4 (MAKEFOURCC('D','X','T','4'))
|
||||
#define FOURCC_DXT5 (MAKEFOURCC('D','X','T','5'))
|
||||
|
||||
#define DDS_FILECODE "DDS "
|
||||
|
||||
#ifndef DUMMYUNIONNAMEN
|
||||
#if defined(__cplusplus) || !defined(NONAMELESSUNION)
|
||||
#define DUMMYUNIONNAMEN(n)
|
||||
#else
|
||||
#define DUMMYUNIONNAMEN(n) u##n
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
//these structures are the headers for a dds file
|
||||
typedef struct _DDSCAPS2
|
||||
{
|
||||
DWORD dwCaps; // capabilities of surface wanted
|
||||
DWORD dwCaps2;
|
||||
DWORD dwCaps3;
|
||||
union
|
||||
{
|
||||
DWORD dwCaps4;
|
||||
DWORD dwVolumeDepth;
|
||||
} DUMMYUNIONNAMEN(1);
|
||||
} DDSCAPS2;
|
||||
|
||||
typedef struct _DDSURFACEDESC2
|
||||
{
|
||||
DWORD dwSize; // size of the DDSURFACEDESC structure
|
||||
DWORD dwFlags; // determines what fields are valid
|
||||
DWORD dwHeight; // height of surface to be created
|
||||
DWORD dwWidth; // width of input surface
|
||||
union
|
||||
{
|
||||
LONG lPitch; // distance to start of next line (return value only)
|
||||
DWORD dwLinearSize; // Formless late-allocated optimized surface size
|
||||
} DUMMYUNIONNAMEN(1);
|
||||
union
|
||||
{
|
||||
DWORD dwBackBufferCount; // number of back buffers requested
|
||||
DWORD dwDepth; // the depth if this is a volume texture
|
||||
} DUMMYUNIONNAMEN(5);
|
||||
union
|
||||
{
|
||||
DWORD dwMipMapCount; // number of mip-map levels requestde
|
||||
// dwZBufferBitDepth removed, use ddpfPixelFormat one instead
|
||||
DWORD dwRefreshRate; // refresh rate (used when display mode is described)
|
||||
DWORD dwSrcVBHandle; // The source used in VB::Optimize
|
||||
} DUMMYUNIONNAMEN(2);
|
||||
DWORD dwAlphaBitDepth; // depth of alpha buffer requested
|
||||
DWORD dwReserved; // reserved
|
||||
LPVOID lpSurface; // pointer to the associated surface memory
|
||||
union
|
||||
{
|
||||
DDCOLORKEY ddckCKDestOverlay; // color key for destination overlay use
|
||||
DWORD dwEmptyFaceColor; // Physical color for empty cubemap faces
|
||||
} DUMMYUNIONNAMEN(3);
|
||||
DDCOLORKEY ddckCKDestBlt; // color key for destination blt use
|
||||
DDCOLORKEY ddckCKSrcOverlay; // color key for source overlay use
|
||||
DDCOLORKEY ddckCKSrcBlt; // color key for source blt use
|
||||
union
|
||||
{
|
||||
DDPIXELFORMAT ddpfPixelFormat; // pixel format description of the surface
|
||||
DWORD dwFVF; // vertex format description of vertex buffers
|
||||
} DUMMYUNIONNAMEN(4);
|
||||
DDSCAPS2 ddsCaps; // direct draw surface capabilities
|
||||
DWORD dwTextureStage; // stage in multitexture cascade
|
||||
} DDSURFACEDESC2, FAR* LPDDSURFACEDESC2;
|
||||
|
||||
#define DDS_OFFSET 4+sizeof(DDSURFACEDESC2) //place where the data starts -- should be 128
|
||||
|
||||
//reads a dds header
|
||||
//returns one of the error values
|
||||
//'compression_type' comes back as one of the DDS_DXTC* defines
|
||||
int dds_read_header(char *filename, int *width, int *height, int *bpp, int *compression_type);
|
||||
|
||||
//reads bitmap
|
||||
//size of the data it stored in size
|
||||
int dds_read_bitmap(char *filename, int *size, uint* data);
|
||||
|
||||
//returns a string from a DDS error code
|
||||
const char* dds_error_string(int code);
|
||||
|
||||
extern int Texture_compression_enabled;
|
||||
|
||||
#endif //__DDS_H
|
||||
@@ -79,7 +79,7 @@ void timerbar_end_frame()
|
||||
int xsize = (int) profiles[i].frame_total.QuadPart / 60;
|
||||
|
||||
// break condition in else
|
||||
while(1)
|
||||
for (;;)
|
||||
{
|
||||
// if bar runs over
|
||||
if(last_xpos + xsize > WIDTH)
|
||||
|
||||
@@ -0,0 +1,830 @@
|
||||
//sorce file for decals-Bobboau
|
||||
//and no, I don't have any idea what I'm doing
|
||||
|
||||
#include "decals/decals.h"
|
||||
#include "ship/ship.h"
|
||||
#include "render/3d.h"
|
||||
#include "io/timer.h"
|
||||
#include "math/fvi.h"
|
||||
#include "lighting/lighting.h"
|
||||
|
||||
//#define DECALS_ENABLED
|
||||
|
||||
int decal_intersect_seg_with_cube(vector * poly_point, vector start, vector end, vector cube_point[8], matrix orient, int ints=1);
|
||||
|
||||
int decal_intersect_poly_with_cube(vector * poly_point, vector point[3], vector cube_point[8], int ints);
|
||||
|
||||
decal_model d_model;
|
||||
|
||||
int poly_num = 0;
|
||||
|
||||
static vector decal_cube_point[8];
|
||||
static vector decal_cube_plane[6][2];
|
||||
static vector decal_hit_point;
|
||||
static vector decal_hit_vect;
|
||||
static float decal_hit_radius;
|
||||
|
||||
static matrix decal_orient;
|
||||
|
||||
static vector * decal_point_list[MAX_DECAL_DEFPOINTS];
|
||||
|
||||
static int decal_poly[MAX_DECAL_DEFPOINTS];
|
||||
|
||||
static decal * new_decal;
|
||||
|
||||
static int nverts;
|
||||
|
||||
static float min_rad;
|
||||
|
||||
static int back_faceing;
|
||||
|
||||
/*
|
||||
vector uvec, rvec;
|
||||
vector temp;
|
||||
|
||||
temp = *pos;
|
||||
|
||||
vm_vec_sub( &rvec, Eyeposition, &temp );
|
||||
vm_vec_normalize( &rvec );
|
||||
|
||||
vm_vec_crossprod(&uvec,fvec,&rvec);
|
||||
vm_vec_normalize(&uvec);
|
||||
|
||||
vm_vec_scale_add( top, &temp, &uvec, w/2.0f );
|
||||
vm_vec_scale_add( bot, &temp, &uvec, -w/2.0f );
|
||||
*/
|
||||
|
||||
int decal_find_next(object *obj){
|
||||
ship *shipp = &Ships[obj->instance];
|
||||
int oldest = shipp->decals[0].timestamp;
|
||||
int i;
|
||||
for(i = 0; i < MAX_SHIP_DECALS; i++){
|
||||
if(shipp->decals[i].is_valid != 1){ //use up all the unused decals first
|
||||
return i%MAX_SHIP_DECALS;
|
||||
}
|
||||
}
|
||||
for(i = 1; i < MAX_SHIP_DECALS; i++){
|
||||
if(shipp->decals[i].timestamp > oldest){ //then get the oldest one
|
||||
oldest = i;
|
||||
}
|
||||
}
|
||||
return oldest%MAX_SHIP_DECALS;
|
||||
}
|
||||
|
||||
int decal_create_simple(object *obj, decal_point *point, int texture){//makes a simple non-clipped decal
|
||||
#ifdef DECALS_ENABLED
|
||||
mprintf(("a decal is about to be made at %0.2f, %0.2f, %0.2f\n", point->pnt.xyz.x, point->pnt.xyz.y, point->pnt.xyz.z));
|
||||
mprintf(("orient fvec at %0.2f, %0.2f, %0.2f\n", point->orient.vec.fvec.xyz.x, point->orient.vec.fvec.xyz.y, point->orient.vec.fvec.xyz.z));
|
||||
|
||||
if(obj->type != OBJ_SHIP){
|
||||
return 0;
|
||||
}
|
||||
// vertex vert[1][2];
|
||||
// vector vec[4];
|
||||
|
||||
vector center = point->pnt;
|
||||
float rad = point->radius;
|
||||
if(rad <=0) rad = 10;
|
||||
mprintf(("radius %f\n",rad));
|
||||
vector plain_point[4];
|
||||
// mprintf(("orient uvec x %0.2f %0.2f %0.2f\n", point->orient.vec.uvec.xyz.x, point->orient.vec.uvec.xyz.y, point->orient.vec.uvec.xyz.z));
|
||||
// mprintf(("orient rvec x %0.2f %0.2f %0.2f\n", point->orient.vec.rvec.xyz.x, point->orient.vec.rvec.xyz.y, point->orient.vec.rvec.xyz.z));
|
||||
// mprintf(("orient fvec x %0.2f %0.2f %0.2f\n", point->orient.vec.fvec.xyz.x, point->orient.vec.fvec.xyz.y, point->orient.vec.fvec.xyz.z));
|
||||
plain_point[0] = point->orient.vec.uvec;
|
||||
plain_point[1] = plain_point[0];
|
||||
vm_vec_negate(&plain_point[1]);
|
||||
plain_point[2] = point->orient.vec.rvec;
|
||||
plain_point[3] = plain_point[2];
|
||||
vm_vec_negate(&plain_point[3]);
|
||||
|
||||
mprintf(("\n"));
|
||||
|
||||
int dinx = decal_find_next(obj);
|
||||
|
||||
ship *shipp = &Ships[obj->instance];
|
||||
decal *dec = shipp->decals;
|
||||
|
||||
vm_vec_scale_add( &dec[0].vert[0], ¢er, &plain_point[0], rad );
|
||||
vm_vec_scale_add( &dec[0].vert[1], ¢er, &plain_point[2], rad );
|
||||
vm_vec_scale_add( &dec[0].vert[2], ¢er, &plain_point[1], rad );
|
||||
vm_vec_scale_add( &dec[0].vert[3], ¢er, &plain_point[3], rad );
|
||||
|
||||
dec[dinx].poly[0].point[0] = 0;
|
||||
dec[dinx].poly[0].point[1] = 1;
|
||||
dec[dinx].poly[0].point[2] = 2;
|
||||
|
||||
dec[dinx].poly[1].point[0] = 0;
|
||||
dec[dinx].poly[1].point[1] = 3;
|
||||
dec[0].poly[1].point[2] = 2;
|
||||
|
||||
dec[dinx].poly[0].uv[0].u = 0; dec[0].poly[0].uv[0].v = 0;
|
||||
dec[dinx].poly[0].uv[1].u = 0; dec[0].poly[0].uv[1].v = 1;
|
||||
dec[dinx].poly[0].uv[2].u = 1; dec[0].poly[0].uv[2].v = 1;
|
||||
|
||||
dec[dinx].poly[1].uv[0].u = 0; dec[0].poly[1].uv[0].v = 0;
|
||||
dec[dinx].poly[1].uv[1].u = 1; dec[0].poly[1].uv[1].v = 0;
|
||||
dec[dinx].poly[1].uv[2].u = 1; dec[0].poly[1].uv[2].v = 1;
|
||||
|
||||
dec[dinx].texture = texture;
|
||||
dec[dinx].n_poly = 2;
|
||||
dec[dinx].is_valid = 1;
|
||||
dec[dinx].timestamp = timestamp();
|
||||
|
||||
mprintf(("a decal should have been made at %0.2f %0.2f %0.2f\n", point->pnt.xyz.x, point->pnt.xyz.y, point->pnt.xyz.z));
|
||||
//Int3();
|
||||
#endif
|
||||
return 1;
|
||||
}
|
||||
|
||||
#define duw(p) (*((uint *) (p)))
|
||||
#define dw(p) (*((int *) (p)))
|
||||
#define dwp(p) ((int *) (p))
|
||||
#define dvp(p) ((vector *) (p))
|
||||
#define dfl(p) (*((float *) (p)))
|
||||
|
||||
|
||||
//creates a decal, returns decal index on succes, -1 on failure
|
||||
|
||||
int decal_create(object * obj, decal_point *point, int subobject, int texture, int backfaced_texture){
|
||||
#ifdef DECALS_ENABLED
|
||||
mprintf(("a decal is about to be made at %0.2f, %0.2f, %0.2f\n", point->pnt.xyz.x, point->pnt.xyz.y, point->pnt.xyz.z));
|
||||
|
||||
if(obj->type != OBJ_SHIP){
|
||||
return -1;
|
||||
}
|
||||
if(texture == -1)return -1;
|
||||
if(point->radius <= 0)return -1;
|
||||
|
||||
vector center = point->pnt;
|
||||
float rad = point->radius;
|
||||
if(rad <=0) rad = 1;
|
||||
mprintf(("radius %f\n",rad));
|
||||
vector plain_point[4];
|
||||
vector cube_point[8];
|
||||
//define the decals dimentions
|
||||
plain_point[0] = point->orient.vec.uvec;
|
||||
plain_point[1] = plain_point[0];
|
||||
vm_vec_negate(&plain_point[1]);
|
||||
plain_point[2] = point->orient.vec.rvec;
|
||||
plain_point[3] = plain_point[2];
|
||||
vm_vec_negate(&plain_point[3]);
|
||||
|
||||
vector topcenter;
|
||||
vector bvec = point->orient.vec.fvec;
|
||||
vm_vec_negate(&bvec);
|
||||
vm_vec_scale_add(&topcenter, ¢er, &bvec, rad);
|
||||
|
||||
for(int i = 0; i < 4; i++){
|
||||
vm_vec_scale_add( &cube_point[i], &topcenter, &plain_point[i], rad );
|
||||
vm_vec_scale_add( &cube_point[i+4], &cube_point[i], &point->orient.vec.fvec, rad*2);
|
||||
}
|
||||
|
||||
float max_rad = vm_vec_dist_quick(¢er, &cube_point[0]); //the cube points are all equidistant, right?
|
||||
min_rad = fl_sqrt((rad * rad)/2); //the cube points are all equidistant, right?
|
||||
mprintf(("decal defined\n"));
|
||||
|
||||
//define the decals dimentions
|
||||
|
||||
//set up the decal model
|
||||
ship *shipp = &Ships[obj->instance];
|
||||
decal *sdec = shipp->decals;
|
||||
|
||||
polymodel *pm = model_get(shipp->modelnum);
|
||||
bsp_info * sm;
|
||||
sm = &pm->submodel[subobject];
|
||||
// decal_model dmod = pm->submodel[subobject].dec_model;// sm->dec_model;
|
||||
// decal_model tdec; //temporary decal model for holding the culled down part of the decal
|
||||
|
||||
//setting up the decal cube
|
||||
vector test_vec, temp1, temp2;
|
||||
for(i = 0; i<8; i++)decal_cube_point[i] = cube_point[i];
|
||||
|
||||
decal_orient = point->orient;
|
||||
|
||||
decal_cube_plane[0][0] = cube_point[5];
|
||||
|
||||
temp1 = decal_orient.vec.uvec;
|
||||
temp2 = decal_orient.vec.rvec;
|
||||
|
||||
vm_vec_avg(&test_vec, &temp1, &temp2);
|
||||
vm_vec_normalize(&test_vec);
|
||||
|
||||
decal_cube_plane[0][1] = test_vec;
|
||||
|
||||
// mprintf(("plane 0 position is x %0.2f y %0.2f z %0.2f\n", decal_cube_plane[0][0].xyz.x, decal_cube_plane[0][0].xyz.y, decal_cube_plane[0][0].xyz.z));
|
||||
// mprintf(("plane 0 normal is x %0.2f y %0.2f z %0.2f\n", decal_cube_plane[0][1].xyz.x, decal_cube_plane[0][1].xyz.y, decal_cube_plane[0][1].xyz.z));
|
||||
|
||||
|
||||
|
||||
decal_cube_plane[1][0] = cube_point[0];
|
||||
|
||||
vm_vec_negate(&test_vec);
|
||||
|
||||
decal_cube_plane[1][1] = test_vec;
|
||||
// mprintf(("plane 1 position is x %0.2f y %0.2f z %0.2f\n", decal_cube_plane[1][0].xyz.x, decal_cube_plane[1][0].xyz.y, decal_cube_plane[1][0].xyz.z));
|
||||
// mprintf(("plane 1 normal is x %0.2f y %0.2f z %0.2f\n", decal_cube_plane[1][1].xyz.x, decal_cube_plane[1][1].xyz.y, decal_cube_plane[1][1].xyz.z));
|
||||
|
||||
|
||||
|
||||
decal_cube_plane[2][0] = cube_point[5];
|
||||
|
||||
vm_vec_negate(&temp2);
|
||||
vm_vec_avg(&test_vec, &temp1, &temp2);
|
||||
vm_vec_normalize(&test_vec);
|
||||
|
||||
decal_cube_plane[2][1] = test_vec;
|
||||
|
||||
// mprintf(("plane 2 position is x %0.2f y %0.2f z %0.2f\n", decal_cube_plane[2][0].xyz.x, decal_cube_plane[2][0].xyz.y, decal_cube_plane[2][0].xyz.z));
|
||||
// mprintf(("plane 2 normal is x %0.2f y %0.2f z %0.2f\n", decal_cube_plane[2][1].xyz.x, decal_cube_plane[2][1].xyz.y, decal_cube_plane[2][1].xyz.z));
|
||||
|
||||
|
||||
|
||||
decal_cube_plane[3][0] = cube_point[0];
|
||||
|
||||
vm_vec_negate(&test_vec);
|
||||
|
||||
decal_cube_plane[3][1] = test_vec;
|
||||
|
||||
// mprintf(("plane 3 position is x %0.2f y %0.2f z %0.2f\n", decal_cube_plane[3][0].xyz.x, decal_cube_plane[3][0].xyz.y, decal_cube_plane[3][0].xyz.z));
|
||||
// mprintf(("plane 3 normal is x %0.2f y %0.2f z %0.2f\n", decal_cube_plane[3][1].xyz.x, decal_cube_plane[3][1].xyz.y, decal_cube_plane[3][1].xyz.z));
|
||||
|
||||
|
||||
|
||||
test_vec = decal_orient.vec.fvec;
|
||||
|
||||
decal_cube_plane[4][0] = cube_point[0];
|
||||
|
||||
decal_cube_plane[4][1] = test_vec;
|
||||
|
||||
// mprintf(("plane 4 position is x %0.2f y %0.2f z %0.2f\n", decal_cube_plane[4][0].xyz.x, decal_cube_plane[4][0].xyz.y, decal_cube_plane[4][0].xyz.z));
|
||||
// mprintf(("plane 4 normal is x %0.2f y %0.2f z %0.2f\n", decal_cube_plane[4][1].xyz.x, decal_cube_plane[4][1].xyz.y, decal_cube_plane[4][1].xyz.z));
|
||||
|
||||
|
||||
|
||||
vm_vec_negate(&test_vec);
|
||||
decal_cube_plane[5][0] = cube_point[5];
|
||||
|
||||
decal_cube_plane[5][1] = test_vec;
|
||||
|
||||
// mprintf(("plane 5 position is x %0.2f y %0.2f z %0.2f\n", decal_cube_plane[5][0].xyz.x, decal_cube_plane[5][0].xyz.y, decal_cube_plane[5][0].xyz.z));
|
||||
// mprintf(("plane 5 normal is x %0.2f y %0.2f z %0.2f\n", decal_cube_plane[5][1].xyz.x, decal_cube_plane[5][1].xyz.y, decal_cube_plane[5][1].xyz.z));
|
||||
//setting up the decal cube
|
||||
|
||||
mprintf(("cube set up\n"));
|
||||
|
||||
decal_hit_point = point->pnt;
|
||||
decal_hit_radius = max_rad;
|
||||
decal_hit_vect = point->orient.vec.fvec;
|
||||
poly_num = 0;
|
||||
nverts = 0;
|
||||
|
||||
//go and find decals for each submodel
|
||||
// for(int z = 0; z<pm->n_models;z++){
|
||||
|
||||
int dinx = decal_find_next(obj);
|
||||
mprintf(("decal is number %d\n", dinx));
|
||||
|
||||
sdec[dinx].is_valid = 0;
|
||||
|
||||
new_decal = &shipp->decals[dinx];
|
||||
|
||||
if(backfaced_texture != -1){
|
||||
back_faceing = 1;
|
||||
}else{
|
||||
back_faceing = 0;
|
||||
}
|
||||
decal_create_sub((ubyte *)pm->submodel[subobject].bsp_data);
|
||||
|
||||
mprintf(("deacal defined\n"));
|
||||
|
||||
sdec[dinx].texture = texture;
|
||||
sdec[dinx].backfaced_texture = backfaced_texture;
|
||||
sdec[dinx].is_valid = 1;
|
||||
sdec[dinx].timestamp = timestamp();
|
||||
sdec[dinx].n_poly = poly_num;
|
||||
sdec[dinx].state = 1;
|
||||
sdec[dinx].lifetime = 3000;
|
||||
sdec[dinx].frames = 1;
|
||||
sdec[dinx].importance = 0;
|
||||
sdec[dinx].radius = max_rad;
|
||||
sdec[dinx].position = point->pnt;
|
||||
|
||||
mprintf(("a decal should have been made with %d polys\n",sdec[0].n_poly));
|
||||
|
||||
|
||||
return dinx;
|
||||
|
||||
#else
|
||||
return -1;
|
||||
#endif
|
||||
}
|
||||
//decal_model d_model;
|
||||
|
||||
// Point list
|
||||
// +0 int id
|
||||
// +4 int size
|
||||
// +8 int n_verts
|
||||
// +12 int n_norms
|
||||
// +16 int offset from start of chunk to vertex data
|
||||
// +20 n_verts*char norm_counts
|
||||
// +offset vertex data. Each vertex n is a point followed by norm_counts[n] normals.
|
||||
void decal_create_defpoints(ubyte * p )
|
||||
{
|
||||
// mprintf(("entering decal decal_create_defpoints\n"));
|
||||
|
||||
|
||||
int n;
|
||||
nverts = dw(p+8);
|
||||
int offset = dw(p+16);
|
||||
|
||||
mprintf(("%d verts\n",nverts));
|
||||
ubyte * normcount = p+20;
|
||||
vector *src = dvp(p+offset);
|
||||
|
||||
Assert( nverts < 1200 );
|
||||
|
||||
|
||||
|
||||
for (n=0; n<nverts; n++ ) {
|
||||
|
||||
|
||||
decal_point_list[n] = src;
|
||||
new_decal->vert[n].xyz = src->xyz;
|
||||
src += normcount[n]+1;
|
||||
// mprintf(("defpoint %d, x %0.2f, y %0.2f, z %0.2f\n",n,d_model.vert[n].xyz.x,d_model.vert[n].xyz.y,d_model.vert[n].xyz.z));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
// Sortnorms
|
||||
// +0 int id
|
||||
// +4 int size
|
||||
// +8 vector normal
|
||||
// +20 vector center
|
||||
// +32 float radius
|
||||
// 36 int front offset
|
||||
// 40 int back offset
|
||||
// 44 int prelist offset
|
||||
// 48 int postlist offset
|
||||
// 52 int online offset
|
||||
|
||||
void decal_create_sortnorm(ubyte * p)
|
||||
{
|
||||
// mprintf(("entering decal_create_sortnorm\n"));
|
||||
int frontlist = dw(p+36);
|
||||
int backlist = dw(p+40);
|
||||
int prelist = dw(p+44);
|
||||
int postlist = dw(p+48);
|
||||
int onlist = dw(p+52);
|
||||
|
||||
vector min, max;
|
||||
min.xyz = dvp(p+56)->xyz;
|
||||
max.xyz = dvp(p+68)->xyz;
|
||||
min.xyz.x += decal_hit_radius;
|
||||
min.xyz.y += decal_hit_radius;
|
||||
min.xyz.z += decal_hit_radius;
|
||||
max.xyz.x += decal_hit_radius;
|
||||
max.xyz.y += decal_hit_radius;
|
||||
max.xyz.z += decal_hit_radius;
|
||||
|
||||
/* if (!fvi_ray_boundingbox( &min, &max, &decal_hit_point, &decal_hit_vect, NULL )) {
|
||||
return;
|
||||
}
|
||||
*/
|
||||
if (prelist) decal_create_sub(p+prelist);
|
||||
if (backlist) decal_create_sub(p+backlist);
|
||||
if (onlist) decal_create_sub(p+onlist);
|
||||
if (frontlist) decal_create_sub(p+frontlist);
|
||||
if (postlist) decal_create_sub(p+postlist);
|
||||
}
|
||||
|
||||
/*
|
||||
typedef struct model_tmap_vert {
|
||||
short vertnum;
|
||||
short normnum;
|
||||
float u,v;
|
||||
} model_tmap_vert;
|
||||
*/
|
||||
//int poly_num = 0;
|
||||
// Textured Poly
|
||||
// +0 int id
|
||||
// +4 int size
|
||||
// +8 vector normal
|
||||
// +20 vector normal_point
|
||||
// +32 int tmp = 0
|
||||
// +36 int nverts
|
||||
// +40 int tmap_num
|
||||
// +44 nverts*(model_tmap_vert) vertlist (n,u,v)
|
||||
void decal_create_tmappoly(ubyte * p)
|
||||
{
|
||||
// mprintf(("entering decal_create_tmappoly\n"));
|
||||
|
||||
if(poly_num >= MAX_DECAL_POLY){
|
||||
mprintf(("bugging out becase there are too many polys in the decal\n"));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
int i;
|
||||
int nv;
|
||||
// uv_pair uvlist[TMAP_MAX_VERTS];
|
||||
// vector points[TMAP_MAX_VERTS];
|
||||
model_tmap_vert *verts;
|
||||
|
||||
nv = dw(p+36);
|
||||
if ( nv < 0 ) return;
|
||||
|
||||
// int tmap_num = dw(p+40);
|
||||
/*
|
||||
if ( (!(Mc->flags & MC_CHECK_INVISIBLE_FACES)) && (Mc_pm->textures[tmap_num] < 0) ) {
|
||||
// Don't check invisible polygons.
|
||||
return;
|
||||
}
|
||||
*/
|
||||
verts = (model_tmap_vert *)(p+44);
|
||||
vector temppoly[820];
|
||||
|
||||
for (i=0;i<nv;i++) {
|
||||
decal_poly[i] = (int)verts[i].vertnum;
|
||||
temppoly[i].xyz = decal_point_list[decal_poly[i]]->xyz;
|
||||
}
|
||||
|
||||
vector pnorm;
|
||||
vm_vec_perp(&pnorm, decal_point_list[decal_poly[0]], decal_point_list[decal_poly[1]], decal_point_list[decal_poly[2]]);
|
||||
|
||||
float back = vm_vec_dot(&decal_cube_plane[4][1], &pnorm);
|
||||
|
||||
if( (back_faceing == 0) && (back >= 0) )return;
|
||||
|
||||
//poly culling
|
||||
vector pcenter;
|
||||
vm_vec_avg_n(&pcenter, nv, temppoly);
|
||||
float pradius = 0;
|
||||
float dist = 0;
|
||||
for (i=0;i<nv;i++) {
|
||||
dist = vm_vec_dist(decal_point_list[decal_poly[i]], &pcenter);
|
||||
if(dist>pradius){
|
||||
pradius = dist;
|
||||
}
|
||||
}
|
||||
|
||||
//if it's too far to posably get near the cube get out
|
||||
if(vm_vec_dist_quick(&pcenter, &decal_hit_point) >= (pradius + decal_hit_radius)){
|
||||
// mprintf(("leaveing becase poly is too far away\n"));
|
||||
return;
|
||||
}
|
||||
|
||||
//this is for faster testing, I'm not sure if it's realy makeing it faster or not
|
||||
int k;
|
||||
for(k = 0; k<6; k++){
|
||||
int first_good = -1;
|
||||
for(i = 0; ((i< nv) && (first_good == -1)); i++){
|
||||
if(fvi_point_dist_plane(&decal_cube_plane[k][0], &decal_cube_plane[k][1], decal_point_list[decal_poly[i]]) > 0){
|
||||
first_good = i;
|
||||
}
|
||||
}
|
||||
if(first_good == -1){
|
||||
// mprintf(("all points are behind a plane, polygon is not in the cube\n"));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
//poly culling
|
||||
int temp_poly[820];
|
||||
|
||||
int skip = 0, numv = 0, valid = 0;
|
||||
|
||||
// mprintf(("starting to test the poly, with %d verts in it\n",nv));
|
||||
for(k = 0; k<6; k++){
|
||||
//find the first point in front of the plain
|
||||
int first_good = -1;
|
||||
for(i = 0; ((i< nv) && (first_good == -1)); i++){
|
||||
// mprintf(("testing point %d with plane %d\n", i, k));
|
||||
// mprintf(("point's position is x %0.2f y %0.2f z %0.2f\n", decal_point_list[decal_poly[i]]->xyz.x, decal_point_list[decal_poly[i]]->xyz.y, decal_point_list[decal_poly[i]]->xyz.z));
|
||||
// mprintf(("plane's position is x %0.2f y %0.2f z %0.2f\n", decal_cube_plane[k][0].xyz.x, decal_cube_plane[k][0].xyz.y, decal_cube_plane[k][0].xyz.z));
|
||||
// mprintf(("plane's normal is x %0.2f y %0.2f z %0.2f\n", decal_cube_plane[k][1].xyz.x, decal_cube_plane[k][1].xyz.y, decal_cube_plane[k][1].xyz.z));
|
||||
if(fvi_point_dist_plane(&decal_cube_plane[k][0], &decal_cube_plane[k][1], decal_point_list[decal_poly[i]]) > 0){
|
||||
first_good = i;
|
||||
// mprintf(("%d is the first good point\n", i));
|
||||
}
|
||||
}
|
||||
if(first_good == -1){
|
||||
// mprintf(("all points are behind a plane, polygon is not in the cube\n"));
|
||||
return;
|
||||
}else{
|
||||
valid = 1;
|
||||
}
|
||||
|
||||
//first point in front of the plane is good of corse
|
||||
// temp_poly[0] = decal_poly[(first_good + nv)%nv];
|
||||
numv = 0;
|
||||
//go through each point and see if there is an intersection between it the next point and the current plane
|
||||
//if there is then make the intersection point the next point in the poly
|
||||
//ignor all points untill there is another intersection
|
||||
//other wise make the next point the next point in the poly
|
||||
// if(k==1)Int3();
|
||||
int is_infront = 1, is_infront2 = 1;
|
||||
for(i = first_good; i < (nv + first_good); i++){
|
||||
// mprintf(("looking for intersections between point %d and point %d, with plane %d\n", i%nv, (i + 1)%nv, k));
|
||||
// mprintf((" point %d, is at, x %0.2f y %0.2f z %0.2f and point %d, is at, x %0.2f y %0.2f z %0.2f\n", i%nv, decal_point_list[decal_poly[i]]->xyz.x, decal_point_list[decal_poly[i]]->xyz.y, decal_point_list[decal_poly[i]]->xyz.z, (i + 1)%nv, decal_point_list[decal_poly[(i + 1)%nv]]->xyz.x, decal_point_list[decal_poly[(i + 1)%nv]]->xyz.y, decal_point_list[decal_poly[(i + 1)%nv]]->xyz.z));
|
||||
is_infront2 = is_infront;
|
||||
float is_in = fvi_point_dist_plane(&decal_cube_plane[k][0], &decal_cube_plane[k][1], decal_point_list[decal_poly[(i + 1)%nv]]);
|
||||
if(is_in > 0){
|
||||
is_infront = 1;
|
||||
}else{
|
||||
is_infront= 0;
|
||||
}
|
||||
if(is_infront != is_infront2){
|
||||
if(fvi_segment_plane(&new_decal->vert[nverts], &decal_cube_plane[k][0], &decal_cube_plane[k][1], decal_point_list[decal_poly[i%nv]], decal_point_list[decal_poly[(i + 1)%nv]], 0)){
|
||||
// mprintf(("segment %d %d has an an itersection\n", i%nv, (i + 1)%nv));
|
||||
decal_point_list[nverts] = &new_decal->vert[nverts];
|
||||
// mprintf(("new decal defpoint has been added as number %d at x %0.2f y %0.2f z %0.2f\n",nverts, new_decal->vert[nverts].xyz.x, new_decal->vert[nverts].xyz.y, new_decal->vert[nverts].xyz.z));
|
||||
temp_poly[numv] = nverts++;
|
||||
// mprintf(("temp_poly point %d, should have been set to defpoint %d, it was set to %d\n",numv, nverts-1, temp_poly[numv]));
|
||||
skip = (skip+1)%2;
|
||||
// mprintf(("skip has been set to %d\n",skip));
|
||||
numv++;
|
||||
if((skip == 0)){
|
||||
// mprintf(("adding point, becase it is after an intersection point\n", (i + 1)%nv));
|
||||
temp_poly[numv] = decal_poly[(i + 1)%nv];
|
||||
numv++;
|
||||
}
|
||||
}else{
|
||||
// mprintf(("there sould have been an intersection but there wasnt"));
|
||||
}
|
||||
|
||||
}else{
|
||||
if((skip == 0)){//don't copy the first point
|
||||
// mprintf(("segment %d %d has no itersection, copying\n", i%nv, (i + 1)%nv));
|
||||
temp_poly[numv] = decal_poly[(i + 1)%nv];
|
||||
numv++;
|
||||
}else{
|
||||
// mprintf(("skipping segment %d %d becase it isn't in front of the plane\n", i%nv, (i + 1)%nv));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// mprintf(("temp poly has %d points\n", numv));
|
||||
for(int h = 0; h < numv; h++){
|
||||
decal_poly[h] = temp_poly[h];
|
||||
mprintf(("seting decal_poly point %d to %d\n",h,temp_poly[h]));
|
||||
}
|
||||
nv = numv;
|
||||
numv=0;
|
||||
// mprintf(("decal_poly now has has %d points\n", nv));
|
||||
if(nv < 3)return; //if at any time we get fewer than three points this poly is dead
|
||||
}
|
||||
|
||||
|
||||
// mprintf(("copying the poly to the decal\n"));
|
||||
//copy a triangulated version of the poly to the new decal
|
||||
if((valid == 1) && (nv > 2)){
|
||||
/* for (i=1;i<(nv-1);i++) {
|
||||
if(poly_num >= MAX_DECAL_POLY){
|
||||
mprintf(("bugging out becase there are too many polys in the decal\n"));
|
||||
return;
|
||||
}
|
||||
new_decal->poly[poly_num].point[0] = decal_poly[0];
|
||||
new_decal->poly[poly_num].point[1] = decal_poly[i];
|
||||
new_decal->poly[poly_num].point[2] = decal_poly[i+1];
|
||||
new_decal->poly[poly_num].norm = pnorm;
|
||||
if(back > 0){
|
||||
new_decal->poly[poly_num].backfaced = 0;
|
||||
}else{
|
||||
new_decal->poly[poly_num].backfaced = 1;
|
||||
}
|
||||
for (k=0;k<3;k++) {
|
||||
//calculate the UV coords
|
||||
new_decal->poly[poly_num].uv[k].u = (fvi_point_dist_plane(&decal_cube_plane[0][0], &decal_cube_plane[0][1], &new_decal->vert[new_decal->poly[poly_num].point[k]]) / (min_rad*2));
|
||||
new_decal->poly[poly_num].uv[k].v = (fvi_point_dist_plane(&decal_cube_plane[2][0], &decal_cube_plane[2][1], &new_decal->vert[new_decal->poly[poly_num].point[k]]) / (min_rad*2));
|
||||
}
|
||||
// mprintf(("decal poly %d, vert 0 being set to %d, vert 1 %d, and vert 2 %d\n", poly_num, new_decal->poly[poly_num].point[0], new_decal->poly[poly_num].point[1], new_decal->poly[poly_num].point[2]));
|
||||
poly_num++;
|
||||
}*/
|
||||
for (i=1;i<nv;i++){
|
||||
if(poly_num >= MAX_DECAL_POLY){
|
||||
mprintf(("bugging out becase there are too many polys in the decal\n"));
|
||||
return;
|
||||
}
|
||||
if(i >= MAX_DECAL_POLY_POINT){
|
||||
mprintf(("bugging out becase there are too many points in the poly\n"));
|
||||
return;
|
||||
}
|
||||
new_decal->poly[poly_num].point[i] = decal_poly[i];
|
||||
new_decal->poly[poly_num].norm = pnorm;
|
||||
if(back > 0){
|
||||
new_decal->poly[poly_num].backfaced = 0;
|
||||
}else{
|
||||
new_decal->poly[poly_num].backfaced = 1;
|
||||
}
|
||||
//calculate the UV coords
|
||||
new_decal->poly[poly_num].uv[i].u = (fvi_point_dist_plane(&decal_cube_plane[0][0], &decal_cube_plane[0][1], &new_decal->vert[new_decal->poly[poly_num].point[i]]) / (min_rad*2));
|
||||
new_decal->poly[poly_num].uv[i].v = (fvi_point_dist_plane(&decal_cube_plane[2][0], &decal_cube_plane[2][1], &new_decal->vert[new_decal->poly[poly_num].point[i]]) / (min_rad*2));
|
||||
// mprintf(("decal poly %d, vert 0 being set to %d, vert 1 %d, and vert 2 %d\n", poly_num, new_decal->poly[poly_num].point[0], new_decal->poly[poly_num].point[1], new_decal->poly[poly_num].point[2]));
|
||||
}
|
||||
poly_num++;
|
||||
}else{
|
||||
// mprintf(("no poly, all points are out side of planes"));
|
||||
}
|
||||
mprintf(("there are now %d polys in the current decal\n", poly_num));
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
int decal_create_sub(void *model_ptr )
|
||||
{
|
||||
|
||||
// mprintf(("plane 0 position is x %0.2f y %0.2f z %0.2f\n", decal_cube_plane[0][0].xyz.x, decal_cube_plane[0][0].xyz.y, decal_cube_plane[0][0].xyz.z));
|
||||
// mprintf(("plane 0 normal is x %0.2f y %0.2f z %0.2f\n", decal_cube_plane[0][1].xyz.x, decal_cube_plane[0][1].xyz.y, decal_cube_plane[0][1].xyz.z));
|
||||
|
||||
// mprintf(("entering decal_create_sub\n"));
|
||||
|
||||
ubyte *p = (ubyte *)model_ptr;
|
||||
int chunk_type, chunk_size;
|
||||
|
||||
chunk_type = dw(p);
|
||||
chunk_size = dw(p+4);
|
||||
|
||||
// mprintf(("plane 0 position is x %0.2f y %0.2f z %0.2f\n", decal_cube_plane[0][0].xyz.x, decal_cube_plane[0][0].xyz.y, decal_cube_plane[0][0].xyz.z));
|
||||
// mprintf(("plane 0 normal is x %0.2f y %0.2f z %0.2f\n", decal_cube_plane[0][1].xyz.x, decal_cube_plane[0][1].xyz.y, decal_cube_plane[0][1].xyz.z));
|
||||
|
||||
|
||||
while (chunk_type != DP_EOF) {
|
||||
|
||||
// mprintf(( "Processing chunk type %d, len=%d\n", chunk_type, chunk_size ));
|
||||
// mprintf(("plane 0 position is x %0.2f y %0.2f z %0.2f\n", decal_cube_plane[0][0].xyz.x, decal_cube_plane[0][0].xyz.y, decal_cube_plane[0][0].xyz.z));
|
||||
// mprintf(("plane 0 normal is x %0.2f y %0.2f z %0.2f\n", decal_cube_plane[0][1].xyz.x, decal_cube_plane[0][1].xyz.y, decal_cube_plane[0][1].xyz.z));
|
||||
|
||||
|
||||
switch (chunk_type) {
|
||||
case DP_EOF: return 1;
|
||||
case DP_DEFPOINTS: decal_create_defpoints(p); break;
|
||||
case DP_FLATPOLY: break;// I don't want any of these anyway-Bobboau decal_create_flatpoly(p); break;
|
||||
case DP_TMAPPOLY: decal_create_tmappoly(p); break;
|
||||
case DP_SORTNORM: decal_create_sortnorm(p); break;
|
||||
case DP_BOUNDBOX:
|
||||
/* if (!mc_ray_boundingbox( vp(p+8), vp(p+20), &Mc_p0, &Mc_direction, NULL )) {
|
||||
return 1;
|
||||
}*/
|
||||
break;
|
||||
default:
|
||||
mprintf(( "Bad chunk type %d, len=%d in decal_create_sub\n", chunk_type, chunk_size ));
|
||||
Int3(); // Bad chunk type!
|
||||
return 0;
|
||||
}
|
||||
// mprintf(( "current chunk offset %d\n", (int)p ));
|
||||
|
||||
p += chunk_size;
|
||||
chunk_type = dw(p);
|
||||
chunk_size = dw(p+4);
|
||||
}
|
||||
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
int decal_make_model(polymodel * pm){
|
||||
|
||||
return 1;
|
||||
}
|
||||
/*
|
||||
void decal_render_all(object * obj){
|
||||
|
||||
if(obj->type != OBJ_SHIP){
|
||||
return;
|
||||
}
|
||||
|
||||
vertex vecs[3];
|
||||
vertex *vlist[3] = { &vecs[0], &vecs[1], &vecs[2] };
|
||||
|
||||
// mprintf(("about to render all decals\n"));
|
||||
|
||||
ship *shipp = &Ships[obj->instance];
|
||||
|
||||
for(int h = 0; h < MAX_SHIP_DECALS; h++){
|
||||
decal *dec = &shipp->decals[h];
|
||||
if(dec->is_valid){
|
||||
mprintf(("decal %d is valid, and has %d polys\n",h,dec->n_poly));
|
||||
for(int i = 0; i<dec->n_poly; i++){
|
||||
|
||||
mprintf(("drawing decal poly %d, with bitmap %d\n", i, dec->texture));
|
||||
gr_set_bitmap(dec->texture, 0, GR_BITBLT_MODE_NORMAL, 1.0f );
|
||||
if((dec->poly[i].backfaced == 1) && (dec->backfaced_texture)){
|
||||
gr_set_bitmap(dec->backfaced_texture, 0, GR_BITBLT_MODE_NORMAL, 1.0f );
|
||||
}
|
||||
|
||||
for( int j = 0; j < 3; j++){
|
||||
// vecs[j] = dec->vert[i][j];
|
||||
// vector pos;
|
||||
// vm_vert2vec(&vecs[j], &pos);
|
||||
// vm_vec_add2(&pos, &obj->pos);
|
||||
g3_rotate_vertex(&vecs[j], &dec->vert[dec->poly[i].point[j]]);
|
||||
g3_project_vertex(&vecs[j]);
|
||||
vecs[j].u = dec->poly[i].uv[j].u;
|
||||
vecs[j].v = dec->poly[i].uv[j].v;
|
||||
mprintf(("vert %d at x %0.2f y %0.2f z %0.2f u %0.2f v %0.2f\n", j, vecs[j].x, vecs[j].y, vecs[j].z, vecs[j].u, vecs[j].v));
|
||||
|
||||
}
|
||||
|
||||
gr_set_cull(0);
|
||||
g3_draw_poly(3, vlist, TMAP_FLAG_TEXTURED | TMAP_FLAG_CORRECT );
|
||||
gr_set_cull(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
// mprintf(("decals rendered\n"));
|
||||
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
void decal_render_all(object * obj){
|
||||
#ifdef DECALS_ENABLED
|
||||
if(obj->type != OBJ_SHIP){
|
||||
return;
|
||||
}
|
||||
|
||||
vertex vecs[3];
|
||||
vertex *vlist[3] = { &vecs[0], &vecs[1], &vecs[2] };
|
||||
|
||||
// mprintf(("about to render all decals\n"));
|
||||
|
||||
ship *shipp = &Ships[obj->instance];
|
||||
polymodel *pm = model_get( shipp->modelnum );
|
||||
|
||||
for(int h = 0; h < MAX_SHIP_DECALS; h++){
|
||||
decal *dec = &shipp->decals[h];
|
||||
if(dec->is_valid){
|
||||
mprintf(("decal %d is valid, and has %d polys\n",h,dec->n_poly));
|
||||
// vector g_pos;
|
||||
// vm_vec_add(&g_pos, &dec->position, &obj->pos);
|
||||
float dist = vm_vec_dist(&dec->position, &View_position);
|
||||
if(dist < (dec->radius*10)){
|
||||
mprintf(("decal %d too far away to be drawn %0.2f\n", h, dist));
|
||||
// HUD_printf("decal %d too far away to be drawn %0.2f\n", h, dist);
|
||||
continue;
|
||||
}
|
||||
for(int i = 0; i<dec->n_poly; i++){
|
||||
|
||||
// if((pm->submodel[dec->submodel_parent].blown_off != 0) && (dec->submodel_parent > 0))continue;
|
||||
|
||||
for( int j = 0; j < 3; j++){
|
||||
// vecs[j] = dec->vert[i][j];
|
||||
// vector pos;
|
||||
// vm_vert2vec(&vecs[j], &pos);
|
||||
// vm_vec_add2(&pos, &obj->pos);
|
||||
if(dec->poly[i].point[j]<0 || dec->poly[i].point[j]>1000)break;
|
||||
vector pnt = dec->vert[dec->poly[i].point[j]];
|
||||
if(dec->submodel_parent != pm->detail[0]){
|
||||
matrix m;
|
||||
angles angs = pm->submodel[dec->submodel_parent].angs;
|
||||
angs.b = PI2 - angs.b;
|
||||
angs.p = PI2 - angs.p;
|
||||
angs.h = PI2 - angs.h;
|
||||
mprintf(("decal is child of a submodel, who's angles are b %0.2f p %0.2f h %0.2f, it should be rotateing with it\n", angs.b, angs.p, angs.h));
|
||||
|
||||
vector offset = pm->submodel[dec->submodel_parent].offset;
|
||||
vm_angles_2_matrix(&m, &angs);
|
||||
|
||||
vector p = pnt;
|
||||
vm_vec_rotate(&pnt, &p, &m);
|
||||
|
||||
vm_vec_add2(&pnt, &offset);
|
||||
}
|
||||
|
||||
g3_rotate_vertex(&vecs[j], &pnt);
|
||||
g3_project_vertex(&vecs[j]);
|
||||
vecs[j].u = dec->poly[i].uv[j].u;
|
||||
vecs[j].v = dec->poly[i].uv[j].v;
|
||||
mprintf(("vert %d at x %0.2f y %0.2f z %0.2f u %0.2f v %0.2f\n", j, vecs[j].x, vecs[j].y, vecs[j].z, vecs[j].u, vecs[j].v));
|
||||
/*
|
||||
if ( D3D_enabled ) {
|
||||
light_apply_rgb( &vlist[j]->r, &vlist[j]->g, &vlist[j]->b, &pnt, &dec->poly[i].norm, 0 );
|
||||
} else {
|
||||
vlist[j]->b = light_apply( &pnt, &dec->poly[i].norm, 0 );
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
if(dec->poly[i].point[j]<0 || dec->poly[i].point[j]>1000)break;
|
||||
|
||||
gr_set_bitmap(dec->texture, 0, GR_BITBLT_MODE_NORMAL, 1.0f );
|
||||
if((dec->poly[i].backfaced == 1) && (dec->backfaced_texture > -1)){
|
||||
gr_set_bitmap(dec->backfaced_texture, 0, GR_BITBLT_MODE_NORMAL, 1.0f );
|
||||
mprintf(("drawing decal poly %d, with bitmap %d\n", i, dec->backfaced_texture));
|
||||
}else{
|
||||
mprintf(("drawing decal poly %d, with bitmap %d\n", i, dec->texture));
|
||||
}
|
||||
|
||||
// gr_set_cull(0);
|
||||
g3_draw_poly(3, vlist, TMAP_FLAG_TEXTURED | TMAP_FLAG_CORRECT | TMAP_FLAG_RGB | TMAP_FLAG_GOURAUD );
|
||||
// gr_set_cull(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
// mprintf(("decals rendered\n"));
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
//header file for makeing decals-Bobboau
|
||||
|
||||
#ifndef _DECAL_H
|
||||
#define _DECAL_H
|
||||
|
||||
#define MAX_DECAL_POLY 20
|
||||
#define MAX_DECAL_POLY_POINT 10
|
||||
#define MAX_DECAL_DEFPOINTS 1000
|
||||
#define MAX_DECAL_POINT 10
|
||||
#define MAX_SHIP_DECALS 25
|
||||
#include "globalincs/pstypes.h"
|
||||
#include "object/object.h"
|
||||
|
||||
#define DP_EOF 0
|
||||
#define DP_DEFPOINTS 1
|
||||
#define DP_FLATPOLY 2
|
||||
#define DP_TMAPPOLY 3
|
||||
#define DP_SORTNORM 4
|
||||
#define DP_BOUNDBOX 5
|
||||
|
||||
typedef struct decal_model{ //this will store a triangulated version of the ships polygons
|
||||
struct{
|
||||
int point[3]; //an index to the vert list-Bobboau
|
||||
vector center; //the center of the poly
|
||||
float radius; //the max radius of the poly
|
||||
}poly[MAX_DECAL_POLY];
|
||||
vector vert[MAX_DECAL_DEFPOINTS]; //the defpoints-Bobboau
|
||||
int n_polys;
|
||||
}decal_model;
|
||||
|
||||
//extern decal_model d_model;
|
||||
|
||||
typedef struct decal{
|
||||
struct{
|
||||
int backfaced; //flag that this poly uses the backfaced texture
|
||||
uv_pair uv[MAX_DECAL_POLY_POINT]; //uv coordanants
|
||||
int point[MAX_DECAL_POLY_POINT]; //an index to the vert list-Bobboau
|
||||
int n_poly;
|
||||
vector norm; //the normal used for lighting
|
||||
}poly[MAX_DECAL_POLY];
|
||||
vector position;
|
||||
float radius;
|
||||
int submodel_parent; //the submodel this is part of
|
||||
vector vert[1000]; //the defpoints-Bobboau
|
||||
int frames; //number of frames in an animation
|
||||
int fps; //frames per second
|
||||
int starting_keyframe; //the frame that indicates the end of the inital nonlooped portion and the start of the middle looped part
|
||||
int ending_keyframe; //the frame that indicates the end of the loopable portion and the start of the end part
|
||||
int texture; //the texture to be used, first in animation
|
||||
int backfaced_texture; //the texture to be used by backfaced polys, first in animation
|
||||
int is_valid; //this means it is a good decal that should be rendered-Bobboau
|
||||
int n_poly; //the number of polys
|
||||
int timestamp; //this is when the decal was made-Bobboau
|
||||
int lifetime; //this is how long the decal should be alive for-Bobboau
|
||||
int importance; //this is for big things large beam marks and bomb craters should last longer than the odd laser impacts-Bobboau
|
||||
int state; //1 starting, 2 looping(mostly for beams), 3 ending, 4 static
|
||||
}decal;
|
||||
|
||||
typedef struct decal_point{
|
||||
vector pnt;
|
||||
matrix orient;
|
||||
float radius;
|
||||
}decal_point;
|
||||
|
||||
int decal_create(object * obj, decal_point *point, int subobject, int texture, int backfaced_texture = -1);//makes the decal
|
||||
|
||||
#endif
|
||||
|
||||
int decal_create_simple(object * obj, decal_point *point, int texture);//makes a simple non-clipped decal
|
||||
|
||||
void decal_render_all(object * obj); //renders all decals
|
||||
|
||||
int decal_create(object * obj, decal_point *point, int subobject, int texture, int backfaced_texture);//makes the decal
|
||||
|
||||
int decal_create_sub(void *model_ptr);
|
||||
|
||||
/*
|
||||
|
||||
int decal_is_in_face(int n, vertex vertlist[n]);//sees if a poly is inside a decal: 0 is yes, 1 is sort of, -1 is no
|
||||
*/
|
||||
Binary file not shown.
@@ -0,0 +1,240 @@
|
||||
#include <dshow.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "osapi/osapi.h"
|
||||
#include "dx8show.h"
|
||||
#include "debugconsole/dbugfile.h"
|
||||
|
||||
//
|
||||
// Constants
|
||||
//
|
||||
const int KEYBOARD_SAMPLE_FREQ = 200; // Sample user input on an interval
|
||||
|
||||
//
|
||||
// Globals
|
||||
//
|
||||
IGraphBuilder *pGB = NULL;
|
||||
IMediaControl *pMC = NULL;
|
||||
IVideoWindow *pVW = NULL;
|
||||
IMediaEvent *pME = NULL;
|
||||
|
||||
//
|
||||
// Function prototypes
|
||||
//
|
||||
HRESULT get_interfaces(void);
|
||||
bool play_media(LPTSTR movie_filename);
|
||||
bool set_fullscreen(void);
|
||||
void cleanup_interfaces(void);
|
||||
|
||||
HWND internal_hwnd = NULL;
|
||||
|
||||
// This define, 0 by default, if set to 1 will run window binding code which currently
|
||||
// doesnt work, left in for fun
|
||||
#define VIS_CODE 0
|
||||
//
|
||||
// Helper Macros (Jump-If-Failed, Log-If-Failed)
|
||||
//
|
||||
#define RUN_FUNCTION_ROF(x) if(FAILED(hr=(x))) \
|
||||
{DBUGFILE_OUTPUT_0("FAILED in " #x); return false;}
|
||||
|
||||
#define RUN_FUNCTION_GET_INTERFACE(x) if(FAILED(hr=(x))) \
|
||||
{DBUGFILE_OUTPUT_0("FAILED " #x); cleanup_interfaces(); return hr;}
|
||||
|
||||
#define RUN_FUNCTION(x) if(FAILED(hr=(x))) \
|
||||
{DBUGFILE_OUTPUT_0("FAILED " #x);}
|
||||
|
||||
#define RELEASE(i) {if (i) i->Release(); i = NULL;}
|
||||
|
||||
void process_messages(HWND hwnd)
|
||||
{
|
||||
MSG msg;
|
||||
while(PeekMessage(&msg, hwnd, 0, 0, PM_REMOVE))
|
||||
{
|
||||
TranslateMessage(&msg);
|
||||
DispatchMessage(&msg);
|
||||
}
|
||||
}
|
||||
|
||||
void dx8show_set_hwnd(void *hwnd)
|
||||
{
|
||||
internal_hwnd = (HWND) hwnd;
|
||||
}
|
||||
|
||||
bool dx8show_play_cutscene(char *movie_file)
|
||||
{
|
||||
HRESULT hr;
|
||||
|
||||
// Initialize COM
|
||||
RUN_FUNCTION_ROF(CoInitialize(NULL));
|
||||
|
||||
// Get DirectShow interfaces
|
||||
RUN_FUNCTION_ROF(get_interfaces());
|
||||
|
||||
if(internal_hwnd == NULL)
|
||||
{
|
||||
internal_hwnd = (HWND) os_get_window();
|
||||
}
|
||||
|
||||
#if VIS_CODE
|
||||
RUN_FUNCTION(pVW->put_Visible(OATRUE));
|
||||
RUN_FUNCTION(pVW->put_Owner((OAHWND) internal_hwnd));
|
||||
#endif
|
||||
|
||||
// Play the movie / cutscene
|
||||
play_media(movie_file);
|
||||
|
||||
#if VIS_CODE
|
||||
RUN_FUNCTION(pVW->put_Visible(OAFALSE));
|
||||
RUN_FUNCTION(pVW->put_Owner(NULL));
|
||||
#endif
|
||||
|
||||
// Release DirectShow interfaces
|
||||
cleanup_interfaces();
|
||||
CoUninitialize();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
HRESULT get_interfaces(void)
|
||||
{
|
||||
HRESULT hr = S_OK;
|
||||
|
||||
// Instantiate filter graph interface
|
||||
RUN_FUNCTION_GET_INTERFACE(CoCreateInstance(CLSID_FilterGraph, NULL, CLSCTX_INPROC, IID_IGraphBuilder, (void **) &pGB));
|
||||
// Get interfaces to control playback & screensize
|
||||
RUN_FUNCTION_GET_INTERFACE(pGB->QueryInterface(IID_IMediaControl, (void **) &pMC));
|
||||
RUN_FUNCTION_GET_INTERFACE(pGB->QueryInterface(IID_IVideoWindow, (void **) &pVW));
|
||||
|
||||
// Get interface to allow the app to wait for completion of playback
|
||||
RUN_FUNCTION_GET_INTERFACE(pGB->QueryInterface(IID_IMediaEventEx, (void **)&pME));
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
||||
void cleanup_interfaces(void)
|
||||
{
|
||||
// Release the DirectShow interfaces
|
||||
RELEASE(pMC);
|
||||
RELEASE(pVW);
|
||||
RELEASE(pME);
|
||||
RELEASE(pGB);
|
||||
}
|
||||
|
||||
bool play_media(LPTSTR movie_filename)
|
||||
{
|
||||
HRESULT hr;
|
||||
WCHAR file_name[MAX_PATH];
|
||||
|
||||
#ifndef UNICODE
|
||||
MultiByteToWideChar(CP_ACP, 0, movie_filename, -1, file_name, MAX_PATH);
|
||||
#else
|
||||
lstrcpy(file_name, movie_filename);
|
||||
#endif
|
||||
|
||||
// Allow DirectShow to create the FilterGraph for this media file
|
||||
RUN_FUNCTION_ROF(pGB->RenderFile(file_name, NULL));
|
||||
|
||||
// Set the message drain of the video window to point to our hidden application window. This allows
|
||||
// keyboard input to be transferred to our main window for processing.
|
||||
//
|
||||
// If this is an audio-only or MIDI file, then put_MessageDrain will fail.
|
||||
//
|
||||
RUN_FUNCTION(pVW->put_MessageDrain((OAHWND) internal_hwnd));
|
||||
|
||||
if(set_fullscreen() == false)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// Display first frame of the movie and play
|
||||
RUN_FUNCTION_ROF(pMC->Pause());
|
||||
RUN_FUNCTION_ROF(pMC->Run());
|
||||
|
||||
// Update state variables
|
||||
bool movie_continue = true;
|
||||
|
||||
// Enter a loop of checking for events and sampling keyboard input
|
||||
while (movie_continue)
|
||||
{
|
||||
long event_code, param1, param2;
|
||||
|
||||
// Has there been a media event? Look for end of stream condition.
|
||||
if(E_ABORT != pME->GetEvent(&event_code, ¶m1, ¶m2, 0))
|
||||
{
|
||||
// Is this the end of the movie?
|
||||
if (event_code == EC_COMPLETE)
|
||||
{
|
||||
movie_continue = false;
|
||||
}
|
||||
|
||||
// Free the media event resources.
|
||||
RUN_FUNCTION(pME->FreeEventParams(event_code, param1, param2));
|
||||
}
|
||||
|
||||
|
||||
// Give system threads time to run (and don't sample user input madly)
|
||||
Sleep(KEYBOARD_SAMPLE_FREQ);
|
||||
|
||||
MSG msg;
|
||||
// Quits movie if escape, space or return is pressed
|
||||
while(PeekMessage(&msg, internal_hwnd, 0, 0, PM_REMOVE))
|
||||
{
|
||||
TranslateMessage(&msg);
|
||||
|
||||
if(msg.message != WM_KEYDOWN)
|
||||
{
|
||||
DispatchMessage(&msg);
|
||||
continue;
|
||||
}
|
||||
|
||||
switch(msg.wParam )
|
||||
{
|
||||
case VK_ESCAPE:
|
||||
case VK_SPACE:
|
||||
case VK_RETURN:
|
||||
{
|
||||
DBUGFILE_OUTPUT_0("User skipped cut scene");
|
||||
movie_continue = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool set_fullscreen(void)
|
||||
{
|
||||
HRESULT hr;
|
||||
LONG mode;
|
||||
HWND drain=0;
|
||||
|
||||
if (!pVW)
|
||||
{
|
||||
return S_FALSE;
|
||||
}
|
||||
|
||||
// Read current state
|
||||
RUN_FUNCTION_ROF(pVW->get_FullScreenMode(&mode));
|
||||
|
||||
if (mode == OAFALSE)
|
||||
{
|
||||
// Save current message drain
|
||||
RUN_FUNCTION_ROF(pVW->get_MessageDrain((OAHWND *) &drain));
|
||||
|
||||
// This is very important. It ensures that the video window doesnt end
|
||||
// up playing behind the main window
|
||||
SetFocus(drain);
|
||||
|
||||
// Set message drain to application main window
|
||||
RUN_FUNCTION_ROF(pVW->put_MessageDrain((OAHWND) internal_hwnd));
|
||||
|
||||
// Switch to full-screen mode
|
||||
mode = OATRUE;
|
||||
|
||||
RUN_FUNCTION_ROF(pVW->put_FullScreenMode(mode));
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
#ifndef _DX8SHOW_HEADER_FILE
|
||||
#define _DX8SHOW_HEADER_FILE
|
||||
|
||||
bool dx8show_play_cutscene(char *filename);
|
||||
void dx8show_set_hwnd(void *hwnd);
|
||||
|
||||
#endif
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -9,13 +9,16 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/ExceptionHandler/ExceptionHandler.cpp $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:22 $
|
||||
* $Revision: 2.1 $
|
||||
* $Date: 2003-03-02 05:10:42 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
* Main file for dealing with exception handling
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.0 2002/06/03 04:02:22 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
* Revision 1.1 2002/05/02 18:03:05 mharris
|
||||
* Initial checkin - converted filenames and includes to lower case
|
||||
*
|
||||
@@ -139,7 +142,9 @@ static void PrintTime(char *output, FILETIME TimeToPrint)
|
||||
static void ShowModuleInfo(HANDLE LogFile, HINSTANCE ModuleHandle)
|
||||
{
|
||||
char ModName[MAX_PATH];
|
||||
#ifdef _MSC_VER
|
||||
__try {
|
||||
#endif
|
||||
if (GetModuleFileName(ModuleHandle, ModName, sizeof(ModName)) > 0) {
|
||||
// If GetModuleFileName returns greater than zero then this must
|
||||
// be a valid code module address. Therefore we can try to walk
|
||||
@@ -174,11 +179,13 @@ static void ShowModuleInfo(HANDLE LogFile, HINSTANCE ModuleHandle)
|
||||
ModName, ModuleHandle, FileSize,
|
||||
NTHeader->FileHeader.TimeDateStamp, TimeBuffer);
|
||||
}
|
||||
#ifdef _MSC_VER
|
||||
}
|
||||
// Handle any exceptions by continuing from this point.
|
||||
__except(EXCEPTION_EXECUTE_HANDLER)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
// Scan memory looking for code modules (DLLs or EXEs). VirtualQuery is used
|
||||
@@ -436,15 +443,19 @@ int __cdecl RecordExceptionInfo(PEXCEPTION_POINTERS data, const char *Message)
|
||||
// exception handler will print '??'.
|
||||
unsigned char *code = (unsigned char*)Context->Eip;
|
||||
for (int codebyte = 0; codebyte < NumCodeBytes; codebyte++) {
|
||||
#ifdef _MSC_VER
|
||||
__try {
|
||||
#endif
|
||||
hprintf(LogFile, "%02x ", code[codebyte]);
|
||||
|
||||
#ifdef _MSC_VER
|
||||
}
|
||||
__except(EXCEPTION_EXECUTE_HANDLER) {
|
||||
hprintf(LogFile, "?? ");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef _MSC_VER
|
||||
// Time to print part or all of the stack to the error log. This allows
|
||||
// us to figure out the call stack, parameters, local variables, etc.
|
||||
hprintf(LogFile, "\r\n"
|
||||
@@ -500,6 +511,7 @@ int __cdecl RecordExceptionInfo(PEXCEPTION_POINTERS data, const char *Message)
|
||||
__except(EXCEPTION_EXECUTE_HANDLER) {
|
||||
hprintf(LogFile, "Exception encountered during stack dump.\r\n");
|
||||
}
|
||||
#endif
|
||||
|
||||
RecordModuleList(LogFile);
|
||||
|
||||
|
||||
@@ -9,13 +9,21 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Fireball/FireBalls.cpp $
|
||||
* $Revision: 2.1 $
|
||||
* $Date: 2002-08-01 01:41:04 $
|
||||
* $Author: penguin $
|
||||
* $Revision: 2.3 $
|
||||
* $Date: 2002-12-07 01:37:41 $
|
||||
* $Author: bobboau $
|
||||
*
|
||||
* Code to move, render and otherwise deal with fireballs.
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.2 2002/11/14 04:18:16 bobboau
|
||||
* added warp model and type 1 glow points
|
||||
* and well as made the new glow file type,
|
||||
* some general improvement to fighter beams,
|
||||
*
|
||||
* Revision 2.1 2002/08/01 01:41:04 penguin
|
||||
* The big include file move
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:22 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
@@ -343,7 +351,9 @@
|
||||
#include "gamesnd/gamesnd.h"
|
||||
#include "localization/localize.h"
|
||||
|
||||
#define WARPHOLE_GROW_TIME (1.5f) // time for warphole to reach max size (also time to shrink to nothing once it begins to shrink)
|
||||
int wm;
|
||||
|
||||
#define WARPHOLE_GROW_TIME (3.5f) // time for warphole to reach max size (also time to shrink to nothing once it begins to shrink)
|
||||
|
||||
#define MAX_FIREBALL_LOD 4
|
||||
|
||||
@@ -508,7 +518,9 @@ void fireball_load_data()
|
||||
|
||||
if ( Warp_glow_bitmap == -1 ) {
|
||||
Warp_glow_bitmap = bm_load( NOX("warpglow01") );
|
||||
}
|
||||
}
|
||||
|
||||
// polymodel Warp_pm;
|
||||
|
||||
}
|
||||
|
||||
@@ -537,6 +549,11 @@ void fireball_init()
|
||||
Fireballs[i].objnum = -1;
|
||||
}
|
||||
|
||||
mprintf(("loading warp model"));
|
||||
wm = -1;
|
||||
wm = model_load("warp.pof", 0, NULL, 0);
|
||||
mprintf((" %d\n", wm));
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -630,6 +647,7 @@ void fireball_render(object * obj)
|
||||
//rad = (fb->total_time - t )*obj->radius/WARPHOLE_GROW_TIME;
|
||||
}
|
||||
//rad = obj->radius;
|
||||
// obj->alt_rad = rad;
|
||||
|
||||
|
||||
warpin_render(&obj->orient, &obj->pos, Fireballs[num].current_bitmap, rad, percent_life, obj->radius );
|
||||
|
||||
@@ -5,17 +5,25 @@
|
||||
* or otherwise commercially exploit the source or things you created based on the
|
||||
* source.
|
||||
*
|
||||
*/
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Fireball/FireBalls.h $
|
||||
* $Revision: 2.1 $
|
||||
* $Date: 2002-08-01 01:41:04 $
|
||||
* $Revision: 2.3 $
|
||||
* $Date: 2003-03-02 05:12:39 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
* Prototypes for fireball functions
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.2 2002/11/14 04:18:16 bobboau
|
||||
* added warp model and type 1 glow points
|
||||
* and well as made the new glow file type,
|
||||
* some general improvement to fighter beams,
|
||||
*
|
||||
* Revision 2.1 2002/08/01 01:41:04 penguin
|
||||
* The big include file move
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:22 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
@@ -206,4 +214,6 @@ float fireball_lifeleft_percent( object *obj );
|
||||
extern void warpin_render(matrix *orient, vector *pos, int texture_bitmap_num, float radius, float life_percent, float max_radius );
|
||||
extern int Warp_glow_bitmap; // Internal
|
||||
|
||||
extern int wm;
|
||||
|
||||
#endif /* _FIREBALLS_H */
|
||||
@@ -7,15 +7,23 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Fireball/WarpInEffect.cpp $
|
||||
* $Revision: 2.1 $
|
||||
* $Date: 2002-08-01 01:41:04 $
|
||||
* $Author: penguin $
|
||||
* $Revision: 2.3 $
|
||||
* $Date: 2003-01-05 23:41:50 $
|
||||
* $Author: bobboau $
|
||||
*
|
||||
* Code for rendering the warp in effects for ships
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.2 2002/11/14 04:18:16 bobboau
|
||||
* added warp model and type 1 glow points
|
||||
* and well as made the new glow file type,
|
||||
* some general improvement to fighter beams,
|
||||
*
|
||||
* Revision 2.1 2002/08/01 01:41:04 penguin
|
||||
* The big include file move
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:22 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
@@ -135,6 +143,9 @@
|
||||
#include "fireball/fireballs.h"
|
||||
#include "globalincs/linklist.h"
|
||||
#include "io/timer.h"
|
||||
#include "Weapon/Beam.h"
|
||||
|
||||
extern int wm;
|
||||
|
||||
DCF(norm,"normalize a zero length vector")
|
||||
{
|
||||
@@ -164,15 +175,19 @@ void draw_face( vertex *v1, vertex *v2, vertex *v3 )
|
||||
|
||||
}
|
||||
|
||||
#define wSTUFF_VERTICES() do { verts[0]->u = 0.5f; verts[0]->v = 0.0f; verts[1]->u = 1.0f; verts[1]->v = 0.0f; verts[2]->u = 1.0f; verts[2]->v = 1.0f; verts[3]->u = 0.5f; verts[3]->v = 1.0f; } while(0);
|
||||
#define wR_VERTICES() do { g3_rotate_vertex(verts[0], &bottom1); g3_rotate_vertex(verts[1], &bottom2); g3_rotate_vertex(verts[2], &top2); g3_rotate_vertex(verts[3], &top1); } while(0);
|
||||
#define wP_VERTICES() do { for(idx=0; idx<4; idx++){ g3_project_vertex(verts[idx]); } } while(0);
|
||||
|
||||
void warpin_render(matrix *orient, vector *pos, int texture_bitmap_num, float radius, float life_percent, float max_radius )
|
||||
{
|
||||
|
||||
int i;
|
||||
|
||||
int saved_gr_zbuffering = gr_zbuffer_get();
|
||||
|
||||
// gr_zbuffering = 0;
|
||||
|
||||
gr_set_bitmap( texture_bitmap_num, GR_ALPHABLEND_FILTER, GR_BITBLT_MODE_NORMAL, 1.0f );
|
||||
|
||||
float Grid_depth = radius/2.5f;
|
||||
|
||||
@@ -180,43 +195,109 @@ void warpin_render(matrix *orient, vector *pos, int texture_bitmap_num, float ra
|
||||
|
||||
vm_vec_scale_add( ¢er, pos, &orient->vec.fvec, -(max_radius/2.5f)/3.0f );
|
||||
|
||||
// Warp_Map = texture_bitmap_num;//sets the warp map, and thus sets the interp flag for this being a warpin effect
|
||||
vector vecs[5];
|
||||
vertex verts[5];
|
||||
|
||||
vm_vec_scale_add( &vecs[0], ¢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 );
|
||||
if(wm > -1){
|
||||
float model_Interp_scale_x = radius /20;
|
||||
float model_Interp_scale_y = radius /20;
|
||||
float model_Interp_scale_z = max_radius /20;
|
||||
|
||||
vm_vec_scale_add( &vecs[1], ¢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 );
|
||||
set_warp_gloabals(model_Interp_scale_x, model_Interp_scale_y, model_Interp_scale_z, texture_bitmap_num, (radius/max_radius) );
|
||||
|
||||
float dist = vm_vec_dist_quick( pos, &Eye_position );
|
||||
|
||||
vm_vec_scale_add( &vecs[2], ¢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 );
|
||||
model_set_detail_level((int)(dist / (radius * 10.0f)));
|
||||
gr_set_cull(0);
|
||||
model_render( wm, orient, pos, MR_NO_LIGHTING | MR_NORMAL);
|
||||
gr_set_cull(1);
|
||||
|
||||
vm_vec_scale_add( &vecs[3], ¢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 );
|
||||
// Warp_Map = -1;//un sets the warp map
|
||||
|
||||
// vm_vec_scale_add( &vecs[4], ¢er, &orient->vec.fvec, -Grid_depth );
|
||||
vecs[4] = center;
|
||||
model_Interp_scale_x = 1.0f;
|
||||
model_Interp_scale_y = 1.0f;
|
||||
model_Interp_scale_z = 1.0f;
|
||||
|
||||
set_warp_gloabals(model_Interp_scale_x, model_Interp_scale_y, model_Interp_scale_z, -1, 0.0f);
|
||||
|
||||
gr_set_cull(0);
|
||||
/*
|
||||
//this is that half done effect that was pissing people off-Bobboau
|
||||
matrix m;
|
||||
vector ray_dir;
|
||||
vm_vector_2_matrix(&m, &orient->vec.fvec, NULL, NULL);//this is the beam things that will come outof the point-Bobboau
|
||||
float angle = ANG_TO_RAD(135.0f);
|
||||
if(life_percent < 0.2f){
|
||||
angle = ANG_TO_RAD(135.0f * (life_percent * 5.0f));
|
||||
}
|
||||
for(int idx=0; idx<1; idx++){
|
||||
vm_vec_random_cone(&ray_dir, &orient->vec.fvec, angle, &m);
|
||||
mprintf(( "ray direction %f %f %f, orentation %f %f %f, angle %f\n",ray_dir.xyz.x, ray_dir.xyz.y, ray_dir.xyz.z, orient->vec.fvec.xyz.x, orient->vec.fvec.xyz.y, orient->vec.fvec.xyz.z, angle));
|
||||
vector p_temp = *pos;
|
||||
vm_vec_scale_add(&p_temp, pos, &ray_dir, (max_radius * 10 * frand_range(0.75f, 0.9f)));
|
||||
mprintf(( "end %f %f %f",p_temp.xyz.x, p_temp.xyz.y, p_temp.xyz.z));
|
||||
|
||||
verts[0].u = 0.01f; verts[0].v = 0.01f;
|
||||
verts[1].u = 0.99f; verts[1].v = 0.01f;
|
||||
verts[2].u = 0.99f; verts[2].v = 0.99f;
|
||||
verts[3].u = 0.01f; verts[3].v = 0.99f;
|
||||
verts[4].u = 0.5f; verts[4].v = 0.5f;
|
||||
vertex h1[4]; // halves of a beam section
|
||||
vertex *verts[4] = { &h1[0], &h1[1], &h1[2], &h1[3] };
|
||||
vector top1, bottom1, top2, bottom2;
|
||||
|
||||
for (i=0; i<5; i++ ) {
|
||||
g3_rotate_vertex( &verts[i], &vecs[i] );
|
||||
beam_calc_facing_pts(&top1, &bottom1, &ray_dir, pos, 1.0f, 1.0f);
|
||||
beam_calc_facing_pts(&top2, &bottom2, &ray_dir, &p_temp, 1.0f, 1.0f);
|
||||
|
||||
mprintf(( "top1 %f %f %f, botom1 %f %f %f, \n",top1.xyz.x, top1.xyz.y, top1.xyz.z, bottom1.xyz.x, bottom1.xyz.y, bottom1.xyz.z));
|
||||
mprintf(( "top2 %f %f %f, botom2 %f %f %f, \n",top2.xyz.x, top2.xyz.y, top2.xyz.z, bottom2.xyz.x, bottom2.xyz.y, bottom2.xyz.z));
|
||||
wR_VERTICES(); // rotate and project the vertices
|
||||
wP_VERTICES();
|
||||
wSTUFF_VERTICES(); // stuff the beam with creamy goodness (texture coords)
|
||||
|
||||
gr_set_bitmap(Warp_glow_bitmap, GR_ALPHABLEND_FILTER, GR_BITBLT_MODE_NORMAL, 0.9999f);
|
||||
g3_draw_poly( 4, verts, TMAP_FLAG_TILED | TMAP_FLAG_TEXTURED | TMAP_FLAG_CORRECT); // added TMAP_FLAG_TILED flag for beam texture tileing -Bobboau
|
||||
}
|
||||
*/
|
||||
gr_set_cull(1);
|
||||
|
||||
vecs[4] = center; //this is for the warp glow-Bobboau
|
||||
verts[4].u = 0.5f; verts[4].v = 0.5f;
|
||||
g3_rotate_vertex( &verts[4], &vecs[4] );
|
||||
|
||||
}else{
|
||||
gr_set_bitmap( texture_bitmap_num, GR_ALPHABLEND_FILTER, GR_BITBLT_MODE_NORMAL, 1.0f );
|
||||
|
||||
vm_vec_scale_add( &vecs[0], ¢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->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->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->vec.uvec, -radius );
|
||||
vm_vec_scale_add2( &vecs[3], &orient->vec.rvec, -radius );
|
||||
vm_vec_scale_add2( &vecs[3], &orient->vec.fvec, Grid_depth );
|
||||
|
||||
// vm_vec_scale_add( &vecs[4], ¢er, &orient->vec.fvec, -Grid_depth );
|
||||
vecs[4] = center;
|
||||
|
||||
verts[0].u = 0.01f; verts[0].v = 0.01f;
|
||||
verts[1].u = 0.99f; verts[1].v = 0.01f;
|
||||
verts[2].u = 0.99f; verts[2].v = 0.99f;
|
||||
verts[3].u = 0.01f; verts[3].v = 0.99f;
|
||||
verts[4].u = 0.5f; verts[4].v = 0.5f;
|
||||
|
||||
for (i=0; i<5; i++ ) {
|
||||
g3_rotate_vertex( &verts[i], &vecs[i] );
|
||||
}
|
||||
|
||||
draw_face( &verts[0], &verts[4], &verts[1] );
|
||||
draw_face( &verts[1], &verts[4], &verts[2] );
|
||||
draw_face( &verts[4], &verts[3], &verts[2] );
|
||||
draw_face( &verts[0], &verts[3], &verts[4] );
|
||||
}
|
||||
|
||||
draw_face( &verts[0], &verts[4], &verts[1] );
|
||||
draw_face( &verts[1], &verts[4], &verts[2] );
|
||||
draw_face( &verts[4], &verts[3], &verts[2] );
|
||||
draw_face( &verts[0], &verts[3], &verts[4] );
|
||||
|
||||
if ( Warp_glow_bitmap != -1 ) {
|
||||
gr_set_bitmap( Warp_glow_bitmap, GR_ALPHABLEND_FILTER, GR_BITBLT_MODE_NORMAL, 1.0f );
|
||||
|
||||
@@ -265,9 +346,3 @@ void warpin_render(matrix *orient, vector *pos, int texture_bitmap_num, float ra
|
||||
gr_zbuffer_set( saved_gr_zbuffering );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -9,13 +9,62 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Freespace2/FreeSpace.cpp $
|
||||
* $Revision: 2.13 $
|
||||
* $Date: 2002-10-22 17:42:09 $
|
||||
* $Author: randomtiger $
|
||||
* $Revision: 2.27 $
|
||||
* $Date: 2003-03-02 05:23:34 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
* Freespace main body
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.26 2003/02/23 20:55:57 wmcoolmon
|
||||
* Refixed the splash screen loading code so that it still works with the demo VPs (Loading "2_PreLoad" and "PreLoad") and put logo support back in. Logo support does nothing unless "PreLoadLogo" and/or"2_PreLoadLogo" exist within the search path.
|
||||
*
|
||||
* Revision 2.25 2003/02/16 19:00:56 phreak
|
||||
* stupid typo -- my bad
|
||||
*
|
||||
* Revision 2.24 2003/02/16 18:53:59 phreak
|
||||
* fixed around splash screen
|
||||
* 2_splash.pcx is loaded in 1024x768
|
||||
* splash.pcx is loaded in 640x480 or 2_splash.pcx isn't found
|
||||
*
|
||||
* Revision 2.23 2003/01/30 23:18:21 phreak
|
||||
* cleaned up debug output
|
||||
*
|
||||
* Revision 2.22 2003/01/26 20:04:32 wmcoolmon
|
||||
* Minor mod to preload screen code, added separate 1024x768 logo
|
||||
* -C
|
||||
*
|
||||
* Revision 2.21 2003/01/26 02:58:33 wmcoolmon
|
||||
* Added title screen support to retail version. When FS2 loads, it will build a list of PCX files in the current directory, then attempt to display one. If no PCX files exist, it will try to display one of the title screens defined in the code. Freespace 2 will then attempt to superimpose a logo in the upper-left hand corner of the screen. If neither can be displayed, FS2 will function normally.
|
||||
*
|
||||
* Revision 2.20 2003/01/20 05:40:49 bobboau
|
||||
* added several sExps for turning glow points and glow maps on and off
|
||||
*
|
||||
* Revision 2.19 2003/01/19 01:07:41 bobboau
|
||||
* redid the way glowmaps are handeled, you now must set the global int GLOWMAP (no longer an array) before you render a poly that uses a glow map then set GLOWMAP to -1 when you're done with, fixed a few other misc bugs it
|
||||
*
|
||||
* Revision 2.18 2003/01/15 21:26:35 anonymous
|
||||
* fixed the demo compilation. Define FS2_DEMO globally to compile as a demo. Make sure warp.pof is in your data/models directory.
|
||||
*
|
||||
* Revision 2.17 2003/01/14 04:00:16 Goober5000
|
||||
* allowed for up to 256 main halls
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.16 2002/12/21 13:39:03 DTP
|
||||
* did bit more house keeping. modfied Phreaks fps cmdline a bit, so that we dont have to specific build code.libs for fred, but can use the same code.lib for both fs2_open.exe and fred2_open.exe
|
||||
*
|
||||
* Revision 2.15 2002/12/18 22:21:23 phreak
|
||||
* tidied up game_init() a bit.. took out a bunch of unneeded ifdefs like E3_BUILD
|
||||
* Added option to access OpenGL from the registry keys. searches for "OpenGL-"
|
||||
* whoever is in charge of the launcher might want to know this.
|
||||
*
|
||||
* Revision 2.14 2002/11/18 21:34:16 phreak
|
||||
* made ogl be used if "NDEBUG" is not defined and "USE_OPENGL" is defined - phreak
|
||||
*
|
||||
* Revision 2.13 2002/10/22 17:42:09 randomtiger
|
||||
* Fixed lighting bug that caused special pause to crash on debug build.
|
||||
* Also added TAB functionality for special pause that toggles HUD. - RT
|
||||
*
|
||||
* Revision 2.12 2002/10/19 03:50:28 randomtiger
|
||||
* Added special pause mode for easier action screenshots.
|
||||
* Added new command line parameter for accessing all single missions in tech room. - RT
|
||||
@@ -1067,17 +1116,25 @@ static char *Game_loading_ani_fname[GR_NUM_RESOLUTIONS] = {
|
||||
};
|
||||
|
||||
#if defined(FS2_DEMO)
|
||||
static char *Game_demo_title_screen_fname[GR_NUM_RESOLUTIONS] = {
|
||||
static char *Game_title_screen_fname[GR_NUM_RESOLUTIONS] = {
|
||||
"PreLoad",
|
||||
"2_PreLoad"
|
||||
};
|
||||
#elif defined(OEM_BUILD)
|
||||
static char *Game_demo_title_screen_fname[GR_NUM_RESOLUTIONS] = {
|
||||
static char *Game_title_screen_fname[GR_NUM_RESOLUTIONS] = {
|
||||
"OEMPreLoad",
|
||||
"2_OEMPreLoad"
|
||||
};
|
||||
#else
|
||||
static char *Game_title_screen_fname[GR_NUM_RESOLUTIONS] = {
|
||||
"PreLoad",
|
||||
"2_PreLoad"
|
||||
};
|
||||
#endif
|
||||
|
||||
static char *Game_logo_screen_fname[GR_NUM_RESOLUTIONS] = {
|
||||
"PreLoadLogo",
|
||||
"2_PreLoadLogo"
|
||||
};
|
||||
|
||||
#ifdef _WIN32
|
||||
// cdrom stuff
|
||||
@@ -1214,7 +1271,7 @@ void game_framerate_check()
|
||||
Gf_critical_time += flFrametime;
|
||||
}
|
||||
|
||||
if(!Show_framerate){
|
||||
if((!Show_framerate) || (!Cmdline_show_fps)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1475,7 +1532,7 @@ void game_flash_diminish(float frametime)
|
||||
|
||||
if ( Use_palette_flash ) {
|
||||
int r,g,b;
|
||||
static int or=0, og=0, ob=0;
|
||||
static int o_r=0, o_g=0, o_b=0;
|
||||
|
||||
// Change the 200 to change the color range of colors.
|
||||
r = fl2i( Game_flash_red*128.0f );
|
||||
@@ -1503,9 +1560,9 @@ void game_flash_diminish(float frametime)
|
||||
|
||||
//mprintf(( "Flash! %d,%d,%d\n", r, g, b ));
|
||||
|
||||
or = r;
|
||||
og = g;
|
||||
ob = b;
|
||||
o_r = r;
|
||||
o_g = g;
|
||||
o_b = b;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1980,7 +2037,7 @@ int game_start_mission()
|
||||
game_post_level_init();
|
||||
load_post_level_init = time(NULL) - load_post_level_init;
|
||||
|
||||
#ifndef NDEBUG
|
||||
#if (!defined(NDEBUG)) && (!defined(NO_SOFTWARE_RENDERING))
|
||||
{
|
||||
void Do_model_timings_test();
|
||||
Do_model_timings_test();
|
||||
@@ -2368,44 +2425,38 @@ void game_init()
|
||||
int trying_d3d = 0;
|
||||
|
||||
if (!Is_standalone && ptr && (strstr(ptr, NOX("3DFX Glide")))) {
|
||||
#ifdef E3_BUILD
|
||||
// always 640 for E3
|
||||
gr_init(GR_640, GR_GLIDE);
|
||||
#else
|
||||
// regular or hi-res ?
|
||||
#ifdef NDEBUG
|
||||
if(has_sparky_hi && strstr(ptr, NOX("(1024x768)"))){
|
||||
#else
|
||||
if(strstr(ptr, NOX("(1024x768)"))){
|
||||
#endif
|
||||
gr_init(GR_1024, GR_GLIDE);
|
||||
} else {
|
||||
gr_init(GR_640, GR_GLIDE);
|
||||
}
|
||||
#endif
|
||||
|
||||
} else if (!Is_standalone && ptr && (strstr(ptr, NOX("Direct 3D -") ))) {
|
||||
#ifdef E3_BUILD
|
||||
// always 640 for E3
|
||||
trying_d3d = 1;
|
||||
gr_init(GR_640, GR_DIRECT3D, depth);
|
||||
#else
|
||||
// regular or hi-res ?
|
||||
#ifdef NDEBUG
|
||||
if(has_sparky_hi && strstr(ptr, NOX("(1024x768)"))){
|
||||
#else
|
||||
if(strstr(ptr, NOX("(1024x768)"))){
|
||||
#endif
|
||||
// Direct 3D
|
||||
trying_d3d = 1;
|
||||
gr_init(GR_1024, GR_DIRECT3D, depth);
|
||||
|
||||
} else {
|
||||
// Direct 3D
|
||||
trying_d3d = 1;
|
||||
gr_init(GR_640, GR_DIRECT3D, depth);
|
||||
|
||||
}
|
||||
#endif
|
||||
} else if (!Is_standalone && ptr && (strstr(ptr, NOX("OpenGL -") ))){
|
||||
if (has_sparky_hi && strstr(ptr,NOX("1024x768"))){
|
||||
gr_init(GR_1024, GR_OPENGL, depth);
|
||||
} else {
|
||||
gr_init(GR_640, GR_OPENGL, depth);
|
||||
}
|
||||
|
||||
} else {
|
||||
// Software
|
||||
//NOT USED ANYMORE
|
||||
Error(LOCATION,"Software mode is unsupported, use hardware acceleration. If not using software mode, then something was misspelled. GET A PROGRAMMER!!");
|
||||
/*
|
||||
#ifndef NDEBUG
|
||||
if ( Use_fullscreen_at_startup && !Is_standalone) {
|
||||
gr_init(GR_640, GR_DIRECTDRAW);
|
||||
@@ -2419,6 +2470,7 @@ void game_init()
|
||||
gr_init(GR_640, GR_SOFTWARE);
|
||||
}
|
||||
#endif
|
||||
*/
|
||||
}
|
||||
|
||||
// tried d3d ?
|
||||
@@ -2455,12 +2507,12 @@ void game_init()
|
||||
|
||||
gr_set_gamma(Freespace_gamma);
|
||||
|
||||
#if defined(FS2_DEMO) || defined(OEM_BUILD)
|
||||
//#if defined(FS2_DEMO) || defined(OEM_BUILD)
|
||||
// add title screen
|
||||
if(!Is_standalone){
|
||||
display_title_screen();
|
||||
}
|
||||
#endif
|
||||
//#endif
|
||||
|
||||
#ifndef NO_NETWORK
|
||||
// attempt to load up master tracker registry info (login and password)
|
||||
@@ -2509,7 +2561,9 @@ void game_init()
|
||||
|
||||
control_config_common_init(); // sets up localization stuff in the control config
|
||||
parse_rank_tbl();
|
||||
#ifndef FS2_DEMO
|
||||
parse_medal_tbl();
|
||||
#endif
|
||||
cutscene_init();
|
||||
key_init();
|
||||
mouse_init();
|
||||
@@ -2629,7 +2683,7 @@ void game_get_framerate()
|
||||
}
|
||||
Framecount++;
|
||||
|
||||
if (Show_framerate) {
|
||||
if ((Show_framerate) || (Cmdline_show_fps)) {
|
||||
gr_set_color_fast(&HUD_color_debug);
|
||||
gr_string( 570, 2, text );
|
||||
}
|
||||
@@ -3961,6 +4015,8 @@ void game_flip_page_and_time_it()
|
||||
|
||||
void game_simulation_frame()
|
||||
{
|
||||
// mprintf(("about to render a frame\n"));
|
||||
|
||||
#ifndef NO_NETWORK
|
||||
// blow ships up in multiplayer dogfight
|
||||
if((Game_mode & GM_MULTIPLAYER) && (Net_player != NULL) && (Net_player->flags & NETINFO_FLAG_AM_MASTER) && (Netgame.type_flags & NG_TYPE_DOGFIGHT) && (f2fl(Missiontime) >= 2.0f) && !dogfight_blown){
|
||||
@@ -3992,6 +4048,7 @@ void game_simulation_frame()
|
||||
|
||||
// process AWACS stuff - do this first thing
|
||||
awacs_process();
|
||||
//mprintf(("awacs procesed\n"));
|
||||
|
||||
// single player, set Player hits_this_frame to 0
|
||||
if ( !(Game_mode & GM_MULTIPLAYER) && Player ) {
|
||||
@@ -4013,6 +4070,7 @@ void game_simulation_frame()
|
||||
// the basic idea being that because it con be confusing to deal with them on a multi-frame basis, they are only valid for
|
||||
// frame
|
||||
ship_process_targeting_lasers();
|
||||
//mprintf(("targeting lasers procesed\n"));
|
||||
|
||||
// do this here so that it works for multiplayer
|
||||
if ( Viewer_obj ) {
|
||||
@@ -4039,6 +4097,7 @@ void game_simulation_frame()
|
||||
} else {
|
||||
physics_set_viewer( NULL, PHYSICS_VIEWER_FRONT );
|
||||
}
|
||||
//mprintf(("view stuff done\n"));
|
||||
|
||||
#define VM_PADLOCK_UP (1 << 7)
|
||||
#define VM_PADLOCK_REAR (1 << 8)
|
||||
@@ -4082,11 +4141,14 @@ void game_simulation_frame()
|
||||
mission_eval_goals();
|
||||
}
|
||||
#endif // ifndef NO_NETWORK
|
||||
//mprintf(("arivals\\departures done\n"));
|
||||
|
||||
// always check training objectives, even in multiplayer missions. we need to do this so that the directives gauge works properly on clients
|
||||
if(!(Game_mode & GM_DEMO_PLAYBACK)){
|
||||
training_check_objectives();
|
||||
}
|
||||
// mprintf(("objectives procesed\n"));
|
||||
|
||||
|
||||
#ifndef NO_NETWORK
|
||||
// do all interpolation now
|
||||
@@ -4102,12 +4164,15 @@ void game_simulation_frame()
|
||||
// move all objects - does interpolation now as well
|
||||
obj_move_all(flFrametime);
|
||||
}
|
||||
// mprintf(("interpolation procesed\n"));
|
||||
|
||||
#endif // ifndef NO_NETWORK
|
||||
|
||||
// only process the message queue when the player is "in" the game
|
||||
if ( !Pre_player_entry ){
|
||||
message_queue_process(); // process any messages send to the player
|
||||
}
|
||||
//mprintf(("message queue procesed\n"));
|
||||
|
||||
if(!(Game_mode & GM_DEMO_PLAYBACK)){
|
||||
message_maybe_distort(); // maybe distort incoming message if comms damaged
|
||||
@@ -4115,12 +4180,14 @@ void game_simulation_frame()
|
||||
player_process_pending_praise(); // maybe send off a delayed praise message to the player
|
||||
player_maybe_play_all_alone_msg(); // mabye tell the player he is all alone
|
||||
}
|
||||
//mprintf(("assorted player stuff procesed\n"));
|
||||
|
||||
if(!(Game_mode & GM_STANDALONE_SERVER)){
|
||||
// process some stuff every frame (before frame is rendered)
|
||||
emp_process_local();
|
||||
|
||||
hud_update_frame(); // update hud systems
|
||||
//mprintf(("HUD updated\n"));
|
||||
|
||||
if (!physics_paused) {
|
||||
// Move particle system
|
||||
@@ -4137,9 +4204,11 @@ void game_simulation_frame()
|
||||
|
||||
shockwave_move_all(flFrametime); // update all the shockwaves
|
||||
}
|
||||
//mprintf(("physics stuff procesed\n"));
|
||||
|
||||
// subspace missile strikes
|
||||
ssm_process();
|
||||
//mprintf(("SSM procesed\n"));
|
||||
|
||||
#ifndef NO_SOUND
|
||||
obj_snd_do_frame(); // update the object-linked persistant sounds
|
||||
@@ -4152,8 +4221,10 @@ void game_simulation_frame()
|
||||
if ( Game_subspace_effect ) {
|
||||
game_start_subspace_ambient_sound();
|
||||
}
|
||||
//mprintf(("sound procesed\n"));
|
||||
#endif
|
||||
}
|
||||
}
|
||||
// mprintf(("frame rendered\n"));
|
||||
}
|
||||
|
||||
// Maybe render and process the dead-popup
|
||||
@@ -4738,6 +4809,9 @@ void game_do_frame()
|
||||
game_set_frametime(GS_STATE_GAME_PLAY);
|
||||
game_update_missiontime();
|
||||
|
||||
// if (Player_ship->flags & SF_DYING)
|
||||
// flFrametime /= 15.0;
|
||||
|
||||
#if !defined(NO_NETWORK) && !defined(NO_STANDALONE)
|
||||
if (Game_mode & GM_STANDALONE_SERVER) {
|
||||
std_multi_set_standalone_missiontime(f2fl(Missiontime));
|
||||
@@ -6019,11 +6093,7 @@ void game_enter_state( int old_state, int new_state )
|
||||
#if defined(PRESS_TOUR_BUILD) || defined(PD_BUILD)
|
||||
mht_init();
|
||||
#else
|
||||
if (Player->on_bastion) {
|
||||
main_hall_init(1);
|
||||
} else {
|
||||
main_hall_init(0);
|
||||
}
|
||||
main_hall_init(Player->main_hall);
|
||||
#endif
|
||||
break;
|
||||
|
||||
@@ -7115,7 +7185,7 @@ int WinMainSub(int argc, char *argv[])
|
||||
// movie_play( NOX("intro.mve"), 0 );
|
||||
|
||||
// debug version, movie will only play with -showmovies
|
||||
#else if !defined(NDEBUG)
|
||||
#elif !defined(NDEBUG)
|
||||
|
||||
// no soup for you!
|
||||
// movie_play( NOX("intro.mve"), 0);
|
||||
@@ -7173,14 +7243,18 @@ int main(int argc, char *argv[])
|
||||
int result = -1;
|
||||
|
||||
#ifdef _WIN32
|
||||
#if defined(_MSC_VER)
|
||||
__try {
|
||||
#endif
|
||||
result = WinMainSub(hInst, hPrev, szCmdLine, nCmdShow);
|
||||
#if defined(_MSC_VER)
|
||||
} __except(RecordExceptionInfo(GetExceptionInformation(), "Freespace 2 Main Thread")) {
|
||||
// Do nothing here - RecordExceptionInfo() has already done
|
||||
// everything that is needed. Actually this code won't even
|
||||
// get called unless you return EXCEPTION_EXECUTE_HANDLER from
|
||||
// the __except clause.
|
||||
}
|
||||
#endif
|
||||
#else
|
||||
try {
|
||||
result = WinMainSub(argc, argv);
|
||||
@@ -7668,7 +7742,7 @@ void game_show_event_debug(float frametime)
|
||||
|
||||
#endif // NDEBUG
|
||||
|
||||
#ifndef NDEBUG
|
||||
#if (!defined(NDEBUG)) && (!defined(NO_SOFTWARE_RENDERING))
|
||||
FILE * Time_fp;
|
||||
FILE * Texture_fp;
|
||||
|
||||
@@ -7909,6 +7983,10 @@ if ( FS_VERSION_BUILD == 0 ) {
|
||||
sprintf(str,"V%d.%d.%d", FS_VERSION_MAJOR, FS_VERSION_MINOR, FS_VERSION_BUILD );
|
||||
}
|
||||
|
||||
#ifdef FS2_DEMO
|
||||
strcat(str, " Demo");
|
||||
#endif
|
||||
|
||||
#ifdef _DEBUG
|
||||
strcat(str, " Dbg");
|
||||
#endif
|
||||
@@ -8804,16 +8882,18 @@ int game_do_cd_mission_check(char *filename)
|
||||
|
||||
// checksums, just keep a list of all valid ones, if it matches any of them, keep it
|
||||
#define NUM_SHIPS_TBL_CHECKSUMS 1
|
||||
/*
|
||||
|
||||
#ifdef FS2_DEMO
|
||||
int Game_ships_tbl_checksums[NUM_SHIPS_TBL_CHECKSUMS] = {
|
||||
-463907578, // US - beta 1
|
||||
//-463907578, // US - beta 1
|
||||
1696074201, // FS2 demo
|
||||
};
|
||||
*/
|
||||
#else
|
||||
int Game_ships_tbl_checksums[NUM_SHIPS_TBL_CHECKSUMS] = {
|
||||
// -1022810006, // 1.0 FULL
|
||||
-1254285366 // 1.2 FULL (German)
|
||||
};
|
||||
#endif
|
||||
|
||||
void verify_ships_tbl()
|
||||
{
|
||||
@@ -8871,16 +8951,18 @@ DCF(shipspew, "display the checksum for the current ships.tbl")
|
||||
|
||||
// checksums, just keep a list of all valid ones, if it matches any of them, keep it
|
||||
#define NUM_WEAPONS_TBL_CHECKSUMS 1
|
||||
/*
|
||||
|
||||
#ifdef FS2_DEMO
|
||||
int Game_weapons_tbl_checksums[NUM_WEAPONS_TBL_CHECKSUMS] = {
|
||||
141718090, // US - beta 1
|
||||
//141718090, // US - beta 1
|
||||
-266420030, // demo 1
|
||||
};
|
||||
*/
|
||||
#else
|
||||
int Game_weapons_tbl_checksums[NUM_WEAPONS_TBL_CHECKSUMS] = {
|
||||
// 399297860, // 1.0 FULL
|
||||
-553984927 // 1.2 FULL (german)
|
||||
};
|
||||
#endif
|
||||
|
||||
void verify_weapons_tbl()
|
||||
{
|
||||
@@ -8944,17 +9026,64 @@ int game_hacked_data()
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
//#define MAX_SPLASHSCREENS 64
|
||||
//char Splash_screens[MAX_SPLASHSCREENS][MAX_FILENAME_LEN];
|
||||
|
||||
|
||||
void display_title_screen()
|
||||
{
|
||||
#if defined(FS2_DEMO) || defined(OEM_BUILD)
|
||||
///int title_bitmap;
|
||||
int title_bitmap = -1;
|
||||
int title_logo =-1;
|
||||
/* _finddata_t find;
|
||||
long find_handle;
|
||||
char current_dir[256];
|
||||
|
||||
// load bitmap
|
||||
int title_bitmap = bm_load(Game_demo_title_screen_fname[gr_screen.res]);
|
||||
if (title_bitmap == -1) {
|
||||
return;
|
||||
//Get the find string
|
||||
_getcwd(current_dir, 256);
|
||||
strcat(current_dir, DIR_SEPARATOR_STR);
|
||||
strcat(current_dir, "*.pcx");
|
||||
|
||||
//Let the search begin!
|
||||
find_handle = _findfirst(current_dir, &find);
|
||||
int i = 0;
|
||||
if(find_handle != -1)
|
||||
{
|
||||
char *p;
|
||||
|
||||
do {
|
||||
if(!(find.attrib & _A_SUBDIR) && (strlen(find.name) < MAX_FILENAME_LEN)) {
|
||||
p = strchr( find.name, '.' );
|
||||
if(p) {
|
||||
*p = '\0';
|
||||
}
|
||||
|
||||
if(stricmp(find.name, Game_logo_screen_fname[gr_screen.res])
|
||||
&& stricmp(find.name, Game_title_screen_fname[gr_screen.res]))
|
||||
{
|
||||
strcpy(Splash_screens[i], find.name);
|
||||
i++;
|
||||
}
|
||||
|
||||
if(i == MAX_SPLASHSCREENS) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
} while(!_findnext(find_handle, &find));
|
||||
}
|
||||
|
||||
if(i) {
|
||||
srand(time(NULL));
|
||||
title_bitmap = bm_load(Splash_screens[rand() % i]);
|
||||
|
||||
} else {
|
||||
title_bitmap = bm_load(Game_title_screen_fname[gr_screen.res]);
|
||||
}
|
||||
|
||||
if (title_bitmap == -1 && title_logo == -1) {
|
||||
// return;
|
||||
}
|
||||
*/
|
||||
#ifndef NO_DIRECT3D
|
||||
// d3d
|
||||
if((gr_screen.mode == GR_DIRECT3D) && (Gr_bitmap_poly)){
|
||||
@@ -8963,11 +9092,31 @@ void display_title_screen()
|
||||
}
|
||||
#endif
|
||||
|
||||
// set
|
||||
gr_set_bitmap(title_bitmap);
|
||||
title_logo = bm_load(Game_logo_screen_fname[gr_screen.res]);
|
||||
title_bitmap = bm_load(Game_title_screen_fname[gr_screen.res]);
|
||||
|
||||
// draw
|
||||
gr_bitmap(0, 0);
|
||||
if(title_bitmap != -1)
|
||||
{
|
||||
// set
|
||||
gr_set_bitmap(title_bitmap);
|
||||
|
||||
//Get bitmap's width and height
|
||||
int width, height;
|
||||
bm_get_info(title_bitmap, &width, &height);
|
||||
|
||||
//Draw it in the center of the screen
|
||||
gr_bitmap((gr_screen.max_w - width)/2, (gr_screen.max_h - height)/2);
|
||||
bm_unload(title_bitmap);
|
||||
}
|
||||
|
||||
if(title_logo != -1)
|
||||
{
|
||||
gr_set_bitmap(title_logo);
|
||||
|
||||
gr_bitmap(0,0);
|
||||
|
||||
bm_unload(title_logo);
|
||||
}
|
||||
|
||||
#ifndef NO_DIRECT3D
|
||||
// d3d
|
||||
@@ -8979,9 +9128,6 @@ void display_title_screen()
|
||||
|
||||
// flip
|
||||
gr_flip();
|
||||
|
||||
bm_unload(title_bitmap);
|
||||
#endif // FS2_DEMO || OEM_BUILD
|
||||
}
|
||||
|
||||
// return true if the game is running with "low memory", which is less than 48MB
|
||||
|
||||
@@ -9,13 +9,16 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Gamesnd/EventMusic.cpp $
|
||||
* $Revision: 2.1 $
|
||||
* $Date: 2002-08-01 01:41:04 $
|
||||
* $Author: penguin $
|
||||
* $Revision: 2.2 $
|
||||
* $Date: 2003-01-25 04:17:39 $
|
||||
* $Author: Goober5000 $
|
||||
*
|
||||
* C module for high-level control of event driven music
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.1 2002/08/01 01:41:04 penguin
|
||||
* The big include file move
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:22 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
@@ -1415,6 +1418,30 @@ int event_music_next_soundtrack(int delta)
|
||||
return Current_soundtrack_num;
|
||||
}
|
||||
|
||||
// Goober5000 - along the same lines; this is for the sexp
|
||||
void event_sexp_change_music(char *name)
|
||||
{
|
||||
Assert(name);
|
||||
|
||||
int i, new_soundtrack = -1;
|
||||
|
||||
if ( Event_music_enabled == FALSE || Event_music_level_inited == FALSE )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
for (i=0; i<Num_soundtracks; i++)
|
||||
{
|
||||
if (!stricmp(name, Soundtracks[i].name))
|
||||
{
|
||||
new_soundtrack = i;
|
||||
}
|
||||
}
|
||||
|
||||
event_music_level_close();
|
||||
event_music_level_init(new_soundtrack);
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------
|
||||
// event_music_get_soundtrack_name()
|
||||
//
|
||||
|
||||
@@ -9,13 +9,16 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Gamesnd/EventMusic.h $
|
||||
* $Revision: 2.1 $
|
||||
* $Date: 2002-08-01 01:41:04 $
|
||||
* $Author: penguin $
|
||||
* $Revision: 2.2 $
|
||||
* $Date: 2003-01-25 04:17:39 $
|
||||
* $Author: Goober5000 $
|
||||
*
|
||||
* Header file for high-level control of event driven music
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.1 2002/08/01 01:41:04 penguin
|
||||
* The big include file move
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:22 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
@@ -185,7 +188,7 @@ typedef struct tagSOUNDTRACK_INFO {
|
||||
char pattern_fnames[MAX_PATTERNS][MAX_FILENAME_LEN];
|
||||
} SOUNDTRACK_INFO;
|
||||
|
||||
#define MAX_SOUNDTRACKS 10
|
||||
#define MAX_SOUNDTRACKS 25
|
||||
|
||||
extern SOUNDTRACK_INFO Soundtracks[MAX_SOUNDTRACKS];
|
||||
extern int Num_soundtracks;
|
||||
@@ -217,6 +220,7 @@ void event_music_start_default();
|
||||
void event_music_get_info(char *outbuf);
|
||||
void event_music_get_soundtrack_name(char *outbuf);
|
||||
int event_music_next_soundtrack(int delta);
|
||||
void event_sexp_change_music(char *name);
|
||||
void event_music_set_soundtrack(char *name);
|
||||
void event_music_set_score(int score_index, char *name);
|
||||
int event_music_get_spooled_music_index(char *name);
|
||||
|
||||
@@ -9,13 +9,16 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Gamesnd/GameSnd.h $
|
||||
* $Revision: 2.1 $
|
||||
* $Date: 2002-08-01 01:41:04 $
|
||||
* $Author: penguin $
|
||||
* $Revision: 2.2 $
|
||||
* $Date: 2002-12-10 05:43:35 $
|
||||
* $Author: Goober5000 $
|
||||
*
|
||||
* Routines to keep track of which sound files go where
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.1 2002/08/01 01:41:04 penguin
|
||||
* The big include file move
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:22 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
@@ -530,6 +533,10 @@ extern game_snd Snds_flyby[MAX_SPECIES_NAMES][2];
|
||||
// copilot
|
||||
#define SND_COPILOT 162
|
||||
|
||||
// added for ballistic primaries - Goober5000
|
||||
#define SND_BALLISTIC_START_LOAD 165
|
||||
#define SND_BALLISTIC_LOAD 166
|
||||
|
||||
// supernova 1 and supernova 2
|
||||
#define SND_SUPERNOVA_1 173
|
||||
#define SND_SUPERNOVA_2 174
|
||||
@@ -538,7 +545,6 @@ extern game_snd Snds_flyby[MAX_SPECIES_NAMES][2];
|
||||
#define SND_LIGHTNING_1 180
|
||||
#define SND_LIGHTNING_2 181
|
||||
|
||||
|
||||
//---------------------------------------------------
|
||||
// Interface sounds
|
||||
//---------------------------------------------------
|
||||
|
||||
@@ -62,6 +62,9 @@ typedef struct { float r, g, b, a; } FxColor4;
|
||||
#elif defined(__unix__)
|
||||
#define FX_ENTRY extern
|
||||
#define FX_CALL
|
||||
#elif defined(__GNUC__)
|
||||
#define FX_ENTRY extern
|
||||
#define FX_CALL
|
||||
#else
|
||||
#warning define FX_ENTRY & FX_CALL for your compiler
|
||||
#define FX_ENTRY extern
|
||||
|
||||
@@ -9,13 +9,25 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/GlobalIncs/PsTypes.h $
|
||||
* $Revision: 2.4 $
|
||||
* $Date: 2002-08-06 01:49:08 $
|
||||
* $Revision: 2.8 $
|
||||
* $Date: 2003-03-02 05:27:44 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
* Header file containg global typedefs, constants and macros
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.7 2003/01/18 19:48:19 phreak
|
||||
* added some defines that deal with mages using DXTC
|
||||
*
|
||||
* Revision 2.6 2002/12/02 23:56:12 Goober5000
|
||||
* fixed misspelling
|
||||
*
|
||||
* Revision 2.5 2002/12/02 20:49:14 Goober5000
|
||||
* fixed misspelling of "category" as "catagory"
|
||||
*
|
||||
* Revision 2.4 2002/08/06 01:49:08 penguin
|
||||
* Renamed ccode members to cc_or and cc_and
|
||||
*
|
||||
* Revision 2.3 2002/08/01 01:41:04 penguin
|
||||
* The big include file move
|
||||
*
|
||||
@@ -328,13 +340,22 @@ typedef struct vertex {
|
||||
ubyte pad[2]; // pad structure to be 4 byte aligned.
|
||||
} vertex;
|
||||
|
||||
#define BMP_AABITMAP (1<<0) // antialiased bitmap
|
||||
#define BMP_AABITMAP (1<<0) // antialiased bitmap
|
||||
#define BMP_TEX_XPARENT (1<<1) // transparent texture
|
||||
#define BMP_TEX_NONDARK (1<<2) // nondarkening texture
|
||||
#define BMP_TEX_OTHER (1<<3) // so we can identify all "normal" textures
|
||||
#define BMP_TEX_OTHER (1<<3) // so we can identify all "normal" textures
|
||||
#define BMP_TEX_DXT1 (1<<4) // dxt1 compressed 8r8g8b1a (24bit)
|
||||
#define BMP_TEX_DXT3 (1<<5) // dxt3 compressed 8r8g8b4a (32bit)
|
||||
#define BMP_TEX_DXT5 (1<<6) // dxt5 compressed 8r8g8b8a (32bit)
|
||||
|
||||
//compressed texture types
|
||||
#define BMP_TEX_COMP ( BMP_TEX_DXT1 | BMP_TEX_DXT3 | BMP_TEX_DXT5 )
|
||||
|
||||
//non compressed textures
|
||||
#define BMP_TEX_NONCOMP ( BMP_TEX_XPARENT | BMP_TEX_NONDARK | BMP_TEX_OTHER )
|
||||
|
||||
// any texture type
|
||||
#define BMP_TEX_ANY ( BMP_TEX_XPARENT | BMP_TEX_NONDARK | BMP_TEX_OTHER )
|
||||
#define BMP_TEX_ANY ( BMP_TEX_COMP | BMP_TEX_NONCOMP )
|
||||
|
||||
// max res == 1024x768. max texture size == 256
|
||||
#define MAX_BMAP_SECTIONS_X 4
|
||||
@@ -383,12 +404,12 @@ extern void _cdecl Warning( char * filename, int line, char * format, ... );
|
||||
// or,
|
||||
// Error( LOCATION, "Error opening %s", filename );
|
||||
|
||||
#if defined(NDEBUG)
|
||||
//#if defined(NDEBUG)
|
||||
#define Assert(x) do {} while (0)
|
||||
#else
|
||||
void gr_activate(int);
|
||||
#define Assert(x) do { if (!(x)){ gr_activate(0); WinAssert(#x,__FILE__,__LINE__); gr_activate(1); } } while (0)
|
||||
#endif
|
||||
//#else
|
||||
//void gr_activate(int);
|
||||
//#define Assert(x) do { if (!(x)){ gr_activate(0); WinAssert(#x,__FILE__,__LINE__); gr_activate(1); } } while (0)
|
||||
//#endif
|
||||
|
||||
//#define Int3() _asm { int 3 }
|
||||
|
||||
@@ -416,8 +437,12 @@ void gr_activate(int);
|
||||
#endif // NDEBUG && DEMO
|
||||
#endif // INTERPLAYQA
|
||||
|
||||
#ifndef min
|
||||
#define min(a,b) (((a) < (b)) ? (a) : (b))
|
||||
#endif
|
||||
#ifndef max
|
||||
#define max(a,b) (((a) > (b)) ? (a) : (b))
|
||||
#endif
|
||||
|
||||
#define PI 3.141592654f
|
||||
#define PI2 (3.141592654f*2.0f) // PI*2
|
||||
@@ -497,7 +522,7 @@ extern float Dc_arg_float; // If Dc_arg_type & ARG_FLOAT is set, then this is th
|
||||
void dc_printf( char *format, ... );
|
||||
|
||||
// Each dc_arg_type can have one or more of these flags set.
|
||||
// This is because some things can fit into two catagories.
|
||||
// This is because some things can fit into two categories.
|
||||
// Like 1 can be an integer, a float, a string, or a true boolean
|
||||
// value.
|
||||
#define ARG_NONE (1<<0) // no argument
|
||||
|
||||
@@ -9,13 +9,16 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/GlobalIncs/SystemVars.cpp $
|
||||
* $Revision: 2.1 $
|
||||
* $Date: 2002-08-01 01:41:04 $
|
||||
* $Author: penguin $
|
||||
* $Revision: 2.2 $
|
||||
* $Date: 2002-11-22 20:56:15 $
|
||||
* $Author: phreak $
|
||||
*
|
||||
* Variables and constants common to FreeSpace and Fred.
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.1 2002/08/01 01:41:04 penguin
|
||||
* The big include file move
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:22 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
@@ -233,7 +236,9 @@ int Fred_found_unknown_ship_during_parsing = 0;
|
||||
|
||||
// If true, then we are using Direct3D hardware. This is used for game type stuff
|
||||
// that changes when you're using hardware.
|
||||
int D3D_enabled = 0;
|
||||
int D3D_enabled = 0;
|
||||
|
||||
int OGL_inited=0;
|
||||
|
||||
// Values used for noise for thruster animations
|
||||
float Noise[NOISE_NUM_FRAMES] = {
|
||||
|
||||
@@ -9,12 +9,22 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/GlobalIncs/version.h $
|
||||
* $Revision: 2.3 $
|
||||
* $Date: 2002-11-10 20:40:02 $
|
||||
* $Author: inquisitor $
|
||||
* $Revision: 2.6 $
|
||||
* $Date: 2003-02-05 07:04:31 $
|
||||
* $Author: Goober5000 $
|
||||
*
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.5 2003/01/30 23:24:34 phreak
|
||||
* bumped to 3.50
|
||||
*
|
||||
* Revision 2.4 2002/12/31 20:09:14 Goober5000
|
||||
* bumped to 3.4
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.3 2002/11/10 20:40:02 inquisitor
|
||||
* Bumped to 3.3
|
||||
*
|
||||
* Revision 2.2 2002/08/13 03:32:25 penguin
|
||||
* Bumped to version 3.2
|
||||
*
|
||||
@@ -129,7 +139,7 @@
|
||||
// Major.Minor.Bugfix
|
||||
|
||||
#define FS_VERSION_MAJOR 3 // major version
|
||||
#define FS_VERSION_MINOR 3 // increase by 1 for minor revs
|
||||
#define FS_VERSION_MINOR 5 // increase by 1 for minor revs
|
||||
#define FS_VERSION_BUILD 0 // bugfix release
|
||||
|
||||
#define VERSION_LOC_FNAME "version.nfo"
|
||||
|
||||
@@ -9,13 +9,16 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/GlobalIncs/WinDebug.cpp $
|
||||
* $Revision: 2.1 $
|
||||
* $Date: 2002-08-01 01:41:04 $
|
||||
* $Revision: 2.2 $
|
||||
* $Date: 2003-03-02 05:30:26 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
* Debug stuff
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.1 2002/08/01 01:41:04 penguin
|
||||
* The big include file move
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:22 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
@@ -116,12 +119,26 @@
|
||||
#include <windows.h>
|
||||
#include <windowsx.h>
|
||||
#include <stdio.h>
|
||||
#include <crtdbg.h>
|
||||
|
||||
#include "globalincs/pstypes.h"
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#include <crtdbg.h>
|
||||
|
||||
//Uncomment SHOW_CALL_STACK to show the call stack in Asserts, Warnings, and Errors
|
||||
#define SHOW_CALL_STACK
|
||||
#endif // _MSC_VER
|
||||
|
||||
|
||||
#ifndef __ASSERT
|
||||
#ifndef _DEBUG
|
||||
#define _ASSERT(expr) ((void)0)
|
||||
#else
|
||||
#define _ASSERT(expr) (assert(expr))
|
||||
// #error _ASSERT is not defined yet for debug mode with non-MSVC compilers
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef SHOW_CALL_STACK
|
||||
|
||||
@@ -1006,8 +1023,6 @@ void getmem()
|
||||
|
||||
#ifndef NDEBUG
|
||||
|
||||
#include <crtdbg.h>
|
||||
|
||||
int TotalRam = 0;
|
||||
|
||||
#define nNoMansLandSize 4
|
||||
@@ -1030,6 +1045,9 @@ typedef struct _CrtMemBlockHeader
|
||||
|
||||
#define pHdr(pbData) (((_CrtMemBlockHeader *)pbData)-1)
|
||||
|
||||
|
||||
// this block of code is never referenced...
|
||||
#if 0
|
||||
int __cdecl MyAllocHook(
|
||||
int nAllocType,
|
||||
void * pvData,
|
||||
@@ -1067,6 +1085,9 @@ int __cdecl MyAllocHook(
|
||||
|
||||
return( TRUE ); // Allow the memory operation to proceed
|
||||
}
|
||||
#endif // #if 0
|
||||
|
||||
|
||||
|
||||
void windebug_memwatch_init()
|
||||
{
|
||||
@@ -1120,7 +1141,7 @@ void *vm_malloc( int size, char *filename, int line )
|
||||
void *vm_malloc( int size )
|
||||
#endif
|
||||
{
|
||||
#ifndef NDEBUG
|
||||
#if (!defined(NDEBUG)) && defined(_MSC_VER)
|
||||
if ( !Heap ) {
|
||||
TotalRam += size;
|
||||
|
||||
@@ -1179,27 +1200,23 @@ void vm_free( void *ptr )
|
||||
return;
|
||||
}
|
||||
|
||||
#ifndef NDEBUG
|
||||
#if (!defined(NDEBUG)) && defined(_MSC_VER)
|
||||
if ( !Heap ) {
|
||||
#ifndef NDEBUG
|
||||
_CrtMemBlockHeader *phd = pHdr(ptr);
|
||||
int nSize = phd->nDataSize;
|
||||
|
||||
TotalRam -= nSize;
|
||||
#endif
|
||||
|
||||
_free_dbg(ptr,_NORMAL_BLOCK);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef NDEBUG
|
||||
int actual_size = HeapSize(Heap, HEAP_FLAG, ptr);
|
||||
if ( Watch_malloc ) {
|
||||
mprintf(( "Free %d bytes [%s(%d)]\n", actual_size, clean_filename(filename), line ));
|
||||
}
|
||||
TotalRam -= actual_size;
|
||||
#endif
|
||||
int actual_size = HeapSize(Heap, HEAP_FLAG, ptr);
|
||||
if ( Watch_malloc ) {
|
||||
mprintf(( "Free %d bytes [%s(%d)]\n", actual_size, clean_filename(filename), line ));
|
||||
}
|
||||
TotalRam -= actual_size;
|
||||
#endif
|
||||
HeapFree( Heap, HEAP_FLAG, ptr );
|
||||
HeapCompact(Heap, HEAP_FLAG);
|
||||
}
|
||||
|
||||
@@ -9,13 +9,19 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Graphics/2d.cpp $
|
||||
* $Revision: 2.3 $
|
||||
* $Date: 2002-08-01 01:41:04 $
|
||||
* $Revision: 2.5 $
|
||||
* $Date: 2003-03-02 05:41:52 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
* Main file for 2d primitives.
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.4 2002/11/18 21:32:11 phreak
|
||||
* added some ogl functionality - phreak
|
||||
*
|
||||
* Revision 2.3 2002/08/01 01:41:04 penguin
|
||||
* The big include file move
|
||||
*
|
||||
* Revision 2.2 2002/07/30 14:29:15 unknownplayer
|
||||
*
|
||||
* Started work on DX8.1 implementation. Updated the project files to encompass
|
||||
@@ -513,9 +519,6 @@ void gr_close()
|
||||
|
||||
switch( gr_screen.mode ) {
|
||||
#ifdef _WIN32
|
||||
case GR_SOFTWARE:
|
||||
gr_soft_cleanup();
|
||||
break;
|
||||
case GR_DIRECTDRAW:
|
||||
Int3();
|
||||
gr_directdraw_cleanup();
|
||||
@@ -528,6 +531,12 @@ void gr_close()
|
||||
break;
|
||||
#endif
|
||||
|
||||
#ifndef NO_SOFTWARE_RENDERING
|
||||
case GR_SOFTWARE:
|
||||
gr_soft_cleanup();
|
||||
break;
|
||||
#endif // ifndef NO_SOFTWARE_RENDERING
|
||||
|
||||
#ifdef USE_OPENGL
|
||||
case GR_OPENGL:
|
||||
gr_opengl_cleanup();
|
||||
@@ -887,9 +896,6 @@ int gr_init(int res, int mode, int depth, int fred_x, int fred_y)
|
||||
if ( Gr_inited ) {
|
||||
switch( gr_screen.mode ) {
|
||||
#ifdef _WIN32
|
||||
case GR_SOFTWARE:
|
||||
gr_soft_cleanup();
|
||||
break;
|
||||
case GR_DIRECTDRAW:
|
||||
Int3();
|
||||
gr_directdraw_cleanup();
|
||||
@@ -904,7 +910,13 @@ int gr_init(int res, int mode, int depth, int fred_x, int fred_y)
|
||||
case GR_GLIDE:
|
||||
gr_glide_cleanup();
|
||||
break;
|
||||
#endif
|
||||
#endif // ifdef _WIN32
|
||||
|
||||
#ifndef NO_SOFTWARE_RENDERING
|
||||
case GR_SOFTWARE:
|
||||
gr_soft_cleanup();
|
||||
break;
|
||||
#endif // ifndef NO_SOFTWARE_RENDERING
|
||||
|
||||
#ifdef USE_OPENGL
|
||||
case GR_OPENGL:
|
||||
@@ -921,7 +933,7 @@ int gr_init(int res, int mode, int depth, int fred_x, int fred_y)
|
||||
|
||||
#if defined(HARDWARE_ONLY) && defined(_WIN32)
|
||||
if(!Fred_running && !Pofview_running && !Nebedit_running && !Is_standalone){
|
||||
if((mode != GR_GLIDE) && (mode != GR_DIRECT3D)){
|
||||
if((mode != GR_GLIDE) && (mode != GR_DIRECT3D) && (mode != GR_OPENGL)){
|
||||
mprintf(("Forcing glide startup!\n"));
|
||||
mode = GR_GLIDE;
|
||||
}
|
||||
@@ -978,10 +990,6 @@ int gr_init(int res, int mode, int depth, int fred_x, int fred_y)
|
||||
|
||||
switch( gr_screen.mode ) {
|
||||
#ifdef _WIN32
|
||||
case GR_SOFTWARE:
|
||||
Assert(Fred_running || Pofview_running || Is_standalone || Nebedit_running);
|
||||
gr_soft_init();
|
||||
break;
|
||||
// directdraw, direct3d,
|
||||
case GR_DIRECTDRAW:
|
||||
Int3();
|
||||
@@ -1020,8 +1028,18 @@ int gr_init(int res, int mode, int depth, int fred_x, int fred_y)
|
||||
break;
|
||||
#endif // ifdef WIN32
|
||||
|
||||
#ifndef NO_SOFTWARE_RENDERING
|
||||
case GR_SOFTWARE:
|
||||
Assert(Fred_running || Pofview_running || Is_standalone || Nebedit_running);
|
||||
gr_soft_init();
|
||||
break;
|
||||
#endif // ifndef NO_SOFTWARE_RENDERING
|
||||
|
||||
#ifdef USE_OPENGL
|
||||
case GR_OPENGL:
|
||||
Gr_bitmap_poly=1;
|
||||
gr_screen.bits_per_pixel=depth;
|
||||
gr_screen.bytes_per_pixel=depth/8;
|
||||
gr_opengl_init();
|
||||
break;
|
||||
#endif // ifdef USE_OPENGL
|
||||
@@ -1063,12 +1081,6 @@ void gr_force_windowed()
|
||||
|
||||
switch( gr_screen.mode ) {
|
||||
#ifdef _WIN32
|
||||
case GR_SOFTWARE:
|
||||
{
|
||||
extern void gr_soft_force_windowed();
|
||||
gr_soft_force_windowed();
|
||||
}
|
||||
break;
|
||||
case GR_DIRECTDRAW:
|
||||
{
|
||||
Int3();
|
||||
@@ -1086,8 +1098,19 @@ void gr_force_windowed()
|
||||
break;
|
||||
#endif // ifdef WIN32
|
||||
|
||||
#ifndef NO_SOFTWARE_RENDERING
|
||||
case GR_SOFTWARE:
|
||||
{
|
||||
extern void gr_soft_force_windowed();
|
||||
gr_soft_force_windowed();
|
||||
}
|
||||
break;
|
||||
#endif // ifndef NO_SOFTWARE_RENDERING
|
||||
|
||||
#ifdef USE_OPENGL
|
||||
case GR_OPENGL:
|
||||
extern void opengl_minimize();
|
||||
opengl_minimize();
|
||||
break;
|
||||
|
||||
#endif // ifdef USE_OPENGL
|
||||
@@ -1107,13 +1130,6 @@ void gr_activate(int active)
|
||||
|
||||
switch( gr_screen.mode ) {
|
||||
#ifdef _WIN32
|
||||
case GR_SOFTWARE:
|
||||
{
|
||||
extern void gr_soft_activate(int active);
|
||||
gr_soft_activate(active);
|
||||
return;
|
||||
}
|
||||
break;
|
||||
case GR_DIRECTDRAW:
|
||||
{
|
||||
Int3();
|
||||
@@ -1138,8 +1154,20 @@ void gr_activate(int active)
|
||||
break;
|
||||
#endif // ifdef WIN32
|
||||
|
||||
#ifndef NO_SOFTWARE_RENDERING
|
||||
case GR_SOFTWARE:
|
||||
{
|
||||
extern void gr_soft_activate(int active);
|
||||
gr_soft_activate(active);
|
||||
return;
|
||||
}
|
||||
break;
|
||||
#endif // ifndef NO_SOFTWARE_RENDERING
|
||||
|
||||
#ifdef USE_OPENGL
|
||||
case GR_OPENGL:
|
||||
extern void gr_opengl_activate(int active);
|
||||
gr_opengl_activate(active);
|
||||
break;
|
||||
#endif // ifdef USE_OPENGL
|
||||
|
||||
@@ -1203,8 +1231,8 @@ void gr_bitmap(int x, int y)
|
||||
int x_line, y_line;
|
||||
int w, h;
|
||||
|
||||
// d3d and glide support texture poly shiz
|
||||
if(((gr_screen.mode == GR_DIRECT3D) || (gr_screen.mode == GR_GLIDE)) && Gr_bitmap_poly){
|
||||
// d3d and glide support texture poly shiz, ogl does too
|
||||
if(((gr_screen.mode == GR_DIRECT3D) || (gr_screen.mode == GR_GLIDE) || (gr_screen.mode== GR_OPENGL)) && Gr_bitmap_poly){
|
||||
int idx, s_idx;
|
||||
// float u_scale, v_scale;
|
||||
bitmap_section_info *sections;
|
||||
@@ -1236,10 +1264,6 @@ void gr_bitmap(int x, int y)
|
||||
// old school bitmaps
|
||||
switch(gr_screen.mode){
|
||||
#ifdef _WIN32
|
||||
case GR_SOFTWARE:
|
||||
grx_bitmap(x, y);
|
||||
break;
|
||||
|
||||
case GR_DIRECTDRAW:
|
||||
grx_bitmap(x, y);
|
||||
break;
|
||||
@@ -1251,9 +1275,14 @@ void gr_bitmap(int x, int y)
|
||||
case GR_GLIDE:
|
||||
gr_glide_bitmap(x, y);
|
||||
break;
|
||||
|
||||
#endif // ifdef WIN32
|
||||
|
||||
#ifndef NO_SOFTWARE_RENDERING
|
||||
case GR_SOFTWARE:
|
||||
grx_bitmap(x, y);
|
||||
break;
|
||||
#endif // ifndef NO_SOFTWARE_RENDERING
|
||||
|
||||
#ifdef USE_OPENGL
|
||||
case GR_OPENGL:
|
||||
gr_opengl_bitmap(x, y);
|
||||
@@ -1267,10 +1296,6 @@ void gr_bitmap_ex(int x, int y, int w, int h, int sx, int sy)
|
||||
{
|
||||
switch(gr_screen.mode){
|
||||
#ifdef _WIN32
|
||||
case GR_SOFTWARE:
|
||||
grx_bitmap_ex(x, y, w, h, sx, sy);
|
||||
break;
|
||||
|
||||
case GR_DIRECTDRAW:
|
||||
grx_bitmap_ex(x, y, w, h, sx, sy);
|
||||
break;
|
||||
@@ -1284,6 +1309,12 @@ void gr_bitmap_ex(int x, int y, int w, int h, int sx, int sy)
|
||||
break;
|
||||
#endif // ifdef WIN32
|
||||
|
||||
#ifndef NO_SOFTWARE_RENDERING
|
||||
case GR_SOFTWARE:
|
||||
grx_bitmap_ex(x, y, w, h, sx, sy);
|
||||
break;
|
||||
#endif // ifndef NO_SOFTWARE_RENDERING
|
||||
|
||||
#ifdef USE_OPENGL
|
||||
case GR_OPENGL:
|
||||
gr_opengl_bitmap_ex(x, y, w, h, sx, sy);
|
||||
|
||||
@@ -9,13 +9,16 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Graphics/aaline.cpp $
|
||||
* $Revision: 2.2 $
|
||||
* $Date: 2002-08-01 01:41:05 $
|
||||
* $Revision: 2.3 $
|
||||
* $Date: 2003-03-02 05:42:25 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
* Code to draw antialiased lines
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.2 2002/08/01 01:41:05 penguin
|
||||
* The big include file move
|
||||
*
|
||||
* Revision 2.1 2002/07/07 19:55:59 penguin
|
||||
* Back-port to MSVC
|
||||
*
|
||||
@@ -246,11 +249,12 @@ void aaline_init_tables()
|
||||
// less than 1.0 and less total bits are sufficient.
|
||||
// Some of the steps here are not needed. This was originally
|
||||
// written to simulate exact hardware behavior.
|
||||
#if defined( _WIN32 ) && defined( _MSC_VER )
|
||||
#if defined _WIN32
|
||||
long int fix_xy_mult(long int oa, fix_xy ob)
|
||||
{
|
||||
int retval;
|
||||
|
||||
#if defined _MSC_VER
|
||||
_asm {
|
||||
mov edx, oa
|
||||
mov eax, ob
|
||||
@@ -258,11 +262,26 @@ long int fix_xy_mult(long int oa, fix_xy ob)
|
||||
shrd eax,edx,20
|
||||
mov retval, eax
|
||||
}
|
||||
#elif defined __GNUC__
|
||||
asm(
|
||||
"mov %1,%%edx;"
|
||||
"mov %2,%%eax;"
|
||||
"imul %%edx;"
|
||||
"shrd $20,%%eax,%%edx;"
|
||||
"mov %%eax,%0"
|
||||
: "=g" (retval) // outputs
|
||||
: "g" (oa), "g" (ob) // inputs
|
||||
: "eax", "edx" // clobbered registers
|
||||
);
|
||||
#else
|
||||
#error unknown compiler
|
||||
#endif
|
||||
return retval;
|
||||
}
|
||||
#else
|
||||
#error unknown OS
|
||||
long int fix_xy_mult(long int oa, fix_xy ob);
|
||||
#endif // if defined( _WIN32 ) && defined( _MSC_VER )
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -9,13 +9,16 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Graphics/Font.cpp $
|
||||
* $Revision: 2.3 $
|
||||
* $Date: 2002-08-01 01:41:05 $
|
||||
* $Revision: 2.4 $
|
||||
* $Date: 2003-03-02 05:41:52 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
* source file for font stuff
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.3 2002/08/01 01:41:05 penguin
|
||||
* The big include file move
|
||||
*
|
||||
* Revision 2.2 2002/07/29 20:12:31 penguin
|
||||
* added #ifdef _WIN32 around windows-specific system headers
|
||||
*
|
||||
@@ -644,6 +647,7 @@ void gr8_string(int sx, int sy, char *s )
|
||||
gr_unlock();
|
||||
}
|
||||
|
||||
#ifndef NO_SOFTWARE_RENDERING
|
||||
#ifdef _WIN32
|
||||
HFONT MyhFont = NULL;
|
||||
extern HDC hDibDC;
|
||||
@@ -733,7 +737,8 @@ void gr_get_string_size_win(int *w, int *h, char *text)
|
||||
if (h)
|
||||
*h += size.cy;
|
||||
}
|
||||
#endif
|
||||
#endif // ifdef _WIN32
|
||||
#endif // ifndef NO_SOFTWARE_RENDERING
|
||||
|
||||
char grx_printf_text[2048];
|
||||
|
||||
|
||||
@@ -0,0 +1,373 @@
|
||||
/*++ BUILD Version: 0004 // Increment this if a change has global effects
|
||||
|
||||
Copyright (c) 1985-95, Microsoft Corporation
|
||||
|
||||
Module Name:
|
||||
|
||||
glaux.h
|
||||
|
||||
Abstract:
|
||||
|
||||
Procedure declarations, constant definitions and macros for the OpenGL
|
||||
Auxiliary Library.
|
||||
|
||||
--*/
|
||||
|
||||
#ifndef __GLAUX_H__
|
||||
#define __GLAUX_H__
|
||||
|
||||
/*
|
||||
* (c) Copyright 1993, Silicon Graphics, Inc.
|
||||
* ALL RIGHTS RESERVED
|
||||
* Permission to use, copy, modify, and distribute this software for
|
||||
* any purpose and without fee is hereby granted, provided that the above
|
||||
* copyright notice appear in all copies and that both the copyright notice
|
||||
* and this permission notice appear in supporting documentation, and that
|
||||
* the name of Silicon Graphics, Inc. not be used in advertising
|
||||
* or publicity pertaining to distribution of the software without specific,
|
||||
* written prior permission.
|
||||
*
|
||||
* THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS"
|
||||
* AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE,
|
||||
* INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
|
||||
* GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT,
|
||||
* SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY
|
||||
* KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION,
|
||||
* LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF
|
||||
* THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC. HAS BEEN
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON
|
||||
* ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE
|
||||
* POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*
|
||||
* US Government Users Restricted Rights
|
||||
* Use, duplication, or disclosure by the Government is subject to
|
||||
* restrictions set forth in FAR 52.227.19(c)(2) or subparagraph
|
||||
* (c)(1)(ii) of the Rights in Technical Data and Computer Software
|
||||
* clause at DFARS 252.227-7013 and/or in similar or successor
|
||||
* clauses in the FAR or the DOD or NASA FAR Supplement.
|
||||
* Unpublished-- rights reserved under the copyright laws of the
|
||||
* United States. Contractor/manufacturer is Silicon Graphics,
|
||||
* Inc., 2011 N. Shoreline Blvd., Mountain View, CA 94039-7311.
|
||||
*
|
||||
* OpenGL(TM) is a trademark of Silicon Graphics, Inc.
|
||||
*/
|
||||
|
||||
#include <windows.h>
|
||||
#include <GL/gl.h>
|
||||
#include <GL/glu.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
** ToolKit Window Types
|
||||
** In the future, AUX_RGBA may be a combination of both RGB and ALPHA
|
||||
*/
|
||||
|
||||
#define AUX_RGB 0
|
||||
#define AUX_RGBA AUX_RGB
|
||||
#define AUX_INDEX 1
|
||||
#define AUX_SINGLE 0
|
||||
#define AUX_DOUBLE 2
|
||||
#define AUX_DIRECT 0
|
||||
#define AUX_INDIRECT 4
|
||||
|
||||
#define AUX_ACCUM 8
|
||||
#define AUX_ALPHA 16
|
||||
#define AUX_DEPTH24 32 /* 24-bit depth buffer */
|
||||
#define AUX_STENCIL 64
|
||||
#define AUX_AUX 128
|
||||
#define AUX_DEPTH16 256 /* 16-bit depth buffer */
|
||||
#define AUX_FIXED_332_PAL 512
|
||||
#define AUX_DEPTH AUX_DEPTH16 /* default is 16-bit depth buffer */
|
||||
|
||||
/*
|
||||
** Window Masks
|
||||
*/
|
||||
|
||||
#define AUX_WIND_IS_RGB(x) (((x) & AUX_INDEX) == 0)
|
||||
#define AUX_WIND_IS_INDEX(x) (((x) & AUX_INDEX) != 0)
|
||||
#define AUX_WIND_IS_SINGLE(x) (((x) & AUX_DOUBLE) == 0)
|
||||
#define AUX_WIND_IS_DOUBLE(x) (((x) & AUX_DOUBLE) != 0)
|
||||
#define AUX_WIND_IS_INDIRECT(x) (((x) & AUX_INDIRECT) != 0)
|
||||
#define AUX_WIND_IS_DIRECT(x) (((x) & AUX_INDIRECT) == 0)
|
||||
#define AUX_WIND_HAS_ACCUM(x) (((x) & AUX_ACCUM) != 0)
|
||||
#define AUX_WIND_HAS_ALPHA(x) (((x) & AUX_ALPHA) != 0)
|
||||
#define AUX_WIND_HAS_DEPTH(x) (((x) & (AUX_DEPTH24 | AUX_DEPTH16)) != 0)
|
||||
#define AUX_WIND_HAS_STENCIL(x) (((x) & AUX_STENCIL) != 0)
|
||||
#define AUX_WIND_USES_FIXED_332_PAL(x) (((x) & AUX_FIXED_332_PAL) != 0)
|
||||
|
||||
/*
|
||||
** ToolKit Event Structure
|
||||
*/
|
||||
|
||||
typedef struct _AUX_EVENTREC {
|
||||
GLint event;
|
||||
GLint data[4];
|
||||
} AUX_EVENTREC;
|
||||
|
||||
/*
|
||||
** ToolKit Event Types
|
||||
*/
|
||||
#define AUX_EXPOSE 1
|
||||
#define AUX_CONFIG 2
|
||||
#define AUX_DRAW 4
|
||||
#define AUX_KEYEVENT 8
|
||||
#define AUX_MOUSEDOWN 16
|
||||
#define AUX_MOUSEUP 32
|
||||
#define AUX_MOUSELOC 64
|
||||
|
||||
/*
|
||||
** Toolkit Event Data Indices
|
||||
*/
|
||||
#define AUX_WINDOWX 0
|
||||
#define AUX_WINDOWY 1
|
||||
#define AUX_MOUSEX 0
|
||||
#define AUX_MOUSEY 1
|
||||
#define AUX_MOUSESTATUS 3
|
||||
#define AUX_KEY 0
|
||||
#define AUX_KEYSTATUS 1
|
||||
|
||||
/*
|
||||
** ToolKit Event Status Messages
|
||||
*/
|
||||
#define AUX_LEFTBUTTON 1
|
||||
#define AUX_RIGHTBUTTON 2
|
||||
#define AUX_MIDDLEBUTTON 4
|
||||
#define AUX_SHIFT 1
|
||||
#define AUX_CONTROL 2
|
||||
|
||||
/*
|
||||
** ToolKit Key Codes
|
||||
*/
|
||||
#define AUX_RETURN 0x0D
|
||||
#define AUX_ESCAPE 0x1B
|
||||
#define AUX_SPACE 0x20
|
||||
#define AUX_LEFT 0x25
|
||||
#define AUX_UP 0x26
|
||||
#define AUX_RIGHT 0x27
|
||||
#define AUX_DOWN 0x28
|
||||
#define AUX_A 'A'
|
||||
#define AUX_B 'B'
|
||||
#define AUX_C 'C'
|
||||
#define AUX_D 'D'
|
||||
#define AUX_E 'E'
|
||||
#define AUX_F 'F'
|
||||
#define AUX_G 'G'
|
||||
#define AUX_H 'H'
|
||||
#define AUX_I 'I'
|
||||
#define AUX_J 'J'
|
||||
#define AUX_K 'K'
|
||||
#define AUX_L 'L'
|
||||
#define AUX_M 'M'
|
||||
#define AUX_N 'N'
|
||||
#define AUX_O 'O'
|
||||
#define AUX_P 'P'
|
||||
#define AUX_Q 'Q'
|
||||
#define AUX_R 'R'
|
||||
#define AUX_S 'S'
|
||||
#define AUX_T 'T'
|
||||
#define AUX_U 'U'
|
||||
#define AUX_V 'V'
|
||||
#define AUX_W 'W'
|
||||
#define AUX_X 'X'
|
||||
#define AUX_Y 'Y'
|
||||
#define AUX_Z 'Z'
|
||||
#define AUX_a 'a'
|
||||
#define AUX_b 'b'
|
||||
#define AUX_c 'c'
|
||||
#define AUX_d 'd'
|
||||
#define AUX_e 'e'
|
||||
#define AUX_f 'f'
|
||||
#define AUX_g 'g'
|
||||
#define AUX_h 'h'
|
||||
#define AUX_i 'i'
|
||||
#define AUX_j 'j'
|
||||
#define AUX_k 'k'
|
||||
#define AUX_l 'l'
|
||||
#define AUX_m 'm'
|
||||
#define AUX_n 'n'
|
||||
#define AUX_o 'o'
|
||||
#define AUX_p 'p'
|
||||
#define AUX_q 'q'
|
||||
#define AUX_r 'r'
|
||||
#define AUX_s 's'
|
||||
#define AUX_t 't'
|
||||
#define AUX_u 'u'
|
||||
#define AUX_v 'v'
|
||||
#define AUX_w 'w'
|
||||
#define AUX_x 'x'
|
||||
#define AUX_y 'y'
|
||||
#define AUX_z 'z'
|
||||
#define AUX_0 '0'
|
||||
#define AUX_1 '1'
|
||||
#define AUX_2 '2'
|
||||
#define AUX_3 '3'
|
||||
#define AUX_4 '4'
|
||||
#define AUX_5 '5'
|
||||
#define AUX_6 '6'
|
||||
#define AUX_7 '7'
|
||||
#define AUX_8 '8'
|
||||
#define AUX_9 '9'
|
||||
|
||||
/*
|
||||
** ToolKit Gets and Sets
|
||||
*/
|
||||
#define AUX_FD 1 /* return fd (long) */
|
||||
#define AUX_COLORMAP 3 /* pass buf of r, g and b (unsigned char) */
|
||||
#define AUX_GREYSCALEMAP 4
|
||||
#define AUX_FOGMAP 5 /* pass fog and color bits (long) */
|
||||
#define AUX_ONECOLOR 6 /* pass index, r, g, and b (long) */
|
||||
|
||||
/*
|
||||
** Color Macros
|
||||
*/
|
||||
|
||||
#define AUX_BLACK 0
|
||||
#define AUX_RED 13
|
||||
#define AUX_GREEN 14
|
||||
#define AUX_YELLOW 15
|
||||
#define AUX_BLUE 16
|
||||
#define AUX_MAGENTA 17
|
||||
#define AUX_CYAN 18
|
||||
#define AUX_WHITE 19
|
||||
|
||||
extern float auxRGBMap[20][3];
|
||||
|
||||
#define AUX_SETCOLOR(x, y) (AUX_WIND_IS_RGB((x)) ? \
|
||||
glColor3fv(auxRGBMap[(y)]) : glIndexf((y)))
|
||||
|
||||
/*
|
||||
** RGB Image Structure
|
||||
*/
|
||||
|
||||
typedef struct _AUX_RGBImageRec {
|
||||
GLint sizeX, sizeY;
|
||||
unsigned char *data;
|
||||
} AUX_RGBImageRec;
|
||||
|
||||
/*
|
||||
** Prototypes
|
||||
*/
|
||||
|
||||
void APIENTRY auxInitDisplayMode(GLenum);
|
||||
void APIENTRY auxInitPosition(int, int, int, int);
|
||||
|
||||
/* GLenum APIENTRY auxInitWindow(LPCTSTR); */
|
||||
#ifdef UNICODE
|
||||
#define auxInitWindow auxInitWindowW
|
||||
#else
|
||||
#define auxInitWindow auxInitWindowA
|
||||
#endif
|
||||
GLenum APIENTRY auxInitWindowA(LPCSTR);
|
||||
GLenum APIENTRY auxInitWindowW(LPCWSTR);
|
||||
|
||||
void APIENTRY auxCloseWindow(void);
|
||||
void APIENTRY auxQuit(void);
|
||||
void APIENTRY auxSwapBuffers(void);
|
||||
|
||||
typedef void (CALLBACK* AUXMAINPROC)(void);
|
||||
void APIENTRY auxMainLoop(AUXMAINPROC);
|
||||
|
||||
typedef void (CALLBACK* AUXEXPOSEPROC)(int, int);
|
||||
void APIENTRY auxExposeFunc(AUXEXPOSEPROC);
|
||||
|
||||
typedef void (CALLBACK* AUXRESHAPEPROC)(GLsizei, GLsizei);
|
||||
void APIENTRY auxReshapeFunc(AUXRESHAPEPROC);
|
||||
|
||||
typedef void (CALLBACK* AUXIDLEPROC)(void);
|
||||
void APIENTRY auxIdleFunc(AUXIDLEPROC);
|
||||
|
||||
typedef void (CALLBACK* AUXKEYPROC)(void);
|
||||
void APIENTRY auxKeyFunc(int, AUXKEYPROC);
|
||||
|
||||
typedef void (CALLBACK* AUXMOUSEPROC)(AUX_EVENTREC *);
|
||||
void APIENTRY auxMouseFunc(int, int, AUXMOUSEPROC);
|
||||
|
||||
int APIENTRY auxGetColorMapSize(void);
|
||||
void APIENTRY auxGetMouseLoc(int *, int *);
|
||||
void APIENTRY auxSetOneColor(int, float, float, float);
|
||||
void APIENTRY auxSetFogRamp(int, int);
|
||||
void APIENTRY auxSetGreyRamp(void);
|
||||
void APIENTRY auxSetRGBMap(int, float *);
|
||||
|
||||
/* AUX_RGBImageRec * APIENTRY auxRGBImageLoad(LPCTSTR); */
|
||||
#ifdef UNICODE
|
||||
#define auxRGBImageLoad auxRGBImageLoadW
|
||||
#else
|
||||
#define auxRGBImageLoad auxRGBImageLoadA
|
||||
#endif
|
||||
AUX_RGBImageRec * APIENTRY auxRGBImageLoadA(LPCSTR);
|
||||
AUX_RGBImageRec * APIENTRY auxRGBImageLoadW(LPCWSTR);
|
||||
|
||||
#ifdef UNICODE
|
||||
#define auxDIBImageLoad auxDIBImageLoadW
|
||||
#else
|
||||
#define auxDIBImageLoad auxDIBImageLoadA
|
||||
#endif
|
||||
AUX_RGBImageRec * APIENTRY auxDIBImageLoadA(LPCSTR);
|
||||
AUX_RGBImageRec * APIENTRY auxDIBImageLoadW(LPCWSTR);
|
||||
|
||||
void APIENTRY auxCreateFont(void);
|
||||
/* void APIENTRY auxDrawStr(LPCTSTR); */
|
||||
#ifdef UNICODE
|
||||
#define auxDrawStr auxDrawStrW
|
||||
#else
|
||||
#define auxDrawStr auxDrawStrA
|
||||
#endif
|
||||
void APIENTRY auxDrawStrA(LPCSTR);
|
||||
void APIENTRY auxDrawStrW(LPCWSTR);
|
||||
|
||||
void APIENTRY auxWireSphere(GLdouble);
|
||||
void APIENTRY auxSolidSphere(GLdouble);
|
||||
void APIENTRY auxWireCube(GLdouble);
|
||||
void APIENTRY auxSolidCube(GLdouble);
|
||||
void APIENTRY auxWireBox(GLdouble, GLdouble, GLdouble);
|
||||
void APIENTRY auxSolidBox(GLdouble, GLdouble, GLdouble);
|
||||
void APIENTRY auxWireTorus(GLdouble, GLdouble);
|
||||
void APIENTRY auxSolidTorus(GLdouble, GLdouble);
|
||||
void APIENTRY auxWireCylinder(GLdouble, GLdouble);
|
||||
void APIENTRY auxSolidCylinder(GLdouble, GLdouble);
|
||||
void APIENTRY auxWireIcosahedron(GLdouble);
|
||||
void APIENTRY auxSolidIcosahedron(GLdouble);
|
||||
void APIENTRY auxWireOctahedron(GLdouble);
|
||||
void APIENTRY auxSolidOctahedron(GLdouble);
|
||||
void APIENTRY auxWireTetrahedron(GLdouble);
|
||||
void APIENTRY auxSolidTetrahedron(GLdouble);
|
||||
void APIENTRY auxWireDodecahedron(GLdouble);
|
||||
void APIENTRY auxSolidDodecahedron(GLdouble);
|
||||
void APIENTRY auxWireCone(GLdouble, GLdouble);
|
||||
void APIENTRY auxSolidCone(GLdouble, GLdouble);
|
||||
void APIENTRY auxWireTeapot(GLdouble);
|
||||
void APIENTRY auxSolidTeapot(GLdouble);
|
||||
|
||||
/*
|
||||
** Window specific functions
|
||||
** hwnd, hdc, and hglrc valid after auxInitWindow()
|
||||
*/
|
||||
HWND APIENTRY auxGetHWND(void);
|
||||
HDC APIENTRY auxGetHDC(void);
|
||||
HGLRC APIENTRY auxGetHGLRC(void);
|
||||
|
||||
/*
|
||||
** Viewperf support functions and constants
|
||||
*/
|
||||
/* Display Mode Selection Criteria */
|
||||
enum {
|
||||
AUX_USE_ID = 1,
|
||||
AUX_EXACT_MATCH,
|
||||
AUX_MINIMUM_CRITERIA
|
||||
};
|
||||
void APIENTRY auxInitDisplayModePolicy(GLenum);
|
||||
GLenum APIENTRY auxInitDisplayModeID(GLint);
|
||||
GLenum APIENTRY auxGetDisplayModePolicy(void);
|
||||
GLint APIENTRY auxGetDisplayModeID(void);
|
||||
GLenum APIENTRY auxGetDisplayMode(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __GLAUX_H__ */
|
||||
@@ -0,0 +1,584 @@
|
||||
/*++ BUILD Version: 0004 // Increment this if a change has global effects
|
||||
|
||||
Copyright (c) 1985-95, Microsoft Corporation
|
||||
|
||||
Module Name:
|
||||
|
||||
glu.h
|
||||
|
||||
Abstract:
|
||||
|
||||
Procedure declarations, constant definitions and macros for the OpenGL
|
||||
Utility Library.
|
||||
|
||||
--*/
|
||||
|
||||
#ifndef __glu_h__
|
||||
#ifndef __GLU_H__
|
||||
|
||||
#define __glu_h__
|
||||
#define __GLU_H__
|
||||
|
||||
#include <GL/gl.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
** Copyright 1991-1993, Silicon Graphics, Inc.
|
||||
** All Rights Reserved.
|
||||
**
|
||||
** This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
|
||||
** the contents of this file may not be disclosed to third parties, copied or
|
||||
** duplicated in any form, in whole or in part, without the prior written
|
||||
** permission of Silicon Graphics, Inc.
|
||||
**
|
||||
** RESTRICTED RIGHTS LEGEND:
|
||||
** Use, duplication or disclosure by the Government is subject to restrictions
|
||||
** as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
|
||||
** and Computer Software clause at DFARS 252.227-7013, and/or in similar or
|
||||
** successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
|
||||
** rights reserved under the Copyright Laws of the United States.
|
||||
*/
|
||||
|
||||
/*
|
||||
** Return the error string associated with a particular error code.
|
||||
** This will return 0 for an invalid error code.
|
||||
**
|
||||
** The generic function prototype that can be compiled for ANSI or Unicode
|
||||
** is defined as follows:
|
||||
**
|
||||
** LPCTSTR APIENTRY gluErrorStringWIN (GLenum errCode);
|
||||
*/
|
||||
#ifdef UNICODE
|
||||
#define gluErrorStringWIN(errCode) ((LPCSTR) gluErrorUnicodeStringEXT(errCode))
|
||||
#else
|
||||
#define gluErrorStringWIN(errCode) ((LPCWSTR) gluErrorString(errCode))
|
||||
#endif
|
||||
|
||||
const GLubyte* APIENTRY gluErrorString (
|
||||
GLenum errCode);
|
||||
|
||||
const wchar_t* APIENTRY gluErrorUnicodeStringEXT (
|
||||
GLenum errCode);
|
||||
|
||||
const GLubyte* APIENTRY gluGetString (
|
||||
GLenum name);
|
||||
|
||||
void APIENTRY gluOrtho2D (
|
||||
GLdouble left,
|
||||
GLdouble right,
|
||||
GLdouble bottom,
|
||||
GLdouble top);
|
||||
|
||||
void APIENTRY gluPerspective (
|
||||
GLdouble fovy,
|
||||
GLdouble aspect,
|
||||
GLdouble zNear,
|
||||
GLdouble zFar);
|
||||
|
||||
void APIENTRY gluPickMatrix (
|
||||
GLdouble x,
|
||||
GLdouble y,
|
||||
GLdouble width,
|
||||
GLdouble height,
|
||||
GLint viewport[4]);
|
||||
|
||||
void APIENTRY gluLookAt (
|
||||
GLdouble eyex,
|
||||
GLdouble eyey,
|
||||
GLdouble eyez,
|
||||
GLdouble centerx,
|
||||
GLdouble centery,
|
||||
GLdouble centerz,
|
||||
GLdouble upx,
|
||||
GLdouble upy,
|
||||
GLdouble upz);
|
||||
|
||||
int APIENTRY gluProject (
|
||||
GLdouble objx,
|
||||
GLdouble objy,
|
||||
GLdouble objz,
|
||||
const GLdouble modelMatrix[16],
|
||||
const GLdouble projMatrix[16],
|
||||
const GLint viewport[4],
|
||||
GLdouble *winx,
|
||||
GLdouble *winy,
|
||||
GLdouble *winz);
|
||||
|
||||
int APIENTRY gluUnProject (
|
||||
GLdouble winx,
|
||||
GLdouble winy,
|
||||
GLdouble winz,
|
||||
const GLdouble modelMatrix[16],
|
||||
const GLdouble projMatrix[16],
|
||||
const GLint viewport[4],
|
||||
GLdouble *objx,
|
||||
GLdouble *objy,
|
||||
GLdouble *objz);
|
||||
|
||||
|
||||
int APIENTRY gluScaleImage (
|
||||
GLenum format,
|
||||
GLint widthin,
|
||||
GLint heightin,
|
||||
GLenum typein,
|
||||
const void *datain,
|
||||
GLint widthout,
|
||||
GLint heightout,
|
||||
GLenum typeout,
|
||||
void *dataout);
|
||||
|
||||
|
||||
int APIENTRY gluBuild1DMipmaps (
|
||||
GLenum target,
|
||||
GLint components,
|
||||
GLint width,
|
||||
GLenum format,
|
||||
GLenum type,
|
||||
const void *data);
|
||||
|
||||
int APIENTRY gluBuild2DMipmaps (
|
||||
GLenum target,
|
||||
GLint components,
|
||||
GLint width,
|
||||
GLint height,
|
||||
GLenum format,
|
||||
GLenum type,
|
||||
const void *data);
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
class GLUnurbs;
|
||||
class GLUquadric;
|
||||
class GLUtesselator;
|
||||
|
||||
/* backwards compatibility: */
|
||||
typedef class GLUnurbs GLUnurbsObj;
|
||||
typedef class GLUquadric GLUquadricObj;
|
||||
typedef class GLUtesselator GLUtesselatorObj;
|
||||
typedef class GLUtesselator GLUtriangulatorObj;
|
||||
|
||||
#else
|
||||
|
||||
typedef struct GLUnurbs GLUnurbs;
|
||||
typedef struct GLUquadric GLUquadric;
|
||||
typedef struct GLUtesselator GLUtesselator;
|
||||
|
||||
/* backwards compatibility: */
|
||||
typedef struct GLUnurbs GLUnurbsObj;
|
||||
typedef struct GLUquadric GLUquadricObj;
|
||||
typedef struct GLUtesselator GLUtesselatorObj;
|
||||
typedef struct GLUtesselator GLUtriangulatorObj;
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
GLUquadric* APIENTRY gluNewQuadric (void);
|
||||
void APIENTRY gluDeleteQuadric (
|
||||
GLUquadric *state);
|
||||
|
||||
void APIENTRY gluQuadricNormals (
|
||||
GLUquadric *quadObject,
|
||||
GLenum normals);
|
||||
|
||||
void APIENTRY gluQuadricTexture (
|
||||
GLUquadric *quadObject,
|
||||
GLboolean textureCoords);
|
||||
|
||||
void APIENTRY gluQuadricOrientation (
|
||||
GLUquadric *quadObject,
|
||||
GLenum orientation);
|
||||
|
||||
void APIENTRY gluQuadricDrawStyle (
|
||||
GLUquadric *quadObject,
|
||||
GLenum drawStyle);
|
||||
|
||||
void APIENTRY gluCylinder (
|
||||
GLUquadric *qobj,
|
||||
GLdouble baseRadius,
|
||||
GLdouble topRadius,
|
||||
GLdouble height,
|
||||
GLint slices,
|
||||
GLint stacks);
|
||||
|
||||
void APIENTRY gluDisk (
|
||||
GLUquadric *qobj,
|
||||
GLdouble innerRadius,
|
||||
GLdouble outerRadius,
|
||||
GLint slices,
|
||||
GLint loops);
|
||||
|
||||
void APIENTRY gluPartialDisk (
|
||||
GLUquadric *qobj,
|
||||
GLdouble innerRadius,
|
||||
GLdouble outerRadius,
|
||||
GLint slices,
|
||||
GLint loops,
|
||||
GLdouble startAngle,
|
||||
GLdouble sweepAngle);
|
||||
|
||||
void APIENTRY gluSphere (
|
||||
GLUquadric *qobj,
|
||||
GLdouble radius,
|
||||
GLint slices,
|
||||
GLint stacks);
|
||||
|
||||
void APIENTRY gluQuadricCallback (
|
||||
GLUquadric *qobj,
|
||||
GLenum which,
|
||||
void (CALLBACK* fn)());
|
||||
|
||||
GLUtesselator* APIENTRY gluNewTess(
|
||||
void );
|
||||
|
||||
void APIENTRY gluDeleteTess(
|
||||
GLUtesselator *tess );
|
||||
|
||||
void APIENTRY gluTessBeginPolygon(
|
||||
GLUtesselator *tess,
|
||||
void *polygon_data );
|
||||
|
||||
void APIENTRY gluTessBeginContour(
|
||||
GLUtesselator *tess );
|
||||
|
||||
void APIENTRY gluTessVertex(
|
||||
GLUtesselator *tess,
|
||||
GLdouble coords[3],
|
||||
void *data );
|
||||
|
||||
void APIENTRY gluTessEndContour(
|
||||
GLUtesselator *tess );
|
||||
|
||||
void APIENTRY gluTessEndPolygon(
|
||||
GLUtesselator *tess );
|
||||
|
||||
void APIENTRY gluTessProperty(
|
||||
GLUtesselator *tess,
|
||||
GLenum which,
|
||||
GLdouble value );
|
||||
|
||||
void APIENTRY gluTessNormal(
|
||||
GLUtesselator *tess,
|
||||
GLdouble x,
|
||||
GLdouble y,
|
||||
GLdouble z );
|
||||
|
||||
void APIENTRY gluTessCallback(
|
||||
GLUtesselator *tess,
|
||||
GLenum which,
|
||||
void (CALLBACK *fn)());
|
||||
|
||||
void APIENTRY gluGetTessProperty(
|
||||
GLUtesselator *tess,
|
||||
GLenum which,
|
||||
GLdouble *value );
|
||||
|
||||
GLUnurbs* APIENTRY gluNewNurbsRenderer (void);
|
||||
|
||||
void APIENTRY gluDeleteNurbsRenderer (
|
||||
GLUnurbs *nobj);
|
||||
|
||||
void APIENTRY gluBeginSurface (
|
||||
GLUnurbs *nobj);
|
||||
|
||||
void APIENTRY gluBeginCurve (
|
||||
GLUnurbs *nobj);
|
||||
|
||||
void APIENTRY gluEndCurve (
|
||||
GLUnurbs *nobj);
|
||||
|
||||
void APIENTRY gluEndSurface (
|
||||
GLUnurbs *nobj);
|
||||
|
||||
void APIENTRY gluBeginTrim (
|
||||
GLUnurbs *nobj);
|
||||
|
||||
void APIENTRY gluEndTrim (
|
||||
GLUnurbs *nobj);
|
||||
|
||||
void APIENTRY gluPwlCurve (
|
||||
GLUnurbs *nobj,
|
||||
GLint count,
|
||||
GLfloat *array,
|
||||
GLint stride,
|
||||
GLenum type);
|
||||
|
||||
void APIENTRY gluNurbsCurve (
|
||||
GLUnurbs *nobj,
|
||||
GLint nknots,
|
||||
GLfloat *knot,
|
||||
GLint stride,
|
||||
GLfloat *ctlarray,
|
||||
GLint order,
|
||||
GLenum type);
|
||||
|
||||
void APIENTRY
|
||||
gluNurbsSurface(
|
||||
GLUnurbs *nobj,
|
||||
GLint sknot_count,
|
||||
float *sknot,
|
||||
GLint tknot_count,
|
||||
GLfloat *tknot,
|
||||
GLint s_stride,
|
||||
GLint t_stride,
|
||||
GLfloat *ctlarray,
|
||||
GLint sorder,
|
||||
GLint torder,
|
||||
GLenum type);
|
||||
|
||||
void APIENTRY
|
||||
gluLoadSamplingMatrices (
|
||||
GLUnurbs *nobj,
|
||||
const GLfloat modelMatrix[16],
|
||||
const GLfloat projMatrix[16],
|
||||
const GLint viewport[4] );
|
||||
|
||||
void APIENTRY
|
||||
gluNurbsProperty (
|
||||
GLUnurbs *nobj,
|
||||
GLenum property,
|
||||
GLfloat value );
|
||||
|
||||
void APIENTRY
|
||||
gluGetNurbsProperty (
|
||||
GLUnurbs *nobj,
|
||||
GLenum property,
|
||||
GLfloat *value );
|
||||
|
||||
void APIENTRY
|
||||
gluNurbsCallback (
|
||||
GLUnurbs *nobj,
|
||||
GLenum which,
|
||||
void (CALLBACK* fn)() );
|
||||
|
||||
|
||||
/**** Callback function prototypes ****/
|
||||
|
||||
/* gluQuadricCallback */
|
||||
typedef void (CALLBACK* GLUquadricErrorProc) (GLenum);
|
||||
|
||||
/* gluTessCallback */
|
||||
typedef void (CALLBACK* GLUtessBeginProc) (GLenum);
|
||||
typedef void (CALLBACK* GLUtessEdgeFlagProc) (GLboolean);
|
||||
typedef void (CALLBACK* GLUtessVertexProc) (void *);
|
||||
typedef void (CALLBACK* GLUtessEndProc) (void);
|
||||
typedef void (CALLBACK* GLUtessErrorProc) (GLenum);
|
||||
typedef void (CALLBACK* GLUtessCombineProc) (GLdouble[3],
|
||||
void*[4],
|
||||
GLfloat[4],
|
||||
void** );
|
||||
typedef void (CALLBACK* GLUtessBeginDataProc) (GLenum, void *);
|
||||
typedef void (CALLBACK* GLUtessEdgeFlagDataProc) (GLboolean, void *);
|
||||
typedef void (CALLBACK* GLUtessVertexDataProc) (void *, void *);
|
||||
typedef void (CALLBACK* GLUtessEndDataProc) (void *);
|
||||
typedef void (CALLBACK* GLUtessErrorDataProc) (GLenum, void *);
|
||||
typedef void (CALLBACK* GLUtessCombineDataProc) (GLdouble[3],
|
||||
void*[4],
|
||||
GLfloat[4],
|
||||
void**,
|
||||
void* );
|
||||
|
||||
/* gluNurbsCallback */
|
||||
typedef void (CALLBACK* GLUnurbsErrorProc) (GLenum);
|
||||
|
||||
|
||||
/**** Generic constants ****/
|
||||
|
||||
/* Version */
|
||||
#define GLU_VERSION_1_1 1
|
||||
#define GLU_VERSION_1_2 1
|
||||
|
||||
/* Errors: (return value 0 = no error) */
|
||||
#define GLU_INVALID_ENUM 100900
|
||||
#define GLU_INVALID_VALUE 100901
|
||||
#define GLU_OUT_OF_MEMORY 100902
|
||||
#define GLU_INCOMPATIBLE_GL_VERSION 100903
|
||||
|
||||
/* StringName */
|
||||
#define GLU_VERSION 100800
|
||||
#define GLU_EXTENSIONS 100801
|
||||
|
||||
/* Boolean */
|
||||
#define GLU_TRUE GL_TRUE
|
||||
#define GLU_FALSE GL_FALSE
|
||||
|
||||
|
||||
/**** Quadric constants ****/
|
||||
|
||||
/* QuadricNormal */
|
||||
#define GLU_SMOOTH 100000
|
||||
#define GLU_FLAT 100001
|
||||
#define GLU_NONE 100002
|
||||
|
||||
/* QuadricDrawStyle */
|
||||
#define GLU_POINT 100010
|
||||
#define GLU_LINE 100011
|
||||
#define GLU_FILL 100012
|
||||
#define GLU_SILHOUETTE 100013
|
||||
|
||||
/* QuadricOrientation */
|
||||
#define GLU_OUTSIDE 100020
|
||||
#define GLU_INSIDE 100021
|
||||
|
||||
/* Callback types: */
|
||||
/* GLU_ERROR 100103 */
|
||||
|
||||
|
||||
/**** Tesselation constants ****/
|
||||
|
||||
#define GLU_TESS_MAX_COORD 1.0e150
|
||||
|
||||
/* TessProperty */
|
||||
#define GLU_TESS_WINDING_RULE 100140
|
||||
#define GLU_TESS_BOUNDARY_ONLY 100141
|
||||
#define GLU_TESS_TOLERANCE 100142
|
||||
|
||||
/* TessWinding */
|
||||
#define GLU_TESS_WINDING_ODD 100130
|
||||
#define GLU_TESS_WINDING_NONZERO 100131
|
||||
#define GLU_TESS_WINDING_POSITIVE 100132
|
||||
#define GLU_TESS_WINDING_NEGATIVE 100133
|
||||
#define GLU_TESS_WINDING_ABS_GEQ_TWO 100134
|
||||
|
||||
/* TessCallback */
|
||||
#define GLU_TESS_BEGIN 100100 /* void (CALLBACK*)(GLenum type) */
|
||||
#define GLU_TESS_VERTEX 100101 /* void (CALLBACK*)(void *data) */
|
||||
#define GLU_TESS_END 100102 /* void (CALLBACK*)(void) */
|
||||
#define GLU_TESS_ERROR 100103 /* void (CALLBACK*)(GLenum errno) */
|
||||
#define GLU_TESS_EDGE_FLAG 100104 /* void (CALLBACK*)(GLboolean boundaryEdge) */
|
||||
#define GLU_TESS_COMBINE 100105 /* void (CALLBACK*)(GLdouble coords[3],
|
||||
void *data[4],
|
||||
GLfloat weight[4],
|
||||
void **dataOut) */
|
||||
#define GLU_TESS_BEGIN_DATA 100106 /* void (CALLBACK*)(GLenum type,
|
||||
void *polygon_data) */
|
||||
#define GLU_TESS_VERTEX_DATA 100107 /* void (CALLBACK*)(void *data,
|
||||
void *polygon_data) */
|
||||
#define GLU_TESS_END_DATA 100108 /* void (CALLBACK*)(void *polygon_data) */
|
||||
#define GLU_TESS_ERROR_DATA 100109 /* void (CALLBACK*)(GLenum errno,
|
||||
void *polygon_data) */
|
||||
#define GLU_TESS_EDGE_FLAG_DATA 100110 /* void (CALLBACK*)(GLboolean boundaryEdge,
|
||||
void *polygon_data) */
|
||||
#define GLU_TESS_COMBINE_DATA 100111 /* void (CALLBACK*)(GLdouble coords[3],
|
||||
void *data[4],
|
||||
GLfloat weight[4],
|
||||
void **dataOut,
|
||||
void *polygon_data) */
|
||||
|
||||
/* TessError */
|
||||
#define GLU_TESS_ERROR1 100151
|
||||
#define GLU_TESS_ERROR2 100152
|
||||
#define GLU_TESS_ERROR3 100153
|
||||
#define GLU_TESS_ERROR4 100154
|
||||
#define GLU_TESS_ERROR5 100155
|
||||
#define GLU_TESS_ERROR6 100156
|
||||
#define GLU_TESS_ERROR7 100157
|
||||
#define GLU_TESS_ERROR8 100158
|
||||
|
||||
#define GLU_TESS_MISSING_BEGIN_POLYGON GLU_TESS_ERROR1
|
||||
#define GLU_TESS_MISSING_BEGIN_CONTOUR GLU_TESS_ERROR2
|
||||
#define GLU_TESS_MISSING_END_POLYGON GLU_TESS_ERROR3
|
||||
#define GLU_TESS_MISSING_END_CONTOUR GLU_TESS_ERROR4
|
||||
#define GLU_TESS_COORD_TOO_LARGE GLU_TESS_ERROR5
|
||||
#define GLU_TESS_NEED_COMBINE_CALLBACK GLU_TESS_ERROR6
|
||||
|
||||
/**** NURBS constants ****/
|
||||
|
||||
/* NurbsProperty */
|
||||
#define GLU_AUTO_LOAD_MATRIX 100200
|
||||
#define GLU_CULLING 100201
|
||||
#define GLU_SAMPLING_TOLERANCE 100203
|
||||
#define GLU_DISPLAY_MODE 100204
|
||||
#define GLU_PARAMETRIC_TOLERANCE 100202
|
||||
#define GLU_SAMPLING_METHOD 100205
|
||||
#define GLU_U_STEP 100206
|
||||
#define GLU_V_STEP 100207
|
||||
|
||||
/* NurbsSampling */
|
||||
#define GLU_PATH_LENGTH 100215
|
||||
#define GLU_PARAMETRIC_ERROR 100216
|
||||
#define GLU_DOMAIN_DISTANCE 100217
|
||||
|
||||
|
||||
/* NurbsTrim */
|
||||
#define GLU_MAP1_TRIM_2 100210
|
||||
#define GLU_MAP1_TRIM_3 100211
|
||||
|
||||
/* NurbsDisplay */
|
||||
/* GLU_FILL 100012 */
|
||||
#define GLU_OUTLINE_POLYGON 100240
|
||||
#define GLU_OUTLINE_PATCH 100241
|
||||
|
||||
/* NurbsCallback */
|
||||
/* GLU_ERROR 100103 */
|
||||
|
||||
/* NurbsErrors */
|
||||
#define GLU_NURBS_ERROR1 100251
|
||||
#define GLU_NURBS_ERROR2 100252
|
||||
#define GLU_NURBS_ERROR3 100253
|
||||
#define GLU_NURBS_ERROR4 100254
|
||||
#define GLU_NURBS_ERROR5 100255
|
||||
#define GLU_NURBS_ERROR6 100256
|
||||
#define GLU_NURBS_ERROR7 100257
|
||||
#define GLU_NURBS_ERROR8 100258
|
||||
#define GLU_NURBS_ERROR9 100259
|
||||
#define GLU_NURBS_ERROR10 100260
|
||||
#define GLU_NURBS_ERROR11 100261
|
||||
#define GLU_NURBS_ERROR12 100262
|
||||
#define GLU_NURBS_ERROR13 100263
|
||||
#define GLU_NURBS_ERROR14 100264
|
||||
#define GLU_NURBS_ERROR15 100265
|
||||
#define GLU_NURBS_ERROR16 100266
|
||||
#define GLU_NURBS_ERROR17 100267
|
||||
#define GLU_NURBS_ERROR18 100268
|
||||
#define GLU_NURBS_ERROR19 100269
|
||||
#define GLU_NURBS_ERROR20 100270
|
||||
#define GLU_NURBS_ERROR21 100271
|
||||
#define GLU_NURBS_ERROR22 100272
|
||||
#define GLU_NURBS_ERROR23 100273
|
||||
#define GLU_NURBS_ERROR24 100274
|
||||
#define GLU_NURBS_ERROR25 100275
|
||||
#define GLU_NURBS_ERROR26 100276
|
||||
#define GLU_NURBS_ERROR27 100277
|
||||
#define GLU_NURBS_ERROR28 100278
|
||||
#define GLU_NURBS_ERROR29 100279
|
||||
#define GLU_NURBS_ERROR30 100280
|
||||
#define GLU_NURBS_ERROR31 100281
|
||||
#define GLU_NURBS_ERROR32 100282
|
||||
#define GLU_NURBS_ERROR33 100283
|
||||
#define GLU_NURBS_ERROR34 100284
|
||||
#define GLU_NURBS_ERROR35 100285
|
||||
#define GLU_NURBS_ERROR36 100286
|
||||
#define GLU_NURBS_ERROR37 100287
|
||||
|
||||
/**** Backwards compatibility for old tesselator ****/
|
||||
|
||||
void APIENTRY gluBeginPolygon( GLUtesselator *tess );
|
||||
|
||||
void APIENTRY gluNextContour( GLUtesselator *tess,
|
||||
GLenum type );
|
||||
|
||||
void APIENTRY gluEndPolygon( GLUtesselator *tess );
|
||||
|
||||
/* Contours types -- obsolete! */
|
||||
#define GLU_CW 100120
|
||||
#define GLU_CCW 100121
|
||||
#define GLU_INTERIOR 100122
|
||||
#define GLU_EXTERIOR 100123
|
||||
#define GLU_UNKNOWN 100124
|
||||
|
||||
/* Names without "TESS_" prefix */
|
||||
#define GLU_BEGIN GLU_TESS_BEGIN
|
||||
#define GLU_VERTEX GLU_TESS_VERTEX
|
||||
#define GLU_END GLU_TESS_END
|
||||
#define GLU_ERROR GLU_TESS_ERROR
|
||||
#define GLU_EDGE_FLAG GLU_TESS_EDGE_FLAG
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __GLU_H__ */
|
||||
#endif /* __glu_h__ */
|
||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,582 @@
|
||||
#ifndef __wglext_h_
|
||||
#define __wglext_h_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
** License Applicability. Except to the extent portions of this file are
|
||||
** made subject to an alternative license as permitted in the SGI Free
|
||||
** Software License B, Version 1.1 (the "License"), the contents of this
|
||||
** file are subject only to the provisions of the License. You may not use
|
||||
** this file except in compliance with the License. You may obtain a copy
|
||||
** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
|
||||
** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
|
||||
**
|
||||
** http://oss.sgi.com/projects/FreeB
|
||||
**
|
||||
** Note that, as provided in the License, the Software is distributed on an
|
||||
** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
|
||||
** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
|
||||
** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
|
||||
** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
|
||||
**
|
||||
** Original Code. The Original Code is: OpenGL Sample Implementation,
|
||||
** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
|
||||
** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
|
||||
** Copyright in any portions created by third parties is as indicated
|
||||
** elsewhere herein. All Rights Reserved.
|
||||
**
|
||||
** Additional Notice Provisions: This software was created using the
|
||||
** OpenGL(R) version 1.2.1 Sample Implementation published by SGI, but has
|
||||
** not been independently verified as being compliant with the OpenGL(R)
|
||||
** version 1.2.1 Specification.
|
||||
*/
|
||||
|
||||
#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__)
|
||||
#define WIN32_LEAN_AND_MEAN 1
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
#ifndef APIENTRY
|
||||
#define APIENTRY
|
||||
#endif
|
||||
#ifndef GLAPI
|
||||
#define GLAPI extern
|
||||
#endif
|
||||
|
||||
/*************************************************************/
|
||||
|
||||
/* Header file version number */
|
||||
/* wglext.h last updated 2002/03/22 */
|
||||
/* Current version at http://oss.sgi.com/projects/ogl-sample/registry/ */
|
||||
#define WGL_WGLEXT_VERSION 4
|
||||
|
||||
#ifndef WGL_ARB_buffer_region
|
||||
#define WGL_FRONT_COLOR_BUFFER_BIT_ARB 0x00000001
|
||||
#define WGL_BACK_COLOR_BUFFER_BIT_ARB 0x00000002
|
||||
#define WGL_DEPTH_BUFFER_BIT_ARB 0x00000004
|
||||
#define WGL_STENCIL_BUFFER_BIT_ARB 0x00000008
|
||||
#endif
|
||||
|
||||
#ifndef WGL_ARB_multisample
|
||||
#define WGL_SAMPLE_BUFFERS_ARB 0x2041
|
||||
#define WGL_SAMPLES_ARB 0x2042
|
||||
#endif
|
||||
|
||||
#ifndef WGL_ARB_extensions_string
|
||||
#endif
|
||||
|
||||
#ifndef WGL_ARB_pixel_format
|
||||
#define WGL_NUMBER_PIXEL_FORMATS_ARB 0x2000
|
||||
#define WGL_DRAW_TO_WINDOW_ARB 0x2001
|
||||
#define WGL_DRAW_TO_BITMAP_ARB 0x2002
|
||||
#define WGL_ACCELERATION_ARB 0x2003
|
||||
#define WGL_NEED_PALETTE_ARB 0x2004
|
||||
#define WGL_NEED_SYSTEM_PALETTE_ARB 0x2005
|
||||
#define WGL_SWAP_LAYER_BUFFERS_ARB 0x2006
|
||||
#define WGL_SWAP_METHOD_ARB 0x2007
|
||||
#define WGL_NUMBER_OVERLAYS_ARB 0x2008
|
||||
#define WGL_NUMBER_UNDERLAYS_ARB 0x2009
|
||||
#define WGL_TRANSPARENT_ARB 0x200A
|
||||
#define WGL_TRANSPARENT_RED_VALUE_ARB 0x2037
|
||||
#define WGL_TRANSPARENT_GREEN_VALUE_ARB 0x2038
|
||||
#define WGL_TRANSPARENT_BLUE_VALUE_ARB 0x2039
|
||||
#define WGL_TRANSPARENT_ALPHA_VALUE_ARB 0x203A
|
||||
#define WGL_TRANSPARENT_INDEX_VALUE_ARB 0x203B
|
||||
#define WGL_SHARE_DEPTH_ARB 0x200C
|
||||
#define WGL_SHARE_STENCIL_ARB 0x200D
|
||||
#define WGL_SHARE_ACCUM_ARB 0x200E
|
||||
#define WGL_SUPPORT_GDI_ARB 0x200F
|
||||
#define WGL_SUPPORT_OPENGL_ARB 0x2010
|
||||
#define WGL_DOUBLE_BUFFER_ARB 0x2011
|
||||
#define WGL_STEREO_ARB 0x2012
|
||||
#define WGL_PIXEL_TYPE_ARB 0x2013
|
||||
#define WGL_COLOR_BITS_ARB 0x2014
|
||||
#define WGL_RED_BITS_ARB 0x2015
|
||||
#define WGL_RED_SHIFT_ARB 0x2016
|
||||
#define WGL_GREEN_BITS_ARB 0x2017
|
||||
#define WGL_GREEN_SHIFT_ARB 0x2018
|
||||
#define WGL_BLUE_BITS_ARB 0x2019
|
||||
#define WGL_BLUE_SHIFT_ARB 0x201A
|
||||
#define WGL_ALPHA_BITS_ARB 0x201B
|
||||
#define WGL_ALPHA_SHIFT_ARB 0x201C
|
||||
#define WGL_ACCUM_BITS_ARB 0x201D
|
||||
#define WGL_ACCUM_RED_BITS_ARB 0x201E
|
||||
#define WGL_ACCUM_GREEN_BITS_ARB 0x201F
|
||||
#define WGL_ACCUM_BLUE_BITS_ARB 0x2020
|
||||
#define WGL_ACCUM_ALPHA_BITS_ARB 0x2021
|
||||
#define WGL_DEPTH_BITS_ARB 0x2022
|
||||
#define WGL_STENCIL_BITS_ARB 0x2023
|
||||
#define WGL_AUX_BUFFERS_ARB 0x2024
|
||||
#define WGL_NO_ACCELERATION_ARB 0x2025
|
||||
#define WGL_GENERIC_ACCELERATION_ARB 0x2026
|
||||
#define WGL_FULL_ACCELERATION_ARB 0x2027
|
||||
#define WGL_SWAP_EXCHANGE_ARB 0x2028
|
||||
#define WGL_SWAP_COPY_ARB 0x2029
|
||||
#define WGL_SWAP_UNDEFINED_ARB 0x202A
|
||||
#define WGL_TYPE_RGBA_ARB 0x202B
|
||||
#define WGL_TYPE_COLORINDEX_ARB 0x202C
|
||||
#endif
|
||||
|
||||
#ifndef WGL_ARB_make_current_read
|
||||
#define ERROR_INVALID_PIXEL_TYPE_ARB 0x2043
|
||||
#define ERROR_INCOMPATIBLE_DEVICE_CONTEXTS_ARB 0x2054
|
||||
#endif
|
||||
|
||||
#ifndef WGL_ARB_pbuffer
|
||||
#define WGL_DRAW_TO_PBUFFER_ARB 0x202D
|
||||
#define WGL_MAX_PBUFFER_PIXELS_ARB 0x202E
|
||||
#define WGL_MAX_PBUFFER_WIDTH_ARB 0x202F
|
||||
#define WGL_MAX_PBUFFER_HEIGHT_ARB 0x2030
|
||||
#define WGL_PBUFFER_LARGEST_ARB 0x2033
|
||||
#define WGL_PBUFFER_WIDTH_ARB 0x2034
|
||||
#define WGL_PBUFFER_HEIGHT_ARB 0x2035
|
||||
#define WGL_PBUFFER_LOST_ARB 0x2036
|
||||
#endif
|
||||
|
||||
#ifndef WGL_ARB_render_texture
|
||||
#define WGL_BIND_TO_TEXTURE_RGB_ARB 0x2070
|
||||
#define WGL_BIND_TO_TEXTURE_RGBA_ARB 0x2071
|
||||
#define WGL_TEXTURE_FORMAT_ARB 0x2072
|
||||
#define WGL_TEXTURE_TARGET_ARB 0x2073
|
||||
#define WGL_MIPMAP_TEXTURE_ARB 0x2074
|
||||
#define WGL_TEXTURE_RGB_ARB 0x2075
|
||||
#define WGL_TEXTURE_RGBA_ARB 0x2076
|
||||
#define WGL_NO_TEXTURE_ARB 0x2077
|
||||
#define WGL_TEXTURE_CUBE_MAP_ARB 0x2078
|
||||
#define WGL_TEXTURE_1D_ARB 0x2079
|
||||
#define WGL_TEXTURE_2D_ARB 0x207A
|
||||
#define WGL_MIPMAP_LEVEL_ARB 0x207B
|
||||
#define WGL_CUBE_MAP_FACE_ARB 0x207C
|
||||
#define WGL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB 0x207D
|
||||
#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB 0x207E
|
||||
#define WGL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB 0x207F
|
||||
#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB 0x2080
|
||||
#define WGL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB 0x2081
|
||||
#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB 0x2082
|
||||
#define WGL_FRONT_LEFT_ARB 0x2083
|
||||
#define WGL_FRONT_RIGHT_ARB 0x2084
|
||||
#define WGL_BACK_LEFT_ARB 0x2085
|
||||
#define WGL_BACK_RIGHT_ARB 0x2086
|
||||
#define WGL_AUX0_ARB 0x2087
|
||||
#define WGL_AUX1_ARB 0x2088
|
||||
#define WGL_AUX2_ARB 0x2089
|
||||
#define WGL_AUX3_ARB 0x208A
|
||||
#define WGL_AUX4_ARB 0x208B
|
||||
#define WGL_AUX5_ARB 0x208C
|
||||
#define WGL_AUX6_ARB 0x208D
|
||||
#define WGL_AUX7_ARB 0x208E
|
||||
#define WGL_AUX8_ARB 0x208F
|
||||
#define WGL_AUX9_ARB 0x2090
|
||||
#endif
|
||||
|
||||
#ifndef WGL_EXT_make_current_read
|
||||
#define ERROR_INVALID_PIXEL_TYPE_EXT 0x2043
|
||||
#endif
|
||||
|
||||
#ifndef WGL_EXT_pixel_format
|
||||
#define WGL_NUMBER_PIXEL_FORMATS_EXT 0x2000
|
||||
#define WGL_DRAW_TO_WINDOW_EXT 0x2001
|
||||
#define WGL_DRAW_TO_BITMAP_EXT 0x2002
|
||||
#define WGL_ACCELERATION_EXT 0x2003
|
||||
#define WGL_NEED_PALETTE_EXT 0x2004
|
||||
#define WGL_NEED_SYSTEM_PALETTE_EXT 0x2005
|
||||
#define WGL_SWAP_LAYER_BUFFERS_EXT 0x2006
|
||||
#define WGL_SWAP_METHOD_EXT 0x2007
|
||||
#define WGL_NUMBER_OVERLAYS_EXT 0x2008
|
||||
#define WGL_NUMBER_UNDERLAYS_EXT 0x2009
|
||||
#define WGL_TRANSPARENT_EXT 0x200A
|
||||
#define WGL_TRANSPARENT_VALUE_EXT 0x200B
|
||||
#define WGL_SHARE_DEPTH_EXT 0x200C
|
||||
#define WGL_SHARE_STENCIL_EXT 0x200D
|
||||
#define WGL_SHARE_ACCUM_EXT 0x200E
|
||||
#define WGL_SUPPORT_GDI_EXT 0x200F
|
||||
#define WGL_SUPPORT_OPENGL_EXT 0x2010
|
||||
#define WGL_DOUBLE_BUFFER_EXT 0x2011
|
||||
#define WGL_STEREO_EXT 0x2012
|
||||
#define WGL_PIXEL_TYPE_EXT 0x2013
|
||||
#define WGL_COLOR_BITS_EXT 0x2014
|
||||
#define WGL_RED_BITS_EXT 0x2015
|
||||
#define WGL_RED_SHIFT_EXT 0x2016
|
||||
#define WGL_GREEN_BITS_EXT 0x2017
|
||||
#define WGL_GREEN_SHIFT_EXT 0x2018
|
||||
#define WGL_BLUE_BITS_EXT 0x2019
|
||||
#define WGL_BLUE_SHIFT_EXT 0x201A
|
||||
#define WGL_ALPHA_BITS_EXT 0x201B
|
||||
#define WGL_ALPHA_SHIFT_EXT 0x201C
|
||||
#define WGL_ACCUM_BITS_EXT 0x201D
|
||||
#define WGL_ACCUM_RED_BITS_EXT 0x201E
|
||||
#define WGL_ACCUM_GREEN_BITS_EXT 0x201F
|
||||
#define WGL_ACCUM_BLUE_BITS_EXT 0x2020
|
||||
#define WGL_ACCUM_ALPHA_BITS_EXT 0x2021
|
||||
#define WGL_DEPTH_BITS_EXT 0x2022
|
||||
#define WGL_STENCIL_BITS_EXT 0x2023
|
||||
#define WGL_AUX_BUFFERS_EXT 0x2024
|
||||
#define WGL_NO_ACCELERATION_EXT 0x2025
|
||||
#define WGL_GENERIC_ACCELERATION_EXT 0x2026
|
||||
#define WGL_FULL_ACCELERATION_EXT 0x2027
|
||||
#define WGL_SWAP_EXCHANGE_EXT 0x2028
|
||||
#define WGL_SWAP_COPY_EXT 0x2029
|
||||
#define WGL_SWAP_UNDEFINED_EXT 0x202A
|
||||
#define WGL_TYPE_RGBA_EXT 0x202B
|
||||
#define WGL_TYPE_COLORINDEX_EXT 0x202C
|
||||
#endif
|
||||
|
||||
#ifndef WGL_EXT_pbuffer
|
||||
#define WGL_DRAW_TO_PBUFFER_EXT 0x202D
|
||||
#define WGL_MAX_PBUFFER_PIXELS_EXT 0x202E
|
||||
#define WGL_MAX_PBUFFER_WIDTH_EXT 0x202F
|
||||
#define WGL_MAX_PBUFFER_HEIGHT_EXT 0x2030
|
||||
#define WGL_OPTIMAL_PBUFFER_WIDTH_EXT 0x2031
|
||||
#define WGL_OPTIMAL_PBUFFER_HEIGHT_EXT 0x2032
|
||||
#define WGL_PBUFFER_LARGEST_EXT 0x2033
|
||||
#define WGL_PBUFFER_WIDTH_EXT 0x2034
|
||||
#define WGL_PBUFFER_HEIGHT_EXT 0x2035
|
||||
#endif
|
||||
|
||||
#ifndef WGL_EXT_depth_float
|
||||
#define WGL_DEPTH_FLOAT_EXT 0x2040
|
||||
#endif
|
||||
|
||||
#ifndef WGL_3DFX_multisample
|
||||
#define WGL_SAMPLE_BUFFERS_3DFX 0x2060
|
||||
#define WGL_SAMPLES_3DFX 0x2061
|
||||
#endif
|
||||
|
||||
#ifndef WGL_EXT_multisample
|
||||
#define WGL_SAMPLE_BUFFERS_EXT 0x2041
|
||||
#define WGL_SAMPLES_EXT 0x2042
|
||||
#endif
|
||||
|
||||
#ifndef WGL_I3D_digital_video_control
|
||||
#define WGL_DIGITAL_VIDEO_CURSOR_ALPHA_FRAMEBUFFER_I3D 0x2050
|
||||
#define WGL_DIGITAL_VIDEO_CURSOR_ALPHA_VALUE_I3D 0x2051
|
||||
#define WGL_DIGITAL_VIDEO_CURSOR_INCLUDED_I3D 0x2052
|
||||
#define WGL_DIGITAL_VIDEO_GAMMA_CORRECTED_I3D 0x2053
|
||||
#endif
|
||||
|
||||
#ifndef WGL_I3D_gamma
|
||||
#define WGL_GAMMA_TABLE_SIZE_I3D 0x204E
|
||||
#define WGL_GAMMA_EXCLUDE_DESKTOP_I3D 0x204F
|
||||
#endif
|
||||
|
||||
#ifndef WGL_I3D_genlock
|
||||
#define WGL_GENLOCK_SOURCE_MULTIVIEW_I3D 0x2044
|
||||
#define WGL_GENLOCK_SOURCE_EXTENAL_SYNC_I3D 0x2045
|
||||
#define WGL_GENLOCK_SOURCE_EXTENAL_FIELD_I3D 0x2046
|
||||
#define WGL_GENLOCK_SOURCE_EXTENAL_TTL_I3D 0x2047
|
||||
#define WGL_GENLOCK_SOURCE_DIGITAL_SYNC_I3D 0x2048
|
||||
#define WGL_GENLOCK_SOURCE_DIGITAL_FIELD_I3D 0x2049
|
||||
#define WGL_GENLOCK_SOURCE_EDGE_FALLING_I3D 0x204A
|
||||
#define WGL_GENLOCK_SOURCE_EDGE_RISING_I3D 0x204B
|
||||
#define WGL_GENLOCK_SOURCE_EDGE_BOTH_I3D 0x204C
|
||||
#endif
|
||||
|
||||
#ifndef WGL_I3D_image_buffer
|
||||
#define WGL_IMAGE_BUFFER_MIN_ACCESS_I3D 0x00000001
|
||||
#define WGL_IMAGE_BUFFER_LOCK_I3D 0x00000002
|
||||
#endif
|
||||
|
||||
#ifndef WGL_I3D_swap_frame_lock
|
||||
#endif
|
||||
|
||||
|
||||
/*************************************************************/
|
||||
|
||||
#ifndef WGL_ARB_pbuffer
|
||||
DECLARE_HANDLE(HPBUFFERARB);
|
||||
#endif
|
||||
#ifndef WGL_EXT_pbuffer
|
||||
DECLARE_HANDLE(HPBUFFEREXT);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_ARB_buffer_region
|
||||
#define WGL_ARB_buffer_region 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern HANDLE WINAPI wglCreateBufferRegionARB (HDC, int, UINT);
|
||||
extern VOID WINAPI wglDeleteBufferRegionARB (HANDLE);
|
||||
extern BOOL WINAPI wglSaveBufferRegionARB (HANDLE, int, int, int, int);
|
||||
extern BOOL WINAPI wglRestoreBufferRegionARB (HANDLE, int, int, int, int, int, int);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef HANDLE (WINAPI * PFNWGLCREATEBUFFERREGIONARBPROC) (HDC hDC, int iLayerPlane, UINT uType);
|
||||
typedef VOID (WINAPI * PFNWGLDELETEBUFFERREGIONARBPROC) (HANDLE hRegion);
|
||||
typedef BOOL (WINAPI * PFNWGLSAVEBUFFERREGIONARBPROC) (HANDLE hRegion, int x, int y, int width, int height);
|
||||
typedef BOOL (WINAPI * PFNWGLRESTOREBUFFERREGIONARBPROC) (HANDLE hRegion, int x, int y, int width, int height, int xSrc, int ySrc);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_ARB_multisample
|
||||
#define WGL_ARB_multisample 1
|
||||
#endif
|
||||
|
||||
#ifndef WGL_ARB_extensions_string
|
||||
#define WGL_ARB_extensions_string 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern const char * WINAPI wglGetExtensionsStringARB (HDC);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef const char * (WINAPI * PFNWGLGETEXTENSIONSSTRINGARBPROC) (HDC hdc);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_ARB_pixel_format
|
||||
#define WGL_ARB_pixel_format 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern BOOL WINAPI wglGetPixelFormatAttribivARB (HDC, int, int, UINT, const int *, int *);
|
||||
extern BOOL WINAPI wglGetPixelFormatAttribfvARB (HDC, int, int, UINT, const int *, FLOAT *);
|
||||
extern BOOL WINAPI wglChoosePixelFormatARB (HDC, const int *, const FLOAT *, UINT, int *, UINT *);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBIVARBPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int *piAttributes, int *piValues);
|
||||
typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBFVARBPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int *piAttributes, FLOAT *pfValues);
|
||||
typedef BOOL (WINAPI * PFNWGLCHOOSEPIXELFORMATARBPROC) (HDC hdc, const int *piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_ARB_make_current_read
|
||||
#define WGL_ARB_make_current_read 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern BOOL WINAPI wglMakeContextCurrentARB (HDC, HDC, HGLRC);
|
||||
extern HDC WINAPI wglGetCurrentReadDCARB (void);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef BOOL (WINAPI * PFNWGLMAKECONTEXTCURRENTARBPROC) (HDC hDrawDC, HDC hReadDC, HGLRC hglrc);
|
||||
typedef HDC (WINAPI * PFNWGLGETCURRENTREADDCARBPROC) (void);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_ARB_pbuffer
|
||||
#define WGL_ARB_pbuffer 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern HPBUFFERARB WINAPI wglCreatePbufferARB (HDC, int, int, int, const int *);
|
||||
extern HDC WINAPI wglGetPbufferDCARB (HPBUFFERARB);
|
||||
extern int WINAPI wglReleasePbufferDCARB (HPBUFFERARB, HDC);
|
||||
extern BOOL WINAPI wglDestroyPbufferARB (HPBUFFERARB);
|
||||
extern BOOL WINAPI wglQueryPbufferARB (HPBUFFERARB, int, int *);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef HPBUFFERARB (WINAPI * PFNWGLCREATEPBUFFERARBPROC) (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int *piAttribList);
|
||||
typedef HDC (WINAPI * PFNWGLGETPBUFFERDCARBPROC) (HPBUFFERARB hPbuffer);
|
||||
typedef int (WINAPI * PFNWGLRELEASEPBUFFERDCARBPROC) (HPBUFFERARB hPbuffer, HDC hDC);
|
||||
typedef BOOL (WINAPI * PFNWGLDESTROYPBUFFERARBPROC) (HPBUFFERARB hPbuffer);
|
||||
typedef BOOL (WINAPI * PFNWGLQUERYPBUFFERARBPROC) (HPBUFFERARB hPbuffer, int iAttribute, int *piValue);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_ARB_render_texture
|
||||
#define WGL_ARB_render_texture 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern BOOL WINAPI wglBindTexImageARB (HPBUFFERARB, int);
|
||||
extern BOOL WINAPI wglReleaseTexImageARB (HPBUFFERARB, int);
|
||||
extern BOOL WINAPI wglSetPbufferAttribARB (HPBUFFERARB, const int *);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef BOOL (WINAPI * PFNWGLBINDTEXIMAGEARBPROC) (HPBUFFERARB hPbuffer, int iBuffer);
|
||||
typedef BOOL (WINAPI * PFNWGLRELEASETEXIMAGEARBPROC) (HPBUFFERARB hPbuffer, int iBuffer);
|
||||
typedef BOOL (WINAPI * PFNWGLSETPBUFFERATTRIBARBPROC) (HPBUFFERARB hPbuffer, const int *piAttribList);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_EXT_display_color_table
|
||||
#define WGL_EXT_display_color_table 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern GLboolean WINAPI wglCreateDisplayColorTableEXT (GLushort);
|
||||
extern GLboolean WINAPI wglLoadDisplayColorTableEXT (const GLushort *, GLuint);
|
||||
extern GLboolean WINAPI wglBindDisplayColorTableEXT (GLushort);
|
||||
extern VOID WINAPI wglDestroyDisplayColorTableEXT (GLushort);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef GLboolean (WINAPI * PFNWGLCREATEDISPLAYCOLORTABLEEXTPROC) (GLushort id);
|
||||
typedef GLboolean (WINAPI * PFNWGLLOADDISPLAYCOLORTABLEEXTPROC) (const GLushort *table, GLuint length);
|
||||
typedef GLboolean (WINAPI * PFNWGLBINDDISPLAYCOLORTABLEEXTPROC) (GLushort id);
|
||||
typedef VOID (WINAPI * PFNWGLDESTROYDISPLAYCOLORTABLEEXTPROC) (GLushort id);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_EXT_extensions_string
|
||||
#define WGL_EXT_extensions_string 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern const char * WINAPI wglGetExtensionsStringEXT (void);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef const char * (WINAPI * PFNWGLGETEXTENSIONSSTRINGEXTPROC) (void);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_EXT_make_current_read
|
||||
#define WGL_EXT_make_current_read 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern BOOL WINAPI wglMakeContextCurrentEXT (HDC, HDC, HGLRC);
|
||||
extern HDC WINAPI wglGetCurrentReadDCEXT (void);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef BOOL (WINAPI * PFNWGLMAKECONTEXTCURRENTEXTPROC) (HDC hDrawDC, HDC hReadDC, HGLRC hglrc);
|
||||
typedef HDC (WINAPI * PFNWGLGETCURRENTREADDCEXTPROC) (void);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_EXT_pbuffer
|
||||
#define WGL_EXT_pbuffer 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern HPBUFFEREXT WINAPI wglCreatePbufferEXT (HDC, int, int, int, const int *);
|
||||
extern HDC WINAPI wglGetPbufferDCEXT (HPBUFFEREXT);
|
||||
extern int WINAPI wglReleasePbufferDCEXT (HPBUFFEREXT, HDC);
|
||||
extern BOOL WINAPI wglDestroyPbufferEXT (HPBUFFEREXT);
|
||||
extern BOOL WINAPI wglQueryPbufferEXT (HPBUFFEREXT, int, int *);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef HPBUFFEREXT (WINAPI * PFNWGLCREATEPBUFFEREXTPROC) (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int *piAttribList);
|
||||
typedef HDC (WINAPI * PFNWGLGETPBUFFERDCEXTPROC) (HPBUFFEREXT hPbuffer);
|
||||
typedef int (WINAPI * PFNWGLRELEASEPBUFFERDCEXTPROC) (HPBUFFEREXT hPbuffer, HDC hDC);
|
||||
typedef BOOL (WINAPI * PFNWGLDESTROYPBUFFEREXTPROC) (HPBUFFEREXT hPbuffer);
|
||||
typedef BOOL (WINAPI * PFNWGLQUERYPBUFFEREXTPROC) (HPBUFFEREXT hPbuffer, int iAttribute, int *piValue);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_EXT_pixel_format
|
||||
#define WGL_EXT_pixel_format 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern BOOL WINAPI wglGetPixelFormatAttribivEXT (HDC, int, int, UINT, int *, int *);
|
||||
extern BOOL WINAPI wglGetPixelFormatAttribfvEXT (HDC, int, int, UINT, int *, FLOAT *);
|
||||
extern BOOL WINAPI wglChoosePixelFormatEXT (HDC, const int *, const FLOAT *, UINT, int *, UINT *);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBIVEXTPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int *piAttributes, int *piValues);
|
||||
typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBFVEXTPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int *piAttributes, FLOAT *pfValues);
|
||||
typedef BOOL (WINAPI * PFNWGLCHOOSEPIXELFORMATEXTPROC) (HDC hdc, const int *piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_EXT_swap_control
|
||||
#define WGL_EXT_swap_control 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern BOOL WINAPI wglSwapIntervalEXT (int);
|
||||
extern int WINAPI wglGetSwapIntervalEXT (void);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef BOOL (WINAPI * PFNWGLSWAPINTERVALEXTPROC) (int interval);
|
||||
typedef int (WINAPI * PFNWGLGETSWAPINTERVALEXTPROC) (void);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_EXT_depth_float
|
||||
#define WGL_EXT_depth_float 1
|
||||
#endif
|
||||
|
||||
#ifndef WGL_NV_vertex_array_range
|
||||
#define WGL_NV_vertex_array_range 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern void* WINAPI wglAllocateMemoryNV (GLsizei, GLfloat, GLfloat, GLfloat);
|
||||
extern void WINAPI wglFreeMemoryNV (void *);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef void* (WINAPI * PFNWGLALLOCATEMEMORYNVPROC) (GLsizei size, GLfloat readfreq, GLfloat writefreq, GLfloat priority);
|
||||
typedef void (WINAPI * PFNWGLFREEMEMORYNVPROC) (void *pointer);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_3DFX_multisample
|
||||
#define WGL_3DFX_multisample 1
|
||||
#endif
|
||||
|
||||
#ifndef WGL_EXT_multisample
|
||||
#define WGL_EXT_multisample 1
|
||||
#endif
|
||||
|
||||
#ifndef WGL_OML_sync_control
|
||||
#define WGL_OML_sync_control 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern BOOL WINAPI wglGetSyncValuesOML (HDC, INT64 *, INT64 *, INT64 *);
|
||||
extern BOOL WINAPI wglGetMscRateOML (HDC, INT32 *, INT32 *);
|
||||
extern INT64 WINAPI wglSwapBuffersMscOML (HDC, INT64, INT64, INT64);
|
||||
extern INT64 WINAPI wglSwapLayerBuffersMscOML (HDC, int, INT64, INT64, INT64);
|
||||
extern BOOL WINAPI wglWaitForMscOML (HDC, INT64, INT64, INT64, INT64 *, INT64 *, INT64 *);
|
||||
extern BOOL WINAPI wglWaitForSbcOML (HDC, INT64, INT64 *, INT64 *, INT64 *);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef BOOL (WINAPI * PFNWGLGETSYNCVALUESOMLPROC) (HDC hdc, INT64 *ust, INT64 *msc, INT64 *sbc);
|
||||
typedef BOOL (WINAPI * PFNWGLGETMSCRATEOMLPROC) (HDC hdc, INT32 *numerator, INT32 *denominator);
|
||||
typedef INT64 (WINAPI * PFNWGLSWAPBUFFERSMSCOMLPROC) (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder);
|
||||
typedef INT64 (WINAPI * PFNWGLSWAPLAYERBUFFERSMSCOMLPROC) (HDC hdc, int fuPlanes, INT64 target_msc, INT64 divisor, INT64 remainder);
|
||||
typedef BOOL (WINAPI * PFNWGLWAITFORMSCOMLPROC) (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder, INT64 *ust, INT64 *msc, INT64 *sbc);
|
||||
typedef BOOL (WINAPI * PFNWGLWAITFORSBCOMLPROC) (HDC hdc, INT64 target_sbc, INT64 *ust, INT64 *msc, INT64 *sbc);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_I3D_digital_video_control
|
||||
#define WGL_I3D_digital_video_control 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern BOOL WINAPI wglGetDigitalVideoParametersI3D (HDC, int, int *);
|
||||
extern BOOL WINAPI wglSetDigitalVideoParametersI3D (HDC, int, const int *);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef BOOL (WINAPI * PFNWGLGETDIGITALVIDEOPARAMETERSI3DPROC) (HDC hDC, int iAttribute, int *piValue);
|
||||
typedef BOOL (WINAPI * PFNWGLSETDIGITALVIDEOPARAMETERSI3DPROC) (HDC hDC, int iAttribute, const int *piValue);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_I3D_gamma
|
||||
#define WGL_I3D_gamma 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern BOOL WINAPI wglGetGammaTableParametersI3D (HDC, int, int *);
|
||||
extern BOOL WINAPI wglSetGammaTableParametersI3D (HDC, int, const int *);
|
||||
extern BOOL WINAPI wglGetGammaTableI3D (HDC, int, USHORT *, USHORT *, USHORT *);
|
||||
extern BOOL WINAPI wglSetGammaTableI3D (HDC, int, const USHORT *, const USHORT *, const USHORT *);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef BOOL (WINAPI * PFNWGLGETGAMMATABLEPARAMETERSI3DPROC) (HDC hDC, int iAttribute, int *piValue);
|
||||
typedef BOOL (WINAPI * PFNWGLSETGAMMATABLEPARAMETERSI3DPROC) (HDC hDC, int iAttribute, const int *piValue);
|
||||
typedef BOOL (WINAPI * PFNWGLGETGAMMATABLEI3DPROC) (HDC hDC, int iEntries, USHORT *puRed, USHORT *puGreen, USHORT *puBlue);
|
||||
typedef BOOL (WINAPI * PFNWGLSETGAMMATABLEI3DPROC) (HDC hDC, int iEntries, const USHORT *puRed, const USHORT *puGreen, const USHORT *puBlue);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_I3D_genlock
|
||||
#define WGL_I3D_genlock 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern BOOL WINAPI wglEnableGenlockI3D (HDC);
|
||||
extern BOOL WINAPI wglDisableGenlockI3D (HDC);
|
||||
extern BOOL WINAPI wglIsEnabledGenlockI3D (HDC, BOOL *);
|
||||
extern BOOL WINAPI wglGenlockSourceI3D (HDC, UINT);
|
||||
extern BOOL WINAPI wglGetGenlockSourceI3D (HDC, UINT *);
|
||||
extern BOOL WINAPI wglGenlockSourceEdgeI3D (HDC, UINT);
|
||||
extern BOOL WINAPI wglGetGenlockSourceEdgeI3D (HDC, UINT *);
|
||||
extern BOOL WINAPI wglGenlockSampleRateI3D (HDC, UINT);
|
||||
extern BOOL WINAPI wglGetGenlockSampleRateI3D (HDC, UINT *);
|
||||
extern BOOL WINAPI wglGenlockSourceDelayI3D (HDC, UINT);
|
||||
extern BOOL WINAPI wglGetGenlockSourceDelayI3D (HDC, UINT *);
|
||||
extern BOOL WINAPI wglQueryGenlockMaxSourceDelayI3D (HDC, UINT *, UINT *);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef BOOL (WINAPI * PFNWGLENABLEGENLOCKI3DPROC) (HDC hDC);
|
||||
typedef BOOL (WINAPI * PFNWGLDISABLEGENLOCKI3DPROC) (HDC hDC);
|
||||
typedef BOOL (WINAPI * PFNWGLISENABLEDGENLOCKI3DPROC) (HDC hDC, BOOL *pFlag);
|
||||
typedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEI3DPROC) (HDC hDC, UINT uSource);
|
||||
typedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEI3DPROC) (HDC hDC, UINT *uSource);
|
||||
typedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEEDGEI3DPROC) (HDC hDC, UINT uEdge);
|
||||
typedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEEDGEI3DPROC) (HDC hDC, UINT *uEdge);
|
||||
typedef BOOL (WINAPI * PFNWGLGENLOCKSAMPLERATEI3DPROC) (HDC hDC, UINT uRate);
|
||||
typedef BOOL (WINAPI * PFNWGLGETGENLOCKSAMPLERATEI3DPROC) (HDC hDC, UINT *uRate);
|
||||
typedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEDELAYI3DPROC) (HDC hDC, UINT uDelay);
|
||||
typedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEDELAYI3DPROC) (HDC hDC, UINT *uDelay);
|
||||
typedef BOOL (WINAPI * PFNWGLQUERYGENLOCKMAXSOURCEDELAYI3DPROC) (HDC hDC, UINT *uMaxLineDelay, UINT *uMaxPixelDelay);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_I3D_image_buffer
|
||||
#define WGL_I3D_image_buffer 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern LPVOID WINAPI wglCreateImageBufferI3D (HDC, DWORD, UINT);
|
||||
extern BOOL WINAPI wglDestroyImageBufferI3D (HDC, LPVOID);
|
||||
extern BOOL WINAPI wglAssociateImageBufferEventsI3D (HDC, const HANDLE *, const LPVOID *, const DWORD *, UINT);
|
||||
extern BOOL WINAPI wglReleaseImageBufferEventsI3D (HDC, const LPVOID *, UINT);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef LPVOID (WINAPI * PFNWGLCREATEIMAGEBUFFERI3DPROC) (HDC hDC, DWORD dwSize, UINT uFlags);
|
||||
typedef BOOL (WINAPI * PFNWGLDESTROYIMAGEBUFFERI3DPROC) (HDC hDC, LPVOID pAddress);
|
||||
typedef BOOL (WINAPI * PFNWGLASSOCIATEIMAGEBUFFEREVENTSI3DPROC) (HDC hDC, const HANDLE *pEvent, const LPVOID *pAddress, const DWORD *pSize, UINT count);
|
||||
typedef BOOL (WINAPI * PFNWGLRELEASEIMAGEBUFFEREVENTSI3DPROC) (HDC hDC, const LPVOID *pAddress, UINT count);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_I3D_swap_frame_lock
|
||||
#define WGL_I3D_swap_frame_lock 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern BOOL WINAPI wglEnableFrameLockI3D (void);
|
||||
extern BOOL WINAPI wglDisableFrameLockI3D (void);
|
||||
extern BOOL WINAPI wglIsEnabledFrameLockI3D (BOOL *);
|
||||
extern BOOL WINAPI wglQueryFrameLockMasterI3D (BOOL *);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef BOOL (WINAPI * PFNWGLENABLEFRAMELOCKI3DPROC) (void);
|
||||
typedef BOOL (WINAPI * PFNWGLDISABLEFRAMELOCKI3DPROC) (void);
|
||||
typedef BOOL (WINAPI * PFNWGLISENABLEDFRAMELOCKI3DPROC) (BOOL *pFlag);
|
||||
typedef BOOL (WINAPI * PFNWGLQUERYFRAMELOCKMASTERI3DPROC) (BOOL *pFlag);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_I3D_swap_frame_usage
|
||||
#define WGL_I3D_swap_frame_usage 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern BOOL WINAPI wglGetFrameUsageI3D (float *);
|
||||
extern BOOL WINAPI wglBeginFrameTrackingI3D (void);
|
||||
extern BOOL WINAPI wglEndFrameTrackingI3D (void);
|
||||
extern BOOL WINAPI wglQueryFrameTrackingI3D (DWORD *, DWORD *, float *);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef BOOL (WINAPI * PFNWGLGETFRAMEUSAGEI3DPROC) (float *pUsage);
|
||||
typedef BOOL (WINAPI * PFNWGLBEGINFRAMETRACKINGI3DPROC) (void);
|
||||
typedef BOOL (WINAPI * PFNWGLENDFRAMETRACKINGI3DPROC) (void);
|
||||
typedef BOOL (WINAPI * PFNWGLQUERYFRAMETRACKINGI3DPROC) (DWORD *pFrameCount, DWORD *pMissedFrames, float *pLastMissedUsage);
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -9,13 +9,23 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Graphics/GrD3D.cpp $
|
||||
* $Revision: 2.3 $
|
||||
* $Date: 2002-10-05 16:46:09 $
|
||||
* $Author: randomtiger $
|
||||
* $Revision: 2.5 $
|
||||
* $Date: 2003-03-02 05:43:48 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
* Code for our Direct3D renderer
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.4 2003/01/14 05:53:58 Goober5000
|
||||
* commented out some mprintfs that were clogging up the debug spew
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.3 2002/10/05 16:46:09 randomtiger
|
||||
* Added us fs2_open people to the credits. Worth looking at just for that.
|
||||
* Added timer bar code, by default its not compiled in.
|
||||
* Use TIMEBAR_ACTIVE in project and dependancy code settings to activate.
|
||||
* Added the new timebar files with the new code.
|
||||
*
|
||||
* Revision 2.2 2002/08/01 01:41:05 penguin
|
||||
* The big include file move
|
||||
*
|
||||
@@ -661,14 +671,14 @@ HRESULT d3d_DrawPrimitive( D3DPRIMITIVETYPE dptPrimitiveType, D3DVERTEXTYPE dvtV
|
||||
OP_NOP( D3D_ex_ptr );
|
||||
}
|
||||
|
||||
OP_TRIANGLE_LIST( unsigned short(dwVertexCount-2), D3D_ex_ptr );
|
||||
OP_TRIANGLE_LIST( (unsigned short)(dwVertexCount-2), D3D_ex_ptr );
|
||||
|
||||
LPD3DTRIANGLE tri = ( LPD3DTRIANGLE )D3D_ex_ptr;
|
||||
|
||||
for (i=0; i<(int)dwVertexCount-2; i++ ) {
|
||||
tri->v1 = unsigned short(D3D_num_verts+0);
|
||||
tri->v2 = unsigned short(D3D_num_verts+i+1);
|
||||
tri->v3 = unsigned short(D3D_num_verts+i+2);
|
||||
tri->v1 = (unsigned short)(D3D_num_verts+0);
|
||||
tri->v2 = (unsigned short)(D3D_num_verts+i+1);
|
||||
tri->v3 = (unsigned short)(D3D_num_verts+i+2);
|
||||
tri->wFlags = D3DTRIFLAG_EDGEENABLETRIANGLE;
|
||||
tri++;
|
||||
|
||||
@@ -708,8 +718,8 @@ HRESULT d3d_DrawPrimitive( D3DPRIMITIVETYPE dptPrimitiveType, D3DVERTEXTYPE dvtV
|
||||
|
||||
for (i=0; i<(int)nlines; i++ ) {
|
||||
LPD3DLINE line = (LPD3DLINE )D3D_ex_ptr;
|
||||
line->v1 = unsigned short(D3D_num_verts);
|
||||
line->v2 = unsigned short(D3D_num_verts+1);
|
||||
line->v1 = (unsigned short)(D3D_num_verts);
|
||||
line->v2 = (unsigned short)(D3D_num_verts+1);
|
||||
D3D_ex_ptr = (void *)(((LPD3DLINE)D3D_ex_ptr) + 1);
|
||||
}
|
||||
|
||||
@@ -1811,7 +1821,7 @@ void gr_d3d_flip()
|
||||
}
|
||||
ddrval = lpFrontBuffer->Flip( NULL, DDFLIP_WAIT );
|
||||
if ( ddrval == DDERR_SURFACELOST ) {
|
||||
mprintf(( "Front surface lost... attempting to restore...\n" ));
|
||||
// mprintf(( "Front surface lost... attempting to restore...\n" ));
|
||||
os_sleep(1000); // Wait a second
|
||||
|
||||
// os poll?
|
||||
|
||||
@@ -9,13 +9,37 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Graphics/GrD3DRender.cpp $
|
||||
* $Revision: 2.4 $
|
||||
* $Date: 2002-10-05 16:46:09 $
|
||||
* $Author: randomtiger $
|
||||
* $Revision: 2.10 $
|
||||
* $Date: 2003-03-02 05:43:48 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
* Code to actually render stuff using Direct3D
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.9 2003/02/16 05:14:28 bobboau
|
||||
* added glow map nebula bug fix for d3d, someone should add a fix for glide too
|
||||
* more importantly I (think I) have fixed all major bugs with fighter beams, and added a bit of new functionality
|
||||
*
|
||||
* Revision 2.8 2003/01/20 05:40:49 bobboau
|
||||
* added several sExps for turning glow points and glow maps on and off
|
||||
*
|
||||
* Revision 2.7 2003/01/19 01:07:41 bobboau
|
||||
* redid the way glowmaps are handeled, you now must set the global int GLOWMAP (no longer an array) before you render a poly that uses a glow map then set GLOWMAP to -1 when you're done with, fixed a few other misc bugs it
|
||||
*
|
||||
* Revision 2.6 2003/01/09 21:20:21 phreak
|
||||
* fixed a small error in bob's code
|
||||
*
|
||||
* Revision 2.5 2003/01/05 23:41:50 bobboau
|
||||
* disabled decals (for now), removed the warp ray thingys,
|
||||
* made some better error mesages while parseing weapons and ships tbls,
|
||||
* and... oh ya, added glow mapping
|
||||
*
|
||||
* Revision 2.4 2002/10/05 16:46:09 randomtiger
|
||||
* Added us fs2_open people to the credits. Worth looking at just for that.
|
||||
* Added timer bar code, by default its not compiled in.
|
||||
* Use TIMEBAR_ACTIVE in project and dependancy code settings to activate.
|
||||
* Added the new timebar files with the new code.
|
||||
*
|
||||
* Revision 2.3 2002/08/07 00:45:25 DTP
|
||||
* Implented -GF4FIX commandline switch & #include "cmdline/cmdline.h"
|
||||
*
|
||||
@@ -711,6 +735,7 @@ float flCAP( float x, float minx, float maxx)
|
||||
}
|
||||
|
||||
#define NEBULA_COLORS 20
|
||||
static float Interp_fog_level;
|
||||
|
||||
void gr_d3d_tmapper_internal( int nverts, vertex **verts, uint flags, int is_scaler )
|
||||
{
|
||||
@@ -975,10 +1000,11 @@ void gr_d3d_tmapper_internal( int nverts, vertex **verts, uint flags, int is_sca
|
||||
src_v++;
|
||||
}
|
||||
|
||||
int ra = 0, ga = 0, ba = 0;
|
||||
// if we're rendering against a fullneb background
|
||||
if(flags & TMAP_FLAG_PIXEL_FOG){
|
||||
int r, g, b;
|
||||
int ra, ga, ba;
|
||||
// int ra, ga, ba;
|
||||
ra = ga = ba = 0;
|
||||
|
||||
// get the average pixel color behind the vertices
|
||||
@@ -998,10 +1024,26 @@ void gr_d3d_tmapper_internal( int nverts, vertex **verts, uint flags, int is_sca
|
||||
|
||||
d3d_DrawPrimitive(D3DPT_TRIANGLEFAN, D3DVT_TLVERTEX, (LPVOID)d3d_verts, nverts, NULL);
|
||||
|
||||
// turn off fog
|
||||
// if(flags & TMAP_FLAG_PIXEL_FOG){
|
||||
// gr_fog_set(GR_FOGMODE_NONE, 0, 0, 0);
|
||||
// }
|
||||
|
||||
//this is my hack to get some sort of luminence mapping-Bobboau
|
||||
if(GLOWMAP > 0){
|
||||
|
||||
gr_screen.gf_set_bitmap(GLOWMAP, GR_ALPHABLEND_FILTER, GR_BITBLT_MODE_NORMAL, 0.0);
|
||||
if ( !gr_tcache_set(gr_screen.current_bitmap, tmap_type, &u_scale, &v_scale, 0, gr_screen.current_bitmap_sx, gr_screen.current_bitmap_sy )) {
|
||||
mprintf(( "Not rendering a texture because it didn't fit in VRAM!\n" ));
|
||||
return;
|
||||
}
|
||||
|
||||
gr_d3d_set_state( TEXTURE_SOURCE_DECAL, ALPHA_BLEND_ALPHA_ADDITIVE, zbuffer_type );
|
||||
|
||||
for (i=0; i<nverts; i++ ) {
|
||||
if(flags & TMAP_FLAG_PIXEL_FOG)d3d_verts[i].color = RGBA_MAKE((255 - ra), (255 - ga), (255 - ba), ((ba + ga + ra)/2));
|
||||
else d3d_verts[i].color = RGBA_MAKE(255, 255, 255, 0);
|
||||
}
|
||||
if(flags & TMAP_FLAG_PIXEL_FOG)gr_fog_set(GR_FOGMODE_NONE, 0, 0, 0);
|
||||
d3d_DrawPrimitive(D3DPT_TRIANGLEFAN, D3DVT_TLVERTEX, (LPVOID)d3d_verts, nverts, NULL);
|
||||
if(flags & TMAP_FLAG_PIXEL_FOG)gr_fog_set(GR_FOGMODE_FOG, ra, ga, ba);
|
||||
}
|
||||
}
|
||||
|
||||
void gr_d3d_tmapper( int nverts, vertex **verts, uint flags )
|
||||
@@ -1266,9 +1308,9 @@ void gr_d3d_reset_clip()
|
||||
void gr_d3d_init_color(color *c, int r, int g, int b)
|
||||
{
|
||||
c->screen_sig = gr_screen.signature;
|
||||
c->red = unsigned char(r);
|
||||
c->green = unsigned char(g);
|
||||
c->blue = unsigned char(b);
|
||||
c->red = (unsigned char) r;
|
||||
c->green = (unsigned char) g;
|
||||
c->blue = (unsigned char) b;
|
||||
c->alpha = 255;
|
||||
c->ac_type = AC_TYPE_NONE;
|
||||
c->alphacolor = -1;
|
||||
@@ -1285,7 +1327,7 @@ void gr_d3d_init_alphacolor( color *clr, int r, int g, int b, int alpha, int typ
|
||||
|
||||
gr_d3d_init_color( clr, r, g, b );
|
||||
|
||||
clr->alpha = unsigned char(alpha);
|
||||
clr->alpha = (unsigned char) alpha;
|
||||
clr->ac_type = (ubyte)type;
|
||||
clr->alphacolor = -1;
|
||||
clr->is_alphacolor = 1;
|
||||
|
||||
@@ -9,13 +9,19 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Graphics/GrD3DTexture.cpp $
|
||||
* $Revision: 2.1 $
|
||||
* $Date: 2002-08-01 01:41:05 $
|
||||
* $Revision: 2.3 $
|
||||
* $Date: 2003-03-02 05:43:48 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
* Code to manage loading textures into VRAM for Direct3D
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.2 2003/01/19 01:07:41 bobboau
|
||||
* redid the way glowmaps are handeled, you now must set the global int GLOWMAP (no longer an array) before you render a poly that uses a glow map then set GLOWMAP to -1 when you're done with, fixed a few other misc bugs it
|
||||
*
|
||||
* Revision 2.1 2002/08/01 01:41:05 penguin
|
||||
* The big include file move
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:22 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
@@ -624,7 +630,7 @@ int d3d_create_texture_sub(int bitmap_type, int texture_handle, ushort *data, in
|
||||
g /= Gr_ta_green.scale;
|
||||
b /= Gr_ta_blue.scale;
|
||||
a /= Gr_ta_alpha.scale;
|
||||
xlat[i] = unsigned short(((a<<Gr_ta_alpha.shift) | (r << Gr_ta_red.shift) | (g << Gr_ta_green.shift) | (b << Gr_ta_blue.shift)));
|
||||
xlat[i] = (unsigned short)(((a<<Gr_ta_alpha.shift) | (r << Gr_ta_red.shift) | (g << Gr_ta_green.shift) | (b << Gr_ta_blue.shift)));
|
||||
}
|
||||
|
||||
xlat[15] = xlat[1];
|
||||
@@ -963,6 +969,7 @@ int d3d_tcache_set(int bitmap_id, int bitmap_type, float *u_scale, float *v_scal
|
||||
}
|
||||
|
||||
int n = bm_get_cache_slot( bitmap_id, 1 );
|
||||
// if(n == -1)return -1;//for a bad handel, this was triping some assertion errors in the glowmap code
|
||||
tcache_slot_d3d * t = &Textures[n];
|
||||
|
||||
if ( (D3D_last_bitmap_id == bitmap_id) && (D3D_last_bitmap_type==bitmap_type) && (t->bitmap_id == bitmap_id) && (D3D_last_section_x == sx) && (D3D_last_section_y == sy)) {
|
||||
|
||||
@@ -9,13 +9,16 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Graphics/GrDirectDraw.cpp $
|
||||
* $Revision: 2.1 $
|
||||
* $Date: 2002-08-01 01:41:05 $
|
||||
* $Author: penguin $
|
||||
* $Revision: 2.2 $
|
||||
* $Date: 2003-01-14 05:53:58 $
|
||||
* $Author: Goober5000 $
|
||||
*
|
||||
* Code for software 8-bpp rendering using DirectDraw
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.1 2002/08/01 01:41:05 penguin
|
||||
* The big include file move
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:22 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
@@ -419,7 +422,7 @@ TryFlipAgain:
|
||||
|
||||
HRESULT ddrval = lpFrontBuffer->Flip( NULL, DDFLIP_WAIT );
|
||||
if ( ddrval == DDERR_SURFACELOST ) {
|
||||
mprintf(( "Front surface lost... attempting to restore...\n" ));
|
||||
// mprintf(( "Front surface lost... attempting to restore...\n" ));
|
||||
os_sleep(1000); // Wait a second
|
||||
goto TryFlipAgain;
|
||||
} else if (ddrval != DD_OK ) {
|
||||
@@ -463,7 +466,7 @@ TryFlipAgain:
|
||||
}
|
||||
ddrval = lpFrontBuffer->Blt( &dst_rect, lpBackBuffer, &src_rect, DDBLT_WAIT, 0 );
|
||||
if ( ddrval == DDERR_SURFACELOST ) {
|
||||
mprintf(( "Front surface lost... attempting to restore...\n" ));
|
||||
// mprintf(( "Front surface lost... attempting to restore...\n" ));
|
||||
os_sleep(1000); // Wait a second
|
||||
goto TryFlipAgain;
|
||||
} else if (ddrval != DD_OK ) {
|
||||
|
||||
@@ -9,13 +9,16 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Graphics/GrGlide.cpp $
|
||||
* $Revision: 2.1 $
|
||||
* $Date: 2002-08-01 01:41:05 $
|
||||
* $Revision: 2.2 $
|
||||
* $Date: 2003-03-02 05:43:49 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
* Code that uses 3DFX's Glide graphics library
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.1 2002/08/01 01:41:05 penguin
|
||||
* The big include file move
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:22 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
@@ -2170,9 +2173,9 @@ void gr_glide_set_palette(ubyte *new_palette, int force_flag )
|
||||
void gr_glide_init_color(color *c, int r, int g, int b)
|
||||
{
|
||||
c->screen_sig = gr_screen.signature;
|
||||
c->red = unsigned char(r);
|
||||
c->green = unsigned char(g);
|
||||
c->blue = unsigned char(b);
|
||||
c->red = (unsigned char)(r);
|
||||
c->green = (unsigned char)(g);
|
||||
c->blue = (unsigned char)(b);
|
||||
c->alpha = 255;
|
||||
c->ac_type = AC_TYPE_NONE;
|
||||
c->alphacolor = -1;
|
||||
@@ -2189,7 +2192,7 @@ void gr_glide_init_alphacolor( color *clr, int r, int g, int b, int alpha, int t
|
||||
|
||||
gr_glide_init_color( clr, r, g, b );
|
||||
|
||||
clr->alpha = unsigned char(alpha);
|
||||
clr->alpha = (unsigned char)(alpha);
|
||||
clr->ac_type = (ubyte)type;
|
||||
clr->alphacolor = -1;
|
||||
clr->is_alphacolor = 1;
|
||||
|
||||
@@ -9,13 +9,16 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Graphics/GrInternal.h $
|
||||
* $Revision: 2.1 $
|
||||
* $Date: 2002-08-01 01:41:05 $
|
||||
* $Author: penguin $
|
||||
* $Revision: 2.2 $
|
||||
* $Date: 2003-01-18 19:49:02 $
|
||||
* $Author: phreak $
|
||||
*
|
||||
* Include file for our Graphics directory
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.1 2002/08/01 01:41:05 penguin
|
||||
* The big include file move
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:22 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
@@ -217,6 +220,7 @@ extern int Gr_gamma_lookup[256];
|
||||
#define TCACHE_TYPE_XPARENT 2 // Bitmap with 0,255,0 = transparent. Alpha=0 if transparent, 1 if not.
|
||||
#define TCACHE_TYPE_NONDARKENING 3 // Bitmap with 255,255,255 = non-darkening. Alpha=1 if non-darkening, 0 if not.
|
||||
#define TCACHE_TYPE_BITMAP_SECTION 4 // section of a bitmap
|
||||
#define TCACHE_TYPE_COMPRESSED (1<<31)
|
||||
|
||||
#endif
|
||||
|
||||
+2900
-838
File diff suppressed because it is too large.
Load diff
@@ -9,13 +9,16 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Graphics/GrOpenGL.h $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:23 $
|
||||
* $Author: penguin $
|
||||
* $Revision: 2.1 $
|
||||
* $Date: 2003-03-07 00:15:45 $
|
||||
* $Author: phreak $
|
||||
*
|
||||
* Include file for OpenGL renderer
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.0 2002/06/03 04:02:23 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
* Revision 1.1 2002/05/02 18:03:07 mharris
|
||||
* Initial checkin - converted filenames and includes to lower case
|
||||
*
|
||||
@@ -36,8 +39,8 @@
|
||||
#ifndef _GROPENGL_H
|
||||
#define _GROPENGL_H
|
||||
|
||||
void gr_opengl_init();
|
||||
void gr_opengl_cleanup();
|
||||
void gr_opengl_init(int reinit=0);
|
||||
void gr_opengl_cleanup(int minimize=1);
|
||||
|
||||
void gr_opengl_bitmap(int x, int y);
|
||||
void gr_opengl_bitmap_ex(int x, int y, int w, int h, int sx, int sy);
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -9,13 +9,16 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Graphics/GrSoft.cpp $
|
||||
* $Revision: 2.2 $
|
||||
* $Date: 2002-08-01 01:41:05 $
|
||||
* $Revision: 2.3 $
|
||||
* $Date: 2003-03-02 05:43:49 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
* Code for our software renderer using standard Win32 functions. (Dibsections, etc)
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.2 2002/08/01 01:41:05 penguin
|
||||
* The big include file move
|
||||
*
|
||||
* Revision 2.1 2002/07/07 19:55:59 penguin
|
||||
* Back-port to MSVC
|
||||
*
|
||||
@@ -567,7 +570,7 @@ void gr_buffer_create( int w, int h, int bpp )
|
||||
Gr_blue.mask = 0xff;
|
||||
|
||||
DibInfo.Header.biCompression = BI_RGB;
|
||||
DibInfo.Header.biBitCount = unsigned short(bpp);
|
||||
DibInfo.Header.biBitCount = (unsigned short)(bpp);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
@@ -9,13 +9,16 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Graphics/Scaler.cpp $
|
||||
* $Revision: 2.2 $
|
||||
* $Date: 2002-08-01 01:41:05 $
|
||||
* $Revision: 2.3 $
|
||||
* $Date: 2003-03-02 05:45:04 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
* Routines to scale a bitmap.
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.2 2002/08/01 01:41:05 penguin
|
||||
* The big include file move
|
||||
*
|
||||
* Revision 2.1 2002/07/07 19:55:59 penguin
|
||||
* Back-port to MSVC
|
||||
*
|
||||
@@ -817,8 +820,9 @@ void gr8_scaler(vertex *va, vertex *vb )
|
||||
spixels = (ubyte *)bp->data;
|
||||
|
||||
gr_lock();
|
||||
#ifndef NO_SOFTWARE_RENDERING
|
||||
Tmap.pScreenBits = (uint)gr_screen.offscreen_buffer_base;
|
||||
|
||||
#endif
|
||||
uint *zbuf;
|
||||
|
||||
for (y=dy0; y<=dy1; v += dv, y++ ) {
|
||||
@@ -836,7 +840,8 @@ void gr8_scaler(vertex *va, vertex *vb )
|
||||
}
|
||||
|
||||
if ( Gr_scaler_zbuffering && gr_zbuffering ) {
|
||||
zbuf = (uint *)&gr_zbuffer[(uint)dbits-(uint)Tmap.pScreenBits];
|
||||
// zbuf = (uint *)&gr_zbuffer[(uint)dbits-(uint)Tmap.pScreenBits];
|
||||
zbuf = (uint *)&gr_zbuffer[(uint)dbits-(uint)gr_screen.offscreen_buffer_base];
|
||||
}
|
||||
|
||||
#ifdef USE_COMPILED_CODE
|
||||
@@ -876,7 +881,7 @@ void gr8_scaler(vertex *va, vertex *vb )
|
||||
}
|
||||
*/
|
||||
|
||||
#ifdef _WIN32
|
||||
#if defined _WIN32 && defined _MSC_VER
|
||||
_asm push esi
|
||||
_asm push edi
|
||||
_asm push edx
|
||||
@@ -898,8 +903,33 @@ void gr8_scaler(vertex *va, vertex *vb )
|
||||
_asm pop edx
|
||||
_asm pop edi
|
||||
_asm pop esi
|
||||
#elif defined __GNUC__
|
||||
asm(
|
||||
"push %%esi;"
|
||||
"push %%edi;"
|
||||
"push %%edx;"
|
||||
"push %%ecx;"
|
||||
"push %%ebx;"
|
||||
"push %%eax;"
|
||||
"mov %0,%%ecx;" // lookup
|
||||
"mov %1,%%esi;" // sbits
|
||||
"mov %2,%%edi;" // dbits
|
||||
"mov %3,%%eax;" // cc
|
||||
"mov %4,%%edx;" // zbuf
|
||||
"push %%ebp;"
|
||||
"mov %5,%%ebp;" // Gr_global_z
|
||||
"call *%%eax;"
|
||||
"pop %%ebp;"
|
||||
"pop %%eax;"
|
||||
"pop %%ebx;"
|
||||
"pop %%ecx;"
|
||||
"pop %%edx;"
|
||||
"pop %%edi;"
|
||||
"pop %%esi;"
|
||||
: /* no outputs */
|
||||
: "g" (lookup), "g" (sbits), "g" (dbits), "g" (cc), "g" (zbuf), "g" (Gr_global_z));
|
||||
#else
|
||||
#warning not implemented
|
||||
#error asm not implemented
|
||||
#endif
|
||||
}
|
||||
#else
|
||||
@@ -1100,7 +1130,8 @@ void gr8_aascaler(vertex *va, vertex *vb )
|
||||
int x, tmp_u;
|
||||
tmp_u = u;
|
||||
|
||||
uint *zbuf = (uint *)&gr_zbuffer[(uint)dbits-(uint)Tmap.pScreenBits];
|
||||
// uint *zbuf = (uint *)&gr_zbuffer[(uint)dbits-(uint)Tmap.pScreenBits];
|
||||
uint *zbuf = (uint *)&gr_zbuffer[(uint)dbits-(uint)gr_screen.offscreen_buffer_base];
|
||||
|
||||
for (x=0; x<w; x++ ) {
|
||||
if ( fx_w > *zbuf ) {
|
||||
@@ -1113,7 +1144,7 @@ void gr8_aascaler(vertex *va, vertex *vb )
|
||||
tmp_u += du;
|
||||
}
|
||||
} else {
|
||||
#ifdef _WIN32
|
||||
#if defined _WIN32 && defined _MSC_VER
|
||||
_asm push esi
|
||||
_asm push edi
|
||||
_asm push ecx
|
||||
@@ -1129,8 +1160,27 @@ void gr8_aascaler(vertex *va, vertex *vb )
|
||||
_asm pop ecx
|
||||
_asm pop edi
|
||||
_asm pop esi
|
||||
#elif defined __GNUC__
|
||||
asm(
|
||||
"push %%esi;"
|
||||
"push %%edi;"
|
||||
"push %%ecx;"
|
||||
"push %%ebx;"
|
||||
"push %%eax;"
|
||||
"mov %0,%%ecx;" // lookup
|
||||
"mov %1,%%esi;" // sbits
|
||||
"mov %2,%%edi;" // dbits
|
||||
"mov %3,%%eax;" // cc
|
||||
"call *%%eax;"
|
||||
"pop %%eax;"
|
||||
"pop %%ebx;"
|
||||
"pop %%ecx;"
|
||||
"pop %%edi;"
|
||||
"pop %%esi;"
|
||||
: /* no outputs */
|
||||
: "g" (lookup), "g" (sbits), "g" (dbits), "g" (cc));
|
||||
#else
|
||||
#warning not implemented
|
||||
#error asm not implemented
|
||||
#endif
|
||||
}
|
||||
#else
|
||||
@@ -1138,7 +1188,8 @@ void gr8_aascaler(vertex *va, vertex *vb )
|
||||
int x, tmp_u;
|
||||
tmp_u = u;
|
||||
|
||||
uint *zbuf = (uint *)&gr_zbuffer[(uint)dbits-(uint)Tmap.pScreenBits];
|
||||
// uint *zbuf = (uint *)&gr_zbuffer[(uint)dbits-(uint)Tmap.pScreenBits];
|
||||
uint *zbuf = (uint *)&gr_zbuffer[(uint)dbits-(uint)gr_screen.offscreen_buffer_base];
|
||||
|
||||
for (x=0; x<w; x++ ) {
|
||||
if ( fx_w > *zbuf ) {
|
||||
|
||||
@@ -9,13 +9,16 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Graphics/Shade.cpp $
|
||||
* $Revision: 2.2 $
|
||||
* $Date: 2002-08-01 01:41:05 $
|
||||
* $Revision: 2.3 $
|
||||
* $Date: 2003-03-02 05:40:28 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
* Routines to shade an area.
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.2 2002/08/01 01:41:05 penguin
|
||||
* The big include file move
|
||||
*
|
||||
* Revision 2.1 2002/07/07 19:55:59 penguin
|
||||
* Back-port to MSVC
|
||||
*
|
||||
@@ -197,7 +200,7 @@ void gr8_shade(int x,int y,int w,int h)
|
||||
int left_over = w1 % 4;
|
||||
|
||||
if ( wd4 > 0 ) {
|
||||
#ifdef _WIN32
|
||||
#if defined _WIN32 && !defined __GNUC__
|
||||
_asm push eax
|
||||
_asm push ebx
|
||||
_asm push ecx
|
||||
@@ -248,7 +251,8 @@ void gr8_shade(int x,int y,int w,int h)
|
||||
_asm pop ebx
|
||||
_asm pop eax
|
||||
#else
|
||||
#warning not implemented
|
||||
#warning asm not implemented
|
||||
Error(LOCATION, "asm not implemented");
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
+20
-16
@@ -9,13 +9,22 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Hud/HUD.cpp $
|
||||
* $Revision: 2.2 $
|
||||
* $Date: 2002-10-17 20:40:50 $
|
||||
* $Author: randomtiger $
|
||||
* $Revision: 2.4 $
|
||||
* $Date: 2003-01-19 07:02:15 $
|
||||
* $Author: Goober5000 $
|
||||
*
|
||||
* C module that contains all the HUD functions at a high level
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.3 2003/01/17 07:59:09 Goober5000
|
||||
* fixed some really strange behavior with strings not being truncated at the
|
||||
* # symbol
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.2 2002/10/17 20:40:50 randomtiger
|
||||
* Added ability to remove HUD ingame on keypress shift O
|
||||
* So I've added a new key to the bind list and made use of already existing hud removal code.
|
||||
*
|
||||
* Revision 2.1 2002/08/01 01:41:05 penguin
|
||||
* The big include file move
|
||||
*
|
||||
@@ -2472,7 +2481,14 @@ void hud_support_view_blit()
|
||||
gr_string(0x8000, Support_text_val_coords[gr_screen.res][1], outstr);
|
||||
} else {
|
||||
if ( Hud_support_objnum == -1 ) {
|
||||
sprintf(outstr, XSTR( "warping in", 230));
|
||||
if (The_mission.support_ships.arrival_location == ARRIVE_FROM_DOCK_BAY)
|
||||
{
|
||||
sprintf(outstr, XSTR( "exiting hangar", -1));
|
||||
}
|
||||
else
|
||||
{
|
||||
sprintf(outstr, XSTR( "warping in", 230));
|
||||
}
|
||||
gr_string(0x8000, Support_text_val_coords[gr_screen.res][1], outstr);
|
||||
} else {
|
||||
ai_info *aip;
|
||||
@@ -3101,18 +3117,6 @@ void hud_maybe_render_multi_text()
|
||||
}
|
||||
#endif
|
||||
|
||||
// cut any text off after (and including) '#' char
|
||||
void hud_end_string_at_first_hash_symbol(char *src)
|
||||
{
|
||||
char *pointer_to_last_char;
|
||||
|
||||
pointer_to_last_char = strstr(src, NOX("#"));
|
||||
|
||||
if ( pointer_to_last_char ) {
|
||||
*pointer_to_last_char = 0;
|
||||
}
|
||||
}
|
||||
|
||||
// set the offset values for this render frame
|
||||
void HUD_set_offsets(object *viewer_obj, int wiggedy_wack)
|
||||
{
|
||||
|
||||
@@ -9,13 +9,17 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Hud/HUD.h $
|
||||
* $Revision: 2.2 $
|
||||
* $Date: 2002-10-17 20:40:50 $
|
||||
* $Author: randomtiger $
|
||||
* $Revision: 2.3 $
|
||||
* $Date: 2003-01-17 07:59:09 $
|
||||
* $Author: Goober5000 $
|
||||
*
|
||||
* Header file for functions that contain HUD functions at a high level
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.2 2002/10/17 20:40:50 randomtiger
|
||||
* Added ability to remove HUD ingame on keypress shift O
|
||||
* So I've added a new key to the bind list and made use of already existing hud removal code.
|
||||
*
|
||||
* Revision 2.1 2002/08/01 01:41:05 penguin
|
||||
* The big include file move
|
||||
*
|
||||
@@ -347,9 +351,6 @@ void hud_start_text_flash(char *txt, int t);
|
||||
// convert a string to use mono spaced numbers
|
||||
void hud_num_make_mono(char *num_str);
|
||||
|
||||
// cut any text off after (and including) '#' char
|
||||
void hud_end_string_at_first_hash_symbol(char *src);
|
||||
|
||||
// functions for handling hud animations
|
||||
void hud_anim_init(hud_anim *ha, int sx, int sy, char *filename);
|
||||
int hud_anim_render(hud_anim *ha, float frametime, int draw_alpha=0, int loop=1, int hold_last=0, int reverse=0);
|
||||
|
||||
@@ -9,13 +9,24 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Hud/HUDbrackets.cpp $
|
||||
* $Revision: 2.1 $
|
||||
* $Date: 2002-08-01 01:41:05 $
|
||||
* $Author: penguin $
|
||||
* $Revision: 2.4 $
|
||||
* $Date: 2003-01-27 07:46:33 $
|
||||
* $Author: Goober5000 $
|
||||
*
|
||||
* C file that contains functions for drawing target brackets on the HUD
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.3 2002/12/14 17:09:28 Goober5000
|
||||
* removed mission flag for fighterbay damage; instead made damage display contingent on whether the fighterbay subsystem is assigned a damage percentage in ships.tbl
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.2 2002/12/14 01:55:04 Goober5000
|
||||
* added mission flag to show subsystem damage for fighterbays
|
||||
* ~Goober5000~
|
||||
*
|
||||
* Revision 2.1 2002/08/01 01:41:05 penguin
|
||||
* The big include file move
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:23 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
@@ -227,6 +238,7 @@
|
||||
#include "bmpman/bmpman.h"
|
||||
#include "globalincs/linklist.h"
|
||||
#include "weapon/emp.h"
|
||||
#include "mission/missionparse.h"
|
||||
|
||||
#define FADE_FACTOR 2 // how much the bounding brackets get faded
|
||||
#define LOWEST_RED 50 // lowest r value for bounding bracket
|
||||
@@ -533,16 +545,6 @@ void draw_brackets_diamond_quick(int x1, int y1, int x2, int y2, int thick)
|
||||
gr_line(center_x-x_delta, center_y+y_delta, center_x+x_delta, center_y-y_delta);
|
||||
}
|
||||
|
||||
|
||||
int subsys_is_fighterbay(ship_subsys *ss)
|
||||
{
|
||||
if ( !strnicmp(NOX("fighter"), ss->system_info->name, 7) ) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Draw bounding brackets for a subobject.
|
||||
void draw_bounding_brackets_subobject()
|
||||
{
|
||||
@@ -608,8 +610,13 @@ void draw_bounding_brackets_subobject()
|
||||
// determine if subsystem is on far or near side of the ship
|
||||
Player->subsys_in_view = ship_subsystem_in_sight(targetp, subsys, &View_position, &subobj_pos, 0);
|
||||
|
||||
// AL 29-3-98: If subsystem is destroyed, draw gray brackets
|
||||
if ( (Player_ai->targeted_subsys->current_hits <= 0) && (!subsys_is_fighterbay(Player_ai->targeted_subsys)) ) {
|
||||
// AL 29-3-98: If subsystem is destroyed, draw gray brackets
|
||||
// Goober5000: this will now execute for fighterbays if the bay has been given a
|
||||
// percentage subsystem strength in ships.tbl
|
||||
// Goober5000: this will now execute for any subsys that takes damage and will not
|
||||
// execute for any subsys that doesn't take damage
|
||||
if ( (Player_ai->targeted_subsys->current_hits <= 0) && ( ship_subsys_takes_damage(Player_ai->targeted_subsys) ) )
|
||||
{
|
||||
gr_set_color_fast(&IFF_colors[IFF_COLOR_MESSAGE][1]);
|
||||
} else {
|
||||
hud_set_iff_color( targetp, 1 );
|
||||
|
||||
@@ -9,13 +9,16 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Hud/HUDconfig.cpp $
|
||||
* $Revision: 2.2 $
|
||||
* $Date: 2002-08-01 01:41:05 $
|
||||
* $Author: penguin $
|
||||
* $Revision: 2.3 $
|
||||
* $Date: 2003-01-15 21:29:04 $
|
||||
* $Author: anonymous $
|
||||
*
|
||||
* C module to handle HUD configuration
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.2 2002/08/01 01:41:05 penguin
|
||||
* The big include file move
|
||||
*
|
||||
* Revision 2.1 2002/07/18 20:07:49 penguin
|
||||
* Fixed bug (potential access of unitialized pointer) in hud_config_render_gauges() -- thanks to DTP for finding it!
|
||||
*
|
||||
@@ -503,8 +506,10 @@ struct HC_gauge_region HC_gauge_regions[GR_NUM_RESOLUTIONS][NUM_HUD_GAUGES] =
|
||||
HC_gauge_region("none", 1, 1, -1, 0, 0, -1, 0, 0), // attacking target count
|
||||
HC_gauge_region("HCB_38", 342, 138, 38, 0, 0, -1, 0, 0), // text flash gauge
|
||||
HC_gauge_region("HCB_52", 465, 8, 52, 0, 0, -1, 0, 0), // comm menu
|
||||
#ifndef FS2_DEMO
|
||||
HC_gauge_region("HCB_46", 324, 264, 46, 0, 0, -1, 0, 0), // support view gauge
|
||||
HC_gauge_region("HCB_47", 418, 262, 47, 0, 0, -1, 0, 0), // netlag icon gauge
|
||||
#endif
|
||||
//XSTR:ON
|
||||
},
|
||||
{ // GR_1024
|
||||
@@ -546,8 +551,10 @@ struct HC_gauge_region HC_gauge_regions[GR_NUM_RESOLUTIONS][NUM_HUD_GAUGES] =
|
||||
HC_gauge_region("none", 1, 1, -1, 0, 0, -1, 0, 0), // attacking target count
|
||||
HC_gauge_region("2_HCB_38", 548, 222, 38, 0, 0, -1, 0, 0), // text flash gauge
|
||||
HC_gauge_region("2_HCB_52", 744, 14, 52, 0, 0, -1, 0, 0), // comm menu
|
||||
#ifndef FS2_DEMO
|
||||
HC_gauge_region("2_HCB_46", 520, 422, 46, 0, 0, -1, 0, 0), // support view gauge
|
||||
HC_gauge_region("2_HCB_47", 670, 419, 47, 0, 0, -1, 0, 0), // netlag icon gauge
|
||||
#endif
|
||||
//XSTR:ON
|
||||
}
|
||||
};
|
||||
|
||||
@@ -9,13 +9,24 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Hud/HUDescort.cpp $
|
||||
* $Revision: 2.1 $
|
||||
* $Date: 2002-08-01 01:41:05 $
|
||||
* $Author: penguin $
|
||||
* $Revision: 2.4 $
|
||||
* $Date: 2003-01-18 09:25:41 $
|
||||
* $Author: Goober5000 $
|
||||
*
|
||||
* C module for managing and displaying ships that are in an escort
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.3 2002/12/31 07:26:40 Goober5000
|
||||
* added damaged-escort-priority-all sexp
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.2 2002/12/31 05:17:13 Goober5000
|
||||
* fixed escort list behavior for stealthy ships
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.1 2002/08/01 01:41:05 penguin
|
||||
* The big include file move
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:23 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
@@ -125,9 +136,6 @@ escort_info Escort_ships[MAX_ESCORT_SHIPS];
|
||||
int Num_escort_ships;
|
||||
|
||||
|
||||
// size of complete escort list, including all those wanting to get onto list but without space
|
||||
#define MAX_COMPLETE_ESCORT_LIST 20
|
||||
|
||||
|
||||
#define NUM_ESCORT_FRAMES 3
|
||||
hud_frames Escort_gauges[NUM_ESCORT_FRAMES];
|
||||
@@ -374,6 +382,24 @@ void hud_create_complete_escort_list(escort_info *escorts, int *num_escorts)
|
||||
continue;
|
||||
}
|
||||
|
||||
// don't process most stealth ships
|
||||
if ( (Ships[objp->instance].flags2 & SF2_STEALTH) )
|
||||
{
|
||||
if ( Ships[objp->instance].team == TEAM_FRIENDLY )
|
||||
{
|
||||
// friendly stealths are only not seen when explicitly specified
|
||||
if ( Ships[objp->instance].flags2 & SF2_FRIENDLY_STEALTH_INVIS )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
// non-friendly stealths are never seen
|
||||
else
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
// don't process ships that are dying, or objects that should be dead
|
||||
if ( (Ships[objp->instance].flags & (SF_DYING|SF_DEPARTING)) || (objp->flags & OF_SHOULD_BE_DEAD) ){
|
||||
continue;
|
||||
|
||||
+129
-37
@@ -9,13 +9,16 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Hud/HUDets.cpp $
|
||||
* $Revision: 2.1 $
|
||||
* $Date: 2002-08-01 01:41:05 $
|
||||
* $Author: penguin $
|
||||
* $Revision: 2.2 $
|
||||
* $Date: 2002-12-10 05:43:34 $
|
||||
* $Author: Goober5000 $
|
||||
*
|
||||
* C file that contains code to manage and display the Energy Transfer System (ETS)
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.1 2002/08/01 01:41:05 penguin
|
||||
* The big include file move
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:23 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
@@ -502,12 +505,29 @@ void hud_show_ets()
|
||||
return;
|
||||
}
|
||||
|
||||
// if at least two gauges are not shown, don't show any
|
||||
i = 0;
|
||||
if (Player_obj->flags & OF_NO_LASERS) i++;
|
||||
if (Player_obj->flags & OF_NO_SHIELDS) i++;
|
||||
if (Player_obj->flags & OF_NO_ENGINES) i++;
|
||||
if (i >= 2) return;
|
||||
|
||||
hud_set_gauge_color(HUD_ETS_GAUGE);
|
||||
|
||||
// draw the letters for the gauges first, before any clipping occurs
|
||||
i = 0;
|
||||
for ( j = 0; j < 3; j++ ) {
|
||||
if ( j == 1 && Player_obj->flags & OF_NO_SHIELDS ) {
|
||||
for ( j = 0; j < 3; j++ )
|
||||
{
|
||||
if (j == 0 && Player_obj->flags & OF_NO_LASERS)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (j == 1 && Player_obj->flags & OF_NO_SHIELDS)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (j == 2 && Player_obj->flags & OF_NO_ENGINES)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
Assert(Ets_gauge_info != NULL);
|
||||
@@ -522,15 +542,24 @@ void hud_show_ets()
|
||||
switch (j) {
|
||||
case 0:
|
||||
index = ship_p->weapon_recharge_index;
|
||||
if ( Player_obj->flags & OF_NO_LASERS )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
index = ship_p->shield_recharge_index;
|
||||
if ( Player_obj->flags & OF_NO_SHIELDS ) {
|
||||
if ( Player_obj->flags & OF_NO_SHIELDS )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
index = ship_p->engine_recharge_index;
|
||||
if ( Player_obj->flags & OF_NO_ENGINES )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -609,13 +638,13 @@ void set_default_recharge_rates(object* obj)
|
||||
return;
|
||||
|
||||
ship_properties = 0;
|
||||
if ( ship_info_p->max_weapon_reserve )
|
||||
if (!(obj->flags & OF_NO_LASERS))
|
||||
ship_properties |= HAS_WEAPONS;
|
||||
|
||||
if (!(obj->flags & OF_NO_SHIELDS))
|
||||
ship_properties |= HAS_SHIELDS;
|
||||
|
||||
if ( ship_info_p->max_speed )
|
||||
if (!(obj->flags & OF_NO_ENGINES))
|
||||
ship_properties |= HAS_ENGINES;
|
||||
|
||||
// the default charge rate depends on what systems are on each ship
|
||||
@@ -680,43 +709,74 @@ void increase_recharge_rate(object* obj, SYSTEM_TYPE ship_system)
|
||||
|
||||
switch ( ship_system ) {
|
||||
case WEAPONS:
|
||||
if ( obj->flags & OF_NO_LASERS )
|
||||
return;
|
||||
|
||||
gain_index = &ship_p->weapon_recharge_index;
|
||||
lose_index1 = &ship_p->engine_recharge_index;
|
||||
if ( obj->flags & OF_NO_SHIELDS ) {
|
||||
|
||||
if ( obj->flags & OF_NO_SHIELDS )
|
||||
lose_index1 = NULL;
|
||||
else
|
||||
lose_index1 = &ship_p->shield_recharge_index;
|
||||
|
||||
if ( obj->flags & OF_NO_ENGINES )
|
||||
lose_index2 = NULL;
|
||||
} else {
|
||||
lose_index2 = &ship_p->shield_recharge_index;
|
||||
}
|
||||
else
|
||||
lose_index2 = &ship_p->engine_recharge_index;
|
||||
|
||||
break;
|
||||
|
||||
case SHIELDS:
|
||||
if ( obj->flags & OF_NO_SHIELDS ) {
|
||||
if ( obj->flags & OF_NO_SHIELDS )
|
||||
return;
|
||||
}
|
||||
|
||||
gain_index = &ship_p->shield_recharge_index;
|
||||
lose_index1 = &ship_p->weapon_recharge_index;
|
||||
lose_index2 = &ship_p->engine_recharge_index;
|
||||
|
||||
if ( obj->flags & OF_NO_LASERS )
|
||||
lose_index1 = NULL;
|
||||
else
|
||||
lose_index1 = &ship_p->weapon_recharge_index;
|
||||
|
||||
if ( obj->flags & OF_NO_ENGINES )
|
||||
lose_index2 = NULL;
|
||||
else
|
||||
lose_index2 = &ship_p->engine_recharge_index;
|
||||
|
||||
break;
|
||||
|
||||
case ENGINES:
|
||||
if ( obj->flags & OF_NO_ENGINES )
|
||||
return;
|
||||
|
||||
gain_index = &ship_p->engine_recharge_index;
|
||||
lose_index1 = &ship_p->weapon_recharge_index;
|
||||
if ( obj->flags & OF_NO_SHIELDS ) {
|
||||
|
||||
if ( obj->flags & OF_NO_LASERS )
|
||||
lose_index1 = NULL;
|
||||
else
|
||||
lose_index1 = &ship_p->weapon_recharge_index;
|
||||
|
||||
if ( obj->flags & OF_NO_SHIELDS )
|
||||
lose_index2 = NULL;
|
||||
} else {
|
||||
else
|
||||
lose_index2 = &ship_p->shield_recharge_index;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
} // end switch
|
||||
|
||||
// return if we can't transfer energy
|
||||
if (!lose_index1 && !lose_index2)
|
||||
return;
|
||||
|
||||
// already full, nothing to do
|
||||
count = MAX_ENERGY_INDEX - *gain_index;
|
||||
if ( count > 2 )
|
||||
count = 2;
|
||||
|
||||
if ( count <= 0 ) {
|
||||
if ( obj == Player_obj ) {
|
||||
if ( count <= 0 )
|
||||
{
|
||||
if ( obj == Player_obj )
|
||||
{
|
||||
snd_play( &Snds[SND_ENERGY_TRANS_FAIL], 0.0f );
|
||||
}
|
||||
return;
|
||||
@@ -770,39 +830,65 @@ void decrease_recharge_rate(object* obj, SYSTEM_TYPE ship_system)
|
||||
|
||||
switch ( ship_system ) {
|
||||
case WEAPONS:
|
||||
if ( obj->flags & OF_NO_LASERS )
|
||||
return;
|
||||
|
||||
lose_index = &ship_p->weapon_recharge_index;
|
||||
|
||||
if ( obj->flags & OF_NO_SHIELDS ) {
|
||||
if ( obj->flags & OF_NO_SHIELDS )
|
||||
gain_index1 = NULL;
|
||||
} else {
|
||||
else
|
||||
gain_index1 = &ship_p->shield_recharge_index;
|
||||
}
|
||||
|
||||
gain_index2 = &ship_p->engine_recharge_index;
|
||||
if ( obj->flags & OF_NO_ENGINES )
|
||||
gain_index2 = NULL;
|
||||
else
|
||||
gain_index2 = &ship_p->engine_recharge_index;
|
||||
|
||||
break;
|
||||
|
||||
case SHIELDS:
|
||||
if ( obj->flags & OF_NO_SHIELDS ) {
|
||||
if ( obj->flags & OF_NO_SHIELDS )
|
||||
return;
|
||||
}
|
||||
|
||||
lose_index = &ship_p->shield_recharge_index;
|
||||
gain_index1 = &ship_p->weapon_recharge_index;
|
||||
gain_index2 = &ship_p->engine_recharge_index;
|
||||
|
||||
if ( obj->flags & OF_NO_LASERS )
|
||||
gain_index1 = NULL;
|
||||
else
|
||||
gain_index1 = &ship_p->weapon_recharge_index;
|
||||
|
||||
if ( obj->flags & OF_NO_ENGINES )
|
||||
gain_index2 = NULL;
|
||||
else
|
||||
gain_index2 = &ship_p->engine_recharge_index;
|
||||
|
||||
break;
|
||||
|
||||
case ENGINES:
|
||||
if ( obj->flags & OF_NO_ENGINES )
|
||||
return;
|
||||
|
||||
lose_index = &ship_p->engine_recharge_index;
|
||||
|
||||
if ( obj->flags & OF_NO_SHIELDS ) {
|
||||
if ( obj->flags & OF_NO_LASERS )
|
||||
gain_index1 = NULL;
|
||||
} else {
|
||||
gain_index1 = &ship_p->shield_recharge_index;
|
||||
}
|
||||
else
|
||||
gain_index1 = &ship_p->weapon_recharge_index;
|
||||
|
||||
if ( obj->flags & OF_NO_SHIELDS )
|
||||
gain_index2 = NULL;
|
||||
else
|
||||
gain_index2 = &ship_p->shield_recharge_index;
|
||||
|
||||
gain_index2 = &ship_p->weapon_recharge_index;
|
||||
break;
|
||||
|
||||
} // end switch
|
||||
|
||||
// return if we can't transfer energy
|
||||
if (!gain_index1 && !gain_index2)
|
||||
return;
|
||||
|
||||
// check how much there is to lose
|
||||
count = min(2, *lose_index);
|
||||
if ( count <= 0 ) {
|
||||
@@ -882,7 +968,8 @@ void transfer_energy_to_shields(object* obj)
|
||||
if (ship_p->flags & SF_DYING)
|
||||
return;
|
||||
|
||||
if ( obj->flags & OF_NO_SHIELDS ) {
|
||||
if ( obj->flags & OF_NO_LASERS || obj->flags & OF_NO_SHIELDS )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -900,6 +987,11 @@ void transfer_energy_to_weapons(object* obj)
|
||||
if (ship_p->flags & SF_DYING)
|
||||
return;
|
||||
|
||||
if ( obj->flags & OF_NO_LASERS || obj->flags & OF_NO_SHIELDS )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
transfer_energy_weapon_common(obj, get_shield_strength(obj), ship_p->weapon_energy, &ship_p->target_shields_delta, &ship_p->target_weapon_energy_delta, sinfo_p->max_weapon_reserve, 1.0f);
|
||||
}
|
||||
|
||||
|
||||
@@ -9,13 +9,16 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Hud/HUDgauges.h $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:23 $
|
||||
* $Author: penguin $
|
||||
* $Revision: 2.1 $
|
||||
* $Date: 2003-01-15 21:29:04 $
|
||||
* $Author: anonymous $
|
||||
*
|
||||
* HUD data common to FRED and FreeSpace
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.0 2002/06/03 04:02:23 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
* Revision 1.1 2002/05/02 18:03:08 mharris
|
||||
* Initial checkin - converted filenames and includes to lower case
|
||||
*
|
||||
@@ -80,7 +83,11 @@
|
||||
#define __HUD_COMMON_H__
|
||||
|
||||
// HUD gauge types
|
||||
#ifdef FS2_DEMO
|
||||
#define NUM_HUD_GAUGES 37
|
||||
#else
|
||||
#define NUM_HUD_GAUGES 39
|
||||
#endif
|
||||
|
||||
#define HUD_LEAD_INDICATOR 0
|
||||
#define HUD_ORIENTATION_TEE 1
|
||||
|
||||
@@ -9,13 +9,16 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Hud/HUDshield.h $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:23 $
|
||||
* $Author: penguin $
|
||||
* $Revision: 2.1 $
|
||||
* $Date: 2003-01-06 17:14:52 $
|
||||
* $Author: Goober5000 $
|
||||
*
|
||||
* Header file for the display and management of the HUD shield
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.0 2002/06/03 04:02:23 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
* Revision 1.1 2002/05/02 18:03:08 mharris
|
||||
* Initial checkin - converted filenames and includes to lower case
|
||||
*
|
||||
@@ -89,4 +92,8 @@ void hud_shield_hit_reset(int player=0);
|
||||
|
||||
void shield_info_reset(shield_hit_info *shi);
|
||||
|
||||
// random page in stuff - moved here by Goober5000
|
||||
extern void hud_ship_icon_page_in(ship_info *sip);
|
||||
|
||||
|
||||
#endif /* __FREESPACE_HUDSHIELDBOX_H__ */
|
||||
@@ -9,13 +9,16 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Hud/HUDsquadmsg.cpp $
|
||||
* $Revision: 2.1 $
|
||||
* $Date: 2002-08-01 01:41:05 $
|
||||
* $Author: penguin $
|
||||
* $Revision: 2.2 $
|
||||
* $Date: 2003-01-19 22:20:23 $
|
||||
* $Author: Goober5000 $
|
||||
*
|
||||
* File to control sqaudmate messaging
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.1 2002/08/01 01:41:05 penguin
|
||||
* The big include file move
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:23 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
@@ -1174,13 +1177,27 @@ void hud_squadmsg_repair_rearm_abort( int toggle_state, object *obj)
|
||||
hud_squadmsg_toggle(); // take us out of message mode
|
||||
}
|
||||
|
||||
// Goober5000 - redone and added a bit
|
||||
// returns 1 if an order is valid for a ship. Applies to things like departure when engines are blown, etc.
|
||||
int hud_squadmsg_ship_order_valid( int shipnum, int order )
|
||||
{
|
||||
// disabled ships can't depart.
|
||||
if ( (order == DEPART_ITEM) && (Ships[shipnum].flags & SF_DISABLED) )
|
||||
return 0;
|
||||
switch ( order )
|
||||
{
|
||||
case DEPART_ITEM:
|
||||
// disabled ships can't depart.
|
||||
if (Ships[shipnum].flags & SF_DISABLED)
|
||||
return 0;
|
||||
|
||||
// Goober5000: also can't depart if no subspace drives and no capships in the area
|
||||
if (Ships[shipnum].flags2 & SF2_NO_SUBSPACE_DRIVE)
|
||||
{
|
||||
// locate a capital ship on the same team:
|
||||
if (ship_get_ship_with_dock_bay(Ships[shipnum].team) < 0)
|
||||
return 0;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
+359
-93
@@ -9,13 +9,52 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Hud/HUDtarget.cpp $
|
||||
* $Revision: 2.2 $
|
||||
* $Date: 2002-09-20 20:02:00 $
|
||||
* $Author: phreak $
|
||||
* $Revision: 2.12 $
|
||||
* $Date: 2003-01-17 07:59:09 $
|
||||
* $Author: Goober5000 $
|
||||
*
|
||||
* C module to provide HUD targeting functions
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.11 2003/01/03 21:58:08 Goober5000
|
||||
* Fixed some minor bugs, and added a primitive-sensors flag, where if a ship
|
||||
* has primitive sensors it can't target anything and objects don't appear
|
||||
* on radar if they're outside a certain range. This range can be modified
|
||||
* via the sexp primitive-sensors-set-range.
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.10 2002/12/31 19:18:41 Goober5000
|
||||
* if it ain't broke, don't fix it
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.8 2002/12/22 21:31:01 Goober5000
|
||||
* tweaked positioning of the new HUD graphics
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.7 2002/12/21 18:03:49 Goober5000
|
||||
* commented out the warning if you don't have the new ballistic HUD graphics - it would probably get annoying (just use the old ones without comment)
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.6 2002/12/19 10:54:37 Goober5000
|
||||
* oops - squashed a bug :)
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.5 2002/12/19 10:46:14 Goober5000
|
||||
* implemented the revised HUD weapon display for ballistic primaries
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.4 2002/12/13 08:13:30 Goober5000
|
||||
* small tweaks and bug fixes for the ballistic primary conversion
|
||||
* ~Goober5000~
|
||||
*
|
||||
* Revision 2.3 2002/12/10 05:42:42 Goober5000
|
||||
* Full-fledged ballistic primary support added! Try it and see! :)
|
||||
*
|
||||
* Fixed lead indicator behavior; Phreak's version didn't work properly.
|
||||
*
|
||||
* Revision 2.2 2002/09/20 20:02:00 phreak
|
||||
* lead indicator for dumbfire missiles
|
||||
*
|
||||
* Revision 2.1 2002/08/01 01:41:05 penguin
|
||||
* The big include file move
|
||||
*
|
||||
@@ -285,6 +324,8 @@ float Max_front_seperation[GR_NUM_RESOLUTIONS] = {
|
||||
// This means the variables are not player-specific
|
||||
static int Target_in_reticle = 0;
|
||||
|
||||
static int ballistic_hud_index = 0; // Goober5000
|
||||
|
||||
extern object obj_used_list; // dummy node in linked list of active objects
|
||||
extern char *Cargo_names[];
|
||||
|
||||
@@ -483,47 +524,97 @@ static int Toggle_text_alpha = 255;
|
||||
|
||||
// animation files for the weapons gauge
|
||||
#define NUM_WEAPON_GAUGES 5
|
||||
hud_frames Weapon_gauges[NUM_WEAPON_GAUGES];
|
||||
#define NUM_HUD_SETTINGS 2
|
||||
hud_frames Weapon_gauges[NUM_HUD_SETTINGS][NUM_WEAPON_GAUGES];
|
||||
int Weapon_gauges_loaded = 0;
|
||||
// for primaries
|
||||
int Weapon_gauge_primary_coords[GR_NUM_RESOLUTIONS][3][2] = {
|
||||
{ // GR_640
|
||||
// based on the # of primaries
|
||||
{509, 273}, // top of weapon gauge, first frame, always
|
||||
{497, 293}, // for the first primary
|
||||
{497, 305} // for the second primary
|
||||
int Weapon_gauge_primary_coords[NUM_HUD_SETTINGS][GR_NUM_RESOLUTIONS][3][2] =
|
||||
{
|
||||
{ // normal HUD
|
||||
{ // GR_640
|
||||
// based on the # of primaries
|
||||
{509, 273}, // top of weapon gauge, first frame, always
|
||||
{497, 293}, // for the first primary
|
||||
{497, 305} // for the second primary
|
||||
},
|
||||
{ // GR_1024
|
||||
// based on the # of primaries
|
||||
{892, 525}, // top of weapon gauge, first frame, always
|
||||
{880, 545}, // for the first primary
|
||||
{880, 557} // for the second primary
|
||||
}
|
||||
},
|
||||
{ // GR_1024
|
||||
// based on the # of primaries
|
||||
{892, 525}, // top of weapon gauge, first frame, always
|
||||
{880, 545}, // for the first primary
|
||||
{880, 557} // for the second primary
|
||||
{ // ballistic HUD - slightly different alignment
|
||||
{ // GR_640
|
||||
// based on the # of primaries
|
||||
{485, 273}, // top of weapon gauge, first frame, always
|
||||
{485, 293}, // for the first primary
|
||||
{485, 305} // for the second primary
|
||||
},
|
||||
{ // GR_1024
|
||||
// based on the # of primaries
|
||||
{868, 525}, // top of weapon gauge, first frame, always
|
||||
{868, 545}, // for the first primary
|
||||
{868, 557} // for the second primary
|
||||
}
|
||||
}
|
||||
};
|
||||
int Weapon_gauge_secondary_coords[GR_NUM_RESOLUTIONS][5][2] = {
|
||||
{ // GR_640
|
||||
// based on the # of secondaries
|
||||
{497, 318}, // bottom of gauge, 0 secondaries
|
||||
{497, 318}, // bottom of gauge, 1 secondaries
|
||||
{497, 317}, // middle of gauge, 2 secondaries AND middle of gauge, 3 secondaries
|
||||
{497, 326}, // bottom of gauge, 2 secondaries AND middle of gauge, 3 secondaries
|
||||
{497, 335} // bottom of gauge, 3 secondaries
|
||||
int Weapon_gauge_secondary_coords[NUM_HUD_SETTINGS][GR_NUM_RESOLUTIONS][5][2] =
|
||||
{
|
||||
{ // normal HUD
|
||||
{ // GR_640
|
||||
// based on the # of secondaries
|
||||
{497, 318}, // bottom of gauge, 0 secondaries
|
||||
{497, 318}, // bottom of gauge, 1 secondaries
|
||||
{497, 317}, // middle of gauge, 2 secondaries AND middle of gauge, 3 secondaries
|
||||
{497, 326}, // bottom of gauge, 2 secondaries AND middle of gauge, 3 secondaries
|
||||
{497, 335} // bottom of gauge, 3 secondaries
|
||||
},
|
||||
{ // GR_1024
|
||||
// based on the # of secondaries
|
||||
{880, 570}, // bottom of gauge, 0 secondaries
|
||||
{880, 570}, // bottom of gauge, 1 secondaries
|
||||
{880, 569}, // middle of gauge, 2 secondaries AND middle of gauge, 3 secondaries
|
||||
{880, 578}, // bottom of gauge, 2 secondaries AND middle of gauge, 3 secondaries
|
||||
{880, 587} // bottom of gauge, 3 secondaries
|
||||
}
|
||||
},
|
||||
{ // GR_1024
|
||||
// based on the # of secondaries
|
||||
{880, 570}, // bottom of gauge, 0 secondaries
|
||||
{880, 570}, // bottom of gauge, 1 secondaries
|
||||
{880, 569}, // middle of gauge, 2 secondaries AND middle of gauge, 3 secondaries
|
||||
{880, 578}, // bottom of gauge, 2 secondaries AND middle of gauge, 3 secondaries
|
||||
{880, 587} // bottom of gauge, 3 secondaries
|
||||
{ // ballistic HUD - slightly different alignment
|
||||
{ // GR_640
|
||||
// based on the # of secondaries
|
||||
{485, 318}, // bottom of gauge, 0 secondaries
|
||||
{485, 318}, // bottom of gauge, 1 secondaries
|
||||
{485, 317}, // middle of gauge, 2 secondaries AND middle of gauge, 3 secondaries
|
||||
{485, 326}, // bottom of gauge, 2 secondaries AND middle of gauge, 3 secondaries
|
||||
{485, 335} // bottom of gauge, 3 secondaries
|
||||
},
|
||||
{ // GR_1024
|
||||
// based on the # of secondaries
|
||||
{868, 570}, // bottom of gauge, 0 secondaries
|
||||
{868, 570}, // bottom of gauge, 1 secondaries
|
||||
{868, 569}, // middle of gauge, 2 secondaries AND middle of gauge, 3 secondaries
|
||||
{868, 578}, // bottom of gauge, 2 secondaries AND middle of gauge, 3 secondaries
|
||||
{868, 587} // bottom of gauge, 3 secondaries
|
||||
}
|
||||
}
|
||||
};
|
||||
int Weapon_title_coords[GR_NUM_RESOLUTIONS][2] = {
|
||||
{ // GR_640
|
||||
518, 275
|
||||
int Weapon_title_coords[NUM_HUD_SETTINGS][GR_NUM_RESOLUTIONS][2] =
|
||||
{
|
||||
{ // normal HUD
|
||||
{ // GR_640
|
||||
518, 274
|
||||
},
|
||||
{ // GR_1024
|
||||
901, 527
|
||||
}
|
||||
},
|
||||
{ // GR_1024
|
||||
901, 527
|
||||
{ // ballistic HUD - slightly different alignment
|
||||
{ // GR_640
|
||||
487, 274
|
||||
},
|
||||
{ // GR_1024
|
||||
870, 527
|
||||
}
|
||||
}
|
||||
};
|
||||
int Weapon_plink_coords[GR_NUM_RESOLUTIONS][2][2] = {
|
||||
@@ -566,6 +657,16 @@ int Weapon_secondary_y[GR_NUM_RESOLUTIONS][3] = {
|
||||
579 // y location of where to draw text for the third secondary
|
||||
}
|
||||
};
|
||||
int Weapon_primary_y[GR_NUM_RESOLUTIONS][2] = {
|
||||
{ // GR_640
|
||||
285, // y location of where to draw text for the first primary
|
||||
295 // y location of where to draw text for the second primary
|
||||
},
|
||||
{ // GR_1024
|
||||
537, // y location of where to draw text for the first primary
|
||||
547 // y location of where to draw text for the second primary
|
||||
}
|
||||
};
|
||||
int Weapon_secondary_name_x[GR_NUM_RESOLUTIONS] = {
|
||||
536, // x location of where to draw weapon name
|
||||
919
|
||||
@@ -574,26 +675,48 @@ int Weapon_secondary_ammo_x[GR_NUM_RESOLUTIONS] = {
|
||||
525, // x location of where to draw weapon ammo count
|
||||
908
|
||||
};
|
||||
int Weapon_primary_ammo_x[GR_NUM_RESOLUTIONS] = {
|
||||
525, // x location of where to draw primary weapon ammo count
|
||||
908
|
||||
};
|
||||
int Weapon_secondary_reload_x[GR_NUM_RESOLUTIONS] = {
|
||||
615, // x location of where to draw the weapon reload time
|
||||
998
|
||||
};
|
||||
char *Weapon_gauge_fnames[GR_NUM_RESOLUTIONS][NUM_WEAPON_GAUGES] =
|
||||
char *Weapon_gauge_fnames[NUM_HUD_SETTINGS][GR_NUM_RESOLUTIONS][NUM_WEAPON_GAUGES] =
|
||||
{
|
||||
//XSTR:OFF
|
||||
{ // GR_640
|
||||
"weapons1",
|
||||
"weapons2",
|
||||
"weapons3",
|
||||
"weapons4",
|
||||
"weapons5"
|
||||
},
|
||||
{ // GR_1024
|
||||
"weapons1",
|
||||
"weapons2",
|
||||
"weapons3",
|
||||
"weapons4",
|
||||
"weapons5"
|
||||
{ // normal HUD
|
||||
{ // GR_640
|
||||
"weapons1",
|
||||
"weapons2",
|
||||
"weapons3",
|
||||
"weapons4",
|
||||
"weapons5"
|
||||
},
|
||||
{ // GR_1024
|
||||
"weapons1",
|
||||
"weapons2",
|
||||
"weapons3",
|
||||
"weapons4",
|
||||
"weapons5"
|
||||
}
|
||||
},
|
||||
{ // ballistic HUD - slightly different alignment
|
||||
{ // GR_640
|
||||
"weapons1_b",
|
||||
"weapons2_b",
|
||||
"weapons3_b",
|
||||
"weapons4_b",
|
||||
"weapons5_b"
|
||||
},
|
||||
{ // GR_1024
|
||||
"weapons1_b",
|
||||
"weapons2_b",
|
||||
"weapons3_b",
|
||||
"weapons4_b",
|
||||
"weapons5_b"
|
||||
}
|
||||
}
|
||||
//XSTR:ON
|
||||
};
|
||||
@@ -635,7 +758,7 @@ int hud_target_invalid_awacs(object *objp)
|
||||
// if objp is ship object, first check if can be targeted with team info
|
||||
if (objp->type == OBJ_SHIP) {
|
||||
if (Player_ship != NULL) {
|
||||
if (ship_is_visible_by_team(objp->instance, Player_ship->team)) {
|
||||
if (ship_is_visible_by_team_new(objp, Player_ship)) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -927,8 +1050,8 @@ object *hud_reticle_pick_target()
|
||||
return return_objp;
|
||||
}
|
||||
|
||||
// hud_target_hotkey_add_remove takes as it's parameter which hotkey (1-0) to add/remove the current
|
||||
// target from. This functio behaves like the Shift-<selection> does in Windows -- using shift # will toggle
|
||||
// hud_target_hotkey_add_remove takes as its parameter which hotkey (1-0) to add/remove the current
|
||||
// target from. This function behaves like the Shift-<selection> does in Windows -- using shift # will toggle
|
||||
// the current target in and out of the selection set.
|
||||
void hud_target_hotkey_add_remove( int k, object *ctarget, int how_to_add )
|
||||
{
|
||||
@@ -1157,7 +1280,7 @@ void hud_keyed_targets_clear()
|
||||
// Init data used for the weapons display on the HUD
|
||||
void hud_weapons_init()
|
||||
{
|
||||
int i;
|
||||
int i, j, k, hud_index, gauge_index, hud_warned;
|
||||
|
||||
Weapon_flash_info.is_bright = 0;
|
||||
for ( i = 0; i < MAX_WEAPON_FLASH_LINES; i++ ) {
|
||||
@@ -1165,13 +1288,71 @@ void hud_weapons_init()
|
||||
Weapon_flash_info.flash_next[i] = 1;
|
||||
}
|
||||
|
||||
if ( !Weapon_gauges_loaded ) {
|
||||
for ( i = 0; i < NUM_WEAPON_GAUGES; i++ ) {
|
||||
Weapon_gauges[i].first_frame = bm_load_animation(Weapon_gauge_fnames[gr_screen.res][i], &Weapon_gauges[i].num_frames);
|
||||
if ( Weapon_gauges[i].first_frame < 0 ) {
|
||||
Warning(LOCATION,"Cannot load hud ani: %s\n",Weapon_gauge_fnames[gr_screen.res][i]);
|
||||
if ( !Weapon_gauges_loaded )
|
||||
{
|
||||
hud_warned = 0;
|
||||
|
||||
for (hud_index = 0; hud_index < NUM_HUD_SETTINGS; hud_index++)
|
||||
{
|
||||
for ( gauge_index = 0; gauge_index < NUM_WEAPON_GAUGES; gauge_index++ )
|
||||
{
|
||||
Weapon_gauges[hud_index][gauge_index].first_frame = bm_load_animation(Weapon_gauge_fnames[hud_index][gr_screen.res][gauge_index], &Weapon_gauges[hud_index][gauge_index].num_frames);
|
||||
|
||||
// file not found?
|
||||
if ( Weapon_gauges[hud_index][gauge_index].first_frame < 0 )
|
||||
{
|
||||
// if this is the ballistic hud setting, load the conventional ani
|
||||
if (hud_index)
|
||||
{
|
||||
// give a single warning
|
||||
if (!hud_warned)
|
||||
{
|
||||
// commented because it gets annoying, and the warning really isn't needed anyway - Goober5000
|
||||
//Warning(LOCATION, "Warning: Ballistic HUD graphics not found. Defaulting to original graphics.\n");
|
||||
hud_warned = 1;
|
||||
}
|
||||
|
||||
Weapon_gauges[hud_index][gauge_index].first_frame = bm_load_animation(Weapon_gauge_fnames[0][gr_screen.res][gauge_index], &Weapon_gauges[hud_index][gauge_index].num_frames);
|
||||
|
||||
// and test again
|
||||
if ( Weapon_gauges[hud_index][gauge_index].first_frame < 0 )
|
||||
{
|
||||
Warning(LOCATION,"Cannot load hud ani: %s\n",Weapon_gauge_fnames[hud_index][gr_screen.res][gauge_index]);
|
||||
}
|
||||
}
|
||||
// otherwise, display the regular warning
|
||||
else
|
||||
{
|
||||
Warning(LOCATION,"Cannot load hud ani: %s\n",Weapon_gauge_fnames[hud_index][gr_screen.res][gauge_index]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// reset the old coordinates if hud_warned
|
||||
if (hud_warned)
|
||||
{
|
||||
// don't reset the first one, but reset all others
|
||||
for (hud_index = 1; hud_index < NUM_HUD_SETTINGS; hud_index++)
|
||||
{
|
||||
for (i = 0; i < GR_NUM_RESOLUTIONS; i++)
|
||||
{
|
||||
for (k = 0; k < 2; k++)
|
||||
{
|
||||
for (j = 0; j < 3; j++)
|
||||
{
|
||||
Weapon_gauge_primary_coords[hud_index][i][j][k] = Weapon_gauge_primary_coords[0][i][j][k];
|
||||
}
|
||||
for (j = 0; j < 5; j++)
|
||||
{
|
||||
Weapon_gauge_secondary_coords[hud_index][i][j][k] = Weapon_gauge_secondary_coords[0][i][j][k];
|
||||
}
|
||||
Weapon_title_coords[hud_index][i][k] = Weapon_title_coords[0][i][k];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Weapon_gauges_loaded = 1;
|
||||
}
|
||||
}
|
||||
@@ -1191,6 +1372,19 @@ void hud_init_targeting()
|
||||
{
|
||||
Assert(Player_ai != NULL);
|
||||
|
||||
int i;
|
||||
|
||||
// decide whether to realign HUD for ballistic primaries
|
||||
ballistic_hud_index = 0;
|
||||
for (i = 0; i < Player_ship->weapons.num_primary_banks; i++)
|
||||
{
|
||||
if (Weapon_info[Player_ship->weapons.primary_bank_weapons[i]].wi_flags2 & WIF2_BALLISTIC)
|
||||
{
|
||||
ballistic_hud_index = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// make sure there is no current target
|
||||
set_target_objnum( Player_ai, -1 );
|
||||
Player_ai->last_target = -1;
|
||||
@@ -1256,8 +1450,6 @@ void hud_init_targeting()
|
||||
} else {
|
||||
Toggle_text_alpha = 160;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
// Target the next or previous subobject on the currently selected ship, based on next_flag.
|
||||
@@ -3188,7 +3380,7 @@ void hud_show_remote_detonate_missile()
|
||||
}
|
||||
}
|
||||
|
||||
// routine to possibly draw a bouding box around a ship sending a message to the player
|
||||
// routine to possibly draw a bounding box around a ship sending a message to the player
|
||||
void hud_show_message_sender()
|
||||
{
|
||||
object *targetp;
|
||||
@@ -3814,18 +4006,28 @@ int hud_get_best_primary_bank(float *range)
|
||||
num_to_test = min(1, swp->num_primary_banks);
|
||||
}
|
||||
|
||||
for ( i = 0; i < num_to_test; i++ ) {
|
||||
|
||||
bank_to_fire = (swp->current_primary_bank+i)%2; // Max supported banks is 2
|
||||
for ( i = 0; i < num_to_test; i++ )
|
||||
{
|
||||
bank_to_fire = (swp->current_primary_bank+i)%MAX_SUPPORTED_PRIMARY_BANKS; // Max supported banks is 2
|
||||
|
||||
// calculate the range of the weapon, and only display the lead target indicator when
|
||||
// calculate the range of the weapon, and only display the lead target indicator
|
||||
// if the weapon can actually hit the target
|
||||
Assert(bank_to_fire >= 0);
|
||||
Assert(swp->primary_bank_weapons[bank_to_fire] >= 0);
|
||||
wip = &Weapon_info[swp->primary_bank_weapons[bank_to_fire]];
|
||||
weapon_range = wip->max_speed * wip->lifetime;
|
||||
|
||||
if ( weapon_range > farthest_weapon_range ) {
|
||||
// don't consider this primary if it's a ballistic that's out of ammo - Goober5000
|
||||
if ( wip->wi_flags2 & WIF2_BALLISTIC )
|
||||
{
|
||||
if ( swp->primary_bank_ammo[bank_to_fire] <= 0)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if ( weapon_range > farthest_weapon_range )
|
||||
{
|
||||
best_bank = bank_to_fire;
|
||||
farthest_weapon_range = weapon_range;
|
||||
}
|
||||
@@ -3975,17 +4177,24 @@ void hud_show_lead_indicator(vector *target_world_pos)
|
||||
|
||||
srange = ship_get_secondary_weapon_range(Player_ship);
|
||||
|
||||
if ( swp->current_secondary_bank >= 0 ) {
|
||||
if ( swp->current_secondary_bank >= 0 )
|
||||
{
|
||||
int bank = swp->current_secondary_bank;
|
||||
tmp = &Weapon_info[swp->secondary_bank_weapons[bank]];
|
||||
if ( tmp->wi_flags & WIF_HOMING_ASPECT ) {
|
||||
if ( !Player->target_in_lock_cone ) {
|
||||
if ( tmp->wi_flags & WIF_HOMING_ASPECT )
|
||||
{
|
||||
if ( !Player->target_in_lock_cone )
|
||||
{
|
||||
srange = -1.0f;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//frame_offset=hudtarget_lead_indicator_pick_frame(prange, srange, dist_to_target);
|
||||
frame_offset = hudtarget_lead_indicator_pick_frame(prange, srange, dist_to_target);
|
||||
|
||||
/* Commented out by Goober5000, because it's a bit buggy. The original Volition code
|
||||
// is A-1 SUPAR and ought to work for dumbfires as well. O_o
|
||||
--------------- Phreak's Non-Working Code (TM) ------------
|
||||
if (dist_to_target < prange)
|
||||
{
|
||||
frame_offset=2;
|
||||
@@ -4006,10 +4215,11 @@ void hud_show_lead_indicator(vector *target_world_pos)
|
||||
{
|
||||
if((dist_to_target < srange) && (tmp->wi_flags & WIF_HOMING_HEAT))
|
||||
{
|
||||
frame_offset=0;
|
||||
frame_offset=0; // and this probably should be 2 - Goober5000
|
||||
}
|
||||
}
|
||||
}
|
||||
----------------------------------------------------------- */
|
||||
|
||||
if ( frame_offset < 0 ) {
|
||||
return;
|
||||
@@ -4617,16 +4827,26 @@ void hud_show_weapon_energy_gauge()
|
||||
float percent_left;
|
||||
int clip_h, i, w, h;
|
||||
|
||||
if ( Energy_bar_gauges.first_frame == -1 ){
|
||||
if ( Energy_bar_gauges.first_frame == -1 )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if ( Player_ship->weapons.num_primary_banks <= 0 ){
|
||||
if ( Player_ship->weapons.num_primary_banks <= 0 )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// also leave if no energy can be stored for weapons
|
||||
if (Objects[Player_ship->objnum].flags & OF_NO_LASERS)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
percent_left = Player_ship->weapon_energy/Ship_info[Player_ship->ship_info_index].max_weapon_reserve;
|
||||
if ( percent_left > 1 ) {
|
||||
if ( percent_left > 1 )
|
||||
{
|
||||
percent_left = 1.0f;
|
||||
}
|
||||
|
||||
@@ -4641,9 +4861,12 @@ void hud_show_weapon_energy_gauge()
|
||||
}
|
||||
|
||||
hud_set_gauge_color(HUD_WEAPONS_ENERGY);
|
||||
for ( i = 0; i < Player_ship->weapons.num_primary_banks; i++ ) {
|
||||
if ( !timestamp_elapsed(Weapon_flash_info.flash_duration[i]) ) {
|
||||
if ( Weapon_flash_info.is_bright & (1<<i) ) {
|
||||
for ( i = 0; i < Player_ship->weapons.num_primary_banks; i++ )
|
||||
{
|
||||
if ( !timestamp_elapsed(Weapon_flash_info.flash_duration[i]) )
|
||||
{
|
||||
if ( Weapon_flash_info.is_bright & (1<<i) )
|
||||
{
|
||||
// hud_set_bright_color();
|
||||
hud_set_gauge_color(HUD_WEAPONS_ENERGY, HUD_C_BRIGHT);
|
||||
break;
|
||||
@@ -4708,7 +4931,7 @@ void hud_show_target_triangle_indicator(vertex *projected_v)
|
||||
}
|
||||
}
|
||||
|
||||
// called from hud_show_weapons() to plot out the secondary weapon name and amo
|
||||
// called from hud_show_weapons() to plot out the secondary weapon name and ammo
|
||||
void hud_show_secondary_weapon(int count, ship_weapon *sw, int dual_fire)
|
||||
{
|
||||
char ammo_str[32];
|
||||
@@ -4732,7 +4955,7 @@ void hud_show_secondary_weapon(int count, ship_weapon *sw, int dual_fire)
|
||||
strcpy(weapon_name, wip->name);
|
||||
}
|
||||
|
||||
hud_end_string_at_first_hash_symbol(weapon_name);
|
||||
end_string_at_first_hash_symbol(weapon_name);
|
||||
|
||||
if ( sw->current_secondary_bank == i ) {
|
||||
emp_hud_printf(Weapon_sunlinked_x[gr_screen.res], Weapon_secondary_y[gr_screen.res][i] - np*12, EG_NULL, "%c", Lcl_special_chars + 2);
|
||||
@@ -4764,6 +4987,29 @@ void hud_show_secondary_weapon(int count, ship_weapon *sw, int dual_fire)
|
||||
}
|
||||
}
|
||||
|
||||
// called from hud_show_weapons() to plot out the primary weapon ammo - Goober5000
|
||||
void hud_show_primary_weapon_ammo(int count, ship_weapon *sw)
|
||||
{
|
||||
char ammo_str[32];
|
||||
int i, w, h;
|
||||
|
||||
for ( i = 0; i < count; i++ )
|
||||
{
|
||||
// for all ballistic weapons
|
||||
if (Weapon_info[sw->primary_bank_weapons[i]].wi_flags2 & WIF2_BALLISTIC)
|
||||
{
|
||||
// print out the ammo right justified
|
||||
sprintf(ammo_str, "%d", sw->primary_bank_ammo[i]);
|
||||
hud_num_make_mono(ammo_str);
|
||||
gr_get_string_size(&w, &h, ammo_str);
|
||||
|
||||
emp_hud_string(Weapon_primary_ammo_x[gr_screen.res] - w, Weapon_primary_y[gr_screen.res][i], EG_NULL, ammo_str);
|
||||
|
||||
hud_set_gauge_color(HUD_WEAPONS_GAUGE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// start the weapon line (on the HUD) flashing
|
||||
void hud_start_flash_weapon(int index)
|
||||
{
|
||||
@@ -4838,6 +5084,8 @@ void hud_show_cmeasure_gague()
|
||||
void hud_show_weapons()
|
||||
{
|
||||
ship_weapon *sw;
|
||||
int ship_is_ballistic;
|
||||
|
||||
int np, ns; // np == num primary, ns == num secondary
|
||||
char name[NAME_LENGTH];
|
||||
|
||||
@@ -4848,6 +5096,7 @@ void hud_show_weapons()
|
||||
Assert(Player_obj->instance >= 0 && Player_obj->instance < MAX_SHIPS);
|
||||
|
||||
sw = &Ships[Player_obj->instance].weapons;
|
||||
ship_is_ballistic = (Ship_info[Ships[Player_obj->instance].ship_info_index].flags & SIF_BALLISTIC_PRIMARIES);
|
||||
|
||||
np = sw->num_primary_banks;
|
||||
ns = sw->num_secondary_banks;
|
||||
@@ -4860,14 +5109,14 @@ void hud_show_weapons()
|
||||
hud_set_gauge_color(HUD_WEAPONS_GAUGE);
|
||||
|
||||
// draw top of primary display
|
||||
GR_AABITMAP(Weapon_gauges[0].first_frame, Weapon_gauge_primary_coords[gr_screen.res][0][0], Weapon_gauge_primary_coords[gr_screen.res][0][1]);
|
||||
GR_AABITMAP(Weapon_gauges[ballistic_hud_index][0].first_frame, Weapon_gauge_primary_coords[ballistic_hud_index][gr_screen.res][0][0], Weapon_gauge_primary_coords[ballistic_hud_index][gr_screen.res][0][1]);
|
||||
|
||||
emp_hud_string(Weapon_title_coords[gr_screen.res][0], Weapon_title_coords[gr_screen.res][1], EG_WEAPON_TITLE, XSTR( "weapons", 328));
|
||||
emp_hud_string(Weapon_title_coords[ballistic_hud_index][gr_screen.res][0], Weapon_title_coords[ballistic_hud_index][gr_screen.res][1], EG_WEAPON_TITLE, XSTR( "weapons", 328));
|
||||
|
||||
switch ( np ) {
|
||||
case 0:
|
||||
// draw bottom of border
|
||||
GR_AABITMAP(Weapon_gauges[2].first_frame, Weapon_gauge_primary_coords[gr_screen.res][1][0], Weapon_gauge_primary_coords[gr_screen.res][1][1]);
|
||||
GR_AABITMAP(Weapon_gauges[ballistic_hud_index][2].first_frame, Weapon_gauge_primary_coords[ballistic_hud_index][gr_screen.res][1][0], Weapon_gauge_primary_coords[ballistic_hud_index][gr_screen.res][1][1]);
|
||||
|
||||
emp_hud_string(Weapon_pname_coords[gr_screen.res][0][0], Weapon_pname_coords[gr_screen.res][0][1], EG_WEAPON_P1, XSTR( "<none>", 329));
|
||||
|
||||
@@ -4876,7 +5125,7 @@ void hud_show_weapons()
|
||||
|
||||
case 1:
|
||||
// draw bottom of border
|
||||
GR_AABITMAP(Weapon_gauges[2].first_frame, Weapon_gauge_primary_coords[gr_screen.res][1][0], Weapon_gauge_primary_coords[gr_screen.res][1][1]);
|
||||
GR_AABITMAP(Weapon_gauges[ballistic_hud_index][2].first_frame, Weapon_gauge_primary_coords[ballistic_hud_index][gr_screen.res][1][0], Weapon_gauge_primary_coords[ballistic_hud_index][gr_screen.res][1][1]);
|
||||
|
||||
strcpy(name, Weapon_info[sw->primary_bank_weapons[0]].name);
|
||||
if (Lcl_gr) {
|
||||
@@ -4893,14 +5142,20 @@ void hud_show_weapons()
|
||||
|
||||
emp_hud_printf(Weapon_plink_coords[gr_screen.res][0][0], Weapon_plink_coords[gr_screen.res][0][1], EG_NULL, "%c", Lcl_special_chars + 2);
|
||||
emp_hud_printf(Weapon_pname_coords[gr_screen.res][0][0], Weapon_pname_coords[gr_screen.res][0][1], EG_WEAPON_P2, "%s", name);
|
||||
|
||||
// check ballistic - Goober5000
|
||||
if (ship_is_ballistic)
|
||||
{
|
||||
hud_show_primary_weapon_ammo(1, sw);
|
||||
}
|
||||
break;
|
||||
|
||||
case 2:
|
||||
// draw border to accomodate second primary weapon
|
||||
GR_AABITMAP(Weapon_gauges[1].first_frame, Weapon_gauge_primary_coords[gr_screen.res][1][0], Weapon_gauge_primary_coords[gr_screen.res][1][1]);
|
||||
GR_AABITMAP(Weapon_gauges[ballistic_hud_index][1].first_frame, Weapon_gauge_primary_coords[ballistic_hud_index][gr_screen.res][1][0], Weapon_gauge_primary_coords[ballistic_hud_index][gr_screen.res][1][1]);
|
||||
|
||||
// draw bottom of border
|
||||
GR_AABITMAP(Weapon_gauges[2].first_frame, Weapon_gauge_primary_coords[gr_screen.res][2][0], Weapon_gauge_primary_coords[gr_screen.res][2][1]);
|
||||
GR_AABITMAP(Weapon_gauges[ballistic_hud_index][2].first_frame, Weapon_gauge_primary_coords[ballistic_hud_index][gr_screen.res][2][0], Weapon_gauge_primary_coords[ballistic_hud_index][gr_screen.res][2][1]);
|
||||
|
||||
strcpy(name, Weapon_info[sw->primary_bank_weapons[0]].name);
|
||||
if (Lcl_gr) {
|
||||
@@ -4935,6 +5190,13 @@ void hud_show_weapons()
|
||||
}
|
||||
emp_hud_printf(Weapon_pname_coords[gr_screen.res][1][0], Weapon_pname_coords[gr_screen.res][1][1], EG_WEAPON_P2, "%s", name);
|
||||
np = 0;
|
||||
|
||||
// check ballistic - Goober5000
|
||||
if (ship_is_ballistic)
|
||||
{
|
||||
hud_show_primary_weapon_ammo(2, sw);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
@@ -4948,37 +5210,37 @@ void hud_show_weapons()
|
||||
switch ( ns ) {
|
||||
case 0:
|
||||
// draw the bottom of the secondary weapons
|
||||
GR_AABITMAP(Weapon_gauges[4].first_frame, Weapon_gauge_secondary_coords[gr_screen.res][0][0], Weapon_gauge_secondary_coords[gr_screen.res][0][1] - 12*np - 1);
|
||||
GR_AABITMAP(Weapon_gauges[ballistic_hud_index][4].first_frame, Weapon_gauge_secondary_coords[ballistic_hud_index][gr_screen.res][0][0], Weapon_gauge_secondary_coords[ballistic_hud_index][gr_screen.res][0][1] - 12*np - 1);
|
||||
|
||||
emp_hud_string(Weapon_pname_coords[gr_screen.res][0][0], Weapon_secondary_y[gr_screen.res][0] - np*12, EG_WEAPON_S1, XSTR( "<none>", 329));
|
||||
break;
|
||||
|
||||
case 1:
|
||||
// draw the bottom of the secondary weapons
|
||||
GR_AABITMAP(Weapon_gauges[4].first_frame, Weapon_gauge_secondary_coords[gr_screen.res][1][0], Weapon_gauge_secondary_coords[gr_screen.res][1][1] - 12*np - 1);
|
||||
GR_AABITMAP(Weapon_gauges[ballistic_hud_index][4].first_frame, Weapon_gauge_secondary_coords[ballistic_hud_index][gr_screen.res][1][0], Weapon_gauge_secondary_coords[ballistic_hud_index][gr_screen.res][1][1] - 12*np - 1);
|
||||
|
||||
hud_show_secondary_weapon(1, sw, Player_ship->flags & SF_SECONDARY_DUAL_FIRE);
|
||||
break;
|
||||
|
||||
case 2:
|
||||
// draw the middle border, only present when there are 2 or more secondaries
|
||||
GR_AABITMAP(Weapon_gauges[3].first_frame, Weapon_gauge_secondary_coords[gr_screen.res][2][0], Weapon_gauge_secondary_coords[gr_screen.res][2][1] - np*12);
|
||||
GR_AABITMAP(Weapon_gauges[ballistic_hud_index][3].first_frame, Weapon_gauge_secondary_coords[ballistic_hud_index][gr_screen.res][2][0], Weapon_gauge_secondary_coords[ballistic_hud_index][gr_screen.res][2][1] - np*12);
|
||||
|
||||
// draw the bottom of the secondary weapons
|
||||
GR_AABITMAP(Weapon_gauges[4].first_frame, Weapon_gauge_secondary_coords[gr_screen.res][3][0], Weapon_gauge_secondary_coords[gr_screen.res][3][1] - 12*np);
|
||||
GR_AABITMAP(Weapon_gauges[ballistic_hud_index][4].first_frame, Weapon_gauge_secondary_coords[ballistic_hud_index][gr_screen.res][3][0], Weapon_gauge_secondary_coords[ballistic_hud_index][gr_screen.res][3][1] - 12*np);
|
||||
|
||||
hud_show_secondary_weapon(2, sw, Player_ship->flags & SF_SECONDARY_DUAL_FIRE);
|
||||
break;
|
||||
|
||||
case 3:
|
||||
// draw the middle border, only present when there are 2 or more secondaries
|
||||
GR_AABITMAP(Weapon_gauges[3].first_frame, Weapon_gauge_secondary_coords[gr_screen.res][2][0], Weapon_gauge_secondary_coords[gr_screen.res][2][1] - np*12);
|
||||
GR_AABITMAP(Weapon_gauges[ballistic_hud_index][3].first_frame, Weapon_gauge_secondary_coords[ballistic_hud_index][gr_screen.res][2][0], Weapon_gauge_secondary_coords[ballistic_hud_index][gr_screen.res][2][1] - np*12);
|
||||
|
||||
// draw the bottm border, only present when there are 3 secondaries
|
||||
GR_AABITMAP(Weapon_gauges[3].first_frame, Weapon_gauge_secondary_coords[gr_screen.res][3][0], Weapon_gauge_secondary_coords[gr_screen.res][3][1] - np*12);
|
||||
GR_AABITMAP(Weapon_gauges[ballistic_hud_index][3].first_frame, Weapon_gauge_secondary_coords[ballistic_hud_index][gr_screen.res][3][0], Weapon_gauge_secondary_coords[ballistic_hud_index][gr_screen.res][3][1] - np*12);
|
||||
|
||||
// draw the bottom of the secondary weapons
|
||||
GR_AABITMAP(Weapon_gauges[4].first_frame, Weapon_gauge_secondary_coords[gr_screen.res][4][0], Weapon_gauge_secondary_coords[gr_screen.res][4][1] - 12*np);
|
||||
GR_AABITMAP(Weapon_gauges[ballistic_hud_index][4].first_frame, Weapon_gauge_secondary_coords[ballistic_hud_index][gr_screen.res][4][0], Weapon_gauge_secondary_coords[ballistic_hud_index][gr_screen.res][4][1] - 12*np);
|
||||
|
||||
hud_show_secondary_weapon(3, sw, Player_ship->flags & SF_SECONDARY_DUAL_FIRE);
|
||||
break;
|
||||
@@ -5235,6 +5497,10 @@ void hud_show_auto_icons()
|
||||
if ( Toggle_gauge.first_frame == -1 )
|
||||
return;
|
||||
|
||||
// don't draw auto icons if we have primitive sensors - Goober5000
|
||||
if (Player_ship->flags2 & SF2_PRIMITIVE_SENSORS)
|
||||
return;
|
||||
|
||||
// display auto target icon
|
||||
if ( hud_gauge_active(HUD_AUTO_TARGET) ) {
|
||||
show_flag=1;
|
||||
@@ -5662,7 +5928,7 @@ void hudtarget_page_in()
|
||||
int i;
|
||||
|
||||
for ( i = 0; i < NUM_WEAPON_GAUGES; i++ ) {
|
||||
bm_page_in_aabitmap( Weapon_gauges[i].first_frame, Weapon_gauges[i].num_frames);
|
||||
bm_page_in_aabitmap( Weapon_gauges[ballistic_hud_index][i].first_frame, Weapon_gauges[ballistic_hud_index][i].num_frames);
|
||||
}
|
||||
bm_page_in_aabitmap( Lead_indicator_gauge.first_frame, Lead_indicator_gauge.num_frames);
|
||||
bm_page_in_aabitmap( Energy_bar_gauges.first_frame, Energy_bar_gauges.num_frames);
|
||||
|
||||
@@ -9,13 +9,54 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Hud/HUDtargetbox.cpp $
|
||||
* $Revision: 2.4 $
|
||||
* $Date: 2002-10-22 23:02:40 $
|
||||
* $Author: randomtiger $
|
||||
* $Revision: 2.13 $
|
||||
* $Date: 2003-01-27 07:46:33 $
|
||||
* $Author: Goober5000 $
|
||||
*
|
||||
* C module for drawing the target monitor box on the HUD
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.12 2003/01/17 07:59:09 Goober5000
|
||||
* fixed some really strange behavior with strings not being truncated at the
|
||||
* # symbol
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.11 2003/01/17 01:48:50 Goober5000
|
||||
* added capability to the $Texture replace code to substitute the textures
|
||||
* without needing and extra model, however, this way you can't substitute
|
||||
* transparent or animated textures
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.10 2003/01/15 20:49:10 Goober5000
|
||||
* did the XSTR for the turret thing
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.9 2003/01/15 16:52:27 Goober5000
|
||||
* oops, that'll introduce a bug - naming it just plain "Turret" instead
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.8 2003/01/15 16:48:59 Goober5000
|
||||
* capship ballistic weapon displays "Cannon" on HUD instead of "Laser Turret"
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.7 2003/01/15 07:09:09 Goober5000
|
||||
* changed most references to modelnum to use ship instead of ship_info --
|
||||
* this will help with the change-model sexp and any other instances of model
|
||||
* changing
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.6 2002/12/14 17:09:28 Goober5000
|
||||
* removed mission flag for fighterbay damage; instead made damage display contingent on whether the fighterbay subsystem is assigned a damage percentage in ships.tbl
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.5 2002/12/14 01:55:04 Goober5000
|
||||
* added mission flag to show subsystem damage for fighterbays
|
||||
* ~Goober5000~
|
||||
*
|
||||
* Revision 2.4 2002/10/22 23:02:40 randomtiger
|
||||
* Made Phreaks alternative scanning style optional under the command line tag "-phreak"
|
||||
* Fixed bug that changes HUD colour when targetting debris in a full nebula. - RT
|
||||
*
|
||||
* Revision 2.3 2002/09/20 20:01:30 phreak
|
||||
* extra effects during cargo scan
|
||||
*
|
||||
@@ -914,13 +955,21 @@ void get_turret_subsys_name(model_subsystem *system_info, char *outstr)
|
||||
} else {
|
||||
|
||||
if (Weapon_info[system_info->turret_weapon_type].subtype == WP_LASER) {
|
||||
sprintf(outstr, "%s", XSTR("Laser turret", 1568));
|
||||
// ballistic too! - Goober5000
|
||||
if (Weapon_info[system_info->turret_weapon_type].wi_flags2 & WIF2_BALLISTIC)
|
||||
{
|
||||
sprintf(outstr, "%s", XSTR("Turret", 1487));
|
||||
}
|
||||
else
|
||||
{
|
||||
sprintf(outstr, "%s", XSTR("Laser turret", 1568));
|
||||
}
|
||||
} else if (Weapon_info[system_info->turret_weapon_type].subtype == WP_MISSILE) {
|
||||
sprintf(outstr, "%s", XSTR("Missile lnchr", 1569));
|
||||
} else {
|
||||
// Illegal subtype
|
||||
Int3();
|
||||
sprintf(outstr, "%s", NOX("Turret"));
|
||||
sprintf(outstr, "%s", XSTR("Turret", 1487));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@@ -980,10 +1029,7 @@ void hud_render_target_ship_info(object *target_objp)
|
||||
mission_parse_lookup_alt_index(target_shipp->alt_type_index, temp_name);
|
||||
} else {
|
||||
strcpy(temp_name, Ship_info[base_index].name);
|
||||
if ( strstr(Ship_info[base_index].name, NOX("#")) ) {
|
||||
strcpy(temp_name, Ship_info[base_index].name);
|
||||
hud_end_string_at_first_hash_symbol(temp_name);
|
||||
}
|
||||
end_string_at_first_hash_symbol(temp_name);
|
||||
}
|
||||
|
||||
if (Lcl_gr) {
|
||||
@@ -1051,7 +1097,10 @@ void hud_render_target_ship_info(object *target_objp)
|
||||
|
||||
// AL 23-3-98: Fighter bays are a special case. Player cannot destroy them, so don't
|
||||
// show the subsystem strength
|
||||
if ( strnicmp(NOX("fighter"), Player_ai->targeted_subsys->system_info->name, 7) ) {
|
||||
// Goober5000: don't display any strength if we can't destroy this subsystem - but sometimes
|
||||
// fighterbays can be destroyed
|
||||
if ( ship_subsys_takes_damage(Player_ai->targeted_subsys) )
|
||||
{
|
||||
sprintf(outstr,XSTR( "%d%%", 341),screen_integrity);
|
||||
gr_get_string_size(&w,&h,outstr);
|
||||
gr_printf(Target_window_coords[gr_screen.res][0]+Target_window_coords[gr_screen.res][2]-w-1, Target_window_coords[gr_screen.res][1]+Target_window_coords[gr_screen.res][3] - h, "%s", outstr);
|
||||
@@ -1299,7 +1348,7 @@ void hud_render_target_ship(object *target_objp)
|
||||
// hud_targetbox_get_eye(&camera_eye, &camera_orient, Player_obj->instance);
|
||||
|
||||
hud_render_target_setup(&camera_eye, &camera_orient, target_sip->closeup_zoom);
|
||||
// model_clear_instance(target_sip->modelnum);
|
||||
// model_clear_instance(target_shipp->modelnum);
|
||||
ship_model_start( target_objp );
|
||||
|
||||
if (Targetbox_wire!=0)
|
||||
@@ -1336,7 +1385,7 @@ void hud_render_target_ship(object *target_objp)
|
||||
if(target_sip->modelnum_hud >= 0){
|
||||
model_render( target_sip->modelnum_hud, &target_objp->orient, &obj_pos, flags | MR_NO_LIGHTING | MR_LOCK_DETAIL | MR_AUTOCENTER);
|
||||
} else {
|
||||
model_render( target_sip->modelnum, &target_objp->orient, &obj_pos, flags | MR_NO_LIGHTING | MR_LOCK_DETAIL | MR_AUTOCENTER);
|
||||
model_render( target_shipp->modelnum, &target_objp->orient, &obj_pos, flags | MR_NO_LIGHTING | MR_LOCK_DETAIL | MR_AUTOCENTER, -1, -1, target_shipp->replacement_textures);
|
||||
}
|
||||
ship_model_stop( target_objp );
|
||||
|
||||
@@ -1439,13 +1488,9 @@ void hud_render_target_debris(object *target_objp)
|
||||
base_index = ship_info_base_lookup( debrisp->ship_info_index );
|
||||
|
||||
// print out ship class that debris came from
|
||||
char *printable_ship_class = Ship_info[base_index].name;
|
||||
if ( strstr(Ship_info[base_index].name, NOX("#")) ) {
|
||||
char temp_name[NAME_LENGTH];
|
||||
strcpy(temp_name, Ship_info[base_index].name);
|
||||
hud_end_string_at_first_hash_symbol(temp_name);
|
||||
printable_ship_class = temp_name;
|
||||
}
|
||||
char printable_ship_class[NAME_LENGTH];
|
||||
strcpy(printable_ship_class, Ship_info[base_index].name);
|
||||
end_string_at_first_hash_symbol(printable_ship_class);
|
||||
|
||||
emp_hud_string(Targetbox_coords[gr_screen.res][TBOX_CLASS][0], Targetbox_coords[gr_screen.res][TBOX_CLASS][1], EG_TBOX_CLASS, printable_ship_class);
|
||||
emp_hud_string(Targetbox_coords[gr_screen.res][TBOX_NAME][0], Targetbox_coords[gr_screen.res][TBOX_NAME][1], EG_TBOX_NAME, XSTR( "debris", 348));
|
||||
@@ -1465,6 +1510,7 @@ void hud_render_target_weapon(object *target_objp)
|
||||
weapon_info *target_wip = NULL;
|
||||
weapon *wp = NULL;
|
||||
object *viewer_obj, *viewed_obj;
|
||||
int *replacement_textures = NULL;
|
||||
int target_team, is_homing, is_player_missile, missile_view, viewed_model_num, w, h;
|
||||
float factor;
|
||||
char outstr[100]; // temp buffer
|
||||
@@ -1495,6 +1541,7 @@ void hud_render_target_weapon(object *target_objp)
|
||||
viewed_obj = wp->homing_object;
|
||||
missile_view = TRUE;
|
||||
viewed_model_num = Ships[wp->homing_object->instance].modelnum;
|
||||
replacement_textures = Ships[wp->homing_object->instance].replacement_textures;
|
||||
}
|
||||
|
||||
if (Targetbox_wire!=0)
|
||||
@@ -1542,7 +1589,7 @@ void hud_render_target_weapon(object *target_objp)
|
||||
hud_render_target_setup(&camera_eye, &camera_orient, View_zoom/3);
|
||||
model_clear_instance(viewed_model_num);
|
||||
|
||||
model_render( viewed_model_num, &viewed_obj->orient, &obj_pos, flags | MR_NO_LIGHTING | MR_LOCK_DETAIL | MR_AUTOCENTER);
|
||||
model_render( viewed_model_num, &viewed_obj->orient, &obj_pos, flags | MR_NO_LIGHTING | MR_LOCK_DETAIL | MR_AUTOCENTER, -1, -1, replacement_textures);
|
||||
hud_render_target_close();
|
||||
}
|
||||
|
||||
@@ -1562,9 +1609,8 @@ void hud_render_target_weapon(object *target_objp)
|
||||
gr_get_string_size(&w,&h,outstr);
|
||||
|
||||
// drop name past the # sign
|
||||
if ( strstr(outstr, NOX("#")) ) {
|
||||
hud_end_string_at_first_hash_symbol(outstr);
|
||||
}
|
||||
end_string_at_first_hash_symbol(outstr);
|
||||
|
||||
emp_hud_string(Targetbox_coords[gr_screen.res][TBOX_NAME][0], Targetbox_coords[gr_screen.res][TBOX_NAME][1], EG_TBOX_NAME, outstr);
|
||||
|
||||
// If a homing weapon, show time to impact
|
||||
|
||||
@@ -9,13 +9,31 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Io/KeyControl.cpp $
|
||||
* $Revision: 2.4 $
|
||||
* $Date: 2002-10-19 03:50:29 $
|
||||
* $Author: randomtiger $
|
||||
* $Revision: 2.9 $
|
||||
* $Date: 2003-01-18 10:00:43 $
|
||||
* $Author: Goober5000 $
|
||||
*
|
||||
* Routines to read and deal with keyboard input.
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.8 2003/01/03 21:58:08 Goober5000
|
||||
* Fixed some minor bugs, and added a primitive-sensors flag, where if a ship
|
||||
* has primitive sensors it can't target anything and objects don't appear
|
||||
* on radar if they're outside a certain range. This range can be modified
|
||||
* via the sexp primitive-sensors-set-range.
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.7 2002/12/31 18:59:43 Goober5000
|
||||
* if it ain't broke, don't fix it
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.5 2002/12/10 05:43:34 Goober5000
|
||||
* Full-fledged ballistic primary support added! Try it and see! :)
|
||||
*
|
||||
* Revision 2.4 2002/10/19 03:50:29 randomtiger
|
||||
* Added special pause mode for easier action screenshots.
|
||||
* Added new command line parameter for accessing all single missions in tech room. - RT
|
||||
*
|
||||
* Revision 2.3 2002/10/17 20:40:51 randomtiger
|
||||
* Added ability to remove HUD ingame on keypress shift O
|
||||
* So I've added a new key to the bind list and made use of already existing hud removal code.
|
||||
@@ -759,9 +777,32 @@ void debug_max_secondary_weapons(object *objp)
|
||||
int index;
|
||||
ship *shipp = &Ships[objp->instance];
|
||||
ship_info *sip = &Ship_info[shipp->ship_info_index];
|
||||
ship_weapon *swp = &shipp->weapons;
|
||||
|
||||
for ( index = 0; index < MAX_SECONDARY_BANKS; index++ ) {
|
||||
shipp->weapons.secondary_bank_ammo[index] = sip->secondary_bank_ammo_capacity[index];
|
||||
for ( index = 0; index < MAX_SECONDARY_BANKS; index++ )
|
||||
{
|
||||
swp->secondary_bank_ammo[index] = sip->secondary_bank_ammo_capacity[index];
|
||||
}
|
||||
}
|
||||
|
||||
void debug_max_primary_weapons(object *objp) // Goober5000
|
||||
{
|
||||
int index;
|
||||
ship *shipp = &Ships[objp->instance];
|
||||
ship_info *sip = &Ship_info[shipp->ship_info_index];
|
||||
ship_weapon *swp = &shipp->weapons;
|
||||
weapon_info *wip;
|
||||
|
||||
if (sip->flags & SIF_BALLISTIC_PRIMARIES)
|
||||
{
|
||||
for ( index = 0; index < MAX_PRIMARY_BANKS; index++ )
|
||||
{
|
||||
wip = &Weapon_info[swp->primary_bank_weapons[index]];
|
||||
if (wip->wi_flags2 & WIF2_BALLISTIC)
|
||||
{
|
||||
swp->primary_bank_ammo[index] = sip->primary_bank_ammo_capacity[index];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1047,12 +1088,14 @@ void process_debug_keys(int k)
|
||||
HUD_sourced_printf(HUD_SOURCE_HIDDEN, XSTR( "Weapon energy and missile count will always be at full for player", 16));
|
||||
|
||||
debug_max_secondary_weapons(Player_obj);
|
||||
debug_max_primary_weapons(Player_obj);
|
||||
if (k & KEY_SHIFTED) {
|
||||
object *objp;
|
||||
|
||||
for ( objp = GET_FIRST(&obj_used_list); objp !=END_OF_LIST(&obj_used_list); objp = GET_NEXT(objp) )
|
||||
if (objp->type == OBJ_SHIP)
|
||||
debug_max_secondary_weapons(objp);
|
||||
debug_max_primary_weapons(objp);
|
||||
}
|
||||
|
||||
} else
|
||||
@@ -2323,6 +2366,7 @@ int button_function_demo_valid(int n)
|
||||
}
|
||||
|
||||
// execute function corresponding to action n (BUTTON_ #define from KeyControl.h)
|
||||
// Goober5000: function returns 1 when action was taken
|
||||
int button_function(int n)
|
||||
{
|
||||
Assert(n >= 0);
|
||||
@@ -2337,7 +2381,58 @@ int button_function(int n)
|
||||
if (Game_mode & GM_DEAD_DIED){
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Goober5000 - if the ship doesn't have subspace drive, jump key doesn't work: so test and exit early
|
||||
if (Player_ship->flags2 & SF2_NO_SUBSPACE_DRIVE)
|
||||
{
|
||||
switch(n)
|
||||
{
|
||||
case END_MISSION:
|
||||
control_used(n); // set the timestamp for when we used the control, in case we need it
|
||||
return 1; // pretend we took the action: if we return 0, strange stuff may happen
|
||||
}
|
||||
}
|
||||
|
||||
// Goober5000 - if we have primitive sensors, some keys don't work: so test and exit early
|
||||
if (Player_ship->flags2 & SF2_PRIMITIVE_SENSORS)
|
||||
{
|
||||
switch (n)
|
||||
{
|
||||
case MATCH_TARGET_SPEED:
|
||||
case TOGGLE_AUTO_MATCH_TARGET_SPEED:
|
||||
case TOGGLE_AUTO_TARGETING:
|
||||
case TARGET_NEXT:
|
||||
case TARGET_PREV:
|
||||
case TARGET_NEXT_CLOSEST_HOSTILE:
|
||||
case TARGET_PREV_CLOSEST_HOSTILE:
|
||||
case TARGET_NEXT_CLOSEST_FRIENDLY:
|
||||
case TARGET_PREV_CLOSEST_FRIENDLY:
|
||||
case TARGET_SHIP_IN_RETICLE:
|
||||
case TARGET_LAST_TRANMISSION_SENDER:
|
||||
case TARGET_CLOSEST_REPAIR_SHIP:
|
||||
case TARGET_CLOSEST_SHIP_ATTACKING_TARGET:
|
||||
case STOP_TARGETING_SHIP:
|
||||
case TARGET_CLOSEST_SHIP_ATTACKING_SELF:
|
||||
case TARGET_TARGETS_TARGET:
|
||||
case TARGET_SUBOBJECT_IN_RETICLE:
|
||||
case TARGET_NEXT_SUBOBJECT:
|
||||
case TARGET_PREV_SUBOBJECT:
|
||||
case STOP_TARGETING_SUBSYSTEM:
|
||||
case TARGET_NEXT_BOMB:
|
||||
case TARGET_PREV_BOMB:
|
||||
case TARGET_NEXT_UNINSPECTED_CARGO:
|
||||
case TARGET_PREV_UNINSPECTED_CARGO:
|
||||
case TARGET_NEWEST_SHIP:
|
||||
case TARGET_NEXT_LIVE_TURRET:
|
||||
case TARGET_PREV_LIVE_TURRET:
|
||||
case TARGET_NEXT_ESCORT_SHIP:
|
||||
control_used(n); // set the timestamp for when we used the control, in case we need it
|
||||
return 1; // pretend we took the action: if we return 0, strange stuff may happen
|
||||
}
|
||||
}
|
||||
|
||||
// now handle keys the regular way
|
||||
switch (n) {
|
||||
// cycle to next primary weapon
|
||||
case CYCLE_NEXT_PRIMARY:
|
||||
@@ -2390,7 +2485,7 @@ int button_function(int n)
|
||||
|
||||
// undefined in multiplayer for clients right now
|
||||
// match target speed
|
||||
case MATCH_TARGET_SPEED:
|
||||
case MATCH_TARGET_SPEED:
|
||||
control_used(MATCH_TARGET_SPEED);
|
||||
// If player is auto-matching, break auto-match speed
|
||||
if ( Player->flags & PLAYER_FLAGS_AUTO_MATCH_SPEED ) {
|
||||
|
||||
@@ -778,8 +778,8 @@ BOOL SWFF_WriteRegString(
|
||||
|
||||
// close the key
|
||||
RegCloseKey(hKey);
|
||||
if(lRet != ERROR_SUCCESS)
|
||||
return FALSE;
|
||||
/* if(lRet != ERROR_SUCCESS) // eh, this is unreachable code
|
||||
return FALSE;*/
|
||||
|
||||
// if we have reached this point, then it was a success
|
||||
return TRUE;
|
||||
|
||||
+91
-14
@@ -9,13 +9,16 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Io/Timer.cpp $
|
||||
* $Revision: 2.2 $
|
||||
* $Date: 2002-08-01 01:41:06 $
|
||||
* $Revision: 2.3 $
|
||||
* $Date: 2003-03-02 05:46:28 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
* Include file for timer stuff
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.2 2002/08/01 01:41:06 penguin
|
||||
* The big include file move
|
||||
*
|
||||
* Revision 2.1 2002/07/07 19:55:59 penguin
|
||||
* Back-port to MSVC
|
||||
*
|
||||
@@ -190,11 +193,12 @@ fix timer_get_fixed_seconds()
|
||||
return 0;
|
||||
}
|
||||
|
||||
#if defined(_WIN32) && defined(_MSC_VER)
|
||||
#if defined(_WIN32)
|
||||
int tmp;
|
||||
LARGE_INTEGER temp_large;
|
||||
timer_get(&temp_large);
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
// Timing in fixed point (16.16) seconds.
|
||||
// Can be used for up to 1000 hours
|
||||
_asm mov edx, temp_large.HighPart
|
||||
@@ -212,9 +216,37 @@ sub_again:
|
||||
_asm add edx, ebx ; ...then add in to get correct value.
|
||||
_asm div ebx
|
||||
//eax = fixed point seconds elapsed...
|
||||
|
||||
_asm mov tmp, eax
|
||||
|
||||
#elif defined(__GNUC__)
|
||||
|
||||
// Timing in fixed point (16.16) seconds.
|
||||
// Can be used for up to 1000 hours
|
||||
asm(
|
||||
"mov %1, %%edx;" // temp_large.HighPart
|
||||
"mov %2, %%eax;" // temp_large.LowPart
|
||||
|
||||
"shld $16,%%edx,%%eax;" // Keep 32+11 bits
|
||||
"shl $16,%%eax;"
|
||||
// edx:eax = number of 1.19Mhz pulses elapsed.
|
||||
"mov %3,%%ebx;" // Timer_freq
|
||||
|
||||
// Make sure we won't divide overflow. Make time wrap at about 9 hours
|
||||
"sub_again:"
|
||||
"sub %%ebx,%%edx;" // subtract until negative...
|
||||
"jns sub_again;" // ...to prevent divide overflow..."
|
||||
"add %%ebx,%%edx;" // ...then add in to get correct value."
|
||||
"div %%ebx;"
|
||||
//eax = fixed point seconds elapsed...
|
||||
"mov %%eax,%0;" // tmp
|
||||
: "=g" (tmp)
|
||||
: "g" (temp_large.HighPart), "g" (temp_large.LowPart), "g" (Timer_freq)
|
||||
: "edx", "eax", "ebx" );
|
||||
|
||||
#else
|
||||
#error unknown Win32 compiler
|
||||
#endif
|
||||
|
||||
return tmp;
|
||||
|
||||
#elif defined unix
|
||||
@@ -247,14 +279,13 @@ int timer_get_milliseconds()
|
||||
return 0;
|
||||
}
|
||||
|
||||
#if defined(_WIN32) && defined(_MSC_VER)
|
||||
#if defined(_WIN32)
|
||||
int tmp;
|
||||
LARGE_INTEGER temp_large;
|
||||
|
||||
timer_get(&temp_large);
|
||||
|
||||
temp_large.QuadPart *= (longlong)1000;
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
// Timing in milliseconds.
|
||||
_asm mov edx, temp_large.HighPart
|
||||
_asm mov eax, temp_large.LowPart
|
||||
@@ -263,7 +294,6 @@ int timer_get_milliseconds()
|
||||
//_asm shl eax, 16
|
||||
// edx:eax = number of 1.19Mhz pulses elapsed.
|
||||
_asm mov ebx, Timer_freq
|
||||
|
||||
// Make sure we won't divide overflow. Make time wrap at about 9 hours
|
||||
sub_again:
|
||||
_asm sub edx, ebx ; subtract until negative...
|
||||
@@ -271,17 +301,41 @@ sub_again:
|
||||
_asm add edx, ebx ; ...then add in to get correct value.
|
||||
_asm div ebx
|
||||
//eax = milliseconds elapsed...
|
||||
|
||||
_asm mov tmp, eax
|
||||
|
||||
#elif defined(__GNUC__)
|
||||
// Timing in milliseconds.
|
||||
asm(
|
||||
"mov %1,%%edx;\n" // temp_large.HighPart
|
||||
"mov %2,%%eax;\n" // temp_large.LowPart
|
||||
// edx:eax = number of 1.19Mhz pulses elapsed.
|
||||
"mov %3,%%ebx;\n" // Timer_freq
|
||||
// Make sure we won't divide overflow. Make time wrap at about 9 hours
|
||||
"sub_again2:"
|
||||
"sub %%ebx,%%edx;\n" // subtract until negative...
|
||||
"jns sub_again2;\n" // ...to prevent divide overflow...
|
||||
"add %%ebx,%%edx;\n" // ...then add in to get correct value.
|
||||
"div %%ebx;\n"
|
||||
//eax = milliseconds elapsed...
|
||||
"mov %%eax,%0;\n" // tmp
|
||||
: "=g" (tmp)
|
||||
: "g" (temp_large.HighPart), "g" (temp_large.LowPart), "g" (Timer_freq)
|
||||
: "edx", "eax", "ebx");
|
||||
#else
|
||||
#error unknown Win32 compiler
|
||||
#endif
|
||||
|
||||
return tmp;
|
||||
|
||||
#else
|
||||
|
||||
#elif defined unix
|
||||
|
||||
timeval tmp_tv;
|
||||
timer_get(&tmp_tv);
|
||||
return (tmp_tv.tv_sec * 1000) + (tmp_tv.tv_usec / 1000);
|
||||
|
||||
#else
|
||||
#error unknown architecture/compiler
|
||||
#endif
|
||||
|
||||
}
|
||||
@@ -293,14 +347,14 @@ int timer_get_microseconds()
|
||||
return 0;
|
||||
}
|
||||
|
||||
#if defined(_WIN32) && defined(_MSC_VER)
|
||||
#if defined(_WIN32)
|
||||
int tmp;
|
||||
LARGE_INTEGER temp_large;
|
||||
|
||||
timer_get(&temp_large);
|
||||
|
||||
temp_large.QuadPart *= (longlong)1000000;
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
|
||||
// Timing in milliseconds.
|
||||
_asm mov edx, temp_large.HighPart
|
||||
_asm mov eax, temp_large.LowPart
|
||||
@@ -317,9 +371,30 @@ sub_again:
|
||||
_asm add edx, ebx ; ...then add in to get correct value.
|
||||
_asm div ebx
|
||||
//eax = milliseconds elapsed...
|
||||
|
||||
_asm mov tmp, eax
|
||||
|
||||
#elif defined(__GNUC__)
|
||||
// Timing in milliseconds.
|
||||
asm(
|
||||
"mov %1,%%edx;\n" // temp_large.HighPart
|
||||
"mov %2,%%eax;\n" // temp_large.LowPart
|
||||
// edx:eax = number of 1.19Mhz pulses elapsed.
|
||||
"mov %3,%%ebx;\n" // Timer_freq
|
||||
// Make sure we won't divide overflow. Make time wrap at about 9 hours
|
||||
"sub_again3:"
|
||||
"sub %%ebx,%%edx;\n" // subtract until negative...
|
||||
"jns sub_again3;\n" // ...to prevent divide overflow...
|
||||
"add %%ebx,%%edx;\n" // ...then add in to get correct value.
|
||||
"div %%ebx;\n"
|
||||
//eax = milliseconds elapsed...
|
||||
"mov %%eax,%0;\n" // tmp
|
||||
: "=g" (tmp)
|
||||
: "g" (temp_large.HighPart), "g" (temp_large.LowPart), "g" (Timer_freq)
|
||||
: "edx", "eax", "ebx");
|
||||
#else
|
||||
#error unknown Win32 compiler
|
||||
#endif
|
||||
|
||||
return tmp;
|
||||
|
||||
#elif defined unix
|
||||
@@ -328,6 +403,8 @@ sub_again:
|
||||
timer_get(&tmp_tv);
|
||||
return (tmp_tv.tv_sec * 1000000) + tmp_tv.tv_usec;
|
||||
|
||||
#else
|
||||
#error unknown architecture/compiler
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -9,13 +9,16 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/JumpNode/JumpNode.h $
|
||||
* $Revision: 2.1 $
|
||||
* $Date: 2002-08-01 01:41:06 $
|
||||
* $Author: penguin $
|
||||
* $Revision: 2.2 $
|
||||
* $Date: 2002-12-17 01:56:36 $
|
||||
* $Author: DTP $
|
||||
*
|
||||
* Header for everything to do with jump nodes
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.1 2002/08/01 01:41:06 penguin
|
||||
* The big include file move
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:24 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
@@ -41,7 +44,7 @@
|
||||
|
||||
#include "parse/parselo.h"
|
||||
|
||||
#define MAX_JUMP_NODES 3
|
||||
#define MAX_JUMP_NODES 50
|
||||
|
||||
typedef struct {
|
||||
int modelnum;
|
||||
|
||||
@@ -9,13 +9,16 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Math/Fvi.cpp $
|
||||
* $Revision: 2.1 $
|
||||
* $Date: 2002-08-01 01:41:06 $
|
||||
* $Author: penguin $
|
||||
* $Revision: 2.2 $
|
||||
* $Date: 2002-12-07 01:37:41 $
|
||||
* $Author: bobboau $
|
||||
*
|
||||
* Routines to find intersections of various 3d things.
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.1 2002/08/01 01:41:06 penguin
|
||||
* The big include file move
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:24 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
@@ -204,6 +207,21 @@ void fvi_two_lines_in_3space(vector *p1, vector *v1, vector *p2, vector *v2, flo
|
||||
}
|
||||
}
|
||||
|
||||
//tells distance from a plain to a point-Bobboau
|
||||
float fvi_point_dist_plane( vector *plane_pnt, vector *plane_norm, // Plane description, a point and a normal
|
||||
vector *point //a point to test
|
||||
)
|
||||
{
|
||||
float dist,D;
|
||||
|
||||
D = -vm_vec_dot(plane_norm,plane_pnt);
|
||||
|
||||
dist = vm_vec_dot(plane_norm, point) + D;
|
||||
return dist;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
// fvi_ray_plane - Finds the point on the specified plane where the
|
||||
|
||||
@@ -9,13 +9,16 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Math/Fvi.h $
|
||||
* $Revision: 2.1 $
|
||||
* $Date: 2002-08-01 01:41:06 $
|
||||
* $Author: penguin $
|
||||
* $Revision: 2.2 $
|
||||
* $Date: 2002-12-07 01:37:41 $
|
||||
* $Author: bobboau $
|
||||
*
|
||||
* Prototypes for fvi stuff
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.1 2002/08/01 01:41:06 penguin
|
||||
* The big include file move
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:24 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
@@ -81,6 +84,9 @@
|
||||
|
||||
#include "globalincs/pstypes.h"
|
||||
|
||||
//finds distance from point to plane
|
||||
float fvi_point_dist_plane( vector *plane_pnt,vector *plane_norm, vector *point);
|
||||
|
||||
// fvi functions - fvi stands for Find Vector Intersection
|
||||
// fvi_a_b - means find the intersection of something of type a with something of type b
|
||||
// type can be:
|
||||
|
||||
@@ -9,13 +9,28 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Math/VecMat.cpp $
|
||||
* $Revision: 2.1 $
|
||||
* $Date: 2002-08-01 01:41:06 $
|
||||
* $Revision: 2.4 $
|
||||
* $Date: 2003-03-02 07:39:34 $
|
||||
* $Author: penguin $
|
||||
*
|
||||
* C module containg functions for manipulating vectors and matricies
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.3 2003/02/25 06:22:48 bobboau
|
||||
* fixed a bunch of fighter beam bugs,
|
||||
* most notabley the sound now works corectly,
|
||||
* and they have limeted range with atenuated damage (table option)
|
||||
* added bank specific compatabilities
|
||||
*
|
||||
* Revision 2.2 2002/12/07 01:37:41 bobboau
|
||||
* inital decals code, if you are worried a bug is being caused by the decals code it's only references are in,
|
||||
* collideshipweapon.cpp line 262, beam.cpp line 2771, and modelinterp.cpp line 2949.
|
||||
* it needs a better renderer, but is in prety good shape for now,
|
||||
* I also (think) I squashed a bug in the warpmodel code
|
||||
*
|
||||
* Revision 2.1 2002/08/01 01:41:06 penguin
|
||||
* The big include file move
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:24 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
@@ -392,6 +407,41 @@ void vm_vec_sub2(vector *dest,vector *src)
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
void vm_vert2vec(vertex *vert, vector *vec) //takes a vertex and makes it into a vector-Bobboau
|
||||
{
|
||||
vec->xyz.x = vert->x;
|
||||
vec->xyz.y = vert->y;
|
||||
vec->xyz.z = vert->z;
|
||||
}
|
||||
|
||||
void vm_vec2vert(vector *vec, vertex *vert) //takes a vector and makes it into a vertex-Bobboau
|
||||
{
|
||||
vert->x = vec->xyz.x;
|
||||
vert->y = vec->xyz.y;
|
||||
vert->z = vec->xyz.z;
|
||||
}
|
||||
|
||||
//averages n vectors. returns ptr to dest
|
||||
//dest can equal either source
|
||||
vector *vm_vec_avg_n(vector *dest, int n, vector src[])
|
||||
{
|
||||
float x=0,y=0,z=0;
|
||||
|
||||
for(int i = 0; i<n; i++){
|
||||
x += src[i].xyz.x;
|
||||
y += src[i].xyz.y;
|
||||
z += src[i].xyz.z;
|
||||
}
|
||||
|
||||
dest->xyz.x = x / n;
|
||||
dest->xyz.y = y / n;
|
||||
dest->xyz.z = z / n;
|
||||
|
||||
return dest;
|
||||
}
|
||||
|
||||
|
||||
//averages two vectors. returns ptr to dest
|
||||
//dest can equal either source
|
||||
vector *vm_vec_avg(vector *dest,vector *src0,vector *src1)
|
||||
@@ -403,6 +453,15 @@ vector *vm_vec_avg(vector *dest,vector *src0,vector *src1)
|
||||
return dest;
|
||||
}
|
||||
|
||||
//averages four vectors. returns ptr to dest
|
||||
//dest can equal any source
|
||||
vector *vm_vec_avg3(vector *dest,vector *src0,vector *src1,vector *src2)
|
||||
{
|
||||
dest->xyz.x = (src0->xyz.x + src1->xyz.x + src2->xyz.x) * 0.333333333f;
|
||||
dest->xyz.y = (src0->xyz.y + src1->xyz.y + src2->xyz.y) * 0.333333333f;
|
||||
dest->xyz.z = (src0->xyz.z + src1->xyz.z + src2->xyz.z) * 0.333333333f;
|
||||
return dest;
|
||||
}
|
||||
|
||||
//averages four vectors. returns ptr to dest
|
||||
//dest can equal any source
|
||||
@@ -605,14 +664,18 @@ float vm_vec_dist_quick(vector *v0,vector *v1)
|
||||
//normalize a vector. returns mag of source vec
|
||||
float vm_vec_copy_normalize(vector *dest,vector *src)
|
||||
{
|
||||
static int ben_warned = false;//added this so the warning could be sounded and you can still get on with playing-Bobboau
|
||||
float m;
|
||||
|
||||
m = vm_vec_mag(src);
|
||||
|
||||
// Mainly here to trap attempts to normalize a null vector.
|
||||
if (m <= 0.0f) {
|
||||
Warning(LOCATION, "Null vector in vector normalize.\n"
|
||||
if(!ben_warned){
|
||||
Warning(LOCATION, "Null vector in vector normalize.\n"
|
||||
"Trace out of vecmat.cpp and find offending code.\n");
|
||||
ben_warned = true;
|
||||
}
|
||||
dest->xyz.x = 1.0f;
|
||||
dest->xyz.y = 0.0f;
|
||||
dest->xyz.z = 0.0f;
|
||||
|
||||
@@ -9,13 +9,16 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Math/VecMat.h $
|
||||
* $Revision: 2.1 $
|
||||
* $Date: 2002-08-01 01:41:06 $
|
||||
* $Author: penguin $
|
||||
* $Revision: 2.2 $
|
||||
* $Date: 2002-12-07 01:37:42 $
|
||||
* $Author: bobboau $
|
||||
*
|
||||
* Header file for functions that manipulate vectors and matricies
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.1 2002/08/01 01:41:06 penguin
|
||||
* The big include file move
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:24 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
@@ -296,11 +299,16 @@ void vm_vec_sub(vector *dest,vector *src0,vector *src1);
|
||||
void vm_vec_sub2(vector *dest,vector *src);
|
||||
#endif
|
||||
|
||||
//averages n vectors
|
||||
vector *vm_vec_avg_n(vector *dest, int n, vector src[]);
|
||||
|
||||
|
||||
//averages two vectors. returns ptr to dest
|
||||
//dest can equal either source
|
||||
vector *vm_vec_avg(vector *dest,vector *src0,vector *src1);
|
||||
|
||||
vector *vm_vec_avg3(vector *dest,vector *src0,vector *src1,vector *src2);
|
||||
|
||||
//averages four vectors. returns ptr to dest
|
||||
//dest can equal any source
|
||||
vector *vm_vec_avg4(vector *dest,vector *src0,vector *src1,vector *src2,vector *src3);
|
||||
@@ -651,5 +659,9 @@ void vm_vec_random_in_circle(vector *out, vector *in, matrix *orient, float radi
|
||||
// returns 0 if the point is inside the line segment, -1 if "before" the line segment and 1 ir "after" the line segment
|
||||
int vm_vec_dist_to_line(vector *p, vector *l0, vector *l1, vector *nearest, float *dist);
|
||||
|
||||
void vm_vert2vec(vertex *vert, vector *vec);
|
||||
void vm_vec2vert(vector *vec, vertex *vert);
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -9,13 +9,16 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/MenuUI/Credits.cpp $
|
||||
* $Revision: 2.6 $
|
||||
* $Date: 2002-11-02 22:25:26 $
|
||||
* $Author: inquisitor $
|
||||
* $Revision: 2.7 $
|
||||
* $Date: 2002-12-03 22:14:06 $
|
||||
* $Author: Goober5000 $
|
||||
*
|
||||
* C source file for displaying game credits
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.6 2002/11/02 22:25:26 inquisitor
|
||||
* Cleaned up the presentation a little, added HLP and VW, and, no offense to Kazan, removed Kazan.
|
||||
*
|
||||
* Revision 2.5 2002/11/02 22:11:35 DTP
|
||||
* DOH forgot \n
|
||||
*
|
||||
@@ -199,6 +202,7 @@ char *fs2_open_credit_text =
|
||||
"\n"
|
||||
"\"Bobboau\"\n"
|
||||
"Dennis \"DTP\" Pedersen\n"
|
||||
"Ian \"Goober5000\" Warfield\n"
|
||||
"Joe \"Righteous1\" Dowd\n"
|
||||
"Mike \"penguin\" Harris\n"
|
||||
"\"Mysterial\"\n"
|
||||
|
||||
@@ -9,13 +9,16 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/MenuUI/MainHallMenu.cpp $
|
||||
* $Revision: 2.5 $
|
||||
* $Date: 2002-08-27 13:38:58 $
|
||||
* $Author: penguin $
|
||||
* $Revision: 2.6 $
|
||||
* $Date: 2003-01-15 21:29:04 $
|
||||
* $Author: anonymous $
|
||||
*
|
||||
* Header file for main-hall menu code
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.5 2002/08/27 13:38:58 penguin
|
||||
* Moved DirectX8 stuff to directx8 branch; reverted to previous
|
||||
*
|
||||
* Revision 2.3 2002/08/04 05:12:10 penguin
|
||||
* Change version display location
|
||||
*
|
||||
@@ -2036,8 +2039,10 @@ void main_hall_read_table()
|
||||
stuff_string(m->bitmap, F_NAME, NULL, MAX_FILENAME_LEN);
|
||||
required_string("+Mask:");
|
||||
stuff_string(m->mask, F_NAME, NULL, MAX_FILENAME_LEN);
|
||||
#ifndef FS2_DEMO
|
||||
required_string("+Music:");
|
||||
stuff_string(m->music, F_NAME, NULL, MAX_FILENAME_LEN);
|
||||
#endif
|
||||
|
||||
// intercom sounds
|
||||
required_string("+Num Intercom Sounds:");
|
||||
|
||||
@@ -9,13 +9,20 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/MenuUI/MainHallMenu.h $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:24 $
|
||||
* $Author: penguin $
|
||||
* $Revision: 2.2 $
|
||||
* $Date: 2003-01-15 05:19:07 $
|
||||
* $Author: Goober5000 $
|
||||
*
|
||||
* Header file for main-hall menu code
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.1 2003/01/14 04:00:15 Goober5000
|
||||
* allowed for up to 256 main halls
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:24 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
* Revision 1.1 2002/05/02 18:03:09 mharris
|
||||
* Initial checkin - converted filenames and includes to lower case
|
||||
*
|
||||
@@ -63,7 +70,7 @@
|
||||
#define _MAIN_HALL_MENU_HEADER_FILE
|
||||
|
||||
// the # of main halls we're supporting
|
||||
#define NUM_MAIN_HALLS 2
|
||||
#define NUM_MAIN_HALLS 10 // Goober5000 - bumped down to 10; don't go above 256 (size of ubyte)
|
||||
|
||||
// initialize the main hall proper
|
||||
void main_hall_init(int main_hall_num);
|
||||
|
||||
@@ -9,13 +9,16 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/MenuUI/PlayerMenu.cpp $
|
||||
* $Revision: 2.2 $
|
||||
* $Date: 2002-08-04 05:12:42 $
|
||||
* $Author: penguin $
|
||||
* $Revision: 2.3 $
|
||||
* $Date: 2003-01-14 04:00:15 $
|
||||
* $Author: Goober5000 $
|
||||
*
|
||||
* Code to drive the Player Select initial screen
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.2 2002/08/04 05:12:42 penguin
|
||||
* Display fs2_open version instead of "Freespace 2"
|
||||
*
|
||||
* Revision 2.1 2002/08/01 01:41:06 penguin
|
||||
* The big include file move
|
||||
*
|
||||
@@ -342,7 +345,7 @@ int Player_select_clone_flag; // clone the currently selected pilot
|
||||
char Player_select_last_pilot[CALLSIGN_LEN + 10]; // callsign of the last used pilot, or none if there wasn't one
|
||||
int Player_select_last_is_multi;
|
||||
|
||||
int Player_select_force_bastion = 0;
|
||||
int Player_select_force_main_hall = 0;
|
||||
|
||||
// notification text areas
|
||||
|
||||
@@ -408,7 +411,7 @@ void player_select_init()
|
||||
// start a looping ambient sound
|
||||
main_hall_start_ambient();
|
||||
|
||||
Player_select_force_bastion = 0;
|
||||
Player_select_force_main_hall = 0;
|
||||
|
||||
#ifdef FS2_DEMO
|
||||
/*
|
||||
@@ -723,8 +726,8 @@ void player_select_close()
|
||||
Player = NULL;
|
||||
}
|
||||
|
||||
if (Player_select_force_bastion) {
|
||||
Player->on_bastion = 1;
|
||||
if (Player_select_force_main_hall) {
|
||||
Player->main_hall = 1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1462,7 +1465,7 @@ void player_select_cancel_create()
|
||||
DCF(bastion,"Sets the player to be on the bastion")
|
||||
{
|
||||
if(gameseq_get_state() == GS_STATE_INITIAL_PLAYER_SELECT){
|
||||
Player_select_force_bastion = 1;
|
||||
Player_select_force_main_hall = 1;
|
||||
dc_printf("Player is now in the Bastion\n");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,13 +9,17 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/MenuUI/ReadyRoom.cpp $
|
||||
* $Revision: 2.2 $
|
||||
* $Date: 2002-10-19 03:50:29 $
|
||||
* $Author: randomtiger $
|
||||
* $Revision: 2.3 $
|
||||
* $Date: 2003-03-03 04:28:37 $
|
||||
* $Author: Goober5000 $
|
||||
*
|
||||
* Ready Room code, which is the UI screen for selecting Campaign/mission to play next mainly.
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.2 2002/10/19 03:50:29 randomtiger
|
||||
* Added special pause mode for easier action screenshots.
|
||||
* Added new command line parameter for accessing all single missions in tech room. - RT
|
||||
*
|
||||
* Revision 2.1 2002/08/01 01:41:06 penguin
|
||||
* The big include file move
|
||||
*
|
||||
@@ -106,6 +110,7 @@
|
||||
#include "freespace2/freespace.h"
|
||||
#include "globalincs/alphacolors.h"
|
||||
#include "cmdline/cmdline.h"
|
||||
#include "menuui/techmenu.h" // for tech menu reset stuff
|
||||
|
||||
#define MAX_MISSIONS 1024
|
||||
|
||||
@@ -781,6 +786,10 @@ void sim_room_scroll_line_down()
|
||||
gamesnd_play_iface(SND_GENERAL_FAIL);
|
||||
}
|
||||
|
||||
/* Goober5000 - why are there two nearly identical functions?
|
||||
(campaign_room_reset_campaign and ready_room_reset_campaign)
|
||||
Looks like this function should be deprecated...
|
||||
|
||||
// returns: 0 = success, !0 = aborted or failed
|
||||
int ready_room_reset_campaign()
|
||||
{
|
||||
@@ -791,11 +800,13 @@ int ready_room_reset_campaign()
|
||||
if (z) {
|
||||
mission_campaign_savefile_delete(Campaign.filename);
|
||||
mission_campaign_load(Campaign.filename);
|
||||
|
||||
rval = 0;
|
||||
}
|
||||
|
||||
return rval;
|
||||
}
|
||||
*/
|
||||
|
||||
// Decide if we should offer choice to resume this savegame
|
||||
int sim_room_can_resume_savegame(char *savegame_filename)
|
||||
@@ -1545,6 +1556,7 @@ int campaign_room_reset_campaign(int n)
|
||||
mission_campaign_savefile_delete(filename);
|
||||
mission_campaign_load(filename);
|
||||
mission_campaign_next_mission();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1567,6 +1579,13 @@ void campaign_room_commit()
|
||||
mission_campaign_savefile_delete(Campaign_file_names[Selected_campaign_index]);
|
||||
mission_campaign_load(Campaign_file_names[Selected_campaign_index]);
|
||||
strcpy(Player->current_campaign, Campaign.filename); // track new campaign for player
|
||||
|
||||
// Goober5000 - reinitialize tech database if needed
|
||||
if ( (Campaign.flags & CF_CUSTOM_TECH_DATABASE) || !stricmp(Campaign.filename, "freespace2") )
|
||||
{
|
||||
// reset tech database to what's in the tables
|
||||
tech_reset_to_default();
|
||||
}
|
||||
}
|
||||
|
||||
if (mission_campaign_next_mission()) { // is campaign and next mission valid?
|
||||
@@ -1619,8 +1638,17 @@ int campaign_room_button_pressed(int n)
|
||||
else if (campaign_room_reset_campaign(Active_campaign_index))
|
||||
gamesnd_play_iface(SND_GENERAL_FAIL);
|
||||
else
|
||||
{
|
||||
gamesnd_play_iface(SND_USER_SELECT);
|
||||
|
||||
// Goober5000 - reinitialize tech database if needed
|
||||
if ( (Campaign.flags & CF_CUSTOM_TECH_DATABASE) || !stricmp(Campaign.filename, "freespace2") )
|
||||
{
|
||||
// reset tech database to what's in the tables
|
||||
tech_reset_to_default();
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -9,13 +9,25 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/MenuUI/TechMenu.cpp $
|
||||
* $Revision: 2.1 $
|
||||
* $Date: 2002-08-01 01:41:06 $
|
||||
* $Author: penguin $
|
||||
* $Revision: 2.4 $
|
||||
* $Date: 2003-03-03 04:28:37 $
|
||||
* $Author: Goober5000 $
|
||||
*
|
||||
* C module that contains functions to drive the Tech Menu user interface
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.3 2002/12/07 01:37:42 bobboau
|
||||
* inital decals code, if you are worried a bug is being caused by the decals code it's only references are in,
|
||||
* collideshipweapon.cpp line 262, beam.cpp line 2771, and modelinterp.cpp line 2949.
|
||||
* it needs a better renderer, but is in prety good shape for now,
|
||||
* I also (think) I squashed a bug in the warpmodel code
|
||||
*
|
||||
* Revision 2.2 2002/11/27 01:20:51 sesquipedalian
|
||||
* Added Phreak's fix for the weapons room bug. Can now view a modified weapons.tbl in the tech room without crashing
|
||||
*
|
||||
* Revision 2.1 2002/08/01 01:41:06 penguin
|
||||
* The big include file move
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:24 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
@@ -1043,10 +1055,11 @@ void techroom_change_tab(int num)
|
||||
|
||||
for (i=0; i<MAX_WEAPON_TYPES; i++) {
|
||||
if (Weapon_info[i].wi_flags & mask) {
|
||||
//following was commented out to fix the tech room crash bug when modified weapons.tbl is used. Fix by Phreak, implemented by Sesquipedalian.
|
||||
// note: hack here to exclude dogfight weapons -- dont put weapon in if it has same description as pvs weapon
|
||||
if ((Weapon_list_size > 0) && (!strcmp(Weapon_info[i].tech_desc, Weapon_list[Weapon_list_size-1].desc))) {
|
||||
continue;
|
||||
}
|
||||
//if ((Weapon_list_size > 0) && (!strcmp(Weapon_info[i].tech_desc, Weapon_list[Weapon_list_size-1].desc))) {
|
||||
// continue;
|
||||
//}
|
||||
|
||||
// we have a weapon that should be in the tech db, so fill out the entry struct
|
||||
Weapon_list[Weapon_list_size].index = i;
|
||||
@@ -1092,7 +1105,7 @@ void techroom_change_tab(int num)
|
||||
Intel_list_size = 0;
|
||||
for (i=0; i<Intel_info_size; i++) {
|
||||
|
||||
if (Intel_info[i].in_tech_db != 0) {
|
||||
if (Intel_info[i].flags & IIF_IN_TECH_DATABASE) {
|
||||
// leave option for no animation if string == "none"
|
||||
if (!strcmp(Intel_info[i].anim_filename, "none")) {
|
||||
Intel_list[Intel_list_size].has_anim = 0;
|
||||
@@ -1263,7 +1276,7 @@ int techroom_load_ani(anim **animpp, char *name)
|
||||
|
||||
void techroom_intel_init()
|
||||
{
|
||||
int rval;
|
||||
int rval, temp;
|
||||
static int inited = 0;
|
||||
|
||||
// open localization
|
||||
@@ -1285,15 +1298,24 @@ void techroom_intel_init()
|
||||
Assert(Intel_info_size < MAX_INTEL_ENTRIES);
|
||||
if (Intel_info_size >= MAX_INTEL_ENTRIES) break;
|
||||
|
||||
Intel_info[Intel_info_size].flags = IIF_DEFAULT_VALUE;
|
||||
|
||||
required_string("$Name:");
|
||||
stuff_string(Intel_info[Intel_info_size].name, F_NAME, NULL, 32);
|
||||
required_string("$Anim:");
|
||||
stuff_string(Intel_info[Intel_info_size].anim_filename, F_NAME, NULL, 32);
|
||||
required_string("$AlwaysInTechRoom:");
|
||||
stuff_int(&Intel_info[Intel_info_size].in_tech_db);
|
||||
stuff_int(&temp);
|
||||
if (temp)
|
||||
{
|
||||
Intel_info[Intel_info_size].flags |= IIF_IN_TECH_DATABASE;
|
||||
}
|
||||
required_string("$Description:");
|
||||
stuff_string(Intel_info[Intel_info_size].desc, F_MULTITEXT, NULL, TECH_INTEL_DESC_LEN);
|
||||
|
||||
// set default to align with what we read - Goober5000
|
||||
if (Intel_info[Intel_info_size].flags & IIF_IN_TECH_DATABASE)
|
||||
Intel_info[Intel_info_size].flags |= IIF_DEFAULT_IN_TECH_DATABASE;
|
||||
|
||||
Intel_info_size++;
|
||||
}
|
||||
@@ -1502,6 +1524,7 @@ void techroom_close()
|
||||
|
||||
void techroom_do_frame(float frametime)
|
||||
{
|
||||
|
||||
int i, k;
|
||||
|
||||
// turn off controls when overlay is on
|
||||
@@ -1677,3 +1700,56 @@ void techroom_do_frame(float frametime)
|
||||
|
||||
gr_flip();
|
||||
}
|
||||
|
||||
int intel_info_lookup(char *name)
|
||||
{
|
||||
int i;
|
||||
|
||||
// bogus
|
||||
if (!name)
|
||||
return -1;
|
||||
|
||||
for (i=0; i<Intel_info_size; i++)
|
||||
if (!stricmp(name, Intel_info[i].name))
|
||||
return i;
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Goober5000
|
||||
void tech_reset_to_default()
|
||||
{
|
||||
int i;
|
||||
|
||||
// ships
|
||||
for (i=0; i<Num_ship_types; i++)
|
||||
{
|
||||
if (Ship_info[i].flags2 & SIF2_DEFAULT_IN_TECH_DATABASE)
|
||||
Ship_info[i].flags |= SIF_IN_TECH_DATABASE;
|
||||
else
|
||||
Ship_info[i].flags &= ~SIF_IN_TECH_DATABASE;
|
||||
|
||||
if (Ship_info[i].flags2 & SIF2_DEFAULT_IN_TECH_DATABASE_M)
|
||||
Ship_info[i].flags |= SIF_IN_TECH_DATABASE_M;
|
||||
else
|
||||
Ship_info[i].flags &= ~SIF_IN_TECH_DATABASE_M;
|
||||
}
|
||||
|
||||
// weapons
|
||||
for (i=0; i<Num_weapon_types; i++)
|
||||
{
|
||||
if (Weapon_info[i].wi_flags2 & WIF2_DEFAULT_IN_TECH_DATABASE)
|
||||
Weapon_info[i].wi_flags |= WIF_IN_TECH_DATABASE;
|
||||
else
|
||||
Weapon_info[i].wi_flags &= ~WIF_IN_TECH_DATABASE;
|
||||
}
|
||||
|
||||
// intelligence
|
||||
for (i=0; i<Intel_info_size; i++)
|
||||
{
|
||||
if (Intel_info[i].flags & IIF_DEFAULT_IN_TECH_DATABASE)
|
||||
Intel_info[i].flags |= IIF_IN_TECH_DATABASE;
|
||||
else
|
||||
Intel_info[i].flags &= ~IIF_IN_TECH_DATABASE;
|
||||
}
|
||||
}
|
||||
@@ -9,13 +9,16 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/MenuUI/TechMenu.h $
|
||||
* $Revision: 2.0 $
|
||||
* $Date: 2002-06-03 04:02:24 $
|
||||
* $Author: penguin $
|
||||
* $Revision: 2.1 $
|
||||
* $Date: 2003-03-03 04:28:37 $
|
||||
* $Author: Goober5000 $
|
||||
*
|
||||
* Header file for code that controls the Tech Room menu
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.0 2002/06/03 04:02:24 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
* Revision 1.1 2002/05/02 18:03:10 mharris
|
||||
* Initial checkin - converted filenames and includes to lower case
|
||||
*
|
||||
@@ -79,9 +82,13 @@ typedef struct {
|
||||
char name[32];
|
||||
char desc[TECH_INTEL_DESC_LEN];
|
||||
char anim_filename[32];
|
||||
int in_tech_db; // determines if visible in tech db or not
|
||||
int flags;
|
||||
} intel_data;
|
||||
|
||||
// flags by Goober5000
|
||||
#define IIF_DEFAULT_VALUE 0
|
||||
#define IIF_IN_TECH_DATABASE (1 << 0) // in tech database? - Goober5000
|
||||
#define IIF_DEFAULT_IN_TECH_DATABASE (1 << 1) // in tech database by default? - Goober5000
|
||||
|
||||
extern intel_data Intel_info[MAX_INTEL_ENTRIES];
|
||||
extern int Intel_info_size;
|
||||
@@ -93,5 +100,7 @@ void techroom_close();
|
||||
void techroom_do_frame(float frametime);
|
||||
int techroom_on_ships_tab();
|
||||
void techroom_intel_init(); // called on startup so campaigns can manipulate tech room visibility
|
||||
int intel_info_lookup(char *name);
|
||||
extern void tech_reset_to_default();
|
||||
|
||||
#endif
|
||||
@@ -9,13 +9,23 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Mission/MissionCampaign.cpp $
|
||||
* $Revision: 2.5 $
|
||||
* $Date: 2002-08-27 13:38:58 $
|
||||
* $Author: penguin $
|
||||
* $Revision: 2.8 $
|
||||
* $Date: 2003-03-03 04:28:36 $
|
||||
* $Author: Goober5000 $
|
||||
*
|
||||
* source for dealing with campaigns
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.7 2003/02/23 03:13:03 wmcoolmon
|
||||
* Uncommented the sections of code that actually played a movie for a given mission. (Removed when daveb cleaned out the movie code for the release)
|
||||
*
|
||||
* Revision 2.6 2003/01/14 04:00:16 Goober5000
|
||||
* allowed for up to 256 main halls
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.5 2002/08/27 13:38:58 penguin
|
||||
* Moved DirectX8 stuff to directx8 branch; reverted to previous
|
||||
*
|
||||
* Revision 2.3 2002/08/01 01:41:06 penguin
|
||||
* The big include file move
|
||||
*
|
||||
@@ -210,7 +220,7 @@
|
||||
#include "cfile/cfile.h"
|
||||
#include "playerman/player.h"
|
||||
#include "mission/missiongoals.h"
|
||||
// #include "movie.h"
|
||||
#include "cutscene/movie.h"
|
||||
#include "network/multi.h"
|
||||
#include "menuui/techmenu.h"
|
||||
#include "gamesnd/eventmusic.h"
|
||||
@@ -580,6 +590,13 @@ int mission_campaign_load( char *filename, int load_savefile )
|
||||
stuff_int( &(Campaign.num_players) );
|
||||
}
|
||||
|
||||
// parse flags - Goober5000
|
||||
Campaign.flags = CF_DEFAULT_VALUE;
|
||||
if (optional_string("$Flags:"))
|
||||
{
|
||||
stuff_int( &(Campaign.flags) );
|
||||
}
|
||||
|
||||
// parse the optional ship/weapon information
|
||||
mission_campaign_get_sw_info();
|
||||
|
||||
@@ -601,6 +618,17 @@ int mission_campaign_load( char *filename, int load_savefile )
|
||||
if (optional_string("+Flags:"))
|
||||
stuff_int(&cm->flags);
|
||||
|
||||
// Goober5000 - new main hall stuff!
|
||||
cm->main_hall = 0;
|
||||
|
||||
// deal with previous campaign versions
|
||||
if (cm->flags & CMISSION_FLAG_BASTION)
|
||||
cm->main_hall = 1;
|
||||
|
||||
// specify up to 256 main halls :)
|
||||
if (optional_string("+Main Hall:"))
|
||||
stuff_byte(&cm->main_hall);
|
||||
|
||||
cm->formula = -1;
|
||||
if ( optional_string("+Formula:") ) {
|
||||
cm->formula = get_sexp_main();
|
||||
@@ -1513,12 +1541,9 @@ void mission_campaign_mission_over()
|
||||
Sexp_nodes[mission->formula].value = SEXP_UNKNOWN;
|
||||
}
|
||||
|
||||
// new main hall behavior - Goober5000
|
||||
Assert(Player);
|
||||
if (Campaign.missions[Campaign.next_mission].flags & CMISSION_FLAG_BASTION){
|
||||
Player->on_bastion = 1;
|
||||
} else {
|
||||
Player->on_bastion = 0;
|
||||
}
|
||||
Player->main_hall = Campaign.missions[Campaign.next_mission].main_hall;
|
||||
|
||||
mission_campaign_next_mission(); // sets up whatever needs to be set to actually play next mission
|
||||
}
|
||||
@@ -1758,8 +1783,7 @@ void mission_campaign_maybe_play_movie(int type)
|
||||
if ( !filename )
|
||||
return;
|
||||
|
||||
// no soup for you!
|
||||
// movie_play( filename );
|
||||
movie_play( filename ); //Play the movie!
|
||||
}
|
||||
|
||||
// return nonzero if the passed filename is a multiplayer campaign, 0 otherwise
|
||||
|
||||
@@ -9,13 +9,20 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Mission/MissionCampaign.h $
|
||||
* $Revision: 2.1 $
|
||||
* $Date: 2002-08-01 01:41:06 $
|
||||
* $Author: penguin $
|
||||
* $Revision: 2.3 $
|
||||
* $Date: 2003-03-03 04:28:36 $
|
||||
* $Author: Goober5000 $
|
||||
*
|
||||
* header file for dealing with campaigns
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.2 2003/01/14 04:00:16 Goober5000
|
||||
* allowed for up to 256 main halls
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.1 2002/08/01 01:41:06 penguin
|
||||
* The big include file move
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:24 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
@@ -307,13 +314,21 @@
|
||||
#define CAMPAIGN_PERSISTENT_SHIP 1
|
||||
#define CAMPAIGN_PERSISTENT_WEAPON 2
|
||||
|
||||
// Goober5000 - Bastion flag is not needed anymore; there can now be more than two main halls;
|
||||
// but the flag is kept in order to maintain compatibility with older campaigns
|
||||
#define CMISSION_FLAG_BASTION (1<<0) // set if stationed on Bastion, else Galatea
|
||||
|
||||
#define CMISSION_FLAG_SKIPPED (1<<1) // set if skipped, else not
|
||||
|
||||
#define CAMPAIGN_LOOP_MISSION_UNINITIALIZED -2
|
||||
|
||||
extern char *campaign_types[MAX_CAMPAIGN_TYPES];
|
||||
|
||||
|
||||
// campaign flags - Goober5000
|
||||
#define CF_DEFAULT_VALUE 0
|
||||
#define CF_CUSTOM_TECH_DATABASE (1 << 0) // Goober5000
|
||||
|
||||
// structure for a campaign definition. It contains the mission names and other interesting
|
||||
// information about a campaign and the mission strucuture within.
|
||||
|
||||
@@ -345,6 +360,7 @@ typedef struct cmission {
|
||||
int level; // what level of the tree it's on (Fred)
|
||||
int pos; // what x position on level it's on (Fred)
|
||||
int flags;
|
||||
ubyte main_hall; // which main hall the player is in - Goober5000
|
||||
scoring_struct stats;
|
||||
} cmission;
|
||||
|
||||
@@ -353,6 +369,7 @@ typedef struct campaign {
|
||||
char filename[MAX_FILENAME_LEN]; // filename the campaign info is in
|
||||
char *desc; // description of campaign
|
||||
int type; // type of campaign
|
||||
int flags; // flags - Goober5000
|
||||
int num_missions; // number of missions in the campaign
|
||||
int num_missions_completed; // number of missions in the campaign that have been flown
|
||||
int current_mission; // the current mission that the player is playing. Only valid during the mission
|
||||
|
||||
@@ -9,13 +9,16 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Mission/MissionHotKey.cpp $
|
||||
* $Revision: 2.1 $
|
||||
* $Date: 2002-08-01 01:41:06 $
|
||||
* $Author: penguin $
|
||||
* $Revision: 2.2 $
|
||||
* $Date: 2002-12-02 23:24:35 $
|
||||
* $Author: Goober5000 $
|
||||
*
|
||||
* C module for the Hotkey selection screen
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.1 2002/08/01 01:41:06 penguin
|
||||
* The big include file move
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:24 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
@@ -73,7 +76,7 @@
|
||||
* to hide the ship/wing until the mission is entered.
|
||||
*
|
||||
* 45 3/11/98 11:20a Hoffoss
|
||||
* Changed hotkey screen to only show friendly and hostile catagories
|
||||
* Changed hotkey screen to only show friendly and hostile categories
|
||||
* (everything non-friendly is hostile).
|
||||
*
|
||||
* 44 3/10/98 9:51a Allender
|
||||
|
||||
@@ -9,13 +9,16 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Mission/MissionLoad.cpp $
|
||||
* $Revision: 2.1 $
|
||||
* $Date: 2002-08-01 01:41:06 $
|
||||
* $Author: penguin $
|
||||
* $Revision: 2.2 $
|
||||
* $Date: 2002-12-02 23:53:49 $
|
||||
* $Author: Goober5000 $
|
||||
*
|
||||
* C source module for mission loading
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.1 2002/08/01 01:41:06 penguin
|
||||
* The big include file move
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:25 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
@@ -92,7 +95,7 @@
|
||||
* appended path for j:\tmp missions
|
||||
*
|
||||
* 89 10/31/97 11:19a John
|
||||
* added filter catagory for j:\tmp\*.fsm
|
||||
* added filter category for j:\tmp\*.fsm
|
||||
*
|
||||
* 88 10/12/97 5:22p Lawrance
|
||||
* have ESC back out of mission load screen
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -9,13 +9,108 @@
|
||||
|
||||
/*
|
||||
* $Source: /cvs/cvsroot/fs2open/fs2_open/code/mission/missionparse.h,v $
|
||||
* $Revision: 2.3 $
|
||||
* $Author: penguin $
|
||||
* $Date: 2002-08-01 01:41:07 $
|
||||
* $Revision: 2.22 $
|
||||
* $Author: Goober5000 $
|
||||
* $Date: 2003-03-02 02:10:11 $
|
||||
*
|
||||
* main header file for parsing code
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.21 2003/01/19 07:02:16 Goober5000
|
||||
* fixed a bunch of bugs - "no-subspace-drive" should now work properly for
|
||||
* all ships, and all ships who have their departure anchor set to a capital ship
|
||||
* should exit to that ship when told to depart
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.20 2003/01/18 23:25:39 Goober5000
|
||||
* made "no-subspace-drive" applicable to all ships and fixed a really *STUPID*
|
||||
* bug that made FRED keep crashing (missing comma, bleagh!)
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.19 2003/01/18 09:25:41 Goober5000
|
||||
* fixed bug I inadvertently introduced by modifying SIF_ flags with sexps rather
|
||||
* than SF_ flags
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.18 2003/01/17 01:48:50 Goober5000
|
||||
* added capability to the $Texture replace code to substitute the textures
|
||||
* without needing and extra model, however, this way you can't substitute
|
||||
* transparent or animated textures
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.17 2003/01/15 05:24:23 Goober5000
|
||||
* added texture replacement parse - will be implemented later
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.16 2003/01/13 02:09:12 wmcoolmon
|
||||
* Added MISSION_FLAG_NO_NEB_TRAILS and removed MISSION_FLAG_ST_OVERRIDE_NEB. Also changed code to set flags as necessary
|
||||
*
|
||||
* Revision 2.15 2003/01/11 01:00:25 wmcoolmon
|
||||
* Added code for "Ship Trails override Nebula"
|
||||
*
|
||||
* Revision 2.14 2003/01/03 21:58:08 Goober5000
|
||||
* Fixed some minor bugs, and added a primitive-sensors flag, where if a ship
|
||||
* has primitive sensors it can't target anything and objects don't appear
|
||||
* on radar if they're outside a certain range. This range can be modified
|
||||
* via the sexp primitive-sensors-set-range.
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.13 2003/01/02 00:35:21 Goober5000
|
||||
* added don't-collide-invisible and collide-invisible sexps
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.12 2003/01/01 23:33:33 Goober5000
|
||||
* added ship-vaporize and ship-no-vaporize sexps
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.11 2002/12/27 02:57:51 Goober5000
|
||||
* removed the existing stealth sexps and replaced them with the following...
|
||||
* ship-stealthy
|
||||
* ship-unstealthy
|
||||
* is-ship-stealthy
|
||||
* friendly-stealth-invisible
|
||||
* friendly-stealth-visible
|
||||
* is-friendly-stealth-visible
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.10 2002/12/24 07:38:59 Goober5000
|
||||
* added a wee cautionary note
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.9 2002/12/23 05:18:52 Goober5000
|
||||
* Squashed some Volition bugs! :O Some of the sexps for dealing with more than
|
||||
* one ship would return after only dealing with the first ship.
|
||||
*
|
||||
* Also added the following sexps:
|
||||
* is-ship-stealthed
|
||||
* ship-force-stealth
|
||||
* ship-force-nostealth
|
||||
* ship-remove-stealth-forcing
|
||||
*
|
||||
* They toggle the stealth flag on and off. If a ship is forced stealthy, it won't even
|
||||
* show up for friendly ships.
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.8 2002/12/14 17:09:28 Goober5000
|
||||
* removed mission flag for fighterbay damage; instead made damage display contingent on whether the fighterbay subsystem is assigned a damage percentage in ships.tbl
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.7 2002/12/14 01:55:04 Goober5000
|
||||
* added mission flag to show subsystem damage for fighterbays
|
||||
* ~Goober5000~
|
||||
*
|
||||
* Revision 2.6 2002/12/10 05:43:34 Goober5000
|
||||
* Full-fledged ballistic primary support added! Try it and see! :)
|
||||
*
|
||||
* Revision 2.5 2002/12/03 23:05:13 Goober5000
|
||||
* implemented beam-free-all-by-default mission flag
|
||||
*
|
||||
* Revision 2.4 2002/11/14 06:15:02 bobboau
|
||||
* added nameplate code
|
||||
*
|
||||
* Revision 2.3 2002/08/01 01:41:07 penguin
|
||||
* The big include file move
|
||||
*
|
||||
* Revision 2.2 2002/07/30 17:35:22 wmcoolmon
|
||||
* Added mission flag "MISSION_FLAG_SUPPORT_REPAIRS_HULL" for toggling Support Ship hull repair on and off
|
||||
*
|
||||
@@ -232,6 +327,8 @@ extern char *Starting_wing_names[MAX_STARTING_WINGS+1];
|
||||
#define MISSION_FLAG_NO_TRAITOR (1<<4) // player cannot become a traitor
|
||||
#define MISSION_FLAG_SHIP_TRAILS (1<<5) // Enables ship trails
|
||||
#define MISSION_FLAG_SUPPORT_REPAIRS_HULL (1<<6) // Toggles support ship repair of ship hulls
|
||||
#define MISSION_FLAG_BEAM_FREE_ALL_BY_DEFAULT (1<<7) // Beam-free-all by default - Goober5000
|
||||
#define MISSION_FLAG_NO_NEB_TRAILS (1<<8) //Disables ship trails in nebula -C
|
||||
|
||||
// some mice macros for mission type
|
||||
#define IS_MISSION_MULTI_COOP (The_mission.game_type & MISSION_TYPE_MULTI_COOP)
|
||||
@@ -240,6 +337,17 @@ extern char *Starting_wing_names[MAX_STARTING_WINGS+1];
|
||||
|
||||
#define MISSION_DESC_LENGTH 512
|
||||
|
||||
// Goober5000
|
||||
typedef struct support_ship_info {
|
||||
int arrival_location; // arrival location
|
||||
int arrival_anchor; // arrival anchor
|
||||
int departure_location; // departure location
|
||||
int departure_anchor; // departure anchor
|
||||
int max_support_ships; // max number of support ships
|
||||
int ship_class; // ship class of support ship
|
||||
int tally; // number of support ships so far
|
||||
} support_ship_info;
|
||||
|
||||
typedef struct mission {
|
||||
char name[NAME_LENGTH];
|
||||
char author[NAME_LENGTH];
|
||||
@@ -254,7 +362,7 @@ typedef struct mission {
|
||||
uint num_respawns; // valid in multiplayer missions -- number of respawns allowed
|
||||
int red_alert;
|
||||
int scramble;
|
||||
int disallow_support; // should support ships be disallowed.
|
||||
support_ship_info support_ships; // Goober5000
|
||||
char tour_name[NAME_LENGTH];
|
||||
char pre_briefing_cutscene[FILESPEC_LENGTH];
|
||||
char pre_mission_cutscene[FILESPEC_LENGTH];
|
||||
@@ -268,7 +376,7 @@ typedef struct mission {
|
||||
// cargo defines
|
||||
// NOTE: MAX_CARGO MUST REMAIN <= 64 (CARGO_NO_DEPLETE) for NO_DEPLETE to work.
|
||||
#define CARGO_INDEX_MASK 0xBF
|
||||
#define CARGO_NO_DEPLETE 0x40
|
||||
#define CARGO_NO_DEPLETE 0x40 // CARGO_NO_DEPLETE + CARGO_INDEX_MASK must == FF
|
||||
#define MAX_CARGO 30
|
||||
|
||||
extern mission The_mission;
|
||||
@@ -296,7 +404,7 @@ extern char Mission_filename[80]; // filename of mission in The_mission (Fred o
|
||||
#define MAX_GOAL_TYPE_NAMES 3
|
||||
|
||||
// alternate ship type names
|
||||
#define MAX_ALT_TYPE_NAMES 10
|
||||
#define MAX_ALT_TYPE_NAMES 25
|
||||
extern char Mission_alt_types[MAX_ALT_TYPE_NAMES][NAME_LENGTH];
|
||||
extern int Mission_alt_type_count;
|
||||
|
||||
@@ -326,12 +434,13 @@ extern char *Status_desc_names[MAX_STATUS_NAMES];
|
||||
extern char *Status_type_names[MAX_STATUS_NAMES];
|
||||
extern char *Status_target_names[MAX_STATUS_NAMES];
|
||||
extern char *Arrival_location_names[MAX_ARRIVAL_NAMES];
|
||||
extern char *Departure_location_names[MAX_ARRIVAL_NAMES];
|
||||
extern char *Departure_location_names[MAX_DEPARTURE_NAMES];
|
||||
extern char *Goal_type_names[MAX_GOAL_TYPE_NAMES];
|
||||
extern char *Species_names[MAX_SPECIES_NAMES];
|
||||
extern char *Reinforcement_type_names[];
|
||||
extern char *Object_flags[];
|
||||
extern char *Parse_object_flags[];
|
||||
extern char *Parse_object_flags_2[];
|
||||
extern char *Icon_names[];
|
||||
|
||||
extern char *Cargo_names[MAX_CARGO];
|
||||
@@ -361,6 +470,7 @@ typedef struct subsys_status {
|
||||
char name[NAME_LENGTH];
|
||||
float percent; // percent damaged
|
||||
int primary_banks[MAX_PRIMARY_BANKS];
|
||||
int primary_ammo[MAX_PRIMARY_BANKS];
|
||||
int secondary_banks[MAX_SECONDARY_BANKS];
|
||||
int secondary_ammo[MAX_SECONDARY_BANKS];
|
||||
int ai_class;
|
||||
@@ -405,6 +515,7 @@ typedef struct p_object {
|
||||
int determination;
|
||||
int wingnum; // set to -1 if not in a wing -- Wing array index otherwise
|
||||
int flags; // mission savable flags
|
||||
int flags2; // Goober5000
|
||||
int escort_priority; // priority in escort list
|
||||
int ai_class;
|
||||
int hotkey; // hotkey number (between 0 and 9) -1 means no hotkey
|
||||
@@ -426,13 +537,17 @@ typedef struct p_object {
|
||||
int respawn_priority; // priority this ship has for controlling respawn points
|
||||
|
||||
char alt_type_index; // optional alt type index
|
||||
|
||||
// Goober5000
|
||||
int num_texture_replacements;
|
||||
texture_replace replacement_textures[MAX_MODEL_TEXTURES]; // replacement textures - Goober5000
|
||||
} p_object;
|
||||
|
||||
// defines for flags used for p_objects when they are created. Used to help create
|
||||
// special circumstances for those ships. The order that these bitfields appear
|
||||
// in this list MUST match the order that they appear in the flags array in MissionParse.cpp!!!!
|
||||
// defines for flags used for p_objects when they are created. Used to help create special
|
||||
// circumstances for those ships. This list of bitfield indicators MUST correspond EXACTLY
|
||||
// (i.e., order and position must be the same) to its counterpart in MissionParse.cpp!!!!
|
||||
|
||||
#define MAX_PARSE_OBJECT_FLAGS 20
|
||||
#define MAX_PARSE_OBJECT_FLAGS 22
|
||||
|
||||
#define P_OF_CARGO_KNOWN (1<<0)
|
||||
#define P_SF_IGNORE_COUNT (1<<1)
|
||||
@@ -451,18 +566,41 @@ typedef struct p_object {
|
||||
#define P_AIF_KAMIKAZE (1<<14)
|
||||
#define P_AIF_NO_DYNAMIC (1<<15)
|
||||
#define P_SF_RED_ALERT_STORE_STATUS (1<<16)
|
||||
#define P_OF_BEAM_PROTECTED (1<<17)
|
||||
#define P_OF_BEAM_PROTECTED (1<<17)
|
||||
#define P_SF_GUARDIAN (1<<18)
|
||||
#define P_KNOSSOS_WARP_IN (1<<19)
|
||||
|
||||
// these flags do not appear in the array; we may want to add them
|
||||
// in the future though
|
||||
#define P_OF_NO_LASERS (1<<20)
|
||||
#define P_OF_NO_ENGINES (1<<21)
|
||||
#define P_SF_VAPORIZE (1<<22)
|
||||
#define P_SF2_STEALTH (1<<23)
|
||||
#define P_SF2_FRIENDLY_STEALTH_INVIS (1<<24)
|
||||
#define P_SF2_DONT_COLLIDE_INVIS (1<<25)
|
||||
|
||||
// the following parse object flags are used internally by Freespace
|
||||
#define P_SF_USE_UNIQUE_ORDERS (1<<26) // tells a newly created ship to use the default orders for that ship
|
||||
#define P_SF_USE_UNIQUE_ORDERS (1<<26) // tells a newly created ship to use the default orders for that ship
|
||||
#define P_SF_INITIALLY_DOCKED (1<<27) // is this parse object initially docked with something else
|
||||
#define P_SF_CANNOT_ARRIVE (1<<28) // used to indicate that this ship's arrival cue will never be true
|
||||
#define P_SF_WARP_BROKEN (1<<29) // warp engine should be broken for this ship
|
||||
#define P_SF_WARP_NEVER (1<<30) // warp drive is destroyed
|
||||
#define P_SF_PLAYER_START_VALID (1<<31) // this is a valid player start object
|
||||
#define P_SF_PLAYER_START_VALID (1<<31) // this is a valid player start object
|
||||
|
||||
// more parse flags! -- Goober5000
|
||||
// same caveat: This list of bitfield indicators MUST correspond EXACTLY
|
||||
// (i.e., order and position must be the same) to its counterpart in MissionParse.cpp!!!!
|
||||
|
||||
#define MAX_PARSE_OBJECT_FLAGS_2 5
|
||||
|
||||
#define P2_SF2_PRIMITIVE_SENSORS (1<<0)
|
||||
#define P2_SF2_NO_SUBSPACE_DRIVE (1<<1)
|
||||
|
||||
// and again: these flags do not appear in the array
|
||||
//#define blah (1<<29)
|
||||
//#define blah (1<<30)
|
||||
//#define blah (1<<31)
|
||||
|
||||
|
||||
extern p_object ship_arrival_list; // used by sexpression parser
|
||||
|
||||
@@ -534,7 +672,7 @@ int mission_parse_is_multi(char *filename, char *mission_name );
|
||||
int mission_parse_get_multi_mission_info(char *filename);
|
||||
|
||||
// called externally from multiplayer code
|
||||
void mission_do_departure(object *objp);
|
||||
int mission_do_departure(object *objp);
|
||||
|
||||
// called externally from Freespace.cpp
|
||||
void mission_parse_fixup_players(void);
|
||||
@@ -548,8 +686,8 @@ void mission_parse_eval_stuff();
|
||||
// function to set the ramaing time left in the mission
|
||||
void mission_parse_set_end_time( int seconds );
|
||||
|
||||
// code to warp in a repair ship.
|
||||
void mission_warp_in_support_ship( object *requester_objp );
|
||||
// code to bring in a repair ship.
|
||||
void mission_bring_in_support_ship( object *requester_objp );
|
||||
int mission_is_support_ship_arriving( void );
|
||||
void mission_add_to_arriving_support( object *requester_objp );
|
||||
int mission_is_repair_scheduled( object *objp );
|
||||
|
||||
@@ -9,14 +9,17 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/Mission/MissionTraining.cpp $
|
||||
* $Revision: 2.1 $
|
||||
* $Date: 2002-08-01 01:41:07 $
|
||||
* $Author: penguin $
|
||||
* $Revision: 2.2 $
|
||||
* $Date: 2002-12-23 01:47:17 $
|
||||
* $Author: Goober5000 $
|
||||
*
|
||||
* Special code for training missions. Stuff like displaying training messages in
|
||||
* the special training window, listing the training objectives, etc.
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.1 2002/08/01 01:41:07 penguin
|
||||
* The big include file move
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:25 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
@@ -1037,18 +1040,20 @@ void message_training_que(char *text, int timestamp, int length)
|
||||
}
|
||||
|
||||
// check the training message que to see if we should play a new message yet or not.
|
||||
// Goober5000: removed stipulation of instructor being present
|
||||
void message_training_que_check()
|
||||
{
|
||||
int i, j, iship_num;
|
||||
|
||||
// get the instructor's ship.
|
||||
iship_num = ship_name_lookup(NOX("instructor"));
|
||||
if ( iship_num == -1 )
|
||||
return;
|
||||
// if ( iship_num == -1 ) // commented out by Goober5000
|
||||
// return;
|
||||
|
||||
// if the instructor is dying or departing, do nothing
|
||||
if (Ships[iship_num].flags & (SF_DYING | SF_DEPARTING))
|
||||
return;
|
||||
if ( iship_num != -1 ) // added by Goober5000
|
||||
if (Ships[iship_num].flags & (SF_DYING | SF_DEPARTING))
|
||||
return;
|
||||
|
||||
if (Training_failure)
|
||||
return;
|
||||
|
||||
@@ -9,13 +9,16 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/MissionUI/MissionBrief.cpp $
|
||||
* $Revision: 2.1 $
|
||||
* $Date: 2002-08-01 01:41:07 $
|
||||
* $Author: penguin $
|
||||
* $Revision: 2.2 $
|
||||
* $Date: 2003-01-17 07:59:08 $
|
||||
* $Author: Goober5000 $
|
||||
*
|
||||
* C module that contains code to display the mission briefing to the player
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.1 2002/08/01 01:41:07 penguin
|
||||
* The big include file move
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:25 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
@@ -1535,18 +1538,6 @@ void brief_get_closeup_ship_modelnum(brief_icon *ci)
|
||||
}
|
||||
}
|
||||
|
||||
// cut any text off after (and including) '#' char
|
||||
void brief_truncate_label(char *src)
|
||||
{
|
||||
char *pointer_to_last_char;
|
||||
|
||||
pointer_to_last_char = strstr(src, NOX("#"));
|
||||
|
||||
if ( pointer_to_last_char ) {
|
||||
*pointer_to_last_char = 0;
|
||||
}
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------------------
|
||||
// brief_setup_closeup()
|
||||
//
|
||||
@@ -1606,7 +1597,7 @@ int brief_setup_closeup(brief_icon *bi)
|
||||
strcpy(Closeup_icon->closeup_label,sip->name);
|
||||
|
||||
// cut any text off after (and including) '#' char
|
||||
brief_truncate_label(Closeup_icon->closeup_label);
|
||||
end_string_at_first_hash_symbol(Closeup_icon->closeup_label);
|
||||
|
||||
if ( sip->flags & (SIF_SMALL_SHIP|SIF_BIG_SHIP|SIF_HUGE_SHIP|SIF_SENTRYGUN) ) {
|
||||
strcat(Closeup_icon->closeup_label, XSTR( " class", 434));
|
||||
|
||||
@@ -9,13 +9,27 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/MissionUI/MissionDebrief.cpp $
|
||||
* $Revision: 2.2 $
|
||||
* $Date: 2002-08-01 01:41:07 $
|
||||
* $Author: penguin $
|
||||
* $Revision: 2.6 $
|
||||
* $Date: 2003-01-27 00:51:46 $
|
||||
* $Author: DTP $
|
||||
*
|
||||
* C module for running the debriefing
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.5 2003/01/14 04:00:16 Goober5000
|
||||
* allowed for up to 256 main halls
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.4 2003/01/08 19:49:15 Goober5000
|
||||
* fixed debriefing music in non-campaign missions
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.3 2002/12/09 08:37:31 Goober5000
|
||||
* fixed misspelling
|
||||
*
|
||||
* Revision 2.2 2002/08/01 01:41:07 penguin
|
||||
* The big include file move
|
||||
*
|
||||
* Revision 2.1 2002/07/20 23:50:53 DTP
|
||||
* Fixed multiplayer music. succes music on all Primary goals complete, fail music
|
||||
* if otherwise
|
||||
@@ -1382,7 +1396,7 @@ void debrief_traitor_init()
|
||||
stuff_string(traitor_voice_file, F_FILESPEC, NULL);
|
||||
|
||||
// DKA 9/13/99 Only 1 traitor msg for FS2
|
||||
// if ( Player->on_bastion ) {
|
||||
// if ( Player->main_hall ) {
|
||||
// strcpy(stagep->voice, NOX("3_"));
|
||||
// } else {
|
||||
// strcpy(stagep->voice, NOX("1_"));
|
||||
@@ -2077,7 +2091,8 @@ void debrief_button_pressed(int num)
|
||||
void debrief_setup_ship_kill_stats(int stage_num)
|
||||
{
|
||||
int i;
|
||||
ushort *kill_arr;
|
||||
//ushort *kill_arr;
|
||||
int *kill_arr; //DTP max ships
|
||||
debrief_stats_kill_info *kill_info;
|
||||
|
||||
Assert(Current_stage < DEBRIEF_NUM_STATS_PAGES);
|
||||
@@ -2335,9 +2350,13 @@ void debrief_init()
|
||||
common_music_init(SCORE_DEBRIEF_FAIL);
|
||||
}
|
||||
*/
|
||||
/* 21-07-02 01:12 Commented out DTP, so we have the original source here
|
||||
|
||||
// Goober5000 - restored original source, because we can have multiplayer campaigns
|
||||
// also, added flag (Game_mode & GM_CAMPAIGN_MODE) to check if in campaign
|
||||
|
||||
// /* 21-07-02 01:12 Commented out DTP, so we have the original source here
|
||||
// start up the appropriate music
|
||||
if (Campaign.next_mission == Campaign.current_mission) {
|
||||
if ((Game_mode & GM_CAMPAIGN_MODE) && (Campaign.next_mission == Campaign.current_mission)) {
|
||||
// you failed the mission because you suck, so you get the suck music
|
||||
common_music_init(SCORE_DEBRIEF_FAIL);
|
||||
} else if (mission_goals_met()) {
|
||||
@@ -2348,15 +2367,16 @@ void debrief_init()
|
||||
common_music_init(SCORE_DEBRIEF_AVERAGE);
|
||||
}
|
||||
|
||||
if (Campaign.next_mission == Campaign.current_mission) {
|
||||
if ((Game_mode & GM_CAMPAIGN_MODE) && (Campaign.next_mission == Campaign.current_mission)) {
|
||||
// better luck next time, increase his retries
|
||||
Player->failures_this_session++;
|
||||
} else {
|
||||
// clear his retries info regardless of whether or not he accepts
|
||||
Player->failures_this_session = 0;
|
||||
}
|
||||
*/ //commented out stop
|
||||
// 21-07-02 01:12 DTP; New checks for setting debreifing music. at lot like the old.
|
||||
// */ //commented out stop
|
||||
|
||||
/* // 21-07-02 01:12 DTP; New checks for setting debriefing music. at lot like the old.
|
||||
// this is for single player
|
||||
if (Campaign.next_mission == Campaign.current_mission && (Game_mode & GM_NORMAL)) { //DTP
|
||||
common_music_init(SCORE_DEBRIEF_FAIL); //DTP
|
||||
@@ -2387,6 +2407,8 @@ void debrief_init()
|
||||
}
|
||||
|
||||
}
|
||||
*/
|
||||
|
||||
#ifndef NO_NETWORK
|
||||
if (Game_mode & GM_MULTIPLAYER) {
|
||||
multi_debrief_init();
|
||||
|
||||
@@ -9,13 +9,25 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/MissionUI/MissionShipChoice.cpp $
|
||||
* $Revision: 2.1 $
|
||||
* $Date: 2002-08-01 01:41:07 $
|
||||
* $Author: penguin $
|
||||
* $Revision: 2.4 $
|
||||
* $Date: 2003-03-05 09:17:14 $
|
||||
* $Author: Goober5000 $
|
||||
*
|
||||
* C module to allow player ship selection for the mission
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.3 2003/02/25 06:22:48 bobboau
|
||||
* fixed a bunch of fighter beam bugs,
|
||||
* most notabley the sound now works corectly,
|
||||
* and they have limeted range with atenuated damage (table option)
|
||||
* added bank specific compatabilities
|
||||
*
|
||||
* Revision 2.2 2002/12/15 06:50:49 DTP
|
||||
* FIX; player can now have all ships set in FRED2 as allowed playerships in singleplayer
|
||||
*
|
||||
* Revision 2.1 2002/08/01 01:41:07 penguin
|
||||
* The big include file move
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:25 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
@@ -579,7 +591,8 @@ typedef struct ss_active_item
|
||||
} ss_active_item;
|
||||
|
||||
static ss_active_item SS_active_head;
|
||||
static ss_active_item SS_active_items[MAX_WSS_SLOTS];
|
||||
//static ss_active_item SS_active_items[MAX_WSS_SLOTS];//DTP commented out or else singleplayer will only have a max of 12 ships
|
||||
static ss_active_item SS_active_items[MAX_SHIP_TYPES];//DTP, now we have all ships in the TBL, as they can all be playerships
|
||||
|
||||
static int SS_active_list_start;
|
||||
static int SS_active_list_size;
|
||||
@@ -793,7 +806,8 @@ void ss_set_carried_icon(int from_slot, int ship_class)
|
||||
void clear_active_list()
|
||||
{
|
||||
int i;
|
||||
for ( i = 0; i < MAX_WSS_SLOTS; i++ ) {
|
||||
for ( i = 0; i < MAX_SHIP_TYPES; i++ ) { //DTP singleplayer ship choice fix
|
||||
//for ( i = 0; i < MAX_WSS_SLOTS; i++ ) {
|
||||
SS_active_items[i].flags = 0;
|
||||
SS_active_items[i].ship_class = -1;
|
||||
}
|
||||
@@ -803,12 +817,14 @@ void clear_active_list()
|
||||
SS_active_list_size = 0;
|
||||
}
|
||||
|
||||
|
||||
// get a free element from SS_active_items[]
|
||||
ss_active_item *get_free_active_list_node()
|
||||
{
|
||||
int i;
|
||||
for ( i = 0; i < MAX_WSS_SLOTS; i++ ) {
|
||||
if ( SS_active_items[i].flags == 0 ) {
|
||||
for ( i = 0; i < MAX_SHIP_TYPES; i++ ) {
|
||||
//for ( i = 0; i < MAX_WSS_SLOTS; i++ ) { //DTP, ONLY 12 SHIPS ???, as MAX_WSS_SLOTS will be 12.
|
||||
if ( SS_active_items[i].flags == 0 ) {
|
||||
SS_active_items[i].flags |= SS_ACTIVE_ITEM_USED;
|
||||
return &SS_active_items[i];
|
||||
}
|
||||
@@ -816,6 +832,7 @@ ss_active_item *get_free_active_list_node()
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
// add a ship into the active list
|
||||
void active_list_add(int ship_class)
|
||||
{
|
||||
@@ -3259,13 +3276,14 @@ int ss_dump_to_list(int from_slot, int to_list, int *sound)
|
||||
// exit: data changed flag
|
||||
int ss_grab_from_list(int from_list, int to_slot, int *sound)
|
||||
{
|
||||
wss_unit *slot;
|
||||
wss_unit *slot;
|
||||
int i, wep[MAX_WL_WEAPONS], wep_count[MAX_WL_WEAPONS];
|
||||
|
||||
slot = &Wss_slots[to_slot];
|
||||
|
||||
// ensure that pool has ship
|
||||
if ( Ss_pool[from_list] <= 0 ) {
|
||||
if ( Ss_pool[from_list] <= 0 )
|
||||
{
|
||||
*sound=SND_ICON_DROP;
|
||||
return 0;
|
||||
}
|
||||
@@ -3279,7 +3297,8 @@ int ss_grab_from_list(int from_list, int to_slot, int *sound)
|
||||
// take weapons from list->slot
|
||||
wl_get_default_weapons(from_list, to_slot, wep, wep_count);
|
||||
wl_remove_weps_from_pool(wep, wep_count, slot->ship_class);
|
||||
for ( i = 0; i < MAX_WL_WEAPONS; i++ ) {
|
||||
for ( i = 0; i < MAX_WL_WEAPONS; i++ )
|
||||
{
|
||||
slot->wep[i] = wep[i];
|
||||
slot->wep_count[i] = wep_count[i];
|
||||
}
|
||||
@@ -3287,28 +3306,31 @@ int ss_grab_from_list(int from_list, int to_slot, int *sound)
|
||||
*sound=SND_ICON_DROP_ON_WING;
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
// exit: data changed flag
|
||||
int ss_swap_list_slot(int from_list, int to_slot, int *sound)
|
||||
{
|
||||
int i, wep[MAX_WL_WEAPONS], wep_count[MAX_WL_WEAPONS];
|
||||
wss_unit *slot;
|
||||
wss_unit *slot;
|
||||
|
||||
// ensure that pool has ship
|
||||
if ( Ss_pool[from_list] <= 0 ) {
|
||||
if ( Ss_pool[from_list] <= 0 )
|
||||
{
|
||||
*sound=SND_ICON_DROP;
|
||||
return 0;
|
||||
}
|
||||
|
||||
slot = &Wss_slots[to_slot];
|
||||
Assert(slot->ship_class >= 0 ); // slot should be filled
|
||||
Assert(slot->ship_class >= 0 ); // slot should be filled
|
||||
|
||||
// put ship from slot->list
|
||||
Ss_pool[Wss_slots[to_slot].ship_class]++;
|
||||
|
||||
// put weapons from slot->list
|
||||
for ( i = 0; i < MAX_WL_WEAPONS; i++ ) {
|
||||
if ( (slot->wep[i] >= 0) && (slot->wep_count[i] > 0) ) {
|
||||
for ( i = 0; i < MAX_WL_WEAPONS; i++ )
|
||||
{
|
||||
if ( (slot->wep[i] >= 0) && (slot->wep_count[i] > 0) )
|
||||
{
|
||||
Wl_pool[slot->wep[i]] += slot->wep_count[i];
|
||||
slot->wep[i] = -1;
|
||||
slot->wep_count[i] = 0;
|
||||
@@ -3322,7 +3344,8 @@ int ss_swap_list_slot(int from_list, int to_slot, int *sound)
|
||||
// take weapons from list->slot
|
||||
wl_get_default_weapons(from_list, to_slot, wep, wep_count);
|
||||
wl_remove_weps_from_pool(wep, wep_count, slot->ship_class);
|
||||
for ( i = 0; i < MAX_WL_WEAPONS; i++ ) {
|
||||
for ( i = 0; i < MAX_WL_WEAPONS; i++ )
|
||||
{
|
||||
slot->wep[i] = wep[i];
|
||||
slot->wep_count[i] = wep_count[i];
|
||||
}
|
||||
@@ -3330,7 +3353,7 @@ int ss_swap_list_slot(int from_list, int to_slot, int *sound)
|
||||
*sound=SND_ICON_DROP_ON_WING;
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
void ss_apply(int mode, int from_slot, int from_list, int to_slot, int to_list,int player_index)
|
||||
{
|
||||
int update=0;
|
||||
|
||||
@@ -9,13 +9,38 @@
|
||||
|
||||
/*
|
||||
* $Logfile: /Freespace2/code/MissionUI/MissionWeaponChoice.cpp $
|
||||
* $Revision: 2.1 $
|
||||
* $Date: 2002-08-01 01:41:07 $
|
||||
* $Author: penguin $
|
||||
* $Revision: 2.13 $
|
||||
* $Date: 2003-03-06 09:13:42 $
|
||||
* $Author: Goober5000 $
|
||||
*
|
||||
* C module for the weapon loadout screen
|
||||
*
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 2.12 2003/03/05 12:38:01 Goober5000
|
||||
* rewrote the restricted bank loadout code; it should work now
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.11 2003/03/05 09:17:14 Goober5000
|
||||
* cleaned out Bobboau's buggy code - about to rewrite with new, bug-free code :)
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.6 2003/01/15 21:29:05 anonymous
|
||||
* fixed the demo compilation. Define FS2_DEMO globally to compile as a demo. Make sure warp.pof is in your data/models directory.
|
||||
*
|
||||
* Revision 2.5 2002/12/31 18:59:43 Goober5000
|
||||
* if it ain't broke, don't fix it
|
||||
* --Goober5000
|
||||
*
|
||||
* Revision 2.3 2002/12/13 08:13:28 Goober5000
|
||||
* small tweaks and bug fixes for the ballistic primary conversion
|
||||
* ~Goober5000~
|
||||
*
|
||||
* Revision 2.2 2002/12/10 05:43:33 Goober5000
|
||||
* Full-fledged ballistic primary support added! Try it and see! :)
|
||||
*
|
||||
* Revision 2.1 2002/08/01 01:41:07 penguin
|
||||
* The big include file move
|
||||
*
|
||||
* Revision 2.0 2002/06/03 04:02:25 penguin
|
||||
* Warpcore CVS sync
|
||||
*
|
||||
@@ -1222,18 +1247,19 @@ int wl_get_ship_class(int wl_slot)
|
||||
|
||||
// Return true if weapon_flags indicates a weapon that is legal for use in current game type.
|
||||
// Function added by MK on 9/6/99 to support separate legal loadouts for dogfight missions.
|
||||
int weapon_allowed_for_game_type(int weapon_flags)
|
||||
// name changed by Goober5000 to better reflect what it actually does
|
||||
int eval_weapon_flag_for_game_type(int weapon_flags)
|
||||
{
|
||||
int rval = 0;
|
||||
|
||||
#ifndef NO_NETWORK
|
||||
#if !defined NO_NETWORK && !defined FS2_DEMO
|
||||
if ((Game_mode & GM_MULTIPLAYER) && (Netgame.type_flags & NG_TYPE_DOGFIGHT)) {
|
||||
if (weapon_flags & (1 << 1))
|
||||
if (weapon_flags & DOGFIGHT_WEAPON)
|
||||
rval = 1;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
if (weapon_flags & (1 << 0))
|
||||
if (weapon_flags & REGULAR_WEAPON)
|
||||
rval = 1;
|
||||
|
||||
return rval;
|
||||
@@ -1254,10 +1280,21 @@ void wl_set_disabled_weapons(int ship_class)
|
||||
|
||||
sip = &Ship_info[ship_class];
|
||||
|
||||
for ( i = 0; i < MAX_WEAPON_TYPES; i++ ) {
|
||||
for ( i = 0; i < MAX_WEAPON_TYPES; i++ )
|
||||
{
|
||||
// Determine whether weapon #i is allowed on this ship class in the current type of mission.
|
||||
// As of 9/6/99, the only difference is dogfight missions have a different list of legal weapons.
|
||||
Wl_icons[i].can_use = weapon_allowed_for_game_type(sip->allowed_weapons[i]);
|
||||
Wl_icons[i].can_use = eval_weapon_flag_for_game_type(sip->allowed_weapons[i]);
|
||||
|
||||
// Goober5000: ballistic primaries
|
||||
if (Weapon_info[i].wi_flags2 & WIF2_BALLISTIC)
|
||||
{
|
||||
// not allowed if this ship is not ballistic
|
||||
if (!(sip->flags & SIF_BALLISTIC_PRIMARIES))
|
||||
{
|
||||
Wl_icons[i].can_use = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1680,7 +1717,7 @@ void wl_start_slot_animation(int n)
|
||||
// should prolly scrub out the 1e06 lines of dead code this leaves
|
||||
return;
|
||||
|
||||
/*
|
||||
/*
|
||||
|
||||
int ship_class;
|
||||
wl_ship_class_info *wl_ship;
|
||||
@@ -1742,6 +1779,20 @@ void wl_set_selected_slot(int slot_num)
|
||||
}
|
||||
}
|
||||
|
||||
// determine how many ballistics of type 'wi_index' will fit into capacity - Goober5000
|
||||
int wl_calc_ballistic_fit(int wi_index, int capacity)
|
||||
{
|
||||
if ( wi_index < 0 ) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
Assert(Weapon_info[wi_index].subtype == WP_LASER);
|
||||
|
||||
Assert(Weapon_info[wi_index].wi_flags2 & WIF2_BALLISTIC);
|
||||
|
||||
return fl2i( capacity / Weapon_info[wi_index].cargo_size + 0.5f );
|
||||
}
|
||||
|
||||
// determine how many missiles of type 'wi_index' will fit into capacity
|
||||
int wl_calc_missile_fit(int wi_index, int capacity)
|
||||
{
|
||||
@@ -1768,12 +1819,14 @@ void wl_get_ship_class_weapons(int ship_class, int *wep, int *wep_count)
|
||||
wep_count[i] = -1; // -1 means weapon bank doesn't exist.. 0 just means it is empty
|
||||
}
|
||||
|
||||
for ( i = 0; i < sip->num_primary_banks; i++ ) {
|
||||
for ( i = 0; i < sip->num_primary_banks; i++ )
|
||||
{
|
||||
wep[i] = sip->primary_bank_weapons[i];
|
||||
wep_count[i] = 1;
|
||||
}
|
||||
|
||||
for ( i = 0; i < sip->num_secondary_banks; i++ ) {
|
||||
for ( i = 0; i < sip->num_secondary_banks; i++ )
|
||||
{
|
||||
wep[i+MAX_WL_PRIMARY] = sip->secondary_bank_weapons[i];
|
||||
wep_count[i+MAX_WL_PRIMARY] = wl_calc_missile_fit(sip->secondary_bank_weapons[i], sip->secondary_bank_ammo_capacity[i]);
|
||||
}
|
||||
@@ -1792,17 +1845,21 @@ void wl_get_ship_weapons(int ship_index, int *wep, int *wep_count)
|
||||
wp = &Wings[Ships[ship_index].wingnum];
|
||||
swp = &Ships[ship_index].weapons;
|
||||
|
||||
for ( i = 0; i < swp->num_primary_banks; i++ ) {
|
||||
for ( i = 0; i < swp->num_primary_banks; i++ )
|
||||
{
|
||||
wep[i] = swp->primary_bank_weapons[i];
|
||||
wep_count[i] = 1;
|
||||
|
||||
if ( wep[i] == -1 ) {
|
||||
wep_count[i] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
for ( i = 0; i < swp->num_secondary_banks; i++ ) {
|
||||
for ( i = 0; i < swp->num_secondary_banks; i++ )
|
||||
{
|
||||
wep[i+MAX_WL_PRIMARY] = swp->secondary_bank_weapons[i];
|
||||
wep_count[i+MAX_WL_PRIMARY] = swp->secondary_bank_ammo[i];
|
||||
|
||||
if ( wep[i+MAX_WL_PRIMARY] == -1 ) {
|
||||
wep_count[i+MAX_WL_PRIMARY] = 0;
|
||||
}
|
||||
@@ -1840,8 +1897,10 @@ void wl_get_parseobj_weapons(int sa_index, int ship_class, int *wep, int *wep_co
|
||||
}
|
||||
|
||||
// ammo counts could still be modified
|
||||
for ( i=0; i < MAX_SECONDARY_BANKS; i++ ) {
|
||||
if ( wep[i+MAX_WL_PRIMARY] >= 0 ) {
|
||||
for ( i=0; i < MAX_SECONDARY_BANKS; i++ )
|
||||
{
|
||||
if ( wep[i+MAX_WL_PRIMARY] >= 0 )
|
||||
{
|
||||
wep_count[i+MAX_WL_PRIMARY] = wl_calc_missile_fit(wep[i+MAX_WL_PRIMARY], fl2i(ss->secondary_ammo[i]/100.0f * sip->secondary_bank_ammo_capacity[i] + 0.5f));
|
||||
}
|
||||
}
|
||||
@@ -1850,13 +1909,38 @@ void wl_get_parseobj_weapons(int sa_index, int ship_class, int *wep, int *wep_co
|
||||
// ensure that there aren't any bogus weapons assigned by default
|
||||
void wl_cull_illegal_weapons(int ship_class, int *wep, int *wep_count)
|
||||
{
|
||||
int i;
|
||||
int i, check_flag;
|
||||
for ( i=0; i < MAX_WL_WEAPONS; i++ ) {
|
||||
if ( wep[i] < 0 ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( !weapon_allowed_for_game_type(Ship_info[ship_class].allowed_weapons[wep[i]]) ) {
|
||||
check_flag = Ship_info[ship_class].allowed_weapons[wep[i]];
|
||||
|
||||
// possibly re-do flag according to whether it's restricted
|
||||
if (i < MAX_WL_PRIMARY)
|
||||
{
|
||||
if (i < MAX_SUPPORTED_PRIMARY_BANKS)
|
||||
{
|
||||
if (eval_weapon_flag_for_game_type(Ship_info[ship_class].restricted_loadout_flag[i]))
|
||||
{
|
||||
check_flag = Ship_info[ship_class].allowed_bank_restricted_weapons[i][wep[i]];
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (i-MAX_WL_PRIMARY < MAX_SUPPORTED_SECONDARY_BANKS)
|
||||
{
|
||||
if (eval_weapon_flag_for_game_type(Ship_info[ship_class].restricted_loadout_flag[i-MAX_WL_PRIMARY+MAX_SUPPORTED_PRIMARY_BANKS]))
|
||||
{
|
||||
check_flag = Ship_info[ship_class].allowed_bank_restricted_weapons[i-MAX_WL_PRIMARY+MAX_SUPPORTED_PRIMARY_BANKS][wep[i]];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ( !eval_weapon_flag_for_game_type(check_flag) ) {
|
||||
// wep[i] = -1;
|
||||
wep_count[i] = 0;
|
||||
}
|
||||
@@ -1931,7 +2015,7 @@ void wl_add_index_to_list(int wi_index)
|
||||
}
|
||||
}
|
||||
|
||||
// remove the weapons specificed by wep[] and wep_count[] from Wl_pool[].
|
||||
// remove the weapons specified by wep[] and wep_count[] from Wl_pool[].
|
||||
void wl_remove_weps_from_pool(int *wep, int *wep_count, int ship_class)
|
||||
{
|
||||
int i, wi_index;
|
||||
@@ -1963,7 +2047,7 @@ void wl_remove_weps_from_pool(int *wep, int *wep_count, int ship_class)
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( !weapon_allowed_for_game_type(Ship_info[ship_class].allowed_weapons[wep_pool_index]) ) {
|
||||
if ( !eval_weapon_flag_for_game_type(Ship_info[ship_class].allowed_weapons[wep_pool_index]) ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -1987,7 +2071,8 @@ void wl_remove_weps_from_pool(int *wep, int *wep_count, int ship_class)
|
||||
}
|
||||
|
||||
int new_wep_count = wep_count[i];
|
||||
if ( Weapon_info[wi_index].subtype == WP_MISSILE ) {
|
||||
if ( Weapon_info[wi_index].subtype == WP_MISSILE )
|
||||
{
|
||||
int secondary_bank_index;
|
||||
secondary_bank_index = i-3;
|
||||
if ( secondary_bank_index < 0 ) {
|
||||
@@ -2933,20 +3018,24 @@ void weapon_select_do(float frametime)
|
||||
}
|
||||
|
||||
// check so see if this is really a legal weapon to carry away
|
||||
if ( !Wl_icons[Carried_wl_icon.weapon_class].can_use ) {
|
||||
if ( !Wl_icons[Carried_wl_icon.weapon_class].can_use )
|
||||
{
|
||||
int diffx, diffy;
|
||||
diffx = abs(Carried_wl_icon.from_x-mx);
|
||||
diffy = abs(Carried_wl_icon.from_y-my);
|
||||
if ( (diffx > 2) || (diffy > 2) ) {
|
||||
int ship_class = Wss_slots[Selected_wl_slot].ship_class;
|
||||
wl_pause_anim();
|
||||
if (Lcl_gr) {
|
||||
if (Lcl_gr)
|
||||
{
|
||||
// might have to get weapon name translation
|
||||
char display_name[128];
|
||||
strncpy(display_name, Weapon_info[Carried_wl_icon.weapon_class].name, 128);
|
||||
lcl_translate_wep_name(display_name);
|
||||
popup(PF_USE_AFFIRMATIVE_ICON, 1, POPUP_OK, XSTR( "A %s is unable to carry %s weaponry", 633), Ship_info[ship_class].name, display_name);
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
popup(PF_USE_AFFIRMATIVE_ICON, 1, POPUP_OK, XSTR( "A %s is unable to carry %s weaponry", 633), Ship_info[ship_class].name, Weapon_info[Carried_wl_icon.weapon_class].name);
|
||||
}
|
||||
wl_unpause_anim();
|
||||
@@ -3155,9 +3244,10 @@ void wl_draw_ship_weapons(int index)
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( (wep[i] != -1) && (wep_count[i] > 0) ) {
|
||||
if ( (wep[i] != -1) && (wep_count[i] > 0) )
|
||||
{
|
||||
int x_offset = wl_fury_missile_offset_hack(wep[i], wep_count[i]);
|
||||
x_offset =0;
|
||||
x_offset = 0;
|
||||
wl_render_icon( wep[i], Wl_bank_coords[gr_screen.res][i][0]+x_offset, Wl_bank_coords[gr_screen.res][i][1], wep_count[i], Wl_bank_count_draw_flags[i], -1, i, wep[i]);
|
||||
}
|
||||
}
|
||||
@@ -3370,21 +3460,41 @@ void wl_update_parse_object_weapons(p_object *pobjp, wss_unit *slot)
|
||||
}
|
||||
|
||||
j = 0;
|
||||
for ( i = 0; i < MAX_WL_PRIMARY; i++ ) {
|
||||
if ( (slot->wep_count[i] > 0) && (slot->wep[i] >= 0) ) {
|
||||
for ( i = 0; i < MAX_WL_PRIMARY; i++ )
|
||||
{
|
||||
if ( (slot->wep_count[i] > 0) && (slot->wep[i] >= 0) )
|
||||
{
|
||||
ss->primary_banks[j] = slot->wep[i];
|
||||
|
||||
// ballistic primaries - Goober5000
|
||||
if (Weapon_info[slot->wep[i]].wi_flags2 & WIF2_BALLISTIC)
|
||||
{
|
||||
// Important: the primary_ammo[] value is a percentage of max capacity!
|
||||
// which means that it's always 100%, since ballistic primaries are completely
|
||||
// full upon launch - Goober5000
|
||||
ss->primary_ammo[j] = 100;
|
||||
}
|
||||
else
|
||||
{
|
||||
ss->primary_ammo[j] = 0;
|
||||
}
|
||||
|
||||
j++;
|
||||
}
|
||||
}
|
||||
|
||||
j = 0;
|
||||
for ( i = 0; i < MAX_WL_SECONDARY; i++ ) {
|
||||
for ( i = 0; i < MAX_WL_SECONDARY; i++ )
|
||||
{
|
||||
sidx = i+MAX_WL_PRIMARY;
|
||||
if ( (slot->wep_count[sidx] > 0) && (slot->wep[sidx] >= 0) ) {
|
||||
if ( (slot->wep_count[sidx] > 0) && (slot->wep[sidx] >= 0) )
|
||||
{
|
||||
ss->secondary_banks[j] = slot->wep[sidx];
|
||||
|
||||
// Important: the secondary_ammo[] value is a percentage of max capacity!
|
||||
max_count = wl_calc_missile_fit(slot->wep[sidx], Ship_info[slot->ship_class].secondary_bank_ammo_capacity[j]);
|
||||
ss->secondary_ammo[j] = fl2i( i2fl(slot->wep_count[sidx]) / max_count * 100.0f + 0.5f);
|
||||
|
||||
j++;
|
||||
}
|
||||
}
|
||||
@@ -3498,7 +3608,21 @@ void wl_bash_ship_weapons(ship_weapon *swp, wss_unit *slot)
|
||||
j = 0;
|
||||
for ( i = 0; i < MAX_WL_PRIMARY; i++ ) {
|
||||
if ( (slot->wep_count[i] > 0) && (slot->wep[i] >= 0) ) {
|
||||
swp->primary_bank_weapons[j] = slot->wep[i];
|
||||
swp->primary_bank_weapons[j] = slot->wep[i];
|
||||
|
||||
// ballistic primaries - Goober5000
|
||||
if (Weapon_info[swp->primary_bank_weapons[j]].wi_flags2 & WIF2_BALLISTIC)
|
||||
{
|
||||
// this is a bit tricky: we must recalculate ammo for full capacity
|
||||
// since wep_count for primaries does not store the ammo; ballistic
|
||||
// primaries always come with a full magazine
|
||||
swp->primary_bank_ammo[j] = wl_calc_ballistic_fit(swp->primary_bank_weapons[j], Ship_info[slot->ship_class].primary_bank_ammo_capacity[i]);
|
||||
}
|
||||
else
|
||||
{
|
||||
swp->primary_bank_ammo[j] = 0;
|
||||
}
|
||||
|
||||
j++;
|
||||
}
|
||||
}
|
||||
@@ -3562,34 +3686,104 @@ void wl_saturate_bank(int ship_slot, int bank)
|
||||
// exit: 0 -> no data changed
|
||||
// 1 -> data changed
|
||||
// sound => gets filled with sound id to play
|
||||
// updated for specific bank by Goober5000
|
||||
int wl_swap_slot_slot(int from_bank, int to_bank, int ship_slot, int *sound)
|
||||
{
|
||||
wss_unit *slot;
|
||||
int class_mismatch_flag, from_index, to_index, forced_update;
|
||||
slot = &Wss_slots[ship_slot];
|
||||
|
||||
// usually zero, unless we have a strange update thingy
|
||||
forced_update = 0;
|
||||
|
||||
if ( slot->ship_class == -1 ) {
|
||||
Int3(); // should not be possible
|
||||
return 0;
|
||||
return forced_update;
|
||||
}
|
||||
|
||||
// do nothing if swapping with self
|
||||
if ( from_bank == to_bank ) {
|
||||
*sound=SND_ICON_DROP_ON_WING;
|
||||
return 0; // no update
|
||||
return forced_update; // no update
|
||||
}
|
||||
|
||||
// ensure that source bank exists and has something to pick from
|
||||
if ( slot->wep[from_bank] == -1 || slot->wep_count[from_bank] <= 0 ) {
|
||||
return 0;
|
||||
return forced_update;
|
||||
}
|
||||
|
||||
// ensure that the dest bank exists
|
||||
if ( slot->wep_count[to_bank] < 0 ) {
|
||||
return 0;
|
||||
return forced_update;
|
||||
}
|
||||
|
||||
// ensure that the banks are both of the same class
|
||||
if ( (IS_BANK_PRIMARY(from_bank) && IS_BANK_SECONDARY(to_bank)) || (IS_BANK_SECONDARY(from_bank) && IS_BANK_PRIMARY(to_bank)) ) {
|
||||
// ensure banks are compatible as far as primary and secondary
|
||||
class_mismatch_flag = (IS_BANK_PRIMARY(from_bank) && IS_BANK_SECONDARY(to_bank)) || (IS_BANK_SECONDARY(from_bank) && IS_BANK_PRIMARY(to_bank));
|
||||
|
||||
// further ensure that restrictions aren't breached
|
||||
if (!class_mismatch_flag)
|
||||
{
|
||||
from_index = -1;
|
||||
to_index = -1;
|
||||
|
||||
// calculate indices for ship_info
|
||||
if (from_bank < MAX_SUPPORTED_PRIMARY_BANKS)
|
||||
{
|
||||
from_index = from_bank;
|
||||
}
|
||||
if (to_bank < MAX_SUPPORTED_PRIMARY_BANKS)
|
||||
{
|
||||
to_index = to_bank;
|
||||
}
|
||||
if (MAX_WL_PRIMARY <= from_bank && from_bank-MAX_WL_PRIMARY < MAX_SUPPORTED_SECONDARY_BANKS)
|
||||
{
|
||||
from_index = from_bank - MAX_WL_PRIMARY + MAX_SUPPORTED_PRIMARY_BANKS;
|
||||
}
|
||||
if (MAX_WL_PRIMARY <= to_bank && to_bank-MAX_WL_PRIMARY < MAX_SUPPORTED_SECONDARY_BANKS)
|
||||
{
|
||||
to_index = to_bank - MAX_WL_PRIMARY + MAX_SUPPORTED_PRIMARY_BANKS;
|
||||
}
|
||||
|
||||
ship_info *sip = &Ship_info[slot->ship_class];
|
||||
|
||||
// check the to-bank first
|
||||
// check only if we have good bank numbering
|
||||
if (to_index >= 0)
|
||||
{
|
||||
if (eval_weapon_flag_for_game_type(sip->restricted_loadout_flag[to_index]))
|
||||
{
|
||||
if (!eval_weapon_flag_for_game_type(sip->allowed_bank_restricted_weapons[to_index][slot->wep[from_bank]]))
|
||||
{
|
||||
popup(PF_USE_AFFIRMATIVE_ICON, 1, POPUP_OK, "This bank is unable to carry %s weaponry", Weapon_info[slot->wep[from_bank]].name);
|
||||
return forced_update;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// check the from-bank
|
||||
// again, we must have good bank numbering
|
||||
if (from_index >= 0)
|
||||
{
|
||||
if (eval_weapon_flag_for_game_type(sip->restricted_loadout_flag[from_index]))
|
||||
{
|
||||
if (!eval_weapon_flag_for_game_type(sip->allowed_bank_restricted_weapons[from_index][slot->wep[to_bank]]))
|
||||
{
|
||||
// going from "from" to "to" is valid (from previous if), but going the other way isn't...
|
||||
// so return the "to" to the list before we move the "from"
|
||||
|
||||
// put to_bank back into list
|
||||
Wl_pool[slot->wep[to_bank]] += slot->wep_count[to_bank];; // return to list
|
||||
slot->wep[to_bank] = -1; // remove from slot
|
||||
slot->wep_count[to_bank] = 0;
|
||||
*sound=SND_ICON_DROP; // unless it changes later
|
||||
forced_update = 1; // because we can't return right away
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( class_mismatch_flag )
|
||||
{
|
||||
// put from_bank back into list
|
||||
Wl_pool[slot->wep[from_bank]] += slot->wep_count[from_bank];; // return to list
|
||||
slot->wep[from_bank] = -1; // remove from slot
|
||||
@@ -3598,16 +3792,17 @@ int wl_swap_slot_slot(int from_bank, int to_bank, int ship_slot, int *sound)
|
||||
return 1;
|
||||
}
|
||||
|
||||
// case 1: primaries (easy)
|
||||
if ( IS_BANK_PRIMARY(from_bank) && IS_BANK_PRIMARY(to_bank) ) {
|
||||
// case 1: primaries (easy, even with ballistics, because ammo is always maximized)
|
||||
if ( IS_BANK_PRIMARY(from_bank) && IS_BANK_PRIMARY(to_bank) )
|
||||
{
|
||||
wl_swap_weapons(ship_slot, from_bank, to_bank);
|
||||
*sound=SND_ICON_DROP_ON_WING;
|
||||
return 1;
|
||||
}
|
||||
|
||||
// case 2: secondaries (harder)
|
||||
if ( IS_BANK_SECONDARY(from_bank) && IS_BANK_SECONDARY(to_bank) ) {
|
||||
|
||||
if ( IS_BANK_SECONDARY(from_bank) && IS_BANK_SECONDARY(to_bank) )
|
||||
{
|
||||
// case 2a: secondaries are the same type
|
||||
if ( slot->wep[from_bank] == slot->wep[to_bank] ) {
|
||||
int dest_max, dest_can_fit, source_can_give;
|
||||
@@ -3617,7 +3812,7 @@ int wl_swap_slot_slot(int from_bank, int to_bank, int ship_slot, int *sound)
|
||||
|
||||
if ( dest_can_fit <= 0 ) {
|
||||
// dest bank is already full.. nothing to do here
|
||||
return 0;
|
||||
return forced_update;
|
||||
}
|
||||
|
||||
// see how much source can give
|
||||
@@ -3629,13 +3824,13 @@ int wl_swap_slot_slot(int from_bank, int to_bank, int ship_slot, int *sound)
|
||||
*sound=SND_ICON_DROP_ON_WING;
|
||||
return 1;
|
||||
} else {
|
||||
return 0;
|
||||
return forced_update;
|
||||
}
|
||||
}
|
||||
|
||||
// case 2b: secondaries are different types
|
||||
if ( slot->wep[from_bank] != slot->wep[to_bank] ) {
|
||||
|
||||
if ( slot->wep[from_bank] != slot->wep[to_bank] )
|
||||
{
|
||||
// swap 'em
|
||||
wl_swap_weapons(ship_slot, from_bank, to_bank);
|
||||
|
||||
@@ -3648,7 +3843,7 @@ int wl_swap_slot_slot(int from_bank, int to_bank, int ship_slot, int *sound)
|
||||
}
|
||||
|
||||
Int3(); // should never get here
|
||||
return 0;
|
||||
return forced_update;
|
||||
}
|
||||
|
||||
// exit: 0 -> no data changed
|
||||
@@ -3680,10 +3875,11 @@ int wl_grab_from_list(int from_list, int to_bank, int ship_slot, int *sound)
|
||||
{
|
||||
wss_unit *slot;
|
||||
slot = &Wss_slots[ship_slot];
|
||||
int max_fit;
|
||||
int max_fit, to_index;
|
||||
|
||||
// ensure that the banks are both of the same class
|
||||
if ( (IS_LIST_PRIMARY(from_list) && IS_BANK_SECONDARY(to_bank)) || (IS_LIST_SECONDARY(from_list) && IS_BANK_PRIMARY(to_bank)) ) {
|
||||
if ( (IS_LIST_PRIMARY(from_list) && IS_BANK_SECONDARY(to_bank)) || (IS_LIST_SECONDARY(from_list) && IS_BANK_PRIMARY(to_bank)) )
|
||||
{
|
||||
// do nothing
|
||||
*sound=SND_ICON_DROP;
|
||||
return 0;
|
||||
@@ -3704,10 +3900,41 @@ int wl_grab_from_list(int from_list, int to_bank, int ship_slot, int *sound)
|
||||
return 0;
|
||||
}
|
||||
|
||||
// ensure that this bank will accept the weapon
|
||||
to_index = -1;
|
||||
|
||||
// calculate index for ship_info
|
||||
if (to_bank < MAX_SUPPORTED_PRIMARY_BANKS)
|
||||
{
|
||||
to_index = to_bank;
|
||||
}
|
||||
if (MAX_WL_PRIMARY <= to_bank && to_bank-MAX_WL_PRIMARY < MAX_SUPPORTED_SECONDARY_BANKS)
|
||||
{
|
||||
to_index = to_bank - MAX_WL_PRIMARY + MAX_SUPPORTED_PRIMARY_BANKS;
|
||||
}
|
||||
|
||||
ship_info *sip = &Ship_info[slot->ship_class];
|
||||
|
||||
// check only if we have good bank numbering
|
||||
if (to_index >= 0)
|
||||
{
|
||||
if (eval_weapon_flag_for_game_type(sip->restricted_loadout_flag[to_index]))
|
||||
{
|
||||
if (!eval_weapon_flag_for_game_type(sip->allowed_bank_restricted_weapons[to_index][from_list]))
|
||||
{
|
||||
popup(PF_USE_AFFIRMATIVE_ICON, 1, POPUP_OK, "This bank is unable to carry %s weaponry", Weapon_info[from_list].name);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// find how much dest bank can fit
|
||||
if ( to_bank < MAX_WL_PRIMARY ) {
|
||||
if ( to_bank < MAX_WL_PRIMARY )
|
||||
{
|
||||
max_fit = 1;
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
max_fit = wl_calc_missile_fit(from_list, Ship_info[slot->ship_class].secondary_bank_ammo_capacity[to_bank-MAX_WL_PRIMARY]);
|
||||
}
|
||||
|
||||
@@ -3732,7 +3959,7 @@ int wl_swap_list_slot(int from_list, int to_bank, int ship_slot, int *sound)
|
||||
{
|
||||
wss_unit *slot;
|
||||
slot = &Wss_slots[ship_slot];
|
||||
int max_fit;
|
||||
int max_fit, to_index;
|
||||
|
||||
// ensure that the banks are both of the same class
|
||||
if ( (IS_LIST_PRIMARY(from_list) && IS_BANK_SECONDARY(to_bank)) || (IS_LIST_SECONDARY(from_list) && IS_BANK_PRIMARY(to_bank)) ) {
|
||||
@@ -3755,6 +3982,34 @@ int wl_swap_list_slot(int from_list, int to_bank, int ship_slot, int *sound)
|
||||
return 0;
|
||||
}
|
||||
|
||||
// ensure that this bank will accept the weapon
|
||||
to_index = -1;
|
||||
|
||||
// calculate index for ship_info
|
||||
if (to_bank < MAX_SUPPORTED_PRIMARY_BANKS)
|
||||
{
|
||||
to_index = to_bank;
|
||||
}
|
||||
if (MAX_WL_PRIMARY <= to_bank && to_bank-MAX_WL_PRIMARY < MAX_SUPPORTED_SECONDARY_BANKS)
|
||||
{
|
||||
to_index = to_bank - MAX_WL_PRIMARY + MAX_SUPPORTED_PRIMARY_BANKS;
|
||||
}
|
||||
|
||||
ship_info *sip = &Ship_info[slot->ship_class];
|
||||
|
||||
// check only if we have good bank numbering
|
||||
if (to_index >= 0)
|
||||
{
|
||||
if (eval_weapon_flag_for_game_type(sip->restricted_loadout_flag[to_index]))
|
||||
{
|
||||
if (!eval_weapon_flag_for_game_type(sip->allowed_bank_restricted_weapons[to_index][from_list]))
|
||||
{
|
||||
popup(PF_USE_AFFIRMATIVE_ICON, 1, POPUP_OK, "This bank is unable to carry %s weaponry", Weapon_info[from_list].name);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// dump slot weapon back into list
|
||||
Wl_pool[slot->wep[to_bank]] += slot->wep_count[to_bank];
|
||||
slot->wep_count[to_bank] = 0;
|
||||
@@ -3763,9 +4018,12 @@ int wl_swap_list_slot(int from_list, int to_bank, int ship_slot, int *sound)
|
||||
// put weapon on ship from list
|
||||
|
||||
// find how much dest bank can fit
|
||||
if ( to_bank < MAX_WL_PRIMARY ) {
|
||||
if ( to_bank < MAX_WL_PRIMARY )
|
||||
{
|
||||
max_fit = 1;
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
max_fit = wl_calc_missile_fit(from_list, Ship_info[slot->ship_class].secondary_bank_ammo_capacity[to_bank-MAX_WL_PRIMARY]);
|
||||
}
|
||||
|
||||
|
||||
Loaded 100 of 174 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user