From 5a7f34bd50c9638291cfe1d1e1a105e0dcad4cf7 Mon Sep 17 00:00:00 2001 From: Spoike Date: Mon, 5 Sep 2011 01:48:23 +0000 Subject: [PATCH] Couple of tweeks, breakages, and fixes. git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@3898 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/Makefile | 31 +++++++++++++++++++++----- engine/client/cl_input.c | 7 +++--- engine/client/cl_parse.c | 2 ++ engine/client/in_morphos.c | 5 ----- engine/client/in_sdl.c | 3 --- engine/client/in_win.c | 10 --------- engine/client/input.h | 2 -- engine/client/keys.h | 2 ++ engine/client/render.h | 2 +- engine/client/snd_dma.c | 13 ++++++++++- engine/common/bothdefs.h | 17 ++++++++++---- engine/common/common.c | 5 ++++- engine/common/fs_stdio.c | 38 ++++++++++++++++++++++++++------ engine/common/protocol.h | 2 -- engine/gl/gl_backend.c | 23 +++++++++++++++---- engine/gl/gl_draw.c | 45 +++++++++++++++++++++----------------- engine/gl/gl_ngraph.c | 10 ++++++--- engine/gl/gl_rmain.c | 34 +++++++++++++++++----------- engine/gl/gl_rsurf.c | 2 +- engine/gl/gl_shader.c | 2 +- engine/gl/gl_vidcommon.c | 2 +- engine/gl/gl_videgl.h | 1 + engine/gl/gl_vidlinuxglx.c | 18 ++++++--------- engine/gl/gl_vidmacos.c | 1 - engine/gl/gl_vidnull.c | 7 ------ engine/gl/gl_vidsdl.c | 4 ---- engine/gl/glquake.h | 31 +++++++++++++++++++++++++- engine/gl/glsupp.h | 30 ++++++++++++------------- engine/gl/shader.h | 3 ++- engine/server/sv_main.c | 4 ++-- engine/server/sv_send.c | 2 +- engine/server/sv_user.c | 6 ++--- 32 files changed, 230 insertions(+), 134 deletions(-) diff --git a/engine/Makefile b/engine/Makefile index 58b7ef237..48c07a71e 100644 --- a/engine/Makefile +++ b/engine/Makefile @@ -53,6 +53,14 @@ ifeq ($(FTE_TARGET),win32_sdl) FTE_TARGET=win32_SDL endif +ifeq ($(FTE_TARGET),droid) + + CC=~/droid/android-ndk-r6b/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-gcc -I ~/droid/android-ndk-r6b/platforms/android-9/arch-arm/usr/include/ -I ~/droid/android-ndk-r6b/sources/android/native_app_glue/ -DANDROID + STRIP=~/droid/android-ndk-r6b/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-strip + DO_LD=~/droid/android-ndk-r6b/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-ar -r $@ + +endif + #correct the gcc build when cross compiling ifeq ($(FTE_TARGET),win32_SDL) ifeq ($(shell $(CC) -v 2>&1 | grep mingw),) @@ -348,7 +356,6 @@ CLIENT_OBJS = \ pr_menu.o GLQUAKE_OBJS = \ - gl_alias.o \ gl_draw.o \ gl_model.o \ gl_ngraph.o \ @@ -381,7 +388,6 @@ D3DONLY_OBJS = \ gl_model.o \ gl_shader.o \ gl_rlight.o \ - gl_alias.o \ gl_warp.o \ ltface.o \ r_surf.o \ @@ -442,16 +448,15 @@ SERVER_OBJS = \ httpserver.o SERVERONLY_OBJS = \ - gl_alias.o \ svmodel.o \ sv_sys_unix.o WINDOWSSERVERONLY_OBJS = \ - gl_alias.o \ svmodel.o \ sv_sys_win.o COMMON_OBJS = \ + gl_alias.o \ com_mesh.o \ com_phys_ode.o \ common.o \ @@ -826,6 +831,22 @@ ifeq ($(FTE_TARGET),cygwin) MINGL_DIR=mingl_cygwin endif +ifeq ($(FTE_TARGET),droid) + BASELDFLAGS= + + SV_DIR=sv_droid + SV_LDFLAGS=-lz + SV_OBJS=$(COMMON_OBJS) $(SERVER_OBJS) $(PROGS_OBJS) svmodel.o sys_droid.o + SV_EXE_NAME=../fteqw.a$(BITS) + + SV_LDFLAGS= + + GLCL_OBJS=$(GL_OBJS) $(GLQUAKE_OBJS) gl_viddroid.o sys_droid.o cd_null.o + GL_LDFLAGS=$(GLLDFLAGS) + GLB_DIR=gl_droid + GL_EXE_NAME=../fteqw.a$(BITS) +endif + SV_DIR?=sv_sdl .default: help @@ -919,7 +940,7 @@ PRECOMPHEADERS ?= $(OUT_DIR)/quakedef.h.gch DO_LD ?= $(CC) -o $@ $(LTO_LD) $(WCFLAGS) $(CFLAGS) $(OUT_DIR)/$(EXE_NAME): $(PRECOMPHEADERS) $(foreach fn, $(CUSTOMOBJS) $(foreach ol, $(OBJS), $($(ol))),$(if $(findstring ltox,$(fn)),,$(OUT_DIR)/$(fn))) - $(DO_LD) $(foreach fn, $(CUSTOMOBJS) $(foreach ol, $(OBJS) $(LTO_END), $($(ol))),$(if $(findstring ltox,$(fn)),$(subst ltox,-x ,$(fn)),$(OUT_DIR)/$(fn)) ) -x none $(LDFLAGS) + $(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)" diff --git a/engine/client/cl_input.c b/engine/client/cl_input.c index 52873049b..10d1b046a 100644 --- a/engine/client/cl_input.c +++ b/engine/client/cl_input.c @@ -40,6 +40,7 @@ cvar_t cl_smartjump = CVAR("cl_smartjump", "1"); cvar_t cl_prydoncursor = CVAR("cl_prydoncursor", ""); //for dp protocol cvar_t cl_instantrotate = CVARF("cl_instantrotate", "1", CVAR_SEMICHEAT); +cvar_t in_xflip = {"in_xflip", "0"}; cvar_t prox_inmenu = CVAR("prox_inmenu", "0"); @@ -572,10 +573,7 @@ void CL_BaseMove (usercmd_t *cmd, int pnum, float extra, float wantfps) cmd->sidemove += scale*cl_sidespeed.value * CL_KeyState (&in_moveright, pnum); cmd->sidemove -= scale*cl_sidespeed.value * CL_KeyState (&in_moveleft, pnum); -#ifdef IN_XFLIP if(in_xflip.ival) cmd->sidemove *= -1; -#endif - cmd->upmove += scale*cl_upspeed.value * CL_KeyState (&in_up, pnum); cmd->upmove -= scale*cl_upspeed.value * CL_KeyState (&in_down, pnum); @@ -1653,7 +1651,7 @@ void CL_SendCmd (double frametime, qboolean mainloop) dropcount = 0; } -#ifdef PEXT2_VOICECHAT +#ifdef VOICECHAT S_Voip_Transmit(clc_voicechat, &buf); #endif @@ -1717,6 +1715,7 @@ void CL_InitInput (void) Cmd_AddCommand("in_restart", IN_Restart); Cmd_AddCommand("sendcvar", CL_SendCvar_f); + Cvar_Register (&in_xflip, inputnetworkcvargroup); Cvar_Register (&cl_nodelta, inputnetworkcvargroup); Cvar_Register (&prox_inmenu, inputnetworkcvargroup); diff --git a/engine/client/cl_parse.c b/engine/client/cl_parse.c index e5b69cd18..23ef6f5ad 100644 --- a/engine/client/cl_parse.c +++ b/engine/client/cl_parse.c @@ -1087,6 +1087,7 @@ int CL_LoadModels(int stage, qboolean dontactuallyload) endstage(); } +#ifdef CSQC_DAT if (atstage()) { if (CSQC_Inited()) @@ -1099,6 +1100,7 @@ int CL_LoadModels(int stage, qboolean dontactuallyload) } endstage(); } +#endif return stage; } diff --git a/engine/client/in_morphos.c b/engine/client/in_morphos.c index aeb58684a..c9df9920d 100644 --- a/engine/client/in_morphos.c +++ b/engine/client/in_morphos.c @@ -33,8 +33,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "in_morphos.h" -cvar_t in_xflip = {"in_xflip", "0"}; - struct InputEvent imsgs[MAXIMSGS]; extern struct IntuitionBase *IntuitionBase; extern struct Window *window; @@ -126,7 +124,6 @@ void IN_ReInit() void IN_Init(void) { - Cvar_Register (&in_xflip, "input controls"); IN_ReInit(); } @@ -247,9 +244,7 @@ void IN_Move (float *movements, int pnum) old_mouse_x = mouse_x; old_mouse_y = mouse_y; -#ifdef IN_XFLIP if(in_xflip.value) mouse_x *= -1; -#endif if (Key_MouseShouldBeFree()) { diff --git a/engine/client/in_sdl.c b/engine/client/in_sdl.c index ebb168bb5..8d5ba1a1c 100644 --- a/engine/client/in_sdl.c +++ b/engine/client/in_sdl.c @@ -294,9 +294,6 @@ void IN_ReInit (void) void IN_Init (void) { -#ifdef IN_XFLIP - Cvar_Register (&in_xflip, "Input Controls"); -#endif IN_ReInit(); } void IN_Move (float *movements, int pnum) //add mouse movement to cmd diff --git a/engine/client/in_win.c b/engine/client/in_win.c index 040a40b32..c741a4f07 100644 --- a/engine/client/in_win.c +++ b/engine/client/in_win.c @@ -128,10 +128,6 @@ DWORD dwAxisMap[JOY_MAX_AXES]; DWORD dwControlMap[JOY_MAX_AXES]; PDWORD pdwRawValue[JOY_MAX_AXES]; -#ifdef IN_XFLIP -cvar_t in_xflip = SCVAR("in_xflip", "0"); -#endif - // none of these cvars are saved over a session // this means that advanced controller configuration needs to be executed // each time. this avoids any problems with getting back to a default usage @@ -1135,10 +1131,6 @@ void IN_Init (void) if (COM_CheckParm ("-dinput")) Cvar_Set(&in_dinput, "1"); -#ifdef IN_XFLIP - Cvar_Register (&in_xflip, "Input stuff"); -#endif - // joystick variables Cvar_Register (&in_joystick, "Joystick variables"); @@ -1304,9 +1296,7 @@ static void ProcessMouse(mouse_t *mouse, float *movements, int pnum) mouse->delta[1]=0; -#ifdef IN_XFLIP if(in_xflip.value) mx *= -1; -#endif mousemove_x += mx; mousemove_y += my; diff --git a/engine/client/input.h b/engine/client/input.h index b6545c704..3a93d986f 100644 --- a/engine/client/input.h +++ b/engine/client/input.h @@ -36,9 +36,7 @@ void IN_ModeChanged (void); void IN_ClearStates (void); void IN_Accumulate (void); -#ifdef IN_XFLIP extern cvar_t in_xflip; -#endif #ifdef _SDL void IN_ActivateMouse(void); diff --git a/engine/client/keys.h b/engine/client/keys.h index 090a6259e..798a84584 100644 --- a/engine/client/keys.h +++ b/engine/client/keys.h @@ -163,6 +163,8 @@ K_MAX = 256 #define K_RSHIFT K_SHIFT #define K_RCTRL K_CTRL #define K_LCTRL K_CTRL +#define K_RALT K_CTRL +#define K_LALT K_CTRL typedef enum {key_game, key_console, key_message, key_menu, key_editor} keydest_t; diff --git a/engine/client/render.h b/engine/client/render.h index e33843b5e..99d8769f8 100644 --- a/engine/client/render.h +++ b/engine/client/render.h @@ -39,7 +39,7 @@ static const texid_t r_nulltex = {0}; #define TEXVALID(t) ((t).num!=0) -#ifdef D3DQUAKE +#if defined(D3DQUAKE) || defined(ANDROID) #define sizeof_index_t 2 #endif #if sizeof_index_t == 2 diff --git a/engine/client/snd_dma.c b/engine/client/snd_dma.c index 6d45c2a9f..6c83651bb 100644 --- a/engine/client/snd_dma.c +++ b/engine/client/snd_dma.c @@ -307,7 +307,7 @@ static qboolean S_Speex_Init(void) void S_Voip_Parse(void) { unsigned int sender; - int bytes; + unsigned int bytes; unsigned char data[1024], *start; short decodebuf[1024]; unsigned int decodesamps, len, newseq, drops; @@ -599,6 +599,17 @@ qboolean S_Voip_Speaking(unsigned int plno) return false; return s_speex.lastspoke[plno] > realtime; } +#else +void S_Voip_Parse(void) +{ + unsigned int bytes; + + MSG_ReadByte(); + MSG_ReadByte(); + MSG_ReadByte(); + bytes = MSG_ReadShort(); + MSG_ReadSkip(bytes); +} #endif diff --git a/engine/common/bothdefs.h b/engine/common/bothdefs.h index d860e4ddb..4922fcc7a 100644 --- a/engine/common/bothdefs.h +++ b/engine/common/bothdefs.h @@ -45,6 +45,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define MINGW //Erm, why is this happening? #endif +#ifdef ANDROID + #define NO_PNG + #define NO_JPEG + #define NO_OGG +#endif + #ifdef HAVE_CONFIG_H //if it was configured properly, then we have a more correct list of features we want to use. #include "config.h" #else @@ -187,9 +193,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // #define QTERM //qterm... adds a console command that allows running programs from within quake - bit like xterm. #define CL_MASTER //query master servers and stuff for a dynamic server listing. #define R_XFLIP //allow view to be flipped horizontally -#ifndef NO_XFLIP - #define IN_XFLIP //allow input to be flipped horizontally. -#endif #define TEXTEDITOR #define PPL //per pixel lighting (stencil shadowing) #define DDS //a sort of image file format. @@ -215,13 +218,19 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define PSET_CLASSIC //#define PSET_DARKPLACES - #define VOICECHAT //not added yet. + #define VOICECHAT //these things were moved to plugins. #endif #endif +#ifdef ANDROID +#undef RTLIGHTS +#undef VOICECHAT +#undef TEXTEDITOR +#endif + //fix things a little... #ifdef NPQTV diff --git a/engine/common/common.c b/engine/common/common.c index 9f361fbbc..fe7a967e5 100644 --- a/engine/common/common.c +++ b/engine/common/common.c @@ -3009,7 +3009,10 @@ void COM_InitArgv (int argc, const char **argv) //not allowed to tprint FILE *f; - f = fopen(va("%s_p.txt", argv[0]), "rb"); + if (argv && argv[0]) + f = fopen(va("%s_p.txt", argv[0]), "rb"); + else + f = NULL; if (f) { char *buffer; diff --git a/engine/common/fs_stdio.c b/engine/common/fs_stdio.c index 6dd1cde91..0d6883e2f 100644 --- a/engine/common/fs_stdio.c +++ b/engine/common/fs_stdio.c @@ -84,6 +84,10 @@ vfsfile_t *FSSTDIO_OpenTemp(void) return (vfsfile_t*)file; } +#ifdef ANDROID +vfsfile_t *Sys_OpenAsset(const char *fname); +#endif + vfsfile_t *VFSSTDIO_Open(const char *osname, const char *mode) { FILE *f; @@ -95,6 +99,15 @@ vfsfile_t *VFSSTDIO_Open(const char *osname, const char *mode) char newmode[3]; int modec = 0; +#ifdef ANDROID +// if (!strncmp("asset/", osname, 6)) + { + if (append || write) + return NULL; + return Sys_OpenAsset(osname); + } +#endif + if (read) newmode[modec++] = 'r'; if (write) @@ -176,7 +189,6 @@ static void FSSTDIO_BuildHash(void *handle) } static qboolean FSSTDIO_FLocate(void *handle, flocation_t *loc, const char *filename, void *hashedresult) { - FILE *f; int len; char netpath[MAX_OSPATH]; @@ -195,13 +207,25 @@ static qboolean FSSTDIO_FLocate(void *handle, flocation_t *loc, const char *file // check a file in the directory tree snprintf (netpath, sizeof(netpath)-1, "%s/%s",(char*)handle, filename); - f = fopen(netpath, "rb"); - if (!f) - return false; +#ifdef ANDROID + { + vfsfile_t *f = VFSSTDIO_Open(netpath, "rb"); + if (!f) + return false; + len = VFS_GETLEN(f); + VFS_CLOSE(f); + } +#else + { + FILE *f = fopen(netpath, "rb"); + if (!f) + return false; - fseek(f, 0, SEEK_END); - len = ftell(f); - fclose(f); + fseek(f, 0, SEEK_END); + len = ftell(f); + fclose(f); + } +#endif if (loc) { loc->len = len; diff --git a/engine/common/protocol.h b/engine/common/protocol.h index d6bdcda6b..d4886f2d2 100644 --- a/engine/common/protocol.h +++ b/engine/common/protocol.h @@ -71,9 +71,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #endif #define PEXT2_PRYDONCURSOR 0x00000001 -#ifdef VOICECHAT #define PEXT2_VOICECHAT 0x00000002 -#endif #define PEXT2_SETANGLEDELTA 0x00000004 //#define PEXT2_64PLAYERS 0x02000000 //Client is able to cope with 64 players. Wow. //#define PEXT2_PK3DOWNLOADS 0x10000000 //retrieve a list of pk3s/pk3s/paks for downloading (with optional URL and crcs) diff --git a/engine/gl/gl_backend.c b/engine/gl/gl_backend.c index e09da84b9..2a5249a72 100644 --- a/engine/gl/gl_backend.c +++ b/engine/gl/gl_backend.c @@ -425,7 +425,12 @@ void GL_TexEnv(GLenum mode) if (mode != shaderstate.texenvmode[shaderstate.currenttmu]) #endif { +#ifdef ANDROID + /*android appears to have a bug, and requires f and not i*/ + qglTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, mode); +#else qglTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, mode); +#endif shaderstate.texenvmode[shaderstate.currenttmu] = mode; } } @@ -568,7 +573,9 @@ void GL_MTBind(int tmu, int target, texid_t texnum) if (target) bindTexFunc (target, texnum.num); +#ifndef FORCESTATE if (shaderstate.curtexturetype[tmu] != target && !gl_config.nofixedfunc) +#endif { if (shaderstate.curtexturetype[tmu]) qglDisable(shaderstate.curtexturetype[tmu]); @@ -577,7 +584,9 @@ void GL_MTBind(int tmu, int target, texid_t texnum) qglEnable(target); } +#ifndef FORCESTATE if (((shaderstate.tmuarrayactive>>tmu) & 1) != 0) +#endif { qglClientActiveTextureARB(tmu + mtexid0); if (0) @@ -605,7 +614,9 @@ void GL_LazyBind(int tmu, int target, texid_t texnum, qboolean arrays) if (target) bindTexFunc (target, texnum.num); +#ifndef FORCESTATE if (shaderstate.curtexturetype[tmu] != target && !gl_config.nofixedfunc) +#endif { if (shaderstate.curtexturetype[tmu]) qglDisable(shaderstate.curtexturetype[tmu]); @@ -618,7 +629,9 @@ void GL_LazyBind(int tmu, int target, texid_t texnum, qboolean arrays) if (!target) arrays = false; +#ifndef FORCESTATE if (((shaderstate.tmuarrayactive>>tmu) & 1) != arrays) +#endif { qglClientActiveTextureARB(mtexid0 + tmu); if (arrays) @@ -1915,7 +1928,7 @@ static void GenerateColourMods(const shaderpass_t *pass) qglShadeModel(GL_SMOOTH); return; } - if (pass->flags & SHADER_PASS_NOCOLORARRAY) + if (pass->flags & SHADER_PASS_NOCOLORARRAY && qglColor4fv) { avec4_t scol; @@ -2308,7 +2321,6 @@ static void DrawPass(const shaderpass_t *pass) } if (i == lastpass) return; - BE_SendPassBlendDepthMask(pass[i].shaderbits); GenerateColourMods(pass+i); tmu = 0; @@ -2823,15 +2835,15 @@ void BE_SelectFog(vec3_t colour, float alpha, float density) qglColor4f(colour[0], colour[1], colour[2], alpha); } -#ifdef RTLIGHTS void BE_SelectDLight(dlight_t *dl, vec3_t colour) { shaderstate.lightradius = dl->radius; VectorCopy(dl->origin, shaderstate.lightorg); VectorCopy(colour, shaderstate.lightcolours); +#ifdef RTLIGHTS shaderstate.curshadowmap = dl->stexture; -} #endif +} void BE_PushOffsetShadow(qboolean pushdepth) { @@ -3484,8 +3496,11 @@ void GLBE_DrawLightPrePass(qbyte *vis, batch_t **batches) BE_SelectEntity(&r_worldentity); GLBE_SubmitMeshes(true, batches, SHADER_SORT_SKY, SHADER_SORT_NEAREST); +#ifdef RTLIGHTS /*regular lighting now*/ + BE_SelectEntity(&r_worldentity); Sh_DrawLights(vis); +#endif shaderstate.tex_sourcecol = r_nulltex; shaderstate.tex_sourcedepth = r_nulltex; diff --git a/engine/gl/gl_draw.c b/engine/gl/gl_draw.c index b0ad0bd0e..66f30dad6 100644 --- a/engine/gl/gl_draw.c +++ b/engine/gl/gl_draw.c @@ -995,14 +995,13 @@ void GL_Upload32_Int (char *name, unsigned *data, int width, int height, unsigne } } } - TRACE(("dbg: GL_Upload32: %i %i\n", scaled_width, scaled_height)); if (scaled_width * scaled_height > sizeofuploadmemorybuffer/4) Sys_Error ("GL_LoadTexture: too big"); if (gl_config.gles) - samples = GL_RGBA; /* GL ES doesn't allow for format conversion */ + glcolormode = samples = GL_RGBA; /* GL ES doesn't allow for format conversion */ else samples = (flags&IF_NOALPHA) ? GL_RGB : GL_RGBA; @@ -1014,6 +1013,28 @@ void GL_Upload32_Int (char *name, unsigned *data, int width, int height, unsigne TRACE(("dbg: GL_Upload32: GL_SGIS_generate_mipmap\n")); qglTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP_SGIS, GL_TRUE); } + + if (!(flags&IF_NOMIPMAP)) + { + qglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, gl_filter_min); + qglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, gl_filter_max); + } + else + { + qglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, gl_filter_max_2d); + qglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, gl_filter_max_2d); + } + + if (flags&IF_CLAMP) + { + qglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); + qglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); + } + else + { + qglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT); + qglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT); + } if (scaled_width == width && scaled_height == height) { @@ -1100,28 +1121,12 @@ void GL_Upload32_Int (char *name, unsigned *data, int width, int height, unsigne } } done: - if (gl_config.sgis_generate_mipmap && !(flags&IF_NOMIPMAP)) - qglTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP_SGIS, GL_FALSE); if (gl_anisotropy_factor) qglTexParameterf (GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, gl_anisotropy_factor); // without this, you could loose anisotropy on mapchange - if (!(flags&IF_NOMIPMAP)) - { - qglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, gl_filter_min); - qglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, gl_filter_max); - } - else - { - qglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, gl_filter_max_2d); - qglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, gl_filter_max_2d); - } - - if (flags&IF_CLAMP) - { - qglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); - qglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); - } + if (gl_config.sgis_generate_mipmap && !(flags&IF_NOMIPMAP)) + qglTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP_SGIS, GL_FALSE); } void GL_Upload32 (char *name, unsigned *data, int width, int height, unsigned int flags) diff --git a/engine/gl/gl_ngraph.c b/engine/gl/gl_ngraph.c index 1849be4f4..004f15b07 100644 --- a/engine/gl/gl_ngraph.c +++ b/engine/gl/gl_ngraph.c @@ -117,8 +117,9 @@ void GLR_NetGraph (void) sprintf(st, "%3i%% packet loss", lost); Draw_FunString(8, y, st); y += 8; - - GL_MTBind(0, GL_TEXTURE_2D, netgraphtexture); + +#ifndef ANDROID + GL_MTBind(0, GL_TEXTURE_2D, netgraphtexture); qglTexImage2D (GL_TEXTURE_2D, 0, GL_RGBA, NET_TIMINGS, NET_GRAPHHEIGHT, 0, GL_RGBA, @@ -140,6 +141,7 @@ void GLR_NetGraph (void) qglTexCoord2f (0, 1); qglVertex2f (x, y+NET_GRAPHHEIGHT); qglEnd (); +#endif } void GLR_FrameTimeGraph (int frametime) @@ -177,7 +179,8 @@ void GLR_FrameTimeGraph (int frametime) sprintf(st, "%3i%% packet loss", lost); Draw_FunString(8, y, st); y += 8; - + +#ifndef ANDROID GL_MTBind(0, GL_TEXTURE_2D, netgraphtexture); qglTexImage2D (GL_TEXTURE_2D, 0, GL_RGBA, @@ -200,6 +203,7 @@ void GLR_FrameTimeGraph (int frametime) qglTexCoord2f (0, 1); qglVertex2f (x, y+NET_GRAPHHEIGHT); qglEnd (); +#endif } #endif diff --git a/engine/gl/gl_rmain.c b/engine/gl/gl_rmain.c index 725fd6a60..9f43f875a 100644 --- a/engine/gl/gl_rmain.c +++ b/engine/gl/gl_rmain.c @@ -830,14 +830,18 @@ void GLR_DrawPortal(batch_t *batch, batch_t **blist) /*FIXME: can we get away with stenciling the screen?*/ /*Add to frustum culling instead of clip planes?*/ - glplane[0] = -plane.normal[0]; - glplane[1] = -plane.normal[1]; - glplane[2] = -plane.normal[2]; - glplane[3] = plane.dist; - qglClipPlane(GL_CLIP_PLANE0, glplane); - qglEnable(GL_CLIP_PLANE0); + if (qglClipPlane) + { + glplane[0] = -plane.normal[0]; + glplane[1] = -plane.normal[1]; + glplane[2] = -plane.normal[2]; + glplane[3] = plane.dist; + qglClipPlane(GL_CLIP_PLANE0, glplane); + qglEnable(GL_CLIP_PLANE0); + } R_RenderScene(); - qglDisable(GL_CLIP_PLANE0); + if (qglClipPlane) + qglDisable(GL_CLIP_PLANE0); for (sort = 0; sort < SHADER_SORT_COUNT; sort++) for (batch = blist[sort]; batch; batch = batch->next) @@ -851,12 +855,15 @@ void GLR_DrawPortal(batch_t *batch, batch_t **blist) VectorCopy (r_refdef.vieworg, r_origin); R_SetFrustum (r_refdef.m_projection, r_refdef.m_view); - /*put GL back the way it was*/ - qglMatrixMode(GL_PROJECTION); - qglLoadMatrixf(r_refdef.m_projection); + if (qglLoadMatrixf) + { + /*put GL back the way it was*/ + qglMatrixMode(GL_PROJECTION); + qglLoadMatrixf(r_refdef.m_projection); - qglMatrixMode(GL_MODELVIEW); - qglLoadMatrixf(r_refdef.m_view); + qglMatrixMode(GL_MODELVIEW); + qglLoadMatrixf(r_refdef.m_view); + } GL_CullFace(0); @@ -952,6 +959,7 @@ static void R_RenderMotionBlur(void) #ifdef _MSC_VER #pragma message("backend fixme") #endif +#ifndef ANDROID Con_Printf("motionblur is not updated for the backend\n"); if (gl_config.arb_texture_non_power_of_two) @@ -1015,7 +1023,7 @@ static void R_RenderMotionBlur(void) qglCopyTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, 0, 0, vwidth, vheight, 0); qglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); qglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - +#endif PPL_RevertToKnownState(); } diff --git a/engine/gl/gl_rsurf.c b/engine/gl/gl_rsurf.c index 544220956..bfa9bf470 100644 --- a/engine/gl/gl_rsurf.c +++ b/engine/gl/gl_rsurf.c @@ -312,7 +312,7 @@ void GLBE_UploadAllLightmaps(void) switch (lightmap_bytes) { case 4: - qglTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, + qglTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, LMBLOCK_WIDTH, LMBLOCK_WIDTH, 0, (lightmap_bgra?GL_BGRA_EXT:GL_RGBA), GL_UNSIGNED_INT_8_8_8_8_REV, lightmap[i]->lightmaps); break; diff --git a/engine/gl/gl_shader.c b/engine/gl/gl_shader.c index 8d5561847..fe7e53bbc 100644 --- a/engine/gl/gl_shader.c +++ b/engine/gl/gl_shader.c @@ -1387,7 +1387,7 @@ struct sbuiltin_s /*calc diffuse lighting term*/ "vec3 lightDir = l_lightposition - worldPos;\n" - "float zdiff = 1.0 - saturate( length(lightDir) / lightAttenuation );\n" + "float zdiff = 1.0 - clamp(length(lightDir) / lightAttenuation, 0.0, 1.0);\n" "float atten = (radiusFar * zdiff) / (radiusFar - radiusNear);\n" "atten = pow(atten, 2.0);\n" "lightDir = normalize(lightDir);\n" diff --git a/engine/gl/gl_vidcommon.c b/engine/gl/gl_vidcommon.c index a4c5f73aa..b618ab1f8 100644 --- a/engine/gl/gl_vidcommon.c +++ b/engine/gl/gl_vidcommon.c @@ -458,6 +458,7 @@ void GL_CheckExtensions (void *(*getglfunction) (char *name), float ver) if (gl_config.gles) { qglActiveTextureARB = (void *) getglext("glActiveTexture"); + qglClientActiveTextureARB = (void *) getglext("glClientActiveTexture"); qglSelectTextureSGIS = qglActiveTextureARB; mtexid0 = GL_TEXTURE0_ARB; mtexid1 = GL_TEXTURE1_ARB; @@ -1101,7 +1102,6 @@ void GL_Init(void *(*getglfunction) (char *name)) if (!gl_extensions) Sys_Error("no extensions\n"); } - GL_CheckExtensions (getglfunction, gl_major_version + (gl_minor_version/10.f)); if (gl_config.gles && gl_config.glversion >= 2) diff --git a/engine/gl/gl_videgl.h b/engine/gl/gl_videgl.h index f8d48d5c9..db20fd256 100644 --- a/engine/gl/gl_videgl.h +++ b/engine/gl/gl_videgl.h @@ -2,6 +2,7 @@ #define __GL_VIDEGL_H__ #include "quakedef.h" +#define NativeWindowType EGLNativeWindowType #include #include diff --git a/engine/gl/gl_vidlinuxglx.c b/engine/gl/gl_vidlinuxglx.c index e02684f4b..d2454b78f 100644 --- a/engine/gl/gl_vidlinuxglx.c +++ b/engine/gl/gl_vidlinuxglx.c @@ -92,10 +92,6 @@ extern cvar_t _windowed_mouse; cvar_t m_filter = {"m_filter", "0"}; cvar_t m_accel = {"m_accel", "0"}; -#ifdef IN_XFLIP -cvar_t in_xflip = {"in_xflip", "0"}; -#endif - static float mouse_x, mouse_y; static float old_mouse_x, old_mouse_y; @@ -164,6 +160,7 @@ qboolean GLX_InitLibrary(char *driver) void *GLX_GetSymbol(char *name) { void *symb; + if (qglXGetProcAddress) symb = qglXGetProcAddress(name); else @@ -346,7 +343,8 @@ static void uninstall_grabs(void) } #endif - XUngrabPointer(vid_dpy, CurrentTime); + if (vid_dpy) + XUngrabPointer(vid_dpy, CurrentTime); // XSync(vid_dpy, True); } @@ -591,7 +589,7 @@ void GLVID_Shutdown(void) EGL_Shutdown(); #else printf("GLVID_Shutdown\n"); - if (!ctx) + if (!vid_dpy) return; XUngrabKeyboard(vid_dpy, CurrentTime); @@ -599,7 +597,10 @@ void GLVID_Shutdown(void) uninstall_grabs(); if (ctx) + { qglXDestroyContext(vid_dpy, ctx); + ctx = NULL; + } #ifdef WITH_VMODE if (originalapplied) @@ -1053,9 +1054,6 @@ void IN_ReInit(void) void IN_Init(void) { -#ifdef IN_XFLIP - Cvar_Register (&in_xflip, "Input variables"); -#endif IN_ReInit(); } @@ -1135,9 +1133,7 @@ void IN_MouseMove (float *movements, int pnum) mouse_y *= sensitivity.value*in_sensitivityscale; } -#ifdef IN_XFLIP if(in_xflip.value) mouse_x *= -1; -#endif if (movements) { diff --git a/engine/gl/gl_vidmacos.c b/engine/gl/gl_vidmacos.c index 7a5654f7c..15277f20b 100644 --- a/engine/gl/gl_vidmacos.c +++ b/engine/gl/gl_vidmacos.c @@ -28,7 +28,6 @@ // note: cocoa code is separated in vid_cocoa.m because of compilation pbs -cvar_t in_xflip = SCVAR("in_xflip", "0"); extern cvar_t vid_hardwaregamma; static void *agllibrary; diff --git a/engine/gl/gl_vidnull.c b/engine/gl/gl_vidnull.c index 3b170bea3..5398ad25b 100644 --- a/engine/gl/gl_vidnull.c +++ b/engine/gl/gl_vidnull.c @@ -1,9 +1,5 @@ #include "quakedef.h" -#ifdef IN_XFLIP -cvar_t in_xflip = {"in_xflip", "0"}; -#endif - qboolean GLVID_Init(rendererstate_t *info, unsigned char *palette) { return false; @@ -57,9 +53,6 @@ void IN_ReInit(void) void IN_Init(void) { -#ifdef IN_XFLIP - Cvar_Register (&in_xflip, "Input Controls"); -#endif } void IN_Shutdown(void) diff --git a/engine/gl/gl_vidsdl.c b/engine/gl/gl_vidsdl.c index deda54650..bc9a401e6 100644 --- a/engine/gl/gl_vidsdl.c +++ b/engine/gl/gl_vidsdl.c @@ -15,10 +15,6 @@ HWND mainwindow; extern qboolean vid_isfullscreen; -#ifdef IN_XFLIP -cvar_t in_xflip = {"in_xflip", "0"}; -#endif - unsigned short intitialgammaramps[3][256]; qboolean ActiveApp; diff --git a/engine/gl/glquake.h b/engine/gl/glquake.h index bb14af8d1..a7c652ac6 100644 --- a/engine/gl/glquake.h +++ b/engine/gl/glquake.h @@ -45,7 +45,35 @@ qboolean BoundsIntersect (vec3_t mins1, vec3_t maxs1, vec3_t mins2, vec3_t maxs2 void ClearBounds (vec3_t mins, vec3_t maxs); #ifdef GLQUAKE - #ifdef __MACOSX__ + #if defined(ANDROID) /*FIXME: actually just to use standard GLES headers instead of full GL*/ + #if 1 + #include + #else + #include + /*gles has no fixed function*/ + #define GL_PROJECTION 0 + #define GL_MODELVIEW 0 + #define GL_CLIP_PLANE0 0 + #define GL_ALPHA_TEST 0 + #define GL_MODULATE 0 + #define GL_FLAT 0 + #define GL_SMOOTH 0 + #define GL_DECAL 0 + #define GL_ADD 0 + #define GL_TEXTURE_ENV 0 + #define GL_TEXTURE_ENV_MODE 0 + #define GL_COLOR_ARRAY 0 + #define GL_VERTEX_ARRAY 0 + #define GL_TEXTURE_COORD_ARRAY 0 + #endif + /*gles has no doubles*/ + #define GLclampd GLclampf + #define GLdouble GLfloat + #define GL_CLAMP GL_CLAMP_TO_EDGE + + #define GL_FILL (Sys_Error("GL_FILL was used"),0) + #define GL_QUADS (Sys_Error("GL_QUADS was used"),0) + #elif defined(__MACOSX__) //apple, you suck. #include #else @@ -395,6 +423,7 @@ extern void (APIENTRY *qglCallLists) (GLsizei n, GLenum type, const GLvoid *list extern void (APIENTRY *qglClear) (GLbitfield mask); extern void (APIENTRY *qglClearAccum) (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); extern void (APIENTRY *qglClearColor) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); +extern void (APIENTRY *qglClearDepthf) (GLclampf depth); extern void (APIENTRY *qglClearDepth) (GLclampd depth); extern void (APIENTRY *qglClearIndex) (GLfloat c); extern void (APIENTRY *qglClearStencil) (GLint s); diff --git a/engine/gl/glsupp.h b/engine/gl/glsupp.h index 37128cd1b..829427987 100644 --- a/engine/gl/glsupp.h +++ b/engine/gl/glsupp.h @@ -386,20 +386,20 @@ typedef void (APIENTRY * PFNGLACTIVESTENCILFACEEXTPROC) (GLenum face); #ifndef GL_ARB_vertex_program #define GL_ARB_vertex_program 1 -typedef void (APIENTRYP PFNGLVERTEXATTRIB1DARBPROC) (GLuint index, GLdouble x); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1DVARBPROC) (GLuint index, const GLdouble *v); +//typedef void (APIENTRYP PFNGLVERTEXATTRIB1DARBPROC) (GLuint index, GLdouble x); +//typedef void (APIENTRYP PFNGLVERTEXATTRIB1DVARBPROC) (GLuint index, const GLdouble *v); typedef void (APIENTRYP PFNGLVERTEXATTRIB1FARBPROC) (GLuint index, GLfloat x); typedef void (APIENTRYP PFNGLVERTEXATTRIB1FVARBPROC) (GLuint index, const GLfloat *v); typedef void (APIENTRYP PFNGLVERTEXATTRIB1SARBPROC) (GLuint index, GLshort x); typedef void (APIENTRYP PFNGLVERTEXATTRIB1SVARBPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2DARBPROC) (GLuint index, GLdouble x, GLdouble y); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2DVARBPROC) (GLuint index, const GLdouble *v); +//typedef void (APIENTRYP PFNGLVERTEXATTRIB2DARBPROC) (GLuint index, GLdouble x, GLdouble y); +//typedef void (APIENTRYP PFNGLVERTEXATTRIB2DVARBPROC) (GLuint index, const GLdouble *v); typedef void (APIENTRYP PFNGLVERTEXATTRIB2FARBPROC) (GLuint index, GLfloat x, GLfloat y); typedef void (APIENTRYP PFNGLVERTEXATTRIB2FVARBPROC) (GLuint index, const GLfloat *v); typedef void (APIENTRYP PFNGLVERTEXATTRIB2SARBPROC) (GLuint index, GLshort x, GLshort y); typedef void (APIENTRYP PFNGLVERTEXATTRIB2SVARBPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3DARBPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3DVARBPROC) (GLuint index, const GLdouble *v); +//typedef void (APIENTRYP PFNGLVERTEXATTRIB3DARBPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); +//typedef void (APIENTRYP PFNGLVERTEXATTRIB3DVARBPROC) (GLuint index, const GLdouble *v); typedef void (APIENTRYP PFNGLVERTEXATTRIB3FARBPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z); typedef void (APIENTRYP PFNGLVERTEXATTRIB3FVARBPROC) (GLuint index, const GLfloat *v); typedef void (APIENTRYP PFNGLVERTEXATTRIB3SARBPROC) (GLuint index, GLshort x, GLshort y, GLshort z); @@ -412,8 +412,8 @@ typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBVARBPROC) (GLuint index, const GLub typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUIVARBPROC) (GLuint index, const GLuint *v); typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUSVARBPROC) (GLuint index, const GLushort *v); typedef void (APIENTRYP PFNGLVERTEXATTRIB4BVARBPROC) (GLuint index, const GLbyte *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4DARBPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4DVARBPROC) (GLuint index, const GLdouble *v); +//typedef void (APIENTRYP PFNGLVERTEXATTRIB4DARBPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +//typedef void (APIENTRYP PFNGLVERTEXATTRIB4DVARBPROC) (GLuint index, const GLdouble *v); typedef void (APIENTRYP PFNGLVERTEXATTRIB4FARBPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); typedef void (APIENTRYP PFNGLVERTEXATTRIB4FVARBPROC) (GLuint index, const GLfloat *v); typedef void (APIENTRYP PFNGLVERTEXATTRIB4IVARBPROC) (GLuint index, const GLint *v); @@ -429,21 +429,21 @@ typedef void (APIENTRYP PFNGLPROGRAMSTRINGARBPROC) (GLenum target, GLenum format typedef void (APIENTRYP PFNGLBINDPROGRAMARBPROC) (GLenum target, GLuint program); typedef void (APIENTRYP PFNGLDELETEPROGRAMSARBPROC) (GLsizei n, const GLuint *programs); typedef void (APIENTRYP PFNGLGENPROGRAMSARBPROC) (GLsizei n, GLuint *programs); -typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4DARBPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4DVARBPROC) (GLenum target, GLuint index, const GLdouble *params); +//typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4DARBPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +//typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4DVARBPROC) (GLenum target, GLuint index, const GLdouble *params); typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4FARBPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4FVARBPROC) (GLenum target, GLuint index, const GLfloat *params); -typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4DARBPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4DVARBPROC) (GLenum target, GLuint index, const GLdouble *params); +//typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4DARBPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +//typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4DVARBPROC) (GLenum target, GLuint index, const GLdouble *params); typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4FARBPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4FVARBPROC) (GLenum target, GLuint index, const GLfloat *params); -typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERDVARBPROC) (GLenum target, GLuint index, GLdouble *params); +//typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERDVARBPROC) (GLenum target, GLuint index, GLdouble *params); typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERFVARBPROC) (GLenum target, GLuint index, GLfloat *params); -typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC) (GLenum target, GLuint index, GLdouble *params); +//typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC) (GLenum target, GLuint index, GLdouble *params); typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC) (GLenum target, GLuint index, GLfloat *params); typedef void (APIENTRYP PFNGLGETPROGRAMIVARBPROC) (GLenum target, GLenum pname, GLint *params); typedef void (APIENTRYP PFNGLGETPROGRAMSTRINGARBPROC) (GLenum target, GLenum pname, GLvoid *string); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVARBPROC) (GLuint index, GLenum pname, GLdouble *params); +//typedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVARBPROC) (GLuint index, GLenum pname, GLdouble *params); typedef void (APIENTRYP PFNGLGETVERTEXATTRIBFVARBPROC) (GLuint index, GLenum pname, GLfloat *params); typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVARBPROC) (GLuint index, GLenum pname, GLint *params); typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVARBPROC) (GLuint index, GLenum pname, GLvoid* *pointer); diff --git a/engine/gl/shader.h b/engine/gl/shader.h index 58d3b7edd..21b702d28 100644 --- a/engine/gl/shader.h +++ b/engine/gl/shader.h @@ -511,5 +511,6 @@ struct shader_field_names_s { char *name; enum shaderprogparmtype_e ptype; -} shader_field_names[]; +}; +extern struct shader_field_names_s shader_field_names[]; #endif diff --git a/engine/server/sv_main.c b/engine/server/sv_main.c index 3fc0f90c4..cf50cae83 100644 --- a/engine/server/sv_main.c +++ b/engine/server/sv_main.c @@ -2417,7 +2417,7 @@ client_t *SVC_DirectConnect(void) SV_CheckRecentCrashes(newcl); -#ifdef PEXT2_VOICECHAT +#ifdef VOICECHAT SV_VoiceInitClient(newcl); #endif @@ -4026,7 +4026,7 @@ void SV_InitLocal (void) #endif svs.fteprotocolextensions2 |= PEXT2_PRYDONCURSOR; -#ifdef PEXT2_VOICECHAT +#ifdef VOICECHAT svs.fteprotocolextensions2 |= PEXT2_VOICECHAT; #endif svs.fteprotocolextensions2 |= PEXT2_SETANGLEDELTA; diff --git a/engine/server/sv_send.c b/engine/server/sv_send.c index 1d17f4dec..8325c708d 100644 --- a/engine/server/sv_send.c +++ b/engine/server/sv_send.c @@ -1763,7 +1763,7 @@ qboolean SV_SendClientDatagram (client_t *client) // possibly a nails update SV_WriteEntitiesToClient (client, &msg, false); } -#ifdef PEXT2_VOICECHAT +#ifdef VOICECHAT SV_VoiceSendPacket(client, &msg); #endif } diff --git a/engine/server/sv_user.c b/engine/server/sv_user.c index c9614ec80..cc557cb22 100644 --- a/engine/server/sv_user.c +++ b/engine/server/sv_user.c @@ -6174,7 +6174,7 @@ haveannothergo: case clc_upload: SV_NextUpload(); break; -#ifdef PEXT2_VOICECHAT +#ifdef VOICECHAT case clc_voicechat: SV_VoiceReadPacket(); break; @@ -6337,7 +6337,7 @@ void SVQ2_ExecuteClientMessage (client_t *cl) return; // disconnect command break; -#ifdef PEXT2_VOICECHAT +#ifdef VOICECHAT case clc_voicechat: SV_VoiceReadPacket(); break; @@ -6533,7 +6533,7 @@ void SVNQ_ExecuteClientMessage (client_t *cl) SV_DarkPlacesDownloadAck(host_client); break; -#ifdef PEXT2_VOICECHAT +#ifdef VOICECHAT case clc_voicechat: SV_VoiceReadPacket(); break;