1
0
Fork 0
forked from fte/fteqw

Android: fat presses, vibrator, onscreen keyboard, keep-screen-on, console scaling, touch-based console scrolling, additional bindables.

Some memory leaks fixed.
latency with the nq protocol over loopback is much reduced.
Terrain: now mostly a property of a (q1 for now) bsp map, file format changed, glsl now built in, terrain editor builtin improved/changed, holes supported.

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4067 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2012-07-14 16:25:18 +00:00
parent e2a5138e77
commit 8ae45223dc
60 changed files with 2031 additions and 570 deletions

View file

@ -324,7 +324,7 @@ ifeq ($(FTE_TARGET),vc)
else
WARNINGFLAGS=-Wall -Wno-pointer-sign
GNUC_FUNCS= -Dstrnicmp=strncasecmp -Dstricmp=strcasecmp -D_vsnprintf=vsnprintf -D_snprintf=snprintf
GNUC_FUNCS= -Dstrnicmp=strncasecmp -Dstricmp=strcasecmp
endif
BASE_CFLAGS=$(WARNINGFLAGS) $(GNUC_FUNCS) -I$(CLIENT_DIR) -I$(SERVER_DIR) -I$(COMMON_DIR) -I$(GL_DIR) -I$(D3D_DIR) -I$(PROGS_DIR) -I$(BOTLIB_DIR) -I$(LIBS_DIR) -I$(LIBS_DIR)/dxsdk9/include -I$(LIBS_DIR)/sdl/include -I/usr/include/SDL -I$(LIBS_DIR)/sdl/include/SDL -I./libs/freetype2/include -I./libs/freetype2/include/freetype -I./libs/speex -DBOTLIB $(SVNREVISION)
@ -335,10 +335,11 @@ DEBUG_CFLAGS=-ggdb -g
RELEASE_CFLAGS?=-O3 -ffast-math $(CPUOPTIMIZATIONS)
#incase our compiler doesn't support it (mingw)
ifeq ($(shell $(CC) -rdynamic 2>&1 | grep unrecognised),)
ifeq ($(shell LANG=c $(CC) -rdynamic 2>&1 | grep unrecognized),)
DEBUG_CFLAGS+= -rdynamic
endif
OBJS+=$(SPEEX_OBJS)
PROFILE_CFLAGS=-pg
DX7SDK=-I./libs/dxsdk7/include/
@ -347,6 +348,49 @@ GLCFLAGS=-DGLQUAKE
D3DCFLAGS=-DD3DQUAKE
NPFTECFLAGS=-DNPFTE
SPEEX_OBJS = \
bits.o \
buffer.o \
cb_search.o \
exc_10_16_table.o \
exc_10_32_table.o \
exc_20_32_table.o \
exc_5_256_table.o \
exc_5_64_table.o \
exc_8_128_table.o \
fftwrap.o \
filterbank.o \
filters.o \
gain_table.o \
gain_table_lbr.o \
hexc_10_32_table.o \
hexc_table.o \
high_lsp_tables.o \
jitter.o \
kiss_fft.o \
kiss_fftr.o \
lpc.o \
lsp.o \
lsp_tables_nb.o \
ltp.o \
mdf.o \
modes.o \
modes_wb.o \
nb_celp.o \
preprocess.o \
quant_lsp.o \
resample.o \
sb_celp.o \
scal.o \
smallft.o \
speex.o \
speex_callbacks.o \
speex_header.o \
stereo.o \
vbr.o \
vq.o \
window.o
CLIENT_OBJS = \
textedit.o \
fragstats.o \
@ -731,6 +775,8 @@ ifeq ($(shell echo $(FTE_TARGET)|grep -E -v "win(32|64)$$"),)
BITS=64
endif
BASELDFLAGS=
SV_CFLAGS=$(SERVER_ONLY_CFLAGS) $(W32_CFLAGS)
LIBS_DIR = $(BASE_DIR)/libs
@ -985,6 +1031,13 @@ endif
VPATH = $(BASE_DIR) : $(CLIENT_DIR) : $(GL_DIR) : $(COMMON_DIR) : $(SERVER_DIR) : $(HTTP_DIR) : $(BASE_DIR)/irc : $(BASE_DIR)/email : $(QUX_DIR) : $(PROGS_DIR) : $(NACL_DIR) : $(SNDCODEC_DIR) : $(D3D_DIR) : $(BOTLIB_DIR)
ifneq ($(findstring -DSPEEX_STATIC, $(CFLAGS)),)
#add these to statically link libspeex
VPATH += : $(BASE_DIR)/libs/speex-1.2rc1/libspeex
BASE_CFLAGS += -DSPEEX_STATIC -I$(BASE_DIR)/libs/speex-1.2rc1/include -DFIXED_POINT -DUSE_KISS_FFT -DEXPORT=""
CLIENT_OBJS += $(SPEEX_OBJS)
endif
# This is for linking the FTE icon to the MinGW target
$(OUT_DIR)/resources.o : winquake.rc
$(WINDRES) -I$(CLIENT_DIR) -O coff $< $@
@ -1054,75 +1107,75 @@ $(OUT_DIR)/$(EXE_NAME): $(PRECOMPHEADERS) $(foreach fn, $(CUSTOMOBJS) $(foreac
$(DO_LD) $(foreach fn, $(CUSTOMOBJS) $(foreach ol, $(OBJS) $(LTO_END), $($(ol))),$(if $(findstring ltox,$(fn)),$(subst ltox,-x ,$(fn)),$(OUT_DIR)/$(fn)) ) $(LDFLAGS)
_out-rel:
$(MAKE) $(OUT_DIR)/$(EXE_NAME) EXE_NAME="$(EXE_NAME)" OUT_DIR="$(OUT_DIR)" WCFLAGS="$(WCFLAGS) $(RELEASE_CFLAGS)" LDFLAGS="$(BASELDFLAGS) $(LDFLAGS) $(RELEASE_LDFLAGS)" OBJS="$(OBJS)"
@$(MAKE) $(OUT_DIR)/$(EXE_NAME) EXE_NAME="$(EXE_NAME)" OUT_DIR="$(OUT_DIR)" WCFLAGS="$(WCFLAGS) $(RELEASE_CFLAGS)" LDFLAGS="$(BASELDFLAGS) $(LDFLAGS) $(RELEASE_LDFLAGS)" OBJS="$(OBJS)"
$(STRIP) $(STRIPFLAGS) $(OUT_DIR)/$(EXE_NAME)
_out-dbg:
$(MAKE) $(OUT_DIR)/$(EXE_NAME) EXE_NAME="$(EXE_NAME)" OUT_DIR="$(OUT_DIR)" WCFLAGS="$(WCFLAGS) $(DEBUG_CFLAGS)" LDFLAGS="$(BASELDFLAGS) $(LDFLAGS) $(DEBUG_LDFLAGS)" OBJS="$(OBJS)"
@$(MAKE) $(OUT_DIR)/$(EXE_NAME) EXE_NAME="$(EXE_NAME)" OUT_DIR="$(OUT_DIR)" WCFLAGS="$(WCFLAGS) $(DEBUG_CFLAGS)" LDFLAGS="$(BASELDFLAGS) $(LDFLAGS) $(DEBUG_LDFLAGS)" OBJS="$(OBJS)"
_out-profile:
$(MAKE) $(OUT_DIR)/$(EXE_NAME) EXE_NAME="$(EXE_NAME)" OUT_DIR="$(OUT_DIR)" WCFLAGS="$(WCFLAGS) $(PROFILE_CFLAGS)" LDFLAGS="$(BASELDFLAGS) $(LDFLAGS) $(PROFILE_LDFLAGS)" OBJS="$(OBJS)"
@$(MAKE) $(OUT_DIR)/$(EXE_NAME) EXE_NAME="$(EXE_NAME)" OUT_DIR="$(OUT_DIR)" WCFLAGS="$(WCFLAGS) $(PROFILE_CFLAGS)" LDFLAGS="$(BASELDFLAGS) $(LDFLAGS) $(PROFILE_LDFLAGS)" OBJS="$(OBJS)"
_cl-rel: reldir
$(MAKE) _out-rel EXE_NAME="$(EXE_NAME)" OUT_DIR="$(OUT_DIR)" WCFLAGS="$(CLIENT_ONLY_CFLAGS) $(WCFLAGS)" LDFLAGS="$(LDFLAGS)" SOBJS="$(SOBJS)" OBJS="SOBJS COMMON_OBJS CLIENT_OBJS PROGS_OBJS"
@$(MAKE) _out-rel EXE_NAME="$(EXE_NAME)" OUT_DIR="$(OUT_DIR)" WCFLAGS="$(CLIENT_ONLY_CFLAGS) $(WCFLAGS)" LDFLAGS="$(LDFLAGS)" SOBJS="$(SOBJS)" OBJS="SOBJS COMMON_OBJS CLIENT_OBJS PROGS_OBJS"
_cl-dbg: debugdir
$(MAKE) _out-dbg EXE_NAME="$(EXE_NAME)" OUT_DIR="$(OUT_DIR)" WCFLAGS="$(CLIENT_ONLY_CFLAGS) $(WCFLAGS)" LDFLAGS="$(LDFLAGS)" SOBJS="$(SOBJS)" OBJS="SOBJS COMMON_OBJS CLIENT_OBJS PROGS_OBJS"
@$(MAKE) _out-dbg EXE_NAME="$(EXE_NAME)" OUT_DIR="$(OUT_DIR)" WCFLAGS="$(CLIENT_ONLY_CFLAGS) $(WCFLAGS)" LDFLAGS="$(LDFLAGS)" SOBJS="$(SOBJS)" OBJS="SOBJS COMMON_OBJS CLIENT_OBJS PROGS_OBJS"
_cl-profile: reldir
$(MAKE) _out-profile EXE_NAME="$(EXE_NAME)" OUT_DIR="$(OUT_DIR)" WCFLAGS="$(CLIENT_ONLY_CFLAGS) $(WCFLAGS)" LDFLAGS="$(LDFLAGS)" SOBJS="$(SOBJS)" OBJS="SOBJS COMMON_OBJS CLIENT_OBJS PROGS_OBJS"
@$(MAKE) _out-profile EXE_NAME="$(EXE_NAME)" OUT_DIR="$(OUT_DIR)" WCFLAGS="$(CLIENT_ONLY_CFLAGS) $(WCFLAGS)" LDFLAGS="$(LDFLAGS)" SOBJS="$(SOBJS)" OBJS="SOBJS COMMON_OBJS CLIENT_OBJS PROGS_OBJS"
_clsv-rel: reldir
$(MAKE) _out-rel EXE_NAME="$(EXE_NAME)" OUT_DIR="$(OUT_DIR)" WCFLAGS="$(JOINT_CFLAGS) $(WCFLAGS)" LDFLAGS="$(LDFLAGS)" SOBJS="$(SOBJS)" OBJS="SOBJS COMMON_OBJS CLIENT_OBJS PROGS_OBJS SERVER_OBJS"
@$(MAKE) _out-rel EXE_NAME="$(EXE_NAME)" OUT_DIR="$(OUT_DIR)" WCFLAGS="$(JOINT_CFLAGS) $(WCFLAGS)" LDFLAGS="$(LDFLAGS)" SOBJS="$(SOBJS)" OBJS="SOBJS COMMON_OBJS CLIENT_OBJS PROGS_OBJS SERVER_OBJS"
_clsv-dbg: debugdir
$(MAKE) _out-dbg EXE_NAME="$(EXE_NAME)" OUT_DIR="$(OUT_DIR)" WCFLAGS="$(JOINT_CFLAGS) $(WCFLAGS)" LDFLAGS="$(LDFLAGS)" SOBJS="$(SOBJS)" OBJS="SOBJS COMMON_OBJS CLIENT_OBJS PROGS_OBJS SERVER_OBJS"
@$(MAKE) _out-dbg EXE_NAME="$(EXE_NAME)" OUT_DIR="$(OUT_DIR)" WCFLAGS="$(JOINT_CFLAGS) $(WCFLAGS)" LDFLAGS="$(LDFLAGS)" SOBJS="$(SOBJS)" OBJS="SOBJS COMMON_OBJS CLIENT_OBJS PROGS_OBJS SERVER_OBJS"
_clsv-profile: reldir
$(MAKE) _out-profile EXE_NAME="$(EXE_NAME)" OUT_DIR="$(OUT_DIR)" WCFLAGS="$(JOINT_CFLAGS) $(WCFLAGS)" LDFLAGS="$(LDFLAGS)" SOBJS="$(SOBJS)" OBJS="SOBJS COMMON_OBJS CLIENT_OBJS PROGS_OBJS SERVER_OBJS"
@$(MAKE) _out-profile EXE_NAME="$(EXE_NAME)" OUT_DIR="$(OUT_DIR)" WCFLAGS="$(JOINT_CFLAGS) $(WCFLAGS)" LDFLAGS="$(LDFLAGS)" SOBJS="$(SOBJS)" OBJS="SOBJS COMMON_OBJS CLIENT_OBJS PROGS_OBJS SERVER_OBJS"
sv-tmp: reldir debugdir
$(MAKE) $(TYPE) OUT_DIR="$(OUT_DIR)" EXE_NAME="$(SV_EXE_NAME)" WCFLAGS="$(SV_CFLAGS)" LDFLAGS="$(SV_LDFLAGS) $(LDFLAGS)" OBJS="SV_OBJS"
@$(MAKE) $(TYPE) OUT_DIR="$(OUT_DIR)" EXE_NAME="$(SV_EXE_NAME)" WCFLAGS="$(SV_CFLAGS)" LDFLAGS="$(SV_LDFLAGS) $(LDFLAGS)" OBJS="SV_OBJS"
sv-rel:
$(MAKE) sv-tmp TYPE=_out-rel OUT_DIR="$(RELEASE_DIR)/$(SV_DIR)"
@$(MAKE) sv-tmp TYPE=_out-rel OUT_DIR="$(RELEASE_DIR)/$(SV_DIR)"
sv-dbg:
$(MAKE) sv-tmp TYPE=_out-dbg OUT_DIR="$(DEBUG_DIR)/$(SV_DIR)"
@$(MAKE) sv-tmp TYPE=_out-dbg OUT_DIR="$(DEBUG_DIR)/$(SV_DIR)"
sv-profile:
$(MAKE) sv-tmp TYPE=_out-profile OUT_DIR="$(PROFILE_DIR)/$(SV_DIR)"
@$(MAKE) sv-tmp TYPE=_out-profile OUT_DIR="$(PROFILE_DIR)/$(SV_DIR)"
d3dcl-tmp:
$(MAKE) $(TYPE) OUT_DIR="$(OUT_DIR)" EXE_NAME="$(D3DCL_EXE_NAME)" WCFLAGS="$(D3D_CFLAGS)" LDFLAGS="$(D3D_LDFLAGS) $(LDFLAGS)" SOBJS="$(D3DCL_OBJS)"
@$(MAKE) $(TYPE) OUT_DIR="$(OUT_DIR)" EXE_NAME="$(D3DCL_EXE_NAME)" WCFLAGS="$(D3D_CFLAGS)" LDFLAGS="$(D3D_LDFLAGS) $(LDFLAGS)" SOBJS="$(D3DCL_OBJS)"
d3d-tmp:
$(MAKE) $(TYPE) OUT_DIR="$(OUT_DIR)" EXE_NAME="$(D3D_EXE_NAME)" WCFLAGS="$(D3D_CFLAGS)" LDFLAGS="$(D3D_LDFLAGS) $(LDFLAGS)" SOBJS="$(D3DCL_OBJS)"
@$(MAKE) $(TYPE) OUT_DIR="$(OUT_DIR)" EXE_NAME="$(D3D_EXE_NAME)" WCFLAGS="$(D3D_CFLAGS)" LDFLAGS="$(D3D_LDFLAGS) $(LDFLAGS)" SOBJS="$(D3DCL_OBJS)"
d3dcl-rel:
$(MAKE) d3dcl-tmp TYPE=_cl-rel OUT_DIR="$(RELEASE_DIR)/$(D3DCL_DIR)"
@$(MAKE) d3dcl-tmp TYPE=_cl-rel OUT_DIR="$(RELEASE_DIR)/$(D3DCL_DIR)"
d3dcl-dbg:
$(MAKE) d3dcl-tmp TYPE=_cl-dbg OUT_DIR="$(DEBUG_DIR)/$(D3DCL_DIR)"
@$(MAKE) d3dcl-tmp TYPE=_cl-dbg OUT_DIR="$(DEBUG_DIR)/$(D3DCL_DIR)"
d3dcl-profile:
$(MAKE) d3dcl-tmp TYPE=_cl-profile OUT_DIR="$(PROFILE_DIR)/$(D3DCL_DIR)"
@$(MAKE) d3dcl-tmp TYPE=_cl-profile OUT_DIR="$(PROFILE_DIR)/$(D3DCL_DIR)"
d3d-rel:
$(MAKE) d3d-tmp TYPE=_clsv-rel OUT_DIR="$(RELEASE_DIR)/$(D3DB_DIR)"
@$(MAKE) d3d-tmp TYPE=_clsv-rel OUT_DIR="$(RELEASE_DIR)/$(D3DB_DIR)"
d3d-dbg:
$(MAKE) d3d-tmp TYPE=_clsv-dbg OUT_DIR="$(DEBUG_DIR)/$(D3DB_DIR)"
@$(MAKE) d3d-tmp TYPE=_clsv-dbg OUT_DIR="$(DEBUG_DIR)/$(D3DB_DIR)"
d3d-profile:
$(MAKE) d3d-tmp TYPE=_clsv-profile OUT_DIR="$(PROFILE_DIR)/$(D3DB_DIR)"
@$(MAKE) d3d-tmp TYPE=_clsv-profile OUT_DIR="$(PROFILE_DIR)/$(D3DB_DIR)"
npqtvcl-tmp:
$(MAKE) $(TYPE) OUT_DIR="$(OUT_DIR)" EXE_NAME="$(NPFTECL_DLL_NAME)" WCFLAGS="$(NPFTE_CFLAGS)" LDFLAGS="$(NPFTE_LDFLAGS) $(LDFLAGS)" SOBJS="$(NPFTECL_OBJS)"
@$(MAKE) $(TYPE) OUT_DIR="$(OUT_DIR)" EXE_NAME="$(NPFTECL_DLL_NAME)" WCFLAGS="$(NPFTE_CFLAGS)" LDFLAGS="$(NPFTE_LDFLAGS) $(LDFLAGS)" SOBJS="$(NPFTECL_OBJS)"
npfte-tmp:
$(MAKE) $(TYPE) OUT_DIR="$(OUT_DIR)" EXE_NAME="$(NPFTE_DLL_NAME)" WCFLAGS="$(NPFTE_CFLAGS)" LDFLAGS="$(NPFTE_LDFLAGS) $(LDFLAGS)" SOBJS="$(NPFTECL_OBJS)"
@$(MAKE) $(TYPE) OUT_DIR="$(OUT_DIR)" EXE_NAME="$(NPFTE_DLL_NAME)" WCFLAGS="$(NPFTE_CFLAGS)" LDFLAGS="$(NPFTE_LDFLAGS) $(LDFLAGS)" SOBJS="$(NPFTECL_OBJS)"
npqtvcl-rel:
$(MAKE) npqtvcl-tmp TYPE=_cl-rel OUT_DIR="$(RELEASE_DIR)/$(NPFTECL_DIR)"
@$(MAKE) npqtvcl-tmp TYPE=_cl-rel OUT_DIR="$(RELEASE_DIR)/$(NPFTECL_DIR)"
npqtvcl-dbg:
$(MAKE) npqtvcl-tmp TYPE=_cl-dbg OUT_DIR="$(DEBUG_DIR)/$(NPFTECL_DIR)"
@$(MAKE) npqtvcl-tmp TYPE=_cl-dbg OUT_DIR="$(DEBUG_DIR)/$(NPFTECL_DIR)"
npqtvcl-profile:
$(MAKE) npqtvcl-tmp TYPE=_cl-profile OUT_DIR="$(PROFILE_DIR)/$(NPFTECL_DIR)"
@$(MAKE) npqtvcl-tmp TYPE=_cl-profile OUT_DIR="$(PROFILE_DIR)/$(NPFTECL_DIR)"
npfte-rel:
$(MAKE) npfte-tmp TYPE=_cl-rel OUT_DIR="$(RELEASE_DIR)/$(NPFTEB_DIR)"
@$(MAKE) npfte-tmp TYPE=_cl-rel OUT_DIR="$(RELEASE_DIR)/$(NPFTEB_DIR)"
cp $(RELEASE_DIR)/npfte.dll npfte/plugins
cd npfte && zip $(abspath $(RELEASE_DIR)/npfte.xpi) install.rdf plugins/npfte.dll
rm -rf /tmp/npfte
@ -1132,54 +1185,54 @@ npfte-rel:
cd $(RELEASE_DIR)/ && ../npfte/crxmake.sh /tmp/npfte ../npfte/chrome.pem
rm -rf /tmp/npfte
npfte-dbg:
$(MAKE) npfte-tmp TYPE=_clsv-dbg OUT_DIR="$(DEBUG_DIR)/$(NPFTEB_DIR)"
@$(MAKE) npfte-tmp TYPE=_clsv-dbg OUT_DIR="$(DEBUG_DIR)/$(NPFTEB_DIR)"
npfte-profile:
$(MAKE) npfte-tmp TYPE=_cl-profile OUT_DIR="$(PROFILE_DIR)/$(NPFTEB_DIR)"
@$(MAKE) npfte-tmp TYPE=_cl-profile OUT_DIR="$(PROFILE_DIR)/$(NPFTEB_DIR)"
glcl-tmp:
$(MAKE) $(TYPE) OUT_DIR="$(OUT_DIR)" EXE_NAME="$(GLCL_EXE_NAME)" WCFLAGS="$(GL_CFLAGS)" LDFLAGS="$(GL_LDFLAGS) $(LDFLAGS)" SOBJS="$(GLCL_OBJS)"
@$(MAKE) $(TYPE) OUT_DIR="$(OUT_DIR)" EXE_NAME="$(GLCL_EXE_NAME)" WCFLAGS="$(GL_CFLAGS)" LDFLAGS="$(GL_LDFLAGS) $(LDFLAGS)" SOBJS="$(GLCL_OBJS)"
gl-tmp:
$(MAKE) $(TYPE) OUT_DIR="$(OUT_DIR)" EXE_NAME="$(GL_EXE_NAME)" WCFLAGS="$(GL_CFLAGS)" LDFLAGS="$(GL_LDFLAGS) $(LDFLAGS)" SOBJS="$(GLCL_OBJS)"
@$(MAKE) $(TYPE) OUT_DIR="$(OUT_DIR)" EXE_NAME="$(GL_EXE_NAME)" WCFLAGS="$(GL_CFLAGS)" LDFLAGS="$(GL_LDFLAGS) $(LDFLAGS)" SOBJS="$(GLCL_OBJS)"
glcl-rel:
$(MAKE) glcl-tmp TYPE=_cl-rel OUT_DIR="$(RELEASE_DIR)/$(GLCL_DIR)"
@$(MAKE) glcl-tmp TYPE=_cl-rel OUT_DIR="$(RELEASE_DIR)/$(GLCL_DIR)"
glcl-dbg:
$(MAKE) glcl-tmp TYPE=_cl-dbg OUT_DIR="$(DEBUG_DIR)/$(GLCL_DIR)"
@$(MAKE) glcl-tmp TYPE=_cl-dbg OUT_DIR="$(DEBUG_DIR)/$(GLCL_DIR)"
glcl-profile:
$(MAKE) glcl-tmp TYPE=_cl-profile OUT_DIR="$(PROFILE_DIR)/$(GLCL_DIR)"
@$(MAKE) glcl-tmp TYPE=_cl-profile OUT_DIR="$(PROFILE_DIR)/$(GLCL_DIR)"
gl-rel:
$(MAKE) gl-tmp TYPE=_clsv-rel OUT_DIR="$(RELEASE_DIR)/$(GLB_DIR)"
@$(MAKE) gl-tmp TYPE=_clsv-rel OUT_DIR="$(RELEASE_DIR)/$(GLB_DIR)"
gl-dbg:
$(MAKE) gl-tmp TYPE=_clsv-dbg OUT_DIR="$(DEBUG_DIR)/$(GLB_DIR)"
@$(MAKE) gl-tmp TYPE=_clsv-dbg OUT_DIR="$(DEBUG_DIR)/$(GLB_DIR)"
gl-profile:
$(MAKE) gl-tmp TYPE=_clsv-profile OUT_DIR="$(PROFILE_DIR)/$(GLB_DIR)"
@$(MAKE) gl-tmp TYPE=_clsv-profile OUT_DIR="$(PROFILE_DIR)/$(GLB_DIR)"
mingl-tmp: reldir
$(MAKE) $(TYPE) OUT_DIR="$(OUT_DIR)" EXE_NAME="$(MINGL_EXE_NAME)" WCFLAGS="$(GL_CFLAGS) -DMINIMAL" LDFLAGS="$(GL_LDFLAGS) $(LDFLAGS)" SOBJS="$(GLCL_OBJS)"
@$(MAKE) $(TYPE) OUT_DIR="$(OUT_DIR)" EXE_NAME="$(MINGL_EXE_NAME)" WCFLAGS="$(GL_CFLAGS) -DMINIMAL" LDFLAGS="$(GL_LDFLAGS) $(LDFLAGS)" SOBJS="$(GLCL_OBJS)"
mingl-rel:
$(MAKE) mingl-tmp TYPE=_cl-rel OUT_DIR="$(RELEASE_DIR)/$(MINGL_DIR)"
@$(MAKE) mingl-tmp TYPE=_cl-rel OUT_DIR="$(RELEASE_DIR)/$(MINGL_DIR)"
mingl-dbg:
$(MAKE) mingl-tmp TYPE=_cl-dbg OUT_DIR="$(DEBUG_DIR)/$(MINGL_DIR)"
@$(MAKE) mingl-tmp TYPE=_cl-dbg OUT_DIR="$(DEBUG_DIR)/$(MINGL_DIR)"
mingl-profile:
$(MAKE) mingl-tmp TYPE=_cl-profile OUT_DIR="$(PROFILE_DIR)/$(MINGL_DIR)"
@$(MAKE) mingl-tmp TYPE=_cl-profile OUT_DIR="$(PROFILE_DIR)/$(MINGL_DIR)"
mcl-tmp:
$(MAKE) $(TYPE) OUT_DIR="$(OUT_DIR)" EXE_NAME="$(MCL_EXE_NAME)" WCFLAGS="$(M_CFLAGS)" LDFLAGS="$(M_LDFLAGS) $(LDFLAGS)" SOBJS="$(MCL_OBJS)"
@$(MAKE) $(TYPE) OUT_DIR="$(OUT_DIR)" EXE_NAME="$(MCL_EXE_NAME)" WCFLAGS="$(M_CFLAGS)" LDFLAGS="$(M_LDFLAGS) $(LDFLAGS)" SOBJS="$(MCL_OBJS)"
m-tmp:
$(MAKE) $(TYPE) OUT_DIR="$(OUT_DIR)" EXE_NAME="$(M_EXE_NAME)" WCFLAGS="$(M_CFLAGS)" LDFLAGS="$(M_LDFLAGS) $(LDFLAGS)" SOBJS="$(MCL_OBJS)"
@$(MAKE) $(TYPE) OUT_DIR="$(OUT_DIR)" EXE_NAME="$(M_EXE_NAME)" WCFLAGS="$(M_CFLAGS)" LDFLAGS="$(M_LDFLAGS) $(LDFLAGS)" SOBJS="$(MCL_OBJS)"
mcl-rel:
$(MAKE) mcl-tmp TYPE=_cl-rel OUT_DIR="$(RELEASE_DIR)/$(MCL_DIR)"
@$(MAKE) mcl-tmp TYPE=_cl-rel OUT_DIR="$(RELEASE_DIR)/$(MCL_DIR)"
mcl-dbg:
$(MAKE) mcl-tmp TYPE=_cl-dbg OUT_DIR="$(DEBUG_DIR)/$(MCL_DIR)"
@$(MAKE) mcl-tmp TYPE=_cl-dbg OUT_DIR="$(DEBUG_DIR)/$(MCL_DIR)"
mcl-profile:
$(MAKE) mcl-tmp TYPE=_cl-profile OUT_DIR="$(PROFILE_DIR)/$(MCL_DIR)"
@$(MAKE) mcl-tmp TYPE=_cl-profile OUT_DIR="$(PROFILE_DIR)/$(MCL_DIR)"
m-rel:
$(MAKE) m-tmp TYPE=_clsv-rel OUT_DIR="$(RELEASE_DIR)/$(MB_DIR)"
@$(MAKE) m-tmp TYPE=_clsv-rel OUT_DIR="$(RELEASE_DIR)/$(MB_DIR)"
m-dbg:
$(MAKE) m-tmp TYPE=_clsv-dbg OUT_DIR="$(DEBUG_DIR)/$(MB_DIR)"
@$(MAKE) m-tmp TYPE=_clsv-dbg OUT_DIR="$(DEBUG_DIR)/$(MB_DIR)"
m-profile:
$(MAKE) m-tmp TYPE=_clsv-profile OUT_DIR="$(PROFILE_DIR)/$(MB_DIR)"
@$(MAKE) m-tmp TYPE=_clsv-profile OUT_DIR="$(PROFILE_DIR)/$(MB_DIR)"
.PHONY: m-tmp mcl-tmp mingl-tmp glcl-tmp gl-tmp sv-tmp _clsv-dbg _clsv-rel _cl-dbg _cl-rel _out-rel _out-dbg
@ -1313,9 +1366,9 @@ droid-opt: droid/build.xml droid/ftekeystore
#build FTE as a library, then build the java+package (release). also installs it onto the 'current' device.
droid-dbg: droid/build.xml
$(MAKE) FTE_TARGET=droid gl-dbg
@mkdir -p droid/libs/armeabi
@cp $(DEBUG_DIR)/libftedroid.so droid/libs/armeabi/
$(foreach a, $(DROID_ARCH), $(MAKE) FTE_TARGET=droid gl-dbg DROID_ARCH=$a; )
@$(foreach a, $(DROID_ARCH), mkdir -p droid/libs/$a; )
-@$(foreach a, $(DROID_ARCH), cp $(DEBUG_DIR)/gl_droid-$a/libftedroid.so droid/libs/$a/libftedroid.so; )
@cd droid && $(ANT) debug && $(ANT) debug install
cp droid/bin/FTEDroid-debug.apk $(DEBUG_DIR)/FTEDroid.apk

View file

@ -820,7 +820,7 @@ void CLFTE_ParseEntities(void)
break;
/*update the prediction info if needed*/
if (e->u.q1.pmovetype)
// if (e->u.q1.pmovetype)
{
frame_t *fram;
fram = &cl.frames[cls.netchan.incoming_sequence & UPDATE_MASK];

View file

@ -3273,6 +3273,7 @@ void CL_Init (void)
Cmd_AddCommand ("god", NULL); //cheats
Cmd_AddCommand ("give", NULL);
Cmd_AddCommand ("noclip", NULL);
Cmd_AddCommand ("notarget", NULL);
Cmd_AddCommand ("fly", NULL);
Cmd_AddCommand ("setpos", NULL);
@ -3465,15 +3466,6 @@ double Host_Frame (double time)
// if (cls.demoplayback && cl_demospeed.value>0)
// realframetime *= cl_demospeed.value; // this probably screws up other timings
#ifndef CLIENTONLY
if (sv.state)
{
RSpeedRemark();
SV_Frame();
RSpeedEnd(RSPEED_SERVER);
}
#endif
if (cl.gamespeed<0.1)
cl.gamespeed = 1;
time *= cl.gamespeed;
@ -3510,8 +3502,18 @@ double Host_Frame (double time)
if (idlesec > 0.1)
idlesec = 0.1; // limit to at least 10 fps
if ((realtime - oldrealtime) < idlesec)
{
#ifndef CLIENTONLY
if (sv.state)
{
RSpeedRemark();
SV_Frame();
RSpeedEnd(RSPEED_SERVER);
}
#endif
return idlesec - (realtime - oldrealtime);
}
}
/*
if (cl_maxfps.value)
@ -3598,7 +3600,6 @@ double Host_Frame (double time)
// fetch results from server
CL_ReadPackets ();
CL_CalcClientTime();
// send intentions now
// resend a connection request if necessary
@ -3620,6 +3621,19 @@ double Host_Frame (double time)
RSpeedEnd(RSPEED_PROTOCOL);
#ifndef CLIENTONLY
if (sv.state)
{
float ohft = host_frametime;
RSpeedRemark();
SV_Frame();
RSpeedEnd(RSPEED_SERVER);
host_frametime = ohft;
CL_ReadPackets ();
}
#endif
CL_CalcClientTime();
// update video
if (host_speeds.ival)
time1 = Sys_DoubleTime ();

View file

@ -1032,7 +1032,14 @@ int CL_LoadModels(int stage, qboolean dontactuallyload)
s = Info_ValueForKey(cl.serverinfo, "*csprogs");
if (anycsqc || *s || cls.demoplayback) //only allow csqc if the server says so, and the 'checksum' matches.
{
unsigned int chksum = strtoul(s, NULL, 0);
char *endptr;
unsigned int chksum = strtoul(s, &endptr, 0);
if (*endptr)
{
Con_Printf("corrupt *csprogs key in serverinfo\n");
anycsqc = true;
chksum = 0;
}
SCR_SetLoadingFile("csprogs");
if (!CSQC_Init(anycsqc, chksum))
{
@ -1291,8 +1298,9 @@ void Sound_CheckDownloads (void)
if (*s) //only allow csqc if the server says so, and the 'checksum' matches.
{
extern cvar_t cl_download_csprogs, cl_nocsqc;
unsigned int chksum = strtoul(s, NULL, 0);
if (cl_nocsqc.ival || cls.demoplayback)
char *endptr;
unsigned int chksum = strtoul(s, &endptr, 0);
if (cl_nocsqc.ival || cls.demoplayback || *endptr)
{
}
else if (cl_download_csprogs.ival)

View file

@ -981,7 +981,11 @@ void CL_PredictMovePNum (int pnum)
{
if (cl_lerp_players.ival && !cls.demoplayback)
{
lerpents_t *le = &cl.lerpplayers[spec_track[pnum]];
lerpents_t *le;
if (cls.fteprotocolextensions2 & PEXT2_REPLACEMENTDELTAS)
le = &cl.lerpents[spec_track[pnum]+1];
else
le = &cl.lerpplayers[spec_track[pnum]];
org = le->origin;
vel = vec3_origin;
}

View file

@ -1744,8 +1744,18 @@ void SCR_SetUpToDrawConsole (void)
// decide on the height of the console
if (!scr_disabled_for_loading)
{
if ((key_dest == key_console || key_dest == key_game) && !cl.sendprespawn && cl.worldmodel && cl.worldmodel->needload)
Con_ForceActiveNow();
float fullscreenpercent = 1;
#ifdef ANDROID
//android has an onscreen imm that we don't want to obscure
fullscreenpercent = scr_consize.value;
#endif
if ((key_dest == key_console || key_dest == key_game) && (!cl.sendprespawn && cl.worldmodel && cl.worldmodel->needload))
{
key_dest = key_console;
scr_conlines = scr_con_current = vid.height * fullscreenpercent;
}
else if ((key_dest == key_console || key_dest == key_game) && SCR_GetLoadingStage() == LS_NONE && cls.state < ca_active)
scr_con_current = scr_conlines = vid.height * fullscreenpercent;
else if (key_dest == key_console || scr_chatmode)
{
scr_conlines = vid.height*scr_consize.value; // half screen

View file

@ -521,6 +521,7 @@ CL_ClearTEnts
void CL_ClearTEnts (void)
{
CL_ClearTEntParticleState();
CL_ShutdownTEnts();
cl_beams_max = 0;
BZ_Free(cl_beams);

View file

@ -772,8 +772,16 @@ void VARGS Con_DPrintf (char *fmt, ...)
char msg[MAXPRINTMSG];
extern cvar_t log_developer;
#ifdef CRAZYDEBUGGING
va_start (argptr,fmt);
vsnprintf (msg,sizeof(msg)-1, fmt,argptr);
va_end (argptr);
Sys_Printf("%s", msg);
return;
#else
if (!developer.value && !log_developer.value)
return; // early exit
#endif
va_start (argptr,fmt);
vsnprintf (msg,sizeof(msg)-1, fmt,argptr);

View file

@ -5,7 +5,9 @@
extern qboolean mouse_active;
cvar_t m_filter = CVARF("m_filter", "0", CVAR_ARCHIVE);
cvar_t m_strafeonright = CVARFD("m_strafeonright", "1", CVAR_ARCHIVE, "If 1, touching the right half of the touchscreen will strafe/move, while the left side will turn.");
cvar_t m_strafeonleft = CVARFD("m_strafeonleft", "1", CVAR_ARCHIVE, "If 1, touching the right half of the touchscreen will strafe/move, while the left side will turn.");
cvar_t m_fatpressthreshold = CVARFD("m_fatpressthreshold", "0.5", CVAR_ARCHIVE, "How fat your thumb has to be to register a fat press.");
cvar_t m_slidethreshold = CVARFD("m_slidethreshold", "5", CVAR_ARCHIVE, "How far your finger needs to move to be considered a slide event.");
extern cvar_t _windowed_mouse;
@ -32,6 +34,7 @@ struct eventlist_s
struct
{
float x, y;
float tsize; //the size of the touch
} mouse;
struct
{
@ -72,13 +75,14 @@ void IN_Shutdown(void)
void IN_ReInit()
{
Cvar_Register (&m_filter, "input controls");
Cvar_Register (&m_strafeonright, "input controls");
}
void IN_Init(void)
{
IN_ReInit();
Cvar_Register (&m_filter, "input controls");
Cvar_Register (&m_strafeonleft, "input controls");
Cvar_Register (&m_fatpressthreshold, "input controls");
Cvar_Register (&m_slidethreshold, "input controls");
}
/*on android, each 'pointer' is a separate touch location*/
@ -95,31 +99,44 @@ void IN_Commands(void)
if (ev->keyboard.scancode == K_MOUSE1 && ev->devid < MAXPOINTERS)
{
if (Key_MouseShouldBeFree())
ptr[ev->devid].down = false;
ptr[ev->devid].down = 0;
else
{
if (ev->type == IEV_KEYDOWN)
{
ptr[ev->devid].down = true;
ptr[ev->devid].down = 1;
ptr[ev->devid].movedist = 0;
ptr[ev->devid].downpos[0] = ptr[ev->devid].oldpos[0];
ptr[ev->devid].downpos[1] = ptr[ev->devid].oldpos[1];
ptr[ev->devid].move[0] = 0;
ptr[ev->devid].move[1] = 0;
if (ev->mouse.tsize > m_fatpressthreshold.value)
{
int key = (m_strafeonleft.ival && ptr[ev->devid].downpos[0] > vid.pixelwidth/2)?K_MOUSE2:K_MOUSE1;
Key_Event(ev->devid, key, 0, true);
ptr[ev->devid].down = 2;
}
}
else
{
if (ptr[ev->devid].down > 1)
{
int key = (m_strafeonleft.ival && ptr[ev->devid].downpos[0] > vid.pixelwidth/2)?K_MOUSE2:K_MOUSE1;
Key_Event(ev->devid, key, 0, false);
ptr[ev->devid].down = 1;
}
if (ptr[ev->devid].down)
{
if (ptr[ev->devid].movedist < 5)
if (ptr[ev->devid].movedist < m_slidethreshold.value)
{
/*if its on the right, make it a mouse2*/
int key = (m_strafeonright.ival && ptr[ev->devid].downpos[0] > vid.pixelwidth/2)?K_MOUSE3:K_MOUSE1;
int key = (m_strafeonleft.ival && ptr[ev->devid].downpos[0] > vid.pixelwidth/2)?K_MOUSE2:K_MOUSE1;
Key_Event(ev->devid, key, 0, true);
Key_Event(ev->devid, key, 0, false);
}
}
ptr[ev->devid].down = false;
ptr[ev->devid].down = 0;
}
break;
}
@ -130,8 +147,11 @@ void IN_Commands(void)
/*mouse cursors only really work with one pointer*/
if (ev->devid == 0)
{
mousecursor_x = bound(0, ev->mouse.x, vid.width - 1);
mousecursor_y = bound(0, ev->mouse.y, vid.height - 1);
float fl;
fl = ev->mouse.x * vid.width / vid.pixelwidth;
mousecursor_x = bound(0, fl, vid.width-1);
fl = ev->mouse.y * vid.height / vid.pixelheight;
mousecursor_y = bound(0, fl, vid.height-1);
}
if (ev->devid < MAXPOINTERS)
@ -143,6 +163,20 @@ void IN_Commands(void)
ptr[ev->devid].oldpos[0] = ev->mouse.x;
ptr[ev->devid].oldpos[1] = ev->mouse.y;
if (ptr[ev->devid].down > 1 && ev->mouse.tsize < m_fatpressthreshold.value)
{
int key = (m_strafeonleft.ival && ptr[ev->devid].downpos[0] > vid.pixelwidth/2)?K_MOUSE2:K_MOUSE1;
Key_Event(ev->devid, key, 0, false);
ptr[ev->devid].down = 1;
}
if (ptr[ev->devid].down == 1 && ev->mouse.tsize > m_fatpressthreshold.value)
{
int key = (m_strafeonleft.ival && ptr[ev->devid].downpos[0] > vid.pixelwidth/2)?K_MOUSE2:K_MOUSE1;
Key_Event(ev->devid, key, 0, true);
ptr[ev->devid].down = 2;
}
}
break;
}
@ -169,7 +203,7 @@ static void IN_Update(qboolean ingame)
{
if (!CSQC_MouseMove(ptr[i].move[0], ptr[i].move[1], i))
{
if (ptr[i].down && m_strafeonright.ival && ptr[i].downpos[0] > vid.pixelwidth/2 && ingame)
if (ptr[i].down && m_strafeonleft.ival && ptr[i].downpos[0] > vid.pixelwidth/2 && ingame)
{
mousestrafe_x += ptr[i].oldpos[0] - ptr[i].downpos[0];
mousestrafe_y += ptr[i].oldpos[1] - ptr[i].downpos[1];
@ -273,7 +307,7 @@ JNIEXPORT void JNICALL Java_com_fteqw_FTEDroidEngine_keypress(JNIEnv *env, jobje
}
JNIEXPORT void JNICALL Java_com_fteqw_FTEDroidEngine_motion(JNIEnv *env, jobject obj,
jint act, jint ptrid, jfloat x, jfloat y)
jint act, jint ptrid, jfloat x, jfloat y, jfloat size)
{
struct eventlist_s *ev = in_newevent();
if (!ev)
@ -290,6 +324,7 @@ JNIEXPORT void JNICALL Java_com_fteqw_FTEDroidEngine_motion(JNIEnv *env, jobject
ev->type = IEV_MOUSEABS;
ev->mouse.x = x;
ev->mouse.y = y;
ev->mouse.tsize = size;
}
in_finishevent();
}

View file

@ -83,7 +83,7 @@ void IN_Move (float *movements, int pnum)
}
else
{
cl.viewanglechange[pnum][YAW] -= m_yaw.value * mouse_x;
cl.playerview[pnum].viewanglechange[YAW] -= m_yaw.value * mouse_x;
}
if (in_mlook.state[pnum])
@ -91,7 +91,7 @@ void IN_Move (float *movements, int pnum)
if (in_mlook.state[pnum] && !(in_strafe.state[pnum] & 1))
{
cl.viewanglechange[pnum][PITCH] += m_pitch.value * mouse_y;
cl.playerview[pnum].viewanglechange[PITCH] += m_pitch.value * mouse_y;
}
else
{

View file

@ -281,13 +281,13 @@ void IN_Move (float *movements, int pnum)
}
else
{
cl.viewanglechange[pnum][YAW] -= m_yaw.value * mouse_x;
cl.playerview[pnum].viewanglechange[YAW] -= m_yaw.value * mouse_x;
}
if (in_mlook.state[pnum] & 1)
V_StopPitchDrift (pnum);
if ( (in_mlook.state[pnum] & 1) && !(in_strafe.state[pnum] & 1)) {
cl.viewanglechange[pnum][PITCH] += m_pitch.value * mouse_y;
cl.playerview[pnum].viewanglechange[PITCH] += m_pitch.value * mouse_y;
} else {
if (movements)
{

View file

@ -315,14 +315,14 @@ void IN_Move (float *movements, int pnum) //add mouse movement to cmd
if ( (in_strafe.state[pnum] & 1) || (lookstrafe.value && (in_mlook.state[pnum] & 1) ))
movements[1] += m_side.value * mouse_x;
else
cl.viewanglechange[pnum][YAW] -= m_yaw.value * mouse_x;
cl.playerview[pnum].viewanglechange[YAW] -= m_yaw.value * mouse_x;
if (in_mlook.state[pnum] & 1)
V_StopPitchDrift (pnum);
if ( (in_mlook.state[pnum] & 1) && !(in_strafe.state[pnum] & 1))
{
cl.viewanglechange[pnum][PITCH] += m_pitch.value * mouse_y;
cl.playerview[pnum].viewanglechange[PITCH] += m_pitch.value * mouse_y;
}
else
{

View file

@ -161,6 +161,11 @@ keyname_t keynames[] =
{"LWIN", K_LWIN},
{"RWIN", K_RWIN},
{"APP", K_APP},
{"MENU", K_APP},
{"SEARCH", K_SEARCH},
{"POWER", K_POWER},
{"VOLUP", K_VOLUP},
{"VOLDOWN", K_VOLDOWN},
{"JOY1", K_JOY1},
{"JOY2", K_JOY2},
@ -390,28 +395,41 @@ qboolean Key_GetConsoleSelectionBox(int *sx, int *sy, int *ex, int *ey)
{
extern int mousecursor_x, mousecursor_y;
if (!con_mousedown[2])
{
*sx = *sy = *ex = *ey = 0;
return false;
if (con_mousedown[2] == 1)
{
while (mousecursor_y - con_mousedown[1] > 8 && con_current->display->older)
{
con_mousedown[1] += 8;
con_current->display = con_current->display->older;
}
while (mousecursor_y - con_mousedown[1] < -8 && con_current->display->newer)
{
con_mousedown[1] -= 8;
con_current->display = con_current->display->newer;
}
}
else if (con_mousedown[2] == 2)
{
*sx = con_mousedown[0];
*sy = con_mousedown[1];
*ex = mousecursor_x;
*ey = mousecursor_y;
return true;
}
return false;
}
void Key_ConsoleRelease(int key, int unicode)
{
if (key == K_MOUSE1)
con_mousedown[2] = false;
if (key == K_MOUSE2 && con_mousedown[2])
con_mousedown[2] = 0;
if (key == K_MOUSE2 && con_mousedown[2] == 2)
{
extern int mousecursor_x, mousecursor_y;
char *buffer;
con_mousedown[2] = false;
con_mousedown[2] = 0;
buffer = Con_CopyConsole();
if (!buffer)
return;
@ -478,9 +496,9 @@ void Key_Console (unsigned int unicode, int key)
}
}
else if (key == K_MOUSE2)
con_mousedown[2] = true;
con_mousedown[2] = 2;
else
con_mousedown[2] = false;
con_mousedown[2] = 1;
return;
}

View file

@ -155,6 +155,9 @@ K_AUX32 = 238,
K_LWIN = 239,
K_RWIN = 240,
K_APP = 241,
K_SEARCH = 242,
K_VOLUP = 243,
K_VOLDOWN = 244,
K_MAX = 256
};

View file

@ -3289,10 +3289,6 @@ sfxcache_t *S_MP3_Locate(sfx_t *sfx, sfxcache_t *buf, int start, int length)
#ifndef WAVE_FORMAT_MPEGLAYER3
#define WAVE_FORMAT_MPEGLAYER3 0x0055
#define MPEGLAYER3_WFX_EXTRA_BYTES 12
#define MPEGLAYER3_FLAG_PADDING_OFF 2
#define MPEGLAYER3_ID_MPEG 1
typedef struct
{
WAVEFORMATEX wfx;
@ -3303,6 +3299,11 @@ typedef struct
WORD nCodecDelay;
} MPEGLAYER3WAVEFORMAT;
#endif
#ifndef MPEGLAYER3_ID_MPEG
#define MPEGLAYER3_WFX_EXTRA_BYTES 12
#define MPEGLAYER3_FLAG_PADDING_OFF 2
#define MPEGLAYER3_ID_MPEG 1
#endif
qboolean S_LoadMP3Sound (sfx_t *s, qbyte *data, int datalen, int sndspeed)
{

View file

@ -628,6 +628,17 @@ void Master_AddMaster (char *address, int type, char *description)
master = mast;
}
void MasterInfo_Shutdown(void)
{
master_t *mast;
while(master)
{
mast = master;
master = mast->next;
Z_Free(mast);
}
}
void Master_AddMasterHTTP (char *address, int mastertype, char *description)
{
master_t *mast;

View file

@ -246,7 +246,7 @@ typedef struct part_type_s {
float gravity;
vec3_t friction;
float clipbounce;
int stainonimpact;
float stainonimpact;
vec3_t dl_rgb;
float dl_radius;
@ -1135,13 +1135,15 @@ static void P_ParticleEffect_f(void)
ptype->rgbrandsync[2] = atof(value);
else if (!strcmp(var, "stains"))
ptype->stainonimpact = atoi(value);
ptype->stainonimpact = atof(value);
else if (!strcmp(var, "blend"))
{
if (!strcmp(value, "add"))
ptype->looks.blendmode = BM_ADD;
else if (!strcmp(value, "subtract"))
ptype->looks.blendmode = BM_SUBTRACT;
else if (!strcmp(value, "invmod"))
ptype->looks.blendmode = BM_INVMOD;
else if (!strcmp(value, "blendcolour") || !strcmp(value, "blendcolor"))
ptype->looks.blendmode = BM_BLENDCOLOUR;
else
@ -2187,6 +2189,16 @@ static void PScript_Shutdown (void)
Cmd_RemoveCommand("r_beaminfo");
#endif
while (numparticletypes > 0)
{
numparticletypes--;
if (part_type[numparticletypes].ramp)
BZ_Free(part_type[numparticletypes].ramp);
}
BZ_Free (part_type);
part_type = NULL;
part_run_list = NULL;
BZ_Free (particles);
BZ_Free (beams);
BZ_Free (decals);
@ -5354,6 +5366,12 @@ static void PScript_DrawParticleTypes (void)
{
if (traces-->0&&tr(oldorg, p->org, stop, normal))
{
if (type->stainonimpact < 0)
R_AddStain(stop, (p->rgba[0]*-1),
(p->rgba[1]*-1),
(p->rgba[2]*-1),
p->scale*-type->stainonimpact);
else
R_AddStain(stop, (p->rgba[1]*-10+p->rgba[2]*-10),
(p->rgba[0]*-10+p->rgba[2]*-10),
(p->rgba[0]*-10+p->rgba[1]*-10),

View file

@ -1223,6 +1223,7 @@ static void QCBUILTIN PF_R_GetViewFlag(progfuncs_t *prinst, struct globalvars_s
case VF_SIZE:
r[0] = r_refdef.vrect.width;
r[1] = r_refdef.vrect.height;
r[2] = 0;
break;
case VF_MIN_X:

View file

@ -603,6 +603,8 @@ void QCBUILTIN PF_CL_drawrawstring (progfuncs_t *prinst, struct globalvars_s *pr
}
while(*text)
{
//FIXME: which charset is this meant to be using?
//quakes? 8859-1? utf8? some weird hacky mixture?
x = Font_DrawScaleChar(x, y, size[0], size[1], CON_WHITEMASK|/*0xe000|*/(*text++&0xff));
}
Font_InvalidateColour();

View file

@ -92,6 +92,23 @@ void R2D_Shutdown(void)
Cvar_Unhook(&crosshair);
Cvar_Unhook(&crosshairimage);
Cvar_Unhook(&crosshaircolor);
BZ_Free(cl_stris);
cl_stris = NULL;
BZ_Free(cl_strisvertv);
cl_strisvertv = NULL;
BZ_Free(cl_strisvertc);
cl_strisvertc = NULL;
BZ_Free(cl_strisvertt);
cl_strisvertt = NULL;
BZ_Free(cl_strisidx);
cl_strisidx = NULL;
cl_numstrisidx = 0;
cl_maxstrisidx = 0;
cl_numstrisvert = 0;
cl_maxstrisvert = 0;
cl_numstris = 0;
cl_maxstris = 0;
}
/*

View file

@ -1624,6 +1624,8 @@ char *particle_set_high =
"friction 4\n"
"scalefactor 0.825\n"
"blend add\n"
"spawnmode spiral\n"
"spawnvel -50\n"
"}\n"
/////////////////////////////////////////
@ -1658,46 +1660,91 @@ char *particle_set_high =
//{
//}
"r_part te_blood\n"
"{\n"
"texture fte_bloodparticle\n"
"blend subtract\n"
"count 1\n"
"scale 32\n"
"alpha 0\n"
"die 1\n"
"randomvel 64\n"
"veladd 10\n"
"rotationspeed 90\n"
"rotationstart 0 360\n"
"rgb 64 128 128\n"
"rgbdelta -64 -128 -128\n"
"gravity 200\n"
"scalefactor 0.8\n"
// scaledelta -10
"}\n"
"r_part pe_73\n"
"{\n"
"assoc te_blood\n"
"}\n"
"r_part te_lightningblood\n"
"{\n"
"texture fte_bloodparticle\n"
"blend subtract\n"
"count 1\n"
"scale 32\n"
"alpha 0\n"
"die 1\n"
"randomvel 64\n"
"veladd 10\n"
"rotationspeed 90\n"
"rotationstart 0 360\n"
"rgb 0 128 128\n"
"rgbdelta 0 -128 -128\n"
"gravity 200\n"
"scalefactor 0.8\n"
"}\n"
/////////////////////////////////////////
//zombie body-part blood trails
"r_part tr_slightblood\n"
"{\n"
"texture \"particles/fteparticlefont.tga\"\n"
"tcoords 1 1 63 63 256 2 64\n"
"texture fte_bloodparticle\n"
"blend subtract\n"
// tcoords 1 1 63 63 256 2 64
"step 16\n"
"scale 64\n"
"alpha 0.6\n"
"alpha 0\n"
"die 1\n"
"randomvel 32\n"
"veladd 10\n"
"rotationspeed 90\n"
"rotationstart 0 360\n"
"rgb 32 0 0\n"
"rgb 64 128 128 \n"
"rgbdelta -64 -128 -128\n"
"gravity 200\n"
"scalefactor 0.8\n"
"scaledelta -10\n"
"stains 5\n"
"stains -0.5\n"
"}\n"
//////////////////////////////////////////
//regular ol' blood trails
"r_part tr_blood\n"
"{\n"
"texture \"particles/fteparticlefont.tga\"\n"
"tcoords 1 1 63 63 256 2 64\n"
"step 4\n"
"texture fte_bloodparticle\n"
"blend subtract\n"
"step 8\n"
"scale 64\n"
"alpha 0.3\n"
"alpha 0\n"
"die 1\n"
"randomvel 32\n"
"veladd 10\n"
"rotationspeed 90\n"
"rotationstart 0 360\n"
"rgb 64 0 0\n"
"rgb 32 128 128 \n"
"rgbdelta -32 -128 -128\n"
"gravity 200\n"
"scalefactor 0.8\n"
"scaledelta -10\n"
"stains 5\n"
"stains -0.5\n"
"}\n"
//////////////////////////////////
@ -1729,6 +1776,8 @@ char *particle_set_high =
"randomvel 2\n"
"friction 4\n"
"scalefactor 0.825\n"
"spawnmode spiral\n"
"spawnvel 25\n"
"blend add\n"
"}\n"

View file

@ -2286,7 +2286,7 @@ void Surf_DrawWorld (void)
=============================================================================
*/
#ifdef TERRAIN
#if 0//def TERRAIN
// returns a texture number and the position inside it
int Surf_LM_AllocBlock (int w, int h, int *x, int *y, shader_t *shader)
{
@ -2685,9 +2685,7 @@ void Surf_DeInit(void)
void Surf_Clear(model_t *mod)
{
batch_t *b;
vbo_t *vbo;
int i;
if (mod->fromgame == fg_doom3)
return;/*they're on the hunk*/
while(mod->vbos)
@ -2748,6 +2746,51 @@ void Surf_LightmapMode(void)
}
}
//needs to be followed by a BE_UploadAllLightmaps at some point
int Surf_NewLightmaps(int count, int width, int height)
{
int first = numlightmaps;
int i, k;
if (!count)
return -1;
i = numlightmaps + count;
lightmap = BZ_Realloc(lightmap, sizeof(*lightmap)*(i));
while(i > first)
{
i--;
lightmap[i] = Z_Malloc(sizeof(*lightmap[i]) + (sizeof(qbyte)*8 + sizeof(stmap)*3)*width*height);
lightmap[i]->width = width;
lightmap[i]->height = height;
lightmap[i]->lightmaps = (qbyte*)(lightmap[i]+1);
lightmap[i]->deluxmaps = (qbyte*)(lightmap[i]->lightmaps+4*width*height);
lightmap[i]->stainmaps = (stmap*)(lightmap[i]->deluxmaps+4*width*height);
lightmap[i]->modified = true;
// lightmap[i]->shader = NULL;
lightmap[i]->external = false;
// reset stainmap since it now starts at 255
memset(lightmap[i]->stainmaps, 255, width*height*3*sizeof(stmap));
//clear out the deluxmaps incase there is none on the map.
for (k = 0; k < width*height*3; k+=3)
{
lightmap[i]->deluxmaps[k+0] = 128;
lightmap[i]->deluxmaps[k+1] = 128;
lightmap[i]->deluxmaps[k+2] = 255;
}
TEXASSIGN(lightmap[i]->lightmap_texture, R_AllocNewTexture("***lightmap***", width, height));
TEXASSIGN(lightmap[i]->deluxmap_texture, R_AllocNewTexture("***deluxmap***", width, height));
}
numlightmaps += count;
return first;
}
/*
==================
GL_BuildLightmaps
@ -2759,16 +2802,13 @@ Groups surfaces into their respective batches (based on the lightmap number).
*/
void Surf_BuildLightmaps (void)
{
int i, j, k, t;
int i, j, t;
model_t *m;
int shift;
msurface_t *surf;
batch_t *batch, *bstop;
vec3_t sn;
batch_t *batch;
int sortid;
int ptype;
void *mem;
unsigned int memsize;
int newfirst;
r_framecount = 1; // no dlightcache
@ -2783,6 +2823,11 @@ void Surf_BuildLightmaps (void)
Surf_LightmapMode();
r_oldviewleaf = NULL;
r_oldviewleaf2 = NULL;
r_oldviewcluster = -1;
r_oldviewcluster2 = -1;
if (cl.worldmodel->fromgame == fg_doom)
return; //no lightmaps.
@ -2793,6 +2838,12 @@ void Surf_BuildLightmaps (void)
m = cl.model_precache[j];
if (!m)
break;
#ifdef TERRAIN
if (m->terrain)
Terr_PurgeTerrainModel(m, true);
#endif
if (m->type != mod_brush)
continue;
@ -2807,41 +2858,7 @@ void Surf_BuildLightmaps (void)
if (*m->name == '*' && m->fromgame == fg_quake3) //FIXME: should be all bsp formats
newfirst = cl.model_precache[1]->lightmaps.first;
else
{
newfirst = numlightmaps;
i = numlightmaps + m->lightmaps.count;
lightmap = BZ_Realloc(lightmap, sizeof(*lightmap)*(i));
while(i > numlightmaps)
{
i--;
lightmap[i] = Z_Malloc(sizeof(*lightmap[i]) + (sizeof(qbyte)*8 + sizeof(stmap)*3)*m->lightmaps.width*m->lightmaps.height);
lightmap[i]->width = m->lightmaps.width;
lightmap[i]->height = m->lightmaps.height;
lightmap[i]->lightmaps = (qbyte*)(lightmap[i]+1);
lightmap[i]->deluxmaps = (qbyte*)(lightmap[i]->lightmaps+4*lightmap[i]->width*lightmap[i]->height);
lightmap[i]->stainmaps = (stmap*)(lightmap[i]->deluxmaps+4*lightmap[i]->width*lightmap[i]->height);
lightmap[i]->modified = true;
// lightmap[i]->shader = NULL;
lightmap[i]->external = false;
// reset stainmap since it now starts at 255
memset(lightmap[i]->stainmaps, 255, LMBLOCK_WIDTH*LMBLOCK_HEIGHT*3*sizeof(stmap));
//clear out the deluxmaps incase there is none on the map.
for (k = 0; k < lightmap[i]->width*lightmap[i]->height*3; k+=3)
{
lightmap[i]->deluxmaps[k+0] = 128;
lightmap[i]->deluxmaps[k+1] = 128;
lightmap[i]->deluxmaps[k+2] = 255;
}
TEXASSIGN(lightmap[i]->lightmap_texture, R_AllocNewTexture("***lightmap***", lightmap[i]->width, lightmap[i]->height));
TEXASSIGN(lightmap[i]->deluxmap_texture, R_AllocNewTexture("***deluxmap***", lightmap[i]->width, lightmap[i]->height));
}
numlightmaps += m->lightmaps.count;
}
newfirst = Surf_NewLightmaps(m->lightmaps.count, m->lightmaps.width, m->lightmaps.height);
//fixup batch lightmaps
for (sortid = 0; sortid < SHADER_SORT_COUNT; sortid++)

View file

@ -222,7 +222,7 @@ typedef struct {
int height;
glRect_t rectchange;
glRect_t deluxrectchange;
#ifdef TERRAIN
#if 0 //def TERRAIN
int allocated[LMBLOCK_WIDTH];
#endif
qbyte *lightmaps;//[4*LMBLOCK_WIDTH*LMBLOCK_HEIGHT];

View file

@ -210,8 +210,14 @@ extern cvar_t r_novis;
extern cvar_t r_speeds;
extern cvar_t r_waterwarp;
#ifdef ANDROID
//on android, these numbers seem to be generating major weirdness, so disable these.
cvar_t r_polygonoffset_submodel_factor = SCVAR("r_polygonoffset_submodel_factor", "0");
cvar_t r_polygonoffset_submodel_offset = SCVAR("r_polygonoffset_submodel_offset", "0");
#else
cvar_t r_polygonoffset_submodel_factor = SCVAR("r_polygonoffset_submodel_factor", "0.05");
cvar_t r_polygonoffset_submodel_offset = SCVAR("r_polygonoffset_submodel_offset", "25");
#endif
cvar_t r_polygonoffset_stencil_factor = SCVAR("r_polygonoffset_stencil_factor", "0.01");
cvar_t r_polygonoffset_stencil_offset = SCVAR("r_polygonoffset_stencil_offset", "1");
@ -2384,7 +2390,19 @@ void R_InitParticleTexture (void)
data[y*16+x][3] = exptexture[x][y]*255/9.0;
}
}
explosiontexture = R_LoadTexture32("", 16, 16, data, IF_NOMIPMAP|IF_NOPICMIP);
explosiontexture = R_LoadTexture32("fte_fuzzyparticle", 16, 16, data, IF_NOMIPMAP|IF_NOPICMIP);
for (x=0 ; x<16 ; x++)
{
for (y=0 ; y<16 ; y++)
{
data[y*16+x][0] = exptexture[x][y]*255/9.0;
data[y*16+x][1] = exptexture[x][y]*255/9.0;
data[y*16+x][2] = exptexture[x][y]*255/9.0;
data[y*16+x][3] = exptexture[x][y]*255/9.0;
}
}
R_LoadTexture32("fte_bloodparticle", 16, 16, data, IF_NOMIPMAP|IF_NOPICMIP);
memset(data, 255, sizeof(data));
for (y = 0;y < PARTICLETEXTURESIZE;y++)

View file

@ -225,6 +225,24 @@ static struct
void *driverctx; /*capture driver context*/
} s_speex;
#ifdef SPEEX_STATIC
#define qspeex_lib_get_mode speex_lib_get_mode
#define qspeex_bits_init speex_bits_init
#define qspeex_bits_reset speex_bits_reset
#define qspeex_bits_write speex_bits_write
#define qspeex_preprocess_state_init speex_preprocess_state_init
#define qspeex_preprocess_ctl speex_preprocess_ctl
#define qspeex_preprocess_run speex_preprocess_run
#define qspeex_encoder_init speex_encoder_init
#define qspeex_encoder_ctl speex_encoder_ctl
#define qspeex_encode_int speex_encode_int
#define qspeex_decoder_init speex_decoder_init
#define qspeex_decode_int speex_decode_int
#define qspeex_bits_read_from speex_bits_read_from
#else
static const SpeexMode *(VARGS *qspeex_lib_get_mode)(int mode);
static void (VARGS *qspeex_bits_init)(SpeexBits *bits);
static void (VARGS *qspeex_bits_reset)(SpeexBits *bits);
@ -267,6 +285,7 @@ static dllfunction_t qspeexdspfuncs[] =
{NULL}
};
#endif
snd_capture_driver_t DSOUND_Capture;
snd_capture_driver_t OSS_Capture;
@ -275,6 +294,8 @@ static qboolean S_Speex_Init(void)
{
int i;
const SpeexMode *mode;
#ifndef SPEEX_STATIC
if (s_speex.inited)
return s_speex.loaded;
s_speex.inited = true;
@ -292,6 +313,7 @@ static qboolean S_Speex_Init(void)
Con_Printf("libspeexdsp not found. Voice chat is not available.\n");
return false;
}
#endif
mode = qspeex_lib_get_mode(SPEEX_MODEID_NB);

View file

@ -20,6 +20,9 @@ qboolean isDedicated = false;
void *sys_window; /*public so the renderer can attach to the correct place*/
static qboolean sys_running = false;
int sys_glesversion;
cvar_t sys_vibrate = CVAR("sys_vibrate", "1");
cvar_t sys_osk = CVAR("sys_osk", "0"); //to be toggled
cvar_t sys_keepscreenon = CVAR("sys_keepscreenon", "1"); //to be toggled
#define LOGI(...) ((void)__android_log_print(ANDROID_LOG_INFO, DISTRIBUTION"Droid", __VA_ARGS__))
@ -27,9 +30,23 @@ int sys_glesversion;
static void *sys_memheap;
static unsigned int sys_lastframe;
JNIEXPORT int JNICALL Java_com_fteqw_FTEDroidEngine_frame(JNIEnv *env, jobject obj,
static unsigned int vibrateduration;
void Sys_Vibrate(int count)
{
vibrateduration = count*10*sys_vibrate.value;
}
JNIEXPORT jint JNICALL Java_com_fteqw_FTEDroidEngine_getvibrateduration(JNIEnv *env, jobject obj)
{
unsigned int dur = vibrateduration;
vibrateduration = 0;
return dur;
}
JNIEXPORT jint JNICALL Java_com_fteqw_FTEDroidEngine_frame(JNIEnv *env, jobject obj,
jfloat ax, jfloat ay, jfloat az)
{
int ret;
static vec3_t oac;
#ifdef SERVERONLY
SV_Frame();
@ -38,6 +55,9 @@ JNIEXPORT int JNICALL Java_com_fteqw_FTEDroidEngine_frame(JNIEnv *env, jobject o
double tdelta = (now - sys_lastframe) * 0.001;
if (oac[0] != ax || oac[1] != ay || oac[2] != az)
{
//down: x= +9.8
//left: y= -9.8
//up: z= +9.8
CSQC_Accelerometer(ax, ay, az);
oac[0] = ax;
oac[1] = ay;
@ -47,9 +67,14 @@ JNIEXPORT int JNICALL Java_com_fteqw_FTEDroidEngine_frame(JNIEnv *env, jobject o
sys_lastframe = now;
#endif
if (key_dest == key_console || key_dest == key_message)
return 1;
return 0;
ret = 0;
if (key_dest == key_console || key_dest == key_message || (key_dest == key_game && cls.state == ca_disconnected) || sys_osk.ival)
ret |= 1;
if (vibrateduration)
ret |= 2;
if (sys_keepscreenon.ival)
ret |= 4;
return ret;
}
JNIEXPORT void JNICALL Java_com_fteqw_FTEDroidEngine_init(JNIEnv *env, jobject obj,
@ -78,7 +103,7 @@ JNIEXPORT void JNICALL Java_com_fteqw_FTEDroidEngine_init(JNIEnv *env, jobject o
parms.basedir = NULL; /*filled in later*/
parms.argc = 3;
parms.argv = args;
parms.memsize = 16*1024*1024;
parms.memsize = 512*1024*1024;
parms.membase = sys_memheap = malloc(parms.memsize);
if (!parms.membase)
{
@ -249,6 +274,9 @@ void Sys_SendKeyEvents(void)
}
void Sys_Init(void)
{
Cvar_Register(&sys_vibrate, "android stuff");
Cvar_Register(&sys_osk, "android stuff");
Cvar_Register(&sys_keepscreenon, "android stuff");
}
qboolean Sys_GetDesktopParameters(int *width, int *height, int *bpp, int *refreshrate)

View file

@ -392,6 +392,10 @@ void V_ParseDamage (int pnum)
if (count < 10)
count = 10;
#ifdef ANDROID
Sys_Vibrate(count);
#endif
if (v_damagecshift.value >= 0)
count *= v_damagecshift.value;

View file

@ -639,15 +639,12 @@ void Mod_ParseInfoFromEntityLump(model_t *wmodel, char *data, char *mapname) //a
else if (!strcmp("fog", key))
{
char *s;
Q_strncpyz(key, com_token, sizeof(key));
s = COM_Parse(key);
cl.fog_density = atof(com_token);
s = COM_Parse(s);
cl.fog_colour[0] = atof(com_token);
s = COM_Parse(s);
cl.fog_colour[1] = atof(com_token);
s = COM_Parse(s);
cl.fog_colour[2] = atof(com_token);
void CL_Fog_f(void);
key[0] = 'f';
key[1] = ' ';
Q_strncpyz(key+2, com_token, sizeof(key)-2);
Cmd_TokenizeString(key, false, false);
CL_Fog_f();
}
else if (!strcmp("sky", key)) // for Quake2 maps
{

View file

@ -233,7 +233,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#ifdef ANDROID
#undef RTLIGHTS
#ifndef SPEEX_STATIC
#undef VOICECHAT
#endif
#undef TEXTEDITOR
#endif
#ifdef NACL
@ -360,6 +362,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#else
#define PLATFORM "Win32"
#endif
#elif defined(ANDROID)
#define PLATFORM "Android" /*technically also linux*/
#elif defined(__linux__)
#if defined(__amd64__)
#define PLATFORM "Linux64"

View file

@ -712,6 +712,7 @@ static float Alias_CalculateSkeletalNormals(galiasinfo_t *model)
Z_Free(inversepose);
Z_Free(normals);
Z_Free(xyz);
Z_Free(mvert);
model = next;
modnum++;

View file

@ -2210,7 +2210,7 @@ conchar_t *COM_ParseFunString(conchar_t defaultflags, const char *str, conchar_t
continue;
}
}
if (*str == '&' && str[1] == 'c')
else if (*str == '&' && str[1] == 'c')
{
// ezQuake color codes
@ -2261,6 +2261,15 @@ conchar_t *COM_ParseFunString(conchar_t defaultflags, const char *str, conchar_t
}
}
}
else if (*str == '&' && str[1] == 'r')
{
ext = (COLOR_WHITE << CON_FGSHIFT) | (ext&~CON_FGMASK);
if (!keepmarkup)
{
str+=2;
continue;
}
}
messedup:
if (!--outsize)
break;
@ -2270,6 +2279,8 @@ messedup:
{
if (strchr("\n\r\t ", *str))
*out++ = (unsigned char)(*str++) | (ext&~CON_HIGHCHARSMASK);
else if (*str >= 32 && *str < 127 && !(ext&CON_HIGHCHARSMASK))
*out++ = (unsigned char)(*str++) | ext;
else
*out++ = (unsigned char)(*str++) | ext | 0xe000;
}
@ -3324,6 +3335,13 @@ void COM_Version_f (void)
#endif
}
void COM_CrashMe_f(void)
{
int *crashaddr = (int*)0x05;
*crashaddr = 0;
}
/*
================
COM_Init
@ -3360,7 +3378,7 @@ void COM_Init (void)
Cmd_AddCommand ("flocate", COM_Locate_f); //prints the pak or whatever where this file can be found.
Cmd_AddCommand ("version", COM_Version_f); //prints the pak or whatever where this file can be found.
Cmd_AddCommand ("crashme", (void*)1); //debugging feature, makes it jump to an invalid address
Cmd_AddCommand ("crashme", COM_CrashMe_f);
COM_InitFilesystem ();
COM_CheckRegistered ();

View file

@ -169,7 +169,7 @@ void Con_PrintCon (console_t *con, char *txt);
void Con_NotifyBox (char *text); // during startup for sound / cd warnings
#ifdef CRAZYDEBUGGING
#define TRACE(x) Con_Printf x
#define TRACE(x) Sys_Printf x
#else
#define TRACE(x)
#endif

View file

@ -1645,6 +1645,40 @@ char *FS_GetBasedir(void)
{
return com_quakedir;
}
void FS_CleanDir(char *in, char *out, int outlen)
{
char *end;
if (!outlen)
return;
end = in + strlen(in);
//skip over any trailing slashes
while (end > in)
{
if (end[-1] == '/' || end[-1] == '\\')
end--;
else
break;
}
//skip over the path
while (end > in)
{
if (end[-1] != '/' && end[-1] != '\\')
end--;
else
break;
}
//copy string into the dest
while (--outlen)
{
if (*end == '/' || *end == '\\' || !*end)
break;
*out++ = *end++;
}
*out = 0;
}
/*
================
COM_Gamedir
@ -1654,9 +1688,9 @@ Sets the gamedir and path to a different directory.
*/
void COM_Gamedir (const char *dir)
{
char thispath[64];
searchpath_t *next;
int plen, dlen;
char *p;
int dlen;
qboolean isbase;
if (!*dir || !strcmp(dir, ".") || strstr(dir, "..") || strstr(dir, "/")
@ -1674,12 +1708,8 @@ void COM_Gamedir (const char *dir)
isbase = true;
if (next->funcs == &osfilefuncs)
{
p = next->handle;
plen = strlen(p);
if (plen == dlen)
{
//no basedir, maybe
if (!strcmp(p, dir))
FS_CleanDir(next->purepath, thispath, sizeof(thispath));
if (!strcmp(dir, thispath))
{
if (isbase && com_searchpaths == com_base_searchpaths)
{
@ -1691,25 +1721,6 @@ void COM_Gamedir (const char *dir)
break;
}
}
else if (plen > dlen)
{
if (*(p+plen-dlen-1) == '/')
{
if (!strcmp(p+plen-dlen, dir))
{
if (isbase && com_searchpaths == com_base_searchpaths)
{
Q_strncpyz (gamedirfile, dir, sizeof(gamedirfile));
return;
}
if (!isbase)
return;
break;
}
}
}
}
}
FS_ForceToPure(NULL, NULL, 0);
@ -1807,6 +1818,7 @@ void COM_Gamedir (const char *dir)
#define HEX2CFG "set com_parseutf8 -1\nset gl_font gfx/hexen2\nset in_builtinkeymap 0\nset_calc cl_playerclass int (random * 5) + 1\nset r_particlesdesc \"spikeset tsshaft h2part\"\nset sv_maxspeed 640\nset watervis 1\nset r_wateralpha 0.5\nset sv_pupglow 1\nset cl_model_bobbing 1\nsv_sound_land \"fx/thngland.wav\"\n"
/*Q3's ui doesn't like empty model/headmodel/handicap cvars, even if the gamecode copes*/
#define Q3CFG "gl_overbright 2\nseta model sarge\nseta headmodel sarge\nseta handicap 100\n"
#define RMQCFG "sv_bigcoords 1\n"
typedef struct {
const char *argname; //used if this was used as a parameter.
@ -1834,6 +1846,7 @@ const gamemode_info_t gamemode_info[] = {
{"-spark", "spark", "Spark", {"base/src/progs.src",
"base/qwprogs.dat",
"base/pak0.pak"}, DMFCFG, {"base", }, "Spark"},
{"-rmq", "rmq", "RMQ", {NULL}, RMQCFG, {"id1", "qw", "rmq", "fte"}, "Remake Quake"},
//supported commercial mods (some are currently only partially supported)
{"-portals", "h2mp", "FTE-H2MP", {"portals/hexen.rc",
@ -2147,7 +2160,16 @@ void FS_ReloadPackFilesFlags(unsigned int reloadflags)
com_base_searchpaths = com_searchpaths;
if (oldpaths->isexplicit)
{
if (oldpaths->funcs == &osfilefuncs)
{
char pure[64];
FS_CleanDir(oldpaths->purepath, pure, sizeof(pure));
FS_AddPathHandle(pure, oldpaths->purepath, oldpaths->funcs, oldpaths->handle, oldpaths->copyprotected, false, true, reloadflags);
}
else
FS_AddPathHandle(oldpaths->purepath, oldpaths->purepath, oldpaths->funcs, oldpaths->handle, oldpaths->copyprotected, false, true, reloadflags);
}
else
oldpaths->funcs->ClosePath(oldpaths->handle);
Z_Free(oldpaths);

View file

@ -376,7 +376,7 @@ void Log_Init(void)
// cmd line options, debug options
#ifdef CRAZYDEBUGGING
Cvar_ForceSet(&log_enable, "1");
Cvar_ForceSet(&log_enable[LOG_CONSOLE], "1");
TRACE(("dbg: Con_Init: log_enable forced\n"));
#endif

View file

@ -3583,7 +3583,7 @@ lh_extension_t QSG_Extensions[] = {
{"EXT_CSQC_SHARED"}, //this is a separate extension because it requires protocol modifications. note: this is also the extension that extends the allowed stats.
{NULL},
{"PEXT_DPFLAGS"},
//{"EXT_CSQC"}, //this is the base csqc extension. I'm not sure what needs to be separate and what does not.
//{"EXT_CSQC_DELTAS"},//this is a separate extension because the feature may be banned in a league due to cheat protection.

View file

@ -1,6 +1,8 @@
#include "quakedef.h"
#include "pr_common.h"
qboolean Heightmap_Trace(model_t *model, int forcehullnum, int frame, vec3_t axis[3], vec3_t start, vec3_t end, vec3_t mins, vec3_t maxs, unsigned int contentmask, trace_t *trace);
/*
============================================================================
@ -998,6 +1000,14 @@ qboolean Q1BSP_Trace(model_t *model, int forcehullnum, int frame, vec3_t axis[3]
}
}
if (model->terrain && trace->fraction)
{
trace_t hmt;
Heightmap_Trace(model, forcehullnum, frame, axis, start, end, mins, maxs, hitcontentsmask, &hmt);
if (hmt.fraction < trace->fraction)
*trace = hmt;
}
return trace->fraction != 1;
}

View file

@ -85,6 +85,8 @@ void Sys_SendKeyEvents (void);
int Sys_EnumerateFiles (const char *gpath, const char *match, int (*func)(const char *, int, void *), void *parm);
void Sys_Vibrate(int count);
qboolean Sys_GetDesktopParameters(int *width, int *height, int *bpp, int *refreshrate);
#ifdef MULTITHREAD

View file

@ -1384,7 +1384,7 @@ void *Hunk_AllocName (int size, char *name)
#ifdef _WIN32
Sys_Error ("Not enough RAM allocated on allocation of \"%s\". Try starting using \"-heapsize 16000\" on the QuakeWorld command line.", name);
#else
Sys_Error ("Not enough RAM allocated. Try starting using \"-mem 16\" on the QuakeWorld command line.");
Sys_Error ("Not enough RAM allocated. Try starting using \"-mem %u\" on the QuakeWorld command line.", (hunk_size + 8*1024*1024) / 1024*1024);
#endif
#endif

View file

@ -1069,9 +1069,6 @@ static void (D3D9_SCR_UpdateScreen) (void)
scr_con_forcedraw = false;
if (noworld)
{
if ((key_dest == key_console || key_dest == key_game) && SCR_GetLoadingStage() == LS_NONE)
scr_con_current = vid.height;
if (scr_con_current != vid.height)
R2D_ConsoleBackground(0, vid.height, true);
else

View file

@ -20879,6 +20879,170 @@
/>
</FileConfiguration>
</File>
<File
RelativePath="..\client\in_droid.c"
>
<FileConfiguration
Name="MinGLDebug|Win32"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="MinGLDebug|x64"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="D3DDebug|Win32"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="D3DDebug|x64"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="MinGLRelease|Win32"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="MinGLRelease|x64"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="GLDebug|Win32"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="GLDebug|x64"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="Release Dedicated Server|Win32"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="Release Dedicated Server|x64"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="MRelease|Win32"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="MRelease|x64"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug Dedicated Server|Win32"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug Dedicated Server|x64"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="MDebug|Win32"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="MDebug|x64"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="GLRelease|Win32"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="GLRelease|x64"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="D3DRelease|Win32"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="D3DRelease|x64"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
</File>
<File
RelativePath="..\client\in_macos.c"
>
@ -21207,6 +21371,170 @@
/>
</FileConfiguration>
</File>
<File
RelativePath="..\client\in_sdl.c"
>
<FileConfiguration
Name="MinGLDebug|Win32"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="MinGLDebug|x64"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="D3DDebug|Win32"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="D3DDebug|x64"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="MinGLRelease|Win32"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="MinGLRelease|x64"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="GLDebug|Win32"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="GLDebug|x64"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="Release Dedicated Server|Win32"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="Release Dedicated Server|x64"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="MRelease|Win32"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="MRelease|x64"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug Dedicated Server|Win32"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug Dedicated Server|x64"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="MDebug|Win32"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="MDebug|x64"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="GLRelease|Win32"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="GLRelease|x64"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="D3DRelease|Win32"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="D3DRelease|x64"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
</File>
<File
RelativePath="..\client\snd_alsa.c"
>

View file

@ -7,6 +7,7 @@
<uses-sdk android:minSdkVersion="4" android:targetSdkVersion="8"/>
<uses-permission android:name="android.permission.INTERNET"></uses-permission>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"></uses-permission>
<uses-permission android:name="android.permission.VIBRATE"></uses-permission>
<application android:icon="@drawable/icon" android:label="@string/app_name">
<activity android:name=".FTEDroidActivity"

View file

@ -26,6 +26,10 @@ import android.media.AudioManager;
import android.media.AudioTrack;
import android.os.Environment;
import android.view.inputmethod.InputMethodManager;
import android.os.Vibrator;
public class FTEDroidActivity extends Activity
{
private static final int USE_GLES_VERSION = 1; //valid values: 1 or 2. If set to 2, it'll still fall back to 1 if gles2 isn't supported on this device.
@ -41,13 +45,16 @@ public class FTEDroidActivity extends Activity
public int glesversion;
private String basedir, userdir;
FTEDroidActivity act;
FTEView theview;
int notifiedflags;
FTERenderer(Context ctx, FTEDroidActivity parent)
FTERenderer(FTEView view, FTEDroidActivity parent)
{
act = parent;
theview = view;
try
{
android.content.pm.PackageInfo info = ctx.getPackageManager().getPackageInfo("com.fteqw", 0);
android.content.pm.PackageInfo info = parent.getPackageManager().getPackageInfo("com.fteqw", 0);
basedir = info.applicationInfo.sourceDir;
}
catch(android.content.pm.PackageManager.NameNotFoundException e)
@ -71,7 +78,69 @@ public class FTEDroidActivity extends Activity
{
if (inited == true)
{
FTEDroidEngine.frame(act.acc_x, act.acc_y, act.acc_z);
int flags;
flags = FTEDroidEngine.frame(act.acc_x, act.acc_y, act.acc_z);
if (flags != notifiedflags)
{
if (((flags ^ notifiedflags) & 1) != 0)
{
final int fl = flags;
Runnable r = new Runnable()
{ //doing this on the ui thread because android sucks.
public void run()
{
InputMethodManager im = (InputMethodManager) act.getSystemService(Context.INPUT_METHOD_SERVICE);
if (im != null)
{
if ((fl & 1) != 0)
{
// getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE);
im.showSoftInput(theview, InputMethodManager.SHOW_FORCED);
}
else
{
// getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);
im.hideSoftInputFromWindow(theview.getWindowToken(), 0);
}
}
else
android.util.Log.i("FTEDroid", "IMM failed");
}
};
act.runOnUiThread(r);
}
if (((flags ^ notifiedflags) & 2) != 0)
{
int dur = FTEDroidEngine.getvibrateduration();
flags &= ~2;
Vibrator vib = (Vibrator) act.getSystemService(Context.VIBRATOR_SERVICE);
if (vib != null)
{
android.util.Log.i("FTEDroid", "Vibrate " + dur + "ms");
vib.vibrate(dur);
}
else
android.util.Log.i("FTEDroid", "No vibrator device");
}
if (((flags ^ notifiedflags) & 4) != 0)
{
final int fl = flags;
Runnable r = new Runnable()
{
public void run()
{
if ((fl & 4) != 0)
act.getWindow().setFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON, WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
else
act.getWindow().setFlags(0, WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
}
};
act.runOnUiThread(r);
}
//clear anything which is an impulse
notifiedflags = flags;
}
}
}
@Override
@ -253,13 +322,13 @@ public class FTEDroidActivity extends Activity
final int pointerCount = event.getPointerCount();
int i;
for (i = 0; i < pointerCount; i++)
FTEDroidEngine.motion(0, event.getPointerId(i), event.getX(i), event.getY(i));
FTEDroidEngine.motion(0, event.getPointerId(i), event.getX(i), event.getY(i), event.getSize(i));
}
public boolean go(MotionEvent event)
{
int id;
float x, y;
float x, y, size;
final int act = event.getAction();
domove(event);
@ -272,7 +341,8 @@ public class FTEDroidActivity extends Activity
x = event.getX(id);
y = event.getY(id);
id = event.getPointerId(id);
FTEDroidEngine.motion(1, id, x, y);
size = event.getSize(id);
FTEDroidEngine.motion(1, id, x, y, size);
break;
case MotionEvent.ACTION_UP:
case MotionEvent.ACTION_POINTER_UP:
@ -280,7 +350,8 @@ public class FTEDroidActivity extends Activity
x = event.getX(id);
y = event.getY(id);
id = event.getPointerId(id);
FTEDroidEngine.motion(2, id, x, y);
size = event.getSize(id);
FTEDroidEngine.motion(2, id, x, y, size);
break;
case MotionEvent.ACTION_MOVE:
break;
@ -297,16 +368,17 @@ public class FTEDroidActivity extends Activity
final int act = event.getAction();
final float x = event.getX();
final float y = event.getY();
final float size = event.getSize();
FTEDroidEngine.motion(0, 0, x, y);
FTEDroidEngine.motion(0, 0, x, y, size);
switch(act)
{
case MotionEvent.ACTION_DOWN:
FTEDroidEngine.motion(1, 0, x, y);
FTEDroidEngine.motion(1, 0, x, y, size);
break;
case MotionEvent.ACTION_UP:
FTEDroidEngine.motion(2, 0, x, y);
FTEDroidEngine.motion(2, 0, x, y, size);
break;
case MotionEvent.ACTION_MOVE:
break;
@ -326,7 +398,7 @@ public class FTEDroidActivity extends Activity
else
inputevent = new FTELegacyInputEvent();
rndr = new FTERenderer(context, context);
rndr = new FTERenderer(this, context);
if (USE_GLES_VERSION < 2)
{
@ -383,10 +455,18 @@ public class FTEDroidActivity extends Activity
float y = event.getY();
}
*/
private static final int K_ENTER = 13;
private static final int K_ESCAPE = 27;
private static final int K_DEL = 127;
private static final int K_POWER = 130;
private static final int K_UPARROW = 132;
private static final int K_DOWNARROW = 133;
private static final int K_LEFTARROW = 134;
private static final int K_RIGHTARROW = 135;
private static final int K_APP = 241;
private static final int K_SEARCH = 242;
private static final int K_VOLUP = 243;
private static final int K_VOLDOWN = 244;
private int mapKey(int acode, int unicode)
{
switch(acode)
@ -401,13 +481,21 @@ public class FTEDroidActivity extends Activity
return K_RIGHTARROW;
case KeyEvent.KEYCODE_DPAD_CENTER:
case KeyEvent.KEYCODE_ENTER:
return '\r';
return K_ENTER;
case KeyEvent.KEYCODE_BACK:
return 27;
return K_ESCAPE; //escape, cannot be rebound
case KeyEvent.KEYCODE_MENU:
return 241;
return K_APP; //"app"
case KeyEvent.KEYCODE_DEL:
return 127;
return K_DEL; //"del"
case KeyEvent.KEYCODE_SEARCH:
return K_SEARCH; //"search"
case KeyEvent.KEYCODE_POWER:
return K_POWER; //"power"
case KeyEvent.KEYCODE_VOLUME_DOWN:
return K_VOLDOWN; //"voldown"
case KeyEvent.KEYCODE_VOLUME_UP:
return K_VOLUP; //"volup"
default:
if (unicode < 128)
return Character.toLowerCase(unicode);

View file

@ -3,9 +3,10 @@ package com.fteqw;
public class FTEDroidEngine
{
public static native void init(int w, int h, int gles2, String apkpath, String usrpath); /* init/reinit */
public static native void frame(float ax, float ay, float az);
public static native int frame(float ax, float ay, float az);
public static native int getvibrateduration(); //in ms
public static native void keypress(int down, int qkey, int unicode);
public static native void motion(int act, int pointerid, float x, float y);
public static native void motion(int act, int pointerid, float x, float y, float size);
public static native int paintaudio(byte[] stream, int len);
static

View file

@ -1923,8 +1923,8 @@ void BE_GenModelBatches(batch_t **batches)
batches[i] = NULL;
#if defined(TERRAIN)
if (cl.worldmodel && cl.worldmodel->type == mod_heightmap)
GL_DrawHeightmapModel(batches, &r_worldentity);
if (cl.worldmodel && cl.worldmodel->terrain)
Terr_DrawTerrainModel(batches, &r_worldentity);
#endif
if (!r_drawentities.ival)

View file

@ -1618,6 +1618,17 @@ static void colourgen(const shaderpass_t *pass, int cnt, vec4_t *src, vec4_t *ds
}
break;
case RGB_GEN_IDENTITY_LIGHTING:
if (shaderstate.curbatch->lightstyle[0] != 255)
{
while((cnt)--)
{
dst[cnt][0] = shaderstate.identitylighting * d_lightstylevalue[shaderstate.curbatch->lightstyle[0]]/256.0f;
dst[cnt][1] = shaderstate.identitylighting * d_lightstylevalue[shaderstate.curbatch->lightstyle[0]]/256.0f;
dst[cnt][2] = shaderstate.identitylighting * d_lightstylevalue[shaderstate.curbatch->lightstyle[0]]/256.0f;
}
}
else
{
//compensate for overbrights
while((cnt)--)
{
@ -1625,6 +1636,7 @@ static void colourgen(const shaderpass_t *pass, int cnt, vec4_t *src, vec4_t *ds
dst[cnt][1] = shaderstate.identitylighting;
dst[cnt][2] = shaderstate.identitylighting;
}
}
break;
default:
case RGB_GEN_IDENTITY:
@ -3525,6 +3537,7 @@ void GLBE_DrawMesh_List(shader_t *shader, int nummeshes, mesh_t **meshlist, vbo_
shaderstate.sourcevbo = &shaderstate.dummyvbo;
shaderstate.curshader = shader;
shaderstate.flags = beflags;
TRACE(("GLBE_DrawMesh_List: shader %s\n", shader->name));
if (shaderstate.curentity != &r_worldentity)
{
BE_SelectEntity(&r_worldentity);
@ -3719,10 +3732,15 @@ static void GLBE_SubmitMeshesSortList(batch_t *sortlist)
continue;
if (batch->buildmeshes)
{
TRACE(("GLBE_SubmitMeshesSortList: build\n"));
batch->buildmeshes(batch);
}
else if (batch->texture)
batch->shader = R_TextureAnimation(batch->ent->framestate.g[FS_REG].frame[0], batch->texture)->shader;
TRACE(("GLBE_SubmitMeshesSortList: shader %s\n", batch->shader->name));
if (batch->shader->flags & SHADER_NODRAW)
continue;
if (batch->shader->flags & SHADER_NODLIGHT)
@ -4111,6 +4129,8 @@ void GLBE_DrawWorld (qboolean drawworld, qbyte *vis)
GL_DoSwap();
TRACE(("GLBE_DrawWorld: %i %p\n", drawworld, vis));
if (!r_refdef.recurse)
{
if (shaderstate.wbatch + 50 > shaderstate.maxwbatches)
@ -4210,9 +4230,11 @@ void GLBE_DrawWorld (qboolean drawworld, qbyte *vis)
if (vis)
{
RSpeedRemark();
TRACE(("GLBE_DrawWorld: drawing lights\n"));
BE_SelectEntity(&r_worldentity);
Sh_DrawLights(vis);
RSpeedEnd(RSPEED_STENCILSHADOWS);
TRACE(("GLBE_DrawWorld: lights drawn\n"));
}
#endif
@ -4239,5 +4261,7 @@ void GLBE_DrawWorld (qboolean drawworld, qbyte *vis)
shaderstate.identitylighting = 1;
shaderstate.mbatches = ob;
TRACE(("GLBE_DrawWorld: drawn everything\n"));
}
#endif

View file

@ -1522,8 +1522,8 @@ float Font_DrawScaleChar(float px, float py, float cw, float ch, unsigned int ch
}
else
{
sx = ((px+c->left));
sy = ((py+c->top));
sx = ((px+(c->left*(int)vid.width) / (float)vid.rotpixelwidth));
sy = ((py+(c->top*(int)vid.height) / (float)vid.rotpixelheight));
sw = ((c->bmw*cw));
sh = ((c->bmh*ch));
v = Font_BeginChar(fontplanes.texnum[c->texplane]);

File diff suppressed because it is too large Load diff

View file

@ -39,7 +39,6 @@ char loadname[32]; // for hunk tags
void CM_Init(void);
qboolean GL_LoadHeightmapModel (model_t *mod, void *buffer);
qboolean RMod_LoadSpriteModel (model_t *mod, void *buffer);
qboolean RMod_LoadSprite2Model (model_t *mod, void *buffer);
qboolean RMod_LoadBrushModel (model_t *mod, void *buffer);
@ -400,9 +399,10 @@ void RMod_ClearAll (void)
Surf_Clear(mod);
}
#ifdef TERRAIN
if (mod->type == mod_heightmap)
if (mod->terrain)
{
HeightMap_Purge(mod);
Terr_PurgeTerrainModel(mod, false);
mod->terrain = NULL;
}
#endif
@ -667,10 +667,15 @@ model_t *RMod_LoadModel (model_t *mod, qboolean crash)
while (replstr)
{
replstr = COM_ParseStringSet(replstr);
if (replstr)
{
TRACE(("RMod_LoadModel: Trying to load (replacement) model \"%s.%s\"\n", mdlbase, com_token));
buf = (unsigned *)COM_LoadStackFile (va("%s.%s", mdlbase, com_token), stackbuf, sizeof(stackbuf));
}
else
{
TRACE(("RMod_LoadModel: Trying to load model \"%s\"\n", mod->name));
buf = (unsigned *)COM_LoadStackFile (mod->name, stackbuf, sizeof(stackbuf));
if (!buf)
{
@ -678,6 +683,7 @@ model_t *RMod_LoadModel (model_t *mod, qboolean crash)
if (doomsprite) // special case needed for doom sprites
{
mod->needload = false;
TRACE(("RMod_LoadModel: doomsprite: \"%s\"\n", mod->name));
RMod_LoadDoomSprite(mod);
return mod;
}
@ -703,12 +709,14 @@ model_t *RMod_LoadModel (model_t *mod, qboolean crash)
//The binary 3d mesh model formats
case RAPOLYHEADER:
case IDPOLYHEADER:
TRACE(("RMod_LoadModel: Q1 mdl\n"));
if (!Mod_LoadQ1Model(mod, buf))
continue;
break;
#ifdef MD2MODELS
case MD2IDALIASHEADER:
TRACE(("RMod_LoadModel: md2\n"));
if (!Mod_LoadQ2Model(mod, buf))
continue;
break;
@ -716,6 +724,7 @@ model_t *RMod_LoadModel (model_t *mod, qboolean crash)
#ifdef MD3MODELS
case MD3_IDENT:
TRACE(("RMod_LoadModel: md3\n"));
if (!Mod_LoadQ3Model (mod, buf))
continue;
break;
@ -723,6 +732,7 @@ model_t *RMod_LoadModel (model_t *mod, qboolean crash)
#ifdef HALFLIFEMODELS
case (('T'<<24)+('S'<<16)+('D'<<8)+'I'):
TRACE(("RMod_LoadModel: HL mdl\n"));
if (!Mod_LoadHLModel (mod, buf))
continue;
break;
@ -731,12 +741,14 @@ model_t *RMod_LoadModel (model_t *mod, qboolean crash)
//Binary skeletal model formats
#ifdef ZYMOTICMODELS
case (('O'<<24)+('M'<<16)+('Y'<<8)+'Z'):
TRACE(("RMod_LoadModel: zym\n"));
if (!Mod_LoadZymoticModel(mod, buf))
continue;
break;
#endif
#ifdef DPMMODELS
case (('K'<<24)+('R'<<16)+('A'<<8)+'D'):
TRACE(("RMod_LoadModel: dpm\n"));
if (!Mod_LoadDarkPlacesModel(mod, buf))
continue;
break;
@ -744,6 +756,7 @@ model_t *RMod_LoadModel (model_t *mod, qboolean crash)
#ifdef PSKMODELS
case ('A'<<0)+('C'<<8)+('T'<<16)+('R'<<24):
TRACE(("RMod_LoadModel: psk\n"));
if (!Mod_LoadPSKModel (mod, buf))
continue;
break;
@ -751,6 +764,7 @@ model_t *RMod_LoadModel (model_t *mod, qboolean crash)
#ifdef INTERQUAKEMODELS
case ('I'<<0)+('N'<<8)+('T'<<16)+('E'<<24):
TRACE(("RMod_LoadModel: IQM\n"));
if (!Mod_LoadInterQuakeModel (mod, buf))
continue;
break;
@ -759,12 +773,14 @@ model_t *RMod_LoadModel (model_t *mod, qboolean crash)
//Binary Sprites
#ifdef SP2MODELS
case IDSPRITE2HEADER:
TRACE(("RMod_LoadModel: q2 sp2\n"));
if (!RMod_LoadSprite2Model (mod, buf))
continue;
break;
#endif
case IDSPRITEHEADER:
TRACE(("RMod_LoadModel: q1 spr\n"));
if (!RMod_LoadSpriteModel (mod, buf))
continue;
break;
@ -775,6 +791,7 @@ model_t *RMod_LoadModel (model_t *mod, qboolean crash)
case ('F'<<0)+('B'<<8)+('S'<<16)+('P'<<24):
case ('R'<<0)+('B'<<8)+('S'<<16)+('P'<<24):
case IDBSPHEADER: //looks like id switched to have proper ids
TRACE(("RMod_LoadModel: q2/q3/raven/fusion bsp\n"));
if (!Mod_LoadQ2BrushModel (mod, buf))
continue;
break;
@ -782,6 +799,7 @@ model_t *RMod_LoadModel (model_t *mod, qboolean crash)
#ifdef MAP_DOOM
case (('D'<<24)+('A'<<16)+('W'<<8)+'I'): //the id is hacked by the FS .wad loader (main wad).
case (('D'<<24)+('A'<<16)+('W'<<8)+'P'): //the id is hacked by the FS .wad loader (patch wad).
TRACE(("RMod_LoadModel: doom iwad/pwad map\n"));
if (!Mod_LoadDoomLevel (mod))
continue;
break;
@ -791,6 +809,7 @@ model_t *RMod_LoadModel (model_t *mod, qboolean crash)
case 29: //q1
case 28: //prerel
case BSPVERSION_LONG:
TRACE(("RMod_LoadModel: hl/q1 bsp\n"));
if (!RMod_LoadBrushModel (mod, buf))
continue;
break;
@ -802,12 +821,14 @@ model_t *RMod_LoadModel (model_t *mod, qboolean crash)
#ifdef MD5MODELS
if (!strcmp(com_token, "MD5Version")) //doom3 format, text based, skeletal
{
TRACE(("RMod_LoadModel: md5mesh/md5anim\n"));
if (!Mod_LoadMD5MeshModel (mod, buf))
continue;
break;
}
if (!strcmp(com_token, "EXTERNALANIM")) //custom format, text based, specifies skeletal models to load and which md5anim files to use.
{
TRACE(("RMod_LoadModel: blurgh\n"));
if (!Mod_LoadCompositeAnim (mod, buf))
continue;
break;
@ -816,6 +837,7 @@ model_t *RMod_LoadModel (model_t *mod, qboolean crash)
#ifdef MAP_PROC
if (!strcmp(com_token, "CM")) //doom3 map.
{
TRACE(("RMod_LoadModel: doom3 CM\n"));
if (!D3_LoadMap_CollisionMap (mod, (char*)buf))
continue;
break;
@ -824,7 +846,8 @@ model_t *RMod_LoadModel (model_t *mod, qboolean crash)
#ifdef TERRAIN
if (!strcmp(com_token, "terrain")) //custom format, text based.
{
if (!GL_LoadHeightmapModel(mod, buf))
TRACE(("RMod_LoadModel: terrain\n"));
if (!Terr_LoadTerrainModel(mod, buf))
continue;
break;
}
@ -837,6 +860,8 @@ model_t *RMod_LoadModel (model_t *mod, qboolean crash)
P_LoadedModel(mod);
Validation_IncludeFile(mod->name, (char *)buf, com_filesize);
TRACE(("RMod_LoadModel: Loaded\n"));
return mod;
}
@ -3816,6 +3841,7 @@ qboolean RMod_LoadBrushModel (model_t *mod, void *buffer)
crouchhullfile = NULL;
TRACE(("Loading info\n"));
#ifndef CLIENTONLY
if (sv.state) //if the server is running
{
@ -3832,38 +3858,61 @@ qboolean RMod_LoadBrushModel (model_t *mod, void *buffer)
// load into heap
if (!isDedicated || ode)
{
TRACE(("Loading verts\n"));
noerrors = noerrors && RMod_LoadVertexes (&header->lumps[LUMP_VERTEXES]);
TRACE(("Loading edges\n"));
noerrors = noerrors && RMod_LoadEdges (&header->lumps[LUMP_EDGES], longm);
TRACE(("Loading Surfedges\n"));
noerrors = noerrors && RMod_LoadSurfedges (&header->lumps[LUMP_SURFEDGES]);
}
if (!isDedicated)
{
TRACE(("Loading Textures\n"));
noerrors = noerrors && RMod_LoadTextures (&header->lumps[LUMP_TEXTURES]);
TRACE(("Loading Lighting\n"));
if (noerrors)
RMod_LoadLighting (&header->lumps[LUMP_LIGHTING]);
}
TRACE(("Loading Submodels\n"));
noerrors = noerrors && RMod_LoadSubmodels (&header->lumps[LUMP_MODELS]);
if (noerrors)
{
TRACE(("Loading CH\n"));
RMod_LoadCrouchHull();
}
TRACE(("Loading Planes\n"));
noerrors = noerrors && RMod_LoadPlanes (&header->lumps[LUMP_PLANES]);
if (!isDedicated || ode)
{
TRACE(("Loading Texinfo\n"));
noerrors = noerrors && RMod_LoadTexinfo (&header->lumps[LUMP_TEXINFO]);
TRACE(("Loading Faces\n"));
noerrors = noerrors && RMod_LoadFaces (&header->lumps[LUMP_FACES], longm, &meshlist);
}
if (!isDedicated)
{
TRACE(("Loading MarkSurfaces\n"));
noerrors = noerrors && RMod_LoadMarksurfaces (&header->lumps[LUMP_MARKSURFACES], longm);
}
if (noerrors)
{
TRACE(("Loading Vis\n"));
RMod_LoadVisibility (&header->lumps[LUMP_VISIBILITY]);
}
noerrors = noerrors && RMod_LoadLeafs (&header->lumps[LUMP_LEAFS], longm);
TRACE(("Loading Nodes\n"));
noerrors = noerrors && RMod_LoadNodes (&header->lumps[LUMP_NODES], longm);
TRACE(("Loading Clipnodes\n"));
noerrors = noerrors && RMod_LoadClipnodes (&header->lumps[LUMP_CLIPNODES], longm);
if (noerrors)
{
TRACE(("Loading Entities\n"));
RMod_LoadEntities (&header->lumps[LUMP_ENTITIES]);
TRACE(("Loading hull 0\n"));
RMod_MakeHull0 ();
}
TRACE(("sorting shaders\n"));
if (!isDedicated && noerrors)
Mod_SortShaders();
@ -3879,8 +3928,11 @@ qboolean RMod_LoadBrushModel (model_t *mod, void *buffer)
return false;
}
TRACE(("LoadBrushModel %i\n", __LINE__));
Q1BSP_LoadBrushes(mod);
TRACE(("LoadBrushModel %i\n", __LINE__));
Q1BSP_SetModelFuncs(mod);
TRACE(("LoadBrushModel %i\n", __LINE__));
mod->funcs.LightPointValues = GLQ1BSP_LightPointValues;
mod->funcs.StainNode = Q1BSP_StainNode;
mod->funcs.MarkLights = Q1BSP_MarkLights;
@ -3899,7 +3951,7 @@ qboolean RMod_LoadBrushModel (model_t *mod, void *buffer)
mod->hulls[0].available = true;
Q1BSP_CheckHullNodes(&mod->hulls[0]);
TRACE(("LoadBrushModel %i\n", __LINE__));
for (j=1 ; j<MAX_MAP_HULLSM ; j++)
{
mod->hulls[j].firstclipnode = bm->headnode[j];
@ -3925,10 +3977,12 @@ qboolean RMod_LoadBrushModel (model_t *mod, void *buffer)
memset(&mod->batches, 0, sizeof(mod->batches));
mod->vbos = NULL;
TRACE(("LoadBrushModel %i\n", __LINE__));
if (meshlist)
{
RMod_Batches_Build(meshlist, mod, NULL, NULL);
}
TRACE(("LoadBrushModel %i\n", __LINE__));
if (i < mod->numsubmodels-1)
{ // duplicate the basic information
@ -3940,15 +3994,21 @@ qboolean RMod_LoadBrushModel (model_t *mod, void *buffer)
strcpy (loadmodel->name, name);
mod = loadmodel;
}
TRACE(("LoadBrushModel %i\n", __LINE__));
}
#ifdef RUNTIMELIGHTING
TRACE(("LoadBrushModel %i\n", __LINE__));
if (lightmodel == lm)
LightLoadEntities(lightmodel->entities);
#endif
TRACE(("LoadBrushModel %i\n", __LINE__));
if (1)
RMod_FixupMinsMaxs();
TRACE(("LoadBrushModel %i\n", __LINE__));
#ifdef TERRAIN
lm->terrain = Mod_LoadTerrainInfo(lm, loadname);
#endif
return true;
}

View file

@ -665,8 +665,7 @@ void GLR_DrawPortal(batch_t *batch, batch_t **blist, int portaltype)
if (DotProduct(r_refdef.vieworg, plane.normal)-plane.dist < 0)
return;
//if (!view)
// return;
TRACE(("GLR_DrawPortal: portal type %i\n", portaltype));
oldrefdef = r_refdef;
r_refdef.recurse = true;
@ -824,6 +823,8 @@ void GLR_DrawPortal(batch_t *batch, batch_t **blist, int portaltype)
GL_CullFace(0);
TRACE(("GLR_DrawPortal: portal drawn\n"));
#ifdef warningmsg
#pragma warningmsg("warning: there's a bug with rtlights in portals, culling is broken or something. May also be loading the wrong matrix")
#endif

View file

@ -188,9 +188,6 @@ void GLSCR_UpdateScreen (void)
{
extern char levelshotname[];
if ((key_dest == key_console || key_dest == key_game) && SCR_GetLoadingStage() == LS_NONE)
scr_con_current = scr_conlines = vid.height;
//draw the levelshot or the conback fullscreen
if (*levelshotname)
R2D_ScalePic(0, 0, vid.width, vid.height, R2D_SafeCachePic (levelshotname));

View file

@ -3358,11 +3358,14 @@ static qboolean Shader_Parsetok (shader_t *shader, shaderpass_t *pass, shaderkey
}
}
// Con_Printf("Unknown shader directive: \"%s\"\n", token);
// Next Line
while (ptr)
{
token = COM_ParseExt ( ptr, false );
if ( !token[0] ) {
if ( !token[0] )
{
break;
}
}

View file

@ -1568,12 +1568,12 @@ static qboolean Sh_ScissorForBox(vec3_t mins, vec3_t maxs, srect_t *r)
x2 = 0;
if (y2 < 0)
y2 = 0;
if (x1 > r_refdef.vrect.width)
x1 = r_refdef.vrect.width;
if (x1 > r_refdef.vrect.width * vid.pixelwidth / vid.width)
x1 = r_refdef.vrect.width * vid.pixelwidth / vid.width;
if (y1 > r_refdef.vrect.height * vid.pixelheight / vid.height)
y1 = r_refdef.vrect.height * vid.pixelheight / vid.height;
if (x2 > r_refdef.vrect.width)
x2 = r_refdef.vrect.width;
if (x2 > r_refdef.vrect.width * vid.pixelwidth / vid.width)
x2 = r_refdef.vrect.width * vid.pixelwidth / vid.width;
if (y2 > r_refdef.vrect.height * vid.pixelheight / vid.height)
y2 = r_refdef.vrect.height * vid.pixelheight / vid.height;
r->x = floor(x1);

View file

@ -2210,8 +2210,9 @@ void Doom_MarkLights(struct dlight_s *light, int bit, struct mnode_s *node)
void Doom_SetModelFunc(model_t *mod)
{
#ifndef SERVERONLY
mod->funcs.PurgeModel = Doom_Purge;
#endif
mod->funcs.FatPVS = Doom_FatPVS;
mod->funcs.EdictInFatPVS = Doom_EdictInFatPVS;
mod->funcs.FindTouchedLeafs = Doom_FindTouchedLeafs;

View file

@ -407,9 +407,11 @@ void R_SaveRTLights_f(void);
// gl_heightmap.c
//
#ifdef TERRAIN
void GL_DrawHeightmapModel (batch_t **batch, entity_t *e);
qboolean GL_LoadHeightmapModel (model_t *mod, void *buffer);
void HeightMap_Purge(model_t *mod);
void Terr_DrawTerrainModel (batch_t **batch, entity_t *e);
qboolean Terr_LoadTerrainModel (model_t *mod, void *buffer);
void Terr_PurgeTerrainModel(model_t *mod, qboolean lightmapsonly);
void *Mod_LoadTerrainInfo(model_t *mod, char *loadname); //call this after loading a bsp
qboolean Heightmap_Trace(model_t *model, int forcehullnum, int frame, vec3_t axis[3], vec3_t start, vec3_t end, vec3_t mins, vec3_t maxs, unsigned int contentmask, trace_t *trace);
#endif
//doom

View file

@ -1101,3 +1101,49 @@ YOU SHOULD NOT EDIT THIS FILE BY HAND
"#endif\n"
},
#endif
#ifdef GLQUAKE
{QR_OPENGL, 110, "terrain",
"!!permu FOG\n"
"#include \"sys/fog.h\"\n"
"varying vec2 tc;\n"
"varying vec2 lm;\n"
"#ifdef VERTEX_SHADER\n"
"attribute vec2 v_texcoord;\n"
"attribute vec2 v_lmcoord;\n"
"void main (void)\n"
"{\n"
"tc = v_texcoord.st;\n"
"lm = v_lmcoord.st;\n"
"gl_Position = ftetransform();\n"
"}\n"
"#endif\n"
"#ifdef FRAGMENT_SHADER\n"
//four texture passes
"uniform sampler2D s_t0;\n"
"uniform sampler2D s_t1;\n"
"uniform sampler2D s_t2;\n"
"uniform sampler2D s_t3;\n"
//mix values
"uniform sampler2D s_t4;\n"
"void main (void)\n"
"{\n"
"vec4 m = texture2D(s_t4, lm);\n"
"gl_FragColor = fog4(\n"
"texture2D(s_t0, tc)*m.r\n"
"+ texture2D(s_t1, tc)*m.g\n"
"+ texture2D(s_t2, tc)*m.b\n"
"+ texture2D(s_t3, tc)*(1.0 - (m.r + m.g + m.b))\n"
");\n"
"}\n"
"#endif\n"
},
#endif

View file

@ -327,6 +327,8 @@ r_part tr_knightspike
friction 4
scalefactor 0.825
blend add
spawnmode spiral
spawnvel -50
}
/////////////////////////////////////////
@ -361,46 +363,91 @@ r_trail "progs/v_spike.mdl" tr_vorespike
//{
//}
r_part te_blood
{
texture fte_bloodparticle
blend subtract
count 1
scale 32
alpha 0
die 1
randomvel 64
veladd 10
rotationspeed 90
rotationstart 0 360
rgb 64 128 128
rgbdelta -64 -128 -128
gravity 200
scalefactor 0.8
// scaledelta -10
}
r_part pe_73
{
assoc te_blood
}
r_part te_lightningblood
{
texture fte_bloodparticle
blend subtract
count 1
scale 32
alpha 0
die 1
randomvel 64
veladd 10
rotationspeed 90
rotationstart 0 360
rgb 0 128 128
rgbdelta 0 -128 -128
gravity 200
scalefactor 0.8
}
/////////////////////////////////////////
//zombie body-part blood trails
r_part tr_slightblood
{
texture "particles/fteparticlefont.tga"
tcoords 1 1 63 63 256 2 64
texture fte_bloodparticle
blend subtract
// tcoords 1 1 63 63 256 2 64
step 16
scale 64
alpha 0.6
alpha 0
die 1
randomvel 32
veladd 10
rotationspeed 90
rotationstart 0 360
rgb 32 0 0
rgb 64 128 128
rgbdelta -64 -128 -128
gravity 200
scalefactor 0.8
scaledelta -10
stains 5
stains -0.5
}
//////////////////////////////////////////
//regular ol' blood trails
r_part tr_blood
{
texture "particles/fteparticlefont.tga"
tcoords 1 1 63 63 256 2 64
step 4
texture fte_bloodparticle
blend subtract
step 8
scale 64
alpha 0.3
alpha 0
die 1
randomvel 32
veladd 10
rotationspeed 90
rotationstart 0 360
rgb 64 0 0
rgb 32 128 128
rgbdelta -32 -128 -128
gravity 200
scalefactor 0.8
scaledelta -10
stains 5
stains -0.5
}
//////////////////////////////////
@ -432,6 +479,8 @@ r_part pe_defaulttrail
randomvel 2
friction 4
scalefactor 0.825
spawnmode spiral
spawnvel 25
blend add
}

View file

@ -26,6 +26,7 @@ char shaders[][64] =
"postproc_panorama",
"rtlight",
"underwaterwarp",
"terrain",
""
};

View file

@ -0,0 +1,42 @@
!!permu FOG
#include "sys/fog.h"
varying vec2 tc;
varying vec2 lm;
#ifdef VERTEX_SHADER
attribute vec2 v_texcoord;
attribute vec2 v_lmcoord;
void main (void)
{
tc = v_texcoord.st;
lm = v_lmcoord.st;
gl_Position = ftetransform();
}
#endif
#ifdef FRAGMENT_SHADER
//four texture passes
uniform sampler2D s_t0;
uniform sampler2D s_t1;
uniform sampler2D s_t2;
uniform sampler2D s_t3;
//mix values
uniform sampler2D s_t4;
void main (void)
{
vec4 m = texture2D(s_t4, lm);
gl_FragColor = fog4(
texture2D(s_t0, tc)*m.r
+ texture2D(s_t1, tc)*m.g
+ texture2D(s_t2, tc)*m.b
+ texture2D(s_t3, tc)*(1.0 - (m.r + m.g + m.b))
);
}
#endif

View file

@ -751,6 +751,7 @@ void SW_Draw_Init(void)
}
void SW_Draw_Shutdown(void)
{
R2D_Shutdown();
}
void SW_R_Init(void)
{