forked from len0rd/rockbox
Port of Duke Nukem 3D
This ports Fabien Sanglard's Chocolate Duke to run on a version of SDL for Rockbox. Change-Id: I8f2c4c78af19de10c1633ed7bb7a997b43256dd9
This commit is contained in:
parent
01c6dcf6c7
commit
a855d62025
994 changed files with 336924 additions and 15 deletions
693
apps/plugins/sdl/progs/duke3d/Engine/src/Makefile
Normal file
693
apps/plugins/sdl/progs/duke3d/Engine/src/Makefile
Normal file
|
|
@ -0,0 +1,693 @@
|
|||
# Makefile.in generated by automake 1.15.1 from Makefile.am.
|
||||
# Engine/src/Makefile. Generated from Makefile.in by configure.
|
||||
|
||||
# Copyright (C) 1994-2017 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.
|
||||
|
||||
|
||||
|
||||
|
||||
am__is_gnu_make = { \
|
||||
if test -z '$(MAKELEVEL)'; then \
|
||||
false; \
|
||||
elif test -n '$(MAKE_HOST)'; then \
|
||||
true; \
|
||||
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
|
||||
true; \
|
||||
else \
|
||||
false; \
|
||||
fi; \
|
||||
}
|
||||
am__make_running_with_option = \
|
||||
case $${target_option-} in \
|
||||
?) ;; \
|
||||
*) echo "am__make_running_with_option: internal error: invalid" \
|
||||
"target option '$${target_option-}' specified" >&2; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
has_opt=no; \
|
||||
sane_makeflags=$$MAKEFLAGS; \
|
||||
if $(am__is_gnu_make); then \
|
||||
sane_makeflags=$$MFLAGS; \
|
||||
else \
|
||||
case $$MAKEFLAGS in \
|
||||
*\\[\ \ ]*) \
|
||||
bs=\\; \
|
||||
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
|
||||
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
|
||||
esac; \
|
||||
fi; \
|
||||
skip_next=no; \
|
||||
strip_trailopt () \
|
||||
{ \
|
||||
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
|
||||
}; \
|
||||
for flg in $$sane_makeflags; do \
|
||||
test $$skip_next = yes && { skip_next=no; continue; }; \
|
||||
case $$flg in \
|
||||
*=*|--*) continue;; \
|
||||
-*I) strip_trailopt 'I'; skip_next=yes;; \
|
||||
-*I?*) strip_trailopt 'I';; \
|
||||
-*O) strip_trailopt 'O'; skip_next=yes;; \
|
||||
-*O?*) strip_trailopt 'O';; \
|
||||
-*l) strip_trailopt 'l'; skip_next=yes;; \
|
||||
-*l?*) strip_trailopt 'l';; \
|
||||
-[dEDm]) skip_next=yes;; \
|
||||
-[JT]) skip_next=yes;; \
|
||||
esac; \
|
||||
case $$flg in \
|
||||
*$$target_option*) has_opt=yes; break;; \
|
||||
esac; \
|
||||
done; \
|
||||
test $$has_opt = yes
|
||||
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
|
||||
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
|
||||
pkgdatadir = $(datadir)/chocolate-duke3d
|
||||
pkgincludedir = $(includedir)/chocolate-duke3d
|
||||
pkglibdir = $(libdir)/chocolate-duke3d
|
||||
pkglibexecdir = $(libexecdir)/chocolate-duke3d
|
||||
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
||||
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 = :
|
||||
subdir = Engine/src
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
|
||||
mkinstalldirs = $(install_sh) -d
|
||||
CONFIG_CLEAN_FILES =
|
||||
CONFIG_CLEAN_VPATH_FILES =
|
||||
LIBRARIES = $(noinst_LIBRARIES)
|
||||
AR = ar
|
||||
ARFLAGS = cru
|
||||
AM_V_AR = $(am__v_AR_$(V))
|
||||
am__v_AR_ = $(am__v_AR_$(AM_DEFAULT_VERBOSITY))
|
||||
am__v_AR_0 = @echo " AR " $@;
|
||||
am__v_AR_1 =
|
||||
libEngine_a_AR = $(AR) $(ARFLAGS)
|
||||
libEngine_a_LIBADD =
|
||||
am_libEngine_a_OBJECTS = libEngine_a-cache.$(OBJEXT) \
|
||||
libEngine_a-display.$(OBJEXT) libEngine_a-draw.$(OBJEXT) \
|
||||
libEngine_a-dummy_multi.$(OBJEXT) libEngine_a-engine.$(OBJEXT) \
|
||||
libEngine_a-filesystem.$(OBJEXT) \
|
||||
libEngine_a-fixedPoint_math.$(OBJEXT) \
|
||||
libEngine_a-mmulti.$(OBJEXT) libEngine_a-network.$(OBJEXT) \
|
||||
libEngine_a-tiles.$(OBJEXT)
|
||||
libEngine_a_OBJECTS = $(am_libEngine_a_OBJECTS)
|
||||
AM_V_P = $(am__v_P_$(V))
|
||||
am__v_P_ = $(am__v_P_$(AM_DEFAULT_VERBOSITY))
|
||||
am__v_P_0 = false
|
||||
am__v_P_1 = :
|
||||
AM_V_GEN = $(am__v_GEN_$(V))
|
||||
am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
|
||||
am__v_GEN_0 = @echo " GEN " $@;
|
||||
am__v_GEN_1 =
|
||||
AM_V_at = $(am__v_at_$(V))
|
||||
am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
|
||||
am__v_at_0 = @
|
||||
am__v_at_1 =
|
||||
DEFAULT_INCLUDES = -I.
|
||||
depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp
|
||||
am__depfiles_maybe = depfiles
|
||||
am__mv = mv -f
|
||||
AM_V_lt = $(am__v_lt_$(V))
|
||||
am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY))
|
||||
am__v_lt_0 = --silent
|
||||
am__v_lt_1 =
|
||||
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
|
||||
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
|
||||
AM_V_CC = $(am__v_CC_$(V))
|
||||
am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY))
|
||||
am__v_CC_0 = @echo " CC " $@;
|
||||
am__v_CC_1 =
|
||||
CCLD = $(CC)
|
||||
LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
|
||||
AM_V_CCLD = $(am__v_CCLD_$(V))
|
||||
am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY))
|
||||
am__v_CCLD_0 = @echo " CCLD " $@;
|
||||
am__v_CCLD_1 =
|
||||
SOURCES = $(libEngine_a_SOURCES)
|
||||
DIST_SOURCES = $(libEngine_a_SOURCES)
|
||||
am__can_run_installinfo = \
|
||||
case $$AM_UPDATE_INFO_DIR in \
|
||||
n|no|NO) false;; \
|
||||
*) (install-info --version) >/dev/null 2>&1;; \
|
||||
esac
|
||||
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
|
||||
# Read a list of newline-separated strings from the standard input,
|
||||
# and print each of them once, without duplicates. Input order is
|
||||
# *not* preserved.
|
||||
am__uniquify_input = $(AWK) '\
|
||||
BEGIN { nonempty = 0; } \
|
||||
{ items[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in items) print i; }; } \
|
||||
'
|
||||
# Make sure the list of sources is unique. This is necessary because,
|
||||
# e.g., the same source file might be shared among _SOURCES variables
|
||||
# for different programs/libraries.
|
||||
am__define_uniq_tagged_files = \
|
||||
list='$(am__tagged_files)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | $(am__uniquify_input)`
|
||||
ETAGS = etags
|
||||
CTAGS = ctags
|
||||
am__DIST_COMMON = $(srcdir)/Makefile.in \
|
||||
$(top_srcdir)/build-aux/depcomp
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
ACLOCAL = ${SHELL} /home/franklin/chocolate_duke3D/build-aux/missing aclocal-1.15
|
||||
AMTAR = $${TAR-tar}
|
||||
AM_DEFAULT_VERBOSITY = 0
|
||||
AUTOCONF = ${SHELL} /home/franklin/chocolate_duke3D/build-aux/missing autoconf
|
||||
AUTOHEADER = ${SHELL} /home/franklin/chocolate_duke3D/build-aux/missing autoheader
|
||||
AUTOMAKE = ${SHELL} /home/franklin/chocolate_duke3D/build-aux/missing automake-1.15
|
||||
AWK = gawk
|
||||
CC = gcc
|
||||
CCDEPMODE = depmode=gcc3
|
||||
CFLAGS = -Wall -Wno-pointer-sign -Wno-pointer-to-int-cast -Wno-int-to-pointer-cast -Wno-parentheses -Wno-maybe-uninitialized -Wno-unused-but-set-variable -Wno-unused-function -Wno-unused-result -fno-strict-aliasing -fno-aggressive-loop-optimizations -DPLATFORM_UNIX -D_GNU_SOURCE=1 -D_REENTRANT -I/usr/include/SDL -g -O2
|
||||
CPP = gcc -E
|
||||
CPPFLAGS =
|
||||
CYGPATH_W = echo
|
||||
DEFS = -DPACKAGE_NAME=\"Chocolate\ Duke3D\" -DPACKAGE_TARNAME=\"chocolate-duke3d\" -DPACKAGE_VERSION=\"1.0\" -DPACKAGE_STRING=\"Chocolate\ Duke3D\ 1.0\" -DPACKAGE_BUGREPORT=\"https://github.com/fabiensanglard/chocolate_duke3D/issues\" -DPACKAGE_URL=\"\" -DPACKAGE=\"chocolate-duke3d\" -DVERSION=\"1.0\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_ASSERT_H=1 -DHAVE_ENET_ENET_H=1
|
||||
DEPDIR = .deps
|
||||
ECHO_C =
|
||||
ECHO_N = -n
|
||||
ECHO_T =
|
||||
EGREP = /usr/bin/grep -E
|
||||
EXEEXT =
|
||||
GREP = /usr/bin/grep
|
||||
INSTALL = /usr/bin/install -c
|
||||
INSTALL_DATA = ${INSTALL} -m 644
|
||||
INSTALL_PROGRAM = ${INSTALL}
|
||||
INSTALL_SCRIPT = ${INSTALL}
|
||||
INSTALL_STRIP_PROGRAM = $(install_sh) -c -s
|
||||
LDFLAGS = -lSDL -lpthread -lSDL_mixer -lSDL -lpthread
|
||||
LIBOBJS =
|
||||
LIBS =
|
||||
LTLIBOBJS =
|
||||
MAKEINFO = ${SHELL} /home/franklin/chocolate_duke3D/build-aux/missing makeinfo
|
||||
MKDIR_P = /usr/bin/mkdir -p
|
||||
OBJEXT = o
|
||||
PACKAGE = chocolate-duke3d
|
||||
PACKAGE_BUGREPORT = https://github.com/fabiensanglard/chocolate_duke3D/issues
|
||||
PACKAGE_NAME = Chocolate Duke3D
|
||||
PACKAGE_STRING = Chocolate Duke3D 1.0
|
||||
PACKAGE_TARNAME = chocolate-duke3d
|
||||
PACKAGE_URL =
|
||||
PACKAGE_VERSION = 1.0
|
||||
PATH_SEPARATOR = :
|
||||
PKG_CONFIG = /usr/bin/pkg-config
|
||||
PKG_CONFIG_LIBDIR =
|
||||
PKG_CONFIG_PATH =
|
||||
RANLIB = ranlib
|
||||
SDL_CFLAGS = -D_GNU_SOURCE=1 -D_REENTRANT -I/usr/include/SDL
|
||||
SDL_LIBS = -lSDL -lpthread
|
||||
SDL_MIXER_CFLAGS = -D_GNU_SOURCE=1 -D_REENTRANT -I/usr/include/SDL
|
||||
SDL_MIXER_LIBS = -lSDL_mixer -lSDL -lpthread
|
||||
SET_MAKE =
|
||||
SHELL = /bin/sh
|
||||
STRIP =
|
||||
VERSION = 1.0
|
||||
WINDRES =
|
||||
abs_builddir = /home/franklin/chocolate_duke3D/Engine/src
|
||||
abs_srcdir = /home/franklin/chocolate_duke3D/Engine/src
|
||||
abs_top_builddir = /home/franklin/chocolate_duke3D
|
||||
abs_top_srcdir = /home/franklin/chocolate_duke3D
|
||||
ac_ct_CC = gcc
|
||||
am__include = include
|
||||
am__leading_dot = .
|
||||
am__quote =
|
||||
am__tar = $${TAR-tar} chof - "$$tardir"
|
||||
am__untar = $${TAR-tar} xf -
|
||||
bindir = ${exec_prefix}/bin
|
||||
build_alias =
|
||||
builddir = .
|
||||
datadir = ${datarootdir}
|
||||
datarootdir = ${prefix}/share
|
||||
docdir = ${datarootdir}/doc/${PACKAGE_TARNAME}
|
||||
dvidir = ${docdir}
|
||||
exec_prefix = ${prefix}
|
||||
host_alias =
|
||||
htmldir = ${docdir}
|
||||
includedir = ${prefix}/include
|
||||
infodir = ${datarootdir}/info
|
||||
install_sh = ${SHELL} /home/franklin/chocolate_duke3D/build-aux/install-sh
|
||||
libdir = ${exec_prefix}/lib
|
||||
libexecdir = ${exec_prefix}/libexec
|
||||
localedir = ${datarootdir}/locale
|
||||
localstatedir = ${prefix}/var
|
||||
mandir = ${datarootdir}/man
|
||||
mkdir_p = $(MKDIR_P)
|
||||
oldincludedir = /usr/include
|
||||
pdfdir = ${docdir}
|
||||
prefix = /usr/local
|
||||
program_transform_name = s,x,x,
|
||||
psdir = ${docdir}
|
||||
sbindir = ${exec_prefix}/sbin
|
||||
sharedstatedir = ${prefix}/com
|
||||
srcdir = .
|
||||
sysconfdir = ${prefix}/etc
|
||||
target_alias =
|
||||
top_build_prefix = ../../
|
||||
top_builddir = ../..
|
||||
top_srcdir = ../..
|
||||
noinst_LIBRARIES = libEngine.a
|
||||
libEngine_a_SOURCES = cache.c display.c draw.c dummy_multi.c engine.c filesystem.c fixedPoint_math.c mmulti.c network.c tiles.c
|
||||
libEngine_a_CFLAGS = -I$(top_srcdir)/Game/src
|
||||
all: all-am
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .c .o .obj
|
||||
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
|
||||
@for dep in $?; do \
|
||||
case '$(am__configure_deps)' in \
|
||||
*$$dep*) \
|
||||
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
|
||||
&& { if test -f $@; then exit 0; else break; fi; }; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
done; \
|
||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Engine/src/Makefile'; \
|
||||
$(am__cd) $(top_srcdir) && \
|
||||
$(AUTOMAKE) --foreign Engine/src/Makefile
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
@case '$?' in \
|
||||
*config.status*) \
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
|
||||
*) \
|
||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
|
||||
esac;
|
||||
|
||||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
|
||||
$(top_srcdir)/configure: $(am__configure_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(am__aclocal_m4_deps):
|
||||
|
||||
clean-noinstLIBRARIES:
|
||||
-test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
|
||||
|
||||
libEngine.a: $(libEngine_a_OBJECTS) $(libEngine_a_DEPENDENCIES) $(EXTRA_libEngine_a_DEPENDENCIES)
|
||||
$(AM_V_at)-rm -f libEngine.a
|
||||
$(AM_V_AR)$(libEngine_a_AR) libEngine.a $(libEngine_a_OBJECTS) $(libEngine_a_LIBADD)
|
||||
$(AM_V_at)$(RANLIB) libEngine.a
|
||||
|
||||
mostlyclean-compile:
|
||||
-rm -f *.$(OBJEXT)
|
||||
|
||||
distclean-compile:
|
||||
-rm -f *.tab.c
|
||||
|
||||
include ./$(DEPDIR)/libEngine_a-cache.Po
|
||||
include ./$(DEPDIR)/libEngine_a-display.Po
|
||||
include ./$(DEPDIR)/libEngine_a-draw.Po
|
||||
include ./$(DEPDIR)/libEngine_a-dummy_multi.Po
|
||||
include ./$(DEPDIR)/libEngine_a-engine.Po
|
||||
include ./$(DEPDIR)/libEngine_a-filesystem.Po
|
||||
include ./$(DEPDIR)/libEngine_a-fixedPoint_math.Po
|
||||
include ./$(DEPDIR)/libEngine_a-mmulti.Po
|
||||
include ./$(DEPDIR)/libEngine_a-network.Po
|
||||
include ./$(DEPDIR)/libEngine_a-tiles.Po
|
||||
|
||||
.c.o:
|
||||
$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
|
||||
$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
|
||||
# $(AM_V_CC)source='$<' object='$@' libtool=no \
|
||||
# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
|
||||
# $(AM_V_CC_no)$(COMPILE) -c -o $@ $<
|
||||
|
||||
.c.obj:
|
||||
$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
|
||||
$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
|
||||
# $(AM_V_CC)source='$<' object='$@' libtool=no \
|
||||
# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
|
||||
# $(AM_V_CC_no)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
|
||||
|
||||
libEngine_a-cache.o: cache.c
|
||||
$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libEngine_a_CFLAGS) $(CFLAGS) -MT libEngine_a-cache.o -MD -MP -MF $(DEPDIR)/libEngine_a-cache.Tpo -c -o libEngine_a-cache.o `test -f 'cache.c' || echo '$(srcdir)/'`cache.c
|
||||
$(AM_V_at)$(am__mv) $(DEPDIR)/libEngine_a-cache.Tpo $(DEPDIR)/libEngine_a-cache.Po
|
||||
# $(AM_V_CC)source='cache.c' object='libEngine_a-cache.o' libtool=no \
|
||||
# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
|
||||
# $(AM_V_CC_no)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libEngine_a_CFLAGS) $(CFLAGS) -c -o libEngine_a-cache.o `test -f 'cache.c' || echo '$(srcdir)/'`cache.c
|
||||
|
||||
libEngine_a-cache.obj: cache.c
|
||||
$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libEngine_a_CFLAGS) $(CFLAGS) -MT libEngine_a-cache.obj -MD -MP -MF $(DEPDIR)/libEngine_a-cache.Tpo -c -o libEngine_a-cache.obj `if test -f 'cache.c'; then $(CYGPATH_W) 'cache.c'; else $(CYGPATH_W) '$(srcdir)/cache.c'; fi`
|
||||
$(AM_V_at)$(am__mv) $(DEPDIR)/libEngine_a-cache.Tpo $(DEPDIR)/libEngine_a-cache.Po
|
||||
# $(AM_V_CC)source='cache.c' object='libEngine_a-cache.obj' libtool=no \
|
||||
# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
|
||||
# $(AM_V_CC_no)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libEngine_a_CFLAGS) $(CFLAGS) -c -o libEngine_a-cache.obj `if test -f 'cache.c'; then $(CYGPATH_W) 'cache.c'; else $(CYGPATH_W) '$(srcdir)/cache.c'; fi`
|
||||
|
||||
libEngine_a-display.o: display.c
|
||||
$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libEngine_a_CFLAGS) $(CFLAGS) -MT libEngine_a-display.o -MD -MP -MF $(DEPDIR)/libEngine_a-display.Tpo -c -o libEngine_a-display.o `test -f 'display.c' || echo '$(srcdir)/'`display.c
|
||||
$(AM_V_at)$(am__mv) $(DEPDIR)/libEngine_a-display.Tpo $(DEPDIR)/libEngine_a-display.Po
|
||||
# $(AM_V_CC)source='display.c' object='libEngine_a-display.o' libtool=no \
|
||||
# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
|
||||
# $(AM_V_CC_no)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libEngine_a_CFLAGS) $(CFLAGS) -c -o libEngine_a-display.o `test -f 'display.c' || echo '$(srcdir)/'`display.c
|
||||
|
||||
libEngine_a-display.obj: display.c
|
||||
$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libEngine_a_CFLAGS) $(CFLAGS) -MT libEngine_a-display.obj -MD -MP -MF $(DEPDIR)/libEngine_a-display.Tpo -c -o libEngine_a-display.obj `if test -f 'display.c'; then $(CYGPATH_W) 'display.c'; else $(CYGPATH_W) '$(srcdir)/display.c'; fi`
|
||||
$(AM_V_at)$(am__mv) $(DEPDIR)/libEngine_a-display.Tpo $(DEPDIR)/libEngine_a-display.Po
|
||||
# $(AM_V_CC)source='display.c' object='libEngine_a-display.obj' libtool=no \
|
||||
# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
|
||||
# $(AM_V_CC_no)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libEngine_a_CFLAGS) $(CFLAGS) -c -o libEngine_a-display.obj `if test -f 'display.c'; then $(CYGPATH_W) 'display.c'; else $(CYGPATH_W) '$(srcdir)/display.c'; fi`
|
||||
|
||||
libEngine_a-draw.o: draw.c
|
||||
$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libEngine_a_CFLAGS) $(CFLAGS) -MT libEngine_a-draw.o -MD -MP -MF $(DEPDIR)/libEngine_a-draw.Tpo -c -o libEngine_a-draw.o `test -f 'draw.c' || echo '$(srcdir)/'`draw.c
|
||||
$(AM_V_at)$(am__mv) $(DEPDIR)/libEngine_a-draw.Tpo $(DEPDIR)/libEngine_a-draw.Po
|
||||
# $(AM_V_CC)source='draw.c' object='libEngine_a-draw.o' libtool=no \
|
||||
# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
|
||||
# $(AM_V_CC_no)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libEngine_a_CFLAGS) $(CFLAGS) -c -o libEngine_a-draw.o `test -f 'draw.c' || echo '$(srcdir)/'`draw.c
|
||||
|
||||
libEngine_a-draw.obj: draw.c
|
||||
$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libEngine_a_CFLAGS) $(CFLAGS) -MT libEngine_a-draw.obj -MD -MP -MF $(DEPDIR)/libEngine_a-draw.Tpo -c -o libEngine_a-draw.obj `if test -f 'draw.c'; then $(CYGPATH_W) 'draw.c'; else $(CYGPATH_W) '$(srcdir)/draw.c'; fi`
|
||||
$(AM_V_at)$(am__mv) $(DEPDIR)/libEngine_a-draw.Tpo $(DEPDIR)/libEngine_a-draw.Po
|
||||
# $(AM_V_CC)source='draw.c' object='libEngine_a-draw.obj' libtool=no \
|
||||
# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
|
||||
# $(AM_V_CC_no)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libEngine_a_CFLAGS) $(CFLAGS) -c -o libEngine_a-draw.obj `if test -f 'draw.c'; then $(CYGPATH_W) 'draw.c'; else $(CYGPATH_W) '$(srcdir)/draw.c'; fi`
|
||||
|
||||
libEngine_a-dummy_multi.o: dummy_multi.c
|
||||
$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libEngine_a_CFLAGS) $(CFLAGS) -MT libEngine_a-dummy_multi.o -MD -MP -MF $(DEPDIR)/libEngine_a-dummy_multi.Tpo -c -o libEngine_a-dummy_multi.o `test -f 'dummy_multi.c' || echo '$(srcdir)/'`dummy_multi.c
|
||||
$(AM_V_at)$(am__mv) $(DEPDIR)/libEngine_a-dummy_multi.Tpo $(DEPDIR)/libEngine_a-dummy_multi.Po
|
||||
# $(AM_V_CC)source='dummy_multi.c' object='libEngine_a-dummy_multi.o' libtool=no \
|
||||
# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
|
||||
# $(AM_V_CC_no)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libEngine_a_CFLAGS) $(CFLAGS) -c -o libEngine_a-dummy_multi.o `test -f 'dummy_multi.c' || echo '$(srcdir)/'`dummy_multi.c
|
||||
|
||||
libEngine_a-dummy_multi.obj: dummy_multi.c
|
||||
$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libEngine_a_CFLAGS) $(CFLAGS) -MT libEngine_a-dummy_multi.obj -MD -MP -MF $(DEPDIR)/libEngine_a-dummy_multi.Tpo -c -o libEngine_a-dummy_multi.obj `if test -f 'dummy_multi.c'; then $(CYGPATH_W) 'dummy_multi.c'; else $(CYGPATH_W) '$(srcdir)/dummy_multi.c'; fi`
|
||||
$(AM_V_at)$(am__mv) $(DEPDIR)/libEngine_a-dummy_multi.Tpo $(DEPDIR)/libEngine_a-dummy_multi.Po
|
||||
# $(AM_V_CC)source='dummy_multi.c' object='libEngine_a-dummy_multi.obj' libtool=no \
|
||||
# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
|
||||
# $(AM_V_CC_no)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libEngine_a_CFLAGS) $(CFLAGS) -c -o libEngine_a-dummy_multi.obj `if test -f 'dummy_multi.c'; then $(CYGPATH_W) 'dummy_multi.c'; else $(CYGPATH_W) '$(srcdir)/dummy_multi.c'; fi`
|
||||
|
||||
libEngine_a-engine.o: engine.c
|
||||
$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libEngine_a_CFLAGS) $(CFLAGS) -MT libEngine_a-engine.o -MD -MP -MF $(DEPDIR)/libEngine_a-engine.Tpo -c -o libEngine_a-engine.o `test -f 'engine.c' || echo '$(srcdir)/'`engine.c
|
||||
$(AM_V_at)$(am__mv) $(DEPDIR)/libEngine_a-engine.Tpo $(DEPDIR)/libEngine_a-engine.Po
|
||||
# $(AM_V_CC)source='engine.c' object='libEngine_a-engine.o' libtool=no \
|
||||
# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
|
||||
# $(AM_V_CC_no)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libEngine_a_CFLAGS) $(CFLAGS) -c -o libEngine_a-engine.o `test -f 'engine.c' || echo '$(srcdir)/'`engine.c
|
||||
|
||||
libEngine_a-engine.obj: engine.c
|
||||
$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libEngine_a_CFLAGS) $(CFLAGS) -MT libEngine_a-engine.obj -MD -MP -MF $(DEPDIR)/libEngine_a-engine.Tpo -c -o libEngine_a-engine.obj `if test -f 'engine.c'; then $(CYGPATH_W) 'engine.c'; else $(CYGPATH_W) '$(srcdir)/engine.c'; fi`
|
||||
$(AM_V_at)$(am__mv) $(DEPDIR)/libEngine_a-engine.Tpo $(DEPDIR)/libEngine_a-engine.Po
|
||||
# $(AM_V_CC)source='engine.c' object='libEngine_a-engine.obj' libtool=no \
|
||||
# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
|
||||
# $(AM_V_CC_no)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libEngine_a_CFLAGS) $(CFLAGS) -c -o libEngine_a-engine.obj `if test -f 'engine.c'; then $(CYGPATH_W) 'engine.c'; else $(CYGPATH_W) '$(srcdir)/engine.c'; fi`
|
||||
|
||||
libEngine_a-filesystem.o: filesystem.c
|
||||
$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libEngine_a_CFLAGS) $(CFLAGS) -MT libEngine_a-filesystem.o -MD -MP -MF $(DEPDIR)/libEngine_a-filesystem.Tpo -c -o libEngine_a-filesystem.o `test -f 'filesystem.c' || echo '$(srcdir)/'`filesystem.c
|
||||
$(AM_V_at)$(am__mv) $(DEPDIR)/libEngine_a-filesystem.Tpo $(DEPDIR)/libEngine_a-filesystem.Po
|
||||
# $(AM_V_CC)source='filesystem.c' object='libEngine_a-filesystem.o' libtool=no \
|
||||
# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
|
||||
# $(AM_V_CC_no)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libEngine_a_CFLAGS) $(CFLAGS) -c -o libEngine_a-filesystem.o `test -f 'filesystem.c' || echo '$(srcdir)/'`filesystem.c
|
||||
|
||||
libEngine_a-filesystem.obj: filesystem.c
|
||||
$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libEngine_a_CFLAGS) $(CFLAGS) -MT libEngine_a-filesystem.obj -MD -MP -MF $(DEPDIR)/libEngine_a-filesystem.Tpo -c -o libEngine_a-filesystem.obj `if test -f 'filesystem.c'; then $(CYGPATH_W) 'filesystem.c'; else $(CYGPATH_W) '$(srcdir)/filesystem.c'; fi`
|
||||
$(AM_V_at)$(am__mv) $(DEPDIR)/libEngine_a-filesystem.Tpo $(DEPDIR)/libEngine_a-filesystem.Po
|
||||
# $(AM_V_CC)source='filesystem.c' object='libEngine_a-filesystem.obj' libtool=no \
|
||||
# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
|
||||
# $(AM_V_CC_no)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libEngine_a_CFLAGS) $(CFLAGS) -c -o libEngine_a-filesystem.obj `if test -f 'filesystem.c'; then $(CYGPATH_W) 'filesystem.c'; else $(CYGPATH_W) '$(srcdir)/filesystem.c'; fi`
|
||||
|
||||
libEngine_a-fixedPoint_math.o: fixedPoint_math.c
|
||||
$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libEngine_a_CFLAGS) $(CFLAGS) -MT libEngine_a-fixedPoint_math.o -MD -MP -MF $(DEPDIR)/libEngine_a-fixedPoint_math.Tpo -c -o libEngine_a-fixedPoint_math.o `test -f 'fixedPoint_math.c' || echo '$(srcdir)/'`fixedPoint_math.c
|
||||
$(AM_V_at)$(am__mv) $(DEPDIR)/libEngine_a-fixedPoint_math.Tpo $(DEPDIR)/libEngine_a-fixedPoint_math.Po
|
||||
# $(AM_V_CC)source='fixedPoint_math.c' object='libEngine_a-fixedPoint_math.o' libtool=no \
|
||||
# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
|
||||
# $(AM_V_CC_no)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libEngine_a_CFLAGS) $(CFLAGS) -c -o libEngine_a-fixedPoint_math.o `test -f 'fixedPoint_math.c' || echo '$(srcdir)/'`fixedPoint_math.c
|
||||
|
||||
libEngine_a-fixedPoint_math.obj: fixedPoint_math.c
|
||||
$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libEngine_a_CFLAGS) $(CFLAGS) -MT libEngine_a-fixedPoint_math.obj -MD -MP -MF $(DEPDIR)/libEngine_a-fixedPoint_math.Tpo -c -o libEngine_a-fixedPoint_math.obj `if test -f 'fixedPoint_math.c'; then $(CYGPATH_W) 'fixedPoint_math.c'; else $(CYGPATH_W) '$(srcdir)/fixedPoint_math.c'; fi`
|
||||
$(AM_V_at)$(am__mv) $(DEPDIR)/libEngine_a-fixedPoint_math.Tpo $(DEPDIR)/libEngine_a-fixedPoint_math.Po
|
||||
# $(AM_V_CC)source='fixedPoint_math.c' object='libEngine_a-fixedPoint_math.obj' libtool=no \
|
||||
# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
|
||||
# $(AM_V_CC_no)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libEngine_a_CFLAGS) $(CFLAGS) -c -o libEngine_a-fixedPoint_math.obj `if test -f 'fixedPoint_math.c'; then $(CYGPATH_W) 'fixedPoint_math.c'; else $(CYGPATH_W) '$(srcdir)/fixedPoint_math.c'; fi`
|
||||
|
||||
libEngine_a-mmulti.o: mmulti.c
|
||||
$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libEngine_a_CFLAGS) $(CFLAGS) -MT libEngine_a-mmulti.o -MD -MP -MF $(DEPDIR)/libEngine_a-mmulti.Tpo -c -o libEngine_a-mmulti.o `test -f 'mmulti.c' || echo '$(srcdir)/'`mmulti.c
|
||||
$(AM_V_at)$(am__mv) $(DEPDIR)/libEngine_a-mmulti.Tpo $(DEPDIR)/libEngine_a-mmulti.Po
|
||||
# $(AM_V_CC)source='mmulti.c' object='libEngine_a-mmulti.o' libtool=no \
|
||||
# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
|
||||
# $(AM_V_CC_no)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libEngine_a_CFLAGS) $(CFLAGS) -c -o libEngine_a-mmulti.o `test -f 'mmulti.c' || echo '$(srcdir)/'`mmulti.c
|
||||
|
||||
libEngine_a-mmulti.obj: mmulti.c
|
||||
$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libEngine_a_CFLAGS) $(CFLAGS) -MT libEngine_a-mmulti.obj -MD -MP -MF $(DEPDIR)/libEngine_a-mmulti.Tpo -c -o libEngine_a-mmulti.obj `if test -f 'mmulti.c'; then $(CYGPATH_W) 'mmulti.c'; else $(CYGPATH_W) '$(srcdir)/mmulti.c'; fi`
|
||||
$(AM_V_at)$(am__mv) $(DEPDIR)/libEngine_a-mmulti.Tpo $(DEPDIR)/libEngine_a-mmulti.Po
|
||||
# $(AM_V_CC)source='mmulti.c' object='libEngine_a-mmulti.obj' libtool=no \
|
||||
# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
|
||||
# $(AM_V_CC_no)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libEngine_a_CFLAGS) $(CFLAGS) -c -o libEngine_a-mmulti.obj `if test -f 'mmulti.c'; then $(CYGPATH_W) 'mmulti.c'; else $(CYGPATH_W) '$(srcdir)/mmulti.c'; fi`
|
||||
|
||||
libEngine_a-network.o: network.c
|
||||
$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libEngine_a_CFLAGS) $(CFLAGS) -MT libEngine_a-network.o -MD -MP -MF $(DEPDIR)/libEngine_a-network.Tpo -c -o libEngine_a-network.o `test -f 'network.c' || echo '$(srcdir)/'`network.c
|
||||
$(AM_V_at)$(am__mv) $(DEPDIR)/libEngine_a-network.Tpo $(DEPDIR)/libEngine_a-network.Po
|
||||
# $(AM_V_CC)source='network.c' object='libEngine_a-network.o' libtool=no \
|
||||
# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
|
||||
# $(AM_V_CC_no)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libEngine_a_CFLAGS) $(CFLAGS) -c -o libEngine_a-network.o `test -f 'network.c' || echo '$(srcdir)/'`network.c
|
||||
|
||||
libEngine_a-network.obj: network.c
|
||||
$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libEngine_a_CFLAGS) $(CFLAGS) -MT libEngine_a-network.obj -MD -MP -MF $(DEPDIR)/libEngine_a-network.Tpo -c -o libEngine_a-network.obj `if test -f 'network.c'; then $(CYGPATH_W) 'network.c'; else $(CYGPATH_W) '$(srcdir)/network.c'; fi`
|
||||
$(AM_V_at)$(am__mv) $(DEPDIR)/libEngine_a-network.Tpo $(DEPDIR)/libEngine_a-network.Po
|
||||
# $(AM_V_CC)source='network.c' object='libEngine_a-network.obj' libtool=no \
|
||||
# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
|
||||
# $(AM_V_CC_no)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libEngine_a_CFLAGS) $(CFLAGS) -c -o libEngine_a-network.obj `if test -f 'network.c'; then $(CYGPATH_W) 'network.c'; else $(CYGPATH_W) '$(srcdir)/network.c'; fi`
|
||||
|
||||
libEngine_a-tiles.o: tiles.c
|
||||
$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libEngine_a_CFLAGS) $(CFLAGS) -MT libEngine_a-tiles.o -MD -MP -MF $(DEPDIR)/libEngine_a-tiles.Tpo -c -o libEngine_a-tiles.o `test -f 'tiles.c' || echo '$(srcdir)/'`tiles.c
|
||||
$(AM_V_at)$(am__mv) $(DEPDIR)/libEngine_a-tiles.Tpo $(DEPDIR)/libEngine_a-tiles.Po
|
||||
# $(AM_V_CC)source='tiles.c' object='libEngine_a-tiles.o' libtool=no \
|
||||
# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
|
||||
# $(AM_V_CC_no)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libEngine_a_CFLAGS) $(CFLAGS) -c -o libEngine_a-tiles.o `test -f 'tiles.c' || echo '$(srcdir)/'`tiles.c
|
||||
|
||||
libEngine_a-tiles.obj: tiles.c
|
||||
$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libEngine_a_CFLAGS) $(CFLAGS) -MT libEngine_a-tiles.obj -MD -MP -MF $(DEPDIR)/libEngine_a-tiles.Tpo -c -o libEngine_a-tiles.obj `if test -f 'tiles.c'; then $(CYGPATH_W) 'tiles.c'; else $(CYGPATH_W) '$(srcdir)/tiles.c'; fi`
|
||||
$(AM_V_at)$(am__mv) $(DEPDIR)/libEngine_a-tiles.Tpo $(DEPDIR)/libEngine_a-tiles.Po
|
||||
# $(AM_V_CC)source='tiles.c' object='libEngine_a-tiles.obj' libtool=no \
|
||||
# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
|
||||
# $(AM_V_CC_no)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libEngine_a_CFLAGS) $(CFLAGS) -c -o libEngine_a-tiles.obj `if test -f 'tiles.c'; then $(CYGPATH_W) 'tiles.c'; else $(CYGPATH_W) '$(srcdir)/tiles.c'; fi`
|
||||
|
||||
ID: $(am__tagged_files)
|
||||
$(am__define_uniq_tagged_files); mkid -fID $$unique
|
||||
tags: tags-am
|
||||
TAGS: tags
|
||||
|
||||
tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
|
||||
set x; \
|
||||
here=`pwd`; \
|
||||
$(am__define_uniq_tagged_files); \
|
||||
shift; \
|
||||
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
|
||||
test -n "$$unique" || unique=$$empty_fix; \
|
||||
if test $$# -gt 0; then \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
"$$@" $$unique; \
|
||||
else \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
$$unique; \
|
||||
fi; \
|
||||
fi
|
||||
ctags: ctags-am
|
||||
|
||||
CTAGS: ctags
|
||||
ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
|
||||
$(am__define_uniq_tagged_files); \
|
||||
test -z "$(CTAGS_ARGS)$$unique" \
|
||||
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
|
||||
$$unique
|
||||
|
||||
GTAGS:
|
||||
here=`$(am__cd) $(top_builddir) && pwd` \
|
||||
&& $(am__cd) $(top_srcdir) \
|
||||
&& gtags -i $(GTAGS_ARGS) "$$here"
|
||||
cscopelist: cscopelist-am
|
||||
|
||||
cscopelist-am: $(am__tagged_files)
|
||||
list='$(am__tagged_files)'; \
|
||||
case "$(srcdir)" in \
|
||||
[\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
|
||||
*) sdir=$(subdir)/$(srcdir) ;; \
|
||||
esac; \
|
||||
for i in $$list; do \
|
||||
if test -f "$$i"; then \
|
||||
echo "$(subdir)/$$i"; \
|
||||
else \
|
||||
echo "$$sdir/$$i"; \
|
||||
fi; \
|
||||
done >> $(top_builddir)/cscope.files
|
||||
|
||||
distclean-tags:
|
||||
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
list='$(DISTFILES)'; \
|
||||
dist_files=`for file in $$list; do echo $$file; done | \
|
||||
sed -e "s|^$$srcdirstrip/||;t" \
|
||||
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
|
||||
case $$dist_files in \
|
||||
*/*) $(MKDIR_P) `echo "$$dist_files" | \
|
||||
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
|
||||
sort -u` ;; \
|
||||
esac; \
|
||||
for file in $$dist_files; do \
|
||||
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
|
||||
if test -d $$d/$$file; then \
|
||||
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
|
||||
if test -d "$(distdir)/$$file"; then \
|
||||
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
|
||||
fi; \
|
||||
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
|
||||
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
|
||||
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
|
||||
fi; \
|
||||
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
|
||||
else \
|
||||
test -f "$(distdir)/$$file" \
|
||||
|| cp -p $$d/$$file "$(distdir)/$$file" \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
check-am: all-am
|
||||
check: check-am
|
||||
all-am: Makefile $(LIBRARIES)
|
||||
installdirs:
|
||||
install: install-am
|
||||
install-exec: install-exec-am
|
||||
install-data: install-data-am
|
||||
uninstall: uninstall-am
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
|
||||
installcheck: installcheck-am
|
||||
install-strip:
|
||||
if test -z '$(STRIP)'; then \
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
install; \
|
||||
else \
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
|
||||
fi
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
|
||||
distclean-generic:
|
||||
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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-am
|
||||
|
||||
clean-am: clean-generic clean-noinstLIBRARIES mostlyclean-am
|
||||
|
||||
distclean: distclean-am
|
||||
-rm -rf ./$(DEPDIR)
|
||||
-rm -f Makefile
|
||||
distclean-am: clean-am distclean-compile distclean-generic \
|
||||
distclean-tags
|
||||
|
||||
dvi: dvi-am
|
||||
|
||||
dvi-am:
|
||||
|
||||
html: html-am
|
||||
|
||||
html-am:
|
||||
|
||||
info: info-am
|
||||
|
||||
info-am:
|
||||
|
||||
install-data-am:
|
||||
|
||||
install-dvi: install-dvi-am
|
||||
|
||||
install-dvi-am:
|
||||
|
||||
install-exec-am:
|
||||
|
||||
install-html: install-html-am
|
||||
|
||||
install-html-am:
|
||||
|
||||
install-info: install-info-am
|
||||
|
||||
install-info-am:
|
||||
|
||||
install-man:
|
||||
|
||||
install-pdf: install-pdf-am
|
||||
|
||||
install-pdf-am:
|
||||
|
||||
install-ps: install-ps-am
|
||||
|
||||
install-ps-am:
|
||||
|
||||
installcheck-am:
|
||||
|
||||
maintainer-clean: maintainer-clean-am
|
||||
-rm -rf ./$(DEPDIR)
|
||||
-rm -f Makefile
|
||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
||||
|
||||
mostlyclean: mostlyclean-am
|
||||
|
||||
mostlyclean-am: mostlyclean-compile mostlyclean-generic
|
||||
|
||||
pdf: pdf-am
|
||||
|
||||
pdf-am:
|
||||
|
||||
ps: ps-am
|
||||
|
||||
ps-am:
|
||||
|
||||
uninstall-am:
|
||||
|
||||
.MAKE: install-am install-strip
|
||||
|
||||
.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \
|
||||
clean-noinstLIBRARIES cscopelist-am ctags ctags-am distclean \
|
||||
distclean-compile distclean-generic distclean-tags distdir dvi \
|
||||
dvi-am html html-am info info-am install install-am \
|
||||
install-data install-data-am install-dvi install-dvi-am \
|
||||
install-exec install-exec-am install-html install-html-am \
|
||||
install-info install-info-am install-man install-pdf \
|
||||
install-pdf-am install-ps install-ps-am install-strip \
|
||||
installcheck installcheck-am installdirs maintainer-clean \
|
||||
maintainer-clean-generic mostlyclean mostlyclean-compile \
|
||||
mostlyclean-generic pdf pdf-am ps ps-am tags tags-am uninstall \
|
||||
uninstall-am
|
||||
|
||||
.PRECIOUS: Makefile
|
||||
|
||||
|
||||
# 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:
|
||||
3
apps/plugins/sdl/progs/duke3d/Engine/src/Makefile.am
Normal file
3
apps/plugins/sdl/progs/duke3d/Engine/src/Makefile.am
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
noinst_LIBRARIES = libEngine.a
|
||||
libEngine_a_SOURCES = cache.c display.c draw.c dummy_multi.c engine.c filesystem.c fixedPoint_math.c mmulti.c network.c tiles.c
|
||||
libEngine_a_CFLAGS = -I$(top_srcdir)/Game/src
|
||||
693
apps/plugins/sdl/progs/duke3d/Engine/src/Makefile.in
Normal file
693
apps/plugins/sdl/progs/duke3d/Engine/src/Makefile.in
Normal file
|
|
@ -0,0 +1,693 @@
|
|||
# Makefile.in generated by automake 1.15.1 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994-2017 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@
|
||||
|
||||
VPATH = @srcdir@
|
||||
am__is_gnu_make = { \
|
||||
if test -z '$(MAKELEVEL)'; then \
|
||||
false; \
|
||||
elif test -n '$(MAKE_HOST)'; then \
|
||||
true; \
|
||||
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
|
||||
true; \
|
||||
else \
|
||||
false; \
|
||||
fi; \
|
||||
}
|
||||
am__make_running_with_option = \
|
||||
case $${target_option-} in \
|
||||
?) ;; \
|
||||
*) echo "am__make_running_with_option: internal error: invalid" \
|
||||
"target option '$${target_option-}' specified" >&2; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
has_opt=no; \
|
||||
sane_makeflags=$$MAKEFLAGS; \
|
||||
if $(am__is_gnu_make); then \
|
||||
sane_makeflags=$$MFLAGS; \
|
||||
else \
|
||||
case $$MAKEFLAGS in \
|
||||
*\\[\ \ ]*) \
|
||||
bs=\\; \
|
||||
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
|
||||
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
|
||||
esac; \
|
||||
fi; \
|
||||
skip_next=no; \
|
||||
strip_trailopt () \
|
||||
{ \
|
||||
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
|
||||
}; \
|
||||
for flg in $$sane_makeflags; do \
|
||||
test $$skip_next = yes && { skip_next=no; continue; }; \
|
||||
case $$flg in \
|
||||
*=*|--*) continue;; \
|
||||
-*I) strip_trailopt 'I'; skip_next=yes;; \
|
||||
-*I?*) strip_trailopt 'I';; \
|
||||
-*O) strip_trailopt 'O'; skip_next=yes;; \
|
||||
-*O?*) strip_trailopt 'O';; \
|
||||
-*l) strip_trailopt 'l'; skip_next=yes;; \
|
||||
-*l?*) strip_trailopt 'l';; \
|
||||
-[dEDm]) skip_next=yes;; \
|
||||
-[JT]) skip_next=yes;; \
|
||||
esac; \
|
||||
case $$flg in \
|
||||
*$$target_option*) has_opt=yes; break;; \
|
||||
esac; \
|
||||
done; \
|
||||
test $$has_opt = yes
|
||||
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
|
||||
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkglibexecdir = $(libexecdir)/@PACKAGE@
|
||||
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
||||
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 = :
|
||||
subdir = Engine/src
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
|
||||
mkinstalldirs = $(install_sh) -d
|
||||
CONFIG_CLEAN_FILES =
|
||||
CONFIG_CLEAN_VPATH_FILES =
|
||||
LIBRARIES = $(noinst_LIBRARIES)
|
||||
AR = ar
|
||||
ARFLAGS = cru
|
||||
AM_V_AR = $(am__v_AR_@AM_V@)
|
||||
am__v_AR_ = $(am__v_AR_@AM_DEFAULT_V@)
|
||||
am__v_AR_0 = @echo " AR " $@;
|
||||
am__v_AR_1 =
|
||||
libEngine_a_AR = $(AR) $(ARFLAGS)
|
||||
libEngine_a_LIBADD =
|
||||
am_libEngine_a_OBJECTS = libEngine_a-cache.$(OBJEXT) \
|
||||
libEngine_a-display.$(OBJEXT) libEngine_a-draw.$(OBJEXT) \
|
||||
libEngine_a-dummy_multi.$(OBJEXT) libEngine_a-engine.$(OBJEXT) \
|
||||
libEngine_a-filesystem.$(OBJEXT) \
|
||||
libEngine_a-fixedPoint_math.$(OBJEXT) \
|
||||
libEngine_a-mmulti.$(OBJEXT) libEngine_a-network.$(OBJEXT) \
|
||||
libEngine_a-tiles.$(OBJEXT)
|
||||
libEngine_a_OBJECTS = $(am_libEngine_a_OBJECTS)
|
||||
AM_V_P = $(am__v_P_@AM_V@)
|
||||
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
|
||||
am__v_P_0 = false
|
||||
am__v_P_1 = :
|
||||
AM_V_GEN = $(am__v_GEN_@AM_V@)
|
||||
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
|
||||
am__v_GEN_0 = @echo " GEN " $@;
|
||||
am__v_GEN_1 =
|
||||
AM_V_at = $(am__v_at_@AM_V@)
|
||||
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
|
||||
am__v_at_0 = @
|
||||
am__v_at_1 =
|
||||
DEFAULT_INCLUDES = -I.@am__isrc@
|
||||
depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp
|
||||
am__depfiles_maybe = depfiles
|
||||
am__mv = mv -f
|
||||
AM_V_lt = $(am__v_lt_@AM_V@)
|
||||
am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
|
||||
am__v_lt_0 = --silent
|
||||
am__v_lt_1 =
|
||||
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
|
||||
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
|
||||
AM_V_CC = $(am__v_CC_@AM_V@)
|
||||
am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
|
||||
am__v_CC_0 = @echo " CC " $@;
|
||||
am__v_CC_1 =
|
||||
CCLD = $(CC)
|
||||
LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
|
||||
AM_V_CCLD = $(am__v_CCLD_@AM_V@)
|
||||
am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
|
||||
am__v_CCLD_0 = @echo " CCLD " $@;
|
||||
am__v_CCLD_1 =
|
||||
SOURCES = $(libEngine_a_SOURCES)
|
||||
DIST_SOURCES = $(libEngine_a_SOURCES)
|
||||
am__can_run_installinfo = \
|
||||
case $$AM_UPDATE_INFO_DIR in \
|
||||
n|no|NO) false;; \
|
||||
*) (install-info --version) >/dev/null 2>&1;; \
|
||||
esac
|
||||
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
|
||||
# Read a list of newline-separated strings from the standard input,
|
||||
# and print each of them once, without duplicates. Input order is
|
||||
# *not* preserved.
|
||||
am__uniquify_input = $(AWK) '\
|
||||
BEGIN { nonempty = 0; } \
|
||||
{ items[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in items) print i; }; } \
|
||||
'
|
||||
# Make sure the list of sources is unique. This is necessary because,
|
||||
# e.g., the same source file might be shared among _SOURCES variables
|
||||
# for different programs/libraries.
|
||||
am__define_uniq_tagged_files = \
|
||||
list='$(am__tagged_files)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | $(am__uniquify_input)`
|
||||
ETAGS = etags
|
||||
CTAGS = ctags
|
||||
am__DIST_COMMON = $(srcdir)/Makefile.in \
|
||||
$(top_srcdir)/build-aux/depcomp
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AMTAR = @AMTAR@
|
||||
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AWK = @AWK@
|
||||
CC = @CC@
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
ECHO_C = @ECHO_C@
|
||||
ECHO_N = @ECHO_N@
|
||||
ECHO_T = @ECHO_T@
|
||||
EGREP = @EGREP@
|
||||
EXEEXT = @EXEEXT@
|
||||
GREP = @GREP@
|
||||
INSTALL = @INSTALL@
|
||||
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@
|
||||
MKDIR_P = @MKDIR_P@
|
||||
OBJEXT = @OBJEXT@
|
||||
PACKAGE = @PACKAGE@
|
||||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
||||
PACKAGE_NAME = @PACKAGE_NAME@
|
||||
PACKAGE_STRING = @PACKAGE_STRING@
|
||||
PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
||||
PACKAGE_URL = @PACKAGE_URL@
|
||||
PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||
PKG_CONFIG = @PKG_CONFIG@
|
||||
PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
|
||||
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
|
||||
RANLIB = @RANLIB@
|
||||
SDL_CFLAGS = @SDL_CFLAGS@
|
||||
SDL_LIBS = @SDL_LIBS@
|
||||
SDL_MIXER_CFLAGS = @SDL_MIXER_CFLAGS@
|
||||
SDL_MIXER_LIBS = @SDL_MIXER_LIBS@
|
||||
SET_MAKE = @SET_MAKE@
|
||||
SHELL = @SHELL@
|
||||
STRIP = @STRIP@
|
||||
VERSION = @VERSION@
|
||||
WINDRES = @WINDRES@
|
||||
abs_builddir = @abs_builddir@
|
||||
abs_srcdir = @abs_srcdir@
|
||||
abs_top_builddir = @abs_top_builddir@
|
||||
abs_top_srcdir = @abs_top_srcdir@
|
||||
ac_ct_CC = @ac_ct_CC@
|
||||
am__include = @am__include@
|
||||
am__leading_dot = @am__leading_dot@
|
||||
am__quote = @am__quote@
|
||||
am__tar = @am__tar@
|
||||
am__untar = @am__untar@
|
||||
bindir = @bindir@
|
||||
build_alias = @build_alias@
|
||||
builddir = @builddir@
|
||||
datadir = @datadir@
|
||||
datarootdir = @datarootdir@
|
||||
docdir = @docdir@
|
||||
dvidir = @dvidir@
|
||||
exec_prefix = @exec_prefix@
|
||||
host_alias = @host_alias@
|
||||
htmldir = @htmldir@
|
||||
includedir = @includedir@
|
||||
infodir = @infodir@
|
||||
install_sh = @install_sh@
|
||||
libdir = @libdir@
|
||||
libexecdir = @libexecdir@
|
||||
localedir = @localedir@
|
||||
localstatedir = @localstatedir@
|
||||
mandir = @mandir@
|
||||
mkdir_p = @mkdir_p@
|
||||
oldincludedir = @oldincludedir@
|
||||
pdfdir = @pdfdir@
|
||||
prefix = @prefix@
|
||||
program_transform_name = @program_transform_name@
|
||||
psdir = @psdir@
|
||||
sbindir = @sbindir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
srcdir = @srcdir@
|
||||
sysconfdir = @sysconfdir@
|
||||
target_alias = @target_alias@
|
||||
top_build_prefix = @top_build_prefix@
|
||||
top_builddir = @top_builddir@
|
||||
top_srcdir = @top_srcdir@
|
||||
noinst_LIBRARIES = libEngine.a
|
||||
libEngine_a_SOURCES = cache.c display.c draw.c dummy_multi.c engine.c filesystem.c fixedPoint_math.c mmulti.c network.c tiles.c
|
||||
libEngine_a_CFLAGS = -I$(top_srcdir)/Game/src
|
||||
all: all-am
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .c .o .obj
|
||||
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
|
||||
@for dep in $?; do \
|
||||
case '$(am__configure_deps)' in \
|
||||
*$$dep*) \
|
||||
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
|
||||
&& { if test -f $@; then exit 0; else break; fi; }; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
done; \
|
||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Engine/src/Makefile'; \
|
||||
$(am__cd) $(top_srcdir) && \
|
||||
$(AUTOMAKE) --foreign Engine/src/Makefile
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
@case '$?' in \
|
||||
*config.status*) \
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
|
||||
*) \
|
||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
|
||||
esac;
|
||||
|
||||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
|
||||
$(top_srcdir)/configure: $(am__configure_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(am__aclocal_m4_deps):
|
||||
|
||||
clean-noinstLIBRARIES:
|
||||
-test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
|
||||
|
||||
libEngine.a: $(libEngine_a_OBJECTS) $(libEngine_a_DEPENDENCIES) $(EXTRA_libEngine_a_DEPENDENCIES)
|
||||
$(AM_V_at)-rm -f libEngine.a
|
||||
$(AM_V_AR)$(libEngine_a_AR) libEngine.a $(libEngine_a_OBJECTS) $(libEngine_a_LIBADD)
|
||||
$(AM_V_at)$(RANLIB) libEngine.a
|
||||
|
||||
mostlyclean-compile:
|
||||
-rm -f *.$(OBJEXT)
|
||||
|
||||
distclean-compile:
|
||||
-rm -f *.tab.c
|
||||
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libEngine_a-cache.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libEngine_a-display.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libEngine_a-draw.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libEngine_a-dummy_multi.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libEngine_a-engine.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libEngine_a-filesystem.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libEngine_a-fixedPoint_math.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libEngine_a-mmulti.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libEngine_a-network.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libEngine_a-tiles.Po@am__quote@
|
||||
|
||||
.c.o:
|
||||
@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
|
||||
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
|
||||
|
||||
.c.obj:
|
||||
@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
|
||||
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
|
||||
|
||||
libEngine_a-cache.o: cache.c
|
||||
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libEngine_a_CFLAGS) $(CFLAGS) -MT libEngine_a-cache.o -MD -MP -MF $(DEPDIR)/libEngine_a-cache.Tpo -c -o libEngine_a-cache.o `test -f 'cache.c' || echo '$(srcdir)/'`cache.c
|
||||
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libEngine_a-cache.Tpo $(DEPDIR)/libEngine_a-cache.Po
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='cache.c' object='libEngine_a-cache.o' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libEngine_a_CFLAGS) $(CFLAGS) -c -o libEngine_a-cache.o `test -f 'cache.c' || echo '$(srcdir)/'`cache.c
|
||||
|
||||
libEngine_a-cache.obj: cache.c
|
||||
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libEngine_a_CFLAGS) $(CFLAGS) -MT libEngine_a-cache.obj -MD -MP -MF $(DEPDIR)/libEngine_a-cache.Tpo -c -o libEngine_a-cache.obj `if test -f 'cache.c'; then $(CYGPATH_W) 'cache.c'; else $(CYGPATH_W) '$(srcdir)/cache.c'; fi`
|
||||
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libEngine_a-cache.Tpo $(DEPDIR)/libEngine_a-cache.Po
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='cache.c' object='libEngine_a-cache.obj' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libEngine_a_CFLAGS) $(CFLAGS) -c -o libEngine_a-cache.obj `if test -f 'cache.c'; then $(CYGPATH_W) 'cache.c'; else $(CYGPATH_W) '$(srcdir)/cache.c'; fi`
|
||||
|
||||
libEngine_a-display.o: display.c
|
||||
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libEngine_a_CFLAGS) $(CFLAGS) -MT libEngine_a-display.o -MD -MP -MF $(DEPDIR)/libEngine_a-display.Tpo -c -o libEngine_a-display.o `test -f 'display.c' || echo '$(srcdir)/'`display.c
|
||||
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libEngine_a-display.Tpo $(DEPDIR)/libEngine_a-display.Po
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='display.c' object='libEngine_a-display.o' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libEngine_a_CFLAGS) $(CFLAGS) -c -o libEngine_a-display.o `test -f 'display.c' || echo '$(srcdir)/'`display.c
|
||||
|
||||
libEngine_a-display.obj: display.c
|
||||
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libEngine_a_CFLAGS) $(CFLAGS) -MT libEngine_a-display.obj -MD -MP -MF $(DEPDIR)/libEngine_a-display.Tpo -c -o libEngine_a-display.obj `if test -f 'display.c'; then $(CYGPATH_W) 'display.c'; else $(CYGPATH_W) '$(srcdir)/display.c'; fi`
|
||||
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libEngine_a-display.Tpo $(DEPDIR)/libEngine_a-display.Po
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='display.c' object='libEngine_a-display.obj' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libEngine_a_CFLAGS) $(CFLAGS) -c -o libEngine_a-display.obj `if test -f 'display.c'; then $(CYGPATH_W) 'display.c'; else $(CYGPATH_W) '$(srcdir)/display.c'; fi`
|
||||
|
||||
libEngine_a-draw.o: draw.c
|
||||
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libEngine_a_CFLAGS) $(CFLAGS) -MT libEngine_a-draw.o -MD -MP -MF $(DEPDIR)/libEngine_a-draw.Tpo -c -o libEngine_a-draw.o `test -f 'draw.c' || echo '$(srcdir)/'`draw.c
|
||||
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libEngine_a-draw.Tpo $(DEPDIR)/libEngine_a-draw.Po
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='draw.c' object='libEngine_a-draw.o' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libEngine_a_CFLAGS) $(CFLAGS) -c -o libEngine_a-draw.o `test -f 'draw.c' || echo '$(srcdir)/'`draw.c
|
||||
|
||||
libEngine_a-draw.obj: draw.c
|
||||
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libEngine_a_CFLAGS) $(CFLAGS) -MT libEngine_a-draw.obj -MD -MP -MF $(DEPDIR)/libEngine_a-draw.Tpo -c -o libEngine_a-draw.obj `if test -f 'draw.c'; then $(CYGPATH_W) 'draw.c'; else $(CYGPATH_W) '$(srcdir)/draw.c'; fi`
|
||||
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libEngine_a-draw.Tpo $(DEPDIR)/libEngine_a-draw.Po
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='draw.c' object='libEngine_a-draw.obj' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libEngine_a_CFLAGS) $(CFLAGS) -c -o libEngine_a-draw.obj `if test -f 'draw.c'; then $(CYGPATH_W) 'draw.c'; else $(CYGPATH_W) '$(srcdir)/draw.c'; fi`
|
||||
|
||||
libEngine_a-dummy_multi.o: dummy_multi.c
|
||||
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libEngine_a_CFLAGS) $(CFLAGS) -MT libEngine_a-dummy_multi.o -MD -MP -MF $(DEPDIR)/libEngine_a-dummy_multi.Tpo -c -o libEngine_a-dummy_multi.o `test -f 'dummy_multi.c' || echo '$(srcdir)/'`dummy_multi.c
|
||||
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libEngine_a-dummy_multi.Tpo $(DEPDIR)/libEngine_a-dummy_multi.Po
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dummy_multi.c' object='libEngine_a-dummy_multi.o' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libEngine_a_CFLAGS) $(CFLAGS) -c -o libEngine_a-dummy_multi.o `test -f 'dummy_multi.c' || echo '$(srcdir)/'`dummy_multi.c
|
||||
|
||||
libEngine_a-dummy_multi.obj: dummy_multi.c
|
||||
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libEngine_a_CFLAGS) $(CFLAGS) -MT libEngine_a-dummy_multi.obj -MD -MP -MF $(DEPDIR)/libEngine_a-dummy_multi.Tpo -c -o libEngine_a-dummy_multi.obj `if test -f 'dummy_multi.c'; then $(CYGPATH_W) 'dummy_multi.c'; else $(CYGPATH_W) '$(srcdir)/dummy_multi.c'; fi`
|
||||
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libEngine_a-dummy_multi.Tpo $(DEPDIR)/libEngine_a-dummy_multi.Po
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dummy_multi.c' object='libEngine_a-dummy_multi.obj' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libEngine_a_CFLAGS) $(CFLAGS) -c -o libEngine_a-dummy_multi.obj `if test -f 'dummy_multi.c'; then $(CYGPATH_W) 'dummy_multi.c'; else $(CYGPATH_W) '$(srcdir)/dummy_multi.c'; fi`
|
||||
|
||||
libEngine_a-engine.o: engine.c
|
||||
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libEngine_a_CFLAGS) $(CFLAGS) -MT libEngine_a-engine.o -MD -MP -MF $(DEPDIR)/libEngine_a-engine.Tpo -c -o libEngine_a-engine.o `test -f 'engine.c' || echo '$(srcdir)/'`engine.c
|
||||
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libEngine_a-engine.Tpo $(DEPDIR)/libEngine_a-engine.Po
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='engine.c' object='libEngine_a-engine.o' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libEngine_a_CFLAGS) $(CFLAGS) -c -o libEngine_a-engine.o `test -f 'engine.c' || echo '$(srcdir)/'`engine.c
|
||||
|
||||
libEngine_a-engine.obj: engine.c
|
||||
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libEngine_a_CFLAGS) $(CFLAGS) -MT libEngine_a-engine.obj -MD -MP -MF $(DEPDIR)/libEngine_a-engine.Tpo -c -o libEngine_a-engine.obj `if test -f 'engine.c'; then $(CYGPATH_W) 'engine.c'; else $(CYGPATH_W) '$(srcdir)/engine.c'; fi`
|
||||
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libEngine_a-engine.Tpo $(DEPDIR)/libEngine_a-engine.Po
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='engine.c' object='libEngine_a-engine.obj' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libEngine_a_CFLAGS) $(CFLAGS) -c -o libEngine_a-engine.obj `if test -f 'engine.c'; then $(CYGPATH_W) 'engine.c'; else $(CYGPATH_W) '$(srcdir)/engine.c'; fi`
|
||||
|
||||
libEngine_a-filesystem.o: filesystem.c
|
||||
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libEngine_a_CFLAGS) $(CFLAGS) -MT libEngine_a-filesystem.o -MD -MP -MF $(DEPDIR)/libEngine_a-filesystem.Tpo -c -o libEngine_a-filesystem.o `test -f 'filesystem.c' || echo '$(srcdir)/'`filesystem.c
|
||||
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libEngine_a-filesystem.Tpo $(DEPDIR)/libEngine_a-filesystem.Po
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='filesystem.c' object='libEngine_a-filesystem.o' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libEngine_a_CFLAGS) $(CFLAGS) -c -o libEngine_a-filesystem.o `test -f 'filesystem.c' || echo '$(srcdir)/'`filesystem.c
|
||||
|
||||
libEngine_a-filesystem.obj: filesystem.c
|
||||
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libEngine_a_CFLAGS) $(CFLAGS) -MT libEngine_a-filesystem.obj -MD -MP -MF $(DEPDIR)/libEngine_a-filesystem.Tpo -c -o libEngine_a-filesystem.obj `if test -f 'filesystem.c'; then $(CYGPATH_W) 'filesystem.c'; else $(CYGPATH_W) '$(srcdir)/filesystem.c'; fi`
|
||||
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libEngine_a-filesystem.Tpo $(DEPDIR)/libEngine_a-filesystem.Po
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='filesystem.c' object='libEngine_a-filesystem.obj' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libEngine_a_CFLAGS) $(CFLAGS) -c -o libEngine_a-filesystem.obj `if test -f 'filesystem.c'; then $(CYGPATH_W) 'filesystem.c'; else $(CYGPATH_W) '$(srcdir)/filesystem.c'; fi`
|
||||
|
||||
libEngine_a-fixedPoint_math.o: fixedPoint_math.c
|
||||
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libEngine_a_CFLAGS) $(CFLAGS) -MT libEngine_a-fixedPoint_math.o -MD -MP -MF $(DEPDIR)/libEngine_a-fixedPoint_math.Tpo -c -o libEngine_a-fixedPoint_math.o `test -f 'fixedPoint_math.c' || echo '$(srcdir)/'`fixedPoint_math.c
|
||||
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libEngine_a-fixedPoint_math.Tpo $(DEPDIR)/libEngine_a-fixedPoint_math.Po
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fixedPoint_math.c' object='libEngine_a-fixedPoint_math.o' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libEngine_a_CFLAGS) $(CFLAGS) -c -o libEngine_a-fixedPoint_math.o `test -f 'fixedPoint_math.c' || echo '$(srcdir)/'`fixedPoint_math.c
|
||||
|
||||
libEngine_a-fixedPoint_math.obj: fixedPoint_math.c
|
||||
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libEngine_a_CFLAGS) $(CFLAGS) -MT libEngine_a-fixedPoint_math.obj -MD -MP -MF $(DEPDIR)/libEngine_a-fixedPoint_math.Tpo -c -o libEngine_a-fixedPoint_math.obj `if test -f 'fixedPoint_math.c'; then $(CYGPATH_W) 'fixedPoint_math.c'; else $(CYGPATH_W) '$(srcdir)/fixedPoint_math.c'; fi`
|
||||
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libEngine_a-fixedPoint_math.Tpo $(DEPDIR)/libEngine_a-fixedPoint_math.Po
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fixedPoint_math.c' object='libEngine_a-fixedPoint_math.obj' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libEngine_a_CFLAGS) $(CFLAGS) -c -o libEngine_a-fixedPoint_math.obj `if test -f 'fixedPoint_math.c'; then $(CYGPATH_W) 'fixedPoint_math.c'; else $(CYGPATH_W) '$(srcdir)/fixedPoint_math.c'; fi`
|
||||
|
||||
libEngine_a-mmulti.o: mmulti.c
|
||||
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libEngine_a_CFLAGS) $(CFLAGS) -MT libEngine_a-mmulti.o -MD -MP -MF $(DEPDIR)/libEngine_a-mmulti.Tpo -c -o libEngine_a-mmulti.o `test -f 'mmulti.c' || echo '$(srcdir)/'`mmulti.c
|
||||
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libEngine_a-mmulti.Tpo $(DEPDIR)/libEngine_a-mmulti.Po
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mmulti.c' object='libEngine_a-mmulti.o' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libEngine_a_CFLAGS) $(CFLAGS) -c -o libEngine_a-mmulti.o `test -f 'mmulti.c' || echo '$(srcdir)/'`mmulti.c
|
||||
|
||||
libEngine_a-mmulti.obj: mmulti.c
|
||||
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libEngine_a_CFLAGS) $(CFLAGS) -MT libEngine_a-mmulti.obj -MD -MP -MF $(DEPDIR)/libEngine_a-mmulti.Tpo -c -o libEngine_a-mmulti.obj `if test -f 'mmulti.c'; then $(CYGPATH_W) 'mmulti.c'; else $(CYGPATH_W) '$(srcdir)/mmulti.c'; fi`
|
||||
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libEngine_a-mmulti.Tpo $(DEPDIR)/libEngine_a-mmulti.Po
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mmulti.c' object='libEngine_a-mmulti.obj' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libEngine_a_CFLAGS) $(CFLAGS) -c -o libEngine_a-mmulti.obj `if test -f 'mmulti.c'; then $(CYGPATH_W) 'mmulti.c'; else $(CYGPATH_W) '$(srcdir)/mmulti.c'; fi`
|
||||
|
||||
libEngine_a-network.o: network.c
|
||||
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libEngine_a_CFLAGS) $(CFLAGS) -MT libEngine_a-network.o -MD -MP -MF $(DEPDIR)/libEngine_a-network.Tpo -c -o libEngine_a-network.o `test -f 'network.c' || echo '$(srcdir)/'`network.c
|
||||
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libEngine_a-network.Tpo $(DEPDIR)/libEngine_a-network.Po
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='network.c' object='libEngine_a-network.o' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libEngine_a_CFLAGS) $(CFLAGS) -c -o libEngine_a-network.o `test -f 'network.c' || echo '$(srcdir)/'`network.c
|
||||
|
||||
libEngine_a-network.obj: network.c
|
||||
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libEngine_a_CFLAGS) $(CFLAGS) -MT libEngine_a-network.obj -MD -MP -MF $(DEPDIR)/libEngine_a-network.Tpo -c -o libEngine_a-network.obj `if test -f 'network.c'; then $(CYGPATH_W) 'network.c'; else $(CYGPATH_W) '$(srcdir)/network.c'; fi`
|
||||
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libEngine_a-network.Tpo $(DEPDIR)/libEngine_a-network.Po
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='network.c' object='libEngine_a-network.obj' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libEngine_a_CFLAGS) $(CFLAGS) -c -o libEngine_a-network.obj `if test -f 'network.c'; then $(CYGPATH_W) 'network.c'; else $(CYGPATH_W) '$(srcdir)/network.c'; fi`
|
||||
|
||||
libEngine_a-tiles.o: tiles.c
|
||||
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libEngine_a_CFLAGS) $(CFLAGS) -MT libEngine_a-tiles.o -MD -MP -MF $(DEPDIR)/libEngine_a-tiles.Tpo -c -o libEngine_a-tiles.o `test -f 'tiles.c' || echo '$(srcdir)/'`tiles.c
|
||||
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libEngine_a-tiles.Tpo $(DEPDIR)/libEngine_a-tiles.Po
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tiles.c' object='libEngine_a-tiles.o' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libEngine_a_CFLAGS) $(CFLAGS) -c -o libEngine_a-tiles.o `test -f 'tiles.c' || echo '$(srcdir)/'`tiles.c
|
||||
|
||||
libEngine_a-tiles.obj: tiles.c
|
||||
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libEngine_a_CFLAGS) $(CFLAGS) -MT libEngine_a-tiles.obj -MD -MP -MF $(DEPDIR)/libEngine_a-tiles.Tpo -c -o libEngine_a-tiles.obj `if test -f 'tiles.c'; then $(CYGPATH_W) 'tiles.c'; else $(CYGPATH_W) '$(srcdir)/tiles.c'; fi`
|
||||
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libEngine_a-tiles.Tpo $(DEPDIR)/libEngine_a-tiles.Po
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tiles.c' object='libEngine_a-tiles.obj' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libEngine_a_CFLAGS) $(CFLAGS) -c -o libEngine_a-tiles.obj `if test -f 'tiles.c'; then $(CYGPATH_W) 'tiles.c'; else $(CYGPATH_W) '$(srcdir)/tiles.c'; fi`
|
||||
|
||||
ID: $(am__tagged_files)
|
||||
$(am__define_uniq_tagged_files); mkid -fID $$unique
|
||||
tags: tags-am
|
||||
TAGS: tags
|
||||
|
||||
tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
|
||||
set x; \
|
||||
here=`pwd`; \
|
||||
$(am__define_uniq_tagged_files); \
|
||||
shift; \
|
||||
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
|
||||
test -n "$$unique" || unique=$$empty_fix; \
|
||||
if test $$# -gt 0; then \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
"$$@" $$unique; \
|
||||
else \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
$$unique; \
|
||||
fi; \
|
||||
fi
|
||||
ctags: ctags-am
|
||||
|
||||
CTAGS: ctags
|
||||
ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
|
||||
$(am__define_uniq_tagged_files); \
|
||||
test -z "$(CTAGS_ARGS)$$unique" \
|
||||
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
|
||||
$$unique
|
||||
|
||||
GTAGS:
|
||||
here=`$(am__cd) $(top_builddir) && pwd` \
|
||||
&& $(am__cd) $(top_srcdir) \
|
||||
&& gtags -i $(GTAGS_ARGS) "$$here"
|
||||
cscopelist: cscopelist-am
|
||||
|
||||
cscopelist-am: $(am__tagged_files)
|
||||
list='$(am__tagged_files)'; \
|
||||
case "$(srcdir)" in \
|
||||
[\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
|
||||
*) sdir=$(subdir)/$(srcdir) ;; \
|
||||
esac; \
|
||||
for i in $$list; do \
|
||||
if test -f "$$i"; then \
|
||||
echo "$(subdir)/$$i"; \
|
||||
else \
|
||||
echo "$$sdir/$$i"; \
|
||||
fi; \
|
||||
done >> $(top_builddir)/cscope.files
|
||||
|
||||
distclean-tags:
|
||||
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
list='$(DISTFILES)'; \
|
||||
dist_files=`for file in $$list; do echo $$file; done | \
|
||||
sed -e "s|^$$srcdirstrip/||;t" \
|
||||
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
|
||||
case $$dist_files in \
|
||||
*/*) $(MKDIR_P) `echo "$$dist_files" | \
|
||||
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
|
||||
sort -u` ;; \
|
||||
esac; \
|
||||
for file in $$dist_files; do \
|
||||
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
|
||||
if test -d $$d/$$file; then \
|
||||
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
|
||||
if test -d "$(distdir)/$$file"; then \
|
||||
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
|
||||
fi; \
|
||||
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
|
||||
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
|
||||
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
|
||||
fi; \
|
||||
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
|
||||
else \
|
||||
test -f "$(distdir)/$$file" \
|
||||
|| cp -p $$d/$$file "$(distdir)/$$file" \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
check-am: all-am
|
||||
check: check-am
|
||||
all-am: Makefile $(LIBRARIES)
|
||||
installdirs:
|
||||
install: install-am
|
||||
install-exec: install-exec-am
|
||||
install-data: install-data-am
|
||||
uninstall: uninstall-am
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
|
||||
installcheck: installcheck-am
|
||||
install-strip:
|
||||
if test -z '$(STRIP)'; then \
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
install; \
|
||||
else \
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
|
||||
fi
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
|
||||
distclean-generic:
|
||||
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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-am
|
||||
|
||||
clean-am: clean-generic clean-noinstLIBRARIES mostlyclean-am
|
||||
|
||||
distclean: distclean-am
|
||||
-rm -rf ./$(DEPDIR)
|
||||
-rm -f Makefile
|
||||
distclean-am: clean-am distclean-compile distclean-generic \
|
||||
distclean-tags
|
||||
|
||||
dvi: dvi-am
|
||||
|
||||
dvi-am:
|
||||
|
||||
html: html-am
|
||||
|
||||
html-am:
|
||||
|
||||
info: info-am
|
||||
|
||||
info-am:
|
||||
|
||||
install-data-am:
|
||||
|
||||
install-dvi: install-dvi-am
|
||||
|
||||
install-dvi-am:
|
||||
|
||||
install-exec-am:
|
||||
|
||||
install-html: install-html-am
|
||||
|
||||
install-html-am:
|
||||
|
||||
install-info: install-info-am
|
||||
|
||||
install-info-am:
|
||||
|
||||
install-man:
|
||||
|
||||
install-pdf: install-pdf-am
|
||||
|
||||
install-pdf-am:
|
||||
|
||||
install-ps: install-ps-am
|
||||
|
||||
install-ps-am:
|
||||
|
||||
installcheck-am:
|
||||
|
||||
maintainer-clean: maintainer-clean-am
|
||||
-rm -rf ./$(DEPDIR)
|
||||
-rm -f Makefile
|
||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
||||
|
||||
mostlyclean: mostlyclean-am
|
||||
|
||||
mostlyclean-am: mostlyclean-compile mostlyclean-generic
|
||||
|
||||
pdf: pdf-am
|
||||
|
||||
pdf-am:
|
||||
|
||||
ps: ps-am
|
||||
|
||||
ps-am:
|
||||
|
||||
uninstall-am:
|
||||
|
||||
.MAKE: install-am install-strip
|
||||
|
||||
.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \
|
||||
clean-noinstLIBRARIES cscopelist-am ctags ctags-am distclean \
|
||||
distclean-compile distclean-generic distclean-tags distdir dvi \
|
||||
dvi-am html html-am info info-am install install-am \
|
||||
install-data install-data-am install-dvi install-dvi-am \
|
||||
install-exec install-exec-am install-html install-html-am \
|
||||
install-info install-info-am install-man install-pdf \
|
||||
install-pdf-am install-ps install-ps-am install-strip \
|
||||
installcheck installcheck-am installdirs maintainer-clean \
|
||||
maintainer-clean-generic mostlyclean mostlyclean-compile \
|
||||
mostlyclean-generic pdf pdf-am ps ps-am tags tags-am uninstall \
|
||||
uninstall-am
|
||||
|
||||
.PRECIOUS: Makefile
|
||||
|
||||
|
||||
# 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:
|
||||
320
apps/plugins/sdl/progs/duke3d/Engine/src/build.h
Normal file
320
apps/plugins/sdl/progs/duke3d/Engine/src/build.h
Normal file
|
|
@ -0,0 +1,320 @@
|
|||
/*
|
||||
* "Build Engine & Tools" Copyright (c) 1993-1997 Ken Silverman
|
||||
* Ken Silverman's official web site: "http://www.advsys.net/ken"
|
||||
* See the included license file "BUILDLIC.TXT" for license info.
|
||||
* This file has been modified from Ken Silverman's original release
|
||||
*/
|
||||
|
||||
#ifndef _INCLUDE_BUILD_H_
|
||||
#define _INCLUDE_BUILD_H_
|
||||
#ifdef _WIN32
|
||||
#include "windows/inttypes.h"
|
||||
#else
|
||||
#include <inttypes.h>
|
||||
#endif
|
||||
|
||||
#define MAXSECTORS 1024
|
||||
#define MAXWALLS 8192
|
||||
#define MAXSPRITES 4096
|
||||
#define MAXTILES 9216
|
||||
|
||||
#define MAXSTATUS 1024
|
||||
#define MAXPLAYERS 16
|
||||
#define MAXXDIM 1600
|
||||
#define MAXYDIM 1200
|
||||
#define MAXPALOOKUPS 256
|
||||
#define MAXPSKYTILES 256
|
||||
#define MAXSPRITESONSCREEN 1024
|
||||
|
||||
#define CLIPMASK0 (((1L)<<16)+1L)
|
||||
#define CLIPMASK1 (((256L)<<16)+64L)
|
||||
|
||||
|
||||
/*
|
||||
* Make all variables in BUILD.H defined in the ENGINE,
|
||||
* and externed in GAME
|
||||
* (dear lord. --ryan.)
|
||||
*/
|
||||
#ifdef ENGINE
|
||||
#define EXTERN
|
||||
#else
|
||||
#define EXTERN extern
|
||||
#endif
|
||||
|
||||
#pragma pack(1)
|
||||
|
||||
/*
|
||||
* ceilingstat/floorstat:
|
||||
* bit 0: 1 = parallaxing, 0 = not "P"
|
||||
* bit 1: 1 = groudraw, 0 = not
|
||||
* bit 2: 1 = swap x&y, 0 = not "F"
|
||||
* bit 3: 1 = double smooshiness "E"
|
||||
* bit 4: 1 = x-flip "F"
|
||||
* bit 5: 1 = y-flip "F"
|
||||
* bit 6: 1 = Align texture to first wall of sector "R"
|
||||
* bits 7-8: "T"
|
||||
* 00 = normal floors
|
||||
* 01 = masked floors
|
||||
* 10 = transluscent masked floors
|
||||
* 11 = reverse transluscent masked floors
|
||||
* bits 9-15: reserved
|
||||
*/
|
||||
|
||||
/* 40 bytes */
|
||||
typedef struct
|
||||
{
|
||||
short wallptr, wallnum;
|
||||
int32_t ceilingz, floorz;
|
||||
short ceilingstat, floorstat;
|
||||
short ceilingpicnum, ceilingheinum;
|
||||
int8_t ceilingshade;
|
||||
uint8_t ceilingpal, ceilingxpanning, ceilingypanning;
|
||||
short floorpicnum, floorheinum;
|
||||
int8_t floorshade;
|
||||
uint8_t floorpal, floorxpanning, floorypanning;
|
||||
uint8_t visibility, filler;
|
||||
short lotag, hitag, extra;
|
||||
} sectortype;
|
||||
|
||||
/*
|
||||
* cstat:
|
||||
* bit 0: 1 = Blocking wall (use with clipmove, getzrange) "B"
|
||||
* bit 1: 1 = bottoms of invisible walls swapped, 0 = not "2"
|
||||
* bit 2: 1 = align picture on bottom (for doors), 0 = top "O"
|
||||
* bit 3: 1 = x-flipped, 0 = normal "F"
|
||||
* bit 4: 1 = masking wall, 0 = not "M"
|
||||
* bit 5: 1 = 1-way wall, 0 = not "1"
|
||||
* bit 6: 1 = Blocking wall (use with hitscan / cliptype 1) "H"
|
||||
* bit 7: 1 = Transluscence, 0 = not "T"
|
||||
* bit 8: 1 = y-flipped, 0 = normal "F"
|
||||
* bit 9: 1 = Transluscence reversing, 0 = normal "T"
|
||||
* bits 10-15: reserved
|
||||
*/
|
||||
|
||||
/* 32 bytes */
|
||||
typedef struct
|
||||
{
|
||||
int32_t x, y;
|
||||
short point2, nextwall, nextsector, cstat;
|
||||
short picnum, overpicnum;
|
||||
int8_t shade;
|
||||
uint8_t pal, xrepeat, yrepeat, xpanning, ypanning;
|
||||
short lotag, hitag, extra;
|
||||
} walltype;
|
||||
|
||||
|
||||
/*
|
||||
* cstat:
|
||||
* bit 0: 1 = Blocking sprite (use with clipmove, getzrange) "B"
|
||||
* bit 1: 1 = transluscence, 0 = normal "T"
|
||||
* bit 2: 1 = x-flipped, 0 = normal "F"
|
||||
* bit 3: 1 = y-flipped, 0 = normal "F"
|
||||
* bits 5-4: 00 = FACE sprite (default) "R"
|
||||
* 01 = WALL sprite (like masked walls)
|
||||
* 10 = FLOOR sprite (parallel to ceilings&floors)
|
||||
* bit 6: 1 = 1-sided sprite, 0 = normal "1"
|
||||
* bit 7: 1 = Real centered centering, 0 = foot center "C"
|
||||
* bit 8: 1 = Blocking sprite (use with hitscan / cliptype 1) "H"
|
||||
* bit 9: 1 = Transluscence reversing, 0 = normal "T"
|
||||
* bits 10-14: reserved
|
||||
* bit 15: 1 = Invisible sprite, 0 = not invisible
|
||||
*/
|
||||
|
||||
/* 44 bytes */
|
||||
typedef struct
|
||||
{
|
||||
int32_t x, y, z;
|
||||
short cstat, picnum;
|
||||
int8_t shade;
|
||||
uint8_t pal, clipdist, filler;
|
||||
uint8_t xrepeat, yrepeat;
|
||||
int8_t xoffset, yoffset;
|
||||
short sectnum, statnum;
|
||||
short ang, owner, xvel, yvel, zvel;
|
||||
short lotag, hitag, extra;
|
||||
} spritetype;
|
||||
|
||||
#pragma pack()
|
||||
|
||||
EXTERN sectortype sector[MAXSECTORS];
|
||||
EXTERN walltype wall[MAXWALLS];
|
||||
EXTERN spritetype sprite[MAXSPRITES];
|
||||
|
||||
EXTERN uint16_t mapCRC;
|
||||
|
||||
EXTERN int32_t spritesortcnt;
|
||||
EXTERN spritetype tsprite[MAXSPRITESONSCREEN];
|
||||
|
||||
EXTERN uint8_t vidoption;
|
||||
EXTERN int32_t xdim, ydim, numpages;
|
||||
|
||||
// Fast way to retrive the start of a column in the framebuffer, given a screenspace X coordinate.
|
||||
EXTERN int32_t ylookup[MAXYDIM+1];
|
||||
|
||||
EXTERN int32_t yxaspect, viewingrange;
|
||||
|
||||
EXTERN int32_t validmodecnt;
|
||||
EXTERN short validmode[256];
|
||||
EXTERN int32_t validmodexdim[256], validmodeydim[256];
|
||||
|
||||
EXTERN short numsectors, numwalls;
|
||||
EXTERN volatile int32_t totalclock;
|
||||
EXTERN int32_t numframes, randomseed;
|
||||
EXTERN short sintable[2048];
|
||||
EXTERN uint8_t palette[768];
|
||||
EXTERN short numpalookups;
|
||||
EXTERN uint8_t *palookup[MAXPALOOKUPS];
|
||||
EXTERN uint8_t parallaxtype, showinvisibility;
|
||||
EXTERN int32_t parallaxyoffs, parallaxyscale;
|
||||
EXTERN int32_t visibility, parallaxvisibility;
|
||||
|
||||
EXTERN int32_t windowx1, windowy1, windowx2, windowy2;
|
||||
EXTERN short startumost[MAXXDIM], startdmost[MAXXDIM];
|
||||
|
||||
EXTERN short pskyoff[MAXPSKYTILES], pskybits;
|
||||
|
||||
EXTERN short headspritesect[MAXSECTORS+1], headspritestat[MAXSTATUS+1];
|
||||
EXTERN short prevspritesect[MAXSPRITES], prevspritestat[MAXSPRITES];
|
||||
EXTERN short nextspritesect[MAXSPRITES], nextspritestat[MAXSPRITES];
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* These variables are for auto-mapping with the draw2dscreen function.
|
||||
* When you load a new board, these bits are all set to 0 - since
|
||||
* you haven't mapped out anything yet. Note that these arrays are
|
||||
* bit-mapped.
|
||||
* If you want draw2dscreen() to show sprite #54 then you say:
|
||||
* spritenum = 54;
|
||||
* show2dsprite[spritenum>>3] |= (1<<(spritenum&7));
|
||||
* And if you want draw2dscreen() to not show sprite #54 then you say:
|
||||
* spritenum = 54;
|
||||
* show2dsprite[spritenum>>3] &= ~(1<<(spritenum&7));
|
||||
* Automapping defaults to 0 (do nothing). If you set automapping to 1,
|
||||
* then in 3D mode, the walls and sprites that you see will show up the
|
||||
* next time you flip to 2D mode.
|
||||
*/
|
||||
EXTERN uint8_t show2dsector[(MAXSECTORS+7)>>3];
|
||||
EXTERN uint8_t show2dwall[(MAXWALLS+7)>>3];
|
||||
EXTERN uint8_t show2dsprite[(MAXSPRITES+7)>>3];
|
||||
EXTERN uint8_t automapping;
|
||||
|
||||
|
||||
|
||||
//This is the bit vector that marks visited sector during portal flooding. Size is hence (MAXSECTORS / 8)
|
||||
EXTERN uint8_t visitedSectors[(MAXSECTORS+7)>>3];
|
||||
|
||||
/*************************************************************************
|
||||
POSITION VARIABLES:
|
||||
|
||||
POSX is your x - position ranging from 0 to 65535
|
||||
POSY is your y - position ranging from 0 to 65535
|
||||
(the length of a side of the grid in EDITBORD would be 1024)
|
||||
POSZ is your z - position (height) ranging from 0 to 65535, 0 highest.
|
||||
ANG is your angle ranging from 0 to 2047. Instead of 360 degrees, or
|
||||
2 * PI radians, I use 2048 different angles, so 90 degrees would
|
||||
be 512 in my system.
|
||||
|
||||
SPRITE VARIABLES:
|
||||
|
||||
EXTERN short headspritesect[MAXSECTORS+1], headspritestat[MAXSTATUS+1];
|
||||
EXTERN short prevspritesect[MAXSPRITES], prevspritestat[MAXSPRITES];
|
||||
EXTERN short nextspritesect[MAXSPRITES], nextspritestat[MAXSPRITES];
|
||||
|
||||
Example: if the linked lists look like the following:
|
||||
ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
|
||||
³ Sector lists: Status lists: ³
|
||||
ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
|
||||
³ Sector0: 4, 5, 8 Status0: 2, 0, 8 ³
|
||||
³ Sector1: 16, 2, 0, 7 Status1: 4, 5, 16, 7, 3, 9 ³
|
||||
³ Sector2: 3, 9 ³
|
||||
ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
|
||||
Notice that each number listed above is shown exactly once on both the
|
||||
left and right side. This is because any sprite that exists must
|
||||
be in some sector, and must have some kind of status that you define.
|
||||
|
||||
|
||||
Coding example #1:
|
||||
To go through all the sprites in sector 1, the code can look like this:
|
||||
|
||||
sectnum = 1;
|
||||
i = headspritesect[sectnum];
|
||||
while (i != -1)
|
||||
{
|
||||
nexti = nextspritesect[i];
|
||||
|
||||
//your code goes here
|
||||
//ex: printf("Sprite %d is in sector %d\n",i,sectnum);
|
||||
|
||||
i = nexti;
|
||||
}
|
||||
|
||||
Coding example #2:
|
||||
To go through all sprites with status = 1, the code can look like this:
|
||||
|
||||
statnum = 1; //status 1
|
||||
i = headspritestat[statnum];
|
||||
while (i != -1)
|
||||
{
|
||||
nexti = nextspritestat[i];
|
||||
|
||||
//your code goes here
|
||||
//ex: printf("Sprite %d has a status of 1 (active)\n",i,statnum);
|
||||
|
||||
i = nexti;
|
||||
}
|
||||
|
||||
insertsprite(short sectnum, short statnum);
|
||||
deletesprite(short spritenum);
|
||||
changespritesect(short spritenum, short newsectnum);
|
||||
changespritestat(short spritenum, short newstatnum);
|
||||
|
||||
TILE VARIABLES:
|
||||
NUMTILES - the number of tiles found TILES.DAT.
|
||||
TILESIZX[MAXTILES] - simply the x-dimension of the tile number.
|
||||
TILESIZY[MAXTILES] - simply the y-dimension of the tile number.
|
||||
WALOFF[MAXTILES] - the actual 32-bit offset pointing to the top-left
|
||||
corner of the tile.
|
||||
PICANM[MAXTILES] - flags for animating the tile.
|
||||
|
||||
TIMING VARIABLES:
|
||||
TOTALCLOCK - When the engine is initialized, TOTALCLOCK is set to zero.
|
||||
From then on, it is incremented 120 times a second by 1. That
|
||||
means that the number of seconds elapsed is totalclock / 120.
|
||||
NUMFRAMES - The number of times the draw3dscreen function was called
|
||||
since the engine was initialized. This helps to determine frame
|
||||
rate. (Frame rate = numframes * 120 / totalclock.)
|
||||
|
||||
OTHER VARIABLES:
|
||||
|
||||
STARTUMOST[320] is an array of the highest y-coordinates on each column
|
||||
that my engine is allowed to write to. You need to set it only
|
||||
once.
|
||||
STARTDMOST[320] is an array of the lowest y-coordinates on each column
|
||||
that my engine is allowed to write to. You need to set it only
|
||||
once.
|
||||
SINTABLE[2048] is a sin table with 2048 angles rather than the
|
||||
normal 360 angles for higher precision. Also since SINTABLE is in
|
||||
all integers, the range is multiplied by 16383, so instead of the
|
||||
normal -1<sin(x)<1, the range of sintable is -16383<sintable[]<16383
|
||||
If you use this sintable, you can possibly speed up your code as
|
||||
well as save space in memory. If you plan to use sintable, 2
|
||||
identities you may want to keep in mind are:
|
||||
sintable[ang&2047] = sin(ang * (3.141592/1024)) * 16383
|
||||
sintable[(ang+512)&2047] = cos(ang * (3.141592/1024)) * 16383
|
||||
NUMSECTORS - the total number of existing sectors. Modified every time
|
||||
you call the loadboard function.
|
||||
***************************************************************************/
|
||||
|
||||
#define PORTSIG "Port by Ryan C. Gordon, Andrew Henderson, Dan Olson, Fabien Sanglard and a cast of thousands."
|
||||
|
||||
//Global.c
|
||||
void Error (int errorType, char *error, ...);
|
||||
int FindDistance2D(int ix, int iy);
|
||||
|
||||
#endif /* defined _INCLUDE_BUILD_H_ */
|
||||
|
||||
/* end of build.h ... */
|
||||
|
||||
|
||||
|
||||
225
apps/plugins/sdl/progs/duke3d/Engine/src/cache.c
Normal file
225
apps/plugins/sdl/progs/duke3d/Engine/src/cache.c
Normal file
|
|
@ -0,0 +1,225 @@
|
|||
/*
|
||||
* "Build Engine & Tools" Copyright (c) 1993-1997 Ken Silverman
|
||||
* Ken Silverman's official web site: "http://www.advsys.net/ken"
|
||||
* See the included license file "BUILDLIC.TXT" for license info.
|
||||
* This file has been modified from Ken Silverman's original release
|
||||
*/
|
||||
|
||||
#include "platform.h"
|
||||
#include "display.h"
|
||||
|
||||
#include "fixedPoint_math.h"
|
||||
#include "cache.h"
|
||||
#include "build.h"
|
||||
|
||||
#include "../../Game/src/cvar_defs.h"
|
||||
|
||||
#include "../../Game/src/types.h"
|
||||
|
||||
/*
|
||||
* This module keeps track of a standard linear cacheing system.
|
||||
* To use this module, here's all you need to do:
|
||||
*
|
||||
* Step 1: Allocate a nice BIG buffer, like from 1MB-4MB and
|
||||
* Call initcache(int32_t cachestart, int32_t cachesize) where
|
||||
*
|
||||
* cachestart = (int32_t )(pointer to start of BIG buffer)
|
||||
* cachesize = length of BIG buffer
|
||||
*
|
||||
* Step 2: Call allocache(int32_t *bufptr, int32_t bufsiz, uint8_t *lockptr)
|
||||
* whenever you need to allocate a buffer, where:
|
||||
*
|
||||
* *bufptr = pointer to 4-byte pointer to buffer
|
||||
* Confused? Using this method, cache2d can remove
|
||||
* previously allocated things from the cache safely by
|
||||
* setting the 4-byte pointer to 0.
|
||||
* bufsiz = number of bytes to allocate
|
||||
* *lockptr = pointer to locking uint8_t which tells whether
|
||||
* the region can be removed or not. If *lockptr = 0 then
|
||||
* the region is not locked else its locked.
|
||||
*
|
||||
* Step 3: If you need to remove everything from the cache, or every
|
||||
* unlocked item from the cache, you can call uninitcache();
|
||||
* Call uninitcache(0) to remove all unlocked items, or
|
||||
* Call uninitcache(1) to remove everything.
|
||||
* After calling uninitcache, it is still ok to call allocache
|
||||
* without first calling initcache.
|
||||
*/
|
||||
|
||||
#define MAXCACHEOBJECTS 9216
|
||||
|
||||
static int32_t cachesize = 0;
|
||||
int32_t cachecount = 0;
|
||||
uint8_t zerochar = 0;
|
||||
uint8_t* cachestart = NULL;
|
||||
int32_t cacnum = 0, agecount = 0;
|
||||
|
||||
typedef struct {
|
||||
uint8_t** hand;
|
||||
int32_t leng;
|
||||
uint8_t *lock; }
|
||||
cactype;
|
||||
|
||||
cactype cac[MAXCACHEOBJECTS];
|
||||
int32_t lockrecip[200];
|
||||
|
||||
// TC game directory
|
||||
char game_dir[512] = "/.rockbox/duke3d";
|
||||
|
||||
void initcache(uint8_t* dacachestart, int32_t dacachesize)
|
||||
{
|
||||
int32_t i;
|
||||
|
||||
for(i=1;i<200;i++) lockrecip[i] = (1<<28)/(200-i);
|
||||
|
||||
cachestart = dacachestart;
|
||||
cachesize = dacachesize;
|
||||
|
||||
cac[0].leng = cachesize;
|
||||
cac[0].lock = &zerochar;
|
||||
cacnum = 1;
|
||||
}
|
||||
|
||||
void allocache (uint8_t** newhandle, int32_t newbytes, uint8_t *newlockptr)
|
||||
{
|
||||
int32_t i, z, zz, bestz=0, daval, bestval, besto=0, o1, o2, sucklen, suckz;
|
||||
|
||||
newbytes = newbytes+15;
|
||||
|
||||
if ((uint32_t)newbytes > (uint32_t)cachesize)
|
||||
{
|
||||
printf("Cachesize: %d\n",cachesize);
|
||||
printf("*Newhandle: 0x%x, Newbytes: %d, *Newlock: %d\n",(unsigned int)newhandle,newbytes,*newlockptr);
|
||||
reportandexit("BUFFER TOO BIG TO FIT IN CACHE!\n");
|
||||
}
|
||||
|
||||
if (*newlockptr == 0)
|
||||
{
|
||||
reportandexit("ALLOCACHE CALLED WITH LOCK OF 0!\n");
|
||||
}
|
||||
|
||||
/* Find best place */
|
||||
bestval = 0x7fffffff; o1 = cachesize;
|
||||
for(z=cacnum-1;z>=0;z--)
|
||||
{
|
||||
o1 -= cac[z].leng;
|
||||
o2 = o1+newbytes; if (o2 > cachesize) continue;
|
||||
|
||||
daval = 0;
|
||||
for(i=o1,zz=z;i<o2;i+=cac[zz++].leng)
|
||||
{
|
||||
if (*cac[zz].lock == 0) continue;
|
||||
if (*cac[zz].lock >= 200) { daval = 0x7fffffff; break; }
|
||||
daval += (int32_t ) mulscale32(cac[zz].leng+65536,lockrecip[*cac[zz].lock]);
|
||||
if (daval >= bestval) break;
|
||||
}
|
||||
if (daval < bestval)
|
||||
{
|
||||
bestval = daval; besto = o1; bestz = z;
|
||||
if (bestval == 0) break;
|
||||
}
|
||||
}
|
||||
|
||||
/*printf("%ld %ld %ld\n",besto,newbytes,*newlockptr);*/
|
||||
|
||||
if (bestval == 0x7fffffff)
|
||||
reportandexit("CACHE SPACE ALL LOCKED UP!\n");
|
||||
|
||||
/* Suck things out */
|
||||
for(sucklen=-newbytes,suckz=bestz;sucklen<0;sucklen+=cac[suckz++].leng)
|
||||
if (*cac[suckz].lock) *cac[suckz].hand = 0;
|
||||
|
||||
/* Remove all blocks except 1 */
|
||||
suckz -= (bestz+1); cacnum -= suckz;
|
||||
copybufbyte(&cac[bestz+suckz],&cac[bestz],(cacnum-bestz)*sizeof(cactype));
|
||||
cac[bestz].hand = newhandle;
|
||||
*newhandle = cachestart+besto;
|
||||
cac[bestz].leng = newbytes;
|
||||
cac[bestz].lock = newlockptr;
|
||||
cachecount++;
|
||||
|
||||
/* Add new empty block if necessary */
|
||||
if (sucklen <= 0) return;
|
||||
|
||||
bestz++;
|
||||
if (bestz == cacnum)
|
||||
{
|
||||
cacnum++; if (cacnum > MAXCACHEOBJECTS) reportandexit("Too many objects in cache! (cacnum > MAXCACHEOBJECTS)\n");
|
||||
cac[bestz].leng = sucklen;
|
||||
cac[bestz].lock = &zerochar;
|
||||
return;
|
||||
}
|
||||
|
||||
if (*cac[bestz].lock == 0) { cac[bestz].leng += sucklen; return; }
|
||||
|
||||
cacnum++; if (cacnum > MAXCACHEOBJECTS) reportandexit("Too many objects in cache! (cacnum > MAXCACHEOBJECTS)\n");
|
||||
for(z=cacnum-1;z>bestz;z--) cac[z] = cac[z-1];
|
||||
cac[bestz].leng = sucklen;
|
||||
cac[bestz].lock = &zerochar;
|
||||
}
|
||||
|
||||
void suckcache (int32_t *suckptr)
|
||||
{
|
||||
int32_t i;
|
||||
|
||||
/* Can't exit early, because invalid pointer might be same even though lock = 0 */
|
||||
for(i=0;i<cacnum;i++)
|
||||
if ((int32_t )(*cac[i].hand) == (int32_t )suckptr)
|
||||
{
|
||||
if (*cac[i].lock) *cac[i].hand = 0;
|
||||
cac[i].lock = &zerochar;
|
||||
cac[i].hand = 0;
|
||||
|
||||
/* Combine empty blocks */
|
||||
if ((i > 0) && (*cac[i-1].lock == 0))
|
||||
{
|
||||
cac[i-1].leng += cac[i].leng;
|
||||
cacnum--; copybuf(&cac[i+1],&cac[i],(cacnum-i)*sizeof(cactype));
|
||||
}
|
||||
else if ((i < cacnum-1) && (*cac[i+1].lock == 0))
|
||||
{
|
||||
cac[i+1].leng += cac[i].leng;
|
||||
cacnum--; copybuf(&cac[i+1],&cac[i],(cacnum-i)*sizeof(cactype));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void agecache(void)
|
||||
{
|
||||
int32_t cnt;
|
||||
uint8_t ch;
|
||||
|
||||
if (agecount >= cacnum) agecount = cacnum-1;
|
||||
assert(agecount >= 0);
|
||||
|
||||
for(cnt=(cacnum>>4);cnt>=0;cnt--)
|
||||
{
|
||||
ch = (*cac[agecount].lock);
|
||||
if (((ch-2)&255) < 198)
|
||||
(*cac[agecount].lock) = (uint8_t ) (ch-1);
|
||||
|
||||
agecount--; if (agecount < 0) agecount = cacnum-1;
|
||||
}
|
||||
}
|
||||
|
||||
void reportandexit(char *errormessage)
|
||||
{
|
||||
int32_t i, j;
|
||||
|
||||
setvmode(0x3);
|
||||
j = 0;
|
||||
for(i=0;i<cacnum;i++)
|
||||
{
|
||||
printf("%d- ",i);
|
||||
printf("ptr: 0x%x, ",(int8_t)*cac[i].hand);
|
||||
printf("leng: %d, ",cac[i].leng);
|
||||
printf("lock: %d\n",*cac[i].lock);
|
||||
j += cac[i].leng;
|
||||
}
|
||||
printf("Cachesize = %d\n",cachesize);
|
||||
printf("Cacnum = %d\n",cacnum);
|
||||
printf("Cache length sum = %d\n",j);
|
||||
printf("ERROR: %s",errormessage);
|
||||
Error(EXIT_FAILURE, "");
|
||||
}
|
||||
|
||||
34
apps/plugins/sdl/progs/duke3d/Engine/src/cache.h
Normal file
34
apps/plugins/sdl/progs/duke3d/Engine/src/cache.h
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
/*
|
||||
* Cache1d declarations.
|
||||
*
|
||||
* Written by Ryan C. Gordon. (icculus@clutteredmind.org)
|
||||
*
|
||||
* Please do NOT harrass Ken Silverman about any code modifications
|
||||
* (including this file) to BUILD.
|
||||
*/
|
||||
|
||||
/*
|
||||
* "Build Engine & Tools" Copyright (c) 1993-1997 Ken Silverman
|
||||
* Ken Silverman's official web site: "http://www.advsys.net/ken"
|
||||
* See the included license file "BUILDLIC.TXT" for license info.
|
||||
* This file has been modified from Ken Silverman's original release
|
||||
*/
|
||||
|
||||
#ifndef _INCLUDE_CACHE1D_H_
|
||||
#define _INCLUDE_CACHE1D_H_
|
||||
|
||||
void initcache(uint8_t* dacachestart, int32_t dacachesize);
|
||||
void allocache (uint8_t* *newhandle, int32_t newbytes, uint8_t *newlockptr);
|
||||
void suckcache (int32_t *suckptr);
|
||||
void agecache(void);
|
||||
|
||||
|
||||
void reportandexit(char *errormessage);
|
||||
|
||||
extern char game_dir[];
|
||||
|
||||
//Filesystem
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
1949
apps/plugins/sdl/progs/duke3d/Engine/src/display.c
Normal file
1949
apps/plugins/sdl/progs/duke3d/Engine/src/display.c
Normal file
File diff suppressed because it is too large
Load diff
110
apps/plugins/sdl/progs/duke3d/Engine/src/display.h
Normal file
110
apps/plugins/sdl/progs/duke3d/Engine/src/display.h
Normal file
|
|
@ -0,0 +1,110 @@
|
|||
/*
|
||||
* "Build Engine & Tools" Copyright (c) 1993-1997 Ken Silverman
|
||||
* Ken Silverman's official web site: "http://www.advsys.net/ken"
|
||||
* See the included license file "BUILDLIC.TXT" for license info.
|
||||
* This file IS NOT A PART OF Ken Silverman's original release
|
||||
*/
|
||||
|
||||
#ifndef _INCLUDE_DISPLAY_H_
|
||||
#define _INCLUDE_DISPLAY_H_
|
||||
|
||||
#include "platform.h"
|
||||
|
||||
/* set these in your _platform_init() implementation. */
|
||||
int _argc;
|
||||
char **_argv;
|
||||
|
||||
/* !!! gads, look at all the namespace polution... */
|
||||
extern int32_t xres, yres, bytesperline, imageSize, maxpages;
|
||||
extern uint8_t *screen, vesachecked;
|
||||
extern int32_t buffermode, origbuffermode, linearmode;
|
||||
extern uint8_t permanentupdate, vgacompatible;
|
||||
extern uint8_t moustat;
|
||||
extern int32_t *horizlookup, *horizlookup2, horizycent;
|
||||
extern int32_t oxdimen, oviewingrange, oxyaspect;
|
||||
extern int32_t curbrightness;
|
||||
extern int32_t qsetmode;
|
||||
extern int32_t pageoffset, ydim16;
|
||||
extern uint8_t* frameplace;
|
||||
extern uint8_t* frameoffset;
|
||||
extern uint8_t textfont[1024], smalltextfont[1024];
|
||||
extern uint8_t pow2char[8];
|
||||
extern int32_t stereomode, visualpage, activepage, whiteband, blackband;
|
||||
extern int32_t searchx, searchy;
|
||||
extern int32_t wx1, wy1, wx2, wy2, ydimen;
|
||||
extern int32_t xdimen, xdimenrecip, halfxdimen, xdimenscale, xdimscale;
|
||||
|
||||
/*
|
||||
* !!! used to be static. If we ever put the original setgamemode() back, this
|
||||
* !!! can be made static again. --ryan.
|
||||
* !!! (Actually, most of these extern declarations used to be static...rcg.)
|
||||
*/
|
||||
extern uint8_t permanentlock;
|
||||
|
||||
// defined in the game project:
|
||||
extern int32_t BFullScreen; // defined in Game\src\config.c
|
||||
extern int32_t ScreenMode;
|
||||
|
||||
|
||||
/* these need to be implemented by YOUR driver. */
|
||||
void _platform_init(int argc, char **argv, const char *title, const char *iconName);
|
||||
void _idle(void);
|
||||
void _handle_events(void);
|
||||
void *_getVideoBase(void);
|
||||
void initkeys(void);
|
||||
void uninitkeys(void);
|
||||
void _nextpage(void);
|
||||
void _uninitengine(void);
|
||||
void _joystick_init(void);
|
||||
void _joystick_deinit(void);
|
||||
int _joystick_update(void);
|
||||
int _joystick_axis(int axis);
|
||||
int _joystick_hat(int hat);
|
||||
int _joystick_button(int button);
|
||||
|
||||
void getvalidvesamodes(void);
|
||||
int VBE_getPalette(int32_t start, int32_t num, uint8_t *dapal);
|
||||
int VBE_setPalette(uint8_t *palettebuffer);
|
||||
|
||||
|
||||
void setvmode(int mode);
|
||||
uint8_t readpixel(uint8_t * location);
|
||||
void drawpixel(uint8_t * location, uint8_t pixel);
|
||||
|
||||
|
||||
void drawpixel16(int32_t offset);
|
||||
void fillscreen16 (int32_t input1, int32_t input2, int32_t input3);
|
||||
|
||||
|
||||
void clear2dscreen(void);
|
||||
void _updateScreenRect(int32_t x, int32_t y, int32_t w, int32_t h);
|
||||
|
||||
/* mouse/keystuff stuff. Also implemented in sdl_driver.c ... */
|
||||
int setupmouse(void);
|
||||
void readmousexy(short *x, short *y);
|
||||
void readmousebstatus(short *bstatus);
|
||||
void keyhandler(void);
|
||||
uint8_t _readlastkeyhit(void);
|
||||
|
||||
/* timer krap. */
|
||||
int inittimer(int);
|
||||
void uninittimer(void);
|
||||
|
||||
/* this is implemented in the game, and your driver calls it. */
|
||||
void timerhandler(void);
|
||||
|
||||
/* resolution inits. sdl_driver.c ... */
|
||||
int32_t _setgamemode(uint8_t davidoption, int32_t daxdim, int32_t daydim);
|
||||
|
||||
uint32_t getticks();
|
||||
|
||||
void drawline16(int32_t XStart, int32_t YStart, int32_t XEnd, int32_t YEnd, uint8_t Color);
|
||||
void setcolor16(uint8_t color);
|
||||
|
||||
|
||||
|
||||
void initmultiplayers(uint8_t damultioption, uint8_t dacomrateoption, uint8_t dapriority);
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
919
apps/plugins/sdl/progs/duke3d/Engine/src/draw.c
Normal file
919
apps/plugins/sdl/progs/duke3d/Engine/src/draw.c
Normal file
|
|
@ -0,0 +1,919 @@
|
|||
// "Build Engine & Tools" Copyright (c) 1993-1997 Ken Silverman
|
||||
// Ken Silverman's official web site: "http://www.advsys.net/ken"
|
||||
// See the included license file "BUILDLIC.TXT" for license info.
|
||||
// This file has been modified from Ken Silverman's original release
|
||||
|
||||
/* DDOI - This file is an attempt to reimplement a_nasm.asm in C */
|
||||
/* FCS: However did that work: This is far from perfect but you have my eternal respect !!! */
|
||||
|
||||
#include "platform.h"
|
||||
#include "build.h"
|
||||
#include "draw.h"
|
||||
|
||||
int32_t pixelsAllowed = 10000000000;
|
||||
|
||||
uint8_t *transluc = NULL;
|
||||
|
||||
static int transrev = 0;
|
||||
|
||||
|
||||
#define shrd(a,b,c) (((b)<<(32-(c))) | ((a)>>(c)))
|
||||
#define shld(a,b,c) (((b)>>(32-(c))) | ((a)<<(c)))
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* --------------- WALLS RENDERING METHOD (USED TO BE HIGHLY OPTIMIZED ASSEMBLY) ----------------------------*/
|
||||
extern int32_t asm1;
|
||||
extern intptr_t asm2;
|
||||
extern uint8_t *asm3;
|
||||
extern int32_t asm4;
|
||||
|
||||
static uint8_t machxbits_al;
|
||||
static uint8_t bitsSetup;
|
||||
static uint8_t * textureSetup;
|
||||
void sethlinesizes(int32_t i1, int32_t _bits, uint8_t * textureAddress)
|
||||
{
|
||||
machxbits_al = i1;
|
||||
bitsSetup = _bits;
|
||||
textureSetup = textureAddress;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//FCS: Draw ceiling/floors
|
||||
//Draw a line from destination in the framebuffer to framebuffer-numPixels
|
||||
void hlineasm4(int32_t numPixels, int32_t shade, uint32_t i4, uint32_t i5, uint8_t *dest){
|
||||
|
||||
int32_t shifter = ((256-machxbits_al) & 0x1f);
|
||||
uint32_t source;
|
||||
|
||||
uint8_t * texture = textureSetup;
|
||||
uint8_t bits = bitsSetup;
|
||||
|
||||
shade = shade & 0xffffff00;
|
||||
numPixels++;
|
||||
|
||||
if (!RENDER_DRAW_CEILING_AND_FLOOR)
|
||||
return;
|
||||
|
||||
while (numPixels) {
|
||||
|
||||
source = i5 >> shifter;
|
||||
source = shld(source,i4,bits);
|
||||
source = texture[source];
|
||||
|
||||
if (pixelsAllowed-- > 0)
|
||||
*dest = globalpalwritten[shade|source];
|
||||
|
||||
dest--;
|
||||
|
||||
i5 -= asm1;
|
||||
i4 -= asm2;
|
||||
|
||||
numPixels--;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
static int32_t rmach_eax;
|
||||
static int32_t rmach_ebx;
|
||||
static int32_t rmach_ecx;
|
||||
static int32_t rmach_edx;
|
||||
static int32_t rmach_esi;
|
||||
void setuprhlineasm4(int32_t i1, int32_t i2, int32_t i3, int32_t i4, int32_t i5, int32_t i6)
|
||||
{
|
||||
rmach_eax = i1;
|
||||
rmach_ebx = i2;
|
||||
rmach_ecx = i3;
|
||||
rmach_edx = i4;
|
||||
rmach_esi = i5;
|
||||
}
|
||||
|
||||
|
||||
void rhlineasm4(int32_t i1, uint8_t* texture, int32_t i3, uint32_t i4, uint32_t i5, int32_t dest)
|
||||
{
|
||||
uint32_t ebp = dest - i1;
|
||||
uint32_t rmach6b = ebp-1;
|
||||
int32_t numPixels;
|
||||
|
||||
if (i1 <= 0) return;
|
||||
|
||||
numPixels = i1;
|
||||
do {
|
||||
|
||||
|
||||
|
||||
i3 = ((i3&0xffffff00)|(*texture));
|
||||
i4 -= rmach_eax;
|
||||
ebp = (((i4+rmach_eax) < i4) ? -1 : 0);
|
||||
i5 -= rmach_ebx;
|
||||
|
||||
if ((i5 + rmach_ebx) < i5)
|
||||
texture -= (rmach_ecx+1);
|
||||
else
|
||||
texture -= rmach_ecx;
|
||||
|
||||
ebp &= rmach_esi;
|
||||
i1 = ((i1&0xffffff00)|(((uint8_t *)i3)[rmach_edx]));
|
||||
|
||||
if (pixelsAllowed-- > 0)
|
||||
((uint8_t *)rmach6b)[numPixels] = (i1&0xff);
|
||||
|
||||
texture -= ebp;
|
||||
numPixels--;
|
||||
} while (numPixels);
|
||||
}
|
||||
|
||||
static int32_t rmmach_eax;
|
||||
static int32_t rmmach_ebx;
|
||||
static int32_t rmmach_ecx;
|
||||
static int32_t rmmach_edx;
|
||||
static int32_t setupTileHeight;
|
||||
void setuprmhlineasm4(int32_t i1, int32_t i2, int32_t i3, int32_t i4, int32_t tileHeight, int32_t i6)
|
||||
{
|
||||
rmmach_eax = i1;
|
||||
rmmach_ebx = i2;
|
||||
rmmach_ecx = i3;
|
||||
rmmach_edx = i4;
|
||||
setupTileHeight = tileHeight;
|
||||
}
|
||||
|
||||
|
||||
//FCS: ????
|
||||
void rmhlineasm4(int32_t i1, intptr_t shade, int32_t colorIndex, int32_t i4, int32_t i5, int32_t dest)
|
||||
{
|
||||
uint32_t ebp = dest - i1;
|
||||
uint32_t rmach6b = ebp-1;
|
||||
int32_t numPixels;
|
||||
|
||||
if (i1 <= 0)
|
||||
return;
|
||||
|
||||
numPixels = i1;
|
||||
do {
|
||||
|
||||
|
||||
|
||||
colorIndex = ((colorIndex&0xffffff00)|(*((uint8_t *)shade)));
|
||||
i4 -= rmmach_eax;
|
||||
ebp = (((i4+rmmach_eax) < i4) ? -1 : 0);
|
||||
i5 -= rmmach_ebx;
|
||||
|
||||
if ((i5 + rmmach_ebx) < i5)
|
||||
shade -= (rmmach_ecx+1);
|
||||
else
|
||||
shade -= rmmach_ecx;
|
||||
|
||||
ebp &= setupTileHeight;
|
||||
|
||||
//Check if this colorIndex is the transparent color (255).
|
||||
if ((colorIndex&0xff) != 255) {
|
||||
if (pixelsAllowed-- > 0)
|
||||
{
|
||||
i1 = ((i1&0xffffff00)|(((uint8_t *)colorIndex)[rmmach_edx]));
|
||||
((uint8_t *)rmach6b)[numPixels] = (i1&0xff);
|
||||
}
|
||||
}
|
||||
|
||||
shade -= ebp;
|
||||
numPixels--;
|
||||
|
||||
} while (numPixels);
|
||||
}
|
||||
|
||||
|
||||
//Variable used to draw column.
|
||||
//This is how much you have to skip in the framebuffer in order to be one pixel below.
|
||||
static int32_t bytesperline;
|
||||
void setBytesPerLine(int32_t _bytesperline)
|
||||
{
|
||||
bytesperline = _bytesperline;
|
||||
}
|
||||
|
||||
|
||||
|
||||
static uint8_t mach3_al;
|
||||
|
||||
//FCS: RENDER TOP AND BOTTOM COLUMN
|
||||
int32_t prevlineasm1(int32_t i1, uint8_t* palette, int32_t i3, int32_t i4, uint8_t *source, uint8_t *dest)
|
||||
{
|
||||
|
||||
|
||||
if (i3 == 0)
|
||||
{
|
||||
if (!RENDER_DRAW_TOP_AND_BOTTOM_COLUMN)
|
||||
return 0;
|
||||
|
||||
i1 += i4;
|
||||
i4 = ((uint32_t)i4) >> mach3_al;
|
||||
i4 = (i4&0xffffff00) | source[i4];
|
||||
|
||||
if (pixelsAllowed-- > 0)
|
||||
*dest = palette[i4];
|
||||
|
||||
|
||||
|
||||
return i1;
|
||||
} else {
|
||||
return vlineasm1(i1,palette,i3,i4,source,dest);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//FCS: This is used to draw wall border vertical lines
|
||||
int32_t vlineasm1(int32_t vince, uint8_t* palookupoffse, int32_t numPixels, int32_t vplce, uint8_t* texture, uint8_t* dest)
|
||||
{
|
||||
uint32_t temp;
|
||||
|
||||
if (!RENDER_DRAW_WALL_BORDERS)
|
||||
return vplce;
|
||||
|
||||
numPixels++;
|
||||
while (numPixels)
|
||||
{
|
||||
temp = ((uint32_t)vplce) >> mach3_al;
|
||||
|
||||
temp = texture[temp];
|
||||
|
||||
if (pixelsAllowed-- > 0)
|
||||
*dest = palookupoffse[temp];
|
||||
|
||||
vplce += vince;
|
||||
dest += bytesperline;
|
||||
numPixels--;
|
||||
}
|
||||
return vplce;
|
||||
}
|
||||
|
||||
|
||||
int32_t tvlineasm1(int32_t i1, uint8_t * texture, int32_t numPixels, int32_t i4, uint8_t *source, uint8_t *dest)
|
||||
{
|
||||
uint8_t shiftValue = (globalshiftval & 0x1f);
|
||||
|
||||
numPixels++;
|
||||
while (numPixels)
|
||||
{
|
||||
uint32_t temp = i4;
|
||||
temp >>= shiftValue;
|
||||
temp = source[temp];
|
||||
|
||||
//255 is the index for transparent color index. Skip drawing this pixel.
|
||||
if (temp != 255)
|
||||
{
|
||||
uint16_t colorIndex;
|
||||
|
||||
colorIndex = texture[temp];
|
||||
colorIndex |= ((*dest)<<8);
|
||||
|
||||
if (transrev)
|
||||
colorIndex = ((colorIndex>>8)|(colorIndex<<8));
|
||||
|
||||
if (pixelsAllowed-- > 0)
|
||||
*dest = transluc[colorIndex];
|
||||
}
|
||||
|
||||
i4 += i1;
|
||||
|
||||
//We are drawing a column ?!
|
||||
dest += bytesperline;
|
||||
numPixels--;
|
||||
}
|
||||
return i4;
|
||||
} /* tvlineasm1 */
|
||||
|
||||
|
||||
static uint8_t tran2shr;
|
||||
static uint32_t tran2pal_ebx;
|
||||
static uint32_t tran2pal_ecx;
|
||||
void setuptvlineasm2(int32_t i1, int32_t i2, int32_t i3)
|
||||
{
|
||||
tran2shr = (i1&0x1f);
|
||||
tran2pal_ebx = i2;
|
||||
tran2pal_ecx = i3;
|
||||
} /* */
|
||||
|
||||
|
||||
void tvlineasm2(uint32_t i1, uint32_t i2, uintptr_t i3, uintptr_t i4, uint32_t i5, uintptr_t i6)
|
||||
{
|
||||
uint32_t ebp = i1;
|
||||
uint32_t tran2inca = i2;
|
||||
uint32_t tran2incb = asm1;
|
||||
uintptr_t tran2bufa = i3;
|
||||
uintptr_t tran2bufb = i4;
|
||||
uintptr_t tran2edi = asm2;
|
||||
uintptr_t tran2edi1 = asm2 + 1;
|
||||
|
||||
i6 -= asm2;
|
||||
|
||||
do {
|
||||
|
||||
i1 = i5 >> tran2shr;
|
||||
i2 = ebp >> tran2shr;
|
||||
i5 += tran2inca;
|
||||
ebp += tran2incb;
|
||||
i3 = ((uint8_t *)tran2bufa)[i1];
|
||||
i4 = ((uint8_t *)tran2bufb)[i2];
|
||||
if (i3 == 255) { // skipdraw1
|
||||
if (i4 != 255) { // skipdraw3
|
||||
uint16_t val;
|
||||
val = ((uint8_t *)tran2pal_ecx)[i4];
|
||||
val |= (((uint8_t *)i6)[tran2edi1]<<8);
|
||||
|
||||
if (transrev)
|
||||
val = ((val>>8)|(val<<8));
|
||||
|
||||
if (pixelsAllowed-- > 0)
|
||||
((uint8_t *)i6)[tran2edi1] = transluc[val];
|
||||
}
|
||||
} else if (i4 == 255) { // skipdraw2
|
||||
uint16_t val;
|
||||
val = ((uint8_t *)tran2pal_ebx)[i3];
|
||||
val |= (((uint8_t *)i6)[tran2edi]<<8);
|
||||
|
||||
if (transrev)
|
||||
val = ((val>>8)|(val<<8));
|
||||
|
||||
if (pixelsAllowed-- > 0)
|
||||
((uint8_t *)i6)[tran2edi] = transluc[val];
|
||||
} else {
|
||||
uint16_t l = ((uint8_t *)i6)[tran2edi]<<8;
|
||||
uint16_t r = ((uint8_t *)i6)[tran2edi1]<<8;
|
||||
l |= ((uint8_t *)tran2pal_ebx)[i3];
|
||||
r |= ((uint8_t *)tran2pal_ecx)[i4];
|
||||
if (transrev) {
|
||||
l = ((l>>8)|(l<<8));
|
||||
r = ((r>>8)|(r<<8));
|
||||
}
|
||||
if (pixelsAllowed-- > 0)
|
||||
{
|
||||
((uint8_t *)i6)[tran2edi] = transluc[l];
|
||||
((uint8_t *)i6)[tran2edi1] =transluc[r];
|
||||
pixelsAllowed--;
|
||||
}
|
||||
}
|
||||
i6 += bytesperline;
|
||||
} while (i6 > i6 - bytesperline);
|
||||
asm1 = i5;
|
||||
asm2 = ebp;
|
||||
}
|
||||
|
||||
|
||||
|
||||
static uint8_t machmv;
|
||||
int32_t mvlineasm1(int32_t vince, uint8_t* palookupoffse, int32_t i3, int32_t vplce, uint8_t* texture, uint8_t *dest)
|
||||
{
|
||||
uint32_t temp;
|
||||
|
||||
for(;i3>=0;i3--)
|
||||
{
|
||||
temp = ((uint32_t)vplce) >> machmv;
|
||||
temp = texture[temp];
|
||||
|
||||
if (temp != 255)
|
||||
{
|
||||
if (pixelsAllowed-- > 0)
|
||||
*dest = palookupoffse[temp];
|
||||
}
|
||||
|
||||
vplce += vince;
|
||||
dest += bytesperline;
|
||||
}
|
||||
return vplce;
|
||||
}
|
||||
|
||||
|
||||
void setupvlineasm(int32_t i1)
|
||||
{
|
||||
mach3_al = (i1&0x1f);
|
||||
}
|
||||
|
||||
//FCS This is used to fill the inside of a wall (so it draws VERTICAL column, always).
|
||||
void vlineasm4(int32_t columnIndex, intptr_t framebuffer)
|
||||
{
|
||||
|
||||
if (!RENDER_DRAW_WALL_INSIDE)
|
||||
return ;
|
||||
|
||||
int i;
|
||||
uint32_t temp;
|
||||
|
||||
uintptr_t index = (framebuffer + ylookup[columnIndex]);
|
||||
uint8_t *dest= (uint8_t *)(-ylookup[columnIndex]);
|
||||
|
||||
do {
|
||||
for (i = 0; i < 4; i++)
|
||||
{
|
||||
|
||||
temp = ((uint32_t)vplce[i]) >> mach3_al;
|
||||
temp = (((uint8_t *)(bufplce[i]))[temp]);
|
||||
|
||||
if (pixelsAllowed-- > 0)
|
||||
dest[index+i] = palookupoffse [i] [temp];
|
||||
|
||||
vplce[i] += vince[i];
|
||||
}
|
||||
dest += bytesperline;
|
||||
} while (((uint32_t)dest - bytesperline) < ((uint32_t)dest));
|
||||
}
|
||||
|
||||
|
||||
void setupmvlineasm(int32_t i1)
|
||||
{
|
||||
//Only keep 5 first bits
|
||||
machmv = (i1&0x1f);
|
||||
}
|
||||
|
||||
|
||||
void mvlineasm4(int32_t column, intptr_t framebufferOffset)
|
||||
{
|
||||
int i;
|
||||
uint32_t temp;
|
||||
uintptr_t index = (framebufferOffset + ylookup[column]);
|
||||
uint8_t *dest = (uint8_t *)(-ylookup[column]);
|
||||
|
||||
do {
|
||||
|
||||
if (pixelsAllowed <= 0)
|
||||
return;
|
||||
|
||||
for (i = 0; i < 4; i++)
|
||||
{
|
||||
|
||||
temp = ((uint32_t)vplce[i]) >> machmv;
|
||||
temp = (((uint8_t *)(bufplce[i]))[temp]);
|
||||
if (temp != 255)
|
||||
{
|
||||
if (pixelsAllowed-- > 0)
|
||||
dest[index+i] = palookupoffse[i][temp];
|
||||
}
|
||||
vplce[i] += vince[i];
|
||||
}
|
||||
dest += bytesperline;
|
||||
|
||||
} while (((uint32_t)dest - bytesperline) < ((uint32_t)dest));
|
||||
}
|
||||
/* END --------------- WALLS RENDERING METHOD (USED TO BE HIGHLY OPTIMIZED ASSEMBLY) ----------------------------*/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* --------------- SPRITE RENDERING METHOD (USED TO BE HIGHLY OPTIMIZED ASSEMBLY) ----------------------------*/
|
||||
static int32_t spal_eax;
|
||||
static int32_t smach_eax;
|
||||
static int32_t smach2_eax;
|
||||
static int32_t smach5_eax;
|
||||
static int32_t smach_ecx;
|
||||
void setupspritevline(int32_t i1, int32_t i2, int32_t i3, int32_t i4, int32_t i5, int32_t i6)
|
||||
{
|
||||
spal_eax = i1;
|
||||
smach_eax = (i5<<16);
|
||||
smach2_eax = (i5>>16)+i2;
|
||||
smach5_eax = smach2_eax + i4;
|
||||
smach_ecx = i3;
|
||||
}
|
||||
|
||||
|
||||
void spritevline(int32_t i1, uint32_t i2, int32_t i3, uint32_t i4, uint8_t* source, uint8_t* dest)
|
||||
{
|
||||
|
||||
|
||||
setup:
|
||||
|
||||
i2 += smach_eax;
|
||||
i1 = (i1&0xffffff00) | (*source&0xff);
|
||||
if ((i2 - smach_eax) > i2)
|
||||
source += smach2_eax + 1;
|
||||
else
|
||||
source += smach2_eax;
|
||||
|
||||
while(1) {
|
||||
|
||||
i1 = (i1&0xffffff00) | (((uint8_t *)spal_eax)[i1]&0xff);
|
||||
|
||||
if (pixelsAllowed-- > 0)
|
||||
*dest = i1;
|
||||
|
||||
dest += bytesperline;
|
||||
|
||||
i4 += smach_ecx;
|
||||
i4--;
|
||||
if (!((i4 - smach_ecx) > i4) && i4 != 0)
|
||||
goto setup;
|
||||
|
||||
if (i4 == 0)
|
||||
return;
|
||||
|
||||
i2 += smach_eax;
|
||||
|
||||
i1 = (i1&0xffffff00) | (*source&0xff);
|
||||
|
||||
if ((i2 - smach_eax) > i2)
|
||||
source += smach5_eax + 1;
|
||||
else
|
||||
source += smach5_eax;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static int32_t mspal_eax;
|
||||
static int32_t msmach_eax;
|
||||
static int32_t msmach2_eax;
|
||||
static int32_t msmach5_eax;
|
||||
static int32_t msmach_ecx;
|
||||
void msetupspritevline(int32_t i1, int32_t i2, int32_t i3, int32_t i4, int32_t i5, int32_t i6)
|
||||
{
|
||||
mspal_eax = i1;
|
||||
msmach_eax = (i5<<16);
|
||||
msmach2_eax = (i5>>16)+i2;
|
||||
msmach5_eax = smach2_eax + i4;
|
||||
msmach_ecx = i3;
|
||||
}
|
||||
|
||||
|
||||
void mspritevline(int32_t colorIndex, int32_t i2, int32_t i3, int32_t i4, uint8_t * source, uint8_t * dest)
|
||||
{
|
||||
|
||||
setup:
|
||||
i2 += smach_eax;
|
||||
|
||||
colorIndex = (colorIndex&0xffffff00) | (*source&0xff);
|
||||
|
||||
if ((i2 - smach_eax) > i2)
|
||||
source += smach2_eax + 1;
|
||||
else
|
||||
source += smach2_eax;
|
||||
|
||||
while(1){
|
||||
|
||||
//Skip transparent pixels (index=255)
|
||||
if ((colorIndex&0xff) != 255)
|
||||
{
|
||||
colorIndex = (colorIndex&0xffffff00) | (((uint8_t *)spal_eax)[colorIndex]&0xff);
|
||||
|
||||
if (pixelsAllowed-- > 0)
|
||||
*dest = colorIndex;
|
||||
}
|
||||
|
||||
dest += bytesperline;
|
||||
i4 += smach_ecx;
|
||||
i4--;
|
||||
|
||||
if (!((i4 - smach_ecx) > i4) && i4 != 0)
|
||||
goto setup;
|
||||
|
||||
if (i4 == 0)
|
||||
return;
|
||||
|
||||
i2 += smach_eax;
|
||||
|
||||
colorIndex = (colorIndex&0xffffff00) | (*source&0xff);
|
||||
|
||||
if ((i2 - smach_eax) > i2)
|
||||
source += smach5_eax + 1;
|
||||
else
|
||||
source += smach5_eax;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
uint8_t * tspal;
|
||||
uint32_t tsmach_eax1;
|
||||
uint32_t adder;
|
||||
uint32_t tsmach_eax3;
|
||||
uint32_t tsmach_ecx;
|
||||
void tsetupspritevline(uint8_t * palette, int32_t i2, int32_t i3, int32_t i4, int32_t i5)
|
||||
{
|
||||
tspal = palette;
|
||||
tsmach_eax1 = i5 << 16;
|
||||
adder = (i5 >> 16) + i2;
|
||||
tsmach_eax3 = adder + i4;
|
||||
tsmach_ecx = i3;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
FCS: Draw a sprite vertical line of pixels.
|
||||
*/
|
||||
void DrawSpriteVerticalLine(int32_t i2, int32_t numPixels, uint32_t i4, uint8_t * texture, uint8_t * dest)
|
||||
{
|
||||
uint8_t colorIndex;
|
||||
|
||||
while (numPixels)
|
||||
{
|
||||
numPixels--;
|
||||
|
||||
if (numPixels != 0)
|
||||
{
|
||||
|
||||
i4 += tsmach_ecx;
|
||||
|
||||
if (i4 < (i4 - tsmach_ecx))
|
||||
adder = tsmach_eax3;
|
||||
|
||||
colorIndex = *texture;
|
||||
|
||||
i2 += tsmach_eax1;
|
||||
if (i2 < (i2 - tsmach_eax1))
|
||||
texture++;
|
||||
|
||||
texture += adder;
|
||||
|
||||
//255 is the index of the transparent color: Do not draw it.
|
||||
if (colorIndex != 255)
|
||||
{
|
||||
uint16_t val;
|
||||
val = tspal[colorIndex];
|
||||
val |= (*dest)<<8;
|
||||
|
||||
if (transrev)
|
||||
val = ((val>>8)|(val<<8));
|
||||
|
||||
colorIndex = transluc[val];
|
||||
|
||||
if (pixelsAllowed-- > 0)
|
||||
*dest = colorIndex;
|
||||
}
|
||||
|
||||
//Move down one pixel on the framebuffer
|
||||
dest += bytesperline;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
/* END--------------- SPRITE RENDERING METHOD (USED TO BE HIGHLY OPTIMIZED ASSEMBLY) ----------------------------*/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* --------------- FLOOR/CEILING RENDERING METHOD (USED TO BE HIGHLY OPTIMIZED ASSEMBLY) ----------------------------*/
|
||||
|
||||
void settrans(int32_t type){
|
||||
transrev = type;
|
||||
}
|
||||
|
||||
static uint8_t * textureData;
|
||||
static uint8_t * mmach_asm3;
|
||||
static int32_t mmach_asm1;
|
||||
static int32_t mmach_asm2;
|
||||
|
||||
void mhline(uint8_t * texture, int32_t i2, int32_t numPixels, int32_t i4, int32_t i5, uint8_t* dest)
|
||||
{
|
||||
textureData = texture;
|
||||
mmach_asm3 = asm3;
|
||||
mmach_asm1 = asm1;
|
||||
mmach_asm2 = asm2;
|
||||
mhlineskipmodify(i2,numPixels>>16,i5,dest);
|
||||
}
|
||||
|
||||
|
||||
static uint8_t mshift_al = 26;
|
||||
static uint8_t mshift_bl = 6;
|
||||
void mhlineskipmodify( uint32_t i2, int32_t numPixels, int32_t i5, uint8_t* dest)
|
||||
{
|
||||
uint32_t ebx;
|
||||
int32_t colorIndex;
|
||||
|
||||
while (numPixels >= 0)
|
||||
{
|
||||
ebx = i2 >> mshift_al;
|
||||
ebx = shld (ebx, (uint32_t)i5, mshift_bl);
|
||||
colorIndex = textureData[ebx];
|
||||
|
||||
//Skip transparent color.
|
||||
if ((colorIndex&0xff) != 0xff){
|
||||
if (pixelsAllowed-- > 0)
|
||||
*dest = mmach_asm3[colorIndex];
|
||||
}
|
||||
i2 += mmach_asm1;
|
||||
i5 += mmach_asm2;
|
||||
dest++;
|
||||
numPixels--;
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void msethlineshift(int32_t i1, int32_t i2)
|
||||
{
|
||||
i1 = 256-i1;
|
||||
mshift_al = (i1&0x1f);
|
||||
mshift_bl = (i2&0x1f);
|
||||
} /* msethlineshift */
|
||||
|
||||
|
||||
static uint8_t * tmach_eax;
|
||||
static uint8_t * tmach_asm3;
|
||||
static int32_t tmach_asm1;
|
||||
static int32_t tmach_asm2;
|
||||
|
||||
void thline(uint8_t * i1, int32_t i2, int32_t i3, int32_t i4, int32_t i5, uint8_t * i6)
|
||||
{
|
||||
tmach_eax = i1;
|
||||
tmach_asm3 = asm3;
|
||||
tmach_asm1 = asm1;
|
||||
tmach_asm2 = asm2;
|
||||
thlineskipmodify(asm2,i2,i3,i4,i5,i6);
|
||||
}
|
||||
|
||||
static uint8_t tshift_al = 26;
|
||||
static uint8_t tshift_bl = 6;
|
||||
void thlineskipmodify(int32_t i1, uint32_t i2, uint32_t i3, int32_t i4, int32_t i5, uint8_t * i6)
|
||||
{
|
||||
uint32_t ebx;
|
||||
int counter = (i3>>16);
|
||||
while (counter >= 0)
|
||||
{
|
||||
ebx = i2 >> tshift_al;
|
||||
ebx = shld (ebx, (uint32_t)i5, tshift_bl);
|
||||
i1 = tmach_eax[ebx];
|
||||
if ((i1&0xff) != 0xff)
|
||||
{
|
||||
uint16_t val = tmach_asm3[i1];
|
||||
val |= (*i6)<<8;
|
||||
|
||||
if (transrev)
|
||||
val = ((val>>8)|(val<<8));
|
||||
|
||||
if (pixelsAllowed-- > 0)
|
||||
*i6 = transluc[val];
|
||||
}
|
||||
|
||||
i2 += tmach_asm1;
|
||||
i5 += tmach_asm2;
|
||||
i6++;
|
||||
counter--;
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void tsethlineshift(int32_t i1, int32_t i2)
|
||||
{
|
||||
i1 = 256-i1;
|
||||
tshift_al = (i1&0x1f);
|
||||
tshift_bl = (i2&0x1f);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
static intptr_t slopemach_ebx;
|
||||
static int32_t slopemach_ecx;
|
||||
static int32_t slopemach_edx;
|
||||
static uint8_t slopemach_ah1;
|
||||
static uint8_t slopemach_ah2;
|
||||
static float asm2_f;
|
||||
typedef union { unsigned int i; float f; } bitwisef2i;
|
||||
void setupslopevlin(int32_t i1, intptr_t i2, int32_t i3)
|
||||
{
|
||||
bitwisef2i c;
|
||||
slopemach_ebx = i2;
|
||||
slopemach_ecx = i3;
|
||||
slopemach_edx = (1<<(i1&0x1f)) - 1;
|
||||
slopemach_edx <<= ((i1&0x1f00)>>8);
|
||||
slopemach_ah1 = 32-((i1&0x1f00)>>8);
|
||||
slopemach_ah2 = (slopemach_ah1 - (i1&0x1f)) & 0x1f;
|
||||
c.f = asm2_f = (float)asm1;
|
||||
asm2 = c.i;
|
||||
}
|
||||
|
||||
extern int32_t reciptable[2048];
|
||||
extern int32_t globalx3, globaly3;
|
||||
extern int32_t fpuasm;
|
||||
#define low32(a) ((a&0xffffffff))
|
||||
#define high32(a) ((int)(((__int64)a&(__int64)0xffffffff00000000)>>32))
|
||||
|
||||
//FCS: Render RENDER_SLOPPED_CEILING_AND_FLOOR
|
||||
void slopevlin(intptr_t i1, uint32_t i2, int32_t i3, int32_t i4, int32_t i5, int32_t i6)
|
||||
{
|
||||
bitwisef2i c;
|
||||
uint32_t ecx,eax,ebx,edx,esi,edi;
|
||||
//This is so bad to cast asm3 to int then float :( !!!
|
||||
float a = (float)(int32_t) asm3 + asm2_f;
|
||||
i1 -= slopemach_ecx;
|
||||
esi = i5 + low32((__int64)globalx3 * (__int64)(i2<<3));
|
||||
edi = i6 + low32((__int64)globaly3 * (__int64)(i2<<3));
|
||||
ebx = i4;
|
||||
|
||||
if (!RENDER_SLOPPED_CEILING_AND_FLOOR)
|
||||
return;
|
||||
|
||||
do {
|
||||
// -------------
|
||||
// All this is calculating a fixed point approx. of 1/a
|
||||
c.f = a;
|
||||
fpuasm = eax = c.i;
|
||||
edx = (((int32_t)eax) < 0) ? 0xffffffff : 0;
|
||||
eax = eax << 1;
|
||||
ecx = (eax>>24); // exponent
|
||||
eax = ((eax&0xffe000)>>11);
|
||||
ecx = ((ecx&0xffffff00)|((ecx-2)&0xff));
|
||||
eax = reciptable[eax/4];
|
||||
eax >>= (ecx&0x1f);
|
||||
eax ^= edx;
|
||||
// -------------
|
||||
edx = i2;
|
||||
i2 = eax;
|
||||
eax -= edx;
|
||||
ecx = low32((__int64)globalx3 * (__int64)eax);
|
||||
eax = low32((__int64)globaly3 * (__int64)eax);
|
||||
a += asm2_f;
|
||||
|
||||
asm4 = ebx;
|
||||
ecx = ((ecx&0xffffff00)|(ebx&0xff));
|
||||
if (ebx >= 8) ecx = ((ecx&0xffffff00)|8);
|
||||
|
||||
ebx = esi;
|
||||
edx = edi;
|
||||
while ((ecx&0xff))
|
||||
{
|
||||
ebx >>= slopemach_ah2;
|
||||
esi += ecx;
|
||||
edx >>= slopemach_ah1;
|
||||
ebx &= slopemach_edx;
|
||||
edi += eax;
|
||||
i1 += slopemach_ecx;
|
||||
edx = ((edx&0xffffff00)|((((uint8_t *)(ebx+edx))[slopemach_ebx])));
|
||||
ebx = *((uint32_t*)i3); // register trickery
|
||||
i3 -= 4;
|
||||
eax = ((eax&0xffffff00)|(*((uint8_t *)(ebx+edx))));
|
||||
ebx = esi;
|
||||
|
||||
if (pixelsAllowed-- > 0)
|
||||
*((uint8_t *)i1) = (eax&0xff);
|
||||
|
||||
edx = edi;
|
||||
ecx = ((ecx&0xffffff00)|((ecx-1)&0xff));
|
||||
|
||||
|
||||
}
|
||||
ebx = asm4;
|
||||
ebx -= 8; // BITSOFPRECISIONPOW
|
||||
|
||||
|
||||
|
||||
} while ((int32_t)ebx > 0);
|
||||
}
|
||||
|
||||
|
||||
/* END --------------- FLOOR/CEILING RENDERING METHOD (USED TO BE HIGHLY OPTIMIZED ASSEMBLY) ----------------------------*/
|
||||
105
apps/plugins/sdl/progs/duke3d/Engine/src/draw.h
Normal file
105
apps/plugins/sdl/progs/duke3d/Engine/src/draw.h
Normal file
|
|
@ -0,0 +1,105 @@
|
|||
/*
|
||||
* "Build Engine & Tools" Copyright (c) 1993-1997 Ken Silverman
|
||||
* Ken Silverman's official web site: "http://www.advsys.net/ken"
|
||||
* See the included license file "BUILDLIC.TXT" for license info.
|
||||
* This file IS NOT A PART OF Ken Silverman's original release
|
||||
*/
|
||||
|
||||
#ifndef _INCLUDE_A_H_
|
||||
#define _INCLUDE_A_H_
|
||||
|
||||
#ifdef _WIN32
|
||||
#include "windows/inttypes.h"
|
||||
#else
|
||||
#include <inttypes.h>
|
||||
#endif
|
||||
|
||||
|
||||
//C++ linker friendly
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
extern uint8_t *transluc;
|
||||
|
||||
|
||||
extern uint8_t *globalpalwritten;
|
||||
extern int16_t globalshiftval;
|
||||
extern int32_t vplce[4], vince[4];
|
||||
extern intptr_t bufplce[4];
|
||||
extern uint8_t* palookupoffse[4];
|
||||
|
||||
void sethlinesizes(int32_t,int32_t,uint8_t *);
|
||||
|
||||
|
||||
void hlineasm4(int32_t,int32_t,uint32_t,uint32_t,uint8_t*);
|
||||
void setuprhlineasm4(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t);
|
||||
void rhlineasm4(int32_t,uint8_t*,int32_t,uint32_t,uint32_t,int32_t);
|
||||
void setuprmhlineasm4(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t);
|
||||
void rmhlineasm4(int32_t,intptr_t,int32_t,int32_t,int32_t,int32_t);
|
||||
|
||||
|
||||
void setBytesPerLine(int32_t);
|
||||
|
||||
int32_t prevlineasm1(int32_t,uint8_t* palette ,int32_t,int32_t,uint8_t *,uint8_t *);
|
||||
int32_t vlineasm1(int32_t,uint8_t*,int32_t,int32_t,uint8_t *,uint8_t*);
|
||||
|
||||
int32_t tvlineasm1(int32_t,uint8_t *,int32_t,int32_t,uint8_t *,uint8_t * dest);
|
||||
void setuptvlineasm2(int32_t,int32_t,int32_t);
|
||||
void tvlineasm2(uint32_t,uint32_t,uintptr_t,uintptr_t,uint32_t,uintptr_t);
|
||||
int32_t mvlineasm1(int32_t,uint8_t*,int32_t,int32_t,uint8_t* texture,uint8_t* dest);
|
||||
void setupvlineasm(int32_t);
|
||||
void vlineasm4(int32_t,intptr_t);
|
||||
void setupmvlineasm(int32_t);
|
||||
void mvlineasm4(int32_t,intptr_t);
|
||||
void setupspritevline(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t);
|
||||
void spritevline(int32_t,uint32_t,int32_t,uint32_t,uint8_t*,uint8_t*);
|
||||
void msetupspritevline(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t);
|
||||
void mspritevline(int32_t,int32_t,int32_t,int32_t,uint8_t *,uint8_t *);
|
||||
void tsetupspritevline(uint8_t *,int32_t,int32_t,int32_t,int32_t);
|
||||
void DrawSpriteVerticalLine(int32_t,int32_t,uint32_t,uint8_t* ,uint8_t*);
|
||||
void mhline(uint8_t *,int32_t,int32_t,int32_t,int32_t,uint8_t*);
|
||||
void mhlineskipmodify(uint32_t,int32_t,int32_t,uint8_t*);
|
||||
void msethlineshift(int32_t,int32_t);
|
||||
void thline(uint8_t*,int32_t,int32_t,int32_t,int32_t,uint8_t *);
|
||||
void thlineskipmodify(int32_t,uint32_t,uint32_t,int32_t,int32_t,uint8_t *);
|
||||
void tsethlineshift(int32_t,int32_t);
|
||||
void setupslopevlin(int32_t,intptr_t,int32_t);
|
||||
void slopevlin(intptr_t,uint32_t,int32_t,int32_t,int32_t,int32_t);
|
||||
|
||||
|
||||
#define TRANS_NORMAL 0
|
||||
#define TRANS_REVERSE 1
|
||||
void settrans(int32_t type);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//FCS: In order to see how the engine renders different part of the screen you can set the following macros
|
||||
//VISUALIZE RENDERER
|
||||
|
||||
#define MAX_PIXEL_RENDERERED ((1600*1200)+20000 )
|
||||
extern int32_t pixelsAllowed;
|
||||
|
||||
#define RENDER_DRAW_WALL_BORDERS 1
|
||||
#define RENDER_DRAW_WALL_INSIDE 1
|
||||
#define RENDER_DRAW_CEILING_AND_FLOOR 1
|
||||
#define RENDER_DRAW_TOP_AND_BOTTOM_COLUMN 1
|
||||
#define RENDER_SLOPPED_CEILING_AND_FLOOR 1
|
||||
|
||||
#if RENDER_DRAW_WALL_BORDERS && RENDER_DRAW_WALL_INSIDE && RENDER_DRAW_CEILING_AND_FLOOR && RENDER_DRAW_TOP_AND_BOTTOM_COLUMN && RENDER_SLOPPED_CEILING_AND_FLOOR && MAX_PIXEL_RENDERERED!=0
|
||||
#define CLEAR_FRAMEBUFFER 0
|
||||
#else
|
||||
#define CLEAR_FRAMEBUFFER 1
|
||||
#endif
|
||||
//END VISUALIZE RENDERER
|
||||
|
||||
|
||||
//C++
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
16
apps/plugins/sdl/progs/duke3d/Engine/src/dummy_multi.c
Normal file
16
apps/plugins/sdl/progs/duke3d/Engine/src/dummy_multi.c
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
//
|
||||
// dummy.c
|
||||
// Duke3D
|
||||
//
|
||||
// Created by fabien sanglard on 12-12-12.
|
||||
// Copyright (c) 2012 fabien sanglard. All rights reserved.
|
||||
//
|
||||
|
||||
#include "build.h"
|
||||
|
||||
|
||||
short numplayers = 1, myconnectindex = 0;
|
||||
short connecthead, connectpoint2[MAXPLAYERS];
|
||||
|
||||
|
||||
//uint8_t syncstate=0;
|
||||
177
apps/plugins/sdl/progs/duke3d/Engine/src/enet/ChangeLog
Normal file
177
apps/plugins/sdl/progs/duke3d/Engine/src/enet/ChangeLog
Normal file
|
|
@ -0,0 +1,177 @@
|
|||
ENet 1.3.13 (April 30, 2015):
|
||||
|
||||
* miscellaneous bug fixes
|
||||
* added premake and cmake support
|
||||
* miscellaneous documentation cleanups
|
||||
|
||||
ENet 1.3.12 (April 24, 2014):
|
||||
|
||||
* added maximumPacketSize and maximumWaitingData fields to ENetHost to limit the amount of
|
||||
data waiting to be delivered on a peer (beware that the default maximumPacketSize is
|
||||
32MB and should be set higher if desired as should maximumWaitingData)
|
||||
|
||||
ENet 1.3.11 (December 26, 2013):
|
||||
|
||||
* allow an ENetHost to connect to itself
|
||||
* fixed possible bug with disconnect notifications during connect attempts
|
||||
* fixed some preprocessor definition bugs
|
||||
|
||||
ENet 1.3.10 (October 23, 2013);
|
||||
|
||||
* doubled maximum reliable window size
|
||||
* fixed RCVTIMEO/SNDTIMEO socket options and also added NODELAY
|
||||
|
||||
ENet 1.3.9 (August 19, 2013):
|
||||
|
||||
* added duplicatePeers option to ENetHost which can limit the number of peers from duplicate IPs
|
||||
* added enet_socket_get_option() and ENET_SOCKOPT_ERROR
|
||||
* added enet_host_random_seed() platform stub
|
||||
|
||||
ENet 1.3.8 (June 2, 2013):
|
||||
|
||||
* added enet_linked_version() for checking the linked version
|
||||
* added enet_socket_get_address() for querying the local address of a socket
|
||||
* silenced some debugging prints unless ENET_DEBUG is defined during compilation
|
||||
* handle EINTR in enet_socket_wait() so that enet_host_service() doesn't propagate errors from signals
|
||||
* optimized enet_host_bandwidth_throttle() to be less expensive for large numbers of peers
|
||||
|
||||
ENet 1.3.7 (March 6, 2013):
|
||||
|
||||
* added ENET_PACKET_FLAG_SENT to indicate that a packet is being freed because it has been sent
|
||||
* added userData field to ENetPacket
|
||||
* changed how random seed is generated on Windows to avoid import warnings
|
||||
* fixed case where disconnects could be generated with no preceding connect event
|
||||
|
||||
ENet 1.3.6 (December 11, 2012):
|
||||
|
||||
* added support for intercept callback in ENetHost that can be used to process raw packets before ENet
|
||||
* added enet_socket_shutdown() for issuing shutdown on a socket
|
||||
* fixed enet_socket_connect() to not error on non-blocking connects
|
||||
* fixed bug in MTU negotiation during connections
|
||||
|
||||
ENet 1.3.5 (July 31, 2012):
|
||||
|
||||
* fixed bug in unreliable packet fragment queuing
|
||||
|
||||
ENet 1.3.4 (May 29, 2012):
|
||||
|
||||
* added enet_peer_ping_interval() for configuring per-peer ping intervals
|
||||
* added enet_peer_timeout() for configuring per-peer timeouts
|
||||
* added protocol packet size limits
|
||||
|
||||
ENet 1.3.3 (June 28, 2011):
|
||||
|
||||
* fixed bug with simultaneous disconnects not dispatching events
|
||||
|
||||
ENet 1.3.2 (May 31, 2011):
|
||||
|
||||
* added support for unreliable packet fragmenting via the packet flag
|
||||
ENET_PACKET_FLAG_UNRELIABLE_FRAGMENT
|
||||
* fixed regression in unreliable packet queuing
|
||||
* added check against received port to limit some forms of IP-spoofing
|
||||
|
||||
ENet 1.3.1 (February 10, 2011):
|
||||
|
||||
* fixed bug in tracking of reliable data in transit
|
||||
* reliable data window size now scales with the throttle
|
||||
* fixed bug in fragment length calculation when checksums are used
|
||||
|
||||
ENet 1.3.0 (June 5, 2010):
|
||||
|
||||
* enet_host_create() now requires the channel limit to be specified as
|
||||
a parameter
|
||||
* enet_host_connect() now accepts a data parameter which is supplied
|
||||
to the receiving receiving host in the event data field for a connect event
|
||||
* added an adaptive order-2 PPM range coder as a built-in compressor option
|
||||
which can be set with enet_host_compress_with_range_coder()
|
||||
* added support for packet compression configurable with a callback
|
||||
* improved session number handling to not rely on the packet checksum
|
||||
field, saving 4 bytes per packet unless the checksum option is used
|
||||
* removed the dependence on the rand callback for session number handling
|
||||
|
||||
Caveats: This version is not protocol compatible with the 1.2 series or
|
||||
earlier. The enet_host_connect and enet_host_create API functions require
|
||||
supplying additional parameters.
|
||||
|
||||
ENet 1.2.5 (June 28, 2011):
|
||||
|
||||
* fixed bug with simultaneous disconnects not dispatching events
|
||||
|
||||
ENet 1.2.4 (May 31, 2011):
|
||||
|
||||
* fixed regression in unreliable packet queuing
|
||||
* added check against received port to limit some forms of IP-spoofing
|
||||
|
||||
ENet 1.2.3 (February 10, 2011):
|
||||
|
||||
* fixed bug in tracking reliable data in transit
|
||||
|
||||
ENet 1.2.2 (June 5, 2010):
|
||||
|
||||
* checksum functionality is now enabled by setting a checksum callback
|
||||
inside ENetHost instead of being a configure script option
|
||||
* added totalSentData, totalSentPackets, totalReceivedData, and
|
||||
totalReceivedPackets counters inside ENetHost for getting usage
|
||||
statistics
|
||||
* added enet_host_channel_limit() for limiting the maximum number of
|
||||
channels allowed by connected peers
|
||||
* now uses dispatch queues for event dispatch rather than potentially
|
||||
unscalable array walking
|
||||
* added no_memory callback that is called when a malloc attempt fails,
|
||||
such that if no_memory returns rather than aborts (the default behavior),
|
||||
then the error is propagated to the return value of the API calls
|
||||
* now uses packed attribute for protocol structures on platforms with
|
||||
strange alignment rules
|
||||
* improved autoconf build system contributed by Nathan Brink allowing
|
||||
for easier building as a shared library
|
||||
|
||||
Caveats: If you were using the compile-time option that enabled checksums,
|
||||
make sure to set the checksum callback inside ENetHost to enet_crc32 to
|
||||
regain the old behavior. The ENetCallbacks structure has added new fields,
|
||||
so make sure to clear the structure to zero before use if
|
||||
using enet_initialize_with_callbacks().
|
||||
|
||||
ENet 1.2.1 (November 12, 2009):
|
||||
|
||||
* fixed bug that could cause disconnect events to be dropped
|
||||
* added thin wrapper around select() for portable usage
|
||||
* added ENET_SOCKOPT_REUSEADDR socket option
|
||||
* factored enet_socket_bind()/enet_socket_listen() out of enet_socket_create()
|
||||
* added contributed Code::Blocks build file
|
||||
|
||||
ENet 1.2 (February 12, 2008):
|
||||
|
||||
* fixed bug in VERIFY_CONNECT acknowledgement that could cause connect
|
||||
attempts to occasionally timeout
|
||||
* fixed acknowledgements to check both the outgoing and sent queues
|
||||
when removing acknowledged packets
|
||||
* fixed accidental bit rot in the MSVC project file
|
||||
* revised sequence number overflow handling to address some possible
|
||||
disconnect bugs
|
||||
* added enet_host_check_events() for getting only local queued events
|
||||
* factored out socket option setting into enet_socket_set_option() so
|
||||
that socket options are now set separately from enet_socket_create()
|
||||
|
||||
Caveats: While this release is superficially protocol compatible with 1.1,
|
||||
differences in the sequence number overflow handling can potentially cause
|
||||
random disconnects.
|
||||
|
||||
ENet 1.1 (June 6, 2007):
|
||||
|
||||
* optional CRC32 just in case someone needs a stronger checksum than UDP
|
||||
provides (--enable-crc32 configure option)
|
||||
* the size of packet headers are half the size they used to be (so less
|
||||
overhead when sending small packets)
|
||||
* enet_peer_disconnect_later() that waits till all queued outgoing
|
||||
packets get sent before issuing an actual disconnect
|
||||
* freeCallback field in individual packets for notification of when a
|
||||
packet is about to be freed
|
||||
* ENET_PACKET_FLAG_NO_ALLOCATE for supplying pre-allocated data to a
|
||||
packet (can be used in concert with freeCallback to support some custom
|
||||
allocation schemes that the normal memory allocation callbacks would
|
||||
normally not allow)
|
||||
* enet_address_get_host_ip() for printing address numbers
|
||||
* promoted the enet_socket_*() functions to be part of the API now
|
||||
* a few stability/crash fixes
|
||||
|
||||
|
||||
7
apps/plugins/sdl/progs/duke3d/Engine/src/enet/LICENSE
Normal file
7
apps/plugins/sdl/progs/duke3d/Engine/src/enet/LICENSE
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
Copyright (c) 2002-2015 Lee Salzman
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
15
apps/plugins/sdl/progs/duke3d/Engine/src/enet/README
Normal file
15
apps/plugins/sdl/progs/duke3d/Engine/src/enet/README
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
Please visit the ENet homepage at http://enet.bespin.org for installation
|
||||
and usage instructions.
|
||||
|
||||
If you obtained this package from github, the quick description on how to build
|
||||
is:
|
||||
|
||||
# Generate the build system.
|
||||
|
||||
autoreconf -vfi
|
||||
|
||||
# Compile and install the library.
|
||||
|
||||
./configure && make && make install
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
/**
|
||||
@file callbacks.h
|
||||
@brief ENet callbacks
|
||||
*/
|
||||
#ifndef __ENET_CALLBACKS_H__
|
||||
#define __ENET_CALLBACKS_H__
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
typedef struct _ENetCallbacks
|
||||
{
|
||||
void * (ENET_CALLBACK * malloc) (size_t size);
|
||||
void (ENET_CALLBACK * free) (void * memory);
|
||||
void (ENET_CALLBACK * no_memory) (void);
|
||||
} ENetCallbacks;
|
||||
|
||||
/** @defgroup callbacks ENet internal callbacks
|
||||
@{
|
||||
@ingroup private
|
||||
*/
|
||||
extern void * enet_malloc (size_t);
|
||||
extern void enet_free (void *);
|
||||
|
||||
/** @} */
|
||||
|
||||
#endif /* __ENET_CALLBACKS_H__ */
|
||||
|
||||
592
apps/plugins/sdl/progs/duke3d/Engine/src/enet/include/enet.h
Normal file
592
apps/plugins/sdl/progs/duke3d/Engine/src/enet/include/enet.h
Normal file
|
|
@ -0,0 +1,592 @@
|
|||
/**
|
||||
@file enet.h
|
||||
@brief ENet public header file
|
||||
*/
|
||||
#ifndef __ENET_ENET_H__
|
||||
#define __ENET_ENET_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#ifdef _WIN32
|
||||
#include "win32.h"
|
||||
#else
|
||||
#include "unix.h"
|
||||
#endif
|
||||
|
||||
#include "types.h"
|
||||
#include "protocol.h"
|
||||
#include "list.h"
|
||||
#include "callbacks.h"
|
||||
|
||||
#define ENET_VERSION_MAJOR 1
|
||||
#define ENET_VERSION_MINOR 3
|
||||
#define ENET_VERSION_PATCH 13
|
||||
#define ENET_VERSION_CREATE(major, minor, patch) (((major)<<16) | ((minor)<<8) | (patch))
|
||||
#define ENET_VERSION_GET_MAJOR(version) (((version)>>16)&0xFF)
|
||||
#define ENET_VERSION_GET_MINOR(version) (((version)>>8)&0xFF)
|
||||
#define ENET_VERSION_GET_PATCH(version) ((version)&0xFF)
|
||||
#define ENET_VERSION ENET_VERSION_CREATE(ENET_VERSION_MAJOR, ENET_VERSION_MINOR, ENET_VERSION_PATCH)
|
||||
|
||||
typedef enet_uint32 ENetVersion;
|
||||
|
||||
struct _ENetHost;
|
||||
struct _ENetEvent;
|
||||
struct _ENetPacket;
|
||||
|
||||
typedef enum _ENetSocketType
|
||||
{
|
||||
ENET_SOCKET_TYPE_STREAM = 1,
|
||||
ENET_SOCKET_TYPE_DATAGRAM = 2
|
||||
} ENetSocketType;
|
||||
|
||||
typedef enum _ENetSocketWait
|
||||
{
|
||||
ENET_SOCKET_WAIT_NONE = 0,
|
||||
ENET_SOCKET_WAIT_SEND = (1 << 0),
|
||||
ENET_SOCKET_WAIT_RECEIVE = (1 << 1),
|
||||
ENET_SOCKET_WAIT_INTERRUPT = (1 << 2)
|
||||
} ENetSocketWait;
|
||||
|
||||
typedef enum _ENetSocketOption
|
||||
{
|
||||
ENET_SOCKOPT_NONBLOCK = 1,
|
||||
ENET_SOCKOPT_BROADCAST = 2,
|
||||
ENET_SOCKOPT_RCVBUF = 3,
|
||||
ENET_SOCKOPT_SNDBUF = 4,
|
||||
ENET_SOCKOPT_REUSEADDR = 5,
|
||||
ENET_SOCKOPT_RCVTIMEO = 6,
|
||||
ENET_SOCKOPT_SNDTIMEO = 7,
|
||||
ENET_SOCKOPT_ERROR = 8,
|
||||
ENET_SOCKOPT_NODELAY = 9
|
||||
} ENetSocketOption;
|
||||
|
||||
typedef enum _ENetSocketShutdown
|
||||
{
|
||||
ENET_SOCKET_SHUTDOWN_READ = 0,
|
||||
ENET_SOCKET_SHUTDOWN_WRITE = 1,
|
||||
ENET_SOCKET_SHUTDOWN_READ_WRITE = 2
|
||||
} ENetSocketShutdown;
|
||||
|
||||
#define ENET_HOST_ANY 0
|
||||
#define ENET_HOST_BROADCAST 0xFFFFFFFFU
|
||||
#define ENET_PORT_ANY 0
|
||||
|
||||
/**
|
||||
* Portable internet address structure.
|
||||
*
|
||||
* The host must be specified in network byte-order, and the port must be in host
|
||||
* byte-order. The constant ENET_HOST_ANY may be used to specify the default
|
||||
* server host. The constant ENET_HOST_BROADCAST may be used to specify the
|
||||
* broadcast address (255.255.255.255). This makes sense for enet_host_connect,
|
||||
* but not for enet_host_create. Once a server responds to a broadcast, the
|
||||
* address is updated from ENET_HOST_BROADCAST to the server's actual IP address.
|
||||
*/
|
||||
typedef struct _ENetAddress
|
||||
{
|
||||
enet_uint32 host;
|
||||
enet_uint16 port;
|
||||
} ENetAddress;
|
||||
|
||||
/**
|
||||
* Packet flag bit constants.
|
||||
*
|
||||
* The host must be specified in network byte-order, and the port must be in
|
||||
* host byte-order. The constant ENET_HOST_ANY may be used to specify the
|
||||
* default server host.
|
||||
|
||||
@sa ENetPacket
|
||||
*/
|
||||
typedef enum _ENetPacketFlag
|
||||
{
|
||||
/** packet must be received by the target peer and resend attempts should be
|
||||
* made until the packet is delivered */
|
||||
ENET_PACKET_FLAG_RELIABLE = (1 << 0),
|
||||
/** packet will not be sequenced with other packets
|
||||
* not supported for reliable packets
|
||||
*/
|
||||
ENET_PACKET_FLAG_UNSEQUENCED = (1 << 1),
|
||||
/** packet will not allocate data, and user must supply it instead */
|
||||
ENET_PACKET_FLAG_NO_ALLOCATE = (1 << 2),
|
||||
/** packet will be fragmented using unreliable (instead of reliable) sends
|
||||
* if it exceeds the MTU */
|
||||
ENET_PACKET_FLAG_UNRELIABLE_FRAGMENT = (1 << 3),
|
||||
|
||||
/** whether the packet has been sent from all queues it has been entered into */
|
||||
ENET_PACKET_FLAG_SENT = (1<<8)
|
||||
} ENetPacketFlag;
|
||||
|
||||
typedef void (ENET_CALLBACK * ENetPacketFreeCallback) (struct _ENetPacket *);
|
||||
|
||||
/**
|
||||
* ENet packet structure.
|
||||
*
|
||||
* An ENet data packet that may be sent to or received from a peer. The shown
|
||||
* fields should only be read and never modified. The data field contains the
|
||||
* allocated data for the packet. The dataLength fields specifies the length
|
||||
* of the allocated data. The flags field is either 0 (specifying no flags),
|
||||
* or a bitwise-or of any combination of the following flags:
|
||||
*
|
||||
* ENET_PACKET_FLAG_RELIABLE - packet must be received by the target peer
|
||||
* and resend attempts should be made until the packet is delivered
|
||||
*
|
||||
* ENET_PACKET_FLAG_UNSEQUENCED - packet will not be sequenced with other packets
|
||||
* (not supported for reliable packets)
|
||||
*
|
||||
* ENET_PACKET_FLAG_NO_ALLOCATE - packet will not allocate data, and user must supply it instead
|
||||
|
||||
@sa ENetPacketFlag
|
||||
*/
|
||||
typedef struct _ENetPacket
|
||||
{
|
||||
size_t referenceCount; /**< internal use only */
|
||||
enet_uint32 flags; /**< bitwise-or of ENetPacketFlag constants */
|
||||
enet_uint8 * data; /**< allocated data for packet */
|
||||
size_t dataLength; /**< length of data */
|
||||
ENetPacketFreeCallback freeCallback; /**< function to be called when the packet is no longer in use */
|
||||
void * userData; /**< application private data, may be freely modified */
|
||||
} ENetPacket;
|
||||
|
||||
typedef struct _ENetAcknowledgement
|
||||
{
|
||||
ENetListNode acknowledgementList;
|
||||
enet_uint32 sentTime;
|
||||
ENetProtocol command;
|
||||
} ENetAcknowledgement;
|
||||
|
||||
typedef struct _ENetOutgoingCommand
|
||||
{
|
||||
ENetListNode outgoingCommandList;
|
||||
enet_uint16 reliableSequenceNumber;
|
||||
enet_uint16 unreliableSequenceNumber;
|
||||
enet_uint32 sentTime;
|
||||
enet_uint32 roundTripTimeout;
|
||||
enet_uint32 roundTripTimeoutLimit;
|
||||
enet_uint32 fragmentOffset;
|
||||
enet_uint16 fragmentLength;
|
||||
enet_uint16 sendAttempts;
|
||||
ENetProtocol command;
|
||||
ENetPacket * packet;
|
||||
} ENetOutgoingCommand;
|
||||
|
||||
typedef struct _ENetIncomingCommand
|
||||
{
|
||||
ENetListNode incomingCommandList;
|
||||
enet_uint16 reliableSequenceNumber;
|
||||
enet_uint16 unreliableSequenceNumber;
|
||||
ENetProtocol command;
|
||||
enet_uint32 fragmentCount;
|
||||
enet_uint32 fragmentsRemaining;
|
||||
enet_uint32 * fragments;
|
||||
ENetPacket * packet;
|
||||
} ENetIncomingCommand;
|
||||
|
||||
typedef enum _ENetPeerState
|
||||
{
|
||||
ENET_PEER_STATE_DISCONNECTED = 0,
|
||||
ENET_PEER_STATE_CONNECTING = 1,
|
||||
ENET_PEER_STATE_ACKNOWLEDGING_CONNECT = 2,
|
||||
ENET_PEER_STATE_CONNECTION_PENDING = 3,
|
||||
ENET_PEER_STATE_CONNECTION_SUCCEEDED = 4,
|
||||
ENET_PEER_STATE_CONNECTED = 5,
|
||||
ENET_PEER_STATE_DISCONNECT_LATER = 6,
|
||||
ENET_PEER_STATE_DISCONNECTING = 7,
|
||||
ENET_PEER_STATE_ACKNOWLEDGING_DISCONNECT = 8,
|
||||
ENET_PEER_STATE_ZOMBIE = 9
|
||||
} ENetPeerState;
|
||||
|
||||
#ifndef ENET_BUFFER_MAXIMUM
|
||||
#define ENET_BUFFER_MAXIMUM (1 + 2 * ENET_PROTOCOL_MAXIMUM_PACKET_COMMANDS)
|
||||
#endif
|
||||
|
||||
enum
|
||||
{
|
||||
ENET_HOST_RECEIVE_BUFFER_SIZE = 256 * 1024,
|
||||
ENET_HOST_SEND_BUFFER_SIZE = 256 * 1024,
|
||||
ENET_HOST_BANDWIDTH_THROTTLE_INTERVAL = 1000,
|
||||
ENET_HOST_DEFAULT_MTU = 1400,
|
||||
ENET_HOST_DEFAULT_MAXIMUM_PACKET_SIZE = 32 * 1024 * 1024,
|
||||
ENET_HOST_DEFAULT_MAXIMUM_WAITING_DATA = 32 * 1024 * 1024,
|
||||
|
||||
ENET_PEER_DEFAULT_ROUND_TRIP_TIME = 500,
|
||||
ENET_PEER_DEFAULT_PACKET_THROTTLE = 32,
|
||||
ENET_PEER_PACKET_THROTTLE_SCALE = 32,
|
||||
ENET_PEER_PACKET_THROTTLE_COUNTER = 7,
|
||||
ENET_PEER_PACKET_THROTTLE_ACCELERATION = 2,
|
||||
ENET_PEER_PACKET_THROTTLE_DECELERATION = 2,
|
||||
ENET_PEER_PACKET_THROTTLE_INTERVAL = 5000,
|
||||
ENET_PEER_PACKET_LOSS_SCALE = (1 << 16),
|
||||
ENET_PEER_PACKET_LOSS_INTERVAL = 10000,
|
||||
ENET_PEER_WINDOW_SIZE_SCALE = 64 * 1024,
|
||||
ENET_PEER_TIMEOUT_LIMIT = 32,
|
||||
ENET_PEER_TIMEOUT_MINIMUM = 5000,
|
||||
ENET_PEER_TIMEOUT_MAXIMUM = 30000,
|
||||
ENET_PEER_PING_INTERVAL = 500,
|
||||
ENET_PEER_UNSEQUENCED_WINDOWS = 64,
|
||||
ENET_PEER_UNSEQUENCED_WINDOW_SIZE = 1024,
|
||||
ENET_PEER_FREE_UNSEQUENCED_WINDOWS = 32,
|
||||
ENET_PEER_RELIABLE_WINDOWS = 16,
|
||||
ENET_PEER_RELIABLE_WINDOW_SIZE = 0x1000,
|
||||
ENET_PEER_FREE_RELIABLE_WINDOWS = 8
|
||||
};
|
||||
|
||||
typedef struct _ENetChannel
|
||||
{
|
||||
enet_uint16 outgoingReliableSequenceNumber;
|
||||
enet_uint16 outgoingUnreliableSequenceNumber;
|
||||
enet_uint16 usedReliableWindows;
|
||||
enet_uint16 reliableWindows [ENET_PEER_RELIABLE_WINDOWS];
|
||||
enet_uint16 incomingReliableSequenceNumber;
|
||||
enet_uint16 incomingUnreliableSequenceNumber;
|
||||
ENetList incomingReliableCommands;
|
||||
ENetList incomingUnreliableCommands;
|
||||
} ENetChannel;
|
||||
|
||||
/**
|
||||
* An ENet peer which data packets may be sent or received from.
|
||||
*
|
||||
* No fields should be modified unless otherwise specified.
|
||||
*/
|
||||
typedef struct _ENetPeer
|
||||
{
|
||||
ENetListNode dispatchList;
|
||||
struct _ENetHost * host;
|
||||
enet_uint16 outgoingPeerID;
|
||||
enet_uint16 incomingPeerID;
|
||||
enet_uint32 connectID;
|
||||
enet_uint8 outgoingSessionID;
|
||||
enet_uint8 incomingSessionID;
|
||||
ENetAddress address; /**< Internet address of the peer */
|
||||
void * data; /**< Application private data, may be freely modified */
|
||||
ENetPeerState state;
|
||||
ENetChannel * channels;
|
||||
size_t channelCount; /**< Number of channels allocated for communication with peer */
|
||||
enet_uint32 incomingBandwidth; /**< Downstream bandwidth of the client in bytes/second */
|
||||
enet_uint32 outgoingBandwidth; /**< Upstream bandwidth of the client in bytes/second */
|
||||
enet_uint32 incomingBandwidthThrottleEpoch;
|
||||
enet_uint32 outgoingBandwidthThrottleEpoch;
|
||||
enet_uint32 incomingDataTotal;
|
||||
enet_uint32 outgoingDataTotal;
|
||||
enet_uint32 lastSendTime;
|
||||
enet_uint32 lastReceiveTime;
|
||||
enet_uint32 nextTimeout;
|
||||
enet_uint32 earliestTimeout;
|
||||
enet_uint32 packetLossEpoch;
|
||||
enet_uint32 packetsSent;
|
||||
enet_uint32 packetsLost;
|
||||
enet_uint32 packetLoss; /**< mean packet loss of reliable packets as a ratio with respect to the constant ENET_PEER_PACKET_LOSS_SCALE */
|
||||
enet_uint32 packetLossVariance;
|
||||
enet_uint32 packetThrottle;
|
||||
enet_uint32 packetThrottleLimit;
|
||||
enet_uint32 packetThrottleCounter;
|
||||
enet_uint32 packetThrottleEpoch;
|
||||
enet_uint32 packetThrottleAcceleration;
|
||||
enet_uint32 packetThrottleDeceleration;
|
||||
enet_uint32 packetThrottleInterval;
|
||||
enet_uint32 pingInterval;
|
||||
enet_uint32 timeoutLimit;
|
||||
enet_uint32 timeoutMinimum;
|
||||
enet_uint32 timeoutMaximum;
|
||||
enet_uint32 lastRoundTripTime;
|
||||
enet_uint32 lowestRoundTripTime;
|
||||
enet_uint32 lastRoundTripTimeVariance;
|
||||
enet_uint32 highestRoundTripTimeVariance;
|
||||
enet_uint32 roundTripTime; /**< mean round trip time (RTT), in milliseconds, between sending a reliable packet and receiving its acknowledgement */
|
||||
enet_uint32 roundTripTimeVariance;
|
||||
enet_uint32 mtu;
|
||||
enet_uint32 windowSize;
|
||||
enet_uint32 reliableDataInTransit;
|
||||
enet_uint16 outgoingReliableSequenceNumber;
|
||||
ENetList acknowledgements;
|
||||
ENetList sentReliableCommands;
|
||||
ENetList sentUnreliableCommands;
|
||||
ENetList outgoingReliableCommands;
|
||||
ENetList outgoingUnreliableCommands;
|
||||
ENetList dispatchedCommands;
|
||||
int needsDispatch;
|
||||
enet_uint16 incomingUnsequencedGroup;
|
||||
enet_uint16 outgoingUnsequencedGroup;
|
||||
enet_uint32 unsequencedWindow [ENET_PEER_UNSEQUENCED_WINDOW_SIZE / 32];
|
||||
enet_uint32 eventData;
|
||||
size_t totalWaitingData;
|
||||
} ENetPeer;
|
||||
|
||||
/** An ENet packet compressor for compressing UDP packets before socket sends or receives.
|
||||
*/
|
||||
typedef struct _ENetCompressor
|
||||
{
|
||||
/** Context data for the compressor. Must be non-NULL. */
|
||||
void * context;
|
||||
/** Compresses from inBuffers[0:inBufferCount-1], containing inLimit bytes, to outData, outputting at most outLimit bytes. Should return 0 on failure. */
|
||||
size_t (ENET_CALLBACK * compress) (void * context, const ENetBuffer * inBuffers, size_t inBufferCount, size_t inLimit, enet_uint8 * outData, size_t outLimit);
|
||||
/** Decompresses from inData, containing inLimit bytes, to outData, outputting at most outLimit bytes. Should return 0 on failure. */
|
||||
size_t (ENET_CALLBACK * decompress) (void * context, const enet_uint8 * inData, size_t inLimit, enet_uint8 * outData, size_t outLimit);
|
||||
/** Destroys the context when compression is disabled or the host is destroyed. May be NULL. */
|
||||
void (ENET_CALLBACK * destroy) (void * context);
|
||||
} ENetCompressor;
|
||||
|
||||
/** Callback that computes the checksum of the data held in buffers[0:bufferCount-1] */
|
||||
typedef enet_uint32 (ENET_CALLBACK * ENetChecksumCallback) (const ENetBuffer * buffers, size_t bufferCount);
|
||||
|
||||
/** Callback for intercepting received raw UDP packets. Should return 1 to intercept, 0 to ignore, or -1 to propagate an error. */
|
||||
typedef int (ENET_CALLBACK * ENetInterceptCallback) (struct _ENetHost * host, struct _ENetEvent * event);
|
||||
|
||||
/** An ENet host for communicating with peers.
|
||||
*
|
||||
* No fields should be modified unless otherwise stated.
|
||||
|
||||
@sa enet_host_create()
|
||||
@sa enet_host_destroy()
|
||||
@sa enet_host_connect()
|
||||
@sa enet_host_service()
|
||||
@sa enet_host_flush()
|
||||
@sa enet_host_broadcast()
|
||||
@sa enet_host_compress()
|
||||
@sa enet_host_compress_with_range_coder()
|
||||
@sa enet_host_channel_limit()
|
||||
@sa enet_host_bandwidth_limit()
|
||||
@sa enet_host_bandwidth_throttle()
|
||||
*/
|
||||
typedef struct _ENetHost
|
||||
{
|
||||
ENetSocket socket;
|
||||
ENetAddress address; /**< Internet address of the host */
|
||||
enet_uint32 incomingBandwidth; /**< downstream bandwidth of the host */
|
||||
enet_uint32 outgoingBandwidth; /**< upstream bandwidth of the host */
|
||||
enet_uint32 bandwidthThrottleEpoch;
|
||||
enet_uint32 mtu;
|
||||
enet_uint32 randomSeed;
|
||||
int recalculateBandwidthLimits;
|
||||
ENetPeer * peers; /**< array of peers allocated for this host */
|
||||
size_t peerCount; /**< number of peers allocated for this host */
|
||||
size_t channelLimit; /**< maximum number of channels allowed for connected peers */
|
||||
enet_uint32 serviceTime;
|
||||
ENetList dispatchQueue;
|
||||
int continueSending;
|
||||
size_t packetSize;
|
||||
enet_uint16 headerFlags;
|
||||
ENetProtocol commands [ENET_PROTOCOL_MAXIMUM_PACKET_COMMANDS];
|
||||
size_t commandCount;
|
||||
ENetBuffer buffers [ENET_BUFFER_MAXIMUM];
|
||||
size_t bufferCount;
|
||||
ENetChecksumCallback checksum; /**< callback the user can set to enable packet checksums for this host */
|
||||
ENetCompressor compressor;
|
||||
enet_uint8 packetData [2][ENET_PROTOCOL_MAXIMUM_MTU];
|
||||
ENetAddress receivedAddress;
|
||||
enet_uint8 * receivedData;
|
||||
size_t receivedDataLength;
|
||||
enet_uint32 totalSentData; /**< total data sent, user should reset to 0 as needed to prevent overflow */
|
||||
enet_uint32 totalSentPackets; /**< total UDP packets sent, user should reset to 0 as needed to prevent overflow */
|
||||
enet_uint32 totalReceivedData; /**< total data received, user should reset to 0 as needed to prevent overflow */
|
||||
enet_uint32 totalReceivedPackets; /**< total UDP packets received, user should reset to 0 as needed to prevent overflow */
|
||||
ENetInterceptCallback intercept; /**< callback the user can set to intercept received raw UDP packets */
|
||||
size_t connectedPeers;
|
||||
size_t bandwidthLimitedPeers;
|
||||
size_t duplicatePeers; /**< optional number of allowed peers from duplicate IPs, defaults to ENET_PROTOCOL_MAXIMUM_PEER_ID */
|
||||
size_t maximumPacketSize; /**< the maximum allowable packet size that may be sent or received on a peer */
|
||||
size_t maximumWaitingData; /**< the maximum aggregate amount of buffer space a peer may use waiting for packets to be delivered */
|
||||
} ENetHost;
|
||||
|
||||
/**
|
||||
* An ENet event type, as specified in @ref ENetEvent.
|
||||
*/
|
||||
typedef enum _ENetEventType
|
||||
{
|
||||
/** no event occurred within the specified time limit */
|
||||
ENET_EVENT_TYPE_NONE = 0,
|
||||
|
||||
/** a connection request initiated by enet_host_connect has completed.
|
||||
* The peer field contains the peer which successfully connected.
|
||||
*/
|
||||
ENET_EVENT_TYPE_CONNECT = 1,
|
||||
|
||||
/** a peer has disconnected. This event is generated on a successful
|
||||
* completion of a disconnect initiated by enet_pper_disconnect, if
|
||||
* a peer has timed out, or if a connection request intialized by
|
||||
* enet_host_connect has timed out. The peer field contains the peer
|
||||
* which disconnected. The data field contains user supplied data
|
||||
* describing the disconnection, or 0, if none is available.
|
||||
*/
|
||||
ENET_EVENT_TYPE_DISCONNECT = 2,
|
||||
|
||||
/** a packet has been received from a peer. The peer field specifies the
|
||||
* peer which sent the packet. The channelID field specifies the channel
|
||||
* number upon which the packet was received. The packet field contains
|
||||
* the packet that was received; this packet must be destroyed with
|
||||
* enet_packet_destroy after use.
|
||||
*/
|
||||
ENET_EVENT_TYPE_RECEIVE = 3
|
||||
} ENetEventType;
|
||||
|
||||
/**
|
||||
* An ENet event as returned by enet_host_service().
|
||||
|
||||
@sa enet_host_service
|
||||
*/
|
||||
typedef struct _ENetEvent
|
||||
{
|
||||
ENetEventType type; /**< type of the event */
|
||||
ENetPeer * peer; /**< peer that generated a connect, disconnect or receive event */
|
||||
enet_uint8 channelID; /**< channel on the peer that generated the event, if appropriate */
|
||||
enet_uint32 data; /**< data associated with the event, if appropriate */
|
||||
ENetPacket * packet; /**< packet associated with the event, if appropriate */
|
||||
} ENetEvent;
|
||||
|
||||
/** @defgroup global ENet global functions
|
||||
@{
|
||||
*/
|
||||
|
||||
/**
|
||||
Initializes ENet globally. Must be called prior to using any functions in
|
||||
ENet.
|
||||
@returns 0 on success, < 0 on failure
|
||||
*/
|
||||
ENET_API int enet_initialize (void);
|
||||
|
||||
/**
|
||||
Initializes ENet globally and supplies user-overridden callbacks. Must be called prior to using any functions in ENet. Do not use enet_initialize() if you use this variant. Make sure the ENetCallbacks structure is zeroed out so that any additional callbacks added in future versions will be properly ignored.
|
||||
|
||||
@param version the constant ENET_VERSION should be supplied so ENet knows which version of ENetCallbacks struct to use
|
||||
@param inits user-overridden callbacks where any NULL callbacks will use ENet's defaults
|
||||
@returns 0 on success, < 0 on failure
|
||||
*/
|
||||
ENET_API int enet_initialize_with_callbacks (ENetVersion version, const ENetCallbacks * inits);
|
||||
|
||||
/**
|
||||
Shuts down ENet globally. Should be called when a program that has
|
||||
initialized ENet exits.
|
||||
*/
|
||||
ENET_API void enet_deinitialize (void);
|
||||
|
||||
/**
|
||||
Gives the linked version of the ENet library.
|
||||
@returns the version number
|
||||
*/
|
||||
ENET_API ENetVersion enet_linked_version (void);
|
||||
|
||||
/** @} */
|
||||
|
||||
/** @defgroup private ENet private implementation functions */
|
||||
|
||||
/**
|
||||
Returns the wall-time in milliseconds. Its initial value is unspecified
|
||||
unless otherwise set.
|
||||
*/
|
||||
ENET_API enet_uint32 enet_time_get (void);
|
||||
/**
|
||||
Sets the current wall-time in milliseconds.
|
||||
*/
|
||||
ENET_API void enet_time_set (enet_uint32);
|
||||
|
||||
/** @defgroup socket ENet socket functions
|
||||
@{
|
||||
*/
|
||||
ENET_API ENetSocket enet_socket_create (ENetSocketType);
|
||||
ENET_API int enet_socket_bind (ENetSocket, const ENetAddress *);
|
||||
ENET_API int enet_socket_get_address (ENetSocket, ENetAddress *);
|
||||
ENET_API int enet_socket_listen (ENetSocket, int);
|
||||
ENET_API ENetSocket enet_socket_accept (ENetSocket, ENetAddress *);
|
||||
ENET_API int enet_socket_connect (ENetSocket, const ENetAddress *);
|
||||
ENET_API int enet_socket_send (ENetSocket, const ENetAddress *, const ENetBuffer *, size_t);
|
||||
ENET_API int enet_socket_receive (ENetSocket, ENetAddress *, ENetBuffer *, size_t);
|
||||
ENET_API int enet_socket_wait (ENetSocket, enet_uint32 *, enet_uint32);
|
||||
ENET_API int enet_socket_set_option (ENetSocket, ENetSocketOption, int);
|
||||
ENET_API int enet_socket_get_option (ENetSocket, ENetSocketOption, int *);
|
||||
ENET_API int enet_socket_shutdown (ENetSocket, ENetSocketShutdown);
|
||||
ENET_API void enet_socket_destroy (ENetSocket);
|
||||
ENET_API int enet_socketset_select (ENetSocket, ENetSocketSet *, ENetSocketSet *, enet_uint32);
|
||||
|
||||
/** @} */
|
||||
|
||||
/** @defgroup Address ENet address functions
|
||||
@{
|
||||
*/
|
||||
/** Attempts to resolve the host named by the parameter hostName and sets
|
||||
the host field in the address parameter if successful.
|
||||
@param address destination to store resolved address
|
||||
@param hostName host name to lookup
|
||||
@retval 0 on success
|
||||
@retval < 0 on failure
|
||||
@returns the address of the given hostName in address on success
|
||||
*/
|
||||
ENET_API int enet_address_set_host (ENetAddress * address, const char * hostName);
|
||||
|
||||
/** Gives the printable form of the IP address specified in the address parameter.
|
||||
@param address address printed
|
||||
@param hostName destination for name, must not be NULL
|
||||
@param nameLength maximum length of hostName.
|
||||
@returns the null-terminated name of the host in hostName on success
|
||||
@retval 0 on success
|
||||
@retval < 0 on failure
|
||||
*/
|
||||
ENET_API int enet_address_get_host_ip (const ENetAddress * address, char * hostName, size_t nameLength);
|
||||
|
||||
/** Attempts to do a reverse lookup of the host field in the address parameter.
|
||||
@param address address used for reverse lookup
|
||||
@param hostName destination for name, must not be NULL
|
||||
@param nameLength maximum length of hostName.
|
||||
@returns the null-terminated name of the host in hostName on success
|
||||
@retval 0 on success
|
||||
@retval < 0 on failure
|
||||
*/
|
||||
ENET_API int enet_address_get_host (const ENetAddress * address, char * hostName, size_t nameLength);
|
||||
|
||||
/** @} */
|
||||
|
||||
ENET_API ENetPacket * enet_packet_create (const void *, size_t, enet_uint32);
|
||||
ENET_API void enet_packet_destroy (ENetPacket *);
|
||||
ENET_API int enet_packet_resize (ENetPacket *, size_t);
|
||||
ENET_API enet_uint32 enet_crc32 (const ENetBuffer *, size_t);
|
||||
|
||||
ENET_API ENetHost * enet_host_create (const ENetAddress *, size_t, size_t, enet_uint32, enet_uint32);
|
||||
ENET_API void enet_host_destroy (ENetHost *);
|
||||
ENET_API ENetPeer * enet_host_connect (ENetHost *, const ENetAddress *, size_t, enet_uint32);
|
||||
ENET_API int enet_host_check_events (ENetHost *, ENetEvent *);
|
||||
ENET_API int enet_host_service (ENetHost *, ENetEvent *, enet_uint32);
|
||||
ENET_API void enet_host_flush (ENetHost *);
|
||||
ENET_API void enet_host_broadcast (ENetHost *, enet_uint8, ENetPacket *);
|
||||
ENET_API void enet_host_compress (ENetHost *, const ENetCompressor *);
|
||||
ENET_API int enet_host_compress_with_range_coder (ENetHost * host);
|
||||
ENET_API void enet_host_channel_limit (ENetHost *, size_t);
|
||||
ENET_API void enet_host_bandwidth_limit (ENetHost *, enet_uint32, enet_uint32);
|
||||
extern void enet_host_bandwidth_throttle (ENetHost *);
|
||||
extern enet_uint32 enet_host_random_seed (void);
|
||||
|
||||
ENET_API int enet_peer_send (ENetPeer *, enet_uint8, ENetPacket *);
|
||||
ENET_API ENetPacket * enet_peer_receive (ENetPeer *, enet_uint8 * channelID);
|
||||
ENET_API void enet_peer_ping (ENetPeer *);
|
||||
ENET_API void enet_peer_ping_interval (ENetPeer *, enet_uint32);
|
||||
ENET_API void enet_peer_timeout (ENetPeer *, enet_uint32, enet_uint32, enet_uint32);
|
||||
ENET_API void enet_peer_reset (ENetPeer *);
|
||||
ENET_API void enet_peer_disconnect (ENetPeer *, enet_uint32);
|
||||
ENET_API void enet_peer_disconnect_now (ENetPeer *, enet_uint32);
|
||||
ENET_API void enet_peer_disconnect_later (ENetPeer *, enet_uint32);
|
||||
ENET_API void enet_peer_throttle_configure (ENetPeer *, enet_uint32, enet_uint32, enet_uint32);
|
||||
extern int enet_peer_throttle (ENetPeer *, enet_uint32);
|
||||
extern void enet_peer_reset_queues (ENetPeer *);
|
||||
extern void enet_peer_setup_outgoing_command (ENetPeer *, ENetOutgoingCommand *);
|
||||
extern ENetOutgoingCommand * enet_peer_queue_outgoing_command (ENetPeer *, const ENetProtocol *, ENetPacket *, enet_uint32, enet_uint16);
|
||||
extern ENetIncomingCommand * enet_peer_queue_incoming_command (ENetPeer *, const ENetProtocol *, const void *, size_t, enet_uint32, enet_uint32);
|
||||
extern ENetAcknowledgement * enet_peer_queue_acknowledgement (ENetPeer *, const ENetProtocol *, enet_uint16);
|
||||
extern void enet_peer_dispatch_incoming_unreliable_commands (ENetPeer *, ENetChannel *);
|
||||
extern void enet_peer_dispatch_incoming_reliable_commands (ENetPeer *, ENetChannel *);
|
||||
extern void enet_peer_on_connect (ENetPeer *);
|
||||
extern void enet_peer_on_disconnect (ENetPeer *);
|
||||
|
||||
ENET_API void * enet_range_coder_create (void);
|
||||
ENET_API void enet_range_coder_destroy (void *);
|
||||
ENET_API size_t enet_range_coder_compress (void *, const ENetBuffer *, size_t, size_t, enet_uint8 *, size_t);
|
||||
ENET_API size_t enet_range_coder_decompress (void *, const enet_uint8 *, size_t, enet_uint8 *, size_t);
|
||||
|
||||
extern size_t enet_protocol_command_size (enet_uint8);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __ENET_ENET_H__ */
|
||||
|
||||
43
apps/plugins/sdl/progs/duke3d/Engine/src/enet/include/list.h
Normal file
43
apps/plugins/sdl/progs/duke3d/Engine/src/enet/include/list.h
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
/**
|
||||
@file list.h
|
||||
@brief ENet list management
|
||||
*/
|
||||
#ifndef __ENET_LIST_H__
|
||||
#define __ENET_LIST_H__
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
typedef struct _ENetListNode
|
||||
{
|
||||
struct _ENetListNode * next;
|
||||
struct _ENetListNode * previous;
|
||||
} ENetListNode;
|
||||
|
||||
typedef ENetListNode * ENetListIterator;
|
||||
|
||||
typedef struct _ENetList
|
||||
{
|
||||
ENetListNode sentinel;
|
||||
} ENetList;
|
||||
|
||||
extern void enet_list_clear (ENetList *);
|
||||
|
||||
extern ENetListIterator enet_list_insert (ENetListIterator, void *);
|
||||
extern void * enet_list_remove (ENetListIterator);
|
||||
extern ENetListIterator enet_list_move (ENetListIterator, void *, void *);
|
||||
|
||||
extern size_t enet_list_size (ENetList *);
|
||||
|
||||
#define enet_list_begin(list) ((list) -> sentinel.next)
|
||||
#define enet_list_end(list) (& (list) -> sentinel)
|
||||
|
||||
#define enet_list_empty(list) (enet_list_begin (list) == enet_list_end (list))
|
||||
|
||||
#define enet_list_next(iterator) ((iterator) -> next)
|
||||
#define enet_list_previous(iterator) ((iterator) -> previous)
|
||||
|
||||
#define enet_list_front(list) ((void *) (list) -> sentinel.next)
|
||||
#define enet_list_back(list) ((void *) (list) -> sentinel.previous)
|
||||
|
||||
#endif /* __ENET_LIST_H__ */
|
||||
|
||||
198
apps/plugins/sdl/progs/duke3d/Engine/src/enet/include/protocol.h
Normal file
198
apps/plugins/sdl/progs/duke3d/Engine/src/enet/include/protocol.h
Normal file
|
|
@ -0,0 +1,198 @@
|
|||
/**
|
||||
@file protocol.h
|
||||
@brief ENet protocol
|
||||
*/
|
||||
#ifndef __ENET_PROTOCOL_H__
|
||||
#define __ENET_PROTOCOL_H__
|
||||
|
||||
#include "types.h"
|
||||
|
||||
enum
|
||||
{
|
||||
ENET_PROTOCOL_MINIMUM_MTU = 576,
|
||||
ENET_PROTOCOL_MAXIMUM_MTU = 4096,
|
||||
ENET_PROTOCOL_MAXIMUM_PACKET_COMMANDS = 32,
|
||||
ENET_PROTOCOL_MINIMUM_WINDOW_SIZE = 4096,
|
||||
ENET_PROTOCOL_MAXIMUM_WINDOW_SIZE = 65536,
|
||||
ENET_PROTOCOL_MINIMUM_CHANNEL_COUNT = 1,
|
||||
ENET_PROTOCOL_MAXIMUM_CHANNEL_COUNT = 255,
|
||||
ENET_PROTOCOL_MAXIMUM_PEER_ID = 0xFFF,
|
||||
ENET_PROTOCOL_MAXIMUM_FRAGMENT_COUNT = 1024 * 1024
|
||||
};
|
||||
|
||||
typedef enum _ENetProtocolCommand
|
||||
{
|
||||
ENET_PROTOCOL_COMMAND_NONE = 0,
|
||||
ENET_PROTOCOL_COMMAND_ACKNOWLEDGE = 1,
|
||||
ENET_PROTOCOL_COMMAND_CONNECT = 2,
|
||||
ENET_PROTOCOL_COMMAND_VERIFY_CONNECT = 3,
|
||||
ENET_PROTOCOL_COMMAND_DISCONNECT = 4,
|
||||
ENET_PROTOCOL_COMMAND_PING = 5,
|
||||
ENET_PROTOCOL_COMMAND_SEND_RELIABLE = 6,
|
||||
ENET_PROTOCOL_COMMAND_SEND_UNRELIABLE = 7,
|
||||
ENET_PROTOCOL_COMMAND_SEND_FRAGMENT = 8,
|
||||
ENET_PROTOCOL_COMMAND_SEND_UNSEQUENCED = 9,
|
||||
ENET_PROTOCOL_COMMAND_BANDWIDTH_LIMIT = 10,
|
||||
ENET_PROTOCOL_COMMAND_THROTTLE_CONFIGURE = 11,
|
||||
ENET_PROTOCOL_COMMAND_SEND_UNRELIABLE_FRAGMENT = 12,
|
||||
ENET_PROTOCOL_COMMAND_COUNT = 13,
|
||||
|
||||
ENET_PROTOCOL_COMMAND_MASK = 0x0F
|
||||
} ENetProtocolCommand;
|
||||
|
||||
typedef enum _ENetProtocolFlag
|
||||
{
|
||||
ENET_PROTOCOL_COMMAND_FLAG_ACKNOWLEDGE = (1 << 7),
|
||||
ENET_PROTOCOL_COMMAND_FLAG_UNSEQUENCED = (1 << 6),
|
||||
|
||||
ENET_PROTOCOL_HEADER_FLAG_COMPRESSED = (1 << 14),
|
||||
ENET_PROTOCOL_HEADER_FLAG_SENT_TIME = (1 << 15),
|
||||
ENET_PROTOCOL_HEADER_FLAG_MASK = ENET_PROTOCOL_HEADER_FLAG_COMPRESSED | ENET_PROTOCOL_HEADER_FLAG_SENT_TIME,
|
||||
|
||||
ENET_PROTOCOL_HEADER_SESSION_MASK = (3 << 12),
|
||||
ENET_PROTOCOL_HEADER_SESSION_SHIFT = 12
|
||||
} ENetProtocolFlag;
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma pack(push, 1)
|
||||
#define ENET_PACKED
|
||||
#elif defined(__GNUC__) || defined(__clang__)
|
||||
#define ENET_PACKED __attribute__ ((packed))
|
||||
#else
|
||||
#define ENET_PACKED
|
||||
#endif
|
||||
|
||||
typedef struct _ENetProtocolHeader
|
||||
{
|
||||
enet_uint16 peerID;
|
||||
enet_uint16 sentTime;
|
||||
} ENET_PACKED ENetProtocolHeader;
|
||||
|
||||
typedef struct _ENetProtocolCommandHeader
|
||||
{
|
||||
enet_uint8 command;
|
||||
enet_uint8 channelID;
|
||||
enet_uint16 reliableSequenceNumber;
|
||||
} ENET_PACKED ENetProtocolCommandHeader;
|
||||
|
||||
typedef struct _ENetProtocolAcknowledge
|
||||
{
|
||||
ENetProtocolCommandHeader header;
|
||||
enet_uint16 receivedReliableSequenceNumber;
|
||||
enet_uint16 receivedSentTime;
|
||||
} ENET_PACKED ENetProtocolAcknowledge;
|
||||
|
||||
typedef struct _ENetProtocolConnect
|
||||
{
|
||||
ENetProtocolCommandHeader header;
|
||||
enet_uint16 outgoingPeerID;
|
||||
enet_uint8 incomingSessionID;
|
||||
enet_uint8 outgoingSessionID;
|
||||
enet_uint32 mtu;
|
||||
enet_uint32 windowSize;
|
||||
enet_uint32 channelCount;
|
||||
enet_uint32 incomingBandwidth;
|
||||
enet_uint32 outgoingBandwidth;
|
||||
enet_uint32 packetThrottleInterval;
|
||||
enet_uint32 packetThrottleAcceleration;
|
||||
enet_uint32 packetThrottleDeceleration;
|
||||
enet_uint32 connectID;
|
||||
enet_uint32 data;
|
||||
} ENET_PACKED ENetProtocolConnect;
|
||||
|
||||
typedef struct _ENetProtocolVerifyConnect
|
||||
{
|
||||
ENetProtocolCommandHeader header;
|
||||
enet_uint16 outgoingPeerID;
|
||||
enet_uint8 incomingSessionID;
|
||||
enet_uint8 outgoingSessionID;
|
||||
enet_uint32 mtu;
|
||||
enet_uint32 windowSize;
|
||||
enet_uint32 channelCount;
|
||||
enet_uint32 incomingBandwidth;
|
||||
enet_uint32 outgoingBandwidth;
|
||||
enet_uint32 packetThrottleInterval;
|
||||
enet_uint32 packetThrottleAcceleration;
|
||||
enet_uint32 packetThrottleDeceleration;
|
||||
enet_uint32 connectID;
|
||||
} ENET_PACKED ENetProtocolVerifyConnect;
|
||||
|
||||
typedef struct _ENetProtocolBandwidthLimit
|
||||
{
|
||||
ENetProtocolCommandHeader header;
|
||||
enet_uint32 incomingBandwidth;
|
||||
enet_uint32 outgoingBandwidth;
|
||||
} ENET_PACKED ENetProtocolBandwidthLimit;
|
||||
|
||||
typedef struct _ENetProtocolThrottleConfigure
|
||||
{
|
||||
ENetProtocolCommandHeader header;
|
||||
enet_uint32 packetThrottleInterval;
|
||||
enet_uint32 packetThrottleAcceleration;
|
||||
enet_uint32 packetThrottleDeceleration;
|
||||
} ENET_PACKED ENetProtocolThrottleConfigure;
|
||||
|
||||
typedef struct _ENetProtocolDisconnect
|
||||
{
|
||||
ENetProtocolCommandHeader header;
|
||||
enet_uint32 data;
|
||||
} ENET_PACKED ENetProtocolDisconnect;
|
||||
|
||||
typedef struct _ENetProtocolPing
|
||||
{
|
||||
ENetProtocolCommandHeader header;
|
||||
} ENET_PACKED ENetProtocolPing;
|
||||
|
||||
typedef struct _ENetProtocolSendReliable
|
||||
{
|
||||
ENetProtocolCommandHeader header;
|
||||
enet_uint16 dataLength;
|
||||
} ENET_PACKED ENetProtocolSendReliable;
|
||||
|
||||
typedef struct _ENetProtocolSendUnreliable
|
||||
{
|
||||
ENetProtocolCommandHeader header;
|
||||
enet_uint16 unreliableSequenceNumber;
|
||||
enet_uint16 dataLength;
|
||||
} ENET_PACKED ENetProtocolSendUnreliable;
|
||||
|
||||
typedef struct _ENetProtocolSendUnsequenced
|
||||
{
|
||||
ENetProtocolCommandHeader header;
|
||||
enet_uint16 unsequencedGroup;
|
||||
enet_uint16 dataLength;
|
||||
} ENET_PACKED ENetProtocolSendUnsequenced;
|
||||
|
||||
typedef struct _ENetProtocolSendFragment
|
||||
{
|
||||
ENetProtocolCommandHeader header;
|
||||
enet_uint16 startSequenceNumber;
|
||||
enet_uint16 dataLength;
|
||||
enet_uint32 fragmentCount;
|
||||
enet_uint32 fragmentNumber;
|
||||
enet_uint32 totalLength;
|
||||
enet_uint32 fragmentOffset;
|
||||
} ENET_PACKED ENetProtocolSendFragment;
|
||||
|
||||
typedef union _ENetProtocol
|
||||
{
|
||||
ENetProtocolCommandHeader header;
|
||||
ENetProtocolAcknowledge acknowledge;
|
||||
ENetProtocolConnect connect;
|
||||
ENetProtocolVerifyConnect verifyConnect;
|
||||
ENetProtocolDisconnect disconnect;
|
||||
ENetProtocolPing ping;
|
||||
ENetProtocolSendReliable sendReliable;
|
||||
ENetProtocolSendUnreliable sendUnreliable;
|
||||
ENetProtocolSendUnsequenced sendUnsequenced;
|
||||
ENetProtocolSendFragment sendFragment;
|
||||
ENetProtocolBandwidthLimit bandwidthLimit;
|
||||
ENetProtocolThrottleConfigure throttleConfigure;
|
||||
} ENET_PACKED ENetProtocol;
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma pack(pop)
|
||||
#endif
|
||||
|
||||
#endif /* __ENET_PROTOCOL_H__ */
|
||||
|
||||
18
apps/plugins/sdl/progs/duke3d/Engine/src/enet/include/time.h
Normal file
18
apps/plugins/sdl/progs/duke3d/Engine/src/enet/include/time.h
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
/**
|
||||
@file time.h
|
||||
@brief ENet time constants and macros
|
||||
*/
|
||||
#ifndef __ENET_TIME_H__
|
||||
#define __ENET_TIME_H__
|
||||
|
||||
#define ENET_TIME_OVERFLOW 86400000
|
||||
|
||||
#define ENET_TIME_LESS(a, b) ((a) - (b) >= ENET_TIME_OVERFLOW)
|
||||
#define ENET_TIME_GREATER(a, b) ((b) - (a) >= ENET_TIME_OVERFLOW)
|
||||
#define ENET_TIME_LESS_EQUAL(a, b) (! ENET_TIME_GREATER (a, b))
|
||||
#define ENET_TIME_GREATER_EQUAL(a, b) (! ENET_TIME_LESS (a, b))
|
||||
|
||||
#define ENET_TIME_DIFFERENCE(a, b) ((a) - (b) >= ENET_TIME_OVERFLOW ? (b) - (a) : (a) - (b))
|
||||
|
||||
#endif /* __ENET_TIME_H__ */
|
||||
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
/**
|
||||
@file types.h
|
||||
@brief type definitions for ENet
|
||||
*/
|
||||
#ifndef __ENET_TYPES_H__
|
||||
#define __ENET_TYPES_H__
|
||||
|
||||
typedef unsigned char enet_uint8; /**< unsigned 8-bit type */
|
||||
typedef unsigned short enet_uint16; /**< unsigned 16-bit type */
|
||||
typedef unsigned int enet_uint32; /**< unsigned 32-bit type */
|
||||
|
||||
#endif /* __ENET_TYPES_H__ */
|
||||
|
||||
40
apps/plugins/sdl/progs/duke3d/Engine/src/enet/include/unix.h
Normal file
40
apps/plugins/sdl/progs/duke3d/Engine/src/enet/include/unix.h
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
/**
|
||||
@file unix.h
|
||||
@brief ENet Unix header
|
||||
*/
|
||||
#ifndef __ENET_UNIX_H__
|
||||
#define __ENET_UNIX_H__
|
||||
|
||||
#ifdef MSG_MAXIOVLEN
|
||||
#define ENET_BUFFER_MAXIMUM MSG_MAXIOVLEN
|
||||
#endif
|
||||
|
||||
typedef int ENetSocket;
|
||||
|
||||
#define ENET_SOCKET_NULL -1
|
||||
|
||||
#define ENET_HOST_TO_NET_16(value) (htons (value)) /**< macro that converts host to net byte-order of a 16-bit value */
|
||||
#define ENET_HOST_TO_NET_32(value) (htonl (value)) /**< macro that converts host to net byte-order of a 32-bit value */
|
||||
|
||||
#define ENET_NET_TO_HOST_16(value) (ntohs (value)) /**< macro that converts net to host byte-order of a 16-bit value */
|
||||
#define ENET_NET_TO_HOST_32(value) (ntohl (value)) /**< macro that converts net to host byte-order of a 32-bit value */
|
||||
|
||||
typedef struct
|
||||
{
|
||||
void * data;
|
||||
size_t dataLength;
|
||||
} ENetBuffer;
|
||||
|
||||
#define ENET_CALLBACK
|
||||
|
||||
#define ENET_API extern
|
||||
|
||||
typedef int ENetSocketSet;
|
||||
|
||||
#define ENET_SOCKETSET_EMPTY(sockset) FD_ZERO (& (sockset))
|
||||
#define ENET_SOCKETSET_ADD(sockset, socket) FD_SET (socket, & (sockset))
|
||||
#define ENET_SOCKETSET_REMOVE(sockset, socket) FD_CLR (socket, & (sockset))
|
||||
#define ENET_SOCKETSET_CHECK(sockset, socket) FD_ISSET (socket, & (sockset))
|
||||
|
||||
#endif /* __ENET_UNIX_H__ */
|
||||
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
/**
|
||||
@file utility.h
|
||||
@brief ENet utility header
|
||||
*/
|
||||
#ifndef __ENET_UTILITY_H__
|
||||
#define __ENET_UTILITY_H__
|
||||
|
||||
#define ENET_MAX(x, y) ((x) > (y) ? (x) : (y))
|
||||
#define ENET_MIN(x, y) ((x) < (y) ? (x) : (y))
|
||||
|
||||
#endif /* __ENET_UTILITY_H__ */
|
||||
|
||||
|
|
@ -0,0 +1,57 @@
|
|||
/**
|
||||
@file win32.h
|
||||
@brief ENet Win32 header
|
||||
*/
|
||||
#ifndef __ENET_WIN32_H__
|
||||
#define __ENET_WIN32_H__
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#ifdef ENET_BUILDING_LIB
|
||||
#pragma warning (disable: 4267) // size_t to int conversion
|
||||
#pragma warning (disable: 4244) // 64bit to 32bit int
|
||||
#pragma warning (disable: 4018) // signed/unsigned mismatch
|
||||
#pragma warning (disable: 4146) // unary minus operator applied to unsigned type
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <winsock2.h>
|
||||
|
||||
typedef SOCKET ENetSocket;
|
||||
|
||||
#define ENET_SOCKET_NULL INVALID_SOCKET
|
||||
|
||||
#define ENET_HOST_TO_NET_16(value) (htons (value))
|
||||
#define ENET_HOST_TO_NET_32(value) (htonl (value))
|
||||
|
||||
#define ENET_NET_TO_HOST_16(value) (ntohs (value))
|
||||
#define ENET_NET_TO_HOST_32(value) (ntohl (value))
|
||||
|
||||
typedef struct
|
||||
{
|
||||
size_t dataLength;
|
||||
void * data;
|
||||
} ENetBuffer;
|
||||
|
||||
#define ENET_CALLBACK __cdecl
|
||||
|
||||
#ifdef ENET_DLL
|
||||
#ifdef ENET_BUILDING_LIB
|
||||
#define ENET_API __declspec( dllexport )
|
||||
#else
|
||||
#define ENET_API __declspec( dllimport )
|
||||
#endif /* ENET_BUILDING_LIB */
|
||||
#else /* !ENET_DLL */
|
||||
#define ENET_API extern
|
||||
#endif /* ENET_DLL */
|
||||
|
||||
typedef fd_set ENetSocketSet;
|
||||
|
||||
#define ENET_SOCKETSET_EMPTY(sockset) FD_ZERO (& (sockset))
|
||||
#define ENET_SOCKETSET_ADD(sockset, socket) FD_SET (socket, & (sockset))
|
||||
#define ENET_SOCKETSET_REMOVE(sockset, socket) FD_CLR (socket, & (sockset))
|
||||
#define ENET_SOCKETSET_CHECK(sockset, socket) FD_ISSET (socket, & (sockset))
|
||||
|
||||
#endif /* __ENET_WIN32_H__ */
|
||||
|
||||
|
||||
9349
apps/plugins/sdl/progs/duke3d/Engine/src/engine.c
Normal file
9349
apps/plugins/sdl/progs/duke3d/Engine/src/engine.c
Normal file
File diff suppressed because it is too large
Load diff
164
apps/plugins/sdl/progs/duke3d/Engine/src/engine.h
Normal file
164
apps/plugins/sdl/progs/duke3d/Engine/src/engine.h
Normal file
|
|
@ -0,0 +1,164 @@
|
|||
/*
|
||||
* A list of all symbols exported from engine.c for a game's use.
|
||||
*
|
||||
* Put together by Ryan C. Gordon (icculus@clutteredmind.org)
|
||||
*
|
||||
* Please do NOT harrass Ken Silverman about any code modifications
|
||||
* (including this file) to BUILD.
|
||||
*/
|
||||
|
||||
/*
|
||||
* "Build Engine & Tools" Copyright (c) 1993-1997 Ken Silverman
|
||||
* Ken Silverman's official web site: "http://www.advsys.net/ken"
|
||||
* See the included license file "BUILDLIC.TXT" for license info.
|
||||
* This file IS NOT A PART OF Ken Silverman's original release
|
||||
*/
|
||||
|
||||
#ifndef _INCLUDE_ENGINE_H_
|
||||
#define _INCLUDE_ENGINE_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define ENGINE_DIR "/.rockbox/duke3d/"
|
||||
|
||||
//#define SUPERBUILD /* don't touch this. */
|
||||
|
||||
/*
|
||||
* this must be implemented by every program that uses the BUILD engine.
|
||||
* engine.c calls this function in several places.
|
||||
* See Ken's test game (in game.c), and his editor (in bstub.c) for examples.
|
||||
*/
|
||||
void faketimerhandler(void);
|
||||
|
||||
/*
|
||||
* exported engine functions, in absolutely no particular order.
|
||||
* See build.txt, build2.txt...and anything else with a .txt extention for
|
||||
* information on using these functions that may or may not be accurate. :)
|
||||
*/
|
||||
int initmouse(void);
|
||||
int setgamemode(uint8_t davidoption, int32_t daxdim, int32_t daydim);
|
||||
int getceilzofslope(int16_t sectnum, int32_t dax, int32_t day);
|
||||
int getflorzofslope(int16_t sectnum, int32_t dax, int32_t day);
|
||||
void getzsofslope(int16_t sectnum, int32_t dax, int32_t day, int32_t *ceilz, int32_t *florz);
|
||||
void setaspect(int32_t daxrange, int32_t daaspect);
|
||||
int insertsprite(int16_t sectnum, int16_t statnum);
|
||||
void updatesector(int32_t x, int32_t y, int16_t *sectnum);
|
||||
int lastwall(int16_t point);
|
||||
void initspritelists(void);
|
||||
int deletesprite(int16_t spritenum);
|
||||
int insertspritesect(int16_t sectnum);
|
||||
int deletespritesect(int16_t deleteme);
|
||||
int deletespritestat (int16_t deleteme);
|
||||
int insertspritestat(int16_t statnum);
|
||||
int changespritesect(int16_t spritenum, int16_t newsectnum);
|
||||
int changespritestat(int16_t spritenum, int16_t newstatnum);
|
||||
void loadtile(int16_t tilenume);
|
||||
|
||||
|
||||
void nextpage(void);
|
||||
void drawrooms(int32_t daposx, int32_t daposy, int32_t daposz,int16_t daang, int32_t dahoriz, int16_t dacursectnum);
|
||||
int loadboard(char *filename, int32_t *daposx, int32_t *daposy,int32_t *daposz, int16_t *daang, int16_t *dacursectnum);
|
||||
void drawmasks(void);
|
||||
void printext256(int32_t xpos, int32_t ypos, int16_t col, int16_t backcol,char name[82], uint8_t fontsize);
|
||||
|
||||
void initengine(void);
|
||||
void uninitengine(void);
|
||||
|
||||
int loadpics(char *filename, char * gamedir);
|
||||
int saveboard(char *filename, int32_t *daposx, int32_t *daposy, int32_t *daposz,int16_t *daang, int16_t *dacursectnum);
|
||||
void plotpixel(int32_t x, int32_t y, uint8_t col);
|
||||
uint8_t getpixel(int32_t x, int32_t y);
|
||||
void setbrightness(uint8_t dabrightness, uint8_t *dapal);
|
||||
int screencapture(char *filename, uint8_t inverseit);
|
||||
void getmousevalues(int16_t *mousx, int16_t *mousy, int16_t *bstatus);
|
||||
int clipmove (int32_t *x, int32_t *y, int32_t *z, int16_t *sectnum, int32_t xvect,int32_t yvect, int32_t walldist, int32_t ceildist,int32_t flordist, uint32_t cliptype);
|
||||
void getzrange(int32_t x, int32_t y, int32_t z, int16_t sectnum,int32_t *ceilz, int32_t *ceilhit, int32_t *florz, int32_t *florhit,int32_t walldist, uint32_t cliptype);
|
||||
int getangle(int32_t xvect, int32_t yvect);
|
||||
void alignceilslope(int16_t dasect, int32_t x, int32_t y, int32_t z);
|
||||
void alignflorslope(int16_t dasect, int32_t x, int32_t y, int32_t z);
|
||||
int hitscan(int32_t xs, int32_t ys, int32_t zs, int16_t sectnum,
|
||||
int32_t vx, int32_t vy, int32_t vz,
|
||||
int16_t *hitsect, int16_t *hitwall, int16_t *hitsprite,
|
||||
int32_t *hitx, int32_t *hity, int32_t *hitz, uint32_t cliptype);
|
||||
int inside (int32_t x, int32_t y, int16_t sectnum);
|
||||
void setfirstwall(int16_t sectnum, int16_t newfirstwall);
|
||||
void rotatepoint(int32_t xpivot, int32_t ypivot, int32_t x, int32_t y, int16_t daang,
|
||||
int32_t *x2, int32_t *y2);
|
||||
int drawtilescreen(int32_t pictopleft, int32_t picbox);
|
||||
void clearview(int32_t dacol);
|
||||
void clearallviews(int32_t dacol);
|
||||
void draw2dgrid(int32_t posxe, int32_t posye, int16_t ange, int32_t zoome,int16_t gride);
|
||||
void draw2dscreen(int32_t posxe, int32_t posye, int16_t ange, int32_t zoome,int16_t gride);
|
||||
int sectorofwall(int16_t theline);
|
||||
int setsprite(int16_t spritenum, int32_t newx, int32_t newy, int32_t newz);
|
||||
void dragpoint(int16_t pointhighlight, int32_t dax, int32_t day);
|
||||
int ksqrt(int32_t num);
|
||||
int loopnumofsector(int16_t sectnum, int16_t wallnum);
|
||||
int cansee(int32_t x1, int32_t y1, int32_t z1, int16_t sect1,int32_t x2, int32_t y2, int32_t z2, int16_t sect2);
|
||||
int lintersect(int32_t x1, int32_t y1, int32_t z1, int32_t x2, int32_t y2, int32_t z2, int32_t x3, int32_t y3, int32_t x4, int32_t y4, int32_t *intx,int32_t *inty, int32_t *intz);
|
||||
int rintersect(int32_t x1, int32_t y1, int32_t z1, int32_t vx, int32_t vy, int32_t vz,
|
||||
int32_t x3, int32_t y3, int32_t x4, int32_t y4, int32_t *intx,
|
||||
int32_t *inty, int32_t *intz);
|
||||
uint8_t* allocatepermanenttile(int16_t tilenume, int32_t xsiz, int32_t ysiz);
|
||||
void drawline256 (int32_t x1, int32_t y1, int32_t x2, int32_t y2, uint8_t col);
|
||||
void copytilepiece(int32_t tilenume1, int32_t sx1, int32_t sy1, int32_t xsiz, int32_t ysiz,
|
||||
int32_t tilenume2, int32_t sx2, int32_t sy2);
|
||||
int nextsectorneighborz(int16_t sectnum, int32_t thez,
|
||||
int16_t topbottom, int16_t direction);
|
||||
int neartag(int32_t xs, int32_t ys, int32_t zs, int16_t sectnum, int16_t ange,
|
||||
int16_t *neartagsector, int16_t *neartagwall, int16_t *neartagsprite,
|
||||
int32_t *neartaghitdist, int32_t neartagrange, uint8_t tagsearch);
|
||||
int pushmove(int32_t *x, int32_t *y, int32_t *z, int16_t *sectnum,
|
||||
int32_t walldist, int32_t ceildist, int32_t flordist,
|
||||
uint32_t cliptype);
|
||||
|
||||
int krand(void);
|
||||
|
||||
void flushperms(void);
|
||||
void rotatesprite(int32_t sx, int32_t sy, int32_t z, int16_t a, int16_t picnum,
|
||||
int8_t dashade, uint8_t dapalnum, uint8_t dastat,
|
||||
int32_t cx1, int32_t cy1, int32_t cx2, int32_t cy2);
|
||||
void makepalookup(int32_t palnum, uint8_t *remapbuf, int8_t r,
|
||||
int8_t g, int8_t b, uint8_t dastat);
|
||||
void drawmapview(int32_t dax, int32_t day, int32_t zoome, int16_t ang);
|
||||
void setview(int32_t x1, int32_t y1, int32_t x2, int32_t y2);
|
||||
void setviewtotile(int16_t tilenume, int32_t xsiz, int32_t ysiz);
|
||||
void setviewback(void);
|
||||
void squarerotatetile(int16_t tilenume);
|
||||
void preparemirror(int32_t dax, int32_t day, int32_t daz,
|
||||
int16_t daang, int32_t dahoriz, int16_t dawall,
|
||||
int16_t dasector, int32_t *tposx, int32_t *tposy,
|
||||
short *tang);
|
||||
void completemirror(void);
|
||||
int clipinsidebox(int32_t x, int32_t y, int16_t wallnum, int32_t walldist);
|
||||
|
||||
#include "cache.h"
|
||||
#include "filesystem.h"
|
||||
#include "display.h"
|
||||
#include "fixedPoint_math.h"
|
||||
#include "tiles.h"
|
||||
#include "network.h"
|
||||
|
||||
|
||||
//Exported for tile module
|
||||
extern int32_t setviewcnt;
|
||||
extern int32_t bakvidoption[4];
|
||||
extern uint8_t* bakframeplace[4];
|
||||
extern int32_t bakxsiz[4], bakysiz[4];
|
||||
extern int32_t bakwindowx1[4], bakwindowy1[4];
|
||||
extern int32_t bakwindowx2[4], bakwindowy2[4];
|
||||
extern uint8_t picsiz[MAXTILES], tilefilenum[MAXTILES];
|
||||
extern int16_t bakumost[MAXXDIM+1], bakdmost[MAXXDIM+1];
|
||||
extern int32_t numtilefiles, artfil , artfilnum, artfilplc;
|
||||
extern int32_t pow2long[32];
|
||||
extern int32_t artsize , cachesize ;
|
||||
extern int32_t tilefileoffs[MAXTILES];
|
||||
extern int32_t totalclocklock;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
877
apps/plugins/sdl/progs/duke3d/Engine/src/filesystem.c
Normal file
877
apps/plugins/sdl/progs/duke3d/Engine/src/filesystem.c
Normal file
|
|
@ -0,0 +1,877 @@
|
|||
//
|
||||
// filesystem.c
|
||||
// Duke3D
|
||||
//
|
||||
// Created by fabien sanglard on 12-12-19.
|
||||
// Copyright (c) 2012 fabien sanglard. All rights reserved.
|
||||
//
|
||||
|
||||
#include "filesystem.h"
|
||||
|
||||
#include "platform.h"
|
||||
#include "cache.h"
|
||||
#include "fixedPoint_math.h"
|
||||
#include "../../Game/src/global.h"
|
||||
|
||||
extern char game_dir[512];
|
||||
|
||||
//The multiplayer module in game.dll needs direct access to the crc32 (sic).
|
||||
int32_t groupefil_crc32[MAXGROUPFILES];
|
||||
|
||||
|
||||
// A typical GRP index entry:
|
||||
// - 12 bytes for filename
|
||||
// - 4 for filesize
|
||||
typedef uint8_t grpIndexEntry_t[16];
|
||||
|
||||
typedef struct grpArchive_s{
|
||||
|
||||
int32_t numFiles ;//Number of files in the archive.
|
||||
grpIndexEntry_t *gfilelist ;//Array containing the filenames.
|
||||
int32_t *fileOffsets ;//Array containing the file offsets.
|
||||
int32_t *filesizes ;//Array containing the file offsets.
|
||||
int fileDescriptor ;//The fd used for open,read operations.
|
||||
uint32_t crc32 ;//Hash to recognize GRP: Duke Shareware, Duke plutonimum etc...
|
||||
|
||||
int cache_len; // valid if cached == 1
|
||||
int cached; // 0 = not cached, 1 = partial, 2 = full
|
||||
uint8_t *data; // entire file in RAM
|
||||
} __attribute__((packed)) grpArchive_t;
|
||||
|
||||
//All GRP opened are in this structure
|
||||
typedef struct grpSet_s{
|
||||
grpArchive_t archives[MAXGROUPFILES];
|
||||
int32_t num;
|
||||
} __attribute__((packed)) grpSet_t;
|
||||
|
||||
// Marking it static gurantee not only invisility outside module
|
||||
// but also that the content will be set to 0.
|
||||
static grpSet_t grpSet;
|
||||
|
||||
int32_t filelength(int32_t fd);
|
||||
|
||||
int32_t initgroupfile(const char *filename)
|
||||
{
|
||||
uint8_t buf[16] ;
|
||||
int32_t i, j, k ;
|
||||
grpArchive_t* archive ;
|
||||
|
||||
|
||||
|
||||
printf("Loading %s ...\n", filename);
|
||||
|
||||
if (grpSet.num == MAXGROUPFILES){
|
||||
printf("Error: Unable to open an extra GRP archive <= No more slot available.\n");
|
||||
return(-1);
|
||||
}
|
||||
|
||||
archive = &grpSet.archives[grpSet.num];
|
||||
|
||||
//Init the slot
|
||||
memset(archive, 0, sizeof(grpArchive_t));
|
||||
|
||||
//groupfil_memory[numgroupfiles] = NULL; // addresses of raw GRP files in memory
|
||||
//groupefil_crc32[numgroupfiles] = 0;
|
||||
|
||||
archive->fileDescriptor = open(filename,O_BINARY|O_RDONLY);
|
||||
|
||||
if (archive->fileDescriptor < 0){
|
||||
printf("Error: Unable to open file %s.\n",filename);
|
||||
|
||||
exit(0);
|
||||
}
|
||||
|
||||
|
||||
read(archive->fileDescriptor,buf,16);
|
||||
|
||||
//FCS : The ".grp" file format is just a collection of a lot of files stored into 1 big one.
|
||||
//KS doc: I tried to make the format as simple as possible: The first 12 bytes contains my name,
|
||||
//"KenSilverman". The next 4 bytes is the number of files that were compacted into the
|
||||
//group file. Then for each file, there is a 16 byte structure, where the first 12
|
||||
//bytes are the filename, and the last 4 bytes are the file's size. The rest of the
|
||||
//group file is just the raw data packed one after the other in the same order as the list
|
||||
//of files. - ken
|
||||
|
||||
// Check the magic number (12 bytes header).
|
||||
if ((buf[0] != 'K') || (buf[1] != 'e') || (buf[2] != 'n') ||
|
||||
(buf[3] != 'S') || (buf[4] != 'i') || (buf[5] != 'l') ||
|
||||
(buf[6] != 'v') || (buf[7] != 'e') || (buf[8] != 'r') ||
|
||||
(buf[9] != 'm') || (buf[10] != 'a') || (buf[11] != 'n')){
|
||||
printf("Error: File %s is not a GRP archive.\n",filename);
|
||||
return(-1);
|
||||
}
|
||||
|
||||
// The next 4 bytes of the header feature the number of files in the GRP archive.
|
||||
archive->numFiles = BUILDSWAP_INTEL32(*((int32_t *)&buf[12]));
|
||||
|
||||
|
||||
archive->gfilelist = kmalloc(archive->numFiles * sizeof(grpIndexEntry_t));
|
||||
archive->fileOffsets = kmalloc(archive->numFiles * sizeof(int32_t));
|
||||
archive->filesizes = kmalloc(archive->numFiles * sizeof(int32_t));
|
||||
|
||||
// Load the full index 16 bytes per file (12bytes for name + 4 bytes for the size).
|
||||
read(archive->fileDescriptor,archive->gfilelist, archive->numFiles * 16);
|
||||
|
||||
//Initialize all file offset and pointers.
|
||||
j = 12 + 4 + archive->numFiles * sizeof(grpIndexEntry_t);
|
||||
for(i=0;i<archive->numFiles;i++){
|
||||
|
||||
k = BUILDSWAP_INTEL32(*((int32_t *)&archive->gfilelist[i][12])); // get size
|
||||
|
||||
// Now that the filesize has been read, we can replace it with '0' and hence have a
|
||||
// valid, null terminated character string that will be usable.
|
||||
archive->gfilelist[i][12] = '\0';
|
||||
archive->filesizes[i] = k;
|
||||
archive->fileOffsets[i] = j; // absolute offset list of all files.
|
||||
j += k;
|
||||
}
|
||||
//archive->fileOffsets[archive->numFiles-1] = j;
|
||||
|
||||
|
||||
// Compute CRC32 of the whole grp and implicitely caches the GRP in memory through windows caching service.
|
||||
// Rewind the fileDescriptor
|
||||
lseek(archive->fileDescriptor, 0, SEEK_SET);
|
||||
|
||||
//i = 1000000;
|
||||
//groupfil_memory[numgroupfiles] = malloc(i);
|
||||
|
||||
//Load the full GRP in RAM.
|
||||
|
||||
int total = filelength(archive->fileDescriptor);
|
||||
|
||||
#define CRC_BUFLEN 1024*128
|
||||
|
||||
/* Atomic Edition won't fit */
|
||||
if(total > MEMORYSIZE / 2 * 1024 * 1024)
|
||||
{
|
||||
#if MEMORYSIZE > 32
|
||||
archive->cached = 1;
|
||||
archive->cache_len = 24 * 1024 * 1024; /* arbitrary, but must be multiple of CRC_BUFLEN (currently 1024*128) */
|
||||
assert(archive->cache_len % CRC_BUFLEN == 0);
|
||||
archive->data = malloc(archive->cache_len);
|
||||
#else
|
||||
archive->cached = 0;
|
||||
archive->data = 0;
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
archive->data = malloc(total);
|
||||
archive->cached = archive->data != NULL ? 2 : 0;
|
||||
}
|
||||
|
||||
switch(archive->cached)
|
||||
{
|
||||
case 2:
|
||||
printf("Caching complete GRP in RAM (%d KB)\n", total / 1024);
|
||||
break;
|
||||
case 1:
|
||||
printf("Partially caching GRP in RAM (%d KB/%d KB)\n", archive->cache_len / 1024, total / 1024);
|
||||
break;
|
||||
default:
|
||||
printf("Not caching large GRP (%d KB)", total / 1024);
|
||||
break;
|
||||
}
|
||||
|
||||
uint8_t *crcBuffer = NULL;
|
||||
/* we need a temporary buffer to calculate the CRC if it's not being cached */
|
||||
if(!archive->cached)
|
||||
crcBuffer = malloc(CRC_BUFLEN);
|
||||
else
|
||||
crcBuffer = archive->data;
|
||||
|
||||
int loop = 0;
|
||||
int bytes = 0;
|
||||
bool stop_inc = false;
|
||||
while((j=read(archive->fileDescriptor, crcBuffer, CRC_BUFLEN))) {
|
||||
archive->crc32 = crc32_update(crcBuffer,j,archive->crc32);
|
||||
|
||||
/* crcBuffer points to a permanent buffer */
|
||||
if(archive->cached)
|
||||
{
|
||||
if(!stop_inc)
|
||||
crcBuffer += j;
|
||||
|
||||
if(archive->cached == 1 && !stop_inc)
|
||||
{
|
||||
if(crcBuffer - archive->data >= archive->cache_len) /* we've read enough, further reads go into a temp buffer */
|
||||
{
|
||||
crcBuffer = malloc(CRC_BUFLEN);
|
||||
stop_inc = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bytes += j;
|
||||
loop++;
|
||||
|
||||
if(loop % 16 == 0)
|
||||
printf("%d%% complete...\n", (int)(100.0 * bytes / (float)total)); // sorry
|
||||
//rb->splashf(0, "point -%d", loop);
|
||||
}
|
||||
|
||||
if(!archive->cached || stop_inc)
|
||||
free(crcBuffer);
|
||||
|
||||
// The game layer seems to absolutely need to access an array int[4] groupefil_crc32
|
||||
// so we need to store the crc32 in there too.
|
||||
groupefil_crc32[grpSet.num] = archive->crc32;
|
||||
|
||||
//free(groupfil_memory[numgroupfiles]);
|
||||
//groupfil_memory[numgroupfiles] = 0;
|
||||
|
||||
grpSet.num++;
|
||||
|
||||
return(grpSet.num-1);
|
||||
|
||||
}
|
||||
|
||||
void uninitgroupfile(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
for( i=0 ; i < grpSet.num ;i++){
|
||||
close(grpSet.archives[i].fileDescriptor);
|
||||
if(grpSet.archives[i].cached)
|
||||
free(grpSet.archives[i].data);
|
||||
free(grpSet.archives[i].gfilelist);
|
||||
free(grpSet.archives[i].fileOffsets);
|
||||
free(grpSet.archives[i].filesizes);
|
||||
memset(&grpSet.archives[i], 0, sizeof(grpArchive_t));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void crc32_table_gen(unsigned int* crc32_table) /* build CRC32 table */
|
||||
{
|
||||
unsigned int crc, poly;
|
||||
int i, j;
|
||||
|
||||
poly = 0xEDB88320L;
|
||||
for (i = 0; i < 256; i++)
|
||||
{
|
||||
crc = i;
|
||||
for (j = 8; j > 0; j--)
|
||||
{
|
||||
if (crc & 1)
|
||||
crc = (crc >> 1) ^ poly;
|
||||
else
|
||||
crc >>= 1;
|
||||
}
|
||||
crc32_table[i] = crc;
|
||||
}
|
||||
}
|
||||
|
||||
unsigned int crc32(uint8_t *buf, unsigned int length)
|
||||
{
|
||||
unsigned int initial_crc;
|
||||
|
||||
initial_crc = 0;
|
||||
return(crc32_update(buf, length, initial_crc));
|
||||
}
|
||||
|
||||
uint32_t crc32_update(uint8_t *buf, uint32_t length, uint32_t crc_to_update)
|
||||
{
|
||||
unsigned int crc32_table[256];
|
||||
|
||||
crc32_table_gen(crc32_table);
|
||||
|
||||
crc_to_update ^= 0xFFFFFFFF;
|
||||
|
||||
while (length--)
|
||||
crc_to_update = crc32_table[(crc_to_update ^ *buf++) & 0xFF] ^ (crc_to_update >> 8);
|
||||
|
||||
return crc_to_update ^ 0xFFFFFFFF;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 16 12 5
|
||||
* this is the CCITT CRC 16 polynomial X + X + X + 1.
|
||||
* This is 0x1021 when x is 2, but the way the algorithm works
|
||||
* we use 0x8408 (the reverse of the bit pattern). The high
|
||||
* bit is always assumed to be set, thus we only use 16 bits to
|
||||
* represent the 17 bit value.
|
||||
*/
|
||||
|
||||
#define POLY 0x8408 /* 1021H bit reversed */
|
||||
|
||||
uint16_t crc16(uint8_t *data_p, uint16_t length)
|
||||
{
|
||||
uint8_t i;
|
||||
unsigned int data;
|
||||
unsigned int crc = 0xffff;
|
||||
|
||||
if (length == 0)
|
||||
return (~crc);
|
||||
do
|
||||
{
|
||||
for (i=0, data=(unsigned int)0xff & *data_p++;
|
||||
i < 8;
|
||||
i++, data >>= 1)
|
||||
{
|
||||
if ((crc & 0x0001) ^ (data & 0x0001))
|
||||
crc = (crc >> 1) ^ POLY;
|
||||
else crc >>= 1;
|
||||
}
|
||||
} while (--length);
|
||||
|
||||
crc = ~crc;
|
||||
data = crc;
|
||||
crc = (crc << 8) | (data >> 8 & 0xff);
|
||||
|
||||
return (crc);
|
||||
}
|
||||
|
||||
// The engine can open files transparently on the filesystem or on the GRPsystem
|
||||
enum fileType_e{ SYSTEM_FILE, GRP_FILE} ;
|
||||
|
||||
//An entry in the array tracking open files
|
||||
typedef struct openFile_s{
|
||||
enum fileType_e type ;
|
||||
int fd ; //Either the fileDescriptor or the fileIndex in a GRP depending on the type.
|
||||
int cursor ; //lseek cursor
|
||||
int grpID ; //GRP id
|
||||
int used ; //Marker 1=used
|
||||
} openFile_t;
|
||||
|
||||
|
||||
#define MAXOPENFILES 64
|
||||
static openFile_t openFiles[MAXOPENFILES];
|
||||
|
||||
int32_t kopen4load(const char *filename, int openOnlyFromGRP){
|
||||
|
||||
int32_t i, k;
|
||||
int32_t newhandle;
|
||||
|
||||
grpArchive_t* archive;
|
||||
|
||||
//Search a free slot
|
||||
newhandle = MAXOPENFILES-1;
|
||||
while (openFiles[newhandle].used && newhandle >= 0)
|
||||
newhandle--;
|
||||
|
||||
|
||||
if (newhandle < 0)
|
||||
Error(EXIT_FAILURE, "Too Many files open!\n");
|
||||
|
||||
|
||||
//Try to look in the filesystem first. In this case fd = filedescriptor.
|
||||
if(!openOnlyFromGRP){
|
||||
|
||||
openFiles[newhandle].fd = open(filename,O_BINARY|O_RDONLY);
|
||||
|
||||
#if 0
|
||||
if(openFiles[newhandle].fd < 0)
|
||||
perror(filename);
|
||||
#endif
|
||||
if (openFiles[newhandle].fd >= 0){
|
||||
openFiles[newhandle].type = SYSTEM_FILE;
|
||||
openFiles[newhandle].cursor = 0;
|
||||
openFiles[newhandle].used = 1;
|
||||
return(newhandle);
|
||||
}
|
||||
}
|
||||
|
||||
//Try to look in the GRP archives. In this case fd = index of the file in the GRP.
|
||||
for(k=grpSet.num-1;k>=0;k--)
|
||||
{
|
||||
archive = &grpSet.archives[k];
|
||||
|
||||
for(i=archive->numFiles-1;i>=0;i--){
|
||||
|
||||
if (!strncasecmp((char*)archive->gfilelist[i],filename,12)){
|
||||
|
||||
openFiles[newhandle].type = GRP_FILE;
|
||||
openFiles[newhandle].used = 1;
|
||||
openFiles[newhandle].cursor = 0;
|
||||
openFiles[newhandle].fd = i;
|
||||
openFiles[newhandle].grpID = k;
|
||||
LOGF("found GRP %s", filename);
|
||||
return(newhandle);
|
||||
}
|
||||
}
|
||||
}
|
||||
LOGF("kopen4load: couldn't find %s in GRP", filename);
|
||||
|
||||
return(-1);
|
||||
|
||||
}
|
||||
|
||||
int32_t kread(int32_t handle, void *buffer, int32_t leng){
|
||||
|
||||
openFile_t * openFile ;
|
||||
grpArchive_t * archive ;
|
||||
|
||||
openFile = &openFiles[handle];
|
||||
|
||||
if (!openFile->used){
|
||||
printf("Invalide handle. Unrecoverable error.\n");
|
||||
getchar();
|
||||
exit(0);
|
||||
}
|
||||
|
||||
//FILESYSTEM ? OS takes care of it !
|
||||
if (openFile->type == SYSTEM_FILE){
|
||||
return(read(openFile->fd,buffer,leng));
|
||||
}
|
||||
|
||||
//File is actually in the GRP
|
||||
archive = & grpSet.archives[openFile->grpID];
|
||||
|
||||
//Adjust leng so we cannot read more than filesystem-cursor location.
|
||||
leng = min(leng,archive->filesizes[openFile->fd]-openFile->cursor);
|
||||
|
||||
if(!archive->cached)
|
||||
{
|
||||
lseek(archive->fileDescriptor,
|
||||
archive->fileOffsets[openFile->fd] + openFile->cursor,
|
||||
SEEK_SET);
|
||||
leng = read(archive->fileDescriptor,buffer,leng);
|
||||
}
|
||||
else
|
||||
{
|
||||
if(archive->cached == 2) /* completely in RAM */
|
||||
memcpy(buffer, archive->data + archive->fileOffsets[openFile->fd] + openFile->cursor, leng);
|
||||
else
|
||||
{
|
||||
/* 3 cases here: either it's completely outside the cached region, in which case we
|
||||
* fall back to a disk read; it can be on a boundary; or completely in RAM */
|
||||
int ofs = archive->fileOffsets[openFile->fd];
|
||||
int start = ofs + openFile->cursor;
|
||||
|
||||
/* completely outside */
|
||||
if(start >= archive->cache_len)
|
||||
{
|
||||
lseek(archive->fileDescriptor,
|
||||
start,
|
||||
SEEK_SET);
|
||||
leng = read(archive->fileDescriptor, buffer, leng);
|
||||
}
|
||||
else
|
||||
{
|
||||
int end = start + leng - 1;
|
||||
/* partial */
|
||||
if(end >= archive->cache_len)
|
||||
{
|
||||
/* in-RAM portion */
|
||||
memcpy(buffer, archive->data + start,
|
||||
archive->cache_len - start);
|
||||
|
||||
/* disk */
|
||||
lseek(archive->fileDescriptor, archive->cache_len, SEEK_SET);
|
||||
|
||||
leng = archive->cache_len - start +
|
||||
read(archive->fileDescriptor, buffer + archive->cache_len - start,
|
||||
end - archive->cache_len);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* fully in RAM */
|
||||
memcpy(buffer, archive->data + ofs + openFile->cursor,
|
||||
leng);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
openFile->cursor += leng;
|
||||
|
||||
return leng;
|
||||
|
||||
}
|
||||
|
||||
int32_t kread16(int32_t handle, int16_t *buffer){
|
||||
if (kread(handle, buffer, 2) != 2)
|
||||
return(0);
|
||||
|
||||
*buffer = BUILDSWAP_INTEL16(*buffer);
|
||||
return(1);
|
||||
}
|
||||
|
||||
int32_t kread32(int32_t handle, int32_t *buffer){
|
||||
if (kread(handle, buffer, 4) != 4)
|
||||
return(0);
|
||||
|
||||
*buffer = BUILDSWAP_INTEL32(*buffer);
|
||||
return(1);
|
||||
}
|
||||
|
||||
int32_t kread8(int32_t handle, uint8_t *buffer){
|
||||
if (kread(handle, buffer, 1) != 1)
|
||||
return(0);
|
||||
|
||||
return(1);
|
||||
}
|
||||
|
||||
int32_t klseek(int32_t handle, int32_t offset, int whence){
|
||||
|
||||
grpArchive_t* archive;
|
||||
|
||||
if (!openFiles[handle].used){
|
||||
printf("Invalide handle. Unrecoverable error.\n");
|
||||
getchar();
|
||||
exit(0);
|
||||
}
|
||||
|
||||
// FILESYSTEM ? OS will take care of it.
|
||||
if (openFiles[handle].type == SYSTEM_FILE){
|
||||
return lseek(openFiles[handle].fd,offset,whence);
|
||||
}
|
||||
|
||||
|
||||
archive = & grpSet.archives [ openFiles[handle].grpID ];
|
||||
|
||||
switch(whence){
|
||||
case SEEK_SET: openFiles[handle].cursor = offset; break;
|
||||
case SEEK_END: openFiles[handle].cursor = archive->filesizes[openFiles[handle].fd]; break;
|
||||
case SEEK_CUR: openFiles[handle].cursor += offset; break;
|
||||
}
|
||||
|
||||
return(openFiles[handle].cursor);
|
||||
|
||||
|
||||
}
|
||||
|
||||
int32_t filelength(int32_t fd)
|
||||
{
|
||||
off_t cur = lseek(fd, 0, SEEK_CUR);
|
||||
off_t len = lseek(fd, 0, SEEK_END);
|
||||
lseek(fd, cur, SEEK_SET);
|
||||
return len;
|
||||
}
|
||||
|
||||
int32_t kfilelength(int32_t handle)
|
||||
{
|
||||
openFile_t* openFile = &openFiles[handle];
|
||||
|
||||
if (!openFile->used){
|
||||
printf("Invalide handle. Unrecoverable error.\n");
|
||||
getchar();
|
||||
exit(0);
|
||||
}
|
||||
|
||||
if (openFile->type == SYSTEM_FILE){
|
||||
LOGF("calling filelength");
|
||||
return(filelength(openFile->fd));
|
||||
}
|
||||
|
||||
else{
|
||||
grpArchive_t* archive = &grpSet.archives[ openFile->grpID ];
|
||||
return archive->filesizes[openFile->fd];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void kclose(int32_t handle)
|
||||
{
|
||||
openFile_t* openFile = &openFiles[handle];
|
||||
|
||||
//This is a typical handle for a non existing file.
|
||||
if (handle == -1)
|
||||
return;
|
||||
|
||||
if (!openFile->used){
|
||||
printf("Invalide handle. Unrecoverable error.\n");
|
||||
getchar();
|
||||
exit(0);
|
||||
}
|
||||
|
||||
if (openFile->type == SYSTEM_FILE){
|
||||
close(openFile->fd);
|
||||
}
|
||||
|
||||
memset(openFile, 0, sizeof(openFile_t));
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/* Internal LZW variables */
|
||||
#define LZWSIZE 16384 /* Watch out for shorts! */
|
||||
static uint8_t *lzwbuf1, *lzwbuf4, *lzwbuf5;
|
||||
static uint8_t lzwbuflock[5];
|
||||
static short *lzwbuf2, *lzwbuf3;
|
||||
|
||||
|
||||
|
||||
int32_t compress(uint8_t *lzwinbuf, int32_t uncompleng, uint8_t *lzwoutbuf)
|
||||
{
|
||||
int32_t i, addr, newaddr, addrcnt, zx, *longptr;
|
||||
int32_t bytecnt1, bitcnt, numbits, oneupnumbits;
|
||||
short *shortptr;
|
||||
|
||||
for(i=255;i>=0;i--) { lzwbuf1[i] = (uint8_t ) i; lzwbuf3[i] = (short) ((i+1)&255); }
|
||||
clearbuf((void *) (lzwbuf2),256>>1,0xffffffff);
|
||||
clearbuf((void *) (lzwoutbuf),((uncompleng+15)+3)>>2,0L);
|
||||
|
||||
addrcnt = 256; bytecnt1 = 0; bitcnt = (4<<3);
|
||||
numbits = 8; oneupnumbits = (1<<8);
|
||||
do
|
||||
{
|
||||
addr = lzwinbuf[bytecnt1];
|
||||
do
|
||||
{
|
||||
bytecnt1++;
|
||||
if (bytecnt1 == uncompleng) break;
|
||||
if (lzwbuf2[addr] < 0) {lzwbuf2[addr] = (short) addrcnt; break;}
|
||||
newaddr = lzwbuf2[addr];
|
||||
while (lzwbuf1[newaddr] != lzwinbuf[bytecnt1])
|
||||
{
|
||||
zx = lzwbuf3[newaddr];
|
||||
if (zx < 0) {lzwbuf3[newaddr] = (short) addrcnt; break;}
|
||||
newaddr = zx;
|
||||
}
|
||||
if (lzwbuf3[newaddr] == addrcnt) break;
|
||||
addr = newaddr;
|
||||
} while (addr >= 0);
|
||||
lzwbuf1[addrcnt] = lzwinbuf[bytecnt1];
|
||||
lzwbuf2[addrcnt] = -1;
|
||||
lzwbuf3[addrcnt] = -1;
|
||||
|
||||
longptr = (int32_t *)&lzwoutbuf[bitcnt>>3];
|
||||
longptr[0] |= (addr<<(bitcnt&7));
|
||||
bitcnt += numbits;
|
||||
if ((addr&((oneupnumbits>>1)-1)) > ((addrcnt-1)&((oneupnumbits>>1)-1)))
|
||||
bitcnt--;
|
||||
|
||||
addrcnt++;
|
||||
if (addrcnt > oneupnumbits) { numbits++; oneupnumbits <<= 1; }
|
||||
} while ((bytecnt1 < uncompleng) && (bitcnt < (uncompleng<<3)));
|
||||
|
||||
longptr = (int32_t *)&lzwoutbuf[bitcnt>>3];
|
||||
longptr[0] |= (addr<<(bitcnt&7));
|
||||
bitcnt += numbits;
|
||||
if ((addr&((oneupnumbits>>1)-1)) > ((addrcnt-1)&((oneupnumbits>>1)-1)))
|
||||
bitcnt--;
|
||||
|
||||
shortptr = (short *)lzwoutbuf;
|
||||
shortptr[0] = (short)uncompleng;
|
||||
if (((bitcnt+7)>>3) < uncompleng)
|
||||
{
|
||||
shortptr[1] = (short)addrcnt;
|
||||
return((bitcnt+7)>>3);
|
||||
}
|
||||
shortptr[1] = (short)0;
|
||||
for(i=0;i<uncompleng;i++) lzwoutbuf[i+4] = lzwinbuf[i];
|
||||
return(uncompleng+4);
|
||||
}
|
||||
|
||||
int32_t uncompress(uint8_t *lzwinbuf, int32_t compleng, uint8_t *lzwoutbuf)
|
||||
{
|
||||
int32_t strtot, currstr, numbits, oneupnumbits;
|
||||
int32_t i, dat, leng, bitcnt, outbytecnt, *longptr;
|
||||
short *shortptr;
|
||||
|
||||
shortptr = (short *)lzwinbuf;
|
||||
strtot = (int32_t )shortptr[1];
|
||||
if (strtot == 0)
|
||||
{
|
||||
copybuf((void *)((lzwinbuf)+4),(void *)((lzwoutbuf)),((compleng-4)+3)>>2);
|
||||
return((int32_t )shortptr[0]); /* uncompleng */
|
||||
}
|
||||
for(i=255;i>=0;i--) { lzwbuf2[i] = (short) i; lzwbuf3[i] = (short) i; }
|
||||
currstr = 256; bitcnt = (4<<3); outbytecnt = 0;
|
||||
numbits = 8; oneupnumbits = (1<<8);
|
||||
do
|
||||
{
|
||||
longptr = (int32_t *)&lzwinbuf[bitcnt>>3];
|
||||
dat = ((longptr[0]>>(bitcnt&7)) & (oneupnumbits-1));
|
||||
bitcnt += numbits;
|
||||
if ((dat&((oneupnumbits>>1)-1)) > ((currstr-1)&((oneupnumbits>>1)-1)))
|
||||
{ dat &= ((oneupnumbits>>1)-1); bitcnt--; }
|
||||
|
||||
lzwbuf3[currstr] = (short) dat;
|
||||
|
||||
for(leng=0;dat>=256;leng++,dat=lzwbuf3[dat])
|
||||
lzwbuf1[leng] = (uint8_t ) lzwbuf2[dat];
|
||||
|
||||
lzwoutbuf[outbytecnt++] = (uint8_t ) dat;
|
||||
for(i=leng-1;i>=0;i--) lzwoutbuf[outbytecnt++] = lzwbuf1[i];
|
||||
|
||||
lzwbuf2[currstr-1] = (short) dat; lzwbuf2[currstr] = (short) dat;
|
||||
currstr++;
|
||||
if (currstr > oneupnumbits) { numbits++; oneupnumbits <<= 1; }
|
||||
} while (currstr < strtot);
|
||||
return((int32_t )shortptr[0]); /* uncompleng */
|
||||
}
|
||||
|
||||
|
||||
void kdfread(void *buffer, size_t dasizeof, size_t count, int32_t fil)
|
||||
{
|
||||
kread(fil, buffer, dasizeof * count);
|
||||
#if 0
|
||||
size_t i, j;
|
||||
int32_t k, kgoal;
|
||||
short leng;
|
||||
uint8_t *ptr;
|
||||
|
||||
lzwbuflock[0] = lzwbuflock[1] = lzwbuflock[2] = lzwbuflock[3] = lzwbuflock[4] = 200;
|
||||
if (lzwbuf1 == NULL) allocache(&lzwbuf1,LZWSIZE+(LZWSIZE>>4),&lzwbuflock[0]);
|
||||
if (lzwbuf2 == NULL) allocache((uint8_t**)&lzwbuf2,(LZWSIZE+(LZWSIZE>>4))*2,&lzwbuflock[1]);
|
||||
if (lzwbuf3 == NULL) allocache((uint8_t**)&lzwbuf3,(LZWSIZE+(LZWSIZE>>4))*2,&lzwbuflock[2]);
|
||||
if (lzwbuf4 == NULL) allocache(&lzwbuf4,LZWSIZE,&lzwbuflock[3]);
|
||||
if (lzwbuf5 == NULL) allocache(&lzwbuf5,LZWSIZE+(LZWSIZE>>4),&lzwbuflock[4]);
|
||||
|
||||
if (dasizeof > LZWSIZE) { count *= dasizeof; dasizeof = 1; }
|
||||
ptr = (uint8_t *)buffer;
|
||||
|
||||
kread(fil,&leng,2); kread(fil,lzwbuf5,(int32_t )leng);
|
||||
k = 0;
|
||||
kgoal = uncompress(lzwbuf5,leng,lzwbuf4);
|
||||
|
||||
copybufbyte(lzwbuf4,ptr,(int32_t )dasizeof);
|
||||
k += (int32_t )dasizeof;
|
||||
|
||||
for(i=1;i<count;i++)
|
||||
{
|
||||
if (k >= kgoal)
|
||||
{
|
||||
kread(fil,&leng,2); kread(fil,lzwbuf5,(int32_t )leng);
|
||||
k = 0; kgoal = uncompress(lzwbuf5,(int32_t )leng,lzwbuf4);
|
||||
}
|
||||
for(j=0;j<dasizeof;j++) ptr[j+dasizeof] = (uint8_t ) ((ptr[j]+lzwbuf4[j+k])&255);
|
||||
k += dasizeof;
|
||||
ptr += dasizeof;
|
||||
}
|
||||
lzwbuflock[0] = lzwbuflock[1] = lzwbuflock[2] = lzwbuflock[3] = lzwbuflock[4] = 1;
|
||||
#endif
|
||||
}
|
||||
|
||||
void dfread(void *buffer, size_t dasizeof, size_t count, FILE *fil)
|
||||
{
|
||||
fread(buffer, dasizeof, count, fil);
|
||||
#if 0
|
||||
size_t i, j;
|
||||
int32_t k, kgoal;
|
||||
short leng;
|
||||
uint8_t *ptr;
|
||||
|
||||
lzwbuflock[0] = lzwbuflock[1] = lzwbuflock[2] = lzwbuflock[3] = lzwbuflock[4] = 200;
|
||||
if (lzwbuf1 == NULL) allocache(&lzwbuf1,LZWSIZE+(LZWSIZE>>4),&lzwbuflock[0]);
|
||||
if (lzwbuf2 == NULL) allocache((uint8_t**)&lzwbuf2,(LZWSIZE+(LZWSIZE>>4))*2,&lzwbuflock[1]);
|
||||
if (lzwbuf3 == NULL) allocache((uint8_t**)&lzwbuf3,(LZWSIZE+(LZWSIZE>>4))*2,&lzwbuflock[2]);
|
||||
if (lzwbuf4 == NULL) allocache(&lzwbuf4,LZWSIZE,&lzwbuflock[3]);
|
||||
if (lzwbuf5 == NULL) allocache(&lzwbuf5,LZWSIZE+(LZWSIZE>>4),&lzwbuflock[4]);
|
||||
|
||||
if (dasizeof > LZWSIZE) {
|
||||
count *= dasizeof;
|
||||
dasizeof = 1;
|
||||
}
|
||||
|
||||
ptr = (uint8_t *)buffer;
|
||||
|
||||
fread(&leng,2,1,fil);
|
||||
fread(lzwbuf5,(int32_t )leng,1,fil);
|
||||
|
||||
k = 0;
|
||||
kgoal = uncompress(lzwbuf5,(int32_t )leng,lzwbuf4);
|
||||
|
||||
copybufbyte(lzwbuf4,ptr,(int32_t )dasizeof);
|
||||
k += (int32_t )dasizeof;
|
||||
|
||||
for(i=1;i<count;i++)
|
||||
{
|
||||
if (k >= kgoal)
|
||||
{
|
||||
fread(&leng,2,1,fil); fread(lzwbuf5,(int32_t )leng,1,fil);
|
||||
k = 0; kgoal = uncompress(lzwbuf5,(int32_t )leng,lzwbuf4);
|
||||
}
|
||||
for(j=0;j<dasizeof;j++) ptr[j+dasizeof] = (uint8_t ) ((ptr[j]+lzwbuf4[j+k])&255);
|
||||
k += dasizeof;
|
||||
ptr += dasizeof;
|
||||
}
|
||||
lzwbuflock[0] = lzwbuflock[1] = lzwbuflock[2] = lzwbuflock[3] = lzwbuflock[4] = 1;
|
||||
#endif
|
||||
}
|
||||
|
||||
void dfwrite(void *buffer, size_t dasizeof, size_t count, FILE *fil)
|
||||
{
|
||||
fwrite(buffer, dasizeof, count, fil);
|
||||
#if 0
|
||||
size_t i, j, k;
|
||||
short leng;
|
||||
uint8_t *ptr;
|
||||
|
||||
lzwbuflock[0] = lzwbuflock[1] = lzwbuflock[2] = lzwbuflock[3] = lzwbuflock[4] = 200;
|
||||
if (lzwbuf1 == NULL) allocache(&lzwbuf1,LZWSIZE+(LZWSIZE>>4),&lzwbuflock[0]);
|
||||
if (lzwbuf2 == NULL) allocache((uint8_t**)&lzwbuf2,(LZWSIZE+(LZWSIZE>>4))*2,&lzwbuflock[1]);
|
||||
if (lzwbuf3 == NULL) allocache((uint8_t**)&lzwbuf3,(LZWSIZE+(LZWSIZE>>4))*2,&lzwbuflock[2]);
|
||||
if (lzwbuf4 == NULL) allocache(&lzwbuf4,LZWSIZE,&lzwbuflock[3]);
|
||||
if (lzwbuf5 == NULL) allocache(&lzwbuf5,LZWSIZE+(LZWSIZE>>4),&lzwbuflock[4]);
|
||||
|
||||
if (dasizeof > LZWSIZE) { count *= dasizeof; dasizeof = 1; }
|
||||
ptr = (uint8_t *)buffer;
|
||||
|
||||
copybufbyte(ptr,lzwbuf4,(int32_t )dasizeof);
|
||||
k = dasizeof;
|
||||
|
||||
if (k > LZWSIZE-dasizeof)
|
||||
{
|
||||
leng = (short)compress(lzwbuf4,k,lzwbuf5); k = 0;
|
||||
fwrite(&leng,2,1,fil); fwrite(lzwbuf5,(int32_t )leng,1,fil);
|
||||
}
|
||||
|
||||
for(i=1;i<count;i++)
|
||||
{
|
||||
for(j=0;j<dasizeof;j++) lzwbuf4[j+k] = (uint8_t ) ((ptr[j+dasizeof]-ptr[j])&255);
|
||||
k += dasizeof;
|
||||
if (k > LZWSIZE-dasizeof)
|
||||
{
|
||||
leng = (short)compress(lzwbuf4,k,lzwbuf5); k = 0;
|
||||
fwrite(&leng,2,1,fil); fwrite(lzwbuf5,(int32_t )leng,1,fil);
|
||||
}
|
||||
ptr += dasizeof;
|
||||
}
|
||||
if (k > 0)
|
||||
{
|
||||
leng = (short)compress(lzwbuf4,k,lzwbuf5);
|
||||
fwrite(&leng,2,1,fil); fwrite(lzwbuf5,(int32_t )leng,1,fil);
|
||||
}
|
||||
lzwbuflock[0] = lzwbuflock[1] = lzwbuflock[2] = lzwbuflock[3] = lzwbuflock[4] = 1;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
int SafeFileExists ( const char * _filename );
|
||||
int32_t TCkopen4load(const char *filename, int32_t readfromGRP)
|
||||
{
|
||||
char fullfilename[512] = "\0";
|
||||
int32_t result = 0;
|
||||
|
||||
if(game_dir[0] != '\0' && !readfromGRP)
|
||||
{
|
||||
sprintf(fullfilename, "%s/%s", game_dir, filename);
|
||||
if (!SafeFileExists(fullfilename)) // try root
|
||||
sprintf(fullfilename, "%s", filename);
|
||||
}
|
||||
else
|
||||
{
|
||||
sprintf(fullfilename, "%s/%s", game_dir, filename);
|
||||
}
|
||||
|
||||
result = kopen4load(fullfilename, readfromGRP);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
void setGameDir(char* gameDir){
|
||||
if (gameDir == NULL)
|
||||
return;
|
||||
|
||||
strncpy(game_dir,gameDir,sizeof(game_dir));
|
||||
}
|
||||
|
||||
char* getGameDir(void){
|
||||
//return game_dir;
|
||||
return "/.rockbox/duke3d";
|
||||
}
|
||||
|
||||
int getGRPcrc32(int grpID){
|
||||
|
||||
return grpSet.archives[grpID].crc32;
|
||||
}
|
||||
49
apps/plugins/sdl/progs/duke3d/Engine/src/filesystem.h
Normal file
49
apps/plugins/sdl/progs/duke3d/Engine/src/filesystem.h
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
//
|
||||
// filesystem.h
|
||||
// Duke3D
|
||||
//
|
||||
// Created by fabien sanglard on 12-12-19.
|
||||
// Copyright (c) 2012 fabien sanglard. All rights reserved.
|
||||
//
|
||||
|
||||
#ifndef Duke3D_filesystem_h
|
||||
#define Duke3D_filesystem_h
|
||||
|
||||
#include "stdio.h"
|
||||
#include "platform.h"
|
||||
|
||||
|
||||
|
||||
#define MAXGROUPFILES 4 /* Warning: Fix groupfil if this is changed */
|
||||
|
||||
|
||||
extern int32_t groupefil_crc32[MAXGROUPFILES];
|
||||
|
||||
int32_t initgroupfile(const char *filename);
|
||||
void uninitgroupfile(void);
|
||||
uint16_t crc16(uint8_t *data_p, uint16_t length);
|
||||
uint32_t crc32_update(uint8_t *buf, uint32_t length, uint32_t crc_to_update);
|
||||
int32_t kopen4load(const char *filename, int openOnlyFromGRP);
|
||||
int32_t kread(int32_t handle, void *buffer, int32_t leng);
|
||||
int32_t kread8(int32_t handle, uint8_t *buffer);
|
||||
int32_t kread16(int32_t handle, int16_t *buffer);
|
||||
int32_t kread32(int32_t handle, int32_t *buffer);
|
||||
int32_t klseek(int32_t handle, int32_t offset, int whence);
|
||||
int32_t kfilelength(int32_t handle);
|
||||
void kclose(int32_t handle);
|
||||
void kdfread(void *buffer, size_t dasizeof, size_t count, int32_t fil);
|
||||
void dfread(void *buffer, size_t dasizeof, size_t count, FILE *fil);
|
||||
void dfwrite(void *buffer, size_t dasizeof, size_t count, FILE *fil);
|
||||
|
||||
int getGRPcrc32(int grpID);
|
||||
|
||||
char* getGameDir(void);
|
||||
void setGameDir(char* gameDir);
|
||||
|
||||
int32_t TCkopen4load(const char *filename, int32_t readfromGRP);
|
||||
|
||||
#if defined(__APPLE__) || defined(__linux__)
|
||||
int32_t filelength(int32_t fd);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
54
apps/plugins/sdl/progs/duke3d/Engine/src/fixedPoint_math.c
Normal file
54
apps/plugins/sdl/progs/duke3d/Engine/src/fixedPoint_math.c
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
// converted from asm to c by Jonof
|
||||
|
||||
#include <stdio.h>
|
||||
#include "platform.h"
|
||||
#include "fixedPoint_math.h"
|
||||
|
||||
void clearbuf(void *d, int32_t c, int32_t a)
|
||||
{
|
||||
int32_t *p = (int32_t*)d;
|
||||
while ((c--) > 0) *(p++) = a;
|
||||
}
|
||||
|
||||
void clearbufbyte(void *D, int32_t c, int32_t a)
|
||||
{ // Cringe City
|
||||
uint8_t *p = (uint8_t *)D;
|
||||
int32_t m[4] = { 0xffl,0xff00l,0xff0000l,0xff000000l };
|
||||
int32_t n[4] = { 0,8,16,24 };
|
||||
int32_t z=0;
|
||||
while ((c--) > 0) {
|
||||
*(p++) = (uint8_t )((a & m[z])>>n[z]);
|
||||
z=(z+1)&3;
|
||||
}
|
||||
}
|
||||
|
||||
void copybuf(void *s, void *d, int32_t c)
|
||||
{
|
||||
int32_t *p = (int32_t*)s, *q = (int32_t*)d;
|
||||
while ((c--) > 0) *(q++) = *(p++);
|
||||
}
|
||||
|
||||
void copybufbyte(void *S, void *D, int32_t c)
|
||||
{
|
||||
uint8_t *p = (uint8_t *)S, *q = (uint8_t *)D;
|
||||
while((c--) > 0) *(q++) = *(p++);
|
||||
}
|
||||
|
||||
void copybufreverse(void *S, void *D, int32_t c)
|
||||
{
|
||||
uint8_t *p = (uint8_t *)S, *q = (uint8_t *)D;
|
||||
while((c--) > 0) *(q++) = *(p--);
|
||||
}
|
||||
|
||||
void qinterpolatedown16(int32_t* bufptr, int32_t num, int32_t val, int32_t add)
|
||||
{ // gee, I wonder who could have provided this...
|
||||
int32_t i, *lptr = bufptr;
|
||||
for(i=0;i<num;i++) { lptr[i] = (val>>16); val += add; }
|
||||
}
|
||||
|
||||
void qinterpolatedown16short(int32_t* bufptr, int32_t num, int32_t val, int32_t add)
|
||||
{ // ...maybe the same person who provided this too?
|
||||
int32_t i; short *sptr = (short *)bufptr;
|
||||
for(i=0;i<num;i++) { sptr[i] = (short)(val>>16); val += add; }
|
||||
}
|
||||
|
||||
167
apps/plugins/sdl/progs/duke3d/Engine/src/fixedPoint_math.h
Normal file
167
apps/plugins/sdl/progs/duke3d/Engine/src/fixedPoint_math.h
Normal file
|
|
@ -0,0 +1,167 @@
|
|||
/*
|
||||
* "Build Engine & Tools" Copyright (c) 1993-1997 Ken Silverman
|
||||
* Ken Silverman's official web site: "http://www.advsys.net/ken"
|
||||
* See the included license file "BUILDLIC.TXT" for license info.
|
||||
* This file has been modified from Ken Silverman's original release
|
||||
*/
|
||||
|
||||
#ifndef __PRAGMAS_H__
|
||||
#define __PRAGMAS_H__
|
||||
|
||||
#include "platform.h"
|
||||
|
||||
static __inline void swapchar(uint8_t *p1, uint8_t *p2)
|
||||
{ uint8_t tmp = *p1; *p1 = *p2; *p2 = tmp; }
|
||||
static __inline void swapshort(short *p1, short *p2)
|
||||
{ short tmp = *p1; *p1 = *p2; *p2 = tmp; }
|
||||
static __inline void swaplong(int32_t *p1, int32_t *p2)
|
||||
{ int32_t tmp = *p1; *p1 = *p2; *p2 = tmp; }
|
||||
static __inline void swapchar2(uint8_t *p1, uint8_t *p2, int xsiz)
|
||||
{
|
||||
swapchar(p1, p2);
|
||||
swapchar(p1 + 1, p2 + xsiz);
|
||||
}
|
||||
|
||||
static __inline int32_t msqrtasm(uint32_t input)
|
||||
{
|
||||
uint32_t a,b;
|
||||
|
||||
a = 0x40000000l; // mov eax, 0x40000000
|
||||
b = 0x20000000l; // mov ebx, 0x20000000
|
||||
|
||||
do { // begit:
|
||||
if (input >= a) { // cmp ecx, eax / jl skip
|
||||
input -= a; // sub ecx, eax
|
||||
a += b*4; // lea eax, [eax+ebx*4]
|
||||
} // skip:
|
||||
a -= b; // sub eax, ebx
|
||||
a >>= 1; // shr eax, 1
|
||||
b >>= 2; // shr ebx, 2
|
||||
}
|
||||
while (b); // jnz begit
|
||||
|
||||
if (input >= a) // cmp ecx, eax
|
||||
a++; // sbb eax, -1
|
||||
|
||||
a >>= 1; // shr eax, 1
|
||||
|
||||
return a;
|
||||
}
|
||||
|
||||
void vlin16first (int32_t i1, int32_t i2);
|
||||
|
||||
static inline int32_t sqr (int32_t input1) { return input1*input1; }
|
||||
|
||||
/* internal use:32x32 = 64bit */
|
||||
static inline int64_t mul32_64(int32_t i1,int32_t i2)
|
||||
{
|
||||
return (int64_t)i1*i2;
|
||||
}
|
||||
static inline int scale (int32_t input1, int32_t input2, int32_t input3)
|
||||
{
|
||||
return (int)(mul32_64(input1,input2)/(int64_t)input3);
|
||||
}
|
||||
static inline int mulscale (int32_t input1, int32_t input2, int32_t input3)
|
||||
{
|
||||
return (int)(mul32_64(input1,input2)>>input3);
|
||||
}
|
||||
static inline int dmulscale (int32_t input1, int32_t input2, int32_t input3,int32_t input4,int32_t input5)
|
||||
{
|
||||
return (int)((mul32_64(input1,input2) + mul32_64(input3,input4))>>input5);
|
||||
}
|
||||
static inline int tmulscale(int32_t i1, int32_t i2, int32_t i3, int32_t i4, int32_t i5, int32_t i6,int32_t shift)
|
||||
{
|
||||
return (int)((mul32_64(i1,i2) + mul32_64(i3,i4) + mul32_64(i5,i6))>>shift);
|
||||
}
|
||||
static inline int32_t divscale(int32_t i1, int32_t i2, int32_t i3)
|
||||
{
|
||||
return (int32_t)(((int64_t)i1<<i3)/i2);
|
||||
}
|
||||
|
||||
#define DEFFUNCS \
|
||||
DEFFUN(1)\
|
||||
DEFFUN(2)\
|
||||
DEFFUN(3)\
|
||||
DEFFUN(4)\
|
||||
DEFFUN(5)\
|
||||
DEFFUN(6)\
|
||||
DEFFUN(7)\
|
||||
DEFFUN(8)\
|
||||
DEFFUN(9)\
|
||||
DEFFUN(10)\
|
||||
DEFFUN(11)\
|
||||
DEFFUN(12)\
|
||||
DEFFUN(13)\
|
||||
DEFFUN(14)\
|
||||
DEFFUN(15)\
|
||||
DEFFUN(16)\
|
||||
DEFFUN(17)\
|
||||
DEFFUN(18)\
|
||||
DEFFUN(19)\
|
||||
DEFFUN(20)\
|
||||
DEFFUN(21)\
|
||||
DEFFUN(22)\
|
||||
DEFFUN(23)\
|
||||
DEFFUN(24)\
|
||||
DEFFUN(25)\
|
||||
DEFFUN(26)\
|
||||
DEFFUN(27)\
|
||||
DEFFUN(28)\
|
||||
DEFFUN(29)\
|
||||
DEFFUN(30)\
|
||||
DEFFUN(31)\
|
||||
DEFFUN(32)
|
||||
|
||||
#define DEFFUN(N) \
|
||||
static __inline int32_t mulscale##N(int32_t input1, int32_t input2) \
|
||||
{ return mulscale(input1,input2,N); }
|
||||
DEFFUNCS
|
||||
#undef DEFFUN
|
||||
|
||||
#define DEFFUN(N) \
|
||||
static __inline int32_t dmulscale##N(int32_t input1, int32_t input2,int32_t input3,int32_t input4) \
|
||||
{ return dmulscale(input1,input2,input3,input4,N); }
|
||||
DEFFUNCS
|
||||
#undef DEFFUN
|
||||
|
||||
#define DEFFUN(N) \
|
||||
static __inline int32_t tmulscale##N(int32_t i1, int32_t i2,int32_t i3,int32_t i4,int32_t i5,int32_t i6) \
|
||||
{ return tmulscale(i1,i2,i3,i4,i5,i6,N); }
|
||||
DEFFUNCS
|
||||
#undef DEFFUN
|
||||
|
||||
#define DEFFUN(N) \
|
||||
static __inline int32_t divscale##N(int32_t input1, int32_t input2) \
|
||||
{ return divscale(input1,input2,N); }
|
||||
DEFFUNCS
|
||||
#undef DEFFUN
|
||||
|
||||
static inline int ksgn(int32_t i1)
|
||||
{
|
||||
if (i1 < 0) return -1;
|
||||
else if (i1 > 0) return 1;
|
||||
else return 0;
|
||||
}
|
||||
|
||||
static inline int sgn(int32_t i1) { return ksgn(i1); }
|
||||
static inline int klabs (int32_t i1)
|
||||
{
|
||||
if (i1 < 0) i1 = -i1;
|
||||
return i1;
|
||||
}
|
||||
static inline int mul3 (int32_t i1) { return i1*3; }
|
||||
static inline int mul5 (int32_t i1) { return i1*5; }
|
||||
static inline int mul9 (int32_t i1) { return i1*9; }
|
||||
|
||||
void copybufreverse(void *S, void *D, int32_t c);
|
||||
void copybuf(void *s, void *d, int32_t c);
|
||||
void clearbuf(void *d, int32_t c, int32_t a);
|
||||
void clearbufbyte(void *D, int32_t c, int32_t a);
|
||||
void copybufbyte(void *S, void *D, int32_t c);
|
||||
|
||||
void qinterpolatedown16 (int32_t* bufptr, int32_t num, int32_t val, int32_t add);
|
||||
void qinterpolatedown16short (int32_t* bufptr, int32_t num, int32_t val, int32_t add);
|
||||
|
||||
#endif /* !defined _INCLUDE_PRAGMAS_H_ */
|
||||
|
||||
|
||||
168
apps/plugins/sdl/progs/duke3d/Engine/src/icon.c
Normal file
168
apps/plugins/sdl/progs/duke3d/Engine/src/icon.c
Normal file
|
|
@ -0,0 +1,168 @@
|
|||
#include "SDL.h"
|
||||
#include "icon.h"
|
||||
uint8_t iconBMP[]=
|
||||
{
|
||||
0x42,0x4d,0x36,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x36,0x04,0x00,
|
||||
0x00,0x28,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x20,0x00,0x00,0x00,
|
||||
0x01,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0xff,0xff,0xff,0x00,0x04,0x6a,0xa4,0x00,0x5c,0x62,0x64,
|
||||
0x00,0x1c,0x92,0xb4,0x00,0x1c,0x32,0x44,0x00,0x34,0x62,0x8c,0x00,
|
||||
0x4c,0x42,0x44,0x00,0x24,0x4a,0x64,0x00,0x04,0x7a,0xac,0x00,0x04,
|
||||
0x1a,0x1c,0x00,0x1c,0xaa,0xe4,0x00,0x2c,0x7a,0xa4,0x00,0x34,0x4a,
|
||||
0x54,0x00,0x24,0x1a,0x1c,0x00,0x1c,0x7a,0xa4,0x00,0x34,0x32,0x2c,
|
||||
0x00,0x2c,0x92,0xc4,0x00,0x1c,0x8a,0xb4,0x00,0x1c,0x62,0x84,0x00,
|
||||
0x2c,0x2a,0x24,0x00,0x1c,0x72,0x9c,0x00,0x04,0x92,0xd4,0x00,0x2c,
|
||||
0x72,0x9c,0x00,0x74,0x72,0x74,0x00,0x44,0x52,0x5c,0x00,0x34,0x8a,
|
||||
0xc4,0x00,0x1c,0x82,0xb4,0x00,0x1c,0x5a,0x7c,0x00,0x34,0x5a,0x6c,
|
||||
0x00,0x34,0x42,0x54,0x00,0x3c,0x7a,0x9c,0x00,0x1c,0xa2,0xdc,0x00,
|
||||
0x64,0x62,0x74,0x00,0x1c,0x3a,0x4c,0x00,0x44,0x62,0x7c,0x00,0x24,
|
||||
0x22,0x1c,0x00,0x34,0x3a,0x44,0x00,0x24,0x62,0x9c,0x00,0x1c,0x2a,
|
||||
0x3c,0x00,0x34,0xb2,0xe4,0x00,0x2c,0x82,0xac,0x00,0x1c,0x7a,0xb4,
|
||||
0x00,0x1c,0x9a,0xd4,0x00,0x1c,0x5a,0x8c,0x00,0x4c,0x4a,0x4c,0x00,
|
||||
0x1c,0x1a,0x1c,0x00,0x1c,0xb2,0xf4,0x00,0x34,0x52,0x6c,0x00,0x1c,
|
||||
0x8a,0xcc,0x00,0x34,0x2a,0x2c,0x00,0x24,0x72,0x9c,0x00,0x64,0x5a,
|
||||
0x5c,0x00,0x2c,0x22,0x24,0x00,0x4c,0x72,0x94,0x00,0x24,0x32,0x3c,
|
||||
0x00,0x2c,0x6a,0x94,0x00,0x34,0x7a,0xa4,0x00,0x24,0x7a,0xa4,0x00,
|
||||
0x3c,0x32,0x34,0x00,0x24,0xa2,0xdc,0x00,0x3c,0x72,0x9c,0x00,0x54,
|
||||
0x52,0x54,0x00,0x24,0x82,0xac,0x00,0x24,0x5a,0x7c,0x00,0x34,0x5a,
|
||||
0x84,0x00,0x1c,0x6a,0x9c,0x00,0x1c,0x9a,0xe4,0x00,0x1c,0x22,0x2c,
|
||||
0x00,0x1c,0x02,0x04,0x00,0x54,0x62,0x74,0x00,0x1c,0x92,0xcc,0x00,
|
||||
0x2c,0x52,0x6c,0x00,0x24,0xaa,0xe4,0x00,0x34,0x52,0x64,0x00,0x2c,
|
||||
0x9a,0xd4,0x00,0x1c,0x8a,0xc4,0x00,0x1c,0x6a,0x94,0x00,0x2c,0x2a,
|
||||
0x34,0x00,0x34,0x72,0x9c,0x00,0x84,0x82,0x84,0x00,0x44,0x5a,0x6c,
|
||||
0x00,0x3c,0x5a,0x74,0x00,0x6c,0x72,0x7c,0x00,0x24,0x3a,0x4c,0x00,
|
||||
0x3c,0x6a,0x8c,0x00,0x24,0x22,0x2c,0x00,0x3c,0x3a,0x3c,0x00,0x54,
|
||||
0x4a,0x44,0x00,0x24,0x72,0xac,0x00,0x34,0x6a,0x8c,0x00,0x24,0x6a,
|
||||
0x9c,0x00,0x04,0x72,0xa4,0x00,0x1c,0x92,0xbc,0x00,0x1c,0x32,0x4c,
|
||||
0x00,0x4c,0x42,0x4c,0x00,0x1c,0x52,0x7c,0x00,0x04,0x82,0xb4,0x00,
|
||||
0x1c,0xaa,0xec,0x00,0x2c,0x7a,0xac,0x00,0x34,0x4a,0x64,0x00,0x24,
|
||||
0x1a,0x24,0x00,0x1c,0x7a,0xac,0x00,0x34,0x32,0x34,0x00,0x1c,0x8a,
|
||||
0xbc,0x00,0x2c,0x2a,0x2c,0x00,0x1c,0x72,0xac,0x00,0x04,0x9a,0xec,
|
||||
0x00,0x44,0x52,0x64,0x00,0x3c,0x8a,0xc4,0x00,0x1c,0x82,0xbc,0x00,
|
||||
0x1c,0x5a,0x84,0x00,0x34,0x5a,0x74,0x00,0x3c,0x42,0x4c,0x00,0x3c,
|
||||
0x7a,0xac,0x00,0x1c,0xa2,0xe4,0x00,0x6c,0x6a,0x6c,0x00,0x1c,0x3a,
|
||||
0x54,0x00,0x24,0x22,0x24,0x00,0x34,0x82,0xb4,0x00,0x1c,0x7a,0xbc,
|
||||
0x00,0x1c,0x9a,0xdc,0x00,0x1c,0x5a,0x94,0x00,0x4c,0x4a,0x54,0x00,
|
||||
0x1c,0x1a,0x24,0x00,0x24,0xb2,0xf4,0x00,0x34,0x52,0x74,0x00,0x1c,
|
||||
0x8a,0xd4,0x00,0x34,0x2a,0x34,0x00,0x24,0x72,0xa4,0x00,0x1c,0x02,
|
||||
0x1c,0x00,0x34,0x9a,0xcc,0x00,0x8c,0x82,0x8c,0x00,0x24,0x6a,0x94,
|
||||
0x00,0x2c,0x22,0x2c,0x00,0x24,0x32,0x44,0x00,0x2c,0x6a,0x9c,0x00,
|
||||
0x34,0x7a,0xac,0x00,0x24,0x7a,0xac,0x00,0x3c,0x32,0x3c,0x00,0x24,
|
||||
0x82,0xb4,0x00,0x24,0x5a,0x84,0x00,0x1c,0x9a,0xec,0x00,0x1c,0x22,
|
||||
0x34,0x00,0x54,0x62,0x7c,0x00,0x34,0x72,0xa4,0x00,0x3c,0x6a,0x94,
|
||||
0x00,0x3c,0x3a,0x44,0x00,0x24,0x6a,0xa4,0x00,0xc7,0x67,0x18,0x00,
|
||||
0x37,0x04,0xeb,0x00,0x91,0xd7,0x12,0x00,0x7c,0x77,0x00,0x00,0x08,
|
||||
0x30,0x6f,0x00,0x06,0x88,0x03,0x00,0x15,0xd4,0xc3,0x00,0x00,0x77,
|
||||
0x03,0x00,0x28,0xff,0x23,0x00,0x00,0xff,0x04,0x00,0xab,0xff,0x00,
|
||||
0x00,0x00,0xff,0x00,0x00,0x00,0x2a,0x60,0x00,0x00,0x88,0x9d,0x00,
|
||||
0x00,0xd4,0xd4,0x00,0x00,0x77,0x77,0x00,0x00,0xc0,0x00,0x00,0x00,
|
||||
0xb4,0x00,0x00,0x00,0xd4,0x00,0x00,0x00,0x77,0x00,0x00,0x58,0x00,
|
||||
0x01,0x00,0xed,0x00,0x00,0x00,0x12,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0xfd,0x4f,0x00,0x00,0x00,0xe5,0x00,0x00,0x81,0xd6,0x00,0x00,
|
||||
0x7c,0x77,0x00,0x00,0x05,0xdc,0x00,0x00,0x01,0x07,0x00,0x00,0x81,
|
||||
0x10,0x00,0x00,0x7c,0x00,0x00,0x00,0xb0,0x82,0x00,0x00,0x3e,0x00,
|
||||
0x00,0x00,0x16,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x82,0x00,0x70,
|
||||
0x00,0x00,0x00,0x02,0x00,0x81,0x00,0xda,0x00,0x7c,0x00,0x77,0x00,
|
||||
0x00,0x00,0x02,0x00,0x00,0x00,0x7f,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x28,0x4c,0x00,0x00,0x00,0xad,0x00,0x00,0xab,0x74,
|
||||
0xd4,0x00,0x00,0x00,0x77,0x00,0x09,0xcb,0xdc,0x00,0x03,0xb4,0x07,
|
||||
0x00,0x00,0xd4,0x10,0x00,0x00,0x77,0x00,0x00,0x01,0x2a,0xdc,0x00,
|
||||
0x00,0x02,0x07,0x00,0x00,0x79,0x10,0x00,0x00,0x00,0x00,0x00,0x28,
|
||||
0xa8,0x90,0x00,0xed,0xec,0x5b,0x00,0x12,0x12,0x33,0x00,0x00,0x00,
|
||||
0x00,0x00,0xf8,0x00,0x60,0x00,0xf7,0x00,0xeb,0x00,0x12,0x00,0x12,
|
||||
0x00,0x00,0x00,0x00,0x00,0xf8,0x01,0x23,0x00,0xf7,0x00,0x36,0x00,
|
||||
0x12,0x00,0xd7,0x00,0x00,0x00,0x5a,0x00,0xf3,0x00,0xdc,0x00,0x99,
|
||||
0x00,0x07,0x00,0x83,0x00,0x10,0x00,0x7c,0x00,0x00,0x00,0x08,0x3c,
|
||||
0x01,0x00,0x01,0xec,0x00,0x00,0x81,0x12,0x00,0x00,0x7c,0x00,0x00,
|
||||
0x00,0xff,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0xff,0x00,0x00,0x00,
|
||||
0xff,0x00,0x00,0x00,0x05,0xf8,0x00,0x00,0x01,0xf7,0x00,0x00,0x81,
|
||||
0x12,0x00,0x00,0x7c,0x00,0x00,0x00,0x24,0x67,0xdc,0x00,0xfe,0x04,
|
||||
0x07,0x00,0x41,0xd7,0x10,0x00,0x00,0x77,0x00,0x00,0x90,0xd0,0x4f,
|
||||
0x00,0xd8,0xb4,0xe5,0x00,0x15,0xd4,0xd6,0x00,0x00,0x77,0x77,0x00,
|
||||
0x2f,0xff,0x29,0x00,0xfe,0xff,0x4e,0x00,0x80,0xff,0xd7,0x00,0x7c,
|
||||
0xff,0x5a,0x00,0x82,0xcb,0xdc,0x00,0x00,0xb4,0x07,0x00,0x81,0xd4,
|
||||
0x10,0x00,0x7c,0x77,0x00,0x00,0x58,0xbd,0x02,0x00,0xd6,0xda,0x00,
|
||||
0x00,0xd4,0xd4,0x00,0x00,0x77,0x77,0x00,0x00,0x2a,0x38,0x4f,0x00,
|
||||
0x02,0xad,0xe5,0x00,0x79,0x74,0xd6,0x00,0x00,0x00,0x77,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x73,0x06,0x24,0x26,0x36,0x36,0x2c,0x02,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x2d,0x26,0x1b,0x5b,0x08,
|
||||
0x12,0x01,0x08,0x5b,0x1b,0x26,0x2d,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x2d,
|
||||
0x21,0x12,0x60,0x0e,0x4c,0x1b,0x51,0x3f,0x1b,0x4c,0x0e,0x60,0x4c,
|
||||
0x04,0x2d,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x2d,0x1b,0x03,0x14,0x07,0x24,0x24,0x06,0x06,
|
||||
0x06,0x06,0x24,0x66,0x47,0x4c,0x03,0x12,0x09,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x43,0x01,0x11,0x1b,
|
||||
0x66,0x3a,0x0f,0x31,0x13,0x23,0x31,0x31,0x13,0x0f,0x3a,0x24,0x1b,
|
||||
0x11,0x4c,0x43,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x7b,0x0e,0x14,0x84,0x1b,0x2d,0x2d,0x0d,0x13,0x13,0x31,0x13,
|
||||
0x31,0x23,0x34,0x2d,0x2d,0x1b,0x12,0x80,0x14,0x43,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x09,0x14,0x1a,0x12,0x84,0x45,0x04,
|
||||
0x44,0x23,0x55,0x34,0x13,0x31,0x75,0x68,0x2d,0x44,0x04,0x45,0x84,
|
||||
0x4c,0x1a,0x4c,0x09,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x2d,0x1b,
|
||||
0x11,0x84,0x1a,0x0e,0x4c,0x4c,0x43,0x2d,0x13,0x4d,0x13,0x13,0x31,
|
||||
0x55,0x2d,0x43,0x4c,0x4c,0x0e,0x65,0x32,0x11,0x1b,0x2d,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x26,0x03,0x14,0x1a,0x65,0x0e,0x1a,0x60,0x1b,
|
||||
0x2d,0x64,0x68,0x85,0x68,0x7f,0x23,0x2d,0x1b,0x60,0x65,0x0e,0x60,
|
||||
0x1a,0x14,0x03,0x26,0x00,0x00,0x00,0x00,0x00,0x2d,0x4c,0x60,0x5a,
|
||||
0x11,0x60,0x4b,0x46,0x1a,0x1a,0x21,0x2d,0x68,0x0d,0x31,0x68,0x2d,
|
||||
0x21,0x1a,0x1a,0x1a,0x1a,0x65,0x11,0x41,0x60,0x4c,0x2d,0x00,0x00,
|
||||
0x00,0x00,0x04,0x1a,0x4c,0x65,0x1a,0x1a,0x84,0x4b,0x65,0x39,0x41,
|
||||
0x7b,0x64,0x75,0x31,0x2d,0x7b,0x41,0x0e,0x65,0x65,0x08,0x1a,0x1a,
|
||||
0x65,0x4c,0x65,0x04,0x00,0x00,0x00,0x73,0x1b,0x11,0x84,0x30,0x16,
|
||||
0x14,0x29,0x46,0x08,0x1a,0x54,0x07,0x34,0x2d,0x0d,0x0d,0x07,0x35,
|
||||
0x45,0x29,0x65,0x65,0x14,0x16,0x46,0x84,0x11,0x1b,0x73,0x00,0x00,
|
||||
0x2c,0x0e,0x1a,0x05,0x62,0x14,0x29,0x1a,0x65,0x1a,0x4e,0x50,0x0f,
|
||||
0x2d,0x7b,0x43,0x0d,0x0f,0x50,0x16,0x65,0x60,0x1a,0x69,0x69,0x0b,
|
||||
0x91,0x08,0x0e,0x3d,0x00,0x00,0x1d,0x11,0x0e,0x11,0x65,0x11,0x4e,
|
||||
0x1a,0x1a,0x1a,0x14,0x24,0x0d,0x04,0x14,0x29,0x04,0x2d,0x24,0x14,
|
||||
0x6d,0x1a,0x65,0x38,0x11,0x14,0x67,0x39,0x11,0x24,0x00,0x00,0x1d,
|
||||
0x4b,0x0e,0x39,0x0b,0x4e,0x05,0x0b,0x84,0x65,0x05,0x0f,0x7b,0x65,
|
||||
0x4b,0x4b,0x65,0x64,0x66,0x40,0x39,0x16,0x16,0x54,0x4e,0x28,0x39,
|
||||
0x0e,0x46,0x53,0x00,0x00,0x66,0x41,0x60,0x13,0x06,0x2c,0x2c,0x2c,
|
||||
0x06,0x2c,0x2c,0x66,0x55,0x1a,0x15,0x6d,0x08,0x4d,0x0f,0x7a,0x2c,
|
||||
0x06,0x2c,0x06,0x06,0x06,0x13,0x4c,0x46,0x0c,0x00,0x00,0x5e,0x08,
|
||||
0x08,0x2d,0x13,0x68,0x68,0x0f,0x0f,0x75,0x34,0x31,0x13,0x47,0x1a,
|
||||
0x1a,0x49,0x34,0x31,0x8a,0x0f,0x0f,0x0f,0x24,0x24,0x23,0x44,0x4c,
|
||||
0x2a,0x0c,0x00,0x00,0x02,0x11,0x1a,0x2d,0x2d,0x68,0x68,0x31,0x4d,
|
||||
0x66,0x0f,0x66,0x31,0x34,0x1d,0x24,0x13,0x31,0x66,0x0f,0x66,0x68,
|
||||
0x31,0x68,0x0f,0x2d,0x2d,0x65,0x67,0x02,0x00,0x00,0x4f,0x37,0x28,
|
||||
0x09,0x2d,0x8a,0x66,0x8a,0x66,0x66,0x8a,0x85,0x2d,0x2d,0x2d,0x2d,
|
||||
0x7b,0x2d,0x7f,0x7f,0x8a,0x7f,0x8a,0x66,0x7f,0x2d,0x43,0x28,0x12,
|
||||
0x4f,0x00,0x00,0x00,0x47,0x10,0x5f,0x44,0x75,0x66,0x8a,0x7f,0x3a,
|
||||
0x66,0x64,0x5d,0x1a,0x01,0x12,0x1a,0x5d,0x7b,0x3a,0x66,0x8a,0x66,
|
||||
0x7f,0x68,0x44,0x5f,0x5c,0x1c,0x00,0x00,0x00,0x00,0x2c,0x67,0x1a,
|
||||
0x2d,0x2d,0x24,0x8a,0x66,0x8a,0x4d,0x64,0x08,0x2a,0x2a,0x1f,0x1f,
|
||||
0x65,0x7b,0x85,0x3a,0x7f,0x8a,0x56,0x2d,0x09,0x29,0x4b,0x2c,0x00,
|
||||
0x00,0x00,0x00,0x00,0x47,0x42,0x6e,0x81,0x7b,0x66,0x56,0x66,0x0d,
|
||||
0x07,0x78,0x46,0x1f,0x2a,0x46,0x6a,0x07,0x0d,0x66,0x56,0x66,0x7b,
|
||||
0x81,0x6e,0x42,0x47,0x00,0x00,0x00,0x00,0x00,0x00,0x06,0x41,0x15,
|
||||
0x04,0x2d,0x85,0x66,0x68,0x7b,0x67,0x1f,0x1f,0x1f,0x1f,0x1f,0x2a,
|
||||
0x67,0x7b,0x68,0x66,0x34,0x2d,0x04,0x15,0x93,0x56,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x24,0x29,0x30,0x8e,0x2d,0x2d,0x2d,0x1b,0x61,
|
||||
0x2e,0x1f,0x15,0x2a,0x0a,0x2e,0x2e,0x1b,0x0d,0x2d,0x2d,0x8e,0x7e,
|
||||
0x29,0x24,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x6a,
|
||||
0x7e,0x21,0x2d,0x7b,0x67,0x61,0x2e,0x0a,0x19,0x19,0x0a,0x2e,0x61,
|
||||
0x67,0x7b,0x2d,0x74,0x30,0x6a,0x18,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x18,0x4b,0x6a,0x2b,0x47,0x2a,0x2e,0x1f,
|
||||
0x0a,0x1f,0x0a,0x1f,0x1f,0x2e,0x2a,0x47,0x2b,0x6a,0x4b,0x18,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x5e,
|
||||
0x1a,0x72,0x42,0x82,0x19,0x19,0x48,0x2e,0x2e,0x27,0x28,0x19,0x10,
|
||||
0x42,0x61,0x65,0x2c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x3d,0x22,0x10,0x61,0x61,0x27,0x4a,
|
||||
0x19,0x8b,0x4a,0x27,0x2e,0x61,0x10,0x51,0x33,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x50,0x22,0x1e,0x2a,0x10,0x38,0x1e,0x4a,0x46,0x38,0x22,0x02,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x83,0x52,0x02,
|
||||
0x02,0x52,0x83,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
};
|
||||
int iconBMP_size = sizeof(iconBMP);
|
||||
5
apps/plugins/sdl/progs/duke3d/Engine/src/icon.h
Normal file
5
apps/plugins/sdl/progs/duke3d/Engine/src/icon.h
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
#ifndef icon_H_
|
||||
#define icon_H_
|
||||
extern uint8_t iconBMP[];
|
||||
extern int iconBMP_size;
|
||||
#endif
|
||||
62
apps/plugins/sdl/progs/duke3d/Engine/src/macos_compat.h
Normal file
62
apps/plugins/sdl/progs/duke3d/Engine/src/macos_compat.h
Normal file
|
|
@ -0,0 +1,62 @@
|
|||
//
|
||||
// macos_compat.h
|
||||
// Duke3D
|
||||
//
|
||||
// Created by fabien sanglard on 12-12-12.
|
||||
// Copyright (c) 2012 fabien sanglard. All rights reserved.
|
||||
//
|
||||
|
||||
#ifndef Duke3D_macos_compat_h
|
||||
#define Duke3D_macos_compat_h
|
||||
|
||||
#define PLATFORM_SUPPORTS_SDL
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#define kmalloc(x) malloc(x)
|
||||
#define kkmalloc(x) malloc(x)
|
||||
#define kfree(x) free(x)
|
||||
#define kkfree(x) free(x)
|
||||
|
||||
#ifdef FP_OFF
|
||||
#undef FP_OFF
|
||||
#endif
|
||||
|
||||
// Horrible horrible macro: Watcom allowed memory pointer to be cast
|
||||
// to a 32bits integer. The code is unfortunately stuffed with this :( !
|
||||
#define FP_OFF(x) ((int32_t) (x))
|
||||
|
||||
#ifndef max
|
||||
#define max(x, y) (((x) > (y)) ? (x) : (y))
|
||||
#endif
|
||||
|
||||
#ifndef min
|
||||
#define min(x, y) (((x) < (y)) ? (x) : (y))
|
||||
#endif
|
||||
|
||||
#include <inttypes.h>
|
||||
#define __int64 int64_t
|
||||
|
||||
#define O_BINARY 0
|
||||
|
||||
#define UDP_NETWORKING 1
|
||||
|
||||
#define PLATFORM_MACOSX 1
|
||||
|
||||
#define SOL_IP SOL_SOCKET
|
||||
#define IP_RECVERR SO_BROADCAST
|
||||
|
||||
#define stricmp strcasecmp
|
||||
#define strcmpi strcasecmp
|
||||
|
||||
#include <assert.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/uio.h>
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
#include <string.h>
|
||||
|
||||
#define USER_DUMMY_NETWORK 1
|
||||
|
||||
#endif
|
||||
1707
apps/plugins/sdl/progs/duke3d/Engine/src/mmulti.c
Normal file
1707
apps/plugins/sdl/progs/duke3d/Engine/src/mmulti.c
Normal file
File diff suppressed because it is too large
Load diff
1213
apps/plugins/sdl/progs/duke3d/Engine/src/mmulti.cpp
Normal file
1213
apps/plugins/sdl/progs/duke3d/Engine/src/mmulti.cpp
Normal file
File diff suppressed because it is too large
Load diff
1211
apps/plugins/sdl/progs/duke3d/Engine/src/mmulti_stable.cpp
Normal file
1211
apps/plugins/sdl/progs/duke3d/Engine/src/mmulti_stable.cpp
Normal file
File diff suppressed because it is too large
Load diff
19
apps/plugins/sdl/progs/duke3d/Engine/src/mmulti_stable.h
Normal file
19
apps/plugins/sdl/progs/duke3d/Engine/src/mmulti_stable.h
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
#ifndef _MMULTI_STABLE_H_
|
||||
#define _MMULTI_STABLE_H_
|
||||
|
||||
void stable_callcommit(void);
|
||||
void stable_initcrc(void);
|
||||
long stable_getcrc(char *buffer, short bufleng);
|
||||
void stable_initmultiplayers(char damultioption, char dacomrateoption, char dapriority);
|
||||
void stable_sendpacket(long other, char *bufptr, long messleng);
|
||||
void stable_setpackettimeout(long datimeoutcount, long daresendagaincount);
|
||||
void stable_uninitmultiplayers(void);
|
||||
void stable_sendlogon(void);
|
||||
void stable_sendlogoff(void);
|
||||
int stable_getoutputcirclesize(void);
|
||||
void stable_setsocket(short newsocket);
|
||||
short stable_getpacket(short *other, char *bufptr);
|
||||
void stable_flushpackets(void);
|
||||
void stable_genericmultifunction(long other, char *bufptr, long messleng, long command);
|
||||
|
||||
#endif
|
||||
19
apps/plugins/sdl/progs/duke3d/Engine/src/mmulti_unstable.h
Normal file
19
apps/plugins/sdl/progs/duke3d/Engine/src/mmulti_unstable.h
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
#ifndef _MMULTI_UNSTABLE_H_
|
||||
#define _MMULTI_UNSTABLE_H_
|
||||
|
||||
void unstable_callcommit(void);
|
||||
void unstable_initcrc(void);
|
||||
long unstable_getcrc(char *buffer, short bufleng);
|
||||
void unstable_initmultiplayers(char damultioption, char dacomrateoption, char dapriority);
|
||||
void unstable_sendpacket(long other, char *bufptr, long messleng);
|
||||
void unstable_setpackettimeout(long datimeoutcount, long daresendagaincount);
|
||||
void unstable_uninitmultiplayers(void);
|
||||
void unstable_sendlogon(void);
|
||||
void unstable_sendlogoff(void);
|
||||
int unstable_getoutputcirclesize(void);
|
||||
void unstable_setsocket(short newsocket);
|
||||
short unstable_getpacket(short *other, char *bufptr);
|
||||
void unstable_flushpackets(void);
|
||||
void unstable_genericmultifunction(long other, char *bufptr, long messleng, long command);
|
||||
|
||||
#endif
|
||||
1176
apps/plugins/sdl/progs/duke3d/Engine/src/multi.c
Normal file
1176
apps/plugins/sdl/progs/duke3d/Engine/src/multi.c
Normal file
File diff suppressed because it is too large
Load diff
222
apps/plugins/sdl/progs/duke3d/Engine/src/network.c
Normal file
222
apps/plugins/sdl/progs/duke3d/Engine/src/network.c
Normal file
|
|
@ -0,0 +1,222 @@
|
|||
//
|
||||
// network.c
|
||||
// Duke3D
|
||||
//
|
||||
// Created by fabien sanglard on 12-12-22.
|
||||
// Copyright (c) 2012 fabien sanglard. All rights reserved.
|
||||
//
|
||||
|
||||
#include "network.h"
|
||||
|
||||
int nNetMode = 0;
|
||||
|
||||
//#include "mmulti_stable.h"
|
||||
void Setup_UnstableNetworking()
|
||||
{
|
||||
nNetMode = 0;
|
||||
}
|
||||
|
||||
void Setup_StableNetworking()
|
||||
{
|
||||
nNetMode = 1;
|
||||
}
|
||||
|
||||
|
||||
//TODO ( "[Fix this horrible networking mess. Function pointers not happy]" )
|
||||
// I do not like this one bit.
|
||||
// Figure out what was causing the problems with the function pointers.
|
||||
// This mess is a direct result of my lack of time.. bleh
|
||||
// This mess shouldn't even be in this file. /slap /slap
|
||||
void callcommit(void)
|
||||
{
|
||||
#ifndef USER_DUMMY_NETWORK
|
||||
switch(nNetMode)
|
||||
{
|
||||
case 0:
|
||||
unstable_callcommit();
|
||||
break;
|
||||
case 1:
|
||||
stable_callcommit();
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
void initcrc(void)
|
||||
{
|
||||
#ifndef USER_DUMMY_NETWORK
|
||||
switch(nNetMode)
|
||||
{
|
||||
case 0:
|
||||
unstable_initcrc();
|
||||
break;
|
||||
case 1:
|
||||
stable_initcrc();
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
int32_t getcrc(uint8_t *buffer, short bufleng)
|
||||
{
|
||||
#ifndef USER_DUMMY_NETWORK
|
||||
switch(nNetMode)
|
||||
{
|
||||
case 0:
|
||||
return unstable_getcrc(buffer, bufleng);
|
||||
case 1:
|
||||
return stable_getcrc(buffer, bufleng);
|
||||
}
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
void initmultiplayers(uint8_t damultioption, uint8_t dacomrateoption, uint8_t dapriority)
|
||||
{
|
||||
#ifndef USER_DUMMY_NETWORK
|
||||
switch(nNetMode)
|
||||
{
|
||||
case 0:
|
||||
unstable_initmultiplayers(damultioption, dacomrateoption, dapriority);
|
||||
break;
|
||||
case 1:
|
||||
stable_initmultiplayers(damultioption, dacomrateoption, dapriority);
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
void sendpacket(int32_t other, uint8_t *bufptr, int32_t messleng)
|
||||
{
|
||||
#ifndef USER_DUMMY_NETWORK
|
||||
switch(nNetMode)
|
||||
{
|
||||
case 0:
|
||||
unstable_sendpacket(other, bufptr, messleng);
|
||||
break;
|
||||
case 1:
|
||||
stable_sendpacket(other, bufptr, messleng);
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
void setpackettimeout(int32_t datimeoutcount, int32_t daresendagaincount)
|
||||
{
|
||||
#ifndef USER_DUMMY_NETWORK
|
||||
switch(nNetMode)
|
||||
{
|
||||
case 0:
|
||||
unstable_setpackettimeout(datimeoutcount, daresendagaincount);
|
||||
break;
|
||||
case 1:
|
||||
stable_setpackettimeout(datimeoutcount, daresendagaincount);
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
void uninitmultiplayers(void)
|
||||
{
|
||||
#ifndef USER_DUMMY_NETWORK
|
||||
switch(nNetMode)
|
||||
{
|
||||
case 0:
|
||||
unstable_uninitmultiplayers();
|
||||
break;
|
||||
case 1:
|
||||
stable_uninitmultiplayers();
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
void sendlogon(void)
|
||||
{
|
||||
#ifndef USER_DUMMY_NETWORK
|
||||
switch(nNetMode)
|
||||
{
|
||||
case 0:
|
||||
unstable_sendlogon();
|
||||
break;
|
||||
case 1:
|
||||
unstable_sendlogon();
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
void sendlogoff(void)
|
||||
{
|
||||
#ifndef USER_DUMMY_NETWORK
|
||||
switch(nNetMode)
|
||||
{
|
||||
case 0:
|
||||
unstable_sendlogoff();
|
||||
break;
|
||||
case 1:
|
||||
stable_sendlogoff();
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
int getoutputcirclesize(void)
|
||||
{
|
||||
#ifndef USER_DUMMY_NETWORK
|
||||
switch(nNetMode)
|
||||
{
|
||||
case 0:
|
||||
return unstable_getoutputcirclesize();
|
||||
case 1:
|
||||
return stable_getoutputcirclesize();
|
||||
}
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
void setsocket(short newsocket)
|
||||
{
|
||||
#ifndef USER_DUMMY_NETWORK
|
||||
switch(nNetMode)
|
||||
{
|
||||
case 0:
|
||||
unstable_setsocket(newsocket);
|
||||
break;
|
||||
case 1:
|
||||
stable_setsocket(newsocket);
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
short getpacket(short *other, uint8_t *bufptr)
|
||||
{
|
||||
#ifndef USER_DUMMY_NETWORK
|
||||
switch(nNetMode)
|
||||
{
|
||||
case 0:
|
||||
return unstable_getpacket(other, bufptr); // default
|
||||
case 1:
|
||||
return stable_getpacket(other, bufptr);
|
||||
}
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
void flushpackets(void)
|
||||
{
|
||||
#ifndef USER_DUMMY_NETWORK
|
||||
switch(nNetMode)
|
||||
{
|
||||
case 0:
|
||||
unstable_flushpackets();
|
||||
break;
|
||||
case 1:
|
||||
stable_flushpackets();
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
void genericmultifunction(int32_t other, char *bufptr, int32_t messleng, int32_t command)
|
||||
{
|
||||
#ifndef USER_DUMMY_NETWORK
|
||||
switch(nNetMode)
|
||||
{
|
||||
case 0:
|
||||
unstable_genericmultifunction(other, bufptr, messleng, command);
|
||||
break;
|
||||
case 1:
|
||||
stable_genericmultifunction(other, bufptr, messleng, command);
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
33
apps/plugins/sdl/progs/duke3d/Engine/src/network.h
Normal file
33
apps/plugins/sdl/progs/duke3d/Engine/src/network.h
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
//
|
||||
// network.h
|
||||
// Duke3D
|
||||
//
|
||||
// Created by fabien sanglard on 12-12-22.
|
||||
// Copyright (c) 2012 fabien sanglard. All rights reserved.
|
||||
//
|
||||
|
||||
#ifndef Duke3D_network_h
|
||||
#define Duke3D_network_h
|
||||
|
||||
#include "platform.h"
|
||||
|
||||
void Setup_UnstableNetworking();
|
||||
void Setup_StableNetworking();
|
||||
|
||||
void callcommit(void);
|
||||
void initcrc(void);
|
||||
int32_t getcrc(uint8_t *buffer, short bufleng);
|
||||
void initmultiplayers(uint8_t damultioption, uint8_t dacomrateoption, uint8_t dapriority);
|
||||
void sendpacket(int32_t other, uint8_t *bufptr, int32_t messleng);
|
||||
void setpackettimeout(int32_t datimeoutcount, int32_t daresendagaincount);
|
||||
void uninitmultiplayers(void);
|
||||
void sendlogon(void);
|
||||
void sendlogoff(void);
|
||||
int getoutputcirclesize(void);
|
||||
void setsocket(short newsocket);
|
||||
short getpacket(short *other, uint8_t *bufptr);
|
||||
void flushpackets(void);
|
||||
void genericmultifunction(int32_t other, char *bufptr, int32_t messleng, int32_t command);
|
||||
|
||||
|
||||
#endif
|
||||
38
apps/plugins/sdl/progs/duke3d/Engine/src/platform.h
Normal file
38
apps/plugins/sdl/progs/duke3d/Engine/src/platform.h
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
#ifndef _INCLUDE_PLATFORM_DUKE_H_
|
||||
#define _INCLUDE_PLATFORM_DUKE_H_
|
||||
|
||||
#if (defined PLATFORM_WIN32)
|
||||
#include "win32_compat.h"
|
||||
#elif (defined PLATFORM_UNIX)
|
||||
#include "unix_compat.h"
|
||||
#elif (defined PLATFORM_DOS)
|
||||
#include "doscmpat.h"
|
||||
#elif (defined __APPLE__)
|
||||
#include "macos_compat.h"
|
||||
#elif (defined ROCKBOX)
|
||||
#include "rockbox_compat.h"
|
||||
#else
|
||||
#error Define your platform!
|
||||
#endif
|
||||
|
||||
#if (!defined __EXPORT__)
|
||||
#define __EXPORT__
|
||||
#endif
|
||||
|
||||
uint16_t _swap16(uint16_t D);
|
||||
unsigned int _swap32(unsigned int D);
|
||||
#if defined(PLATFORM_MACOSX) && defined(__ppc__)
|
||||
#define PLATFORM_BIGENDIAN 1
|
||||
#define BUILDSWAP_INTEL16(x) _swap16(x)
|
||||
#define BUILDSWAP_INTEL32(x) _swap32(x)
|
||||
#else
|
||||
#define PLATFORM_LITTLEENDIAN 1
|
||||
#define BUILDSWAP_INTEL16(x) (x)
|
||||
#define BUILDSWAP_INTEL32(x) (x)
|
||||
#endif
|
||||
|
||||
#endif /* !defined _INCLUDE_PLATFORM_H_ */
|
||||
|
||||
/* end of platform.h ... */
|
||||
|
||||
|
||||
67
apps/plugins/sdl/progs/duke3d/Engine/src/rockbox_compat.h
Normal file
67
apps/plugins/sdl/progs/duke3d/Engine/src/rockbox_compat.h
Normal file
|
|
@ -0,0 +1,67 @@
|
|||
//
|
||||
// rockbox_compat.h
|
||||
// Duke3D
|
||||
//
|
||||
// Based on unix_compat.h
|
||||
// Copyright Wed, Jul 31, 2013, Juan Manuel Borges Caño (GPLv3+)
|
||||
//
|
||||
|
||||
/* all we need */
|
||||
#include "SDL.h"
|
||||
#include "plugin.h"
|
||||
|
||||
#ifndef Duke3D_rockbox_compat_h
|
||||
#define Duke3D_rockbox_compat_h
|
||||
|
||||
//#define BYTE_ORDER LITTLE_ENDIAN
|
||||
#define PLATFORM_SUPPORTS_SDL
|
||||
|
||||
#define kmalloc(x) malloc(x)
|
||||
#define kkmalloc(x) malloc(x)
|
||||
#define kfree(x) free(x)
|
||||
#define kkfree(x) free(x)
|
||||
|
||||
#ifdef FP_OFF
|
||||
#undef FP_OFF
|
||||
#endif
|
||||
|
||||
// Horrible horrible macro: Watcom allowed memory pointer to be cast
|
||||
// to a 32bits integer. The code is unfortunately stuffed with this :( !
|
||||
#define FP_OFF(x) ((int32_t)(x))
|
||||
|
||||
#ifndef max
|
||||
#define max(x, y) (((x) > (y)) ? (x) : (y))
|
||||
#endif
|
||||
|
||||
#ifndef min
|
||||
#define min(x, y) (((x) < (y)) ? (x) : (y))
|
||||
#endif
|
||||
|
||||
#include <inttypes.h>
|
||||
#define __int64 int64_t
|
||||
|
||||
#define O_BINARY 0
|
||||
|
||||
#define UDP_NETWORKING 1
|
||||
|
||||
#define PLATFORM_ROCKBOX 1
|
||||
|
||||
#define read(a, b, c) rb->read((a), (b), (c))
|
||||
#define write(a, b, c) rb->write((a), (b), (c))
|
||||
#define close(a) rb->close(a)
|
||||
|
||||
|
||||
/*
|
||||
#define SOL_IP SOL_SOCKET
|
||||
#define IP_RECVERR SO_BROADCAST
|
||||
*/
|
||||
|
||||
#define stricmp strcasecmp
|
||||
#define strcmpi strcasecmp
|
||||
|
||||
#define S_IREAD S_IRUSR
|
||||
|
||||
#define USER_DUMMY_NETWORK 1
|
||||
#define STUB_NETWORKING 1
|
||||
|
||||
#endif
|
||||
386
apps/plugins/sdl/progs/duke3d/Engine/src/tiles.c
Normal file
386
apps/plugins/sdl/progs/duke3d/Engine/src/tiles.c
Normal file
|
|
@ -0,0 +1,386 @@
|
|||
//
|
||||
// tiles.c
|
||||
// Duke3D
|
||||
//
|
||||
// Created by fabien sanglard on 12-12-22.
|
||||
// Copyright (c) 2012 fabien sanglard. All rights reserved.
|
||||
//
|
||||
|
||||
#include "tiles.h"
|
||||
#include "engine.h"
|
||||
#include "draw.h"
|
||||
#include "filesystem.h"
|
||||
|
||||
char artfilename[20];
|
||||
|
||||
tile_t tiles[MAXTILES];
|
||||
|
||||
int32_t numTiles;
|
||||
|
||||
int32_t artversion;
|
||||
|
||||
uint8_t *pic = NULL;
|
||||
|
||||
uint8_t gotpic[(MAXTILES+7)>>3];
|
||||
|
||||
void setviewtotile(short tilenume, int32_t tileWidth, int32_t tileHeight)
|
||||
{
|
||||
int32_t i, j;
|
||||
|
||||
/* DRAWROOMS TO TILE BACKUP&SET CODE */
|
||||
tiles[tilenume].dim.width = tileWidth;
|
||||
tiles[tilenume].dim.height = tileHeight;
|
||||
bakxsiz[setviewcnt] = tileWidth;
|
||||
bakysiz[setviewcnt] = tileHeight;
|
||||
bakvidoption[setviewcnt] = vidoption;
|
||||
vidoption = 2;
|
||||
bakframeplace[setviewcnt] = frameplace;
|
||||
frameplace = tiles[tilenume].data;
|
||||
bakwindowx1[setviewcnt] = windowx1;
|
||||
bakwindowy1[setviewcnt] = windowy1;
|
||||
bakwindowx2[setviewcnt] = windowx2;
|
||||
bakwindowy2[setviewcnt] = windowy2;
|
||||
copybufbyte(&startumost[windowx1],&bakumost[windowx1],(windowx2-windowx1+1)*sizeof(bakumost[0]));
|
||||
copybufbyte(&startdmost[windowx1],&bakdmost[windowx1],(windowx2-windowx1+1)*sizeof(bakdmost[0]));
|
||||
setview(0,0,tileHeight-1,tileWidth-1);
|
||||
setaspect(65536,65536);
|
||||
j = 0;
|
||||
for(i=0; i<=tileWidth; i++) {
|
||||
ylookup[i] = j;
|
||||
j += tileWidth;
|
||||
}
|
||||
setBytesPerLine(tileHeight);
|
||||
setviewcnt++;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void squarerotatetile(short tilenume)
|
||||
{
|
||||
int32_t i, j, k;
|
||||
uint8_t *ptr1, *ptr2;
|
||||
|
||||
dimensions_t tileDim;
|
||||
|
||||
tileDim.width = tiles[tilenume].dim.width;
|
||||
tileDim.height = tiles[tilenume].dim.height;
|
||||
|
||||
/* supports square tiles only for rotation part */
|
||||
if (tileDim.width == tileDim.height)
|
||||
{
|
||||
k = (tileDim.width<<1);
|
||||
for(i=tileDim.width-1; i>=0; i--)
|
||||
{
|
||||
ptr1 = tiles[tilenume].data+i*(tileDim.width+1);
|
||||
ptr2 = ptr1;
|
||||
if ((i&1) != 0) {
|
||||
ptr1--;
|
||||
ptr2 -= tileDim.width;
|
||||
swapchar(ptr1,ptr2);
|
||||
}
|
||||
for(j=(i>>1)-1; j>=0; j--)
|
||||
{
|
||||
ptr1 -= 2;
|
||||
ptr2 -= k;
|
||||
swapchar2(ptr1,ptr2,tileDim.width);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
//1. Lock a picture in the cache system.
|
||||
//2. Mark it as used in the bitvector tracker.
|
||||
void setgotpic(int32_t tilenume)
|
||||
{
|
||||
if (tiles[tilenume].lock < 200)
|
||||
tiles[tilenume].lock = 199;
|
||||
|
||||
gotpic[tilenume>>3] |= pow2char[tilenume&7];
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void loadtile(short tilenume)
|
||||
{
|
||||
uint8_t *ptr;
|
||||
int32_t i, tileFilesize;
|
||||
|
||||
|
||||
|
||||
|
||||
if ((uint32_t)tilenume >= (uint32_t)MAXTILES)
|
||||
return;
|
||||
|
||||
tileFilesize = tiles[tilenume].dim.width * tiles[tilenume].dim.height;
|
||||
|
||||
if (tileFilesize <= 0)
|
||||
return;
|
||||
|
||||
i = tilefilenum[tilenume];
|
||||
if (i != artfilnum){
|
||||
if (artfil != -1)
|
||||
kclose(artfil);
|
||||
artfilnum = i;
|
||||
artfilplc = 0L;
|
||||
|
||||
artfilename[7] = (i%10)+48;
|
||||
artfilename[6] = ((i/10)%10)+48;
|
||||
artfilename[5] = ((i/100)%10)+48;
|
||||
artfil = TCkopen4load(artfilename,0);
|
||||
|
||||
if (artfil == -1){
|
||||
printf("Error, unable to load artfile:'%s'.\n",artfilename);
|
||||
getchar();
|
||||
exit(0);
|
||||
}
|
||||
|
||||
faketimerhandler();
|
||||
}
|
||||
|
||||
if (tiles[tilenume].data == NULL){
|
||||
tiles[tilenume].lock = 199;
|
||||
allocache(&tiles[tilenume].data,tileFilesize,(uint8_t *) &tiles[tilenume].lock);
|
||||
}
|
||||
|
||||
if (artfilplc != tilefileoffs[tilenume])
|
||||
{
|
||||
klseek(artfil,tilefileoffs[tilenume]-artfilplc,SEEK_CUR);
|
||||
faketimerhandler();
|
||||
}
|
||||
ptr = tiles[tilenume].data;
|
||||
|
||||
kread(artfil,ptr,tileFilesize);
|
||||
faketimerhandler();
|
||||
artfilplc = tilefileoffs[tilenume]+tileFilesize;
|
||||
}
|
||||
|
||||
|
||||
|
||||
uint8_t* allocatepermanenttile(short tilenume, int32_t width, int32_t height)
|
||||
{
|
||||
int32_t j;
|
||||
uint32_t tileDataSize;
|
||||
|
||||
//Check dimensions are correct.
|
||||
if ((width <= 0) || (height <= 0) || ((uint32_t)tilenume >= (uint32_t)MAXTILES))
|
||||
return(0);
|
||||
|
||||
tileDataSize = width * height;
|
||||
|
||||
tiles[tilenume].lock = 255;
|
||||
allocache(&tiles[tilenume].data,tileDataSize,(uint8_t *) &tiles[tilenume].lock);
|
||||
|
||||
tiles[tilenume].dim.width = width;
|
||||
tiles[tilenume].dim.height = height;
|
||||
tiles[tilenume].animFlags = 0;
|
||||
|
||||
j = 15;
|
||||
while ((j > 1) && (pow2long[j] > width))
|
||||
j--;
|
||||
picsiz[tilenume] = ((uint8_t )j);
|
||||
|
||||
j = 15;
|
||||
while ((j > 1) && (pow2long[j] > height))
|
||||
j--;
|
||||
picsiz[tilenume] += ((uint8_t )(j<<4));
|
||||
|
||||
return(tiles[tilenume].data);
|
||||
}
|
||||
|
||||
|
||||
|
||||
int loadpics(char *filename, char * gamedir)
|
||||
|
||||
{
|
||||
int32_t offscount, localtilestart, localtileend, dasiz;
|
||||
short fil, i, j, k;
|
||||
|
||||
|
||||
strcpy(artfilename,filename);
|
||||
|
||||
for(i=0; i<MAXTILES; i++)
|
||||
{
|
||||
tiles[i].dim.width = 0;
|
||||
tiles[i].dim.height = 0;
|
||||
tiles[i].animFlags = 0L;
|
||||
}
|
||||
|
||||
artsize = 0L;
|
||||
|
||||
numtilefiles = 0;
|
||||
do
|
||||
{
|
||||
k = numtilefiles;
|
||||
|
||||
artfilename[7] = (k%10)+48;
|
||||
artfilename[6] = ((k/10)%10)+48;
|
||||
artfilename[5] = ((k/100)%10)+48;
|
||||
|
||||
|
||||
|
||||
if ((fil = TCkopen4load(artfilename,0)) != -1)
|
||||
{
|
||||
kread32(fil,&artversion);
|
||||
if (artversion != 1) return(-1);
|
||||
|
||||
kread32(fil,&numTiles);
|
||||
kread32(fil,&localtilestart);
|
||||
kread32(fil,&localtileend);
|
||||
|
||||
/*kread(fil,&tilesizx[localtilestart],(localtileend-localtilestart+1)<<1);*/
|
||||
for (i = localtilestart; i <= localtileend; i++)
|
||||
kread16(fil,&tiles[i].dim.width);
|
||||
|
||||
/*kread(fil,&tilesizy[localtilestart],(localtileend-localtilestart+1)<<1);*/
|
||||
for (i = localtilestart; i <= localtileend; i++)
|
||||
kread16(fil,&tiles[i].dim.height);
|
||||
|
||||
/*kread(fil,&picanm[localtilestart],(localtileend-localtilestart+1)<<2);*/
|
||||
for (i = localtilestart; i <= localtileend; i++)
|
||||
kread32(fil,&tiles[i].animFlags);
|
||||
|
||||
offscount = 4+4+4+4+((localtileend-localtilestart+1)<<3);
|
||||
for(i=localtilestart; i<=localtileend; i++)
|
||||
{
|
||||
tilefilenum[i] = k;
|
||||
tilefileoffs[i] = offscount;
|
||||
dasiz = tiles[i].dim.width*tiles[i].dim.height;
|
||||
offscount += dasiz;
|
||||
artsize += ((dasiz+15)&0xfffffff0);
|
||||
}
|
||||
kclose(fil);
|
||||
|
||||
numtilefiles++;
|
||||
|
||||
}
|
||||
}
|
||||
while (k != numtilefiles);
|
||||
|
||||
printf("Art files loaded\n");
|
||||
|
||||
clearbuf(gotpic,(MAXTILES+31)>>5,0L);
|
||||
|
||||
/* try dpmi_DETERMINEMAXREALALLOC! */
|
||||
|
||||
cachesize = max(artsize,1048576);
|
||||
while ((pic = (uint8_t *)kkmalloc(cachesize)) == NULL)
|
||||
{
|
||||
cachesize -= 65536L;
|
||||
if (cachesize < 65536) return(-1);
|
||||
}
|
||||
initcache(pic,cachesize);
|
||||
|
||||
for(i=0; i<MAXTILES; i++)
|
||||
{
|
||||
j = 15;
|
||||
while ((j > 1) && (pow2long[j] > tiles[i].dim.width))
|
||||
j--;
|
||||
|
||||
picsiz[i] = ((uint8_t )j);
|
||||
j = 15;
|
||||
|
||||
while ((j > 1) && (pow2long[j] > tiles[i].dim.height))
|
||||
j--;
|
||||
|
||||
picsiz[i] += ((uint8_t )(j<<4));
|
||||
}
|
||||
|
||||
artfil = -1;
|
||||
artfilnum = -1;
|
||||
artfilplc = 0L;
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
||||
void TILE_MakeAvailable(short picID){
|
||||
if (tiles[picID].data == NULL)
|
||||
loadtile(picID);
|
||||
|
||||
}
|
||||
|
||||
void copytilepiece(int32_t tilenume1, int32_t sx1, int32_t sy1, int32_t xsiz, int32_t ysiz,
|
||||
int32_t tilenume2, int32_t sx2, int32_t sy2)
|
||||
{
|
||||
uint8_t *ptr1, *ptr2, dat;
|
||||
int32_t xsiz1, ysiz1, xsiz2, ysiz2, i, j, x1, y1, x2, y2;
|
||||
|
||||
xsiz1 = tiles[tilenume1].dim.width;
|
||||
ysiz1 = tiles[tilenume1].dim.height;
|
||||
|
||||
xsiz2 = tiles[tilenume2].dim.width;
|
||||
ysiz2 = tiles[tilenume2].dim.height;
|
||||
|
||||
|
||||
if ((xsiz1 > 0) && (ysiz1 > 0) && (xsiz2 > 0) && (ysiz2 > 0))
|
||||
{
|
||||
TILE_MakeAvailable(tilenume1);
|
||||
TILE_MakeAvailable(tilenume2);
|
||||
|
||||
x1 = sx1;
|
||||
for(i=0; i<xsiz; i++)
|
||||
{
|
||||
y1 = sy1;
|
||||
for(j=0; j<ysiz; j++)
|
||||
{
|
||||
x2 = sx2+i;
|
||||
y2 = sy2+j;
|
||||
if ((x2 >= 0) && (y2 >= 0) && (x2 < xsiz2) && (y2 < ysiz2))
|
||||
{
|
||||
ptr1 = tiles[tilenume1].data + x1*ysiz1 + y1;
|
||||
ptr2 = tiles[tilenume2].data + x2*ysiz2 + y2;
|
||||
dat = *ptr1;
|
||||
|
||||
|
||||
if (dat != 255)
|
||||
*ptr2 = *ptr1;
|
||||
}
|
||||
|
||||
y1++;
|
||||
if (y1 >= ysiz1) y1 = 0;
|
||||
}
|
||||
x1++;
|
||||
if (x1 >= xsiz1) x1 = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
FCS: If a texture is animated, this will return the offset to add to tilenum
|
||||
in order to retrieve the texture to display.
|
||||
*/
|
||||
int animateoffs(int16_t tilenum)
|
||||
{
|
||||
int32_t i, k, offs;
|
||||
|
||||
offs = 0;
|
||||
|
||||
i = (totalclocklock>>((tiles[tilenum].animFlags>>24)&15));
|
||||
|
||||
if ((tiles[tilenum].animFlags&63) > 0){
|
||||
switch(tiles[tilenum].animFlags&192)
|
||||
{
|
||||
case 64:
|
||||
k = (i%((tiles[tilenum].animFlags&63)<<1));
|
||||
if (k < (tiles[tilenum].animFlags&63))
|
||||
offs = k;
|
||||
else
|
||||
offs = (((tiles[tilenum].animFlags&63)<<1)-k);
|
||||
break;
|
||||
case 128:
|
||||
offs = (i%((tiles[tilenum].animFlags&63)+1));
|
||||
break;
|
||||
case 192:
|
||||
offs = -(i%((tiles[tilenum].animFlags&63)+1));
|
||||
}
|
||||
}
|
||||
|
||||
return(offs);
|
||||
}
|
||||
73
apps/plugins/sdl/progs/duke3d/Engine/src/tiles.h
Normal file
73
apps/plugins/sdl/progs/duke3d/Engine/src/tiles.h
Normal file
|
|
@ -0,0 +1,73 @@
|
|||
//
|
||||
// tiles.h
|
||||
// Duke3D
|
||||
//
|
||||
// Created by fabien sanglard on 12-12-22.
|
||||
// Copyright (c) 2012 fabien sanglard. All rights reserved.
|
||||
//
|
||||
|
||||
#ifndef Duke3D_tiles_h
|
||||
#define Duke3D_tiles_h
|
||||
|
||||
#include "build.h"
|
||||
|
||||
|
||||
|
||||
/*
|
||||
// The dimension of the tile in texels unit. The sizes can be obtained for
|
||||
// any tile by doing a tilesizx * tilesizy
|
||||
//EXTERN short tilesizx[MAXTILES], tilesizy[MAXTILES];
|
||||
typedef struct dimensions_s{
|
||||
short width;
|
||||
short height;
|
||||
} dimensions_t;
|
||||
dimensions_t tiles[MAXTILES];
|
||||
|
||||
// An array of locks for each pic: Used to check if a texture is in RAM or in the GRP.
|
||||
EXTERN uint8_t walock[MAXTILES];
|
||||
EXTERN int32_t numtiles, picanm[MAXTILES];
|
||||
|
||||
//The wall texture data.
|
||||
EXTERN uint8_t* waloff[MAXTILES];
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
typedef struct dimensions_s{
|
||||
short width;
|
||||
short height;
|
||||
} dimensions_t;
|
||||
|
||||
typedef struct tile_s{
|
||||
dimensions_t dim;
|
||||
uint8_t lock;
|
||||
int32_t animFlags;
|
||||
uint8_t* data;
|
||||
} tile_t;
|
||||
|
||||
|
||||
extern tile_t tiles[MAXTILES];
|
||||
|
||||
void setviewtotile(short tilenume, int32_t tileWidth, int32_t tileHeight);
|
||||
void squarerotatetile(short tilenume);
|
||||
|
||||
void loadtile(short tilenume);
|
||||
uint8_t* allocatepermanenttile(short tilenume, int32_t width, int32_t height);
|
||||
int loadpics(char *filename, char * gamedir);
|
||||
void copytilepiece(int32_t tilenume1, int32_t sx1, int32_t sy1, int32_t xsiz, int32_t ysiz,int32_t tilenume2, int32_t sx2, int32_t sy2);
|
||||
|
||||
|
||||
//Bitvector marking picture used for rendition.
|
||||
extern uint8_t gotpic[(MAXTILES+7)>>3];
|
||||
void setgotpic(int32_t tilenume);
|
||||
|
||||
|
||||
|
||||
int animateoffs(int16_t tilenum);
|
||||
|
||||
extern uint8_t *pic ;
|
||||
|
||||
void TILE_MakeAvailable(short picID);
|
||||
|
||||
#endif
|
||||
67
apps/plugins/sdl/progs/duke3d/Engine/src/unix_compat.h
Normal file
67
apps/plugins/sdl/progs/duke3d/Engine/src/unix_compat.h
Normal file
|
|
@ -0,0 +1,67 @@
|
|||
//
|
||||
// unix_compat.h
|
||||
// Duke3D
|
||||
//
|
||||
// Based on macos_compat.h
|
||||
// Copyright Wed, Jul 31, 2013, Juan Manuel Borges Caño (GPLv3+)
|
||||
//
|
||||
|
||||
#ifndef Duke3D_unix_compat_h
|
||||
#define Duke3D_unix_compat_h
|
||||
|
||||
//#define BYTE_ORDER LITTLE_ENDIAN
|
||||
#define PLATFORM_SUPPORTS_SDL
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#define kmalloc(x) malloc(x)
|
||||
#define kkmalloc(x) malloc(x)
|
||||
#define kfree(x) free(x)
|
||||
#define kkfree(x) free(x)
|
||||
|
||||
#ifdef FP_OFF
|
||||
#undef FP_OFF
|
||||
#endif
|
||||
|
||||
// Horrible horrible macro: Watcom allowed memory pointer to be cast
|
||||
// to a 32bits integer. The code is unfortunately stuffed with this :( !
|
||||
#define FP_OFF(x) ((int32_t) (x))
|
||||
|
||||
#ifndef max
|
||||
#define max(x, y) (((x) > (y)) ? (x) : (y))
|
||||
#endif
|
||||
|
||||
#ifndef min
|
||||
#define min(x, y) (((x) < (y)) ? (x) : (y))
|
||||
#endif
|
||||
|
||||
#include <inttypes.h>
|
||||
#define __int64 int64_t
|
||||
|
||||
#define O_BINARY 0
|
||||
|
||||
#define UDP_NETWORKING 1
|
||||
|
||||
#define PLATFORM_UNIX 1
|
||||
|
||||
/*
|
||||
#define SOL_IP SOL_SOCKET
|
||||
#define IP_RECVERR SO_BROADCAST
|
||||
*/
|
||||
|
||||
#define stricmp strcasecmp
|
||||
#define strcmpi strcasecmp
|
||||
|
||||
#define S_IREAD S_IRUSR
|
||||
#include <assert.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/uio.h>
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
#include <dirent.h>
|
||||
#include <string.h>
|
||||
|
||||
#define USER_DUMMY_NETWORK 1
|
||||
|
||||
#endif
|
||||
106
apps/plugins/sdl/progs/duke3d/Engine/src/win32_compat.h
Normal file
106
apps/plugins/sdl/progs/duke3d/Engine/src/win32_compat.h
Normal file
|
|
@ -0,0 +1,106 @@
|
|||
/*
|
||||
* win32 compatibility header. Takes care of some legacy code issues
|
||||
* and incompatibilities at the source level.
|
||||
*
|
||||
* Written by Ryan C. Gordon (icculus@clutteredmind.org)
|
||||
*
|
||||
* Please do NOT harrass Ken Silverman about any code modifications
|
||||
* (including this file) to BUILD.
|
||||
*/
|
||||
|
||||
/*
|
||||
* "Build Engine & Tools" Copyright (c) 1993-1997 Ken Silverman
|
||||
* Ken Silverman's official web site: "http://www.advsys.net/ken"
|
||||
* See the included license file "BUILDLIC.TXT" for license info.
|
||||
* This file IS NOT A PART OF Ken Silverman's original release
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#ifndef _INCLUDE_WIN32_COMPAT_H_
|
||||
#define _INCLUDE_WIN32_COMPAT_H_
|
||||
|
||||
#if (!defined PLATFORM_WIN32)
|
||||
#error PLATFORM_WIN32 is not defined.
|
||||
#endif
|
||||
|
||||
#define PLATFORM_SUPPORTS_SDL
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#if (!defined _MSC_VER)
|
||||
#include <unistd.h>
|
||||
#else
|
||||
#include <fcntl.h>
|
||||
#include <SYS\STAT.H>
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <io.h>
|
||||
#include <direct.h>
|
||||
#include <conio.h>
|
||||
#include <dos.h>
|
||||
#include <assert.h>
|
||||
#include <string.h>
|
||||
|
||||
#define kmalloc(x) malloc(x)
|
||||
#define kkmalloc(x) malloc(x)
|
||||
#define kfree(x) free(x)
|
||||
#define kkfree(x) free(x)
|
||||
|
||||
#ifdef FP_OFF
|
||||
#undef FP_OFF
|
||||
#endif
|
||||
|
||||
#define FP_OFF(x) ((long) (x))
|
||||
|
||||
/* !!! This might be temporary. */
|
||||
#define printext16 printext256
|
||||
#define printext16_noupdate printext256_noupdate
|
||||
|
||||
#ifndef max
|
||||
#define max(x, y) (((x) > (y)) ? (x) : (y))
|
||||
#endif
|
||||
|
||||
#ifndef min
|
||||
#define min(x, y) (((x) < (y)) ? (x) : (y))
|
||||
#endif
|
||||
|
||||
#if (defined __WATCOMC__)
|
||||
#define inline
|
||||
#pragma intrinsic(min);
|
||||
#pragma intrinsic(max);
|
||||
#define __int64 long long
|
||||
#endif
|
||||
|
||||
#if (defined _MSC_VER)
|
||||
#if ((!defined _INTEGRAL_MAX_BITS) || (_INTEGRAL_MAX_BITS < 64))
|
||||
#error __int64 type not supported
|
||||
#endif
|
||||
|
||||
#define open _open
|
||||
#define O_BINARY _O_BINARY
|
||||
#define O_RDONLY _O_RDONLY
|
||||
#define O_WRONLY _O_WRONLY
|
||||
#define O_RDWR _O_RDWR
|
||||
#define O_TRUNC _O_TRUNC
|
||||
#define O_CREAT _O_CREAT
|
||||
#define S_IREAD _S_IREAD
|
||||
#define S_IWRITE _S_IWRITE
|
||||
#define S_IRDWR _S_IRDWR
|
||||
#endif /* defined _MSC_VER */
|
||||
|
||||
#define snprintf _snprintf
|
||||
|
||||
#define strncasecmp strnicmp
|
||||
|
||||
//Damn you Microsoft, how hard would it REALLY be to support C99 ?!??!?!
|
||||
#define inline
|
||||
#include "windows/inttypes.h"
|
||||
|
||||
#endif
|
||||
|
||||
/* end of win32_compat.h ... */
|
||||
|
||||
|
||||
|
||||
305
apps/plugins/sdl/progs/duke3d/Engine/src/windows/inttypes.h
Normal file
305
apps/plugins/sdl/progs/duke3d/Engine/src/windows/inttypes.h
Normal file
|
|
@ -0,0 +1,305 @@
|
|||
// ISO C9x compliant inttypes.h for Microsoft Visual Studio
|
||||
// Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124
|
||||
//
|
||||
// Copyright (c) 2006 Alexander Chemeris
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are met:
|
||||
//
|
||||
// 1. Redistributions of source code must retain the above copyright notice,
|
||||
// this list of conditions and the following disclaimer.
|
||||
//
|
||||
// 2. Redistributions in binary form must reproduce the above copyright
|
||||
// notice, this list of conditions and the following disclaimer in the
|
||||
// documentation and/or other materials provided with the distribution.
|
||||
//
|
||||
// 3. The name of the author may be used to endorse or promote products
|
||||
// derived from this software without specific prior written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
||||
// EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
||||
// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||
// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _MSC_VER // [
|
||||
#error "Use this header only with Microsoft Visual C++ compilers!"
|
||||
#endif // _MSC_VER ]
|
||||
|
||||
#ifndef _MSC_INTTYPES_H_ // [
|
||||
#define _MSC_INTTYPES_H_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "stdint.h"
|
||||
|
||||
// 7.8 Format conversion of integer types
|
||||
|
||||
typedef struct {
|
||||
intmax_t quot;
|
||||
intmax_t rem;
|
||||
} imaxdiv_t;
|
||||
|
||||
// 7.8.1 Macros for format specifiers
|
||||
|
||||
#if !defined(__cplusplus) || defined(__STDC_FORMAT_MACROS) // [ See footnote 185 at page 198
|
||||
|
||||
// The fprintf macros for signed integers are:
|
||||
#define PRId8 "d"
|
||||
#define PRIi8 "i"
|
||||
#define PRIdLEAST8 "d"
|
||||
#define PRIiLEAST8 "i"
|
||||
#define PRIdFAST8 "d"
|
||||
#define PRIiFAST8 "i"
|
||||
|
||||
#define PRId16 "hd"
|
||||
#define PRIi16 "hi"
|
||||
#define PRIdLEAST16 "hd"
|
||||
#define PRIiLEAST16 "hi"
|
||||
#define PRIdFAST16 "hd"
|
||||
#define PRIiFAST16 "hi"
|
||||
|
||||
#define PRId32 "I32d"
|
||||
#define PRIi32 "I32i"
|
||||
#define PRIdLEAST32 "I32d"
|
||||
#define PRIiLEAST32 "I32i"
|
||||
#define PRIdFAST32 "I32d"
|
||||
#define PRIiFAST32 "I32i"
|
||||
|
||||
#define PRId64 "I64d"
|
||||
#define PRIi64 "I64i"
|
||||
#define PRIdLEAST64 "I64d"
|
||||
#define PRIiLEAST64 "I64i"
|
||||
#define PRIdFAST64 "I64d"
|
||||
#define PRIiFAST64 "I64i"
|
||||
|
||||
#define PRIdMAX "I64d"
|
||||
#define PRIiMAX "I64i"
|
||||
|
||||
#define PRIdPTR "Id"
|
||||
#define PRIiPTR "Ii"
|
||||
|
||||
// The fprintf macros for unsigned integers are:
|
||||
#define PRIo8 "o"
|
||||
#define PRIu8 "u"
|
||||
#define PRIx8 "x"
|
||||
#define PRIX8 "X"
|
||||
#define PRIoLEAST8 "o"
|
||||
#define PRIuLEAST8 "u"
|
||||
#define PRIxLEAST8 "x"
|
||||
#define PRIXLEAST8 "X"
|
||||
#define PRIoFAST8 "o"
|
||||
#define PRIuFAST8 "u"
|
||||
#define PRIxFAST8 "x"
|
||||
#define PRIXFAST8 "X"
|
||||
|
||||
#define PRIo16 "ho"
|
||||
#define PRIu16 "hu"
|
||||
#define PRIx16 "hx"
|
||||
#define PRIX16 "hX"
|
||||
#define PRIoLEAST16 "ho"
|
||||
#define PRIuLEAST16 "hu"
|
||||
#define PRIxLEAST16 "hx"
|
||||
#define PRIXLEAST16 "hX"
|
||||
#define PRIoFAST16 "ho"
|
||||
#define PRIuFAST16 "hu"
|
||||
#define PRIxFAST16 "hx"
|
||||
#define PRIXFAST16 "hX"
|
||||
|
||||
#define PRIo32 "I32o"
|
||||
#define PRIu32 "I32u"
|
||||
#define PRIx32 "I32x"
|
||||
#define PRIX32 "I32X"
|
||||
#define PRIoLEAST32 "I32o"
|
||||
#define PRIuLEAST32 "I32u"
|
||||
#define PRIxLEAST32 "I32x"
|
||||
#define PRIXLEAST32 "I32X"
|
||||
#define PRIoFAST32 "I32o"
|
||||
#define PRIuFAST32 "I32u"
|
||||
#define PRIxFAST32 "I32x"
|
||||
#define PRIXFAST32 "I32X"
|
||||
|
||||
#define PRIo64 "I64o"
|
||||
#define PRIu64 "I64u"
|
||||
#define PRIx64 "I64x"
|
||||
#define PRIX64 "I64X"
|
||||
#define PRIoLEAST64 "I64o"
|
||||
#define PRIuLEAST64 "I64u"
|
||||
#define PRIxLEAST64 "I64x"
|
||||
#define PRIXLEAST64 "I64X"
|
||||
#define PRIoFAST64 "I64o"
|
||||
#define PRIuFAST64 "I64u"
|
||||
#define PRIxFAST64 "I64x"
|
||||
#define PRIXFAST64 "I64X"
|
||||
|
||||
#define PRIoMAX "I64o"
|
||||
#define PRIuMAX "I64u"
|
||||
#define PRIxMAX "I64x"
|
||||
#define PRIXMAX "I64X"
|
||||
|
||||
#define PRIoPTR "Io"
|
||||
#define PRIuPTR "Iu"
|
||||
#define PRIxPTR "Ix"
|
||||
#define PRIXPTR "IX"
|
||||
|
||||
// The fscanf macros for signed integers are:
|
||||
#define SCNd8 "d"
|
||||
#define SCNi8 "i"
|
||||
#define SCNdLEAST8 "d"
|
||||
#define SCNiLEAST8 "i"
|
||||
#define SCNdFAST8 "d"
|
||||
#define SCNiFAST8 "i"
|
||||
|
||||
#define SCNd16 "hd"
|
||||
#define SCNi16 "hi"
|
||||
#define SCNdLEAST16 "hd"
|
||||
#define SCNiLEAST16 "hi"
|
||||
#define SCNdFAST16 "hd"
|
||||
#define SCNiFAST16 "hi"
|
||||
|
||||
#define SCNd32 "ld"
|
||||
#define SCNi32 "li"
|
||||
#define SCNdLEAST32 "ld"
|
||||
#define SCNiLEAST32 "li"
|
||||
#define SCNdFAST32 "ld"
|
||||
#define SCNiFAST32 "li"
|
||||
|
||||
#define SCNd64 "I64d"
|
||||
#define SCNi64 "I64i"
|
||||
#define SCNdLEAST64 "I64d"
|
||||
#define SCNiLEAST64 "I64i"
|
||||
#define SCNdFAST64 "I64d"
|
||||
#define SCNiFAST64 "I64i"
|
||||
|
||||
#define SCNdMAX "I64d"
|
||||
#define SCNiMAX "I64i"
|
||||
|
||||
#ifdef _WIN64 // [
|
||||
# define SCNdPTR "I64d"
|
||||
# define SCNiPTR "I64i"
|
||||
#else // _WIN64 ][
|
||||
# define SCNdPTR "ld"
|
||||
# define SCNiPTR "li"
|
||||
#endif // _WIN64 ]
|
||||
|
||||
// The fscanf macros for unsigned integers are:
|
||||
#define SCNo8 "o"
|
||||
#define SCNu8 "u"
|
||||
#define SCNx8 "x"
|
||||
#define SCNX8 "X"
|
||||
#define SCNoLEAST8 "o"
|
||||
#define SCNuLEAST8 "u"
|
||||
#define SCNxLEAST8 "x"
|
||||
#define SCNXLEAST8 "X"
|
||||
#define SCNoFAST8 "o"
|
||||
#define SCNuFAST8 "u"
|
||||
#define SCNxFAST8 "x"
|
||||
#define SCNXFAST8 "X"
|
||||
|
||||
#define SCNo16 "ho"
|
||||
#define SCNu16 "hu"
|
||||
#define SCNx16 "hx"
|
||||
#define SCNX16 "hX"
|
||||
#define SCNoLEAST16 "ho"
|
||||
#define SCNuLEAST16 "hu"
|
||||
#define SCNxLEAST16 "hx"
|
||||
#define SCNXLEAST16 "hX"
|
||||
#define SCNoFAST16 "ho"
|
||||
#define SCNuFAST16 "hu"
|
||||
#define SCNxFAST16 "hx"
|
||||
#define SCNXFAST16 "hX"
|
||||
|
||||
#define SCNo32 "lo"
|
||||
#define SCNu32 "lu"
|
||||
#define SCNx32 "lx"
|
||||
#define SCNX32 "lX"
|
||||
#define SCNoLEAST32 "lo"
|
||||
#define SCNuLEAST32 "lu"
|
||||
#define SCNxLEAST32 "lx"
|
||||
#define SCNXLEAST32 "lX"
|
||||
#define SCNoFAST32 "lo"
|
||||
#define SCNuFAST32 "lu"
|
||||
#define SCNxFAST32 "lx"
|
||||
#define SCNXFAST32 "lX"
|
||||
|
||||
#define SCNo64 "I64o"
|
||||
#define SCNu64 "I64u"
|
||||
#define SCNx64 "I64x"
|
||||
#define SCNX64 "I64X"
|
||||
#define SCNoLEAST64 "I64o"
|
||||
#define SCNuLEAST64 "I64u"
|
||||
#define SCNxLEAST64 "I64x"
|
||||
#define SCNXLEAST64 "I64X"
|
||||
#define SCNoFAST64 "I64o"
|
||||
#define SCNuFAST64 "I64u"
|
||||
#define SCNxFAST64 "I64x"
|
||||
#define SCNXFAST64 "I64X"
|
||||
|
||||
#define SCNoMAX "I64o"
|
||||
#define SCNuMAX "I64u"
|
||||
#define SCNxMAX "I64x"
|
||||
#define SCNXMAX "I64X"
|
||||
|
||||
#ifdef _WIN64 // [
|
||||
# define SCNoPTR "I64o"
|
||||
# define SCNuPTR "I64u"
|
||||
# define SCNxPTR "I64x"
|
||||
# define SCNXPTR "I64X"
|
||||
#else // _WIN64 ][
|
||||
# define SCNoPTR "lo"
|
||||
# define SCNuPTR "lu"
|
||||
# define SCNxPTR "lx"
|
||||
# define SCNXPTR "lX"
|
||||
#endif // _WIN64 ]
|
||||
|
||||
#endif // __STDC_FORMAT_MACROS ]
|
||||
|
||||
// 7.8.2 Functions for greatest-width integer types
|
||||
|
||||
// 7.8.2.1 The imaxabs function
|
||||
#define imaxabs _abs64
|
||||
|
||||
// 7.8.2.2 The imaxdiv function
|
||||
|
||||
// This is modified version of div() function from Microsoft's div.c found
|
||||
// in %MSVC.NET%\crt\src\div.c
|
||||
#ifdef STATIC_IMAXDIV // [
|
||||
static
|
||||
#else // STATIC_IMAXDIV ][
|
||||
_inline
|
||||
#endif // STATIC_IMAXDIV ]
|
||||
imaxdiv_t __cdecl imaxdiv(intmax_t numer, intmax_t denom)
|
||||
{
|
||||
imaxdiv_t result;
|
||||
|
||||
result.quot = numer / denom;
|
||||
result.rem = numer % denom;
|
||||
|
||||
if (numer < 0 && result.rem > 0) {
|
||||
// did division wrong; must fix up
|
||||
++result.quot;
|
||||
result.rem -= denom;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
// 7.8.2.3 The strtoimax and strtoumax functions
|
||||
#define strtoimax _strtoi64
|
||||
#define strtoumax _strtoui64
|
||||
|
||||
// 7.8.2.4 The wcstoimax and wcstoumax functions
|
||||
#define wcstoimax _wcstoi64
|
||||
#define wcstoumax _wcstoui64
|
||||
|
||||
|
||||
#endif // _MSC_INTTYPES_H_ ]
|
||||
247
apps/plugins/sdl/progs/duke3d/Engine/src/windows/stdint.h
Normal file
247
apps/plugins/sdl/progs/duke3d/Engine/src/windows/stdint.h
Normal file
|
|
@ -0,0 +1,247 @@
|
|||
// ISO C9x compliant stdint.h for Microsoft Visual Studio
|
||||
// Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124
|
||||
//
|
||||
// Copyright (c) 2006-2008 Alexander Chemeris
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are met:
|
||||
//
|
||||
// 1. Redistributions of source code must retain the above copyright notice,
|
||||
// this list of conditions and the following disclaimer.
|
||||
//
|
||||
// 2. Redistributions in binary form must reproduce the above copyright
|
||||
// notice, this list of conditions and the following disclaimer in the
|
||||
// documentation and/or other materials provided with the distribution.
|
||||
//
|
||||
// 3. The name of the author may be used to endorse or promote products
|
||||
// derived from this software without specific prior written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
||||
// EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
||||
// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||
// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _MSC_VER // [
|
||||
#error "Use this header only with Microsoft Visual C++ compilers!"
|
||||
#endif // _MSC_VER ]
|
||||
|
||||
#ifndef _MSC_STDINT_H_ // [
|
||||
#define _MSC_STDINT_H_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include <limits.h>
|
||||
|
||||
// For Visual Studio 6 in C++ mode and for many Visual Studio versions when
|
||||
// compiling for ARM we should wrap <wchar.h> include with 'extern "C++" {}'
|
||||
// or compiler give many errors like this:
|
||||
// error C2733: second C linkage of overloaded function 'wmemchr' not allowed
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
# include <wchar.h>
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
// Define _W64 macros to mark types changing their size, like intptr_t.
|
||||
#ifndef _W64
|
||||
# if !defined(__midl) && (defined(_X86_) || defined(_M_IX86)) && _MSC_VER >= 1300
|
||||
# define _W64 __w64
|
||||
# else
|
||||
# define _W64
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
// 7.18.1 Integer types
|
||||
|
||||
// 7.18.1.1 Exact-width integer types
|
||||
|
||||
// Visual Studio 6 and Embedded Visual C++ 4 doesn't
|
||||
// realize that, e.g. char has the same size as __int8
|
||||
// so we give up on __intX for them.
|
||||
#if (_MSC_VER < 1300)
|
||||
typedef signed char int8_t;
|
||||
typedef signed short int16_t;
|
||||
typedef signed int int32_t;
|
||||
typedef unsigned char uint8_t;
|
||||
typedef unsigned short uint16_t;
|
||||
typedef unsigned int uint32_t;
|
||||
#else
|
||||
typedef signed __int8 int8_t;
|
||||
typedef signed __int16 int16_t;
|
||||
typedef signed __int32 int32_t;
|
||||
typedef unsigned __int8 uint8_t;
|
||||
typedef unsigned __int16 uint16_t;
|
||||
typedef unsigned __int32 uint32_t;
|
||||
#endif
|
||||
typedef signed __int64 int64_t;
|
||||
typedef unsigned __int64 uint64_t;
|
||||
|
||||
|
||||
// 7.18.1.2 Minimum-width integer types
|
||||
typedef int8_t int_least8_t;
|
||||
typedef int16_t int_least16_t;
|
||||
typedef int32_t int_least32_t;
|
||||
typedef int64_t int_least64_t;
|
||||
typedef uint8_t uint_least8_t;
|
||||
typedef uint16_t uint_least16_t;
|
||||
typedef uint32_t uint_least32_t;
|
||||
typedef uint64_t uint_least64_t;
|
||||
|
||||
// 7.18.1.3 Fastest minimum-width integer types
|
||||
typedef int8_t int_fast8_t;
|
||||
typedef int16_t int_fast16_t;
|
||||
typedef int32_t int_fast32_t;
|
||||
typedef int64_t int_fast64_t;
|
||||
typedef uint8_t uint_fast8_t;
|
||||
typedef uint16_t uint_fast16_t;
|
||||
typedef uint32_t uint_fast32_t;
|
||||
typedef uint64_t uint_fast64_t;
|
||||
|
||||
// 7.18.1.4 Integer types capable of holding object pointers
|
||||
#ifdef _WIN64 // [
|
||||
typedef signed __int64 intptr_t;
|
||||
typedef unsigned __int64 uintptr_t;
|
||||
#else // _WIN64 ][
|
||||
typedef _W64 signed int intptr_t;
|
||||
typedef _W64 unsigned int uintptr_t;
|
||||
#endif // _WIN64 ]
|
||||
|
||||
// 7.18.1.5 Greatest-width integer types
|
||||
typedef int64_t intmax_t;
|
||||
typedef uint64_t uintmax_t;
|
||||
|
||||
|
||||
// 7.18.2 Limits of specified-width integer types
|
||||
|
||||
#if !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS) // [ See footnote 220 at page 257 and footnote 221 at page 259
|
||||
|
||||
// 7.18.2.1 Limits of exact-width integer types
|
||||
#define INT8_MIN ((int8_t)_I8_MIN)
|
||||
#define INT8_MAX _I8_MAX
|
||||
#define INT16_MIN ((int16_t)_I16_MIN)
|
||||
#define INT16_MAX _I16_MAX
|
||||
#define INT32_MIN ((int32_t)_I32_MIN)
|
||||
#define INT32_MAX _I32_MAX
|
||||
#define INT64_MIN ((int64_t)_I64_MIN)
|
||||
#define INT64_MAX _I64_MAX
|
||||
#define UINT8_MAX _UI8_MAX
|
||||
#define UINT16_MAX _UI16_MAX
|
||||
#define UINT32_MAX _UI32_MAX
|
||||
#define UINT64_MAX _UI64_MAX
|
||||
|
||||
// 7.18.2.2 Limits of minimum-width integer types
|
||||
#define INT_LEAST8_MIN INT8_MIN
|
||||
#define INT_LEAST8_MAX INT8_MAX
|
||||
#define INT_LEAST16_MIN INT16_MIN
|
||||
#define INT_LEAST16_MAX INT16_MAX
|
||||
#define INT_LEAST32_MIN INT32_MIN
|
||||
#define INT_LEAST32_MAX INT32_MAX
|
||||
#define INT_LEAST64_MIN INT64_MIN
|
||||
#define INT_LEAST64_MAX INT64_MAX
|
||||
#define UINT_LEAST8_MAX UINT8_MAX
|
||||
#define UINT_LEAST16_MAX UINT16_MAX
|
||||
#define UINT_LEAST32_MAX UINT32_MAX
|
||||
#define UINT_LEAST64_MAX UINT64_MAX
|
||||
|
||||
// 7.18.2.3 Limits of fastest minimum-width integer types
|
||||
#define INT_FAST8_MIN INT8_MIN
|
||||
#define INT_FAST8_MAX INT8_MAX
|
||||
#define INT_FAST16_MIN INT16_MIN
|
||||
#define INT_FAST16_MAX INT16_MAX
|
||||
#define INT_FAST32_MIN INT32_MIN
|
||||
#define INT_FAST32_MAX INT32_MAX
|
||||
#define INT_FAST64_MIN INT64_MIN
|
||||
#define INT_FAST64_MAX INT64_MAX
|
||||
#define UINT_FAST8_MAX UINT8_MAX
|
||||
#define UINT_FAST16_MAX UINT16_MAX
|
||||
#define UINT_FAST32_MAX UINT32_MAX
|
||||
#define UINT_FAST64_MAX UINT64_MAX
|
||||
|
||||
// 7.18.2.4 Limits of integer types capable of holding object pointers
|
||||
#ifdef _WIN64 // [
|
||||
# define INTPTR_MIN INT64_MIN
|
||||
# define INTPTR_MAX INT64_MAX
|
||||
# define UINTPTR_MAX UINT64_MAX
|
||||
#else // _WIN64 ][
|
||||
# define INTPTR_MIN INT32_MIN
|
||||
# define INTPTR_MAX INT32_MAX
|
||||
# define UINTPTR_MAX UINT32_MAX
|
||||
#endif // _WIN64 ]
|
||||
|
||||
// 7.18.2.5 Limits of greatest-width integer types
|
||||
#define INTMAX_MIN INT64_MIN
|
||||
#define INTMAX_MAX INT64_MAX
|
||||
#define UINTMAX_MAX UINT64_MAX
|
||||
|
||||
// 7.18.3 Limits of other integer types
|
||||
|
||||
#ifdef _WIN64 // [
|
||||
# define PTRDIFF_MIN _I64_MIN
|
||||
# define PTRDIFF_MAX _I64_MAX
|
||||
#else // _WIN64 ][
|
||||
# define PTRDIFF_MIN _I32_MIN
|
||||
# define PTRDIFF_MAX _I32_MAX
|
||||
#endif // _WIN64 ]
|
||||
|
||||
#define SIG_ATOMIC_MIN INT_MIN
|
||||
#define SIG_ATOMIC_MAX INT_MAX
|
||||
|
||||
#ifndef SIZE_MAX // [
|
||||
# ifdef _WIN64 // [
|
||||
# define SIZE_MAX _UI64_MAX
|
||||
# else // _WIN64 ][
|
||||
# define SIZE_MAX _UI32_MAX
|
||||
# endif // _WIN64 ]
|
||||
#endif // SIZE_MAX ]
|
||||
|
||||
// WCHAR_MIN and WCHAR_MAX are also defined in <wchar.h>
|
||||
#ifndef WCHAR_MIN // [
|
||||
# define WCHAR_MIN 0
|
||||
#endif // WCHAR_MIN ]
|
||||
#ifndef WCHAR_MAX // [
|
||||
# define WCHAR_MAX _UI16_MAX
|
||||
#endif // WCHAR_MAX ]
|
||||
|
||||
#define WINT_MIN 0
|
||||
#define WINT_MAX _UI16_MAX
|
||||
|
||||
#endif // __STDC_LIMIT_MACROS ]
|
||||
|
||||
|
||||
// 7.18.4 Limits of other integer types
|
||||
|
||||
#if !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS) // [ See footnote 224 at page 260
|
||||
|
||||
// 7.18.4.1 Macros for minimum-width integer constants
|
||||
|
||||
#define INT8_C(val) val##i8
|
||||
#define INT16_C(val) val##i16
|
||||
#define INT32_C(val) val##i32
|
||||
#define INT64_C(val) val##i64
|
||||
|
||||
#define UINT8_C(val) val##ui8
|
||||
#define UINT16_C(val) val##ui16
|
||||
#define UINT32_C(val) val##ui32
|
||||
#define UINT64_C(val) val##ui64
|
||||
|
||||
// 7.18.4.2 Macros for greatest-width integer constants
|
||||
#define INTMAX_C INT64_C
|
||||
#define UINTMAX_C UINT64_C
|
||||
|
||||
#endif // __STDC_CONSTANT_MACROS ]
|
||||
|
||||
|
||||
#endif // _MSC_STDINT_H_ ]
|
||||
Loading…
Add table
Add a link
Reference in a new issue