--- a/engine/common/common.c +++ b/engine/common/common.c @@ -1,3 +1,4 @@ +/* Browser Games Now, 2026-10-19: local-file offline Web build; changes in BUILDING.txt. */ /* Copyright (C) 1996-1997 Id Software, Inc. @@ -20,6 +21,9 @@ // common.c -- misc functions used in client and server #include "quakedef.h" +#ifdef FTE_TARGET_WEB +#include +#endif #include #include --- a/engine/common/config_fteqw.h +++ b/engine/common/config_fteqw.h @@ -1,3 +1,4 @@ +// Browser Games Now, 2026-10-19: local-file offline Web build; changes in BUILDING.txt. // Build-Config file for FTE's standard builds, the default settings. // to use: make FTE_CONFIG=fteqw @@ -154,8 +155,8 @@ #define TCPCONNECT //support for playing over tcp sockets, instead of just udp. compatible with qizmo. //#define IRCCONNECT //lame support for routing game packets via irc server. not a good idea. #define SUPPORT_ICE //Internet Connectivity Establishment, for use by plugins to establish voice or game connections. -#define CL_MASTER //Clientside Server Browser functionality. -#define PACKAGEMANAGER //Allows the user to enable/disable/download(with WEBCLIENT) packages and plugins. Also handles map packages. +//#define CL_MASTER //Clientside Server Browser functionality. +//#define PACKAGEMANAGER //Allows the user to enable/disable/download(with WEBCLIENT) packages and plugins. Also handles map packages. // Audio Drivers #define AVAIL_OPENAL @@ -168,9 +169,9 @@ #define AVAIL_MP3_ACM //.mp3 support (windows only). // Other Audio Options -#define VOICECHAT -#define HAVE_SPEEX //Support the speex codec. -#define HAVE_OPUS //Support the opus codec. +//#define VOICECHAT +//#define HAVE_SPEEX //Support the speex codec. +//#define HAVE_OPUS //Support the opus codec. #define HAVE_MEDIA_DECODER //can play cin/roq, more with plugins #define HAVE_MEDIA_ENCODER //capture/capturedemo work. #define HAVE_CDPLAYER //includes cd playback. actual cds. named/numbered tracks are supported regardless (though you need to use the 'music' command to play them without this). @@ -214,8 +215,8 @@ -DLINK_QUAKE3 //ask the makefile to bake the quake3 plugin into the engine itself. #endif -//-DNO_OPUS -//-DNO_SPEEX //disable static speex +-DNO_OPUS +-DNO_SPEEX //disable static speex #ifndef AVAIL_BOTLIB -DNO_BOTLIB //disable static botlib #endif --- a/engine/client/m_download.c +++ b/engine/client/m_download.c @@ -1,3 +1,4 @@ +/* Browser Games Now, 2026-10-19: local-file offline Web build; changes in BUILDING.txt. */ //copyright 'Spike', license gplv2+ //provides both a package manager and downloads menu. //FIXME: block downloads of exe/dll/so/etc if not an https url (even if inside zips). also block such files from package lists over http. @@ -5775,7 +5776,7 @@ void PM_EnumeratePlugins(void (*callback)(const char *name, qboolean blocked)) { } -int PM_IsApplying(qboolean listsonly) +unsigned int PM_IsApplying(void) { return false; } --- a/engine/web/prejs.js +++ b/engine/web/prejs.js @@ -1,3 +1,4 @@ +// Browser Games Now, 2026-10-19: local-file offline Web build; changes in BUILDING.txt. //Populate our filesystem from Module['files'] FTEH = {h: [], f: {}}; @@ -21,7 +22,7 @@ addRunDependency("loadcachedfiles"); try { - caches.open('user').then((c)=>{Module['cache']=c;return c.keys();}).then((keys)=>{ + caches.open('bgn-quake-v1').then((c)=>{Module['cache']=c;return c.keys();}).then((keys)=>{ const cache = Module['cache']; for(var r of keys) { --- a/engine/web/ftejslib.js +++ b/engine/web/ftejslib.js @@ -1,3 +1,4 @@ +// Browser Games Now, 2026-10-19: local-file offline Web build; changes in BUILDING.txt. mergeInto(LibraryManager.library, { @@ -327,6 +328,7 @@ { const codepoint = event.key.codePointAt(1)?0:event.key.codePointAt(0); // only if its a single codepoint - none of this 'Return' nonsense. if (codepoint < ' ') codepoint = 0; //don't give a codepoint for c0 chars - like tab. + event.stopPropagation(); // The document capture listener owns keyboard events; do not process again on the focused canvas. if ({{{makeDynCall('iiiii','FTEC.evcb.key')}}}(0, event.type=='keydown', event.keyCode, codepoint)) event.preventDefault(); } @@ -1008,7 +1010,7 @@ { if (localStorage && createifneeded != 2) { - var str = localStorage.getItem(name); + var str = localStorage.getItem('bgn-quake-v1/' + name); if (str != null) { // console.log('read file '+name+': ' + str); @@ -1141,7 +1143,7 @@ //use a divide and conquer implementation instead for speed? for (var i = 0; i < len; i++) foo += String.fromCharCode(data[i]); - localStorage.setItem(b.n, foo); + localStorage.setItem('bgn-quake-v1/' + b.n, foo); } else console.log('local storage not supported');