diff --git a/CMakeLists.txt b/CMakeLists.txt index 864f768da..dcf0cf88a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -299,7 +299,7 @@ ELSEIF(1) #SDL FIND_PACKAGE(PkgConfig REQUIRED) PKG_SEARCH_MODULE(sdl2 REQUIRED sdl2) -# FIND_PACKAGE(SDL2 REQUIRED) + FIND_PACKAGE(SDL2 REQUIRED) INCLUDE_DIRECTORIES(${FREETYPE_INCLUDE_DIRS} ${SDL2_INCLUDE_DIRS}) @@ -918,7 +918,7 @@ SET_TARGET_PROPERTIES(models PROPERTIES PREFIX "fteplug_") SET_TARGET_PROPERTIES(models PROPERTIES LINK_FLAGS "-Wl,--no-undefined") TARGET_LINK_LIBRARIES(models m) -#x11 formats plugin +#x11 server plugin (note: for displaying other programs) ADD_LIBRARY(x11 MODULE plugins/qvm_api.c plugins/plugin.c diff --git a/engine/client/cl_demo.c b/engine/client/cl_demo.c index c290c20d1..46fcf53b8 100644 --- a/engine/client/cl_demo.c +++ b/engine/client/cl_demo.c @@ -1219,7 +1219,7 @@ static void CLQW_RecordServerData(sizebuf_t *buf, int *seq) MSG_WriteByte (buf, svc_serverdata); if (cls.fteprotocolextensions&~PEXT1_HIDEPROTOCOLS) //maintain demo compatability { - MSG_WriteLong (buf, PROTOCOL_VERSION_FTE); + MSG_WriteLong (buf, PROTOCOL_VERSION_FTE1); MSG_WriteLong (buf, cls.fteprotocolextensions&~PEXT1_HIDEPROTOCOLS); } if (cls.fteprotocolextensions2) //maintain demo compatability @@ -1355,7 +1355,7 @@ void CLNQ_WriteServerData(sizebuf_t *buf) //for demo recording MSG_WriteByte(buf, svc_serverdata); if (cls.fteprotocolextensions&~PEXT1_HIDEPROTOCOLS) { - MSG_WriteLong (buf, PROTOCOL_VERSION_FTE); + MSG_WriteLong (buf, PROTOCOL_VERSION_FTE1); MSG_WriteLong (buf, cls.fteprotocolextensions&~PEXT1_HIDEPROTOCOLS); } if (cls.fteprotocolextensions2) @@ -2089,7 +2089,7 @@ void CL_Record_f (void) MSG_WriteByte (&buf, svcq2_serverdata); if (cls.fteprotocolextensions) //maintain demo compatability { - MSG_WriteLong (&buf, PROTOCOL_VERSION_FTE); + MSG_WriteLong (&buf, PROTOCOL_VERSION_FTE1); MSG_WriteLong (&buf, cls.fteprotocolextensions); } if (cls.fteprotocolextensions2) //maintain demo compatability diff --git a/engine/client/cl_main.c b/engine/client/cl_main.c index 062ceb83f..3959d5887 100644 --- a/engine/client/cl_main.c +++ b/engine/client/cl_main.c @@ -441,6 +441,7 @@ void CL_Quit_f (void) Sys_Quit (); } +#ifdef NQPROT void CL_ConnectToDarkPlaces(char *challenge, netadr_t *adr) { char data[2048]; @@ -456,16 +457,13 @@ void CL_ConnectToDarkPlaces(char *challenge, netadr_t *adr) cl.splitclients = 0; } +#endif void CL_SupportedFTEExtensions(unsigned int *pext1, unsigned int *pext2, unsigned int *ezpext1) { - unsigned int fteprotextsupported1 = 0; - unsigned int fteprotextsupported2 = 0; - unsigned int ezprotextsupported1 = 0; - - fteprotextsupported1 = Net_PextMask(1, false); - fteprotextsupported2 = Net_PextMask(2, false); - ezprotextsupported1 = Net_PextMask(3, false) & EZPEXT1_CLIENTADVERTISE; + unsigned int fteprotextsupported1 = Net_PextMask(PROTOCOL_VERSION_FTE1, false); + unsigned int fteprotextsupported2 = Net_PextMask(PROTOCOL_VERSION_FTE2, false); + unsigned int ezprotextsupported1 = Net_PextMask(PROTOCOL_VERSION_EZQUAKE1, false) & EZPEXT1_CLIENTADVERTISE; fteprotextsupported1 &= strtoul(cl_pext_mask.string, NULL, 16); // fteprotextsupported2 &= strtoul(cl_pext2_mask.string, NULL, 16); @@ -683,7 +681,7 @@ void CL_SendConnectPacket (netadr_t *to, int mtu, Q_strncatz(data, "\n", sizeof(data)); if (ftepext1) - Q_strncatz(data, va("0x%x 0x%x\n", PROTOCOL_VERSION_FTE, fteprotextsupported1), sizeof(data)); + Q_strncatz(data, va("0x%x 0x%x\n", PROTOCOL_VERSION_FTE1, fteprotextsupported1), sizeof(data)); if (ftepext2) Q_strncatz(data, va("0x%x 0x%x\n", PROTOCOL_VERSION_FTE2, fteprotextsupported2), sizeof(data)); @@ -799,9 +797,9 @@ void CL_CheckForResend (void) //for hexen2 we always force fte's native qw protocol. other protocols won't cut it. connectinfo.protocol = CP_QUAKEWORLD; connectinfo.subprotocol = PROTOCOL_VERSION_QW; - connectinfo.fteext1 = Net_PextMask(1, false); - connectinfo.fteext2 = Net_PextMask(2, false); - connectinfo.ezext1 = Net_PextMask(3, false) & EZPEXT1_CLIENTADVERTISE; + connectinfo.fteext1 = Net_PextMask(PROTOCOL_VERSION_FTE1, false); + connectinfo.fteext2 = Net_PextMask(PROTOCOL_VERSION_FTE2, false); + connectinfo.ezext1 = Net_PextMask(PROTOCOL_VERSION_EZQUAKE1, false) & EZPEXT1_CLIENTADVERTISE; } else if (!strcmp(lbp, "qwid") || !strcmp(lbp, "idqw")) { //for recording .qwd files in any client @@ -827,9 +825,9 @@ void CL_CheckForResend (void) { connectinfo.protocol = CP_QUAKEWORLD; connectinfo.subprotocol = PROTOCOL_VERSION_QW; - connectinfo.fteext1 = Net_PextMask(1, false); - connectinfo.fteext2 = Net_PextMask(2, false); - connectinfo.ezext1 = Net_PextMask(3, false) & EZPEXT1_CLIENTADVERTISE; + connectinfo.fteext1 = Net_PextMask(PROTOCOL_VERSION_FTE1, false); + connectinfo.fteext2 = Net_PextMask(PROTOCOL_VERSION_FTE2, false); + connectinfo.ezext1 = Net_PextMask(PROTOCOL_VERSION_EZQUAKE1, false) & EZPEXT1_CLIENTADVERTISE; } } else if (!strcmp(lbp, "fitz") || !strcmp(lbp, "rmqe") || @@ -877,18 +875,18 @@ void CL_CheckForResend (void) { connectinfo.protocol = CP_NETQUAKE; connectinfo.subprotocol = CPNQ_FITZ666; - connectinfo.fteext1 = Net_PextMask(1, true); - connectinfo.fteext2 = Net_PextMask(2, true); - connectinfo.ezext1 = Net_PextMask(3, false) & EZPEXT1_CLIENTADVERTISE; + connectinfo.fteext1 = Net_PextMask(PROTOCOL_VERSION_FTE1, true); + connectinfo.fteext2 = Net_PextMask(PROTOCOL_VERSION_FTE2, true); + connectinfo.ezext1 = Net_PextMask(PROTOCOL_VERSION_EZQUAKE1, false) & EZPEXT1_CLIENTADVERTISE; } #endif else { //protocol wasn't recognised, and we didn't take the nq fallback, so that must mean we're going for qw. connectinfo.protocol = CP_QUAKEWORLD; connectinfo.subprotocol = PROTOCOL_VERSION_QW; - connectinfo.fteext1 = Net_PextMask(1, false); - connectinfo.fteext2 = Net_PextMask(2, false); - connectinfo.ezext1 = Net_PextMask(3, false) & EZPEXT1_CLIENTADVERTISE; + connectinfo.fteext1 = Net_PextMask(PROTOCOL_VERSION_FTE1, false); + connectinfo.fteext2 = Net_PextMask(PROTOCOL_VERSION_FTE2, false); + connectinfo.ezext1 = Net_PextMask(PROTOCOL_VERSION_EZQUAKE1, false) & EZPEXT1_CLIENTADVERTISE; } #ifdef NETPREPARSE @@ -902,9 +900,9 @@ void CL_CheckForResend (void) { connectinfo.protocol = CP_QUAKEWORLD; connectinfo.subprotocol = PROTOCOL_VERSION_QW; - connectinfo.fteext1 = Net_PextMask(1, false); - connectinfo.fteext2 = Net_PextMask(2, false); - connectinfo.ezext1 = Net_PextMask(3, false) & EZPEXT1_CLIENTADVERTISE; + connectinfo.fteext1 = Net_PextMask(PROTOCOL_VERSION_FTE1, false); + connectinfo.fteext2 = Net_PextMask(PROTOCOL_VERSION_FTE2, false); + connectinfo.ezext1 = Net_PextMask(PROTOCOL_VERSION_EZQUAKE1, false) & EZPEXT1_CLIENTADVERTISE; } else if (progstype != PROG_QW && cls.protocol == CP_QUAKEWORLD) { @@ -918,9 +916,9 @@ void CL_CheckForResend (void) { connectinfo.protocol = CP_QUAKEWORLD; connectinfo.subprotocol = PROTOCOL_VERSION_QW; - connectinfo.fteext1 = Net_PextMask(1, false); - connectinfo.fteext2 = Net_PextMask(2, false); - connectinfo.ezext1 = Net_PextMask(3, false) & EZPEXT1_CLIENTADVERTISE; + connectinfo.fteext1 = Net_PextMask(PROTOCOL_VERSION_FTE1, false); + connectinfo.fteext2 = Net_PextMask(PROTOCOL_VERSION_FTE2, false); + connectinfo.ezext1 = Net_PextMask(PROTOCOL_VERSION_EZQUAKE1, false) & EZPEXT1_CLIENTADVERTISE; } #ifdef NQPROT else if (cls.demorecording == DPB_NETQUAKE && cls.protocol != CP_NETQUAKE) @@ -3209,7 +3207,7 @@ void CL_ConnectionlessPacket (void) unsigned int l = MSG_ReadLong(); switch(cmd) { - case PROTOCOL_VERSION_FTE: ftepext1 = l; break; + case PROTOCOL_VERSION_FTE1: ftepext1 = l; break; case PROTOCOL_VERSION_FTE2: ftepext2 = l; break; case PROTOCOL_VERSION_EZQUAKE1: ezpext1 = l; break; case PROTOCOL_VERSION_FRAGMENT: mtu = l; break; diff --git a/engine/client/cl_parse.c b/engine/client/cl_parse.c index 26aced3a1..4180e70d4 100644 --- a/engine/client/cl_parse.c +++ b/engine/client/cl_parse.c @@ -3099,7 +3099,7 @@ static void CLQW_ParseServerData (void) for(;;) { protover = MSG_ReadLong (); - if (protover == PROTOCOL_VERSION_FTE) + if (protover == PROTOCOL_VERSION_FTE1) { cls.fteprotocolextensions = MSG_ReadLong(); continue; @@ -3417,7 +3417,7 @@ static void CLQ2_ParseServerData (void) // parse protocol version number i = MSG_ReadLong (); - if (i == PROTOCOL_VERSION_FTE) + if (i == PROTOCOL_VERSION_FTE1) { cls.fteprotocolextensions = i = MSG_ReadLong(); // if (i & PEXT_FLOATCOORDS) @@ -3577,7 +3577,7 @@ static void CLNQ_ParseProtoVersion(void) protover = MSG_ReadLong (); switch(protover) { - case PROTOCOL_VERSION_FTE: + case PROTOCOL_VERSION_FTE1: cls.fteprotocolextensions = MSG_ReadLong(); continue; case PROTOCOL_VERSION_FTE2: diff --git a/engine/client/cl_screen.c b/engine/client/cl_screen.c index e7ba99dba..ec3d43ffd 100644 --- a/engine/client/cl_screen.c +++ b/engine/client/cl_screen.c @@ -1968,8 +1968,10 @@ void SCR_SetLoadingFile(char *str) if (scr_loadingrefresh.ival) { + qboolean oldwarndraw = r_refdef.warndraw; r_refdef.warndraw = false; SCR_UpdateScreen(); + r_refdef.warndraw = oldwarndraw; } } @@ -2212,12 +2214,14 @@ void SCR_BeginLoadingPlaque (void) // redraw with no console and the loading plaque if (!scr_disabled_for_loading) { + qboolean oldwarndraw = r_refdef.warndraw; Sbar_Changed (); r_refdef.warndraw = false; scr_drawloading = true; SCR_UpdateScreen (); scr_drawloading = false; scr_disabled_for_loading = true; + r_refdef.warndraw = oldwarndraw; } scr_disabled_time = Sys_DoubleTime(); //realtime tends to change... Hmmm.... @@ -2267,10 +2271,11 @@ void SCR_ImageName (const char *mapname) scr_drawloading = true; if (qrenderer != QR_NONE) { + qboolean oldwarndraw = r_refdef.warndraw; r_refdef.warndraw = false; Sbar_Changed (); SCR_UpdateScreen (); - r_refdef.warndraw = true; + r_refdef.warndraw = oldwarndraw; } scr_disabled_time = Sys_DoubleTime(); //realtime tends to change... Hmmm.... diff --git a/engine/client/m_master.c b/engine/client/m_master.c index 523415740..38f37c928 100644 --- a/engine/client/m_master.c +++ b/engine/client/m_master.c @@ -273,23 +273,23 @@ static void SL_ServerDraw (int x, int y, menucustom_t *ths, menu_t *menu) stype = flagstoservertype(si->special); if (thisone == info->selectedpos) { - R2D_ImageColours( + R2D_ImageColours(SRGBA( serverhighlight[(int)stype][0], serverhighlight[(int)stype][1], serverhighlight[(int)stype][2], - 1.0); + 1.0)); } else if (thisone == info->scrollpos + (int)(mousecursor_y-info->servers_top)/8 && mousecursor_x < x) - R2D_ImageColours((sin(realtime*4.4)*0.25)+0.5, (sin(realtime*4.4)*0.25)+0.5, 0.08, sb_alpha.value); + R2D_ImageColours(SRGBA((sin(realtime*4.4)*0.25)+0.5, (sin(realtime*4.4)*0.25)+0.5, 0.08, sb_alpha.value)); else if (selectedserver.inuse && NET_CompareAdr(&si->adr, &selectedserver.adr)) - R2D_ImageColours(((sin(realtime*4.4)*0.25)+0.5) * 0.5, ((sin(realtime*4.4)*0.25)+0.5)*0.5, 0.08*0.5, sb_alpha.value); + R2D_ImageColours(SRGBA(((sin(realtime*4.4)*0.25)+0.5) * 0.5, ((sin(realtime*4.4)*0.25)+0.5)*0.5, 0.08*0.5, sb_alpha.value)); else { - R2D_ImageColours( + R2D_ImageColours(SRGBA( serverbackcolor[(int)stype * 2 + (thisone & 1)][0], serverbackcolor[(int)stype * 2 + (thisone & 1)][1], serverbackcolor[(int)stype * 2 + (thisone & 1)][2], - sb_alpha.value); + sb_alpha.value)); } R2D_FillBlock(0, y, ths->common.width, 8); @@ -970,12 +970,12 @@ static void SL_SliderDraw (int x, int y, menucustom_t *ths, menu_t *menu) } else { - R2D_ImageColours(0.1, 0.1, 0.2, 1.0); + R2D_ImageColours(SRGBA(0.1, 0.1, 0.2, 1.0)); R2D_FillBlock(x, y, ths->common.width, ths->common.height); y += ((info->scrollpos) / ((float)info->numslots - info->visibleslots)) * (ths->common.height-8); - R2D_ImageColours(0.35, 0.35, 0.55, 1.0); + R2D_ImageColours(SRGBA(0.35, 0.35, 0.55, 1.0)); R2D_FillBlock(x, y, 8, 8); R2D_ImageColours(1,1,1,1); } diff --git a/engine/client/m_mp3.c b/engine/client/m_mp3.c index 27fb17d7a..235e48e90 100644 --- a/engine/client/m_mp3.c +++ b/engine/client/m_mp3.c @@ -3951,7 +3951,7 @@ static void Media_RecordFilm (char *recordingname, qboolean demo) if (pluginencodersfunc[i]) { currentcapture_funcs = pluginencodersfunc[i]; - break; +// break; } } } @@ -5141,13 +5141,13 @@ void Media_Init(void) #endif #ifdef HAVE_MEDIA_ENCODER - #if defined(HAVE_API_VFW) - Media_RegisterEncoder(NULL, &capture_avi); - #endif #ifdef _DEBUG Media_RegisterEncoder(NULL, &capture_null); #endif Media_RegisterEncoder(NULL, &capture_raw); + #if defined(HAVE_API_VFW) + Media_RegisterEncoder(NULL, &capture_avi); + #endif Cmd_AddCommandD("capture", Media_RecordFilm_f, "Captures realtime action to a named video file. Check the capture* cvars to control driver/codecs/rates."); Cmd_AddCommandD("capturedemo", Media_RecordDemo_f, "Capture a nemed demo to a named video file. Demo capturing can be performed offscreen, allowing arbitrary video sizes, or smooth captures on underpowered hardware."); diff --git a/engine/client/m_options.c b/engine/client/m_options.c index 6c0d6a90f..e6bd71042 100644 --- a/engine/client/m_options.c +++ b/engine/client/m_options.c @@ -3647,14 +3647,18 @@ static void M_ModelViewerDraw(int x, int y, struct menucustom_s *c, struct menu_ "body: %i\n" "geomset: %i %i%s\n" "numverts: %i\nnumtris: %i\n" +#ifdef SKELETALMODELS "numbones: %i\n" +#endif , ent.model->mins[0], ent.model->mins[1], ent.model->mins[2], ent.model->maxs[0], ent.model->maxs[1], ent.model->maxs[2], contents, inf->csurface.flags, inf->surfaceid, inf->geomset>=MAX_GEOMSETS?-1:inf->geomset, inf->geomid, inf->geomset>=MAX_GEOMSETS?" (always)":"", - inf->numverts, inf->numindexes/3, - inf->numbones + inf->numverts, inf->numindexes/3 +#ifdef SKELETALMODELS + ,inf->numbones +#endif ) , CON_WHITEMASK, CPRINT_TALIGN|CPRINT_LALIGN, font_default, fs); } diff --git a/engine/client/m_single.c b/engine/client/m_single.c index 6b86be0f6..d2c39a016 100644 --- a/engine/client/m_single.c +++ b/engine/client/m_single.c @@ -320,6 +320,7 @@ void M_Menu_Load_f (void) #endif +extern cvar_t cl_splitscreen; void M_Menu_SinglePlayer_f (void) { menu_t *menu; @@ -327,7 +328,6 @@ void M_Menu_SinglePlayer_f (void) menubutton_t *b; mpic_t *p; static menuresel_t resel; - extern cvar_t cl_splitscreen; #endif Key_Dest_Add(kdm_emenu); @@ -388,7 +388,6 @@ void M_Menu_SinglePlayer_f (void) if (!strncmp(Cmd_Argv(1), "class", 5)) { int pnum; - extern cvar_t cl_splitscreen; pnum = atoi(Cmd_Argv(1)+5); if (!pnum) pnum = 1; @@ -528,6 +527,7 @@ void M_Menu_SinglePlayer_f (void) } else { +#if MAX_SPLITS > 1 const char *opts[] = { "Single", @@ -544,6 +544,7 @@ void M_Menu_SinglePlayer_f (void) "3", NULL }; +#endif int width; if (R_GetShaderSizes(p, &width, NULL, true) <= 0) width = 232; diff --git a/engine/client/net_master.c b/engine/client/net_master.c index c25a65d21..8bf586b45 100644 --- a/engine/client/net_master.c +++ b/engine/client/net_master.c @@ -1741,7 +1741,7 @@ qboolean Master_LoadMasterList (char *filename, qboolean withcomment, int defaul if (!*com_token) continue; - //special cases. Add a port if you have a server named 'file'... (unlikly) + //special cases. Add a port if you have a host named 'file'... (unlikly) if (!strcmp(entry, "file")) { if (withcomment) diff --git a/engine/client/renderer.c b/engine/client/renderer.c index a236f2436..b841aa5b0 100644 --- a/engine/client/renderer.c +++ b/engine/client/renderer.c @@ -274,16 +274,8 @@ cvar_t vid_bpp = CVARFD ("vid_bpp", "0", CVAR_ARCHIVE | CVAR_VIDEOLATCH, "The number of colour bits to request from the renedering context"); cvar_t vid_desktopsettings = CVARFD ("vid_desktopsettings", "0", CVAR_ARCHIVE | CVAR_VIDEOLATCH, "Ignore the values of vid_width and vid_height, and just use the same settings that are used for the desktop."); -#ifdef NACL -cvar_t vid_fullscreen = CVARF ("vid_fullscreen", "0", - CVAR_ARCHIVE); -#else -//these cvars will be given their names when they're registered, based upon whether -plugin was used. this means code can always use vid_fullscreen without caring, but gets saved properly. -cvar_t vid_fullscreen = CVARAFD (NULL, "1", "vid_fullscreen", - CVAR_ARCHIVE | CVAR_VIDEOLATCH, "Whether to use fullscreen or not. A value of 2 specifies fullscreen windowed (aka borderless window) mode."); -cvar_t vid_fullscreen_alternative = CVARFD (NULL, "1", - CVAR_ARCHIVE, "Whether to use fullscreen or not. This cvar is saved to your config but not otherwise used in this operating mode."); -#endif +cvar_t vid_fullscreen = CVARF ("vid_fullscreen", "1", + CVAR_ARCHIVE|CVAR_VIDEOLATCH); cvar_t vid_height = CVARFD ("vid_height", "0", CVAR_ARCHIVE | CVAR_VIDEOLATCH, "The screen height to attempt to use, in physical pixels. 0 means use desktop resolution."); cvar_t vid_multisample = CVARFD ("vid_multisample", "0", @@ -812,19 +804,6 @@ void Renderer_Init(void) ""; Cvar_Register (&vid_renderer_opts, VIDCOMMANDGROUP); -#ifndef NACL - if (COM_CheckParm("-plugin")) - { - vid_fullscreen.name = "vid_fullscreen_embedded"; - vid_fullscreen_alternative.name = "vid_fullscreen_standalone"; - } - else - { - vid_fullscreen.name = "vid_fullscreen_standalone"; - vid_fullscreen_alternative.name = "vid_fullscreen_embedded"; - } - Cvar_Register (&vid_fullscreen_alternative, VIDCOMMANDGROUP); -#endif Cvar_Register (&vid_fullscreen, VIDCOMMANDGROUP); Cvar_Register (&vid_bpp, VIDCOMMANDGROUP); diff --git a/engine/client/snd_dma.c b/engine/client/snd_dma.c index 394441f62..1e435deff 100644 --- a/engine/client/snd_dma.c +++ b/engine/client/snd_dma.c @@ -2031,10 +2031,7 @@ static void QDECL S_Voip_EnumeratedCaptureDevice(const char *driver, const char char nbuf[1024]; char dbuf[1024]; - if (devicecode && ( strchr(devicecode, ' ') || - strchr(devicecode, '\"'))) - fullintname = va("\"%s:%s\"", driver, devicecode); //it'll all get escaped anyway. but yeah, needs to be a single token or our multi-device stuff won't work properly. yes, this is a bit of a hack. - else if (devicecode) + if (devicecode) fullintname = va("%s:%s", driver, devicecode); else fullintname = driver; diff --git a/engine/client/snd_sdl.c b/engine/client/snd_sdl.c index 0ac0fbb38..13fcc2b04 100644 --- a/engine/client/snd_sdl.c +++ b/engine/client/snd_sdl.c @@ -94,7 +94,6 @@ static dllhandle_t *libsdl; #include #endif #define SDRVNAME "SDL" -#endif //SDL calls a callback each time it needs to repaint the 'hardware' buffers //This results in extra latency due it needing to buffer that much data. @@ -135,9 +134,11 @@ static qboolean SSDL_InitAudio(void) return false; } inited = true; - return true; } +#else +#define SDL_VERSION_ATLEAST(x,y,z) 0 +#endif #ifdef HAVE_MIXER #define SELFPAINT diff --git a/engine/client/sys_droid.c b/engine/client/sys_droid.c index 16ee193f1..52d577f2e 100644 --- a/engine/client/sys_droid.c +++ b/engine/client/sys_droid.c @@ -366,10 +366,10 @@ static int mapkey(int androidkey) // case 265/*AKEYCODE_STEM_1*/: return K_; // case 266/*AKEYCODE_STEM_2*/: return K_; // case 267/*AKEYCODE_STEM_3*/: return K_; -// case 268/*AKEYCODE_DPAD_UP_LEFT*/: return K_; -// case 269/*AKEYCODE_DPAD_DOWN_LEFT*/: return K_; -// case 270/*AKEYCODE_DPAD_UP_RIGHT*/: return K_; -// case 271/*AKEYCODE_DPAD_DOWN_RIGHT*/: return K_; +// case 268/*AKEYCODE_DPAD_UP_LEFT*/: return K_UPLEFTARROW; +// case 269/*AKEYCODE_DPAD_DOWN_LEFT*/: return K_DOWNLEFTARROW; +// case 270/*AKEYCODE_DPAD_UP_RIGHT*/: return K_UPRIGHTARROW; +// case 271/*AKEYCODE_DPAD_DOWN_RIGHT*/: return K_DOWNRIGHTARROW; // case 272/*AKEYCODE_MEDIA_SKIP_FORWARD*/: return K_; // case 273/*AKEYCODE_MEDIA_SKIP_BACKWARD*/: return K_; // case 274/*AKEYCODE_MEDIA_STEP_FORWARD*/: return K_; @@ -448,6 +448,7 @@ static void run_intent_url(struct android_app *app) { if (!strncmp(url, "content:", 8)) { + Con_Printf(CON_ERROR"Content uris are not supported\n"); /*Java: Cursor cursor = this.getContentResolver().query(data, null, null, null, null); cursor.moveToFirst(); @@ -697,7 +698,7 @@ void android_main(struct android_app *state) Q_strncpyz(sys_basedir, getenv("EXTERNAL_STORAGE"), sizeof(sys_basedir)); Q_strncatz(sys_basedir, "/fte", sizeof(sys_basedir)); #else //so now users have to use some big long path to install stuff instead - Q_strncatz(sys_basedir, state->activity->externalDataPath, sizeof(sys_basedir)); + Q_strncpyz(sys_basedir, state->activity->externalDataPath, sizeof(sys_basedir)); #endif Sys_Printf("Starting up (apk=%s, usr=%s)\n", sys_basepak, parms.basedir); diff --git a/engine/client/sys_linux.c b/engine/client/sys_linux.c index 7574e91aa..5855828c4 100644 --- a/engine/client/sys_linux.c +++ b/engine/client/sys_linux.c @@ -188,8 +188,8 @@ void Sys_Printf (char *fmt, ...) if (codeflags & CON_HIDDEN) continue; - if (codepoint == '\n' && (codeflags&CON_NONCLEARBG)) - codeflags &= CON_WHITEMASK; //make sure we don't get annoying backgrounds on other lines. + if ((codeflags&CON_RICHFORECOLOUR) || (codepoint == '\n' && (codeflags&CON_NONCLEARBG))) + codeflags = CON_WHITEMASK; //make sure we don't get annoying backgrounds on other lines. ApplyColour(codeflags); w = codepoint; if (w >= 0xe000 && w < 0xe100) diff --git a/engine/common/cmd.c b/engine/common/cmd.c index deb16cba9..cf9e7d52d 100644 --- a/engine/common/cmd.c +++ b/engine/common/cmd.c @@ -2623,9 +2623,9 @@ static void Cmd_ForwardToServer_f (void) if (Q_strcasecmp(Cmd_Argv(1), "pext") == 0 && (cls.protocol != CP_NETQUAKE || cls.fteprotocolextensions2 || cls.protocol_nq != CPNQ_ID || cls.proquake_angles_hack || cls.netchan.remote_address.type != NA_LOOPBACK)) { //don't send any extension flags this if we're using cl_loopbackprotocol nqid, purely for a compat test. //if you want to record compat-demos, disable extensions instead. - unsigned int fp1 = Net_PextMask(1, cls.protocol == CP_NETQUAKE), - fp2 = Net_PextMask(2, cls.protocol == CP_NETQUAKE), - ez1 = Net_PextMask(3, cls.protocol == CP_NETQUAKE) & EZPEXT1_CLIENTADVERTISE; + unsigned int fp1 = Net_PextMask(PROTOCOL_VERSION_FTE1, cls.protocol == CP_NETQUAKE), + fp2 = Net_PextMask(PROTOCOL_VERSION_FTE2, cls.protocol == CP_NETQUAKE), + ez1 = Net_PextMask(PROTOCOL_VERSION_EZQUAKE1, cls.protocol == CP_NETQUAKE) & EZPEXT1_CLIENTADVERTISE; extern cvar_t cl_nopext; char line[256]; if (cl_nopext.ival) @@ -2635,7 +2635,7 @@ static void Cmd_ForwardToServer_f (void) } Q_strncpyz(line, "pext", sizeof(line)); if (fp1) - Q_strncatz(line, va(" %#x %#x", PROTOCOL_VERSION_FTE, fp1), sizeof(line)); + Q_strncatz(line, va(" %#x %#x", PROTOCOL_VERSION_FTE1, fp1), sizeof(line)); if (fp2) Q_strncatz(line, va(" %#x %#x", PROTOCOL_VERSION_FTE2, fp2), sizeof(line)); if (ez1) diff --git a/engine/common/common.h b/engine/common/common.h index 5fa3a1953..ae01b4b87 100644 --- a/engine/common/common.h +++ b/engine/common/common.h @@ -35,8 +35,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. //C99 has a stdint header which hopefully contains an intptr_t //its optional... but if its not in there then its unlikely you'll actually be able to get the engine to a stage where it *can* load anything #include - #define qintptr_t intptr_t - #define quintptr_t uintptr_t + typedef intptr_t qintptr_t; + typedef uintptr_t quintptr_t; #define qint16_t int16_t #define quint16_t uint16_t #define qint32_t int32_t diff --git a/engine/common/net.h b/engine/common/net.h index 5c829a545..e51960ccb 100644 --- a/engine/common/net.h +++ b/engine/common/net.h @@ -280,7 +280,7 @@ void VARGS Netchan_OutOfBandPrint (netsrc_t sock, netadr_t *adr, char *format, . void VARGS Netchan_OutOfBandTPrintf (netsrc_t sock, netadr_t *adr, int language, translation_t text, ...); qboolean Netchan_Process (netchan_t *chan); void Netchan_Setup (netsrc_t sock, netchan_t *chan, netadr_t *adr, int qport); -unsigned int Net_PextMask(int maskset, qboolean fornq); +unsigned int Net_PextMask(unsigned int protover, qboolean fornq); extern cvar_t net_mtu; qboolean Netchan_CanPacket (netchan_t *chan, int rate); diff --git a/engine/common/net_chan.c b/engine/common/net_chan.c index 1562fc53f..70a3e91b5 100644 --- a/engine/common/net_chan.c +++ b/engine/common/net_chan.c @@ -100,10 +100,10 @@ cvar_t pext_predinfo = CVARD("pext_predinfo", "1", "Enables some extra things to #endif /*returns the entire bitmask of supported+enabled extensions*/ -unsigned int Net_PextMask(int maskset, qboolean fornq) +unsigned int Net_PextMask(unsigned int protover, qboolean fornq) { unsigned int mask = 0; - if (maskset == 1) /*FTEX*/ + if (protover == PROTOCOL_VERSION_FTE1) { #ifdef PEXT_SCALE mask |= PEXT_SCALE; @@ -201,7 +201,7 @@ unsigned int Net_PextMask(int maskset, qboolean fornq) mask &= ~(PEXT_SCALE|PEXT_TRANS|PEXT_ACCURATETIMINGS|PEXT_FATNESS|PEXT_HULLSIZE|PEXT_MODELDBL|PEXT_ENTITYDBL|PEXT_ENTITYDBL2|PEXT_COLOURMOD|PEXT_SPAWNSTATIC2|PEXT_256PACKETENTITIES|PEXT_SETATTACHMENT|PEXT_DPFLAGS); } } - else if (maskset == 2) + else if (protover == PROTOCOL_VERSION_FTE2) { mask |= PEXT2_PRYDONCURSOR; #ifdef PEXT2_VOICECHAT @@ -233,7 +233,7 @@ unsigned int Net_PextMask(int maskset, qboolean fornq) // else // mask &= ~PEXT2_PREDINFO; } - else if (maskset == 3) + else if (protover == PROTOCOL_VERSION_EZQUAKE1) { mask = EZPEXT1_FLOATENTCOORDS|EZPEXT1_SETANGLEREASON; } diff --git a/engine/common/net_wins.c b/engine/common/net_wins.c index 03ef2300d..bb8ac2eca 100644 --- a/engine/common/net_wins.c +++ b/engine/common/net_wins.c @@ -8333,6 +8333,9 @@ int QDECL VFSTCP_WriteBytes (struct vfsfile_s *file, const void *buffer, int byt Con_Printf("connection to \"%s\" timed out\n", tf->peer); return -1; //don't bother trying to read if we never connected. case NET_ENOTCONN: +#ifdef __unix__ + case EPIPE: +#endif Con_Printf("connection to \"%s\" failed\n", tf->peer); return -1; //don't bother trying to read if we never connected. default: diff --git a/engine/common/pmove.c b/engine/common/pmove.c index b78f1822e..a3b5842ed 100644 --- a/engine/common/pmove.c +++ b/engine/common/pmove.c @@ -426,7 +426,7 @@ int PM_StepSlideMove (qboolean in_air) VectorCopy (trace.endpos, pmove.origin); } - if ((in_air || movevars.slidefix) && -DotProduct(pmove.gravitydir, original) < 0) + if (in_air && -DotProduct(pmove.gravitydir, original) < 0) VectorMA(pmove.velocity, -DotProduct(pmove.velocity, pmove.gravitydir), pmove.gravitydir, pmove.velocity); //z=0 PM_SlideMove (); diff --git a/engine/common/pr_bgcmd.c b/engine/common/pr_bgcmd.c index c8c72a1e6..f2122ba01 100644 --- a/engine/common/pr_bgcmd.c +++ b/engine/common/pr_bgcmd.c @@ -5063,6 +5063,14 @@ void QCBUILTIN PF_random (pubprogfuncs_t *prinst, struct globalvars_s *pr_global //don't return 1 (it would break array[random()*array.length]; //don't return 0 either, it would break the self.nextthink = time+random()*foo; lines in walkmonster_start, resulting rarely in statue-monsters. G_FLOAT(OFS_RETURN) = (rand ()&0x7fff) / ((float)0x08000) + (0.5/0x08000); + + if (prinst->callargc) + { + if (prinst->callargc == 1) + G_FLOAT(OFS_RETURN) *= G_FLOAT(OFS_PARM0); + else + G_FLOAT(OFS_RETURN) = G_FLOAT(OFS_PARM0) + G_FLOAT(OFS_RETURN)*(G_FLOAT(OFS_PARM1)-G_FLOAT(OFS_PARM0)); + } } //float(float number, float quantity) bitshift = #218; diff --git a/engine/common/protocol.h b/engine/common/protocol.h index ee7b554d4..7eda0e703 100644 --- a/engine/common/protocol.h +++ b/engine/common/protocol.h @@ -79,13 +79,14 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define PEXT2_PREDINFO 0x00000020 //movevar stats, NQ input sequences+acks. #define PEXT2_NEWSIZEENCODING 0x00000040 //richer size encoding. #define PEXT2_INFOBLOBS 0x00000080 //serverinfo+userinfo lengths can be MUCH higher (protocol is unbounded, but expect low sanity limits on userinfo), and contain nulls etc. +//#define PEXT2_NEWINTENTS 0x00000100 //clc_move changes #define PEXT2_CLIENTSUPPORT (PEXT2_PRYDONCURSOR|PEXT2_VOICECHAT|PEXT2_SETANGLEDELTA|PEXT2_REPLACEMENTDELTAS|PEXT2_MAXPLAYERS|PEXT2_PREDINFO|PEXT2_NEWSIZEENCODING|PEXT2_INFOBLOBS) -//EzQuake/Mvdsv extensions +//EzQuake/Mvdsv extensions. (use ezquake name, to avoid confusion about .mvd format and its protocol differences) #define EZPEXT1_FLOATENTCOORDS 0x00000001 //quirky - doesn't apply to broadcasts, just players+ents. this gives more precision, but will bug out if you try using it to increase map bounds in ways that may not be immediately apparent. iiuc this was added instead of fixing some inconsistent rounding... #define EZPEXT1_SETANGLEREASON 0x00000002 //specifies the reason for an svc_setangles call. the mvdsv implementation will fuck over any mods that writebyte them. we'd need to modify our preparse stuff to work around the issue. #define EZPEXT1_SERVERADVERTISE 0 -#define EZPEXT1_CLIENTADVERTISE 0 // +#define EZPEXT1_CLIENTADVERTISE EZPEXT1_FLOATENTCOORDS //might as well ask for it, as a way around mvdsv's writecoord/PM_NudgePosition rounding difference bug. #define EZPEXT1_CLIENTSUPPORT (EZPEXT1_FLOATENTCOORDS|EZPEXT1_SETANGLEREASON) //ones we can support in demos. warning if other bits. //ZQuake transparent protocol extensions. @@ -111,7 +112,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define PROTOCOL_VERSION_VARLENGTH (('v'<<0) + ('l'<<8) + ('e'<<16) + ('n' << 24)) //variable length handshake -#define PROTOCOL_VERSION_FTE (('F'<<0) + ('T'<<8) + ('E'<<16) + ('X' << 24)) //fte extensions. +#define PROTOCOL_VERSION_FTE1 (('F'<<0) + ('T'<<8) + ('E'<<16) + ('X' << 24)) //fte extensions. #define PROTOCOL_VERSION_FTE2 (('F'<<0) + ('T'<<8) + ('E'<<16) + ('2' << 24)) //fte extensions. #define PROTOCOL_VERSION_EZQUAKE1 (('M'<<0) + ('V'<<8) + ('D'<<16) + ('1' << 24)) //ezquake/mvdsv extensions #define PROTOCOL_VERSION_HUFFMAN (('H'<<0) + ('U'<<8) + ('F'<<16) + ('F' << 24)) //packet compression diff --git a/engine/droid/fte.cfg b/engine/droid/fte.cfg index b1b55fa75..ca98a5860 100644 --- a/engine/droid/fte.cfg +++ b/engine/droid/fte.cfg @@ -3,8 +3,8 @@ bind mouse1 +attack //left area of the screen bind mouse2 +jump //right area of the screen bind menu "toggleconsole" -bind volup inv volume 0.1 -bind voldown inv volume -0.1 +bind volup inc volume 0.1 +bind voldown inc volume -0.1 // Appearance settings diff --git a/engine/droid/src/com/fteqw/FTENativeActivity.java b/engine/droid/src/com/fteqw/FTENativeActivity.java index fba1c3d59..b6e358796 100644 --- a/engine/droid/src/com/fteqw/FTENativeActivity.java +++ b/engine/droid/src/com/fteqw/FTENativeActivity.java @@ -226,7 +226,7 @@ public class FTENativeActivity extends android.app.NativeActivity canrelative = true; //yay, no exceptions. android.util.Log.i("FTEDroid", "relative mouse supported"); - MotionEvent_getButtonState = MotionEvent.class.getMethod("getButtonState"); + MotionEvent_getButtonState = MotionEvent.class.getMethod("getButtonState"); //api14ish canbuttons = true; android.util.Log.i("FTEDroid", "mouse buttons supported"); } catch(Exception e) { @@ -323,7 +323,7 @@ public class FTENativeActivity extends android.app.NativeActivity y = event.getY(id); size = event.getSize(id); id = event.getPointerId(id); - if (canbuttons) + if (canbuttons && event.getSource() == SOURCE_MOUSE) { try {mousepress(id, (Integer)MotionEvent_getButtonState.invoke(event));} catch(Exception e){} @@ -338,7 +338,7 @@ public class FTENativeActivity extends android.app.NativeActivity y = event.getY(id); size = event.getSize(id); id = event.getPointerId(id); - if (canbuttons) + if (canbuttons && event.getSource() == SOURCE_MOUSE) { try {mousepress(id, (Integer)MotionEvent_getButtonState.invoke(event));} catch(Exception e){} diff --git a/engine/gl/gl_heightmap.c b/engine/gl/gl_heightmap.c index 0c7db1e86..b664381e5 100644 --- a/engine/gl/gl_heightmap.c +++ b/engine/gl/gl_heightmap.c @@ -5929,7 +5929,7 @@ void Terr_Brush_Draw(heightmap_t *hm, batch_t **batches, entity_t *e) bb->next = bt->batches; bt->batches = bb; bb->lightmap = lmnum; - BE_VBO_Begin(&ctx, (sizeof(arrays->coord[0])+sizeof(arrays->texcoord[0])+sizeof(arrays->lmcoord[0])+sizeof(arrays->normal[0])+sizeof(arrays->svector[0])+sizeof(arrays->tvector[0])) * numverts); + BE_VBO_Begin(&ctx, (sizeof(arrays->coord[0])+sizeof(arrays->texcoord[0])+sizeof(arrays->lmcoord[0])+sizeof(arrays->normal[0])+sizeof(arrays->svector[0])+sizeof(arrays->tvector[0])+sizeof(arrays->rgba[0])) * numverts); BE_VBO_Data(&ctx, arrays->coord, sizeof(arrays->coord [0])*numverts, &bb->vbo.coord); BE_VBO_Data(&ctx, arrays->texcoord, sizeof(arrays->texcoord [0])*numverts, &bb->vbo.texcoord); BE_VBO_Data(&ctx, arrays->lmcoord, sizeof(arrays->lmcoord [0])*numverts, &bb->vbo.lmcoord[0]); diff --git a/engine/gl/gl_shader.c b/engine/gl/gl_shader.c index 64c496751..3b87a5090 100644 --- a/engine/gl/gl_shader.c +++ b/engine/gl/gl_shader.c @@ -7381,36 +7381,36 @@ static char *Shader_DecomposeSubPass(char *o, shader_t *s, shaderpass_t *p, qboo switch(p->texgen) { default: sprintf(o, "T_GEN_? "); break; - case T_GEN_SINGLEMAP: Shader_DecomposeSubPassMap(o, s, "singlemap", p->anim_frames[0]); break; + case T_GEN_SINGLEMAP: Shader_DecomposeSubPassMap(o, s, "map", p->anim_frames[0]); break; case T_GEN_ANIMMAP: Shader_DecomposeSubPassMap(o, s, "animmap", p->anim_frames[0]); break; #ifdef HAVE_MEDIA_DECODER case T_GEN_VIDEOMAP: Shader_DecomposeSubPassMap(o, s, "videomap", Media_UpdateForShader(p->cin)); break; #endif - case T_GEN_CUBEMAP: Shader_DecomposeSubPassMap(o, s, "cubemap", p->anim_frames[0]); break; - case T_GEN_3DMAP: Shader_DecomposeSubPassMap(o, s, "3dmap", p->anim_frames[0]); break; - case T_GEN_LIGHTMAP: sprintf(o, "lightmap "); break; - case T_GEN_DELUXMAP: sprintf(o, "deluxemap "); break; - case T_GEN_SHADOWMAP: sprintf(o, "shadowmap "); break; - case T_GEN_LIGHTCUBEMAP: sprintf(o, "lightcubemap "); break; - case T_GEN_DIFFUSE: Shader_DecomposeSubPassMap(o, s, "diffuse", s->defaulttextures[0].base); break; - case T_GEN_NORMALMAP: Shader_DecomposeSubPassMap(o, s, "normalmap", s->defaulttextures[0].bump); break; - case T_GEN_SPECULAR: Shader_DecomposeSubPassMap(o, s, "specular", s->defaulttextures[0].specular); break; - case T_GEN_UPPEROVERLAY: Shader_DecomposeSubPassMap(o, s, "upper", s->defaulttextures[0].upperoverlay); break; - case T_GEN_LOWEROVERLAY: Shader_DecomposeSubPassMap(o, s, "lower", s->defaulttextures[0].loweroverlay); break; - case T_GEN_FULLBRIGHT: Shader_DecomposeSubPassMap(o, s, "fullbright", s->defaulttextures[0].fullbright); break; - case T_GEN_PALETTED: Shader_DecomposeSubPassMap(o, s, "paletted", s->defaulttextures[0].paletted); break; - case T_GEN_REFLECTCUBE: Shader_DecomposeSubPassMap(o, s, "reflectcube", s->defaulttextures[0].reflectcube); break; - case T_GEN_REFLECTMASK: Shader_DecomposeSubPassMap(o, s, "reflectmask", s->defaulttextures[0].reflectmask); break; - case T_GEN_DISPLACEMENT: Shader_DecomposeSubPassMap(o, s, "displacement", s->defaulttextures[0].displacement); break; - case T_GEN_CURRENTRENDER: sprintf(o, "currentrender "); break; - case T_GEN_SOURCECOLOUR: sprintf(o, "sourcecolour"); break; - case T_GEN_SOURCEDEPTH: sprintf(o, "sourcedepth"); break; - case T_GEN_REFLECTION: sprintf(o, "reflection"); break; - case T_GEN_REFRACTION: sprintf(o, "refraction"); break; - case T_GEN_REFRACTIONDEPTH: sprintf(o, "refractiondepth"); break; - case T_GEN_RIPPLEMAP: sprintf(o, "ripplemap"); break; - case T_GEN_SOURCECUBE: sprintf(o, "sourcecube"); break; - case T_GEN_GBUFFERCASE: sprintf(o, "gbuffer%i ",p->texgen-T_GEN_GBUFFER0); break; + case T_GEN_CUBEMAP: Shader_DecomposeSubPassMap(o, s, "map $cubemap", p->anim_frames[0]); break; + case T_GEN_3DMAP: Shader_DecomposeSubPassMap(o, s, "map $3dmap", p->anim_frames[0]); break; + case T_GEN_LIGHTMAP: sprintf(o, "map $lightmap "); break; + case T_GEN_DELUXMAP: sprintf(o, "map $deluxemap "); break; + case T_GEN_SHADOWMAP: sprintf(o, "map $shadowmap "); break; + case T_GEN_LIGHTCUBEMAP: sprintf(o, "map $lightcubemap "); break; + case T_GEN_DIFFUSE: Shader_DecomposeSubPassMap(o, s, "map $diffuse", s->defaulttextures[0].base); break; + case T_GEN_NORMALMAP: Shader_DecomposeSubPassMap(o, s, "map $normalmap", s->defaulttextures[0].bump); break; + case T_GEN_SPECULAR: Shader_DecomposeSubPassMap(o, s, "map $specular", s->defaulttextures[0].specular); break; + case T_GEN_UPPEROVERLAY: Shader_DecomposeSubPassMap(o, s, "map $upper", s->defaulttextures[0].upperoverlay); break; + case T_GEN_LOWEROVERLAY: Shader_DecomposeSubPassMap(o, s, "map $lower", s->defaulttextures[0].loweroverlay); break; + case T_GEN_FULLBRIGHT: Shader_DecomposeSubPassMap(o, s, "map $fullbright", s->defaulttextures[0].fullbright); break; + case T_GEN_PALETTED: Shader_DecomposeSubPassMap(o, s, "map $paletted", s->defaulttextures[0].paletted); break; + case T_GEN_REFLECTCUBE: Shader_DecomposeSubPassMap(o, s, "map $reflectcube", s->defaulttextures[0].reflectcube); break; + case T_GEN_REFLECTMASK: Shader_DecomposeSubPassMap(o, s, "map $reflectmask", s->defaulttextures[0].reflectmask); break; + case T_GEN_DISPLACEMENT: Shader_DecomposeSubPassMap(o, s, "map $displacement", s->defaulttextures[0].displacement); break; + case T_GEN_CURRENTRENDER: sprintf(o, "map $currentrender "); break; + case T_GEN_SOURCECOLOUR: sprintf(o, "map $sourcecolour"); break; + case T_GEN_SOURCEDEPTH: sprintf(o, "map $sourcedepth"); break; + case T_GEN_REFLECTION: sprintf(o, "map $reflection"); break; + case T_GEN_REFRACTION: sprintf(o, "map $refraction"); break; + case T_GEN_REFRACTIONDEPTH: sprintf(o, "map $refractiondepth"); break; + case T_GEN_RIPPLEMAP: sprintf(o, "map $ripplemap"); break; + case T_GEN_SOURCECUBE: sprintf(o, "map $sourcecube"); break; + case T_GEN_GBUFFERCASE: sprintf(o, "map $gbuffer%i ",p->texgen-T_GEN_GBUFFER0); break; } o+=strlen(o); diff --git a/engine/gl/gl_shadow.c b/engine/gl/gl_shadow.c index 221d77e23..45fdd6c3e 100644 --- a/engine/gl/gl_shadow.c +++ b/engine/gl/gl_shadow.c @@ -3820,6 +3820,15 @@ void Sh_CalcPointLight(vec3_t point, vec3_t light) } } +void Sh_OrthoAlignToFrustum(dlight_t *dl) +{ + vec3_t neworg; + //there's 1 sample every dl->radius/(SHADOWMAP_SIZE*2) + //fixme: fit to frustum + VectorMA(r_origin, dl->radius/3, vpn, neworg); + VectorCopy(neworg, dl->origin); +} + int drawdlightnum; void Sh_DrawLights(qbyte *vis) { @@ -3954,12 +3963,11 @@ void Sh_DrawLights(qbyte *vis) drawdlightnum++; if (dl->flags & LFLAG_ORTHO) { - vec3_t saveorg = {dl->origin[0], dl->origin[1], dl->origin[2]}, neworg; + vec3_t saveorg = {dl->origin[0], dl->origin[1], dl->origin[2]}; vec3_t saveaxis[3]; memcpy(saveaxis, dl->axis, sizeof(saveaxis)); memcpy(dl->axis, axis, sizeof(saveaxis)); - VectorMA(r_origin, dl->radius/3, vpn, neworg); - VectorCopy(neworg, dl->origin); + Sh_OrthoAlignToFrustum(dl); dl->rebuildcache = true; Sh_DrawShadowMapLight(dl, colour, axis, NULL); VectorCopy(saveorg, dl->origin); diff --git a/engine/gl/gl_vidlinuxglx.c b/engine/gl/gl_vidlinuxglx.c index b09b846bd..54737bfe2 100644 --- a/engine/gl/gl_vidlinuxglx.c +++ b/engine/gl/gl_vidlinuxglx.c @@ -952,7 +952,7 @@ static void XRandR_SelectMode(const char *devicename, int *x, int *y, int *width if (COM_CheckParm("-current")) return; - if (XRandR_FindOutput(devicename)) + if (xrandr.crtcinfo) { XRRCrtcInfo *c; xrandr.crtcmode = XRandR_FindBestMode(*width, *height, rate); @@ -3854,9 +3854,9 @@ static qboolean X11VID_Init (rendererstate_t *info, unsigned char *palette, int fullscreenflags |= FULLSCREEN_DESKTOP; #ifdef USE_XRANDR XRandR_Init(); + XRandR_FindOutput(info->devicename); if (fullscreen && !(fullscreenflags & FULLSCREEN_ANYMODE)) XRandR_SelectMode(info->devicename, &x, &y, &width, &height, rate); - XRandR_FindOutput(info->devicename); #endif #ifdef USE_VMODE @@ -3884,7 +3884,7 @@ static qboolean X11VID_Init (rendererstate_t *info, unsigned char *palette, int //window managers fuck up too much if we change the video mode and request the windowmanager make us fullscreen. //we assume that window manages will understand xrandr, as that actually provides notifications that things have changed. - if (!(fullscreenflags & FULLSCREEN_VMODE) && X_CheckWMFullscreenAvailable()) + if (!(fullscreenflags & (FULLSCREEN_VMODE|FULLSCREEN_XRANDR)) && X_CheckWMFullscreenAvailable()) fullscreenflags |= FULLSCREEN_WM; else fullscreenflags |= FULLSCREEN_LEGACY; diff --git a/engine/gl/gl_vidsdl.c b/engine/gl/gl_vidsdl.c index aaac36789..cb2e10aa3 100644 --- a/engine/gl/gl_vidsdl.c +++ b/engine/gl/gl_vidsdl.c @@ -201,7 +201,8 @@ static qboolean SDLVID_Init (rendererstate_t *info, unsigned char *palette, r_qr } if (info->fullscreen) flags |= SDL_WINDOW_FULLSCREEN; - flags |= SDL_WINDOW_RESIZABLE; + else + flags |= SDL_WINDOW_RESIZABLE; flags |= SDL_WINDOW_INPUT_GRABBED; flags |= SDL_WINDOW_SHOWN; #if SDL_PATCHLEVEL >= 1 @@ -502,6 +503,7 @@ static qboolean VKVID_Init (rendererstate_t *info, unsigned char *palette) extnames = alloca(sizeof(*extnames)*(extcount+1)); if (!SDL_Vulkan_GetInstanceExtensions(sdlwindow, &extcount, extnames)) return false; + extnames[extcount] = 0; vkGetInstanceProcAddr = SDL_Vulkan_GetVkGetInstanceProcAddr(); if (!VK_Init(info, extnames, VKSDL_CreateSurface, NULL)) diff --git a/engine/http/httpclient.c b/engine/http/httpclient.c index 6b1c7463c..4360087bd 100644 --- a/engine/http/httpclient.c +++ b/engine/http/httpclient.c @@ -371,7 +371,7 @@ void Cookie_Monster(void) //parses Set-Cookie: THISPARTONLY\r\n //we don't support: -//domain) we don't have a list of composite roots, like .co.uk, and thus this wouldn't work very safely anyway. thus we require the exact same host each time +//domain) we don't have a list of public suffixes, like .co.uk, and thus cannot safely block dangerous super-cookies. thus we require the exact same host each time //path) I'm going to call this an optimisation feature and not bother with it... hopefully there won't be too many sites that have sub-paths or third-party stuff... gah. //httponly) irrelevant until we support javascript... which we don't. //secure) assumed to be true. https:// vs http:// are thus completely independant. sorry. diff --git a/engine/server/net_preparse.c b/engine/server/net_preparse.c index 747afab21..36e34a0d0 100644 --- a/engine/server/net_preparse.c +++ b/engine/server/net_preparse.c @@ -571,7 +571,9 @@ static sizebuf_t *writedest; static client_t *cldest; struct netprim_s *destprim; static int majortype; +#ifdef NQPROT static int minortype; +#endif static int protocollen; static qbyte buffer[MAX_QWMSGLEN]; diff --git a/engine/server/pr_cmds.c b/engine/server/pr_cmds.c index e91316fb3..20ab343ca 100644 --- a/engine/server/pr_cmds.c +++ b/engine/server/pr_cmds.c @@ -6915,7 +6915,7 @@ lh_extension_t *checkfteextensioncl(int mask, const char *name) //true if the ci lh_extension_t *checkfteextensionsv(const char *name) //true if the server supports an protocol extension. { - return checkfteextensioncl(Net_PextMask(1, false), name); + return checkfteextensioncl(Net_PextMask(PROTOCOL_VERSION_FTE1, false), name); } lh_extension_t *checkextension(const char *name) @@ -11636,7 +11636,7 @@ void PR_SVExtensionList_f(void) if (i < 32) { - if (!(Net_PextMask(1, false) & (1<name); } -#ifdef HAVE_LEGACY +#if defined(HAVE_LEGACY) && defined(MVD_RECORDING) SV_DownloadQueueClear(drop); #endif if (drop->download) @@ -1091,6 +1091,7 @@ char *SV_PlayerPublicAddress(client_t *cl) #define STATUS_SPECTATORS 4 #define STATUS_SPECTATORS_AS_PLAYERS 8 //for ASE - change only frags: show as "S" #define STATUS_SHOWTEAMS 16 +#define STATUS_QTVLIST 32 //qtv destid "name" "streamid@host:port" numviewers /* ================ @@ -1180,6 +1181,17 @@ static void SVC_Status (void) else slots++; } +#ifdef MVD_RECORDING + if (displayflags & STATUS_QTVLIST) + { + struct mvddest_s *d; + for (d = demo.dest; d; d = d->nextdest) + { + if (d->desttype == DEST_STREAM) + Con_Printf("qtv %d \"%s\" \"%s\" %d\n", d->id, d->simplename, d->filename, 0/*d->viewercount*/); + } + } +#endif SV_EndRedirect (); } @@ -1578,10 +1590,10 @@ qboolean SVC_GetChallenge (qboolean respond_dp) { unsigned int mask; //tell the client what fte extensions we support - mask = Net_PextMask(1, false); + mask = Net_PextMask(PROTOCOL_VERSION_FTE1, false); if (mask) { - lng = LittleLong(PROTOCOL_VERSION_FTE); + lng = LittleLong(PROTOCOL_VERSION_FTE1); memcpy(over, &lng, sizeof(lng)); over+=sizeof(lng); @@ -1590,7 +1602,7 @@ qboolean SVC_GetChallenge (qboolean respond_dp) over+=sizeof(lng); } //tell the client what fte extensions we support - mask = Net_PextMask(2, false); + mask = Net_PextMask(PROTOCOL_VERSION_FTE2, false); if (mask) { lng = LittleLong(PROTOCOL_VERSION_FTE2); @@ -1601,6 +1613,19 @@ qboolean SVC_GetChallenge (qboolean respond_dp) memcpy(over, &lng, sizeof(lng)); over+=sizeof(lng); } + //tell the client what mvdsv/ezquake extensions we support + mask = Net_PextMask(PROTOCOL_VERSION_EZQUAKE1, false); + if (mask) + { + lng = LittleLong(PROTOCOL_VERSION_EZQUAKE1); + memcpy(over, &lng, sizeof(lng)); + over+=sizeof(lng); + + lng = LittleLong(mask); + memcpy(over, &lng, sizeof(lng)); + over+=sizeof(lng); + } + //report the mtu if (*net_mtu.string) mask = net_mtu.ival&~7; else @@ -1913,9 +1938,9 @@ void SV_ClientProtocolExtensionsChanged(client_t *client) extern cvar_t pr_maxedicts; client_t *seat; - client->fteprotocolextensions &= Net_PextMask(1, ISNQCLIENT(client)); - client->fteprotocolextensions2 &= Net_PextMask(2, ISNQCLIENT(client)); - client->ezprotocolextensions1 &= Net_PextMask(3, ISNQCLIENT(client)) & EZPEXT1_SERVERADVERTISE; + client->fteprotocolextensions &= Net_PextMask(PROTOCOL_VERSION_FTE1, ISNQCLIENT(client)); + client->fteprotocolextensions2 &= Net_PextMask(PROTOCOL_VERSION_FTE2, ISNQCLIENT(client)); + client->ezprotocolextensions1 &= Net_PextMask(PROTOCOL_VERSION_EZQUAKE1, ISNQCLIENT(client)) & EZPEXT1_SERVERADVERTISE; //some gamecode can't cope with some extensions for some reasons... and I'm too lazy to fix the code to cope. if (svs.gametype == GT_HALFLIFE) @@ -2615,7 +2640,7 @@ client_t *SVC_DirectConnect(void) Cmd_TokenizeString(MSG_ReadStringLine(), false, false); switch(Q_atoi(Cmd_Argv(0))) { - case PROTOCOL_VERSION_FTE: + case PROTOCOL_VERSION_FTE1: if (protocol == SCP_QUAKEWORLD || protocol == SCP_QUAKE2) { protextsupported = Q_atoi(Cmd_Argv(1)); @@ -3116,10 +3141,12 @@ client_t *SVC_DirectConnect(void) #endif newcl->netchan.compresstable = NULL; if (mtu >= 64) - { + { //if we support application fragmenting, then we can send massive reliables without too much issue newcl->netchan.fragmentsize = mtu; newcl->netchan.message.maxsize = sizeof(newcl->netchan.message_buf); } + else //otherwise we can't fragment the packets, and the only way to honour the mtu is to send less data. yay for more round-trips. + newcl->netchan.message.maxsize = min(newcl->netchan.message.maxsize, max(net_mtu.ival, 512)); newcl->protocol = protocol; #ifdef NQPROT @@ -5772,6 +5799,8 @@ void SV_ExecInitialConfigs(char *defaultexec) Cbuf_AddText(defaultexec, RESTRICT_LOCAL); Cbuf_AddText("\n", RESTRICT_LOCAL); + //make sure +set args override fmf/engine defaults (redundant when there's no map/etc command in configs) + COM_ParsePlusSets(true); if (COM_FileSize("server.cfg") != -1) Cbuf_AddText ("cl_warncmd 1\nexec server.cfg\nexec ftesrv.cfg\n", RESTRICT_LOCAL); @@ -5784,6 +5813,9 @@ void SV_ExecInitialConfigs(char *defaultexec) else Cbuf_AddText ("cl_warncmd 0\nexec default.cfg\ncl_warncmd 1\nexec ftesrv.cfg\n", RESTRICT_LOCAL); + //make sure +set stuff still applies... + COM_ParsePlusSets(true); + // process command line arguments Cbuf_Execute (); diff --git a/engine/server/sv_mvd.c b/engine/server/sv_mvd.c index 17fec52fa..956878998 100644 --- a/engine/server/sv_mvd.c +++ b/engine/server/sv_mvd.c @@ -84,7 +84,7 @@ static char demomsgbuf[MAX_OVERALLMSGLEN]; static mvddest_t *singledest; //used when a stream is starting up so redundant data doesn't get dumped into other streams -static mvddest_t *SV_MVD_InitStream(vfsfile_t *stream); +static mvddest_t *SV_MVD_InitStream(vfsfile_t *stream, const char *info); qboolean SV_MVD_Record (mvddest_t *dest); char *SV_MVDName2Txt(char *name); extern cvar_t qtv_password; @@ -103,23 +103,27 @@ static void DestClose(mvddest_t *d, enum mvdclosereason_e reason) if (d->file) { VFS_CLOSE(d->file); - FS_FlushFSHashWritten(d->filename); + if (d->desttype != DEST_STREAM) + FS_FlushFSHashWritten(d->filename); } - if (reason == MVD_CLOSE_CANCEL) + if (d->desttype != DEST_STREAM) { - FS_Remove(d->filename, FS_GAMEONLY); + if (reason == MVD_CLOSE_CANCEL) + { + FS_Remove(d->filename, FS_GAMEONLY); - FS_Remove(SV_MVDName2Txt(d->filename), FS_GAMEONLY); + FS_Remove(SV_MVDName2Txt(d->filename), FS_GAMEONLY); - //SV_BroadcastPrintf (PRINT_CHAT, "Server recording canceled, demo removed\n"); - } - else if (d->desttype != DEST_STREAM) - { - char buf[512]; - Q_strncpyz(demolog.log[demolog.sequence%DEMOLOG_LENGTH].filename, d->simplename, sizeof(demolog.log[demolog.sequence%DEMOLOG_LENGTH].filename)); - demolog.sequence++; - SV_BroadcastPrintf (PRINT_CHAT, "Server recording complete\n^[/download %s^]\n", COM_QuotedString(va("demos/%s",d->simplename), buf, sizeof(buf), false)); + //SV_BroadcastPrintf (PRINT_CHAT, "Server recording canceled, demo removed\n"); + } + else + { + char buf[512]; + Q_strncpyz(demolog.log[demolog.sequence%DEMOLOG_LENGTH].filename, d->simplename, sizeof(demolog.log[demolog.sequence%DEMOLOG_LENGTH].filename)); + demolog.sequence++; + SV_BroadcastPrintf (PRINT_CHAT, "Server recording complete\n^[/download %s^]\n", COM_QuotedString(va("demos/%s",d->simplename), buf, sizeof(buf), false)); + } } Z_Free(d); @@ -247,6 +251,7 @@ int SV_MVD_GotQTVRequest(vfsfile_t *clientstream, char *headerstart, char *heade int versiontouse = 0; int raw = 0; char password[256] = ""; + char userinfo[1024]; enum { QTVAM_NONE, QTVAM_PLAIN, @@ -278,6 +283,7 @@ int SV_MVD_GotQTVRequest(vfsfile_t *clientstream, char *headerstart, char *heade return QTV_ERROR; } + *userinfo = 0; for(;;) { lineend = strchr(start, '\n'); @@ -359,6 +365,7 @@ int SV_MVD_GotQTVRequest(vfsfile_t *clientstream, char *headerstart, char *heade else if (!strcmp(com_token, "USERINFO")) { //if we were treating this as a regular client over tcp (qizmo...) + start = COM_ParseTokenOut(start, NULL, userinfo, sizeof(userinfo), &com_tokentype); } else { @@ -528,7 +535,7 @@ int SV_MVD_GotQTVRequest(vfsfile_t *clientstream, char *headerstart, char *heade { if (p->hasauthed == true) { - SV_MVD_Record(SV_MVD_InitStream(clientstream)); + SV_MVD_Record(SV_MVD_InitStream(clientstream, userinfo)); return QTV_ACCEPT; } } @@ -542,7 +549,7 @@ int SV_MVD_GotQTVRequest(vfsfile_t *clientstream, char *headerstart, char *heade "\n"); VFS_WRITE(clientstream, e, strlen(e)); e = NULL; - dst = SV_MVD_InitStream(clientstream); + dst = SV_MVD_InitStream(clientstream, userinfo); dst->droponmapchange = p->isreverse; SV_MVD_Record(dst); return QTV_ACCEPT; @@ -1443,7 +1450,7 @@ void SV_Demo_PrintOutputs(void) } } -static mvddest_t *SV_MVD_InitStream(vfsfile_t *stream) +static mvddest_t *SV_MVD_InitStream(vfsfile_t *stream, const char *info) { mvddest_t *dst; @@ -1462,6 +1469,21 @@ static mvddest_t *SV_MVD_InitStream(vfsfile_t *stream) dst->maxcachesize = 0x8000; //is this too small? dst->cache = BZ_Malloc(dst->maxcachesize); dst->droponmapchange = false; + *dst->filename = 0; + *dst->simplename = 0; + + if (info) + { + char *s = Info_ValueForKey(info, "name"); + Q_strncpyz(dst->simplename, s, sizeof(dst->simplename)); + + s = Info_ValueForKey(info, "streamid"); + Q_strncpyz(dst->filename, s, sizeof(dst->filename)); + s = Info_ValueForKey(info, "address"); + if (*dst->filename && *s) + Q_strncatz(dst->filename, "@", sizeof(dst->filename)); + Q_strncatz(dst->filename, s, sizeof(dst->filename)); + } return dst; } @@ -1599,9 +1621,12 @@ void SV_WriteSetMVDMessage (void) void SV_MVD_SendInitialGamestate(mvddest_t *dest); qboolean SV_MVD_Record (mvddest_t *dest) { + static int destid; if (!dest) return false; + dest->id = ++destid; //give each stream a unique id, for no real reason other than for other people to track it via SVC_Status(|32). + SV_MVD_WriteReliables(false); DestFlush(true); @@ -1729,7 +1754,7 @@ void SV_MVD_SendInitialGamestate(mvddest_t *dest) if (demo.recorder.fteprotocolextensions) { - MSG_WriteLong(&buf, PROTOCOL_VERSION_FTE); + MSG_WriteLong(&buf, PROTOCOL_VERSION_FTE1); MSG_WriteLong(&buf, demo.recorder.fteprotocolextensions); } if (demo.recorder.fteprotocolextensions2) diff --git a/engine/server/sv_phys.c b/engine/server/sv_phys.c index 38c545fb7..263771e84 100644 --- a/engine/server/sv_phys.c +++ b/engine/server/sv_phys.c @@ -58,25 +58,26 @@ cvar_t sv_gameplayfix_noairborncorpse = CVAR( "sv_gameplayfix_noairborncorpse", cvar_t sv_gameplayfix_multiplethinks = CVARD( "sv_gameplayfix_multiplethinks", "1", "Enables multiple thinks per entity per frame so small nextthink times are accurate. QuakeWorld mods expect a value of 1, while NQ expects 0."); cvar_t sv_gameplayfix_stepdown = CVARD( "sv_gameplayfix_stepdown", "0", "Attempt to step down steps, instead of only up them. Affects non-predicted movetype_walk."); cvar_t sv_gameplayfix_bouncedownslopes = CVARD( "sv_gameplayfix_grenadebouncedownslopes", "0", "MOVETYPE_BOUNCE speeds are calculated relative to the impacted surface, instead of the vertical, reducing the chance of grenades just sitting there on slopes."); +cvar_t sv_gameplayfix_trappedwithin = CVARD( "sv_gameplayfix_trappedwithin", "0", "Blocks further entity movement when an entity is already inside another entity. This ensures that bsp precision issues cannot allow the entity to completely pass through eg the world."); #if !defined(CLIENTONLY) && defined(NQPROT) && defined(HAVE_LEGACY) cvar_t sv_gameplayfix_spawnbeforethinks = CVARD( "sv_gameplayfix_spawnbeforethinks", "0", "Fixes an issue where player thinks (including Pre+Post) can be called before PutClientInServer. Unfortunately at least one mod depends upon PreThink being called first in order to correctly determine spawn positions."); #endif cvar_t dpcompat_noretouchground = CVARD( "dpcompat_noretouchground", "0", "Prevents entities that are already standing on an entity from touching the same entity again."); cvar_t sv_sound_watersplash = CVAR( "sv_sound_watersplash", "misc/h2ohit1.wav"); cvar_t sv_sound_land = CVAR( "sv_sound_land", "demon/dland2.wav"); -cvar_t sv_stepheight = CVARAFD("pm_stepheight", "", "sv_stepheight", CVAR_SERVERINFO, "If empty, the value "STRINGIFY(PM_DEFAULTSTEPHEIGHT)" will be used instead. This is the size of the step you can step up or down."); +cvar_t sv_stepheight = CVARAFD("pm_stepheight", "", /*dp*/"sv_stepheight", CVAR_SERVERINFO, "If empty, the value "STRINGIFY(PM_DEFAULTSTEPHEIGHT)" will be used instead. This is the size of the step you can step up or down."); cvar_t pm_ktjump = CVARF("pm_ktjump", "", CVAR_SERVERINFO); cvar_t pm_bunnyspeedcap = CVARFD("pm_bunnyspeedcap", "", CVAR_SERVERINFO, "0 or 1, ish. If the player is traveling faster than this speed while turning, their velocity will be gracefully reduced to match their current maxspeed. You can still rocket-jump to gain high velocity, but turning will reduce your speed back to the max. This can be used to disable bunny hopping."); cvar_t pm_watersinkspeed = CVARFD("pm_watersinkspeed", "", CVAR_SERVERINFO, "This is the speed that players will sink at while inactive in water. Empty means 60."); cvar_t pm_flyfriction = CVARFD("pm_flyfriction", "", CVAR_SERVERINFO, "Amount of friction that applies in fly or 6dof mode. Empty means 4."); -cvar_t pm_slidefix = CVARFD("pm_slidefix", "", CVAR_SERVERINFO, "Fixes an issue when jumping down slopes (ie: they act more like slopes and not steps)"); +cvar_t pm_slidefix = CVARFD("pm_slidefix", "", CVAR_SERVERINFO, "Fixes an issue when walking down slopes (ie: so they act more like slopes and not a series of steps)"); cvar_t pm_slidyslopes = CVARFD("pm_slidyslopes", "", CVAR_SERVERINFO, "Replicates NQ behaviour, where players will slowly slide down ramps"); cvar_t pm_airstep = CVARAFD("pm_airstep", "", /*dp*/"sv_jumpstep", CVAR_SERVERINFO, "Allows players to step up while jumping. This makes stairs more graceful but also increases potential jump heights."); cvar_t pm_pground = CVARFD("pm_pground", "", CVAR_SERVERINFO, "Use persisten onground state instead of recalculating every frame."CON_WARNING"Do NOT use with nq mods, as most nq mods will interfere with onground state, resulting in glitches."); cvar_t pm_stepdown = CVARFD("pm_stepdown", "", CVAR_SERVERINFO, "Causes physics to stick to the ground, instead of constantly losing traction whiloe going down steps."); cvar_t pm_walljump = CVARFD("pm_walljump", "", CVAR_SERVERINFO, "Allows the player to bounce off walls while arborne."); -cvar_t pm_edgefriction = CVARAFD("pm_edgefriction", "", /*dp*/"edgefriction", CVAR_SERVERINFO, "Default value of 2"); +cvar_t pm_edgefriction = CVARAFD("pm_edgefriction", "", /*nq*/"edgefriction", CVAR_SERVERINFO, "Default value of 2"); #define cvargroup_serverphysics "server physics variables" void WPhys_Init(void) @@ -100,6 +101,7 @@ void WPhys_Init(void) Cvar_Register (&sv_gameplayfix_multiplethinks, cvargroup_serverphysics); Cvar_Register (&sv_gameplayfix_stepdown, cvargroup_serverphysics); Cvar_Register (&sv_gameplayfix_bouncedownslopes, cvargroup_serverphysics); + Cvar_Register (&sv_gameplayfix_trappedwithin, cvargroup_serverphysics); Cvar_Register (&dpcompat_noretouchground, cvargroup_serverphysics); #if !defined(CLIENTONLY) && defined(NQPROT) && defined(HAVE_LEGACY) @@ -1380,12 +1382,9 @@ static void WPhys_Physics_Toss (world_t *w, wedict_t *ent) trace = WPhys_PushEntity (w, ent, move, fl); - if (trace.allsolid && ent->v->solid != SOLID_NOT && ent->v->solid != SOLID_TRIGGER) + if (trace.allsolid && sv_gameplayfix_trappedwithin.ival && ent->v->solid != SOLID_NOT && ent->v->solid != SOLID_TRIGGER) { -#ifndef CLIENTONLY - if (progstype != PROG_H2) -#endif - trace.fraction = 0; //traces that start in solid report a fraction of 0. this is to prevent things from dropping out of the world completely. at least this way they ought to still be shootable etc + trace.fraction = 0; //traces that start in solid report a fraction of 0. this is to prevent things from dropping out of the world completely. at least this way they ought to still be shootable etc #pragma warningmsg("The following line might help boost framerates a lot in rmq, not sure if they violate expected behaviour in other mods though - check that they're safe.") VectorNegate(gravitydir, trace.plane.normal); diff --git a/engine/server/sv_sys_unix.c b/engine/server/sv_sys_unix.c index f539d1a56..215674e3b 100644 --- a/engine/server/sv_sys_unix.c +++ b/engine/server/sv_sys_unix.c @@ -366,9 +366,9 @@ void Sys_Printf (char *fmt, ...) if (codeflags & CON_HIDDEN) continue; - if (codepoint == '\n' && (codeflags&CON_NONCLEARBG)) - codeflags &= CON_WHITEMASK; //make sure we don't get annoying backgrounds on other lines. - ApplyColour(*c); + if ((codeflags&CON_RICHFORECOLOUR) || (codepoint == '\n' && (codeflags&CON_NONCLEARBG))) + codeflags = CON_WHITEMASK; //make sure we don't get annoying backgrounds on other lines. + ApplyColour(codeflags); w = codepoint; if (w >= 0xe000 && w < 0xe100) { @@ -404,6 +404,7 @@ void Sys_Printf (char *fmt, ...) putc(w, stdout); } } + ApplyColour(CON_WHITEMASK); } else { diff --git a/engine/server/sv_user.c b/engine/server/sv_user.c index 3d55f617e..ebd6f802e 100644 --- a/engine/server/sv_user.c +++ b/engine/server/sv_user.c @@ -308,7 +308,7 @@ void SV_New_f (void) ClientReliableWrite_Byte (host_client, ISQ2CLIENT(host_client)?svcq2_serverdata:svc_serverdata); if (host_client->fteprotocolextensions)//let the client know { - ClientReliableWrite_Long (host_client, PROTOCOL_VERSION_FTE); + ClientReliableWrite_Long (host_client, PROTOCOL_VERSION_FTE1); if (svs.netprim.coordsize == 2) //we're not using float orgs on this level. ClientReliableWrite_Long (host_client, host_client->fteprotocolextensions&~PEXT_FLOATCOORDS); else @@ -727,7 +727,7 @@ void SVNQ_New_f (void) MSG_WriteByte (&host_client->netchan.message, svc_serverdata); if (protext1) { - MSG_WriteLong (&host_client->netchan.message, PROTOCOL_VERSION_FTE); + MSG_WriteLong (&host_client->netchan.message, PROTOCOL_VERSION_FTE1); MSG_WriteLong (&host_client->netchan.message, protext1); } if (protext2) @@ -2462,7 +2462,7 @@ static void SV_NextChunkedDownload(unsigned int chunknum, int ezpercent, int ezf host_client->downloadstarted = false; -#ifdef HAVE_LEGACY +#if defined(HAVE_LEGACY) && defined(MVD_RECORDING) SV_DownloadQueueNext(host_client); #endif } @@ -2544,7 +2544,7 @@ void SV_NextDownload_f (void) VFS_CLOSE (host_client->download); host_client->download = NULL; -#ifdef HAVE_LEGACY +#if defined(HAVE_LEGACY) && defined(MVD_RECORDING) SV_DownloadQueueNext(host_client); #endif } @@ -3592,7 +3592,7 @@ void SV_BeginDownload_f(void) } if (ISNQCLIENT(host_client)) host_client->send_message = true; -#ifdef HAVE_LEGACY +#if defined(HAVE_LEGACY) && defined(MVD_RECORDING) SV_DownloadQueueNext(host_client); #endif return; @@ -3670,7 +3670,7 @@ void SV_StopDownload_f(void) host_client->downloadstarted = false; -#ifdef HAVE_LEGACY +#if defined(HAVE_LEGACY) && defined(MVD_RECORDING) SV_DownloadQueueNext(host_client); // SV_DownloadQueueClear(host_client); #endif @@ -6052,14 +6052,14 @@ void SV_Pext_f(void) val = Cmd_Argv(i++); switch(strtoul(tag, NULL, 0)) { - case PROTOCOL_VERSION_FTE: - host_client->fteprotocolextensions = strtoul(val, NULL, 0) & Net_PextMask(1, ISNQCLIENT(host_client)); + case PROTOCOL_VERSION_FTE1: + host_client->fteprotocolextensions = strtoul(val, NULL, 0) & Net_PextMask(PROTOCOL_VERSION_FTE1, ISNQCLIENT(host_client)); break; case PROTOCOL_VERSION_FTE2: - host_client->fteprotocolextensions2 = strtoul(val, NULL, 0) & Net_PextMask(2, ISNQCLIENT(host_client)); + host_client->fteprotocolextensions2 = strtoul(val, NULL, 0) & Net_PextMask(PROTOCOL_VERSION_FTE2, ISNQCLIENT(host_client)); break; case PROTOCOL_VERSION_EZQUAKE1: - host_client->ezprotocolextensions1 = strtoul(val, NULL, 0) & Net_PextMask(3, ISNQCLIENT(host_client)) & EZPEXT1_SERVERADVERTISE; + host_client->ezprotocolextensions1 = strtoul(val, NULL, 0) & Net_PextMask(PROTOCOL_VERSION_EZQUAKE1, ISNQCLIENT(host_client)) & EZPEXT1_SERVERADVERTISE; break; } } diff --git a/engine/server/world.c b/engine/server/world.c index c87335b18..029cdbf0c 100644 --- a/engine/server/world.c +++ b/engine/server/world.c @@ -2229,7 +2229,7 @@ static void World_ClipToLinks (world_t *w, areanode_t *node, moveclip_t *clip) } #endif -#ifdef HAVE_CLIENT +#if defined(HAVE_CLIENT) && defined(CSQC_DAT) //The logic of this function is seriously handicapped vs the other types of trace we could be doing. static void World_ClipToNetwork (world_t *w, moveclip_t *clip) { @@ -2766,7 +2766,7 @@ trace_t World_Move (world_t *w, vec3_t start, vec3_t mins, vec3_t maxs, vec3_t e World_ClipToLinks(w, &w->portallist, &clip); } -#ifdef HAVE_CLIENT +#if defined(HAVE_CLIENT) && defined(CSQC_DAT) { extern world_t csqc_world; if (w == &csqc_world) diff --git a/engine/vk/vk_backend.c b/engine/vk/vk_backend.c index 96b1c81a2..66e78528d 100644 --- a/engine/vk/vk_backend.c +++ b/engine/vk/vk_backend.c @@ -43,7 +43,9 @@ extern cvar_t vk_stagingbuffers; unsigned int vk_usedynamicstaging; +#ifdef RTLIGHTS static void VK_TerminateShadowMap(void); +#endif void VKBE_BeginShadowmapFace(void); static void R_DrawPortal(batch_t *batch, batch_t **blist, batch_t *depthmasklist[2], int portaltype); @@ -4248,7 +4250,9 @@ batch_t *VKBE_GetTempBatch(void) void VKBE_SetupLightCBuffer(dlight_t *l, vec3_t colour) { +#ifdef RTLIGHTS extern cvar_t gl_specular; +#endif vkcbuf_light_t *cbl = VKBE_AllocateBufferSpace(DB_UBO, (sizeof(*cbl) + 0x0ff) & ~0xff, &shaderstate.ubo_light.buffer, &shaderstate.ubo_light.offset); shaderstate.ubo_light.range = sizeof(*cbl); diff --git a/engine/vk/vk_init.c b/engine/vk/vk_init.c index 64ca50d38..72b0184f8 100644 --- a/engine/vk/vk_init.c +++ b/engine/vk/vk_init.c @@ -1407,7 +1407,7 @@ vk_image_t VK_CreateTexture2DArray(uint32_t width, uint32_t height, uint32_t lay break; } if (format == VK_FORMAT_UNDEFINED) //no default case means warnings for unsupported formats above. - Sys_Error("VK_CreateTexture2DArray: Unrecognised image encoding: %u\n", encoding); + Sys_Error("VK_CreateTexture2DArray: Unsupported image encoding: %u(%s)\n", encoding, Image_FormatName(encoding)); ici.flags = (ret.type==PTI_CUBEMAP)?VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT:0; ici.imageType = VK_IMAGE_TYPE_2D; diff --git a/plugins/models/gltf.c b/plugins/models/gltf.c index aa34fff6c..86b6e8774 100644 --- a/plugins/models/gltf.c +++ b/plugins/models/gltf.c @@ -6,7 +6,9 @@ #include "com_mesh.h" extern modplugfuncs_t *modfuncs; +#ifdef SKELETALMODELS #define GLTFMODELS +#endif //'The units for all linear distances are meters.' diff --git a/plugins/models/models.c b/plugins/models/models.c index d8698ab02..58af7b4ee 100644 --- a/plugins/models/models.c +++ b/plugins/models/models.c @@ -8,7 +8,9 @@ modplugfuncs_t *modfuncs; //#define ASEMODELS //FIXME: TEST TEST TEST. shold be working iiuc //#define LWOMODELS //not working +#ifdef SKELETALMODELS #define GLTFMODELS //FIXME: not yet working properly. +#endif #ifdef ASEMODELS struct aseimport_s