From 52ab543bd78f3980780de4994f12306618ce2f8f Mon Sep 17 00:00:00 2001 From: Spoike Date: Wed, 4 Aug 2021 21:18:04 +0000 Subject: [PATCH] Misc small bugfixes and tweaks. git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@6005 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- build_qc.sh | 9 +++- engine/client/clq2_ents.c | 1 - engine/client/in_sdl.c | 14 +++---- engine/client/in_win.c | 8 ++-- engine/client/input.h | 5 +++ engine/client/m_download.c | 86 +++++++++++++++++++------------------- engine/client/pr_csqc.c | 25 +++++------ engine/client/snd_dma.c | 7 ++-- engine/client/sys_droid.c | 16 ++++++- engine/client/sys_sdl.c | 10 +++++ engine/common/bothdefs.h | 3 +- engine/common/fs.c | 3 ++ engine/gl/gl_vidlinuxglx.c | 8 ++-- engine/server/pr_cmds.c | 13 ++---- engine/server/sv_send.c | 8 ++-- engine/vk/vk_init.c | 23 +++++----- engine/web/gl_vidweb.c | 23 +++++++--- 17 files changed, 151 insertions(+), 111 deletions(-) diff --git a/build_qc.sh b/build_qc.sh index 31f73a634..c458fc27d 100755 --- a/build_qc.sh +++ b/build_qc.sh @@ -5,8 +5,15 @@ BUILDFOLDER=~/htdocs BUILDLOGFOLDER=$BUILDFOLDER/build_logs + +if [ "$FTEQCC" == "" ]; then + QSS=~/htdocs/qss/quakespasm-spiked-linux64 + FTEQW=~/htdocs/linux_amd64/fteqw64 + FTEQCC=~/htdocs/linux_amd64/fteqcc64 +fi + #this really should use the native cpu type... until then we use 32bit in case anyone's still using a 32bit kernel. -if [ "FTEQW" != "" ]; then +if [ "$FTEQW" != "" ]; then echo "--- QC builds ---" echo "Making fteextensions.qc" diff --git a/engine/client/clq2_ents.c b/engine/client/clq2_ents.c index af1ebd2e8..dc737e435 100644 --- a/engine/client/clq2_ents.c +++ b/engine/client/clq2_ents.c @@ -1612,7 +1612,6 @@ void CLQ2_ParseFrame (int extrabits) //in splitscreen we may have multiple player states, one per player. if (cls.protocol_q2 != PROTOCOL_VERSION_R1Q2 && cls.protocol_q2 != PROTOCOL_VERSION_Q2PRO) { - cl.splitclients = 0; for (cl.splitclients = 0; ; ) { cmd = MSG_ReadByte (); diff --git a/engine/client/in_sdl.c b/engine/client/in_sdl.c index 24e78ca84..8968c89ca 100644 --- a/engine/client/in_sdl.c +++ b/engine/client/in_sdl.c @@ -230,7 +230,7 @@ static void J_ControllerAxis(SDL_JoystickID jid, int axis, int value) } static void J_JoystickAxis(SDL_JoystickID jid, int axis, int value) { - static int axismap[] = {0,1,3,4,2,5}; + static const int axismap[] = {0,1,3,4,2,5}; struct sdljoy_s *joy = J_DevId(jid); if (joy && axis < sizeof(axismap)/sizeof(axismap[0]) && joy->qdevid != DEVID_UNSET) @@ -241,7 +241,7 @@ static void J_ControllerButton(SDL_JoystickID jid, int button, qboolean pressed) { //controllers have reliable button maps. //but that doesn't meant that fte has specific k_ names for those buttons, but the mapping should be reliable, at least until they get mapped to proper k_ values. - static int buttonmap[] = + static const int buttonmap[] = { K_GP_A, K_GP_B, @@ -281,7 +281,7 @@ static void J_ControllerButton(SDL_JoystickID jid, int button, qboolean pressed) static void J_JoystickButton(SDL_JoystickID jid, int button, qboolean pressed) { //generic joysticks have no specific mappings. they're really random like that. - static int buttonmap[] = { + static const int buttonmap[] = { K_JOY1, K_JOY2, K_JOY3, @@ -345,7 +345,7 @@ static void J_JoystickButton(SDL_JoystickID jid, int button, qboolean pressed) } } -void J_Rumble(int id, uint16_t amp_low, uint16_t amp_high, int duration) +void INS_Rumble(int id, quint16_t amp_low, quint16_t amp_high, quint32_t duration) { #if SDL_VERSION_ATLEAST(2,0,9) int i; @@ -365,7 +365,7 @@ void J_Rumble(int id, uint16_t amp_low, uint16_t amp_high, int duration) #endif } -void J_RumbleTriggers(int id, uint16_t left, uint16_t right, uint32_t duration) +void INS_RumbleTriggers(int id, quint16_t left, quint16_t right, quint32_t duration) { #if SDL_VERSION_ATLEAST(2,0,14) int i; @@ -385,7 +385,7 @@ void J_RumbleTriggers(int id, uint16_t left, uint16_t right, uint32_t duration) #endif } -void J_SetLEDColor(int id, vec3_t color) +void INS_SetLEDColor(int id, vec3_t color) { #if SDL_VERSION_ATLEAST(2,0,14) int i; @@ -407,7 +407,7 @@ void J_SetLEDColor(int id, vec3_t color) #endif } -void J_SetTriggerFX(int id, const void *data, int size) +void INS_SetTriggerFX(int id, const void *data, size_t size) { #if SDL_VERSION_ATLEAST(2,0,15) for (int i = 0; i < MAX_JOYSTICKS; i++) diff --git a/engine/client/in_win.c b/engine/client/in_win.c index 44b5a7844..11c2a27d2 100644 --- a/engine/client/in_win.c +++ b/engine/client/in_win.c @@ -464,22 +464,22 @@ static int Joy_AllocateDevID(void) } } -void J_Rumble(int id, uint16_t amp_low, uint16_t amp_high, int duration) +void INS_Rumble(int id, quint16_t amp_low, quint16_t amp_high, quint32_t duration) { //Con_DPrintf(CON_WARNING "Rumble is unavailable on this platform\n"); } -void J_RumbleTriggers(int id, uint16_t left, uint16_t right, uint32_t duration) +void INS_RumbleTriggers(int id, quint16_t left, quint16_t right, quint32_t duration) { //Con_DPrintf(CON_WARNING "Trigger rumble is unavailable on this platform\n"); } -void J_SetLEDColor(int id, vec3_t color) +void INS_SetLEDColor(int id, vec3_t color) { //Con_DPrintf(CON_WARNING "Game-Pad LED colors are unavailable on this platform\n"); } -void J_SetTriggerFX(int id, const void *data, int size) +void INS_SetTriggerFX(int id, const void *data, size_t size) { //Con_DPrintf(CON_WARNING "Trigger FX are unavailable on this platform\n"); } diff --git a/engine/client/input.h b/engine/client/input.h index 9f19242e9..b5e7542d2 100644 --- a/engine/client/input.h +++ b/engine/client/input.h @@ -64,6 +64,11 @@ void INS_Commands (void); //final chance to call IN_MouseMove/IN_KeyEvent each f void INS_EnumerateDevices(void *ctx, void(*callback)(void *ctx, const char *type, const char *devicename, unsigned int *qdevid)); void INS_SetupControllerAudioDevices(qboolean enabled); //creates audio devices for each controller (where controllers have their own audio devices) +void INS_Rumble(int joy, quint16_t amp_low, quint16_t amp_high, quint32_t duration); +void INS_RumbleTriggers(int joy, quint16_t left, quint16_t right, quint32_t duration); +void INS_SetLEDColor(int id, vec3_t color); +void INS_SetTriggerFX(int id, const void *data, size_t size); + #define DEVID_UNSET ~0u extern cvar_t cl_splitscreen; diff --git a/engine/client/m_download.c b/engine/client/m_download.c index f0cca5660..8d43d78fc 100644 --- a/engine/client/m_download.c +++ b/engine/client/m_download.c @@ -3671,7 +3671,7 @@ static qboolean PM_SignatureOkay(package_t *p) //metadata doesn't specify all file names for zips. if (p->extract == EXTRACT_ZIP) return false; - if (!p->gamedir || !*p->gamedir) + if (!*p->gamedir) return false; for (dep = p->deps; dep; dep = dep->next) @@ -3911,7 +3911,7 @@ static void PM_StartADownload(void) { p->download = HTTP_CL_Get(mirror, NULL, PM_Download_PreliminaryGot); if (!p->download) - Con_Printf("Unable to download %s\n", p->name); + Con_Printf("Unable to download %s (%s)\n", p->name, mirror); } else { @@ -4833,12 +4833,12 @@ void PM_AddManifestPackages(ftemanifest_t *man) { package_t *p, *m; size_t i; - const char *path; + const char *path, *url; - char buffer[MAX_OSPATH], *url; + char buffer[MAX_OSPATH]; int idx; struct manpack_s *pack; - const char *baseurl = man->updateurl; + const char *baseurl = man->updateurl; //this is a url for updated versions of the fmf itself. for (p = availablepackages; p; p = p->next) p->flags &= ~DPF_MANIMARKED; @@ -4891,46 +4891,46 @@ void PM_AddManifestPackages(ftemanifest_t *man) p->extract = EXTRACT_COPY; for (i = 0; i < countof(pack->mirrors) && i < countof(p->mirror); i++) - if (pack->mirrors[i]) + { + url = pack->mirrors[i]; + if (!url) + continue; + if (!strncmp(url, "gz:", 3)) { - if (pack->mirrors[i]) - { - url = pack->mirrors[i]; - if (!strncmp(url, "gz:", 3)) - { - url+=3; - p->extract = EXTRACT_GZ; - } - else if (!strncmp(url, "xz:", 3)) - { - url+=3; - p->extract = EXTRACT_XZ; - } - else if (!strncmp(url, "unzip:", 6)) - { - char *comma; - url+=6; - comma = strchr(url, ','); - if (comma) - { - p->extract = EXTRACT_EXPLICITZIP; - *comma = 0; - PM_AddDep(p, DEP_EXTRACTNAME, url); - *comma = ','; - url = comma+1; - } - else - p->extract = EXTRACT_ZIP; - } - /*else if (!strncmp(url, "prompt:", 7)) - { - url+=7; - fspdl_extracttype = X_COPY; - }*/ - - p->mirror[i] = Z_StrDup(FS_RelativeURL(baseurl, url, buffer, sizeof(buffer))); - } + url+=3; + p->extract = EXTRACT_GZ; } + else if (!strncmp(url, "xz:", 3)) + { + url+=3; + p->extract = EXTRACT_XZ; + } + else if (!strncmp(url, "unzip:", 6)) + { + char *comma; + url+=6; + comma = strchr(url, ','); + if (comma) + { + p->extract = EXTRACT_EXPLICITZIP; + *comma = 0; + PM_AddDep(p, DEP_EXTRACTNAME, url); + *comma = ','; + url = comma+1; + } + else + p->extract = EXTRACT_ZIP; + } + /*else if (!strncmp(url, "prompt:", 7)) + { + url+=7; + fspdl_extracttype = X_COPY; + }*/ + + url = FS_RelativeURL(baseurl, url, buffer, sizeof(buffer)); + if (url && *url) + p->mirror[i] = Z_StrDup(url); + } PM_AddDep(p, DEP_FILE, path); m = PM_InsertPackage(p); diff --git a/engine/client/pr_csqc.c b/engine/client/pr_csqc.c index 690ce88bb..75d199430 100644 --- a/engine/client/pr_csqc.c +++ b/engine/client/pr_csqc.c @@ -6731,33 +6731,28 @@ static void QCBUILTIN PF_resourcestatus(pubprogfuncs_t *prinst, struct globalvar } } -void J_Rumble(int joy, uint16_t amp_low, uint16_t amp_high, uint32_t duration); -void J_RumbleTriggers(int joy, uint16_t left, uint16_t right, uint32_t duration); -void J_SetLEDColor(int id, vec3_t color); -void J_SetTriggerFX(int id, const void *data, int size); - static void QCBUILTIN PF_cl_gp_rumble(pubprogfuncs_t *prinst, struct globalvars_s *pr_globals) { int device = G_FLOAT(OFS_PARM0); - uint16_t amp_low = G_FLOAT(OFS_PARM1); - uint16_t amp_high = G_FLOAT(OFS_PARM2); - uint32_t duration = G_FLOAT(OFS_PARM3); - J_Rumble(device, amp_low, amp_high, duration); + quint16_t amp_low = G_FLOAT(OFS_PARM1); + quint16_t amp_high = G_FLOAT(OFS_PARM2); + quint32_t duration = G_FLOAT(OFS_PARM3); + INS_Rumble(device, amp_low, amp_high, duration); } static void QCBUILTIN PF_cl_gp_rumbletriggers(pubprogfuncs_t *prinst, struct globalvars_s *pr_globals) { int device = G_FLOAT(OFS_PARM0); - uint16_t left = G_FLOAT(OFS_PARM1); - uint16_t right = G_FLOAT(OFS_PARM2); - uint32_t duration = G_FLOAT(OFS_PARM3); - J_RumbleTriggers(device, left, right, duration); + quint16_t left = G_FLOAT(OFS_PARM1); + quint16_t right = G_FLOAT(OFS_PARM2); + quint32_t duration = G_FLOAT(OFS_PARM3); + INS_RumbleTriggers(device, left, right, duration); } static void QCBUILTIN PF_cl_gp_setledcolor(pubprogfuncs_t *prinst, struct globalvars_s *pr_globals) { int device = G_FLOAT(OFS_PARM0); - J_SetLEDColor(device, G_VECTOR(OFS_PARM1)); + INS_SetLEDColor(device, G_VECTOR(OFS_PARM1)); } static void QCBUILTIN PF_cl_gp_settriggerfx(pubprogfuncs_t *prinst, struct globalvars_s *pr_globals) @@ -6769,7 +6764,7 @@ static void QCBUILTIN PF_cl_gp_settriggerfx(pubprogfuncs_t *prinst, struct globa if (!fxptr) PR_BIError(prinst, "PF_cl_gp_settriggerfx: invalid pointer/size\n"); else - J_SetTriggerFX(device, fxptr, size); + INS_SetTriggerFX(device, fxptr, size); } /*static void PF_cs_clipboard_got(void *ctx, const char *utf8) diff --git a/engine/client/snd_dma.c b/engine/client/snd_dma.c index fe81769cd..96c718e60 100644 --- a/engine/client/snd_dma.c +++ b/engine/client/snd_dma.c @@ -164,7 +164,7 @@ static void QDECL S_Voip_Play_Callback(cvar_t *var, char *oldval); cvar_t snd_voip_capturedevice = CVARF("cl_voip_capturedevice", "", CVAR_ARCHIVE); cvar_t snd_voip_capturedevice_opts = CVARFD("_cl_voip_capturedevice_opts", "", CVAR_NOSET, "The possible audio capture devices, in \"value\" \"description\" pairs, for gamecode to read."); int voipbutton; //+voip, no longer part of cl_voip_send to avoid it getting saved -cvar_t snd_voip_send = CVARFD("cl_voip_send", "0", CVAR_ARCHIVE, "Sends voice-over-ip data to the server whenever it is set.\n0: only send voice if +voip is pressed.\n1: voice activation.\n2: constantly send.\n+4: Do not send to game, only to rtp sessions."); +cvar_t snd_voip_send = CVARFD("cl_voip_send", "0", CVAR_ARCHIVE|CVAR_NOTFROMSERVER, "Sends voice-over-ip data to the server whenever it is set.\n0: only send voice if +voip is pressed.\n1: voice activation.\n2: constantly send.\n+4: Do not send to game, only to rtp sessions."); cvar_t snd_voip_test = CVARD("cl_voip_test", "0", "If 1, enables you to hear your own voice directly, bypassing the server and thus without networking latency, but is fine for checking audio levels. Note that sv_voip_echo can be set if you want to include latency and packetloss considerations, but setting that cvar requires server admin access and is thus much harder to use."); cvar_t snd_voip_vad_threshhold = CVARFD("cl_voip_vad_threshhold", "15", CVAR_ARCHIVE, "This is the threshhold for voice-activation-detection when sending voip data"); cvar_t snd_voip_vad_delay = CVARD("cl_voip_vad_delay", "0.3", "Keeps sending voice data for this many seconds after voice activation would normally stop"); @@ -1670,6 +1670,8 @@ void S_Voip_Ignore(unsigned int slot, qboolean ignore) } static void S_Voip_Enable_f(void) { + if (Cmd_IsInsecure()) + return; voipbutton = true; } static void S_Voip_Disable_f(void) @@ -2645,8 +2647,7 @@ channel_t *SND_PickChannel(soundcardinfo_t *sc, int entnum, int entchannel) if (oldest == -1) return NULL; - //if (sc->channel[oldest].sfx) - sc->channel[oldest].sfx = NULL; + sc->channel[oldest].sfx = NULL; if (sc->total_chans <= oldest) sc->total_chans = oldest+1; diff --git a/engine/client/sys_droid.c b/engine/client/sys_droid.c index 0b3526922..3ef41df06 100644 --- a/engine/client/sys_droid.c +++ b/engine/client/sys_droid.c @@ -86,6 +86,18 @@ void INS_ReInit(void) void INS_Shutdown(void) { } +void INS_Rumble(int joy, uint16_t amp_low, uint16_t amp_high, uint32_t duration) +{ +} +void INS_RumbleTriggers(int joy, uint16_t left, uint16_t right, uint32_t duration) +{ +} +void INS_SetLEDColor(int id, vec3_t color) +{ +} +void INS_SetTriggerFX(int id, const void *data, size_t size) +{ +} void Sys_Vibrate(float count) { // if (count < 0) @@ -202,8 +214,8 @@ static int mapkey(int androidkey) case AKEYCODE_BUTTON_R1: return K_GP_RIGHT_SHOULDER; case AKEYCODE_BUTTON_L2: return K_GP_LEFT_TRIGGER; case AKEYCODE_BUTTON_R2: return K_GP_RIGHT_TRIGGER; - case AKEYCODE_BUTTON_THUMBL: return K_GP_LEFT_THUMB; - case AKEYCODE_BUTTON_THUMBR: return K_GP_RIGHT_THUMB; + case AKEYCODE_BUTTON_THUMBL: return K_GP_LEFT_STICK; + case AKEYCODE_BUTTON_THUMBR: return K_GP_RIGHT_STICK; case AKEYCODE_BUTTON_START: return K_GP_START; case AKEYCODE_BUTTON_SELECT: return K_GP_BACK; case AKEYCODE_BUTTON_MODE: return K_GP_GUIDE; diff --git a/engine/client/sys_sdl.c b/engine/client/sys_sdl.c index 795cd2f2f..e53108a06 100644 --- a/engine/client/sys_sdl.c +++ b/engine/client/sys_sdl.c @@ -817,6 +817,7 @@ int QDECL main(int argc, char **argv) { float time, newtime, oldtime; quakeparms_t parms; + int i; memset(&parms, 0, sizeof(parms)); @@ -842,6 +843,15 @@ int QDECL main(int argc, char **argv) oldtime = Sys_DoubleTime (); + for (i = 1; i < parms.argc; i++) + { + if (!parms.argv[i]) + continue; + if (*parms.argv[i] == '+' || *parms.argv[i] == '-') + break; + Host_RunFile(parms.argv[i], strlen(parms.argv[i]), NULL); + } + //client console should now be initialized. /* main window message loop */ diff --git a/engine/common/bothdefs.h b/engine/common/bothdefs.h index 3423de659..fc820f6cf 100644 --- a/engine/common/bothdefs.h +++ b/engine/common/bothdefs.h @@ -809,7 +809,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. //safeswitch(foo){safedefault: break;} //switch, but errors for any omitted enum values despite the presence of a default case. //(gcc will generally give warnings without the default, but sometimes you don't have control over the source of your enumeration values) -#if (__GNUC__ >= 4) +//note: android's gcc seems to screw up the pop, instead leaving the warnings enabled, which gets horrendously spammy. +#if (__GNUC__ >= 4) && !defined(ANDROID) #define safeswitch \ _Pragma("GCC diagnostic push") \ _Pragma("GCC diagnostic error \"-Wswitch-enum\"") \ diff --git a/engine/common/fs.c b/engine/common/fs.c index 9be31d459..fab36d21b 100644 --- a/engine/common/fs.c +++ b/engine/common/fs.c @@ -2853,6 +2853,9 @@ void COM_FlushTempoaryPacks(void) //flush all temporary packages COM_AssertMainThread("COM_FlushTempoaryPacks"); + if (!com_searchpaths || !fs_thread_mutex) + return; //we already shut down... + COM_WorkerLock(); //make sure no workers are poking files... Sys_LockMutex(fs_thread_mutex); diff --git a/engine/gl/gl_vidlinuxglx.c b/engine/gl/gl_vidlinuxglx.c index cdfb69ec6..550cb83c6 100644 --- a/engine/gl/gl_vidlinuxglx.c +++ b/engine/gl/gl_vidlinuxglx.c @@ -5004,22 +5004,22 @@ void INS_EnumerateDevices(void *ctx, void(*callback)(void *ctx, const char *type } /* doubt this will ever happen to begin with */ -void J_Rumble(int id, uint16_t amp_low, uint16_t amp_high, int duration) +void INS_Rumble(int id, quint16_t amp_low, quint16_t amp_high, quint32_t duration) { //Con_DPrintf(CON_WARNING "Rumble is unavailable on this platform\n"); } -void J_RumbleTriggers(int id, uint16_t left, uint16_t right, uint32_t duration) +void INS_RumbleTriggers(int id, quint16_t left, quint16_t right, quint32_t duration) { //Con_DPrintf(CON_WARNING "Trigger rumble is unavailable on this platform\n"); } -void J_SetLEDColor(int id, vec3_t color) +void INS_SetLEDColor(int id, vec3_t color) { //Con_DPrintf(CON_WARNING "Game-Pad LED colors are unavailable on this platform\n"); } -void J_SetTriggerFX(int id, const void *data, int size) +void INS_SetTriggerFX(int id, const void *data, size_t size) { //Con_DPrintf(CON_WARNING "Trigger FX are unavailable on this platform\n"); } diff --git a/engine/server/pr_cmds.c b/engine/server/pr_cmds.c index 9744e8ced..989a17d0f 100644 --- a/engine/server/pr_cmds.c +++ b/engine/server/pr_cmds.c @@ -12485,17 +12485,12 @@ static void PR_DumpPlatform_SymbolType(vfsfile_t *f, const struct symtable_s *sy int symstart = 0; const char *colon; - //we need to skip over any #defines prefixed to the type string - while(symtype[symstart] == '#') + //skip over any "typedef struct {...;};\n" or "#define foo bar\n" blocks in there + while ((colon = strstr(symtype+symstart, "\n"))) { - while (symtype[symstart] && symtype[symstart] != '\n') - symstart++; - if (symtype[symstart]) - symstart++; //skip over the \n + symstart = (colon+1) - symtype; + continue; } - //skip over any "typedef struct {...;};\n" blocks in there - while ((colon = strstr(symtype+symstart, ";\n"))) - symstart = colon+2 - symtype; //write those prefixes we tried to skip... VFS_WRITE(f, symtype, symstart); diff --git a/engine/server/sv_send.c b/engine/server/sv_send.c index 6522c81e6..30c3feb63 100644 --- a/engine/server/sv_send.c +++ b/engine/server/sv_send.c @@ -1895,11 +1895,9 @@ void SV_WriteClientdataToMessage (client_t *client, sizebuf_t *msg) // stuff the sigil bits into the high bits of items for sbar, or else // mix in items2 -// val = GetEdictFieldValue(ent, "items2", &items2cache); - -// if (val) -// items = (int)ent->v->items | ((int)val->_float << 23); -// else + if (sv.haveitems2) + items = (int)ent->v->items | ((int)ent->xv->items2 << 23); + else items = (int)ent->v->items | ((int)pr_global_struct->serverflags << 28); diff --git a/engine/vk/vk_init.c b/engine/vk/vk_init.c index 649845e98..dd86f0e4b 100644 --- a/engine/vk/vk_init.c +++ b/engine/vk/vk_init.c @@ -7,6 +7,8 @@ #include "vr.h" +#define VK_API_MAX_VERSION VK_API_VERSION_1_0 + extern qboolean vid_isfullscreen; cvar_t vk_stagingbuffers = CVARFD ("vk_stagingbuffers", "", CVAR_RENDERERLATCH, "Configures which dynamic buffers are copied into gpu memory for rendering, instead of reading from shared memory. Empty for default settings.\nAccepted chars are u(niform), e(lements), v(ertex), 0(none)."); @@ -4535,15 +4537,14 @@ qboolean VK_EnumerateDevices (void *usercontext, void(*callback)(void *context, #undef VKFunc #endif -#define ENGINEVERSION 1 memset(&app, 0, sizeof(app)); app.sType = VK_STRUCTURE_TYPE_APPLICATION_INFO; app.pNext = NULL; - app.pApplicationName = NULL; - app.applicationVersion = 0; - app.pEngineName = FULLENGINENAME; - app.engineVersion = ENGINEVERSION; - app.apiVersion = VK_MAKE_VERSION(1, 0, 2); + app.pApplicationName = FULLENGINENAME; + app.applicationVersion = revision_number(false); + app.pEngineName = "FTE Quake"; + app.engineVersion = VK_MAKE_VERSION(FTE_VER_MAJOR, FTE_VER_MINOR, 0); + app.apiVersion = VK_API_MAX_VERSION; memset(&inst_info, 0, sizeof(inst_info)); inst_info.sType = VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO; @@ -4723,11 +4724,11 @@ qboolean VK_Init(rendererstate_t *info, const char **sysextnames, qboolean (*cre memset(&app, 0, sizeof(app)); app.sType = VK_STRUCTURE_TYPE_APPLICATION_INFO; app.pNext = NULL; - app.pApplicationName = NULL; - app.applicationVersion = 0; - app.pEngineName = FULLENGINENAME; - app.engineVersion = ENGINEVERSION; - app.apiVersion = VK_MAKE_VERSION(1, 0, 2); + app.pApplicationName = FULLENGINENAME; + app.applicationVersion = revision_number(false); + app.pEngineName = "FTE Quake"; + app.engineVersion = VK_MAKE_VERSION(FTE_VER_MAJOR, FTE_VER_MINOR, 0); + app.apiVersion = VK_API_MAX_VERSION; memset(&inst_info, 0, sizeof(inst_info)); inst_info.sType = VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO; diff --git a/engine/web/gl_vidweb.c b/engine/web/gl_vidweb.c index 10abcc50d..4607b338d 100644 --- a/engine/web/gl_vidweb.c +++ b/engine/web/gl_vidweb.c @@ -22,7 +22,7 @@ static void *GLVID_getsdlglfunction(char *functionname) static void IN_GamePadButtonEvent(unsigned int joydevid, int button, int ispressed, int isstandardmapping) { - int standardmapping[] = + static const int standardmapping[] = { //the order of these keys is different from that of xinput //however, the quake button codes should be the same. I really ought to define some K_ aliases for them. K_GP_A, @@ -35,8 +35,8 @@ static void IN_GamePadButtonEvent(unsigned int joydevid, int button, int ispress K_GP_RIGHT_TRIGGER, K_GP_BACK, K_GP_START, - K_GP_LEFT_THUMB, - K_GP_RIGHT_THUMB, + K_GP_LEFT_STICK, + K_GP_RIGHT_STICK, K_GP_DPAD_UP, K_GP_DPAD_DOWN, K_GP_DPAD_LEFT, @@ -98,7 +98,7 @@ static void VID_Resized(int width, int height) } static unsigned int domkeytoquake(unsigned int code) { - unsigned char tab[256] = + static const unsigned short tab[256] = { /* 0*/ 0,0,0,0,0,0,0,0, K_BACKSPACE,K_TAB,0,0,0,K_ENTER,0,0, /* 16*/ K_SHIFT,K_CTRL,K_ALT,K_PAUSE,K_CAPSLOCK,0,0,0,0,0,0,K_ESCAPE,0,0,0,0, @@ -133,7 +133,7 @@ static unsigned int domkeytoquake(unsigned int code) } static unsigned int domkeytoshift(unsigned int code) { - unsigned char tab[256] = + static const unsigned short tab[256] = { /* 0*/ 0,0,0,0,0,0,0,0, K_BACKSPACE,K_TAB,0,0,0,K_ENTER,0,0, /* 16*/ K_SHIFT,K_CTRL,K_ALT,K_PAUSE,K_CAPSLOCK,0,0,0,0,0,0,K_ESCAPE,0,0,0,0, @@ -395,3 +395,16 @@ void INS_EnumerateDevices(void *ctx, void(*callback)(void *ctx, const char *type } } +void INS_Rumble(int joy, quint16_t amp_low, quint16_t amp_high, quint32_t duration) +{ +} +void INS_RumbleTriggers(int joy, quint16_t left, quint16_t right, quint32_t duration) +{ +} +void INS_SetLEDColor(int id, vec3_t color) +{ +} +void INS_SetTriggerFX(int id, const void *data, size_t size) +{ +} +