2005-08-26 22:52:26 +00:00
# include "quakedef.h"
2007-08-20 02:24:43 +00:00
# include "netinc.h"
2005-08-26 22:52:26 +00:00
2005-12-21 03:07:33 +00:00
//#define com_gamedir com__gamedir
2005-08-26 22:52:26 +00:00
# include <ctype.h>
2009-04-01 22:03:56 +00:00
# include <limits.h>
2005-08-26 22:52:26 +00:00
2009-04-01 22:03:56 +00:00
# include "fs.h"
2011-03-12 13:51:40 +00:00
# include "shader.h"
2013-06-23 02:17:02 +00:00
# ifdef _WIN32
# include "winquake.h"
# endif
2005-08-26 22:52:26 +00:00
2023-04-21 11:36:13 +00:00
# ifdef FTE_TARGET_WEB //for stuff that doesn't work right...
# define FORWEB(a,b) a
# else
# define FORWEB(a,b) b
# endif
Added sys_openfile console command(and menu option) to web and flatpak(via cmake+dbus) builds, to 'install' packages on sandboxed systems a bit more easily.
Cmake: Add FTE_WERROR option, defaults to true in debug builds and off in release builds (in case future compilers have issues).
Cmake: Pull in libXscreensaver so we don't get interrupted by screensavers when playing demos.
Make: Added `make webcl-rel` for a web build without server bloat (eg for sites focused on demo playback. Yes, this means you XantoM).
fteqcc: Include the decompiler in fteqcc (non-gui) builds ('-d' arg).
fteqcc: Decompiler can now mostly handle hexen2 mods without any unknown opcodes.
Allow ezHud and OpenSSL to be compiled as in-engine plugins, potentially for web and windows ports respectively.
Web: Fix support for ogg vorbis. Add support for voip.
Web: Added basic support for WebXR.
QTV: Don't try seeking on unseekable qtv streams. Don't spam when developer 1 is set.
QTV: add support for some eztv extensions.
MVD: added hack to use ktx's vweps in mvd where mvdsv doesn't bother to record the info.
qwfwd: hack around a hack in qwfwd, allowing it to work again.
recording: favour qwd in single player, instead of mvd.
Protocol: reduce client memory used for precache names. Bump maximum precache counts - some people are just abusive, yes you Orl.
hexen2: add enough clientside protocol compat to play the demo included with h2mp. lacks effects.
in_xflip: restored this setting.
fs_hidesyspaths: new cvar, defaults to enabled so you won't find your username or whatever turning up in screenshots or the like. change it to 0 before debuging stuff eg via 'path'.
gl_overbright_models: Added cvar to match QS.
netchan: Added MTU determination, we'll no longer fail to connect when routers stupidly drop icmp packets.
Win: try a few other versions of xinput too.
CSQC: Added a CSQC_GenerateMaterial function, to give the csqc a chance to generate custom materials.
MenuQC: Added support for the skeletal objects API.
2024-04-09 17:13:59 +00:00
static char * vidfilenames [ ] = //list of filenames to check to see if graphics stuff needs reloading on filesystem changes
{
" gfx.wad " ,
" gfx/conback.lmp " /*q1*/ , " gfx/menu/conback.lmp " /*h2*/ , " pics/conback.pcx " /*q2*/ , //misc stuff
" gfx/palette.lmp " , " pics/colormap.pcx " ,
" gfx/conchars.png " , //conchars...
" fonts/qfont.kfont " , " gfx/mcharset.lmp " , //menu fonts
} ;
2023-04-21 11:36:13 +00:00
# if !defined(HAVE_LEGACY) || !defined(HAVE_CLIENT)
# define ZFIXHACK
# elif defined(ANDROID) //on android, these numbers seem to be generating major weirdness, so disable these.
# define ZFIXHACK
# elif defined(FTE_TARGET_WEB) //on firefox (but not chrome or ie), these numbers seem to be generating major weirdness, so tone them down significantly by default.
# define ZFIXHACK "set r_polygonoffset_submodel_offset 1\nset r_polygonoffset_submodel_factor 0.05\n"
# else //many quake maps have hideous z-fighting. this provides a way to work around it, although the exact numbers are gpu and bitdepth dependant, and trying to fix it can actually break other things.
# define ZFIXHACK "set r_polygonoffset_submodel_offset 25\nset r_polygonoffset_submodel_factor 0.05\n"
# endif
/*ezquake cheats and compat*/
# define EZQUAKECOMPETITIVE "set ruleset_allow_fbmodels 1\nset sv_demoExtensions \"\"\n"
/*quake requires a few settings for compatibility*/
# define QRPCOMPAT "set cl_cursor_scale 0.2\nset cl_cursor_bias_x 7.5\nset cl_cursor_bias_y 0.8\n"
# define QUAKESPASMSUCKS "set mod_h2holey_bugged 1\n"
Added sys_openfile console command(and menu option) to web and flatpak(via cmake+dbus) builds, to 'install' packages on sandboxed systems a bit more easily.
Cmake: Add FTE_WERROR option, defaults to true in debug builds and off in release builds (in case future compilers have issues).
Cmake: Pull in libXscreensaver so we don't get interrupted by screensavers when playing demos.
Make: Added `make webcl-rel` for a web build without server bloat (eg for sites focused on demo playback. Yes, this means you XantoM).
fteqcc: Include the decompiler in fteqcc (non-gui) builds ('-d' arg).
fteqcc: Decompiler can now mostly handle hexen2 mods without any unknown opcodes.
Allow ezHud and OpenSSL to be compiled as in-engine plugins, potentially for web and windows ports respectively.
Web: Fix support for ogg vorbis. Add support for voip.
Web: Added basic support for WebXR.
QTV: Don't try seeking on unseekable qtv streams. Don't spam when developer 1 is set.
QTV: add support for some eztv extensions.
MVD: added hack to use ktx's vweps in mvd where mvdsv doesn't bother to record the info.
qwfwd: hack around a hack in qwfwd, allowing it to work again.
recording: favour qwd in single player, instead of mvd.
Protocol: reduce client memory used for precache names. Bump maximum precache counts - some people are just abusive, yes you Orl.
hexen2: add enough clientside protocol compat to play the demo included with h2mp. lacks effects.
in_xflip: restored this setting.
fs_hidesyspaths: new cvar, defaults to enabled so you won't find your username or whatever turning up in screenshots or the like. change it to 0 before debuging stuff eg via 'path'.
gl_overbright_models: Added cvar to match QS.
netchan: Added MTU determination, we'll no longer fail to connect when routers stupidly drop icmp packets.
Win: try a few other versions of xinput too.
CSQC: Added a CSQC_GenerateMaterial function, to give the csqc a chance to generate custom materials.
MenuQC: Added support for the skeletal objects API.
2024-04-09 17:13:59 +00:00
# define QUAKEOVERRIDES "set sv_listen_nq 2\nset v_gammainverted 1\nset cl_download_mapsrc \"https: //maps.quakeworld.nu/all/\"\nset con_stayhidden 0\nset allow_download_pakcontents 2\nset allow_download_refpackages 0\nset r_meshpitch -1\nr_sprite_backfacing 1\nset sv_bigcoords \"\"\nmap_autoopenportals 1\n" "sv_port "STRINGIFY(PORT_QWSERVER)" "STRINGIFY(PORT_NQSERVER)"\n" ZFIXHACK EZQUAKECOMPETITIVE QUAKESPASMSUCKS
2023-04-21 11:36:13 +00:00
# define QCFG " //schemes quake qw\n" QUAKEOVERRIDES "set com_parseutf8 0\n" QRPCOMPAT
Added sys_openfile console command(and menu option) to web and flatpak(via cmake+dbus) builds, to 'install' packages on sandboxed systems a bit more easily.
Cmake: Add FTE_WERROR option, defaults to true in debug builds and off in release builds (in case future compilers have issues).
Cmake: Pull in libXscreensaver so we don't get interrupted by screensavers when playing demos.
Make: Added `make webcl-rel` for a web build without server bloat (eg for sites focused on demo playback. Yes, this means you XantoM).
fteqcc: Include the decompiler in fteqcc (non-gui) builds ('-d' arg).
fteqcc: Decompiler can now mostly handle hexen2 mods without any unknown opcodes.
Allow ezHud and OpenSSL to be compiled as in-engine plugins, potentially for web and windows ports respectively.
Web: Fix support for ogg vorbis. Add support for voip.
Web: Added basic support for WebXR.
QTV: Don't try seeking on unseekable qtv streams. Don't spam when developer 1 is set.
QTV: add support for some eztv extensions.
MVD: added hack to use ktx's vweps in mvd where mvdsv doesn't bother to record the info.
qwfwd: hack around a hack in qwfwd, allowing it to work again.
recording: favour qwd in single player, instead of mvd.
Protocol: reduce client memory used for precache names. Bump maximum precache counts - some people are just abusive, yes you Orl.
hexen2: add enough clientside protocol compat to play the demo included with h2mp. lacks effects.
in_xflip: restored this setting.
fs_hidesyspaths: new cvar, defaults to enabled so you won't find your username or whatever turning up in screenshots or the like. change it to 0 before debuging stuff eg via 'path'.
gl_overbright_models: Added cvar to match QS.
netchan: Added MTU determination, we'll no longer fail to connect when routers stupidly drop icmp packets.
Win: try a few other versions of xinput too.
CSQC: Added a CSQC_GenerateMaterial function, to give the csqc a chance to generate custom materials.
MenuQC: Added support for the skeletal objects API.
2024-04-09 17:13:59 +00:00
# define EZCFG " //mainconfig config\n" QCFG "fps_preset fast\n"
2023-04-21 11:36:13 +00:00
# define KEXCFG " //schemes quake_r2\n" QUAKEOVERRIDES "set com_parseutf8 1\nset campaign 0\nset net_enable_dtls 1\nset sv_mintic 0.016666667\nset sv_maxtic $sv_mintic\nset cl_netfps 60\n"
/*NetQuake reconfiguration, to make certain people feel more at home...*/
Added sys_openfile console command(and menu option) to web and flatpak(via cmake+dbus) builds, to 'install' packages on sandboxed systems a bit more easily.
Cmake: Add FTE_WERROR option, defaults to true in debug builds and off in release builds (in case future compilers have issues).
Cmake: Pull in libXscreensaver so we don't get interrupted by screensavers when playing demos.
Make: Added `make webcl-rel` for a web build without server bloat (eg for sites focused on demo playback. Yes, this means you XantoM).
fteqcc: Include the decompiler in fteqcc (non-gui) builds ('-d' arg).
fteqcc: Decompiler can now mostly handle hexen2 mods without any unknown opcodes.
Allow ezHud and OpenSSL to be compiled as in-engine plugins, potentially for web and windows ports respectively.
Web: Fix support for ogg vorbis. Add support for voip.
Web: Added basic support for WebXR.
QTV: Don't try seeking on unseekable qtv streams. Don't spam when developer 1 is set.
QTV: add support for some eztv extensions.
MVD: added hack to use ktx's vweps in mvd where mvdsv doesn't bother to record the info.
qwfwd: hack around a hack in qwfwd, allowing it to work again.
recording: favour qwd in single player, instead of mvd.
Protocol: reduce client memory used for precache names. Bump maximum precache counts - some people are just abusive, yes you Orl.
hexen2: add enough clientside protocol compat to play the demo included with h2mp. lacks effects.
in_xflip: restored this setting.
fs_hidesyspaths: new cvar, defaults to enabled so you won't find your username or whatever turning up in screenshots or the like. change it to 0 before debuging stuff eg via 'path'.
gl_overbright_models: Added cvar to match QS.
netchan: Added MTU determination, we'll no longer fail to connect when routers stupidly drop icmp packets.
Win: try a few other versions of xinput too.
CSQC: Added a CSQC_GenerateMaterial function, to give the csqc a chance to generate custom materials.
MenuQC: Added support for the skeletal objects API.
2024-04-09 17:13:59 +00:00
# define NQCFG " //disablehomedir 1\n//mainconfig ftenq\n" QCFG "cfg_save_auto 1\nfps_preset nq\nset cl_loopbackprotocol auto\ncl_sbar 1\nset plug_sbar 0\nset sv_port "STRINGIFY(PORT_NQSERVER)"\ncl_defaultport "STRINGIFY(PORT_NQSERVER)"\nset m_preset_chosen 1\nset vid_wait 1\nset cl_demoreel 1\n"
2023-04-21 11:36:13 +00:00
# define SPASMCFG NQCFG "fps_preset builtin_spasm\nset cl_demoreel 0\ncl_sbar 2\nset gl_load24bit 1\n"
# define FITZCFG NQCFG "fps_preset builtin_spasm\ncl_sbar 2\nset gl_load24bit 1\n"
# define TENEBRAECFG NQCFG "fps_preset builtin_tenebrae\n"
//nehahra has to be weird with its extra cvars, and buggy fullbrights.
# define NEHCFG QCFG "set nospr32 0\nset cutscene 1\nalias startmap_sp \"map nehstart\"\nr_fb_bmodels 0\nr_fb_models 0\n"
/*stuff that makes dp-only mods work a bit better*/
# define DPCOMPAT QCFG "gl_specular 1\nset _cl_playermodel \"\"\n set dpcompat_set 1\ndpcompat_console 1\nset dpcompat_corruptglobals 1\nset vid_pixelheight 1\nset dpcompat_set 1\nset dpcompat_console 1\nset r_particlesdesc effectinfo\n"
/*nexuiz/xonotic has a few quirks/annoyances...*/
# define NEXCFG DPCOMPAT "cl_loopbackprotocol dpp7\nset sv_listen_dp 1\nset sv_listen_qw 0\nset sv_listen_nq 0\nset dpcompat_nopreparse 1\nset sv_bigcoords 1\nset sv_maxairspeed \"30\"\nset sv_jumpvelocity 270\nset sv_mintic \"0.01\"\ncl_nolerp 0\n"
# define XONCFG NEXCFG "set qport $qport_\ncom_parseutf8 1\npr_fixbrokenqccarrays 2\nset pr_csqc_memsize 64m\nset pr_ssqc_memsize 96m\n"
/*some modern non-compat settings*/
# define DMFCFG "set com_parseutf8 1\npm_airstep 1\nsv_demoExtensions 1\n"
2023-06-05 23:27:04 +00:00
/*set some stuff so our regular qw client appears more like hexen2. sv_mintic must be 0.015 to 'fix' the ravenstaff so that its projectiles don't impact upon each other, or even 0.05 to exactly match the hardcoded assumptions in obj_push. There's maps that depend on a low framerate via waterjump framerate-dependance too.*/
# define HEX2CFG " //schemes hexen2\n" "set v_gammainverted 1\nset com_parseutf8 -1\nset gl_font gfx/hexen2\nset in_builtinkeymap 0\nset_calc cl_playerclass int (random * 5) + 1\nset cl_forwardspeed 200\nset cl_backspeed 200\ncl_sidespeed 225\nset sv_maxspeed 640\ncl_run 0\nset watervis 1\nset r_lavaalpha 1\nset r_lavastyle -2\nset r_wateralpha 0.5\nset sv_pupglow 1\ngl_shaftlight 0.5\nsv_mintic 0.05\nset r_meshpitch -1\nset r_meshroll -1\nr_sprite_backfacing 1\nset mod_warnmodels 0\nset cl_model_bobbing 1\nsv_sound_watersplash \"misc/hith2o.wav\"\nsv_sound_land \"fx/thngland.wav\"\nset sv_walkpitch 0\n"
2023-04-21 11:36:13 +00:00
/*yay q2!*/
2023-09-02 05:48:29 +00:00
# define Q2CFG " //schemes quake2\n" "set v_gammainverted 1\nset com_parseutf8 0\ncom_gamedirnativecode 1\nset sv_bigcoords 0\nsv_port "STRINGIFY(PORT_Q2SERVER)" "STRINGIFY(PORT_Q2EXSERVER)"\ncl_defaultport "STRINGIFY(PORT_Q2SERVER)"\n" \
2024-06-09 01:02:55 +00:00
" set r_replacemodels " IFMINIMAL ( " " , " md3 md5mesh " ) " \n " \
2023-09-02 05:48:29 +00:00
" set r_glsl_emissive 0 \n " /*work around the _glow textures not being meant to glow*/
2023-04-21 11:36:13 +00:00
/*Q3's ui doesn't like empty model/headmodel/handicap cvars, even if the gamecode copes*/
# define Q3CFG " //schemes quake3\n" "set v_gammainverted 0\nset snd_ignorecueloops 1\nsetfl g_gametype 0 s\nset gl_clear 1\nset r_clearcolour 0 0 0\nset com_parseutf8 0\ngl_overbright "FORWEB("0","2")"\nseta model sarge\nseta headmodel sarge\nseta handicap 100\ncom_gamedirnativecode 1\nsv_port "STRINGIFY(PORT_Q3SERVER)"\ncl_defaultport "STRINGIFY(PORT_Q3SERVER)"\ncom_protocolversion 68\n"
//#define RMQCFG "sv_bigcoords 1\n"
# define HLCFG NULL
# ifndef UPDATEURL
# ifdef HAVE_SSL
# define UPDATEURL(g) " / downloadables.php?game=" #g
# else
# define UPDATEURL(g) NULL
# endif
# endif
# define QUAKEPROT "FTE-Quake DarkPlaces-Quake"
typedef struct {
const char * argname ; //used if this was used as a parameter.
const char * exename ; //used if the exe name contains this
const char * protocolname ; //sent to the master server when this is the current gamemode (Typically set for DP compat).
const char * auniquefile [ 4 ] ; //used if this file is relative from the gamedir. needs just one file
const char * customexec ;
const char * dir [ 4 ] ;
const char * poshname ; //Full name for the game.
const char * downloadsurl ; //url to check for updates.
const char * needpackages ; //package name(s) that are considered mandatory for this game to work.
const char * manifestfile ; //contents of manifest file to use.
} gamemode_info_t ;
static const gamemode_info_t gamemode_info [ ] = {
# ifdef GAME_SHORTNAME
# ifndef GAME_PROTOCOL
# define GAME_PROTOCOL DISTRIBUTION
# endif
# ifndef GAME_IDENTIFYINGFILES
# define GAME_IDENTIFYINGFILES NULL //
# endif
# ifndef GAME_DEFAULTCMDS
# define GAME_DEFAULTCMDS NULL //doesn't need anything
# endif
# ifndef GAME_BASEGAMES
# define GAME_BASEGAMES "data"
# endif
# ifndef GAME_FULLNAME
# define GAME_FULLNAME FULLENGINENAME
# endif
# ifndef GAME_MANIFESTUPDATE
# define GAME_MANIFESTUPDATE NULL
# endif
{ " - " GAME_SHORTNAME , GAME_SHORTNAME , GAME_PROTOCOL , { GAME_IDENTIFYINGFILES } , GAME_DEFAULTCMDS , { GAME_BASEGAMES } , GAME_FULLNAME , NULL /*updateurl*/ , NULL /*needpackages*/ , GAME_MANIFESTUPDATE } ,
# endif
//note that there is no basic 'fte' gamemode, this is because we aim for network compatability. Darkplaces-Quake is the closest we get.
//this is to avoid having too many gamemodes anyway.
//mission packs should generally come after the main game to avoid prefering the main game. we violate this for hexen2 as the mission pack is mostly a superset.
//whereas the quake mission packs replace start.bsp making the original episodes unreachable.
//for quake, we also allow extracting all files from paks. some people think it loads faster that way or something.
# ifdef HAVE_LEGACY
//cmdline switch exename protocol name(dpmaster) identifying file exec dir1 dir2 dir3 dir(fte) full name
//use rerelease behaviours if we seem to be running from that dir.
{ " -quake_rerel " , NULL , " FTE-QuakeRerelease " , { " QuakeEX.kpf " } , KEXCFG , { " id1 " , " *fte " } , " Quake Re-Release " , UPDATEURL ( Q1 ) } ,
//standard quake
{ " -quake " , " q1 " , QUAKEPROT , { " id1/pak0.pak " , " id1/quake.rc " } , QCFG , { " id1 " , " qw " , " *fte " } , " Quake " , UPDATEURL ( Q1 ) } ,
//alternative name, because fmf file install names are messy when a single name is used for registry install path.
{ " -afterquake " , NULL , " FTE-Quake " , { " id1/pak0.pak " , " id1/quake.rc " } , QCFG , { " id1 " , " qw " , " *fte " } , " AfterQuake " , UPDATEURL ( Q1 ) , NULL } ,
//netquake-specific quake that avoids qw/ with its nquake fuckups, and disables nqisms
{ " -netquake " , NULL , QUAKEPROT , { " id1/pak0.pak " , " id1/quake.rc " } , NQCFG , { " id1 " } , " NetQuake " , UPDATEURL ( Q1 ) } ,
//common variant of fitzquake that includes its own special pak file in the basedir
{ " -spasm " , NULL , QUAKEPROT , { " quakespasm.pak " } , SPASMCFG , { " /id1 " } , " FauxSpasm " , UPDATEURL ( Q1 ) } ,
//because we can. 'fps_preset spasm' is hopefully close enough...
{ " -fitz " , " nq " , QUAKEPROT , { " id1/pak0.pak " , " id1/quake.rc " } , FITZCFG , { " id1 " } , " FauxFitz " , UPDATEURL ( Q1 ) } ,
//because we can
Added sys_openfile console command(and menu option) to web and flatpak(via cmake+dbus) builds, to 'install' packages on sandboxed systems a bit more easily.
Cmake: Add FTE_WERROR option, defaults to true in debug builds and off in release builds (in case future compilers have issues).
Cmake: Pull in libXscreensaver so we don't get interrupted by screensavers when playing demos.
Make: Added `make webcl-rel` for a web build without server bloat (eg for sites focused on demo playback. Yes, this means you XantoM).
fteqcc: Include the decompiler in fteqcc (non-gui) builds ('-d' arg).
fteqcc: Decompiler can now mostly handle hexen2 mods without any unknown opcodes.
Allow ezHud and OpenSSL to be compiled as in-engine plugins, potentially for web and windows ports respectively.
Web: Fix support for ogg vorbis. Add support for voip.
Web: Added basic support for WebXR.
QTV: Don't try seeking on unseekable qtv streams. Don't spam when developer 1 is set.
QTV: add support for some eztv extensions.
MVD: added hack to use ktx's vweps in mvd where mvdsv doesn't bother to record the info.
qwfwd: hack around a hack in qwfwd, allowing it to work again.
recording: favour qwd in single player, instead of mvd.
Protocol: reduce client memory used for precache names. Bump maximum precache counts - some people are just abusive, yes you Orl.
hexen2: add enough clientside protocol compat to play the demo included with h2mp. lacks effects.
in_xflip: restored this setting.
fs_hidesyspaths: new cvar, defaults to enabled so you won't find your username or whatever turning up in screenshots or the like. change it to 0 before debuging stuff eg via 'path'.
gl_overbright_models: Added cvar to match QS.
netchan: Added MTU determination, we'll no longer fail to connect when routers stupidly drop icmp packets.
Win: try a few other versions of xinput too.
CSQC: Added a CSQC_GenerateMaterial function, to give the csqc a chance to generate custom materials.
MenuQC: Added support for the skeletal objects API.
2024-04-09 17:13:59 +00:00
{ " -tenebrae " , NULL , QUAKEPROT , { " tenebrae/Pak0.pak " , " id1/quake.rc " } , TENEBRAECFG , { " id1 " , " tenebrae " } , " FauxTenebrae " , UPDATEURL ( Q1 ) } ,
//for the luls
{ " -ezquake " , " ez " , " FTE-Quake " , { " id1/pak0.pak " , " id1/quake.rc " } , EZCFG , { " id1 " , " qw " , " *ezquake " } , " ezFTE " , UPDATEURL ( Q1 ) , NULL } ,
2023-04-21 11:36:13 +00:00
2023-07-02 03:19:01 +00:00
# if defined(Q2CLIENT) || defined(Q2SERVER)
//list quake2 before q1 missionpacks, to avoid confusion about rogue/pak0.pak
{ " -quake2 " , " q2 " , " Quake2 " , { " baseq2/pak0.pak " } , Q2CFG , { " baseq2 " , " *fteq2 " } , " Quake II " , UPDATEURL ( Q2 ) } ,
//mods of the above that should generally work.
{ " -dday " , " dday " , " Quake2 " , { " dday/pak0.pak " } , Q2CFG , { " baseq2 " , " dday " , " *fteq2 " } , " D-Day: Normandy " } ,
# endif
//quake's mission packs technically have their own protocol (thanks to stat_items). copyrights mean its best to keep them separate, too.
2023-11-19 19:56:39 +00:00
{ " -hipnotic " , " hipnotic " , " FTE-Hipnotic " , { " hipnotic/pak0.pak " , " hipnotic/gfx.wad " } , QCFG , { " id1 " , " qw " , " hipnotic " , " *fte " } , " Quake: Scourge of Armagon " , UPDATEURL ( Q1 ) } ,
2023-07-02 03:19:01 +00:00
{ " -rogue " , " rogue " , " FTE-Rogue " , { " rogue/pak0.pak " , " rogue/gfx.wad " } , QCFG , { " id1 " , " qw " , " rogue " , " *fte " } , " Quake: Dissolution of Eternity " , UPDATEURL ( Q1 ) } ,
2023-04-21 11:36:13 +00:00
//various quake-dependant non-standalone mods that require hacks
//quoth needed an extra arg just to enable hipnotic hud drawing, it doesn't actually do anything weird, but most engines have a -quoth arg, so lets have one too.
2023-07-02 03:19:01 +00:00
{ " -quoth " , " quoth " , " FTE-Quake " , { " quoth/pak0.pak " } , QCFG , { " id1 " , " qw " , " quoth " , " *fte " } , " Quake: Quoth " , UPDATEURL ( Q1 ) } ,
{ " -nehahra " , " nehahra " , " FTE-Quake " , { " nehahra/pak0.pak " } , NEHCFG , { " id1 " , " qw " , " nehahra " , " *fte " } , " Quake: Seal Of Nehahra " , UPDATEURL ( Q1 ) } ,
2023-04-21 11:36:13 +00:00
//various quake-based standalone mods.
{ " -librequake " , " librequake " , " LibreQuake " , { " lq1/pak0.pak " , " lq1/gfx.pk3 " , " lq1/quake.rc " } , QCFG , { " lq1 " } , " LibreQuake " , UPDATEURL ( LQ ) } ,
// {"-nexuiz", "nexuiz", "Nexuiz", {"nexuiz.exe"}, NEXCFG, {"data", "*ftedata"},"Nexuiz"},
// {"-xonotic", "xonotic", "Xonotic", {"data/xonotic-data.pk3dir",
// "data/xonotic-*data*.pk3"}, XONCFG, {"data", "*ftedata"},"Xonotic", UPDATEURL(Xonotic)},
// {"-spark", "spark", "Spark", {"base/src/progs.src",
// "base/qwprogs.dat",
// "base/pak0.pak"}, DMFCFG, {"base", }, "Spark"},
// {"-scouts", "scouts", "FTE-SJ", {"basesj/src/progs.src",
// "basesj/progs.dat",
// "basesj/pak0.pak"}, NULL, {"basesj", }, "Scouts Journey"},
// {"-rmq", "rmq", "RMQ", {NULL}, RMQCFG, {"id1", "qw", "rmq", "*fte" }, "Remake Quake"},
# ifdef HEXEN2
//hexen2's mission pack generally takes precedence if both are installed.
{ " -portals " , " h2mp " , " FTE-H2MP " , { " portals/hexen.rc " ,
" portals/pak3.pak " } , HEX2CFG , { " data1 " , " portals " , " *fteh2 " } , " Hexen II MP " , UPDATEURL ( H2 ) } ,
{ " -hexen2 " , " hexen2 " , " FTE-Hexen2 " , { " data1/pak0.pak " } , HEX2CFG , { " data1 " , " *fteh2 " } , " Hexen II " , UPDATEURL ( H2 ) } ,
# endif
# if defined(Q3CLIENT) || defined(Q3SERVER)
{ " -quake3 " , " q3 " , " Quake3 " , { " baseq3/pak0.pk3 " } , Q3CFG , { " baseq3 " , " *fteq3 " } , " Quake III Arena " , UPDATEURL ( Q3 ) , " fteplug_quake3 " } ,
{ " -quake3demo " , " q3demo " , " Quake3Demo " , { " demoq3/pak0.pk3 " } , Q3CFG , { " demoq3 " , " *fteq3 " } , " Quake III Arena Demo " , NULL , " fteplug_quake3 " } ,
//the rest are not supported in any real way. maps-only mostly, if that
// {"-quake4", "q4", "FTE-Quake4", {"q4base/pak00.pk4"}, NULL, {"q4base", "*fteq4"}, "Quake 4"},
// {"-et", NULL, "FTE-EnemyTerritory", {"etmain/pak0.pk3"}, NULL, {"etmain", "*fteet"}, "Wolfenstein - Enemy Territory"},
// {"-jk2", "jk2", "FTE-JK2", {"base/assets0.pk3"}, NULL, {"base", "*ftejk2"}, "Jedi Knight II: Jedi Outcast"},
// {"-warsow", "warsow", "FTE-Warsow", {"basewsw/pak0.pk3"}, NULL, {"basewsw", "*ftewsw"}, "Warsow"},
2024-04-06 00:05:33 +00:00
{ " -cod4 " , NULL , " FTE-CoD4 " , { " cod4.ico " } , NULL , { " main " , " *ftecod " } , " Call of Duty 4 " , NULL , " fteplug_cod " } ,
{ " -cod2 " , NULL , " FTE-CoD2 " , { " main/iw_00.iwd " } , NULL , { " main " , " *ftecod " } , " Call of Duty 2 " , NULL , " fteplug_cod " } ,
{ " -cod " , NULL , " FTE-CoD " , { " Main/pak0.pk3 " } , NULL , { " Main " , " *ftecod " } , " Call of Duty " , NULL , " fteplug_cod " } ,
2023-04-21 11:36:13 +00:00
# endif
# if !defined(QUAKETC) && !defined(MINIMAL)
// {"-doom", "doom", "FTE-Doom", {"doom.wad"}, NULL, {"*", "*ftedoom"},"Doom"},
// {"-doom2", "doom2", "FTE-Doom2", {"doom2.wad"}, NULL, {"*", "*ftedoom"},"Doom2"},
// {"-doom3", "doom3", "FTE-Doom3", {"doom3.wad"}, NULL, {"based3", "*ftedoom3"},"Doom3"},
//for the luls
// {"-diablo2", NULL, "FTE-Diablo2", {"d2music.mpq"}, NULL, {"*", "*fted2"}, "Diablo 2"},
# endif
/* maintained by FreeHL ~eukara */
2023-05-04 12:40:58 +00:00
{ " -halflife " , " halflife " , " FTE-HalfLife " , { " valve/liblist.gam " } , HLCFG , { " logos " , " valve " } , " Half-Life " , " https://www.frag-net.com/pkgs/list " , " game_valve;fteplug_ffmpeg " } ,
2023-04-21 11:36:13 +00:00
# endif
{ NULL }
} ;
2015-09-07 14:34:39 +00:00
void FS_BeginManifestUpdates ( void ) ;
2015-04-21 04:12:00 +00:00
static void QDECL fs_game_callback ( cvar_t * var , char * oldvalue ) ;
2018-10-23 07:09:06 +00:00
static void COM_InitHomedir ( ftemanifest_t * man ) ;
2005-08-26 22:52:26 +00:00
hashtable_t filesystemhash ;
2021-11-03 20:31:08 +00:00
static qboolean com_fschanged = true , com_fsneedreload ;
2015-04-14 23:12:17 +00:00
qboolean com_installer = false ;
2014-03-30 08:55:06 +00:00
qboolean fs_readonly ;
2023-01-09 05:12:39 +00:00
static searchpath_t * fs_allowfileuri ;
2015-05-16 15:51:39 +00:00
int waitingformanifest ;
2010-07-11 02:22:39 +00:00
static unsigned int fs_restarts ;
2014-10-05 20:04:11 +00:00
void * fs_thread_mutex ;
2017-12-15 06:56:40 +00:00
float fs_accessed_time ; //timestamp of read (does not include flocates, which should normally happen via a cache).
2014-02-11 17:51:29 +00:00
Added sys_openfile console command(and menu option) to web and flatpak(via cmake+dbus) builds, to 'install' packages on sandboxed systems a bit more easily.
Cmake: Add FTE_WERROR option, defaults to true in debug builds and off in release builds (in case future compilers have issues).
Cmake: Pull in libXscreensaver so we don't get interrupted by screensavers when playing demos.
Make: Added `make webcl-rel` for a web build without server bloat (eg for sites focused on demo playback. Yes, this means you XantoM).
fteqcc: Include the decompiler in fteqcc (non-gui) builds ('-d' arg).
fteqcc: Decompiler can now mostly handle hexen2 mods without any unknown opcodes.
Allow ezHud and OpenSSL to be compiled as in-engine plugins, potentially for web and windows ports respectively.
Web: Fix support for ogg vorbis. Add support for voip.
Web: Added basic support for WebXR.
QTV: Don't try seeking on unseekable qtv streams. Don't spam when developer 1 is set.
QTV: add support for some eztv extensions.
MVD: added hack to use ktx's vweps in mvd where mvdsv doesn't bother to record the info.
qwfwd: hack around a hack in qwfwd, allowing it to work again.
recording: favour qwd in single player, instead of mvd.
Protocol: reduce client memory used for precache names. Bump maximum precache counts - some people are just abusive, yes you Orl.
hexen2: add enough clientside protocol compat to play the demo included with h2mp. lacks effects.
in_xflip: restored this setting.
fs_hidesyspaths: new cvar, defaults to enabled so you won't find your username or whatever turning up in screenshots or the like. change it to 0 before debuging stuff eg via 'path'.
gl_overbright_models: Added cvar to match QS.
netchan: Added MTU determination, we'll no longer fail to connect when routers stupidly drop icmp packets.
Win: try a few other versions of xinput too.
CSQC: Added a CSQC_GenerateMaterial function, to give the csqc a chance to generate custom materials.
MenuQC: Added support for the skeletal objects API.
2024-04-09 17:13:59 +00:00
static cvar_t fs_hidesyspaths = CVARFD ( " fs_hidesyspaths " , IFWEB ( " 0 " , " 1 " ) , 0 , " 0: Show system paths in console prints that might appear in screenshots or video capture. \n 1: Replace the start of filenames in console prints with generic prefixes that cannot leak private info like your operating system's user name. " ) ;
2022-03-08 05:31:34 +00:00
static cvar_t com_fs_cache = CVARFD ( " fs_cache " , IFMINIMAL ( " 2 " , " 1 " ) , CVAR_ARCHIVE , " 0: Do individual lookups. \n 1: Scan all files for accelerated lookups. This provides a performance boost on windows and avoids case sensitivity issues on linux. \n 2: like 1, but don't bother checking for external changes (avoiding the cost of rebuild the cache). " ) ;
static cvar_t fs_noreexec = CVARD ( " fs_noreexec " , " 0 " , " Disables automatic re-execing configs on gamedir switches. \n This means your cvar defaults etc may be from the wrong mod, and cfg_save will leave that stuff corrupted! " ) ;
static cvar_t cfg_reload_on_gamedir = CVAR ( " cfg_reload_on_gamedir " , " 1 " ) ;
static cvar_t fs_game = CVARAFCD ( " fs_game " /*q3*/ , " " , " game " /*q2/qs*/ , CVAR_NOSAVE | CVAR_NORESET , fs_game_callback , " Provided for Q2 compat. Contains the subdir of the current mod. " ) ;
static cvar_t fs_gamepath = CVARAFD ( " fs_gamepath " /*q3ish*/ , " " , " fs_gamedir " /*q2*/ , CVAR_NOUNSAFEEXPAND | CVAR_NOSET | CVAR_NOSAVE , " Provided for Q2/Q3 compat. System path of the active gamedir. " ) ;
static cvar_t fs_basepath = CVARAFD ( " fs_basepath " /*q3*/ , " " , " fs_basedir " /*q2*/ , CVAR_NOUNSAFEEXPAND | CVAR_NOSET | CVAR_NOSAVE , " Provided for Q2/Q3 compat. System path of the base directory. " ) ;
static cvar_t fs_homepath = CVARAFD ( " fs_homepath " /*q3ish*/ , " " , " fs_homedir " /*q2ish*/ , CVAR_NOUNSAFEEXPAND | CVAR_NOSET | CVAR_NOSAVE , " Provided for Q2/Q3 compat. System path of the base directory. " ) ;
2021-04-14 05:21:04 +00:00
static cvar_t dpcompat_ignoremodificationtimes = CVARAFD ( " fs_packageprioritisation " , " 1 " , " dpcompat_ignoremodificationtimes " , CVAR_NOUNSAFEEXPAND | CVAR_NOSAVE , " Favours the package that is: \n 0: Most recently modified \n 1: Is alphabetically last (favour z over a, 9 over 0). " ) ;
Added sys_openfile console command(and menu option) to web and flatpak(via cmake+dbus) builds, to 'install' packages on sandboxed systems a bit more easily.
Cmake: Add FTE_WERROR option, defaults to true in debug builds and off in release builds (in case future compilers have issues).
Cmake: Pull in libXscreensaver so we don't get interrupted by screensavers when playing demos.
Make: Added `make webcl-rel` for a web build without server bloat (eg for sites focused on demo playback. Yes, this means you XantoM).
fteqcc: Include the decompiler in fteqcc (non-gui) builds ('-d' arg).
fteqcc: Decompiler can now mostly handle hexen2 mods without any unknown opcodes.
Allow ezHud and OpenSSL to be compiled as in-engine plugins, potentially for web and windows ports respectively.
Web: Fix support for ogg vorbis. Add support for voip.
Web: Added basic support for WebXR.
QTV: Don't try seeking on unseekable qtv streams. Don't spam when developer 1 is set.
QTV: add support for some eztv extensions.
MVD: added hack to use ktx's vweps in mvd where mvdsv doesn't bother to record the info.
qwfwd: hack around a hack in qwfwd, allowing it to work again.
recording: favour qwd in single player, instead of mvd.
Protocol: reduce client memory used for precache names. Bump maximum precache counts - some people are just abusive, yes you Orl.
hexen2: add enough clientside protocol compat to play the demo included with h2mp. lacks effects.
in_xflip: restored this setting.
fs_hidesyspaths: new cvar, defaults to enabled so you won't find your username or whatever turning up in screenshots or the like. change it to 0 before debuging stuff eg via 'path'.
gl_overbright_models: Added cvar to match QS.
netchan: Added MTU determination, we'll no longer fail to connect when routers stupidly drop icmp packets.
Win: try a few other versions of xinput too.
CSQC: Added a CSQC_GenerateMaterial function, to give the csqc a chance to generate custom materials.
MenuQC: Added support for the skeletal objects API.
2024-04-09 17:13:59 +00:00
cvar_t fs_dlURL = CVARAFD ( /*ioq3*/ " sv_dlURL " , " " , /*dp*/ " sv_curl_defaulturl " , CVAR_SERVERINFO | IFWEB ( CVAR_NOSAVE , CVAR_ARCHIVE ) , " Provides clients with an external url from which they can obtain pk3s/packages from an external http server instead of having to download over udp. " ) ;
cvar_t cl_download_mapsrc = CVARFD ( " cl_download_mapsrc " , " " , CVAR_ARCHIVE , " Specifies an http location prefix for map downloads. EG: \" http://example.com/path/gamemaps/ \" " ) ;
2005-08-26 22:52:26 +00:00
int active_fs_cachetype ;
2011-12-05 15:23:40 +00:00
static int fs_referencetype ;
2012-02-27 12:23:15 +00:00
int fs_finds ;
2013-09-26 09:24:52 +00:00
void COM_CheckRegistered ( void ) ;
2020-04-19 01:23:32 +00:00
void Mods_FlushModList ( void ) ;
2021-11-03 20:31:08 +00:00
static void FS_ReloadPackFilesFlags ( unsigned int reloadflags ) ;
Too many changes, sorry.
Change revision displays, use the SVN commit date instead of using __DATE__ (when there's no local changes). This should allow reproducible builds.
Added s_al_disable cvar, to block openal and all the various problems people have had with it, without having to name an explicit fallback (which would vary by system).
Add mastervolume cvar (for ss).
Add r_shadows 2 (aka fake shadows - for ss).
Add scr_loadingscreen_aspect -1 setting, to disable levelshots entirely, also disables the progress bar (for ss).
Better support for some effectinfo hacks (for ss).
Added dpcompat_nocsqcwarnings (because of lazy+buggy mods like ss).
Rework the dpcsqc versions of project+unproject builtins for better compat (for ss).
Added dpcompat_csqcinputeventtypes to block unexpected csqc input events (for ss).
Better compat with DP's loadfont console command (for ss).
Added dpcompat_smallerfonts cvar to replicate a DP bug (for ss).
Detect dp's m_draw extension, to work around it (for ss).
Cvar dpcompat_ignoremodificationtimes added. A value of 0 favour the most recently modified file, 1 will use DP-like alphabetically sorted preferences (for ss).
loadfont builtin can now accept outline=1 in the sizes arg for slightly more readable fonts.
Fix bbox calcs for rotated entities, fix needed for r_ignorenetpvs 0.
Hackily parse emoji.json to provide :poop: etc suggestions.
Skip prediction entirely when there's no local entity info. This fixes stair-smoothing in xonotic.
screenshot_cubemap will now capture half-float images when saving to ktx or dds files.
Fix support for xcf files larger than 4gb, mostly to avoid compiler warnings.
Fixed size of gfx/loading.lmp when replacement textures are used.
Added mipmap support for rg8 and l8a8 textures.
r_hdr_framebuffer cvar updated to support format names instead of random negative numbers. Description updated to name some interesting ones.
Perform autoupdate _checks_ ONLY with explicit user confirmation (actual updating already needed user confirmation, but this extra step should reduce the chances of us getting wrongly accused of exfiltrating user data if we're run in a sandbox - we ONLY ever included the updating engine's version in the checks, though there's nothing we can do to avoid sending the user's router's IP).
Removed the 'summon satan all over your harddrive' quit message, in case paranoid security researchers are idiots and don't bother doing actual research.
Removed the triptohell.info and fte.triptohell.info certificates, they really need to stop being self-signed. The updates domain is still self-signed for autoupdates.
Video drivers are now able to report supported video resolutions, visible to menuqc. Currently only works with SDL2 builds.
Added setmousepos builtin. Should work with glx+win32 build.
VF_SKYROOM_CAMERA can now accept an extra two args, setviewprop(VF_SKYROOM_CAMERA, org, axis, degrees).
Removed v_skyroom_origin+v_skyroom_orientation cvars in favour just v_skyroom, which should make it behave more like the 'fog' command (used when csqc isn't overriding).
Added R_EndPolygonRibbon builtin to make it faster+easier to generate textured ribbon/cable/etc wide lines (for TW).
sdl: Fix up sys_sdl.c's file enumeration to support wildcards in directories.
edit command now displays end1.bin/end2.bin correctly, because we can.
Finally add support for f_modified - though ruleset_allow_larger_models and ruleset_allow_overlong_sounds generally make it redundant.
Fix threading race condition in sha1 lookups.
Updated f_ruleset to include the same extra flags reported by ezquake.
A mod's default.fmf file can now contain an eg 'mainconfig config.cfg' line (to explicitly set the main config saved with cfg_save_auto 1 etc).
fmf: basegame steam:GameName/GameDir can be used to try to load a mod directory from an installed steam game. The resulting gamedir will be read-only.
HOMEDIR CHANGE: use homedirs only if the basedir cannot be written or a homedir already exists, which should further reduce the probability of microsoft randomly uploading our data to their cloud (but mostly because its annoying to never know where your data is written).
Fixed buf_cvarlist, should work in xonotic now, and without segfaults.
Added an extra arg to URI_Get_Callback calls - the response size, also changed the tempstring to contain all bytes of the response, you need to be careful about nulls though.
Try to work around nvidia's forced-panning bug on x11 when changing video modes. This might screw with other programs.
sdl: support custom icons.
sdl: support choosing a specific display.
Added some documentation to menuqc builtins.
menusys: use outlines for slightly more readable fonts.
menusys: switch vid_width and vid_height combos into a single video mode combo to set both according to reported video modes.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5581 fc73d0e0-1445-4013-8a0c-d673dee63da5
2019-11-20 03:09:50 +00:00
static qboolean Sys_SteamHasFile ( char * basepath , int basepathlen , char * steamdir , char * fname ) ;
2005-08-26 22:52:26 +00:00
2015-04-21 04:12:00 +00:00
static void QDECL fs_game_callback ( cvar_t * var , char * oldvalue )
2014-02-11 17:51:29 +00:00
{
static qboolean runaway = false ;
char buf [ MAX_OSPATH ] ;
if ( ! strcmp ( var - > string , oldvalue ) )
return ; //no change here.
if ( runaway )
return ; //ignore that
runaway = true ;
2016-08-25 00:12:14 +00:00
Cmd_ExecuteString ( va ( " gamedir %s \n " , COM_QuotedString ( var - > string , buf , sizeof ( buf ) , false ) ) , RESTRICT_LOCAL ) ;
2014-02-11 17:51:29 +00:00
runaway = false ;
}
2021-04-14 05:21:04 +00:00
static struct
2005-08-26 22:52:26 +00:00
{
2013-05-03 04:28:08 +00:00
void * module ;
2009-04-01 22:03:56 +00:00
const char * extension ;
2018-03-04 14:41:16 +00:00
searchpathfuncs_t * ( QDECL * OpenNew ) ( vfsfile_t * file , searchpathfuncs_t * parent , const char * filename , const char * desc , const char * prefix ) ;
2012-01-28 10:30:44 +00:00
qboolean loadscan ;
2009-04-01 22:03:56 +00:00
} searchpathformats [ 64 ] ;
2005-12-21 03:07:33 +00:00
2018-03-04 14:41:16 +00:00
int FS_RegisterFileSystemType ( void * module , const char * extension , searchpathfuncs_t * ( QDECL * OpenNew ) ( vfsfile_t * file , searchpathfuncs_t * parent , const char * filename , const char * desc , const char * prefix ) , qboolean loadscan )
2005-08-26 22:52:26 +00:00
{
2009-04-01 22:03:56 +00:00
unsigned int i ;
for ( i = 0 ; i < sizeof ( searchpathformats ) / sizeof ( searchpathformats [ 0 ] ) ; i + + )
2005-08-26 22:52:26 +00:00
{
2009-04-01 22:03:56 +00:00
if ( searchpathformats [ i ] . extension & & ! strcmp ( searchpathformats [ i ] . extension , extension ) )
break ; //extension match always replaces
2013-06-23 02:17:02 +00:00
if ( ! searchpathformats [ i ] . extension & & ! searchpathformats [ i ] . OpenNew )
2009-04-01 22:03:56 +00:00
break ;
2005-08-26 22:52:26 +00:00
}
2009-04-01 22:03:56 +00:00
if ( i = = sizeof ( searchpathformats ) / sizeof ( searchpathformats [ 0 ] ) )
return 0 ;
2005-08-26 22:52:26 +00:00
2013-05-03 04:28:08 +00:00
searchpathformats [ i ] . module = module ;
2009-04-01 22:03:56 +00:00
searchpathformats [ i ] . extension = extension ;
2013-06-23 02:17:02 +00:00
searchpathformats [ i ] . OpenNew = OpenNew ;
2012-01-28 10:30:44 +00:00
searchpathformats [ i ] . loadscan = loadscan ;
2009-04-01 22:03:56 +00:00
com_fschanged = true ;
2021-11-03 20:31:08 +00:00
com_fsneedreload = true ;
2005-08-26 22:52:26 +00:00
2009-04-01 22:03:56 +00:00
return i + 1 ;
2005-08-26 22:52:26 +00:00
}
2009-04-01 22:03:56 +00:00
void FS_UnRegisterFileSystemType ( int idx )
2005-08-26 22:52:26 +00:00
{
2009-04-01 22:03:56 +00:00
if ( ( unsigned int ) ( idx - 1 ) > = sizeof ( searchpathformats ) / sizeof ( searchpathformats [ 0 ] ) )
2005-08-26 22:52:26 +00:00
return ;
2013-06-23 02:17:02 +00:00
searchpathformats [ idx - 1 ] . OpenNew = NULL ;
2013-05-03 04:28:08 +00:00
searchpathformats [ idx - 1 ] . module = NULL ;
2009-04-01 22:03:56 +00:00
com_fschanged = true ;
2021-11-03 20:31:08 +00:00
com_fsneedreload = true ;
2005-08-26 22:52:26 +00:00
2009-04-01 22:03:56 +00:00
//FS_Restart will be needed
2005-08-26 22:52:26 +00:00
}
2013-05-03 04:28:08 +00:00
void FS_UnRegisterFileSystemModule ( void * module )
{
int i ;
qboolean found = false ;
2015-06-14 08:16:15 +00:00
if ( ! fs_thread_mutex | | Sys_LockMutex ( fs_thread_mutex ) )
2013-05-03 04:28:08 +00:00
{
2014-10-05 20:04:11 +00:00
for ( i = 0 ; i < sizeof ( searchpathformats ) / sizeof ( searchpathformats [ 0 ] ) ; i + + )
2013-05-03 04:28:08 +00:00
{
2014-10-05 20:04:11 +00:00
if ( searchpathformats [ i ] . module = = module )
{
2021-11-03 20:31:02 +00:00
searchpathformats [ i ] . extension = NULL ;
2014-10-05 20:04:11 +00:00
searchpathformats [ i ] . OpenNew = NULL ;
searchpathformats [ i ] . module = NULL ;
found = true ;
}
}
2015-06-14 08:16:15 +00:00
if ( fs_thread_mutex )
2014-10-05 20:04:11 +00:00
{
2015-06-14 08:16:15 +00:00
Sys_UnlockMutex ( fs_thread_mutex ) ;
if ( found )
{
Cmd_ExecuteString ( " fs_restart " , RESTRICT_LOCAL ) ;
}
2013-05-03 04:28:08 +00:00
}
}
}
2005-08-26 22:52:26 +00:00
2018-05-21 13:47:53 +00:00
char * VFS_GETS ( vfsfile_t * vf , char * buffer , size_t buflen )
2005-08-26 22:52:26 +00:00
{
2009-04-01 22:03:56 +00:00
char in ;
char * out = buffer ;
2018-05-21 13:47:53 +00:00
size_t len ;
if ( buflen < = 1 )
2009-04-01 22:03:56 +00:00
return NULL ;
2018-05-21 13:47:53 +00:00
len = buflen - 1 ;
2009-04-01 22:03:56 +00:00
while ( len > 0 )
2005-08-26 22:52:26 +00:00
{
2010-03-25 22:56:11 +00:00
if ( VFS_READ ( vf , & in , 1 ) ! = 1 )
2005-08-26 22:52:26 +00:00
{
2009-04-01 22:03:56 +00:00
if ( len = = buflen - 1 )
return NULL ;
* out = ' \0 ' ;
return buffer ;
2005-08-26 22:52:26 +00:00
}
2009-04-01 22:03:56 +00:00
if ( in = = ' \n ' )
break ;
* out + + = in ;
len - - ;
2005-08-26 22:52:26 +00:00
}
2009-04-01 22:03:56 +00:00
* out = ' \0 ' ;
2005-08-26 22:52:26 +00:00
2013-06-23 02:17:02 +00:00
//if there's a trailing \r, strip it.
if ( out > buffer )
if ( out [ - 1 ] = = ' \r ' )
out [ - 1 ] = 0 ;
2009-04-01 22:03:56 +00:00
return buffer ;
2005-08-26 22:52:26 +00:00
}
2018-05-21 13:47:53 +00:00
void VARGS VFS_PRINTF ( vfsfile_t * vf , const char * format , . . . )
2005-12-21 03:07:33 +00:00
{
2009-04-01 22:03:56 +00:00
va_list argptr ;
char string [ 1024 ] ;
2005-12-21 03:07:33 +00:00
2009-04-01 22:03:56 +00:00
va_start ( argptr , format ) ;
vsnprintf ( string , sizeof ( string ) - 1 , format , argptr ) ;
va_end ( argptr ) ;
2005-12-21 03:07:33 +00:00
2009-04-01 22:03:56 +00:00
VFS_PUTS ( vf , string ) ;
2005-12-21 03:07:33 +00:00
}
2006-03-15 20:05:25 +00:00
2023-01-09 05:12:39 +00:00
# if defined(_WIN32) && !defined(FTE_SDL) && !defined(WINRT) && !defined(_XBOX)
//windows has a special helper function to handle legacy URIs.
# else
qboolean Sys_ResolveFileURL ( const char * inurl , int inlen , char * out , int outlen )
{
const unsigned char * i = inurl , * inend = inurl + inlen ;
unsigned char * o = out , * outend = out + outlen ;
unsigned char hex ;
//make sure its a file url...
if ( inlen < 5 | | strncmp ( inurl , " file: " , 5 ) )
return false ;
i + = 5 ;
if ( i + 1 < inend & & i [ 0 ] = = ' / ' & & i [ 1 ] = = ' / ' )
{ //has an authority field...
i + = 2 ;
//except we don't support authorities other than ourself...
2023-02-20 07:47:16 +00:00
if ( i > = inend | | * i ! = ' / ' )
2023-01-09 05:12:39 +00:00
return false ; //must be an absolute path...
# ifdef _WIN32
i + + ; //on windows, (full)absolute paths start with a drive name...
# endif
}
else if ( i < inend & & i [ 0 ] = = ' / ' )
; // file:/foo (no authority)
else
return false ;
//everything else must be percent-encoded
while ( i < inend )
{
if ( ! * i | | o = = outend )
return false ; //don't allow nulls...
else if ( * i = = ' / ' & & i + 1 < inend & & i [ 1 ] = = ' / ' )
return false ; //two slashes is invalid (can be parent directory on some systems, or just buggy or weird)
else if ( * i = = ' \\ ' )
return false ; //don't allow backslashes. they're meant to be percent-encoded anyway.
else if ( * i = = ' % ' & & i + 2 < inend )
{
hex = 0 ;
if ( i [ 1 ] > = ' A ' & & i [ 1 ] < = ' F ' )
hex + = i [ 1 ] - ' A ' + 10 ;
else if ( i [ 1 ] > = ' a ' & & i [ 1 ] < = ' f ' )
hex + = i [ 1 ] - ' a ' + 10 ;
else if ( i [ 1 ] > = ' 0 ' & & i [ 1 ] < = ' 9 ' )
hex + = i [ 1 ] - ' 0 ' ;
else
{
* o + + = * i + + ;
continue ;
}
hex < < = 4 ;
if ( i [ 2 ] > = ' A ' & & i [ 2 ] < = ' F ' )
hex + = i [ 2 ] - ' A ' + 10 ;
else if ( i [ 2 ] > = ' a ' & & i [ 2 ] < = ' f ' )
hex + = i [ 2 ] - ' a ' + 10 ;
else if ( i [ 2 ] > = ' 0 ' & & i [ 2 ] < = ' 9 ' )
hex + = i [ 2 ] - ' 0 ' ;
else
{
* o + + = * i + + ;
continue ;
}
* o + + = hex ;
i + = 3 ;
}
else
* o + + = * i + + ;
}
if ( o = = outend )
return false ;
* o = 0 ;
return true ;
}
# endif
2005-12-21 03:07:33 +00:00
2006-03-15 20:05:25 +00:00
2009-04-01 22:03:56 +00:00
char gamedirfile [ MAX_OSPATH ] ;
2021-04-14 05:21:04 +00:00
static char pubgamedirfile [ MAX_OSPATH ] ; //like gamedirfile, but not set to the fte-only paths
2006-03-15 20:05:25 +00:00
2021-04-14 05:21:04 +00:00
static searchpath_t * gameonly_homedir ;
static searchpath_t * gameonly_gamedir ;
2005-12-21 03:07:33 +00:00
2014-03-30 08:55:06 +00:00
char com_gamepath [ MAX_OSPATH ] ; //c:\games\quake
char com_homepath [ MAX_OSPATH ] ; //c:\users\foo\my docs\fte\quake
qboolean com_homepathenabled ;
2021-04-14 05:21:04 +00:00
static qboolean com_homepathusable ; //com_homepath is safe, even if not enabled.
2006-03-15 20:05:25 +00:00
2019-05-23 15:11:32 +00:00
//char com_configdir[MAX_OSPATH]; //homedir/fte/configs
2006-03-15 20:05:25 +00:00
2009-04-01 22:03:56 +00:00
int fs_hash_dups ;
int fs_hash_files ;
2005-12-21 03:07:33 +00:00
2006-03-15 20:05:25 +00:00
2005-12-21 03:07:33 +00:00
2006-01-02 22:53:29 +00:00
2005-12-21 03:07:33 +00:00
2020-02-26 00:37:52 +00:00
static const char * FS_GetCleanPath ( const char * pattern , qboolean silent , char * outbuf , int outlen ) ;
2021-04-14 05:21:04 +00:00
static void FS_RegisterDefaultFileSystems ( void ) ;
2010-07-18 08:42:59 +00:00
static void COM_CreatePath ( char * path ) ;
2021-04-14 05:21:04 +00:00
static ftemanifest_t * FS_ReadDefaultManifest ( char * newbasedir , size_t newbasedirsize , qboolean fixedbasedir ) ;
2005-12-21 03:07:33 +00:00
2009-04-01 22:03:56 +00:00
# define ENFORCEFOPENMODE(mode) {if (strcmp(mode, "r") && strcmp(mode, "w") /* && strcmp(mode, "rw")*/ )Sys_Error("fs mode %s is not permitted here\n");}
2005-12-21 03:07:33 +00:00
2006-03-15 20:05:25 +00:00
2005-12-21 03:07:33 +00:00
2005-08-26 22:52:26 +00:00
2013-06-23 02:17:02 +00:00
//forget a manifest entirely.
void FS_Manifest_Free ( ftemanifest_t * man )
{
int i , j ;
if ( ! man )
return ;
2020-04-19 01:23:32 +00:00
Z_Free ( man - > filename ) ;
2013-06-23 02:17:02 +00:00
Z_Free ( man - > updateurl ) ;
Z_Free ( man - > installation ) ;
Z_Free ( man - > formalname ) ;
2020-04-19 01:23:32 +00:00
# ifdef PACKAGEMANAGER
2016-07-21 19:27:59 +00:00
Z_Free ( man - > downloadsurl ) ;
2016-08-25 00:12:14 +00:00
Z_Free ( man - > installupd ) ;
2020-04-19 01:23:32 +00:00
# endif
2022-01-30 05:55:01 +00:00
Z_Free ( man - > mainconfig ) ;
2021-08-19 06:01:42 +00:00
Z_Free ( man - > schemes ) ;
2013-06-23 02:17:02 +00:00
Z_Free ( man - > protocolname ) ;
2015-04-14 23:12:17 +00:00
Z_Free ( man - > eula ) ;
2013-06-23 02:17:02 +00:00
Z_Free ( man - > defaultexec ) ;
playdemo accepts https urls now. will start playing before the file has finished downloading, to avoid unnecessary delays.
reworked network addresses to separate address family and connection type. this should make banning people more reliable, as well as simplifying a whole load of logic (no need to check for ipv4 AND ipv6).
tcpconnect will keep trying to connect even if the connection wasn't instant, instead of giving up instantly.
rewrote tcp connections quite a bit. sv_port_tcp now handles qtv+qizmo+http+ws+rtcbroker+tls equivalents.
qtv_streamport is now a legacy cvar and now acts equivalently to sv_port_tcp (but still separate).
rewrote screenshot and video capture code to use strides. this solves image-is-upside down issues with vulkan.
ignore alt key in browser port. oh no! no more red text! oh no! no more alt-being-wrongly-down-and-being-unable-to-type-anything-without-forcing-alt-released!
reworked audio decoder interface. now has clearly defined success/unavailable/end-of-file results. this should solve a whole load of issues with audio streaming.
fixed various openal audio streaming issues too. openal also got some workarounds for emscripten's poor emulation.
fixed ogg decoder to retain sync properly if seeked.
updated menu_media a bit. now reads vorbis comments/id3v1 tags to get proper track names. also saves the playlist so you don't have to manually repopulate the list so it might actually be usable now (after how many years?)
r_stains now defaults to 0, and is no longer enabled by presets. use decals if you want that sort of thing.
added fs_noreexec cvar, so configs will not be reexeced on gamedir change. this also means defaults won't be reapplied, etc.
added 'nvvk' renderer on windows, using nvidia's vulkan-inside-opengl gl extension. mostly just to see how much slower it is.
fixed up the ftp server quite a lot. more complete, more compliant, and should do ipv6 properly to-boot. file transfers also threaded.
fixed potential crash inside runclientphys.
experimental sv_antilag=3 setting. totally untested. the aim is to avoid missing due to lagged knockbacks. may be expensive for the server.
browser port's websockets support fixed. experimental support for webrtc ('works for me', requires a broker server).
updated avplug(renamed to ffmpeg so people know what it is) to use ffmpeg 3.2.4 properly, with its new encoder api. should be much more robust... also added experimental audio decoder for game music etc (currently doesn't resample, so playback rates are screwed, disabled by cvar).
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5097 fc73d0e0-1445-4013-8a0c-d673dee63da5
2017-05-10 02:08:58 +00:00
Z_Free ( man - > defaultoverrides ) ;
2018-10-11 10:31:23 +00:00
Z_Free ( man - > basedir ) ;
2020-04-19 01:23:32 +00:00
Z_Free ( man - > iconname ) ;
2013-06-23 02:17:02 +00:00
for ( i = 0 ; i < sizeof ( man - > gamepath ) / sizeof ( man - > gamepath [ 0 ] ) ; i + + )
{
Z_Free ( man - > gamepath [ i ] . path ) ;
}
for ( i = 0 ; i < sizeof ( man - > package ) / sizeof ( man - > package [ 0 ] ) ; i + + )
{
2024-04-25 05:57:34 +00:00
Z_Free ( man - > package [ i ] . packagename ) ;
2013-06-23 02:17:02 +00:00
Z_Free ( man - > package [ i ] . path ) ;
2016-07-12 00:40:13 +00:00
Z_Free ( man - > package [ i ] . prefix ) ;
2015-09-07 14:34:39 +00:00
Z_Free ( man - > package [ i ] . condition ) ;
2023-02-20 07:47:16 +00:00
Z_Free ( man - > package [ i ] . sha512 ) ;
Z_Free ( man - > package [ i ] . signature ) ;
2013-06-23 02:17:02 +00:00
for ( j = 0 ; j < sizeof ( man - > package [ i ] . mirrors ) / sizeof ( man - > package [ i ] . mirrors [ 0 ] ) ; j + + )
Z_Free ( man - > package [ i ] . mirrors [ j ] ) ;
}
Z_Free ( man ) ;
}
//clone a manifest, so we can hack at it.
static ftemanifest_t * FS_Manifest_Clone ( ftemanifest_t * oldm )
{
ftemanifest_t * newm ;
int i , j ;
newm = Z_Malloc ( sizeof ( * newm ) ) ;
if ( oldm - > updateurl )
newm - > updateurl = Z_StrDup ( oldm - > updateurl ) ;
if ( oldm - > installation )
newm - > installation = Z_StrDup ( oldm - > installation ) ;
if ( oldm - > formalname )
newm - > formalname = Z_StrDup ( oldm - > formalname ) ;
2020-04-19 01:23:32 +00:00
# ifdef PACKAGEMANAGER
2016-07-21 19:27:59 +00:00
if ( oldm - > downloadsurl )
newm - > downloadsurl = Z_StrDup ( oldm - > downloadsurl ) ;
2016-08-25 00:12:14 +00:00
if ( oldm - > installupd )
newm - > installupd = Z_StrDup ( oldm - > installupd ) ;
2020-04-19 01:23:32 +00:00
# endif
2021-08-19 06:01:42 +00:00
if ( oldm - > schemes )
newm - > schemes = Z_StrDup ( oldm - > schemes ) ;
2013-06-23 02:17:02 +00:00
if ( oldm - > protocolname )
newm - > protocolname = Z_StrDup ( oldm - > protocolname ) ;
2015-04-14 23:12:17 +00:00
if ( oldm - > eula )
newm - > eula = Z_StrDup ( oldm - > eula ) ;
2013-08-07 14:13:18 +00:00
if ( oldm - > defaultexec )
newm - > defaultexec = Z_StrDup ( oldm - > defaultexec ) ;
playdemo accepts https urls now. will start playing before the file has finished downloading, to avoid unnecessary delays.
reworked network addresses to separate address family and connection type. this should make banning people more reliable, as well as simplifying a whole load of logic (no need to check for ipv4 AND ipv6).
tcpconnect will keep trying to connect even if the connection wasn't instant, instead of giving up instantly.
rewrote tcp connections quite a bit. sv_port_tcp now handles qtv+qizmo+http+ws+rtcbroker+tls equivalents.
qtv_streamport is now a legacy cvar and now acts equivalently to sv_port_tcp (but still separate).
rewrote screenshot and video capture code to use strides. this solves image-is-upside down issues with vulkan.
ignore alt key in browser port. oh no! no more red text! oh no! no more alt-being-wrongly-down-and-being-unable-to-type-anything-without-forcing-alt-released!
reworked audio decoder interface. now has clearly defined success/unavailable/end-of-file results. this should solve a whole load of issues with audio streaming.
fixed various openal audio streaming issues too. openal also got some workarounds for emscripten's poor emulation.
fixed ogg decoder to retain sync properly if seeked.
updated menu_media a bit. now reads vorbis comments/id3v1 tags to get proper track names. also saves the playlist so you don't have to manually repopulate the list so it might actually be usable now (after how many years?)
r_stains now defaults to 0, and is no longer enabled by presets. use decals if you want that sort of thing.
added fs_noreexec cvar, so configs will not be reexeced on gamedir change. this also means defaults won't be reapplied, etc.
added 'nvvk' renderer on windows, using nvidia's vulkan-inside-opengl gl extension. mostly just to see how much slower it is.
fixed up the ftp server quite a lot. more complete, more compliant, and should do ipv6 properly to-boot. file transfers also threaded.
fixed potential crash inside runclientphys.
experimental sv_antilag=3 setting. totally untested. the aim is to avoid missing due to lagged knockbacks. may be expensive for the server.
browser port's websockets support fixed. experimental support for webrtc ('works for me', requires a broker server).
updated avplug(renamed to ffmpeg so people know what it is) to use ffmpeg 3.2.4 properly, with its new encoder api. should be much more robust... also added experimental audio decoder for game music etc (currently doesn't resample, so playback rates are screwed, disabled by cvar).
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5097 fc73d0e0-1445-4013-8a0c-d673dee63da5
2017-05-10 02:08:58 +00:00
if ( oldm - > defaultoverrides )
newm - > defaultoverrides = Z_StrDup ( oldm - > defaultoverrides ) ;
2020-04-19 01:23:32 +00:00
if ( oldm - > iconname )
newm - > iconname = Z_StrDup ( oldm - > iconname ) ;
2018-10-11 10:31:23 +00:00
if ( oldm - > basedir )
newm - > basedir = Z_StrDup ( oldm - > basedir ) ;
2019-11-20 04:53:22 +00:00
if ( oldm - > mainconfig )
newm - > mainconfig = Z_StrDup ( oldm - > mainconfig ) ;
Too many changes, sorry.
Change revision displays, use the SVN commit date instead of using __DATE__ (when there's no local changes). This should allow reproducible builds.
Added s_al_disable cvar, to block openal and all the various problems people have had with it, without having to name an explicit fallback (which would vary by system).
Add mastervolume cvar (for ss).
Add r_shadows 2 (aka fake shadows - for ss).
Add scr_loadingscreen_aspect -1 setting, to disable levelshots entirely, also disables the progress bar (for ss).
Better support for some effectinfo hacks (for ss).
Added dpcompat_nocsqcwarnings (because of lazy+buggy mods like ss).
Rework the dpcsqc versions of project+unproject builtins for better compat (for ss).
Added dpcompat_csqcinputeventtypes to block unexpected csqc input events (for ss).
Better compat with DP's loadfont console command (for ss).
Added dpcompat_smallerfonts cvar to replicate a DP bug (for ss).
Detect dp's m_draw extension, to work around it (for ss).
Cvar dpcompat_ignoremodificationtimes added. A value of 0 favour the most recently modified file, 1 will use DP-like alphabetically sorted preferences (for ss).
loadfont builtin can now accept outline=1 in the sizes arg for slightly more readable fonts.
Fix bbox calcs for rotated entities, fix needed for r_ignorenetpvs 0.
Hackily parse emoji.json to provide :poop: etc suggestions.
Skip prediction entirely when there's no local entity info. This fixes stair-smoothing in xonotic.
screenshot_cubemap will now capture half-float images when saving to ktx or dds files.
Fix support for xcf files larger than 4gb, mostly to avoid compiler warnings.
Fixed size of gfx/loading.lmp when replacement textures are used.
Added mipmap support for rg8 and l8a8 textures.
r_hdr_framebuffer cvar updated to support format names instead of random negative numbers. Description updated to name some interesting ones.
Perform autoupdate _checks_ ONLY with explicit user confirmation (actual updating already needed user confirmation, but this extra step should reduce the chances of us getting wrongly accused of exfiltrating user data if we're run in a sandbox - we ONLY ever included the updating engine's version in the checks, though there's nothing we can do to avoid sending the user's router's IP).
Removed the 'summon satan all over your harddrive' quit message, in case paranoid security researchers are idiots and don't bother doing actual research.
Removed the triptohell.info and fte.triptohell.info certificates, they really need to stop being self-signed. The updates domain is still self-signed for autoupdates.
Video drivers are now able to report supported video resolutions, visible to menuqc. Currently only works with SDL2 builds.
Added setmousepos builtin. Should work with glx+win32 build.
VF_SKYROOM_CAMERA can now accept an extra two args, setviewprop(VF_SKYROOM_CAMERA, org, axis, degrees).
Removed v_skyroom_origin+v_skyroom_orientation cvars in favour just v_skyroom, which should make it behave more like the 'fog' command (used when csqc isn't overriding).
Added R_EndPolygonRibbon builtin to make it faster+easier to generate textured ribbon/cable/etc wide lines (for TW).
sdl: Fix up sys_sdl.c's file enumeration to support wildcards in directories.
edit command now displays end1.bin/end2.bin correctly, because we can.
Finally add support for f_modified - though ruleset_allow_larger_models and ruleset_allow_overlong_sounds generally make it redundant.
Fix threading race condition in sha1 lookups.
Updated f_ruleset to include the same extra flags reported by ezquake.
A mod's default.fmf file can now contain an eg 'mainconfig config.cfg' line (to explicitly set the main config saved with cfg_save_auto 1 etc).
fmf: basegame steam:GameName/GameDir can be used to try to load a mod directory from an installed steam game. The resulting gamedir will be read-only.
HOMEDIR CHANGE: use homedirs only if the basedir cannot be written or a homedir already exists, which should further reduce the probability of microsoft randomly uploading our data to their cloud (but mostly because its annoying to never know where your data is written).
Fixed buf_cvarlist, should work in xonotic now, and without segfaults.
Added an extra arg to URI_Get_Callback calls - the response size, also changed the tempstring to contain all bytes of the response, you need to be careful about nulls though.
Try to work around nvidia's forced-panning bug on x11 when changing video modes. This might screw with other programs.
sdl: support custom icons.
sdl: support choosing a specific display.
Added some documentation to menuqc builtins.
menusys: use outlines for slightly more readable fonts.
menusys: switch vid_width and vid_height combos into a single video mode combo to set both according to reported video modes.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5581 fc73d0e0-1445-4013-8a0c-d673dee63da5
2019-11-20 03:09:50 +00:00
newm - > homedirtype = oldm - > homedirtype ;
2013-06-23 02:17:02 +00:00
for ( i = 0 ; i < sizeof ( newm - > gamepath ) / sizeof ( newm - > gamepath [ 0 ] ) ; i + + )
{
if ( oldm - > gamepath [ i ] . path )
newm - > gamepath [ i ] . path = Z_StrDup ( oldm - > gamepath [ i ] . path ) ;
Too many changes, sorry.
Change revision displays, use the SVN commit date instead of using __DATE__ (when there's no local changes). This should allow reproducible builds.
Added s_al_disable cvar, to block openal and all the various problems people have had with it, without having to name an explicit fallback (which would vary by system).
Add mastervolume cvar (for ss).
Add r_shadows 2 (aka fake shadows - for ss).
Add scr_loadingscreen_aspect -1 setting, to disable levelshots entirely, also disables the progress bar (for ss).
Better support for some effectinfo hacks (for ss).
Added dpcompat_nocsqcwarnings (because of lazy+buggy mods like ss).
Rework the dpcsqc versions of project+unproject builtins for better compat (for ss).
Added dpcompat_csqcinputeventtypes to block unexpected csqc input events (for ss).
Better compat with DP's loadfont console command (for ss).
Added dpcompat_smallerfonts cvar to replicate a DP bug (for ss).
Detect dp's m_draw extension, to work around it (for ss).
Cvar dpcompat_ignoremodificationtimes added. A value of 0 favour the most recently modified file, 1 will use DP-like alphabetically sorted preferences (for ss).
loadfont builtin can now accept outline=1 in the sizes arg for slightly more readable fonts.
Fix bbox calcs for rotated entities, fix needed for r_ignorenetpvs 0.
Hackily parse emoji.json to provide :poop: etc suggestions.
Skip prediction entirely when there's no local entity info. This fixes stair-smoothing in xonotic.
screenshot_cubemap will now capture half-float images when saving to ktx or dds files.
Fix support for xcf files larger than 4gb, mostly to avoid compiler warnings.
Fixed size of gfx/loading.lmp when replacement textures are used.
Added mipmap support for rg8 and l8a8 textures.
r_hdr_framebuffer cvar updated to support format names instead of random negative numbers. Description updated to name some interesting ones.
Perform autoupdate _checks_ ONLY with explicit user confirmation (actual updating already needed user confirmation, but this extra step should reduce the chances of us getting wrongly accused of exfiltrating user data if we're run in a sandbox - we ONLY ever included the updating engine's version in the checks, though there's nothing we can do to avoid sending the user's router's IP).
Removed the 'summon satan all over your harddrive' quit message, in case paranoid security researchers are idiots and don't bother doing actual research.
Removed the triptohell.info and fte.triptohell.info certificates, they really need to stop being self-signed. The updates domain is still self-signed for autoupdates.
Video drivers are now able to report supported video resolutions, visible to menuqc. Currently only works with SDL2 builds.
Added setmousepos builtin. Should work with glx+win32 build.
VF_SKYROOM_CAMERA can now accept an extra two args, setviewprop(VF_SKYROOM_CAMERA, org, axis, degrees).
Removed v_skyroom_origin+v_skyroom_orientation cvars in favour just v_skyroom, which should make it behave more like the 'fog' command (used when csqc isn't overriding).
Added R_EndPolygonRibbon builtin to make it faster+easier to generate textured ribbon/cable/etc wide lines (for TW).
sdl: Fix up sys_sdl.c's file enumeration to support wildcards in directories.
edit command now displays end1.bin/end2.bin correctly, because we can.
Finally add support for f_modified - though ruleset_allow_larger_models and ruleset_allow_overlong_sounds generally make it redundant.
Fix threading race condition in sha1 lookups.
Updated f_ruleset to include the same extra flags reported by ezquake.
A mod's default.fmf file can now contain an eg 'mainconfig config.cfg' line (to explicitly set the main config saved with cfg_save_auto 1 etc).
fmf: basegame steam:GameName/GameDir can be used to try to load a mod directory from an installed steam game. The resulting gamedir will be read-only.
HOMEDIR CHANGE: use homedirs only if the basedir cannot be written or a homedir already exists, which should further reduce the probability of microsoft randomly uploading our data to their cloud (but mostly because its annoying to never know where your data is written).
Fixed buf_cvarlist, should work in xonotic now, and without segfaults.
Added an extra arg to URI_Get_Callback calls - the response size, also changed the tempstring to contain all bytes of the response, you need to be careful about nulls though.
Try to work around nvidia's forced-panning bug on x11 when changing video modes. This might screw with other programs.
sdl: support custom icons.
sdl: support choosing a specific display.
Added some documentation to menuqc builtins.
menusys: use outlines for slightly more readable fonts.
menusys: switch vid_width and vid_height combos into a single video mode combo to set both according to reported video modes.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5581 fc73d0e0-1445-4013-8a0c-d673dee63da5
2019-11-20 03:09:50 +00:00
newm - > gamepath [ i ] . flags = oldm - > gamepath [ i ] . flags ;
2013-06-23 02:17:02 +00:00
}
for ( i = 0 ; i < sizeof ( newm - > package ) / sizeof ( newm - > package [ 0 ] ) ; i + + )
{
2023-02-20 07:47:16 +00:00
newm - > package [ i ] . type = oldm - > package [ i ] . type ;
newm - > package [ i ] . crc = oldm - > package [ i ] . crc ;
newm - > package [ i ] . crcknown = oldm - > package [ i ] . crcknown ;
2024-04-25 05:57:34 +00:00
if ( oldm - > package [ i ] . packagename )
newm - > package [ i ] . packagename = Z_StrDup ( oldm - > package [ i ] . packagename ) ;
2013-06-23 02:17:02 +00:00
if ( oldm - > package [ i ] . path )
newm - > package [ i ] . path = Z_StrDup ( oldm - > package [ i ] . path ) ;
2016-07-12 00:40:13 +00:00
if ( oldm - > package [ i ] . prefix )
newm - > package [ i ] . prefix = Z_StrDup ( oldm - > package [ i ] . prefix ) ;
2015-09-07 14:34:39 +00:00
if ( oldm - > package [ i ] . condition )
newm - > package [ i ] . condition = Z_StrDup ( oldm - > package [ i ] . condition ) ;
2023-02-20 07:47:16 +00:00
if ( oldm - > package [ i ] . sha512 )
newm - > package [ i ] . sha512 = Z_StrDup ( oldm - > package [ i ] . sha512 ) ;
if ( oldm - > package [ i ] . signature )
newm - > package [ i ] . signature = Z_StrDup ( oldm - > package [ i ] . signature ) ;
newm - > package [ i ] . filesize = oldm - > package [ i ] . filesize ;
2013-06-23 02:17:02 +00:00
for ( j = 0 ; j < sizeof ( newm - > package [ i ] . mirrors ) / sizeof ( newm - > package [ i ] . mirrors [ 0 ] ) ; j + + )
if ( oldm - > package [ i ] . mirrors [ j ] )
newm - > package [ i ] . mirrors [ j ] = Z_StrDup ( oldm - > package [ i ] . mirrors [ j ] ) ;
}
2023-04-21 11:36:13 +00:00
newm - > security = oldm - > security ;
2013-06-23 02:17:02 +00:00
return newm ;
}
2018-10-11 10:31:23 +00:00
static void FS_Manifest_Print ( ftemanifest_t * man )
2013-06-23 02:17:02 +00:00
{
2020-05-14 15:50:26 +00:00
char buffer [ 65536 ] ;
2013-06-23 02:17:02 +00:00
int i , j ;
if ( man - > updateurl )
2015-01-02 05:20:56 +00:00
Con_Printf ( " updateurl %s \n " , COM_QuotedString ( man - > updateurl , buffer , sizeof ( buffer ) , false ) ) ;
2015-04-14 23:12:17 +00:00
if ( man - > eula )
Con_Printf ( " eula %s \n " , COM_QuotedString ( man - > eula , buffer , sizeof ( buffer ) , false ) ) ;
2013-06-23 02:17:02 +00:00
if ( man - > installation )
2015-01-02 05:20:56 +00:00
Con_Printf ( " game %s \n " , COM_QuotedString ( man - > installation , buffer , sizeof ( buffer ) , false ) ) ;
2013-06-23 02:17:02 +00:00
if ( man - > formalname )
2015-01-02 05:20:56 +00:00
Con_Printf ( " name %s \n " , COM_QuotedString ( man - > formalname , buffer , sizeof ( buffer ) , false ) ) ;
2019-11-20 04:53:22 +00:00
if ( man - > mainconfig )
Con_Printf ( " mainconfig %s \n " , COM_QuotedString ( man - > mainconfig , buffer , sizeof ( buffer ) , false ) ) ;
2020-04-19 01:23:32 +00:00
# ifdef PACKAGEMANAGER
2016-07-21 19:27:59 +00:00
if ( man - > downloadsurl )
Con_Printf ( " downloadsurl %s \n " , COM_QuotedString ( man - > downloadsurl , buffer , sizeof ( buffer ) , false ) ) ;
2016-08-25 00:12:14 +00:00
if ( man - > installupd )
Con_Printf ( " install %s \n " , COM_QuotedString ( man - > installupd , buffer , sizeof ( buffer ) , false ) ) ;
2020-04-19 01:23:32 +00:00
# endif
2021-08-19 06:01:42 +00:00
if ( man - > schemes )
Con_Printf ( " schemes %s \n " , COM_QuotedString ( man - > schemes , buffer , sizeof ( buffer ) , false ) ) ;
2013-06-23 02:17:02 +00:00
if ( man - > protocolname )
2015-01-02 05:20:56 +00:00
Con_Printf ( " protocolname %s \n " , COM_QuotedString ( man - > protocolname , buffer , sizeof ( buffer ) , false ) ) ;
2013-08-07 14:13:18 +00:00
if ( man - > defaultexec )
2020-05-14 15:50:26 +00:00
{
char * s = buffer , * e ;
for ( s = man - > defaultexec ; * s ; s = e )
{
e = strchr ( s , ' \n ' ) ;
if ( e )
{
* e = 0 ;
Con_Printf ( " -%s \n " , s ) ;
* e + + = ' \n ' ;
}
else
{
Con_Printf ( " -%s \n " , s ) ;
e = s + strlen ( s ) ;
}
}
//Con_Printf("defaultexec %s\n", COM_QuotedString(man->defaultexec, buffer, sizeof(buffer), false));
}
playdemo accepts https urls now. will start playing before the file has finished downloading, to avoid unnecessary delays.
reworked network addresses to separate address family and connection type. this should make banning people more reliable, as well as simplifying a whole load of logic (no need to check for ipv4 AND ipv6).
tcpconnect will keep trying to connect even if the connection wasn't instant, instead of giving up instantly.
rewrote tcp connections quite a bit. sv_port_tcp now handles qtv+qizmo+http+ws+rtcbroker+tls equivalents.
qtv_streamport is now a legacy cvar and now acts equivalently to sv_port_tcp (but still separate).
rewrote screenshot and video capture code to use strides. this solves image-is-upside down issues with vulkan.
ignore alt key in browser port. oh no! no more red text! oh no! no more alt-being-wrongly-down-and-being-unable-to-type-anything-without-forcing-alt-released!
reworked audio decoder interface. now has clearly defined success/unavailable/end-of-file results. this should solve a whole load of issues with audio streaming.
fixed various openal audio streaming issues too. openal also got some workarounds for emscripten's poor emulation.
fixed ogg decoder to retain sync properly if seeked.
updated menu_media a bit. now reads vorbis comments/id3v1 tags to get proper track names. also saves the playlist so you don't have to manually repopulate the list so it might actually be usable now (after how many years?)
r_stains now defaults to 0, and is no longer enabled by presets. use decals if you want that sort of thing.
added fs_noreexec cvar, so configs will not be reexeced on gamedir change. this also means defaults won't be reapplied, etc.
added 'nvvk' renderer on windows, using nvidia's vulkan-inside-opengl gl extension. mostly just to see how much slower it is.
fixed up the ftp server quite a lot. more complete, more compliant, and should do ipv6 properly to-boot. file transfers also threaded.
fixed potential crash inside runclientphys.
experimental sv_antilag=3 setting. totally untested. the aim is to avoid missing due to lagged knockbacks. may be expensive for the server.
browser port's websockets support fixed. experimental support for webrtc ('works for me', requires a broker server).
updated avplug(renamed to ffmpeg so people know what it is) to use ffmpeg 3.2.4 properly, with its new encoder api. should be much more robust... also added experimental audio decoder for game music etc (currently doesn't resample, so playback rates are screwed, disabled by cvar).
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5097 fc73d0e0-1445-4013-8a0c-d673dee63da5
2017-05-10 02:08:58 +00:00
if ( man - > defaultoverrides )
2020-05-14 15:50:26 +00:00
{
char * s = buffer , * e ;
for ( s = man - > defaultoverrides ; * s ; s = e )
{
e = strchr ( s , ' \n ' ) ;
if ( e )
{
* e = 0 ;
Con_Printf ( " +%s \n " , s ) ;
* e + + = ' \n ' ;
}
else
{
Con_Printf ( " +%s \n " , s ) ;
e = s + strlen ( s ) ;
}
}
//Con_Printf("%s", man->defaultoverrides);
}
2020-04-19 01:23:32 +00:00
if ( man - > iconname )
Con_Printf ( " icon %s \n " , COM_QuotedString ( man - > iconname , buffer , sizeof ( buffer ) , false ) ) ;
2018-10-11 10:31:23 +00:00
if ( man - > basedir )
Con_Printf ( " basedir %s \n " , COM_QuotedString ( man - > basedir , buffer , sizeof ( buffer ) , false ) ) ;
2013-06-23 02:17:02 +00:00
for ( i = 0 ; i < sizeof ( man - > gamepath ) / sizeof ( man - > gamepath [ 0 ] ) ; i + + )
{
if ( man - > gamepath [ i ] . path )
{
2023-04-03 00:33:35 +00:00
char * str = va ( " %s%s%s " ,
( man - > gamepath [ i ] . flags & GAMEDIR_QSHACK ) ? " / " : " " ,
( man - > gamepath [ i ] . flags & GAMEDIR_PRIVATE ) ? " * " : " " ,
man - > gamepath [ i ] . path ) ;
Too many changes, sorry.
Change revision displays, use the SVN commit date instead of using __DATE__ (when there's no local changes). This should allow reproducible builds.
Added s_al_disable cvar, to block openal and all the various problems people have had with it, without having to name an explicit fallback (which would vary by system).
Add mastervolume cvar (for ss).
Add r_shadows 2 (aka fake shadows - for ss).
Add scr_loadingscreen_aspect -1 setting, to disable levelshots entirely, also disables the progress bar (for ss).
Better support for some effectinfo hacks (for ss).
Added dpcompat_nocsqcwarnings (because of lazy+buggy mods like ss).
Rework the dpcsqc versions of project+unproject builtins for better compat (for ss).
Added dpcompat_csqcinputeventtypes to block unexpected csqc input events (for ss).
Better compat with DP's loadfont console command (for ss).
Added dpcompat_smallerfonts cvar to replicate a DP bug (for ss).
Detect dp's m_draw extension, to work around it (for ss).
Cvar dpcompat_ignoremodificationtimes added. A value of 0 favour the most recently modified file, 1 will use DP-like alphabetically sorted preferences (for ss).
loadfont builtin can now accept outline=1 in the sizes arg for slightly more readable fonts.
Fix bbox calcs for rotated entities, fix needed for r_ignorenetpvs 0.
Hackily parse emoji.json to provide :poop: etc suggestions.
Skip prediction entirely when there's no local entity info. This fixes stair-smoothing in xonotic.
screenshot_cubemap will now capture half-float images when saving to ktx or dds files.
Fix support for xcf files larger than 4gb, mostly to avoid compiler warnings.
Fixed size of gfx/loading.lmp when replacement textures are used.
Added mipmap support for rg8 and l8a8 textures.
r_hdr_framebuffer cvar updated to support format names instead of random negative numbers. Description updated to name some interesting ones.
Perform autoupdate _checks_ ONLY with explicit user confirmation (actual updating already needed user confirmation, but this extra step should reduce the chances of us getting wrongly accused of exfiltrating user data if we're run in a sandbox - we ONLY ever included the updating engine's version in the checks, though there's nothing we can do to avoid sending the user's router's IP).
Removed the 'summon satan all over your harddrive' quit message, in case paranoid security researchers are idiots and don't bother doing actual research.
Removed the triptohell.info and fte.triptohell.info certificates, they really need to stop being self-signed. The updates domain is still self-signed for autoupdates.
Video drivers are now able to report supported video resolutions, visible to menuqc. Currently only works with SDL2 builds.
Added setmousepos builtin. Should work with glx+win32 build.
VF_SKYROOM_CAMERA can now accept an extra two args, setviewprop(VF_SKYROOM_CAMERA, org, axis, degrees).
Removed v_skyroom_origin+v_skyroom_orientation cvars in favour just v_skyroom, which should make it behave more like the 'fog' command (used when csqc isn't overriding).
Added R_EndPolygonRibbon builtin to make it faster+easier to generate textured ribbon/cable/etc wide lines (for TW).
sdl: Fix up sys_sdl.c's file enumeration to support wildcards in directories.
edit command now displays end1.bin/end2.bin correctly, because we can.
Finally add support for f_modified - though ruleset_allow_larger_models and ruleset_allow_overlong_sounds generally make it redundant.
Fix threading race condition in sha1 lookups.
Updated f_ruleset to include the same extra flags reported by ezquake.
A mod's default.fmf file can now contain an eg 'mainconfig config.cfg' line (to explicitly set the main config saved with cfg_save_auto 1 etc).
fmf: basegame steam:GameName/GameDir can be used to try to load a mod directory from an installed steam game. The resulting gamedir will be read-only.
HOMEDIR CHANGE: use homedirs only if the basedir cannot be written or a homedir already exists, which should further reduce the probability of microsoft randomly uploading our data to their cloud (but mostly because its annoying to never know where your data is written).
Fixed buf_cvarlist, should work in xonotic now, and without segfaults.
Added an extra arg to URI_Get_Callback calls - the response size, also changed the tempstring to contain all bytes of the response, you need to be careful about nulls though.
Try to work around nvidia's forced-panning bug on x11 when changing video modes. This might screw with other programs.
sdl: support custom icons.
sdl: support choosing a specific display.
Added some documentation to menuqc builtins.
menusys: use outlines for slightly more readable fonts.
menusys: switch vid_width and vid_height combos into a single video mode combo to set both according to reported video modes.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5581 fc73d0e0-1445-4013-8a0c-d673dee63da5
2019-11-20 03:09:50 +00:00
if ( man - > gamepath [ i ] . flags & GAMEDIR_BASEGAME )
Con_Printf ( " basegame %s \n " , COM_QuotedString ( str , buffer , sizeof ( buffer ) , false ) ) ;
2013-06-23 02:17:02 +00:00
else
Too many changes, sorry.
Change revision displays, use the SVN commit date instead of using __DATE__ (when there's no local changes). This should allow reproducible builds.
Added s_al_disable cvar, to block openal and all the various problems people have had with it, without having to name an explicit fallback (which would vary by system).
Add mastervolume cvar (for ss).
Add r_shadows 2 (aka fake shadows - for ss).
Add scr_loadingscreen_aspect -1 setting, to disable levelshots entirely, also disables the progress bar (for ss).
Better support for some effectinfo hacks (for ss).
Added dpcompat_nocsqcwarnings (because of lazy+buggy mods like ss).
Rework the dpcsqc versions of project+unproject builtins for better compat (for ss).
Added dpcompat_csqcinputeventtypes to block unexpected csqc input events (for ss).
Better compat with DP's loadfont console command (for ss).
Added dpcompat_smallerfonts cvar to replicate a DP bug (for ss).
Detect dp's m_draw extension, to work around it (for ss).
Cvar dpcompat_ignoremodificationtimes added. A value of 0 favour the most recently modified file, 1 will use DP-like alphabetically sorted preferences (for ss).
loadfont builtin can now accept outline=1 in the sizes arg for slightly more readable fonts.
Fix bbox calcs for rotated entities, fix needed for r_ignorenetpvs 0.
Hackily parse emoji.json to provide :poop: etc suggestions.
Skip prediction entirely when there's no local entity info. This fixes stair-smoothing in xonotic.
screenshot_cubemap will now capture half-float images when saving to ktx or dds files.
Fix support for xcf files larger than 4gb, mostly to avoid compiler warnings.
Fixed size of gfx/loading.lmp when replacement textures are used.
Added mipmap support for rg8 and l8a8 textures.
r_hdr_framebuffer cvar updated to support format names instead of random negative numbers. Description updated to name some interesting ones.
Perform autoupdate _checks_ ONLY with explicit user confirmation (actual updating already needed user confirmation, but this extra step should reduce the chances of us getting wrongly accused of exfiltrating user data if we're run in a sandbox - we ONLY ever included the updating engine's version in the checks, though there's nothing we can do to avoid sending the user's router's IP).
Removed the 'summon satan all over your harddrive' quit message, in case paranoid security researchers are idiots and don't bother doing actual research.
Removed the triptohell.info and fte.triptohell.info certificates, they really need to stop being self-signed. The updates domain is still self-signed for autoupdates.
Video drivers are now able to report supported video resolutions, visible to menuqc. Currently only works with SDL2 builds.
Added setmousepos builtin. Should work with glx+win32 build.
VF_SKYROOM_CAMERA can now accept an extra two args, setviewprop(VF_SKYROOM_CAMERA, org, axis, degrees).
Removed v_skyroom_origin+v_skyroom_orientation cvars in favour just v_skyroom, which should make it behave more like the 'fog' command (used when csqc isn't overriding).
Added R_EndPolygonRibbon builtin to make it faster+easier to generate textured ribbon/cable/etc wide lines (for TW).
sdl: Fix up sys_sdl.c's file enumeration to support wildcards in directories.
edit command now displays end1.bin/end2.bin correctly, because we can.
Finally add support for f_modified - though ruleset_allow_larger_models and ruleset_allow_overlong_sounds generally make it redundant.
Fix threading race condition in sha1 lookups.
Updated f_ruleset to include the same extra flags reported by ezquake.
A mod's default.fmf file can now contain an eg 'mainconfig config.cfg' line (to explicitly set the main config saved with cfg_save_auto 1 etc).
fmf: basegame steam:GameName/GameDir can be used to try to load a mod directory from an installed steam game. The resulting gamedir will be read-only.
HOMEDIR CHANGE: use homedirs only if the basedir cannot be written or a homedir already exists, which should further reduce the probability of microsoft randomly uploading our data to their cloud (but mostly because its annoying to never know where your data is written).
Fixed buf_cvarlist, should work in xonotic now, and without segfaults.
Added an extra arg to URI_Get_Callback calls - the response size, also changed the tempstring to contain all bytes of the response, you need to be careful about nulls though.
Try to work around nvidia's forced-panning bug on x11 when changing video modes. This might screw with other programs.
sdl: support custom icons.
sdl: support choosing a specific display.
Added some documentation to menuqc builtins.
menusys: use outlines for slightly more readable fonts.
menusys: switch vid_width and vid_height combos into a single video mode combo to set both according to reported video modes.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5581 fc73d0e0-1445-4013-8a0c-d673dee63da5
2019-11-20 03:09:50 +00:00
Con_Printf ( " gamedir %s \n " , COM_QuotedString ( str , buffer , sizeof ( buffer ) , false ) ) ;
2013-06-23 02:17:02 +00:00
}
}
for ( i = 0 ; i < sizeof ( man - > package ) / sizeof ( man - > package [ 0 ] ) ; i + + )
{
if ( man - > package [ i ] . path )
{
2015-09-07 14:34:39 +00:00
if ( man - > package [ i ] . type = = mdt_installation )
Con_Printf ( " library " ) ;
2013-08-06 02:19:06 +00:00
else
2015-09-07 14:34:39 +00:00
Con_Printf ( " package " ) ;
Con_Printf ( " %s " , COM_QuotedString ( man - > package [ i ] . path , buffer , sizeof ( buffer ) , false ) ) ;
2024-04-25 05:57:34 +00:00
if ( man - > package [ i ] . prefix )
Con_Printf ( " name %s " , COM_QuotedString ( man - > package [ i ] . packagename , buffer , sizeof ( buffer ) , false ) ) ;
2023-02-20 07:47:16 +00:00
if ( man - > package [ i ] . prefix )
Con_Printf ( " prefix %s " , COM_QuotedString ( man - > package [ i ] . prefix , buffer , sizeof ( buffer ) , false ) ) ;
2016-07-12 00:40:13 +00:00
if ( man - > package [ i ] . condition )
Con_Printf ( " condition %s " , COM_QuotedString ( man - > package [ i ] . condition , buffer , sizeof ( buffer ) , false ) ) ;
2023-02-20 07:47:16 +00:00
if ( man - > package [ i ] . filesize )
Con_Printf ( " filesize % " PRIuQOFS , man - > package [ i ] . filesize ) ;
if ( man - > package [ i ] . sha512 )
Con_Printf ( " sha512 %s " , COM_QuotedString ( man - > package [ i ] . sha512 , buffer , sizeof ( buffer ) , false ) ) ;
if ( man - > package [ i ] . signature )
Con_Printf ( " signature %s " , COM_QuotedString ( man - > package [ i ] . signature , buffer , sizeof ( buffer ) , false ) ) ;
2015-09-07 14:34:39 +00:00
if ( man - > package [ i ] . crcknown )
2016-07-12 00:40:13 +00:00
Con_Printf ( " crc 0x%x " , man - > package [ i ] . crc ) ;
2013-06-23 02:17:02 +00:00
for ( j = 0 ; j < sizeof ( man - > package [ i ] . mirrors ) / sizeof ( man - > package [ i ] . mirrors [ 0 ] ) ; j + + )
if ( man - > package [ i ] . mirrors [ j ] )
2015-01-02 05:20:56 +00:00
Con_Printf ( " %s " , COM_QuotedString ( man - > package [ i ] . mirrors [ j ] , buffer , sizeof ( buffer ) , false ) ) ;
2013-06-23 03:59:48 +00:00
Con_Printf ( " \n " ) ;
2013-06-23 02:17:02 +00:00
}
}
}
//forget any mod dirs.
static void FS_Manifest_PurgeGamedirs ( ftemanifest_t * man )
{
int i ;
2020-04-19 01:23:32 +00:00
if ( man - > filename )
Z_Free ( man - > filename ) ;
man - > filename = NULL ;
2013-06-23 02:17:02 +00:00
for ( i = 0 ; i < sizeof ( man - > gamepath ) / sizeof ( man - > gamepath [ 0 ] ) ; i + + )
{
Too many changes, sorry.
Change revision displays, use the SVN commit date instead of using __DATE__ (when there's no local changes). This should allow reproducible builds.
Added s_al_disable cvar, to block openal and all the various problems people have had with it, without having to name an explicit fallback (which would vary by system).
Add mastervolume cvar (for ss).
Add r_shadows 2 (aka fake shadows - for ss).
Add scr_loadingscreen_aspect -1 setting, to disable levelshots entirely, also disables the progress bar (for ss).
Better support for some effectinfo hacks (for ss).
Added dpcompat_nocsqcwarnings (because of lazy+buggy mods like ss).
Rework the dpcsqc versions of project+unproject builtins for better compat (for ss).
Added dpcompat_csqcinputeventtypes to block unexpected csqc input events (for ss).
Better compat with DP's loadfont console command (for ss).
Added dpcompat_smallerfonts cvar to replicate a DP bug (for ss).
Detect dp's m_draw extension, to work around it (for ss).
Cvar dpcompat_ignoremodificationtimes added. A value of 0 favour the most recently modified file, 1 will use DP-like alphabetically sorted preferences (for ss).
loadfont builtin can now accept outline=1 in the sizes arg for slightly more readable fonts.
Fix bbox calcs for rotated entities, fix needed for r_ignorenetpvs 0.
Hackily parse emoji.json to provide :poop: etc suggestions.
Skip prediction entirely when there's no local entity info. This fixes stair-smoothing in xonotic.
screenshot_cubemap will now capture half-float images when saving to ktx or dds files.
Fix support for xcf files larger than 4gb, mostly to avoid compiler warnings.
Fixed size of gfx/loading.lmp when replacement textures are used.
Added mipmap support for rg8 and l8a8 textures.
r_hdr_framebuffer cvar updated to support format names instead of random negative numbers. Description updated to name some interesting ones.
Perform autoupdate _checks_ ONLY with explicit user confirmation (actual updating already needed user confirmation, but this extra step should reduce the chances of us getting wrongly accused of exfiltrating user data if we're run in a sandbox - we ONLY ever included the updating engine's version in the checks, though there's nothing we can do to avoid sending the user's router's IP).
Removed the 'summon satan all over your harddrive' quit message, in case paranoid security researchers are idiots and don't bother doing actual research.
Removed the triptohell.info and fte.triptohell.info certificates, they really need to stop being self-signed. The updates domain is still self-signed for autoupdates.
Video drivers are now able to report supported video resolutions, visible to menuqc. Currently only works with SDL2 builds.
Added setmousepos builtin. Should work with glx+win32 build.
VF_SKYROOM_CAMERA can now accept an extra two args, setviewprop(VF_SKYROOM_CAMERA, org, axis, degrees).
Removed v_skyroom_origin+v_skyroom_orientation cvars in favour just v_skyroom, which should make it behave more like the 'fog' command (used when csqc isn't overriding).
Added R_EndPolygonRibbon builtin to make it faster+easier to generate textured ribbon/cable/etc wide lines (for TW).
sdl: Fix up sys_sdl.c's file enumeration to support wildcards in directories.
edit command now displays end1.bin/end2.bin correctly, because we can.
Finally add support for f_modified - though ruleset_allow_larger_models and ruleset_allow_overlong_sounds generally make it redundant.
Fix threading race condition in sha1 lookups.
Updated f_ruleset to include the same extra flags reported by ezquake.
A mod's default.fmf file can now contain an eg 'mainconfig config.cfg' line (to explicitly set the main config saved with cfg_save_auto 1 etc).
fmf: basegame steam:GameName/GameDir can be used to try to load a mod directory from an installed steam game. The resulting gamedir will be read-only.
HOMEDIR CHANGE: use homedirs only if the basedir cannot be written or a homedir already exists, which should further reduce the probability of microsoft randomly uploading our data to their cloud (but mostly because its annoying to never know where your data is written).
Fixed buf_cvarlist, should work in xonotic now, and without segfaults.
Added an extra arg to URI_Get_Callback calls - the response size, also changed the tempstring to contain all bytes of the response, you need to be careful about nulls though.
Try to work around nvidia's forced-panning bug on x11 when changing video modes. This might screw with other programs.
sdl: support custom icons.
sdl: support choosing a specific display.
Added some documentation to menuqc builtins.
menusys: use outlines for slightly more readable fonts.
menusys: switch vid_width and vid_height combos into a single video mode combo to set both according to reported video modes.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5581 fc73d0e0-1445-4013-8a0c-d673dee63da5
2019-11-20 03:09:50 +00:00
if ( man - > gamepath [ i ] . path & & ! ( man - > gamepath [ i ] . flags & GAMEDIR_BASEGAME ) )
2013-06-23 02:17:02 +00:00
{
Z_Free ( man - > gamepath [ i ] . path ) ;
man - > gamepath [ i ] . path = NULL ;
2014-10-29 05:03:03 +00:00
//FIXME: remove packages from the removed paths.
2013-06-23 02:17:02 +00:00
}
}
}
//create a new empty manifest with default values.
2020-04-19 01:23:32 +00:00
static ftemanifest_t * FS_Manifest_Create ( const char * syspath , const char * basedir )
2013-06-23 02:17:02 +00:00
{
ftemanifest_t * man = Z_Malloc ( sizeof ( * man ) ) ;
2023-04-21 11:36:13 +00:00
if ( syspath )
{
char base [ MAX_QPATH ] ;
COM_FileBase ( syspath , base , sizeof ( base ) ) ;
2023-07-02 03:19:01 +00:00
if ( * base & & Q_strcasecmp ( base , " default " ) )
2023-04-21 11:36:13 +00:00
man - > formalname = Z_StrDup ( base ) ;
}
2014-03-30 08:55:06 +00:00
2015-09-07 14:34:39 +00:00
# ifdef _DEBUG //FOR TEMPORARY TESTING ONLY.
// man->doinstall = true;
# endif
2014-03-30 08:55:06 +00:00
if ( syspath )
2020-04-19 01:23:32 +00:00
man - > filename = Z_StrDup ( syspath ) ; //this should be a system path.
if ( basedir )
man - > basedir = Z_StrDup ( basedir ) ; //this should be a system path.
Too many changes, sorry.
Change revision displays, use the SVN commit date instead of using __DATE__ (when there's no local changes). This should allow reproducible builds.
Added s_al_disable cvar, to block openal and all the various problems people have had with it, without having to name an explicit fallback (which would vary by system).
Add mastervolume cvar (for ss).
Add r_shadows 2 (aka fake shadows - for ss).
Add scr_loadingscreen_aspect -1 setting, to disable levelshots entirely, also disables the progress bar (for ss).
Better support for some effectinfo hacks (for ss).
Added dpcompat_nocsqcwarnings (because of lazy+buggy mods like ss).
Rework the dpcsqc versions of project+unproject builtins for better compat (for ss).
Added dpcompat_csqcinputeventtypes to block unexpected csqc input events (for ss).
Better compat with DP's loadfont console command (for ss).
Added dpcompat_smallerfonts cvar to replicate a DP bug (for ss).
Detect dp's m_draw extension, to work around it (for ss).
Cvar dpcompat_ignoremodificationtimes added. A value of 0 favour the most recently modified file, 1 will use DP-like alphabetically sorted preferences (for ss).
loadfont builtin can now accept outline=1 in the sizes arg for slightly more readable fonts.
Fix bbox calcs for rotated entities, fix needed for r_ignorenetpvs 0.
Hackily parse emoji.json to provide :poop: etc suggestions.
Skip prediction entirely when there's no local entity info. This fixes stair-smoothing in xonotic.
screenshot_cubemap will now capture half-float images when saving to ktx or dds files.
Fix support for xcf files larger than 4gb, mostly to avoid compiler warnings.
Fixed size of gfx/loading.lmp when replacement textures are used.
Added mipmap support for rg8 and l8a8 textures.
r_hdr_framebuffer cvar updated to support format names instead of random negative numbers. Description updated to name some interesting ones.
Perform autoupdate _checks_ ONLY with explicit user confirmation (actual updating already needed user confirmation, but this extra step should reduce the chances of us getting wrongly accused of exfiltrating user data if we're run in a sandbox - we ONLY ever included the updating engine's version in the checks, though there's nothing we can do to avoid sending the user's router's IP).
Removed the 'summon satan all over your harddrive' quit message, in case paranoid security researchers are idiots and don't bother doing actual research.
Removed the triptohell.info and fte.triptohell.info certificates, they really need to stop being self-signed. The updates domain is still self-signed for autoupdates.
Video drivers are now able to report supported video resolutions, visible to menuqc. Currently only works with SDL2 builds.
Added setmousepos builtin. Should work with glx+win32 build.
VF_SKYROOM_CAMERA can now accept an extra two args, setviewprop(VF_SKYROOM_CAMERA, org, axis, degrees).
Removed v_skyroom_origin+v_skyroom_orientation cvars in favour just v_skyroom, which should make it behave more like the 'fog' command (used when csqc isn't overriding).
Added R_EndPolygonRibbon builtin to make it faster+easier to generate textured ribbon/cable/etc wide lines (for TW).
sdl: Fix up sys_sdl.c's file enumeration to support wildcards in directories.
edit command now displays end1.bin/end2.bin correctly, because we can.
Finally add support for f_modified - though ruleset_allow_larger_models and ruleset_allow_overlong_sounds generally make it redundant.
Fix threading race condition in sha1 lookups.
Updated f_ruleset to include the same extra flags reported by ezquake.
A mod's default.fmf file can now contain an eg 'mainconfig config.cfg' line (to explicitly set the main config saved with cfg_save_auto 1 etc).
fmf: basegame steam:GameName/GameDir can be used to try to load a mod directory from an installed steam game. The resulting gamedir will be read-only.
HOMEDIR CHANGE: use homedirs only if the basedir cannot be written or a homedir already exists, which should further reduce the probability of microsoft randomly uploading our data to their cloud (but mostly because its annoying to never know where your data is written).
Fixed buf_cvarlist, should work in xonotic now, and without segfaults.
Added an extra arg to URI_Get_Callback calls - the response size, also changed the tempstring to contain all bytes of the response, you need to be careful about nulls though.
Try to work around nvidia's forced-panning bug on x11 when changing video modes. This might screw with other programs.
sdl: support custom icons.
sdl: support choosing a specific display.
Added some documentation to menuqc builtins.
menusys: use outlines for slightly more readable fonts.
menusys: switch vid_width and vid_height combos into a single video mode combo to set both according to reported video modes.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5581 fc73d0e0-1445-4013-8a0c-d673dee63da5
2019-11-20 03:09:50 +00:00
# ifdef QUAKETC
man - > mainconfig = Z_StrDup ( " config.cfg " ) ;
# else
man - > mainconfig = Z_StrDup ( " fte.cfg " ) ;
# endif
2013-06-23 02:17:02 +00:00
return man ;
}
2015-04-14 23:12:17 +00:00
2018-10-11 10:31:23 +00:00
static qboolean FS_Manifest_ParsePackage ( ftemanifest_t * man , int packagetype )
2015-04-14 23:12:17 +00:00
{
2023-04-21 11:36:13 +00:00
//CMD [deparch] packagename qhash [archivedfilename] [prefix skip/this/] [mirror url] [[filesize foo] [sha512 hash] [signature "base64"]]
2015-09-07 14:34:39 +00:00
char * path = " " ;
unsigned int crc = 0 ;
qboolean crcknown = false ;
2024-04-25 05:57:34 +00:00
char * packagename = NULL ;
2015-09-07 14:34:39 +00:00
char * legacyextractname = NULL ;
char * condition = NULL ;
2016-07-12 00:40:13 +00:00
char * prefix = NULL ;
2015-09-07 14:34:39 +00:00
char * arch = NULL ;
2023-02-20 07:47:16 +00:00
char * signature = NULL ;
char * sha512 = NULL ;
qofs_t filesize = 0 ;
2015-09-07 14:34:39 +00:00
unsigned int arg = 1 ;
unsigned int mirrors = 0 ;
char * mirror [ countof ( man - > package [ 0 ] . mirrors ) ] ;
2015-04-14 23:12:17 +00:00
size_t i , j ;
2015-09-07 14:34:39 +00:00
char * a ;
a = Cmd_Argv ( 0 ) ;
2024-04-25 05:57:34 +00:00
if ( ! Q_strcasecmp ( a , " managedpackage " ) )
;
else
{
if ( ! Q_strcasecmp ( a , " filedependancies " ) | | ! Q_strcasecmp ( a , " archiveddependancies " ) )
arch = Cmd_Argv ( arg + + ) ;
2015-09-07 14:34:39 +00:00
2024-04-25 05:57:34 +00:00
path = Cmd_Argv ( arg + + ) ;
2015-09-07 14:34:39 +00:00
2019-04-16 22:40:05 +00:00
# ifdef HAVE_LEGACY
2024-04-25 05:57:34 +00:00
a = Cmd_Argv ( arg ) ;
if ( ! strcmp ( a , " - " ) )
2015-04-14 23:12:17 +00:00
{
2015-09-07 14:34:39 +00:00
arg + + ;
2015-04-14 23:12:17 +00:00
}
2024-04-25 05:57:34 +00:00
else if ( * a )
{
crc = strtoul ( a , & a , 0 ) ;
if ( ! * a )
{
crcknown = true ;
arg + + ;
}
}
2015-04-14 23:12:17 +00:00
2024-04-25 05:57:34 +00:00
if ( ! strncmp ( Cmd_Argv ( 0 ) , " archived " , 8 ) )
legacyextractname = Cmd_Argv ( arg + + ) ;
2015-09-07 14:34:39 +00:00
# endif
2024-04-25 05:57:34 +00:00
}
2015-09-07 14:34:39 +00:00
while ( arg < Cmd_Argc ( ) )
{
a = Cmd_Argv ( arg + + ) ;
if ( ! strcmp ( a , " crc " ) )
{
crcknown = true ;
crc = strtoul ( Cmd_Argv ( arg + + ) , NULL , 0 ) ;
}
else if ( ! strcmp ( a , " condition " ) )
condition = Cmd_Argv ( arg + + ) ;
2016-07-12 00:40:13 +00:00
else if ( ! strcmp ( a , " prefix " ) )
prefix = Cmd_Argv ( arg + + ) ;
2015-09-07 14:34:39 +00:00
else if ( ! strcmp ( a , " arch " ) )
arch = Cmd_Argv ( arg + + ) ;
2023-02-20 07:47:16 +00:00
else if ( ! strcmp ( a , " signature " ) )
signature = Cmd_Argv ( arg + + ) ;
else if ( ! strcmp ( a , " sha512 " ) )
sha512 = Cmd_Argv ( arg + + ) ;
2024-04-25 05:57:34 +00:00
else if ( ! strcmp ( a , " name " ) )
packagename = Cmd_Argv ( arg + + ) ;
2023-02-20 07:47:16 +00:00
else if ( ! strcmp ( a , " filesize " ) | | ! strcmp ( a , " size " ) )
filesize = strtoull ( Cmd_Argv ( arg + + ) , NULL , 0 ) ;
2015-09-07 14:34:39 +00:00
else if ( ! strcmp ( a , " mirror " ) )
{
a = Cmd_Argv ( arg + + ) ;
goto mirror ; //oo evil.
}
else if ( strchr ( a , ' : ' ) | | man - > parsever < 1 )
{
mirror :
if ( mirrors = = countof ( mirror ) )
Added sys_openfile console command(and menu option) to web and flatpak(via cmake+dbus) builds, to 'install' packages on sandboxed systems a bit more easily.
Cmake: Add FTE_WERROR option, defaults to true in debug builds and off in release builds (in case future compilers have issues).
Cmake: Pull in libXscreensaver so we don't get interrupted by screensavers when playing demos.
Make: Added `make webcl-rel` for a web build without server bloat (eg for sites focused on demo playback. Yes, this means you XantoM).
fteqcc: Include the decompiler in fteqcc (non-gui) builds ('-d' arg).
fteqcc: Decompiler can now mostly handle hexen2 mods without any unknown opcodes.
Allow ezHud and OpenSSL to be compiled as in-engine plugins, potentially for web and windows ports respectively.
Web: Fix support for ogg vorbis. Add support for voip.
Web: Added basic support for WebXR.
QTV: Don't try seeking on unseekable qtv streams. Don't spam when developer 1 is set.
QTV: add support for some eztv extensions.
MVD: added hack to use ktx's vweps in mvd where mvdsv doesn't bother to record the info.
qwfwd: hack around a hack in qwfwd, allowing it to work again.
recording: favour qwd in single player, instead of mvd.
Protocol: reduce client memory used for precache names. Bump maximum precache counts - some people are just abusive, yes you Orl.
hexen2: add enough clientside protocol compat to play the demo included with h2mp. lacks effects.
in_xflip: restored this setting.
fs_hidesyspaths: new cvar, defaults to enabled so you won't find your username or whatever turning up in screenshots or the like. change it to 0 before debuging stuff eg via 'path'.
gl_overbright_models: Added cvar to match QS.
netchan: Added MTU determination, we'll no longer fail to connect when routers stupidly drop icmp packets.
Win: try a few other versions of xinput too.
CSQC: Added a CSQC_GenerateMaterial function, to give the csqc a chance to generate custom materials.
MenuQC: Added support for the skeletal objects API.
2024-04-09 17:13:59 +00:00
Con_Printf ( CON_WARNING " too many mirrors for package %s \n " , path ) ;
2015-09-07 14:34:39 +00:00
else if ( legacyextractname )
{
if ( ! strcmp ( legacyextractname , " xz " ) | | ! strcmp ( legacyextractname , " gz " ) )
2021-07-17 15:11:15 +00:00
mirror [ mirrors + + ] = Z_StrDupf ( " %s:%s " , legacyextractname , a ) ;
2015-09-07 14:34:39 +00:00
else
2021-07-17 15:11:15 +00:00
mirror [ mirrors + + ] = Z_StrDupf ( " unzip:%s,%s " , legacyextractname , a ) ;
2015-09-07 14:34:39 +00:00
}
else
mirror [ mirrors + + ] = Z_StrDup ( a ) ;
}
else if ( man - > parsever < = MANIFEST_CURRENTVER )
Added sys_openfile console command(and menu option) to web and flatpak(via cmake+dbus) builds, to 'install' packages on sandboxed systems a bit more easily.
Cmake: Add FTE_WERROR option, defaults to true in debug builds and off in release builds (in case future compilers have issues).
Cmake: Pull in libXscreensaver so we don't get interrupted by screensavers when playing demos.
Make: Added `make webcl-rel` for a web build without server bloat (eg for sites focused on demo playback. Yes, this means you XantoM).
fteqcc: Include the decompiler in fteqcc (non-gui) builds ('-d' arg).
fteqcc: Decompiler can now mostly handle hexen2 mods without any unknown opcodes.
Allow ezHud and OpenSSL to be compiled as in-engine plugins, potentially for web and windows ports respectively.
Web: Fix support for ogg vorbis. Add support for voip.
Web: Added basic support for WebXR.
QTV: Don't try seeking on unseekable qtv streams. Don't spam when developer 1 is set.
QTV: add support for some eztv extensions.
MVD: added hack to use ktx's vweps in mvd where mvdsv doesn't bother to record the info.
qwfwd: hack around a hack in qwfwd, allowing it to work again.
recording: favour qwd in single player, instead of mvd.
Protocol: reduce client memory used for precache names. Bump maximum precache counts - some people are just abusive, yes you Orl.
hexen2: add enough clientside protocol compat to play the demo included with h2mp. lacks effects.
in_xflip: restored this setting.
fs_hidesyspaths: new cvar, defaults to enabled so you won't find your username or whatever turning up in screenshots or the like. change it to 0 before debuging stuff eg via 'path'.
gl_overbright_models: Added cvar to match QS.
netchan: Added MTU determination, we'll no longer fail to connect when routers stupidly drop icmp packets.
Win: try a few other versions of xinput too.
CSQC: Added a CSQC_GenerateMaterial function, to give the csqc a chance to generate custom materials.
MenuQC: Added support for the skeletal objects API.
2024-04-09 17:13:59 +00:00
Con_Printf ( CON_WARNING " unknown mirror / property %s for package %s \n " , a , path ) ;
2015-09-07 14:34:39 +00:00
}
for ( i = 0 ; i < countof ( man - > package ) ; i + + )
2015-04-14 23:12:17 +00:00
{
if ( ! man - > package [ i ] . path )
{
2018-10-11 10:31:23 +00:00
if ( packagetype = = mdt_singlepackage & & ( ! strchr ( path , ' / ' ) | | strchr ( path , ' : ' ) | | strchr ( path , ' \\ ' ) ) )
2015-09-07 14:34:39 +00:00
{
Added sys_openfile console command(and menu option) to web and flatpak(via cmake+dbus) builds, to 'install' packages on sandboxed systems a bit more easily.
Cmake: Add FTE_WERROR option, defaults to true in debug builds and off in release builds (in case future compilers have issues).
Cmake: Pull in libXscreensaver so we don't get interrupted by screensavers when playing demos.
Make: Added `make webcl-rel` for a web build without server bloat (eg for sites focused on demo playback. Yes, this means you XantoM).
fteqcc: Include the decompiler in fteqcc (non-gui) builds ('-d' arg).
fteqcc: Decompiler can now mostly handle hexen2 mods without any unknown opcodes.
Allow ezHud and OpenSSL to be compiled as in-engine plugins, potentially for web and windows ports respectively.
Web: Fix support for ogg vorbis. Add support for voip.
Web: Added basic support for WebXR.
QTV: Don't try seeking on unseekable qtv streams. Don't spam when developer 1 is set.
QTV: add support for some eztv extensions.
MVD: added hack to use ktx's vweps in mvd where mvdsv doesn't bother to record the info.
qwfwd: hack around a hack in qwfwd, allowing it to work again.
recording: favour qwd in single player, instead of mvd.
Protocol: reduce client memory used for precache names. Bump maximum precache counts - some people are just abusive, yes you Orl.
hexen2: add enough clientside protocol compat to play the demo included with h2mp. lacks effects.
in_xflip: restored this setting.
fs_hidesyspaths: new cvar, defaults to enabled so you won't find your username or whatever turning up in screenshots or the like. change it to 0 before debuging stuff eg via 'path'.
gl_overbright_models: Added cvar to match QS.
netchan: Added MTU determination, we'll no longer fail to connect when routers stupidly drop icmp packets.
Win: try a few other versions of xinput too.
CSQC: Added a CSQC_GenerateMaterial function, to give the csqc a chance to generate custom materials.
MenuQC: Added support for the skeletal objects API.
2024-04-09 17:13:59 +00:00
Con_Printf ( CON_WARNING " invalid package path specified in manifest (%s) \n " , path ) ;
2015-09-07 14:34:39 +00:00
break ;
}
if ( arch )
{
# ifdef PLATFORM
Added sys_openfile console command(and menu option) to web and flatpak(via cmake+dbus) builds, to 'install' packages on sandboxed systems a bit more easily.
Cmake: Add FTE_WERROR option, defaults to true in debug builds and off in release builds (in case future compilers have issues).
Cmake: Pull in libXscreensaver so we don't get interrupted by screensavers when playing demos.
Make: Added `make webcl-rel` for a web build without server bloat (eg for sites focused on demo playback. Yes, this means you XantoM).
fteqcc: Include the decompiler in fteqcc (non-gui) builds ('-d' arg).
fteqcc: Decompiler can now mostly handle hexen2 mods without any unknown opcodes.
Allow ezHud and OpenSSL to be compiled as in-engine plugins, potentially for web and windows ports respectively.
Web: Fix support for ogg vorbis. Add support for voip.
Web: Added basic support for WebXR.
QTV: Don't try seeking on unseekable qtv streams. Don't spam when developer 1 is set.
QTV: add support for some eztv extensions.
MVD: added hack to use ktx's vweps in mvd where mvdsv doesn't bother to record the info.
qwfwd: hack around a hack in qwfwd, allowing it to work again.
recording: favour qwd in single player, instead of mvd.
Protocol: reduce client memory used for precache names. Bump maximum precache counts - some people are just abusive, yes you Orl.
hexen2: add enough clientside protocol compat to play the demo included with h2mp. lacks effects.
in_xflip: restored this setting.
fs_hidesyspaths: new cvar, defaults to enabled so you won't find your username or whatever turning up in screenshots or the like. change it to 0 before debuging stuff eg via 'path'.
gl_overbright_models: Added cvar to match QS.
netchan: Added MTU determination, we'll no longer fail to connect when routers stupidly drop icmp packets.
Win: try a few other versions of xinput too.
CSQC: Added a CSQC_GenerateMaterial function, to give the csqc a chance to generate custom materials.
MenuQC: Added support for the skeletal objects API.
2024-04-09 17:13:59 +00:00
if ( Q_strcasecmp ( PLATFORM , arch )
& & Q_strcasecmp ( PLATFORM " _ " ARCH_CPU_POSTFIX , arch )
# ifdef ARCH_ALTCPU_POSTFIX
& & Q_strcasecmp ( PLATFORM " _ " ARCH_ALTCPU_POSTFIX , arch )
2015-09-07 14:34:39 +00:00
# endif
Added sys_openfile console command(and menu option) to web and flatpak(via cmake+dbus) builds, to 'install' packages on sandboxed systems a bit more easily.
Cmake: Add FTE_WERROR option, defaults to true in debug builds and off in release builds (in case future compilers have issues).
Cmake: Pull in libXscreensaver so we don't get interrupted by screensavers when playing demos.
Make: Added `make webcl-rel` for a web build without server bloat (eg for sites focused on demo playback. Yes, this means you XantoM).
fteqcc: Include the decompiler in fteqcc (non-gui) builds ('-d' arg).
fteqcc: Decompiler can now mostly handle hexen2 mods without any unknown opcodes.
Allow ezHud and OpenSSL to be compiled as in-engine plugins, potentially for web and windows ports respectively.
Web: Fix support for ogg vorbis. Add support for voip.
Web: Added basic support for WebXR.
QTV: Don't try seeking on unseekable qtv streams. Don't spam when developer 1 is set.
QTV: add support for some eztv extensions.
MVD: added hack to use ktx's vweps in mvd where mvdsv doesn't bother to record the info.
qwfwd: hack around a hack in qwfwd, allowing it to work again.
recording: favour qwd in single player, instead of mvd.
Protocol: reduce client memory used for precache names. Bump maximum precache counts - some people are just abusive, yes you Orl.
hexen2: add enough clientside protocol compat to play the demo included with h2mp. lacks effects.
in_xflip: restored this setting.
fs_hidesyspaths: new cvar, defaults to enabled so you won't find your username or whatever turning up in screenshots or the like. change it to 0 before debuging stuff eg via 'path'.
gl_overbright_models: Added cvar to match QS.
netchan: Added MTU determination, we'll no longer fail to connect when routers stupidly drop icmp packets.
Win: try a few other versions of xinput too.
CSQC: Added a CSQC_GenerateMaterial function, to give the csqc a chance to generate custom materials.
MenuQC: Added support for the skeletal objects API.
2024-04-09 17:13:59 +00:00
)
# endif
{
Con_Printf ( CON_WARNING " package archetecture does not match %s \n " , PLATFORM " _ " ARCH_CPU_POSTFIX ) ;
2015-09-07 14:34:39 +00:00
break ;
Added sys_openfile console command(and menu option) to web and flatpak(via cmake+dbus) builds, to 'install' packages on sandboxed systems a bit more easily.
Cmake: Add FTE_WERROR option, defaults to true in debug builds and off in release builds (in case future compilers have issues).
Cmake: Pull in libXscreensaver so we don't get interrupted by screensavers when playing demos.
Make: Added `make webcl-rel` for a web build without server bloat (eg for sites focused on demo playback. Yes, this means you XantoM).
fteqcc: Include the decompiler in fteqcc (non-gui) builds ('-d' arg).
fteqcc: Decompiler can now mostly handle hexen2 mods without any unknown opcodes.
Allow ezHud and OpenSSL to be compiled as in-engine plugins, potentially for web and windows ports respectively.
Web: Fix support for ogg vorbis. Add support for voip.
Web: Added basic support for WebXR.
QTV: Don't try seeking on unseekable qtv streams. Don't spam when developer 1 is set.
QTV: add support for some eztv extensions.
MVD: added hack to use ktx's vweps in mvd where mvdsv doesn't bother to record the info.
qwfwd: hack around a hack in qwfwd, allowing it to work again.
recording: favour qwd in single player, instead of mvd.
Protocol: reduce client memory used for precache names. Bump maximum precache counts - some people are just abusive, yes you Orl.
hexen2: add enough clientside protocol compat to play the demo included with h2mp. lacks effects.
in_xflip: restored this setting.
fs_hidesyspaths: new cvar, defaults to enabled so you won't find your username or whatever turning up in screenshots or the like. change it to 0 before debuging stuff eg via 'path'.
gl_overbright_models: Added cvar to match QS.
netchan: Added MTU determination, we'll no longer fail to connect when routers stupidly drop icmp packets.
Win: try a few other versions of xinput too.
CSQC: Added a CSQC_GenerateMaterial function, to give the csqc a chance to generate custom materials.
MenuQC: Added support for the skeletal objects API.
2024-04-09 17:13:59 +00:00
}
2015-09-07 14:34:39 +00:00
}
2024-04-25 05:57:34 +00:00
man - > package [ i ] . packagename = packagename ? Z_StrDup ( packagename ) : NULL ;
2018-10-11 10:31:23 +00:00
man - > package [ i ] . type = packagetype ;
2015-04-14 23:12:17 +00:00
man - > package [ i ] . path = Z_StrDup ( path ) ;
2016-07-12 00:40:13 +00:00
man - > package [ i ] . prefix = prefix ? Z_StrDup ( prefix ) : NULL ;
2015-09-07 14:34:39 +00:00
man - > package [ i ] . condition = condition ? Z_StrDup ( condition ) : NULL ;
2023-02-20 07:47:16 +00:00
man - > package [ i ] . sha512 = sha512 ? Z_StrDup ( sha512 ) : NULL ;
man - > package [ i ] . signature = signature ? Z_StrDup ( signature ) : NULL ;
man - > package [ i ] . filesize = filesize ;
2015-04-14 23:12:17 +00:00
man - > package [ i ] . crcknown = crcknown ;
man - > package [ i ] . crc = crc ;
2015-09-07 14:34:39 +00:00
for ( j = 0 ; j < mirrors ; j + + )
man - > package [ i ] . mirrors [ j ] = mirror [ j ] ;
2015-04-14 23:12:17 +00:00
return true ;
}
}
2015-09-07 14:34:39 +00:00
if ( i = = countof ( man - > package ) )
Added sys_openfile console command(and menu option) to web and flatpak(via cmake+dbus) builds, to 'install' packages on sandboxed systems a bit more easily.
Cmake: Add FTE_WERROR option, defaults to true in debug builds and off in release builds (in case future compilers have issues).
Cmake: Pull in libXscreensaver so we don't get interrupted by screensavers when playing demos.
Make: Added `make webcl-rel` for a web build without server bloat (eg for sites focused on demo playback. Yes, this means you XantoM).
fteqcc: Include the decompiler in fteqcc (non-gui) builds ('-d' arg).
fteqcc: Decompiler can now mostly handle hexen2 mods without any unknown opcodes.
Allow ezHud and OpenSSL to be compiled as in-engine plugins, potentially for web and windows ports respectively.
Web: Fix support for ogg vorbis. Add support for voip.
Web: Added basic support for WebXR.
QTV: Don't try seeking on unseekable qtv streams. Don't spam when developer 1 is set.
QTV: add support for some eztv extensions.
MVD: added hack to use ktx's vweps in mvd where mvdsv doesn't bother to record the info.
qwfwd: hack around a hack in qwfwd, allowing it to work again.
recording: favour qwd in single player, instead of mvd.
Protocol: reduce client memory used for precache names. Bump maximum precache counts - some people are just abusive, yes you Orl.
hexen2: add enough clientside protocol compat to play the demo included with h2mp. lacks effects.
in_xflip: restored this setting.
fs_hidesyspaths: new cvar, defaults to enabled so you won't find your username or whatever turning up in screenshots or the like. change it to 0 before debuging stuff eg via 'path'.
gl_overbright_models: Added cvar to match QS.
netchan: Added MTU determination, we'll no longer fail to connect when routers stupidly drop icmp packets.
Win: try a few other versions of xinput too.
CSQC: Added a CSQC_GenerateMaterial function, to give the csqc a chance to generate custom materials.
MenuQC: Added support for the skeletal objects API.
2024-04-09 17:13:59 +00:00
Con_Printf ( CON_WARNING " Too many packages specified in manifest \n " ) ;
2015-09-07 14:34:39 +00:00
for ( j = 0 ; j < mirrors ; j + + )
Z_Free ( mirror [ j ] ) ;
2015-04-14 23:12:17 +00:00
return false ;
}
2020-04-19 01:23:32 +00:00
qboolean FS_GamedirIsOkay ( const char * path )
Too many changes, sorry.
Change revision displays, use the SVN commit date instead of using __DATE__ (when there's no local changes). This should allow reproducible builds.
Added s_al_disable cvar, to block openal and all the various problems people have had with it, without having to name an explicit fallback (which would vary by system).
Add mastervolume cvar (for ss).
Add r_shadows 2 (aka fake shadows - for ss).
Add scr_loadingscreen_aspect -1 setting, to disable levelshots entirely, also disables the progress bar (for ss).
Better support for some effectinfo hacks (for ss).
Added dpcompat_nocsqcwarnings (because of lazy+buggy mods like ss).
Rework the dpcsqc versions of project+unproject builtins for better compat (for ss).
Added dpcompat_csqcinputeventtypes to block unexpected csqc input events (for ss).
Better compat with DP's loadfont console command (for ss).
Added dpcompat_smallerfonts cvar to replicate a DP bug (for ss).
Detect dp's m_draw extension, to work around it (for ss).
Cvar dpcompat_ignoremodificationtimes added. A value of 0 favour the most recently modified file, 1 will use DP-like alphabetically sorted preferences (for ss).
loadfont builtin can now accept outline=1 in the sizes arg for slightly more readable fonts.
Fix bbox calcs for rotated entities, fix needed for r_ignorenetpvs 0.
Hackily parse emoji.json to provide :poop: etc suggestions.
Skip prediction entirely when there's no local entity info. This fixes stair-smoothing in xonotic.
screenshot_cubemap will now capture half-float images when saving to ktx or dds files.
Fix support for xcf files larger than 4gb, mostly to avoid compiler warnings.
Fixed size of gfx/loading.lmp when replacement textures are used.
Added mipmap support for rg8 and l8a8 textures.
r_hdr_framebuffer cvar updated to support format names instead of random negative numbers. Description updated to name some interesting ones.
Perform autoupdate _checks_ ONLY with explicit user confirmation (actual updating already needed user confirmation, but this extra step should reduce the chances of us getting wrongly accused of exfiltrating user data if we're run in a sandbox - we ONLY ever included the updating engine's version in the checks, though there's nothing we can do to avoid sending the user's router's IP).
Removed the 'summon satan all over your harddrive' quit message, in case paranoid security researchers are idiots and don't bother doing actual research.
Removed the triptohell.info and fte.triptohell.info certificates, they really need to stop being self-signed. The updates domain is still self-signed for autoupdates.
Video drivers are now able to report supported video resolutions, visible to menuqc. Currently only works with SDL2 builds.
Added setmousepos builtin. Should work with glx+win32 build.
VF_SKYROOM_CAMERA can now accept an extra two args, setviewprop(VF_SKYROOM_CAMERA, org, axis, degrees).
Removed v_skyroom_origin+v_skyroom_orientation cvars in favour just v_skyroom, which should make it behave more like the 'fog' command (used when csqc isn't overriding).
Added R_EndPolygonRibbon builtin to make it faster+easier to generate textured ribbon/cable/etc wide lines (for TW).
sdl: Fix up sys_sdl.c's file enumeration to support wildcards in directories.
edit command now displays end1.bin/end2.bin correctly, because we can.
Finally add support for f_modified - though ruleset_allow_larger_models and ruleset_allow_overlong_sounds generally make it redundant.
Fix threading race condition in sha1 lookups.
Updated f_ruleset to include the same extra flags reported by ezquake.
A mod's default.fmf file can now contain an eg 'mainconfig config.cfg' line (to explicitly set the main config saved with cfg_save_auto 1 etc).
fmf: basegame steam:GameName/GameDir can be used to try to load a mod directory from an installed steam game. The resulting gamedir will be read-only.
HOMEDIR CHANGE: use homedirs only if the basedir cannot be written or a homedir already exists, which should further reduce the probability of microsoft randomly uploading our data to their cloud (but mostly because its annoying to never know where your data is written).
Fixed buf_cvarlist, should work in xonotic now, and without segfaults.
Added an extra arg to URI_Get_Callback calls - the response size, also changed the tempstring to contain all bytes of the response, you need to be careful about nulls though.
Try to work around nvidia's forced-panning bug on x11 when changing video modes. This might screw with other programs.
sdl: support custom icons.
sdl: support choosing a specific display.
Added some documentation to menuqc builtins.
menusys: use outlines for slightly more readable fonts.
menusys: switch vid_width and vid_height combos into a single video mode combo to set both according to reported video modes.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5581 fc73d0e0-1445-4013-8a0c-d673dee63da5
2019-11-20 03:09:50 +00:00
{
2021-05-27 11:33:55 +00:00
char tmp [ MAX_QPATH ] ;
Too many changes, sorry.
Change revision displays, use the SVN commit date instead of using __DATE__ (when there's no local changes). This should allow reproducible builds.
Added s_al_disable cvar, to block openal and all the various problems people have had with it, without having to name an explicit fallback (which would vary by system).
Add mastervolume cvar (for ss).
Add r_shadows 2 (aka fake shadows - for ss).
Add scr_loadingscreen_aspect -1 setting, to disable levelshots entirely, also disables the progress bar (for ss).
Better support for some effectinfo hacks (for ss).
Added dpcompat_nocsqcwarnings (because of lazy+buggy mods like ss).
Rework the dpcsqc versions of project+unproject builtins for better compat (for ss).
Added dpcompat_csqcinputeventtypes to block unexpected csqc input events (for ss).
Better compat with DP's loadfont console command (for ss).
Added dpcompat_smallerfonts cvar to replicate a DP bug (for ss).
Detect dp's m_draw extension, to work around it (for ss).
Cvar dpcompat_ignoremodificationtimes added. A value of 0 favour the most recently modified file, 1 will use DP-like alphabetically sorted preferences (for ss).
loadfont builtin can now accept outline=1 in the sizes arg for slightly more readable fonts.
Fix bbox calcs for rotated entities, fix needed for r_ignorenetpvs 0.
Hackily parse emoji.json to provide :poop: etc suggestions.
Skip prediction entirely when there's no local entity info. This fixes stair-smoothing in xonotic.
screenshot_cubemap will now capture half-float images when saving to ktx or dds files.
Fix support for xcf files larger than 4gb, mostly to avoid compiler warnings.
Fixed size of gfx/loading.lmp when replacement textures are used.
Added mipmap support for rg8 and l8a8 textures.
r_hdr_framebuffer cvar updated to support format names instead of random negative numbers. Description updated to name some interesting ones.
Perform autoupdate _checks_ ONLY with explicit user confirmation (actual updating already needed user confirmation, but this extra step should reduce the chances of us getting wrongly accused of exfiltrating user data if we're run in a sandbox - we ONLY ever included the updating engine's version in the checks, though there's nothing we can do to avoid sending the user's router's IP).
Removed the 'summon satan all over your harddrive' quit message, in case paranoid security researchers are idiots and don't bother doing actual research.
Removed the triptohell.info and fte.triptohell.info certificates, they really need to stop being self-signed. The updates domain is still self-signed for autoupdates.
Video drivers are now able to report supported video resolutions, visible to menuqc. Currently only works with SDL2 builds.
Added setmousepos builtin. Should work with glx+win32 build.
VF_SKYROOM_CAMERA can now accept an extra two args, setviewprop(VF_SKYROOM_CAMERA, org, axis, degrees).
Removed v_skyroom_origin+v_skyroom_orientation cvars in favour just v_skyroom, which should make it behave more like the 'fog' command (used when csqc isn't overriding).
Added R_EndPolygonRibbon builtin to make it faster+easier to generate textured ribbon/cable/etc wide lines (for TW).
sdl: Fix up sys_sdl.c's file enumeration to support wildcards in directories.
edit command now displays end1.bin/end2.bin correctly, because we can.
Finally add support for f_modified - though ruleset_allow_larger_models and ruleset_allow_overlong_sounds generally make it redundant.
Fix threading race condition in sha1 lookups.
Updated f_ruleset to include the same extra flags reported by ezquake.
A mod's default.fmf file can now contain an eg 'mainconfig config.cfg' line (to explicitly set the main config saved with cfg_save_auto 1 etc).
fmf: basegame steam:GameName/GameDir can be used to try to load a mod directory from an installed steam game. The resulting gamedir will be read-only.
HOMEDIR CHANGE: use homedirs only if the basedir cannot be written or a homedir already exists, which should further reduce the probability of microsoft randomly uploading our data to their cloud (but mostly because its annoying to never know where your data is written).
Fixed buf_cvarlist, should work in xonotic now, and without segfaults.
Added an extra arg to URI_Get_Callback calls - the response size, also changed the tempstring to contain all bytes of the response, you need to be careful about nulls though.
Try to work around nvidia's forced-panning bug on x11 when changing video modes. This might screw with other programs.
sdl: support custom icons.
sdl: support choosing a specific display.
Added some documentation to menuqc builtins.
menusys: use outlines for slightly more readable fonts.
menusys: switch vid_width and vid_height combos into a single video mode combo to set both according to reported video modes.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5581 fc73d0e0-1445-4013-8a0c-d673dee63da5
2019-11-20 03:09:50 +00:00
if ( ! * path | | strchr ( path , ' \n ' ) | | strchr ( path , ' \r ' ) | | ! strcmp ( path , " . " ) | | ! strcmp ( path , " .. " ) | | strchr ( path , ' : ' ) | | strchr ( path , ' / ' ) | | strchr ( path , ' \\ ' ) | | strchr ( path , ' $ ' ) )
{
Added sys_openfile console command(and menu option) to web and flatpak(via cmake+dbus) builds, to 'install' packages on sandboxed systems a bit more easily.
Cmake: Add FTE_WERROR option, defaults to true in debug builds and off in release builds (in case future compilers have issues).
Cmake: Pull in libXscreensaver so we don't get interrupted by screensavers when playing demos.
Make: Added `make webcl-rel` for a web build without server bloat (eg for sites focused on demo playback. Yes, this means you XantoM).
fteqcc: Include the decompiler in fteqcc (non-gui) builds ('-d' arg).
fteqcc: Decompiler can now mostly handle hexen2 mods without any unknown opcodes.
Allow ezHud and OpenSSL to be compiled as in-engine plugins, potentially for web and windows ports respectively.
Web: Fix support for ogg vorbis. Add support for voip.
Web: Added basic support for WebXR.
QTV: Don't try seeking on unseekable qtv streams. Don't spam when developer 1 is set.
QTV: add support for some eztv extensions.
MVD: added hack to use ktx's vweps in mvd where mvdsv doesn't bother to record the info.
qwfwd: hack around a hack in qwfwd, allowing it to work again.
recording: favour qwd in single player, instead of mvd.
Protocol: reduce client memory used for precache names. Bump maximum precache counts - some people are just abusive, yes you Orl.
hexen2: add enough clientside protocol compat to play the demo included with h2mp. lacks effects.
in_xflip: restored this setting.
fs_hidesyspaths: new cvar, defaults to enabled so you won't find your username or whatever turning up in screenshots or the like. change it to 0 before debuging stuff eg via 'path'.
gl_overbright_models: Added cvar to match QS.
netchan: Added MTU determination, we'll no longer fail to connect when routers stupidly drop icmp packets.
Win: try a few other versions of xinput too.
CSQC: Added a CSQC_GenerateMaterial function, to give the csqc a chance to generate custom materials.
MenuQC: Added support for the skeletal objects API.
2024-04-09 17:13:59 +00:00
Con_Printf ( CON_WARNING " Illegal path specified: %s \n " , path ) ;
Too many changes, sorry.
Change revision displays, use the SVN commit date instead of using __DATE__ (when there's no local changes). This should allow reproducible builds.
Added s_al_disable cvar, to block openal and all the various problems people have had with it, without having to name an explicit fallback (which would vary by system).
Add mastervolume cvar (for ss).
Add r_shadows 2 (aka fake shadows - for ss).
Add scr_loadingscreen_aspect -1 setting, to disable levelshots entirely, also disables the progress bar (for ss).
Better support for some effectinfo hacks (for ss).
Added dpcompat_nocsqcwarnings (because of lazy+buggy mods like ss).
Rework the dpcsqc versions of project+unproject builtins for better compat (for ss).
Added dpcompat_csqcinputeventtypes to block unexpected csqc input events (for ss).
Better compat with DP's loadfont console command (for ss).
Added dpcompat_smallerfonts cvar to replicate a DP bug (for ss).
Detect dp's m_draw extension, to work around it (for ss).
Cvar dpcompat_ignoremodificationtimes added. A value of 0 favour the most recently modified file, 1 will use DP-like alphabetically sorted preferences (for ss).
loadfont builtin can now accept outline=1 in the sizes arg for slightly more readable fonts.
Fix bbox calcs for rotated entities, fix needed for r_ignorenetpvs 0.
Hackily parse emoji.json to provide :poop: etc suggestions.
Skip prediction entirely when there's no local entity info. This fixes stair-smoothing in xonotic.
screenshot_cubemap will now capture half-float images when saving to ktx or dds files.
Fix support for xcf files larger than 4gb, mostly to avoid compiler warnings.
Fixed size of gfx/loading.lmp when replacement textures are used.
Added mipmap support for rg8 and l8a8 textures.
r_hdr_framebuffer cvar updated to support format names instead of random negative numbers. Description updated to name some interesting ones.
Perform autoupdate _checks_ ONLY with explicit user confirmation (actual updating already needed user confirmation, but this extra step should reduce the chances of us getting wrongly accused of exfiltrating user data if we're run in a sandbox - we ONLY ever included the updating engine's version in the checks, though there's nothing we can do to avoid sending the user's router's IP).
Removed the 'summon satan all over your harddrive' quit message, in case paranoid security researchers are idiots and don't bother doing actual research.
Removed the triptohell.info and fte.triptohell.info certificates, they really need to stop being self-signed. The updates domain is still self-signed for autoupdates.
Video drivers are now able to report supported video resolutions, visible to menuqc. Currently only works with SDL2 builds.
Added setmousepos builtin. Should work with glx+win32 build.
VF_SKYROOM_CAMERA can now accept an extra two args, setviewprop(VF_SKYROOM_CAMERA, org, axis, degrees).
Removed v_skyroom_origin+v_skyroom_orientation cvars in favour just v_skyroom, which should make it behave more like the 'fog' command (used when csqc isn't overriding).
Added R_EndPolygonRibbon builtin to make it faster+easier to generate textured ribbon/cable/etc wide lines (for TW).
sdl: Fix up sys_sdl.c's file enumeration to support wildcards in directories.
edit command now displays end1.bin/end2.bin correctly, because we can.
Finally add support for f_modified - though ruleset_allow_larger_models and ruleset_allow_overlong_sounds generally make it redundant.
Fix threading race condition in sha1 lookups.
Updated f_ruleset to include the same extra flags reported by ezquake.
A mod's default.fmf file can now contain an eg 'mainconfig config.cfg' line (to explicitly set the main config saved with cfg_save_auto 1 etc).
fmf: basegame steam:GameName/GameDir can be used to try to load a mod directory from an installed steam game. The resulting gamedir will be read-only.
HOMEDIR CHANGE: use homedirs only if the basedir cannot be written or a homedir already exists, which should further reduce the probability of microsoft randomly uploading our data to their cloud (but mostly because its annoying to never know where your data is written).
Fixed buf_cvarlist, should work in xonotic now, and without segfaults.
Added an extra arg to URI_Get_Callback calls - the response size, also changed the tempstring to contain all bytes of the response, you need to be careful about nulls though.
Try to work around nvidia's forced-panning bug on x11 when changing video modes. This might screw with other programs.
sdl: support custom icons.
sdl: support choosing a specific display.
Added some documentation to menuqc builtins.
menusys: use outlines for slightly more readable fonts.
menusys: switch vid_width and vid_height combos into a single video mode combo to set both according to reported video modes.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5581 fc73d0e0-1445-4013-8a0c-d673dee63da5
2019-11-20 03:09:50 +00:00
return false ;
}
//don't allow leading dots, hidden files are evil.
//don't allow complex paths. those are evil too.
if ( ! * path | | * path = = ' . ' | | ! strcmp ( path , " . " ) | | strstr ( path , " .. " ) | | strstr ( path , " / " )
2020-01-13 07:03:28 +00:00
| | strstr ( path , " \\ " ) | | strstr ( path , " : " ) | | strstr ( path , " \" " ) )
Too many changes, sorry.
Change revision displays, use the SVN commit date instead of using __DATE__ (when there's no local changes). This should allow reproducible builds.
Added s_al_disable cvar, to block openal and all the various problems people have had with it, without having to name an explicit fallback (which would vary by system).
Add mastervolume cvar (for ss).
Add r_shadows 2 (aka fake shadows - for ss).
Add scr_loadingscreen_aspect -1 setting, to disable levelshots entirely, also disables the progress bar (for ss).
Better support for some effectinfo hacks (for ss).
Added dpcompat_nocsqcwarnings (because of lazy+buggy mods like ss).
Rework the dpcsqc versions of project+unproject builtins for better compat (for ss).
Added dpcompat_csqcinputeventtypes to block unexpected csqc input events (for ss).
Better compat with DP's loadfont console command (for ss).
Added dpcompat_smallerfonts cvar to replicate a DP bug (for ss).
Detect dp's m_draw extension, to work around it (for ss).
Cvar dpcompat_ignoremodificationtimes added. A value of 0 favour the most recently modified file, 1 will use DP-like alphabetically sorted preferences (for ss).
loadfont builtin can now accept outline=1 in the sizes arg for slightly more readable fonts.
Fix bbox calcs for rotated entities, fix needed for r_ignorenetpvs 0.
Hackily parse emoji.json to provide :poop: etc suggestions.
Skip prediction entirely when there's no local entity info. This fixes stair-smoothing in xonotic.
screenshot_cubemap will now capture half-float images when saving to ktx or dds files.
Fix support for xcf files larger than 4gb, mostly to avoid compiler warnings.
Fixed size of gfx/loading.lmp when replacement textures are used.
Added mipmap support for rg8 and l8a8 textures.
r_hdr_framebuffer cvar updated to support format names instead of random negative numbers. Description updated to name some interesting ones.
Perform autoupdate _checks_ ONLY with explicit user confirmation (actual updating already needed user confirmation, but this extra step should reduce the chances of us getting wrongly accused of exfiltrating user data if we're run in a sandbox - we ONLY ever included the updating engine's version in the checks, though there's nothing we can do to avoid sending the user's router's IP).
Removed the 'summon satan all over your harddrive' quit message, in case paranoid security researchers are idiots and don't bother doing actual research.
Removed the triptohell.info and fte.triptohell.info certificates, they really need to stop being self-signed. The updates domain is still self-signed for autoupdates.
Video drivers are now able to report supported video resolutions, visible to menuqc. Currently only works with SDL2 builds.
Added setmousepos builtin. Should work with glx+win32 build.
VF_SKYROOM_CAMERA can now accept an extra two args, setviewprop(VF_SKYROOM_CAMERA, org, axis, degrees).
Removed v_skyroom_origin+v_skyroom_orientation cvars in favour just v_skyroom, which should make it behave more like the 'fog' command (used when csqc isn't overriding).
Added R_EndPolygonRibbon builtin to make it faster+easier to generate textured ribbon/cable/etc wide lines (for TW).
sdl: Fix up sys_sdl.c's file enumeration to support wildcards in directories.
edit command now displays end1.bin/end2.bin correctly, because we can.
Finally add support for f_modified - though ruleset_allow_larger_models and ruleset_allow_overlong_sounds generally make it redundant.
Fix threading race condition in sha1 lookups.
Updated f_ruleset to include the same extra flags reported by ezquake.
A mod's default.fmf file can now contain an eg 'mainconfig config.cfg' line (to explicitly set the main config saved with cfg_save_auto 1 etc).
fmf: basegame steam:GameName/GameDir can be used to try to load a mod directory from an installed steam game. The resulting gamedir will be read-only.
HOMEDIR CHANGE: use homedirs only if the basedir cannot be written or a homedir already exists, which should further reduce the probability of microsoft randomly uploading our data to their cloud (but mostly because its annoying to never know where your data is written).
Fixed buf_cvarlist, should work in xonotic now, and without segfaults.
Added an extra arg to URI_Get_Callback calls - the response size, also changed the tempstring to contain all bytes of the response, you need to be careful about nulls though.
Try to work around nvidia's forced-panning bug on x11 when changing video modes. This might screw with other programs.
sdl: support custom icons.
sdl: support choosing a specific display.
Added some documentation to menuqc builtins.
menusys: use outlines for slightly more readable fonts.
menusys: switch vid_width and vid_height combos into a single video mode combo to set both according to reported video modes.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5581 fc73d0e0-1445-4013-8a0c-d673dee63da5
2019-11-20 03:09:50 +00:00
{
Con_Printf ( " Gamedir should be a single filename, not \" %s \" \n " , path ) ;
return false ;
}
//some gamedirs should never be used for actual games/mods. Reject them.
2021-05-27 11:33:55 +00:00
if ( ! Q_strncasecmp ( path , " downloads " , 9 ) | | //QI stuff uses this for arbitrary downloads. it doesn't make sense as a gamedir.
! Q_strncasecmp ( path , " docs " , 4 ) | | //don't pollute this
! Q_strncasecmp ( path , " help " , 4 ) | | //don't pollute this
! Q_strncasecmp ( path , " bin " , 3 ) | | //if scripts try executing stuff here then we want to make extra sure that we don't allow writing anything within it.
! Q_strncasecmp ( path , " lib " , 3 ) ) //same deal
{
Con_Printf ( " Gamedir should not be \" %s \" \n " , path ) ;
return false ;
}
//this checks for system-specific entries.
if ( ! FS_GetCleanPath ( path , true , tmp , sizeof ( tmp ) ) )
Too many changes, sorry.
Change revision displays, use the SVN commit date instead of using __DATE__ (when there's no local changes). This should allow reproducible builds.
Added s_al_disable cvar, to block openal and all the various problems people have had with it, without having to name an explicit fallback (which would vary by system).
Add mastervolume cvar (for ss).
Add r_shadows 2 (aka fake shadows - for ss).
Add scr_loadingscreen_aspect -1 setting, to disable levelshots entirely, also disables the progress bar (for ss).
Better support for some effectinfo hacks (for ss).
Added dpcompat_nocsqcwarnings (because of lazy+buggy mods like ss).
Rework the dpcsqc versions of project+unproject builtins for better compat (for ss).
Added dpcompat_csqcinputeventtypes to block unexpected csqc input events (for ss).
Better compat with DP's loadfont console command (for ss).
Added dpcompat_smallerfonts cvar to replicate a DP bug (for ss).
Detect dp's m_draw extension, to work around it (for ss).
Cvar dpcompat_ignoremodificationtimes added. A value of 0 favour the most recently modified file, 1 will use DP-like alphabetically sorted preferences (for ss).
loadfont builtin can now accept outline=1 in the sizes arg for slightly more readable fonts.
Fix bbox calcs for rotated entities, fix needed for r_ignorenetpvs 0.
Hackily parse emoji.json to provide :poop: etc suggestions.
Skip prediction entirely when there's no local entity info. This fixes stair-smoothing in xonotic.
screenshot_cubemap will now capture half-float images when saving to ktx or dds files.
Fix support for xcf files larger than 4gb, mostly to avoid compiler warnings.
Fixed size of gfx/loading.lmp when replacement textures are used.
Added mipmap support for rg8 and l8a8 textures.
r_hdr_framebuffer cvar updated to support format names instead of random negative numbers. Description updated to name some interesting ones.
Perform autoupdate _checks_ ONLY with explicit user confirmation (actual updating already needed user confirmation, but this extra step should reduce the chances of us getting wrongly accused of exfiltrating user data if we're run in a sandbox - we ONLY ever included the updating engine's version in the checks, though there's nothing we can do to avoid sending the user's router's IP).
Removed the 'summon satan all over your harddrive' quit message, in case paranoid security researchers are idiots and don't bother doing actual research.
Removed the triptohell.info and fte.triptohell.info certificates, they really need to stop being self-signed. The updates domain is still self-signed for autoupdates.
Video drivers are now able to report supported video resolutions, visible to menuqc. Currently only works with SDL2 builds.
Added setmousepos builtin. Should work with glx+win32 build.
VF_SKYROOM_CAMERA can now accept an extra two args, setviewprop(VF_SKYROOM_CAMERA, org, axis, degrees).
Removed v_skyroom_origin+v_skyroom_orientation cvars in favour just v_skyroom, which should make it behave more like the 'fog' command (used when csqc isn't overriding).
Added R_EndPolygonRibbon builtin to make it faster+easier to generate textured ribbon/cable/etc wide lines (for TW).
sdl: Fix up sys_sdl.c's file enumeration to support wildcards in directories.
edit command now displays end1.bin/end2.bin correctly, because we can.
Finally add support for f_modified - though ruleset_allow_larger_models and ruleset_allow_overlong_sounds generally make it redundant.
Fix threading race condition in sha1 lookups.
Updated f_ruleset to include the same extra flags reported by ezquake.
A mod's default.fmf file can now contain an eg 'mainconfig config.cfg' line (to explicitly set the main config saved with cfg_save_auto 1 etc).
fmf: basegame steam:GameName/GameDir can be used to try to load a mod directory from an installed steam game. The resulting gamedir will be read-only.
HOMEDIR CHANGE: use homedirs only if the basedir cannot be written or a homedir already exists, which should further reduce the probability of microsoft randomly uploading our data to their cloud (but mostly because its annoying to never know where your data is written).
Fixed buf_cvarlist, should work in xonotic now, and without segfaults.
Added an extra arg to URI_Get_Callback calls - the response size, also changed the tempstring to contain all bytes of the response, you need to be careful about nulls though.
Try to work around nvidia's forced-panning bug on x11 when changing video modes. This might screw with other programs.
sdl: support custom icons.
sdl: support choosing a specific display.
Added some documentation to menuqc builtins.
menusys: use outlines for slightly more readable fonts.
menusys: switch vid_width and vid_height combos into a single video mode combo to set both according to reported video modes.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5581 fc73d0e0-1445-4013-8a0c-d673dee63da5
2019-11-20 03:09:50 +00:00
{
Con_Printf ( " Gamedir should not be \" %s \" \n " , path ) ;
return false ;
}
return true ;
}
2013-06-23 02:17:02 +00:00
//parse Cmd_Argv tokens into the manifest.
2014-03-30 08:55:06 +00:00
static qboolean FS_Manifest_ParseTokens ( ftemanifest_t * man )
2013-06-23 02:17:02 +00:00
{
2014-03-30 08:55:06 +00:00
qboolean result = true ;
2015-04-14 23:12:17 +00:00
char * cmd = Cmd_Argv ( 0 ) ;
if ( ! * cmd )
2014-03-30 08:55:06 +00:00
return result ;
2013-06-23 02:17:02 +00:00
2015-04-14 23:12:17 +00:00
if ( * cmd = = ' * ' )
cmd + + ;
if ( ! Q_strcasecmp ( cmd , " ftemanifestver " ) | | ! Q_strcasecmp ( cmd , " ftemanifest " ) )
man - > parsever = atoi ( Cmd_Argv ( 1 ) ) ;
else if ( ! Q_strcasecmp ( cmd , " minver " ) )
2014-03-30 08:55:06 +00:00
{
//ignore minimum versions for other engines.
if ( ! strcmp ( Cmd_Argv ( 2 ) , DISTRIBUTION ) )
man - > minver = atoi ( Cmd_Argv ( 3 ) ) ;
}
2015-04-14 23:12:17 +00:00
else if ( ! Q_strcasecmp ( cmd , " maxver " ) )
2014-03-30 08:55:06 +00:00
{
//ignore minimum versions for other engines.
if ( ! strcmp ( Cmd_Argv ( 2 ) , DISTRIBUTION ) )
man - > maxver = atoi ( Cmd_Argv ( 3 ) ) ;
}
2015-04-14 23:12:17 +00:00
else if ( ! Q_strcasecmp ( cmd , " game " ) )
2013-06-23 02:17:02 +00:00
{
Z_Free ( man - > installation ) ;
man - > installation = Z_StrDup ( Cmd_Argv ( 1 ) ) ;
}
2015-04-14 23:12:17 +00:00
else if ( ! Q_strcasecmp ( cmd , " name " ) )
2013-06-23 02:17:02 +00:00
{
Z_Free ( man - > formalname ) ;
man - > formalname = Z_StrDup ( Cmd_Argv ( 1 ) ) ;
}
2015-04-14 23:12:17 +00:00
else if ( ! Q_strcasecmp ( cmd , " eula " ) )
{
Z_Free ( man - > eula ) ;
man - > eula = Z_StrDup ( Cmd_Argv ( 1 ) ) ;
}
2020-04-19 01:23:32 +00:00
# ifdef PACKAGEMANAGER
2016-07-21 19:27:59 +00:00
else if ( ! Q_strcasecmp ( cmd , " downloadsurl " ) )
{
2021-10-05 05:05:22 +00:00
if ( man - > downloadsurl )
Z_StrCat ( & man - > downloadsurl , " " ) ;
Z_StrCat ( & man - > downloadsurl , Cmd_Argv ( 1 ) ) ;
2016-07-21 19:27:59 +00:00
}
2016-08-25 00:12:14 +00:00
else if ( ! Q_strcasecmp ( cmd , " install " ) )
{
2017-11-15 12:38:20 +00:00
if ( man - > installupd )
2017-11-23 07:46:39 +00:00
Z_StrCat ( & man - > installupd , va ( " ;%s " , Cmd_Argv ( 1 ) ) ) ;
2017-11-15 12:38:20 +00:00
else
man - > installupd = Z_StrDup ( Cmd_Argv ( 1 ) ) ;
2016-08-25 00:12:14 +00:00
}
2020-04-19 01:23:32 +00:00
# endif
2021-08-19 06:01:42 +00:00
else if ( ! Q_strcasecmp ( cmd , " schemes " ) )
{
int i ;
Z_Free ( man - > schemes ) ;
man - > schemes = Z_StrDup ( Cmd_Argv ( 1 ) ) ;
for ( i = 2 ; i < Cmd_Argc ( ) ; i + + )
Z_StrCat ( & man - > schemes , va ( " %s " , Cmd_Argv ( i ) ) ) ;
}
2015-04-14 23:12:17 +00:00
else if ( ! Q_strcasecmp ( cmd , " protocolname " ) )
2013-06-23 02:17:02 +00:00
{
Z_Free ( man - > protocolname ) ;
man - > protocolname = Z_StrDup ( Cmd_Argv ( 1 ) ) ;
}
Too many changes, sorry.
Change revision displays, use the SVN commit date instead of using __DATE__ (when there's no local changes). This should allow reproducible builds.
Added s_al_disable cvar, to block openal and all the various problems people have had with it, without having to name an explicit fallback (which would vary by system).
Add mastervolume cvar (for ss).
Add r_shadows 2 (aka fake shadows - for ss).
Add scr_loadingscreen_aspect -1 setting, to disable levelshots entirely, also disables the progress bar (for ss).
Better support for some effectinfo hacks (for ss).
Added dpcompat_nocsqcwarnings (because of lazy+buggy mods like ss).
Rework the dpcsqc versions of project+unproject builtins for better compat (for ss).
Added dpcompat_csqcinputeventtypes to block unexpected csqc input events (for ss).
Better compat with DP's loadfont console command (for ss).
Added dpcompat_smallerfonts cvar to replicate a DP bug (for ss).
Detect dp's m_draw extension, to work around it (for ss).
Cvar dpcompat_ignoremodificationtimes added. A value of 0 favour the most recently modified file, 1 will use DP-like alphabetically sorted preferences (for ss).
loadfont builtin can now accept outline=1 in the sizes arg for slightly more readable fonts.
Fix bbox calcs for rotated entities, fix needed for r_ignorenetpvs 0.
Hackily parse emoji.json to provide :poop: etc suggestions.
Skip prediction entirely when there's no local entity info. This fixes stair-smoothing in xonotic.
screenshot_cubemap will now capture half-float images when saving to ktx or dds files.
Fix support for xcf files larger than 4gb, mostly to avoid compiler warnings.
Fixed size of gfx/loading.lmp when replacement textures are used.
Added mipmap support for rg8 and l8a8 textures.
r_hdr_framebuffer cvar updated to support format names instead of random negative numbers. Description updated to name some interesting ones.
Perform autoupdate _checks_ ONLY with explicit user confirmation (actual updating already needed user confirmation, but this extra step should reduce the chances of us getting wrongly accused of exfiltrating user data if we're run in a sandbox - we ONLY ever included the updating engine's version in the checks, though there's nothing we can do to avoid sending the user's router's IP).
Removed the 'summon satan all over your harddrive' quit message, in case paranoid security researchers are idiots and don't bother doing actual research.
Removed the triptohell.info and fte.triptohell.info certificates, they really need to stop being self-signed. The updates domain is still self-signed for autoupdates.
Video drivers are now able to report supported video resolutions, visible to menuqc. Currently only works with SDL2 builds.
Added setmousepos builtin. Should work with glx+win32 build.
VF_SKYROOM_CAMERA can now accept an extra two args, setviewprop(VF_SKYROOM_CAMERA, org, axis, degrees).
Removed v_skyroom_origin+v_skyroom_orientation cvars in favour just v_skyroom, which should make it behave more like the 'fog' command (used when csqc isn't overriding).
Added R_EndPolygonRibbon builtin to make it faster+easier to generate textured ribbon/cable/etc wide lines (for TW).
sdl: Fix up sys_sdl.c's file enumeration to support wildcards in directories.
edit command now displays end1.bin/end2.bin correctly, because we can.
Finally add support for f_modified - though ruleset_allow_larger_models and ruleset_allow_overlong_sounds generally make it redundant.
Fix threading race condition in sha1 lookups.
Updated f_ruleset to include the same extra flags reported by ezquake.
A mod's default.fmf file can now contain an eg 'mainconfig config.cfg' line (to explicitly set the main config saved with cfg_save_auto 1 etc).
fmf: basegame steam:GameName/GameDir can be used to try to load a mod directory from an installed steam game. The resulting gamedir will be read-only.
HOMEDIR CHANGE: use homedirs only if the basedir cannot be written or a homedir already exists, which should further reduce the probability of microsoft randomly uploading our data to their cloud (but mostly because its annoying to never know where your data is written).
Fixed buf_cvarlist, should work in xonotic now, and without segfaults.
Added an extra arg to URI_Get_Callback calls - the response size, also changed the tempstring to contain all bytes of the response, you need to be careful about nulls though.
Try to work around nvidia's forced-panning bug on x11 when changing video modes. This might screw with other programs.
sdl: support custom icons.
sdl: support choosing a specific display.
Added some documentation to menuqc builtins.
menusys: use outlines for slightly more readable fonts.
menusys: switch vid_width and vid_height combos into a single video mode combo to set both according to reported video modes.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5581 fc73d0e0-1445-4013-8a0c-d673dee63da5
2019-11-20 03:09:50 +00:00
else if ( ! Q_strcasecmp ( cmd , " mainconfig " ) )
{
Z_Free ( man - > mainconfig ) ;
2020-04-29 10:43:22 +00:00
if ( strcmp ( " .cfg " , COM_GetFileExtension ( Cmd_Argv ( 1 ) , NULL ) ) )
2021-07-17 15:11:15 +00:00
man - > mainconfig = Z_StrDupf ( " %s.cfg " , Cmd_Argv ( 1 ) ) ;
2020-04-29 10:43:22 +00:00
else
man - > mainconfig = Z_StrDup ( Cmd_Argv ( 1 ) ) ;
Too many changes, sorry.
Change revision displays, use the SVN commit date instead of using __DATE__ (when there's no local changes). This should allow reproducible builds.
Added s_al_disable cvar, to block openal and all the various problems people have had with it, without having to name an explicit fallback (which would vary by system).
Add mastervolume cvar (for ss).
Add r_shadows 2 (aka fake shadows - for ss).
Add scr_loadingscreen_aspect -1 setting, to disable levelshots entirely, also disables the progress bar (for ss).
Better support for some effectinfo hacks (for ss).
Added dpcompat_nocsqcwarnings (because of lazy+buggy mods like ss).
Rework the dpcsqc versions of project+unproject builtins for better compat (for ss).
Added dpcompat_csqcinputeventtypes to block unexpected csqc input events (for ss).
Better compat with DP's loadfont console command (for ss).
Added dpcompat_smallerfonts cvar to replicate a DP bug (for ss).
Detect dp's m_draw extension, to work around it (for ss).
Cvar dpcompat_ignoremodificationtimes added. A value of 0 favour the most recently modified file, 1 will use DP-like alphabetically sorted preferences (for ss).
loadfont builtin can now accept outline=1 in the sizes arg for slightly more readable fonts.
Fix bbox calcs for rotated entities, fix needed for r_ignorenetpvs 0.
Hackily parse emoji.json to provide :poop: etc suggestions.
Skip prediction entirely when there's no local entity info. This fixes stair-smoothing in xonotic.
screenshot_cubemap will now capture half-float images when saving to ktx or dds files.
Fix support for xcf files larger than 4gb, mostly to avoid compiler warnings.
Fixed size of gfx/loading.lmp when replacement textures are used.
Added mipmap support for rg8 and l8a8 textures.
r_hdr_framebuffer cvar updated to support format names instead of random negative numbers. Description updated to name some interesting ones.
Perform autoupdate _checks_ ONLY with explicit user confirmation (actual updating already needed user confirmation, but this extra step should reduce the chances of us getting wrongly accused of exfiltrating user data if we're run in a sandbox - we ONLY ever included the updating engine's version in the checks, though there's nothing we can do to avoid sending the user's router's IP).
Removed the 'summon satan all over your harddrive' quit message, in case paranoid security researchers are idiots and don't bother doing actual research.
Removed the triptohell.info and fte.triptohell.info certificates, they really need to stop being self-signed. The updates domain is still self-signed for autoupdates.
Video drivers are now able to report supported video resolutions, visible to menuqc. Currently only works with SDL2 builds.
Added setmousepos builtin. Should work with glx+win32 build.
VF_SKYROOM_CAMERA can now accept an extra two args, setviewprop(VF_SKYROOM_CAMERA, org, axis, degrees).
Removed v_skyroom_origin+v_skyroom_orientation cvars in favour just v_skyroom, which should make it behave more like the 'fog' command (used when csqc isn't overriding).
Added R_EndPolygonRibbon builtin to make it faster+easier to generate textured ribbon/cable/etc wide lines (for TW).
sdl: Fix up sys_sdl.c's file enumeration to support wildcards in directories.
edit command now displays end1.bin/end2.bin correctly, because we can.
Finally add support for f_modified - though ruleset_allow_larger_models and ruleset_allow_overlong_sounds generally make it redundant.
Fix threading race condition in sha1 lookups.
Updated f_ruleset to include the same extra flags reported by ezquake.
A mod's default.fmf file can now contain an eg 'mainconfig config.cfg' line (to explicitly set the main config saved with cfg_save_auto 1 etc).
fmf: basegame steam:GameName/GameDir can be used to try to load a mod directory from an installed steam game. The resulting gamedir will be read-only.
HOMEDIR CHANGE: use homedirs only if the basedir cannot be written or a homedir already exists, which should further reduce the probability of microsoft randomly uploading our data to their cloud (but mostly because its annoying to never know where your data is written).
Fixed buf_cvarlist, should work in xonotic now, and without segfaults.
Added an extra arg to URI_Get_Callback calls - the response size, also changed the tempstring to contain all bytes of the response, you need to be careful about nulls though.
Try to work around nvidia's forced-panning bug on x11 when changing video modes. This might screw with other programs.
sdl: support custom icons.
sdl: support choosing a specific display.
Added some documentation to menuqc builtins.
menusys: use outlines for slightly more readable fonts.
menusys: switch vid_width and vid_height combos into a single video mode combo to set both according to reported video modes.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5581 fc73d0e0-1445-4013-8a0c-d673dee63da5
2019-11-20 03:09:50 +00:00
}
2015-04-14 23:12:17 +00:00
else if ( ! Q_strcasecmp ( cmd , " defaultexec " ) )
2013-08-07 14:13:18 +00:00
{
Z_Free ( man - > defaultexec ) ;
man - > defaultexec = Z_StrDup ( Cmd_Argv ( 1 ) ) ;
}
2019-12-16 17:36:00 +00:00
else if ( ! Q_strcasecmp ( cmd , " -bind " ) | | ! Q_strcasecmp ( cmd , " -set " ) | | ! Q_strcasecmp ( cmd , " -seta " ) | | ! Q_strcasecmp ( cmd , " -alias " ) | | ! Q_strncasecmp ( cmd , " - " , 1 ) )
2019-09-17 19:49:39 +00:00
{
Z_StrCat ( & man - > defaultexec , va ( " %s %s \n " , Cmd_Argv ( 0 ) + 1 , Cmd_Args ( ) ) ) ;
}
2019-12-16 17:36:00 +00:00
else if ( ! Q_strcasecmp ( cmd , " bind " ) | | ! Q_strcasecmp ( cmd , " set " ) | | ! Q_strcasecmp ( cmd , " seta " ) | | ! Q_strcasecmp ( cmd , " alias " ) | | ! Q_strncasecmp ( cmd , " + " , 1 ) )
playdemo accepts https urls now. will start playing before the file has finished downloading, to avoid unnecessary delays.
reworked network addresses to separate address family and connection type. this should make banning people more reliable, as well as simplifying a whole load of logic (no need to check for ipv4 AND ipv6).
tcpconnect will keep trying to connect even if the connection wasn't instant, instead of giving up instantly.
rewrote tcp connections quite a bit. sv_port_tcp now handles qtv+qizmo+http+ws+rtcbroker+tls equivalents.
qtv_streamport is now a legacy cvar and now acts equivalently to sv_port_tcp (but still separate).
rewrote screenshot and video capture code to use strides. this solves image-is-upside down issues with vulkan.
ignore alt key in browser port. oh no! no more red text! oh no! no more alt-being-wrongly-down-and-being-unable-to-type-anything-without-forcing-alt-released!
reworked audio decoder interface. now has clearly defined success/unavailable/end-of-file results. this should solve a whole load of issues with audio streaming.
fixed various openal audio streaming issues too. openal also got some workarounds for emscripten's poor emulation.
fixed ogg decoder to retain sync properly if seeked.
updated menu_media a bit. now reads vorbis comments/id3v1 tags to get proper track names. also saves the playlist so you don't have to manually repopulate the list so it might actually be usable now (after how many years?)
r_stains now defaults to 0, and is no longer enabled by presets. use decals if you want that sort of thing.
added fs_noreexec cvar, so configs will not be reexeced on gamedir change. this also means defaults won't be reapplied, etc.
added 'nvvk' renderer on windows, using nvidia's vulkan-inside-opengl gl extension. mostly just to see how much slower it is.
fixed up the ftp server quite a lot. more complete, more compliant, and should do ipv6 properly to-boot. file transfers also threaded.
fixed potential crash inside runclientphys.
experimental sv_antilag=3 setting. totally untested. the aim is to avoid missing due to lagged knockbacks. may be expensive for the server.
browser port's websockets support fixed. experimental support for webrtc ('works for me', requires a broker server).
updated avplug(renamed to ffmpeg so people know what it is) to use ffmpeg 3.2.4 properly, with its new encoder api. should be much more robust... also added experimental audio decoder for game music etc (currently doesn't resample, so playback rates are screwed, disabled by cvar).
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5097 fc73d0e0-1445-4013-8a0c-d673dee63da5
2017-05-10 02:08:58 +00:00
{
Z_StrCat ( & man - > defaultoverrides , va ( " %s %s \n " , Cmd_Argv ( 0 ) , Cmd_Args ( ) ) ) ;
}
2023-03-13 17:04:57 +00:00
# ifdef HAVE_LEGACY
playdemo accepts https urls now. will start playing before the file has finished downloading, to avoid unnecessary delays.
reworked network addresses to separate address family and connection type. this should make banning people more reliable, as well as simplifying a whole load of logic (no need to check for ipv4 AND ipv6).
tcpconnect will keep trying to connect even if the connection wasn't instant, instead of giving up instantly.
rewrote tcp connections quite a bit. sv_port_tcp now handles qtv+qizmo+http+ws+rtcbroker+tls equivalents.
qtv_streamport is now a legacy cvar and now acts equivalently to sv_port_tcp (but still separate).
rewrote screenshot and video capture code to use strides. this solves image-is-upside down issues with vulkan.
ignore alt key in browser port. oh no! no more red text! oh no! no more alt-being-wrongly-down-and-being-unable-to-type-anything-without-forcing-alt-released!
reworked audio decoder interface. now has clearly defined success/unavailable/end-of-file results. this should solve a whole load of issues with audio streaming.
fixed various openal audio streaming issues too. openal also got some workarounds for emscripten's poor emulation.
fixed ogg decoder to retain sync properly if seeked.
updated menu_media a bit. now reads vorbis comments/id3v1 tags to get proper track names. also saves the playlist so you don't have to manually repopulate the list so it might actually be usable now (after how many years?)
r_stains now defaults to 0, and is no longer enabled by presets. use decals if you want that sort of thing.
added fs_noreexec cvar, so configs will not be reexeced on gamedir change. this also means defaults won't be reapplied, etc.
added 'nvvk' renderer on windows, using nvidia's vulkan-inside-opengl gl extension. mostly just to see how much slower it is.
fixed up the ftp server quite a lot. more complete, more compliant, and should do ipv6 properly to-boot. file transfers also threaded.
fixed potential crash inside runclientphys.
experimental sv_antilag=3 setting. totally untested. the aim is to avoid missing due to lagged knockbacks. may be expensive for the server.
browser port's websockets support fixed. experimental support for webrtc ('works for me', requires a broker server).
updated avplug(renamed to ffmpeg so people know what it is) to use ffmpeg 3.2.4 properly, with its new encoder api. should be much more robust... also added experimental audio decoder for game music etc (currently doesn't resample, so playback rates are screwed, disabled by cvar).
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5097 fc73d0e0-1445-4013-8a0c-d673dee63da5
2017-05-10 02:08:58 +00:00
else if ( ! Q_strcasecmp ( cmd , " rtcbroker " ) )
{
2023-03-13 17:04:57 +00:00
Z_StrCat ( & man - > defaultexec , va ( " set %s %s \n " , net_ice_broker . name , Cmd_Args ( ) ) ) ;
playdemo accepts https urls now. will start playing before the file has finished downloading, to avoid unnecessary delays.
reworked network addresses to separate address family and connection type. this should make banning people more reliable, as well as simplifying a whole load of logic (no need to check for ipv4 AND ipv6).
tcpconnect will keep trying to connect even if the connection wasn't instant, instead of giving up instantly.
rewrote tcp connections quite a bit. sv_port_tcp now handles qtv+qizmo+http+ws+rtcbroker+tls equivalents.
qtv_streamport is now a legacy cvar and now acts equivalently to sv_port_tcp (but still separate).
rewrote screenshot and video capture code to use strides. this solves image-is-upside down issues with vulkan.
ignore alt key in browser port. oh no! no more red text! oh no! no more alt-being-wrongly-down-and-being-unable-to-type-anything-without-forcing-alt-released!
reworked audio decoder interface. now has clearly defined success/unavailable/end-of-file results. this should solve a whole load of issues with audio streaming.
fixed various openal audio streaming issues too. openal also got some workarounds for emscripten's poor emulation.
fixed ogg decoder to retain sync properly if seeked.
updated menu_media a bit. now reads vorbis comments/id3v1 tags to get proper track names. also saves the playlist so you don't have to manually repopulate the list so it might actually be usable now (after how many years?)
r_stains now defaults to 0, and is no longer enabled by presets. use decals if you want that sort of thing.
added fs_noreexec cvar, so configs will not be reexeced on gamedir change. this also means defaults won't be reapplied, etc.
added 'nvvk' renderer on windows, using nvidia's vulkan-inside-opengl gl extension. mostly just to see how much slower it is.
fixed up the ftp server quite a lot. more complete, more compliant, and should do ipv6 properly to-boot. file transfers also threaded.
fixed potential crash inside runclientphys.
experimental sv_antilag=3 setting. totally untested. the aim is to avoid missing due to lagged knockbacks. may be expensive for the server.
browser port's websockets support fixed. experimental support for webrtc ('works for me', requires a broker server).
updated avplug(renamed to ffmpeg so people know what it is) to use ffmpeg 3.2.4 properly, with its new encoder api. should be much more robust... also added experimental audio decoder for game music etc (currently doesn't resample, so playback rates are screwed, disabled by cvar).
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5097 fc73d0e0-1445-4013-8a0c-d673dee63da5
2017-05-10 02:08:58 +00:00
}
2023-03-13 17:04:57 +00:00
# endif
2015-04-14 23:12:17 +00:00
else if ( ! Q_strcasecmp ( cmd , " updateurl " ) )
2014-03-30 08:55:06 +00:00
{
Z_Free ( man - > updateurl ) ;
man - > updateurl = Z_StrDup ( Cmd_Argv ( 1 ) ) ;
}
2020-04-19 01:23:32 +00:00
else if ( ! Q_strcasecmp ( cmd , " icon " ) ) //relative path to an icon image (typically png)
{
Z_Free ( man - > iconname ) ;
man - > iconname = Z_StrDup ( Cmd_Argv ( 1 ) ) ;
}
Too many changes, sorry.
Change revision displays, use the SVN commit date instead of using __DATE__ (when there's no local changes). This should allow reproducible builds.
Added s_al_disable cvar, to block openal and all the various problems people have had with it, without having to name an explicit fallback (which would vary by system).
Add mastervolume cvar (for ss).
Add r_shadows 2 (aka fake shadows - for ss).
Add scr_loadingscreen_aspect -1 setting, to disable levelshots entirely, also disables the progress bar (for ss).
Better support for some effectinfo hacks (for ss).
Added dpcompat_nocsqcwarnings (because of lazy+buggy mods like ss).
Rework the dpcsqc versions of project+unproject builtins for better compat (for ss).
Added dpcompat_csqcinputeventtypes to block unexpected csqc input events (for ss).
Better compat with DP's loadfont console command (for ss).
Added dpcompat_smallerfonts cvar to replicate a DP bug (for ss).
Detect dp's m_draw extension, to work around it (for ss).
Cvar dpcompat_ignoremodificationtimes added. A value of 0 favour the most recently modified file, 1 will use DP-like alphabetically sorted preferences (for ss).
loadfont builtin can now accept outline=1 in the sizes arg for slightly more readable fonts.
Fix bbox calcs for rotated entities, fix needed for r_ignorenetpvs 0.
Hackily parse emoji.json to provide :poop: etc suggestions.
Skip prediction entirely when there's no local entity info. This fixes stair-smoothing in xonotic.
screenshot_cubemap will now capture half-float images when saving to ktx or dds files.
Fix support for xcf files larger than 4gb, mostly to avoid compiler warnings.
Fixed size of gfx/loading.lmp when replacement textures are used.
Added mipmap support for rg8 and l8a8 textures.
r_hdr_framebuffer cvar updated to support format names instead of random negative numbers. Description updated to name some interesting ones.
Perform autoupdate _checks_ ONLY with explicit user confirmation (actual updating already needed user confirmation, but this extra step should reduce the chances of us getting wrongly accused of exfiltrating user data if we're run in a sandbox - we ONLY ever included the updating engine's version in the checks, though there's nothing we can do to avoid sending the user's router's IP).
Removed the 'summon satan all over your harddrive' quit message, in case paranoid security researchers are idiots and don't bother doing actual research.
Removed the triptohell.info and fte.triptohell.info certificates, they really need to stop being self-signed. The updates domain is still self-signed for autoupdates.
Video drivers are now able to report supported video resolutions, visible to menuqc. Currently only works with SDL2 builds.
Added setmousepos builtin. Should work with glx+win32 build.
VF_SKYROOM_CAMERA can now accept an extra two args, setviewprop(VF_SKYROOM_CAMERA, org, axis, degrees).
Removed v_skyroom_origin+v_skyroom_orientation cvars in favour just v_skyroom, which should make it behave more like the 'fog' command (used when csqc isn't overriding).
Added R_EndPolygonRibbon builtin to make it faster+easier to generate textured ribbon/cable/etc wide lines (for TW).
sdl: Fix up sys_sdl.c's file enumeration to support wildcards in directories.
edit command now displays end1.bin/end2.bin correctly, because we can.
Finally add support for f_modified - though ruleset_allow_larger_models and ruleset_allow_overlong_sounds generally make it redundant.
Fix threading race condition in sha1 lookups.
Updated f_ruleset to include the same extra flags reported by ezquake.
A mod's default.fmf file can now contain an eg 'mainconfig config.cfg' line (to explicitly set the main config saved with cfg_save_auto 1 etc).
fmf: basegame steam:GameName/GameDir can be used to try to load a mod directory from an installed steam game. The resulting gamedir will be read-only.
HOMEDIR CHANGE: use homedirs only if the basedir cannot be written or a homedir already exists, which should further reduce the probability of microsoft randomly uploading our data to their cloud (but mostly because its annoying to never know where your data is written).
Fixed buf_cvarlist, should work in xonotic now, and without segfaults.
Added an extra arg to URI_Get_Callback calls - the response size, also changed the tempstring to contain all bytes of the response, you need to be careful about nulls though.
Try to work around nvidia's forced-panning bug on x11 when changing video modes. This might screw with other programs.
sdl: support custom icons.
sdl: support choosing a specific display.
Added some documentation to menuqc builtins.
menusys: use outlines for slightly more readable fonts.
menusys: switch vid_width and vid_height combos into a single video mode combo to set both according to reported video modes.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5581 fc73d0e0-1445-4013-8a0c-d673dee63da5
2019-11-20 03:09:50 +00:00
else if ( ! Q_strcasecmp ( cmd , " disablehomedir " ) | | ! Q_strcasecmp ( cmd , " homedirmode " ) )
2014-03-30 08:55:06 +00:00
{
Too many changes, sorry.
Change revision displays, use the SVN commit date instead of using __DATE__ (when there's no local changes). This should allow reproducible builds.
Added s_al_disable cvar, to block openal and all the various problems people have had with it, without having to name an explicit fallback (which would vary by system).
Add mastervolume cvar (for ss).
Add r_shadows 2 (aka fake shadows - for ss).
Add scr_loadingscreen_aspect -1 setting, to disable levelshots entirely, also disables the progress bar (for ss).
Better support for some effectinfo hacks (for ss).
Added dpcompat_nocsqcwarnings (because of lazy+buggy mods like ss).
Rework the dpcsqc versions of project+unproject builtins for better compat (for ss).
Added dpcompat_csqcinputeventtypes to block unexpected csqc input events (for ss).
Better compat with DP's loadfont console command (for ss).
Added dpcompat_smallerfonts cvar to replicate a DP bug (for ss).
Detect dp's m_draw extension, to work around it (for ss).
Cvar dpcompat_ignoremodificationtimes added. A value of 0 favour the most recently modified file, 1 will use DP-like alphabetically sorted preferences (for ss).
loadfont builtin can now accept outline=1 in the sizes arg for slightly more readable fonts.
Fix bbox calcs for rotated entities, fix needed for r_ignorenetpvs 0.
Hackily parse emoji.json to provide :poop: etc suggestions.
Skip prediction entirely when there's no local entity info. This fixes stair-smoothing in xonotic.
screenshot_cubemap will now capture half-float images when saving to ktx or dds files.
Fix support for xcf files larger than 4gb, mostly to avoid compiler warnings.
Fixed size of gfx/loading.lmp when replacement textures are used.
Added mipmap support for rg8 and l8a8 textures.
r_hdr_framebuffer cvar updated to support format names instead of random negative numbers. Description updated to name some interesting ones.
Perform autoupdate _checks_ ONLY with explicit user confirmation (actual updating already needed user confirmation, but this extra step should reduce the chances of us getting wrongly accused of exfiltrating user data if we're run in a sandbox - we ONLY ever included the updating engine's version in the checks, though there's nothing we can do to avoid sending the user's router's IP).
Removed the 'summon satan all over your harddrive' quit message, in case paranoid security researchers are idiots and don't bother doing actual research.
Removed the triptohell.info and fte.triptohell.info certificates, they really need to stop being self-signed. The updates domain is still self-signed for autoupdates.
Video drivers are now able to report supported video resolutions, visible to menuqc. Currently only works with SDL2 builds.
Added setmousepos builtin. Should work with glx+win32 build.
VF_SKYROOM_CAMERA can now accept an extra two args, setviewprop(VF_SKYROOM_CAMERA, org, axis, degrees).
Removed v_skyroom_origin+v_skyroom_orientation cvars in favour just v_skyroom, which should make it behave more like the 'fog' command (used when csqc isn't overriding).
Added R_EndPolygonRibbon builtin to make it faster+easier to generate textured ribbon/cable/etc wide lines (for TW).
sdl: Fix up sys_sdl.c's file enumeration to support wildcards in directories.
edit command now displays end1.bin/end2.bin correctly, because we can.
Finally add support for f_modified - though ruleset_allow_larger_models and ruleset_allow_overlong_sounds generally make it redundant.
Fix threading race condition in sha1 lookups.
Updated f_ruleset to include the same extra flags reported by ezquake.
A mod's default.fmf file can now contain an eg 'mainconfig config.cfg' line (to explicitly set the main config saved with cfg_save_auto 1 etc).
fmf: basegame steam:GameName/GameDir can be used to try to load a mod directory from an installed steam game. The resulting gamedir will be read-only.
HOMEDIR CHANGE: use homedirs only if the basedir cannot be written or a homedir already exists, which should further reduce the probability of microsoft randomly uploading our data to their cloud (but mostly because its annoying to never know where your data is written).
Fixed buf_cvarlist, should work in xonotic now, and without segfaults.
Added an extra arg to URI_Get_Callback calls - the response size, also changed the tempstring to contain all bytes of the response, you need to be careful about nulls though.
Try to work around nvidia's forced-panning bug on x11 when changing video modes. This might screw with other programs.
sdl: support custom icons.
sdl: support choosing a specific display.
Added some documentation to menuqc builtins.
menusys: use outlines for slightly more readable fonts.
menusys: switch vid_width and vid_height combos into a single video mode combo to set both according to reported video modes.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5581 fc73d0e0-1445-4013-8a0c-d673dee63da5
2019-11-20 03:09:50 +00:00
char * arg = Cmd_Argv ( 1 ) ;
if ( ! Q_strcasecmp ( arg , " auto " ) )
man - > homedirtype = MANIFEST_HOMEDIRWHENREADONLY ;
Added sys_openfile console command(and menu option) to web and flatpak(via cmake+dbus) builds, to 'install' packages on sandboxed systems a bit more easily.
Cmake: Add FTE_WERROR option, defaults to true in debug builds and off in release builds (in case future compilers have issues).
Cmake: Pull in libXscreensaver so we don't get interrupted by screensavers when playing demos.
Make: Added `make webcl-rel` for a web build without server bloat (eg for sites focused on demo playback. Yes, this means you XantoM).
fteqcc: Include the decompiler in fteqcc (non-gui) builds ('-d' arg).
fteqcc: Decompiler can now mostly handle hexen2 mods without any unknown opcodes.
Allow ezHud and OpenSSL to be compiled as in-engine plugins, potentially for web and windows ports respectively.
Web: Fix support for ogg vorbis. Add support for voip.
Web: Added basic support for WebXR.
QTV: Don't try seeking on unseekable qtv streams. Don't spam when developer 1 is set.
QTV: add support for some eztv extensions.
MVD: added hack to use ktx's vweps in mvd where mvdsv doesn't bother to record the info.
qwfwd: hack around a hack in qwfwd, allowing it to work again.
recording: favour qwd in single player, instead of mvd.
Protocol: reduce client memory used for precache names. Bump maximum precache counts - some people are just abusive, yes you Orl.
hexen2: add enough clientside protocol compat to play the demo included with h2mp. lacks effects.
in_xflip: restored this setting.
fs_hidesyspaths: new cvar, defaults to enabled so you won't find your username or whatever turning up in screenshots or the like. change it to 0 before debuging stuff eg via 'path'.
gl_overbright_models: Added cvar to match QS.
netchan: Added MTU determination, we'll no longer fail to connect when routers stupidly drop icmp packets.
Win: try a few other versions of xinput too.
CSQC: Added a CSQC_GenerateMaterial function, to give the csqc a chance to generate custom materials.
MenuQC: Added support for the skeletal objects API.
2024-04-09 17:13:59 +00:00
else if ( ! * arg | | atoi ( arg ) | | ! Q_strcasecmp ( arg , " never " ) )
Too many changes, sorry.
Change revision displays, use the SVN commit date instead of using __DATE__ (when there's no local changes). This should allow reproducible builds.
Added s_al_disable cvar, to block openal and all the various problems people have had with it, without having to name an explicit fallback (which would vary by system).
Add mastervolume cvar (for ss).
Add r_shadows 2 (aka fake shadows - for ss).
Add scr_loadingscreen_aspect -1 setting, to disable levelshots entirely, also disables the progress bar (for ss).
Better support for some effectinfo hacks (for ss).
Added dpcompat_nocsqcwarnings (because of lazy+buggy mods like ss).
Rework the dpcsqc versions of project+unproject builtins for better compat (for ss).
Added dpcompat_csqcinputeventtypes to block unexpected csqc input events (for ss).
Better compat with DP's loadfont console command (for ss).
Added dpcompat_smallerfonts cvar to replicate a DP bug (for ss).
Detect dp's m_draw extension, to work around it (for ss).
Cvar dpcompat_ignoremodificationtimes added. A value of 0 favour the most recently modified file, 1 will use DP-like alphabetically sorted preferences (for ss).
loadfont builtin can now accept outline=1 in the sizes arg for slightly more readable fonts.
Fix bbox calcs for rotated entities, fix needed for r_ignorenetpvs 0.
Hackily parse emoji.json to provide :poop: etc suggestions.
Skip prediction entirely when there's no local entity info. This fixes stair-smoothing in xonotic.
screenshot_cubemap will now capture half-float images when saving to ktx or dds files.
Fix support for xcf files larger than 4gb, mostly to avoid compiler warnings.
Fixed size of gfx/loading.lmp when replacement textures are used.
Added mipmap support for rg8 and l8a8 textures.
r_hdr_framebuffer cvar updated to support format names instead of random negative numbers. Description updated to name some interesting ones.
Perform autoupdate _checks_ ONLY with explicit user confirmation (actual updating already needed user confirmation, but this extra step should reduce the chances of us getting wrongly accused of exfiltrating user data if we're run in a sandbox - we ONLY ever included the updating engine's version in the checks, though there's nothing we can do to avoid sending the user's router's IP).
Removed the 'summon satan all over your harddrive' quit message, in case paranoid security researchers are idiots and don't bother doing actual research.
Removed the triptohell.info and fte.triptohell.info certificates, they really need to stop being self-signed. The updates domain is still self-signed for autoupdates.
Video drivers are now able to report supported video resolutions, visible to menuqc. Currently only works with SDL2 builds.
Added setmousepos builtin. Should work with glx+win32 build.
VF_SKYROOM_CAMERA can now accept an extra two args, setviewprop(VF_SKYROOM_CAMERA, org, axis, degrees).
Removed v_skyroom_origin+v_skyroom_orientation cvars in favour just v_skyroom, which should make it behave more like the 'fog' command (used when csqc isn't overriding).
Added R_EndPolygonRibbon builtin to make it faster+easier to generate textured ribbon/cable/etc wide lines (for TW).
sdl: Fix up sys_sdl.c's file enumeration to support wildcards in directories.
edit command now displays end1.bin/end2.bin correctly, because we can.
Finally add support for f_modified - though ruleset_allow_larger_models and ruleset_allow_overlong_sounds generally make it redundant.
Fix threading race condition in sha1 lookups.
Updated f_ruleset to include the same extra flags reported by ezquake.
A mod's default.fmf file can now contain an eg 'mainconfig config.cfg' line (to explicitly set the main config saved with cfg_save_auto 1 etc).
fmf: basegame steam:GameName/GameDir can be used to try to load a mod directory from an installed steam game. The resulting gamedir will be read-only.
HOMEDIR CHANGE: use homedirs only if the basedir cannot be written or a homedir already exists, which should further reduce the probability of microsoft randomly uploading our data to their cloud (but mostly because its annoying to never know where your data is written).
Fixed buf_cvarlist, should work in xonotic now, and without segfaults.
Added an extra arg to URI_Get_Callback calls - the response size, also changed the tempstring to contain all bytes of the response, you need to be careful about nulls though.
Try to work around nvidia's forced-panning bug on x11 when changing video modes. This might screw with other programs.
sdl: support custom icons.
sdl: support choosing a specific display.
Added some documentation to menuqc builtins.
menusys: use outlines for slightly more readable fonts.
menusys: switch vid_width and vid_height combos into a single video mode combo to set both according to reported video modes.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5581 fc73d0e0-1445-4013-8a0c-d673dee63da5
2019-11-20 03:09:50 +00:00
man - > homedirtype = MANIFEST_NOHOMEDIR ;
2023-07-02 03:19:01 +00:00
else if ( ! atoi ( arg ) | | ! Q_strcasecmp ( arg , " force " ) | | ! Q_strcasecmp ( arg , " always " ) )
Too many changes, sorry.
Change revision displays, use the SVN commit date instead of using __DATE__ (when there's no local changes). This should allow reproducible builds.
Added s_al_disable cvar, to block openal and all the various problems people have had with it, without having to name an explicit fallback (which would vary by system).
Add mastervolume cvar (for ss).
Add r_shadows 2 (aka fake shadows - for ss).
Add scr_loadingscreen_aspect -1 setting, to disable levelshots entirely, also disables the progress bar (for ss).
Better support for some effectinfo hacks (for ss).
Added dpcompat_nocsqcwarnings (because of lazy+buggy mods like ss).
Rework the dpcsqc versions of project+unproject builtins for better compat (for ss).
Added dpcompat_csqcinputeventtypes to block unexpected csqc input events (for ss).
Better compat with DP's loadfont console command (for ss).
Added dpcompat_smallerfonts cvar to replicate a DP bug (for ss).
Detect dp's m_draw extension, to work around it (for ss).
Cvar dpcompat_ignoremodificationtimes added. A value of 0 favour the most recently modified file, 1 will use DP-like alphabetically sorted preferences (for ss).
loadfont builtin can now accept outline=1 in the sizes arg for slightly more readable fonts.
Fix bbox calcs for rotated entities, fix needed for r_ignorenetpvs 0.
Hackily parse emoji.json to provide :poop: etc suggestions.
Skip prediction entirely when there's no local entity info. This fixes stair-smoothing in xonotic.
screenshot_cubemap will now capture half-float images when saving to ktx or dds files.
Fix support for xcf files larger than 4gb, mostly to avoid compiler warnings.
Fixed size of gfx/loading.lmp when replacement textures are used.
Added mipmap support for rg8 and l8a8 textures.
r_hdr_framebuffer cvar updated to support format names instead of random negative numbers. Description updated to name some interesting ones.
Perform autoupdate _checks_ ONLY with explicit user confirmation (actual updating already needed user confirmation, but this extra step should reduce the chances of us getting wrongly accused of exfiltrating user data if we're run in a sandbox - we ONLY ever included the updating engine's version in the checks, though there's nothing we can do to avoid sending the user's router's IP).
Removed the 'summon satan all over your harddrive' quit message, in case paranoid security researchers are idiots and don't bother doing actual research.
Removed the triptohell.info and fte.triptohell.info certificates, they really need to stop being self-signed. The updates domain is still self-signed for autoupdates.
Video drivers are now able to report supported video resolutions, visible to menuqc. Currently only works with SDL2 builds.
Added setmousepos builtin. Should work with glx+win32 build.
VF_SKYROOM_CAMERA can now accept an extra two args, setviewprop(VF_SKYROOM_CAMERA, org, axis, degrees).
Removed v_skyroom_origin+v_skyroom_orientation cvars in favour just v_skyroom, which should make it behave more like the 'fog' command (used when csqc isn't overriding).
Added R_EndPolygonRibbon builtin to make it faster+easier to generate textured ribbon/cable/etc wide lines (for TW).
sdl: Fix up sys_sdl.c's file enumeration to support wildcards in directories.
edit command now displays end1.bin/end2.bin correctly, because we can.
Finally add support for f_modified - though ruleset_allow_larger_models and ruleset_allow_overlong_sounds generally make it redundant.
Fix threading race condition in sha1 lookups.
Updated f_ruleset to include the same extra flags reported by ezquake.
A mod's default.fmf file can now contain an eg 'mainconfig config.cfg' line (to explicitly set the main config saved with cfg_save_auto 1 etc).
fmf: basegame steam:GameName/GameDir can be used to try to load a mod directory from an installed steam game. The resulting gamedir will be read-only.
HOMEDIR CHANGE: use homedirs only if the basedir cannot be written or a homedir already exists, which should further reduce the probability of microsoft randomly uploading our data to their cloud (but mostly because its annoying to never know where your data is written).
Fixed buf_cvarlist, should work in xonotic now, and without segfaults.
Added an extra arg to URI_Get_Callback calls - the response size, also changed the tempstring to contain all bytes of the response, you need to be careful about nulls though.
Try to work around nvidia's forced-panning bug on x11 when changing video modes. This might screw with other programs.
sdl: support custom icons.
sdl: support choosing a specific display.
Added some documentation to menuqc builtins.
menusys: use outlines for slightly more readable fonts.
menusys: switch vid_width and vid_height combos into a single video mode combo to set both according to reported video modes.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5581 fc73d0e0-1445-4013-8a0c-d673dee63da5
2019-11-20 03:09:50 +00:00
man - > homedirtype = MANIFEST_FORCEHOMEDIR ;
2014-03-30 08:55:06 +00:00
}
2015-04-14 23:12:17 +00:00
else if ( ! Q_strcasecmp ( cmd , " basegame " ) | | ! Q_strcasecmp ( cmd , " gamedir " ) )
2013-06-23 02:17:02 +00:00
{
int i ;
char * newdir = Cmd_Argv ( 1 ) ;
2020-05-16 13:12:58 +00:00
qboolean basegame = ! Q_strcasecmp ( cmd , " basegame " ) ;
for ( i = 0 ; i < sizeof ( man - > gamepath ) / sizeof ( man - > gamepath [ 0 ] ) ; i + + )
{
if ( man - > gamepath [ i ] . path )
{
if ( ! Q_strcasecmp ( man - > gamepath [ i ] . path , newdir ) )
{
if ( basegame & & ! ( man - > gamepath [ i ] . flags & GAMEDIR_BASEGAME ) )
{
Z_Free ( man - > gamepath [ i ] . path ) ;
man - > gamepath [ i ] . path = NULL ; //if we're adding a basegame when there's a mod game with the same name then drop the redundant mod name
man - > gamepath [ i ] . flags = 0 ;
}
else
return true ; //already in there, don't add a conflicting one.
}
}
}
2013-06-23 02:17:02 +00:00
Too many changes, sorry.
Change revision displays, use the SVN commit date instead of using __DATE__ (when there's no local changes). This should allow reproducible builds.
Added s_al_disable cvar, to block openal and all the various problems people have had with it, without having to name an explicit fallback (which would vary by system).
Add mastervolume cvar (for ss).
Add r_shadows 2 (aka fake shadows - for ss).
Add scr_loadingscreen_aspect -1 setting, to disable levelshots entirely, also disables the progress bar (for ss).
Better support for some effectinfo hacks (for ss).
Added dpcompat_nocsqcwarnings (because of lazy+buggy mods like ss).
Rework the dpcsqc versions of project+unproject builtins for better compat (for ss).
Added dpcompat_csqcinputeventtypes to block unexpected csqc input events (for ss).
Better compat with DP's loadfont console command (for ss).
Added dpcompat_smallerfonts cvar to replicate a DP bug (for ss).
Detect dp's m_draw extension, to work around it (for ss).
Cvar dpcompat_ignoremodificationtimes added. A value of 0 favour the most recently modified file, 1 will use DP-like alphabetically sorted preferences (for ss).
loadfont builtin can now accept outline=1 in the sizes arg for slightly more readable fonts.
Fix bbox calcs for rotated entities, fix needed for r_ignorenetpvs 0.
Hackily parse emoji.json to provide :poop: etc suggestions.
Skip prediction entirely when there's no local entity info. This fixes stair-smoothing in xonotic.
screenshot_cubemap will now capture half-float images when saving to ktx or dds files.
Fix support for xcf files larger than 4gb, mostly to avoid compiler warnings.
Fixed size of gfx/loading.lmp when replacement textures are used.
Added mipmap support for rg8 and l8a8 textures.
r_hdr_framebuffer cvar updated to support format names instead of random negative numbers. Description updated to name some interesting ones.
Perform autoupdate _checks_ ONLY with explicit user confirmation (actual updating already needed user confirmation, but this extra step should reduce the chances of us getting wrongly accused of exfiltrating user data if we're run in a sandbox - we ONLY ever included the updating engine's version in the checks, though there's nothing we can do to avoid sending the user's router's IP).
Removed the 'summon satan all over your harddrive' quit message, in case paranoid security researchers are idiots and don't bother doing actual research.
Removed the triptohell.info and fte.triptohell.info certificates, they really need to stop being self-signed. The updates domain is still self-signed for autoupdates.
Video drivers are now able to report supported video resolutions, visible to menuqc. Currently only works with SDL2 builds.
Added setmousepos builtin. Should work with glx+win32 build.
VF_SKYROOM_CAMERA can now accept an extra two args, setviewprop(VF_SKYROOM_CAMERA, org, axis, degrees).
Removed v_skyroom_origin+v_skyroom_orientation cvars in favour just v_skyroom, which should make it behave more like the 'fog' command (used when csqc isn't overriding).
Added R_EndPolygonRibbon builtin to make it faster+easier to generate textured ribbon/cable/etc wide lines (for TW).
sdl: Fix up sys_sdl.c's file enumeration to support wildcards in directories.
edit command now displays end1.bin/end2.bin correctly, because we can.
Finally add support for f_modified - though ruleset_allow_larger_models and ruleset_allow_overlong_sounds generally make it redundant.
Fix threading race condition in sha1 lookups.
Updated f_ruleset to include the same extra flags reported by ezquake.
A mod's default.fmf file can now contain an eg 'mainconfig config.cfg' line (to explicitly set the main config saved with cfg_save_auto 1 etc).
fmf: basegame steam:GameName/GameDir can be used to try to load a mod directory from an installed steam game. The resulting gamedir will be read-only.
HOMEDIR CHANGE: use homedirs only if the basedir cannot be written or a homedir already exists, which should further reduce the probability of microsoft randomly uploading our data to their cloud (but mostly because its annoying to never know where your data is written).
Fixed buf_cvarlist, should work in xonotic now, and without segfaults.
Added an extra arg to URI_Get_Callback calls - the response size, also changed the tempstring to contain all bytes of the response, you need to be careful about nulls though.
Try to work around nvidia's forced-panning bug on x11 when changing video modes. This might screw with other programs.
sdl: support custom icons.
sdl: support choosing a specific display.
Added some documentation to menuqc builtins.
menusys: use outlines for slightly more readable fonts.
menusys: switch vid_width and vid_height combos into a single video mode combo to set both according to reported video modes.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5581 fc73d0e0-1445-4013-8a0c-d673dee63da5
2019-11-20 03:09:50 +00:00
for ( i = 0 ; i < sizeof ( man - > gamepath ) / sizeof ( man - > gamepath [ 0 ] ) ; i + + )
2013-06-23 02:17:02 +00:00
{
Too many changes, sorry.
Change revision displays, use the SVN commit date instead of using __DATE__ (when there's no local changes). This should allow reproducible builds.
Added s_al_disable cvar, to block openal and all the various problems people have had with it, without having to name an explicit fallback (which would vary by system).
Add mastervolume cvar (for ss).
Add r_shadows 2 (aka fake shadows - for ss).
Add scr_loadingscreen_aspect -1 setting, to disable levelshots entirely, also disables the progress bar (for ss).
Better support for some effectinfo hacks (for ss).
Added dpcompat_nocsqcwarnings (because of lazy+buggy mods like ss).
Rework the dpcsqc versions of project+unproject builtins for better compat (for ss).
Added dpcompat_csqcinputeventtypes to block unexpected csqc input events (for ss).
Better compat with DP's loadfont console command (for ss).
Added dpcompat_smallerfonts cvar to replicate a DP bug (for ss).
Detect dp's m_draw extension, to work around it (for ss).
Cvar dpcompat_ignoremodificationtimes added. A value of 0 favour the most recently modified file, 1 will use DP-like alphabetically sorted preferences (for ss).
loadfont builtin can now accept outline=1 in the sizes arg for slightly more readable fonts.
Fix bbox calcs for rotated entities, fix needed for r_ignorenetpvs 0.
Hackily parse emoji.json to provide :poop: etc suggestions.
Skip prediction entirely when there's no local entity info. This fixes stair-smoothing in xonotic.
screenshot_cubemap will now capture half-float images when saving to ktx or dds files.
Fix support for xcf files larger than 4gb, mostly to avoid compiler warnings.
Fixed size of gfx/loading.lmp when replacement textures are used.
Added mipmap support for rg8 and l8a8 textures.
r_hdr_framebuffer cvar updated to support format names instead of random negative numbers. Description updated to name some interesting ones.
Perform autoupdate _checks_ ONLY with explicit user confirmation (actual updating already needed user confirmation, but this extra step should reduce the chances of us getting wrongly accused of exfiltrating user data if we're run in a sandbox - we ONLY ever included the updating engine's version in the checks, though there's nothing we can do to avoid sending the user's router's IP).
Removed the 'summon satan all over your harddrive' quit message, in case paranoid security researchers are idiots and don't bother doing actual research.
Removed the triptohell.info and fte.triptohell.info certificates, they really need to stop being self-signed. The updates domain is still self-signed for autoupdates.
Video drivers are now able to report supported video resolutions, visible to menuqc. Currently only works with SDL2 builds.
Added setmousepos builtin. Should work with glx+win32 build.
VF_SKYROOM_CAMERA can now accept an extra two args, setviewprop(VF_SKYROOM_CAMERA, org, axis, degrees).
Removed v_skyroom_origin+v_skyroom_orientation cvars in favour just v_skyroom, which should make it behave more like the 'fog' command (used when csqc isn't overriding).
Added R_EndPolygonRibbon builtin to make it faster+easier to generate textured ribbon/cable/etc wide lines (for TW).
sdl: Fix up sys_sdl.c's file enumeration to support wildcards in directories.
edit command now displays end1.bin/end2.bin correctly, because we can.
Finally add support for f_modified - though ruleset_allow_larger_models and ruleset_allow_overlong_sounds generally make it redundant.
Fix threading race condition in sha1 lookups.
Updated f_ruleset to include the same extra flags reported by ezquake.
A mod's default.fmf file can now contain an eg 'mainconfig config.cfg' line (to explicitly set the main config saved with cfg_save_auto 1 etc).
fmf: basegame steam:GameName/GameDir can be used to try to load a mod directory from an installed steam game. The resulting gamedir will be read-only.
HOMEDIR CHANGE: use homedirs only if the basedir cannot be written or a homedir already exists, which should further reduce the probability of microsoft randomly uploading our data to their cloud (but mostly because its annoying to never know where your data is written).
Fixed buf_cvarlist, should work in xonotic now, and without segfaults.
Added an extra arg to URI_Get_Callback calls - the response size, also changed the tempstring to contain all bytes of the response, you need to be careful about nulls though.
Try to work around nvidia's forced-panning bug on x11 when changing video modes. This might screw with other programs.
sdl: support custom icons.
sdl: support choosing a specific display.
Added some documentation to menuqc builtins.
menusys: use outlines for slightly more readable fonts.
menusys: switch vid_width and vid_height combos into a single video mode combo to set both according to reported video modes.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5581 fc73d0e0-1445-4013-8a0c-d673dee63da5
2019-11-20 03:09:50 +00:00
if ( ! man - > gamepath [ i ] . path )
2013-06-23 02:17:02 +00:00
{
Too many changes, sorry.
Change revision displays, use the SVN commit date instead of using __DATE__ (when there's no local changes). This should allow reproducible builds.
Added s_al_disable cvar, to block openal and all the various problems people have had with it, without having to name an explicit fallback (which would vary by system).
Add mastervolume cvar (for ss).
Add r_shadows 2 (aka fake shadows - for ss).
Add scr_loadingscreen_aspect -1 setting, to disable levelshots entirely, also disables the progress bar (for ss).
Better support for some effectinfo hacks (for ss).
Added dpcompat_nocsqcwarnings (because of lazy+buggy mods like ss).
Rework the dpcsqc versions of project+unproject builtins for better compat (for ss).
Added dpcompat_csqcinputeventtypes to block unexpected csqc input events (for ss).
Better compat with DP's loadfont console command (for ss).
Added dpcompat_smallerfonts cvar to replicate a DP bug (for ss).
Detect dp's m_draw extension, to work around it (for ss).
Cvar dpcompat_ignoremodificationtimes added. A value of 0 favour the most recently modified file, 1 will use DP-like alphabetically sorted preferences (for ss).
loadfont builtin can now accept outline=1 in the sizes arg for slightly more readable fonts.
Fix bbox calcs for rotated entities, fix needed for r_ignorenetpvs 0.
Hackily parse emoji.json to provide :poop: etc suggestions.
Skip prediction entirely when there's no local entity info. This fixes stair-smoothing in xonotic.
screenshot_cubemap will now capture half-float images when saving to ktx or dds files.
Fix support for xcf files larger than 4gb, mostly to avoid compiler warnings.
Fixed size of gfx/loading.lmp when replacement textures are used.
Added mipmap support for rg8 and l8a8 textures.
r_hdr_framebuffer cvar updated to support format names instead of random negative numbers. Description updated to name some interesting ones.
Perform autoupdate _checks_ ONLY with explicit user confirmation (actual updating already needed user confirmation, but this extra step should reduce the chances of us getting wrongly accused of exfiltrating user data if we're run in a sandbox - we ONLY ever included the updating engine's version in the checks, though there's nothing we can do to avoid sending the user's router's IP).
Removed the 'summon satan all over your harddrive' quit message, in case paranoid security researchers are idiots and don't bother doing actual research.
Removed the triptohell.info and fte.triptohell.info certificates, they really need to stop being self-signed. The updates domain is still self-signed for autoupdates.
Video drivers are now able to report supported video resolutions, visible to menuqc. Currently only works with SDL2 builds.
Added setmousepos builtin. Should work with glx+win32 build.
VF_SKYROOM_CAMERA can now accept an extra two args, setviewprop(VF_SKYROOM_CAMERA, org, axis, degrees).
Removed v_skyroom_origin+v_skyroom_orientation cvars in favour just v_skyroom, which should make it behave more like the 'fog' command (used when csqc isn't overriding).
Added R_EndPolygonRibbon builtin to make it faster+easier to generate textured ribbon/cable/etc wide lines (for TW).
sdl: Fix up sys_sdl.c's file enumeration to support wildcards in directories.
edit command now displays end1.bin/end2.bin correctly, because we can.
Finally add support for f_modified - though ruleset_allow_larger_models and ruleset_allow_overlong_sounds generally make it redundant.
Fix threading race condition in sha1 lookups.
Updated f_ruleset to include the same extra flags reported by ezquake.
A mod's default.fmf file can now contain an eg 'mainconfig config.cfg' line (to explicitly set the main config saved with cfg_save_auto 1 etc).
fmf: basegame steam:GameName/GameDir can be used to try to load a mod directory from an installed steam game. The resulting gamedir will be read-only.
HOMEDIR CHANGE: use homedirs only if the basedir cannot be written or a homedir already exists, which should further reduce the probability of microsoft randomly uploading our data to their cloud (but mostly because its annoying to never know where your data is written).
Fixed buf_cvarlist, should work in xonotic now, and without segfaults.
Added an extra arg to URI_Get_Callback calls - the response size, also changed the tempstring to contain all bytes of the response, you need to be careful about nulls though.
Try to work around nvidia's forced-panning bug on x11 when changing video modes. This might screw with other programs.
sdl: support custom icons.
sdl: support choosing a specific display.
Added some documentation to menuqc builtins.
menusys: use outlines for slightly more readable fonts.
menusys: switch vid_width and vid_height combos into a single video mode combo to set both according to reported video modes.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5581 fc73d0e0-1445-4013-8a0c-d673dee63da5
2019-11-20 03:09:50 +00:00
man - > gamepath [ i ] . flags = GAMEDIR_DEFAULTFLAGS ;
if ( ! Q_strcasecmp ( cmd , " basegame " ) )
man - > gamepath [ i ] . flags | = GAMEDIR_BASEGAME ;
2020-04-29 10:43:22 +00:00
if ( * newdir = = ' / ' )
{
newdir + + ;
man - > gamepath [ i ] . flags | = GAMEDIR_QSHACK ;
}
Too many changes, sorry.
Change revision displays, use the SVN commit date instead of using __DATE__ (when there's no local changes). This should allow reproducible builds.
Added s_al_disable cvar, to block openal and all the various problems people have had with it, without having to name an explicit fallback (which would vary by system).
Add mastervolume cvar (for ss).
Add r_shadows 2 (aka fake shadows - for ss).
Add scr_loadingscreen_aspect -1 setting, to disable levelshots entirely, also disables the progress bar (for ss).
Better support for some effectinfo hacks (for ss).
Added dpcompat_nocsqcwarnings (because of lazy+buggy mods like ss).
Rework the dpcsqc versions of project+unproject builtins for better compat (for ss).
Added dpcompat_csqcinputeventtypes to block unexpected csqc input events (for ss).
Better compat with DP's loadfont console command (for ss).
Added dpcompat_smallerfonts cvar to replicate a DP bug (for ss).
Detect dp's m_draw extension, to work around it (for ss).
Cvar dpcompat_ignoremodificationtimes added. A value of 0 favour the most recently modified file, 1 will use DP-like alphabetically sorted preferences (for ss).
loadfont builtin can now accept outline=1 in the sizes arg for slightly more readable fonts.
Fix bbox calcs for rotated entities, fix needed for r_ignorenetpvs 0.
Hackily parse emoji.json to provide :poop: etc suggestions.
Skip prediction entirely when there's no local entity info. This fixes stair-smoothing in xonotic.
screenshot_cubemap will now capture half-float images when saving to ktx or dds files.
Fix support for xcf files larger than 4gb, mostly to avoid compiler warnings.
Fixed size of gfx/loading.lmp when replacement textures are used.
Added mipmap support for rg8 and l8a8 textures.
r_hdr_framebuffer cvar updated to support format names instead of random negative numbers. Description updated to name some interesting ones.
Perform autoupdate _checks_ ONLY with explicit user confirmation (actual updating already needed user confirmation, but this extra step should reduce the chances of us getting wrongly accused of exfiltrating user data if we're run in a sandbox - we ONLY ever included the updating engine's version in the checks, though there's nothing we can do to avoid sending the user's router's IP).
Removed the 'summon satan all over your harddrive' quit message, in case paranoid security researchers are idiots and don't bother doing actual research.
Removed the triptohell.info and fte.triptohell.info certificates, they really need to stop being self-signed. The updates domain is still self-signed for autoupdates.
Video drivers are now able to report supported video resolutions, visible to menuqc. Currently only works with SDL2 builds.
Added setmousepos builtin. Should work with glx+win32 build.
VF_SKYROOM_CAMERA can now accept an extra two args, setviewprop(VF_SKYROOM_CAMERA, org, axis, degrees).
Removed v_skyroom_origin+v_skyroom_orientation cvars in favour just v_skyroom, which should make it behave more like the 'fog' command (used when csqc isn't overriding).
Added R_EndPolygonRibbon builtin to make it faster+easier to generate textured ribbon/cable/etc wide lines (for TW).
sdl: Fix up sys_sdl.c's file enumeration to support wildcards in directories.
edit command now displays end1.bin/end2.bin correctly, because we can.
Finally add support for f_modified - though ruleset_allow_larger_models and ruleset_allow_overlong_sounds generally make it redundant.
Fix threading race condition in sha1 lookups.
Updated f_ruleset to include the same extra flags reported by ezquake.
A mod's default.fmf file can now contain an eg 'mainconfig config.cfg' line (to explicitly set the main config saved with cfg_save_auto 1 etc).
fmf: basegame steam:GameName/GameDir can be used to try to load a mod directory from an installed steam game. The resulting gamedir will be read-only.
HOMEDIR CHANGE: use homedirs only if the basedir cannot be written or a homedir already exists, which should further reduce the probability of microsoft randomly uploading our data to their cloud (but mostly because its annoying to never know where your data is written).
Fixed buf_cvarlist, should work in xonotic now, and without segfaults.
Added an extra arg to URI_Get_Callback calls - the response size, also changed the tempstring to contain all bytes of the response, you need to be careful about nulls though.
Try to work around nvidia's forced-panning bug on x11 when changing video modes. This might screw with other programs.
sdl: support custom icons.
sdl: support choosing a specific display.
Added some documentation to menuqc builtins.
menusys: use outlines for slightly more readable fonts.
menusys: switch vid_width and vid_height combos into a single video mode combo to set both according to reported video modes.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5581 fc73d0e0-1445-4013-8a0c-d673dee63da5
2019-11-20 03:09:50 +00:00
if ( * newdir = = ' * ' )
{ //*dir makes the dir 'private' and not networked.
newdir + + ;
man - > gamepath [ i ] . flags | = GAMEDIR_PRIVATE ;
if ( ! * newdir )
{ //a single asterisk means load packages from the basedir (but not other files). This is for doom compat.
man - > gamepath [ i ] . flags | = GAMEDIR_USEBASEDIR ;
man - > gamepath [ i ] . flags | = GAMEDIR_READONLY ; //must also be readonly, just in case.
man - > gamepath [ i ] . path = Z_StrDup ( newdir ) ;
break ;
}
}
if ( ! strncmp ( newdir , " steam: " , 6 ) )
{ //"steam:Subdir/gamedir"
char * sl = strchr ( newdir + 6 , ' / ' ) ;
if ( ! sl )
break ; //malformed steam link
man - > gamepath [ i ] . flags | = GAMEDIR_STEAMGAME ;
* sl = 0 ;
if ( ! FS_GamedirIsOkay ( sl + 1 ) )
break ;
* sl = ' / ' ;
2013-06-23 02:17:02 +00:00
man - > gamepath [ i ] . path = Z_StrDup ( newdir ) ;
break ;
}
Too many changes, sorry.
Change revision displays, use the SVN commit date instead of using __DATE__ (when there's no local changes). This should allow reproducible builds.
Added s_al_disable cvar, to block openal and all the various problems people have had with it, without having to name an explicit fallback (which would vary by system).
Add mastervolume cvar (for ss).
Add r_shadows 2 (aka fake shadows - for ss).
Add scr_loadingscreen_aspect -1 setting, to disable levelshots entirely, also disables the progress bar (for ss).
Better support for some effectinfo hacks (for ss).
Added dpcompat_nocsqcwarnings (because of lazy+buggy mods like ss).
Rework the dpcsqc versions of project+unproject builtins for better compat (for ss).
Added dpcompat_csqcinputeventtypes to block unexpected csqc input events (for ss).
Better compat with DP's loadfont console command (for ss).
Added dpcompat_smallerfonts cvar to replicate a DP bug (for ss).
Detect dp's m_draw extension, to work around it (for ss).
Cvar dpcompat_ignoremodificationtimes added. A value of 0 favour the most recently modified file, 1 will use DP-like alphabetically sorted preferences (for ss).
loadfont builtin can now accept outline=1 in the sizes arg for slightly more readable fonts.
Fix bbox calcs for rotated entities, fix needed for r_ignorenetpvs 0.
Hackily parse emoji.json to provide :poop: etc suggestions.
Skip prediction entirely when there's no local entity info. This fixes stair-smoothing in xonotic.
screenshot_cubemap will now capture half-float images when saving to ktx or dds files.
Fix support for xcf files larger than 4gb, mostly to avoid compiler warnings.
Fixed size of gfx/loading.lmp when replacement textures are used.
Added mipmap support for rg8 and l8a8 textures.
r_hdr_framebuffer cvar updated to support format names instead of random negative numbers. Description updated to name some interesting ones.
Perform autoupdate _checks_ ONLY with explicit user confirmation (actual updating already needed user confirmation, but this extra step should reduce the chances of us getting wrongly accused of exfiltrating user data if we're run in a sandbox - we ONLY ever included the updating engine's version in the checks, though there's nothing we can do to avoid sending the user's router's IP).
Removed the 'summon satan all over your harddrive' quit message, in case paranoid security researchers are idiots and don't bother doing actual research.
Removed the triptohell.info and fte.triptohell.info certificates, they really need to stop being self-signed. The updates domain is still self-signed for autoupdates.
Video drivers are now able to report supported video resolutions, visible to menuqc. Currently only works with SDL2 builds.
Added setmousepos builtin. Should work with glx+win32 build.
VF_SKYROOM_CAMERA can now accept an extra two args, setviewprop(VF_SKYROOM_CAMERA, org, axis, degrees).
Removed v_skyroom_origin+v_skyroom_orientation cvars in favour just v_skyroom, which should make it behave more like the 'fog' command (used when csqc isn't overriding).
Added R_EndPolygonRibbon builtin to make it faster+easier to generate textured ribbon/cable/etc wide lines (for TW).
sdl: Fix up sys_sdl.c's file enumeration to support wildcards in directories.
edit command now displays end1.bin/end2.bin correctly, because we can.
Finally add support for f_modified - though ruleset_allow_larger_models and ruleset_allow_overlong_sounds generally make it redundant.
Fix threading race condition in sha1 lookups.
Updated f_ruleset to include the same extra flags reported by ezquake.
A mod's default.fmf file can now contain an eg 'mainconfig config.cfg' line (to explicitly set the main config saved with cfg_save_auto 1 etc).
fmf: basegame steam:GameName/GameDir can be used to try to load a mod directory from an installed steam game. The resulting gamedir will be read-only.
HOMEDIR CHANGE: use homedirs only if the basedir cannot be written or a homedir already exists, which should further reduce the probability of microsoft randomly uploading our data to their cloud (but mostly because its annoying to never know where your data is written).
Fixed buf_cvarlist, should work in xonotic now, and without segfaults.
Added an extra arg to URI_Get_Callback calls - the response size, also changed the tempstring to contain all bytes of the response, you need to be careful about nulls though.
Try to work around nvidia's forced-panning bug on x11 when changing video modes. This might screw with other programs.
sdl: support custom icons.
sdl: support choosing a specific display.
Added some documentation to menuqc builtins.
menusys: use outlines for slightly more readable fonts.
menusys: switch vid_width and vid_height combos into a single video mode combo to set both according to reported video modes.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5581 fc73d0e0-1445-4013-8a0c-d673dee63da5
2019-11-20 03:09:50 +00:00
if ( ! FS_GamedirIsOkay ( newdir ) )
break ;
man - > gamepath [ i ] . path = Z_StrDup ( newdir ) ;
break ;
2013-06-23 02:17:02 +00:00
}
Too many changes, sorry.
Change revision displays, use the SVN commit date instead of using __DATE__ (when there's no local changes). This should allow reproducible builds.
Added s_al_disable cvar, to block openal and all the various problems people have had with it, without having to name an explicit fallback (which would vary by system).
Add mastervolume cvar (for ss).
Add r_shadows 2 (aka fake shadows - for ss).
Add scr_loadingscreen_aspect -1 setting, to disable levelshots entirely, also disables the progress bar (for ss).
Better support for some effectinfo hacks (for ss).
Added dpcompat_nocsqcwarnings (because of lazy+buggy mods like ss).
Rework the dpcsqc versions of project+unproject builtins for better compat (for ss).
Added dpcompat_csqcinputeventtypes to block unexpected csqc input events (for ss).
Better compat with DP's loadfont console command (for ss).
Added dpcompat_smallerfonts cvar to replicate a DP bug (for ss).
Detect dp's m_draw extension, to work around it (for ss).
Cvar dpcompat_ignoremodificationtimes added. A value of 0 favour the most recently modified file, 1 will use DP-like alphabetically sorted preferences (for ss).
loadfont builtin can now accept outline=1 in the sizes arg for slightly more readable fonts.
Fix bbox calcs for rotated entities, fix needed for r_ignorenetpvs 0.
Hackily parse emoji.json to provide :poop: etc suggestions.
Skip prediction entirely when there's no local entity info. This fixes stair-smoothing in xonotic.
screenshot_cubemap will now capture half-float images when saving to ktx or dds files.
Fix support for xcf files larger than 4gb, mostly to avoid compiler warnings.
Fixed size of gfx/loading.lmp when replacement textures are used.
Added mipmap support for rg8 and l8a8 textures.
r_hdr_framebuffer cvar updated to support format names instead of random negative numbers. Description updated to name some interesting ones.
Perform autoupdate _checks_ ONLY with explicit user confirmation (actual updating already needed user confirmation, but this extra step should reduce the chances of us getting wrongly accused of exfiltrating user data if we're run in a sandbox - we ONLY ever included the updating engine's version in the checks, though there's nothing we can do to avoid sending the user's router's IP).
Removed the 'summon satan all over your harddrive' quit message, in case paranoid security researchers are idiots and don't bother doing actual research.
Removed the triptohell.info and fte.triptohell.info certificates, they really need to stop being self-signed. The updates domain is still self-signed for autoupdates.
Video drivers are now able to report supported video resolutions, visible to menuqc. Currently only works with SDL2 builds.
Added setmousepos builtin. Should work with glx+win32 build.
VF_SKYROOM_CAMERA can now accept an extra two args, setviewprop(VF_SKYROOM_CAMERA, org, axis, degrees).
Removed v_skyroom_origin+v_skyroom_orientation cvars in favour just v_skyroom, which should make it behave more like the 'fog' command (used when csqc isn't overriding).
Added R_EndPolygonRibbon builtin to make it faster+easier to generate textured ribbon/cable/etc wide lines (for TW).
sdl: Fix up sys_sdl.c's file enumeration to support wildcards in directories.
edit command now displays end1.bin/end2.bin correctly, because we can.
Finally add support for f_modified - though ruleset_allow_larger_models and ruleset_allow_overlong_sounds generally make it redundant.
Fix threading race condition in sha1 lookups.
Updated f_ruleset to include the same extra flags reported by ezquake.
A mod's default.fmf file can now contain an eg 'mainconfig config.cfg' line (to explicitly set the main config saved with cfg_save_auto 1 etc).
fmf: basegame steam:GameName/GameDir can be used to try to load a mod directory from an installed steam game. The resulting gamedir will be read-only.
HOMEDIR CHANGE: use homedirs only if the basedir cannot be written or a homedir already exists, which should further reduce the probability of microsoft randomly uploading our data to their cloud (but mostly because its annoying to never know where your data is written).
Fixed buf_cvarlist, should work in xonotic now, and without segfaults.
Added an extra arg to URI_Get_Callback calls - the response size, also changed the tempstring to contain all bytes of the response, you need to be careful about nulls though.
Try to work around nvidia's forced-panning bug on x11 when changing video modes. This might screw with other programs.
sdl: support custom icons.
sdl: support choosing a specific display.
Added some documentation to menuqc builtins.
menusys: use outlines for slightly more readable fonts.
menusys: switch vid_width and vid_height combos into a single video mode combo to set both according to reported video modes.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5581 fc73d0e0-1445-4013-8a0c-d673dee63da5
2019-11-20 03:09:50 +00:00
}
if ( i = = sizeof ( man - > gamepath ) / sizeof ( man - > gamepath [ 0 ] ) )
{
Con_Printf ( " Too many game paths specified in manifest \n " ) ;
2013-06-23 02:17:02 +00:00
}
}
2017-11-15 12:38:20 +00:00
//FIXME: these should generate package-manager entries.
2019-04-16 22:40:05 +00:00
# ifdef HAVE_LEGACY
2015-04-14 23:12:17 +00:00
else if ( ! Q_strcasecmp ( cmd , " filedependancies " ) | | ! Q_strcasecmp ( cmd , " archiveddependancies " ) )
2015-09-07 14:34:39 +00:00
FS_Manifest_ParsePackage ( man , mdt_installation ) ;
else if ( ! Q_strcasecmp ( cmd , " archivedpackage " ) )
FS_Manifest_ParsePackage ( man , mdt_singlepackage ) ;
2015-04-14 23:12:17 +00:00
# endif
2015-09-07 14:34:39 +00:00
else if ( ! Q_strcasecmp ( cmd , " library " ) )
FS_Manifest_ParsePackage ( man , mdt_installation ) ;
2015-04-14 23:12:17 +00:00
else if ( ! Q_strcasecmp ( cmd , " package " ) | | ! Q_strcasecmp ( cmd , " archivedpackage " ) )
2015-09-07 14:34:39 +00:00
FS_Manifest_ParsePackage ( man , mdt_singlepackage ) ;
2018-10-14 16:16:34 +00:00
else if ( ! Q_strcasecmp ( cmd , " basedir " ) )
2020-04-19 01:23:32 +00:00
{ //allow explicit basedirs when this is an actual file on the user's system, and we don't have an explicit one.
2023-04-21 11:36:13 +00:00
//this should only happen from parsing /etc/xdg/games/*.fmf
2020-04-19 01:23:32 +00:00
if ( ! man - > basedir & & man - > filename )
man - > basedir = Z_StrDup ( Cmd_Argv ( 1 ) ) ;
}
2014-03-30 08:55:06 +00:00
else
2015-04-14 23:12:17 +00:00
{
2015-09-07 14:34:39 +00:00
Con_Printf ( " Unknown token: %s \n " , cmd ) ;
2014-03-30 08:55:06 +00:00
result = false ;
2015-04-14 23:12:17 +00:00
}
2014-03-30 08:55:06 +00:00
return result ;
2013-06-23 02:17:02 +00:00
}
2023-04-21 11:36:13 +00:00
//if the manifest omits some expected stuff, give it some defaults to match known game names (so fmf files can defer to the engine instead of having to be maintained separately).
static void FS_Manifest_SetDefaultSettings ( ftemanifest_t * man , const gamemode_info_t * game )
{
int j ;
if ( game )
{
//if there's no base dirs, edit the manifest to give it its default ones.
for ( j = 0 ; j < sizeof ( man - > gamepath ) / sizeof ( man - > gamepath [ 0 ] ) ; j + + )
{
if ( man - > gamepath [ j ] . path & & ( man - > gamepath [ j ] . flags & GAMEDIR_BASEGAME ) )
break ;
}
if ( j = = sizeof ( man - > gamepath ) / sizeof ( man - > gamepath [ 0 ] ) )
{
for ( j = 0 ; j < 4 ; j + + )
if ( game - > dir [ j ] )
{
Cmd_TokenizeString ( va ( " basegame \" %s \" " , game - > dir [ j ] ) , false , false ) ;
FS_Manifest_ParseTokens ( man ) ;
}
}
if ( ! man - > schemes )
{
Cmd_TokenizeString ( va ( " schemes \" %s \" " , game - > argname + 1 ) , false , false ) ;
FS_Manifest_ParseTokens ( man ) ;
}
# ifdef PACKAGEMANAGER
if ( ! man - > downloadsurl & & game - > downloadsurl )
{
# ifndef FTE_TARGET_WEB
if ( * game - > downloadsurl = = ' / ' )
{
conchar_t musite [ 256 ] , * e ;
char site [ 256 ] ;
char * oldprefix = " http://fte. " ;
char * newprefix = " https://updates. " ;
e = COM_ParseFunString ( CON_WHITEMASK , ENGINEWEBSITE , musite , sizeof ( musite ) , false ) ;
COM_DeFunString ( musite , e , site , sizeof ( site ) - 1 , true , true ) ;
if ( ! strncmp ( site , oldprefix , strlen ( oldprefix ) ) )
{
memmove ( site + strlen ( newprefix ) , site + strlen ( oldprefix ) , strlen ( site ) - strlen ( oldprefix ) + 1 ) ;
memcpy ( site , newprefix , strlen ( newprefix ) ) ;
}
man - > downloadsurl = Z_StrDupf ( " %s%s " , site , game - > downloadsurl ) ;
}
else
# endif
man - > downloadsurl = Z_StrDup ( game - > downloadsurl ) ;
FS_Manifest_ParseTokens ( man ) ;
}
if ( ! man - > installupd & & game - > needpackages )
man - > installupd = Z_StrDup ( game - > needpackages ) ;
# endif
if ( ! man - > protocolname )
man - > protocolname = Z_StrDup ( game - > protocolname ) ;
if ( ! man - > defaultexec & & game - > customexec )
{
const char * e = game - > customexec ;
while ( e [ 0 ] = = ' / ' & & e [ 1 ] = = ' / ' )
{
e + = 2 ;
while ( * e )
{
if ( * e + + = = ' \n ' )
break ;
}
}
man - > defaultexec = Z_StrDup ( e ) ;
}
if ( ! man - > formalname )
man - > formalname = Z_StrDup ( game - > poshname ) ;
}
if ( ! man - > formalname & & man - > installation & & * man - > installation )
man - > formalname = Z_StrDup ( man - > installation ) ;
else if ( ! man - > formalname )
man - > formalname = Z_StrDup ( FULLENGINENAME ) ;
}
2013-06-23 02:17:02 +00:00
//read a manifest file
2020-04-19 01:23:32 +00:00
ftemanifest_t * FS_Manifest_ReadMem ( const char * fname , const char * basedir , const char * data )
2013-06-23 02:17:02 +00:00
{
2023-08-13 01:33:52 +00:00
int ver ;
2023-04-21 11:36:13 +00:00
int i ;
2013-06-23 02:17:02 +00:00
ftemanifest_t * man ;
if ( ! data )
return NULL ;
while ( * data = = ' ' | | * data = = ' \t ' | | * data = = ' \r ' | | * data = = ' \n ' )
data + + ;
if ( ! * data )
return NULL ;
2005-08-26 22:52:26 +00:00
2020-04-19 01:23:32 +00:00
man = FS_Manifest_Create ( fname , basedir ) ;
2013-06-23 02:17:02 +00:00
while ( data & & * data )
{
2020-04-19 01:23:32 +00:00
data = Cmd_TokenizeString ( data , false , false ) ;
2015-04-14 23:12:17 +00:00
if ( ! FS_Manifest_ParseTokens ( man ) & & man - > parsever < = 1 )
{
2014-03-30 08:55:06 +00:00
FS_Manifest_Free ( man ) ;
return NULL ;
}
2013-06-23 02:17:02 +00:00
}
2013-08-06 02:19:06 +00:00
if ( ! man - > installation )
2014-03-30 08:55:06 +00:00
{ //every manifest should have an internal name specified, so we can guess the correct basedir
2013-08-06 02:19:06 +00:00
//if we don't recognise it, then we'll typically prompt (or just use the working directory), but always assuming a default at least ensures things are sane.
//fixme: we should probably fill in the basegame here (and share that logic with the legacy manifest generation code)
2014-10-05 20:04:11 +00:00
# ifdef BRANDING_NAME
data = Cmd_TokenizeString ( ( char * ) " game " STRINGIFY ( BRANDING_NAME ) , false , false ) ;
# else
2013-08-06 02:19:06 +00:00
data = Cmd_TokenizeString ( ( char * ) " game quake " , false , false ) ;
2014-10-05 20:04:11 +00:00
# endif
2013-08-06 02:19:06 +00:00
FS_Manifest_ParseTokens ( man ) ;
}
2023-04-21 11:36:13 +00:00
if ( man - > installation )
{ //if we know about it, fill in some defaults...
for ( i = 0 ; gamemode_info [ i ] . argname ; i + + )
{
if ( ! strcmp ( man - > installation , gamemode_info [ i ] . argname + 1 ) )
{
FS_Manifest_SetDefaultSettings ( man , & gamemode_info [ i ] ) ;
break ;
}
}
}
2014-03-30 08:55:06 +00:00
//svnrevision is often '-', which means we can't just use it as a constant.
2023-08-13 01:33:52 +00:00
ver = revision_number ( false ) ;
if ( ver & & ( man - > minver > ver | | ( man - > maxver & & man - > maxver < ver ) ) )
2014-03-30 08:55:06 +00:00
{
2023-08-13 01:33:52 +00:00
FS_Manifest_Free ( man ) ;
return NULL ;
2014-03-30 08:55:06 +00:00
}
2013-06-23 02:17:02 +00:00
return man ;
}
2005-08-26 22:52:26 +00:00
2020-04-19 01:23:32 +00:00
ftemanifest_t * FS_Manifest_ReadSystem ( const char * fname , const char * basedir )
{
ftemanifest_t * man = NULL ;
vfsfile_t * f ;
f = VFSOS_Open ( fname , " rb " ) ;
if ( f )
{
size_t len = VFS_GETLEN ( f ) ;
char * fdata = BZ_Malloc ( len + 1 ) ;
if ( fdata )
{
VFS_READ ( f , fdata , len ) ;
fdata [ len ] = 0 ;
man = FS_Manifest_ReadMem ( fname , basedir , fdata ) ;
if ( man )
man - > security = MANIFEST_SECURITY_DEFAULT ;
BZ_Free ( fdata ) ;
}
VFS_CLOSE ( f ) ;
}
return man ;
}
//reads eg $homedir/$moddir.fmf or $basedir/$moddir.fmf as appropriate.
ftemanifest_t * FS_Manifest_ReadMod ( const char * moddir )
{
ftemanifest_t * man = NULL ;
char path [ MAX_OSPATH ] ;
if ( * moddir )
{
//check the homedir, which is a little messy when manifests might disallow themselves...
if ( ! man & & com_homepathusable )
{
Q_snprintfz ( path , sizeof ( path ) , " %s%s " , com_homepath , moddir ) ;
COM_RequireExtension ( path , " .fmf " , sizeof ( path ) ) ;
man = FS_Manifest_ReadSystem ( path , com_gamepath ) ;
if ( man & & man - > homedirtype = = MANIFEST_NOHOMEDIR )
{
FS_Manifest_Free ( man ) ; //manifest doesn't like itself... pretend to not find it.
man = NULL ;
}
}
if ( ! man )
{
Q_snprintfz ( path , sizeof ( path ) , " %s%s " , com_gamepath , moddir ) ;
COM_RequireExtension ( path , " .fmf " , sizeof ( path ) ) ;
man = FS_Manifest_ReadSystem ( path , com_gamepath ) ;
}
}
return man ;
}
2013-06-23 02:17:02 +00:00
//======================================================================================================
2005-08-26 22:52:26 +00:00
2021-04-14 05:21:04 +00:00
static char * fs_loadedcommand ; //execed once all packages are (down)loaded
2015-04-14 23:12:17 +00:00
ftemanifest_t * fs_manifest ; //currently active manifest.
2013-06-23 02:17:02 +00:00
static searchpath_t * com_searchpaths ;
static searchpath_t * com_purepaths ;
static searchpath_t * com_base_searchpaths ; // without gamedirs
static int fs_puremode ; //0=deprioritise pure, 1=prioritise pure, 2=pure only.
2014-06-12 23:08:42 +00:00
static char * fs_refnames ; //list of allowed packages
static char * fs_refcrcs ; //list of crcs for those packages. one token per package.
2013-06-23 02:17:02 +00:00
static char * fs_purenames ; //list of allowed packages
static char * fs_purecrcs ; //list of crcs for those packages. one token per package.
static unsigned int fs_pureseed ; //used as a key so the server knows we're obeying. completely unreliable/redundant in an open source project, but needed for q3 network compat.
2005-08-26 22:52:26 +00:00
Added sys_openfile console command(and menu option) to web and flatpak(via cmake+dbus) builds, to 'install' packages on sandboxed systems a bit more easily.
Cmake: Add FTE_WERROR option, defaults to true in debug builds and off in release builds (in case future compilers have issues).
Cmake: Pull in libXscreensaver so we don't get interrupted by screensavers when playing demos.
Make: Added `make webcl-rel` for a web build without server bloat (eg for sites focused on demo playback. Yes, this means you XantoM).
fteqcc: Include the decompiler in fteqcc (non-gui) builds ('-d' arg).
fteqcc: Decompiler can now mostly handle hexen2 mods without any unknown opcodes.
Allow ezHud and OpenSSL to be compiled as in-engine plugins, potentially for web and windows ports respectively.
Web: Fix support for ogg vorbis. Add support for voip.
Web: Added basic support for WebXR.
QTV: Don't try seeking on unseekable qtv streams. Don't spam when developer 1 is set.
QTV: add support for some eztv extensions.
MVD: added hack to use ktx's vweps in mvd where mvdsv doesn't bother to record the info.
qwfwd: hack around a hack in qwfwd, allowing it to work again.
recording: favour qwd in single player, instead of mvd.
Protocol: reduce client memory used for precache names. Bump maximum precache counts - some people are just abusive, yes you Orl.
hexen2: add enough clientside protocol compat to play the demo included with h2mp. lacks effects.
in_xflip: restored this setting.
fs_hidesyspaths: new cvar, defaults to enabled so you won't find your username or whatever turning up in screenshots or the like. change it to 0 before debuging stuff eg via 'path'.
gl_overbright_models: Added cvar to match QS.
netchan: Added MTU determination, we'll no longer fail to connect when routers stupidly drop icmp packets.
Win: try a few other versions of xinput too.
CSQC: Added a CSQC_GenerateMaterial function, to give the csqc a chance to generate custom materials.
MenuQC: Added support for the skeletal objects API.
2024-04-09 17:13:59 +00:00
char * FS_AbbreviateSize ( char * buf , size_t bufsize , qofs_t fsize )
{
//caps mean kibi instead of kilo, and bytes not bits.
if ( fsize > 512.0 * 1024 * 1024 * 1024 )
Q_snprintfz ( buf , bufsize , " %gTB " , fsize / ( 1024.0 * 1024 * 1024 * 1024 ) ) ;
else if ( fsize > 512.0 * 1024 * 1024 )
Q_snprintfz ( buf , bufsize , " %gGB " , fsize / ( 1024.0 * 1024 * 1024 ) ) ;
else if ( fsize > 512.0 * 1024 )
Q_snprintfz ( buf , bufsize , " %gMB " , fsize / ( 1024.0 * 1024 ) ) ;
else if ( fsize > 512.0 )
Q_snprintfz ( buf , bufsize , " %gKB " , fsize / 1024.0 ) ;
else
Q_snprintfz ( buf , bufsize , " % " PRIuQOFS " B " , fsize ) ;
return buf ;
}
------------------------------------------------------------------------
r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines
removed MAX_VISEDICTS limit.
PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default.
TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW.
added android multitouch emulation for windows/rawinput (in_simulatemultitouch).
split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature.
now using utf-8 for windows consoles.
qcc warnings/errors now give clickable console links for quick+easy editing.
disabled menutint when the currently active item changes contrast or gamma (for OneManClan).
Added support for drawfont/drawfontscale.
tweaked the qcvm a little to reduce the number of pointers.
.doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up.
windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings.
fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen.
editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts.
Added support for .framegroups files for psk(psa) and iqm formats.
True support for ezquake's colour codes. Mutually exclusive with background colours.
path command output slightly more readable.
added support for digest_hex (MD4, SHA1, CRC16).
skingroups now colourmap correctly.
Fix terrain colour hints, and litdata from the wrong bsp.
fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported).
remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother.
fix v *= v.x and similar opcodes.
fteqcc: fixed support for áéÃóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported.
fteqcc: fixed '#if 1 == 3 && 4' parsing.
fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable.
fteqcc: copyright message now includes compile date instead.
fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile.
fteqccgui: the output window is now focused and scrolls down as compilation progresses.
pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue.
rewrote prespawn/modelist/soundlist code. server tracks progress now.
------------------------------------------------------------------------
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
2013-03-12 22:29:40 +00:00
int QDECL COM_FileSize ( const char * path )
2005-08-26 22:52:26 +00:00
{
2005-12-21 03:07:33 +00:00
flocation_t loc ;
2015-10-11 11:34:58 +00:00
if ( FS_FLocateFile ( path , FSLF_IFFOUND , & loc ) )
return loc . len ;
else
return - 1 ;
2005-08-26 22:52:26 +00:00
}
2013-06-23 02:17:02 +00:00
//appends a / on the end of the directory if it does not already have one.
2018-10-11 10:31:23 +00:00
static void FS_CleanDir ( char * out , int outlen )
2013-06-23 02:17:02 +00:00
{
int olen = strlen ( out ) ;
if ( ! olen | | olen > = outlen - 1 )
return ;
if ( out [ olen - 1 ] = = ' \\ ' )
out [ olen - 1 ] = ' / ' ;
else if ( out [ olen - 1 ] ! = ' / ' )
{
out [ olen + 1 ] = ' \0 ' ;
out [ olen ] = ' / ' ;
}
}
2005-08-26 22:52:26 +00:00
/*
= = = = = = = = = = = =
COM_Path_f
= = = = = = = = = = = =
*/
2013-12-17 22:45:37 +00:00
static void COM_PathLine ( searchpath_t * s )
{
Added sys_openfile console command(and menu option) to web and flatpak(via cmake+dbus) builds, to 'install' packages on sandboxed systems a bit more easily.
Cmake: Add FTE_WERROR option, defaults to true in debug builds and off in release builds (in case future compilers have issues).
Cmake: Pull in libXscreensaver so we don't get interrupted by screensavers when playing demos.
Make: Added `make webcl-rel` for a web build without server bloat (eg for sites focused on demo playback. Yes, this means you XantoM).
fteqcc: Include the decompiler in fteqcc (non-gui) builds ('-d' arg).
fteqcc: Decompiler can now mostly handle hexen2 mods without any unknown opcodes.
Allow ezHud and OpenSSL to be compiled as in-engine plugins, potentially for web and windows ports respectively.
Web: Fix support for ogg vorbis. Add support for voip.
Web: Added basic support for WebXR.
QTV: Don't try seeking on unseekable qtv streams. Don't spam when developer 1 is set.
QTV: add support for some eztv extensions.
MVD: added hack to use ktx's vweps in mvd where mvdsv doesn't bother to record the info.
qwfwd: hack around a hack in qwfwd, allowing it to work again.
recording: favour qwd in single player, instead of mvd.
Protocol: reduce client memory used for precache names. Bump maximum precache counts - some people are just abusive, yes you Orl.
hexen2: add enough clientside protocol compat to play the demo included with h2mp. lacks effects.
in_xflip: restored this setting.
fs_hidesyspaths: new cvar, defaults to enabled so you won't find your username or whatever turning up in screenshots or the like. change it to 0 before debuging stuff eg via 'path'.
gl_overbright_models: Added cvar to match QS.
netchan: Added MTU determination, we'll no longer fail to connect when routers stupidly drop icmp packets.
Win: try a few other versions of xinput too.
CSQC: Added a CSQC_GenerateMaterial function, to give the csqc a chance to generate custom materials.
MenuQC: Added support for the skeletal objects API.
2024-04-09 17:13:59 +00:00
char displaypath [ MAX_OSPATH ] ;
2022-03-01 02:51:55 +00:00
char * col = " " ;
if ( s - > flags & SPF_ISDIR )
col = S_COLOR_GREEN ;
else if ( s - > flags & SPF_COPYPROTECTED )
col = S_COLOR_BLUE ;
else
col = S_COLOR_CYAN ;
Added sys_openfile console command(and menu option) to web and flatpak(via cmake+dbus) builds, to 'install' packages on sandboxed systems a bit more easily.
Cmake: Add FTE_WERROR option, defaults to true in debug builds and off in release builds (in case future compilers have issues).
Cmake: Pull in libXscreensaver so we don't get interrupted by screensavers when playing demos.
Make: Added `make webcl-rel` for a web build without server bloat (eg for sites focused on demo playback. Yes, this means you XantoM).
fteqcc: Include the decompiler in fteqcc (non-gui) builds ('-d' arg).
fteqcc: Decompiler can now mostly handle hexen2 mods without any unknown opcodes.
Allow ezHud and OpenSSL to be compiled as in-engine plugins, potentially for web and windows ports respectively.
Web: Fix support for ogg vorbis. Add support for voip.
Web: Added basic support for WebXR.
QTV: Don't try seeking on unseekable qtv streams. Don't spam when developer 1 is set.
QTV: add support for some eztv extensions.
MVD: added hack to use ktx's vweps in mvd where mvdsv doesn't bother to record the info.
qwfwd: hack around a hack in qwfwd, allowing it to work again.
recording: favour qwd in single player, instead of mvd.
Protocol: reduce client memory used for precache names. Bump maximum precache counts - some people are just abusive, yes you Orl.
hexen2: add enough clientside protocol compat to play the demo included with h2mp. lacks effects.
in_xflip: restored this setting.
fs_hidesyspaths: new cvar, defaults to enabled so you won't find your username or whatever turning up in screenshots or the like. change it to 0 before debuging stuff eg via 'path'.
gl_overbright_models: Added cvar to match QS.
netchan: Added MTU determination, we'll no longer fail to connect when routers stupidly drop icmp packets.
Win: try a few other versions of xinput too.
CSQC: Added a CSQC_GenerateMaterial function, to give the csqc a chance to generate custom materials.
MenuQC: Added support for the skeletal objects API.
2024-04-09 17:13:59 +00:00
FS_DisplayPath ( s - > logicalpath , FS_SYSTEM , displaypath , sizeof ( displaypath ) ) ;
Con_Printf ( " %s " U8 ( " %s " ) " %s%s%s%s%s%s%s%s \n " , col , displaypath ,
2013-12-17 22:45:37 +00:00
( s - > flags & SPF_REFERENCED ) ? " ^[(ref) \\ tip \\ Referenced \\ desc \\ Package will auto-download to clients^] " : " " ,
( s - > flags & SPF_TEMPORARY ) ? " ^[(temp) \\ tip \\ Temporary \\ desc \\ Flushed on map change^] " : " " ,
2022-03-01 02:51:55 +00:00
( s - > flags & SPF_SERVER ) ? " ^[(srv) \\ tip \\ Server-Specified \\ desc \\ Loaded to match the server, closed on disconnect^] " : " " ,
2013-12-17 22:45:37 +00:00
( s - > flags & SPF_COPYPROTECTED ) ? " ^[(c) \\ tip \\ Copyrighted \\ desc \\ Copy-Protected and is not downloadable^] " : " " ,
( s - > flags & SPF_EXPLICIT ) ? " ^[(e) \\ tip \\ Explicit \\ desc \\ Loaded explicitly by the gamedir^] " : " " ,
2015-04-27 06:19:33 +00:00
( s - > flags & SPF_UNTRUSTED ) ? " ^[(u) \\ tip \\ Untrusted \\ desc \\ Configs and scripts will not be given access to passwords^] " : " " ,
2016-08-25 00:12:14 +00:00
( s - > flags & SPF_WRITABLE ) ? " ^[(w) \\ tip \\ Writable \\ desc \\ We can probably write here^] " : " " ,
Added sys_openfile console command(and menu option) to web and flatpak(via cmake+dbus) builds, to 'install' packages on sandboxed systems a bit more easily.
Cmake: Add FTE_WERROR option, defaults to true in debug builds and off in release builds (in case future compilers have issues).
Cmake: Pull in libXscreensaver so we don't get interrupted by screensavers when playing demos.
Make: Added `make webcl-rel` for a web build without server bloat (eg for sites focused on demo playback. Yes, this means you XantoM).
fteqcc: Include the decompiler in fteqcc (non-gui) builds ('-d' arg).
fteqcc: Decompiler can now mostly handle hexen2 mods without any unknown opcodes.
Allow ezHud and OpenSSL to be compiled as in-engine plugins, potentially for web and windows ports respectively.
Web: Fix support for ogg vorbis. Add support for voip.
Web: Added basic support for WebXR.
QTV: Don't try seeking on unseekable qtv streams. Don't spam when developer 1 is set.
QTV: add support for some eztv extensions.
MVD: added hack to use ktx's vweps in mvd where mvdsv doesn't bother to record the info.
qwfwd: hack around a hack in qwfwd, allowing it to work again.
recording: favour qwd in single player, instead of mvd.
Protocol: reduce client memory used for precache names. Bump maximum precache counts - some people are just abusive, yes you Orl.
hexen2: add enough clientside protocol compat to play the demo included with h2mp. lacks effects.
in_xflip: restored this setting.
fs_hidesyspaths: new cvar, defaults to enabled so you won't find your username or whatever turning up in screenshots or the like. change it to 0 before debuging stuff eg via 'path'.
gl_overbright_models: Added cvar to match QS.
netchan: Added MTU determination, we'll no longer fail to connect when routers stupidly drop icmp packets.
Win: try a few other versions of xinput too.
CSQC: Added a CSQC_GenerateMaterial function, to give the csqc a chance to generate custom materials.
MenuQC: Added support for the skeletal objects API.
2024-04-09 17:13:59 +00:00
( s - > handle - > GeneratePureCRC ) ? va ( " ^[(h) \\ tip \\ Hash: %x^] " , s - > crc_check ) : " " ) ;
2013-12-17 22:45:37 +00:00
}
Too many changes, sorry.
Change revision displays, use the SVN commit date instead of using __DATE__ (when there's no local changes). This should allow reproducible builds.
Added s_al_disable cvar, to block openal and all the various problems people have had with it, without having to name an explicit fallback (which would vary by system).
Add mastervolume cvar (for ss).
Add r_shadows 2 (aka fake shadows - for ss).
Add scr_loadingscreen_aspect -1 setting, to disable levelshots entirely, also disables the progress bar (for ss).
Better support for some effectinfo hacks (for ss).
Added dpcompat_nocsqcwarnings (because of lazy+buggy mods like ss).
Rework the dpcsqc versions of project+unproject builtins for better compat (for ss).
Added dpcompat_csqcinputeventtypes to block unexpected csqc input events (for ss).
Better compat with DP's loadfont console command (for ss).
Added dpcompat_smallerfonts cvar to replicate a DP bug (for ss).
Detect dp's m_draw extension, to work around it (for ss).
Cvar dpcompat_ignoremodificationtimes added. A value of 0 favour the most recently modified file, 1 will use DP-like alphabetically sorted preferences (for ss).
loadfont builtin can now accept outline=1 in the sizes arg for slightly more readable fonts.
Fix bbox calcs for rotated entities, fix needed for r_ignorenetpvs 0.
Hackily parse emoji.json to provide :poop: etc suggestions.
Skip prediction entirely when there's no local entity info. This fixes stair-smoothing in xonotic.
screenshot_cubemap will now capture half-float images when saving to ktx or dds files.
Fix support for xcf files larger than 4gb, mostly to avoid compiler warnings.
Fixed size of gfx/loading.lmp when replacement textures are used.
Added mipmap support for rg8 and l8a8 textures.
r_hdr_framebuffer cvar updated to support format names instead of random negative numbers. Description updated to name some interesting ones.
Perform autoupdate _checks_ ONLY with explicit user confirmation (actual updating already needed user confirmation, but this extra step should reduce the chances of us getting wrongly accused of exfiltrating user data if we're run in a sandbox - we ONLY ever included the updating engine's version in the checks, though there's nothing we can do to avoid sending the user's router's IP).
Removed the 'summon satan all over your harddrive' quit message, in case paranoid security researchers are idiots and don't bother doing actual research.
Removed the triptohell.info and fte.triptohell.info certificates, they really need to stop being self-signed. The updates domain is still self-signed for autoupdates.
Video drivers are now able to report supported video resolutions, visible to menuqc. Currently only works with SDL2 builds.
Added setmousepos builtin. Should work with glx+win32 build.
VF_SKYROOM_CAMERA can now accept an extra two args, setviewprop(VF_SKYROOM_CAMERA, org, axis, degrees).
Removed v_skyroom_origin+v_skyroom_orientation cvars in favour just v_skyroom, which should make it behave more like the 'fog' command (used when csqc isn't overriding).
Added R_EndPolygonRibbon builtin to make it faster+easier to generate textured ribbon/cable/etc wide lines (for TW).
sdl: Fix up sys_sdl.c's file enumeration to support wildcards in directories.
edit command now displays end1.bin/end2.bin correctly, because we can.
Finally add support for f_modified - though ruleset_allow_larger_models and ruleset_allow_overlong_sounds generally make it redundant.
Fix threading race condition in sha1 lookups.
Updated f_ruleset to include the same extra flags reported by ezquake.
A mod's default.fmf file can now contain an eg 'mainconfig config.cfg' line (to explicitly set the main config saved with cfg_save_auto 1 etc).
fmf: basegame steam:GameName/GameDir can be used to try to load a mod directory from an installed steam game. The resulting gamedir will be read-only.
HOMEDIR CHANGE: use homedirs only if the basedir cannot be written or a homedir already exists, which should further reduce the probability of microsoft randomly uploading our data to their cloud (but mostly because its annoying to never know where your data is written).
Fixed buf_cvarlist, should work in xonotic now, and without segfaults.
Added an extra arg to URI_Get_Callback calls - the response size, also changed the tempstring to contain all bytes of the response, you need to be careful about nulls though.
Try to work around nvidia's forced-panning bug on x11 when changing video modes. This might screw with other programs.
sdl: support custom icons.
sdl: support choosing a specific display.
Added some documentation to menuqc builtins.
menusys: use outlines for slightly more readable fonts.
menusys: switch vid_width and vid_height combos into a single video mode combo to set both according to reported video modes.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5581 fc73d0e0-1445-4013-8a0c-d673dee63da5
2019-11-20 03:09:50 +00:00
qboolean FS_GameIsInitialised ( void )
{
if ( ! com_searchpaths & & ! com_purepaths )
return false ;
return true ;
}
2018-10-11 10:31:23 +00:00
static void COM_Path_f ( void )
2005-08-26 22:52:26 +00:00
{
searchpath_t * s ;
2005-11-21 21:09:11 +00:00
Too many changes, sorry.
Change revision displays, use the SVN commit date instead of using __DATE__ (when there's no local changes). This should allow reproducible builds.
Added s_al_disable cvar, to block openal and all the various problems people have had with it, without having to name an explicit fallback (which would vary by system).
Add mastervolume cvar (for ss).
Add r_shadows 2 (aka fake shadows - for ss).
Add scr_loadingscreen_aspect -1 setting, to disable levelshots entirely, also disables the progress bar (for ss).
Better support for some effectinfo hacks (for ss).
Added dpcompat_nocsqcwarnings (because of lazy+buggy mods like ss).
Rework the dpcsqc versions of project+unproject builtins for better compat (for ss).
Added dpcompat_csqcinputeventtypes to block unexpected csqc input events (for ss).
Better compat with DP's loadfont console command (for ss).
Added dpcompat_smallerfonts cvar to replicate a DP bug (for ss).
Detect dp's m_draw extension, to work around it (for ss).
Cvar dpcompat_ignoremodificationtimes added. A value of 0 favour the most recently modified file, 1 will use DP-like alphabetically sorted preferences (for ss).
loadfont builtin can now accept outline=1 in the sizes arg for slightly more readable fonts.
Fix bbox calcs for rotated entities, fix needed for r_ignorenetpvs 0.
Hackily parse emoji.json to provide :poop: etc suggestions.
Skip prediction entirely when there's no local entity info. This fixes stair-smoothing in xonotic.
screenshot_cubemap will now capture half-float images when saving to ktx or dds files.
Fix support for xcf files larger than 4gb, mostly to avoid compiler warnings.
Fixed size of gfx/loading.lmp when replacement textures are used.
Added mipmap support for rg8 and l8a8 textures.
r_hdr_framebuffer cvar updated to support format names instead of random negative numbers. Description updated to name some interesting ones.
Perform autoupdate _checks_ ONLY with explicit user confirmation (actual updating already needed user confirmation, but this extra step should reduce the chances of us getting wrongly accused of exfiltrating user data if we're run in a sandbox - we ONLY ever included the updating engine's version in the checks, though there's nothing we can do to avoid sending the user's router's IP).
Removed the 'summon satan all over your harddrive' quit message, in case paranoid security researchers are idiots and don't bother doing actual research.
Removed the triptohell.info and fte.triptohell.info certificates, they really need to stop being self-signed. The updates domain is still self-signed for autoupdates.
Video drivers are now able to report supported video resolutions, visible to menuqc. Currently only works with SDL2 builds.
Added setmousepos builtin. Should work with glx+win32 build.
VF_SKYROOM_CAMERA can now accept an extra two args, setviewprop(VF_SKYROOM_CAMERA, org, axis, degrees).
Removed v_skyroom_origin+v_skyroom_orientation cvars in favour just v_skyroom, which should make it behave more like the 'fog' command (used when csqc isn't overriding).
Added R_EndPolygonRibbon builtin to make it faster+easier to generate textured ribbon/cable/etc wide lines (for TW).
sdl: Fix up sys_sdl.c's file enumeration to support wildcards in directories.
edit command now displays end1.bin/end2.bin correctly, because we can.
Finally add support for f_modified - though ruleset_allow_larger_models and ruleset_allow_overlong_sounds generally make it redundant.
Fix threading race condition in sha1 lookups.
Updated f_ruleset to include the same extra flags reported by ezquake.
A mod's default.fmf file can now contain an eg 'mainconfig config.cfg' line (to explicitly set the main config saved with cfg_save_auto 1 etc).
fmf: basegame steam:GameName/GameDir can be used to try to load a mod directory from an installed steam game. The resulting gamedir will be read-only.
HOMEDIR CHANGE: use homedirs only if the basedir cannot be written or a homedir already exists, which should further reduce the probability of microsoft randomly uploading our data to their cloud (but mostly because its annoying to never know where your data is written).
Fixed buf_cvarlist, should work in xonotic now, and without segfaults.
Added an extra arg to URI_Get_Callback calls - the response size, also changed the tempstring to contain all bytes of the response, you need to be careful about nulls though.
Try to work around nvidia's forced-panning bug on x11 when changing video modes. This might screw with other programs.
sdl: support custom icons.
sdl: support choosing a specific display.
Added some documentation to menuqc builtins.
menusys: use outlines for slightly more readable fonts.
menusys: switch vid_width and vid_height combos into a single video mode combo to set both according to reported video modes.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5581 fc73d0e0-1445-4013-8a0c-d673dee63da5
2019-11-20 03:09:50 +00:00
if ( ! FS_GameIsInitialised ( ) )
2018-03-24 04:02:09 +00:00
{
Con_Printf ( " File system not initialised \n " ) ;
Con_Printf ( " gamedirfile: \" %s \" \n " , gamedirfile ) ;
Con_Printf ( " pubgamedirfile: \" %s \" \n " , pubgamedirfile ) ;
Con_Printf ( " com_gamepath: \" %s \" \n " , com_gamepath ) ;
Con_Printf ( " com_homepath: \" %s \" (enabled: %s, usable: %s) \n " , com_homepath , com_homepathenabled ? " yes " : " no " , com_homepathusable ? " yes " : " no " ) ;
2019-05-23 15:11:32 +00:00
// Con_Printf("com_configdir: \"%s\"\n", com_configdir);
2018-03-24 04:02:09 +00:00
if ( fs_manifest )
FS_Manifest_Print ( fs_manifest ) ;
return ;
}
2013-06-23 02:17:02 +00:00
if ( com_purepaths | | fs_puremode )
2005-08-26 22:52:26 +00:00
{
2007-09-17 20:35:39 +00:00
Con_Printf ( " Pure paths: \n " ) ;
2005-08-26 22:52:26 +00:00
for ( s = com_purepaths ; s ; s = s - > nextpure )
{
2013-12-17 22:45:37 +00:00
COM_PathLine ( s ) ;
2005-08-26 22:52:26 +00:00
}
2013-06-23 02:17:02 +00:00
if ( fs_puremode = = 2 )
Con_Printf ( " Inactive paths: \n " ) ;
else
Con_Printf ( " Impure paths: \n " ) ;
2005-08-26 22:52:26 +00:00
}
2022-03-01 02:51:55 +00:00
else
Con_TPrintf ( " Current search path: \n " ) ;
2005-08-26 22:52:26 +00:00
for ( s = com_searchpaths ; s ; s = s - > next )
{
if ( s = = com_base_searchpaths )
2022-03-01 02:51:55 +00:00
Con_Printf ( " ---------- \n " ) ;
2005-08-26 22:52:26 +00:00
2013-12-17 22:45:37 +00:00
COM_PathLine ( s ) ;
2005-08-26 22:52:26 +00:00
}
2022-03-01 02:51:55 +00:00
if ( fs_purenames & & fs_purecrcs )
{
char crctok [ 64 ] ;
char nametok [ MAX_QPATH ] ;
int crc ;
char * pc = fs_purecrcs ;
char * pn = fs_purenames ;
for ( ; ; )
{
pc = COM_ParseOut ( pc , crctok , sizeof ( crctok ) ) ;
pn = COM_ParseOut ( pn , nametok , sizeof ( nametok ) ) ;
if ( ! pc | | ! pn )
break ;
crc = strtoul ( crctok , NULL , 0 ) ;
for ( s = com_searchpaths ; s ; s = s - > next )
{
if ( s & & s - > crc_check = = crc )
break ;
}
if ( ! s )
{
COM_DefaultExtension ( nametok , " .pk3 " , sizeof ( nametok ) ) ;
Added sys_openfile console command(and menu option) to web and flatpak(via cmake+dbus) builds, to 'install' packages on sandboxed systems a bit more easily.
Cmake: Add FTE_WERROR option, defaults to true in debug builds and off in release builds (in case future compilers have issues).
Cmake: Pull in libXscreensaver so we don't get interrupted by screensavers when playing demos.
Make: Added `make webcl-rel` for a web build without server bloat (eg for sites focused on demo playback. Yes, this means you XantoM).
fteqcc: Include the decompiler in fteqcc (non-gui) builds ('-d' arg).
fteqcc: Decompiler can now mostly handle hexen2 mods without any unknown opcodes.
Allow ezHud and OpenSSL to be compiled as in-engine plugins, potentially for web and windows ports respectively.
Web: Fix support for ogg vorbis. Add support for voip.
Web: Added basic support for WebXR.
QTV: Don't try seeking on unseekable qtv streams. Don't spam when developer 1 is set.
QTV: add support for some eztv extensions.
MVD: added hack to use ktx's vweps in mvd where mvdsv doesn't bother to record the info.
qwfwd: hack around a hack in qwfwd, allowing it to work again.
recording: favour qwd in single player, instead of mvd.
Protocol: reduce client memory used for precache names. Bump maximum precache counts - some people are just abusive, yes you Orl.
hexen2: add enough clientside protocol compat to play the demo included with h2mp. lacks effects.
in_xflip: restored this setting.
fs_hidesyspaths: new cvar, defaults to enabled so you won't find your username or whatever turning up in screenshots or the like. change it to 0 before debuging stuff eg via 'path'.
gl_overbright_models: Added cvar to match QS.
netchan: Added MTU determination, we'll no longer fail to connect when routers stupidly drop icmp packets.
Win: try a few other versions of xinput too.
CSQC: Added a CSQC_GenerateMaterial function, to give the csqc a chance to generate custom materials.
MenuQC: Added support for the skeletal objects API.
2024-04-09 17:13:59 +00:00
if ( * nametok = = ' * ' )
Con_Printf ( CON_ERROR " MISSING: " U8 ( " %s " ) " (%x) \n " , nametok + 1 , crc ) ;
else
Con_Printf ( CON_WARNING " MISSING: " U8 ( " %s " ) " (%x) \n " , nametok , crc ) ;
2022-03-01 02:51:55 +00:00
}
}
}
2005-08-26 22:52:26 +00:00
}
/*
= = = = = = = = = = = =
COM_Dir_f
= = = = = = = = = = = =
*/
2015-02-02 08:01:53 +00:00
static int QDECL COM_Dir_List ( const char * name , qofs_t size , time_t mtime , void * parm , searchpathfuncs_t * spath )
2005-08-26 22:52:26 +00:00
{
2013-03-31 04:21:08 +00:00
searchpath_t * s ;
2019-09-25 20:23:24 +00:00
const char * ext ;
2016-07-12 00:40:13 +00:00
char link [ 512 ] ;
Added sys_openfile console command(and menu option) to web and flatpak(via cmake+dbus) builds, to 'install' packages on sandboxed systems a bit more easily.
Cmake: Add FTE_WERROR option, defaults to true in debug builds and off in release builds (in case future compilers have issues).
Cmake: Pull in libXscreensaver so we don't get interrupted by screensavers when playing demos.
Make: Added `make webcl-rel` for a web build without server bloat (eg for sites focused on demo playback. Yes, this means you XantoM).
fteqcc: Include the decompiler in fteqcc (non-gui) builds ('-d' arg).
fteqcc: Decompiler can now mostly handle hexen2 mods without any unknown opcodes.
Allow ezHud and OpenSSL to be compiled as in-engine plugins, potentially for web and windows ports respectively.
Web: Fix support for ogg vorbis. Add support for voip.
Web: Added basic support for WebXR.
QTV: Don't try seeking on unseekable qtv streams. Don't spam when developer 1 is set.
QTV: add support for some eztv extensions.
MVD: added hack to use ktx's vweps in mvd where mvdsv doesn't bother to record the info.
qwfwd: hack around a hack in qwfwd, allowing it to work again.
recording: favour qwd in single player, instead of mvd.
Protocol: reduce client memory used for precache names. Bump maximum precache counts - some people are just abusive, yes you Orl.
hexen2: add enough clientside protocol compat to play the demo included with h2mp. lacks effects.
in_xflip: restored this setting.
fs_hidesyspaths: new cvar, defaults to enabled so you won't find your username or whatever turning up in screenshots or the like. change it to 0 before debuging stuff eg via 'path'.
gl_overbright_models: Added cvar to match QS.
netchan: Added MTU determination, we'll no longer fail to connect when routers stupidly drop icmp packets.
Win: try a few other versions of xinput too.
CSQC: Added a CSQC_GenerateMaterial function, to give the csqc a chance to generate custom materials.
MenuQC: Added support for the skeletal objects API.
2024-04-09 17:13:59 +00:00
char pkgname [ MAX_OSPATH ] ;
char szbuf [ 16 ] ;
2016-07-12 00:40:13 +00:00
char * colour ;
flocation_t loc ;
2013-03-31 04:21:08 +00:00
for ( s = com_searchpaths ; s ; s = s - > next )
{
if ( s - > handle = = spath )
break ;
}
2016-07-12 00:40:13 +00:00
if ( * name & & name [ strlen ( name ) - 1 ] = = ' / ' )
{
colour = " ^7 " ; //superseeded
2017-10-31 22:52:58 +00:00
Q_snprintfz ( link , sizeof ( link ) , " \\ tip \\ Scan Sub-Directory \\ dir \\ %s* " , name ) ;
2016-07-12 00:40:13 +00:00
}
else if ( ! FS_FLocateFile ( name , FSLF_IFFOUND , & loc ) )
{
colour = " ^1 " ; //superseeded
Q_snprintfz ( link , sizeof ( link ) , " \\ tip \\ flocate error " ) ;
}
2023-01-09 05:12:39 +00:00
else if ( loc . search - > handle = = spath | | ( fs_allowfileuri & & loc . search = = fs_allowfileuri ) )
2016-07-12 00:40:13 +00:00
{
colour = " ^2 " ;
2019-09-25 20:23:24 +00:00
ext = COM_GetFileExtension ( name , NULL ) ;
2021-06-02 15:29:44 +00:00
if ( ! Q_strcasecmp ( ext , " .gz " ) | | ! Q_strcasecmp ( ext , " .xz " ) )
2019-09-25 20:23:24 +00:00
ext = COM_GetFileExtension ( name , ext ) ;
if ( * ext = = ' . ' )
{
ext + + ;
if ( strchr ( ext , ' . ' ) )
{
COM_StripAllExtensions ( ext , link , sizeof ( link ) ) ;
ext = link ;
}
}
2024-04-06 00:05:33 +00:00
if ( ( ! Q_strcasecmp ( ext , " bsp " ) | | ! Q_strcasecmp ( ext , " d3dbsp " ) | | ! Q_strcasecmp ( ext , " map " ) | | ! Q_strcasecmp ( ext , " hmp " ) ) & & ! strncmp ( name , " maps/ " , 5 ) & & strncmp ( name , " maps/b_ " , 7 ) )
2016-07-12 00:40:13 +00:00
{
2017-10-31 22:52:58 +00:00
Q_snprintfz ( link , sizeof ( link ) , " \\ tip \\ Change Map \\ map \\ %s " , name + 5 ) ;
2016-07-12 00:40:13 +00:00
colour = " ^4 " ; //disconnects
}
2019-10-02 04:33:36 +00:00
# if !defined(NOBUILTINMENUS) && !defined(MINIMAL)
2021-10-22 22:27:58 +00:00
else if ( ! Q_strcasecmp ( ext , " bsp " ) | | ! Q_strcasecmp ( ext , " spr " ) | | ! Q_strcasecmp ( ext , " sp2 " ) | | ! Q_strcasecmp ( ext , " mdl " ) | | ! Q_strcasecmp ( ext , " md3 " ) | | ! Q_strcasecmp ( ext , " iqm " ) | |
2019-09-25 20:23:24 +00:00
! Q_strcasecmp ( ext , " vvm " ) | | ! Q_strcasecmp ( ext , " psk " ) | | ! Q_strcasecmp ( ext , " dpm " ) | | ! Q_strcasecmp ( ext , " zym " ) | | ! Q_strcasecmp ( ext , " md5mesh " ) | |
2019-10-02 04:33:36 +00:00
! Q_strcasecmp ( ext , " mdx " ) | | ! Q_strcasecmp ( ext , " md2 " ) | | ! Q_strcasecmp ( ext , " obj " ) | | ! Q_strcasecmp ( ext , " mds " ) | | ! Q_strcasecmp ( ext , " mdc " ) | |
2024-04-06 00:05:33 +00:00
! Q_strcasecmp ( ext , " md5anim " ) | | ! Q_strcasecmp ( ext , " gltf " ) | | ! Q_strcasecmp ( ext , " glb " ) | | ! Q_strcasecmp ( ext , " ase " ) | | ! Q_strcasecmp ( ext , " lwo " ) | |
( ( ! Q_strncasecmp ( name , " xmodel/ " , 7 ) | | ! Q_strncasecmp ( name , " xanim/ " , 6 ) ) & & ! Q_strcasecmp ( ext , " " ) ) //urgh
)
2017-10-31 22:52:58 +00:00
Q_snprintfz ( link , sizeof ( link ) , " \\ tip \\ Open in Model Viewer \\ modelviewer \\ %s " , name ) ;
2019-10-02 04:33:36 +00:00
# endif
# ifdef TEXTEDITOR
else if ( ! Q_strcasecmp ( ext , " qc " ) | | ! Q_strcasecmp ( ext , " src " ) | | ! Q_strcasecmp ( ext , " qh " ) | | ! Q_strcasecmp ( ext , " h " ) | | ! Q_strcasecmp ( ext , " c " ) | |
! Q_strcasecmp ( ext , " cfg " ) | | ! Q_strcasecmp ( ext , " rc " ) | |
! Q_strcasecmp ( ext , " txt " ) | | ! Q_strcasecmp ( ext , " log " ) | |
! Q_strcasecmp ( ext , " ent " ) | | ! Q_strcasecmp ( ext , " rtlights " ) | |
! Q_strcasecmp ( ext , " glsl " ) | | ! Q_strcasecmp ( ext , " hlsl " ) | |
! Q_strcasecmp ( ext , " shader " ) | | ! Q_strcasecmp ( ext , " framegroups " ) | |
! Q_strcasecmp ( ext , " vmt " ) | | ! Q_strcasecmp ( ext , " skin " ) )
2017-10-31 22:52:58 +00:00
Q_snprintfz ( link , sizeof ( link ) , " \\ tip \\ Open in Text Editor \\ edit \\ %s " , name ) ;
2019-10-02 04:33:36 +00:00
# endif
2019-09-25 20:23:24 +00:00
else if ( ! Q_strcasecmp ( ext , " tga " ) | | ! Q_strcasecmp ( ext , " png " ) | | ! Q_strcasecmp ( ext , " jpg " ) | | ! Q_strcasecmp ( ext , " jpeg " ) | | ! Q_strcasecmp ( ext , " lmp " ) | | ! Q_strcasecmp ( ext , " ico " ) | |
2021-05-09 13:00:21 +00:00
! Q_strcasecmp ( ext , " pcx " ) | | ! Q_strcasecmp ( ext , " bmp " ) | | ! Q_strcasecmp ( ext , " dds " ) | | ! Q_strcasecmp ( ext , " ktx " ) | | ! Q_strcasecmp ( ext , " ktx2 " ) | | ! Q_strcasecmp ( ext , " vtf " ) | |
2024-04-06 00:05:33 +00:00
! Q_strcasecmp ( ext , " astc " ) | | ! Q_strcasecmp ( ext , " htga " ) | | ! Q_strcasecmp ( ext , " exr " ) | | ! Q_strcasecmp ( ext , " xcf " ) | | ! Q_strcasecmp ( ext , " psd " ) | | ! Q_strcasecmp ( ext , " iwi " ) | |
2024-04-14 03:54:07 +00:00
! Q_strcasecmp ( ext , " pbm " ) | | ! Q_strcasecmp ( ext , " ppm " ) | | ! Q_strcasecmp ( ext , " pgm " ) | | ! Q_strcasecmp ( ext , " pam " ) | | ! Q_strcasecmp ( ext , " pfm " ) | | ! Q_strcasecmp ( ext , " hdr " ) | |
! Q_strcasecmp ( ext , " wal " ) )
2016-07-12 00:40:13 +00:00
{
//FIXME: image replacements are getting in the way here.
Q_snprintfz ( link , sizeof ( link ) , " \\ tiprawimg \\ %s \\ tip \\ (note: image replacement rules are context-dependant, including base path, sub path, extension, or complete replacement via a shader) " , name ) ;
colour = " ^6 " ; //shown on mouseover
}
2019-09-25 20:23:24 +00:00
else if ( ! Q_strcasecmp ( ext , " qwd " ) | | ! Q_strcasecmp ( ext , " dem " ) | | ! Q_strcasecmp ( ext , " mvd " ) | | ! Q_strcasecmp ( ext , " dm2 " ) )
2016-07-12 00:40:13 +00:00
{
2017-10-31 22:52:58 +00:00
Q_snprintfz ( link , sizeof ( link ) , " \\ tip \\ Play Demo \\ demo \\ %s " , name ) ;
2016-07-12 00:40:13 +00:00
colour = " ^4 " ; //disconnects
}
2023-08-11 13:47:53 +00:00
else if ( ! Q_strcasecmp ( ext , " roq " ) | | ! Q_strcasecmp ( ext , " cin " ) | | ! Q_strcasecmp ( ext , " avi " ) | | ! Q_strcasecmp ( ext , " mp4 " ) | | ! Q_strcasecmp ( ext , " mkv " ) | | ! Q_strcasecmp ( ext , " ogv " ) )
2017-10-31 22:52:58 +00:00
Q_snprintfz ( link , sizeof ( link ) , " \\ tip \\ Play Film \\ film \\ %s " , name ) ;
2019-09-25 20:23:24 +00:00
else if ( ! Q_strcasecmp ( ext , " wav " ) | | ! Q_strcasecmp ( ext , " ogg " ) | | ! Q_strcasecmp ( ext , " mp3 " ) | | ! Q_strcasecmp ( ext , " opus " ) | | ! Q_strcasecmp ( ext , " flac " ) )
2018-12-06 07:13:37 +00:00
Q_snprintfz ( link , sizeof ( link ) , " \\ tip \\ Play Audio \\ playaudio \\ %s " , name ) ;
2016-07-12 00:40:13 +00:00
else
{
colour = " ^3 " ; //nothing
* link = 0 ;
}
}
else
{
char * gah ;
Added sys_openfile console command(and menu option) to web and flatpak(via cmake+dbus) builds, to 'install' packages on sandboxed systems a bit more easily.
Cmake: Add FTE_WERROR option, defaults to true in debug builds and off in release builds (in case future compilers have issues).
Cmake: Pull in libXscreensaver so we don't get interrupted by screensavers when playing demos.
Make: Added `make webcl-rel` for a web build without server bloat (eg for sites focused on demo playback. Yes, this means you XantoM).
fteqcc: Include the decompiler in fteqcc (non-gui) builds ('-d' arg).
fteqcc: Decompiler can now mostly handle hexen2 mods without any unknown opcodes.
Allow ezHud and OpenSSL to be compiled as in-engine plugins, potentially for web and windows ports respectively.
Web: Fix support for ogg vorbis. Add support for voip.
Web: Added basic support for WebXR.
QTV: Don't try seeking on unseekable qtv streams. Don't spam when developer 1 is set.
QTV: add support for some eztv extensions.
MVD: added hack to use ktx's vweps in mvd where mvdsv doesn't bother to record the info.
qwfwd: hack around a hack in qwfwd, allowing it to work again.
recording: favour qwd in single player, instead of mvd.
Protocol: reduce client memory used for precache names. Bump maximum precache counts - some people are just abusive, yes you Orl.
hexen2: add enough clientside protocol compat to play the demo included with h2mp. lacks effects.
in_xflip: restored this setting.
fs_hidesyspaths: new cvar, defaults to enabled so you won't find your username or whatever turning up in screenshots or the like. change it to 0 before debuging stuff eg via 'path'.
gl_overbright_models: Added cvar to match QS.
netchan: Added MTU determination, we'll no longer fail to connect when routers stupidly drop icmp packets.
Win: try a few other versions of xinput too.
CSQC: Added a CSQC_GenerateMaterial function, to give the csqc a chance to generate custom materials.
MenuQC: Added support for the skeletal objects API.
2024-04-09 17:13:59 +00:00
if ( FS_DisplayPath ( loc . search - > logicalpath , FS_SYSTEM , pkgname , sizeof ( pkgname ) ) )
;
else
Q_strncpyz ( pkgname , loc . search - > purepath , sizeof ( pkgname ) ) ;
2016-07-12 00:40:13 +00:00
colour = " ^1 " ; //superseeded
Added sys_openfile console command(and menu option) to web and flatpak(via cmake+dbus) builds, to 'install' packages on sandboxed systems a bit more easily.
Cmake: Add FTE_WERROR option, defaults to true in debug builds and off in release builds (in case future compilers have issues).
Cmake: Pull in libXscreensaver so we don't get interrupted by screensavers when playing demos.
Make: Added `make webcl-rel` for a web build without server bloat (eg for sites focused on demo playback. Yes, this means you XantoM).
fteqcc: Include the decompiler in fteqcc (non-gui) builds ('-d' arg).
fteqcc: Decompiler can now mostly handle hexen2 mods without any unknown opcodes.
Allow ezHud and OpenSSL to be compiled as in-engine plugins, potentially for web and windows ports respectively.
Web: Fix support for ogg vorbis. Add support for voip.
Web: Added basic support for WebXR.
QTV: Don't try seeking on unseekable qtv streams. Don't spam when developer 1 is set.
QTV: add support for some eztv extensions.
MVD: added hack to use ktx's vweps in mvd where mvdsv doesn't bother to record the info.
qwfwd: hack around a hack in qwfwd, allowing it to work again.
recording: favour qwd in single player, instead of mvd.
Protocol: reduce client memory used for precache names. Bump maximum precache counts - some people are just abusive, yes you Orl.
hexen2: add enough clientside protocol compat to play the demo included with h2mp. lacks effects.
in_xflip: restored this setting.
fs_hidesyspaths: new cvar, defaults to enabled so you won't find your username or whatever turning up in screenshots or the like. change it to 0 before debuging stuff eg via 'path'.
gl_overbright_models: Added cvar to match QS.
netchan: Added MTU determination, we'll no longer fail to connect when routers stupidly drop icmp packets.
Win: try a few other versions of xinput too.
CSQC: Added a CSQC_GenerateMaterial function, to give the csqc a chance to generate custom materials.
MenuQC: Added support for the skeletal objects API.
2024-04-09 17:13:59 +00:00
Q_snprintfz ( link , sizeof ( link ) , " \\ tip \\ overriden by file from %s " , pkgname ) ;
2016-07-12 00:40:13 +00:00
gah = link + 20 ; //whatever
while ( ( gah = strchr ( gah , ' \\ ' ) ) )
* gah = ' / ' ;
}
Added sys_openfile console command(and menu option) to web and flatpak(via cmake+dbus) builds, to 'install' packages on sandboxed systems a bit more easily.
Cmake: Add FTE_WERROR option, defaults to true in debug builds and off in release builds (in case future compilers have issues).
Cmake: Pull in libXscreensaver so we don't get interrupted by screensavers when playing demos.
Make: Added `make webcl-rel` for a web build without server bloat (eg for sites focused on demo playback. Yes, this means you XantoM).
fteqcc: Include the decompiler in fteqcc (non-gui) builds ('-d' arg).
fteqcc: Decompiler can now mostly handle hexen2 mods without any unknown opcodes.
Allow ezHud and OpenSSL to be compiled as in-engine plugins, potentially for web and windows ports respectively.
Web: Fix support for ogg vorbis. Add support for voip.
Web: Added basic support for WebXR.
QTV: Don't try seeking on unseekable qtv streams. Don't spam when developer 1 is set.
QTV: add support for some eztv extensions.
MVD: added hack to use ktx's vweps in mvd where mvdsv doesn't bother to record the info.
qwfwd: hack around a hack in qwfwd, allowing it to work again.
recording: favour qwd in single player, instead of mvd.
Protocol: reduce client memory used for precache names. Bump maximum precache counts - some people are just abusive, yes you Orl.
hexen2: add enough clientside protocol compat to play the demo included with h2mp. lacks effects.
in_xflip: restored this setting.
fs_hidesyspaths: new cvar, defaults to enabled so you won't find your username or whatever turning up in screenshots or the like. change it to 0 before debuging stuff eg via 'path'.
gl_overbright_models: Added cvar to match QS.
netchan: Added MTU determination, we'll no longer fail to connect when routers stupidly drop icmp packets.
Win: try a few other versions of xinput too.
CSQC: Added a CSQC_GenerateMaterial function, to give the csqc a chance to generate custom materials.
MenuQC: Added support for the skeletal objects API.
2024-04-09 17:13:59 +00:00
if ( s & & FS_DisplayPath ( s - > logicalpath , FS_SYSTEM , pkgname , sizeof ( pkgname ) ) )
;
2014-02-07 08:38:40 +00:00
else
Added sys_openfile console command(and menu option) to web and flatpak(via cmake+dbus) builds, to 'install' packages on sandboxed systems a bit more easily.
Cmake: Add FTE_WERROR option, defaults to true in debug builds and off in release builds (in case future compilers have issues).
Cmake: Pull in libXscreensaver so we don't get interrupted by screensavers when playing demos.
Make: Added `make webcl-rel` for a web build without server bloat (eg for sites focused on demo playback. Yes, this means you XantoM).
fteqcc: Include the decompiler in fteqcc (non-gui) builds ('-d' arg).
fteqcc: Decompiler can now mostly handle hexen2 mods without any unknown opcodes.
Allow ezHud and OpenSSL to be compiled as in-engine plugins, potentially for web and windows ports respectively.
Web: Fix support for ogg vorbis. Add support for voip.
Web: Added basic support for WebXR.
QTV: Don't try seeking on unseekable qtv streams. Don't spam when developer 1 is set.
QTV: add support for some eztv extensions.
MVD: added hack to use ktx's vweps in mvd where mvdsv doesn't bother to record the info.
qwfwd: hack around a hack in qwfwd, allowing it to work again.
recording: favour qwd in single player, instead of mvd.
Protocol: reduce client memory used for precache names. Bump maximum precache counts - some people are just abusive, yes you Orl.
hexen2: add enough clientside protocol compat to play the demo included with h2mp. lacks effects.
in_xflip: restored this setting.
fs_hidesyspaths: new cvar, defaults to enabled so you won't find your username or whatever turning up in screenshots or the like. change it to 0 before debuging stuff eg via 'path'.
gl_overbright_models: Added cvar to match QS.
netchan: Added MTU determination, we'll no longer fail to connect when routers stupidly drop icmp packets.
Win: try a few other versions of xinput too.
CSQC: Added a CSQC_GenerateMaterial function, to give the csqc a chance to generate custom materials.
MenuQC: Added support for the skeletal objects API.
2024-04-09 17:13:59 +00:00
Q_strncpyz ( pkgname , " ?? " , sizeof ( pkgname ) ) ;
Con_Printf ( U8 ( " (%s) ^[%s%s%s^] \t ^h(%s) \n " ) , FS_AbbreviateSize ( szbuf , sizeof ( szbuf ) , size ) , colour , name , link , pkgname ) ;
2005-08-26 22:52:26 +00:00
return 1 ;
}
2018-10-11 10:31:23 +00:00
static void COM_Dir_f ( void )
2005-08-26 22:52:26 +00:00
{
char match [ MAX_QPATH ] ;
2016-07-12 00:40:13 +00:00
if ( Cmd_Argc ( ) > 1 )
Q_strncpyz ( match , Cmd_Argv ( 1 ) , sizeof ( match ) ) ;
else
Q_strncpyz ( match , " * " , sizeof ( match ) ) ;
2005-08-26 22:52:26 +00:00
if ( Cmd_Argc ( ) > 2 )
{
strncat ( match , " /*. " , sizeof ( match ) - 1 ) ;
match [ sizeof ( match ) - 1 ] = ' \0 ' ;
strncat ( match , Cmd_Argv ( 2 ) , sizeof ( match ) - 1 ) ;
match [ sizeof ( match ) - 1 ] = ' \0 ' ;
}
2013-05-03 04:28:08 +00:00
// else
// strncat(match, "/*", sizeof(match)-1);
2005-08-26 22:52:26 +00:00
COM_EnumerateFiles ( match , COM_Dir_List , NULL ) ;
}
/*
= = = = = = = = = = = =
COM_Locate_f
= = = = = = = = = = = =
*/
2018-10-11 10:31:23 +00:00
static void COM_Locate_f ( void )
2005-08-26 22:52:26 +00:00
{
Added sys_openfile console command(and menu option) to web and flatpak(via cmake+dbus) builds, to 'install' packages on sandboxed systems a bit more easily.
Cmake: Add FTE_WERROR option, defaults to true in debug builds and off in release builds (in case future compilers have issues).
Cmake: Pull in libXscreensaver so we don't get interrupted by screensavers when playing demos.
Make: Added `make webcl-rel` for a web build without server bloat (eg for sites focused on demo playback. Yes, this means you XantoM).
fteqcc: Include the decompiler in fteqcc (non-gui) builds ('-d' arg).
fteqcc: Decompiler can now mostly handle hexen2 mods without any unknown opcodes.
Allow ezHud and OpenSSL to be compiled as in-engine plugins, potentially for web and windows ports respectively.
Web: Fix support for ogg vorbis. Add support for voip.
Web: Added basic support for WebXR.
QTV: Don't try seeking on unseekable qtv streams. Don't spam when developer 1 is set.
QTV: add support for some eztv extensions.
MVD: added hack to use ktx's vweps in mvd where mvdsv doesn't bother to record the info.
qwfwd: hack around a hack in qwfwd, allowing it to work again.
recording: favour qwd in single player, instead of mvd.
Protocol: reduce client memory used for precache names. Bump maximum precache counts - some people are just abusive, yes you Orl.
hexen2: add enough clientside protocol compat to play the demo included with h2mp. lacks effects.
in_xflip: restored this setting.
fs_hidesyspaths: new cvar, defaults to enabled so you won't find your username or whatever turning up in screenshots or the like. change it to 0 before debuging stuff eg via 'path'.
gl_overbright_models: Added cvar to match QS.
netchan: Added MTU determination, we'll no longer fail to connect when routers stupidly drop icmp packets.
Win: try a few other versions of xinput too.
CSQC: Added a CSQC_GenerateMaterial function, to give the csqc a chance to generate custom materials.
MenuQC: Added support for the skeletal objects API.
2024-04-09 17:13:59 +00:00
char pkgname [ MAX_OSPATH ] ;
2005-08-26 22:52:26 +00:00
flocation_t loc ;
2015-06-04 06:15:14 +00:00
char * f = Cmd_Argv ( 1 ) ;
if ( strchr ( f , ' ^ ' ) ) //fte's filesystem is assumed to be utf-8, but that doesn't mean that console input is. and I'm too lazy to utf-8ify the string (in part because markup can be used to exploit ascii assumptions).
Con_Printf ( " Warning: filename contains markup. If this is because of unicode, set com_parseutf8 1 \n " ) ;
2015-10-11 11:34:58 +00:00
if ( FS_FLocateFile ( f , FSLF_IFFOUND , & loc ) )
2005-08-26 22:52:26 +00:00
{
Added sys_openfile console command(and menu option) to web and flatpak(via cmake+dbus) builds, to 'install' packages on sandboxed systems a bit more easily.
Cmake: Add FTE_WERROR option, defaults to true in debug builds and off in release builds (in case future compilers have issues).
Cmake: Pull in libXscreensaver so we don't get interrupted by screensavers when playing demos.
Make: Added `make webcl-rel` for a web build without server bloat (eg for sites focused on demo playback. Yes, this means you XantoM).
fteqcc: Include the decompiler in fteqcc (non-gui) builds ('-d' arg).
fteqcc: Decompiler can now mostly handle hexen2 mods without any unknown opcodes.
Allow ezHud and OpenSSL to be compiled as in-engine plugins, potentially for web and windows ports respectively.
Web: Fix support for ogg vorbis. Add support for voip.
Web: Added basic support for WebXR.
QTV: Don't try seeking on unseekable qtv streams. Don't spam when developer 1 is set.
QTV: add support for some eztv extensions.
MVD: added hack to use ktx's vweps in mvd where mvdsv doesn't bother to record the info.
qwfwd: hack around a hack in qwfwd, allowing it to work again.
recording: favour qwd in single player, instead of mvd.
Protocol: reduce client memory used for precache names. Bump maximum precache counts - some people are just abusive, yes you Orl.
hexen2: add enough clientside protocol compat to play the demo included with h2mp. lacks effects.
in_xflip: restored this setting.
fs_hidesyspaths: new cvar, defaults to enabled so you won't find your username or whatever turning up in screenshots or the like. change it to 0 before debuging stuff eg via 'path'.
gl_overbright_models: Added cvar to match QS.
netchan: Added MTU determination, we'll no longer fail to connect when routers stupidly drop icmp packets.
Win: try a few other versions of xinput too.
CSQC: Added a CSQC_GenerateMaterial function, to give the csqc a chance to generate custom materials.
MenuQC: Added support for the skeletal objects API.
2024-04-09 17:13:59 +00:00
if ( FS_DisplayPath ( loc . search - > logicalpath , FS_SYSTEM , pkgname , sizeof ( pkgname ) ) )
;
else
Q_strncpyz ( pkgname , " ?? " , sizeof ( pkgname ) ) ;
2005-08-26 22:52:26 +00:00
if ( ! * loc . rawname )
2005-10-16 03:47:26 +00:00
{
Added sys_openfile console command(and menu option) to web and flatpak(via cmake+dbus) builds, to 'install' packages on sandboxed systems a bit more easily.
Cmake: Add FTE_WERROR option, defaults to true in debug builds and off in release builds (in case future compilers have issues).
Cmake: Pull in libXscreensaver so we don't get interrupted by screensavers when playing demos.
Make: Added `make webcl-rel` for a web build without server bloat (eg for sites focused on demo playback. Yes, this means you XantoM).
fteqcc: Include the decompiler in fteqcc (non-gui) builds ('-d' arg).
fteqcc: Decompiler can now mostly handle hexen2 mods without any unknown opcodes.
Allow ezHud and OpenSSL to be compiled as in-engine plugins, potentially for web and windows ports respectively.
Web: Fix support for ogg vorbis. Add support for voip.
Web: Added basic support for WebXR.
QTV: Don't try seeking on unseekable qtv streams. Don't spam when developer 1 is set.
QTV: add support for some eztv extensions.
MVD: added hack to use ktx's vweps in mvd where mvdsv doesn't bother to record the info.
qwfwd: hack around a hack in qwfwd, allowing it to work again.
recording: favour qwd in single player, instead of mvd.
Protocol: reduce client memory used for precache names. Bump maximum precache counts - some people are just abusive, yes you Orl.
hexen2: add enough clientside protocol compat to play the demo included with h2mp. lacks effects.
in_xflip: restored this setting.
fs_hidesyspaths: new cvar, defaults to enabled so you won't find your username or whatever turning up in screenshots or the like. change it to 0 before debuging stuff eg via 'path'.
gl_overbright_models: Added cvar to match QS.
netchan: Added MTU determination, we'll no longer fail to connect when routers stupidly drop icmp packets.
Win: try a few other versions of xinput too.
CSQC: Added a CSQC_GenerateMaterial function, to give the csqc a chance to generate custom materials.
MenuQC: Added support for the skeletal objects API.
2024-04-09 17:13:59 +00:00
Con_Printf ( " File is %u bytes compressed inside " U8 ( " %s " ) " \n " , ( unsigned ) loc . len , pkgname ) ;
2005-10-16 03:47:26 +00:00
}
2005-08-26 22:52:26 +00:00
else
2006-01-02 22:53:29 +00:00
{
Added sys_openfile console command(and menu option) to web and flatpak(via cmake+dbus) builds, to 'install' packages on sandboxed systems a bit more easily.
Cmake: Add FTE_WERROR option, defaults to true in debug builds and off in release builds (in case future compilers have issues).
Cmake: Pull in libXscreensaver so we don't get interrupted by screensavers when playing demos.
Make: Added `make webcl-rel` for a web build without server bloat (eg for sites focused on demo playback. Yes, this means you XantoM).
fteqcc: Include the decompiler in fteqcc (non-gui) builds ('-d' arg).
fteqcc: Decompiler can now mostly handle hexen2 mods without any unknown opcodes.
Allow ezHud and OpenSSL to be compiled as in-engine plugins, potentially for web and windows ports respectively.
Web: Fix support for ogg vorbis. Add support for voip.
Web: Added basic support for WebXR.
QTV: Don't try seeking on unseekable qtv streams. Don't spam when developer 1 is set.
QTV: add support for some eztv extensions.
MVD: added hack to use ktx's vweps in mvd where mvdsv doesn't bother to record the info.
qwfwd: hack around a hack in qwfwd, allowing it to work again.
recording: favour qwd in single player, instead of mvd.
Protocol: reduce client memory used for precache names. Bump maximum precache counts - some people are just abusive, yes you Orl.
hexen2: add enough clientside protocol compat to play the demo included with h2mp. lacks effects.
in_xflip: restored this setting.
fs_hidesyspaths: new cvar, defaults to enabled so you won't find your username or whatever turning up in screenshots or the like. change it to 0 before debuging stuff eg via 'path'.
gl_overbright_models: Added cvar to match QS.
netchan: Added MTU determination, we'll no longer fail to connect when routers stupidly drop icmp packets.
Win: try a few other versions of xinput too.
CSQC: Added a CSQC_GenerateMaterial function, to give the csqc a chance to generate custom materials.
MenuQC: Added support for the skeletal objects API.
2024-04-09 17:13:59 +00:00
Con_Printf ( " Inside " U8 ( " %s " ) " (%u bytes) \n " U8 ( " %s " ) " \n " , loc . rawname , ( unsigned ) loc . len , pkgname ) ;
2006-01-02 22:53:29 +00:00
}
2005-08-26 22:52:26 +00:00
}
else
Con_Printf ( " Not found \n " ) ;
}
2022-01-19 08:27:42 +00:00
static void COM_CalcHash_Thread ( void * ctx , void * fname , size_t a , size_t b )
{
int h ;
struct
{
const char * name ;
hashfunc_t * hash ;
void * ctx ;
} hashes [ ] =
{
// {"crc16", &hash_crc16},
2024-06-09 01:02:55 +00:00
// {"md4", &hash_md4},
# if defined(HAVE_SERVER) || defined(HAVE_CLIENT)
{ " md5 " , & hash_md5 } ,
# endif
2022-01-19 08:27:42 +00:00
{ " sha1 " , & hash_sha1 } ,
# if defined(HAVE_SERVER) || defined(HAVE_CLIENT)
2023-02-20 06:13:40 +00:00
// {"sha224", &hash_sha2_224},
{ " sha256 " , & hash_sha2_256 } ,
// {"sha384", &hash_sha2_384},
// {"sha512", &hash_sha2_512},
2022-01-19 08:27:42 +00:00
# endif
} ;
qbyte digest [ DIGEST_MAXSIZE ] ;
qbyte digesttext [ DIGEST_MAXSIZE * 2 + 1 ] ;
qbyte block [ 65536 ] ;
int csize ;
quint64_t fsize = 0 ;
quint64_t tsize = 0 ;
unsigned int pct , opct = ~ 0 ;
vfsfile_t * f = FS_OpenVFS ( fname , " rb " , FS_GAME ) ;
if ( f )
{
tsize = VFS_GETLEN ( f ) ;
Con_Printf ( " %s: Processing... \r " , ( char * ) fname ) ;
for ( h = 0 ; h < countof ( hashes ) ; h + + )
{
hashes [ h ] . ctx = Z_Malloc ( hashes [ h ] . hash - > contextsize ) ;
hashes [ h ] . hash - > init ( hashes [ h ] . ctx ) ;
}
for ( ; ; )
{
csize = VFS_READ ( f , block , sizeof ( block ) ) ;
if ( csize < = 0 )
break ;
fsize + = csize ;
for ( h = 0 ; h < countof ( hashes ) ; h + + )
{
hashes [ h ] . hash - > process ( hashes [ h ] . ctx , block , csize ) ;
}
pct = ( 100 * fsize ) / tsize ;
if ( pct ! = opct )
{
Con_Printf ( " %s: %i%%... \r " , ( char * ) fname , pct ) ;
opct = pct ;
}
}
VFS_CLOSE ( f ) ;
Added sys_openfile console command(and menu option) to web and flatpak(via cmake+dbus) builds, to 'install' packages on sandboxed systems a bit more easily.
Cmake: Add FTE_WERROR option, defaults to true in debug builds and off in release builds (in case future compilers have issues).
Cmake: Pull in libXscreensaver so we don't get interrupted by screensavers when playing demos.
Make: Added `make webcl-rel` for a web build without server bloat (eg for sites focused on demo playback. Yes, this means you XantoM).
fteqcc: Include the decompiler in fteqcc (non-gui) builds ('-d' arg).
fteqcc: Decompiler can now mostly handle hexen2 mods without any unknown opcodes.
Allow ezHud and OpenSSL to be compiled as in-engine plugins, potentially for web and windows ports respectively.
Web: Fix support for ogg vorbis. Add support for voip.
Web: Added basic support for WebXR.
QTV: Don't try seeking on unseekable qtv streams. Don't spam when developer 1 is set.
QTV: add support for some eztv extensions.
MVD: added hack to use ktx's vweps in mvd where mvdsv doesn't bother to record the info.
qwfwd: hack around a hack in qwfwd, allowing it to work again.
recording: favour qwd in single player, instead of mvd.
Protocol: reduce client memory used for precache names. Bump maximum precache counts - some people are just abusive, yes you Orl.
hexen2: add enough clientside protocol compat to play the demo included with h2mp. lacks effects.
in_xflip: restored this setting.
fs_hidesyspaths: new cvar, defaults to enabled so you won't find your username or whatever turning up in screenshots or the like. change it to 0 before debuging stuff eg via 'path'.
gl_overbright_models: Added cvar to match QS.
netchan: Added MTU determination, we'll no longer fail to connect when routers stupidly drop icmp packets.
Win: try a few other versions of xinput too.
CSQC: Added a CSQC_GenerateMaterial function, to give the csqc a chance to generate custom materials.
MenuQC: Added support for the skeletal objects API.
2024-04-09 17:13:59 +00:00
Con_Printf ( " %s: %s \n " , ( char * ) fname , FS_AbbreviateSize ( block , sizeof ( block ) , fsize ) ) ;
2022-01-19 08:27:42 +00:00
for ( h = 0 ; h < countof ( hashes ) ; h + + )
{
hashes [ h ] . hash - > terminate ( digest , hashes [ h ] . ctx ) ;
Z_Free ( hashes [ h ] . ctx ) ;
digesttext [ Base16_EncodeBlock ( digest , hashes [ h ] . hash - > digestsize , digesttext , sizeof ( digesttext ) - 1 ) ] = 0 ;
Con_Printf ( " %s: %s \n " , hashes [ h ] . name , digesttext ) ;
}
}
Z_Free ( fname ) ;
}
static void COM_CalcHash_f ( void )
{
if ( Cmd_Argc ( ) ! = 2 )
Con_Printf ( " %s <FILENAME>: computes various hashes of the specified file \n " , Cmd_Argv ( 0 ) ) ;
else
COM_AddWork ( WG_LOADER , COM_CalcHash_Thread , NULL , Z_StrDup ( Cmd_Argv ( 1 ) ) , 0 , 0 ) ;
}
2005-08-26 22:52:26 +00:00
/*
= = = = = = = = = = = =
COM_WriteFile
The filename will be prefixed by the current game directory
= = = = = = = = = = = =
*/
2019-04-16 22:40:05 +00:00
qboolean COM_WriteFile ( const char * filename , enum fs_relative fsroot , const void * data , int len )
2005-08-26 22:52:26 +00:00
{
2019-04-16 22:40:05 +00:00
qboolean success = false ;
2006-03-11 03:12:10 +00:00
vfsfile_t * vfs ;
2005-08-26 22:52:26 +00:00
2006-03-11 03:12:10 +00:00
Sys_Printf ( " COM_WriteFile: %s \n " , filename ) ;
2005-11-21 21:09:11 +00:00
2015-06-04 06:15:14 +00:00
FS_CreatePath ( filename , fsroot ) ;
vfs = FS_OpenVFS ( filename , " wb " , fsroot ) ;
2006-03-11 03:12:10 +00:00
if ( vfs )
2005-08-26 22:52:26 +00:00
{
2006-03-11 03:12:10 +00:00
VFS_WRITE ( vfs , data , len ) ;
2019-04-16 22:40:05 +00:00
success = VFS_CLOSE ( vfs ) ;
2005-11-21 21:09:11 +00:00
2017-02-19 00:15:42 +00:00
if ( fsroot > = FS_GAME )
FS_FlushFSHashWritten ( filename ) ;
else
com_fschanged = true ;
}
2019-04-16 22:40:05 +00:00
return success ;
2005-08-26 22:52:26 +00:00
}
/*
= = = = = = = = = = = =
COM_CreatePath
Only used for CopyFile and download
= = = = = = = = = = = =
*/
2010-07-18 08:42:59 +00:00
static void COM_CreatePath ( char * path )
2005-08-26 22:52:26 +00:00
{
char * ofs ;
2005-11-21 21:09:11 +00:00
2014-03-30 08:55:06 +00:00
if ( fs_readonly )
return ;
2005-08-26 22:52:26 +00:00
for ( ofs = path + 1 ; * ofs ; ofs + + )
{
if ( * ofs = = ' / ' )
{ // create the directory
* ofs = 0 ;
Sys_mkdir ( path ) ;
* ofs = ' / ' ;
}
}
}
/*
= = = = = = = = = = =
COM_CopyFile
Copies a file over from the net to the local cache , creating any directories
needed . This is for the convenience of developers using ISDN from home .
= = = = = = = = = = =
*/
2009-03-03 01:52:30 +00:00
/*
static void COM_CopyFile ( char * netpath , char * cachepath )
2005-08-26 22:52:26 +00:00
{
FILE * in , * out ;
int remaining , count ;
char buf [ 4096 ] ;
2005-11-21 21:09:11 +00:00
remaining = COM_FileOpenRead ( netpath , & in ) ;
2005-08-26 22:52:26 +00:00
COM_CreatePath ( cachepath ) ; // create directories up to the cache file
out = fopen ( cachepath , " wb " ) ;
if ( ! out )
Sys_Error ( " Error opening %s " , cachepath ) ;
2005-11-21 21:09:11 +00:00
2005-08-26 22:52:26 +00:00
while ( remaining )
{
if ( remaining < sizeof ( buf ) )
count = remaining ;
else
count = sizeof ( buf ) ;
fread ( buf , 1 , count , in ) ;
fwrite ( buf , 1 , count , out ) ;
remaining - = count ;
}
fclose ( in ) ;
fclose ( out ) ;
}
2009-03-03 01:52:30 +00:00
//*/
2005-08-26 22:52:26 +00:00
int fs_hash_dups ;
int fs_hash_files ;
2014-02-07 08:38:40 +00:00
//normally the filesystem drivers pass a pre-allocated bucket and static strings to us
//the OS driver can't really be expected to track things that reliably however, so it just gives names via the stack.
//these files are grouped up to avoid excessive memory allocations.
struct fsbucketblock
{
struct fsbucketblock * prev ;
int used ;
int total ;
qbyte data [ 1 ] ;
} ;
static struct fsbucketblock * fs_hash_filebuckets ;
2017-02-19 00:15:42 +00:00
static void FS_FlushFSHashReally ( qboolean domutexes )
2005-08-26 22:52:26 +00:00
{
2014-10-05 20:04:11 +00:00
COM_AssertMainThread ( " FS_FlushFSHashReally " ) ;
if ( ! domutexes | | Sys_LockMutex ( fs_thread_mutex ) )
2005-08-26 22:52:26 +00:00
{
2014-10-05 20:04:11 +00:00
com_fschanged = true ;
2014-02-07 08:38:40 +00:00
2014-10-05 20:04:11 +00:00
if ( filesystemhash . numbuckets )
{
int i ;
for ( i = 0 ; i < filesystemhash . numbuckets ; i + + )
filesystemhash . bucket [ i ] = NULL ;
}
2005-08-26 22:52:26 +00:00
2014-10-05 20:04:11 +00:00
while ( fs_hash_filebuckets )
{
struct fsbucketblock * n = fs_hash_filebuckets - > prev ;
Z_Free ( fs_hash_filebuckets ) ;
fs_hash_filebuckets = n ;
}
if ( domutexes )
Sys_UnlockMutex ( fs_thread_mutex ) ;
}
2005-08-26 22:52:26 +00:00
}
2012-05-09 15:30:53 +00:00
2013-05-03 04:28:08 +00:00
static void QDECL FS_AddFileHash ( int depth , const char * fname , fsbucket_t * filehandle , void * pathhandle )
2012-05-09 15:30:53 +00:00
{
fsbucket_t * old ;
2014-03-30 08:55:06 +00:00
old = Hash_GetInsensitiveBucket ( & filesystemhash , fname ) ;
2012-05-09 15:30:53 +00:00
if ( old )
{
fs_hash_dups + + ;
2014-02-07 08:38:40 +00:00
if ( depth > = old - > depth )
2012-05-09 15:30:53 +00:00
{
return ;
}
//remove the old version
Hash_RemoveBucket ( & filesystemhash , fname , & old - > buck ) ;
}
if ( ! filehandle )
{
2014-02-07 08:38:40 +00:00
int nlen = strlen ( fname ) + 1 ;
2019-06-17 04:21:41 +00:00
int plen = sizeof ( * filehandle ) + nlen ;
2019-06-27 14:38:51 +00:00
plen = ( plen + fte_alignof ( fsbucket_t ) - 1 ) & ~ ( fte_alignof ( fsbucket_t ) - 1 ) ;
2019-06-17 04:21:41 +00:00
if ( ! fs_hash_filebuckets | | fs_hash_filebuckets - > used + plen > fs_hash_filebuckets - > total )
2014-02-07 08:38:40 +00:00
{
void * o = fs_hash_filebuckets ;
fs_hash_filebuckets = Z_Malloc ( 65536 ) ;
fs_hash_filebuckets - > total = 65536 - sizeof ( * fs_hash_filebuckets ) ;
fs_hash_filebuckets - > prev = o ;
}
filehandle = ( fsbucket_t * ) ( fs_hash_filebuckets - > data + fs_hash_filebuckets - > used ) ;
2019-06-17 04:21:41 +00:00
fs_hash_filebuckets - > used + = plen ;
2014-02-07 08:38:40 +00:00
2012-05-09 15:30:53 +00:00
if ( ! filehandle )
return ; //eep!
2014-02-07 08:38:40 +00:00
memcpy ( ( char * ) ( filehandle + 1 ) , fname , nlen ) ;
2012-05-09 15:30:53 +00:00
fname = ( char * ) ( filehandle + 1 ) ;
}
2014-02-07 08:38:40 +00:00
filehandle - > depth = depth ;
2012-05-09 15:30:53 +00:00
2014-03-30 08:55:06 +00:00
Hash_AddInsensitive ( & filesystemhash , fname , pathhandle , & filehandle - > buck ) ;
2012-05-09 15:30:53 +00:00
fs_hash_files + + ;
}
2005-08-26 22:52:26 +00:00
2019-02-23 09:29:20 +00:00
# ifndef FTE_TARGET_WEB
2017-02-19 00:15:42 +00:00
static void FS_RebuildFSHash ( qboolean domutex )
2005-08-26 22:52:26 +00:00
{
2012-05-09 15:30:53 +00:00
int depth = 1 ;
2005-08-26 22:52:26 +00:00
searchpath_t * search ;
2014-02-07 08:38:40 +00:00
if ( ! com_fschanged )
return ;
2014-10-05 20:04:11 +00:00
COM_AssertMainThread ( " FS_RebuildFSHash " ) ;
if ( domutex & & ! Sys_LockMutex ( fs_thread_mutex ) )
return ; //amg!
2021-11-03 20:31:08 +00:00
if ( com_fsneedreload )
FS_ReloadPackFilesFlags ( ~ 0 ) ;
2014-10-05 20:04:11 +00:00
2005-08-26 22:52:26 +00:00
if ( ! filesystemhash . numbuckets )
{
filesystemhash . numbuckets = 1024 ;
2008-05-25 01:06:37 +00:00
filesystemhash . bucket = ( bucket_t * * ) Z_Malloc ( Hash_BytesForBuckets ( filesystemhash . numbuckets ) ) ;
2005-08-26 22:52:26 +00:00
}
else
{
2014-10-05 20:04:11 +00:00
FS_FlushFSHashReally ( false ) ;
2005-08-26 22:52:26 +00:00
}
Hash_InitTable ( & filesystemhash , filesystemhash . numbuckets , filesystemhash . bucket ) ;
fs_hash_dups = 0 ;
fs_hash_files = 0 ;
if ( com_purepaths )
{ //go for the pure paths first.
for ( search = com_purepaths ; search ; search = search - > nextpure )
{
2013-06-23 02:17:02 +00:00
search - > handle - > BuildHash ( search - > handle , depth + + , FS_AddFileHash ) ;
2005-08-26 22:52:26 +00:00
}
}
2013-06-23 02:17:02 +00:00
if ( fs_puremode < 2 )
2005-08-26 22:52:26 +00:00
{
2013-06-23 02:17:02 +00:00
for ( search = com_searchpaths ; search ; search = search - > next )
{
search - > handle - > BuildHash ( search - > handle , depth + + , FS_AddFileHash ) ;
}
2005-08-26 22:52:26 +00:00
}
com_fschanged = false ;
2021-11-03 20:31:08 +00:00
com_fsneedreload = false ;
2005-08-26 22:52:26 +00:00
2014-10-05 20:04:11 +00:00
if ( domutex )
Sys_UnlockMutex ( fs_thread_mutex ) ;
2010-11-02 23:17:25 +00:00
Con_DPrintf ( " %i unique files, %i duplicates \n " , fs_hash_files , fs_hash_dups ) ;
2005-08-26 22:52:26 +00:00
}
2019-02-23 09:29:20 +00:00
# endif
2005-08-26 22:52:26 +00:00
2017-02-19 00:15:42 +00:00
static void FS_RebuildFSHash_Update ( const char * fname )
{
flocation_t loc ;
searchpath_t * search ;
int depth = 0 ;
fsbucket_t * old ;
added r_meshpitch cvar that allows for fixing the unfixable mesh pitch bug from vanilla... needs a better name... do note that this will break pretty much any mod, so this is really only for TCs designed to use it. Its likely that I missed places.
nqsv: added support for spectators with nq clients. the angles are a bit rough, but hey. need to do something about frags so nq clients know who's a spectator. use 'cmd observe' to get an nq client to spectate on an fte server (then attack/jump behave the same as in qw clients).
nqsv: rewrote EF_MUZZLEFLASH handling, so svc_muzzleflash is now translated properly to EF_MUZZLEFLASH, and vice versa. No more missing muzzleflashes!
added screenshot_cubemap, so you can actually pre-generate cubemaps with fte (which can be used for reflections or whatever).
misc fixes (server crash, a couple of other less important ones).
external files based on a model's name will now obey r_replacemodels properly, instead of needing to use foo.mdl_0.skin for foo.md3.
identify <playernum> should now use the correct masked ip, instead of abrubtly failing (reported by kt)
vid_toggle console command should now obey vid_width and vid_height when switching to fullscreen, but only if vid_fullscreen is actually set, which should make it seem better behaved (reported by kt).
qcc: cleaned up sym->symboldata[sym->ofs] to be more consistent at all stages.
qcc: typedef float vec4[4]; now works to define a float array with 4 elements (however, it will be passed by-value rather than by-reference).
qcc: cleaned up optional vs __out ordering issues.
qccgui: shift+f3 searches backwards
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5064 fc73d0e0-1445-4013-8a0c-d673dee63da5
2017-02-27 09:34:35 +00:00
void * filehandle = NULL ;
2017-02-19 00:15:42 +00:00
if ( com_fschanged )
return ;
added r_meshpitch cvar that allows for fixing the unfixable mesh pitch bug from vanilla... needs a better name... do note that this will break pretty much any mod, so this is really only for TCs designed to use it. Its likely that I missed places.
nqsv: added support for spectators with nq clients. the angles are a bit rough, but hey. need to do something about frags so nq clients know who's a spectator. use 'cmd observe' to get an nq client to spectate on an fte server (then attack/jump behave the same as in qw clients).
nqsv: rewrote EF_MUZZLEFLASH handling, so svc_muzzleflash is now translated properly to EF_MUZZLEFLASH, and vice versa. No more missing muzzleflashes!
added screenshot_cubemap, so you can actually pre-generate cubemaps with fte (which can be used for reflections or whatever).
misc fixes (server crash, a couple of other less important ones).
external files based on a model's name will now obey r_replacemodels properly, instead of needing to use foo.mdl_0.skin for foo.md3.
identify <playernum> should now use the correct masked ip, instead of abrubtly failing (reported by kt)
vid_toggle console command should now obey vid_width and vid_height when switching to fullscreen, but only if vid_fullscreen is actually set, which should make it seem better behaved (reported by kt).
qcc: cleaned up sym->symboldata[sym->ofs] to be more consistent at all stages.
qcc: typedef float vec4[4]; now works to define a float array with 4 elements (however, it will be passed by-value rather than by-reference).
qcc: cleaned up optional vs __out ordering issues.
qccgui: shift+f3 searches backwards
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5064 fc73d0e0-1445-4013-8a0c-d673dee63da5
2017-02-27 09:34:35 +00:00
if ( ! filehandle & & com_purepaths )
2017-02-19 00:15:42 +00:00
{ //go for the pure paths first.
for ( search = com_purepaths ; search ; search = search - > nextpure )
{
if ( search - > handle - > FindFile ( search - > handle , & loc , fname , NULL ) )
{
added r_meshpitch cvar that allows for fixing the unfixable mesh pitch bug from vanilla... needs a better name... do note that this will break pretty much any mod, so this is really only for TCs designed to use it. Its likely that I missed places.
nqsv: added support for spectators with nq clients. the angles are a bit rough, but hey. need to do something about frags so nq clients know who's a spectator. use 'cmd observe' to get an nq client to spectate on an fte server (then attack/jump behave the same as in qw clients).
nqsv: rewrote EF_MUZZLEFLASH handling, so svc_muzzleflash is now translated properly to EF_MUZZLEFLASH, and vice versa. No more missing muzzleflashes!
added screenshot_cubemap, so you can actually pre-generate cubemaps with fte (which can be used for reflections or whatever).
misc fixes (server crash, a couple of other less important ones).
external files based on a model's name will now obey r_replacemodels properly, instead of needing to use foo.mdl_0.skin for foo.md3.
identify <playernum> should now use the correct masked ip, instead of abrubtly failing (reported by kt)
vid_toggle console command should now obey vid_width and vid_height when switching to fullscreen, but only if vid_fullscreen is actually set, which should make it seem better behaved (reported by kt).
qcc: cleaned up sym->symboldata[sym->ofs] to be more consistent at all stages.
qcc: typedef float vec4[4]; now works to define a float array with 4 elements (however, it will be passed by-value rather than by-reference).
qcc: cleaned up optional vs __out ordering issues.
qccgui: shift+f3 searches backwards
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5064 fc73d0e0-1445-4013-8a0c-d673dee63da5
2017-02-27 09:34:35 +00:00
filehandle = loc . fhandle ;
break ;
2017-02-19 00:15:42 +00:00
}
depth + + ;
}
}
added r_meshpitch cvar that allows for fixing the unfixable mesh pitch bug from vanilla... needs a better name... do note that this will break pretty much any mod, so this is really only for TCs designed to use it. Its likely that I missed places.
nqsv: added support for spectators with nq clients. the angles are a bit rough, but hey. need to do something about frags so nq clients know who's a spectator. use 'cmd observe' to get an nq client to spectate on an fte server (then attack/jump behave the same as in qw clients).
nqsv: rewrote EF_MUZZLEFLASH handling, so svc_muzzleflash is now translated properly to EF_MUZZLEFLASH, and vice versa. No more missing muzzleflashes!
added screenshot_cubemap, so you can actually pre-generate cubemaps with fte (which can be used for reflections or whatever).
misc fixes (server crash, a couple of other less important ones).
external files based on a model's name will now obey r_replacemodels properly, instead of needing to use foo.mdl_0.skin for foo.md3.
identify <playernum> should now use the correct masked ip, instead of abrubtly failing (reported by kt)
vid_toggle console command should now obey vid_width and vid_height when switching to fullscreen, but only if vid_fullscreen is actually set, which should make it seem better behaved (reported by kt).
qcc: cleaned up sym->symboldata[sym->ofs] to be more consistent at all stages.
qcc: typedef float vec4[4]; now works to define a float array with 4 elements (however, it will be passed by-value rather than by-reference).
qcc: cleaned up optional vs __out ordering issues.
qccgui: shift+f3 searches backwards
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5064 fc73d0e0-1445-4013-8a0c-d673dee63da5
2017-02-27 09:34:35 +00:00
if ( ! filehandle & & fs_puremode < 2 )
2017-02-19 00:15:42 +00:00
{
for ( search = com_searchpaths ; search ; search = search - > next )
{
if ( search - > handle - > FindFile ( search - > handle , & loc , fname , NULL ) )
{
added r_meshpitch cvar that allows for fixing the unfixable mesh pitch bug from vanilla... needs a better name... do note that this will break pretty much any mod, so this is really only for TCs designed to use it. Its likely that I missed places.
nqsv: added support for spectators with nq clients. the angles are a bit rough, but hey. need to do something about frags so nq clients know who's a spectator. use 'cmd observe' to get an nq client to spectate on an fte server (then attack/jump behave the same as in qw clients).
nqsv: rewrote EF_MUZZLEFLASH handling, so svc_muzzleflash is now translated properly to EF_MUZZLEFLASH, and vice versa. No more missing muzzleflashes!
added screenshot_cubemap, so you can actually pre-generate cubemaps with fte (which can be used for reflections or whatever).
misc fixes (server crash, a couple of other less important ones).
external files based on a model's name will now obey r_replacemodels properly, instead of needing to use foo.mdl_0.skin for foo.md3.
identify <playernum> should now use the correct masked ip, instead of abrubtly failing (reported by kt)
vid_toggle console command should now obey vid_width and vid_height when switching to fullscreen, but only if vid_fullscreen is actually set, which should make it seem better behaved (reported by kt).
qcc: cleaned up sym->symboldata[sym->ofs] to be more consistent at all stages.
qcc: typedef float vec4[4]; now works to define a float array with 4 elements (however, it will be passed by-value rather than by-reference).
qcc: cleaned up optional vs __out ordering issues.
qccgui: shift+f3 searches backwards
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5064 fc73d0e0-1445-4013-8a0c-d673dee63da5
2017-02-27 09:34:35 +00:00
filehandle = loc . fhandle ;
break ;
2017-02-19 00:15:42 +00:00
}
depth + + ;
}
}
added r_meshpitch cvar that allows for fixing the unfixable mesh pitch bug from vanilla... needs a better name... do note that this will break pretty much any mod, so this is really only for TCs designed to use it. Its likely that I missed places.
nqsv: added support for spectators with nq clients. the angles are a bit rough, but hey. need to do something about frags so nq clients know who's a spectator. use 'cmd observe' to get an nq client to spectate on an fte server (then attack/jump behave the same as in qw clients).
nqsv: rewrote EF_MUZZLEFLASH handling, so svc_muzzleflash is now translated properly to EF_MUZZLEFLASH, and vice versa. No more missing muzzleflashes!
added screenshot_cubemap, so you can actually pre-generate cubemaps with fte (which can be used for reflections or whatever).
misc fixes (server crash, a couple of other less important ones).
external files based on a model's name will now obey r_replacemodels properly, instead of needing to use foo.mdl_0.skin for foo.md3.
identify <playernum> should now use the correct masked ip, instead of abrubtly failing (reported by kt)
vid_toggle console command should now obey vid_width and vid_height when switching to fullscreen, but only if vid_fullscreen is actually set, which should make it seem better behaved (reported by kt).
qcc: cleaned up sym->symboldata[sym->ofs] to be more consistent at all stages.
qcc: typedef float vec4[4]; now works to define a float array with 4 elements (however, it will be passed by-value rather than by-reference).
qcc: cleaned up optional vs __out ordering issues.
qccgui: shift+f3 searches backwards
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5064 fc73d0e0-1445-4013-8a0c-d673dee63da5
2017-02-27 09:34:35 +00:00
2020-05-14 15:50:26 +00:00
COM_WorkerLock ( ) ;
added r_meshpitch cvar that allows for fixing the unfixable mesh pitch bug from vanilla... needs a better name... do note that this will break pretty much any mod, so this is really only for TCs designed to use it. Its likely that I missed places.
nqsv: added support for spectators with nq clients. the angles are a bit rough, but hey. need to do something about frags so nq clients know who's a spectator. use 'cmd observe' to get an nq client to spectate on an fte server (then attack/jump behave the same as in qw clients).
nqsv: rewrote EF_MUZZLEFLASH handling, so svc_muzzleflash is now translated properly to EF_MUZZLEFLASH, and vice versa. No more missing muzzleflashes!
added screenshot_cubemap, so you can actually pre-generate cubemaps with fte (which can be used for reflections or whatever).
misc fixes (server crash, a couple of other less important ones).
external files based on a model's name will now obey r_replacemodels properly, instead of needing to use foo.mdl_0.skin for foo.md3.
identify <playernum> should now use the correct masked ip, instead of abrubtly failing (reported by kt)
vid_toggle console command should now obey vid_width and vid_height when switching to fullscreen, but only if vid_fullscreen is actually set, which should make it seem better behaved (reported by kt).
qcc: cleaned up sym->symboldata[sym->ofs] to be more consistent at all stages.
qcc: typedef float vec4[4]; now works to define a float array with 4 elements (however, it will be passed by-value rather than by-reference).
qcc: cleaned up optional vs __out ordering issues.
qccgui: shift+f3 searches backwards
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5064 fc73d0e0-1445-4013-8a0c-d673dee63da5
2017-02-27 09:34:35 +00:00
if ( ! Sys_LockMutex ( fs_thread_mutex ) )
return ; //amg!
old = Hash_GetInsensitiveBucket ( & filesystemhash , fname ) ;
if ( old )
{
Hash_RemoveBucket ( & filesystemhash , fname , & old - > buck ) ;
fs_hash_files - - ;
}
if ( filehandle )
FS_AddFileHash ( depth , fname , NULL , filehandle ) ;
2017-02-19 00:15:42 +00:00
Sys_UnlockMutex ( fs_thread_mutex ) ;
2020-05-14 15:50:26 +00:00
COM_WorkerUnlock ( ) ;
2017-02-19 00:15:42 +00:00
}
void FS_FlushFSHashWritten ( const char * fname )
{
FS_RebuildFSHash_Update ( fname ) ;
}
void FS_FlushFSHashRemoved ( const char * fname )
{
FS_RebuildFSHash_Update ( fname ) ;
}
void FS_FlushFSHashFull ( void )
{ //any calls to this are typically a bug...
//that said, figuring out if the file was actually within quake's filesystem isn't easy.
com_fschanged = true ;
//for safety we would need to sync with all threads, so lets just not bother.
//FS_FlushFSHashReally(true);
}
2005-08-26 22:52:26 +00:00
/*
= = = = = = = = = = =
COM_FindFile
Finds the file in the search path .
Sets com_filesize and one of handle or file
= = = = = = = = = = =
*/
//if loc is valid, loc->search is always filled in, the others are filled on success.
2016-07-12 00:40:13 +00:00
//returns 0 if couldn't find.
2015-10-11 11:34:58 +00:00
int FS_FLocateFile ( const char * filename , unsigned int lflags , flocation_t * loc )
2005-08-26 22:52:26 +00:00
{
2014-01-13 02:42:25 +00:00
int depth = 0 ;
2005-08-26 22:52:26 +00:00
searchpath_t * search ;
2015-06-04 06:15:14 +00:00
char cleanpath [ MAX_OSPATH ] ;
2014-01-13 02:42:25 +00:00
flocation_t allownoloc ;
2005-08-26 22:52:26 +00:00
void * pf ;
2014-01-13 02:42:25 +00:00
unsigned int found = FF_NOTFOUND ;
if ( ! loc )
loc = & allownoloc ;
2017-02-19 00:15:42 +00:00
loc - > fhandle = NULL ;
2014-01-13 02:42:25 +00:00
loc - > offset = 0 ;
* loc - > rawname = 0 ;
loc - > search = NULL ;
loc - > len = - 1 ;
2005-08-26 22:52:26 +00:00
2023-01-09 05:12:39 +00:00
if ( ! strncmp ( filename , " file: " , 5 ) )
{
if ( fs_allowfileuri & & Sys_ResolveFileURL ( filename , strlen ( filename ) , cleanpath , sizeof ( cleanpath ) ) )
{
fs_finds + + ;
found = fs_allowfileuri - > handle - > FindFile ( fs_allowfileuri - > handle , loc , cleanpath , NULL ) ;
if ( found )
loc - > search = fs_allowfileuri ;
}
pf = NULL ;
goto fail ;
}
2020-02-26 00:37:52 +00:00
filename = FS_GetCleanPath ( filename , ( lflags & FSLF_QUIET ) , cleanpath , sizeof ( cleanpath ) ) ;
2009-04-01 22:03:56 +00:00
if ( ! filename )
2009-03-03 01:52:30 +00:00
{
pf = NULL ;
goto fail ;
}
2015-10-11 11:34:58 +00:00
if ( com_fs_cache . ival & & ! com_fschanged & & ! ( lflags & FSLF_IGNOREPURE ) )
2005-08-26 22:52:26 +00:00
{
2017-11-11 20:17:52 +00:00
bucket_t * b = Hash_GetInsensitiveBucket ( & filesystemhash , filename ) ;
if ( b )
{
pf = b - > data ;
filename = b - > key . string ; //update the filename to use the correct file case...
}
else
2005-08-26 22:52:26 +00:00
goto fail ;
}
else
pf = NULL ;
2015-10-11 11:34:58 +00:00
if ( com_purepaths & & found = = FF_NOTFOUND & & ! ( lflags & FSLF_IGNOREPURE ) )
2005-08-26 22:52:26 +00:00
{
2014-01-13 02:42:25 +00:00
//check if its in one of the 'pure' packages. these override the default ones.
2005-08-26 22:52:26 +00:00
for ( search = com_purepaths ; search ; search = search - > nextpure )
{
2015-10-11 11:34:58 +00:00
if ( ( lflags & FSLF_SECUREONLY ) & & ! ( search - > flags & SPF_UNTRUSTED ) )
continue ;
2016-07-12 00:40:13 +00:00
if ( ! ( ( lflags & FSLF_IGNOREBASEDEPTH ) & & ( search - > flags & SPF_BASEPATH ) ) )
depth + = ( ( search - > flags & SPF_EXPLICIT ) | | ( lflags & FSLF_DEPTH_INEXPLICIT ) ) ;
2012-02-27 12:23:15 +00:00
fs_finds + + ;
2014-01-13 02:42:25 +00:00
found = search - > handle - > FindFile ( search - > handle , loc , filename , pf ) ;
if ( found )
2005-08-26 22:52:26 +00:00
{
2015-10-11 11:34:58 +00:00
if ( ! ( lflags & FSLF_DONTREFERENCE ) )
2014-07-01 07:10:10 +00:00
{
if ( ( search - > flags & fs_referencetype ) ! = fs_referencetype )
Con_DPrintf ( " %s became referenced due to %s \n " , search - > purepath , filename ) ;
search - > flags | = fs_referencetype ;
}
2014-01-13 02:42:25 +00:00
loc - > search = search ;
break ;
2005-08-26 22:52:26 +00:00
}
}
}
2015-10-11 11:34:58 +00:00
if ( ( ( lflags & FSLF_IGNOREPURE ) | | fs_puremode < 2 ) & & found = = FF_NOTFOUND )
2013-06-23 02:17:02 +00:00
{
2014-01-13 02:42:25 +00:00
// optionally check the non-pure paths too.
2013-06-23 02:17:02 +00:00
for ( search = com_searchpaths ; search ; search = search - > next )
2005-08-26 22:52:26 +00:00
{
2015-10-27 15:20:15 +00:00
if ( ( lflags & FSLF_SECUREONLY ) & & ( search - > flags & SPF_UNTRUSTED ) )
2015-10-11 11:34:58 +00:00
continue ;
2016-07-12 00:40:13 +00:00
if ( ! ( ( lflags & FSLF_IGNOREBASEDEPTH ) & & ( search - > flags & SPF_BASEPATH ) ) )
depth + = ( ( search - > flags & SPF_EXPLICIT ) | | ( lflags & FSLF_DEPTH_INEXPLICIT ) ) ;
2013-06-23 02:17:02 +00:00
fs_finds + + ;
2014-01-13 02:42:25 +00:00
found = search - > handle - > FindFile ( search - > handle , loc , filename , pf ) ;
if ( found )
2005-12-21 03:07:33 +00:00
{
2015-10-11 11:34:58 +00:00
if ( ! ( lflags & FSLF_DONTREFERENCE ) )
2014-07-01 07:10:10 +00:00
{
if ( ( search - > flags & fs_referencetype ) ! = fs_referencetype )
Con_DPrintf ( " %s became referenced due to %s \n " , search - > purepath , filename ) ;
search - > flags | = fs_referencetype ;
}
2014-01-13 02:42:25 +00:00
loc - > search = search ;
break ;
2005-12-21 03:07:33 +00:00
}
2005-08-26 22:52:26 +00:00
}
}
fail :
2015-10-11 11:34:58 +00:00
if ( found = = FF_SYMLINK & & ! ( lflags & FSLF_IGNORELINKS ) )
2014-01-13 02:42:25 +00:00
{
static int blocklink ;
if ( blocklink < 4 & & loc - > len < MAX_QPATH )
{
//read the link target
char * s , * b ;
char targname [ MAX_QPATH ] ;
char mergedname [ MAX_QPATH ] ;
targname [ loc - > len ] = 0 ;
loc - > search - > handle - > ReadFile ( loc - > search - > handle , loc , targname ) ;
//properlyish unixify
2014-02-13 23:54:57 +00:00
while ( ( s = strchr ( targname , ' \\ ' ) ) )
2014-01-13 02:42:25 +00:00
* s = ' / ' ;
if ( * targname = = ' / ' )
Q_strncpyz ( mergedname , targname + 1 , sizeof ( mergedname ) ) ;
else
{
Q_strncpyz ( mergedname , filename , sizeof ( mergedname ) ) ;
2014-02-13 23:54:57 +00:00
while ( ( s = strchr ( mergedname , ' \\ ' ) ) )
2014-01-13 02:42:25 +00:00
* s = ' / ' ;
b = COM_SkipPath ( mergedname ) ;
* b = 0 ;
for ( s = targname ; ! strncmp ( s , " ../ " , 3 ) & & b > mergedname ; )
{
s + = 3 ;
if ( b [ - 1 ] = = ' / ' )
* - - b = 0 ;
* b = 0 ;
b = strrchr ( mergedname , ' / ' ) ;
if ( b )
* + + b = 0 ;
else
{
//no prefix left.
* mergedname = 0 ;
break ;
}
}
b = mergedname + strlen ( mergedname ) ;
Q_strncpyz ( b , s , sizeof ( mergedname ) - ( b - mergedname ) ) ;
}
//and locate that instead.
blocklink + + ;
2015-10-11 11:34:58 +00:00
depth = FS_FLocateFile ( mergedname , lflags , loc ) ;
2014-01-13 02:42:25 +00:00
blocklink - - ;
if ( ! loc - > search )
Con_Printf ( " Symlink %s -> %s (%s) is dead \n " , filename , targname , mergedname ) ;
return depth ;
}
}
2005-08-26 22:52:26 +00:00
/* if (len>=0)
{
if ( loc )
Con_Printf ( " Found %s:%i \n " , loc - > rawname , loc - > len ) ;
else
Con_Printf ( " Found %s \n " , filename ) ;
}
else
Con_Printf ( " Failed \n " ) ;
2006-03-04 20:43:48 +00:00
*/
2020-04-29 10:43:22 +00:00
if ( found = = FF_NOTFOUND | | found = = FF_DIRECTORY | | loc - > len = = - 1 )
2014-01-13 02:42:25 +00:00
{
2016-07-12 00:40:13 +00:00
if ( lflags & FSLF_DEEPONFAILURE )
return 0x7fffffff ; //if we're asking for depth, the file is reported to be so far into the filesystem as to be irrelevant.
return 0 ;
2014-01-13 02:42:25 +00:00
}
2016-07-12 00:40:13 +00:00
return depth + 1 ;
2005-08-26 22:52:26 +00:00
}
2006-01-02 22:53:29 +00:00
2019-06-21 03:59:46 +00:00
//returns the location's root package (or gamedir).
//(aka: loc->search->purepath, but stripping contained nested packs)
const char * FS_GetRootPackagePath ( flocation_t * loc )
{
searchpath_t * sp , * search ;
for ( sp = loc - > search ; ; )
{
for ( search = com_searchpaths ; search ; search = search - > next )
{
if ( search ! = sp )
if ( search - > handle - > GeneratePureCRC ) //only consider files that have a pure hash. this excludes system paths
if ( ! strncmp ( search - > purepath , sp - > purepath , strlen ( search - > purepath ) ) )
if ( sp - > purepath [ strlen ( search - > purepath ) ] = = ' / ' ) //also ensures that the path gets shorter, avoiding infinite loops as it fights between base+home dirs.
break ;
}
if ( search )
sp = search ;
else
break ;
}
//
if ( sp )
return sp - > purepath ;
return NULL ;
}
2017-01-13 00:39:50 +00:00
//returns the package/'gamedir/foo.pk3' filename to tell the client to download
//unfortunately foo.pk3 may contain a 'bar.pk3' and downloading dir/foo.pk3/bar.pk3 won't work
//so if loc->search is dir/foo.pk3/bar.pk3 find dir/foo.pk3 instead
2019-06-21 03:59:46 +00:00
const char * FS_GetPackageDownloadFilename ( flocation_t * loc )
2016-07-12 00:40:13 +00:00
{
searchpath_t * sp , * search ;
for ( sp = loc - > search ; ; )
{
for ( search = com_searchpaths ; search ; search = search - > next )
{
2017-01-13 00:39:50 +00:00
if ( search ! = sp )
if ( search - > handle - > GeneratePureCRC ) //only consider files that have a pure hash. this excludes system paths
if ( ! strncmp ( search - > purepath , sp - > purepath , strlen ( search - > purepath ) ) )
if ( sp - > purepath [ strlen ( search - > purepath ) ] = = ' / ' ) //also ensures that the path gets shorter, avoiding infinite loops as it fights between base+home dirs.
break ;
2016-07-12 00:40:13 +00:00
}
if ( search )
sp = search ;
else
break ;
}
2019-03-15 04:01:46 +00:00
if ( sp & & strchr ( sp - > purepath , ' / ' ) & & sp - > handle - > GeneratePureCRC ) //never allow any packages that are directly sitting in the basedir.
2016-07-12 00:40:13 +00:00
return sp - > purepath ;
return NULL ;
}
2020-07-21 07:58:54 +00:00
qboolean FS_GetLocationForPackageHandle ( flocation_t * loc , searchpathfuncs_t * spath , const char * fname )
{
searchpath_t * search ;
for ( search = com_searchpaths ; search ; search = search - > next )
{
if ( search - > handle = = spath )
{
loc - > search = search ;
2023-01-09 05:12:39 +00:00
return spath - > FindFile ( spath , loc , fname , NULL ) = = FF_FOUND ;
2020-07-21 07:58:54 +00:00
}
}
return false ;
}
const char * FS_WhichPackForLocation ( flocation_t * loc , unsigned int flags )
2008-11-09 22:29:28 +00:00
{
char * ret ;
if ( ! loc - > search )
return NULL ; //huh? not a valid location.
2020-07-21 07:58:54 +00:00
if ( flags & WP_FULLPATH )
{
if ( flags & WP_REFERENCE )
loc - > search - > flags | = SPF_REFERENCED ;
return loc - > search - > purepath ;
}
else
2013-12-17 22:45:37 +00:00
{
2020-07-21 07:58:54 +00:00
ret = strchr ( loc - > search - > purepath , ' / ' ) ;
if ( ret )
2013-12-17 22:45:37 +00:00
{
2020-07-21 07:58:54 +00:00
ret + + ;
if ( ! strchr ( ret , ' / ' ) )
{
if ( flags & WP_REFERENCE )
loc - > search - > flags | = SPF_REFERENCED ;
return ret ;
}
2013-12-17 22:45:37 +00:00
}
}
return NULL ;
2008-11-09 22:29:28 +00:00
}
Added sys_openfile console command(and menu option) to web and flatpak(via cmake+dbus) builds, to 'install' packages on sandboxed systems a bit more easily.
Cmake: Add FTE_WERROR option, defaults to true in debug builds and off in release builds (in case future compilers have issues).
Cmake: Pull in libXscreensaver so we don't get interrupted by screensavers when playing demos.
Make: Added `make webcl-rel` for a web build without server bloat (eg for sites focused on demo playback. Yes, this means you XantoM).
fteqcc: Include the decompiler in fteqcc (non-gui) builds ('-d' arg).
fteqcc: Decompiler can now mostly handle hexen2 mods without any unknown opcodes.
Allow ezHud and OpenSSL to be compiled as in-engine plugins, potentially for web and windows ports respectively.
Web: Fix support for ogg vorbis. Add support for voip.
Web: Added basic support for WebXR.
QTV: Don't try seeking on unseekable qtv streams. Don't spam when developer 1 is set.
QTV: add support for some eztv extensions.
MVD: added hack to use ktx's vweps in mvd where mvdsv doesn't bother to record the info.
qwfwd: hack around a hack in qwfwd, allowing it to work again.
recording: favour qwd in single player, instead of mvd.
Protocol: reduce client memory used for precache names. Bump maximum precache counts - some people are just abusive, yes you Orl.
hexen2: add enough clientside protocol compat to play the demo included with h2mp. lacks effects.
in_xflip: restored this setting.
fs_hidesyspaths: new cvar, defaults to enabled so you won't find your username or whatever turning up in screenshots or the like. change it to 0 before debuging stuff eg via 'path'.
gl_overbright_models: Added cvar to match QS.
netchan: Added MTU determination, we'll no longer fail to connect when routers stupidly drop icmp packets.
Win: try a few other versions of xinput too.
CSQC: Added a CSQC_GenerateMaterial function, to give the csqc a chance to generate custom materials.
MenuQC: Added support for the skeletal objects API.
2024-04-09 17:13:59 +00:00
searchpath_t * FS_GetPackage ( const char * package )
2011-12-05 15:23:40 +00:00
{
searchpath_t * search ;
------------------------------------------------------------------------
r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines
removed MAX_VISEDICTS limit.
PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default.
TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW.
added android multitouch emulation for windows/rawinput (in_simulatemultitouch).
split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature.
now using utf-8 for windows consoles.
qcc warnings/errors now give clickable console links for quick+easy editing.
disabled menutint when the currently active item changes contrast or gamma (for OneManClan).
Added support for drawfont/drawfontscale.
tweaked the qcvm a little to reduce the number of pointers.
.doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up.
windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings.
fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen.
editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts.
Added support for .framegroups files for psk(psa) and iqm formats.
True support for ezquake's colour codes. Mutually exclusive with background colours.
path command output slightly more readable.
added support for digest_hex (MD4, SHA1, CRC16).
skingroups now colourmap correctly.
Fix terrain colour hints, and litdata from the wrong bsp.
fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported).
remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother.
fix v *= v.x and similar opcodes.
fteqcc: fixed support for áéÃóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported.
fteqcc: fixed '#if 1 == 3 && 4' parsing.
fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable.
fteqcc: copyright message now includes compile date instead.
fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile.
fteqccgui: the output window is now focused and scrolls down as compilation progresses.
pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue.
rewrote prespawn/modelist/soundlist code. server tracks progress now.
------------------------------------------------------------------------
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
2013-03-12 22:29:40 +00:00
for ( search = com_searchpaths ; search ; search = search - > next )
2011-12-05 15:23:40 +00:00
{
2014-06-24 03:02:32 +00:00
if ( ! Q_strcasecmp ( package , search - > purepath ) )
Added sys_openfile console command(and menu option) to web and flatpak(via cmake+dbus) builds, to 'install' packages on sandboxed systems a bit more easily.
Cmake: Add FTE_WERROR option, defaults to true in debug builds and off in release builds (in case future compilers have issues).
Cmake: Pull in libXscreensaver so we don't get interrupted by screensavers when playing demos.
Make: Added `make webcl-rel` for a web build without server bloat (eg for sites focused on demo playback. Yes, this means you XantoM).
fteqcc: Include the decompiler in fteqcc (non-gui) builds ('-d' arg).
fteqcc: Decompiler can now mostly handle hexen2 mods without any unknown opcodes.
Allow ezHud and OpenSSL to be compiled as in-engine plugins, potentially for web and windows ports respectively.
Web: Fix support for ogg vorbis. Add support for voip.
Web: Added basic support for WebXR.
QTV: Don't try seeking on unseekable qtv streams. Don't spam when developer 1 is set.
QTV: add support for some eztv extensions.
MVD: added hack to use ktx's vweps in mvd where mvdsv doesn't bother to record the info.
qwfwd: hack around a hack in qwfwd, allowing it to work again.
recording: favour qwd in single player, instead of mvd.
Protocol: reduce client memory used for precache names. Bump maximum precache counts - some people are just abusive, yes you Orl.
hexen2: add enough clientside protocol compat to play the demo included with h2mp. lacks effects.
in_xflip: restored this setting.
fs_hidesyspaths: new cvar, defaults to enabled so you won't find your username or whatever turning up in screenshots or the like. change it to 0 before debuging stuff eg via 'path'.
gl_overbright_models: Added cvar to match QS.
netchan: Added MTU determination, we'll no longer fail to connect when routers stupidly drop icmp packets.
Win: try a few other versions of xinput too.
CSQC: Added a CSQC_GenerateMaterial function, to give the csqc a chance to generate custom materials.
MenuQC: Added support for the skeletal objects API.
2024-04-09 17:13:59 +00:00
return search ;
2011-12-05 15:23:40 +00:00
}
Added sys_openfile console command(and menu option) to web and flatpak(via cmake+dbus) builds, to 'install' packages on sandboxed systems a bit more easily.
Cmake: Add FTE_WERROR option, defaults to true in debug builds and off in release builds (in case future compilers have issues).
Cmake: Pull in libXscreensaver so we don't get interrupted by screensavers when playing demos.
Make: Added `make webcl-rel` for a web build without server bloat (eg for sites focused on demo playback. Yes, this means you XantoM).
fteqcc: Include the decompiler in fteqcc (non-gui) builds ('-d' arg).
fteqcc: Decompiler can now mostly handle hexen2 mods without any unknown opcodes.
Allow ezHud and OpenSSL to be compiled as in-engine plugins, potentially for web and windows ports respectively.
Web: Fix support for ogg vorbis. Add support for voip.
Web: Added basic support for WebXR.
QTV: Don't try seeking on unseekable qtv streams. Don't spam when developer 1 is set.
QTV: add support for some eztv extensions.
MVD: added hack to use ktx's vweps in mvd where mvdsv doesn't bother to record the info.
qwfwd: hack around a hack in qwfwd, allowing it to work again.
recording: favour qwd in single player, instead of mvd.
Protocol: reduce client memory used for precache names. Bump maximum precache counts - some people are just abusive, yes you Orl.
hexen2: add enough clientside protocol compat to play the demo included with h2mp. lacks effects.
in_xflip: restored this setting.
fs_hidesyspaths: new cvar, defaults to enabled so you won't find your username or whatever turning up in screenshots or the like. change it to 0 before debuging stuff eg via 'path'.
gl_overbright_models: Added cvar to match QS.
netchan: Added MTU determination, we'll no longer fail to connect when routers stupidly drop icmp packets.
Win: try a few other versions of xinput too.
CSQC: Added a CSQC_GenerateMaterial function, to give the csqc a chance to generate custom materials.
MenuQC: Added support for the skeletal objects API.
2024-04-09 17:13:59 +00:00
return NULL ;
}
/*requires extension*/
qboolean FS_GetPackageDownloadable ( const char * package )
{
searchpath_t * search = FS_GetPackage ( package ) ;
if ( search )
return ! ( search - > flags & SPF_COPYPROTECTED ) ;
2011-12-05 15:23:40 +00:00
return false ;
}
2006-01-02 22:53:29 +00:00
char * FS_GetPackHashes ( char * buffer , int buffersize , qboolean referencedonly )
{
searchpath_t * search ;
buffersize - - ;
* buffer = 0 ;
if ( com_purepaths )
{
for ( search = com_purepaths ; search ; search = search - > nextpure )
{
Q_strncatz ( buffer , va ( " %i " , search - > crc_check ) , buffersize ) ;
}
return buffer ;
}
else
{
for ( search = com_searchpaths ; search ; search = search - > next )
{
if ( search - > crc_check )
{
Q_strncatz ( buffer , va ( " %i " , search - > crc_check ) , buffersize ) ;
}
}
return buffer ;
}
}
2011-12-05 15:23:40 +00:00
/*
referencedonly = 0 : show all paks
referencedonly = 1 : show only paks that are referenced ( q3 - compat )
referencedonly = 2 : show all paks , but paks that are referenced are prefixed with a star
ext = 0 : hide extensions ( q3 - compat )
ext = 1 : show extensions .
*/
char * FS_GetPackNames ( char * buffer , int buffersize , int referencedonly , qboolean ext )
2006-01-02 22:53:29 +00:00
{
2010-11-10 03:32:47 +00:00
char temp [ MAX_OSPATH ] ;
2008-11-09 22:29:28 +00:00
searchpath_t * search ;
buffersize - - ;
* buffer = 0 ;
2009-06-03 09:09:35 +00:00
2008-11-09 22:29:28 +00:00
if ( com_purepaths )
{
for ( search = com_purepaths ; search ; search = search - > nextpure )
{
2013-06-23 02:17:02 +00:00
if ( referencedonly = = 0 & & ! ( search - > flags & SPF_REFERENCED ) )
2011-12-05 15:23:40 +00:00
continue ;
2013-06-23 02:17:02 +00:00
if ( referencedonly = = 2 & & ( search - > flags & SPF_REFERENCED ) )
2011-12-05 15:23:40 +00:00
Q_strncatz ( buffer , " * " , buffersize ) ;
2011-10-27 16:16:29 +00:00
if ( ! ext )
{
COM_StripExtension ( search - > purepath , temp , sizeof ( temp ) ) ;
Q_strncatz ( buffer , va ( " %s " , temp ) , buffersize ) ;
}
else
{
Q_strncatz ( buffer , va ( " %s " , search - > purepath ) , buffersize ) ;
}
2008-11-09 22:29:28 +00:00
}
return buffer ;
}
else
{
for ( search = com_searchpaths ; search ; search = search - > next )
{
if ( search - > crc_check )
{
2013-06-23 02:17:02 +00:00
if ( referencedonly = = 0 & & ! ( search - > flags & SPF_REFERENCED ) )
2011-12-05 15:23:40 +00:00
continue ;
2013-06-23 02:17:02 +00:00
if ( referencedonly = = 2 & & ( search - > flags & SPF_REFERENCED ) )
------------------------------------------------------------------------
r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines
removed MAX_VISEDICTS limit.
PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default.
TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW.
added android multitouch emulation for windows/rawinput (in_simulatemultitouch).
split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature.
now using utf-8 for windows consoles.
qcc warnings/errors now give clickable console links for quick+easy editing.
disabled menutint when the currently active item changes contrast or gamma (for OneManClan).
Added support for drawfont/drawfontscale.
tweaked the qcvm a little to reduce the number of pointers.
.doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up.
windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings.
fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen.
editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts.
Added support for .framegroups files for psk(psa) and iqm formats.
True support for ezquake's colour codes. Mutually exclusive with background colours.
path command output slightly more readable.
added support for digest_hex (MD4, SHA1, CRC16).
skingroups now colourmap correctly.
Fix terrain colour hints, and litdata from the wrong bsp.
fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported).
remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother.
fix v *= v.x and similar opcodes.
fteqcc: fixed support for áéÃóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported.
fteqcc: fixed '#if 1 == 3 && 4' parsing.
fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable.
fteqcc: copyright message now includes compile date instead.
fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile.
fteqccgui: the output window is now focused and scrolls down as compilation progresses.
pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue.
rewrote prespawn/modelist/soundlist code. server tracks progress now.
------------------------------------------------------------------------
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
2013-03-12 22:29:40 +00:00
{
// '*' prefix is meant to mean 'referenced'.
//really all that means to the client is that it definitely wants to download it.
//if its copyrighted, the client shouldn't try to do so, as it won't be allowed.
2013-06-23 02:17:02 +00:00
if ( ! ( search - > flags & SPF_COPYPROTECTED ) )
------------------------------------------------------------------------
r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines
removed MAX_VISEDICTS limit.
PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default.
TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW.
added android multitouch emulation for windows/rawinput (in_simulatemultitouch).
split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature.
now using utf-8 for windows consoles.
qcc warnings/errors now give clickable console links for quick+easy editing.
disabled menutint when the currently active item changes contrast or gamma (for OneManClan).
Added support for drawfont/drawfontscale.
tweaked the qcvm a little to reduce the number of pointers.
.doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up.
windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings.
fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen.
editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts.
Added support for .framegroups files for psk(psa) and iqm formats.
True support for ezquake's colour codes. Mutually exclusive with background colours.
path command output slightly more readable.
added support for digest_hex (MD4, SHA1, CRC16).
skingroups now colourmap correctly.
Fix terrain colour hints, and litdata from the wrong bsp.
fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported).
remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother.
fix v *= v.x and similar opcodes.
fteqcc: fixed support for áéÃóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported.
fteqcc: fixed '#if 1 == 3 && 4' parsing.
fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable.
fteqcc: copyright message now includes compile date instead.
fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile.
fteqccgui: the output window is now focused and scrolls down as compilation progresses.
pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue.
rewrote prespawn/modelist/soundlist code. server tracks progress now.
------------------------------------------------------------------------
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
2013-03-12 22:29:40 +00:00
Q_strncatz ( buffer , " * " , buffersize ) ;
}
2011-12-05 15:23:40 +00:00
2011-10-27 16:16:29 +00:00
if ( ! ext )
{
COM_StripExtension ( search - > purepath , temp , sizeof ( temp ) ) ;
Q_strncatz ( buffer , va ( " %s " , temp ) , buffersize ) ;
}
else
{
Q_strncatz ( buffer , va ( " %s " , search - > purepath ) , buffersize ) ;
}
2008-11-09 22:29:28 +00:00
}
}
return buffer ;
}
2006-01-02 22:53:29 +00:00
}
2011-12-05 15:23:40 +00:00
void FS_ReferenceControl ( unsigned int refflag , unsigned int resetflags )
{
searchpath_t * s ;
2013-06-23 02:17:02 +00:00
refflag & = SPF_REFERENCED ;
resetflags & = SPF_REFERENCED ;
2011-12-05 15:23:40 +00:00
if ( resetflags )
{
for ( s = com_searchpaths ; s ; s = s - > next )
{
2013-06-23 02:17:02 +00:00
s - > flags & = ~ resetflags ;
2011-12-05 15:23:40 +00:00
}
}
fs_referencetype = refflag ;
}
2009-04-01 22:03:56 +00:00
//outbuf might not be written into
2020-02-26 00:37:52 +00:00
static const char * FS_GetCleanPath ( const char * pattern , qboolean silent , char * outbuf , int outlen )
2005-12-21 03:07:33 +00:00
{
2014-12-23 15:26:42 +00:00
const char * s ;
char * o ;
char * seg ;
2015-04-14 23:12:17 +00:00
char * end = outbuf + outlen ;
2023-01-09 05:12:39 +00:00
static float throttletimer ;
2009-04-01 22:03:56 +00:00
2014-12-23 15:26:42 +00:00
s = pattern ;
seg = o = outbuf ;
2021-05-27 11:33:55 +00:00
if ( ! pattern | | ! * pattern )
2016-09-09 18:46:08 +00:00
{
2023-01-09 05:12:39 +00:00
Con_ThrottlePrintf ( & throttletimer , 0 , " Error: Empty filename \n " ) ;
2016-09-09 18:46:08 +00:00
return NULL ;
}
2014-12-23 15:26:42 +00:00
for ( ; ; )
2005-12-21 03:07:33 +00:00
{
2015-04-14 23:12:17 +00:00
if ( o = = end )
{
2023-01-09 05:12:39 +00:00
Con_ThrottlePrintf ( & throttletimer , 0 , " Error: filename too long \n " ) ;
2015-04-14 23:12:17 +00:00
return NULL ;
}
2014-12-23 15:26:42 +00:00
if ( * s = = ' : ' )
2009-04-01 22:03:56 +00:00
{
2014-12-23 15:26:42 +00:00
if ( s = = pattern + 1 & & ( s [ 1 ] = = ' / ' | | s [ 1 ] = = ' \\ ' ) )
2023-01-09 05:12:39 +00:00
Con_ThrottlePrintf ( & throttletimer , 0 , " Error: absolute path in filename %s \n " , pattern ) ;
2014-12-23 15:26:42 +00:00
else
2023-01-09 05:12:39 +00:00
Con_ThrottlePrintf ( & throttletimer , 0 , " Error: alternative data stream in filename %s \n " , pattern ) ;
2014-12-23 15:26:42 +00:00
return NULL ;
2009-04-01 22:03:56 +00:00
}
2014-12-23 15:26:42 +00:00
else if ( * s = = ' \\ ' | | * s = = ' / ' | | ! * s )
{ //end of segment
2015-04-14 23:12:17 +00:00
if ( o = = seg )
2009-03-03 01:52:30 +00:00
{
2014-12-23 15:26:42 +00:00
if ( o = = outbuf )
{
2023-01-09 05:12:39 +00:00
Con_ThrottlePrintf ( & throttletimer , 0 , " Error: absolute path in filename %s \n " , pattern ) ;
2014-12-23 15:26:42 +00:00
return NULL ;
}
2015-05-14 03:06:58 +00:00
if ( ! * s )
{
* o + + = ' \0 ' ;
break ;
}
2023-01-09 05:12:39 +00:00
Con_ThrottlePrintf ( & throttletimer , 0 , " Error: empty directory name (%s) \n " , pattern ) ;
2009-03-03 01:52:30 +00:00
s + + ;
2014-12-23 15:26:42 +00:00
continue ;
}
//ignore any leading spaces in the name segment
//it should just make more stuff invalid
while ( * seg = = ' ' )
seg + + ;
2016-09-09 18:46:08 +00:00
if ( ! seg [ 0 ] )
{
2023-01-09 05:12:39 +00:00
Con_ThrottlePrintf ( & throttletimer , 0 , " Error: No filename (%s) \n " , pattern ) ;
2016-09-09 18:46:08 +00:00
return NULL ;
}
2014-12-23 15:26:42 +00:00
if ( seg [ 0 ] = = ' . ' )
{
if ( o = = seg + 1 )
2023-01-09 05:12:39 +00:00
Con_ThrottlePrintf ( & throttletimer , 0 , " Error: source directory (%s) \n " , pattern ) ;
2014-12-23 15:26:42 +00:00
else if ( seg [ 1 ] = = ' . ' )
2023-01-09 05:12:39 +00:00
Con_ThrottlePrintf ( & throttletimer , 0 , " Error: parent directory (%s) \n " , pattern ) ;
2014-12-23 15:26:42 +00:00
else
2023-01-09 05:12:39 +00:00
Con_ThrottlePrintf ( & throttletimer , 0 , " Error: hidden name (%s) \n " , pattern ) ;
2014-12-23 15:26:42 +00:00
return NULL ;
}
# if defined(_WIN32) || defined(__CYGWIN__)
//in win32, we use the //?/ trick to get around filename length restrictions.
//4-letter reserved paths: comX, lptX
//we'll allow this elsewhere to save cycles, just try to avoid running it on a fat32 or ntfs filesystem from linux
if ( ( ( seg [ 0 ] = = ' c ' | | seg [ 0 ] = = ' C ' ) & &
( seg [ 1 ] = = ' o ' | | seg [ 1 ] = = ' O ' ) & &
( seg [ 2 ] = = ' m ' | | seg [ 2 ] = = ' M ' ) & &
( seg [ 3 ] > = ' 0 ' & & seg [ 3 ] < = ' 9 ' ) ) | |
( ( seg [ 0 ] = = ' l ' | | seg [ 0 ] = = ' L ' ) & &
( seg [ 1 ] = = ' p ' | | seg [ 1 ] = = ' P ' ) & &
( seg [ 2 ] = = ' t ' | | seg [ 2 ] = = ' T ' ) & &
( seg [ 3 ] > = ' 0 ' & & seg [ 3 ] < = ' 9 ' ) ) )
{
if ( o = = seg + 4 | | seg [ 4 ] = = ' ' | | seg [ 4 ] = = ' \t ' | | seg [ 4 ] = = ' . ' )
{
2023-01-09 05:12:39 +00:00
Con_ThrottlePrintf ( & throttletimer , 0 , " Error: reserved name in path (%c%c%c%c in %s) \n " , seg [ 0 ] , seg [ 1 ] , seg [ 2 ] , seg [ 3 ] , pattern ) ;
2014-12-23 15:26:42 +00:00
return NULL ;
}
2009-03-03 01:52:30 +00:00
}
2014-12-23 15:26:42 +00:00
//3 letter reserved paths: con, nul, prn
if ( ( ( seg [ 0 ] = = ' c ' | | seg [ 0 ] = = ' C ' ) & &
( seg [ 1 ] = = ' o ' | | seg [ 1 ] = = ' O ' ) & &
( seg [ 2 ] = = ' n ' | | seg [ 2 ] = = ' N ' ) ) | |
( ( seg [ 0 ] = = ' p ' | | seg [ 0 ] = = ' P ' ) & &
( seg [ 1 ] = = ' r ' | | seg [ 1 ] = = ' R ' ) & &
( seg [ 2 ] = = ' n ' | | seg [ 2 ] = = ' N ' ) ) | |
( ( seg [ 0 ] = = ' n ' | | seg [ 0 ] = = ' N ' ) & &
( seg [ 1 ] = = ' u ' | | seg [ 1 ] = = ' U ' ) & &
( seg [ 2 ] = = ' l ' | | seg [ 2 ] = = ' L ' ) ) )
{
if ( o = = seg + 3 | | seg [ 3 ] = = ' ' | | seg [ 3 ] = = ' \t ' | | seg [ 3 ] = = ' . ' )
{
2023-01-09 05:12:39 +00:00
Con_ThrottlePrintf ( & throttletimer , 0 , " Error: reserved name in path (%c%c%c in %s) \n " , seg [ 0 ] , seg [ 1 ] , seg [ 2 ] , pattern ) ;
2014-12-23 15:26:42 +00:00
return NULL ;
}
}
# endif
if ( * s + + )
* o + + = ' / ' ;
else
{
* o + + = ' \0 ' ;
break ;
}
seg = o ;
2009-03-03 01:52:30 +00:00
}
2014-12-23 15:26:42 +00:00
else
* o + + = * s + + ;
2010-12-18 17:02:47 +00:00
}
2009-03-03 01:52:30 +00:00
2014-12-23 15:26:42 +00:00
// Sys_Printf("%s changed to %s\n", pattern, outbuf);
return outbuf ;
2005-12-21 03:07:33 +00:00
}
2018-10-11 10:31:23 +00:00
static vfsfile_t * VFS_Filter ( const char * filename , vfsfile_t * handle )
2006-02-11 02:09:43 +00:00
{
// char *ext;
2021-06-02 15:29:44 +00:00
if ( ! filename )
return handle ; //block any filtering (so we don't do stupid stuff like having servers pre-decompressing when downloading)
if ( ! handle | | ! handle - > ReadBytes | | handle - > seekstyle = = SS_UNSEEKABLE ) //only on readonly files for which we can undo any header read damage
2006-02-11 02:09:43 +00:00
return handle ;
2021-06-02 15:29:44 +00:00
// if (handle->seekstyle == SS_SLOW)
// return handle; //we only peek at the header, so rewinding shouldn't be too expensive at least...
// const char *ext = COM_GetFileExtension(filename, NULL);
# ifdef AVAIL_XZDEC
// if (!Q_strcasecmp(ext, ".xz"))
{
vfsfile_t * nh ;
nh = FS_XZ_DecompressReadFilter ( handle ) ;
if ( nh ! = handle )
return nh ;
}
# endif
2017-02-19 00:15:42 +00:00
# ifdef AVAIL_GZDEC
2014-02-07 08:38:40 +00:00
// if (!Q_strcasecmp(ext, ".gz"))
2006-02-11 02:09:43 +00:00
{
2013-06-23 02:17:02 +00:00
return FS_DecompressGZip ( handle , NULL ) ;
2006-02-11 02:09:43 +00:00
}
2009-04-01 22:03:56 +00:00
# endif
return handle ;
}
Added sys_openfile console command(and menu option) to web and flatpak(via cmake+dbus) builds, to 'install' packages on sandboxed systems a bit more easily.
Cmake: Add FTE_WERROR option, defaults to true in debug builds and off in release builds (in case future compilers have issues).
Cmake: Pull in libXscreensaver so we don't get interrupted by screensavers when playing demos.
Make: Added `make webcl-rel` for a web build without server bloat (eg for sites focused on demo playback. Yes, this means you XantoM).
fteqcc: Include the decompiler in fteqcc (non-gui) builds ('-d' arg).
fteqcc: Decompiler can now mostly handle hexen2 mods without any unknown opcodes.
Allow ezHud and OpenSSL to be compiled as in-engine plugins, potentially for web and windows ports respectively.
Web: Fix support for ogg vorbis. Add support for voip.
Web: Added basic support for WebXR.
QTV: Don't try seeking on unseekable qtv streams. Don't spam when developer 1 is set.
QTV: add support for some eztv extensions.
MVD: added hack to use ktx's vweps in mvd where mvdsv doesn't bother to record the info.
qwfwd: hack around a hack in qwfwd, allowing it to work again.
recording: favour qwd in single player, instead of mvd.
Protocol: reduce client memory used for precache names. Bump maximum precache counts - some people are just abusive, yes you Orl.
hexen2: add enough clientside protocol compat to play the demo included with h2mp. lacks effects.
in_xflip: restored this setting.
fs_hidesyspaths: new cvar, defaults to enabled so you won't find your username or whatever turning up in screenshots or the like. change it to 0 before debuging stuff eg via 'path'.
gl_overbright_models: Added cvar to match QS.
netchan: Added MTU determination, we'll no longer fail to connect when routers stupidly drop icmp packets.
Win: try a few other versions of xinput too.
CSQC: Added a CSQC_GenerateMaterial function, to give the csqc a chance to generate custom materials.
MenuQC: Added support for the skeletal objects API.
2024-04-09 17:13:59 +00:00
static qboolean FS_NativePath ( const char * fname , enum fs_relative relativeto , char * out , int outlen , qboolean fordisplay )
2009-04-01 22:03:56 +00:00
{
2017-11-23 07:46:39 +00:00
flocation_t loc ;
2014-03-30 08:55:06 +00:00
int i ;
2009-04-01 22:03:56 +00:00
char cleanname [ MAX_QPATH ] ;
2019-08-11 13:54:26 +00:00
char * last ;
qboolean wasbase ; //to handle out-of-order base/game dirs.
2023-04-03 00:33:35 +00:00
int nlen ;
2014-03-30 08:55:06 +00:00
Added sys_openfile console command(and menu option) to web and flatpak(via cmake+dbus) builds, to 'install' packages on sandboxed systems a bit more easily.
Cmake: Add FTE_WERROR option, defaults to true in debug builds and off in release builds (in case future compilers have issues).
Cmake: Pull in libXscreensaver so we don't get interrupted by screensavers when playing demos.
Make: Added `make webcl-rel` for a web build without server bloat (eg for sites focused on demo playback. Yes, this means you XantoM).
fteqcc: Include the decompiler in fteqcc (non-gui) builds ('-d' arg).
fteqcc: Decompiler can now mostly handle hexen2 mods without any unknown opcodes.
Allow ezHud and OpenSSL to be compiled as in-engine plugins, potentially for web and windows ports respectively.
Web: Fix support for ogg vorbis. Add support for voip.
Web: Added basic support for WebXR.
QTV: Don't try seeking on unseekable qtv streams. Don't spam when developer 1 is set.
QTV: add support for some eztv extensions.
MVD: added hack to use ktx's vweps in mvd where mvdsv doesn't bother to record the info.
qwfwd: hack around a hack in qwfwd, allowing it to work again.
recording: favour qwd in single player, instead of mvd.
Protocol: reduce client memory used for precache names. Bump maximum precache counts - some people are just abusive, yes you Orl.
hexen2: add enough clientside protocol compat to play the demo included with h2mp. lacks effects.
in_xflip: restored this setting.
fs_hidesyspaths: new cvar, defaults to enabled so you won't find your username or whatever turning up in screenshots or the like. change it to 0 before debuging stuff eg via 'path'.
gl_overbright_models: Added cvar to match QS.
netchan: Added MTU determination, we'll no longer fail to connect when routers stupidly drop icmp packets.
Win: try a few other versions of xinput too.
CSQC: Added a CSQC_GenerateMaterial function, to give the csqc a chance to generate custom materials.
MenuQC: Added support for the skeletal objects API.
2024-04-09 17:13:59 +00:00
if ( ! fs_hidesyspaths . ival )
fordisplay = false ; //just show system paths
2014-03-30 08:55:06 +00:00
if ( relativeto = = FS_SYSTEM )
{
Added sys_openfile console command(and menu option) to web and flatpak(via cmake+dbus) builds, to 'install' packages on sandboxed systems a bit more easily.
Cmake: Add FTE_WERROR option, defaults to true in debug builds and off in release builds (in case future compilers have issues).
Cmake: Pull in libXscreensaver so we don't get interrupted by screensavers when playing demos.
Make: Added `make webcl-rel` for a web build without server bloat (eg for sites focused on demo playback. Yes, this means you XantoM).
fteqcc: Include the decompiler in fteqcc (non-gui) builds ('-d' arg).
fteqcc: Decompiler can now mostly handle hexen2 mods without any unknown opcodes.
Allow ezHud and OpenSSL to be compiled as in-engine plugins, potentially for web and windows ports respectively.
Web: Fix support for ogg vorbis. Add support for voip.
Web: Added basic support for WebXR.
QTV: Don't try seeking on unseekable qtv streams. Don't spam when developer 1 is set.
QTV: add support for some eztv extensions.
MVD: added hack to use ktx's vweps in mvd where mvdsv doesn't bother to record the info.
qwfwd: hack around a hack in qwfwd, allowing it to work again.
recording: favour qwd in single player, instead of mvd.
Protocol: reduce client memory used for precache names. Bump maximum precache counts - some people are just abusive, yes you Orl.
hexen2: add enough clientside protocol compat to play the demo included with h2mp. lacks effects.
in_xflip: restored this setting.
fs_hidesyspaths: new cvar, defaults to enabled so you won't find your username or whatever turning up in screenshots or the like. change it to 0 before debuging stuff eg via 'path'.
gl_overbright_models: Added cvar to match QS.
netchan: Added MTU determination, we'll no longer fail to connect when routers stupidly drop icmp packets.
Win: try a few other versions of xinput too.
CSQC: Added a CSQC_GenerateMaterial function, to give the csqc a chance to generate custom materials.
MenuQC: Added support for the skeletal objects API.
2024-04-09 17:13:59 +00:00
//system is already the native path. we can just pass it through. perhaps we should clean it up first however, although that's just making sure all \ are /
if ( fordisplay )
{
if ( com_homepathenabled & & ! strncmp ( fname , com_homepath , strlen ( com_homepath ) ) ) //'FS_HOME'
Q_snprintfz ( out , outlen , " $homedir/%s " , fname + strlen ( com_homepath ) ) ;
else if ( ! strncmp ( fname , com_gamepath , strlen ( com_gamepath ) ) ) //FS_ROOT-THAT-ISNT-HOME
Q_snprintfz ( out , outlen , " $basedir/%s " , fname + strlen ( com_gamepath ) ) ;
else if ( host_parms . binarydir & & ! strncmp ( fname , host_parms . binarydir , strlen ( host_parms . binarydir ) ) ) //FS_BINARYDIR
Q_snprintfz ( out , outlen , " $bindir/%s " , fname + strlen ( host_parms . binarydir ) ) ;
# ifdef FTE_LIBRARY_PATH
else if ( ! strncmp ( fname , STRINGIFY ( FTE_LIBRARY_PATH ) " / " , strlen ( STRINGIFY ( FTE_LIBRARY_PATH ) " / " ) ) ) //FS_LIBRARYDIR
Q_snprintfz ( out , outlen , " $libdir/%s " , fname + strlen ( host_parms . binarydir ) ) ;
# endif
else //should try bindir
Q_snprintfz ( out , outlen , " $system/%s " , COM_SkipPath ( fname ) ) ; //FS_SYSTEM :(
}
else
Q_snprintfz ( out , outlen , " %s " , fname ) ;
2014-03-30 08:55:06 +00:00
for ( ; * out ; out + + )
{
if ( * out = = ' \\ ' )
* out = ' / ' ;
}
return true ;
}
2015-04-14 23:12:17 +00:00
if ( * fname = = 0 )
{
//this is sometimes used to query the actual path.
//don't alow it for other stuff though.
2023-04-03 00:33:35 +00:00
if ( relativeto ! = FS_ROOT & & relativeto ! = FS_BINARYPATH & & relativeto ! = FS_LIBRARYPATH & & relativeto ! = FS_GAMEONLY )
2015-04-14 23:12:17 +00:00
return false ;
}
else
{
2020-02-26 00:37:52 +00:00
fname = FS_GetCleanPath ( fname , false , cleanname , sizeof ( cleanname ) ) ;
2015-04-14 23:12:17 +00:00
if ( ! fname )
return false ;
}
2009-04-01 22:03:56 +00:00
switch ( relativeto )
{
2017-11-23 07:46:39 +00:00
case FS_GAME : //this is really for diagnostic type stuff...
if ( FS_FLocateFile ( fname , FSLF_IFFOUND , & loc ) )
{
Added sys_openfile console command(and menu option) to web and flatpak(via cmake+dbus) builds, to 'install' packages on sandboxed systems a bit more easily.
Cmake: Add FTE_WERROR option, defaults to true in debug builds and off in release builds (in case future compilers have issues).
Cmake: Pull in libXscreensaver so we don't get interrupted by screensavers when playing demos.
Make: Added `make webcl-rel` for a web build without server bloat (eg for sites focused on demo playback. Yes, this means you XantoM).
fteqcc: Include the decompiler in fteqcc (non-gui) builds ('-d' arg).
fteqcc: Decompiler can now mostly handle hexen2 mods without any unknown opcodes.
Allow ezHud and OpenSSL to be compiled as in-engine plugins, potentially for web and windows ports respectively.
Web: Fix support for ogg vorbis. Add support for voip.
Web: Added basic support for WebXR.
QTV: Don't try seeking on unseekable qtv streams. Don't spam when developer 1 is set.
QTV: add support for some eztv extensions.
MVD: added hack to use ktx's vweps in mvd where mvdsv doesn't bother to record the info.
qwfwd: hack around a hack in qwfwd, allowing it to work again.
recording: favour qwd in single player, instead of mvd.
Protocol: reduce client memory used for precache names. Bump maximum precache counts - some people are just abusive, yes you Orl.
hexen2: add enough clientside protocol compat to play the demo included with h2mp. lacks effects.
in_xflip: restored this setting.
fs_hidesyspaths: new cvar, defaults to enabled so you won't find your username or whatever turning up in screenshots or the like. change it to 0 before debuging stuff eg via 'path'.
gl_overbright_models: Added cvar to match QS.
netchan: Added MTU determination, we'll no longer fail to connect when routers stupidly drop icmp packets.
Win: try a few other versions of xinput too.
CSQC: Added a CSQC_GenerateMaterial function, to give the csqc a chance to generate custom materials.
MenuQC: Added support for the skeletal objects API.
2024-04-09 17:13:59 +00:00
if ( fordisplay )
{
if ( ! strncmp ( com_homepath , loc . search - > logicalpath , strlen ( com_homepath ) ) )
nlen = Q_snprintfz ( out , outlen , " $homedir/%s/%s " , loc . search - > purepath , fname ) ;
else
nlen = Q_snprintfz ( out , outlen , " $basedir/%s/%s " , loc . search - > purepath , fname ) ;
}
else
nlen = Q_snprintfz ( out , outlen , " %s/%s " , loc . search - > logicalpath , fname ) ;
2017-11-23 07:46:39 +00:00
break ;
}
//fallthrough
2009-04-01 22:03:56 +00:00
case FS_GAMEONLY :
2014-03-30 08:55:06 +00:00
if ( com_homepathenabled )
Added sys_openfile console command(and menu option) to web and flatpak(via cmake+dbus) builds, to 'install' packages on sandboxed systems a bit more easily.
Cmake: Add FTE_WERROR option, defaults to true in debug builds and off in release builds (in case future compilers have issues).
Cmake: Pull in libXscreensaver so we don't get interrupted by screensavers when playing demos.
Make: Added `make webcl-rel` for a web build without server bloat (eg for sites focused on demo playback. Yes, this means you XantoM).
fteqcc: Include the decompiler in fteqcc (non-gui) builds ('-d' arg).
fteqcc: Decompiler can now mostly handle hexen2 mods without any unknown opcodes.
Allow ezHud and OpenSSL to be compiled as in-engine plugins, potentially for web and windows ports respectively.
Web: Fix support for ogg vorbis. Add support for voip.
Web: Added basic support for WebXR.
QTV: Don't try seeking on unseekable qtv streams. Don't spam when developer 1 is set.
QTV: add support for some eztv extensions.
MVD: added hack to use ktx's vweps in mvd where mvdsv doesn't bother to record the info.
qwfwd: hack around a hack in qwfwd, allowing it to work again.
recording: favour qwd in single player, instead of mvd.
Protocol: reduce client memory used for precache names. Bump maximum precache counts - some people are just abusive, yes you Orl.
hexen2: add enough clientside protocol compat to play the demo included with h2mp. lacks effects.
in_xflip: restored this setting.
fs_hidesyspaths: new cvar, defaults to enabled so you won't find your username or whatever turning up in screenshots or the like. change it to 0 before debuging stuff eg via 'path'.
gl_overbright_models: Added cvar to match QS.
netchan: Added MTU determination, we'll no longer fail to connect when routers stupidly drop icmp packets.
Win: try a few other versions of xinput too.
CSQC: Added a CSQC_GenerateMaterial function, to give the csqc a chance to generate custom materials.
MenuQC: Added support for the skeletal objects API.
2024-04-09 17:13:59 +00:00
nlen = Q_snprintfz ( out , outlen , " %s%s/%s " , fordisplay ? " $homedir/ " : com_homepath , gamedirfile , fname ) ;
2009-04-01 22:03:56 +00:00
else
Added sys_openfile console command(and menu option) to web and flatpak(via cmake+dbus) builds, to 'install' packages on sandboxed systems a bit more easily.
Cmake: Add FTE_WERROR option, defaults to true in debug builds and off in release builds (in case future compilers have issues).
Cmake: Pull in libXscreensaver so we don't get interrupted by screensavers when playing demos.
Make: Added `make webcl-rel` for a web build without server bloat (eg for sites focused on demo playback. Yes, this means you XantoM).
fteqcc: Include the decompiler in fteqcc (non-gui) builds ('-d' arg).
fteqcc: Decompiler can now mostly handle hexen2 mods without any unknown opcodes.
Allow ezHud and OpenSSL to be compiled as in-engine plugins, potentially for web and windows ports respectively.
Web: Fix support for ogg vorbis. Add support for voip.
Web: Added basic support for WebXR.
QTV: Don't try seeking on unseekable qtv streams. Don't spam when developer 1 is set.
QTV: add support for some eztv extensions.
MVD: added hack to use ktx's vweps in mvd where mvdsv doesn't bother to record the info.
qwfwd: hack around a hack in qwfwd, allowing it to work again.
recording: favour qwd in single player, instead of mvd.
Protocol: reduce client memory used for precache names. Bump maximum precache counts - some people are just abusive, yes you Orl.
hexen2: add enough clientside protocol compat to play the demo included with h2mp. lacks effects.
in_xflip: restored this setting.
fs_hidesyspaths: new cvar, defaults to enabled so you won't find your username or whatever turning up in screenshots or the like. change it to 0 before debuging stuff eg via 'path'.
gl_overbright_models: Added cvar to match QS.
netchan: Added MTU determination, we'll no longer fail to connect when routers stupidly drop icmp packets.
Win: try a few other versions of xinput too.
CSQC: Added a CSQC_GenerateMaterial function, to give the csqc a chance to generate custom materials.
MenuQC: Added support for the skeletal objects API.
2024-04-09 17:13:59 +00:00
nlen = Q_snprintfz ( out , outlen , " %s%s/%s " , fordisplay ? " $basedir/ " : com_gamepath , gamedirfile , fname ) ;
2009-04-01 22:03:56 +00:00
break ;
2023-04-03 00:33:35 +00:00
case FS_LIBRARYPATH :
# ifdef FTE_LIBRARY_PATH
Added sys_openfile console command(and menu option) to web and flatpak(via cmake+dbus) builds, to 'install' packages on sandboxed systems a bit more easily.
Cmake: Add FTE_WERROR option, defaults to true in debug builds and off in release builds (in case future compilers have issues).
Cmake: Pull in libXscreensaver so we don't get interrupted by screensavers when playing demos.
Make: Added `make webcl-rel` for a web build without server bloat (eg for sites focused on demo playback. Yes, this means you XantoM).
fteqcc: Include the decompiler in fteqcc (non-gui) builds ('-d' arg).
fteqcc: Decompiler can now mostly handle hexen2 mods without any unknown opcodes.
Allow ezHud and OpenSSL to be compiled as in-engine plugins, potentially for web and windows ports respectively.
Web: Fix support for ogg vorbis. Add support for voip.
Web: Added basic support for WebXR.
QTV: Don't try seeking on unseekable qtv streams. Don't spam when developer 1 is set.
QTV: add support for some eztv extensions.
MVD: added hack to use ktx's vweps in mvd where mvdsv doesn't bother to record the info.
qwfwd: hack around a hack in qwfwd, allowing it to work again.
recording: favour qwd in single player, instead of mvd.
Protocol: reduce client memory used for precache names. Bump maximum precache counts - some people are just abusive, yes you Orl.
hexen2: add enough clientside protocol compat to play the demo included with h2mp. lacks effects.
in_xflip: restored this setting.
fs_hidesyspaths: new cvar, defaults to enabled so you won't find your username or whatever turning up in screenshots or the like. change it to 0 before debuging stuff eg via 'path'.
gl_overbright_models: Added cvar to match QS.
netchan: Added MTU determination, we'll no longer fail to connect when routers stupidly drop icmp packets.
Win: try a few other versions of xinput too.
CSQC: Added a CSQC_GenerateMaterial function, to give the csqc a chance to generate custom materials.
MenuQC: Added support for the skeletal objects API.
2024-04-09 17:13:59 +00:00
if ( fordisplay )
nlen = Q_snprintfz ( out , outlen , " $libdir/%s " , fname ) ;
else
nlen = Q_snprintfz ( out , outlen , STRINGIFY ( FTE_LIBRARY_PATH ) " /%s " , fname ) ;
2023-04-03 00:33:35 +00:00
break ;
# else
return false ;
# endif
2013-05-03 04:28:08 +00:00
case FS_BINARYPATH :
if ( host_parms . binarydir & & * host_parms . binarydir )
Added sys_openfile console command(and menu option) to web and flatpak(via cmake+dbus) builds, to 'install' packages on sandboxed systems a bit more easily.
Cmake: Add FTE_WERROR option, defaults to true in debug builds and off in release builds (in case future compilers have issues).
Cmake: Pull in libXscreensaver so we don't get interrupted by screensavers when playing demos.
Make: Added `make webcl-rel` for a web build without server bloat (eg for sites focused on demo playback. Yes, this means you XantoM).
fteqcc: Include the decompiler in fteqcc (non-gui) builds ('-d' arg).
fteqcc: Decompiler can now mostly handle hexen2 mods without any unknown opcodes.
Allow ezHud and OpenSSL to be compiled as in-engine plugins, potentially for web and windows ports respectively.
Web: Fix support for ogg vorbis. Add support for voip.
Web: Added basic support for WebXR.
QTV: Don't try seeking on unseekable qtv streams. Don't spam when developer 1 is set.
QTV: add support for some eztv extensions.
MVD: added hack to use ktx's vweps in mvd where mvdsv doesn't bother to record the info.
qwfwd: hack around a hack in qwfwd, allowing it to work again.
recording: favour qwd in single player, instead of mvd.
Protocol: reduce client memory used for precache names. Bump maximum precache counts - some people are just abusive, yes you Orl.
hexen2: add enough clientside protocol compat to play the demo included with h2mp. lacks effects.
in_xflip: restored this setting.
fs_hidesyspaths: new cvar, defaults to enabled so you won't find your username or whatever turning up in screenshots or the like. change it to 0 before debuging stuff eg via 'path'.
gl_overbright_models: Added cvar to match QS.
netchan: Added MTU determination, we'll no longer fail to connect when routers stupidly drop icmp packets.
Win: try a few other versions of xinput too.
CSQC: Added a CSQC_GenerateMaterial function, to give the csqc a chance to generate custom materials.
MenuQC: Added support for the skeletal objects API.
2024-04-09 17:13:59 +00:00
nlen = Q_snprintfz ( out , outlen , " %s%s " , fordisplay ? " $bindir/ " : host_parms . binarydir , fname ) ;
2013-05-03 04:28:08 +00:00
else
Added sys_openfile console command(and menu option) to web and flatpak(via cmake+dbus) builds, to 'install' packages on sandboxed systems a bit more easily.
Cmake: Add FTE_WERROR option, defaults to true in debug builds and off in release builds (in case future compilers have issues).
Cmake: Pull in libXscreensaver so we don't get interrupted by screensavers when playing demos.
Make: Added `make webcl-rel` for a web build without server bloat (eg for sites focused on demo playback. Yes, this means you XantoM).
fteqcc: Include the decompiler in fteqcc (non-gui) builds ('-d' arg).
fteqcc: Decompiler can now mostly handle hexen2 mods without any unknown opcodes.
Allow ezHud and OpenSSL to be compiled as in-engine plugins, potentially for web and windows ports respectively.
Web: Fix support for ogg vorbis. Add support for voip.
Web: Added basic support for WebXR.
QTV: Don't try seeking on unseekable qtv streams. Don't spam when developer 1 is set.
QTV: add support for some eztv extensions.
MVD: added hack to use ktx's vweps in mvd where mvdsv doesn't bother to record the info.
qwfwd: hack around a hack in qwfwd, allowing it to work again.
recording: favour qwd in single player, instead of mvd.
Protocol: reduce client memory used for precache names. Bump maximum precache counts - some people are just abusive, yes you Orl.
hexen2: add enough clientside protocol compat to play the demo included with h2mp. lacks effects.
in_xflip: restored this setting.
fs_hidesyspaths: new cvar, defaults to enabled so you won't find your username or whatever turning up in screenshots or the like. change it to 0 before debuging stuff eg via 'path'.
gl_overbright_models: Added cvar to match QS.
netchan: Added MTU determination, we'll no longer fail to connect when routers stupidly drop icmp packets.
Win: try a few other versions of xinput too.
CSQC: Added a CSQC_GenerateMaterial function, to give the csqc a chance to generate custom materials.
MenuQC: Added support for the skeletal objects API.
2024-04-09 17:13:59 +00:00
nlen = Q_snprintfz ( out , outlen , " %s%s " , fordisplay ? " $basedir/ " : host_parms . basedir , fname ) ;
2013-05-03 04:28:08 +00:00
break ;
2009-04-01 22:03:56 +00:00
case FS_ROOT :
2015-04-14 23:12:17 +00:00
if ( com_installer )
return false ;
2014-03-30 08:55:06 +00:00
if ( com_homepathenabled )
Added sys_openfile console command(and menu option) to web and flatpak(via cmake+dbus) builds, to 'install' packages on sandboxed systems a bit more easily.
Cmake: Add FTE_WERROR option, defaults to true in debug builds and off in release builds (in case future compilers have issues).
Cmake: Pull in libXscreensaver so we don't get interrupted by screensavers when playing demos.
Make: Added `make webcl-rel` for a web build without server bloat (eg for sites focused on demo playback. Yes, this means you XantoM).
fteqcc: Include the decompiler in fteqcc (non-gui) builds ('-d' arg).
fteqcc: Decompiler can now mostly handle hexen2 mods without any unknown opcodes.
Allow ezHud and OpenSSL to be compiled as in-engine plugins, potentially for web and windows ports respectively.
Web: Fix support for ogg vorbis. Add support for voip.
Web: Added basic support for WebXR.
QTV: Don't try seeking on unseekable qtv streams. Don't spam when developer 1 is set.
QTV: add support for some eztv extensions.
MVD: added hack to use ktx's vweps in mvd where mvdsv doesn't bother to record the info.
qwfwd: hack around a hack in qwfwd, allowing it to work again.
recording: favour qwd in single player, instead of mvd.
Protocol: reduce client memory used for precache names. Bump maximum precache counts - some people are just abusive, yes you Orl.
hexen2: add enough clientside protocol compat to play the demo included with h2mp. lacks effects.
in_xflip: restored this setting.
fs_hidesyspaths: new cvar, defaults to enabled so you won't find your username or whatever turning up in screenshots or the like. change it to 0 before debuging stuff eg via 'path'.
gl_overbright_models: Added cvar to match QS.
netchan: Added MTU determination, we'll no longer fail to connect when routers stupidly drop icmp packets.
Win: try a few other versions of xinput too.
CSQC: Added a CSQC_GenerateMaterial function, to give the csqc a chance to generate custom materials.
MenuQC: Added support for the skeletal objects API.
2024-04-09 17:13:59 +00:00
nlen = Q_snprintfz ( out , outlen , " %s%s " , fordisplay ? " $homedir/ " : com_homepath , fname ) ;
2009-04-01 22:03:56 +00:00
else
Added sys_openfile console command(and menu option) to web and flatpak(via cmake+dbus) builds, to 'install' packages on sandboxed systems a bit more easily.
Cmake: Add FTE_WERROR option, defaults to true in debug builds and off in release builds (in case future compilers have issues).
Cmake: Pull in libXscreensaver so we don't get interrupted by screensavers when playing demos.
Make: Added `make webcl-rel` for a web build without server bloat (eg for sites focused on demo playback. Yes, this means you XantoM).
fteqcc: Include the decompiler in fteqcc (non-gui) builds ('-d' arg).
fteqcc: Decompiler can now mostly handle hexen2 mods without any unknown opcodes.
Allow ezHud and OpenSSL to be compiled as in-engine plugins, potentially for web and windows ports respectively.
Web: Fix support for ogg vorbis. Add support for voip.
Web: Added basic support for WebXR.
QTV: Don't try seeking on unseekable qtv streams. Don't spam when developer 1 is set.
QTV: add support for some eztv extensions.
MVD: added hack to use ktx's vweps in mvd where mvdsv doesn't bother to record the info.
qwfwd: hack around a hack in qwfwd, allowing it to work again.
recording: favour qwd in single player, instead of mvd.
Protocol: reduce client memory used for precache names. Bump maximum precache counts - some people are just abusive, yes you Orl.
hexen2: add enough clientside protocol compat to play the demo included with h2mp. lacks effects.
in_xflip: restored this setting.
fs_hidesyspaths: new cvar, defaults to enabled so you won't find your username or whatever turning up in screenshots or the like. change it to 0 before debuging stuff eg via 'path'.
gl_overbright_models: Added cvar to match QS.
netchan: Added MTU determination, we'll no longer fail to connect when routers stupidly drop icmp packets.
Win: try a few other versions of xinput too.
CSQC: Added a CSQC_GenerateMaterial function, to give the csqc a chance to generate custom materials.
MenuQC: Added support for the skeletal objects API.
2024-04-09 17:13:59 +00:00
nlen = Q_snprintfz ( out , outlen , " %s%s " , fordisplay ? " $basedir/ " : com_gamepath , fname ) ;
2009-04-01 22:03:56 +00:00
break ;
2018-10-13 12:19:58 +00:00
case FS_BASEGAMEONLY : // fte/
2014-03-30 08:55:06 +00:00
last = NULL ;
2018-10-13 12:19:58 +00:00
for ( i = 0 ; i < countof ( fs_manifest - > gamepath ) ; i + + )
2014-03-30 08:55:06 +00:00
{
Too many changes, sorry.
Change revision displays, use the SVN commit date instead of using __DATE__ (when there's no local changes). This should allow reproducible builds.
Added s_al_disable cvar, to block openal and all the various problems people have had with it, without having to name an explicit fallback (which would vary by system).
Add mastervolume cvar (for ss).
Add r_shadows 2 (aka fake shadows - for ss).
Add scr_loadingscreen_aspect -1 setting, to disable levelshots entirely, also disables the progress bar (for ss).
Better support for some effectinfo hacks (for ss).
Added dpcompat_nocsqcwarnings (because of lazy+buggy mods like ss).
Rework the dpcsqc versions of project+unproject builtins for better compat (for ss).
Added dpcompat_csqcinputeventtypes to block unexpected csqc input events (for ss).
Better compat with DP's loadfont console command (for ss).
Added dpcompat_smallerfonts cvar to replicate a DP bug (for ss).
Detect dp's m_draw extension, to work around it (for ss).
Cvar dpcompat_ignoremodificationtimes added. A value of 0 favour the most recently modified file, 1 will use DP-like alphabetically sorted preferences (for ss).
loadfont builtin can now accept outline=1 in the sizes arg for slightly more readable fonts.
Fix bbox calcs for rotated entities, fix needed for r_ignorenetpvs 0.
Hackily parse emoji.json to provide :poop: etc suggestions.
Skip prediction entirely when there's no local entity info. This fixes stair-smoothing in xonotic.
screenshot_cubemap will now capture half-float images when saving to ktx or dds files.
Fix support for xcf files larger than 4gb, mostly to avoid compiler warnings.
Fixed size of gfx/loading.lmp when replacement textures are used.
Added mipmap support for rg8 and l8a8 textures.
r_hdr_framebuffer cvar updated to support format names instead of random negative numbers. Description updated to name some interesting ones.
Perform autoupdate _checks_ ONLY with explicit user confirmation (actual updating already needed user confirmation, but this extra step should reduce the chances of us getting wrongly accused of exfiltrating user data if we're run in a sandbox - we ONLY ever included the updating engine's version in the checks, though there's nothing we can do to avoid sending the user's router's IP).
Removed the 'summon satan all over your harddrive' quit message, in case paranoid security researchers are idiots and don't bother doing actual research.
Removed the triptohell.info and fte.triptohell.info certificates, they really need to stop being self-signed. The updates domain is still self-signed for autoupdates.
Video drivers are now able to report supported video resolutions, visible to menuqc. Currently only works with SDL2 builds.
Added setmousepos builtin. Should work with glx+win32 build.
VF_SKYROOM_CAMERA can now accept an extra two args, setviewprop(VF_SKYROOM_CAMERA, org, axis, degrees).
Removed v_skyroom_origin+v_skyroom_orientation cvars in favour just v_skyroom, which should make it behave more like the 'fog' command (used when csqc isn't overriding).
Added R_EndPolygonRibbon builtin to make it faster+easier to generate textured ribbon/cable/etc wide lines (for TW).
sdl: Fix up sys_sdl.c's file enumeration to support wildcards in directories.
edit command now displays end1.bin/end2.bin correctly, because we can.
Finally add support for f_modified - though ruleset_allow_larger_models and ruleset_allow_overlong_sounds generally make it redundant.
Fix threading race condition in sha1 lookups.
Updated f_ruleset to include the same extra flags reported by ezquake.
A mod's default.fmf file can now contain an eg 'mainconfig config.cfg' line (to explicitly set the main config saved with cfg_save_auto 1 etc).
fmf: basegame steam:GameName/GameDir can be used to try to load a mod directory from an installed steam game. The resulting gamedir will be read-only.
HOMEDIR CHANGE: use homedirs only if the basedir cannot be written or a homedir already exists, which should further reduce the probability of microsoft randomly uploading our data to their cloud (but mostly because its annoying to never know where your data is written).
Fixed buf_cvarlist, should work in xonotic now, and without segfaults.
Added an extra arg to URI_Get_Callback calls - the response size, also changed the tempstring to contain all bytes of the response, you need to be careful about nulls though.
Try to work around nvidia's forced-panning bug on x11 when changing video modes. This might screw with other programs.
sdl: support custom icons.
sdl: support choosing a specific display.
Added some documentation to menuqc builtins.
menusys: use outlines for slightly more readable fonts.
menusys: switch vid_width and vid_height combos into a single video mode combo to set both according to reported video modes.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5581 fc73d0e0-1445-4013-8a0c-d673dee63da5
2019-11-20 03:09:50 +00:00
if ( fs_manifest & & ( fs_manifest - > gamepath [ i ] . flags & GAMEDIR_BASEGAME ) & & fs_manifest - > gamepath [ i ] . path )
2014-03-30 08:55:06 +00:00
{
Too many changes, sorry.
Change revision displays, use the SVN commit date instead of using __DATE__ (when there's no local changes). This should allow reproducible builds.
Added s_al_disable cvar, to block openal and all the various problems people have had with it, without having to name an explicit fallback (which would vary by system).
Add mastervolume cvar (for ss).
Add r_shadows 2 (aka fake shadows - for ss).
Add scr_loadingscreen_aspect -1 setting, to disable levelshots entirely, also disables the progress bar (for ss).
Better support for some effectinfo hacks (for ss).
Added dpcompat_nocsqcwarnings (because of lazy+buggy mods like ss).
Rework the dpcsqc versions of project+unproject builtins for better compat (for ss).
Added dpcompat_csqcinputeventtypes to block unexpected csqc input events (for ss).
Better compat with DP's loadfont console command (for ss).
Added dpcompat_smallerfonts cvar to replicate a DP bug (for ss).
Detect dp's m_draw extension, to work around it (for ss).
Cvar dpcompat_ignoremodificationtimes added. A value of 0 favour the most recently modified file, 1 will use DP-like alphabetically sorted preferences (for ss).
loadfont builtin can now accept outline=1 in the sizes arg for slightly more readable fonts.
Fix bbox calcs for rotated entities, fix needed for r_ignorenetpvs 0.
Hackily parse emoji.json to provide :poop: etc suggestions.
Skip prediction entirely when there's no local entity info. This fixes stair-smoothing in xonotic.
screenshot_cubemap will now capture half-float images when saving to ktx or dds files.
Fix support for xcf files larger than 4gb, mostly to avoid compiler warnings.
Fixed size of gfx/loading.lmp when replacement textures are used.
Added mipmap support for rg8 and l8a8 textures.
r_hdr_framebuffer cvar updated to support format names instead of random negative numbers. Description updated to name some interesting ones.
Perform autoupdate _checks_ ONLY with explicit user confirmation (actual updating already needed user confirmation, but this extra step should reduce the chances of us getting wrongly accused of exfiltrating user data if we're run in a sandbox - we ONLY ever included the updating engine's version in the checks, though there's nothing we can do to avoid sending the user's router's IP).
Removed the 'summon satan all over your harddrive' quit message, in case paranoid security researchers are idiots and don't bother doing actual research.
Removed the triptohell.info and fte.triptohell.info certificates, they really need to stop being self-signed. The updates domain is still self-signed for autoupdates.
Video drivers are now able to report supported video resolutions, visible to menuqc. Currently only works with SDL2 builds.
Added setmousepos builtin. Should work with glx+win32 build.
VF_SKYROOM_CAMERA can now accept an extra two args, setviewprop(VF_SKYROOM_CAMERA, org, axis, degrees).
Removed v_skyroom_origin+v_skyroom_orientation cvars in favour just v_skyroom, which should make it behave more like the 'fog' command (used when csqc isn't overriding).
Added R_EndPolygonRibbon builtin to make it faster+easier to generate textured ribbon/cable/etc wide lines (for TW).
sdl: Fix up sys_sdl.c's file enumeration to support wildcards in directories.
edit command now displays end1.bin/end2.bin correctly, because we can.
Finally add support for f_modified - though ruleset_allow_larger_models and ruleset_allow_overlong_sounds generally make it redundant.
Fix threading race condition in sha1 lookups.
Updated f_ruleset to include the same extra flags reported by ezquake.
A mod's default.fmf file can now contain an eg 'mainconfig config.cfg' line (to explicitly set the main config saved with cfg_save_auto 1 etc).
fmf: basegame steam:GameName/GameDir can be used to try to load a mod directory from an installed steam game. The resulting gamedir will be read-only.
HOMEDIR CHANGE: use homedirs only if the basedir cannot be written or a homedir already exists, which should further reduce the probability of microsoft randomly uploading our data to their cloud (but mostly because its annoying to never know where your data is written).
Fixed buf_cvarlist, should work in xonotic now, and without segfaults.
Added an extra arg to URI_Get_Callback calls - the response size, also changed the tempstring to contain all bytes of the response, you need to be careful about nulls though.
Try to work around nvidia's forced-panning bug on x11 when changing video modes. This might screw with other programs.
sdl: support custom icons.
sdl: support choosing a specific display.
Added some documentation to menuqc builtins.
menusys: use outlines for slightly more readable fonts.
menusys: switch vid_width and vid_height combos into a single video mode combo to set both according to reported video modes.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5581 fc73d0e0-1445-4013-8a0c-d673dee63da5
2019-11-20 03:09:50 +00:00
if ( fs_manifest - > gamepath [ i ] . flags & GAMEDIR_SPECIAL )
2019-08-11 13:54:26 +00:00
continue ;
2014-03-30 08:55:06 +00:00
last = fs_manifest - > gamepath [ i ] . path ;
}
}
if ( ! last )
return false ; //eep?
if ( com_homepathenabled )
Added sys_openfile console command(and menu option) to web and flatpak(via cmake+dbus) builds, to 'install' packages on sandboxed systems a bit more easily.
Cmake: Add FTE_WERROR option, defaults to true in debug builds and off in release builds (in case future compilers have issues).
Cmake: Pull in libXscreensaver so we don't get interrupted by screensavers when playing demos.
Make: Added `make webcl-rel` for a web build without server bloat (eg for sites focused on demo playback. Yes, this means you XantoM).
fteqcc: Include the decompiler in fteqcc (non-gui) builds ('-d' arg).
fteqcc: Decompiler can now mostly handle hexen2 mods without any unknown opcodes.
Allow ezHud and OpenSSL to be compiled as in-engine plugins, potentially for web and windows ports respectively.
Web: Fix support for ogg vorbis. Add support for voip.
Web: Added basic support for WebXR.
QTV: Don't try seeking on unseekable qtv streams. Don't spam when developer 1 is set.
QTV: add support for some eztv extensions.
MVD: added hack to use ktx's vweps in mvd where mvdsv doesn't bother to record the info.
qwfwd: hack around a hack in qwfwd, allowing it to work again.
recording: favour qwd in single player, instead of mvd.
Protocol: reduce client memory used for precache names. Bump maximum precache counts - some people are just abusive, yes you Orl.
hexen2: add enough clientside protocol compat to play the demo included with h2mp. lacks effects.
in_xflip: restored this setting.
fs_hidesyspaths: new cvar, defaults to enabled so you won't find your username or whatever turning up in screenshots or the like. change it to 0 before debuging stuff eg via 'path'.
gl_overbright_models: Added cvar to match QS.
netchan: Added MTU determination, we'll no longer fail to connect when routers stupidly drop icmp packets.
Win: try a few other versions of xinput too.
CSQC: Added a CSQC_GenerateMaterial function, to give the csqc a chance to generate custom materials.
MenuQC: Added support for the skeletal objects API.
2024-04-09 17:13:59 +00:00
nlen = Q_snprintfz ( out , outlen , " %s%s/%s " , fordisplay ? " $homedir/ " : com_homepath , last , fname ) ;
2014-03-30 08:55:06 +00:00
else
Added sys_openfile console command(and menu option) to web and flatpak(via cmake+dbus) builds, to 'install' packages on sandboxed systems a bit more easily.
Cmake: Add FTE_WERROR option, defaults to true in debug builds and off in release builds (in case future compilers have issues).
Cmake: Pull in libXscreensaver so we don't get interrupted by screensavers when playing demos.
Make: Added `make webcl-rel` for a web build without server bloat (eg for sites focused on demo playback. Yes, this means you XantoM).
fteqcc: Include the decompiler in fteqcc (non-gui) builds ('-d' arg).
fteqcc: Decompiler can now mostly handle hexen2 mods without any unknown opcodes.
Allow ezHud and OpenSSL to be compiled as in-engine plugins, potentially for web and windows ports respectively.
Web: Fix support for ogg vorbis. Add support for voip.
Web: Added basic support for WebXR.
QTV: Don't try seeking on unseekable qtv streams. Don't spam when developer 1 is set.
QTV: add support for some eztv extensions.
MVD: added hack to use ktx's vweps in mvd where mvdsv doesn't bother to record the info.
qwfwd: hack around a hack in qwfwd, allowing it to work again.
recording: favour qwd in single player, instead of mvd.
Protocol: reduce client memory used for precache names. Bump maximum precache counts - some people are just abusive, yes you Orl.
hexen2: add enough clientside protocol compat to play the demo included with h2mp. lacks effects.
in_xflip: restored this setting.
fs_hidesyspaths: new cvar, defaults to enabled so you won't find your username or whatever turning up in screenshots or the like. change it to 0 before debuging stuff eg via 'path'.
gl_overbright_models: Added cvar to match QS.
netchan: Added MTU determination, we'll no longer fail to connect when routers stupidly drop icmp packets.
Win: try a few other versions of xinput too.
CSQC: Added a CSQC_GenerateMaterial function, to give the csqc a chance to generate custom materials.
MenuQC: Added support for the skeletal objects API.
2024-04-09 17:13:59 +00:00
nlen = Q_snprintfz ( out , outlen , " %s%s/%s " , fordisplay ? " $basedir/ " : com_gamepath , last , fname ) ;
2014-03-30 08:55:06 +00:00
break ;
2018-10-13 12:19:58 +00:00
case FS_PUBGAMEONLY : // $gamedir/ or qw/ but not fte/
2015-06-12 14:44:50 +00:00
last = NULL ;
2019-08-11 13:54:26 +00:00
wasbase = true ;
2018-10-13 12:19:58 +00:00
for ( i = 0 ; i < countof ( fs_manifest - > gamepath ) ; i + + )
2015-06-12 14:44:50 +00:00
{
2018-10-13 12:19:58 +00:00
if ( fs_manifest & & fs_manifest - > gamepath [ i ] . path )
2015-06-12 14:44:50 +00:00
{
Too many changes, sorry.
Change revision displays, use the SVN commit date instead of using __DATE__ (when there's no local changes). This should allow reproducible builds.
Added s_al_disable cvar, to block openal and all the various problems people have had with it, without having to name an explicit fallback (which would vary by system).
Add mastervolume cvar (for ss).
Add r_shadows 2 (aka fake shadows - for ss).
Add scr_loadingscreen_aspect -1 setting, to disable levelshots entirely, also disables the progress bar (for ss).
Better support for some effectinfo hacks (for ss).
Added dpcompat_nocsqcwarnings (because of lazy+buggy mods like ss).
Rework the dpcsqc versions of project+unproject builtins for better compat (for ss).
Added dpcompat_csqcinputeventtypes to block unexpected csqc input events (for ss).
Better compat with DP's loadfont console command (for ss).
Added dpcompat_smallerfonts cvar to replicate a DP bug (for ss).
Detect dp's m_draw extension, to work around it (for ss).
Cvar dpcompat_ignoremodificationtimes added. A value of 0 favour the most recently modified file, 1 will use DP-like alphabetically sorted preferences (for ss).
loadfont builtin can now accept outline=1 in the sizes arg for slightly more readable fonts.
Fix bbox calcs for rotated entities, fix needed for r_ignorenetpvs 0.
Hackily parse emoji.json to provide :poop: etc suggestions.
Skip prediction entirely when there's no local entity info. This fixes stair-smoothing in xonotic.
screenshot_cubemap will now capture half-float images when saving to ktx or dds files.
Fix support for xcf files larger than 4gb, mostly to avoid compiler warnings.
Fixed size of gfx/loading.lmp when replacement textures are used.
Added mipmap support for rg8 and l8a8 textures.
r_hdr_framebuffer cvar updated to support format names instead of random negative numbers. Description updated to name some interesting ones.
Perform autoupdate _checks_ ONLY with explicit user confirmation (actual updating already needed user confirmation, but this extra step should reduce the chances of us getting wrongly accused of exfiltrating user data if we're run in a sandbox - we ONLY ever included the updating engine's version in the checks, though there's nothing we can do to avoid sending the user's router's IP).
Removed the 'summon satan all over your harddrive' quit message, in case paranoid security researchers are idiots and don't bother doing actual research.
Removed the triptohell.info and fte.triptohell.info certificates, they really need to stop being self-signed. The updates domain is still self-signed for autoupdates.
Video drivers are now able to report supported video resolutions, visible to menuqc. Currently only works with SDL2 builds.
Added setmousepos builtin. Should work with glx+win32 build.
VF_SKYROOM_CAMERA can now accept an extra two args, setviewprop(VF_SKYROOM_CAMERA, org, axis, degrees).
Removed v_skyroom_origin+v_skyroom_orientation cvars in favour just v_skyroom, which should make it behave more like the 'fog' command (used when csqc isn't overriding).
Added R_EndPolygonRibbon builtin to make it faster+easier to generate textured ribbon/cable/etc wide lines (for TW).
sdl: Fix up sys_sdl.c's file enumeration to support wildcards in directories.
edit command now displays end1.bin/end2.bin correctly, because we can.
Finally add support for f_modified - though ruleset_allow_larger_models and ruleset_allow_overlong_sounds generally make it redundant.
Fix threading race condition in sha1 lookups.
Updated f_ruleset to include the same extra flags reported by ezquake.
A mod's default.fmf file can now contain an eg 'mainconfig config.cfg' line (to explicitly set the main config saved with cfg_save_auto 1 etc).
fmf: basegame steam:GameName/GameDir can be used to try to load a mod directory from an installed steam game. The resulting gamedir will be read-only.
HOMEDIR CHANGE: use homedirs only if the basedir cannot be written or a homedir already exists, which should further reduce the probability of microsoft randomly uploading our data to their cloud (but mostly because its annoying to never know where your data is written).
Fixed buf_cvarlist, should work in xonotic now, and without segfaults.
Added an extra arg to URI_Get_Callback calls - the response size, also changed the tempstring to contain all bytes of the response, you need to be careful about nulls though.
Try to work around nvidia's forced-panning bug on x11 when changing video modes. This might screw with other programs.
sdl: support custom icons.
sdl: support choosing a specific display.
Added some documentation to menuqc builtins.
menusys: use outlines for slightly more readable fonts.
menusys: switch vid_width and vid_height combos into a single video mode combo to set both according to reported video modes.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5581 fc73d0e0-1445-4013-8a0c-d673dee63da5
2019-11-20 03:09:50 +00:00
qboolean isbase = fs_manifest - > gamepath [ i ] . flags & GAMEDIR_BASEGAME ;
if ( fs_manifest - > gamepath [ i ] . flags & ( GAMEDIR_PRIVATE | GAMEDIR_SPECIAL ) )
2015-06-12 14:44:50 +00:00
continue ;
Too many changes, sorry.
Change revision displays, use the SVN commit date instead of using __DATE__ (when there's no local changes). This should allow reproducible builds.
Added s_al_disable cvar, to block openal and all the various problems people have had with it, without having to name an explicit fallback (which would vary by system).
Add mastervolume cvar (for ss).
Add r_shadows 2 (aka fake shadows - for ss).
Add scr_loadingscreen_aspect -1 setting, to disable levelshots entirely, also disables the progress bar (for ss).
Better support for some effectinfo hacks (for ss).
Added dpcompat_nocsqcwarnings (because of lazy+buggy mods like ss).
Rework the dpcsqc versions of project+unproject builtins for better compat (for ss).
Added dpcompat_csqcinputeventtypes to block unexpected csqc input events (for ss).
Better compat with DP's loadfont console command (for ss).
Added dpcompat_smallerfonts cvar to replicate a DP bug (for ss).
Detect dp's m_draw extension, to work around it (for ss).
Cvar dpcompat_ignoremodificationtimes added. A value of 0 favour the most recently modified file, 1 will use DP-like alphabetically sorted preferences (for ss).
loadfont builtin can now accept outline=1 in the sizes arg for slightly more readable fonts.
Fix bbox calcs for rotated entities, fix needed for r_ignorenetpvs 0.
Hackily parse emoji.json to provide :poop: etc suggestions.
Skip prediction entirely when there's no local entity info. This fixes stair-smoothing in xonotic.
screenshot_cubemap will now capture half-float images when saving to ktx or dds files.
Fix support for xcf files larger than 4gb, mostly to avoid compiler warnings.
Fixed size of gfx/loading.lmp when replacement textures are used.
Added mipmap support for rg8 and l8a8 textures.
r_hdr_framebuffer cvar updated to support format names instead of random negative numbers. Description updated to name some interesting ones.
Perform autoupdate _checks_ ONLY with explicit user confirmation (actual updating already needed user confirmation, but this extra step should reduce the chances of us getting wrongly accused of exfiltrating user data if we're run in a sandbox - we ONLY ever included the updating engine's version in the checks, though there's nothing we can do to avoid sending the user's router's IP).
Removed the 'summon satan all over your harddrive' quit message, in case paranoid security researchers are idiots and don't bother doing actual research.
Removed the triptohell.info and fte.triptohell.info certificates, they really need to stop being self-signed. The updates domain is still self-signed for autoupdates.
Video drivers are now able to report supported video resolutions, visible to menuqc. Currently only works with SDL2 builds.
Added setmousepos builtin. Should work with glx+win32 build.
VF_SKYROOM_CAMERA can now accept an extra two args, setviewprop(VF_SKYROOM_CAMERA, org, axis, degrees).
Removed v_skyroom_origin+v_skyroom_orientation cvars in favour just v_skyroom, which should make it behave more like the 'fog' command (used when csqc isn't overriding).
Added R_EndPolygonRibbon builtin to make it faster+easier to generate textured ribbon/cable/etc wide lines (for TW).
sdl: Fix up sys_sdl.c's file enumeration to support wildcards in directories.
edit command now displays end1.bin/end2.bin correctly, because we can.
Finally add support for f_modified - though ruleset_allow_larger_models and ruleset_allow_overlong_sounds generally make it redundant.
Fix threading race condition in sha1 lookups.
Updated f_ruleset to include the same extra flags reported by ezquake.
A mod's default.fmf file can now contain an eg 'mainconfig config.cfg' line (to explicitly set the main config saved with cfg_save_auto 1 etc).
fmf: basegame steam:GameName/GameDir can be used to try to load a mod directory from an installed steam game. The resulting gamedir will be read-only.
HOMEDIR CHANGE: use homedirs only if the basedir cannot be written or a homedir already exists, which should further reduce the probability of microsoft randomly uploading our data to their cloud (but mostly because its annoying to never know where your data is written).
Fixed buf_cvarlist, should work in xonotic now, and without segfaults.
Added an extra arg to URI_Get_Callback calls - the response size, also changed the tempstring to contain all bytes of the response, you need to be careful about nulls though.
Try to work around nvidia's forced-panning bug on x11 when changing video modes. This might screw with other programs.
sdl: support custom icons.
sdl: support choosing a specific display.
Added some documentation to menuqc builtins.
menusys: use outlines for slightly more readable fonts.
menusys: switch vid_width and vid_height combos into a single video mode combo to set both according to reported video modes.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5581 fc73d0e0-1445-4013-8a0c-d673dee63da5
2019-11-20 03:09:50 +00:00
if ( isbase & & ! wasbase )
2019-08-11 13:54:26 +00:00
continue ;
Too many changes, sorry.
Change revision displays, use the SVN commit date instead of using __DATE__ (when there's no local changes). This should allow reproducible builds.
Added s_al_disable cvar, to block openal and all the various problems people have had with it, without having to name an explicit fallback (which would vary by system).
Add mastervolume cvar (for ss).
Add r_shadows 2 (aka fake shadows - for ss).
Add scr_loadingscreen_aspect -1 setting, to disable levelshots entirely, also disables the progress bar (for ss).
Better support for some effectinfo hacks (for ss).
Added dpcompat_nocsqcwarnings (because of lazy+buggy mods like ss).
Rework the dpcsqc versions of project+unproject builtins for better compat (for ss).
Added dpcompat_csqcinputeventtypes to block unexpected csqc input events (for ss).
Better compat with DP's loadfont console command (for ss).
Added dpcompat_smallerfonts cvar to replicate a DP bug (for ss).
Detect dp's m_draw extension, to work around it (for ss).
Cvar dpcompat_ignoremodificationtimes added. A value of 0 favour the most recently modified file, 1 will use DP-like alphabetically sorted preferences (for ss).
loadfont builtin can now accept outline=1 in the sizes arg for slightly more readable fonts.
Fix bbox calcs for rotated entities, fix needed for r_ignorenetpvs 0.
Hackily parse emoji.json to provide :poop: etc suggestions.
Skip prediction entirely when there's no local entity info. This fixes stair-smoothing in xonotic.
screenshot_cubemap will now capture half-float images when saving to ktx or dds files.
Fix support for xcf files larger than 4gb, mostly to avoid compiler warnings.
Fixed size of gfx/loading.lmp when replacement textures are used.
Added mipmap support for rg8 and l8a8 textures.
r_hdr_framebuffer cvar updated to support format names instead of random negative numbers. Description updated to name some interesting ones.
Perform autoupdate _checks_ ONLY with explicit user confirmation (actual updating already needed user confirmation, but this extra step should reduce the chances of us getting wrongly accused of exfiltrating user data if we're run in a sandbox - we ONLY ever included the updating engine's version in the checks, though there's nothing we can do to avoid sending the user's router's IP).
Removed the 'summon satan all over your harddrive' quit message, in case paranoid security researchers are idiots and don't bother doing actual research.
Removed the triptohell.info and fte.triptohell.info certificates, they really need to stop being self-signed. The updates domain is still self-signed for autoupdates.
Video drivers are now able to report supported video resolutions, visible to menuqc. Currently only works with SDL2 builds.
Added setmousepos builtin. Should work with glx+win32 build.
VF_SKYROOM_CAMERA can now accept an extra two args, setviewprop(VF_SKYROOM_CAMERA, org, axis, degrees).
Removed v_skyroom_origin+v_skyroom_orientation cvars in favour just v_skyroom, which should make it behave more like the 'fog' command (used when csqc isn't overriding).
Added R_EndPolygonRibbon builtin to make it faster+easier to generate textured ribbon/cable/etc wide lines (for TW).
sdl: Fix up sys_sdl.c's file enumeration to support wildcards in directories.
edit command now displays end1.bin/end2.bin correctly, because we can.
Finally add support for f_modified - though ruleset_allow_larger_models and ruleset_allow_overlong_sounds generally make it redundant.
Fix threading race condition in sha1 lookups.
Updated f_ruleset to include the same extra flags reported by ezquake.
A mod's default.fmf file can now contain an eg 'mainconfig config.cfg' line (to explicitly set the main config saved with cfg_save_auto 1 etc).
fmf: basegame steam:GameName/GameDir can be used to try to load a mod directory from an installed steam game. The resulting gamedir will be read-only.
HOMEDIR CHANGE: use homedirs only if the basedir cannot be written or a homedir already exists, which should further reduce the probability of microsoft randomly uploading our data to their cloud (but mostly because its annoying to never know where your data is written).
Fixed buf_cvarlist, should work in xonotic now, and without segfaults.
Added an extra arg to URI_Get_Callback calls - the response size, also changed the tempstring to contain all bytes of the response, you need to be careful about nulls though.
Try to work around nvidia's forced-panning bug on x11 when changing video modes. This might screw with other programs.
sdl: support custom icons.
sdl: support choosing a specific display.
Added some documentation to menuqc builtins.
menusys: use outlines for slightly more readable fonts.
menusys: switch vid_width and vid_height combos into a single video mode combo to set both according to reported video modes.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5581 fc73d0e0-1445-4013-8a0c-d673dee63da5
2019-11-20 03:09:50 +00:00
wasbase = isbase ;
2015-06-12 14:44:50 +00:00
last = fs_manifest - > gamepath [ i ] . path ;
}
}
if ( ! last )
return false ; //eep?
if ( com_homepathenabled )
Added sys_openfile console command(and menu option) to web and flatpak(via cmake+dbus) builds, to 'install' packages on sandboxed systems a bit more easily.
Cmake: Add FTE_WERROR option, defaults to true in debug builds and off in release builds (in case future compilers have issues).
Cmake: Pull in libXscreensaver so we don't get interrupted by screensavers when playing demos.
Make: Added `make webcl-rel` for a web build without server bloat (eg for sites focused on demo playback. Yes, this means you XantoM).
fteqcc: Include the decompiler in fteqcc (non-gui) builds ('-d' arg).
fteqcc: Decompiler can now mostly handle hexen2 mods without any unknown opcodes.
Allow ezHud and OpenSSL to be compiled as in-engine plugins, potentially for web and windows ports respectively.
Web: Fix support for ogg vorbis. Add support for voip.
Web: Added basic support for WebXR.
QTV: Don't try seeking on unseekable qtv streams. Don't spam when developer 1 is set.
QTV: add support for some eztv extensions.
MVD: added hack to use ktx's vweps in mvd where mvdsv doesn't bother to record the info.
qwfwd: hack around a hack in qwfwd, allowing it to work again.
recording: favour qwd in single player, instead of mvd.
Protocol: reduce client memory used for precache names. Bump maximum precache counts - some people are just abusive, yes you Orl.
hexen2: add enough clientside protocol compat to play the demo included with h2mp. lacks effects.
in_xflip: restored this setting.
fs_hidesyspaths: new cvar, defaults to enabled so you won't find your username or whatever turning up in screenshots or the like. change it to 0 before debuging stuff eg via 'path'.
gl_overbright_models: Added cvar to match QS.
netchan: Added MTU determination, we'll no longer fail to connect when routers stupidly drop icmp packets.
Win: try a few other versions of xinput too.
CSQC: Added a CSQC_GenerateMaterial function, to give the csqc a chance to generate custom materials.
MenuQC: Added support for the skeletal objects API.
2024-04-09 17:13:59 +00:00
nlen = Q_snprintfz ( out , outlen , " %s%s/%s " , fordisplay ? " $homedir/ " : com_homepath , last , fname ) ;
2015-06-12 14:44:50 +00:00
else
Added sys_openfile console command(and menu option) to web and flatpak(via cmake+dbus) builds, to 'install' packages on sandboxed systems a bit more easily.
Cmake: Add FTE_WERROR option, defaults to true in debug builds and off in release builds (in case future compilers have issues).
Cmake: Pull in libXscreensaver so we don't get interrupted by screensavers when playing demos.
Make: Added `make webcl-rel` for a web build without server bloat (eg for sites focused on demo playback. Yes, this means you XantoM).
fteqcc: Include the decompiler in fteqcc (non-gui) builds ('-d' arg).
fteqcc: Decompiler can now mostly handle hexen2 mods without any unknown opcodes.
Allow ezHud and OpenSSL to be compiled as in-engine plugins, potentially for web and windows ports respectively.
Web: Fix support for ogg vorbis. Add support for voip.
Web: Added basic support for WebXR.
QTV: Don't try seeking on unseekable qtv streams. Don't spam when developer 1 is set.
QTV: add support for some eztv extensions.
MVD: added hack to use ktx's vweps in mvd where mvdsv doesn't bother to record the info.
qwfwd: hack around a hack in qwfwd, allowing it to work again.
recording: favour qwd in single player, instead of mvd.
Protocol: reduce client memory used for precache names. Bump maximum precache counts - some people are just abusive, yes you Orl.
hexen2: add enough clientside protocol compat to play the demo included with h2mp. lacks effects.
in_xflip: restored this setting.
fs_hidesyspaths: new cvar, defaults to enabled so you won't find your username or whatever turning up in screenshots or the like. change it to 0 before debuging stuff eg via 'path'.
gl_overbright_models: Added cvar to match QS.
netchan: Added MTU determination, we'll no longer fail to connect when routers stupidly drop icmp packets.
Win: try a few other versions of xinput too.
CSQC: Added a CSQC_GenerateMaterial function, to give the csqc a chance to generate custom materials.
MenuQC: Added support for the skeletal objects API.
2024-04-09 17:13:59 +00:00
nlen = Q_snprintfz ( out , outlen , " %s%s/%s " , fordisplay ? " $basedir/ " : com_gamepath , last , fname ) ;
2015-06-12 14:44:50 +00:00
break ;
2018-10-13 12:19:58 +00:00
case FS_PUBBASEGAMEONLY : // qw/ (fixme: should be the last non-private basedir)
2014-03-30 08:55:06 +00:00
last = NULL ;
2018-10-13 12:19:58 +00:00
for ( i = 0 ; i < countof ( fs_manifest - > gamepath ) ; i + + )
2014-03-30 08:55:06 +00:00
{
Too many changes, sorry.
Change revision displays, use the SVN commit date instead of using __DATE__ (when there's no local changes). This should allow reproducible builds.
Added s_al_disable cvar, to block openal and all the various problems people have had with it, without having to name an explicit fallback (which would vary by system).
Add mastervolume cvar (for ss).
Add r_shadows 2 (aka fake shadows - for ss).
Add scr_loadingscreen_aspect -1 setting, to disable levelshots entirely, also disables the progress bar (for ss).
Better support for some effectinfo hacks (for ss).
Added dpcompat_nocsqcwarnings (because of lazy+buggy mods like ss).
Rework the dpcsqc versions of project+unproject builtins for better compat (for ss).
Added dpcompat_csqcinputeventtypes to block unexpected csqc input events (for ss).
Better compat with DP's loadfont console command (for ss).
Added dpcompat_smallerfonts cvar to replicate a DP bug (for ss).
Detect dp's m_draw extension, to work around it (for ss).
Cvar dpcompat_ignoremodificationtimes added. A value of 0 favour the most recently modified file, 1 will use DP-like alphabetically sorted preferences (for ss).
loadfont builtin can now accept outline=1 in the sizes arg for slightly more readable fonts.
Fix bbox calcs for rotated entities, fix needed for r_ignorenetpvs 0.
Hackily parse emoji.json to provide :poop: etc suggestions.
Skip prediction entirely when there's no local entity info. This fixes stair-smoothing in xonotic.
screenshot_cubemap will now capture half-float images when saving to ktx or dds files.
Fix support for xcf files larger than 4gb, mostly to avoid compiler warnings.
Fixed size of gfx/loading.lmp when replacement textures are used.
Added mipmap support for rg8 and l8a8 textures.
r_hdr_framebuffer cvar updated to support format names instead of random negative numbers. Description updated to name some interesting ones.
Perform autoupdate _checks_ ONLY with explicit user confirmation (actual updating already needed user confirmation, but this extra step should reduce the chances of us getting wrongly accused of exfiltrating user data if we're run in a sandbox - we ONLY ever included the updating engine's version in the checks, though there's nothing we can do to avoid sending the user's router's IP).
Removed the 'summon satan all over your harddrive' quit message, in case paranoid security researchers are idiots and don't bother doing actual research.
Removed the triptohell.info and fte.triptohell.info certificates, they really need to stop being self-signed. The updates domain is still self-signed for autoupdates.
Video drivers are now able to report supported video resolutions, visible to menuqc. Currently only works with SDL2 builds.
Added setmousepos builtin. Should work with glx+win32 build.
VF_SKYROOM_CAMERA can now accept an extra two args, setviewprop(VF_SKYROOM_CAMERA, org, axis, degrees).
Removed v_skyroom_origin+v_skyroom_orientation cvars in favour just v_skyroom, which should make it behave more like the 'fog' command (used when csqc isn't overriding).
Added R_EndPolygonRibbon builtin to make it faster+easier to generate textured ribbon/cable/etc wide lines (for TW).
sdl: Fix up sys_sdl.c's file enumeration to support wildcards in directories.
edit command now displays end1.bin/end2.bin correctly, because we can.
Finally add support for f_modified - though ruleset_allow_larger_models and ruleset_allow_overlong_sounds generally make it redundant.
Fix threading race condition in sha1 lookups.
Updated f_ruleset to include the same extra flags reported by ezquake.
A mod's default.fmf file can now contain an eg 'mainconfig config.cfg' line (to explicitly set the main config saved with cfg_save_auto 1 etc).
fmf: basegame steam:GameName/GameDir can be used to try to load a mod directory from an installed steam game. The resulting gamedir will be read-only.
HOMEDIR CHANGE: use homedirs only if the basedir cannot be written or a homedir already exists, which should further reduce the probability of microsoft randomly uploading our data to their cloud (but mostly because its annoying to never know where your data is written).
Fixed buf_cvarlist, should work in xonotic now, and without segfaults.
Added an extra arg to URI_Get_Callback calls - the response size, also changed the tempstring to contain all bytes of the response, you need to be careful about nulls though.
Try to work around nvidia's forced-panning bug on x11 when changing video modes. This might screw with other programs.
sdl: support custom icons.
sdl: support choosing a specific display.
Added some documentation to menuqc builtins.
menusys: use outlines for slightly more readable fonts.
menusys: switch vid_width and vid_height combos into a single video mode combo to set both according to reported video modes.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5581 fc73d0e0-1445-4013-8a0c-d673dee63da5
2019-11-20 03:09:50 +00:00
if ( fs_manifest & & ( fs_manifest - > gamepath [ i ] . flags & GAMEDIR_BASEGAME ) & & fs_manifest - > gamepath [ i ] . path )
2014-03-30 08:55:06 +00:00
{
Too many changes, sorry.
Change revision displays, use the SVN commit date instead of using __DATE__ (when there's no local changes). This should allow reproducible builds.
Added s_al_disable cvar, to block openal and all the various problems people have had with it, without having to name an explicit fallback (which would vary by system).
Add mastervolume cvar (for ss).
Add r_shadows 2 (aka fake shadows - for ss).
Add scr_loadingscreen_aspect -1 setting, to disable levelshots entirely, also disables the progress bar (for ss).
Better support for some effectinfo hacks (for ss).
Added dpcompat_nocsqcwarnings (because of lazy+buggy mods like ss).
Rework the dpcsqc versions of project+unproject builtins for better compat (for ss).
Added dpcompat_csqcinputeventtypes to block unexpected csqc input events (for ss).
Better compat with DP's loadfont console command (for ss).
Added dpcompat_smallerfonts cvar to replicate a DP bug (for ss).
Detect dp's m_draw extension, to work around it (for ss).
Cvar dpcompat_ignoremodificationtimes added. A value of 0 favour the most recently modified file, 1 will use DP-like alphabetically sorted preferences (for ss).
loadfont builtin can now accept outline=1 in the sizes arg for slightly more readable fonts.
Fix bbox calcs for rotated entities, fix needed for r_ignorenetpvs 0.
Hackily parse emoji.json to provide :poop: etc suggestions.
Skip prediction entirely when there's no local entity info. This fixes stair-smoothing in xonotic.
screenshot_cubemap will now capture half-float images when saving to ktx or dds files.
Fix support for xcf files larger than 4gb, mostly to avoid compiler warnings.
Fixed size of gfx/loading.lmp when replacement textures are used.
Added mipmap support for rg8 and l8a8 textures.
r_hdr_framebuffer cvar updated to support format names instead of random negative numbers. Description updated to name some interesting ones.
Perform autoupdate _checks_ ONLY with explicit user confirmation (actual updating already needed user confirmation, but this extra step should reduce the chances of us getting wrongly accused of exfiltrating user data if we're run in a sandbox - we ONLY ever included the updating engine's version in the checks, though there's nothing we can do to avoid sending the user's router's IP).
Removed the 'summon satan all over your harddrive' quit message, in case paranoid security researchers are idiots and don't bother doing actual research.
Removed the triptohell.info and fte.triptohell.info certificates, they really need to stop being self-signed. The updates domain is still self-signed for autoupdates.
Video drivers are now able to report supported video resolutions, visible to menuqc. Currently only works with SDL2 builds.
Added setmousepos builtin. Should work with glx+win32 build.
VF_SKYROOM_CAMERA can now accept an extra two args, setviewprop(VF_SKYROOM_CAMERA, org, axis, degrees).
Removed v_skyroom_origin+v_skyroom_orientation cvars in favour just v_skyroom, which should make it behave more like the 'fog' command (used when csqc isn't overriding).
Added R_EndPolygonRibbon builtin to make it faster+easier to generate textured ribbon/cable/etc wide lines (for TW).
sdl: Fix up sys_sdl.c's file enumeration to support wildcards in directories.
edit command now displays end1.bin/end2.bin correctly, because we can.
Finally add support for f_modified - though ruleset_allow_larger_models and ruleset_allow_overlong_sounds generally make it redundant.
Fix threading race condition in sha1 lookups.
Updated f_ruleset to include the same extra flags reported by ezquake.
A mod's default.fmf file can now contain an eg 'mainconfig config.cfg' line (to explicitly set the main config saved with cfg_save_auto 1 etc).
fmf: basegame steam:GameName/GameDir can be used to try to load a mod directory from an installed steam game. The resulting gamedir will be read-only.
HOMEDIR CHANGE: use homedirs only if the basedir cannot be written or a homedir already exists, which should further reduce the probability of microsoft randomly uploading our data to their cloud (but mostly because its annoying to never know where your data is written).
Fixed buf_cvarlist, should work in xonotic now, and without segfaults.
Added an extra arg to URI_Get_Callback calls - the response size, also changed the tempstring to contain all bytes of the response, you need to be careful about nulls though.
Try to work around nvidia's forced-panning bug on x11 when changing video modes. This might screw with other programs.
sdl: support custom icons.
sdl: support choosing a specific display.
Added some documentation to menuqc builtins.
menusys: use outlines for slightly more readable fonts.
menusys: switch vid_width and vid_height combos into a single video mode combo to set both according to reported video modes.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5581 fc73d0e0-1445-4013-8a0c-d673dee63da5
2019-11-20 03:09:50 +00:00
if ( fs_manifest - > gamepath [ i ] . flags & ( GAMEDIR_PRIVATE | GAMEDIR_SPECIAL ) )
2014-03-30 08:55:06 +00:00
continue ;
last = fs_manifest - > gamepath [ i ] . path ;
}
}
if ( ! last )
return false ; //eep?
if ( com_homepathenabled )
Added sys_openfile console command(and menu option) to web and flatpak(via cmake+dbus) builds, to 'install' packages on sandboxed systems a bit more easily.
Cmake: Add FTE_WERROR option, defaults to true in debug builds and off in release builds (in case future compilers have issues).
Cmake: Pull in libXscreensaver so we don't get interrupted by screensavers when playing demos.
Make: Added `make webcl-rel` for a web build without server bloat (eg for sites focused on demo playback. Yes, this means you XantoM).
fteqcc: Include the decompiler in fteqcc (non-gui) builds ('-d' arg).
fteqcc: Decompiler can now mostly handle hexen2 mods without any unknown opcodes.
Allow ezHud and OpenSSL to be compiled as in-engine plugins, potentially for web and windows ports respectively.
Web: Fix support for ogg vorbis. Add support for voip.
Web: Added basic support for WebXR.
QTV: Don't try seeking on unseekable qtv streams. Don't spam when developer 1 is set.
QTV: add support for some eztv extensions.
MVD: added hack to use ktx's vweps in mvd where mvdsv doesn't bother to record the info.
qwfwd: hack around a hack in qwfwd, allowing it to work again.
recording: favour qwd in single player, instead of mvd.
Protocol: reduce client memory used for precache names. Bump maximum precache counts - some people are just abusive, yes you Orl.
hexen2: add enough clientside protocol compat to play the demo included with h2mp. lacks effects.
in_xflip: restored this setting.
fs_hidesyspaths: new cvar, defaults to enabled so you won't find your username or whatever turning up in screenshots or the like. change it to 0 before debuging stuff eg via 'path'.
gl_overbright_models: Added cvar to match QS.
netchan: Added MTU determination, we'll no longer fail to connect when routers stupidly drop icmp packets.
Win: try a few other versions of xinput too.
CSQC: Added a CSQC_GenerateMaterial function, to give the csqc a chance to generate custom materials.
MenuQC: Added support for the skeletal objects API.
2024-04-09 17:13:59 +00:00
nlen = Q_snprintfz ( out , outlen , " %s%s/%s " , fordisplay ? " $homedir/ " : com_homepath , last , fname ) ;
2009-04-01 22:03:56 +00:00
else
Added sys_openfile console command(and menu option) to web and flatpak(via cmake+dbus) builds, to 'install' packages on sandboxed systems a bit more easily.
Cmake: Add FTE_WERROR option, defaults to true in debug builds and off in release builds (in case future compilers have issues).
Cmake: Pull in libXscreensaver so we don't get interrupted by screensavers when playing demos.
Make: Added `make webcl-rel` for a web build without server bloat (eg for sites focused on demo playback. Yes, this means you XantoM).
fteqcc: Include the decompiler in fteqcc (non-gui) builds ('-d' arg).
fteqcc: Decompiler can now mostly handle hexen2 mods without any unknown opcodes.
Allow ezHud and OpenSSL to be compiled as in-engine plugins, potentially for web and windows ports respectively.
Web: Fix support for ogg vorbis. Add support for voip.
Web: Added basic support for WebXR.
QTV: Don't try seeking on unseekable qtv streams. Don't spam when developer 1 is set.
QTV: add support for some eztv extensions.
MVD: added hack to use ktx's vweps in mvd where mvdsv doesn't bother to record the info.
qwfwd: hack around a hack in qwfwd, allowing it to work again.
recording: favour qwd in single player, instead of mvd.
Protocol: reduce client memory used for precache names. Bump maximum precache counts - some people are just abusive, yes you Orl.
hexen2: add enough clientside protocol compat to play the demo included with h2mp. lacks effects.
in_xflip: restored this setting.
fs_hidesyspaths: new cvar, defaults to enabled so you won't find your username or whatever turning up in screenshots or the like. change it to 0 before debuging stuff eg via 'path'.
gl_overbright_models: Added cvar to match QS.
netchan: Added MTU determination, we'll no longer fail to connect when routers stupidly drop icmp packets.
Win: try a few other versions of xinput too.
CSQC: Added a CSQC_GenerateMaterial function, to give the csqc a chance to generate custom materials.
MenuQC: Added support for the skeletal objects API.
2024-04-09 17:13:59 +00:00
nlen = Q_snprintfz ( out , outlen , " %s%s/%s " , fordisplay ? " $basedir/ " : com_gamepath , last , fname ) ;
2009-04-01 22:03:56 +00:00
break ;
default :
2013-05-03 04:28:08 +00:00
Sys_Error ( " FS_NativePath case not handled \n " ) ;
2009-04-01 22:03:56 +00:00
}
2023-04-03 00:33:35 +00:00
return nlen < outlen ;
2006-02-11 02:09:43 +00:00
}
Added sys_openfile console command(and menu option) to web and flatpak(via cmake+dbus) builds, to 'install' packages on sandboxed systems a bit more easily.
Cmake: Add FTE_WERROR option, defaults to true in debug builds and off in release builds (in case future compilers have issues).
Cmake: Pull in libXscreensaver so we don't get interrupted by screensavers when playing demos.
Make: Added `make webcl-rel` for a web build without server bloat (eg for sites focused on demo playback. Yes, this means you XantoM).
fteqcc: Include the decompiler in fteqcc (non-gui) builds ('-d' arg).
fteqcc: Decompiler can now mostly handle hexen2 mods without any unknown opcodes.
Allow ezHud and OpenSSL to be compiled as in-engine plugins, potentially for web and windows ports respectively.
Web: Fix support for ogg vorbis. Add support for voip.
Web: Added basic support for WebXR.
QTV: Don't try seeking on unseekable qtv streams. Don't spam when developer 1 is set.
QTV: add support for some eztv extensions.
MVD: added hack to use ktx's vweps in mvd where mvdsv doesn't bother to record the info.
qwfwd: hack around a hack in qwfwd, allowing it to work again.
recording: favour qwd in single player, instead of mvd.
Protocol: reduce client memory used for precache names. Bump maximum precache counts - some people are just abusive, yes you Orl.
hexen2: add enough clientside protocol compat to play the demo included with h2mp. lacks effects.
in_xflip: restored this setting.
fs_hidesyspaths: new cvar, defaults to enabled so you won't find your username or whatever turning up in screenshots or the like. change it to 0 before debuging stuff eg via 'path'.
gl_overbright_models: Added cvar to match QS.
netchan: Added MTU determination, we'll no longer fail to connect when routers stupidly drop icmp packets.
Win: try a few other versions of xinput too.
CSQC: Added a CSQC_GenerateMaterial function, to give the csqc a chance to generate custom materials.
MenuQC: Added support for the skeletal objects API.
2024-04-09 17:13:59 +00:00
qboolean FS_SystemPath ( const char * fname , enum fs_relative relativeto , char * out , int outlen )
{
return FS_NativePath ( fname , relativeto , out , outlen , false ) ;
}
qboolean FS_DisplayPath ( const char * fname , enum fs_relative relativeto , char * out , int outlen )
{
if ( outlen )
* out = 0 ;
return FS_NativePath ( fname , relativeto , out , outlen , true ) ;
}
2015-06-14 01:28:01 +00:00
//returns false to stop the enumeration. check the return value of the fs enumerator to see if it was canceled by this return value.
static int QDECL FS_NullFSEnumerator ( const char * fname , qofs_t fsize , time_t mtime , void * parm , searchpathfuncs_t * spath )
{
2015-06-14 04:03:22 +00:00
return false ;
2015-06-14 01:28:01 +00:00
}
//opens a file in the same (writable) path that contains an existing version of the file or one of the other patterns listed
Added sys_openfile console command(and menu option) to web and flatpak(via cmake+dbus) builds, to 'install' packages on sandboxed systems a bit more easily.
Cmake: Add FTE_WERROR option, defaults to true in debug builds and off in release builds (in case future compilers have issues).
Cmake: Pull in libXscreensaver so we don't get interrupted by screensavers when playing demos.
Make: Added `make webcl-rel` for a web build without server bloat (eg for sites focused on demo playback. Yes, this means you XantoM).
fteqcc: Include the decompiler in fteqcc (non-gui) builds ('-d' arg).
fteqcc: Decompiler can now mostly handle hexen2 mods without any unknown opcodes.
Allow ezHud and OpenSSL to be compiled as in-engine plugins, potentially for web and windows ports respectively.
Web: Fix support for ogg vorbis. Add support for voip.
Web: Added basic support for WebXR.
QTV: Don't try seeking on unseekable qtv streams. Don't spam when developer 1 is set.
QTV: add support for some eztv extensions.
MVD: added hack to use ktx's vweps in mvd where mvdsv doesn't bother to record the info.
qwfwd: hack around a hack in qwfwd, allowing it to work again.
recording: favour qwd in single player, instead of mvd.
Protocol: reduce client memory used for precache names. Bump maximum precache counts - some people are just abusive, yes you Orl.
hexen2: add enough clientside protocol compat to play the demo included with h2mp. lacks effects.
in_xflip: restored this setting.
fs_hidesyspaths: new cvar, defaults to enabled so you won't find your username or whatever turning up in screenshots or the like. change it to 0 before debuging stuff eg via 'path'.
gl_overbright_models: Added cvar to match QS.
netchan: Added MTU determination, we'll no longer fail to connect when routers stupidly drop icmp packets.
Win: try a few other versions of xinput too.
CSQC: Added a CSQC_GenerateMaterial function, to give the csqc a chance to generate custom materials.
MenuQC: Added support for the skeletal objects API.
2024-04-09 17:13:59 +00:00
vfsfile_t * FS_OpenWithFriends ( const char * fname , char * displayname , size_t displaynamesize , int numfriends , . . . )
2015-06-14 01:28:01 +00:00
{
searchpath_t * search ;
searchpath_t * lastwritable = NULL ;
flocation_t loc ;
va_list ap ;
int i ;
char cleanname [ MAX_QPATH ] ;
2020-02-26 00:37:52 +00:00
fname = FS_GetCleanPath ( fname , false , cleanname , sizeof ( cleanname ) ) ;
2015-06-14 01:28:01 +00:00
if ( ! fname )
return NULL ;
for ( search = com_searchpaths ; search ; search = search - > next )
{
if ( ( search - > flags & SPF_EXPLICIT ) & & ( search - > flags & SPF_WRITABLE ) )
lastwritable = search ;
if ( search - > handle - > FindFile ( search - > handle , & loc , fname , NULL ) )
break ;
va_start ( ap , numfriends ) ;
for ( i = 0 ; i < numfriends ; i + + )
{
char * path = va_arg ( ap , char * ) ;
if ( ! search - > handle - > EnumerateFiles ( search - > handle , path , FS_NullFSEnumerator , NULL ) )
break ;
}
va_end ( ap ) ;
if ( i < numfriends )
break ;
}
if ( lastwritable )
{
Added sys_openfile console command(and menu option) to web and flatpak(via cmake+dbus) builds, to 'install' packages on sandboxed systems a bit more easily.
Cmake: Add FTE_WERROR option, defaults to true in debug builds and off in release builds (in case future compilers have issues).
Cmake: Pull in libXscreensaver so we don't get interrupted by screensavers when playing demos.
Make: Added `make webcl-rel` for a web build without server bloat (eg for sites focused on demo playback. Yes, this means you XantoM).
fteqcc: Include the decompiler in fteqcc (non-gui) builds ('-d' arg).
fteqcc: Decompiler can now mostly handle hexen2 mods without any unknown opcodes.
Allow ezHud and OpenSSL to be compiled as in-engine plugins, potentially for web and windows ports respectively.
Web: Fix support for ogg vorbis. Add support for voip.
Web: Added basic support for WebXR.
QTV: Don't try seeking on unseekable qtv streams. Don't spam when developer 1 is set.
QTV: add support for some eztv extensions.
MVD: added hack to use ktx's vweps in mvd where mvdsv doesn't bother to record the info.
qwfwd: hack around a hack in qwfwd, allowing it to work again.
recording: favour qwd in single player, instead of mvd.
Protocol: reduce client memory used for precache names. Bump maximum precache counts - some people are just abusive, yes you Orl.
hexen2: add enough clientside protocol compat to play the demo included with h2mp. lacks effects.
in_xflip: restored this setting.
fs_hidesyspaths: new cvar, defaults to enabled so you won't find your username or whatever turning up in screenshots or the like. change it to 0 before debuging stuff eg via 'path'.
gl_overbright_models: Added cvar to match QS.
netchan: Added MTU determination, we'll no longer fail to connect when routers stupidly drop icmp packets.
Win: try a few other versions of xinput too.
CSQC: Added a CSQC_GenerateMaterial function, to give the csqc a chance to generate custom materials.
MenuQC: Added support for the skeletal objects API.
2024-04-09 17:13:59 +00:00
char sysname [ MAX_OSPATH ] ;
vfsfile_t * f ;
2015-06-14 01:28:01 +00:00
//figure out the system path
Added sys_openfile console command(and menu option) to web and flatpak(via cmake+dbus) builds, to 'install' packages on sandboxed systems a bit more easily.
Cmake: Add FTE_WERROR option, defaults to true in debug builds and off in release builds (in case future compilers have issues).
Cmake: Pull in libXscreensaver so we don't get interrupted by screensavers when playing demos.
Make: Added `make webcl-rel` for a web build without server bloat (eg for sites focused on demo playback. Yes, this means you XantoM).
fteqcc: Include the decompiler in fteqcc (non-gui) builds ('-d' arg).
fteqcc: Decompiler can now mostly handle hexen2 mods without any unknown opcodes.
Allow ezHud and OpenSSL to be compiled as in-engine plugins, potentially for web and windows ports respectively.
Web: Fix support for ogg vorbis. Add support for voip.
Web: Added basic support for WebXR.
QTV: Don't try seeking on unseekable qtv streams. Don't spam when developer 1 is set.
QTV: add support for some eztv extensions.
MVD: added hack to use ktx's vweps in mvd where mvdsv doesn't bother to record the info.
qwfwd: hack around a hack in qwfwd, allowing it to work again.
recording: favour qwd in single player, instead of mvd.
Protocol: reduce client memory used for precache names. Bump maximum precache counts - some people are just abusive, yes you Orl.
hexen2: add enough clientside protocol compat to play the demo included with h2mp. lacks effects.
in_xflip: restored this setting.
fs_hidesyspaths: new cvar, defaults to enabled so you won't find your username or whatever turning up in screenshots or the like. change it to 0 before debuging stuff eg via 'path'.
gl_overbright_models: Added cvar to match QS.
netchan: Added MTU determination, we'll no longer fail to connect when routers stupidly drop icmp packets.
Win: try a few other versions of xinput too.
CSQC: Added a CSQC_GenerateMaterial function, to give the csqc a chance to generate custom materials.
MenuQC: Added support for the skeletal objects API.
2024-04-09 17:13:59 +00:00
Q_strncpyz ( sysname , lastwritable - > logicalpath , sizeof ( sysname ) ) ;
FS_CleanDir ( sysname , sizeof ( sysname ) ) ;
Q_strncatz ( sysname , fname , sizeof ( sysname ) ) ;
2015-06-14 01:28:01 +00:00
//create the dir if needed and open the file.
COM_CreatePath ( sysname ) ;
Added sys_openfile console command(and menu option) to web and flatpak(via cmake+dbus) builds, to 'install' packages on sandboxed systems a bit more easily.
Cmake: Add FTE_WERROR option, defaults to true in debug builds and off in release builds (in case future compilers have issues).
Cmake: Pull in libXscreensaver so we don't get interrupted by screensavers when playing demos.
Make: Added `make webcl-rel` for a web build without server bloat (eg for sites focused on demo playback. Yes, this means you XantoM).
fteqcc: Include the decompiler in fteqcc (non-gui) builds ('-d' arg).
fteqcc: Decompiler can now mostly handle hexen2 mods without any unknown opcodes.
Allow ezHud and OpenSSL to be compiled as in-engine plugins, potentially for web and windows ports respectively.
Web: Fix support for ogg vorbis. Add support for voip.
Web: Added basic support for WebXR.
QTV: Don't try seeking on unseekable qtv streams. Don't spam when developer 1 is set.
QTV: add support for some eztv extensions.
MVD: added hack to use ktx's vweps in mvd where mvdsv doesn't bother to record the info.
qwfwd: hack around a hack in qwfwd, allowing it to work again.
recording: favour qwd in single player, instead of mvd.
Protocol: reduce client memory used for precache names. Bump maximum precache counts - some people are just abusive, yes you Orl.
hexen2: add enough clientside protocol compat to play the demo included with h2mp. lacks effects.
in_xflip: restored this setting.
fs_hidesyspaths: new cvar, defaults to enabled so you won't find your username or whatever turning up in screenshots or the like. change it to 0 before debuging stuff eg via 'path'.
gl_overbright_models: Added cvar to match QS.
netchan: Added MTU determination, we'll no longer fail to connect when routers stupidly drop icmp packets.
Win: try a few other versions of xinput too.
CSQC: Added a CSQC_GenerateMaterial function, to give the csqc a chance to generate custom materials.
MenuQC: Added support for the skeletal objects API.
2024-04-09 17:13:59 +00:00
f = VFSOS_Open ( sysname , " wbp " ) ;
if ( fs_hidesyspaths . ival )
{
if ( * com_homepath & & ! strncmp ( com_homepath , lastwritable - > logicalpath , strlen ( com_homepath ) ) )
Q_snprintfz ( displayname , displaynamesize , " $homedir/%s/%s " , lastwritable - > purepath , fname ) ;
else
Q_snprintfz ( displayname , displaynamesize , " $basedir/%s/%s " , lastwritable - > purepath , fname ) ;
}
else
Q_strncpyz ( displayname , sysname , displaynamesize ) ;
return f ;
2015-06-14 01:28:01 +00:00
}
Added sys_openfile console command(and menu option) to web and flatpak(via cmake+dbus) builds, to 'install' packages on sandboxed systems a bit more easily.
Cmake: Add FTE_WERROR option, defaults to true in debug builds and off in release builds (in case future compilers have issues).
Cmake: Pull in libXscreensaver so we don't get interrupted by screensavers when playing demos.
Make: Added `make webcl-rel` for a web build without server bloat (eg for sites focused on demo playback. Yes, this means you XantoM).
fteqcc: Include the decompiler in fteqcc (non-gui) builds ('-d' arg).
fteqcc: Decompiler can now mostly handle hexen2 mods without any unknown opcodes.
Allow ezHud and OpenSSL to be compiled as in-engine plugins, potentially for web and windows ports respectively.
Web: Fix support for ogg vorbis. Add support for voip.
Web: Added basic support for WebXR.
QTV: Don't try seeking on unseekable qtv streams. Don't spam when developer 1 is set.
QTV: add support for some eztv extensions.
MVD: added hack to use ktx's vweps in mvd where mvdsv doesn't bother to record the info.
qwfwd: hack around a hack in qwfwd, allowing it to work again.
recording: favour qwd in single player, instead of mvd.
Protocol: reduce client memory used for precache names. Bump maximum precache counts - some people are just abusive, yes you Orl.
hexen2: add enough clientside protocol compat to play the demo included with h2mp. lacks effects.
in_xflip: restored this setting.
fs_hidesyspaths: new cvar, defaults to enabled so you won't find your username or whatever turning up in screenshots or the like. change it to 0 before debuging stuff eg via 'path'.
gl_overbright_models: Added cvar to match QS.
netchan: Added MTU determination, we'll no longer fail to connect when routers stupidly drop icmp packets.
Win: try a few other versions of xinput too.
CSQC: Added a CSQC_GenerateMaterial function, to give the csqc a chance to generate custom materials.
MenuQC: Added support for the skeletal objects API.
2024-04-09 17:13:59 +00:00
FS_DisplayPath ( fname , FS_GAMEONLY , displayname , displaynamesize ) ;
2015-06-14 01:28:01 +00:00
return NULL ;
}
2016-07-21 19:27:59 +00:00
//returns false if the string didn't fit. we're not trying to be clever and reallocate the buffer
2018-10-11 10:31:23 +00:00
static qboolean try_snprintf ( char * buffer , size_t size , const char * format , . . . )
2016-07-21 19:27:59 +00:00
{
size_t ret ;
va_list argptr ;
va_start ( argptr , format ) ;
# ifdef _WIN32
# undef _vsnprintf
ret = _vsnprintf ( buffer , size , format , argptr ) ;
# define _vsnprintf unsafe_vsnprintf
# else
ret = vsnprintf ( buffer , size , format , argptr ) ;
# endif
va_end ( argptr ) ;
if ( ret > size - 1 ) //should cope with microsoft's -1s and linuxes total-length return values.
return false ;
return true ;
}
2015-06-14 01:28:01 +00:00
/*locates and opens a file
modes :
r = read
w = write
a = append
t = text mode ( because windows sucks ) . binary is otherwise assumed .
p = persist ( ie : saved games and configs , but not downloads or large content )
*/
2018-06-02 08:55:57 +00:00
vfsfile_t * QDECL FS_OpenVFS ( const char * filename , const char * mode , enum fs_relative relativeto )
2005-12-21 03:07:33 +00:00
{
2009-04-01 22:03:56 +00:00
char cleanname [ MAX_QPATH ] ;
2005-12-21 03:07:33 +00:00
char fullname [ MAX_OSPATH ] ;
flocation_t loc ;
vfsfile_t * vfs ;
//eventually, this function will be the *ONLY* way to get at files
2017-12-15 06:56:40 +00:00
fs_accessed_time = realtime ;
2019-05-23 15:11:32 +00:00
if ( fs_readonly & & * mode = = ' w ' )
return NULL ;
2023-01-09 05:12:39 +00:00
if ( ! strncmp ( filename , " file: " , 5 ) )
{
if ( fs_allowfileuri | | relativeto = = FS_SYSTEM )
{
if ( Sys_ResolveFileURL ( filename , strlen ( filename ) , fullname , sizeof ( fullname ) ) )
return VFSOS_Open ( fullname , mode ) ;
}
return NULL ;
}
2014-03-30 08:55:06 +00:00
if ( relativeto = = FS_SYSTEM )
return VFSOS_Open ( filename , mode ) ;
2005-12-21 03:07:33 +00:00
2014-03-30 08:55:06 +00:00
//blanket-bans
2009-06-03 09:09:35 +00:00
2020-02-26 00:37:52 +00:00
filename = FS_GetCleanPath ( filename , false , cleanname , sizeof ( cleanname ) ) ;
2009-04-01 22:03:56 +00:00
if ( ! filename )
2005-12-21 03:07:33 +00:00
return NULL ;
2014-08-27 08:41:31 +00:00
# ifdef _DEBUG
2006-01-02 22:53:29 +00:00
if ( strcmp ( mode , " rb " ) )
2010-07-11 02:22:39 +00:00
if ( strcmp ( mode , " r+b " ) )
if ( strcmp ( mode , " wb " ) )
if ( strcmp ( mode , " w+b " ) )
if ( strcmp ( mode , " ab " ) )
2014-08-27 08:41:31 +00:00
if ( strcmp ( mode , " wbp " ) )
return NULL ; //urm, unable to write/append
# endif
2006-01-02 22:53:29 +00:00
2008-11-09 22:29:28 +00:00
//if there can only be one file (eg: write access) find out where it is.
2005-12-21 03:07:33 +00:00
switch ( relativeto )
{
2019-05-23 15:11:32 +00:00
case FS_GAMEONLY : //OS access only, no paks. Used for (re)writing files.
2017-02-19 00:15:42 +00:00
vfs = NULL ;
2019-05-23 15:11:32 +00:00
//FIXME: go via a searchpath, because then the fscache can be selectively updated
2014-03-30 08:55:06 +00:00
if ( com_homepathenabled )
2005-12-21 03:07:33 +00:00
{
2019-05-23 15:11:32 +00:00
if ( gameonly_homedir )
{
2021-10-05 05:05:50 +00:00
if ( ( * mode = = ' w ' & & gameonly_gamedir - > handle - > CreateFile )
2019-05-23 15:11:32 +00:00
? gameonly_homedir - > handle - > CreateFile ( gameonly_homedir - > handle , & loc , filename )
: gameonly_homedir - > handle - > FindFile ( gameonly_homedir - > handle , & loc , filename , NULL ) )
vfs = gameonly_homedir - > handle - > OpenVFS ( gameonly_homedir - > handle , & loc , mode ) ;
else
vfs = NULL ;
}
else
{
if ( ! try_snprintf ( fullname , sizeof ( fullname ) , " %s%s/%s " , com_homepath , gamedirfile , filename ) )
return NULL ;
if ( * mode = = ' w ' )
COM_CreatePath ( fullname ) ;
vfs = VFSOS_Open ( fullname , mode ) ;
}
2005-12-21 03:07:33 +00:00
}
2017-02-19 00:15:42 +00:00
if ( ! vfs & & * gamedirfile )
2014-03-31 17:06:41 +00:00
{
2019-05-23 15:11:32 +00:00
if ( gameonly_gamedir )
{
2021-10-05 05:05:50 +00:00
if ( ( * mode = = ' w ' & & gameonly_gamedir - > handle - > CreateFile )
2019-05-23 15:11:32 +00:00
? gameonly_gamedir - > handle - > CreateFile ( gameonly_gamedir - > handle , & loc , filename )
: gameonly_gamedir - > handle - > FindFile ( gameonly_gamedir - > handle , & loc , filename , NULL ) )
vfs = gameonly_gamedir - > handle - > OpenVFS ( gameonly_gamedir - > handle , & loc , mode ) ;
else
vfs = NULL ;
}
else
{
if ( ! try_snprintf ( fullname , sizeof ( fullname ) , " %s%s/%s " , com_gamepath , gamedirfile , filename ) )
return NULL ;
if ( * mode = = ' w ' )
COM_CreatePath ( fullname ) ;
vfs = VFSOS_Open ( fullname , mode ) ;
}
2014-03-31 17:06:41 +00:00
}
playdemo accepts https urls now. will start playing before the file has finished downloading, to avoid unnecessary delays.
reworked network addresses to separate address family and connection type. this should make banning people more reliable, as well as simplifying a whole load of logic (no need to check for ipv4 AND ipv6).
tcpconnect will keep trying to connect even if the connection wasn't instant, instead of giving up instantly.
rewrote tcp connections quite a bit. sv_port_tcp now handles qtv+qizmo+http+ws+rtcbroker+tls equivalents.
qtv_streamport is now a legacy cvar and now acts equivalently to sv_port_tcp (but still separate).
rewrote screenshot and video capture code to use strides. this solves image-is-upside down issues with vulkan.
ignore alt key in browser port. oh no! no more red text! oh no! no more alt-being-wrongly-down-and-being-unable-to-type-anything-without-forcing-alt-released!
reworked audio decoder interface. now has clearly defined success/unavailable/end-of-file results. this should solve a whole load of issues with audio streaming.
fixed various openal audio streaming issues too. openal also got some workarounds for emscripten's poor emulation.
fixed ogg decoder to retain sync properly if seeked.
updated menu_media a bit. now reads vorbis comments/id3v1 tags to get proper track names. also saves the playlist so you don't have to manually repopulate the list so it might actually be usable now (after how many years?)
r_stains now defaults to 0, and is no longer enabled by presets. use decals if you want that sort of thing.
added fs_noreexec cvar, so configs will not be reexeced on gamedir change. this also means defaults won't be reapplied, etc.
added 'nvvk' renderer on windows, using nvidia's vulkan-inside-opengl gl extension. mostly just to see how much slower it is.
fixed up the ftp server quite a lot. more complete, more compliant, and should do ipv6 properly to-boot. file transfers also threaded.
fixed potential crash inside runclientphys.
experimental sv_antilag=3 setting. totally untested. the aim is to avoid missing due to lagged knockbacks. may be expensive for the server.
browser port's websockets support fixed. experimental support for webrtc ('works for me', requires a broker server).
updated avplug(renamed to ffmpeg so people know what it is) to use ffmpeg 3.2.4 properly, with its new encoder api. should be much more robust... also added experimental audio decoder for game music etc (currently doesn't resample, so playback rates are screwed, disabled by cvar).
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5097 fc73d0e0-1445-4013-8a0c-d673dee63da5
2017-05-10 02:08:58 +00:00
if ( vfs | | ! ( * mode = = ' w ' | | * mode = = ' a ' ) )
dpp7: Treat 'dropped' c2s packets as choked when using dpp7 protocols. This is because the protocol provides no way to disambiguate, and I don't like false reports of packetloss (only reliables loss can be detected, and that's not frequent enough to be meaningful). Pings can still be determined with dpp7, for those few packets which are acked.
package manager: reworked to enable/disable plugins when downloaded, which can also be present-but-disabled.
package manager: display a confirmation prompt before applying changes. do not allow other changes to be made while applying. prompt may be skipped with 'pkg apply' in dedicated servers.
sv: downloads are no longer forced to lower case.
sv: added sv_demoAutoCompress cvar. set to 1 to directly record to *.mvd.gz
cl: properly support directly playing .mvd.gz files
menus: reworked to separate mouse and keyboard focus. mouse focus becomes keyboard focus only on mouse clicks. tooltips follow mouse cursors.
menus: cleaned up menu heirachy a little. now simpler.
server browser: changed 'hide *' filters to 'show *' instead. I felt it was more logical.
deluxmapping: changed to disabled, load, generate, like r_loadlit is.
render targets api now supports negative formats to mean nearest filtering, where filtering is part of texture state.
drawrotpic fixed, now batches and interacts with drawpic correctly.
drawline fixed, no interacts with draw* correctly, but still does not batch.
fixed saving games.
provide proper userinfo to nq clients, where supported.
qcc: catch string table overflows safely, giving errors instead of crashes. switch to 32bit statements if some over-sized function requires it.
qtv: some bigcoords support tweaks
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5073 fc73d0e0-1445-4013-8a0c-d673dee63da5
2017-03-21 05:27:07 +00:00
return vfs ;
//fall through
2019-02-20 17:21:10 +00:00
case FS_PUBGAMEONLY : //used for $gamedir/downloads
case FS_BASEGAMEONLY : //used for fte/configs/*
case FS_PUBBASEGAMEONLY : //used for qw/skins/*
Added sys_openfile console command(and menu option) to web and flatpak(via cmake+dbus) builds, to 'install' packages on sandboxed systems a bit more easily.
Cmake: Add FTE_WERROR option, defaults to true in debug builds and off in release builds (in case future compilers have issues).
Cmake: Pull in libXscreensaver so we don't get interrupted by screensavers when playing demos.
Make: Added `make webcl-rel` for a web build without server bloat (eg for sites focused on demo playback. Yes, this means you XantoM).
fteqcc: Include the decompiler in fteqcc (non-gui) builds ('-d' arg).
fteqcc: Decompiler can now mostly handle hexen2 mods without any unknown opcodes.
Allow ezHud and OpenSSL to be compiled as in-engine plugins, potentially for web and windows ports respectively.
Web: Fix support for ogg vorbis. Add support for voip.
Web: Added basic support for WebXR.
QTV: Don't try seeking on unseekable qtv streams. Don't spam when developer 1 is set.
QTV: add support for some eztv extensions.
MVD: added hack to use ktx's vweps in mvd where mvdsv doesn't bother to record the info.
qwfwd: hack around a hack in qwfwd, allowing it to work again.
recording: favour qwd in single player, instead of mvd.
Protocol: reduce client memory used for precache names. Bump maximum precache counts - some people are just abusive, yes you Orl.
hexen2: add enough clientside protocol compat to play the demo included with h2mp. lacks effects.
in_xflip: restored this setting.
fs_hidesyspaths: new cvar, defaults to enabled so you won't find your username or whatever turning up in screenshots or the like. change it to 0 before debuging stuff eg via 'path'.
gl_overbright_models: Added cvar to match QS.
netchan: Added MTU determination, we'll no longer fail to connect when routers stupidly drop icmp packets.
Win: try a few other versions of xinput too.
CSQC: Added a CSQC_GenerateMaterial function, to give the csqc a chance to generate custom materials.
MenuQC: Added support for the skeletal objects API.
2024-04-09 17:13:59 +00:00
if ( ! FS_SystemPath ( filename , relativeto , fullname , sizeof ( fullname ) ) )
2016-07-21 19:27:59 +00:00
return NULL ;
2015-06-12 14:44:50 +00:00
if ( * mode = = ' w ' )
COM_CreatePath ( fullname ) ;
return VFSOS_Open ( fullname , mode ) ;
2013-06-23 02:17:02 +00:00
case FS_GAME : //load from paks in preference to system paths. overwriting be damned.
Added sys_openfile console command(and menu option) to web and flatpak(via cmake+dbus) builds, to 'install' packages on sandboxed systems a bit more easily.
Cmake: Add FTE_WERROR option, defaults to true in debug builds and off in release builds (in case future compilers have issues).
Cmake: Pull in libXscreensaver so we don't get interrupted by screensavers when playing demos.
Make: Added `make webcl-rel` for a web build without server bloat (eg for sites focused on demo playback. Yes, this means you XantoM).
fteqcc: Include the decompiler in fteqcc (non-gui) builds ('-d' arg).
fteqcc: Decompiler can now mostly handle hexen2 mods without any unknown opcodes.
Allow ezHud and OpenSSL to be compiled as in-engine plugins, potentially for web and windows ports respectively.
Web: Fix support for ogg vorbis. Add support for voip.
Web: Added basic support for WebXR.
QTV: Don't try seeking on unseekable qtv streams. Don't spam when developer 1 is set.
QTV: add support for some eztv extensions.
MVD: added hack to use ktx's vweps in mvd where mvdsv doesn't bother to record the info.
qwfwd: hack around a hack in qwfwd, allowing it to work again.
recording: favour qwd in single player, instead of mvd.
Protocol: reduce client memory used for precache names. Bump maximum precache counts - some people are just abusive, yes you Orl.
hexen2: add enough clientside protocol compat to play the demo included with h2mp. lacks effects.
in_xflip: restored this setting.
fs_hidesyspaths: new cvar, defaults to enabled so you won't find your username or whatever turning up in screenshots or the like. change it to 0 before debuging stuff eg via 'path'.
gl_overbright_models: Added cvar to match QS.
netchan: Added MTU determination, we'll no longer fail to connect when routers stupidly drop icmp packets.
Win: try a few other versions of xinput too.
CSQC: Added a CSQC_GenerateMaterial function, to give the csqc a chance to generate custom materials.
MenuQC: Added support for the skeletal objects API.
2024-04-09 17:13:59 +00:00
if ( ! FS_SystemPath ( filename , relativeto , fullname , sizeof ( fullname ) ) )
2016-07-21 19:27:59 +00:00
return NULL ;
2006-03-11 05:12:33 +00:00
break ;
2023-04-21 11:36:13 +00:00
case FS_LIBRARYPATH :
2013-11-29 14:36:47 +00:00
case FS_BINARYPATH :
Added sys_openfile console command(and menu option) to web and flatpak(via cmake+dbus) builds, to 'install' packages on sandboxed systems a bit more easily.
Cmake: Add FTE_WERROR option, defaults to true in debug builds and off in release builds (in case future compilers have issues).
Cmake: Pull in libXscreensaver so we don't get interrupted by screensavers when playing demos.
Make: Added `make webcl-rel` for a web build without server bloat (eg for sites focused on demo playback. Yes, this means you XantoM).
fteqcc: Include the decompiler in fteqcc (non-gui) builds ('-d' arg).
fteqcc: Decompiler can now mostly handle hexen2 mods without any unknown opcodes.
Allow ezHud and OpenSSL to be compiled as in-engine plugins, potentially for web and windows ports respectively.
Web: Fix support for ogg vorbis. Add support for voip.
Web: Added basic support for WebXR.
QTV: Don't try seeking on unseekable qtv streams. Don't spam when developer 1 is set.
QTV: add support for some eztv extensions.
MVD: added hack to use ktx's vweps in mvd where mvdsv doesn't bother to record the info.
qwfwd: hack around a hack in qwfwd, allowing it to work again.
recording: favour qwd in single player, instead of mvd.
Protocol: reduce client memory used for precache names. Bump maximum precache counts - some people are just abusive, yes you Orl.
hexen2: add enough clientside protocol compat to play the demo included with h2mp. lacks effects.
in_xflip: restored this setting.
fs_hidesyspaths: new cvar, defaults to enabled so you won't find your username or whatever turning up in screenshots or the like. change it to 0 before debuging stuff eg via 'path'.
gl_overbright_models: Added cvar to match QS.
netchan: Added MTU determination, we'll no longer fail to connect when routers stupidly drop icmp packets.
Win: try a few other versions of xinput too.
CSQC: Added a CSQC_GenerateMaterial function, to give the csqc a chance to generate custom materials.
MenuQC: Added support for the skeletal objects API.
2024-04-09 17:13:59 +00:00
if ( ! FS_SystemPath ( filename , relativeto , fullname , sizeof ( fullname ) ) )
2016-07-21 19:27:59 +00:00
return NULL ;
2013-11-29 14:36:47 +00:00
if ( * mode = = ' w ' )
COM_CreatePath ( fullname ) ;
return VFSOS_Open ( fullname , mode ) ;
2013-06-23 02:17:02 +00:00
case FS_ROOT : //always bypass packs and gamedirs
2015-04-14 23:12:17 +00:00
if ( com_installer )
return NULL ;
2014-03-30 08:55:06 +00:00
if ( com_homepathenabled )
2005-12-21 03:07:33 +00:00
{
2016-07-21 19:27:59 +00:00
if ( ! try_snprintf ( fullname , sizeof ( fullname ) , " %s%s " , com_homepath , filename ) )
return NULL ;
2023-04-21 11:36:13 +00:00
if ( * mode = = ' w ' )
COM_CreatePath ( fullname ) ;
2005-12-21 03:07:33 +00:00
vfs = VFSOS_Open ( fullname , mode ) ;
if ( vfs )
return vfs ;
}
2016-07-21 19:27:59 +00:00
if ( ! try_snprintf ( fullname , sizeof ( fullname ) , " %s%s " , com_gamepath , filename ) )
return NULL ;
2023-04-21 11:36:13 +00:00
if ( * mode = = ' w ' )
COM_CreatePath ( fullname ) ;
2005-12-21 03:07:33 +00:00
return VFSOS_Open ( fullname , mode ) ;
default :
2006-03-11 05:12:33 +00:00
Sys_Error ( " FS_OpenVFS: Bad relative path (%i) " , relativeto ) ;
2005-12-21 03:07:33 +00:00
break ;
}
2015-10-11 11:34:58 +00:00
FS_FLocateFile ( filename , FSLF_IFFOUND , & loc ) ;
2005-12-21 03:07:33 +00:00
if ( loc . search )
{
2020-03-25 21:29:30 +00:00
return loc . search - > handle - > OpenVFS ( loc . search - > handle , & loc , mode ) ;
2005-12-21 03:07:33 +00:00
}
2006-01-02 23:46:44 +00:00
//if we're meant to be writing, best write to it.
2007-07-27 21:24:31 +00:00
if ( strchr ( mode , ' w ' ) | | strchr ( mode , ' a ' ) )
2011-02-25 04:22:14 +00:00
{
COM_CreatePath ( fullname ) ;
2006-01-02 23:46:44 +00:00
return VFSOS_Open ( fullname , mode ) ;
2011-02-25 04:22:14 +00:00
}
2005-12-21 03:07:33 +00:00
return NULL ;
}
playdemo accepts https urls now. will start playing before the file has finished downloading, to avoid unnecessary delays.
reworked network addresses to separate address family and connection type. this should make banning people more reliable, as well as simplifying a whole load of logic (no need to check for ipv4 AND ipv6).
tcpconnect will keep trying to connect even if the connection wasn't instant, instead of giving up instantly.
rewrote tcp connections quite a bit. sv_port_tcp now handles qtv+qizmo+http+ws+rtcbroker+tls equivalents.
qtv_streamport is now a legacy cvar and now acts equivalently to sv_port_tcp (but still separate).
rewrote screenshot and video capture code to use strides. this solves image-is-upside down issues with vulkan.
ignore alt key in browser port. oh no! no more red text! oh no! no more alt-being-wrongly-down-and-being-unable-to-type-anything-without-forcing-alt-released!
reworked audio decoder interface. now has clearly defined success/unavailable/end-of-file results. this should solve a whole load of issues with audio streaming.
fixed various openal audio streaming issues too. openal also got some workarounds for emscripten's poor emulation.
fixed ogg decoder to retain sync properly if seeked.
updated menu_media a bit. now reads vorbis comments/id3v1 tags to get proper track names. also saves the playlist so you don't have to manually repopulate the list so it might actually be usable now (after how many years?)
r_stains now defaults to 0, and is no longer enabled by presets. use decals if you want that sort of thing.
added fs_noreexec cvar, so configs will not be reexeced on gamedir change. this also means defaults won't be reapplied, etc.
added 'nvvk' renderer on windows, using nvidia's vulkan-inside-opengl gl extension. mostly just to see how much slower it is.
fixed up the ftp server quite a lot. more complete, more compliant, and should do ipv6 properly to-boot. file transfers also threaded.
fixed potential crash inside runclientphys.
experimental sv_antilag=3 setting. totally untested. the aim is to avoid missing due to lagged knockbacks. may be expensive for the server.
browser port's websockets support fixed. experimental support for webrtc ('works for me', requires a broker server).
updated avplug(renamed to ffmpeg so people know what it is) to use ffmpeg 3.2.4 properly, with its new encoder api. should be much more robust... also added experimental audio decoder for game music etc (currently doesn't resample, so playback rates are screwed, disabled by cvar).
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5097 fc73d0e0-1445-4013-8a0c-d673dee63da5
2017-05-10 02:08:58 +00:00
qboolean FS_GetLocMTime ( flocation_t * location , time_t * modtime )
{
* modtime = 0 ;
if ( ! location - > search - > handle - > FileStat | | ! location - > search - > handle - > FileStat ( location - > search - > handle , location , modtime ) )
return false ;
return true ;
}
2011-10-27 16:16:29 +00:00
/*opens a vfsfile from an already discovered location*/
2021-06-02 15:29:44 +00:00
vfsfile_t * FS_OpenReadLocation ( const char * fname , flocation_t * location )
2008-11-09 22:29:28 +00:00
{
if ( location - > search )
{
2021-06-02 15:29:44 +00:00
return VFS_Filter ( fname , location - > search - > handle - > OpenVFS ( location - > search - > handle , location , " rb " ) ) ;
2008-11-09 22:29:28 +00:00
}
return NULL ;
}
2012-04-24 07:59:11 +00:00
qboolean FS_Rename2 ( const char * oldf , const char * newf , enum fs_relative oldrelativeto , enum fs_relative newrelativeto )
2006-01-21 00:06:49 +00:00
{
char oldfullname [ MAX_OSPATH ] ;
char newfullname [ MAX_OSPATH ] ;
Added sys_openfile console command(and menu option) to web and flatpak(via cmake+dbus) builds, to 'install' packages on sandboxed systems a bit more easily.
Cmake: Add FTE_WERROR option, defaults to true in debug builds and off in release builds (in case future compilers have issues).
Cmake: Pull in libXscreensaver so we don't get interrupted by screensavers when playing demos.
Make: Added `make webcl-rel` for a web build without server bloat (eg for sites focused on demo playback. Yes, this means you XantoM).
fteqcc: Include the decompiler in fteqcc (non-gui) builds ('-d' arg).
fteqcc: Decompiler can now mostly handle hexen2 mods without any unknown opcodes.
Allow ezHud and OpenSSL to be compiled as in-engine plugins, potentially for web and windows ports respectively.
Web: Fix support for ogg vorbis. Add support for voip.
Web: Added basic support for WebXR.
QTV: Don't try seeking on unseekable qtv streams. Don't spam when developer 1 is set.
QTV: add support for some eztv extensions.
MVD: added hack to use ktx's vweps in mvd where mvdsv doesn't bother to record the info.
qwfwd: hack around a hack in qwfwd, allowing it to work again.
recording: favour qwd in single player, instead of mvd.
Protocol: reduce client memory used for precache names. Bump maximum precache counts - some people are just abusive, yes you Orl.
hexen2: add enough clientside protocol compat to play the demo included with h2mp. lacks effects.
in_xflip: restored this setting.
fs_hidesyspaths: new cvar, defaults to enabled so you won't find your username or whatever turning up in screenshots or the like. change it to 0 before debuging stuff eg via 'path'.
gl_overbright_models: Added cvar to match QS.
netchan: Added MTU determination, we'll no longer fail to connect when routers stupidly drop icmp packets.
Win: try a few other versions of xinput too.
CSQC: Added a CSQC_GenerateMaterial function, to give the csqc a chance to generate custom materials.
MenuQC: Added support for the skeletal objects API.
2024-04-09 17:13:59 +00:00
if ( ! FS_SystemPath ( oldf , oldrelativeto , oldfullname , sizeof ( oldfullname ) ) )
2012-04-24 07:59:11 +00:00
return false ;
Added sys_openfile console command(and menu option) to web and flatpak(via cmake+dbus) builds, to 'install' packages on sandboxed systems a bit more easily.
Cmake: Add FTE_WERROR option, defaults to true in debug builds and off in release builds (in case future compilers have issues).
Cmake: Pull in libXscreensaver so we don't get interrupted by screensavers when playing demos.
Make: Added `make webcl-rel` for a web build without server bloat (eg for sites focused on demo playback. Yes, this means you XantoM).
fteqcc: Include the decompiler in fteqcc (non-gui) builds ('-d' arg).
fteqcc: Decompiler can now mostly handle hexen2 mods without any unknown opcodes.
Allow ezHud and OpenSSL to be compiled as in-engine plugins, potentially for web and windows ports respectively.
Web: Fix support for ogg vorbis. Add support for voip.
Web: Added basic support for WebXR.
QTV: Don't try seeking on unseekable qtv streams. Don't spam when developer 1 is set.
QTV: add support for some eztv extensions.
MVD: added hack to use ktx's vweps in mvd where mvdsv doesn't bother to record the info.
qwfwd: hack around a hack in qwfwd, allowing it to work again.
recording: favour qwd in single player, instead of mvd.
Protocol: reduce client memory used for precache names. Bump maximum precache counts - some people are just abusive, yes you Orl.
hexen2: add enough clientside protocol compat to play the demo included with h2mp. lacks effects.
in_xflip: restored this setting.
fs_hidesyspaths: new cvar, defaults to enabled so you won't find your username or whatever turning up in screenshots or the like. change it to 0 before debuging stuff eg via 'path'.
gl_overbright_models: Added cvar to match QS.
netchan: Added MTU determination, we'll no longer fail to connect when routers stupidly drop icmp packets.
Win: try a few other versions of xinput too.
CSQC: Added a CSQC_GenerateMaterial function, to give the csqc a chance to generate custom materials.
MenuQC: Added support for the skeletal objects API.
2024-04-09 17:13:59 +00:00
if ( ! FS_SystemPath ( newf , newrelativeto , newfullname , sizeof ( newfullname ) ) )
2012-04-24 07:59:11 +00:00
return false ;
2006-01-28 06:41:20 +00:00
FS_CreatePath ( newf , newrelativeto ) ;
2020-01-02 05:48:05 +00:00
if ( Sys_Rename ( oldfullname , newfullname ) )
{
if ( oldrelativeto > = FS_GAME )
FS_FlushFSHashRemoved ( oldf ) ;
if ( newrelativeto > = FS_GAME )
FS_FlushFSHashWritten ( newf ) ;
return true ;
}
return false ;
2006-01-21 00:06:49 +00:00
}
2012-04-24 07:59:11 +00:00
qboolean FS_Rename ( const char * oldf , const char * newf , enum fs_relative relativeto )
2005-12-21 03:07:33 +00:00
{
2022-03-08 05:31:34 +00:00
char cleanold [ MAX_QPATH ] ;
char cleannew [ MAX_QPATH ] ;
if ( relativeto ! = FS_SYSTEM )
{
oldf = FS_GetCleanPath ( oldf , false , cleanold , sizeof ( cleanold ) ) ;
newf = FS_GetCleanPath ( newf , false , cleannew , sizeof ( cleannew ) ) ;
}
2009-04-01 22:03:56 +00:00
return FS_Rename2 ( oldf , newf , relativeto , relativeto ) ;
2005-12-21 03:07:33 +00:00
}
2012-04-24 07:59:11 +00:00
qboolean FS_Remove ( const char * fname , enum fs_relative relativeto )
2005-12-21 03:07:33 +00:00
{
2006-01-28 06:41:20 +00:00
char fullname [ MAX_OSPATH ] ;
Added sys_openfile console command(and menu option) to web and flatpak(via cmake+dbus) builds, to 'install' packages on sandboxed systems a bit more easily.
Cmake: Add FTE_WERROR option, defaults to true in debug builds and off in release builds (in case future compilers have issues).
Cmake: Pull in libXscreensaver so we don't get interrupted by screensavers when playing demos.
Make: Added `make webcl-rel` for a web build without server bloat (eg for sites focused on demo playback. Yes, this means you XantoM).
fteqcc: Include the decompiler in fteqcc (non-gui) builds ('-d' arg).
fteqcc: Decompiler can now mostly handle hexen2 mods without any unknown opcodes.
Allow ezHud and OpenSSL to be compiled as in-engine plugins, potentially for web and windows ports respectively.
Web: Fix support for ogg vorbis. Add support for voip.
Web: Added basic support for WebXR.
QTV: Don't try seeking on unseekable qtv streams. Don't spam when developer 1 is set.
QTV: add support for some eztv extensions.
MVD: added hack to use ktx's vweps in mvd where mvdsv doesn't bother to record the info.
qwfwd: hack around a hack in qwfwd, allowing it to work again.
recording: favour qwd in single player, instead of mvd.
Protocol: reduce client memory used for precache names. Bump maximum precache counts - some people are just abusive, yes you Orl.
hexen2: add enough clientside protocol compat to play the demo included with h2mp. lacks effects.
in_xflip: restored this setting.
fs_hidesyspaths: new cvar, defaults to enabled so you won't find your username or whatever turning up in screenshots or the like. change it to 0 before debuging stuff eg via 'path'.
gl_overbright_models: Added cvar to match QS.
netchan: Added MTU determination, we'll no longer fail to connect when routers stupidly drop icmp packets.
Win: try a few other versions of xinput too.
CSQC: Added a CSQC_GenerateMaterial function, to give the csqc a chance to generate custom materials.
MenuQC: Added support for the skeletal objects API.
2024-04-09 17:13:59 +00:00
if ( ! FS_SystemPath ( fname , relativeto , fullname , sizeof ( fullname ) ) )
2012-04-24 07:59:11 +00:00
return false ;
2006-01-28 06:41:20 +00:00
2020-01-02 05:48:05 +00:00
if ( Sys_remove ( fullname ) )
{
if ( relativeto > = FS_GAME )
FS_FlushFSHashRemoved ( fname ) ;
return true ;
}
return false ;
2005-12-21 03:07:33 +00:00
}
2020-04-19 01:23:32 +00:00
static int QDECL FS_RemoveTreeCallback ( const char * fname , qofs_t fsize , time_t mtime , void * parm , searchpathfuncs_t * spath )
{
char fullname [ MAX_OSPATH ] ;
if ( * fname & & fname [ strlen ( fname ) - 1 ] = = ' / ' )
{
Q_snprintfz ( fullname , sizeof ( fullname ) , " %s* " , fname ) ;
if ( ! spath - > EnumerateFiles ( spath , fullname , FS_RemoveTreeCallback , NULL ) )
return false ;
}
if ( ! spath - > RemoveFile )
return false ; //can't remove...
if ( ! spath - > RemoveFile ( spath , fname ) )
{
Con_Printf ( " Unable to delete %s \n " , fname ) ;
return false ; //remove failed
}
FS_RebuildFSHash_Update ( fname ) ;
return true ;
}
qboolean FS_RemoveTree ( searchpathfuncs_t * pathhandle , const char * fname )
{ //this requires that the searchpath a) supports remove. b) supports listing directories...
//path is expected to have a trailing /
2021-05-27 11:33:55 +00:00
/*char cleaned[MAX_QPATH];
fname = FS_GetCleanPath ( fname , false , cleaned , sizeof ( cleaned ) ) ;
if ( ! fname )
return false ; */
if ( fs_readonly )
return false ;
//FIXME: don't cross filesystems.
//FIXME: remove dir symlinks instead of the target's contents.
2020-04-19 01:23:32 +00:00
if ( FS_RemoveTreeCallback ( fname , 0 , 0 , NULL , pathhandle ) )
return true ;
return false ;
}
2009-04-01 22:03:56 +00:00
//create a path for the given filename (dir-only must have trailing slash)
void FS_CreatePath ( const char * pname , enum fs_relative relativeto )
2005-12-21 03:07:33 +00:00
{
char fullname [ MAX_OSPATH ] ;
Added sys_openfile console command(and menu option) to web and flatpak(via cmake+dbus) builds, to 'install' packages on sandboxed systems a bit more easily.
Cmake: Add FTE_WERROR option, defaults to true in debug builds and off in release builds (in case future compilers have issues).
Cmake: Pull in libXscreensaver so we don't get interrupted by screensavers when playing demos.
Make: Added `make webcl-rel` for a web build without server bloat (eg for sites focused on demo playback. Yes, this means you XantoM).
fteqcc: Include the decompiler in fteqcc (non-gui) builds ('-d' arg).
fteqcc: Decompiler can now mostly handle hexen2 mods without any unknown opcodes.
Allow ezHud and OpenSSL to be compiled as in-engine plugins, potentially for web and windows ports respectively.
Web: Fix support for ogg vorbis. Add support for voip.
Web: Added basic support for WebXR.
QTV: Don't try seeking on unseekable qtv streams. Don't spam when developer 1 is set.
QTV: add support for some eztv extensions.
MVD: added hack to use ktx's vweps in mvd where mvdsv doesn't bother to record the info.
qwfwd: hack around a hack in qwfwd, allowing it to work again.
recording: favour qwd in single player, instead of mvd.
Protocol: reduce client memory used for precache names. Bump maximum precache counts - some people are just abusive, yes you Orl.
hexen2: add enough clientside protocol compat to play the demo included with h2mp. lacks effects.
in_xflip: restored this setting.
fs_hidesyspaths: new cvar, defaults to enabled so you won't find your username or whatever turning up in screenshots or the like. change it to 0 before debuging stuff eg via 'path'.
gl_overbright_models: Added cvar to match QS.
netchan: Added MTU determination, we'll no longer fail to connect when routers stupidly drop icmp packets.
Win: try a few other versions of xinput too.
CSQC: Added a CSQC_GenerateMaterial function, to give the csqc a chance to generate custom materials.
MenuQC: Added support for the skeletal objects API.
2024-04-09 17:13:59 +00:00
if ( ! FS_SystemPath ( pname , relativeto , fullname , sizeof ( fullname ) ) )
2009-04-01 22:03:56 +00:00
return ;
2009-06-03 09:09:35 +00:00
2005-12-21 03:07:33 +00:00
COM_CreatePath ( fullname ) ;
}
2005-08-26 22:52:26 +00:00
2020-01-13 07:03:28 +00:00
//FIXME: why is this qofs_t and not size_t?!?
2014-06-30 21:57:35 +00:00
void * FS_MallocFile ( const char * filename , enum fs_relative relativeto , qofs_t * filesize )
{
vfsfile_t * f ;
qbyte * buf ;
qofs_t len ;
f = FS_OpenVFS ( filename , " rb " , relativeto ) ;
if ( ! f )
return NULL ;
len = VFS_GETLEN ( f ) ;
if ( filesize )
* filesize = len ;
2020-01-13 07:03:28 +00:00
if ( len > = ~ ( size_t ) 0 )
{
VFS_CLOSE ( f ) ;
Con_Printf ( CON_ERROR " File %s: too large \n " , filename ) ;
return NULL ;
}
2014-06-30 21:57:35 +00:00
buf = ( qbyte * ) BZ_Malloc ( len + 1 ) ;
2020-01-13 07:03:28 +00:00
if ( ! buf ) //this could be a soft error, but I don't want to have to deal with users reporting misc unrelated issues (and frankly most malloc failures are due to OOB writes)
2014-06-30 21:57:35 +00:00
Sys_Error ( " FS_MallocFile: out of memory loading %s " , filename ) ;
( ( qbyte * ) buf ) [ len ] = 0 ;
VFS_READ ( f , buf , len ) ;
VFS_CLOSE ( f ) ;
return buf ;
}
2009-04-02 22:25:54 +00:00
qboolean FS_WriteFile ( const char * filename , const void * data , int len , enum fs_relative relativeto )
2006-01-02 22:53:29 +00:00
{
vfsfile_t * f ;
FS_CreatePath ( filename , relativeto ) ;
Added sys_openfile console command(and menu option) to web and flatpak(via cmake+dbus) builds, to 'install' packages on sandboxed systems a bit more easily.
Cmake: Add FTE_WERROR option, defaults to true in debug builds and off in release builds (in case future compilers have issues).
Cmake: Pull in libXscreensaver so we don't get interrupted by screensavers when playing demos.
Make: Added `make webcl-rel` for a web build without server bloat (eg for sites focused on demo playback. Yes, this means you XantoM).
fteqcc: Include the decompiler in fteqcc (non-gui) builds ('-d' arg).
fteqcc: Decompiler can now mostly handle hexen2 mods without any unknown opcodes.
Allow ezHud and OpenSSL to be compiled as in-engine plugins, potentially for web and windows ports respectively.
Web: Fix support for ogg vorbis. Add support for voip.
Web: Added basic support for WebXR.
QTV: Don't try seeking on unseekable qtv streams. Don't spam when developer 1 is set.
QTV: add support for some eztv extensions.
MVD: added hack to use ktx's vweps in mvd where mvdsv doesn't bother to record the info.
qwfwd: hack around a hack in qwfwd, allowing it to work again.
recording: favour qwd in single player, instead of mvd.
Protocol: reduce client memory used for precache names. Bump maximum precache counts - some people are just abusive, yes you Orl.
hexen2: add enough clientside protocol compat to play the demo included with h2mp. lacks effects.
in_xflip: restored this setting.
fs_hidesyspaths: new cvar, defaults to enabled so you won't find your username or whatever turning up in screenshots or the like. change it to 0 before debuging stuff eg via 'path'.
gl_overbright_models: Added cvar to match QS.
netchan: Added MTU determination, we'll no longer fail to connect when routers stupidly drop icmp packets.
Win: try a few other versions of xinput too.
CSQC: Added a CSQC_GenerateMaterial function, to give the csqc a chance to generate custom materials.
MenuQC: Added support for the skeletal objects API.
2024-04-09 17:13:59 +00:00
f = FS_OpenVFS ( filename , " wbp " , relativeto ) ;
2006-01-02 22:53:29 +00:00
if ( ! f )
return false ;
VFS_WRITE ( f , data , len ) ;
VFS_CLOSE ( f ) ;
return true ;
}
2009-04-01 22:03:56 +00:00
qboolean FS_Copy ( const char * source , const char * dest , enum fs_relative relativesource , enum fs_relative relativedest )
{
vfsfile_t * d , * s ;
char buffer [ 8192 * 8 ] ;
int read ;
qboolean result = false ;
FS_CreatePath ( dest , relativedest ) ;
s = FS_OpenVFS ( source , " rb " , relativesource ) ;
if ( s )
{
2014-08-27 08:41:31 +00:00
d = FS_OpenVFS ( dest , " wbp " , relativedest ) ;
2009-04-01 22:03:56 +00:00
if ( d )
{
result = true ;
for ( ; ; )
{
read = VFS_READ ( s , buffer , sizeof ( buffer ) ) ;
if ( read < = 0 )
break ;
if ( VFS_WRITE ( d , buffer , read ) ! = read )
{
result = false ;
break ;
}
}
VFS_CLOSE ( d ) ;
if ( ! result )
FS_Remove ( dest , relativedest ) ;
}
VFS_CLOSE ( s ) ;
}
return result ;
}
2005-08-26 22:52:26 +00:00
static qbyte * loadbuf ;
static int loadsize ;
/*
= = = = = = = = = = = =
COM_LoadFile
Filename are reletive to the quake directory .
Always appends a 0 qbyte to the loaded data .
= = = = = = = = = = = =
*/
2018-07-05 16:21:44 +00:00
qbyte * COM_LoadFile ( const char * path , unsigned int locateflags , int usehunk , size_t * filesize )
2005-08-26 22:52:26 +00:00
{
2005-12-21 03:07:33 +00:00
vfsfile_t * f ;
2005-08-26 22:52:26 +00:00
qbyte * buf ;
2014-02-07 08:38:40 +00:00
qofs_t len ;
2005-08-26 22:52:26 +00:00
flocation_t loc ;
2015-10-11 11:34:58 +00:00
2018-07-05 16:21:44 +00:00
locateflags & = ~ FSLF_DEEPONFAILURE ; //disable any flags that can't be supported here
if ( ! FS_FLocateFile ( path , locateflags , & loc ) | | ! loc . search )
2005-08-26 22:52:26 +00:00
return NULL ; //wasn't found
2014-02-07 08:38:40 +00:00
if ( loc . len > 0x7fffffff ) //don't malloc 5000gb sparse files or anything crazy on a 32bit system...
return NULL ;
2005-08-26 22:52:26 +00:00
2017-12-15 06:56:40 +00:00
fs_accessed_time = realtime ;
2013-06-23 02:17:02 +00:00
f = loc . search - > handle - > OpenVFS ( loc . search - > handle , & loc , " rb " ) ;
2005-12-21 03:07:33 +00:00
if ( ! f )
return NULL ;
2014-10-05 20:04:11 +00:00
len = VFS_GETLEN ( f ) ;
if ( filesize )
* filesize = len ;
if ( usehunk = = 2 | | usehunk = = 4 | | usehunk = = 6 )
COM_AssertMainThread ( " COM_LoadFile+hunk " ) ;
2005-08-26 22:52:26 +00:00
if ( usehunk = = 0 )
buf = ( qbyte * ) Z_Malloc ( len + 1 ) ;
else if ( usehunk = = 2 )
buf = ( qbyte * ) Hunk_TempAlloc ( len + 1 ) ;
else if ( usehunk = = 4 )
{
if ( len + 1 > loadsize )
buf = ( qbyte * ) Hunk_TempAlloc ( len + 1 ) ;
else
buf = loadbuf ;
}
else if ( usehunk = = 5 )
buf = ( qbyte * ) BZ_Malloc ( len + 1 ) ;
else if ( usehunk = = 6 )
buf = ( qbyte * ) Hunk_TempAllocMore ( len + 1 ) ;
else
{
Sys_Error ( " COM_LoadFile: bad usehunk " ) ;
buf = NULL ;
}
if ( ! buf )
Sys_Error ( " COM_LoadFile: not enough space for %s " , path ) ;
( ( qbyte * ) buf ) [ len ] = 0 ;
2005-12-21 03:07:33 +00:00
VFS_READ ( f , buf , len ) ;
VFS_CLOSE ( f ) ;
2005-08-26 22:52:26 +00:00
return buf ;
}
2022-03-08 05:31:34 +00:00
void * FS_LoadMallocFile ( const char * path , size_t * fsize )
2005-08-26 22:52:26 +00:00
{
2018-07-05 16:21:44 +00:00
return COM_LoadFile ( path , 0 , 5 , fsize ) ;
2005-08-26 22:52:26 +00:00
}
2020-08-13 08:39:48 +00:00
qbyte * FS_LoadMallocFileFlags ( const char * path , unsigned int locateflags , size_t * fsize )
{
return COM_LoadFile ( path , locateflags , 5 , fsize ) ;
}
2005-08-26 22:52:26 +00:00
2020-03-25 21:29:30 +00:00
void * FS_LoadMallocGroupFile ( zonegroup_t * ctx , char * path , size_t * fsize , qboolean filters )
2005-08-26 22:52:26 +00:00
{
2013-07-14 12:22:51 +00:00
char * mem = NULL ;
vfsfile_t * f = FS_OpenVFS ( path , " rb " , FS_GAME ) ;
2020-03-25 21:29:30 +00:00
if ( f & & filters )
f = VFS_Filter ( path , f ) ;
2013-07-14 12:22:51 +00:00
if ( f )
{
int len = VFS_GETLEN ( f ) ;
2020-03-25 21:29:30 +00:00
if ( ctx )
mem = ZG_Malloc ( ctx , len + 1 ) ;
else
mem = BZ_Malloc ( len + 1 ) ;
2013-07-14 12:22:51 +00:00
if ( mem )
{
mem [ len ] = 0 ;
if ( VFS_READ ( f , mem , len ) = = len )
2014-10-05 20:04:11 +00:00
* fsize = len ;
2013-07-14 12:22:51 +00:00
else
mem = NULL ;
}
VFS_CLOSE ( f ) ;
}
return mem ;
2005-08-26 22:52:26 +00:00
}
2018-07-05 16:21:44 +00:00
qbyte * COM_LoadTempFile ( const char * path , unsigned int locateflags , size_t * fsize )
2005-08-26 22:52:26 +00:00
{
2018-07-05 16:21:44 +00:00
return COM_LoadFile ( path , locateflags , 2 , fsize ) ;
2005-08-26 22:52:26 +00:00
}
2014-10-05 20:04:11 +00:00
qbyte * COM_LoadTempMoreFile ( const char * path , size_t * fsize )
2005-08-26 22:52:26 +00:00
{
2018-07-05 16:21:44 +00:00
return COM_LoadFile ( path , 0 , 6 , fsize ) ;
2005-08-26 22:52:26 +00:00
}
// uses temp hunk if larger than bufsize
2014-10-05 20:04:11 +00:00
qbyte * QDECL COM_LoadStackFile ( const char * path , void * buffer , int bufsize , size_t * fsize )
2005-08-26 22:52:26 +00:00
{
qbyte * buf ;
2005-11-21 21:09:11 +00:00
2014-10-05 20:04:11 +00:00
COM_AssertMainThread ( " COM_LoadStackFile " ) ;
2005-08-26 22:52:26 +00:00
loadbuf = ( qbyte * ) buffer ;
loadsize = bufsize ;
2018-07-05 16:21:44 +00:00
buf = COM_LoadFile ( path , 0 , 4 , fsize ) ;
2005-11-21 21:09:11 +00:00
2005-08-26 22:52:26 +00:00
return buf ;
}
2009-05-24 10:11:17 +00:00
/*warning: at some point I'll change this function to return only read-only buffers*/
2014-03-30 08:55:06 +00:00
qofs_t FS_LoadFile ( const char * name , void * * file )
2009-03-03 01:52:30 +00:00
{
2014-10-05 20:04:11 +00:00
size_t fsz ;
2018-07-05 16:21:44 +00:00
* file = FS_LoadMallocFile ( name , & fsz ) ;
2009-05-24 10:11:17 +00:00
if ( ! * file )
2014-02-07 08:38:40 +00:00
return ( qofs_t ) - 1 ;
2014-10-05 20:04:11 +00:00
return fsz ;
2009-03-03 01:52:30 +00:00
}
void FS_FreeFile ( void * file )
{
BZ_Free ( file ) ;
}
2020-10-27 02:56:18 +00:00
//handle->EnumerateFiles on each a:b:c part of the given matches string.
static qboolean FS_EnumerateFilesEach ( searchpathfuncs_t * handle , char * matches , int ( QDECL * func ) ( const char * fname , qofs_t fsize , time_t mtime , void * parm , searchpathfuncs_t * spath ) , void * parm )
{
char cleanpath [ MAX_QPATH ] ;
const char * match ;
char * sep ;
for ( ; matches ; matches = sep )
{
2023-01-09 05:12:39 +00:00
if ( ! strncmp ( matches , " file: " , 5 ) )
{
sep = strchr ( matches + 5 , ' : ' ) ;
continue ;
}
2020-10-27 02:56:18 +00:00
sep = strchr ( matches , ' : ' ) ;
if ( sep )
{
* sep = 0 ;
match = FS_GetCleanPath ( matches , true , cleanpath , sizeof ( cleanpath ) ) ;
* sep + + = ' : ' ;
}
else
match = FS_GetCleanPath ( matches , true , cleanpath , sizeof ( cleanpath ) ) ;
2009-03-03 01:52:30 +00:00
2020-10-27 02:56:18 +00:00
if ( match & & * match )
if ( ! handle - > EnumerateFiles ( handle , match , func , parm ) )
return false ;
}
return true ;
}
static int FS_EnumerateFilesEachSys ( const char * syspath , char * matches , int ( * func ) ( const char * , qofs_t , time_t modtime , void * , searchpathfuncs_t * ) , void * parm , searchpathfuncs_t * spath )
{
char cleanpath [ MAX_QPATH ] ;
const char * match ;
char * sep ;
for ( ; matches ; matches = sep )
{
2023-01-09 05:12:39 +00:00
if ( ! strncmp ( matches , " file: " , 5 ) )
{
sep = strchr ( matches + 5 , ' : ' ) ;
continue ;
}
2020-10-27 02:56:18 +00:00
sep = strchr ( matches , ' : ' ) ;
if ( sep )
{
* sep = 0 ;
match = FS_GetCleanPath ( matches , true , cleanpath , sizeof ( cleanpath ) ) ;
* sep + + = ' : ' ;
}
else
match = FS_GetCleanPath ( matches , true , cleanpath , sizeof ( cleanpath ) ) ;
if ( ! Sys_EnumerateFiles ( syspath , match , func , parm , spath ) )
return false ;
}
return true ;
}
searchpathfuncs_t * COM_EnumerateFilesPackage ( char * matches , const char * package , unsigned int flags , int ( QDECL * func ) ( const char * , qofs_t , time_t mtime , void * , searchpathfuncs_t * ) , void * parm )
{ //special version of COM_EnumerateFiles that takes an explicit package name to search inside.
//additionally accepts multiple patterns (separated by : chsrs)
2020-07-21 07:58:54 +00:00
searchpathfuncs_t * handle ;
searchpath_t * search ;
const char * sp ;
qboolean foundpackage = false ;
for ( search = com_searchpaths ; search ; search = search - > next )
{
if ( package )
{
if ( flags & WP_FULLPATH )
sp = search - > purepath ;
else
{
sp = strchr ( search - > purepath , ' / ' ) ;
if ( sp & & ! strchr ( + + sp , ' / ' ) )
;
else
continue ; //ignore packages inside other packages. they're just too weird.
}
if ( strcmp ( package , sp ) )
continue ; //ignore this package
}
foundpackage = true ;
2020-10-27 02:56:18 +00:00
if ( ! FS_EnumerateFilesEach ( search - > handle , matches , func , parm ) )
2020-07-21 07:58:54 +00:00
break ;
}
if ( ! foundpackage & & package & & ( flags & WP_FORCE ) & & ( flags & WP_FULLPATH ) )
{ //if we're forcing the package search then be prepared to open the gamedir or gamedir/package that was specified.
char cleanname [ MAX_OSPATH ] ;
char syspath [ MAX_OSPATH ] ;
char * sl ;
package = FS_GetCleanPath ( package , false , cleanname , sizeof ( cleanname ) ) ;
if ( ! package )
return NULL ;
sl = strchr ( package , ' / ' ) ;
if ( sl )
{ //try to open the named package.
* sl = 0 ;
if ( strchr ( sl + 1 , ' / ' ) | | ! FS_GamedirIsOkay ( package ) )
return NULL ;
* sl = ' / ' ;
if ( com_homepathenabled )
{ //try the homedir
Q_snprintfz ( syspath , sizeof ( syspath ) , " %s%s " , com_homepath , package ) ;
2023-04-21 11:36:13 +00:00
handle = FS_OpenPackByExtension ( VFSOS_Open ( syspath , " rb " ) , NULL , package , package , " " ) ;
2020-07-21 07:58:54 +00:00
}
else
handle = NULL ;
if ( ! handle )
{ //now go for the basedir to see if ther.
Q_snprintfz ( syspath , sizeof ( syspath ) , " %s%s " , com_gamepath , package ) ;
2023-04-21 11:36:13 +00:00
handle = FS_OpenPackByExtension ( VFSOS_Open ( syspath , " rb " ) , NULL , package , package , " " ) ;
2020-07-21 07:58:54 +00:00
}
2009-03-03 01:52:30 +00:00
2020-07-21 07:58:54 +00:00
if ( handle )
2020-10-27 02:56:18 +00:00
FS_EnumerateFilesEach ( handle , matches , func , parm ) ;
2020-07-21 07:58:54 +00:00
return handle ; //caller can use this for context, but is expected to tidy it up too.
}
else
{ //we use NULLs for spath context here. caller will need to figure out which basedir to read it from.
if ( ! FS_GamedirIsOkay ( package ) )
return NULL ;
if ( com_homepathenabled )
{
Q_snprintfz ( syspath , sizeof ( syspath ) , " %s%s " , com_homepath , package ) ;
2020-10-27 02:56:18 +00:00
FS_EnumerateFilesEachSys ( syspath , matches , func , parm , NULL ) ;
2020-07-21 07:58:54 +00:00
}
Q_snprintfz ( syspath , sizeof ( syspath ) , " %s%s " , com_gamepath , package ) ;
2020-10-27 02:56:18 +00:00
FS_EnumerateFilesEachSys ( syspath , matches , func , parm , NULL ) ;
2020-07-21 07:58:54 +00:00
}
}
return NULL ;
}
2023-01-09 05:12:39 +00:00
struct fs_enumerate_fileuri_s
{
int ( QDECL * func ) ( const char * , qofs_t , time_t mtime , void * , searchpathfuncs_t * ) ;
void * parm ;
} ;
static int QDECL COM_EnumerateFiles_FileURI ( const char * name , qofs_t flags , time_t mtime , void * parm , searchpathfuncs_t * spath )
{
char syspath [ MAX_OSPATH ] ;
struct fs_enumerate_fileuri_s * e = parm ;
size_t nlen = strlen ( name ) + 1 ;
if ( 7 + nlen > sizeof ( syspath ) )
return true ;
memcpy ( syspath , " file:// " , 7 ) ;
memcpy ( syspath + 7 , name , nlen ) ;
return e - > func ( syspath , flags , mtime , e - > parm , spath ) ;
}
2015-02-02 08:01:53 +00:00
void COM_EnumerateFiles ( const char * match , int ( QDECL * func ) ( const char * , qofs_t , time_t mtime , void * , searchpathfuncs_t * ) , void * parm )
2005-08-26 22:52:26 +00:00
{
searchpath_t * search ;
2023-01-09 05:12:39 +00:00
if ( ! strncmp ( match , " file: " , 5 ) )
{
if ( fs_allowfileuri )
{
char syspath [ MAX_OSPATH ] ;
struct fs_enumerate_fileuri_s e ;
e . func = func ;
e . parm = parm ;
if ( Sys_ResolveFileURL ( match , strlen ( match ) , syspath , sizeof ( syspath ) ) )
Sys_EnumerateFiles ( NULL , syspath , COM_EnumerateFiles_FileURI , & e , NULL ) ;
}
return ;
}
2005-08-26 22:52:26 +00:00
for ( search = com_searchpaths ; search ; search = search - > next )
{
2013-06-23 02:17:02 +00:00
if ( ! search - > handle - > EnumerateFiles ( search - > handle , match , func , parm ) )
2005-08-26 22:52:26 +00:00
break ;
}
}
2023-04-23 04:47:27 +00:00
//scan packages in a reverse order, ie lowest priority first (for less scrolling upwards)
void COM_EnumerateFilesReverse ( const char * match , int ( QDECL * func ) ( const char * , qofs_t , time_t mtime , void * , searchpathfuncs_t * ) , void * parm )
{
searchpath_t * search ;
searchpath_t * * rev ;
size_t count ;
if ( ! strncmp ( match , " file: " , 5 ) )
{
if ( fs_allowfileuri )
{
char syspath [ MAX_OSPATH ] ;
struct fs_enumerate_fileuri_s e ;
e . func = func ;
e . parm = parm ;
if ( Sys_ResolveFileURL ( match , strlen ( match ) , syspath , sizeof ( syspath ) ) )
Sys_EnumerateFiles ( NULL , syspath , COM_EnumerateFiles_FileURI , & e , NULL ) ;
}
return ;
}
for ( search = com_searchpaths , count = 0 ; search ; search = search - > next )
count + + ;
rev = BZ_Malloc ( sizeof ( * rev ) * count ) ;
for ( search = com_searchpaths , count = 0 ; search ; search = search - > next )
rev [ count + + ] = search ;
while ( count )
{
search = rev [ - - count ] ;
if ( ! search - > handle - > EnumerateFiles ( search - > handle , match , func , parm ) )
break ;
}
BZ_Free ( rev ) ;
}
2021-05-28 07:07:48 +00:00
void COM_FlushTempoaryPacks ( void ) //flush all temporary packages
2005-08-26 22:52:26 +00:00
{
2011-10-27 16:16:29 +00:00
searchpath_t * sp , * * link ;
2021-05-28 07:07:48 +00:00
2021-06-01 09:23:42 +00:00
COM_AssertMainThread ( " COM_FlushTempoaryPacks " ) ;
2021-08-04 21:18:04 +00:00
if ( ! com_searchpaths | | ! fs_thread_mutex )
return ; //we already shut down...
2021-05-28 07:07:48 +00:00
COM_WorkerLock ( ) ; //make sure no workers are poking files...
Sys_LockMutex ( fs_thread_mutex ) ;
2011-10-27 16:16:29 +00:00
link = & com_searchpaths ;
while ( * link )
2005-08-26 22:52:26 +00:00
{
2011-10-27 16:16:29 +00:00
sp = * link ;
2013-06-23 02:17:02 +00:00
if ( sp - > flags & SPF_TEMPORARY )
2011-10-27 16:16:29 +00:00
{
2021-05-28 07:07:48 +00:00
FS_FlushFSHashFull ( ) ;
2011-10-27 16:16:29 +00:00
* link = sp - > next ;
2021-06-01 09:23:42 +00:00
com_purepaths = NULL ;
2005-08-26 22:52:26 +00:00
2013-06-23 02:17:02 +00:00
sp - > handle - > ClosePath ( sp - > handle ) ;
2011-10-27 16:16:29 +00:00
Z_Free ( sp ) ;
}
else
link = & sp - > next ;
2005-08-26 22:52:26 +00:00
}
2021-05-28 07:07:48 +00:00
Sys_UnlockMutex ( fs_thread_mutex ) ;
COM_WorkerUnlock ( ) ; //workers can continue now
2005-08-26 22:52:26 +00:00
}
2021-06-01 09:23:42 +00:00
static searchpath_t * FS_MapPackIsActive ( searchpathfuncs_t * archive )
{
searchpath_t * sp ;
Sys_LockMutex ( fs_thread_mutex ) ;
for ( sp = com_searchpaths ; sp ; sp = sp - > next )
{
if ( sp - > handle = = archive )
break ;
}
Sys_UnlockMutex ( fs_thread_mutex ) ;
return sp ;
}
2021-05-28 07:07:48 +00:00
static searchpath_t * FS_AddPathHandle ( searchpath_t * * oldpaths , const char * purepath , const char * probablepath , searchpathfuncs_t * handle , const char * prefix , unsigned int flags , unsigned int loadstuff ) ;
qboolean FS_LoadMapPackFile ( const char * filename , searchpathfuncs_t * archive )
2005-08-26 22:52:26 +00:00
{
2021-06-01 09:23:42 +00:00
if ( ! archive )
return false ;
2021-05-28 07:07:48 +00:00
if ( ! archive - > AddReference )
return false ; //nope...
2021-06-01 09:23:42 +00:00
if ( FS_MapPackIsActive ( archive ) )
return false ; //don't do it twice.
2021-05-28 07:07:48 +00:00
archive - > AddReference ( archive ) ;
if ( FS_AddPathHandle ( NULL , filename , filename , archive , " " , SPF_TEMPORARY , 0 ) )
return true ;
2005-12-21 03:07:33 +00:00
return false ;
2013-06-23 02:17:02 +00:00
}
2021-05-28 07:07:48 +00:00
void FS_CloseMapPackFile ( searchpathfuncs_t * archive )
{
searchpath_t * sp , * * link ;
2021-06-01 09:23:42 +00:00
COM_AssertMainThread ( " FS_CloseMapPackFile " ) ;
2021-05-28 07:07:48 +00:00
COM_WorkerLock ( ) ; //make sure no workers are poking files...
Sys_LockMutex ( fs_thread_mutex ) ;
link = & com_searchpaths ;
while ( * link )
{
sp = * link ;
if ( sp - > handle = = archive )
{
FS_FlushFSHashFull ( ) ;
* link = sp - > next ;
2021-06-01 09:23:42 +00:00
com_purepaths = NULL ; //FIXME...
2021-05-28 07:07:48 +00:00
sp - > handle - > ClosePath ( sp - > handle ) ;
Z_Free ( sp ) ;
break ;
}
else
link = & sp - > next ;
}
Sys_UnlockMutex ( fs_thread_mutex ) ;
COM_WorkerUnlock ( ) ; //workers can continue now
archive - > ClosePath ( archive ) ;
}
2005-08-26 22:52:26 +00:00
2018-10-11 10:31:23 +00:00
static searchpathfuncs_t * FS_GetOldPath ( searchpath_t * * oldpaths , const char * dir , unsigned int * keepflags )
2013-06-23 02:17:02 +00:00
{
searchpath_t * p ;
searchpathfuncs_t * r = NULL ;
2013-12-17 22:45:37 +00:00
* keepflags = 0 ;
2013-06-23 02:17:02 +00:00
while ( * oldpaths )
2005-08-26 22:52:26 +00:00
{
2013-06-23 02:17:02 +00:00
p = * oldpaths ;
2005-08-26 22:52:26 +00:00
2014-02-07 08:38:40 +00:00
if ( ! Q_strcasecmp ( p - > logicalpath , dir ) )
2013-06-23 02:17:02 +00:00
{
2013-12-17 22:45:37 +00:00
* keepflags | = p - > flags & ( SPF_REFERENCED | SPF_UNTRUSTED ) ;
2013-06-23 02:17:02 +00:00
* oldpaths = p - > next ;
r = p - > handle ;
Z_Free ( p ) ;
break ;
}
2005-08-26 22:52:26 +00:00
2013-06-23 02:17:02 +00:00
oldpaths = & ( * oldpaths ) - > next ;
2005-08-26 22:52:26 +00:00
}
2013-06-23 02:17:02 +00:00
return r ;
2005-08-26 22:52:26 +00:00
}
2005-12-21 03:07:33 +00:00
typedef struct {
2018-03-04 14:41:16 +00:00
searchpathfuncs_t * ( QDECL * OpenNew ) ( vfsfile_t * file , searchpathfuncs_t * parent , const char * filename , const char * desc , const char * prefix ) ;
2013-06-23 02:17:02 +00:00
searchpath_t * * oldpaths ;
2009-04-01 22:03:56 +00:00
const char * parentdesc ;
const char * puredesc ;
2016-07-12 00:40:13 +00:00
unsigned int inheritflags ;
2005-12-21 03:07:33 +00:00
} wildpaks_t ;
2019-09-04 08:32:22 +00:00
static void FS_AddSingleDataFile ( const char * descriptor , wildpaks_t * param , searchpathfuncs_t * funcs )
2005-08-26 22:52:26 +00:00
{
2005-12-21 03:07:33 +00:00
vfsfile_t * vfs ;
2005-08-26 22:52:26 +00:00
searchpath_t * search ;
2013-06-23 02:17:02 +00:00
searchpathfuncs_t * newpak ;
2005-08-26 22:52:26 +00:00
char pakfile [ MAX_OSPATH ] ;
2008-11-09 22:29:28 +00:00
char purefile [ MAX_OSPATH ] ;
2005-12-21 03:07:33 +00:00
flocation_t loc ;
2013-12-17 22:45:37 +00:00
unsigned int keptflags = 0 ;
2005-08-26 22:52:26 +00:00
2011-07-22 15:11:35 +00:00
Q_snprintfz ( pakfile , sizeof ( pakfile ) , " %s%s " , param - > parentdesc , descriptor ) ;
2005-08-26 22:52:26 +00:00
for ( search = com_searchpaths ; search ; search = search - > next )
{
2014-02-07 08:38:40 +00:00
if ( ! Q_strcasecmp ( search - > logicalpath , pakfile ) ) //assumption: first member of structure is a char array
2019-09-04 08:32:22 +00:00
return ; //already loaded (base paths?)
2005-08-26 22:52:26 +00:00
}
2013-12-17 22:45:37 +00:00
newpak = FS_GetOldPath ( param - > oldpaths , pakfile , & keptflags ) ;
2013-06-23 02:17:02 +00:00
if ( ! newpak )
2012-07-05 19:42:36 +00:00
{
2013-10-29 17:38:22 +00:00
if ( param - > OpenNew = = VFSOS_OpenPath )
{
vfs = NULL ;
}
else
{
fs_finds + + ;
if ( ! funcs - > FindFile ( funcs , & loc , descriptor , NULL ) )
2019-09-04 08:32:22 +00:00
return ; //not found..
2013-10-29 17:38:22 +00:00
vfs = funcs - > OpenVFS ( funcs , & loc , " rb " ) ;
if ( ! vfs )
2019-09-04 08:32:22 +00:00
return ;
2013-10-29 17:38:22 +00:00
}
2018-03-04 14:41:16 +00:00
newpak = param - > OpenNew ( vfs , funcs , descriptor , pakfile , " " ) ;
2013-06-23 02:17:02 +00:00
if ( ! newpak )
{
VFS_CLOSE ( vfs ) ;
2019-09-04 08:32:22 +00:00
return ;
2013-06-23 02:17:02 +00:00
}
2012-07-05 19:42:36 +00:00
}
2005-12-21 03:07:33 +00:00
2013-06-23 02:17:02 +00:00
Q_snprintfz ( pakfile , sizeof ( pakfile ) , " %s%s " , param - > parentdesc , descriptor ) ;
2008-11-09 22:29:28 +00:00
if ( * param - > puredesc )
snprintf ( purefile , sizeof ( purefile ) , " %s/%s " , param - > puredesc , descriptor ) ;
else
Q_strncpyz ( purefile , descriptor , sizeof ( purefile ) ) ;
2016-07-12 00:40:13 +00:00
FS_AddPathHandle ( param - > oldpaths , purefile , pakfile , newpak , " " , ( ( ! Q_strncasecmp ( descriptor , " pak " , 3 ) ) ? SPF_COPYPROTECTED : 0 ) | keptflags | param - > inheritflags , ( unsigned int ) - 1 ) ;
2019-09-04 08:32:22 +00:00
}
typedef struct
{
//name table, to avoid too many reallocs
char * names ;
size_t numnames ;
size_t maxnames ;
2005-08-26 22:52:26 +00:00
2019-09-04 08:32:22 +00:00
//file table, again to avoid excess reallocs
struct wilddatafile_s
{
size_t nameofs ;
size_t size ;
time_t mtime ;
searchpathfuncs_t * source ;
} * files ;
size_t numfiles ;
size_t maxfiles ;
} filelist_t ;
static int QDECL FS_FindWildDataFiles ( const char * descriptor , qofs_t size , time_t mtime , void * vparam , searchpathfuncs_t * funcs )
{
filelist_t * list = vparam ;
size_t name = list - > numnames ;
size_t file = list - > numfiles ;
size_t dlen = strlen ( descriptor ) ;
if ( list - > numnames + dlen + 1 > list - > maxnames )
Z_ReallocElements ( ( void * * ) & list - > names , & list - > maxnames , list - > numnames + dlen + 1 + 8192 , sizeof ( * list - > names ) ) ;
strcpy ( list - > names + name , descriptor ) ;
list - > numnames + = dlen + 1 ;
if ( list - > numfiles + 1 > list - > maxfiles )
Z_ReallocElements ( ( void * * ) & list - > files , & list - > maxfiles , list - > numfiles + 1 + 128 , sizeof ( * list - > files ) ) ;
list - > files [ file ] . nameofs = name ;
list - > files [ file ] . size = size ;
list - > files [ file ] . mtime = mtime ;
list - > files [ file ] . source = funcs ;
list - > numfiles + = 1 ;
return true ; //keep looking for more
}
static const char * qsortsucks ;
static int QDECL FS_SortWildDataFiles ( const void * va , const void * vb )
{
const struct wilddatafile_s * a = va , * b = vb ;
const char * na = qsortsucks + a - > nameofs , * nb = qsortsucks + b - > nameofs ;
//sort by modification time...
Too many changes, sorry.
Change revision displays, use the SVN commit date instead of using __DATE__ (when there's no local changes). This should allow reproducible builds.
Added s_al_disable cvar, to block openal and all the various problems people have had with it, without having to name an explicit fallback (which would vary by system).
Add mastervolume cvar (for ss).
Add r_shadows 2 (aka fake shadows - for ss).
Add scr_loadingscreen_aspect -1 setting, to disable levelshots entirely, also disables the progress bar (for ss).
Better support for some effectinfo hacks (for ss).
Added dpcompat_nocsqcwarnings (because of lazy+buggy mods like ss).
Rework the dpcsqc versions of project+unproject builtins for better compat (for ss).
Added dpcompat_csqcinputeventtypes to block unexpected csqc input events (for ss).
Better compat with DP's loadfont console command (for ss).
Added dpcompat_smallerfonts cvar to replicate a DP bug (for ss).
Detect dp's m_draw extension, to work around it (for ss).
Cvar dpcompat_ignoremodificationtimes added. A value of 0 favour the most recently modified file, 1 will use DP-like alphabetically sorted preferences (for ss).
loadfont builtin can now accept outline=1 in the sizes arg for slightly more readable fonts.
Fix bbox calcs for rotated entities, fix needed for r_ignorenetpvs 0.
Hackily parse emoji.json to provide :poop: etc suggestions.
Skip prediction entirely when there's no local entity info. This fixes stair-smoothing in xonotic.
screenshot_cubemap will now capture half-float images when saving to ktx or dds files.
Fix support for xcf files larger than 4gb, mostly to avoid compiler warnings.
Fixed size of gfx/loading.lmp when replacement textures are used.
Added mipmap support for rg8 and l8a8 textures.
r_hdr_framebuffer cvar updated to support format names instead of random negative numbers. Description updated to name some interesting ones.
Perform autoupdate _checks_ ONLY with explicit user confirmation (actual updating already needed user confirmation, but this extra step should reduce the chances of us getting wrongly accused of exfiltrating user data if we're run in a sandbox - we ONLY ever included the updating engine's version in the checks, though there's nothing we can do to avoid sending the user's router's IP).
Removed the 'summon satan all over your harddrive' quit message, in case paranoid security researchers are idiots and don't bother doing actual research.
Removed the triptohell.info and fte.triptohell.info certificates, they really need to stop being self-signed. The updates domain is still self-signed for autoupdates.
Video drivers are now able to report supported video resolutions, visible to menuqc. Currently only works with SDL2 builds.
Added setmousepos builtin. Should work with glx+win32 build.
VF_SKYROOM_CAMERA can now accept an extra two args, setviewprop(VF_SKYROOM_CAMERA, org, axis, degrees).
Removed v_skyroom_origin+v_skyroom_orientation cvars in favour just v_skyroom, which should make it behave more like the 'fog' command (used when csqc isn't overriding).
Added R_EndPolygonRibbon builtin to make it faster+easier to generate textured ribbon/cable/etc wide lines (for TW).
sdl: Fix up sys_sdl.c's file enumeration to support wildcards in directories.
edit command now displays end1.bin/end2.bin correctly, because we can.
Finally add support for f_modified - though ruleset_allow_larger_models and ruleset_allow_overlong_sounds generally make it redundant.
Fix threading race condition in sha1 lookups.
Updated f_ruleset to include the same extra flags reported by ezquake.
A mod's default.fmf file can now contain an eg 'mainconfig config.cfg' line (to explicitly set the main config saved with cfg_save_auto 1 etc).
fmf: basegame steam:GameName/GameDir can be used to try to load a mod directory from an installed steam game. The resulting gamedir will be read-only.
HOMEDIR CHANGE: use homedirs only if the basedir cannot be written or a homedir already exists, which should further reduce the probability of microsoft randomly uploading our data to their cloud (but mostly because its annoying to never know where your data is written).
Fixed buf_cvarlist, should work in xonotic now, and without segfaults.
Added an extra arg to URI_Get_Callback calls - the response size, also changed the tempstring to contain all bytes of the response, you need to be careful about nulls though.
Try to work around nvidia's forced-panning bug on x11 when changing video modes. This might screw with other programs.
sdl: support custom icons.
sdl: support choosing a specific display.
Added some documentation to menuqc builtins.
menusys: use outlines for slightly more readable fonts.
menusys: switch vid_width and vid_height combos into a single video mode combo to set both according to reported video modes.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5581 fc73d0e0-1445-4013-8a0c-d673dee63da5
2019-11-20 03:09:50 +00:00
if ( a - > mtime ! = b - > mtime & & a - > mtime & & b - > mtime & & ! dpcompat_ignoremodificationtimes . ival )
2019-09-04 08:32:22 +00:00
return a - > mtime > b - > mtime ;
//then fall back and sort by name
return strcasecmp ( na , nb ) ;
}
static void FS_LoadWildDataFiles ( filelist_t * list , wildpaks_t * wp )
{
size_t f ;
//sort them
qsortsucks = list - > names ;
qsort ( list - > files , list - > numfiles , sizeof ( * list - > files ) , FS_SortWildDataFiles ) ;
qsortsucks = NULL ;
for ( f = 0 ; f < list - > numfiles ; f + + )
FS_AddSingleDataFile ( list - > names + list - > files [ f ] . nameofs , wp , list - > files [ f ] . source ) ;
list - > numfiles = list - > numnames = 0 ;
Z_Free ( list - > files ) ;
list - > files = NULL ;
Z_Free ( list - > names ) ;
list - > names = NULL ;
list - > maxfiles = list - > maxnames = 0 ;
2005-08-26 22:52:26 +00:00
}
2023-04-21 11:36:13 +00:00
searchpathfuncs_t * FS_OpenPackByExtension ( vfsfile_t * f , searchpathfuncs_t * parent , const char * filename , const char * pakname , const char * pakpathprefix )
2014-03-30 08:55:06 +00:00
{
searchpathfuncs_t * pak ;
int j ;
2014-10-05 20:04:11 +00:00
char ext [ 8 ] ;
2020-04-29 10:43:22 +00:00
if ( ! f )
return NULL ;
2014-10-05 20:04:11 +00:00
COM_FileExtension ( pakname , ext , sizeof ( ext ) ) ;
2014-03-30 08:55:06 +00:00
for ( j = 0 ; j < sizeof ( searchpathformats ) / sizeof ( searchpathformats [ 0 ] ) ; j + + )
{
if ( ! searchpathformats [ j ] . extension | | ! searchpathformats [ j ] . OpenNew )
continue ;
Added sys_openfile console command(and menu option) to web and flatpak(via cmake+dbus) builds, to 'install' packages on sandboxed systems a bit more easily.
Cmake: Add FTE_WERROR option, defaults to true in debug builds and off in release builds (in case future compilers have issues).
Cmake: Pull in libXscreensaver so we don't get interrupted by screensavers when playing demos.
Make: Added `make webcl-rel` for a web build without server bloat (eg for sites focused on demo playback. Yes, this means you XantoM).
fteqcc: Include the decompiler in fteqcc (non-gui) builds ('-d' arg).
fteqcc: Decompiler can now mostly handle hexen2 mods without any unknown opcodes.
Allow ezHud and OpenSSL to be compiled as in-engine plugins, potentially for web and windows ports respectively.
Web: Fix support for ogg vorbis. Add support for voip.
Web: Added basic support for WebXR.
QTV: Don't try seeking on unseekable qtv streams. Don't spam when developer 1 is set.
QTV: add support for some eztv extensions.
MVD: added hack to use ktx's vweps in mvd where mvdsv doesn't bother to record the info.
qwfwd: hack around a hack in qwfwd, allowing it to work again.
recording: favour qwd in single player, instead of mvd.
Protocol: reduce client memory used for precache names. Bump maximum precache counts - some people are just abusive, yes you Orl.
hexen2: add enough clientside protocol compat to play the demo included with h2mp. lacks effects.
in_xflip: restored this setting.
fs_hidesyspaths: new cvar, defaults to enabled so you won't find your username or whatever turning up in screenshots or the like. change it to 0 before debuging stuff eg via 'path'.
gl_overbright_models: Added cvar to match QS.
netchan: Added MTU determination, we'll no longer fail to connect when routers stupidly drop icmp packets.
Win: try a few other versions of xinput too.
CSQC: Added a CSQC_GenerateMaterial function, to give the csqc a chance to generate custom materials.
MenuQC: Added support for the skeletal objects API.
2024-04-09 17:13:59 +00:00
if ( ! Q_strcasecmp ( ext , searchpathformats [ j ] . extension ) )
2014-03-30 08:55:06 +00:00
{
2023-04-21 11:36:13 +00:00
pak = searchpathformats [ j ] . OpenNew ( f , parent , filename , pakname , pakpathprefix ) ;
2014-03-30 08:55:06 +00:00
if ( pak )
return pak ;
Con_Printf ( " Unable to open %s - corrupt? \n " , pakname ) ;
break ;
}
}
VFS_CLOSE ( f ) ;
return NULL ;
}
2005-12-21 03:07:33 +00:00
2016-08-25 00:12:14 +00:00
//
2017-11-23 07:46:39 +00:00
void FS_AddHashedPackage ( searchpath_t * * oldpaths , const char * parentpath , const char * logicalpaths , searchpath_t * search , unsigned int loadstuff , const char * pakpath , const char * qhash , const char * pakprefix , unsigned int packflags )
2015-05-14 03:06:58 +00:00
{
searchpathfuncs_t * handle ;
2016-08-25 00:12:14 +00:00
searchpath_t * oldp ;
char pname [ MAX_OSPATH ] ;
char lname [ MAX_OSPATH ] ;
char lname2 [ MAX_OSPATH ] ;
2015-05-14 03:06:58 +00:00
unsigned int keptflags ;
flocation_t loc ;
2016-08-25 00:12:14 +00:00
int fmt ;
char ext [ 8 ] ;
int ptlen = strlen ( parentpath ) ;
COM_FileExtension ( pakpath , ext , sizeof ( ext ) ) ;
//figure out which file format its meant to be.
for ( fmt = 0 ; fmt < sizeof ( searchpathformats ) / sizeof ( searchpathformats [ 0 ] ) ; fmt + + )
2015-05-14 03:06:58 +00:00
{
2016-08-25 00:12:14 +00:00
if ( ! searchpathformats [ fmt ] . extension | | ! searchpathformats [ fmt ] . OpenNew ) // || !searchpathformats[i].loadscan)
continue ;
if ( ( loadstuff & ( 1 < < fmt ) ) & & ! Q_strcasecmp ( ext , searchpathformats [ fmt ] . extension ) )
2015-05-14 03:06:58 +00:00
{
2016-08-25 00:12:14 +00:00
//figure out the logical path names
if ( ! FS_GenCachedPakName ( pakpath , qhash , pname , sizeof ( pname ) ) )
return ; //file name was invalid, panic.
2021-07-17 15:11:35 +00:00
if ( ! search )
{
Added sys_openfile console command(and menu option) to web and flatpak(via cmake+dbus) builds, to 'install' packages on sandboxed systems a bit more easily.
Cmake: Add FTE_WERROR option, defaults to true in debug builds and off in release builds (in case future compilers have issues).
Cmake: Pull in libXscreensaver so we don't get interrupted by screensavers when playing demos.
Make: Added `make webcl-rel` for a web build without server bloat (eg for sites focused on demo playback. Yes, this means you XantoM).
fteqcc: Include the decompiler in fteqcc (non-gui) builds ('-d' arg).
fteqcc: Decompiler can now mostly handle hexen2 mods without any unknown opcodes.
Allow ezHud and OpenSSL to be compiled as in-engine plugins, potentially for web and windows ports respectively.
Web: Fix support for ogg vorbis. Add support for voip.
Web: Added basic support for WebXR.
QTV: Don't try seeking on unseekable qtv streams. Don't spam when developer 1 is set.
QTV: add support for some eztv extensions.
MVD: added hack to use ktx's vweps in mvd where mvdsv doesn't bother to record the info.
qwfwd: hack around a hack in qwfwd, allowing it to work again.
recording: favour qwd in single player, instead of mvd.
Protocol: reduce client memory used for precache names. Bump maximum precache counts - some people are just abusive, yes you Orl.
hexen2: add enough clientside protocol compat to play the demo included with h2mp. lacks effects.
in_xflip: restored this setting.
fs_hidesyspaths: new cvar, defaults to enabled so you won't find your username or whatever turning up in screenshots or the like. change it to 0 before debuging stuff eg via 'path'.
gl_overbright_models: Added cvar to match QS.
netchan: Added MTU determination, we'll no longer fail to connect when routers stupidly drop icmp packets.
Win: try a few other versions of xinput too.
CSQC: Added a CSQC_GenerateMaterial function, to give the csqc a chance to generate custom materials.
MenuQC: Added support for the skeletal objects API.
2024-04-09 17:13:59 +00:00
FS_SystemPath ( pname , FS_ROOT , lname , sizeof ( lname ) ) ;
FS_SystemPath ( pakpath , FS_ROOT , lname2 , sizeof ( lname2 ) ) ;
2021-07-17 15:11:35 +00:00
}
else
{
snprintf ( lname , sizeof ( lname ) , " %s%s " , logicalpaths , pname + ptlen + 1 ) ;
snprintf ( lname2 , sizeof ( lname ) , " %s%s " , logicalpaths , pakpath + ptlen + 1 ) ;
}
2016-08-25 00:12:14 +00:00
//see if we already added it
for ( oldp = com_searchpaths ; oldp ; oldp = oldp - > next )
2015-05-14 03:06:58 +00:00
{
2016-08-25 00:12:14 +00:00
if ( strcmp ( oldp - > prefix , pakprefix ? pakprefix : " " ) ) //probably will only happen from typos, but should be correct.
2015-05-14 03:06:58 +00:00
continue ;
2016-08-25 00:12:14 +00:00
if ( ! Q_strcasecmp ( oldp - > purepath , pakpath ) )
break ;
if ( ! Q_strcasecmp ( oldp - > logicalpath , lname ) )
break ;
if ( ! Q_strcasecmp ( oldp - > logicalpath , lname2 ) )
break ;
}
if ( ! oldp )
{
//see if we can get an old archive handle from before whatever fs_restart
handle = FS_GetOldPath ( oldpaths , lname2 , & keptflags ) ;
if ( handle )
snprintf ( lname , sizeof ( lname ) , " %s " , lname2 ) ;
else
2015-05-14 03:06:58 +00:00
{
2016-08-25 00:12:14 +00:00
handle = FS_GetOldPath ( oldpaths , lname , & keptflags ) ;
2016-07-16 13:21:23 +00:00
2016-08-25 00:12:14 +00:00
//seems new, load it.
if ( ! handle )
{
vfsfile_t * vfs = NULL ;
if ( search )
2015-05-14 03:06:58 +00:00
{
2016-08-25 00:12:14 +00:00
if ( search - > handle - > FindFile ( search - > handle , & loc , pakpath + ptlen + 1 , NULL ) )
2016-07-16 13:21:23 +00:00
{
2017-07-12 08:15:27 +00:00
vfs = search - > handle - > OpenVFS ( search - > handle , & loc , " rb " ) ;
2016-08-25 00:12:14 +00:00
snprintf ( lname , sizeof ( lname ) , " %s " , lname2 ) ;
2016-07-16 13:21:23 +00:00
}
2016-08-25 00:12:14 +00:00
else if ( search - > handle - > FindFile ( search - > handle , & loc , pname + ptlen + 1 , NULL ) )
2017-07-12 08:15:27 +00:00
vfs = search - > handle - > OpenVFS ( search - > handle , & loc , " rb " ) ;
2016-08-25 00:12:14 +00:00
}
else
{
vfs = FS_OpenVFS ( pakpath , " rb " , FS_ROOT ) ;
2016-07-16 13:21:23 +00:00
if ( vfs )
2016-08-25 00:12:14 +00:00
snprintf ( lname , sizeof ( lname ) , " %s " , lname2 ) ;
else
vfs = FS_OpenVFS ( pname , " rb " , FS_ROOT ) ;
2016-07-16 13:21:23 +00:00
}
2016-08-25 00:12:14 +00:00
if ( vfs )
2018-03-04 14:41:16 +00:00
handle = searchpathformats [ fmt ] . OpenNew ( vfs , search ? search - > handle : NULL , pakpath , lname , pakprefix ? pakprefix : " " ) ;
2016-08-25 00:12:14 +00:00
if ( ! handle & & vfs )
VFS_CLOSE ( vfs ) ; //erk
2015-05-14 03:06:58 +00:00
}
2016-08-25 00:12:14 +00:00
}
//insert it into our path lists.
if ( handle & & qhash )
{
Added sys_openfile console command(and menu option) to web and flatpak(via cmake+dbus) builds, to 'install' packages on sandboxed systems a bit more easily.
Cmake: Add FTE_WERROR option, defaults to true in debug builds and off in release builds (in case future compilers have issues).
Cmake: Pull in libXscreensaver so we don't get interrupted by screensavers when playing demos.
Make: Added `make webcl-rel` for a web build without server bloat (eg for sites focused on demo playback. Yes, this means you XantoM).
fteqcc: Include the decompiler in fteqcc (non-gui) builds ('-d' arg).
fteqcc: Decompiler can now mostly handle hexen2 mods without any unknown opcodes.
Allow ezHud and OpenSSL to be compiled as in-engine plugins, potentially for web and windows ports respectively.
Web: Fix support for ogg vorbis. Add support for voip.
Web: Added basic support for WebXR.
QTV: Don't try seeking on unseekable qtv streams. Don't spam when developer 1 is set.
QTV: add support for some eztv extensions.
MVD: added hack to use ktx's vweps in mvd where mvdsv doesn't bother to record the info.
qwfwd: hack around a hack in qwfwd, allowing it to work again.
recording: favour qwd in single player, instead of mvd.
Protocol: reduce client memory used for precache names. Bump maximum precache counts - some people are just abusive, yes you Orl.
hexen2: add enough clientside protocol compat to play the demo included with h2mp. lacks effects.
in_xflip: restored this setting.
fs_hidesyspaths: new cvar, defaults to enabled so you won't find your username or whatever turning up in screenshots or the like. change it to 0 before debuging stuff eg via 'path'.
gl_overbright_models: Added cvar to match QS.
netchan: Added MTU determination, we'll no longer fail to connect when routers stupidly drop icmp packets.
Win: try a few other versions of xinput too.
CSQC: Added a CSQC_GenerateMaterial function, to give the csqc a chance to generate custom materials.
MenuQC: Added support for the skeletal objects API.
2024-04-09 17:13:59 +00:00
int truecrc = handle - > GeneratePureCRC ( handle , NULL ) ;
2016-08-25 00:12:14 +00:00
if ( truecrc ! = ( int ) strtoul ( qhash , NULL , 0 ) )
2015-05-14 03:06:58 +00:00
{
2023-04-21 11:36:13 +00:00
if ( pakprefix & & * pakprefix )
Con_Printf ( CON_ERROR " File \" %s \" [prefix %s] has hash %#x (required: %s). Please delete it or move it away \n " , lname , pakprefix , truecrc , qhash ) ;
else
Con_Printf ( CON_ERROR " File \" %s \" has hash %#x (required: %s). Please delete it or move it away \n " , lname , truecrc , qhash ) ;
2016-08-25 00:12:14 +00:00
handle - > ClosePath ( handle ) ;
handle = NULL ;
2015-05-14 03:06:58 +00:00
}
}
2016-08-25 00:12:14 +00:00
if ( handle )
2017-11-23 07:46:39 +00:00
FS_AddPathHandle ( oldpaths , pakpath , lname , handle , pakprefix , packflags | keptflags , ( unsigned int ) - 1 ) ;
2015-05-14 03:06:58 +00:00
}
2016-08-25 00:12:14 +00:00
return ;
2015-05-14 03:06:58 +00:00
}
}
}
2016-08-25 00:12:14 +00:00
static void FS_AddManifestPackages ( searchpath_t * * oldpaths , const char * purepath , const char * logicalpaths , searchpath_t * search , unsigned int loadstuff )
2015-05-14 03:06:58 +00:00
{
2023-02-20 07:47:16 +00:00
# ifndef PACKAGEMANAGER
2016-08-25 00:12:14 +00:00
int i ;
int ptlen , palen ;
ptlen = strlen ( purepath ) ;
for ( i = 0 ; i < sizeof ( fs_manifest - > package ) / sizeof ( fs_manifest - > package [ 0 ] ) ; i + + )
2015-05-14 03:06:58 +00:00
{
2016-08-25 00:12:14 +00:00
char qhash [ 16 ] ;
if ( ! fs_manifest - > package [ i ] . path )
2015-05-14 03:06:58 +00:00
continue ;
2016-08-25 00:12:14 +00:00
palen = strlen ( fs_manifest - > package [ i ] . path ) ;
if ( palen > ptlen & & ( fs_manifest - > package [ i ] . path [ ptlen ] = = ' / ' | | fs_manifest - > package [ i ] . path [ ptlen ] = = ' \\ ' ) & & ! strncmp ( purepath , fs_manifest - > package [ i ] . path , ptlen ) )
2015-05-14 03:06:58 +00:00
{
2016-08-25 00:12:14 +00:00
Q_snprintfz ( qhash , sizeof ( qhash ) , " %#x " , fs_manifest - > package [ i ] . crc ) ;
2019-02-23 09:29:20 +00:00
FS_AddHashedPackage ( oldpaths , purepath , logicalpaths , search , loadstuff , fs_manifest - > package [ i ] . path , fs_manifest - > package [ i ] . crcknown ? qhash : NULL , fs_manifest - > package [ i ] . prefix , SPF_COPYPROTECTED |
# ifdef FTE_TARGET_WEB
0 //web targets consider manifest packages as trusted, because they're about as trusted as the engine/html that goes with it.
# else
( fs_manifest - > security = = MANIFEST_SECURITY_NOT ? SPF_UNTRUSTED : 0 )
# endif
) ;
2015-05-14 03:06:58 +00:00
}
}
2023-02-20 07:47:16 +00:00
# endif
2015-05-14 03:06:58 +00:00
}
2016-08-25 00:12:14 +00:00
static void FS_AddDownloadManifestPackages ( searchpath_t * * oldpaths , unsigned int loadstuff ) //, const char *purepath, searchpath_t *search, const char *extension, searchpathfuncs_t *(QDECL *OpenNew)(vfsfile_t *file, const char *desc))
{
char logicalroot [ MAX_OSPATH ] ;
Added sys_openfile console command(and menu option) to web and flatpak(via cmake+dbus) builds, to 'install' packages on sandboxed systems a bit more easily.
Cmake: Add FTE_WERROR option, defaults to true in debug builds and off in release builds (in case future compilers have issues).
Cmake: Pull in libXscreensaver so we don't get interrupted by screensavers when playing demos.
Make: Added `make webcl-rel` for a web build without server bloat (eg for sites focused on demo playback. Yes, this means you XantoM).
fteqcc: Include the decompiler in fteqcc (non-gui) builds ('-d' arg).
fteqcc: Decompiler can now mostly handle hexen2 mods without any unknown opcodes.
Allow ezHud and OpenSSL to be compiled as in-engine plugins, potentially for web and windows ports respectively.
Web: Fix support for ogg vorbis. Add support for voip.
Web: Added basic support for WebXR.
QTV: Don't try seeking on unseekable qtv streams. Don't spam when developer 1 is set.
QTV: add support for some eztv extensions.
MVD: added hack to use ktx's vweps in mvd where mvdsv doesn't bother to record the info.
qwfwd: hack around a hack in qwfwd, allowing it to work again.
recording: favour qwd in single player, instead of mvd.
Protocol: reduce client memory used for precache names. Bump maximum precache counts - some people are just abusive, yes you Orl.
hexen2: add enough clientside protocol compat to play the demo included with h2mp. lacks effects.
in_xflip: restored this setting.
fs_hidesyspaths: new cvar, defaults to enabled so you won't find your username or whatever turning up in screenshots or the like. change it to 0 before debuging stuff eg via 'path'.
gl_overbright_models: Added cvar to match QS.
netchan: Added MTU determination, we'll no longer fail to connect when routers stupidly drop icmp packets.
Win: try a few other versions of xinput too.
CSQC: Added a CSQC_GenerateMaterial function, to give the csqc a chance to generate custom materials.
MenuQC: Added support for the skeletal objects API.
2024-04-09 17:13:59 +00:00
FS_SystemPath ( " downloads/ " , FS_ROOT , logicalroot , sizeof ( logicalroot ) ) ;
2016-08-25 00:12:14 +00:00
FS_AddManifestPackages ( oldpaths , " downloads " , logicalroot , NULL , loadstuff ) ;
}
2016-07-12 00:40:13 +00:00
static void FS_AddDataFiles ( searchpath_t * * oldpaths , const char * purepath , const char * logicalpath , searchpath_t * search , unsigned int pflags , unsigned int loadstuff )
2005-08-26 22:52:26 +00:00
{
2005-12-21 03:07:33 +00:00
//search is the parent
2016-07-12 00:40:13 +00:00
int i , j ;
2016-07-16 13:21:23 +00:00
searchpath_t * existing ;
2013-06-23 02:17:02 +00:00
searchpathfuncs_t * handle ;
2005-08-26 22:52:26 +00:00
char pakfile [ MAX_OSPATH ] ;
2013-06-23 02:17:02 +00:00
char logicalpaths [ MAX_OSPATH ] ; //with a slash
2008-11-09 22:29:28 +00:00
char purefile [ MAX_OSPATH ] ;
2018-08-04 19:00:19 +00:00
char logicalfile [ MAX_OSPATH * 2 ] ;
2013-12-17 22:45:37 +00:00
unsigned int keptflags ;
2005-12-21 03:07:33 +00:00
vfsfile_t * vfs ;
flocation_t loc ;
wildpaks_t wp ;
2019-09-04 08:32:22 +00:00
filelist_t list = { 0 } ;
2020-04-29 10:43:22 +00:00
qboolean qshack = ( pflags & SPF_QSHACK ) ;
pflags & = ~ SPF_QSHACK ;
2005-08-26 22:52:26 +00:00
2013-06-23 02:17:02 +00:00
Q_strncpyz ( logicalpaths , logicalpath , sizeof ( logicalpaths ) ) ;
FS_CleanDir ( logicalpaths , sizeof ( logicalpaths ) ) ;
2016-07-12 00:40:13 +00:00
wp . parentdesc = logicalpaths ;
wp . puredesc = purepath ;
wp . oldpaths = oldpaths ;
wp . inheritflags = pflags ;
2013-06-23 02:17:02 +00:00
2016-07-12 00:40:13 +00:00
//read pak.lst to get some sort of official ordering of pak files
if ( search - > handle - > FindFile ( search - > handle , & loc , " pak.lst " , NULL ) = = FF_FOUND )
{
char filename [ MAX_QPATH ] ;
char * buffer = BZ_Malloc ( loc . len + 1 ) ;
char * names = buffer ;
search - > handle - > ReadFile ( search - > handle , & loc , buffer ) ;
buffer [ loc . len ] = 0 ;
while ( names & & * names )
2013-06-23 02:17:02 +00:00
{
2016-07-12 00:40:13 +00:00
names = COM_ParseOut ( names , filename , sizeof ( filename ) ) ;
if ( * filename )
{
char extension [ MAX_QPATH ] ;
COM_FileExtension ( filename , extension , sizeof ( extension ) ) ;
//I dislike that this is tied to extensions, but whatever.
for ( j = 0 ; j < sizeof ( searchpathformats ) / sizeof ( searchpathformats [ 0 ] ) ; j + + )
{
if ( ! searchpathformats [ j ] . extension | | ! searchpathformats [ j ] . OpenNew | | ! searchpathformats [ j ] . loadscan )
continue ;
Added sys_openfile console command(and menu option) to web and flatpak(via cmake+dbus) builds, to 'install' packages on sandboxed systems a bit more easily.
Cmake: Add FTE_WERROR option, defaults to true in debug builds and off in release builds (in case future compilers have issues).
Cmake: Pull in libXscreensaver so we don't get interrupted by screensavers when playing demos.
Make: Added `make webcl-rel` for a web build without server bloat (eg for sites focused on demo playback. Yes, this means you XantoM).
fteqcc: Include the decompiler in fteqcc (non-gui) builds ('-d' arg).
fteqcc: Decompiler can now mostly handle hexen2 mods without any unknown opcodes.
Allow ezHud and OpenSSL to be compiled as in-engine plugins, potentially for web and windows ports respectively.
Web: Fix support for ogg vorbis. Add support for voip.
Web: Added basic support for WebXR.
QTV: Don't try seeking on unseekable qtv streams. Don't spam when developer 1 is set.
QTV: add support for some eztv extensions.
MVD: added hack to use ktx's vweps in mvd where mvdsv doesn't bother to record the info.
qwfwd: hack around a hack in qwfwd, allowing it to work again.
recording: favour qwd in single player, instead of mvd.
Protocol: reduce client memory used for precache names. Bump maximum precache counts - some people are just abusive, yes you Orl.
hexen2: add enough clientside protocol compat to play the demo included with h2mp. lacks effects.
in_xflip: restored this setting.
fs_hidesyspaths: new cvar, defaults to enabled so you won't find your username or whatever turning up in screenshots or the like. change it to 0 before debuging stuff eg via 'path'.
gl_overbright_models: Added cvar to match QS.
netchan: Added MTU determination, we'll no longer fail to connect when routers stupidly drop icmp packets.
Win: try a few other versions of xinput too.
CSQC: Added a CSQC_GenerateMaterial function, to give the csqc a chance to generate custom materials.
MenuQC: Added support for the skeletal objects API.
2024-04-09 17:13:59 +00:00
if ( ! Q_strcasecmp ( extension , searchpathformats [ j ] . extension ) )
2016-07-12 00:40:13 +00:00
{
if ( loadstuff & ( 1 < < j ) )
{
wp . OpenNew = searchpathformats [ j ] . OpenNew ;
2019-09-04 08:32:22 +00:00
FS_AddSingleDataFile ( filename , & wp , search - > handle ) ;
2016-07-12 00:40:13 +00:00
}
break ;
}
}
}
2013-06-23 02:17:02 +00:00
}
2016-07-12 00:40:13 +00:00
BZ_Free ( buffer ) ;
2005-08-26 22:52:26 +00:00
}
2018-12-28 00:04:36 +00:00
# ifdef PACKAGEMANAGER
2016-08-25 00:12:14 +00:00
PM_LoadPackages ( oldpaths , purepath , logicalpaths , search , loadstuff , 0x80000000 , - 1 ) ;
2018-12-28 00:04:36 +00:00
# endif
2016-08-25 00:12:14 +00:00
2016-07-16 13:21:23 +00:00
for ( j = 0 ; j < sizeof ( searchpathformats ) / sizeof ( searchpathformats [ 0 ] ) ; j + + )
{
if ( ! searchpathformats [ j ] . extension | | ! searchpathformats [ j ] . OpenNew | | ! searchpathformats [ j ] . loadscan )
continue ;
if ( loadstuff & ( 1 < < j ) )
{
2020-04-29 10:43:22 +00:00
qboolean okay = true ;
2016-07-16 13:21:23 +00:00
const char * extension = searchpathformats [ j ] . extension ;
//first load all the numbered pak files
2020-04-29 10:43:22 +00:00
for ( i = 0 ; okay ; i + + )
2016-07-16 13:21:23 +00:00
{
snprintf ( pakfile , sizeof ( pakfile ) , " pak%i.%s " , i , extension ) ;
fs_finds + + ;
2020-04-29 10:43:22 +00:00
if ( search - > handle - > FindFile ( search - > handle , & loc , pakfile , NULL ) )
2016-07-16 13:21:23 +00:00
{
2020-04-29 10:43:22 +00:00
snprintf ( logicalfile , sizeof ( logicalfile ) , " %spak%i.%s " , logicalpaths , i , extension ) ;
snprintf ( purefile , sizeof ( purefile ) , " %s/pak%i.%s " , purepath , i , extension ) ;
for ( existing = com_searchpaths ; existing ; existing = existing - > next )
{
if ( ! Q_strcasecmp ( existing - > logicalpath , logicalfile ) ) //assumption: first member of structure is a char array
break ; //already loaded (base paths?)
}
if ( ! existing )
{
handle = FS_GetOldPath ( oldpaths , logicalfile , & keptflags ) ;
if ( ! handle )
{
vfs = search - > handle - > OpenVFS ( search - > handle , & loc , " rb " ) ;
if ( ! vfs )
break ;
handle = searchpathformats [ j ] . OpenNew ( vfs , search - > handle , pakfile , logicalfile , " " ) ;
if ( ! handle )
break ;
}
FS_AddPathHandle ( oldpaths , purefile , logicalfile , handle , " " , SPF_COPYPROTECTED | pflags | keptflags , ( unsigned int ) - 1 ) ;
}
2016-07-16 13:21:23 +00:00
}
2020-04-29 10:43:22 +00:00
else
okay = false ;
if ( i = = 0 & & qshack )
2016-07-16 13:21:23 +00:00
{
2020-04-29 10:43:22 +00:00
snprintf ( pakfile , sizeof ( pakfile ) , " quakespasm.%s " , extension ) ;
2018-03-04 14:41:16 +00:00
handle = FS_GetOldPath ( oldpaths , logicalfile , & keptflags ) ;
2016-07-16 13:21:23 +00:00
if ( ! handle )
2023-04-21 11:36:13 +00:00
handle = FS_OpenPackByExtension ( VFSOS_Open ( pakfile , " rb " ) , NULL , pakfile , pakfile , " " ) ;
2020-04-29 10:43:22 +00:00
if ( handle ) //logically should have SPF_EXPLICIT set, but that would give it a worse gamedir depth
FS_AddPathHandle ( oldpaths , " " , pakfile , handle , " " , SPF_COPYPROTECTED | SPF_PRIVATE , ( unsigned int ) - 1 ) ;
2016-07-16 13:21:23 +00:00
}
}
}
}
//now load ones from the manifest
2016-08-25 00:12:14 +00:00
FS_AddManifestPackages ( oldpaths , purepath , logicalpaths , search , loadstuff ) ;
2016-07-16 13:21:23 +00:00
2018-12-28 00:04:36 +00:00
# ifdef PACKAGEMANAGER
2016-08-25 00:12:14 +00:00
PM_LoadPackages ( oldpaths , purepath , logicalpaths , search , loadstuff , 0x0 , 1000 - 1 ) ;
2018-12-28 00:04:36 +00:00
# endif
2016-07-16 13:21:23 +00:00
2008-11-09 22:29:28 +00:00
//now load the random ones
2016-07-12 00:40:13 +00:00
for ( j = 0 ; j < sizeof ( searchpathformats ) / sizeof ( searchpathformats [ 0 ] ) ; j + + )
{
if ( ! searchpathformats [ j ] . extension | | ! searchpathformats [ j ] . OpenNew | | ! searchpathformats [ j ] . loadscan )
continue ;
if ( loadstuff & ( 1 < < j ) )
{
const char * extension = searchpathformats [ j ] . extension ;
wp . OpenNew = searchpathformats [ j ] . OpenNew ;
2016-07-16 13:21:23 +00:00
2016-07-12 00:40:13 +00:00
Q_snprintfz ( pakfile , sizeof ( pakfile ) , " *.%s " , extension ) ;
2019-09-04 08:32:22 +00:00
search - > handle - > EnumerateFiles ( search - > handle , pakfile , FS_FindWildDataFiles , & list ) ;
FS_LoadWildDataFiles ( & list , & wp ) ;
2016-07-12 00:40:13 +00:00
}
}
2016-08-25 00:12:14 +00:00
2018-12-28 00:04:36 +00:00
# ifdef PACKAGEMANAGER
2018-08-24 00:35:16 +00:00
PM_LoadPackages ( oldpaths , purepath , logicalpaths , search , loadstuff , 1000 , 0x7ffffffe ) ;
2018-12-28 00:04:36 +00:00
# endif
2009-04-01 22:03:56 +00:00
}
2016-07-12 00:40:13 +00:00
static searchpath_t * FS_AddPathHandle ( searchpath_t * * oldpaths , const char * purepath , const char * logicalpath , searchpathfuncs_t * handle , const char * prefix , unsigned int flags , unsigned int loadstuff )
2009-04-01 22:03:56 +00:00
{
2011-10-27 16:16:29 +00:00
searchpath_t * search , * * link ;
2009-04-01 22:03:56 +00:00
2013-06-23 02:17:02 +00:00
if ( ! handle )
{
Con_Printf ( " COM_AddPathHandle: not a valid handle (%s) \n " , logicalpath ) ;
return NULL ;
}
if ( handle - > fsver ! = FSVER )
2009-04-01 22:03:56 +00:00
{
2013-06-23 02:17:02 +00:00
Con_Printf ( " %s: file system driver is outdated (%u should be %u) \n " , logicalpath , handle - > fsver , FSVER ) ;
handle - > ClosePath ( handle ) ;
2009-04-01 22:03:56 +00:00
return NULL ;
}
search = ( searchpath_t * ) Z_Malloc ( sizeof ( searchpath_t ) ) ;
search - > handle = handle ;
2013-06-23 02:17:02 +00:00
Q_strncpyz ( search - > purepath , purepath , sizeof ( search - > purepath ) ) ;
Q_strncpyz ( search - > logicalpath , logicalpath , sizeof ( search - > logicalpath ) ) ;
2023-04-21 11:36:13 +00:00
if ( prefix & & * prefix )
{
2016-07-12 00:40:13 +00:00
Q_strncpyz ( search - > prefix , prefix , sizeof ( search - > prefix ) ) ;
2023-04-21 11:36:13 +00:00
flags | = SPF_COPYPROTECTED ; //don't do downloading weirdness when there's weird prefix shenanegans going on.
}
search - > flags = flags ;
2009-04-01 22:03:56 +00:00
Added sys_openfile console command(and menu option) to web and flatpak(via cmake+dbus) builds, to 'install' packages on sandboxed systems a bit more easily.
Cmake: Add FTE_WERROR option, defaults to true in debug builds and off in release builds (in case future compilers have issues).
Cmake: Pull in libXscreensaver so we don't get interrupted by screensavers when playing demos.
Make: Added `make webcl-rel` for a web build without server bloat (eg for sites focused on demo playback. Yes, this means you XantoM).
fteqcc: Include the decompiler in fteqcc (non-gui) builds ('-d' arg).
fteqcc: Decompiler can now mostly handle hexen2 mods without any unknown opcodes.
Allow ezHud and OpenSSL to be compiled as in-engine plugins, potentially for web and windows ports respectively.
Web: Fix support for ogg vorbis. Add support for voip.
Web: Added basic support for WebXR.
QTV: Don't try seeking on unseekable qtv streams. Don't spam when developer 1 is set.
QTV: add support for some eztv extensions.
MVD: added hack to use ktx's vweps in mvd where mvdsv doesn't bother to record the info.
qwfwd: hack around a hack in qwfwd, allowing it to work again.
recording: favour qwd in single player, instead of mvd.
Protocol: reduce client memory used for precache names. Bump maximum precache counts - some people are just abusive, yes you Orl.
hexen2: add enough clientside protocol compat to play the demo included with h2mp. lacks effects.
in_xflip: restored this setting.
fs_hidesyspaths: new cvar, defaults to enabled so you won't find your username or whatever turning up in screenshots or the like. change it to 0 before debuging stuff eg via 'path'.
gl_overbright_models: Added cvar to match QS.
netchan: Added MTU determination, we'll no longer fail to connect when routers stupidly drop icmp packets.
Win: try a few other versions of xinput too.
CSQC: Added a CSQC_GenerateMaterial function, to give the csqc a chance to generate custom materials.
MenuQC: Added support for the skeletal objects API.
2024-04-09 17:13:59 +00:00
search - > crc_check = 0 ;
search - > crc_seed = ~ fs_pureseed ;
search - > crc_reply = 0 ;
if ( search - > handle - > GeneratePureCRC )
{
search - > crc_check = search - > handle - > GeneratePureCRC ( search - > handle , NULL ) ;
if ( flags & SPF_SERVER )
{
search - > crc_seed = fs_pureseed ;
search - > crc_reply = search - > handle - > GeneratePureCRC ( search - > handle , & search - > crc_seed ) ;
}
}
2015-06-14 01:28:01 +00:00
flags & = ~ SPF_WRITABLE ;
2013-03-12 22:35:33 +00:00
//temp packages also do not nest
2021-05-28 07:07:48 +00:00
if ( ! ( flags & SPF_TEMPORARY ) )
2022-03-01 02:51:55 +00:00
FS_AddDataFiles ( oldpaths , purepath , logicalpath , search , flags & ( SPF_COPYPROTECTED | SPF_UNTRUSTED | SPF_TEMPORARY | SPF_SERVER | SPF_PRIVATE | SPF_QSHACK ) , loadstuff ) ;
2013-03-12 22:35:33 +00:00
Added sys_openfile console command(and menu option) to web and flatpak(via cmake+dbus) builds, to 'install' packages on sandboxed systems a bit more easily.
Cmake: Add FTE_WERROR option, defaults to true in debug builds and off in release builds (in case future compilers have issues).
Cmake: Pull in libXscreensaver so we don't get interrupted by screensavers when playing demos.
Make: Added `make webcl-rel` for a web build without server bloat (eg for sites focused on demo playback. Yes, this means you XantoM).
fteqcc: Include the decompiler in fteqcc (non-gui) builds ('-d' arg).
fteqcc: Decompiler can now mostly handle hexen2 mods without any unknown opcodes.
Allow ezHud and OpenSSL to be compiled as in-engine plugins, potentially for web and windows ports respectively.
Web: Fix support for ogg vorbis. Add support for voip.
Web: Added basic support for WebXR.
QTV: Don't try seeking on unseekable qtv streams. Don't spam when developer 1 is set.
QTV: add support for some eztv extensions.
MVD: added hack to use ktx's vweps in mvd where mvdsv doesn't bother to record the info.
qwfwd: hack around a hack in qwfwd, allowing it to work again.
recording: favour qwd in single player, instead of mvd.
Protocol: reduce client memory used for precache names. Bump maximum precache counts - some people are just abusive, yes you Orl.
hexen2: add enough clientside protocol compat to play the demo included with h2mp. lacks effects.
in_xflip: restored this setting.
fs_hidesyspaths: new cvar, defaults to enabled so you won't find your username or whatever turning up in screenshots or the like. change it to 0 before debuging stuff eg via 'path'.
gl_overbright_models: Added cvar to match QS.
netchan: Added MTU determination, we'll no longer fail to connect when routers stupidly drop icmp packets.
Win: try a few other versions of xinput too.
CSQC: Added a CSQC_GenerateMaterial function, to give the csqc a chance to generate custom materials.
MenuQC: Added support for the skeletal objects API.
2024-04-09 17:13:59 +00:00
search - > nextpure = ( void * ) 0x1 ; //mark as not linked
2022-03-01 02:51:55 +00:00
if ( flags & ( SPF_TEMPORARY | SPF_SERVER ) )
2011-10-27 16:16:29 +00:00
{
//add at end. pureness will reorder if needed.
link = & com_searchpaths ;
while ( * link )
{
link = & ( * link ) - > next ;
}
* link = search ;
}
else
{
search - > next = com_searchpaths ;
com_searchpaths = search ;
}
2009-04-01 22:03:56 +00:00
com_fschanged = true ;
return search ;
2005-08-26 22:52:26 +00:00
}
2017-02-19 00:15:42 +00:00
static void COM_RefreshFSCache_f ( void )
2005-08-26 22:52:26 +00:00
{
com_fschanged = true ;
}
2014-10-05 20:04:11 +00:00
//optionally purges the cache and rebuilds it
void COM_FlushFSCache ( qboolean purge , qboolean domutex )
2005-08-26 22:52:26 +00:00
{
2012-05-09 15:30:53 +00:00
searchpath_t * search ;
2013-10-29 17:38:22 +00:00
if ( com_fs_cache . ival & & com_fs_cache . ival ! = 2 )
2012-05-09 15:30:53 +00:00
{
for ( search = com_searchpaths ; search ; search = search - > next )
{
2013-06-23 02:17:02 +00:00
if ( search - > handle - > PollChanges )
com_fschanged | = search - > handle - > PollChanges ( search - > handle ) ;
2012-05-09 15:30:53 +00:00
}
}
2014-02-07 08:38:40 +00:00
2014-08-27 08:41:31 +00:00
# ifdef FTE_TARGET_WEB
//web target doesn't support filesystem enumeration, so make sure the cache is kept invalid and disabled.
com_fschanged = true ;
# else
if ( com_fs_cache . ival & & com_fschanged )
2014-04-03 02:16:21 +00:00
{
//rebuild it if needed
2014-10-05 20:04:11 +00:00
FS_RebuildFSHash ( domutex ) ;
2014-04-03 02:16:21 +00:00
}
2014-08-27 08:41:31 +00:00
# endif
2005-08-26 22:52:26 +00:00
}
2010-07-11 02:22:39 +00:00
/*since should start as 0, otherwise this can be used to poll*/
qboolean FS_Restarted ( unsigned int * since )
{
if ( * since < fs_restarts )
{
* since = fs_restarts ;
return true ;
}
return false ;
}
2023-04-03 00:33:35 +00:00
# ifdef __WIN32 //already assumed to be case insensitive. let the OS keep fixing up the paths itself.
2023-06-23 21:32:20 +00:00
static qboolean FS_FixupFileCase ( char * out , size_t outsize , const char * basedir , const char * entry , qboolean isdir )
2023-04-03 00:33:35 +00:00
{
2023-07-02 03:19:01 +00:00
return Q_snprintfz ( out , outsize , " %s%s " , basedir , entry ) < outsize ;
2023-04-03 00:33:35 +00:00
}
# else
struct fixupcase_s
{
char * out ;
size_t outsize ;
const char * match ;
size_t matchlen ;
qboolean isdir ; //directory results have a trailing /
} ;
static int FS_FixupFileCaseResult ( const char * name , qofs_t sz , time_t modtime , void * vparm , searchpathfuncs_t * spath )
{
struct fixupcase_s * parm = vparm ;
if ( strlen ( name ) ! = parm - > matchlen + parm - > isdir )
return true ;
if ( parm - > isdir & & name [ parm - > matchlen ] ! = ' / ' )
return true ;
if ( Q_strncasecmp ( name , parm - > match , parm - > matchlen ) )
return true ;
memcpy ( parm - > out , name , parm - > matchlen ) ;
return ! ! Q_strncmp ( name , parm - > match , parm - > matchlen ) ; //stop if we find the exact path case. otherwise keep looking
}
//like snprintf("%s%s") but fixes up 'gamedir' case to a real file
static qboolean FS_FixupFileCase ( char * out , size_t outsize , const char * basedir , const char * entry , qboolean isdir )
{
char * s ;
struct fixupcase_s parm = { out + strlen ( basedir ) , outsize - strlen ( basedir ) , entry , strlen ( entry ) , isdir } ;
if ( Q_snprintfz ( out , outsize , " %s%s " , basedir , entry ) > = outsize | | outsize < strlen ( basedir ) + 1 | | parm . outsize < parm . matchlen + 1 )
return false ; //over sized?...
if ( strchr ( entry , ' / ' ) ) for ( ; ; )
{
parm . match = entry ;
s = strchr ( entry , ' / ' ) ;
if ( s )
{
parm . isdir = true ;
parm . matchlen = s - entry ;
Sys_EnumerateFiles ( basedir , " * " , FS_FixupFileCaseResult , & parm , NULL ) ;
parm . out + = parm . matchlen + 1 ;
parm . outsize - = parm . matchlen + 1 ;
entry + = ( s - entry ) + 1 ;
}
else
{
parm . isdir = isdir ;
parm . matchlen = strlen ( entry ) ;
parm . out [ - 1 ] = 0 ;
Sys_EnumerateFiles ( out , " * " , FS_FixupFileCaseResult , & parm , NULL ) ;
parm . out [ - 1 ] = ' / ' ;
break ;
}
}
else
Sys_EnumerateFiles ( basedir , " * " , FS_FixupFileCaseResult , & parm , NULL ) ;
return true ;
}
# endif
2005-08-26 22:52:26 +00:00
/*
= = = = = = = = = = = = = = = =
2009-04-01 22:03:56 +00:00
FS_AddGameDirectory
2005-08-26 22:52:26 +00:00
Sets com_gamedir , adds the directory to the head of the path ,
2005-11-21 21:09:11 +00:00
then loads and adds pak1 . pak pak2 . pak . . .
2005-08-26 22:52:26 +00:00
= = = = = = = = = = = = = = = =
*/
2019-05-23 15:11:32 +00:00
static searchpath_t * FS_AddSingleGameDirectory ( searchpath_t * * oldpaths , const char * puredir , const char * dir , unsigned int loadstuff , unsigned int flags )
2005-08-26 22:52:26 +00:00
{
2013-12-17 22:45:37 +00:00
unsigned int keptflags ;
2005-08-26 22:52:26 +00:00
searchpath_t * search ;
char * p ;
2012-05-09 15:30:53 +00:00
void * handle ;
2005-08-26 22:52:26 +00:00
2010-07-11 02:22:39 +00:00
fs_restarts + + ;
2005-08-26 22:52:26 +00:00
for ( search = com_searchpaths ; search ; search = search - > next )
{
2014-02-07 08:38:40 +00:00
if ( ! Q_strcasecmp ( search - > logicalpath , dir ) )
2016-08-25 00:12:14 +00:00
{
search - > flags | = flags & SPF_WRITABLE ;
2019-05-23 15:11:32 +00:00
return search ; //already loaded (base paths?)
2016-08-25 00:12:14 +00:00
}
2005-08-26 22:52:26 +00:00
}
2014-03-30 08:55:06 +00:00
if ( ! ( flags & SPF_PRIVATE ) )
{
if ( ( p = strrchr ( dir , ' / ' ) ) ! = NULL )
2016-08-25 00:12:14 +00:00
Q_strncpyz ( pubgamedirfile , + + p , sizeof ( pubgamedirfile ) ) ;
2014-03-30 08:55:06 +00:00
else
2016-08-25 00:12:14 +00:00
Q_strncpyz ( pubgamedirfile , dir , sizeof ( pubgamedirfile ) ) ;
2014-03-30 08:55:06 +00:00
}
if ( ( p = strrchr ( dir , ' / ' ) ) ! = NULL )
2016-08-25 00:12:14 +00:00
Q_strncpyz ( gamedirfile , + + p , sizeof ( gamedirfile ) ) ;
2014-03-30 08:55:06 +00:00
else
2016-08-25 00:12:14 +00:00
Q_strncpyz ( gamedirfile , dir , sizeof ( gamedirfile ) ) ;
2014-03-30 08:55:06 +00:00
2005-08-26 22:52:26 +00:00
//
// add the directory to the search path
//
2013-12-17 22:45:37 +00:00
handle = FS_GetOldPath ( oldpaths , dir , & keptflags ) ;
2013-06-23 02:17:02 +00:00
if ( ! handle )
2018-03-04 14:41:16 +00:00
handle = VFSOS_OpenPath ( NULL , NULL , dir , dir , " " ) ;
2005-10-31 00:52:03 +00:00
2022-03-01 02:51:55 +00:00
return FS_AddPathHandle ( oldpaths , puredir , dir , handle , " " , flags | keptflags | SPF_ISDIR , loadstuff ) ;
2019-05-23 15:11:32 +00:00
}
static void FS_AddGameDirectory ( searchpath_t * * oldpaths , const char * puredir , unsigned int loadstuff , unsigned int flags )
{
char syspath [ MAX_OSPATH ] ;
2023-04-03 00:33:35 +00:00
if ( FS_FixupFileCase ( syspath , sizeof ( syspath ) , com_gamepath , puredir , true ) )
gameonly_gamedir = FS_AddSingleGameDirectory ( oldpaths , puredir , syspath , loadstuff , flags & ~ ( com_homepathenabled ? SPF_WRITABLE : 0u ) ) ;
else
gameonly_gamedir = NULL ;
if ( com_homepathenabled & & FS_FixupFileCase ( syspath , sizeof ( syspath ) , com_homepath , puredir , true ) )
2019-05-23 15:11:32 +00:00
gameonly_homedir = FS_AddSingleGameDirectory ( oldpaths , puredir , syspath , loadstuff , flags ) ;
else
gameonly_homedir = NULL ;
2005-08-26 22:52:26 +00:00
}
2014-09-20 04:11:39 +00:00
//if syspath, something like c:\quake\baseq2
//otherwise just baseq2. beware of dupes.
searchpathfuncs_t * COM_IteratePaths ( void * * iterator , char * pathbuffer , int pathbuffersize , char * dirname , int dirnamesize )
2005-08-26 22:52:26 +00:00
{
searchpath_t * s ;
2013-06-23 02:17:02 +00:00
void * prev ;
2005-08-26 22:52:26 +00:00
2009-04-01 22:03:56 +00:00
prev = NULL ;
2005-08-26 22:52:26 +00:00
for ( s = com_searchpaths ; s ; s = s - > next )
{
2013-06-23 02:17:02 +00:00
if ( ! ( s - > flags & SPF_EXPLICIT ) )
2005-08-26 22:52:26 +00:00
continue ;
2013-06-23 02:17:02 +00:00
if ( * iterator = = prev )
{
* iterator = s - > handle ;
2014-09-20 04:11:39 +00:00
if ( ! strchr ( s - > purepath , ' / ' ) )
{
if ( pathbuffer )
{
Q_strncpyz ( pathbuffer , s - > logicalpath , pathbuffersize - 1 ) ;
FS_CleanDir ( pathbuffer , pathbuffersize ) ;
}
if ( dirname )
{
Q_strncpyz ( dirname , s - > purepath , dirnamesize - 1 ) ;
}
return s - > handle ;
}
2013-06-23 02:17:02 +00:00
}
prev = s - > handle ;
2005-08-26 22:52:26 +00:00
}
2013-06-23 02:17:02 +00:00
* iterator = NULL ;
2014-09-20 04:11:39 +00:00
if ( pathbuffer )
* pathbuffer = 0 ;
if ( dirname )
* dirname = 0 ;
2005-08-26 22:52:26 +00:00
return NULL ;
}
2014-03-30 08:55:06 +00:00
char * FS_GetGamedir ( qboolean publicpathonly )
2005-08-26 22:52:26 +00:00
{
2014-03-30 08:55:06 +00:00
if ( publicpathonly )
return pubgamedirfile ;
else
return gamedirfile ;
}
//returns the commandline arguments required to duplicate the fs details
char * FS_GetManifestArgs ( void )
{
2014-09-02 02:44:43 +00:00
char * homearg = com_homepathenabled ? " -usehome " : " -nohome " ;
2020-04-19 01:23:32 +00:00
if ( fs_manifest - > filename )
return va ( " %s-manifest %s -basedir %s " , homearg , fs_manifest - > filename , com_gamepath ) ;
2014-03-30 08:55:06 +00:00
2016-07-12 00:40:13 +00:00
return va ( " %s-game %s -basedir %s " , homearg , pubgamedirfile , com_gamepath ) ;
}
2020-04-19 01:23:32 +00:00
# ifdef SUBSERVERS
2016-07-12 00:40:13 +00:00
int FS_GetManifestArgv ( char * * argv , int maxargs )
{
int c = 0 ;
if ( maxargs < 5 )
return c ;
argv [ c + + ] = com_homepathenabled ? " -usehome " : " -nohome " ;
2020-04-19 01:23:32 +00:00
if ( fs_manifest - > filename )
2016-07-12 00:40:13 +00:00
{
argv [ c + + ] = " -manifest " ;
2020-04-19 01:23:32 +00:00
argv [ c + + ] = fs_manifest - > filename ;
2016-07-12 00:40:13 +00:00
}
else
{
argv [ c + + ] = " -game " ;
argv [ c + + ] = pubgamedirfile ;
}
2020-04-19 01:23:32 +00:00
2016-07-12 00:40:13 +00:00
argv [ c + + ] = " -basedir " ;
argv [ c + + ] = com_gamepath ;
2020-04-19 01:23:32 +00:00
argv [ c + + ] = " +deathmatch " ;
argv [ c + + ] = * deathmatch . string ? deathmatch . string : " 0 " ;
argv [ c + + ] = " +coop " ;
argv [ c + + ] = * coop . string ? coop . string : " 0 " ;
2016-07-12 00:40:13 +00:00
return c ;
2009-04-01 22:03:56 +00:00
}
2020-04-19 01:23:32 +00:00
# endif
Android: fat presses, vibrator, onscreen keyboard, keep-screen-on, console scaling, touch-based console scrolling, additional bindables.
Some memory leaks fixed.
latency with the nq protocol over loopback is much reduced.
Terrain: now mostly a property of a (q1 for now) bsp map, file format changed, glsl now built in, terrain editor builtin improved/changed, holes supported.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4067 fc73d0e0-1445-4013-8a0c-d673dee63da5
2012-07-14 16:25:18 +00:00
2018-10-11 10:31:23 +00:00
/*
2013-06-23 02:17:02 +00:00
//given a 'c:/foo/bar/' path, will extract 'bar'.
2018-10-11 10:31:23 +00:00
static void FS_ExtractDir ( char * in , char * out , int outlen )
Android: fat presses, vibrator, onscreen keyboard, keep-screen-on, console scaling, touch-based console scrolling, additional bindables.
Some memory leaks fixed.
latency with the nq protocol over loopback is much reduced.
Terrain: now mostly a property of a (q1 for now) bsp map, file format changed, glsl now built in, terrain editor builtin improved/changed, holes supported.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4067 fc73d0e0-1445-4013-8a0c-d673dee63da5
2012-07-14 16:25:18 +00:00
{
char * end ;
if ( ! outlen )
return ;
end = in + strlen ( in ) ;
//skip over any trailing slashes
while ( end > in )
{
if ( end [ - 1 ] = = ' / ' | | end [ - 1 ] = = ' \\ ' )
end - - ;
else
break ;
}
//skip over the path
while ( end > in )
{
if ( end [ - 1 ] ! = ' / ' & & end [ - 1 ] ! = ' \\ ' )
end - - ;
else
break ;
}
//copy string into the dest
while ( - - outlen )
{
if ( * end = = ' / ' | | * end = = ' \\ ' | | ! * end )
break ;
* out + + = * end + + ;
}
* out = 0 ;
2018-10-11 10:31:23 +00:00
} */
2013-06-23 02:17:02 +00:00
2015-05-14 03:06:58 +00:00
qboolean FS_PathURLCache ( const char * url , char * path , size_t pathsize )
{
char tmp [ MAX_QPATH ] ;
2016-02-15 06:01:17 +00:00
char * o = tmp ;
2015-05-14 03:06:58 +00:00
const char * i = url ;
strcpy ( o , " downloads/ " ) ;
o + = strlen ( o ) ;
while ( * i )
{
if ( * i = = ' : ' | | * i = = ' ? ' | | * i = = ' * ' | | * i = = ' & ' )
{
if ( i [ 0 ] = = ' : ' & & i [ 1 ] = = ' / ' & & i [ 2 ] = = ' / ' )
{
i + = 2 ;
continue ;
}
* o + + = ' _ ' ;
i + + ;
continue ;
}
if ( * i = = ' \\ ' )
{
* o + + = ' / ' ;
i + + ;
continue ;
}
* o + + = * i + + ;
}
* o = 0 ;
2020-02-26 00:37:52 +00:00
if ( ! FS_GetCleanPath ( tmp , false , path , pathsize ) )
2015-05-14 03:06:58 +00:00
return false ;
return true ;
}
2022-03-08 05:31:34 +00:00
static ftemanifest_t * FS_Manifest_ChangeGameDir ( const char * newgamedir )
2005-08-26 22:52:26 +00:00
{
2013-06-23 02:17:02 +00:00
ftemanifest_t * man ;
2022-03-08 05:31:34 +00:00
if ( * newgamedir & & ! FS_GamedirIsOkay ( newgamedir ) )
return fs_manifest ;
2013-11-29 14:36:47 +00:00
2022-03-08 05:31:34 +00:00
man = FS_Manifest_ReadMod ( newgamedir ) ;
2013-06-23 02:17:02 +00:00
2014-10-29 05:03:03 +00:00
if ( ! man )
{
//generate a new manifest based upon the current one.
man = FS_ReadDefaultManifest ( com_gamepath , sizeof ( com_gamepath ) , true ) ;
if ( man & & strcmp ( man - > installation , fs_manifest - > installation ) )
{
FS_Manifest_Free ( man ) ;
man = NULL ;
}
if ( ! man )
man = FS_Manifest_Clone ( fs_manifest ) ;
FS_Manifest_PurgeGamedirs ( man ) ;
2022-03-08 05:31:34 +00:00
if ( * newgamedir )
2014-10-29 05:03:03 +00:00
{
2015-05-14 03:06:58 +00:00
char token [ MAX_QPATH ] , quot [ MAX_QPATH ] ;
2022-03-08 05:31:34 +00:00
char * dup = Z_StrDup ( newgamedir ) ; //FIXME: is this really needed?
newgamedir = dup ;
while ( ( newgamedir = COM_ParseStringSet ( newgamedir , token , sizeof ( token ) ) ) )
2014-10-29 05:03:03 +00:00
{
2022-03-08 05:31:34 +00:00
if ( ! strcmp ( newgamedir , " ; " ) )
2014-10-29 05:03:03 +00:00
continue ;
if ( ! * token )
continue ;
2015-05-14 03:06:58 +00:00
Cmd_TokenizeString ( va ( " gamedir %s " , COM_QuotedString ( token , quot , sizeof ( quot ) , false ) ) , false , false ) ;
2014-10-29 05:03:03 +00:00
FS_Manifest_ParseTokens ( man ) ;
}
Z_Free ( dup ) ;
2013-06-23 02:17:02 +00:00
}
2022-03-08 05:31:34 +00:00
}
return man ;
}
/*
= = = = = = = = = = = = = = = =
COM_Gamedir
Sets the gamedir and path to a different directory .
= = = = = = = = = = = = = = = =
*/
void COM_Gamedir ( const char * dir , const struct gamepacks * packagespaths )
{
ftemanifest_t * man ;
COM_FlushTempoaryPacks ( ) ;
if ( ! fs_manifest )
FS_ChangeGame ( NULL , true , false ) ;
//we do allow empty here, for base.
if ( * dir & & ! FS_GamedirIsOkay ( dir ) )
{
Con_Printf ( " Gamedir should be a single filename, not \" %s \" \n " , dir ) ;
return ;
}
man = FS_Manifest_ChangeGameDir ( dir ) ;
2024-04-25 05:57:34 +00:00
while ( packagespaths & & ( packagespaths - > package | | packagespaths - > path ) )
2022-03-08 05:31:34 +00:00
{
char quot [ MAX_QPATH ] ;
char quot2 [ MAX_OSPATH ] ;
char quot3 [ MAX_OSPATH ] ;
2024-04-25 05:57:34 +00:00
char quot4 [ MAX_OSPATH ] ;
Cmd_TokenizeString ( va ( " package %s %s%s %s%s %s%s " ,
COM_QuotedString ( packagespaths - > path , quot , sizeof ( quot ) , false ) , //name
packagespaths - > subpath ? " prefix " : " " , packagespaths - > subpath ? COM_QuotedString ( packagespaths - > subpath , quot2 , sizeof ( quot2 ) , false ) : " " , //prefix
packagespaths - > url ? " mirror " : " " , packagespaths - > url ? COM_QuotedString ( packagespaths - > url , quot3 , sizeof ( quot3 ) , false ) : " " , //mirror
packagespaths - > package ? " name " : " " , packagespaths - > package ? COM_QuotedString ( packagespaths - > package , quot4 , sizeof ( quot4 ) , false ) : " " //
) , false , false ) ;
2022-03-08 05:31:34 +00:00
FS_Manifest_ParseTokens ( man ) ;
packagespaths + + ;
2013-06-23 02:17:02 +00:00
}
2015-04-14 23:12:17 +00:00
FS_ChangeGame ( man , cfg_reload_on_gamedir . ival , false ) ;
2022-03-08 05:31:34 +00:00
# ifdef HAVE_SERVER
if ( ! * dir )
dir = FS_GetGamedir ( true ) ;
InfoBuf_SetStarKey ( & svs . info , " *gamedir " , dir ) ;
# endif
2005-08-26 22:52:26 +00:00
}
2018-10-11 10:31:23 +00:00
static void QDECL Q_strnlowercatz ( char * d , const char * s , int n )
dpp7: Treat 'dropped' c2s packets as choked when using dpp7 protocols. This is because the protocol provides no way to disambiguate, and I don't like false reports of packetloss (only reliables loss can be detected, and that's not frequent enough to be meaningful). Pings can still be determined with dpp7, for those few packets which are acked.
package manager: reworked to enable/disable plugins when downloaded, which can also be present-but-disabled.
package manager: display a confirmation prompt before applying changes. do not allow other changes to be made while applying. prompt may be skipped with 'pkg apply' in dedicated servers.
sv: downloads are no longer forced to lower case.
sv: added sv_demoAutoCompress cvar. set to 1 to directly record to *.mvd.gz
cl: properly support directly playing .mvd.gz files
menus: reworked to separate mouse and keyboard focus. mouse focus becomes keyboard focus only on mouse clicks. tooltips follow mouse cursors.
menus: cleaned up menu heirachy a little. now simpler.
server browser: changed 'hide *' filters to 'show *' instead. I felt it was more logical.
deluxmapping: changed to disabled, load, generate, like r_loadlit is.
render targets api now supports negative formats to mean nearest filtering, where filtering is part of texture state.
drawrotpic fixed, now batches and interacts with drawpic correctly.
drawline fixed, no interacts with draw* correctly, but still does not batch.
fixed saving games.
provide proper userinfo to nq clients, where supported.
qcc: catch string table overflows safely, giving errors instead of crashes. switch to 32bit statements if some over-sized function requires it.
qtv: some bigcoords support tweaks
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5073 fc73d0e0-1445-4013-8a0c-d673dee63da5
2017-03-21 05:27:07 +00:00
{
int c = strlen ( d ) ;
d + = c ;
n - = c ;
n - = 1 ; //for the null
while ( * s & & n - - > 0 )
{
if ( * s > = ' A ' & & * s < = ' Z ' )
* d = ( * s - ' A ' ) + ' a ' ;
else
* d = * s ;
d + + ;
s + + ;
}
* d = 0 ;
}
2018-09-23 19:35:24 +00:00
//pname must be of the form "gamedir/foo.pk3"
//as a special exception, we allow "downloads/*.pk3 too"
2016-08-25 00:12:14 +00:00
qboolean FS_GenCachedPakName ( const char * pname , const char * crc , char * local , int llen )
2011-10-27 16:16:29 +00:00
{
2016-08-25 00:12:14 +00:00
const char * fn ;
2013-06-23 02:17:02 +00:00
char hex [ 16 ] ;
2011-10-27 16:16:29 +00:00
if ( strstr ( pname , " dlcache " ) )
{
2013-06-23 02:17:02 +00:00
* local = 0 ;
return false ;
2011-10-27 16:16:29 +00:00
}
2016-07-12 00:40:13 +00:00
if ( ! strncmp ( pname , " downloads/ " , 10 ) )
{
dpp7: Treat 'dropped' c2s packets as choked when using dpp7 protocols. This is because the protocol provides no way to disambiguate, and I don't like false reports of packetloss (only reliables loss can be detected, and that's not frequent enough to be meaningful). Pings can still be determined with dpp7, for those few packets which are acked.
package manager: reworked to enable/disable plugins when downloaded, which can also be present-but-disabled.
package manager: display a confirmation prompt before applying changes. do not allow other changes to be made while applying. prompt may be skipped with 'pkg apply' in dedicated servers.
sv: downloads are no longer forced to lower case.
sv: added sv_demoAutoCompress cvar. set to 1 to directly record to *.mvd.gz
cl: properly support directly playing .mvd.gz files
menus: reworked to separate mouse and keyboard focus. mouse focus becomes keyboard focus only on mouse clicks. tooltips follow mouse cursors.
menus: cleaned up menu heirachy a little. now simpler.
server browser: changed 'hide *' filters to 'show *' instead. I felt it was more logical.
deluxmapping: changed to disabled, load, generate, like r_loadlit is.
render targets api now supports negative formats to mean nearest filtering, where filtering is part of texture state.
drawrotpic fixed, now batches and interacts with drawpic correctly.
drawline fixed, no interacts with draw* correctly, but still does not batch.
fixed saving games.
provide proper userinfo to nq clients, where supported.
qcc: catch string table overflows safely, giving errors instead of crashes. switch to 32bit statements if some over-sized function requires it.
qtv: some bigcoords support tweaks
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5073 fc73d0e0-1445-4013-8a0c-d673dee63da5
2017-03-21 05:27:07 +00:00
* local = 0 ;
Q_strnlowercatz ( local , pname , llen ) ;
2016-07-12 00:40:13 +00:00
return true ;
}
2015-05-14 03:06:58 +00:00
for ( fn = pname ; * fn ; fn + + )
{
if ( * fn = = ' \\ ' | | * fn = = ' / ' )
{
fn + + ;
break ;
}
}
// fn = COM_SkipPath(pname);
2018-09-23 19:35:24 +00:00
if ( fn = = pname | | ! * fn )
2013-06-23 02:17:02 +00:00
{ //only allow it if it has some game path first.
* local = 0 ;
return false ;
}
2011-10-27 16:16:29 +00:00
Q_strncpyz ( local , pname , min ( ( fn - pname ) + 1 , llen ) ) ;
Q_strncatz ( local , " dlcache/ " , llen ) ;
dpp7: Treat 'dropped' c2s packets as choked when using dpp7 protocols. This is because the protocol provides no way to disambiguate, and I don't like false reports of packetloss (only reliables loss can be detected, and that's not frequent enough to be meaningful). Pings can still be determined with dpp7, for those few packets which are acked.
package manager: reworked to enable/disable plugins when downloaded, which can also be present-but-disabled.
package manager: display a confirmation prompt before applying changes. do not allow other changes to be made while applying. prompt may be skipped with 'pkg apply' in dedicated servers.
sv: downloads are no longer forced to lower case.
sv: added sv_demoAutoCompress cvar. set to 1 to directly record to *.mvd.gz
cl: properly support directly playing .mvd.gz files
menus: reworked to separate mouse and keyboard focus. mouse focus becomes keyboard focus only on mouse clicks. tooltips follow mouse cursors.
menus: cleaned up menu heirachy a little. now simpler.
server browser: changed 'hide *' filters to 'show *' instead. I felt it was more logical.
deluxmapping: changed to disabled, load, generate, like r_loadlit is.
render targets api now supports negative formats to mean nearest filtering, where filtering is part of texture state.
drawrotpic fixed, now batches and interacts with drawpic correctly.
drawline fixed, no interacts with draw* correctly, but still does not batch.
fixed saving games.
provide proper userinfo to nq clients, where supported.
qcc: catch string table overflows safely, giving errors instead of crashes. switch to 32bit statements if some over-sized function requires it.
qtv: some bigcoords support tweaks
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5073 fc73d0e0-1445-4013-8a0c-d673dee63da5
2017-03-21 05:27:07 +00:00
Q_strnlowercatz ( local , fn , llen ) ;
2016-08-25 00:12:14 +00:00
if ( crc & & * crc )
2011-10-27 16:16:29 +00:00
{
Q_strncatz ( local , " . " , llen ) ;
2020-04-19 01:23:32 +00:00
snprintf ( hex , sizeof ( hex ) , " %0x " , ( unsigned int ) strtoul ( crc , NULL , 0 ) ) ;
2013-06-23 02:17:02 +00:00
Q_strncatz ( local , hex , llen ) ;
2011-10-27 16:16:29 +00:00
}
2013-06-23 02:17:02 +00:00
return true ;
2011-10-27 16:16:29 +00:00
}
2018-12-28 00:04:36 +00:00
# ifdef HAVE_CLIENT
2013-06-23 02:17:02 +00:00
#if 0
qboolean FS_LoadPackageFromFile ( vfsfile_t * vfs , char * pname , char * localname , int * crc , unsigned int flags )
2013-03-12 23:01:08 +00:00
{
int i ;
2015-05-14 03:06:58 +00:00
char * ext = " zip " ; //(pname);
2013-06-23 02:17:02 +00:00
searchpathfuncs_t * handle ;
searchpath_t * oldlist = NULL ;
2013-03-12 23:01:08 +00:00
searchpath_t * sp ;
2015-05-14 03:06:58 +00:00
com_fschanged = true ;
2013-03-12 23:01:08 +00:00
for ( i = 0 ; i < sizeof ( searchpathformats ) / sizeof ( searchpathformats [ 0 ] ) ; i + + )
{
2013-06-23 02:17:02 +00:00
if ( ! searchpathformats [ i ] . extension | | ! searchpathformats [ i ] . OpenNew )
2013-03-12 23:01:08 +00:00
continue ;
Added sys_openfile console command(and menu option) to web and flatpak(via cmake+dbus) builds, to 'install' packages on sandboxed systems a bit more easily.
Cmake: Add FTE_WERROR option, defaults to true in debug builds and off in release builds (in case future compilers have issues).
Cmake: Pull in libXscreensaver so we don't get interrupted by screensavers when playing demos.
Make: Added `make webcl-rel` for a web build without server bloat (eg for sites focused on demo playback. Yes, this means you XantoM).
fteqcc: Include the decompiler in fteqcc (non-gui) builds ('-d' arg).
fteqcc: Decompiler can now mostly handle hexen2 mods without any unknown opcodes.
Allow ezHud and OpenSSL to be compiled as in-engine plugins, potentially for web and windows ports respectively.
Web: Fix support for ogg vorbis. Add support for voip.
Web: Added basic support for WebXR.
QTV: Don't try seeking on unseekable qtv streams. Don't spam when developer 1 is set.
QTV: add support for some eztv extensions.
MVD: added hack to use ktx's vweps in mvd where mvdsv doesn't bother to record the info.
qwfwd: hack around a hack in qwfwd, allowing it to work again.
recording: favour qwd in single player, instead of mvd.
Protocol: reduce client memory used for precache names. Bump maximum precache counts - some people are just abusive, yes you Orl.
hexen2: add enough clientside protocol compat to play the demo included with h2mp. lacks effects.
in_xflip: restored this setting.
fs_hidesyspaths: new cvar, defaults to enabled so you won't find your username or whatever turning up in screenshots or the like. change it to 0 before debuging stuff eg via 'path'.
gl_overbright_models: Added cvar to match QS.
netchan: Added MTU determination, we'll no longer fail to connect when routers stupidly drop icmp packets.
Win: try a few other versions of xinput too.
CSQC: Added a CSQC_GenerateMaterial function, to give the csqc a chance to generate custom materials.
MenuQC: Added support for the skeletal objects API.
2024-04-09 17:13:59 +00:00
if ( ! Q_strcasecmp ( ext , searchpathformats [ i ] . extension ) )
2013-03-12 23:01:08 +00:00
{
2013-06-23 02:17:02 +00:00
handle = searchpathformats [ i ] . OpenNew ( vfs , localname ) ;
2013-03-12 23:01:08 +00:00
if ( ! handle )
2013-03-12 23:09:25 +00:00
{
Con_Printf ( " file %s isn't a %s after all \n " , pname , searchpathformats [ i ] . extension ) ;
2013-03-12 23:01:08 +00:00
break ;
2013-03-12 23:09:25 +00:00
}
2013-03-12 23:01:08 +00:00
if ( crc )
{
2013-06-23 02:17:02 +00:00
int truecrc = handle - > GeneratePureCRC ( handle , 0 , false ) ;
2013-03-12 23:01:08 +00:00
if ( truecrc ! = * crc )
{
* crc = truecrc ;
2014-03-30 08:55:06 +00:00
handle - > ClosePath ( handle ) ;
2013-03-12 23:01:08 +00:00
return false ;
}
}
2013-06-23 02:17:02 +00:00
sp = FS_AddPathHandle ( & oldlist , pname , localname , handle , flags , ( unsigned int ) - 1 ) ;
2013-03-12 23:01:08 +00:00
if ( sp )
{
2015-05-14 03:06:58 +00:00
com_fschanged = true ;
2013-03-12 23:01:08 +00:00
return true ;
}
}
}
VFS_CLOSE ( vfs ) ;
return false ;
}
2013-06-23 02:17:02 +00:00
# endif
2014-03-30 08:55:06 +00:00
//'small' wrapper to open foo.zip/bar to read files within zips that are not part of the gamedir.
//name needs to be null terminated. recursive. pass null for search.
dpp7: Treat 'dropped' c2s packets as choked when using dpp7 protocols. This is because the protocol provides no way to disambiguate, and I don't like false reports of packetloss (only reliables loss can be detected, and that's not frequent enough to be meaningful). Pings can still be determined with dpp7, for those few packets which are acked.
package manager: reworked to enable/disable plugins when downloaded, which can also be present-but-disabled.
package manager: display a confirmation prompt before applying changes. do not allow other changes to be made while applying. prompt may be skipped with 'pkg apply' in dedicated servers.
sv: downloads are no longer forced to lower case.
sv: added sv_demoAutoCompress cvar. set to 1 to directly record to *.mvd.gz
cl: properly support directly playing .mvd.gz files
menus: reworked to separate mouse and keyboard focus. mouse focus becomes keyboard focus only on mouse clicks. tooltips follow mouse cursors.
menus: cleaned up menu heirachy a little. now simpler.
server browser: changed 'hide *' filters to 'show *' instead. I felt it was more logical.
deluxmapping: changed to disabled, load, generate, like r_loadlit is.
render targets api now supports negative formats to mean nearest filtering, where filtering is part of texture state.
drawrotpic fixed, now batches and interacts with drawpic correctly.
drawline fixed, no interacts with draw* correctly, but still does not batch.
fixed saving games.
provide proper userinfo to nq clients, where supported.
qcc: catch string table overflows safely, giving errors instead of crashes. switch to 32bit statements if some over-sized function requires it.
qtv: some bigcoords support tweaks
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5073 fc73d0e0-1445-4013-8a0c-d673dee63da5
2017-03-21 05:27:07 +00:00
//name is restored to its original state after the call, only technically not const
2014-03-30 08:55:06 +00:00
vfsfile_t * CL_OpenFileInPackage ( searchpathfuncs_t * search , char * name )
{
int found ;
vfsfile_t * f ;
flocation_t loc ;
char e , * n ;
2014-10-05 20:04:11 +00:00
char ext [ 8 ] ;
2014-03-30 08:55:06 +00:00
char * end ;
int i ;
dpp7: Treat 'dropped' c2s packets as choked when using dpp7 protocols. This is because the protocol provides no way to disambiguate, and I don't like false reports of packetloss (only reliables loss can be detected, and that's not frequent enough to be meaningful). Pings can still be determined with dpp7, for those few packets which are acked.
package manager: reworked to enable/disable plugins when downloaded, which can also be present-but-disabled.
package manager: display a confirmation prompt before applying changes. do not allow other changes to be made while applying. prompt may be skipped with 'pkg apply' in dedicated servers.
sv: downloads are no longer forced to lower case.
sv: added sv_demoAutoCompress cvar. set to 1 to directly record to *.mvd.gz
cl: properly support directly playing .mvd.gz files
menus: reworked to separate mouse and keyboard focus. mouse focus becomes keyboard focus only on mouse clicks. tooltips follow mouse cursors.
menus: cleaned up menu heirachy a little. now simpler.
server browser: changed 'hide *' filters to 'show *' instead. I felt it was more logical.
deluxmapping: changed to disabled, load, generate, like r_loadlit is.
render targets api now supports negative formats to mean nearest filtering, where filtering is part of texture state.
drawrotpic fixed, now batches and interacts with drawpic correctly.
drawline fixed, no interacts with draw* correctly, but still does not batch.
fixed saving games.
provide proper userinfo to nq clients, where supported.
qcc: catch string table overflows safely, giving errors instead of crashes. switch to 32bit statements if some over-sized function requires it.
qtv: some bigcoords support tweaks
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5073 fc73d0e0-1445-4013-8a0c-d673dee63da5
2017-03-21 05:27:07 +00:00
//keep chopping off the last part of the filename until we get an actual package
//once we do, recurse into that package
2014-03-30 08:55:06 +00:00
end = name + strlen ( name ) ;
while ( end > name )
{
e = * end ;
* end = 0 ;
if ( ! e )
{
//always open the last file properly.
loc . search = NULL ;
if ( search )
found = search - > FindFile ( search , & loc , name , NULL ) ;
else
2015-10-11 11:34:58 +00:00
found = FS_FLocateFile ( name , FSLF_IFFOUND , & loc ) ;
2014-03-30 08:55:06 +00:00
if ( found )
{
f = ( search ? search : loc . search - > handle ) - > OpenVFS ( search ? search : loc . search - > handle , & loc , " rb " ) ;
if ( f )
return f ;
}
}
else
{
2014-10-05 20:04:11 +00:00
COM_FileExtension ( name , ext , sizeof ( ext ) ) ;
2014-03-30 08:55:06 +00:00
for ( i = 0 ; i < sizeof ( searchpathformats ) / sizeof ( searchpathformats [ 0 ] ) ; i + + )
{
if ( ! searchpathformats [ i ] . extension | | ! searchpathformats [ i ] . OpenNew )
continue ;
Added sys_openfile console command(and menu option) to web and flatpak(via cmake+dbus) builds, to 'install' packages on sandboxed systems a bit more easily.
Cmake: Add FTE_WERROR option, defaults to true in debug builds and off in release builds (in case future compilers have issues).
Cmake: Pull in libXscreensaver so we don't get interrupted by screensavers when playing demos.
Make: Added `make webcl-rel` for a web build without server bloat (eg for sites focused on demo playback. Yes, this means you XantoM).
fteqcc: Include the decompiler in fteqcc (non-gui) builds ('-d' arg).
fteqcc: Decompiler can now mostly handle hexen2 mods without any unknown opcodes.
Allow ezHud and OpenSSL to be compiled as in-engine plugins, potentially for web and windows ports respectively.
Web: Fix support for ogg vorbis. Add support for voip.
Web: Added basic support for WebXR.
QTV: Don't try seeking on unseekable qtv streams. Don't spam when developer 1 is set.
QTV: add support for some eztv extensions.
MVD: added hack to use ktx's vweps in mvd where mvdsv doesn't bother to record the info.
qwfwd: hack around a hack in qwfwd, allowing it to work again.
recording: favour qwd in single player, instead of mvd.
Protocol: reduce client memory used for precache names. Bump maximum precache counts - some people are just abusive, yes you Orl.
hexen2: add enough clientside protocol compat to play the demo included with h2mp. lacks effects.
in_xflip: restored this setting.
fs_hidesyspaths: new cvar, defaults to enabled so you won't find your username or whatever turning up in screenshots or the like. change it to 0 before debuging stuff eg via 'path'.
gl_overbright_models: Added cvar to match QS.
netchan: Added MTU determination, we'll no longer fail to connect when routers stupidly drop icmp packets.
Win: try a few other versions of xinput too.
CSQC: Added a CSQC_GenerateMaterial function, to give the csqc a chance to generate custom materials.
MenuQC: Added support for the skeletal objects API.
2024-04-09 17:13:59 +00:00
if ( ! Q_strcasecmp ( ext , searchpathformats [ i ] . extension ) )
2014-03-30 08:55:06 +00:00
{
loc . search = NULL ;
if ( search )
found = search - > FindFile ( search , & loc , name , NULL ) ;
else
2015-10-11 11:34:58 +00:00
found = FS_FLocateFile ( name , FSLF_IFFOUND , & loc ) ;
2014-03-30 08:55:06 +00:00
if ( found )
{
f = ( search ? search : loc . search - > handle ) - > OpenVFS ( search ? search : loc . search - > handle , & loc , " rb " ) ;
if ( f )
{
2018-03-04 14:41:16 +00:00
searchpathfuncs_t * newsearch = searchpathformats [ i ] . OpenNew ( f , search ? search : loc . search - > handle , name , name , " " ) ;
2014-03-30 08:55:06 +00:00
if ( newsearch )
{
f = CL_OpenFileInPackage ( newsearch , end + 1 ) ;
newsearch - > ClosePath ( newsearch ) ;
if ( f )
{
* end = e ;
return f ;
}
}
else
VFS_CLOSE ( f ) ;
}
break ;
}
}
}
}
n = COM_SkipPath ( name ) ;
* end = e ;
end = n - 1 ;
}
return NULL ;
}
2017-07-12 08:15:27 +00:00
//some annoying struct+func to prefix the enumerated file name properly.
struct CL_ListFilesInPackageCB_s
{
char * nameprefix ;
size_t nameprefixlen ;
int ( QDECL * func ) ( const char * fname , qofs_t fsize , time_t mtime , void * parm , searchpathfuncs_t * spath ) ;
void * parm ;
searchpathfuncs_t * spath ;
} ;
static int QDECL CL_ListFilesInPackageCB ( const char * fname , qofs_t fsize , time_t mtime , void * parm , searchpathfuncs_t * spath )
{
struct CL_ListFilesInPackageCB_s * cb = parm ;
char name [ MAX_OSPATH ] ;
if ( cb - > nameprefixlen )
{
memcpy ( name , cb - > nameprefix , cb - > nameprefixlen - 1 ) ;
name [ cb - > nameprefixlen - 1 ] = ' / ' ;
Q_strncpyz ( name + cb - > nameprefixlen , fname , sizeof ( name ) - ( cb - > nameprefixlen ) ) ;
return cb - > func ( name , fsize , mtime , cb - > parm , cb - > spath ) ;
}
else
return cb - > func ( fname , fsize , mtime , cb - > parm , cb - > spath ) ;
}
//'small' wrapper to list foo.zip/* to list files within zips that are not part of the gamedir.
//same rules as CL_OpenFileInPackage, except that wildcards should only be in the final part
qboolean CL_ListFilesInPackage ( searchpathfuncs_t * search , char * name , int ( QDECL * func ) ( const char * fname , qofs_t fsize , time_t mtime , void * parm , searchpathfuncs_t * spath ) , void * parm , void * recursioninfo )
{
int found ;
vfsfile_t * f ;
flocation_t loc ;
char e , * n ;
char ext [ 8 ] ;
char * end ;
int i ;
qboolean ret = false ;
struct CL_ListFilesInPackageCB_s cb ;
cb . nameprefix = recursioninfo ? recursioninfo : name ;
cb . nameprefixlen = name - cb . nameprefix ;
cb . func = func ;
cb . parm = parm ;
//keep chopping off the last part of the filename until we get an actual package
//once we do, recurse into that package
end = name + strlen ( name ) ;
while ( end > name )
{
e = * end ;
* end = 0 ;
COM_FileExtension ( name , ext , sizeof ( ext ) ) ;
for ( i = 0 ; i < countof ( searchpathformats ) ; i + + )
{
if ( ! searchpathformats [ i ] . extension | | ! searchpathformats [ i ] . OpenNew )
continue ;
Added sys_openfile console command(and menu option) to web and flatpak(via cmake+dbus) builds, to 'install' packages on sandboxed systems a bit more easily.
Cmake: Add FTE_WERROR option, defaults to true in debug builds and off in release builds (in case future compilers have issues).
Cmake: Pull in libXscreensaver so we don't get interrupted by screensavers when playing demos.
Make: Added `make webcl-rel` for a web build without server bloat (eg for sites focused on demo playback. Yes, this means you XantoM).
fteqcc: Include the decompiler in fteqcc (non-gui) builds ('-d' arg).
fteqcc: Decompiler can now mostly handle hexen2 mods without any unknown opcodes.
Allow ezHud and OpenSSL to be compiled as in-engine plugins, potentially for web and windows ports respectively.
Web: Fix support for ogg vorbis. Add support for voip.
Web: Added basic support for WebXR.
QTV: Don't try seeking on unseekable qtv streams. Don't spam when developer 1 is set.
QTV: add support for some eztv extensions.
MVD: added hack to use ktx's vweps in mvd where mvdsv doesn't bother to record the info.
qwfwd: hack around a hack in qwfwd, allowing it to work again.
recording: favour qwd in single player, instead of mvd.
Protocol: reduce client memory used for precache names. Bump maximum precache counts - some people are just abusive, yes you Orl.
hexen2: add enough clientside protocol compat to play the demo included with h2mp. lacks effects.
in_xflip: restored this setting.
fs_hidesyspaths: new cvar, defaults to enabled so you won't find your username or whatever turning up in screenshots or the like. change it to 0 before debuging stuff eg via 'path'.
gl_overbright_models: Added cvar to match QS.
netchan: Added MTU determination, we'll no longer fail to connect when routers stupidly drop icmp packets.
Win: try a few other versions of xinput too.
CSQC: Added a CSQC_GenerateMaterial function, to give the csqc a chance to generate custom materials.
MenuQC: Added support for the skeletal objects API.
2024-04-09 17:13:59 +00:00
if ( ! Q_strcasecmp ( ext , searchpathformats [ i ] . extension ) )
2017-07-12 08:15:27 +00:00
{
loc . search = NULL ;
if ( search )
found = search - > FindFile ( search , & loc , name , NULL ) ;
else
found = FS_FLocateFile ( name , FSLF_IFFOUND , & loc ) ;
if ( found )
{
f = ( search ? search : loc . search - > handle ) - > OpenVFS ( search ? search : loc . search - > handle , & loc , " rb " ) ;
if ( f )
{
2018-03-04 14:41:16 +00:00
searchpathfuncs_t * newsearch = searchpathformats [ i ] . OpenNew ( f , search ? search : loc . search - > handle , name , name , " " ) ;
2017-07-12 08:15:27 +00:00
if ( newsearch )
{
ret = CL_ListFilesInPackage ( newsearch , end + 1 , func , parm , cb . nameprefix ) ;
newsearch - > ClosePath ( newsearch ) ;
if ( ret )
{
* end = e ;
return ret ;
}
}
else
VFS_CLOSE ( f ) ;
}
}
break ;
}
}
n = COM_SkipPath ( name ) ;
* end = e ;
end = n - 1 ;
}
//always open the last file properly.
loc . search = NULL ;
if ( search )
ret = search - > EnumerateFiles ( search , name , CL_ListFilesInPackageCB , & cb ) ;
else
{
ret = true ;
if ( ret )
COM_EnumerateFiles ( name , CL_ListFilesInPackageCB , & cb ) ;
}
return ret ;
}
2022-03-08 05:31:34 +00:00
void FS_PureMode ( const char * gamedir , int puremode , char * purenamelist , char * purecrclist , char * refnamelist , char * refcrclist , int pureseed )
2013-06-23 02:17:02 +00:00
{
2022-03-08 05:31:34 +00:00
ftemanifest_t * man ;
2013-06-23 02:17:02 +00:00
qboolean pureflush ;
2018-12-28 00:04:36 +00:00
# ifdef HAVE_SERVER
2015-08-10 18:28:23 +00:00
//if we're the server, we can't be impure.
if ( sv . state )
return ;
2015-08-11 09:14:33 +00:00
# endif
2015-08-10 18:28:23 +00:00
2014-03-31 17:06:41 +00:00
if ( puremode = = fs_puremode & & fs_pureseed = = pureseed )
{
2014-06-12 23:08:42 +00:00
if ( ( ! purenamelist & & ! fs_purenames ) | | ! strcmp ( fs_purenames ? fs_purenames : " " , purenamelist ? purenamelist : " " ) )
if ( ( ! purecrclist & & ! fs_purecrcs ) | | ! strcmp ( fs_purecrcs ? fs_purecrcs : " " , purecrclist ? purecrclist : " " ) )
if ( ( ! refnamelist & & ! fs_refnames ) | | ! strcmp ( fs_refnames ? fs_refnames : " " , refnamelist ? refnamelist : " " ) )
if ( ( ! refcrclist & & ! fs_refcrcs ) | | ! strcmp ( fs_refcrcs ? fs_refcrcs : " " , refcrclist ? refcrclist : " " ) )
return ;
2014-03-31 17:06:41 +00:00
}
2013-06-23 02:17:02 +00:00
Z_Free ( fs_purenames ) ;
Z_Free ( fs_purecrcs ) ;
2014-06-12 23:08:42 +00:00
Z_Free ( fs_refnames ) ;
Z_Free ( fs_refcrcs ) ;
2013-06-23 02:17:02 +00:00
pureflush = ( fs_puremode ! = 2 & & puremode = = 2 ) ;
fs_puremode = puremode ;
2014-06-12 23:08:42 +00:00
fs_purenames = purenamelist ? Z_StrDup ( purenamelist ) : NULL ;
fs_purecrcs = purecrclist ? Z_StrDup ( purecrclist ) : NULL ;
2013-06-23 02:17:02 +00:00
fs_pureseed = pureseed ;
2014-06-12 23:08:42 +00:00
fs_refnames = refnamelist ? Z_StrDup ( refnamelist ) : NULL ;
fs_refcrcs = refcrclist ? Z_StrDup ( refcrclist ) : NULL ;
2013-06-23 02:17:02 +00:00
2022-03-08 05:31:34 +00:00
if ( gamedir )
man = FS_Manifest_ChangeGameDir ( gamedir ) ;
else
man = fs_manifest ;
FS_ChangeGame ( man , false , false ) ;
2013-06-23 02:17:02 +00:00
if ( pureflush )
{
2018-12-28 00:04:36 +00:00
# ifdef HAVE_CLIENT
2013-06-23 02:17:02 +00:00
Shader_NeedReload ( true ) ;
# endif
Mod_ClearAll ( ) ;
Cache_Flush ( ) ;
}
}
2013-03-12 23:01:08 +00:00
2018-09-01 04:18:08 +00:00
int FS_PureOkay ( void )
2018-04-15 02:48:23 +00:00
{
2018-09-23 19:35:24 +00:00
qboolean ret = true ;
2018-04-15 02:48:23 +00:00
//returns true if all pure packages that we're meant to need could load.
//if they couldn't then they won't override things, or the game will just be completely screwed due to having absolutely no game data
if ( fs_puremode = = 1 & & fs_purenames & & * fs_purenames & & fs_purecrcs & & * fs_purecrcs )
{
char crctok [ 64 ] ;
char nametok [ MAX_QPATH ] ;
char nametok2 [ MAX_QPATH ] ;
searchpath_t * sp = com_purepaths ;
char * names = fs_purenames , * pname ;
char * crcs = fs_purecrcs ;
int crc ;
qboolean required ;
while ( names & & crcs )
{
crcs = COM_ParseOut ( crcs , crctok , sizeof ( crctok ) ) ;
names = COM_ParseOut ( names , nametok , sizeof ( nametok ) ) ;
crc = strtoul ( crctok , NULL , 0 ) ;
if ( ! crc )
continue ;
pname = nametok ;
if ( fs_refnames & & fs_refcrcs )
{ //q3 is annoying as hell
int crc2 ;
char * rc = fs_refcrcs ;
char * rn = fs_refnames ;
pname = " " ;
for ( ; rc & & rn ; )
{
rc = COM_ParseOut ( rc , crctok , sizeof ( crctok ) ) ;
rn = COM_ParseOut ( rn , nametok2 , sizeof ( nametok2 ) ) ;
crc2 = strtoul ( crctok , NULL , 0 ) ;
if ( crc2 = = crc )
{
COM_DefaultExtension ( nametok2 , " .pk3 " , sizeof ( nametok2 ) ) ;
pname = nametok2 ;
break ;
}
}
}
required = * pname = = ' * ' ;
if ( * pname = = ' * ' ) // * means that its 'referenced' (read: actually useful) thus should be downloaded, which is not relevent here.
{
required = true ;
pname + + ;
}
else
required = false ;
if ( sp & & sp - > crc_check = = crc )
{
sp = sp - > nextpure ;
continue ;
}
else if ( ! required ) //if its not referenced, then its not needed, and we probably didn't bother to download it. this might be an issue with sv_pure 1, but that has its own issues.
continue ;
else //if (!sp)
{
2018-10-13 12:19:58 +00:00
// if (!CL_CheckDLFile(va("package/%s", pname)))
// if (CL_CheckOrEnqueDownloadFile(pname, va("%s.%i", pname, crc), DLLF_NONGAME))
// return -1;
2018-09-23 19:35:24 +00:00
Con_Printf ( CON_ERROR " Pure package %s:%08x missing. \n " , pname , crc ) ;
ret = false ;
2018-04-15 02:48:23 +00:00
}
}
}
2018-09-23 19:35:24 +00:00
return ret ;
2018-04-15 02:48:23 +00:00
}
2018-09-01 04:18:08 +00:00
# endif
2018-04-15 02:48:23 +00:00
2018-12-28 00:04:36 +00:00
# ifdef Q3CLIENT
2009-04-01 22:03:56 +00:00
char * FSQ3_GenerateClientPacksList ( char * buffer , int maxlen , int basechecksum )
{ //this is for q3 compatibility.
2005-08-26 22:52:26 +00:00
flocation_t loc ;
int numpaks = 0 ;
searchpath_t * sp ;
2015-10-11 11:34:58 +00:00
if ( FS_FLocateFile ( " vm/cgame.qvm " , FSLF_IFFOUND , & loc ) )
{
Q_strncatz ( buffer , va ( " %i " , loc . search - > crc_reply ) , maxlen ) ;
basechecksum ^ = loc . search - > crc_reply ;
}
else Q_strncatz ( buffer , va ( " %i " , 0 ) , maxlen ) ;
2005-08-26 22:52:26 +00:00
2015-10-11 11:34:58 +00:00
if ( FS_FLocateFile ( " vm/ui.qvm " , FSLF_IFFOUND , & loc ) )
{
Q_strncatz ( buffer , va ( " %i " , loc . search - > crc_reply ) , maxlen ) ;
basechecksum ^ = loc . search - > crc_reply ;
}
else Q_strncatz ( buffer , va ( " %i " , 0 ) , maxlen ) ;
2005-08-26 22:52:26 +00:00
Q_strncatz ( buffer , " @ " , maxlen ) ;
for ( sp = com_purepaths ; sp ; sp = sp - > nextpure )
{
if ( sp - > crc_reply )
{
Q_strncatz ( buffer , va ( " %i " , sp - > crc_reply ) , maxlen ) ;
basechecksum ^ = sp - > crc_reply ;
numpaks + + ;
}
}
basechecksum ^ = numpaks ;
Q_strncatz ( buffer , va ( " %i " , basechecksum ) , maxlen ) ;
return buffer ;
}
2018-12-28 00:04:36 +00:00
# endif
2005-08-26 22:52:26 +00:00
2005-10-16 12:49:15 +00:00
/*
= = = = = = = = = = = = = = = =
FS_ReloadPackFiles
= = = = = = = = = = = = = = = =
Called when the client has downloaded a new pak / pk3 file
*/
2018-10-11 10:31:23 +00:00
static void FS_ReloadPackFilesFlags ( unsigned int reloadflags )
2005-10-16 12:49:15 +00:00
{
searchpath_t * oldpaths ;
searchpath_t * next ;
2019-10-06 01:59:13 +00:00
int i , j ;
2014-10-05 20:04:11 +00:00
int orderkey ;
Too many changes, sorry.
Change revision displays, use the SVN commit date instead of using __DATE__ (when there's no local changes). This should allow reproducible builds.
Added s_al_disable cvar, to block openal and all the various problems people have had with it, without having to name an explicit fallback (which would vary by system).
Add mastervolume cvar (for ss).
Add r_shadows 2 (aka fake shadows - for ss).
Add scr_loadingscreen_aspect -1 setting, to disable levelshots entirely, also disables the progress bar (for ss).
Better support for some effectinfo hacks (for ss).
Added dpcompat_nocsqcwarnings (because of lazy+buggy mods like ss).
Rework the dpcsqc versions of project+unproject builtins for better compat (for ss).
Added dpcompat_csqcinputeventtypes to block unexpected csqc input events (for ss).
Better compat with DP's loadfont console command (for ss).
Added dpcompat_smallerfonts cvar to replicate a DP bug (for ss).
Detect dp's m_draw extension, to work around it (for ss).
Cvar dpcompat_ignoremodificationtimes added. A value of 0 favour the most recently modified file, 1 will use DP-like alphabetically sorted preferences (for ss).
loadfont builtin can now accept outline=1 in the sizes arg for slightly more readable fonts.
Fix bbox calcs for rotated entities, fix needed for r_ignorenetpvs 0.
Hackily parse emoji.json to provide :poop: etc suggestions.
Skip prediction entirely when there's no local entity info. This fixes stair-smoothing in xonotic.
screenshot_cubemap will now capture half-float images when saving to ktx or dds files.
Fix support for xcf files larger than 4gb, mostly to avoid compiler warnings.
Fixed size of gfx/loading.lmp when replacement textures are used.
Added mipmap support for rg8 and l8a8 textures.
r_hdr_framebuffer cvar updated to support format names instead of random negative numbers. Description updated to name some interesting ones.
Perform autoupdate _checks_ ONLY with explicit user confirmation (actual updating already needed user confirmation, but this extra step should reduce the chances of us getting wrongly accused of exfiltrating user data if we're run in a sandbox - we ONLY ever included the updating engine's version in the checks, though there's nothing we can do to avoid sending the user's router's IP).
Removed the 'summon satan all over your harddrive' quit message, in case paranoid security researchers are idiots and don't bother doing actual research.
Removed the triptohell.info and fte.triptohell.info certificates, they really need to stop being self-signed. The updates domain is still self-signed for autoupdates.
Video drivers are now able to report supported video resolutions, visible to menuqc. Currently only works with SDL2 builds.
Added setmousepos builtin. Should work with glx+win32 build.
VF_SKYROOM_CAMERA can now accept an extra two args, setviewprop(VF_SKYROOM_CAMERA, org, axis, degrees).
Removed v_skyroom_origin+v_skyroom_orientation cvars in favour just v_skyroom, which should make it behave more like the 'fog' command (used when csqc isn't overriding).
Added R_EndPolygonRibbon builtin to make it faster+easier to generate textured ribbon/cable/etc wide lines (for TW).
sdl: Fix up sys_sdl.c's file enumeration to support wildcards in directories.
edit command now displays end1.bin/end2.bin correctly, because we can.
Finally add support for f_modified - though ruleset_allow_larger_models and ruleset_allow_overlong_sounds generally make it redundant.
Fix threading race condition in sha1 lookups.
Updated f_ruleset to include the same extra flags reported by ezquake.
A mod's default.fmf file can now contain an eg 'mainconfig config.cfg' line (to explicitly set the main config saved with cfg_save_auto 1 etc).
fmf: basegame steam:GameName/GameDir can be used to try to load a mod directory from an installed steam game. The resulting gamedir will be read-only.
HOMEDIR CHANGE: use homedirs only if the basedir cannot be written or a homedir already exists, which should further reduce the probability of microsoft randomly uploading our data to their cloud (but mostly because its annoying to never know where your data is written).
Fixed buf_cvarlist, should work in xonotic now, and without segfaults.
Added an extra arg to URI_Get_Callback calls - the response size, also changed the tempstring to contain all bytes of the response, you need to be careful about nulls though.
Try to work around nvidia's forced-panning bug on x11 when changing video modes. This might screw with other programs.
sdl: support custom icons.
sdl: support choosing a specific display.
Added some documentation to menuqc builtins.
menusys: use outlines for slightly more readable fonts.
menusys: switch vid_width and vid_height combos into a single video mode combo to set both according to reported video modes.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5581 fc73d0e0-1445-4013-8a0c-d673dee63da5
2019-11-20 03:09:50 +00:00
unsigned int fl ;
2005-10-16 12:49:15 +00:00
2014-10-05 20:04:11 +00:00
COM_AssertMainThread ( " FS_ReloadPackFilesFlags " ) ;
COM_WorkerFullSync ( ) ;
orderkey = 0 ;
if ( com_purepaths )
for ( next = com_purepaths ; next ; next = next - > nextpure )
next - > orderkey = + + orderkey ;
if ( fs_puremode < 2 )
for ( next = com_purepaths ; next ; next = next - > nextpure )
next - > orderkey = + + orderkey ;
2005-10-16 12:49:15 +00:00
oldpaths = com_searchpaths ;
com_searchpaths = NULL ;
com_purepaths = NULL ;
com_base_searchpaths = NULL ;
2019-05-23 15:11:32 +00:00
gameonly_gamedir = gameonly_homedir = NULL ;
2005-10-16 12:49:15 +00:00
2021-08-23 06:37:21 +00:00
# if defined(HAVE_LEGACY) && defined(PACKAGE_PK3)
{
searchpathfuncs_t * pak ;
vfsfile_t * vfs ;
char pakname [ MAX_OSPATH ] ;
2023-09-11 09:31:09 +00:00
int i ;
static char * names [ ] = { " QuakeEX.kpf " , " Q2Game.kpf " } ; //need a better way to handle this rubbish. fucking mod-specific translations being stored in the engine-specific data.
for ( i = 0 ; i < countof ( names ) ; i + + )
{
Q_snprintfz ( pakname , sizeof ( pakname ) , " %s%s " , com_gamepath , names [ i ] ) ;
vfs = VFSOS_Open ( pakname , " rb " ) ;
pak = FSZIP_LoadArchive ( vfs , NULL , pakname , pakname , " " ) ;
if ( pak ) //logically should have SPF_EXPLICIT set, but that would give it a worse gamedir depth
{
FS_AddPathHandle ( & oldpaths , " " , pakname , pak , " " , SPF_COPYPROTECTED , reloadflags ) ;
break ;
}
}
2021-08-23 06:37:21 +00:00
}
# endif
2014-03-30 08:55:06 +00:00
i = COM_CheckParm ( " -basepack " ) ;
while ( i & & i < com_argc - 1 )
{
const char * pakname = com_argv [ i + 1 ] ;
searchpathfuncs_t * pak ;
vfsfile_t * vfs = VFSOS_Open ( pakname , " rb " ) ;
2023-04-21 11:36:13 +00:00
pak = FS_OpenPackByExtension ( vfs , NULL , pakname , pakname , " " ) ;
2017-03-26 01:46:08 +00:00
if ( pak ) //logically should have SPF_EXPLICIT set, but that would give it a worse gamedir depth
FS_AddPathHandle ( & oldpaths , " " , pakname , pak , " " , SPF_COPYPROTECTED , reloadflags ) ;
2014-03-30 08:55:06 +00:00
i = COM_CheckNextParm ( " -basepack " , i ) ;
}
2018-07-22 11:49:37 +00:00
# ifdef NQPROT
standard_quake = true ;
# endif
2019-10-06 01:59:13 +00:00
for ( i = 0 ; i < countof ( fs_manifest - > gamepath ) ; i + + )
2005-10-16 12:49:15 +00:00
{
2013-11-29 14:36:47 +00:00
char * dir = fs_manifest - > gamepath [ i ] . path ;
Too many changes, sorry.
Change revision displays, use the SVN commit date instead of using __DATE__ (when there's no local changes). This should allow reproducible builds.
Added s_al_disable cvar, to block openal and all the various problems people have had with it, without having to name an explicit fallback (which would vary by system).
Add mastervolume cvar (for ss).
Add r_shadows 2 (aka fake shadows - for ss).
Add scr_loadingscreen_aspect -1 setting, to disable levelshots entirely, also disables the progress bar (for ss).
Better support for some effectinfo hacks (for ss).
Added dpcompat_nocsqcwarnings (because of lazy+buggy mods like ss).
Rework the dpcsqc versions of project+unproject builtins for better compat (for ss).
Added dpcompat_csqcinputeventtypes to block unexpected csqc input events (for ss).
Better compat with DP's loadfont console command (for ss).
Added dpcompat_smallerfonts cvar to replicate a DP bug (for ss).
Detect dp's m_draw extension, to work around it (for ss).
Cvar dpcompat_ignoremodificationtimes added. A value of 0 favour the most recently modified file, 1 will use DP-like alphabetically sorted preferences (for ss).
loadfont builtin can now accept outline=1 in the sizes arg for slightly more readable fonts.
Fix bbox calcs for rotated entities, fix needed for r_ignorenetpvs 0.
Hackily parse emoji.json to provide :poop: etc suggestions.
Skip prediction entirely when there's no local entity info. This fixes stair-smoothing in xonotic.
screenshot_cubemap will now capture half-float images when saving to ktx or dds files.
Fix support for xcf files larger than 4gb, mostly to avoid compiler warnings.
Fixed size of gfx/loading.lmp when replacement textures are used.
Added mipmap support for rg8 and l8a8 textures.
r_hdr_framebuffer cvar updated to support format names instead of random negative numbers. Description updated to name some interesting ones.
Perform autoupdate _checks_ ONLY with explicit user confirmation (actual updating already needed user confirmation, but this extra step should reduce the chances of us getting wrongly accused of exfiltrating user data if we're run in a sandbox - we ONLY ever included the updating engine's version in the checks, though there's nothing we can do to avoid sending the user's router's IP).
Removed the 'summon satan all over your harddrive' quit message, in case paranoid security researchers are idiots and don't bother doing actual research.
Removed the triptohell.info and fte.triptohell.info certificates, they really need to stop being self-signed. The updates domain is still self-signed for autoupdates.
Video drivers are now able to report supported video resolutions, visible to menuqc. Currently only works with SDL2 builds.
Added setmousepos builtin. Should work with glx+win32 build.
VF_SKYROOM_CAMERA can now accept an extra two args, setviewprop(VF_SKYROOM_CAMERA, org, axis, degrees).
Removed v_skyroom_origin+v_skyroom_orientation cvars in favour just v_skyroom, which should make it behave more like the 'fog' command (used when csqc isn't overriding).
Added R_EndPolygonRibbon builtin to make it faster+easier to generate textured ribbon/cable/etc wide lines (for TW).
sdl: Fix up sys_sdl.c's file enumeration to support wildcards in directories.
edit command now displays end1.bin/end2.bin correctly, because we can.
Finally add support for f_modified - though ruleset_allow_larger_models and ruleset_allow_overlong_sounds generally make it redundant.
Fix threading race condition in sha1 lookups.
Updated f_ruleset to include the same extra flags reported by ezquake.
A mod's default.fmf file can now contain an eg 'mainconfig config.cfg' line (to explicitly set the main config saved with cfg_save_auto 1 etc).
fmf: basegame steam:GameName/GameDir can be used to try to load a mod directory from an installed steam game. The resulting gamedir will be read-only.
HOMEDIR CHANGE: use homedirs only if the basedir cannot be written or a homedir already exists, which should further reduce the probability of microsoft randomly uploading our data to their cloud (but mostly because its annoying to never know where your data is written).
Fixed buf_cvarlist, should work in xonotic now, and without segfaults.
Added an extra arg to URI_Get_Callback calls - the response size, also changed the tempstring to contain all bytes of the response, you need to be careful about nulls though.
Try to work around nvidia's forced-panning bug on x11 when changing video modes. This might screw with other programs.
sdl: support custom icons.
sdl: support choosing a specific display.
Added some documentation to menuqc builtins.
menusys: use outlines for slightly more readable fonts.
menusys: switch vid_width and vid_height combos into a single video mode combo to set both according to reported video modes.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5581 fc73d0e0-1445-4013-8a0c-d673dee63da5
2019-11-20 03:09:50 +00:00
if ( dir & & ( fs_manifest - > gamepath [ i ] . flags & GAMEDIR_BASEGAME ) )
2013-06-23 02:17:02 +00:00
{
Too many changes, sorry.
Change revision displays, use the SVN commit date instead of using __DATE__ (when there's no local changes). This should allow reproducible builds.
Added s_al_disable cvar, to block openal and all the various problems people have had with it, without having to name an explicit fallback (which would vary by system).
Add mastervolume cvar (for ss).
Add r_shadows 2 (aka fake shadows - for ss).
Add scr_loadingscreen_aspect -1 setting, to disable levelshots entirely, also disables the progress bar (for ss).
Better support for some effectinfo hacks (for ss).
Added dpcompat_nocsqcwarnings (because of lazy+buggy mods like ss).
Rework the dpcsqc versions of project+unproject builtins for better compat (for ss).
Added dpcompat_csqcinputeventtypes to block unexpected csqc input events (for ss).
Better compat with DP's loadfont console command (for ss).
Added dpcompat_smallerfonts cvar to replicate a DP bug (for ss).
Detect dp's m_draw extension, to work around it (for ss).
Cvar dpcompat_ignoremodificationtimes added. A value of 0 favour the most recently modified file, 1 will use DP-like alphabetically sorted preferences (for ss).
loadfont builtin can now accept outline=1 in the sizes arg for slightly more readable fonts.
Fix bbox calcs for rotated entities, fix needed for r_ignorenetpvs 0.
Hackily parse emoji.json to provide :poop: etc suggestions.
Skip prediction entirely when there's no local entity info. This fixes stair-smoothing in xonotic.
screenshot_cubemap will now capture half-float images when saving to ktx or dds files.
Fix support for xcf files larger than 4gb, mostly to avoid compiler warnings.
Fixed size of gfx/loading.lmp when replacement textures are used.
Added mipmap support for rg8 and l8a8 textures.
r_hdr_framebuffer cvar updated to support format names instead of random negative numbers. Description updated to name some interesting ones.
Perform autoupdate _checks_ ONLY with explicit user confirmation (actual updating already needed user confirmation, but this extra step should reduce the chances of us getting wrongly accused of exfiltrating user data if we're run in a sandbox - we ONLY ever included the updating engine's version in the checks, though there's nothing we can do to avoid sending the user's router's IP).
Removed the 'summon satan all over your harddrive' quit message, in case paranoid security researchers are idiots and don't bother doing actual research.
Removed the triptohell.info and fte.triptohell.info certificates, they really need to stop being self-signed. The updates domain is still self-signed for autoupdates.
Video drivers are now able to report supported video resolutions, visible to menuqc. Currently only works with SDL2 builds.
Added setmousepos builtin. Should work with glx+win32 build.
VF_SKYROOM_CAMERA can now accept an extra two args, setviewprop(VF_SKYROOM_CAMERA, org, axis, degrees).
Removed v_skyroom_origin+v_skyroom_orientation cvars in favour just v_skyroom, which should make it behave more like the 'fog' command (used when csqc isn't overriding).
Added R_EndPolygonRibbon builtin to make it faster+easier to generate textured ribbon/cable/etc wide lines (for TW).
sdl: Fix up sys_sdl.c's file enumeration to support wildcards in directories.
edit command now displays end1.bin/end2.bin correctly, because we can.
Finally add support for f_modified - though ruleset_allow_larger_models and ruleset_allow_overlong_sounds generally make it redundant.
Fix threading race condition in sha1 lookups.
Updated f_ruleset to include the same extra flags reported by ezquake.
A mod's default.fmf file can now contain an eg 'mainconfig config.cfg' line (to explicitly set the main config saved with cfg_save_auto 1 etc).
fmf: basegame steam:GameName/GameDir can be used to try to load a mod directory from an installed steam game. The resulting gamedir will be read-only.
HOMEDIR CHANGE: use homedirs only if the basedir cannot be written or a homedir already exists, which should further reduce the probability of microsoft randomly uploading our data to their cloud (but mostly because its annoying to never know where your data is written).
Fixed buf_cvarlist, should work in xonotic now, and without segfaults.
Added an extra arg to URI_Get_Callback calls - the response size, also changed the tempstring to contain all bytes of the response, you need to be careful about nulls though.
Try to work around nvidia's forced-panning bug on x11 when changing video modes. This might screw with other programs.
sdl: support custom icons.
sdl: support choosing a specific display.
Added some documentation to menuqc builtins.
menusys: use outlines for slightly more readable fonts.
menusys: switch vid_width and vid_height combos into a single video mode combo to set both according to reported video modes.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5581 fc73d0e0-1445-4013-8a0c-d673dee63da5
2019-11-20 03:09:50 +00:00
//paths should be validated before here, when parsing the manifest.
2018-07-22 11:49:37 +00:00
# ifdef NQPROT
//vanilla NQ uses a slightly different protocol when started with -rogue or -hipnotic (and by extension -quoth).
//QW+FTE protocols don't care so we can get away with being a little loose here
if ( ! strcmp ( dir , " rogue " ) | | ! strcmp ( dir , " hipnotic " ) | | ! strcmp ( dir , " quoth " ) )
standard_quake = false ;
# endif
2013-11-29 14:36:47 +00:00
Too many changes, sorry.
Change revision displays, use the SVN commit date instead of using __DATE__ (when there's no local changes). This should allow reproducible builds.
Added s_al_disable cvar, to block openal and all the various problems people have had with it, without having to name an explicit fallback (which would vary by system).
Add mastervolume cvar (for ss).
Add r_shadows 2 (aka fake shadows - for ss).
Add scr_loadingscreen_aspect -1 setting, to disable levelshots entirely, also disables the progress bar (for ss).
Better support for some effectinfo hacks (for ss).
Added dpcompat_nocsqcwarnings (because of lazy+buggy mods like ss).
Rework the dpcsqc versions of project+unproject builtins for better compat (for ss).
Added dpcompat_csqcinputeventtypes to block unexpected csqc input events (for ss).
Better compat with DP's loadfont console command (for ss).
Added dpcompat_smallerfonts cvar to replicate a DP bug (for ss).
Detect dp's m_draw extension, to work around it (for ss).
Cvar dpcompat_ignoremodificationtimes added. A value of 0 favour the most recently modified file, 1 will use DP-like alphabetically sorted preferences (for ss).
loadfont builtin can now accept outline=1 in the sizes arg for slightly more readable fonts.
Fix bbox calcs for rotated entities, fix needed for r_ignorenetpvs 0.
Hackily parse emoji.json to provide :poop: etc suggestions.
Skip prediction entirely when there's no local entity info. This fixes stair-smoothing in xonotic.
screenshot_cubemap will now capture half-float images when saving to ktx or dds files.
Fix support for xcf files larger than 4gb, mostly to avoid compiler warnings.
Fixed size of gfx/loading.lmp when replacement textures are used.
Added mipmap support for rg8 and l8a8 textures.
r_hdr_framebuffer cvar updated to support format names instead of random negative numbers. Description updated to name some interesting ones.
Perform autoupdate _checks_ ONLY with explicit user confirmation (actual updating already needed user confirmation, but this extra step should reduce the chances of us getting wrongly accused of exfiltrating user data if we're run in a sandbox - we ONLY ever included the updating engine's version in the checks, though there's nothing we can do to avoid sending the user's router's IP).
Removed the 'summon satan all over your harddrive' quit message, in case paranoid security researchers are idiots and don't bother doing actual research.
Removed the triptohell.info and fte.triptohell.info certificates, they really need to stop being self-signed. The updates domain is still self-signed for autoupdates.
Video drivers are now able to report supported video resolutions, visible to menuqc. Currently only works with SDL2 builds.
Added setmousepos builtin. Should work with glx+win32 build.
VF_SKYROOM_CAMERA can now accept an extra two args, setviewprop(VF_SKYROOM_CAMERA, org, axis, degrees).
Removed v_skyroom_origin+v_skyroom_orientation cvars in favour just v_skyroom, which should make it behave more like the 'fog' command (used when csqc isn't overriding).
Added R_EndPolygonRibbon builtin to make it faster+easier to generate textured ribbon/cable/etc wide lines (for TW).
sdl: Fix up sys_sdl.c's file enumeration to support wildcards in directories.
edit command now displays end1.bin/end2.bin correctly, because we can.
Finally add support for f_modified - though ruleset_allow_larger_models and ruleset_allow_overlong_sounds generally make it redundant.
Fix threading race condition in sha1 lookups.
Updated f_ruleset to include the same extra flags reported by ezquake.
A mod's default.fmf file can now contain an eg 'mainconfig config.cfg' line (to explicitly set the main config saved with cfg_save_auto 1 etc).
fmf: basegame steam:GameName/GameDir can be used to try to load a mod directory from an installed steam game. The resulting gamedir will be read-only.
HOMEDIR CHANGE: use homedirs only if the basedir cannot be written or a homedir already exists, which should further reduce the probability of microsoft randomly uploading our data to their cloud (but mostly because its annoying to never know where your data is written).
Fixed buf_cvarlist, should work in xonotic now, and without segfaults.
Added an extra arg to URI_Get_Callback calls - the response size, also changed the tempstring to contain all bytes of the response, you need to be careful about nulls though.
Try to work around nvidia's forced-panning bug on x11 when changing video modes. This might screw with other programs.
sdl: support custom icons.
sdl: support choosing a specific display.
Added some documentation to menuqc builtins.
menusys: use outlines for slightly more readable fonts.
menusys: switch vid_width and vid_height combos into a single video mode combo to set both according to reported video modes.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5581 fc73d0e0-1445-4013-8a0c-d673dee63da5
2019-11-20 03:09:50 +00:00
fl = SPF_EXPLICIT ;
if ( ! ( fs_manifest - > gamepath [ i ] . flags & GAMEDIR_READONLY ) )
fl | = SPF_WRITABLE ;
if ( fs_manifest - > gamepath [ i ] . flags & GAMEDIR_PRIVATE )
fl | = SPF_PRIVATE ;
2020-04-29 10:43:22 +00:00
if ( fs_manifest - > gamepath [ i ] . flags & GAMEDIR_QSHACK )
fl | = SPF_QSHACK ;
Too many changes, sorry.
Change revision displays, use the SVN commit date instead of using __DATE__ (when there's no local changes). This should allow reproducible builds.
Added s_al_disable cvar, to block openal and all the various problems people have had with it, without having to name an explicit fallback (which would vary by system).
Add mastervolume cvar (for ss).
Add r_shadows 2 (aka fake shadows - for ss).
Add scr_loadingscreen_aspect -1 setting, to disable levelshots entirely, also disables the progress bar (for ss).
Better support for some effectinfo hacks (for ss).
Added dpcompat_nocsqcwarnings (because of lazy+buggy mods like ss).
Rework the dpcsqc versions of project+unproject builtins for better compat (for ss).
Added dpcompat_csqcinputeventtypes to block unexpected csqc input events (for ss).
Better compat with DP's loadfont console command (for ss).
Added dpcompat_smallerfonts cvar to replicate a DP bug (for ss).
Detect dp's m_draw extension, to work around it (for ss).
Cvar dpcompat_ignoremodificationtimes added. A value of 0 favour the most recently modified file, 1 will use DP-like alphabetically sorted preferences (for ss).
loadfont builtin can now accept outline=1 in the sizes arg for slightly more readable fonts.
Fix bbox calcs for rotated entities, fix needed for r_ignorenetpvs 0.
Hackily parse emoji.json to provide :poop: etc suggestions.
Skip prediction entirely when there's no local entity info. This fixes stair-smoothing in xonotic.
screenshot_cubemap will now capture half-float images when saving to ktx or dds files.
Fix support for xcf files larger than 4gb, mostly to avoid compiler warnings.
Fixed size of gfx/loading.lmp when replacement textures are used.
Added mipmap support for rg8 and l8a8 textures.
r_hdr_framebuffer cvar updated to support format names instead of random negative numbers. Description updated to name some interesting ones.
Perform autoupdate _checks_ ONLY with explicit user confirmation (actual updating already needed user confirmation, but this extra step should reduce the chances of us getting wrongly accused of exfiltrating user data if we're run in a sandbox - we ONLY ever included the updating engine's version in the checks, though there's nothing we can do to avoid sending the user's router's IP).
Removed the 'summon satan all over your harddrive' quit message, in case paranoid security researchers are idiots and don't bother doing actual research.
Removed the triptohell.info and fte.triptohell.info certificates, they really need to stop being self-signed. The updates domain is still self-signed for autoupdates.
Video drivers are now able to report supported video resolutions, visible to menuqc. Currently only works with SDL2 builds.
Added setmousepos builtin. Should work with glx+win32 build.
VF_SKYROOM_CAMERA can now accept an extra two args, setviewprop(VF_SKYROOM_CAMERA, org, axis, degrees).
Removed v_skyroom_origin+v_skyroom_orientation cvars in favour just v_skyroom, which should make it behave more like the 'fog' command (used when csqc isn't overriding).
Added R_EndPolygonRibbon builtin to make it faster+easier to generate textured ribbon/cable/etc wide lines (for TW).
sdl: Fix up sys_sdl.c's file enumeration to support wildcards in directories.
edit command now displays end1.bin/end2.bin correctly, because we can.
Finally add support for f_modified - though ruleset_allow_larger_models and ruleset_allow_overlong_sounds generally make it redundant.
Fix threading race condition in sha1 lookups.
Updated f_ruleset to include the same extra flags reported by ezquake.
A mod's default.fmf file can now contain an eg 'mainconfig config.cfg' line (to explicitly set the main config saved with cfg_save_auto 1 etc).
fmf: basegame steam:GameName/GameDir can be used to try to load a mod directory from an installed steam game. The resulting gamedir will be read-only.
HOMEDIR CHANGE: use homedirs only if the basedir cannot be written or a homedir already exists, which should further reduce the probability of microsoft randomly uploading our data to their cloud (but mostly because its annoying to never know where your data is written).
Fixed buf_cvarlist, should work in xonotic now, and without segfaults.
Added an extra arg to URI_Get_Callback calls - the response size, also changed the tempstring to contain all bytes of the response, you need to be careful about nulls though.
Try to work around nvidia's forced-panning bug on x11 when changing video modes. This might screw with other programs.
sdl: support custom icons.
sdl: support choosing a specific display.
Added some documentation to menuqc builtins.
menusys: use outlines for slightly more readable fonts.
menusys: switch vid_width and vid_height combos into a single video mode combo to set both according to reported video modes.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5581 fc73d0e0-1445-4013-8a0c-d673dee63da5
2019-11-20 03:09:50 +00:00
if ( fs_manifest - > gamepath [ i ] . flags & GAMEDIR_USEBASEDIR )
{ //for doom - loading packages without an actual gamedir. note that this does not imply that we can write anything.
2018-03-04 14:41:16 +00:00
searchpathfuncs_t * handle = VFSOS_OpenPath ( NULL , NULL , com_gamepath , com_gamepath , " " ) ;
2013-10-29 17:38:22 +00:00
searchpath_t * search = ( searchpath_t * ) Z_Malloc ( sizeof ( searchpath_t ) ) ;
search - > flags = 0 ;
search - > handle = handle ;
Q_strncpyz ( search - > purepath , " " , sizeof ( search - > purepath ) ) ;
2014-03-30 08:55:06 +00:00
Q_strncpyz ( search - > logicalpath , com_gamepath , sizeof ( search - > logicalpath ) ) ;
2013-10-29 17:38:22 +00:00
Too many changes, sorry.
Change revision displays, use the SVN commit date instead of using __DATE__ (when there's no local changes). This should allow reproducible builds.
Added s_al_disable cvar, to block openal and all the various problems people have had with it, without having to name an explicit fallback (which would vary by system).
Add mastervolume cvar (for ss).
Add r_shadows 2 (aka fake shadows - for ss).
Add scr_loadingscreen_aspect -1 setting, to disable levelshots entirely, also disables the progress bar (for ss).
Better support for some effectinfo hacks (for ss).
Added dpcompat_nocsqcwarnings (because of lazy+buggy mods like ss).
Rework the dpcsqc versions of project+unproject builtins for better compat (for ss).
Added dpcompat_csqcinputeventtypes to block unexpected csqc input events (for ss).
Better compat with DP's loadfont console command (for ss).
Added dpcompat_smallerfonts cvar to replicate a DP bug (for ss).
Detect dp's m_draw extension, to work around it (for ss).
Cvar dpcompat_ignoremodificationtimes added. A value of 0 favour the most recently modified file, 1 will use DP-like alphabetically sorted preferences (for ss).
loadfont builtin can now accept outline=1 in the sizes arg for slightly more readable fonts.
Fix bbox calcs for rotated entities, fix needed for r_ignorenetpvs 0.
Hackily parse emoji.json to provide :poop: etc suggestions.
Skip prediction entirely when there's no local entity info. This fixes stair-smoothing in xonotic.
screenshot_cubemap will now capture half-float images when saving to ktx or dds files.
Fix support for xcf files larger than 4gb, mostly to avoid compiler warnings.
Fixed size of gfx/loading.lmp when replacement textures are used.
Added mipmap support for rg8 and l8a8 textures.
r_hdr_framebuffer cvar updated to support format names instead of random negative numbers. Description updated to name some interesting ones.
Perform autoupdate _checks_ ONLY with explicit user confirmation (actual updating already needed user confirmation, but this extra step should reduce the chances of us getting wrongly accused of exfiltrating user data if we're run in a sandbox - we ONLY ever included the updating engine's version in the checks, though there's nothing we can do to avoid sending the user's router's IP).
Removed the 'summon satan all over your harddrive' quit message, in case paranoid security researchers are idiots and don't bother doing actual research.
Removed the triptohell.info and fte.triptohell.info certificates, they really need to stop being self-signed. The updates domain is still self-signed for autoupdates.
Video drivers are now able to report supported video resolutions, visible to menuqc. Currently only works with SDL2 builds.
Added setmousepos builtin. Should work with glx+win32 build.
VF_SKYROOM_CAMERA can now accept an extra two args, setviewprop(VF_SKYROOM_CAMERA, org, axis, degrees).
Removed v_skyroom_origin+v_skyroom_orientation cvars in favour just v_skyroom, which should make it behave more like the 'fog' command (used when csqc isn't overriding).
Added R_EndPolygonRibbon builtin to make it faster+easier to generate textured ribbon/cable/etc wide lines (for TW).
sdl: Fix up sys_sdl.c's file enumeration to support wildcards in directories.
edit command now displays end1.bin/end2.bin correctly, because we can.
Finally add support for f_modified - though ruleset_allow_larger_models and ruleset_allow_overlong_sounds generally make it redundant.
Fix threading race condition in sha1 lookups.
Updated f_ruleset to include the same extra flags reported by ezquake.
A mod's default.fmf file can now contain an eg 'mainconfig config.cfg' line (to explicitly set the main config saved with cfg_save_auto 1 etc).
fmf: basegame steam:GameName/GameDir can be used to try to load a mod directory from an installed steam game. The resulting gamedir will be read-only.
HOMEDIR CHANGE: use homedirs only if the basedir cannot be written or a homedir already exists, which should further reduce the probability of microsoft randomly uploading our data to their cloud (but mostly because its annoying to never know where your data is written).
Fixed buf_cvarlist, should work in xonotic now, and without segfaults.
Added an extra arg to URI_Get_Callback calls - the response size, also changed the tempstring to contain all bytes of the response, you need to be careful about nulls though.
Try to work around nvidia's forced-panning bug on x11 when changing video modes. This might screw with other programs.
sdl: support custom icons.
sdl: support choosing a specific display.
Added some documentation to menuqc builtins.
menusys: use outlines for slightly more readable fonts.
menusys: switch vid_width and vid_height combos into a single video mode combo to set both according to reported video modes.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5581 fc73d0e0-1445-4013-8a0c-d673dee63da5
2019-11-20 03:09:50 +00:00
FS_AddDataFiles ( & oldpaths , search - > purepath , search - > logicalpath , search , fl , reloadflags ) ;
2016-07-12 00:40:13 +00:00
2013-10-29 17:38:22 +00:00
handle - > ClosePath ( handle ) ;
Z_Free ( search ) ;
}
Too many changes, sorry.
Change revision displays, use the SVN commit date instead of using __DATE__ (when there's no local changes). This should allow reproducible builds.
Added s_al_disable cvar, to block openal and all the various problems people have had with it, without having to name an explicit fallback (which would vary by system).
Add mastervolume cvar (for ss).
Add r_shadows 2 (aka fake shadows - for ss).
Add scr_loadingscreen_aspect -1 setting, to disable levelshots entirely, also disables the progress bar (for ss).
Better support for some effectinfo hacks (for ss).
Added dpcompat_nocsqcwarnings (because of lazy+buggy mods like ss).
Rework the dpcsqc versions of project+unproject builtins for better compat (for ss).
Added dpcompat_csqcinputeventtypes to block unexpected csqc input events (for ss).
Better compat with DP's loadfont console command (for ss).
Added dpcompat_smallerfonts cvar to replicate a DP bug (for ss).
Detect dp's m_draw extension, to work around it (for ss).
Cvar dpcompat_ignoremodificationtimes added. A value of 0 favour the most recently modified file, 1 will use DP-like alphabetically sorted preferences (for ss).
loadfont builtin can now accept outline=1 in the sizes arg for slightly more readable fonts.
Fix bbox calcs for rotated entities, fix needed for r_ignorenetpvs 0.
Hackily parse emoji.json to provide :poop: etc suggestions.
Skip prediction entirely when there's no local entity info. This fixes stair-smoothing in xonotic.
screenshot_cubemap will now capture half-float images when saving to ktx or dds files.
Fix support for xcf files larger than 4gb, mostly to avoid compiler warnings.
Fixed size of gfx/loading.lmp when replacement textures are used.
Added mipmap support for rg8 and l8a8 textures.
r_hdr_framebuffer cvar updated to support format names instead of random negative numbers. Description updated to name some interesting ones.
Perform autoupdate _checks_ ONLY with explicit user confirmation (actual updating already needed user confirmation, but this extra step should reduce the chances of us getting wrongly accused of exfiltrating user data if we're run in a sandbox - we ONLY ever included the updating engine's version in the checks, though there's nothing we can do to avoid sending the user's router's IP).
Removed the 'summon satan all over your harddrive' quit message, in case paranoid security researchers are idiots and don't bother doing actual research.
Removed the triptohell.info and fte.triptohell.info certificates, they really need to stop being self-signed. The updates domain is still self-signed for autoupdates.
Video drivers are now able to report supported video resolutions, visible to menuqc. Currently only works with SDL2 builds.
Added setmousepos builtin. Should work with glx+win32 build.
VF_SKYROOM_CAMERA can now accept an extra two args, setviewprop(VF_SKYROOM_CAMERA, org, axis, degrees).
Removed v_skyroom_origin+v_skyroom_orientation cvars in favour just v_skyroom, which should make it behave more like the 'fog' command (used when csqc isn't overriding).
Added R_EndPolygonRibbon builtin to make it faster+easier to generate textured ribbon/cable/etc wide lines (for TW).
sdl: Fix up sys_sdl.c's file enumeration to support wildcards in directories.
edit command now displays end1.bin/end2.bin correctly, because we can.
Finally add support for f_modified - though ruleset_allow_larger_models and ruleset_allow_overlong_sounds generally make it redundant.
Fix threading race condition in sha1 lookups.
Updated f_ruleset to include the same extra flags reported by ezquake.
A mod's default.fmf file can now contain an eg 'mainconfig config.cfg' line (to explicitly set the main config saved with cfg_save_auto 1 etc).
fmf: basegame steam:GameName/GameDir can be used to try to load a mod directory from an installed steam game. The resulting gamedir will be read-only.
HOMEDIR CHANGE: use homedirs only if the basedir cannot be written or a homedir already exists, which should further reduce the probability of microsoft randomly uploading our data to their cloud (but mostly because its annoying to never know where your data is written).
Fixed buf_cvarlist, should work in xonotic now, and without segfaults.
Added an extra arg to URI_Get_Callback calls - the response size, also changed the tempstring to contain all bytes of the response, you need to be careful about nulls though.
Try to work around nvidia's forced-panning bug on x11 when changing video modes. This might screw with other programs.
sdl: support custom icons.
sdl: support choosing a specific display.
Added some documentation to menuqc builtins.
menusys: use outlines for slightly more readable fonts.
menusys: switch vid_width and vid_height combos into a single video mode combo to set both according to reported video modes.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5581 fc73d0e0-1445-4013-8a0c-d673dee63da5
2019-11-20 03:09:50 +00:00
else if ( fs_manifest - > gamepath [ i ] . flags & GAMEDIR_STEAMGAME )
2014-03-30 08:55:06 +00:00
{
Too many changes, sorry.
Change revision displays, use the SVN commit date instead of using __DATE__ (when there's no local changes). This should allow reproducible builds.
Added s_al_disable cvar, to block openal and all the various problems people have had with it, without having to name an explicit fallback (which would vary by system).
Add mastervolume cvar (for ss).
Add r_shadows 2 (aka fake shadows - for ss).
Add scr_loadingscreen_aspect -1 setting, to disable levelshots entirely, also disables the progress bar (for ss).
Better support for some effectinfo hacks (for ss).
Added dpcompat_nocsqcwarnings (because of lazy+buggy mods like ss).
Rework the dpcsqc versions of project+unproject builtins for better compat (for ss).
Added dpcompat_csqcinputeventtypes to block unexpected csqc input events (for ss).
Better compat with DP's loadfont console command (for ss).
Added dpcompat_smallerfonts cvar to replicate a DP bug (for ss).
Detect dp's m_draw extension, to work around it (for ss).
Cvar dpcompat_ignoremodificationtimes added. A value of 0 favour the most recently modified file, 1 will use DP-like alphabetically sorted preferences (for ss).
loadfont builtin can now accept outline=1 in the sizes arg for slightly more readable fonts.
Fix bbox calcs for rotated entities, fix needed for r_ignorenetpvs 0.
Hackily parse emoji.json to provide :poop: etc suggestions.
Skip prediction entirely when there's no local entity info. This fixes stair-smoothing in xonotic.
screenshot_cubemap will now capture half-float images when saving to ktx or dds files.
Fix support for xcf files larger than 4gb, mostly to avoid compiler warnings.
Fixed size of gfx/loading.lmp when replacement textures are used.
Added mipmap support for rg8 and l8a8 textures.
r_hdr_framebuffer cvar updated to support format names instead of random negative numbers. Description updated to name some interesting ones.
Perform autoupdate _checks_ ONLY with explicit user confirmation (actual updating already needed user confirmation, but this extra step should reduce the chances of us getting wrongly accused of exfiltrating user data if we're run in a sandbox - we ONLY ever included the updating engine's version in the checks, though there's nothing we can do to avoid sending the user's router's IP).
Removed the 'summon satan all over your harddrive' quit message, in case paranoid security researchers are idiots and don't bother doing actual research.
Removed the triptohell.info and fte.triptohell.info certificates, they really need to stop being self-signed. The updates domain is still self-signed for autoupdates.
Video drivers are now able to report supported video resolutions, visible to menuqc. Currently only works with SDL2 builds.
Added setmousepos builtin. Should work with glx+win32 build.
VF_SKYROOM_CAMERA can now accept an extra two args, setviewprop(VF_SKYROOM_CAMERA, org, axis, degrees).
Removed v_skyroom_origin+v_skyroom_orientation cvars in favour just v_skyroom, which should make it behave more like the 'fog' command (used when csqc isn't overriding).
Added R_EndPolygonRibbon builtin to make it faster+easier to generate textured ribbon/cable/etc wide lines (for TW).
sdl: Fix up sys_sdl.c's file enumeration to support wildcards in directories.
edit command now displays end1.bin/end2.bin correctly, because we can.
Finally add support for f_modified - though ruleset_allow_larger_models and ruleset_allow_overlong_sounds generally make it redundant.
Fix threading race condition in sha1 lookups.
Updated f_ruleset to include the same extra flags reported by ezquake.
A mod's default.fmf file can now contain an eg 'mainconfig config.cfg' line (to explicitly set the main config saved with cfg_save_auto 1 etc).
fmf: basegame steam:GameName/GameDir can be used to try to load a mod directory from an installed steam game. The resulting gamedir will be read-only.
HOMEDIR CHANGE: use homedirs only if the basedir cannot be written or a homedir already exists, which should further reduce the probability of microsoft randomly uploading our data to their cloud (but mostly because its annoying to never know where your data is written).
Fixed buf_cvarlist, should work in xonotic now, and without segfaults.
Added an extra arg to URI_Get_Callback calls - the response size, also changed the tempstring to contain all bytes of the response, you need to be careful about nulls though.
Try to work around nvidia's forced-panning bug on x11 when changing video modes. This might screw with other programs.
sdl: support custom icons.
sdl: support choosing a specific display.
Added some documentation to menuqc builtins.
menusys: use outlines for slightly more readable fonts.
menusys: switch vid_width and vid_height combos into a single video mode combo to set both according to reported video modes.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5581 fc73d0e0-1445-4013-8a0c-d673dee63da5
2019-11-20 03:09:50 +00:00
char steamdir [ MAX_OSPATH ] ;
char * sl ;
dir + = 6 ;
sl = strchr ( dir , ' / ' ) ;
if ( * sl )
{
if ( Sys_SteamHasFile ( steamdir , sizeof ( steamdir ) , dir , " " ) )
FS_AddSingleGameDirectory ( & oldpaths , /*pure*/ dir , steamdir , reloadflags , SPF_COPYPROTECTED | ( fl & ~ SPF_WRITABLE ) ) ;
}
2014-03-30 08:55:06 +00:00
}
2013-10-29 17:38:22 +00:00
else
{
2023-03-27 17:19:00 +00:00
if ( ! FS_GamedirIsOkay ( dir ) )
continue ;
Too many changes, sorry.
Change revision displays, use the SVN commit date instead of using __DATE__ (when there's no local changes). This should allow reproducible builds.
Added s_al_disable cvar, to block openal and all the various problems people have had with it, without having to name an explicit fallback (which would vary by system).
Add mastervolume cvar (for ss).
Add r_shadows 2 (aka fake shadows - for ss).
Add scr_loadingscreen_aspect -1 setting, to disable levelshots entirely, also disables the progress bar (for ss).
Better support for some effectinfo hacks (for ss).
Added dpcompat_nocsqcwarnings (because of lazy+buggy mods like ss).
Rework the dpcsqc versions of project+unproject builtins for better compat (for ss).
Added dpcompat_csqcinputeventtypes to block unexpected csqc input events (for ss).
Better compat with DP's loadfont console command (for ss).
Added dpcompat_smallerfonts cvar to replicate a DP bug (for ss).
Detect dp's m_draw extension, to work around it (for ss).
Cvar dpcompat_ignoremodificationtimes added. A value of 0 favour the most recently modified file, 1 will use DP-like alphabetically sorted preferences (for ss).
loadfont builtin can now accept outline=1 in the sizes arg for slightly more readable fonts.
Fix bbox calcs for rotated entities, fix needed for r_ignorenetpvs 0.
Hackily parse emoji.json to provide :poop: etc suggestions.
Skip prediction entirely when there's no local entity info. This fixes stair-smoothing in xonotic.
screenshot_cubemap will now capture half-float images when saving to ktx or dds files.
Fix support for xcf files larger than 4gb, mostly to avoid compiler warnings.
Fixed size of gfx/loading.lmp when replacement textures are used.
Added mipmap support for rg8 and l8a8 textures.
r_hdr_framebuffer cvar updated to support format names instead of random negative numbers. Description updated to name some interesting ones.
Perform autoupdate _checks_ ONLY with explicit user confirmation (actual updating already needed user confirmation, but this extra step should reduce the chances of us getting wrongly accused of exfiltrating user data if we're run in a sandbox - we ONLY ever included the updating engine's version in the checks, though there's nothing we can do to avoid sending the user's router's IP).
Removed the 'summon satan all over your harddrive' quit message, in case paranoid security researchers are idiots and don't bother doing actual research.
Removed the triptohell.info and fte.triptohell.info certificates, they really need to stop being self-signed. The updates domain is still self-signed for autoupdates.
Video drivers are now able to report supported video resolutions, visible to menuqc. Currently only works with SDL2 builds.
Added setmousepos builtin. Should work with glx+win32 build.
VF_SKYROOM_CAMERA can now accept an extra two args, setviewprop(VF_SKYROOM_CAMERA, org, axis, degrees).
Removed v_skyroom_origin+v_skyroom_orientation cvars in favour just v_skyroom, which should make it behave more like the 'fog' command (used when csqc isn't overriding).
Added R_EndPolygonRibbon builtin to make it faster+easier to generate textured ribbon/cable/etc wide lines (for TW).
sdl: Fix up sys_sdl.c's file enumeration to support wildcards in directories.
edit command now displays end1.bin/end2.bin correctly, because we can.
Finally add support for f_modified - though ruleset_allow_larger_models and ruleset_allow_overlong_sounds generally make it redundant.
Fix threading race condition in sha1 lookups.
Updated f_ruleset to include the same extra flags reported by ezquake.
A mod's default.fmf file can now contain an eg 'mainconfig config.cfg' line (to explicitly set the main config saved with cfg_save_auto 1 etc).
fmf: basegame steam:GameName/GameDir can be used to try to load a mod directory from an installed steam game. The resulting gamedir will be read-only.
HOMEDIR CHANGE: use homedirs only if the basedir cannot be written or a homedir already exists, which should further reduce the probability of microsoft randomly uploading our data to their cloud (but mostly because its annoying to never know where your data is written).
Fixed buf_cvarlist, should work in xonotic now, and without segfaults.
Added an extra arg to URI_Get_Callback calls - the response size, also changed the tempstring to contain all bytes of the response, you need to be careful about nulls though.
Try to work around nvidia's forced-panning bug on x11 when changing video modes. This might screw with other programs.
sdl: support custom icons.
sdl: support choosing a specific display.
Added some documentation to menuqc builtins.
menusys: use outlines for slightly more readable fonts.
menusys: switch vid_width and vid_height combos into a single video mode combo to set both according to reported video modes.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5581 fc73d0e0-1445-4013-8a0c-d673dee63da5
2019-11-20 03:09:50 +00:00
FS_AddGameDirectory ( & oldpaths , dir , reloadflags , fl ) ;
2013-10-29 17:38:22 +00:00
}
2013-06-23 02:17:02 +00:00
}
2005-10-16 12:49:15 +00:00
}
2016-07-12 00:40:13 +00:00
//now mark the depth values
if ( com_searchpaths )
for ( next = com_searchpaths - > next ; next ; next = next - > next )
next - > flags | = SPF_BASEPATH ;
2013-06-23 02:17:02 +00:00
com_base_searchpaths = com_searchpaths ;
2016-07-12 00:40:13 +00:00
2019-10-06 01:59:13 +00:00
for ( i = 0 ; i < countof ( fs_manifest - > gamepath ) ; i + + )
2005-10-16 12:49:15 +00:00
{
2013-11-29 14:36:47 +00:00
char * dir = fs_manifest - > gamepath [ i ] . path ;
Too many changes, sorry.
Change revision displays, use the SVN commit date instead of using __DATE__ (when there's no local changes). This should allow reproducible builds.
Added s_al_disable cvar, to block openal and all the various problems people have had with it, without having to name an explicit fallback (which would vary by system).
Add mastervolume cvar (for ss).
Add r_shadows 2 (aka fake shadows - for ss).
Add scr_loadingscreen_aspect -1 setting, to disable levelshots entirely, also disables the progress bar (for ss).
Better support for some effectinfo hacks (for ss).
Added dpcompat_nocsqcwarnings (because of lazy+buggy mods like ss).
Rework the dpcsqc versions of project+unproject builtins for better compat (for ss).
Added dpcompat_csqcinputeventtypes to block unexpected csqc input events (for ss).
Better compat with DP's loadfont console command (for ss).
Added dpcompat_smallerfonts cvar to replicate a DP bug (for ss).
Detect dp's m_draw extension, to work around it (for ss).
Cvar dpcompat_ignoremodificationtimes added. A value of 0 favour the most recently modified file, 1 will use DP-like alphabetically sorted preferences (for ss).
loadfont builtin can now accept outline=1 in the sizes arg for slightly more readable fonts.
Fix bbox calcs for rotated entities, fix needed for r_ignorenetpvs 0.
Hackily parse emoji.json to provide :poop: etc suggestions.
Skip prediction entirely when there's no local entity info. This fixes stair-smoothing in xonotic.
screenshot_cubemap will now capture half-float images when saving to ktx or dds files.
Fix support for xcf files larger than 4gb, mostly to avoid compiler warnings.
Fixed size of gfx/loading.lmp when replacement textures are used.
Added mipmap support for rg8 and l8a8 textures.
r_hdr_framebuffer cvar updated to support format names instead of random negative numbers. Description updated to name some interesting ones.
Perform autoupdate _checks_ ONLY with explicit user confirmation (actual updating already needed user confirmation, but this extra step should reduce the chances of us getting wrongly accused of exfiltrating user data if we're run in a sandbox - we ONLY ever included the updating engine's version in the checks, though there's nothing we can do to avoid sending the user's router's IP).
Removed the 'summon satan all over your harddrive' quit message, in case paranoid security researchers are idiots and don't bother doing actual research.
Removed the triptohell.info and fte.triptohell.info certificates, they really need to stop being self-signed. The updates domain is still self-signed for autoupdates.
Video drivers are now able to report supported video resolutions, visible to menuqc. Currently only works with SDL2 builds.
Added setmousepos builtin. Should work with glx+win32 build.
VF_SKYROOM_CAMERA can now accept an extra two args, setviewprop(VF_SKYROOM_CAMERA, org, axis, degrees).
Removed v_skyroom_origin+v_skyroom_orientation cvars in favour just v_skyroom, which should make it behave more like the 'fog' command (used when csqc isn't overriding).
Added R_EndPolygonRibbon builtin to make it faster+easier to generate textured ribbon/cable/etc wide lines (for TW).
sdl: Fix up sys_sdl.c's file enumeration to support wildcards in directories.
edit command now displays end1.bin/end2.bin correctly, because we can.
Finally add support for f_modified - though ruleset_allow_larger_models and ruleset_allow_overlong_sounds generally make it redundant.
Fix threading race condition in sha1 lookups.
Updated f_ruleset to include the same extra flags reported by ezquake.
A mod's default.fmf file can now contain an eg 'mainconfig config.cfg' line (to explicitly set the main config saved with cfg_save_auto 1 etc).
fmf: basegame steam:GameName/GameDir can be used to try to load a mod directory from an installed steam game. The resulting gamedir will be read-only.
HOMEDIR CHANGE: use homedirs only if the basedir cannot be written or a homedir already exists, which should further reduce the probability of microsoft randomly uploading our data to their cloud (but mostly because its annoying to never know where your data is written).
Fixed buf_cvarlist, should work in xonotic now, and without segfaults.
Added an extra arg to URI_Get_Callback calls - the response size, also changed the tempstring to contain all bytes of the response, you need to be careful about nulls though.
Try to work around nvidia's forced-panning bug on x11 when changing video modes. This might screw with other programs.
sdl: support custom icons.
sdl: support choosing a specific display.
Added some documentation to menuqc builtins.
menusys: use outlines for slightly more readable fonts.
menusys: switch vid_width and vid_height combos into a single video mode combo to set both according to reported video modes.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5581 fc73d0e0-1445-4013-8a0c-d673dee63da5
2019-11-20 03:09:50 +00:00
if ( dir & & ! ( fs_manifest - > gamepath [ i ] . flags & GAMEDIR_BASEGAME ) )
2013-06-23 02:17:02 +00:00
{
2019-10-06 01:59:13 +00:00
for ( j = 0 ; j < countof ( fs_manifest - > gamepath ) ; j + + )
{
char * dir2 = fs_manifest - > gamepath [ j ] . path ;
Too many changes, sorry.
Change revision displays, use the SVN commit date instead of using __DATE__ (when there's no local changes). This should allow reproducible builds.
Added s_al_disable cvar, to block openal and all the various problems people have had with it, without having to name an explicit fallback (which would vary by system).
Add mastervolume cvar (for ss).
Add r_shadows 2 (aka fake shadows - for ss).
Add scr_loadingscreen_aspect -1 setting, to disable levelshots entirely, also disables the progress bar (for ss).
Better support for some effectinfo hacks (for ss).
Added dpcompat_nocsqcwarnings (because of lazy+buggy mods like ss).
Rework the dpcsqc versions of project+unproject builtins for better compat (for ss).
Added dpcompat_csqcinputeventtypes to block unexpected csqc input events (for ss).
Better compat with DP's loadfont console command (for ss).
Added dpcompat_smallerfonts cvar to replicate a DP bug (for ss).
Detect dp's m_draw extension, to work around it (for ss).
Cvar dpcompat_ignoremodificationtimes added. A value of 0 favour the most recently modified file, 1 will use DP-like alphabetically sorted preferences (for ss).
loadfont builtin can now accept outline=1 in the sizes arg for slightly more readable fonts.
Fix bbox calcs for rotated entities, fix needed for r_ignorenetpvs 0.
Hackily parse emoji.json to provide :poop: etc suggestions.
Skip prediction entirely when there's no local entity info. This fixes stair-smoothing in xonotic.
screenshot_cubemap will now capture half-float images when saving to ktx or dds files.
Fix support for xcf files larger than 4gb, mostly to avoid compiler warnings.
Fixed size of gfx/loading.lmp when replacement textures are used.
Added mipmap support for rg8 and l8a8 textures.
r_hdr_framebuffer cvar updated to support format names instead of random negative numbers. Description updated to name some interesting ones.
Perform autoupdate _checks_ ONLY with explicit user confirmation (actual updating already needed user confirmation, but this extra step should reduce the chances of us getting wrongly accused of exfiltrating user data if we're run in a sandbox - we ONLY ever included the updating engine's version in the checks, though there's nothing we can do to avoid sending the user's router's IP).
Removed the 'summon satan all over your harddrive' quit message, in case paranoid security researchers are idiots and don't bother doing actual research.
Removed the triptohell.info and fte.triptohell.info certificates, they really need to stop being self-signed. The updates domain is still self-signed for autoupdates.
Video drivers are now able to report supported video resolutions, visible to menuqc. Currently only works with SDL2 builds.
Added setmousepos builtin. Should work with glx+win32 build.
VF_SKYROOM_CAMERA can now accept an extra two args, setviewprop(VF_SKYROOM_CAMERA, org, axis, degrees).
Removed v_skyroom_origin+v_skyroom_orientation cvars in favour just v_skyroom, which should make it behave more like the 'fog' command (used when csqc isn't overriding).
Added R_EndPolygonRibbon builtin to make it faster+easier to generate textured ribbon/cable/etc wide lines (for TW).
sdl: Fix up sys_sdl.c's file enumeration to support wildcards in directories.
edit command now displays end1.bin/end2.bin correctly, because we can.
Finally add support for f_modified - though ruleset_allow_larger_models and ruleset_allow_overlong_sounds generally make it redundant.
Fix threading race condition in sha1 lookups.
Updated f_ruleset to include the same extra flags reported by ezquake.
A mod's default.fmf file can now contain an eg 'mainconfig config.cfg' line (to explicitly set the main config saved with cfg_save_auto 1 etc).
fmf: basegame steam:GameName/GameDir can be used to try to load a mod directory from an installed steam game. The resulting gamedir will be read-only.
HOMEDIR CHANGE: use homedirs only if the basedir cannot be written or a homedir already exists, which should further reduce the probability of microsoft randomly uploading our data to their cloud (but mostly because its annoying to never know where your data is written).
Fixed buf_cvarlist, should work in xonotic now, and without segfaults.
Added an extra arg to URI_Get_Callback calls - the response size, also changed the tempstring to contain all bytes of the response, you need to be careful about nulls though.
Try to work around nvidia's forced-panning bug on x11 when changing video modes. This might screw with other programs.
sdl: support custom icons.
sdl: support choosing a specific display.
Added some documentation to menuqc builtins.
menusys: use outlines for slightly more readable fonts.
menusys: switch vid_width and vid_height combos into a single video mode combo to set both according to reported video modes.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5581 fc73d0e0-1445-4013-8a0c-d673dee63da5
2019-11-20 03:09:50 +00:00
if ( dir2 & & ( fs_manifest - > gamepath [ i ] . flags & GAMEDIR_BASEGAME ) & & ! strcmp ( dir , dir2 ) )
2019-10-06 01:59:13 +00:00
break ;
}
if ( j < countof ( fs_manifest - > gamepath ) )
continue ; //already loaded above. don't mess up gameonly_gamedir.
2023-03-27 17:19:00 +00:00
fl = SPF_EXPLICIT ;
if ( ! ( fs_manifest - > gamepath [ i ] . flags & GAMEDIR_READONLY ) )
fl | = SPF_WRITABLE ;
if ( fs_manifest - > gamepath [ i ] . flags & GAMEDIR_PRIVATE )
fl | = SPF_PRIVATE ;
if ( fs_manifest - > gamepath [ i ] . flags & GAMEDIR_QSHACK )
fl | = SPF_QSHACK ;
2013-11-29 14:36:47 +00:00
if ( * dir = = ' * ' )
2023-03-27 17:19:00 +00:00
{ //just in case... shouldn't be needed.
dir + + ;
fl | = GAMEDIR_PRIVATE ;
2013-10-29 17:38:22 +00:00
}
2023-03-27 17:19:00 +00:00
if ( fs_manifest - > gamepath [ i ] . flags & GAMEDIR_SPECIAL )
; //don't.
2013-10-29 17:38:22 +00:00
else
{
2023-03-27 17:19:00 +00:00
//don't use evil gamedir names.
if ( ! FS_GamedirIsOkay ( dir ) )
continue ;
FS_AddGameDirectory ( & oldpaths , dir , reloadflags , fl ) ;
2013-10-29 17:38:22 +00:00
}
2013-06-23 02:17:02 +00:00
}
}
2005-10-16 12:49:15 +00:00
2015-05-14 03:06:58 +00:00
FS_AddDownloadManifestPackages ( & oldpaths , reloadflags ) ;
2013-06-23 02:17:02 +00:00
/*sv_pure: Reload pure paths*/
if ( fs_purenames & & fs_purecrcs )
{
char crctok [ 64 ] ;
char nametok [ MAX_QPATH ] ;
2014-06-12 23:08:42 +00:00
char nametok2 [ MAX_QPATH ] ;
2013-06-23 02:17:02 +00:00
searchpath_t * sp , * lastpure = NULL ;
char * names = fs_purenames , * pname ;
char * crcs = fs_purecrcs ;
int crc ;
2005-10-16 12:49:15 +00:00
2013-06-23 02:17:02 +00:00
for ( sp = com_searchpaths ; sp ; sp = sp - > next )
Android: fat presses, vibrator, onscreen keyboard, keep-screen-on, console scaling, touch-based console scrolling, additional bindables.
Some memory leaks fixed.
latency with the nq protocol over loopback is much reduced.
Terrain: now mostly a property of a (q1 for now) bsp map, file format changed, glsl now built in, terrain editor builtin improved/changed, holes supported.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4067 fc73d0e0-1445-4013-8a0c-d673dee63da5
2012-07-14 16:25:18 +00:00
{
2013-06-23 02:17:02 +00:00
if ( sp - > handle - > GeneratePureCRC )
Android: fat presses, vibrator, onscreen keyboard, keep-screen-on, console scaling, touch-based console scrolling, additional bindables.
Some memory leaks fixed.
latency with the nq protocol over loopback is much reduced.
Terrain: now mostly a property of a (q1 for now) bsp map, file format changed, glsl now built in, terrain editor builtin improved/changed, holes supported.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4067 fc73d0e0-1445-4013-8a0c-d673dee63da5
2012-07-14 16:25:18 +00:00
{
2013-06-23 02:17:02 +00:00
sp - > nextpure = ( void * ) 0x1 ;
Added sys_openfile console command(and menu option) to web and flatpak(via cmake+dbus) builds, to 'install' packages on sandboxed systems a bit more easily.
Cmake: Add FTE_WERROR option, defaults to true in debug builds and off in release builds (in case future compilers have issues).
Cmake: Pull in libXscreensaver so we don't get interrupted by screensavers when playing demos.
Make: Added `make webcl-rel` for a web build without server bloat (eg for sites focused on demo playback. Yes, this means you XantoM).
fteqcc: Include the decompiler in fteqcc (non-gui) builds ('-d' arg).
fteqcc: Decompiler can now mostly handle hexen2 mods without any unknown opcodes.
Allow ezHud and OpenSSL to be compiled as in-engine plugins, potentially for web and windows ports respectively.
Web: Fix support for ogg vorbis. Add support for voip.
Web: Added basic support for WebXR.
QTV: Don't try seeking on unseekable qtv streams. Don't spam when developer 1 is set.
QTV: add support for some eztv extensions.
MVD: added hack to use ktx's vweps in mvd where mvdsv doesn't bother to record the info.
qwfwd: hack around a hack in qwfwd, allowing it to work again.
recording: favour qwd in single player, instead of mvd.
Protocol: reduce client memory used for precache names. Bump maximum precache counts - some people are just abusive, yes you Orl.
hexen2: add enough clientside protocol compat to play the demo included with h2mp. lacks effects.
in_xflip: restored this setting.
fs_hidesyspaths: new cvar, defaults to enabled so you won't find your username or whatever turning up in screenshots or the like. change it to 0 before debuging stuff eg via 'path'.
gl_overbright_models: Added cvar to match QS.
netchan: Added MTU determination, we'll no longer fail to connect when routers stupidly drop icmp packets.
Win: try a few other versions of xinput too.
CSQC: Added a CSQC_GenerateMaterial function, to give the csqc a chance to generate custom materials.
MenuQC: Added support for the skeletal objects API.
2024-04-09 17:13:59 +00:00
if ( sp - > crc_seed ! = fs_pureseed )
{
sp - > crc_seed = fs_pureseed ;
sp - > crc_reply = sp - > handle - > GeneratePureCRC ( sp - > handle , & sp - > crc_seed ) ;
}
Android: fat presses, vibrator, onscreen keyboard, keep-screen-on, console scaling, touch-based console scrolling, additional bindables.
Some memory leaks fixed.
latency with the nq protocol over loopback is much reduced.
Terrain: now mostly a property of a (q1 for now) bsp map, file format changed, glsl now built in, terrain editor builtin improved/changed, holes supported.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4067 fc73d0e0-1445-4013-8a0c-d673dee63da5
2012-07-14 16:25:18 +00:00
}
else
2013-06-23 02:17:02 +00:00
{
sp - > nextpure = NULL ;
sp - > crc_check = 0 ;
sp - > crc_reply = 0 ;
}
}
while ( names & & crcs )
{
crcs = COM_ParseOut ( crcs , crctok , sizeof ( crctok ) ) ;
names = COM_ParseOut ( names , nametok , sizeof ( nametok ) ) ;
crc = strtoul ( crctok , NULL , 0 ) ;
2018-09-23 19:35:24 +00:00
if ( ! * crctok )
2013-06-23 02:17:02 +00:00
continue ;
2018-09-23 19:35:24 +00:00
if ( ! strcmp ( crctok , " - " ) )
* crctok = 0 ;
2013-06-23 02:17:02 +00:00
pname = nametok ;
2014-06-12 23:08:42 +00:00
if ( fs_refnames & & fs_refcrcs )
{ //q3 is annoying as hell
int crc2 ;
char * rc = fs_refcrcs ;
char * rn = fs_refnames ;
pname = " " ;
for ( ; rc & & rn ; )
{
rc = COM_ParseOut ( rc , crctok , sizeof ( crctok ) ) ;
rn = COM_ParseOut ( rn , nametok2 , sizeof ( nametok2 ) ) ;
crc2 = strtoul ( crctok , NULL , 0 ) ;
if ( crc2 = = crc )
{
COM_DefaultExtension ( nametok2 , " .pk3 " , sizeof ( nametok2 ) ) ;
pname = nametok2 ;
break ;
}
}
}
2013-06-23 02:17:02 +00:00
if ( * pname = = ' * ' ) // * means that its 'referenced' (read: actually useful) thus should be downloaded, which is not relevent here.
pname + + ;
for ( sp = com_searchpaths ; sp ; sp = sp - > next )
{
if ( sp - > nextpure = = ( void * ) 0x1 ) //don't add twice.
2018-09-23 19:35:24 +00:00
if ( ( * crctok & & sp - > crc_check = = crc ) | |
( ! * crctok & & ! strcmp ( COM_SkipPath ( sp - > purepath ) , COM_SkipPath ( pname ) ) ) )
2013-06-23 02:17:02 +00:00
{
if ( fs_puremode )
{
if ( lastpure )
lastpure - > nextpure = sp ;
else
com_purepaths = sp ;
sp - > nextpure = NULL ;
lastpure = sp ;
}
break ;
}
}
if ( ! fs_puremode & & ! sp )
{ //if we're not pure, we don't care if the version differs. don't load the server's version.
//this works around 1.01 vs 1.06 issues.
for ( sp = com_searchpaths ; sp ; sp = sp - > next )
{
2014-02-07 08:38:40 +00:00
if ( ! Q_strcasecmp ( pname , sp - > purepath ) )
2013-06-23 02:17:02 +00:00
break ;
}
}
//if its not already loaded (via wildcards), load it from the download cache, if we can
2014-06-12 23:08:42 +00:00
if ( ! sp & & * pname )
2013-06-23 02:17:02 +00:00
{
char local [ MAX_OSPATH ] ;
Added sys_openfile console command(and menu option) to web and flatpak(via cmake+dbus) builds, to 'install' packages on sandboxed systems a bit more easily.
Cmake: Add FTE_WERROR option, defaults to true in debug builds and off in release builds (in case future compilers have issues).
Cmake: Pull in libXscreensaver so we don't get interrupted by screensavers when playing demos.
Make: Added `make webcl-rel` for a web build without server bloat (eg for sites focused on demo playback. Yes, this means you XantoM).
fteqcc: Include the decompiler in fteqcc (non-gui) builds ('-d' arg).
fteqcc: Decompiler can now mostly handle hexen2 mods without any unknown opcodes.
Allow ezHud and OpenSSL to be compiled as in-engine plugins, potentially for web and windows ports respectively.
Web: Fix support for ogg vorbis. Add support for voip.
Web: Added basic support for WebXR.
QTV: Don't try seeking on unseekable qtv streams. Don't spam when developer 1 is set.
QTV: add support for some eztv extensions.
MVD: added hack to use ktx's vweps in mvd where mvdsv doesn't bother to record the info.
qwfwd: hack around a hack in qwfwd, allowing it to work again.
recording: favour qwd in single player, instead of mvd.
Protocol: reduce client memory used for precache names. Bump maximum precache counts - some people are just abusive, yes you Orl.
hexen2: add enough clientside protocol compat to play the demo included with h2mp. lacks effects.
in_xflip: restored this setting.
fs_hidesyspaths: new cvar, defaults to enabled so you won't find your username or whatever turning up in screenshots or the like. change it to 0 before debuging stuff eg via 'path'.
gl_overbright_models: Added cvar to match QS.
netchan: Added MTU determination, we'll no longer fail to connect when routers stupidly drop icmp packets.
Win: try a few other versions of xinput too.
CSQC: Added a CSQC_GenerateMaterial function, to give the csqc a chance to generate custom materials.
MenuQC: Added support for the skeletal objects API.
2024-04-09 17:13:59 +00:00
char rlocal [ MAX_OSPATH ] ;
2013-06-23 02:17:02 +00:00
vfsfile_t * vfs ;
2014-10-05 20:04:11 +00:00
char ext [ 8 ] ;
2013-06-23 02:17:02 +00:00
void * handle ;
int i ;
2014-10-05 20:04:11 +00:00
COM_FileExtension ( pname , ext , sizeof ( ext ) ) ;
2013-06-23 02:17:02 +00:00
Added sys_openfile console command(and menu option) to web and flatpak(via cmake+dbus) builds, to 'install' packages on sandboxed systems a bit more easily.
Cmake: Add FTE_WERROR option, defaults to true in debug builds and off in release builds (in case future compilers have issues).
Cmake: Pull in libXscreensaver so we don't get interrupted by screensavers when playing demos.
Make: Added `make webcl-rel` for a web build without server bloat (eg for sites focused on demo playback. Yes, this means you XantoM).
fteqcc: Include the decompiler in fteqcc (non-gui) builds ('-d' arg).
fteqcc: Decompiler can now mostly handle hexen2 mods without any unknown opcodes.
Allow ezHud and OpenSSL to be compiled as in-engine plugins, potentially for web and windows ports respectively.
Web: Fix support for ogg vorbis. Add support for voip.
Web: Added basic support for WebXR.
QTV: Don't try seeking on unseekable qtv streams. Don't spam when developer 1 is set.
QTV: add support for some eztv extensions.
MVD: added hack to use ktx's vweps in mvd where mvdsv doesn't bother to record the info.
qwfwd: hack around a hack in qwfwd, allowing it to work again.
recording: favour qwd in single player, instead of mvd.
Protocol: reduce client memory used for precache names. Bump maximum precache counts - some people are just abusive, yes you Orl.
hexen2: add enough clientside protocol compat to play the demo included with h2mp. lacks effects.
in_xflip: restored this setting.
fs_hidesyspaths: new cvar, defaults to enabled so you won't find your username or whatever turning up in screenshots or the like. change it to 0 before debuging stuff eg via 'path'.
gl_overbright_models: Added cvar to match QS.
netchan: Added MTU determination, we'll no longer fail to connect when routers stupidly drop icmp packets.
Win: try a few other versions of xinput too.
CSQC: Added a CSQC_GenerateMaterial function, to give the csqc a chance to generate custom materials.
MenuQC: Added support for the skeletal objects API.
2024-04-09 17:13:59 +00:00
if ( FS_GenCachedPakName ( pname , crctok , rlocal , sizeof ( rlocal ) ) & & FS_SystemPath ( rlocal , FS_ROOT , local , sizeof ( local ) ) )
2014-06-12 23:08:42 +00:00
{
unsigned int keptflags ;
Added sys_openfile console command(and menu option) to web and flatpak(via cmake+dbus) builds, to 'install' packages on sandboxed systems a bit more easily.
Cmake: Add FTE_WERROR option, defaults to true in debug builds and off in release builds (in case future compilers have issues).
Cmake: Pull in libXscreensaver so we don't get interrupted by screensavers when playing demos.
Make: Added `make webcl-rel` for a web build without server bloat (eg for sites focused on demo playback. Yes, this means you XantoM).
fteqcc: Include the decompiler in fteqcc (non-gui) builds ('-d' arg).
fteqcc: Decompiler can now mostly handle hexen2 mods without any unknown opcodes.
Allow ezHud and OpenSSL to be compiled as in-engine plugins, potentially for web and windows ports respectively.
Web: Fix support for ogg vorbis. Add support for voip.
Web: Added basic support for WebXR.
QTV: Don't try seeking on unseekable qtv streams. Don't spam when developer 1 is set.
QTV: add support for some eztv extensions.
MVD: added hack to use ktx's vweps in mvd where mvdsv doesn't bother to record the info.
qwfwd: hack around a hack in qwfwd, allowing it to work again.
recording: favour qwd in single player, instead of mvd.
Protocol: reduce client memory used for precache names. Bump maximum precache counts - some people are just abusive, yes you Orl.
hexen2: add enough clientside protocol compat to play the demo included with h2mp. lacks effects.
in_xflip: restored this setting.
fs_hidesyspaths: new cvar, defaults to enabled so you won't find your username or whatever turning up in screenshots or the like. change it to 0 before debuging stuff eg via 'path'.
gl_overbright_models: Added cvar to match QS.
netchan: Added MTU determination, we'll no longer fail to connect when routers stupidly drop icmp packets.
Win: try a few other versions of xinput too.
CSQC: Added a CSQC_GenerateMaterial function, to give the csqc a chance to generate custom materials.
MenuQC: Added support for the skeletal objects API.
2024-04-09 17:13:59 +00:00
2014-06-12 23:08:42 +00:00
handle = FS_GetOldPath ( & oldpaths , local , & keptflags ) ;
if ( handle )
{
2022-03-01 02:51:55 +00:00
sp = FS_AddPathHandle ( & oldpaths , pname , local , handle , " " , SPF_COPYPROTECTED | SPF_UNTRUSTED | SPF_SERVER | keptflags , ( unsigned int ) - 1 ) ;
2018-10-13 12:19:58 +00:00
if ( ! sp )
continue ; //some kind of error...
if ( ( * crctok & & sp - > crc_check = = crc ) | | ! * crctok )
2014-06-12 23:08:42 +00:00
{
if ( fs_puremode )
{
if ( lastpure )
lastpure - > nextpure = sp ;
else
com_purepaths = sp ;
sp - > nextpure = NULL ;
lastpure = sp ;
}
}
2018-10-13 12:19:58 +00:00
//else crc mismatched...
2014-06-12 23:08:42 +00:00
continue ;
}
Added sys_openfile console command(and menu option) to web and flatpak(via cmake+dbus) builds, to 'install' packages on sandboxed systems a bit more easily.
Cmake: Add FTE_WERROR option, defaults to true in debug builds and off in release builds (in case future compilers have issues).
Cmake: Pull in libXscreensaver so we don't get interrupted by screensavers when playing demos.
Make: Added `make webcl-rel` for a web build without server bloat (eg for sites focused on demo playback. Yes, this means you XantoM).
fteqcc: Include the decompiler in fteqcc (non-gui) builds ('-d' arg).
fteqcc: Decompiler can now mostly handle hexen2 mods without any unknown opcodes.
Allow ezHud and OpenSSL to be compiled as in-engine plugins, potentially for web and windows ports respectively.
Web: Fix support for ogg vorbis. Add support for voip.
Web: Added basic support for WebXR.
QTV: Don't try seeking on unseekable qtv streams. Don't spam when developer 1 is set.
QTV: add support for some eztv extensions.
MVD: added hack to use ktx's vweps in mvd where mvdsv doesn't bother to record the info.
qwfwd: hack around a hack in qwfwd, allowing it to work again.
recording: favour qwd in single player, instead of mvd.
Protocol: reduce client memory used for precache names. Bump maximum precache counts - some people are just abusive, yes you Orl.
hexen2: add enough clientside protocol compat to play the demo included with h2mp. lacks effects.
in_xflip: restored this setting.
fs_hidesyspaths: new cvar, defaults to enabled so you won't find your username or whatever turning up in screenshots or the like. change it to 0 before debuging stuff eg via 'path'.
gl_overbright_models: Added cvar to match QS.
netchan: Added MTU determination, we'll no longer fail to connect when routers stupidly drop icmp packets.
Win: try a few other versions of xinput too.
CSQC: Added a CSQC_GenerateMaterial function, to give the csqc a chance to generate custom materials.
MenuQC: Added support for the skeletal objects API.
2024-04-09 17:13:59 +00:00
vfs = FS_OpenVFS ( rlocal , " rb " , FS_ROOT ) ;
2014-06-12 23:08:42 +00:00
}
2013-06-23 02:17:02 +00:00
else
vfs = NULL ;
if ( vfs )
{
for ( i = 0 ; i < sizeof ( searchpathformats ) / sizeof ( searchpathformats [ 0 ] ) ; i + + )
{
if ( ! searchpathformats [ i ] . extension | | ! searchpathformats [ i ] . OpenNew )
continue ;
Added sys_openfile console command(and menu option) to web and flatpak(via cmake+dbus) builds, to 'install' packages on sandboxed systems a bit more easily.
Cmake: Add FTE_WERROR option, defaults to true in debug builds and off in release builds (in case future compilers have issues).
Cmake: Pull in libXscreensaver so we don't get interrupted by screensavers when playing demos.
Make: Added `make webcl-rel` for a web build without server bloat (eg for sites focused on demo playback. Yes, this means you XantoM).
fteqcc: Include the decompiler in fteqcc (non-gui) builds ('-d' arg).
fteqcc: Decompiler can now mostly handle hexen2 mods without any unknown opcodes.
Allow ezHud and OpenSSL to be compiled as in-engine plugins, potentially for web and windows ports respectively.
Web: Fix support for ogg vorbis. Add support for voip.
Web: Added basic support for WebXR.
QTV: Don't try seeking on unseekable qtv streams. Don't spam when developer 1 is set.
QTV: add support for some eztv extensions.
MVD: added hack to use ktx's vweps in mvd where mvdsv doesn't bother to record the info.
qwfwd: hack around a hack in qwfwd, allowing it to work again.
recording: favour qwd in single player, instead of mvd.
Protocol: reduce client memory used for precache names. Bump maximum precache counts - some people are just abusive, yes you Orl.
hexen2: add enough clientside protocol compat to play the demo included with h2mp. lacks effects.
in_xflip: restored this setting.
fs_hidesyspaths: new cvar, defaults to enabled so you won't find your username or whatever turning up in screenshots or the like. change it to 0 before debuging stuff eg via 'path'.
gl_overbright_models: Added cvar to match QS.
netchan: Added MTU determination, we'll no longer fail to connect when routers stupidly drop icmp packets.
Win: try a few other versions of xinput too.
CSQC: Added a CSQC_GenerateMaterial function, to give the csqc a chance to generate custom materials.
MenuQC: Added support for the skeletal objects API.
2024-04-09 17:13:59 +00:00
if ( ! Q_strcasecmp ( ext , searchpathformats [ i ] . extension ) )
2013-06-23 02:17:02 +00:00
{
2018-03-04 14:41:16 +00:00
handle = searchpathformats [ i ] . OpenNew ( vfs , NULL , local , local , " " ) ;
2013-06-23 02:17:02 +00:00
if ( ! handle )
break ;
2022-03-01 02:51:55 +00:00
sp = FS_AddPathHandle ( & oldpaths , pname , local , handle , " " , SPF_COPYPROTECTED | SPF_UNTRUSTED | SPF_SERVER , ( unsigned int ) - 1 ) ;
2013-06-23 02:17:02 +00:00
2018-10-13 12:19:58 +00:00
if ( ( * crctok & & sp - > crc_check = = crc ) | | ! * crctok )
2013-06-23 02:17:02 +00:00
{
if ( fs_puremode )
{
if ( lastpure )
lastpure - > nextpure = sp ;
else
com_purepaths = sp ;
sp - > nextpure = NULL ;
lastpure = sp ;
}
}
break ;
}
}
}
if ( ! sp )
Added sys_openfile console command(and menu option) to web and flatpak(via cmake+dbus) builds, to 'install' packages on sandboxed systems a bit more easily.
Cmake: Add FTE_WERROR option, defaults to true in debug builds and off in release builds (in case future compilers have issues).
Cmake: Pull in libXscreensaver so we don't get interrupted by screensavers when playing demos.
Make: Added `make webcl-rel` for a web build without server bloat (eg for sites focused on demo playback. Yes, this means you XantoM).
fteqcc: Include the decompiler in fteqcc (non-gui) builds ('-d' arg).
fteqcc: Decompiler can now mostly handle hexen2 mods without any unknown opcodes.
Allow ezHud and OpenSSL to be compiled as in-engine plugins, potentially for web and windows ports respectively.
Web: Fix support for ogg vorbis. Add support for voip.
Web: Added basic support for WebXR.
QTV: Don't try seeking on unseekable qtv streams. Don't spam when developer 1 is set.
QTV: add support for some eztv extensions.
MVD: added hack to use ktx's vweps in mvd where mvdsv doesn't bother to record the info.
qwfwd: hack around a hack in qwfwd, allowing it to work again.
recording: favour qwd in single player, instead of mvd.
Protocol: reduce client memory used for precache names. Bump maximum precache counts - some people are just abusive, yes you Orl.
hexen2: add enough clientside protocol compat to play the demo included with h2mp. lacks effects.
in_xflip: restored this setting.
fs_hidesyspaths: new cvar, defaults to enabled so you won't find your username or whatever turning up in screenshots or the like. change it to 0 before debuging stuff eg via 'path'.
gl_overbright_models: Added cvar to match QS.
netchan: Added MTU determination, we'll no longer fail to connect when routers stupidly drop icmp packets.
Win: try a few other versions of xinput too.
CSQC: Added a CSQC_GenerateMaterial function, to give the csqc a chance to generate custom materials.
MenuQC: Added support for the skeletal objects API.
2024-04-09 17:13:59 +00:00
Con_DPrintf ( CON_ERROR " Pure package %s:%08x wasn't found \n " , pname , crc ) ;
2013-06-23 02:17:02 +00:00
}
Android: fat presses, vibrator, onscreen keyboard, keep-screen-on, console scaling, touch-based console scrolling, additional bindables.
Some memory leaks fixed.
latency with the nq protocol over loopback is much reduced.
Terrain: now mostly a property of a (q1 for now) bsp map, file format changed, glsl now built in, terrain editor builtin improved/changed, holes supported.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4067 fc73d0e0-1445-4013-8a0c-d673dee63da5
2012-07-14 16:25:18 +00:00
}
2005-10-16 12:49:15 +00:00
}
2013-06-23 02:17:02 +00:00
while ( oldpaths )
{
2020-04-29 10:43:22 +00:00
fs_restarts + + ;
2013-06-23 02:17:02 +00:00
next = oldpaths - > next ;
2011-10-27 16:16:29 +00:00
2016-07-12 00:40:13 +00:00
Con_DPrintf ( " %s is no longer needed \n " , oldpaths - > logicalpath ) ;
2013-06-23 02:17:02 +00:00
oldpaths - > handle - > ClosePath ( oldpaths - > handle ) ;
Z_Free ( oldpaths ) ;
oldpaths = next ;
}
2014-06-21 17:58:17 +00:00
2014-10-05 20:04:11 +00:00
i = orderkey ;
orderkey = 0 ;
next = NULL ;
if ( com_purepaths )
for ( next = com_purepaths ; next ; next = next - > nextpure )
if ( next - > orderkey ! = + + orderkey )
break ;
if ( ! next & & fs_puremode < 2 )
for ( next = com_purepaths ; next ; next = next - > nextpure )
if ( next - > orderkey ! = + + orderkey )
break ;
if ( next | | i ! = orderkey ) //some path changed. make sure the fs cache is flushed.
FS_FlushFSHashReally ( false ) ;
2018-12-28 00:04:36 +00:00
# ifdef HAVE_CLIENT
2014-06-21 17:58:17 +00:00
Shader_NeedReload ( true ) ;
# endif
// Mod_ClearAll();
// Cache_Flush();
2005-10-16 12:49:15 +00:00
}
2006-01-28 06:41:20 +00:00
void FS_UnloadPackFiles ( void )
{
2014-10-05 20:04:11 +00:00
if ( Sys_LockMutex ( fs_thread_mutex ) )
{
2016-08-25 00:12:14 +00:00
FS_ReloadPackFilesFlags ( 0 ) ;
2014-10-05 20:04:11 +00:00
Sys_UnlockMutex ( fs_thread_mutex ) ;
}
2006-01-28 06:41:20 +00:00
}
2005-10-31 00:52:03 +00:00
void FS_ReloadPackFiles ( void )
{
2016-07-12 00:40:13 +00:00
//extra junk is to ensure the palette is reloaded if that changed.
Added sys_openfile console command(and menu option) to web and flatpak(via cmake+dbus) builds, to 'install' packages on sandboxed systems a bit more easily.
Cmake: Add FTE_WERROR option, defaults to true in debug builds and off in release builds (in case future compilers have issues).
Cmake: Pull in libXscreensaver so we don't get interrupted by screensavers when playing demos.
Make: Added `make webcl-rel` for a web build without server bloat (eg for sites focused on demo playback. Yes, this means you XantoM).
fteqcc: Include the decompiler in fteqcc (non-gui) builds ('-d' arg).
fteqcc: Decompiler can now mostly handle hexen2 mods without any unknown opcodes.
Allow ezHud and OpenSSL to be compiled as in-engine plugins, potentially for web and windows ports respectively.
Web: Fix support for ogg vorbis. Add support for voip.
Web: Added basic support for WebXR.
QTV: Don't try seeking on unseekable qtv streams. Don't spam when developer 1 is set.
QTV: add support for some eztv extensions.
MVD: added hack to use ktx's vweps in mvd where mvdsv doesn't bother to record the info.
qwfwd: hack around a hack in qwfwd, allowing it to work again.
recording: favour qwd in single player, instead of mvd.
Protocol: reduce client memory used for precache names. Bump maximum precache counts - some people are just abusive, yes you Orl.
hexen2: add enough clientside protocol compat to play the demo included with h2mp. lacks effects.
in_xflip: restored this setting.
fs_hidesyspaths: new cvar, defaults to enabled so you won't find your username or whatever turning up in screenshots or the like. change it to 0 before debuging stuff eg via 'path'.
gl_overbright_models: Added cvar to match QS.
netchan: Added MTU determination, we'll no longer fail to connect when routers stupidly drop icmp packets.
Win: try a few other versions of xinput too.
CSQC: Added a CSQC_GenerateMaterial function, to give the csqc a chance to generate custom materials.
MenuQC: Added support for the skeletal objects API.
2024-04-09 17:13:59 +00:00
flocation_t oldloc [ countof ( vidfilenames ) ] ;
flocation_t newloc = { NULL } ;
size_t i ;
if ( ! FS_GameIsInitialised ( ) )
{
ftemanifest_t * man = FS_ReadDefaultManifest ( com_gamepath , 0 , true ) ;
if ( man )
{
FS_ChangeGame ( man , true , false ) ;
return ;
}
}
for ( i = 0 ; i < countof ( vidfilenames ) ; i + + )
FS_FLocateFile ( vidfilenames [ i ] , 0 , & oldloc [ i ] ) ;
2016-07-12 00:40:13 +00:00
2014-10-05 20:04:11 +00:00
if ( Sys_LockMutex ( fs_thread_mutex ) )
{
FS_ReloadPackFilesFlags ( ~ 0 ) ;
Sys_UnlockMutex ( fs_thread_mutex ) ;
}
2016-07-12 00:40:13 +00:00
Added sys_openfile console command(and menu option) to web and flatpak(via cmake+dbus) builds, to 'install' packages on sandboxed systems a bit more easily.
Cmake: Add FTE_WERROR option, defaults to true in debug builds and off in release builds (in case future compilers have issues).
Cmake: Pull in libXscreensaver so we don't get interrupted by screensavers when playing demos.
Make: Added `make webcl-rel` for a web build without server bloat (eg for sites focused on demo playback. Yes, this means you XantoM).
fteqcc: Include the decompiler in fteqcc (non-gui) builds ('-d' arg).
fteqcc: Decompiler can now mostly handle hexen2 mods without any unknown opcodes.
Allow ezHud and OpenSSL to be compiled as in-engine plugins, potentially for web and windows ports respectively.
Web: Fix support for ogg vorbis. Add support for voip.
Web: Added basic support for WebXR.
QTV: Don't try seeking on unseekable qtv streams. Don't spam when developer 1 is set.
QTV: add support for some eztv extensions.
MVD: added hack to use ktx's vweps in mvd where mvdsv doesn't bother to record the info.
qwfwd: hack around a hack in qwfwd, allowing it to work again.
recording: favour qwd in single player, instead of mvd.
Protocol: reduce client memory used for precache names. Bump maximum precache counts - some people are just abusive, yes you Orl.
hexen2: add enough clientside protocol compat to play the demo included with h2mp. lacks effects.
in_xflip: restored this setting.
fs_hidesyspaths: new cvar, defaults to enabled so you won't find your username or whatever turning up in screenshots or the like. change it to 0 before debuging stuff eg via 'path'.
gl_overbright_models: Added cvar to match QS.
netchan: Added MTU determination, we'll no longer fail to connect when routers stupidly drop icmp packets.
Win: try a few other versions of xinput too.
CSQC: Added a CSQC_GenerateMaterial function, to give the csqc a chance to generate custom materials.
MenuQC: Added support for the skeletal objects API.
2024-04-09 17:13:59 +00:00
for ( i = 0 ; i < countof ( vidfilenames ) ; i + + )
{
FS_FLocateFile ( vidfilenames [ i ] , 0 , & newloc ) ;
if ( oldloc [ i ] . search ! = newloc . search )
{ //okay, so this file changed... reload the video stuff
Cbuf_AddText ( " vid_reload \n " , RESTRICT_LOCAL ) ;
break ;
}
}
2005-10-31 00:52:03 +00:00
}
2018-10-11 10:31:23 +00:00
static void FS_ReloadPackFiles_f ( void )
2005-10-31 00:52:03 +00:00
{
2014-10-05 20:04:11 +00:00
if ( Sys_LockMutex ( fs_thread_mutex ) )
{
2016-08-25 00:12:14 +00:00
if ( * Cmd_Argv ( 1 ) )
2014-10-05 20:04:11 +00:00
FS_ReloadPackFilesFlags ( atoi ( Cmd_Argv ( 1 ) ) ) ;
else
FS_ReloadPackFilesFlags ( ~ 0 ) ;
Sys_UnlockMutex ( fs_thread_mutex ) ;
}
2015-09-07 14:34:39 +00:00
if ( host_initialized )
FS_BeginManifestUpdates ( ) ;
2005-10-31 00:52:03 +00:00
}
2019-02-23 09:29:20 +00:00
# ifdef NOSTDIO
qboolean Sys_DoDirectoryPrompt ( char * basepath , size_t basepathsize , const char * poshname , const char * savedname )
{
return false ;
}
qboolean Sys_FindGameData ( const char * poshname , const char * gamename , char * basepath , int basepathlen , qboolean allowprompts )
{
return false ;
}
2019-11-20 05:27:43 +00:00
static qboolean Sys_SteamHasFile ( char * basepath , int basepathlen , char * steamdir , char * fname ) //returns the base system path
{
return false ;
}
2019-02-23 09:29:20 +00:00
# elif defined(_WIN32) && !defined(FTE_SDL) && !defined(WINRT) && !defined(_XBOX)
2014-03-30 08:55:06 +00:00
# include "winquake.h"
2009-05-24 10:11:17 +00:00
# ifdef MINGW
# define byte BYTE //some versions of mingw headers are broken slightly. this lets it compile.
# endif
2010-08-16 02:03:02 +00:00
static qboolean Sys_SteamHasFile ( char * basepath , int basepathlen , char * steamdir , char * fname )
{
/*
Find where Valve ' s Steam distribution platform is installed .
Then take a look at that location for the relevent installed app .
*/
FILE * f ;
DWORD resultlen ;
HKEY key = NULL ;
2012-11-27 03:23:19 +00:00
2015-05-14 03:06:58 +00:00
if ( RegOpenKeyExW ( HKEY_CURRENT_USER , L " SOFTWARE \\ Valve \\ Steam " , 0 , STANDARD_RIGHTS_READ | KEY_QUERY_VALUE , & key ) = = ERROR_SUCCESS )
2010-08-16 02:03:02 +00:00
{
2015-05-14 03:06:58 +00:00
wchar_t suckysucksuck [ MAX_OSPATH ] ;
resultlen = sizeof ( suckysucksuck ) ;
RegQueryValueExW ( key , L " SteamPath " , NULL , NULL , ( void * ) suckysucksuck , & resultlen ) ;
2010-08-16 02:03:02 +00:00
RegCloseKey ( key ) ;
2015-05-14 03:06:58 +00:00
narrowen ( basepath , basepathlen , suckysucksuck ) ;
2010-08-16 02:03:02 +00:00
Q_strncatz ( basepath , va ( " /SteamApps/common/%s " , steamdir ) , basepathlen ) ;
2011-05-30 13:36:44 +00:00
if ( ( f = fopen ( va ( " %s/%s " , basepath , fname ) , " rb " ) ) )
2010-08-16 02:03:02 +00:00
{
fclose ( f ) ;
return true ;
}
}
return false ;
}
2015-04-14 23:12:17 +00:00
2018-12-28 00:04:36 +00:00
# ifdef HAVE_CLIENT
2015-04-14 23:12:17 +00:00
static INT CALLBACK StupidBrowseCallbackProc ( HWND hwnd , UINT uMsg , LPARAM lp , LPARAM pData )
{ //'stolen' from microsoft's knowledge base.
//required to work around microsoft being annoying.
2015-05-14 03:06:58 +00:00
wchar_t szDir [ MAX_PATH ] ;
wchar_t * foo ;
2015-04-14 23:12:17 +00:00
switch ( uMsg )
{
case BFFM_INITIALIZED :
2015-05-14 03:06:58 +00:00
if ( GetCurrentDirectoryW ( sizeof ( szDir ) / sizeof ( TCHAR ) , szDir ) )
2015-04-14 23:12:17 +00:00
{
// foo = strrchr(szDir, '\\');
// if (foo)
// *foo = 0;
// foo = strrchr(szDir, '\\');
// if (foo)
// *foo = 0;
2015-05-14 03:06:58 +00:00
SendMessageW ( hwnd , BFFM_SETSELECTION , TRUE , ( LPARAM ) szDir ) ;
2015-04-14 23:12:17 +00:00
}
break ;
2015-05-14 03:06:58 +00:00
case BFFM_VALIDATEFAILEDW :
break ; //FIXME: validate that the gamedir contains what its meant to
2015-04-14 23:12:17 +00:00
case BFFM_SELCHANGED :
2016-08-25 00:12:14 +00:00
if ( SHGetPathFromIDListW ( ( LPITEMIDLIST ) lp , szDir ) )
2015-04-14 23:12:17 +00:00
{
2015-05-14 03:06:58 +00:00
wchar_t statustxt [ MAX_OSPATH ] ;
2016-07-12 00:40:13 +00:00
while ( ( foo = wcschr ( szDir , ' \\ ' ) ) )
2015-04-14 23:12:17 +00:00
* foo = ' / ' ;
2015-05-14 03:06:58 +00:00
if ( pData )
_snwprintf ( statustxt , countof ( statustxt ) , L " %s/%s " , szDir , pData ) ;
else
_snwprintf ( statustxt , countof ( statustxt ) , L " %s " , szDir ) ;
statustxt [ countof ( statustxt ) - 1 ] = 0 ; //ms really suck.
SendMessageW ( hwnd , BFFM_SETSTATUSTEXT , 0 , ( LPARAM ) statustxt ) ;
2015-04-14 23:12:17 +00:00
}
break ;
}
return 0 ;
}
2015-06-04 06:15:14 +00:00
int MessageBoxU ( HWND hWnd , char * lpText , char * lpCaption , UINT uType ) ;
2015-04-14 23:12:17 +00:00
# endif
qboolean Sys_DoDirectoryPrompt ( char * basepath , size_t basepathsize , const char * poshname , const char * savedname )
{
2018-12-28 00:04:36 +00:00
# ifdef HAVE_CLIENT
2015-05-14 03:06:58 +00:00
wchar_t resultpath [ MAX_OSPATH ] ;
wchar_t title [ MAX_OSPATH ] ;
BROWSEINFOW bi ;
2015-04-14 23:12:17 +00:00
LPITEMIDLIST il ;
memset ( & bi , 0 , sizeof ( bi ) ) ;
bi . hwndOwner = mainwindow ; //note that this is usually still null
bi . pidlRoot = NULL ;
2015-05-14 03:06:58 +00:00
GetCurrentDirectoryW ( sizeof ( resultpath ) - 1 , resultpath ) ;
2015-04-14 23:12:17 +00:00
bi . pszDisplayName = resultpath ;
2015-05-14 03:06:58 +00:00
widen ( resultpath , sizeof ( resultpath ) , poshname ) ;
_snwprintf ( title , countof ( title ) , L " Please locate your existing %s installation " , resultpath ) ;
2015-06-04 06:15:14 +00:00
//force mouse to deactivate, so that we can actually see it.
INS_UpdateGrabs ( false , false ) ;
2015-05-14 03:06:58 +00:00
bi . lpszTitle = title ;
2015-04-14 23:12:17 +00:00
bi . ulFlags = BIF_RETURNONLYFSDIRS | BIF_STATUSTEXT ;
bi . lpfn = StupidBrowseCallbackProc ;
bi . lParam = 0 ; //(LPARAM)poshname;
bi . iImage = 0 ;
2016-08-25 00:12:14 +00:00
il = SHBrowseForFolderW ( & bi ) ;
2015-04-14 23:12:17 +00:00
if ( il )
{
2016-08-25 00:12:14 +00:00
SHGetPathFromIDListW ( il , resultpath ) ;
2015-04-14 23:12:17 +00:00
CoTaskMemFree ( il ) ;
2015-05-14 03:06:58 +00:00
narrowen ( basepath , basepathsize , resultpath ) ;
2015-04-14 23:12:17 +00:00
if ( savedname )
{
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
if ( MessageBoxU ( mainwindow , va ( " Would you like to save the location of %s as: \n %s " , poshname , basepath ) , " Save Instaltion path " , MB_YESNO | MB_DEFBUTTON2 ) = = IDYES )
2015-06-04 06:15:14 +00:00
MyRegSetValue ( HKEY_CURRENT_USER , " SOFTWARE \\ " FULLENGINENAME " \\ GamePaths " , savedname , REG_SZ , basepath , strlen ( basepath ) ) ;
2015-04-14 23:12:17 +00:00
}
return true ;
}
2015-04-21 21:49:08 +00:00
# endif
2015-04-14 23:12:17 +00:00
return false ;
}
2015-05-14 03:06:58 +00:00
DWORD GetFileAttributesU ( const char * lpFileName )
{
wchar_t wide [ MAX_OSPATH ] ;
widen ( wide , sizeof ( wide ) , lpFileName ) ;
return GetFileAttributesW ( wide ) ;
}
2015-04-14 23:12:17 +00:00
qboolean Sys_FindGameData ( const char * poshname , const char * gamename , char * basepath , int basepathlen , qboolean allowprompts )
2009-03-03 01:52:30 +00:00
{
2009-04-12 16:57:30 +00:00
# ifndef INVALID_FILE_ATTRIBUTES
# define INVALID_FILE_ATTRIBUTES ((DWORD)-1)
# endif
//first, try and find it in our game paths location
2015-05-14 03:06:58 +00:00
if ( MyRegGetStringValue ( HKEY_CURRENT_USER , " SOFTWARE \\ " FULLENGINENAME " \\ GamePaths " , gamename , basepath , basepathlen ) )
2009-04-12 16:57:30 +00:00
{
2015-05-14 03:06:58 +00:00
if ( GetFileAttributesU ( basepath ) ! = INVALID_FILE_ATTRIBUTES )
return true ;
2009-04-12 16:57:30 +00:00
}
2022-08-07 23:49:33 +00:00
if ( ! strcmp ( gamename , " quake " ) | | ! strcmp ( gamename , " afterquake " ) | | ! strcmp ( gamename , " netquake " ) | | ! strcmp ( gamename , " spasm " ) | | ! strcmp ( gamename , " fitz " ) | | ! strcmp ( gamename , " tenebrae " ) )
2009-03-03 01:52:30 +00:00
{
2013-10-29 17:38:22 +00:00
char * prefix [ ] =
{
" c:/quake/ " , //quite a lot of people have it in c:\quake, as that's the default install location from the quake cd.
" c:/games/quake/ " , //personally I use this
2015-05-14 03:06:58 +00:00
" c:/nquake/ " , //nquake seems to have moved out of programfiles now. woo.
2013-10-29 17:38:22 +00:00
# ifdef _WIN64
2015-05-14 03:06:58 +00:00
//quite a few people have nquake installed. FIXME: we need to an api function to read the directory for non-english-windows users.
2013-10-29 17:38:22 +00:00
va ( " %s/nQuake/ " , getenv ( " %ProgramFiles(x86)% " ) ) , //64bit builds should look in both places
va ( " %s/nQuake/ " , getenv ( " %ProgramFiles% " ) ) , //
# else
va ( " %s/nQuake/ " , getenv ( " %ProgramFiles% " ) ) , //32bit builds will get the x86 version anyway.
# endif
NULL
} ;
int i ;
2010-08-16 02:03:02 +00:00
2009-03-03 01:52:30 +00:00
//try and find it via steam
//reads HKEY_LOCAL_MACHINE\SOFTWARE\Valve\Steam\InstallPath
//append SteamApps\common\quake
//use it if we find winquake.exe there
2010-08-16 02:03:02 +00:00
if ( Sys_SteamHasFile ( basepath , basepathlen , " quake " , " Winquake.exe " ) )
return true ;
2009-03-03 01:52:30 +00:00
//well, okay, so they don't have quake installed from steam.
2013-10-29 17:38:22 +00:00
//check various 'unadvertised' paths
for ( i = 0 ; prefix [ i ] ; i + + )
2009-03-03 01:52:30 +00:00
{
2013-10-29 17:38:22 +00:00
char syspath [ MAX_OSPATH ] ;
Q_snprintfz ( syspath , sizeof ( syspath ) , " %sid1/pak0.pak " , prefix [ i ] ) ;
2015-05-14 03:06:58 +00:00
if ( GetFileAttributesU ( syspath ) ! = INVALID_FILE_ATTRIBUTES )
{
2015-06-12 14:44:50 +00:00
Q_strncpyz ( basepath , prefix [ i ] , basepathlen ) ;
2015-05-14 03:06:58 +00:00
return true ;
}
Q_snprintfz ( syspath , sizeof ( syspath ) , " %squake.exe " , prefix [ i ] ) ;
if ( GetFileAttributesU ( syspath ) ! = INVALID_FILE_ATTRIBUTES )
2013-10-29 17:38:22 +00:00
{
2015-06-12 14:44:50 +00:00
Q_strncpyz ( basepath , prefix [ i ] , basepathlen ) ;
2013-10-29 17:38:22 +00:00
return true ;
}
2009-03-03 01:52:30 +00:00
}
}
2013-06-23 03:59:48 +00:00
if ( ! strcmp ( gamename , " quake2 " ) )
2009-03-03 01:52:30 +00:00
{
2010-08-16 02:03:02 +00:00
//look for HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\Quake2_exe\Path
2015-05-14 03:06:58 +00:00
if ( MyRegGetStringValue ( HKEY_LOCAL_MACHINE , " SOFTWARE \\ Microsoft \\ Windows \\ CurrentVersion \\ App Paths \\ Quake2_exe " , " Path " , basepath , basepathlen ) )
2009-03-03 01:52:30 +00:00
{
2015-05-14 03:06:58 +00:00
if ( GetFileAttributesU ( va ( " %s/quake2.exe " , basepath ) ) ! = INVALID_FILE_ATTRIBUTES )
2009-03-03 01:52:30 +00:00
return true ;
}
2010-08-16 02:03:02 +00:00
if ( Sys_SteamHasFile ( basepath , basepathlen , " quake 2 " , " quake2.exe " ) )
return true ;
}
if ( ! strcmp ( gamename , " et " ) )
{
//reads HKEY_LOCAL_MACHINE\SOFTWARE\Activision\Wolfenstein - Enemy Territory
2015-05-14 03:06:58 +00:00
if ( MyRegGetStringValue ( HKEY_LOCAL_MACHINE , " SOFTWARE \\ Activision \\ Wolfenstein - Enemy Territory " , " InstallPath " , basepath , basepathlen ) )
2009-03-03 01:52:30 +00:00
{
2015-05-14 03:06:58 +00:00
// if (GetFileAttributesU(va("%s/ET.exe", basepath) != INVALID_FILE_ATTRIBUTES)
// return true;
2010-08-16 02:03:02 +00:00
return true ;
2009-03-03 01:52:30 +00:00
}
}
2013-06-23 03:59:48 +00:00
if ( ! strcmp ( gamename , " quake3 " ) )
2009-03-03 01:52:30 +00:00
{
//reads HKEY_LOCAL_MACHINE\SOFTWARE\id\Quake III Arena\InstallPath
2015-05-14 03:06:58 +00:00
if ( MyRegGetStringValue ( HKEY_LOCAL_MACHINE , " SOFTWARE \\ id \\ Quake III Arena " , " InstallPath " , basepath , basepathlen ) )
2009-03-03 01:52:30 +00:00
{
2015-05-14 03:06:58 +00:00
if ( GetFileAttributesU ( va ( " %s/quake3.exe " , basepath ) ) ! = INVALID_FILE_ATTRIBUTES )
2010-08-16 02:03:02 +00:00
return true ;
2009-03-03 01:52:30 +00:00
}
2010-08-16 02:03:02 +00:00
if ( Sys_SteamHasFile ( basepath , basepathlen , " quake 3 arena " , " quake3.exe " ) )
return true ;
2009-03-03 01:52:30 +00:00
}
2010-03-14 14:35:56 +00:00
if ( ! strcmp ( gamename , " wop " ) )
{
2015-05-14 03:06:58 +00:00
if ( MyRegGetStringValue ( HKEY_LOCAL_MACHINE , " SOFTWARE \\ World Of Padman " , " Path " , basepath , basepathlen ) )
2010-03-14 14:35:56 +00:00
return true ;
}
2009-03-03 01:52:30 +00:00
/*
if ( ! strcmp ( gamename , " d3 " ) )
{
//reads HKEY_LOCAL_MACHINE\SOFTWARE\id\Doom 3\InstallPath
2015-05-14 03:06:58 +00:00
if ( MyRegGetStringValue ( HKEY_LOCAL_MACHINE , L " SOFTWARE \\ id \\ Doom 3 " , " InstallPath " , basepath , basepathlen ) )
2009-03-03 01:52:30 +00:00
return true ;
}
*/
2013-06-23 02:17:02 +00:00
if ( ! strcmp ( gamename , " hexen2 " ) | | ! strcmp ( gamename , " h2mp " ) )
2009-03-03 01:52:30 +00:00
{
//append SteamApps\common\hexen 2
2011-03-09 03:42:30 +00:00
if ( Sys_SteamHasFile ( basepath , basepathlen , " hexen 2 " , " glh2.exe " ) )
2010-08-16 02:03:02 +00:00
return true ;
2009-03-03 01:52:30 +00:00
}
2023-07-09 18:41:24 +00:00
# if defined(HAVE_CLIENT) //this is *really* unfortunate, but doing this crashes the browser
2015-04-14 23:12:17 +00:00
if ( allowprompts & & poshname & & * gamename & & ! COM_CheckParm ( " -manifest " ) )
{
if ( Sys_DoDirectoryPrompt ( basepath , basepathlen , poshname , gamename ) )
2009-04-12 16:57:30 +00:00
return true ;
}
2009-04-19 00:50:42 +00:00
# endif
2009-04-12 16:57:30 +00:00
2009-03-03 01:52:30 +00:00
return false ;
}
# else
2016-07-21 19:27:59 +00:00
# if defined(__linux__) || defined(__unix__) || defined(__apple__)
2012-11-30 02:50:50 +00:00
# include <sys/stat.h>
2017-08-14 16:38:44 +00:00
2022-01-08 10:00:55 +00:00
static qboolean Sys_SteamLibraryHasFile ( char * basepath , int basepathlen , char * librarypath , char * steamdir , char * fname ) //returns the base system path
{
Q_snprintfz ( basepath , basepathlen , " %s/steamapps/common/%s " , librarypath , steamdir ) ;
if ( 0 = = access ( va ( " %s/%s " , basepath , fname ) , R_OK ) )
return true ;
return false ;
}
static qboolean Sys_SteamParseLibraries ( char * basepath , int basepathlen , char * libraryfile , char * steamdir , char * fname ) //returns the base system path
{
qboolean success = false ;
char key [ 1024 ] , * end ;
char value [ 1024 ] ;
char * lib = libraryfile ;
int depth = 0 ;
if ( ! libraryfile )
return false ;
lib = COM_ParseCString ( lib , key , sizeof ( key ) , NULL ) ;
lib = COM_ParseCString ( lib , value , sizeof ( value ) , NULL ) ;
if ( ! strcmp ( key , " libraryfolders " ) & & ! strcmp ( value , " { " ) )
{
depth = 1 ;
while ( lib & & ! success )
{
lib = COM_ParseCString ( lib , key , sizeof ( key ) , NULL ) ;
if ( ! strcmp ( key , " } " ) )
{
if ( ! - - depth )
break ;
continue ;
}
lib = COM_ParseCString ( lib , value , sizeof ( value ) , NULL ) ;
if ( ! strcmp ( value , " { " ) )
depth + + ;
else if ( depth = = 1 & & * key )
{ //older format...
strtoul ( key , & end , 10 ) ;
if ( ! * end )
{
//okay, its strictly base10
if ( Sys_SteamLibraryHasFile ( basepath , basepathlen , value , steamdir , fname ) )
success = true ;
}
}
else if ( depth = = 2 & & ! strcmp ( key , " path " ) )
{ //newer format...
if ( Sys_SteamLibraryHasFile ( basepath , basepathlen , value , steamdir , fname ) )
success = true ;
}
}
}
FS_FreeFile ( libraryfile ) ;
return success ;
}
Too many changes, sorry.
Change revision displays, use the SVN commit date instead of using __DATE__ (when there's no local changes). This should allow reproducible builds.
Added s_al_disable cvar, to block openal and all the various problems people have had with it, without having to name an explicit fallback (which would vary by system).
Add mastervolume cvar (for ss).
Add r_shadows 2 (aka fake shadows - for ss).
Add scr_loadingscreen_aspect -1 setting, to disable levelshots entirely, also disables the progress bar (for ss).
Better support for some effectinfo hacks (for ss).
Added dpcompat_nocsqcwarnings (because of lazy+buggy mods like ss).
Rework the dpcsqc versions of project+unproject builtins for better compat (for ss).
Added dpcompat_csqcinputeventtypes to block unexpected csqc input events (for ss).
Better compat with DP's loadfont console command (for ss).
Added dpcompat_smallerfonts cvar to replicate a DP bug (for ss).
Detect dp's m_draw extension, to work around it (for ss).
Cvar dpcompat_ignoremodificationtimes added. A value of 0 favour the most recently modified file, 1 will use DP-like alphabetically sorted preferences (for ss).
loadfont builtin can now accept outline=1 in the sizes arg for slightly more readable fonts.
Fix bbox calcs for rotated entities, fix needed for r_ignorenetpvs 0.
Hackily parse emoji.json to provide :poop: etc suggestions.
Skip prediction entirely when there's no local entity info. This fixes stair-smoothing in xonotic.
screenshot_cubemap will now capture half-float images when saving to ktx or dds files.
Fix support for xcf files larger than 4gb, mostly to avoid compiler warnings.
Fixed size of gfx/loading.lmp when replacement textures are used.
Added mipmap support for rg8 and l8a8 textures.
r_hdr_framebuffer cvar updated to support format names instead of random negative numbers. Description updated to name some interesting ones.
Perform autoupdate _checks_ ONLY with explicit user confirmation (actual updating already needed user confirmation, but this extra step should reduce the chances of us getting wrongly accused of exfiltrating user data if we're run in a sandbox - we ONLY ever included the updating engine's version in the checks, though there's nothing we can do to avoid sending the user's router's IP).
Removed the 'summon satan all over your harddrive' quit message, in case paranoid security researchers are idiots and don't bother doing actual research.
Removed the triptohell.info and fte.triptohell.info certificates, they really need to stop being self-signed. The updates domain is still self-signed for autoupdates.
Video drivers are now able to report supported video resolutions, visible to menuqc. Currently only works with SDL2 builds.
Added setmousepos builtin. Should work with glx+win32 build.
VF_SKYROOM_CAMERA can now accept an extra two args, setviewprop(VF_SKYROOM_CAMERA, org, axis, degrees).
Removed v_skyroom_origin+v_skyroom_orientation cvars in favour just v_skyroom, which should make it behave more like the 'fog' command (used when csqc isn't overriding).
Added R_EndPolygonRibbon builtin to make it faster+easier to generate textured ribbon/cable/etc wide lines (for TW).
sdl: Fix up sys_sdl.c's file enumeration to support wildcards in directories.
edit command now displays end1.bin/end2.bin correctly, because we can.
Finally add support for f_modified - though ruleset_allow_larger_models and ruleset_allow_overlong_sounds generally make it redundant.
Fix threading race condition in sha1 lookups.
Updated f_ruleset to include the same extra flags reported by ezquake.
A mod's default.fmf file can now contain an eg 'mainconfig config.cfg' line (to explicitly set the main config saved with cfg_save_auto 1 etc).
fmf: basegame steam:GameName/GameDir can be used to try to load a mod directory from an installed steam game. The resulting gamedir will be read-only.
HOMEDIR CHANGE: use homedirs only if the basedir cannot be written or a homedir already exists, which should further reduce the probability of microsoft randomly uploading our data to their cloud (but mostly because its annoying to never know where your data is written).
Fixed buf_cvarlist, should work in xonotic now, and without segfaults.
Added an extra arg to URI_Get_Callback calls - the response size, also changed the tempstring to contain all bytes of the response, you need to be careful about nulls though.
Try to work around nvidia's forced-panning bug on x11 when changing video modes. This might screw with other programs.
sdl: support custom icons.
sdl: support choosing a specific display.
Added some documentation to menuqc builtins.
menusys: use outlines for slightly more readable fonts.
menusys: switch vid_width and vid_height combos into a single video mode combo to set both according to reported video modes.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5581 fc73d0e0-1445-4013-8a0c-d673dee63da5
2019-11-20 03:09:50 +00:00
static qboolean Sys_SteamHasFile ( char * basepath , int basepathlen , char * steamdir , char * fname ) //returns the base system path
2017-08-14 16:38:44 +00:00
{
/*
Find where Valve ' s Steam distribution platform is installed .
Then take a look at that location for the relevent installed app .
*/
Too many changes, sorry.
Change revision displays, use the SVN commit date instead of using __DATE__ (when there's no local changes). This should allow reproducible builds.
Added s_al_disable cvar, to block openal and all the various problems people have had with it, without having to name an explicit fallback (which would vary by system).
Add mastervolume cvar (for ss).
Add r_shadows 2 (aka fake shadows - for ss).
Add scr_loadingscreen_aspect -1 setting, to disable levelshots entirely, also disables the progress bar (for ss).
Better support for some effectinfo hacks (for ss).
Added dpcompat_nocsqcwarnings (because of lazy+buggy mods like ss).
Rework the dpcsqc versions of project+unproject builtins for better compat (for ss).
Added dpcompat_csqcinputeventtypes to block unexpected csqc input events (for ss).
Better compat with DP's loadfont console command (for ss).
Added dpcompat_smallerfonts cvar to replicate a DP bug (for ss).
Detect dp's m_draw extension, to work around it (for ss).
Cvar dpcompat_ignoremodificationtimes added. A value of 0 favour the most recently modified file, 1 will use DP-like alphabetically sorted preferences (for ss).
loadfont builtin can now accept outline=1 in the sizes arg for slightly more readable fonts.
Fix bbox calcs for rotated entities, fix needed for r_ignorenetpvs 0.
Hackily parse emoji.json to provide :poop: etc suggestions.
Skip prediction entirely when there's no local entity info. This fixes stair-smoothing in xonotic.
screenshot_cubemap will now capture half-float images when saving to ktx or dds files.
Fix support for xcf files larger than 4gb, mostly to avoid compiler warnings.
Fixed size of gfx/loading.lmp when replacement textures are used.
Added mipmap support for rg8 and l8a8 textures.
r_hdr_framebuffer cvar updated to support format names instead of random negative numbers. Description updated to name some interesting ones.
Perform autoupdate _checks_ ONLY with explicit user confirmation (actual updating already needed user confirmation, but this extra step should reduce the chances of us getting wrongly accused of exfiltrating user data if we're run in a sandbox - we ONLY ever included the updating engine's version in the checks, though there's nothing we can do to avoid sending the user's router's IP).
Removed the 'summon satan all over your harddrive' quit message, in case paranoid security researchers are idiots and don't bother doing actual research.
Removed the triptohell.info and fte.triptohell.info certificates, they really need to stop being self-signed. The updates domain is still self-signed for autoupdates.
Video drivers are now able to report supported video resolutions, visible to menuqc. Currently only works with SDL2 builds.
Added setmousepos builtin. Should work with glx+win32 build.
VF_SKYROOM_CAMERA can now accept an extra two args, setviewprop(VF_SKYROOM_CAMERA, org, axis, degrees).
Removed v_skyroom_origin+v_skyroom_orientation cvars in favour just v_skyroom, which should make it behave more like the 'fog' command (used when csqc isn't overriding).
Added R_EndPolygonRibbon builtin to make it faster+easier to generate textured ribbon/cable/etc wide lines (for TW).
sdl: Fix up sys_sdl.c's file enumeration to support wildcards in directories.
edit command now displays end1.bin/end2.bin correctly, because we can.
Finally add support for f_modified - though ruleset_allow_larger_models and ruleset_allow_overlong_sounds generally make it redundant.
Fix threading race condition in sha1 lookups.
Updated f_ruleset to include the same extra flags reported by ezquake.
A mod's default.fmf file can now contain an eg 'mainconfig config.cfg' line (to explicitly set the main config saved with cfg_save_auto 1 etc).
fmf: basegame steam:GameName/GameDir can be used to try to load a mod directory from an installed steam game. The resulting gamedir will be read-only.
HOMEDIR CHANGE: use homedirs only if the basedir cannot be written or a homedir already exists, which should further reduce the probability of microsoft randomly uploading our data to their cloud (but mostly because its annoying to never know where your data is written).
Fixed buf_cvarlist, should work in xonotic now, and without segfaults.
Added an extra arg to URI_Get_Callback calls - the response size, also changed the tempstring to contain all bytes of the response, you need to be careful about nulls though.
Try to work around nvidia's forced-panning bug on x11 when changing video modes. This might screw with other programs.
sdl: support custom icons.
sdl: support choosing a specific display.
Added some documentation to menuqc builtins.
menusys: use outlines for slightly more readable fonts.
menusys: switch vid_width and vid_height combos into a single video mode combo to set both according to reported video modes.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5581 fc73d0e0-1445-4013-8a0c-d673dee63da5
2019-11-20 03:09:50 +00:00
char * userhome = getenv ( " HOME " ) ;
if ( userhome & & * userhome )
2017-08-14 16:38:44 +00:00
{
2022-01-08 10:00:55 +00:00
Q_snprintfz ( basepath , basepathlen , " %s/.steam/steam/steamapps/libraryfolders.vdf " , userhome ) ;
if ( Sys_SteamParseLibraries ( basepath , basepathlen , FS_MallocFile ( basepath , FS_SYSTEM , NULL ) , steamdir , fname ) )
2017-08-14 16:38:44 +00:00
return true ;
2022-01-08 10:00:55 +00:00
Q_snprintfz ( basepath , basepathlen , " %s/.local/share/Steam/SteamApps/libraryfolders.vdf " , userhome ) ;
if ( Sys_SteamParseLibraries ( basepath , basepathlen , FS_MallocFile ( basepath , FS_SYSTEM , NULL ) , steamdir , fname ) )
2017-08-14 16:38:44 +00:00
return true ;
}
return false ;
}
Too many changes, sorry.
Change revision displays, use the SVN commit date instead of using __DATE__ (when there's no local changes). This should allow reproducible builds.
Added s_al_disable cvar, to block openal and all the various problems people have had with it, without having to name an explicit fallback (which would vary by system).
Add mastervolume cvar (for ss).
Add r_shadows 2 (aka fake shadows - for ss).
Add scr_loadingscreen_aspect -1 setting, to disable levelshots entirely, also disables the progress bar (for ss).
Better support for some effectinfo hacks (for ss).
Added dpcompat_nocsqcwarnings (because of lazy+buggy mods like ss).
Rework the dpcsqc versions of project+unproject builtins for better compat (for ss).
Added dpcompat_csqcinputeventtypes to block unexpected csqc input events (for ss).
Better compat with DP's loadfont console command (for ss).
Added dpcompat_smallerfonts cvar to replicate a DP bug (for ss).
Detect dp's m_draw extension, to work around it (for ss).
Cvar dpcompat_ignoremodificationtimes added. A value of 0 favour the most recently modified file, 1 will use DP-like alphabetically sorted preferences (for ss).
loadfont builtin can now accept outline=1 in the sizes arg for slightly more readable fonts.
Fix bbox calcs for rotated entities, fix needed for r_ignorenetpvs 0.
Hackily parse emoji.json to provide :poop: etc suggestions.
Skip prediction entirely when there's no local entity info. This fixes stair-smoothing in xonotic.
screenshot_cubemap will now capture half-float images when saving to ktx or dds files.
Fix support for xcf files larger than 4gb, mostly to avoid compiler warnings.
Fixed size of gfx/loading.lmp when replacement textures are used.
Added mipmap support for rg8 and l8a8 textures.
r_hdr_framebuffer cvar updated to support format names instead of random negative numbers. Description updated to name some interesting ones.
Perform autoupdate _checks_ ONLY with explicit user confirmation (actual updating already needed user confirmation, but this extra step should reduce the chances of us getting wrongly accused of exfiltrating user data if we're run in a sandbox - we ONLY ever included the updating engine's version in the checks, though there's nothing we can do to avoid sending the user's router's IP).
Removed the 'summon satan all over your harddrive' quit message, in case paranoid security researchers are idiots and don't bother doing actual research.
Removed the triptohell.info and fte.triptohell.info certificates, they really need to stop being self-signed. The updates domain is still self-signed for autoupdates.
Video drivers are now able to report supported video resolutions, visible to menuqc. Currently only works with SDL2 builds.
Added setmousepos builtin. Should work with glx+win32 build.
VF_SKYROOM_CAMERA can now accept an extra two args, setviewprop(VF_SKYROOM_CAMERA, org, axis, degrees).
Removed v_skyroom_origin+v_skyroom_orientation cvars in favour just v_skyroom, which should make it behave more like the 'fog' command (used when csqc isn't overriding).
Added R_EndPolygonRibbon builtin to make it faster+easier to generate textured ribbon/cable/etc wide lines (for TW).
sdl: Fix up sys_sdl.c's file enumeration to support wildcards in directories.
edit command now displays end1.bin/end2.bin correctly, because we can.
Finally add support for f_modified - though ruleset_allow_larger_models and ruleset_allow_overlong_sounds generally make it redundant.
Fix threading race condition in sha1 lookups.
Updated f_ruleset to include the same extra flags reported by ezquake.
A mod's default.fmf file can now contain an eg 'mainconfig config.cfg' line (to explicitly set the main config saved with cfg_save_auto 1 etc).
fmf: basegame steam:GameName/GameDir can be used to try to load a mod directory from an installed steam game. The resulting gamedir will be read-only.
HOMEDIR CHANGE: use homedirs only if the basedir cannot be written or a homedir already exists, which should further reduce the probability of microsoft randomly uploading our data to their cloud (but mostly because its annoying to never know where your data is written).
Fixed buf_cvarlist, should work in xonotic now, and without segfaults.
Added an extra arg to URI_Get_Callback calls - the response size, also changed the tempstring to contain all bytes of the response, you need to be careful about nulls though.
Try to work around nvidia's forced-panning bug on x11 when changing video modes. This might screw with other programs.
sdl: support custom icons.
sdl: support choosing a specific display.
Added some documentation to menuqc builtins.
menusys: use outlines for slightly more readable fonts.
menusys: switch vid_width and vid_height combos into a single video mode combo to set both according to reported video modes.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5581 fc73d0e0-1445-4013-8a0c-d673dee63da5
2019-11-20 03:09:50 +00:00
# else
static qboolean Sys_SteamHasFile ( char * basepath , int basepathlen , char * steamdir , char * fname ) //returns the base system path
{
return false ;
}
2012-11-30 02:50:50 +00:00
# endif
2018-10-11 10:31:23 +00:00
qboolean Sys_DoDirectoryPrompt ( char * basepath , size_t basepathsize , const char * poshname , const char * savedname )
{
return false ;
}
//#define Sys_DoDirectoryPrompt(bp,bps,game,savename) false
2023-04-21 11:36:13 +00:00
# if defined(__linux__) || defined(__unix__) || defined(__apple__)
static qboolean Sys_XDGHasDirectory ( char * basepath , int basepathlen , const char * pregame , const char * gamename , const char * postgame )
{ //returns true if the gamedir can be found, and fills in the basepath.
struct stat sb ;
const char * dirs = getenv ( " XDG_DATA_DIRS " ) , * s ;
char dir [ MAX_OSPATH ] ;
if ( ! dirs | | ! * dirs )
dirs = " /usr/local/share:/usr/share " ;
while ( dirs & & * dirs )
{
dirs = COM_ParseStringSetSep ( dirs , ' : ' , dir , sizeof ( dir ) ) ;
s = va ( " %s/%s%s%s/ " , dir , pregame , gamename , postgame ) ;
if ( stat ( s , & sb ) = = 0 )
{
if ( S_ISDIR ( sb . st_mode ) )
{
Q_strncpyz ( basepath , s , basepathlen ) ;
return true ;
}
}
}
return false ;
}
# endif
//FIXME: replace with a callback version, for multiple results.
2015-04-14 23:12:17 +00:00
qboolean Sys_FindGameData ( const char * poshname , const char * gamename , char * basepath , int basepathlen , qboolean allowprompts )
2009-03-03 01:52:30 +00:00
{
2016-07-21 19:27:59 +00:00
# if defined(__linux__) || defined(__unix__) || defined(__apple__)
2016-10-22 07:06:51 +00:00
if ( ! * gamename )
gamename = " quake " ; //just a paranoia fallback, shouldn't be needed.
2022-08-07 23:49:33 +00:00
if ( ! strcmp ( gamename , " quake_rerel " ) )
if ( Sys_SteamHasFile ( basepath , basepathlen , " Quake/rerelease " , " id1/pak0.pak " ) )
return true ;
if ( ! strcmp ( gamename , " quake " ) | | ! strcmp ( gamename , " afterquake " ) | | ! strcmp ( gamename , " netquake " ) | | ! strcmp ( gamename , " spasm " ) | | ! strcmp ( gamename , " fitz " ) | | ! strcmp ( gamename , " tenebrae " ) )
2012-11-30 02:50:50 +00:00
{
2023-04-03 00:33:35 +00:00
if ( Sys_SteamHasFile ( basepath , basepathlen , " Quake " , " Id1/PAK0.PAK " ) ) //dos legacies need to die.
return true ;
2022-08-07 23:49:33 +00:00
if ( Sys_SteamHasFile ( basepath , basepathlen , " Quake " , " id1/PAK0.PAK " ) ) //dos legacies need to die.
return true ;
if ( Sys_SteamHasFile ( basepath , basepathlen , " Quake " , " id1/pak0.pak " ) ) //people may have tried to sanitise it already.
2017-08-14 16:38:44 +00:00
return true ;
2023-04-21 11:36:13 +00:00
if ( Sys_XDGHasDirectory ( basepath , basepathlen , " " , gamename , " " ) )
return true ;
2012-11-30 02:50:50 +00:00
}
2017-08-14 16:38:44 +00:00
else if ( ! strcmp ( gamename , " quake2 " ) )
{
if ( Sys_SteamHasFile ( basepath , basepathlen , " quake 2 " , " baseq2/pak0.pak " ) )
return true ;
}
2018-08-23 06:03:31 +00:00
else if ( ! strcmp ( gamename , " hexen2 " ) | | ! strcmp ( gamename , " h2mp " ) | | ! strcmp ( gamename , " portals " ) )
2017-08-14 16:38:44 +00:00
{
if ( Sys_SteamHasFile ( basepath , basepathlen , " hexen 2 " , " data/pak0.pak " ) )
return true ;
2018-08-23 06:03:31 +00:00
gamename = " hexen2 " ;
2017-08-14 16:38:44 +00:00
}
2023-04-21 11:36:13 +00:00
if ( Sys_XDGHasDirectory ( basepath , basepathlen , " games/ " , gamename , " " ) )
return true ;
if ( Sys_XDGHasDirectory ( basepath , basepathlen , " " , gamename , " " ) )
return true ;
if ( Sys_XDGHasDirectory ( basepath , basepathlen , " games/ " , gamename , " -demo " ) )
return true ;
if ( Sys_XDGHasDirectory ( basepath , basepathlen , " " , gamename , " -demo " ) )
return true ;
2018-10-11 10:31:23 +00:00
2023-07-09 18:41:24 +00:00
# if defined(HAVE_CLIENT) //this is *really* unfortunate, but doing this crashes the browser
2018-10-11 10:31:23 +00:00
if ( allowprompts & & poshname & & * gamename & & ! COM_CheckParm ( " -manifest " ) )
{
if ( Sys_DoDirectoryPrompt ( basepath , basepathlen , poshname , gamename ) )
return true ;
}
# endif
2012-11-27 03:23:19 +00:00
# endif
2009-03-03 01:52:30 +00:00
return false ;
}
# endif
2014-10-05 20:04:11 +00:00
static void FS_FreePaths ( void )
2009-04-01 22:03:56 +00:00
{
searchpath_t * next ;
2014-10-05 20:04:11 +00:00
FS_FlushFSHashReally ( true ) ;
2009-04-01 22:03:56 +00:00
//
// free up any current game dir info
//
while ( com_searchpaths )
{
2013-06-23 02:17:02 +00:00
com_searchpaths - > handle - > ClosePath ( com_searchpaths - > handle ) ;
2009-04-01 22:03:56 +00:00
next = com_searchpaths - > next ;
Z_Free ( com_searchpaths ) ;
com_searchpaths = next ;
}
com_fschanged = true ;
2012-07-05 19:42:36 +00:00
if ( filesystemhash . numbuckets )
{
BZ_Free ( filesystemhash . bucket ) ;
filesystemhash . bucket = NULL ;
filesystemhash . numbuckets = 0 ;
}
2013-06-23 02:17:02 +00:00
FS_Manifest_Free ( fs_manifest ) ;
fs_manifest = NULL ;
2009-04-01 22:03:56 +00:00
}
2014-10-05 20:04:11 +00:00
void FS_Shutdown ( void )
{
2016-07-12 00:40:13 +00:00
if ( ! fs_thread_mutex )
return ;
2020-04-19 01:23:32 +00:00
Mods_FlushModList ( ) ;
2018-12-28 00:04:36 +00:00
# ifdef PACKAGEMANAGER
2023-04-21 11:36:13 +00:00
PM_ManifestChanged ( NULL ) ;
2018-12-28 00:04:36 +00:00
# endif
2014-10-05 20:04:11 +00:00
FS_FreePaths ( ) ;
2016-07-12 00:40:13 +00:00
Sys_DestroyMutex ( fs_thread_mutex ) ;
fs_thread_mutex = NULL ;
2014-12-23 15:26:42 +00:00
2014-12-29 02:35:10 +00:00
Cvar_SetEngineDefault ( & fs_gamename , NULL ) ;
Cvar_SetEngineDefault ( & com_protocolname , NULL ) ;
2014-10-05 20:04:11 +00:00
}
2009-04-01 22:03:56 +00:00
2014-04-12 03:31:59 +00:00
//returns false if the directory is not suitable.
//returns true if it contains a known package. if we don't actually know of any packages that it should have, we just have to assume that its okay.
2023-04-21 11:36:13 +00:00
qboolean FS_DirHasAPackage ( char * basedir , ftemanifest_t * man )
2013-10-29 17:38:22 +00:00
{
2014-04-12 03:31:59 +00:00
qboolean defaultret = true ;
2013-10-29 17:38:22 +00:00
int j ;
vfsfile_t * f ;
2015-04-14 23:12:17 +00:00
f = VFSOS_Open ( va ( " %sdefault.fmf " , basedir ) , " rb " ) ;
if ( f )
{
VFS_CLOSE ( f ) ;
return true ;
}
2013-10-29 17:38:22 +00:00
for ( j = 0 ; j < sizeof ( fs_manifest - > package ) / sizeof ( fs_manifest - > package [ 0 ] ) ; j + + )
{
if ( ! man - > package [ j ] . path )
continue ;
2014-04-12 03:31:59 +00:00
defaultret = false ;
2013-10-29 17:38:22 +00:00
f = VFSOS_Open ( va ( " %s%s " , basedir , man - > package [ j ] . path ) , " rb " ) ;
if ( f )
{
VFS_CLOSE ( f ) ;
return true ;
}
}
2014-04-12 03:31:59 +00:00
return defaultret ;
2013-10-29 17:38:22 +00:00
}
2018-10-11 10:31:23 +00:00
//false stops the search (and returns that value to FS_DirHasGame)
2023-01-09 05:14:57 +00:00
static int QDECL FS_DirDoesHaveGame ( const char * fname , qofs_t fsize , time_t modtime , void * ctx , searchpathfuncs_t * subdir )
2018-10-11 10:31:23 +00:00
{
return false ;
}
2013-06-23 02:17:02 +00:00
//just check each possible file, see if one is there.
2016-11-20 20:52:41 +00:00
static qboolean FS_DirHasGame ( const char * basedir , int gameidx )
2012-07-05 19:42:36 +00:00
{
2013-06-23 02:17:02 +00:00
int j ;
2023-07-02 03:19:01 +00:00
# if defined(_WIN32) || defined(NOSTDIO) || !defined(_POSIX_C_SOURCE)
# else
2023-04-03 00:33:35 +00:00
char realpath [ MAX_OSPATH ] ;
2023-07-02 03:19:01 +00:00
# endif
Added sys_openfile console command(and menu option) to web and flatpak(via cmake+dbus) builds, to 'install' packages on sandboxed systems a bit more easily.
Cmake: Add FTE_WERROR option, defaults to true in debug builds and off in release builds (in case future compilers have issues).
Cmake: Pull in libXscreensaver so we don't get interrupted by screensavers when playing demos.
Make: Added `make webcl-rel` for a web build without server bloat (eg for sites focused on demo playback. Yes, this means you XantoM).
fteqcc: Include the decompiler in fteqcc (non-gui) builds ('-d' arg).
fteqcc: Decompiler can now mostly handle hexen2 mods without any unknown opcodes.
Allow ezHud and OpenSSL to be compiled as in-engine plugins, potentially for web and windows ports respectively.
Web: Fix support for ogg vorbis. Add support for voip.
Web: Added basic support for WebXR.
QTV: Don't try seeking on unseekable qtv streams. Don't spam when developer 1 is set.
QTV: add support for some eztv extensions.
MVD: added hack to use ktx's vweps in mvd where mvdsv doesn't bother to record the info.
qwfwd: hack around a hack in qwfwd, allowing it to work again.
recording: favour qwd in single player, instead of mvd.
Protocol: reduce client memory used for precache names. Bump maximum precache counts - some people are just abusive, yes you Orl.
hexen2: add enough clientside protocol compat to play the demo included with h2mp. lacks effects.
in_xflip: restored this setting.
fs_hidesyspaths: new cvar, defaults to enabled so you won't find your username or whatever turning up in screenshots or the like. change it to 0 before debuging stuff eg via 'path'.
gl_overbright_models: Added cvar to match QS.
netchan: Added MTU determination, we'll no longer fail to connect when routers stupidly drop icmp packets.
Win: try a few other versions of xinput too.
CSQC: Added a CSQC_GenerateMaterial function, to give the csqc a chance to generate custom materials.
MenuQC: Added support for the skeletal objects API.
2024-04-09 17:13:59 +00:00
char cached [ MAX_OSPATH ] ;
2017-02-19 00:15:42 +00:00
//none listed, just assume its correct.
if ( ! gamemode_info [ gameidx ] . auniquefile [ 0 ] )
return true ;
2013-06-23 02:17:02 +00:00
for ( j = 0 ; j < 4 ; j + + )
2012-07-05 19:42:36 +00:00
{
2013-06-23 02:17:02 +00:00
if ( ! gamemode_info [ gameidx ] . auniquefile [ j ] )
continue ; //no more
2023-07-02 03:19:01 +00:00
# if defined(_WIN32) || defined(NOSTDIO) || !defined(_POSIX_C_SOURCE) //systems that lack a working 'access' function.
2018-10-11 10:31:23 +00:00
if ( ! Sys_EnumerateFiles ( basedir , gamemode_info [ gameidx ] . auniquefile [ j ] , FS_DirDoesHaveGame , NULL , NULL ) )
return true ; //search was cancelled by the callback, so it actually got called.
2023-04-03 00:33:35 +00:00
# else
if ( FS_FixupFileCase ( realpath , sizeof ( realpath ) , basedir , gamemode_info [ gameidx ] . auniquefile [ j ] , false ) & & access ( realpath , R_OK ) = = 0 )
return true ; //something readable.
# endif
Added sys_openfile console command(and menu option) to web and flatpak(via cmake+dbus) builds, to 'install' packages on sandboxed systems a bit more easily.
Cmake: Add FTE_WERROR option, defaults to true in debug builds and off in release builds (in case future compilers have issues).
Cmake: Pull in libXscreensaver so we don't get interrupted by screensavers when playing demos.
Make: Added `make webcl-rel` for a web build without server bloat (eg for sites focused on demo playback. Yes, this means you XantoM).
fteqcc: Include the decompiler in fteqcc (non-gui) builds ('-d' arg).
fteqcc: Decompiler can now mostly handle hexen2 mods without any unknown opcodes.
Allow ezHud and OpenSSL to be compiled as in-engine plugins, potentially for web and windows ports respectively.
Web: Fix support for ogg vorbis. Add support for voip.
Web: Added basic support for WebXR.
QTV: Don't try seeking on unseekable qtv streams. Don't spam when developer 1 is set.
QTV: add support for some eztv extensions.
MVD: added hack to use ktx's vweps in mvd where mvdsv doesn't bother to record the info.
qwfwd: hack around a hack in qwfwd, allowing it to work again.
recording: favour qwd in single player, instead of mvd.
Protocol: reduce client memory used for precache names. Bump maximum precache counts - some people are just abusive, yes you Orl.
hexen2: add enough clientside protocol compat to play the demo included with h2mp. lacks effects.
in_xflip: restored this setting.
fs_hidesyspaths: new cvar, defaults to enabled so you won't find your username or whatever turning up in screenshots or the like. change it to 0 before debuging stuff eg via 'path'.
gl_overbright_models: Added cvar to match QS.
netchan: Added MTU determination, we'll no longer fail to connect when routers stupidly drop icmp packets.
Win: try a few other versions of xinput too.
CSQC: Added a CSQC_GenerateMaterial function, to give the csqc a chance to generate custom materials.
MenuQC: Added support for the skeletal objects API.
2024-04-09 17:13:59 +00:00
//gah, just try a wildcard for hashes.
if ( FS_GenCachedPakName ( gamemode_info [ gameidx ] . auniquefile [ j ] , NULL , cached , sizeof ( cached ) ) )
{
Q_strncatz ( cached , " .* " , sizeof ( cached ) ) ;
if ( ! Sys_EnumerateFiles ( basedir , cached , FS_DirDoesHaveGame , NULL , NULL ) )
return true ; //search was cancelled by the callback, so it actually got called.
}
2012-07-05 19:42:36 +00:00
}
2013-06-23 02:17:02 +00:00
return false ;
2012-07-05 19:42:36 +00:00
}
2013-06-23 02:17:02 +00:00
//check em all
2016-11-20 20:52:41 +00:00
static int FS_IdentifyDefaultGameFromDir ( const char * basedir )
2005-08-26 22:52:26 +00:00
{
2013-06-23 02:17:02 +00:00
int i ;
for ( i = 0 ; gamemode_info [ i ] . argname ; i + + )
{
if ( FS_DirHasGame ( basedir , i ) )
return i ;
}
return - 1 ;
}
2009-04-01 22:03:56 +00:00
2013-06-23 02:17:02 +00:00
//attempt to work out which game we're meant to be trying to run based upon a few things
//1: fs_changegame console command override. fixme: needs to cope with manifests too.
2018-05-21 13:47:53 +00:00
//2: -quake3 (etc) argument implies that the user wants to run quake3.
//3: otherwise if we are ftequake3.exe then we try to run quake3.
2013-06-23 02:17:02 +00:00
//4: identify characteristic files within the working directory (like id1/pak0.pak implies we're running quake)
//5: check where the exe actually is instead of simply where we're being run from.
2016-07-21 19:27:59 +00:00
//6: try the homedir, just in case.
//7: fallback to prompting. just returns -1 here.
2013-06-23 02:17:02 +00:00
//if autobasedir is not set, block gamedir changes/prompts.
static int FS_IdentifyDefaultGame ( char * newbase , int sizeof_newbase , qboolean fixedbase )
{
int i ;
int gamenum = - 1 ;
2005-10-16 12:49:15 +00:00
2013-06-23 02:17:02 +00:00
//use the game based on an exe name over the filesystem one (could easily have multiple fs path matches).
if ( gamenum = = - 1 )
2006-03-06 01:41:09 +00:00
{
2013-10-29 17:38:22 +00:00
char * ev , * v0 = COM_SkipPath ( com_argv [ 0 ] ) ;
2013-06-23 02:17:02 +00:00
for ( i = 0 ; gamemode_info [ i ] . argname ; i + + )
2006-03-06 01:41:09 +00:00
{
2013-10-29 17:38:22 +00:00
if ( ! gamemode_info [ i ] . exename )
continue ;
ev = strstr ( v0 , gamemode_info [ i ] . exename ) ;
2013-06-23 02:17:02 +00:00
if ( ev & & ( ! strchr ( ev , ' \\ ' ) & & ! strchr ( ev , ' / ' ) ) )
gamenum = i ;
2006-03-06 01:41:09 +00:00
}
}
2013-06-23 02:17:02 +00:00
//identify the game from a telling file in the working directory
if ( gamenum = = - 1 )
gamenum = FS_IdentifyDefaultGameFromDir ( newbase ) ;
//identify the game from a telling file relative to the exe's directory. for when shortcuts don't set the working dir sensibly.
if ( gamenum = = - 1 & & host_parms . binarydir & & * host_parms . binarydir & & ! fixedbase )
{
gamenum = FS_IdentifyDefaultGameFromDir ( host_parms . binarydir ) ;
if ( gamenum ! = - 1 )
Q_strncpyz ( newbase , host_parms . binarydir , sizeof_newbase ) ;
}
2023-04-03 00:33:35 +00:00
if ( gamenum = = - 1 & & * com_homepath & & com_homepathusable & & ! fixedbase )
2016-07-21 19:27:59 +00:00
{
gamenum = FS_IdentifyDefaultGameFromDir ( com_homepath ) ;
if ( gamenum ! = - 1 )
Q_strncpyz ( newbase , com_homepath , sizeof_newbase ) ;
}
2013-06-23 02:17:02 +00:00
return gamenum ;
}
2020-04-19 01:23:32 +00:00
static ftemanifest_t * FS_GenerateLegacyManifest ( int game , const char * basedir )
2013-06-23 02:17:02 +00:00
{
ftemanifest_t * man ;
2020-04-29 10:43:22 +00:00
const char * cexec ;
2013-06-23 02:17:02 +00:00
2023-07-02 03:19:01 +00:00
if ( basedir )
{ //see if the gamedir we're aiming for already has a default.fmf file...
man = NULL ;
if ( ! man )
man = FS_Manifest_ReadSystem ( va ( " %s%s.fmf " , basedir , gamemode_info [ game ] . exename ) , basedir ) ;
# ifdef BRANDING_NAME
if ( ! man )
man = FS_Manifest_ReadSystem ( va ( " %s " STRINGIFY ( BRANDING_NAME ) " .fmf " , basedir ) , basedir ) ;
# endif
if ( ! man )
man = FS_Manifest_ReadSystem ( va ( " %sdefault.fmf " , basedir ) , basedir ) ;
if ( man )
{
if ( ! Q_strcasecmp ( man - > installation , gamemode_info [ game ] . argname + 1 ) )
return man ; //this seems to match what we were expecting. use its data instead of making one up.
else
FS_Manifest_Free ( man ) ;
}
}
2013-06-23 02:17:02 +00:00
if ( gamemode_info [ game ] . manifestfile )
2020-04-19 01:23:32 +00:00
man = FS_Manifest_ReadMem ( NULL , basedir , gamemode_info [ game ] . manifestfile ) ;
2013-06-23 02:17:02 +00:00
else
2012-11-27 03:23:19 +00:00
{
2020-04-19 01:23:32 +00:00
man = FS_Manifest_Create ( NULL , basedir ) ;
2013-06-23 02:17:02 +00:00
2023-04-21 11:36:13 +00:00
Cmd_TokenizeString ( va ( " game \" %s \" " , gamemode_info [ game ] . argname + 1 ) , false , false ) ;
FS_Manifest_ParseTokens ( man ) ;
2020-08-13 08:39:48 +00:00
for ( cexec = gamemode_info [ game ] . customexec ; cexec & & cexec [ 0 ] = = ' / ' & & cexec [ 1 ] = = ' / ' ; )
2018-10-11 10:31:23 +00:00
{
2020-04-29 10:43:22 +00:00
char line [ 256 ] ;
char * e = strchr ( cexec , ' \n ' ) ;
if ( ! e )
break ;
Q_strncpyz ( line , cexec + 2 , min ( e - ( cexec + 2 ) + 1 , sizeof ( line ) ) ) ;
cexec = e + 1 ;
Cmd_TokenizeString ( line , false , false ) ;
2018-10-11 10:31:23 +00:00
FS_Manifest_ParseTokens ( man ) ;
}
2023-04-21 11:36:13 +00:00
FS_Manifest_SetDefaultSettings ( man , & gamemode_info [ game ] ) ;
2016-08-25 00:12:14 +00:00
}
2017-03-04 19:36:06 +00:00
man - > security = MANIFEST_SECURITY_INSTALLER ;
2016-08-25 00:12:14 +00:00
return man ;
}
static void FS_AppendManifestGameArguments ( ftemanifest_t * man )
{
int i ;
if ( ! man )
return ;
2013-06-23 02:17:02 +00:00
2016-08-25 00:12:14 +00:00
i = COM_CheckParm ( " -basegame " ) ;
if ( i )
{
2020-04-19 01:23:32 +00:00
if ( man - > filename )
Z_Free ( man - > filename ) ;
man - > filename = NULL ;
2016-08-25 00:12:14 +00:00
do
2012-11-27 03:23:19 +00:00
{
2016-08-25 00:12:14 +00:00
Cmd_TokenizeString ( va ( " basegame \" %s \" " , com_argv [ i + 1 ] ) , false , false ) ;
FS_Manifest_ParseTokens ( man ) ;
2013-06-23 02:17:02 +00:00
2016-08-25 00:12:14 +00:00
i = COM_CheckNextParm ( " -basegame " , i ) ;
2013-06-23 02:17:02 +00:00
}
2016-08-25 00:12:14 +00:00
while ( i & & i < com_argc - 1 ) ;
}
2013-06-23 02:17:02 +00:00
2016-08-25 00:12:14 +00:00
i = COM_CheckParm ( " -game " ) ;
if ( i )
{
2020-04-19 01:23:32 +00:00
if ( man - > filename )
Z_Free ( man - > filename ) ;
man - > filename = NULL ;
2016-08-25 00:12:14 +00:00
do
2013-06-23 02:17:02 +00:00
{
2016-08-25 00:12:14 +00:00
Cmd_TokenizeString ( va ( " gamedir \" %s \" " , com_argv [ i + 1 ] ) , false , false ) ;
FS_Manifest_ParseTokens ( man ) ;
2013-06-23 02:17:02 +00:00
2016-08-25 00:12:14 +00:00
i = COM_CheckNextParm ( " -game " , i ) ;
2013-06-23 02:17:02 +00:00
}
2016-08-25 00:12:14 +00:00
while ( i & & i < com_argc - 1 ) ;
}
2013-06-23 02:17:02 +00:00
2016-08-25 00:12:14 +00:00
i = COM_CheckParm ( " +gamedir " ) ;
if ( i )
{
2020-04-19 01:23:32 +00:00
if ( man - > filename )
Z_Free ( man - > filename ) ;
man - > filename = NULL ;
2016-08-25 00:12:14 +00:00
do
2013-06-23 02:17:02 +00:00
{
2016-08-25 00:12:14 +00:00
Cmd_TokenizeString ( va ( " gamedir \" %s \" " , com_argv [ i + 1 ] ) , false , false ) ;
FS_Manifest_ParseTokens ( man ) ;
2013-06-23 02:17:02 +00:00
2016-08-25 00:12:14 +00:00
i = COM_CheckNextParm ( " +gamedir " , i ) ;
2012-11-27 03:23:19 +00:00
}
2016-08-25 00:12:14 +00:00
while ( i & & i < com_argc - 1 ) ;
2012-11-27 03:23:19 +00:00
}
2013-06-23 02:17:02 +00:00
}
2018-12-28 00:04:36 +00:00
# ifdef MANIFESTDOWNLOADS
2013-06-23 02:17:02 +00:00
static struct dl_download * curpackagedownload ;
2015-04-14 23:12:17 +00:00
qboolean FS_DownloadingPackage ( void )
{
2023-04-21 11:36:13 +00:00
if ( PM_IsApplying ( ) & 3 )
2016-11-25 08:14:54 +00:00
return true ;
2015-04-14 23:12:17 +00:00
return ! fs_manifest | | ! ! curpackagedownload ;
}
2013-06-23 02:17:02 +00:00
2014-03-30 08:55:06 +00:00
static void FS_ManifestUpdated ( struct dl_download * dl )
{
ftemanifest_t * man = fs_manifest ;
curpackagedownload = NULL ;
2015-04-14 23:12:17 +00:00
waitingformanifest - - ;
2014-03-30 08:55:06 +00:00
if ( dl - > file )
{
if ( dl - > user_ctx = = man )
{
size_t len = VFS_GETLEN ( dl - > file ) , len2 ;
char * fdata = BZ_Malloc ( len + 1 ) , * fdata2 = NULL ;
if ( fdata )
{
VFS_READ ( dl - > file , fdata , len ) ;
fdata [ len ] = 0 ;
2020-04-19 01:23:32 +00:00
man = FS_Manifest_ReadMem ( fs_manifest - > filename , fs_manifest - > basedir , fdata ) ;
2014-03-30 08:55:06 +00:00
if ( man )
{
//the updateurl MUST match the current one in order for the local version of the manifest to be saved (to avoid extra updates, and so it appears in the menu_mods)
//this is a paranoia measure to avoid too much damage from buggy/malicious proxies that return empty pages or whatever.
Added sys_openfile console command(and menu option) to web and flatpak(via cmake+dbus) builds, to 'install' packages on sandboxed systems a bit more easily.
Cmake: Add FTE_WERROR option, defaults to true in debug builds and off in release builds (in case future compilers have issues).
Cmake: Pull in libXscreensaver so we don't get interrupted by screensavers when playing demos.
Make: Added `make webcl-rel` for a web build without server bloat (eg for sites focused on demo playback. Yes, this means you XantoM).
fteqcc: Include the decompiler in fteqcc (non-gui) builds ('-d' arg).
fteqcc: Decompiler can now mostly handle hexen2 mods without any unknown opcodes.
Allow ezHud and OpenSSL to be compiled as in-engine plugins, potentially for web and windows ports respectively.
Web: Fix support for ogg vorbis. Add support for voip.
Web: Added basic support for WebXR.
QTV: Don't try seeking on unseekable qtv streams. Don't spam when developer 1 is set.
QTV: add support for some eztv extensions.
MVD: added hack to use ktx's vweps in mvd where mvdsv doesn't bother to record the info.
qwfwd: hack around a hack in qwfwd, allowing it to work again.
recording: favour qwd in single player, instead of mvd.
Protocol: reduce client memory used for precache names. Bump maximum precache counts - some people are just abusive, yes you Orl.
hexen2: add enough clientside protocol compat to play the demo included with h2mp. lacks effects.
in_xflip: restored this setting.
fs_hidesyspaths: new cvar, defaults to enabled so you won't find your username or whatever turning up in screenshots or the like. change it to 0 before debuging stuff eg via 'path'.
gl_overbright_models: Added cvar to match QS.
netchan: Added MTU determination, we'll no longer fail to connect when routers stupidly drop icmp packets.
Win: try a few other versions of xinput too.
CSQC: Added a CSQC_GenerateMaterial function, to give the csqc a chance to generate custom materials.
MenuQC: Added support for the skeletal objects API.
2024-04-09 17:13:59 +00:00
if ( ! man - > updateurl | | ! fs_manifest - > updateurl | | strcmp ( man - > updateurl , fs_manifest - > updateurl ) )
{
Con_Printf ( " Refusing to update manifest - updateurl changed from \" %s \" to \" %s \" \n " , fs_manifest - > updateurl , man - > updateurl ) ;
FS_Manifest_Free ( man ) ;
}
else if ( ! man - > basedir | | ! fs_manifest - > basedir | | strcmp ( man - > basedir , fs_manifest - > basedir ) ) //basedir must match too... ie: not be overridden.
{
Con_Printf ( " Refusing to update manifest - basedir changed from \" %s \" to \" %s \" \n " , fs_manifest - > basedir , man - > basedir ) ;
FS_Manifest_Free ( man ) ;
}
else if ( ! man - > installation | | ! fs_manifest - > installation | | strcmp ( man - > installation , fs_manifest - > installation ) )
{
Con_Printf ( " Refusing to update manifest - game changed from \" %s \" to \" %s \" \n " , fs_manifest - > installation , man - > installation ) ;
FS_Manifest_Free ( man ) ;
}
else
2014-03-30 08:55:06 +00:00
{
man - > blockupdate = true ; //don't download it multiple times. that's just crazy.
2020-04-19 01:23:32 +00:00
if ( man - > filename )
2014-03-30 08:55:06 +00:00
{
2020-04-19 01:23:32 +00:00
vfsfile_t * f2 = FS_OpenVFS ( fs_manifest - > filename , " rb " , FS_SYSTEM ) ;
2014-03-30 08:55:06 +00:00
if ( f2 )
{
len2 = VFS_GETLEN ( f2 ) ;
if ( len ! = len2 )
{
fdata2 = NULL ;
len2 = 0 ;
}
else
{
fdata2 = BZ_Malloc ( len2 ) ;
VFS_READ ( f2 , fdata2 , len2 ) ;
}
VFS_CLOSE ( f2 ) ;
if ( len = = len2 & & ! memcmp ( fdata , fdata2 , len ) )
{
//files match, no need to use this new manifest at all.
FS_Manifest_Free ( man ) ;
man = NULL ;
}
BZ_Free ( fdata2 ) ;
}
if ( man )
2020-04-19 01:23:32 +00:00
FS_WriteFile ( man - > filename , fdata , len , FS_SYSTEM ) ;
2014-03-30 08:55:06 +00:00
}
if ( man )
2015-04-14 23:12:17 +00:00
FS_ChangeGame ( man , true , false ) ;
2014-03-30 08:55:06 +00:00
}
}
BZ_Free ( fdata ) ;
}
}
VFS_CLOSE ( dl - > file ) ;
dl - > file = NULL ;
}
Added sys_openfile console command(and menu option) to web and flatpak(via cmake+dbus) builds, to 'install' packages on sandboxed systems a bit more easily.
Cmake: Add FTE_WERROR option, defaults to true in debug builds and off in release builds (in case future compilers have issues).
Cmake: Pull in libXscreensaver so we don't get interrupted by screensavers when playing demos.
Make: Added `make webcl-rel` for a web build without server bloat (eg for sites focused on demo playback. Yes, this means you XantoM).
fteqcc: Include the decompiler in fteqcc (non-gui) builds ('-d' arg).
fteqcc: Decompiler can now mostly handle hexen2 mods without any unknown opcodes.
Allow ezHud and OpenSSL to be compiled as in-engine plugins, potentially for web and windows ports respectively.
Web: Fix support for ogg vorbis. Add support for voip.
Web: Added basic support for WebXR.
QTV: Don't try seeking on unseekable qtv streams. Don't spam when developer 1 is set.
QTV: add support for some eztv extensions.
MVD: added hack to use ktx's vweps in mvd where mvdsv doesn't bother to record the info.
qwfwd: hack around a hack in qwfwd, allowing it to work again.
recording: favour qwd in single player, instead of mvd.
Protocol: reduce client memory used for precache names. Bump maximum precache counts - some people are just abusive, yes you Orl.
hexen2: add enough clientside protocol compat to play the demo included with h2mp. lacks effects.
in_xflip: restored this setting.
fs_hidesyspaths: new cvar, defaults to enabled so you won't find your username or whatever turning up in screenshots or the like. change it to 0 before debuging stuff eg via 'path'.
gl_overbright_models: Added cvar to match QS.
netchan: Added MTU determination, we'll no longer fail to connect when routers stupidly drop icmp packets.
Win: try a few other versions of xinput too.
CSQC: Added a CSQC_GenerateMaterial function, to give the csqc a chance to generate custom materials.
MenuQC: Added support for the skeletal objects API.
2024-04-09 17:13:59 +00:00
if ( ! waitingformanifest )
PM_AddManifestPackages ( man , true ) ;
}
static void FS_BeginNextPackageDownload ( ftemanifest_t * man )
{
if ( curpackagedownload | | ! man | | com_installer )
return ;
2014-03-30 08:55:06 +00:00
Added sys_openfile console command(and menu option) to web and flatpak(via cmake+dbus) builds, to 'install' packages on sandboxed systems a bit more easily.
Cmake: Add FTE_WERROR option, defaults to true in debug builds and off in release builds (in case future compilers have issues).
Cmake: Pull in libXscreensaver so we don't get interrupted by screensavers when playing demos.
Make: Added `make webcl-rel` for a web build without server bloat (eg for sites focused on demo playback. Yes, this means you XantoM).
fteqcc: Include the decompiler in fteqcc (non-gui) builds ('-d' arg).
fteqcc: Decompiler can now mostly handle hexen2 mods without any unknown opcodes.
Allow ezHud and OpenSSL to be compiled as in-engine plugins, potentially for web and windows ports respectively.
Web: Fix support for ogg vorbis. Add support for voip.
Web: Added basic support for WebXR.
QTV: Don't try seeking on unseekable qtv streams. Don't spam when developer 1 is set.
QTV: add support for some eztv extensions.
MVD: added hack to use ktx's vweps in mvd where mvdsv doesn't bother to record the info.
qwfwd: hack around a hack in qwfwd, allowing it to work again.
recording: favour qwd in single player, instead of mvd.
Protocol: reduce client memory used for precache names. Bump maximum precache counts - some people are just abusive, yes you Orl.
hexen2: add enough clientside protocol compat to play the demo included with h2mp. lacks effects.
in_xflip: restored this setting.
fs_hidesyspaths: new cvar, defaults to enabled so you won't find your username or whatever turning up in screenshots or the like. change it to 0 before debuging stuff eg via 'path'.
gl_overbright_models: Added cvar to match QS.
netchan: Added MTU determination, we'll no longer fail to connect when routers stupidly drop icmp packets.
Win: try a few other versions of xinput too.
CSQC: Added a CSQC_GenerateMaterial function, to give the csqc a chance to generate custom materials.
MenuQC: Added support for the skeletal objects API.
2024-04-09 17:13:59 +00:00
if ( man = = fs_manifest & & man - > updateurl & & ! man - > blockupdate )
{
vfsfile_t * f = man - > filename ? FS_OpenVFS ( man - > filename , " ab " , FS_SYSTEM ) : NULL ; //this is JUST to make sure its writable. don't bother updating it if it isn't.
man - > blockupdate = true ;
if ( f )
{
VFS_CLOSE ( f ) ;
Con_Printf ( " Updating manifest from %s \n " , man - > updateurl ) ;
waitingformanifest + + ;
curpackagedownload = HTTP_CL_Get ( man - > updateurl , NULL , FS_ManifestUpdated ) ;
if ( curpackagedownload )
{
curpackagedownload - > user_ctx = man ;
return ;
}
}
}
2014-03-30 08:55:06 +00:00
}
void FS_BeginManifestUpdates ( void )
{
ftemanifest_t * man = fs_manifest ;
if ( curpackagedownload | | ! man )
return ;
if ( ! curpackagedownload )
2020-04-19 01:23:32 +00:00
FS_BeginNextPackageDownload ( man ) ;
2014-03-30 08:55:06 +00:00
}
2013-06-23 02:17:02 +00:00
# else
2015-04-14 23:12:17 +00:00
qboolean FS_DownloadingPackage ( void )
{
return false ;
}
2014-03-30 08:55:06 +00:00
void FS_BeginManifestUpdates ( void )
2013-06-23 02:17:02 +00:00
{
}
# endif
2023-07-02 03:19:01 +00:00
static qboolean FS_FoundManifest ( void * usr , ftemanifest_t * man , enum modsourcetype_e sourcetype )
2014-05-20 02:23:37 +00:00
{
if ( ! * ( ftemanifest_t * * ) usr )
* ( ftemanifest_t * * ) usr = man ;
2018-09-23 19:35:24 +00:00
else
FS_Manifest_Free ( man ) ;
return true ;
2014-05-20 02:23:37 +00:00
}
2014-10-29 05:03:03 +00:00
//reads the default manifest based upon the basedir, the commandline arguments, the name of the exe, etc.
//may still fail if no game was identified.
//if fixedbasedir is true, stuff like -quake won't override/change the active basedir (ie: -basedir or gamedir switching without breaking gamedir)
2023-01-09 05:14:57 +00:00
static ftemanifest_t * FS_ReadDefaultManifest ( char * newbasedir , size_t newbasedirsize , qboolean fixedbasedir )
2014-10-29 05:03:03 +00:00
{
2017-03-26 01:46:08 +00:00
int i ;
2015-04-14 23:12:17 +00:00
int game = - 1 ;
2014-10-29 05:03:03 +00:00
ftemanifest_t * man = NULL ;
vfsfile_t * f ;
2015-04-14 23:12:17 +00:00
2017-03-26 01:46:08 +00:00
//commandline generally takes precedence
if ( ! man & & game = = - 1 )
{
int i ;
for ( i = 0 ; gamemode_info [ i ] . argname ; i + + )
{
if ( COM_CheckParm ( gamemode_info [ i ] . argname ) )
{
game = i ;
break ;
}
}
}
//hopefully this will be used for TCs.
2015-04-14 23:12:17 +00:00
if ( ! man & & game = = - 1 )
{
2018-12-04 06:15:53 +00:00
char exename [ MAX_QPATH ] ;
COM_StripAllExtensions ( COM_SkipPath ( com_argv [ 0 ] ) , exename , sizeof ( exename ) ) ;
//take away any amd64/x86/x86_64 postfix, so that people can have multiple cpu arch binaries sharing a single fmf
if ( strlen ( exename ) > strlen ( ARCH_CPU_POSTFIX ) & & ! strcmp ( exename + strlen ( exename ) - strlen ( ARCH_CPU_POSTFIX ) , ARCH_CPU_POSTFIX ) )
exename [ strlen ( exename ) - strlen ( ARCH_CPU_POSTFIX ) ] = 0 ;
//and then the trailing _ (before said postfix)
if ( exename [ strlen ( exename ) ] = = ' _ ' )
exename [ strlen ( exename ) ] = 0 ;
//and hopefully we now have something consistent that we can try to use.
2020-04-19 01:23:32 +00:00
if ( ! man )
man = FS_Manifest_ReadSystem ( va ( " %s%s.fmf " , newbasedir , exename ) , newbasedir ) ;
2014-10-29 05:03:03 +00:00
# ifdef BRANDING_NAME
2020-04-19 01:23:32 +00:00
if ( ! man )
man = FS_Manifest_ReadSystem ( va ( " %s " STRINGIFY ( BRANDING_NAME ) " .fmf " , newbasedir ) , newbasedir ) ;
2014-10-29 05:03:03 +00:00
# endif
2020-04-19 01:23:32 +00:00
if ( ! man )
man = FS_Manifest_ReadSystem ( va ( " %sdefault.fmf " , newbasedir ) , newbasedir ) ;
if ( man )
man - > security = MANIFEST_SECURITY_DEFAULT ;
2015-04-14 23:12:17 +00:00
}
2017-03-26 01:46:08 +00:00
//-basepack is primarily an android feature
i = COM_CheckParm ( " -basepack " ) ;
while ( ! man & & game = = - 1 & & i & & i < com_argc - 1 )
2014-10-29 05:03:03 +00:00
{
2017-03-26 01:46:08 +00:00
const char * pakname = com_argv [ i + 1 ] ;
searchpathfuncs_t * pak ;
vfsfile_t * vfs = VFSOS_Open ( pakname , " rb " ) ;
2023-04-21 11:36:13 +00:00
pak = FS_OpenPackByExtension ( vfs , NULL , pakname , pakname , " " ) ;
2017-03-26 01:46:08 +00:00
if ( pak )
2014-10-29 05:03:03 +00:00
{
2017-03-26 01:46:08 +00:00
flocation_t loc ;
if ( pak - > FindFile ( pak , & loc , " default.fmf " , NULL ) )
2015-04-14 23:12:17 +00:00
{
2017-03-26 01:46:08 +00:00
f = pak - > OpenVFS ( pak , & loc , " rb " ) ;
if ( f )
{
size_t len = VFS_GETLEN ( f ) ;
char * fdata = BZ_Malloc ( len + 1 ) ;
if ( fdata )
{
VFS_READ ( f , fdata , len ) ;
fdata [ len ] = 0 ;
2020-04-19 01:23:32 +00:00
man = FS_Manifest_ReadMem ( NULL , NULL , fdata ) ;
if ( man )
man - > security = MANIFEST_SECURITY_DEFAULT ;
2017-03-26 01:46:08 +00:00
BZ_Free ( fdata ) ;
}
VFS_CLOSE ( f ) ;
}
2015-04-14 23:12:17 +00:00
}
2017-03-26 01:46:08 +00:00
pak - > ClosePath ( pak ) ;
2014-10-29 05:03:03 +00:00
}
2017-03-26 01:46:08 +00:00
i = COM_CheckNextParm ( " -basepack " , i ) ;
2015-04-14 23:12:17 +00:00
}
2017-03-26 01:46:08 +00:00
2015-04-14 23:12:17 +00:00
if ( ! man & & game = = - 1 & & host_parms . manifest )
{
2020-04-19 01:23:32 +00:00
man = FS_Manifest_ReadMem ( NULL , newbasedir , host_parms . manifest ) ;
2015-04-14 23:12:17 +00:00
if ( man )
2017-03-04 19:36:06 +00:00
man - > security = MANIFEST_SECURITY_INSTALLER ;
2014-10-29 05:03:03 +00:00
}
if ( ! man )
{
2015-04-14 23:12:17 +00:00
if ( game = = - 1 )
game = FS_IdentifyDefaultGame ( newbasedir , newbasedirsize , fixedbasedir ) ;
2014-10-29 05:03:03 +00:00
if ( game ! = - 1 )
2020-04-19 01:23:32 +00:00
man = FS_GenerateLegacyManifest ( game , fixedbasedir ? newbasedir : NULL ) ;
2014-10-29 05:03:03 +00:00
}
2016-08-25 00:12:14 +00:00
FS_AppendManifestGameArguments ( man ) ;
2014-10-29 05:03:03 +00:00
return man ;
}
2015-05-03 19:57:46 +00:00
qboolean FS_FixPath ( char * path , size_t pathsize )
{
size_t len = strlen ( path ) ;
if ( len )
{
if ( path [ len - 1 ] = = ' / ' )
return true ;
# ifdef _WIN32
if ( path [ len - 1 ] = = ' \\ ' )
return true ;
# endif
if ( len > = pathsize - 1 )
return false ;
path [ len ] = ' / ' ;
path [ len + 1 ] = 0 ;
}
return true ;
}
2013-06-23 02:17:02 +00:00
//this is potentially unsafe. needs lots of testing.
2015-04-14 23:12:17 +00:00
qboolean FS_ChangeGame ( ftemanifest_t * man , qboolean allowreloadconfigs , qboolean allowbasedirchange )
2013-06-23 02:17:02 +00:00
{
int i , j ;
char realpath [ MAX_OSPATH - 1 ] ;
char newbasedir [ MAX_OSPATH ] ;
2020-04-19 01:23:32 +00:00
# ifdef PACKAGEMANAGER
2016-11-02 08:01:21 +00:00
char * olddownloadsurl ;
2020-04-19 01:23:32 +00:00
# endif
2013-06-23 02:17:02 +00:00
qboolean fixedbasedir ;
qboolean reloadconfigs = false ;
2013-10-29 17:38:22 +00:00
qboolean builtingame = false ;
Added sys_openfile console command(and menu option) to web and flatpak(via cmake+dbus) builds, to 'install' packages on sandboxed systems a bit more easily.
Cmake: Add FTE_WERROR option, defaults to true in debug builds and off in release builds (in case future compilers have issues).
Cmake: Pull in libXscreensaver so we don't get interrupted by screensavers when playing demos.
Make: Added `make webcl-rel` for a web build without server bloat (eg for sites focused on demo playback. Yes, this means you XantoM).
fteqcc: Include the decompiler in fteqcc (non-gui) builds ('-d' arg).
fteqcc: Decompiler can now mostly handle hexen2 mods without any unknown opcodes.
Allow ezHud and OpenSSL to be compiled as in-engine plugins, potentially for web and windows ports respectively.
Web: Fix support for ogg vorbis. Add support for voip.
Web: Added basic support for WebXR.
QTV: Don't try seeking on unseekable qtv streams. Don't spam when developer 1 is set.
QTV: add support for some eztv extensions.
MVD: added hack to use ktx's vweps in mvd where mvdsv doesn't bother to record the info.
qwfwd: hack around a hack in qwfwd, allowing it to work again.
recording: favour qwd in single player, instead of mvd.
Protocol: reduce client memory used for precache names. Bump maximum precache counts - some people are just abusive, yes you Orl.
hexen2: add enough clientside protocol compat to play the demo included with h2mp. lacks effects.
in_xflip: restored this setting.
fs_hidesyspaths: new cvar, defaults to enabled so you won't find your username or whatever turning up in screenshots or the like. change it to 0 before debuging stuff eg via 'path'.
gl_overbright_models: Added cvar to match QS.
netchan: Added MTU determination, we'll no longer fail to connect when routers stupidly drop icmp packets.
Win: try a few other versions of xinput too.
CSQC: Added a CSQC_GenerateMaterial function, to give the csqc a chance to generate custom materials.
MenuQC: Added support for the skeletal objects API.
2024-04-09 17:13:59 +00:00
qboolean basedirchanged = false ;
2013-06-23 02:17:02 +00:00
flocation_t loc ;
Added sys_openfile console command(and menu option) to web and flatpak(via cmake+dbus) builds, to 'install' packages on sandboxed systems a bit more easily.
Cmake: Add FTE_WERROR option, defaults to true in debug builds and off in release builds (in case future compilers have issues).
Cmake: Pull in libXscreensaver so we don't get interrupted by screensavers when playing demos.
Make: Added `make webcl-rel` for a web build without server bloat (eg for sites focused on demo playback. Yes, this means you XantoM).
fteqcc: Include the decompiler in fteqcc (non-gui) builds ('-d' arg).
fteqcc: Decompiler can now mostly handle hexen2 mods without any unknown opcodes.
Allow ezHud and OpenSSL to be compiled as in-engine plugins, potentially for web and windows ports respectively.
Web: Fix support for ogg vorbis. Add support for voip.
Web: Added basic support for WebXR.
QTV: Don't try seeking on unseekable qtv streams. Don't spam when developer 1 is set.
QTV: add support for some eztv extensions.
MVD: added hack to use ktx's vweps in mvd where mvdsv doesn't bother to record the info.
qwfwd: hack around a hack in qwfwd, allowing it to work again.
recording: favour qwd in single player, instead of mvd.
Protocol: reduce client memory used for precache names. Bump maximum precache counts - some people are just abusive, yes you Orl.
hexen2: add enough clientside protocol compat to play the demo included with h2mp. lacks effects.
in_xflip: restored this setting.
fs_hidesyspaths: new cvar, defaults to enabled so you won't find your username or whatever turning up in screenshots or the like. change it to 0 before debuging stuff eg via 'path'.
gl_overbright_models: Added cvar to match QS.
netchan: Added MTU determination, we'll no longer fail to connect when routers stupidly drop icmp packets.
Win: try a few other versions of xinput too.
CSQC: Added a CSQC_GenerateMaterial function, to give the csqc a chance to generate custom materials.
MenuQC: Added support for the skeletal objects API.
2024-04-09 17:13:59 +00:00
# ifdef MANIFESTDOWNLOADS
qboolean allowdownload = man ! = fs_manifest & & allowreloadconfigs ; //or at least ask the user.
# endif
2009-03-03 01:52:30 +00:00
2018-12-28 00:04:36 +00:00
# ifdef HAVE_CLIENT
qboolean allowvidrestart = true ;
Added sys_openfile console command(and menu option) to web and flatpak(via cmake+dbus) builds, to 'install' packages on sandboxed systems a bit more easily.
Cmake: Add FTE_WERROR option, defaults to true in debug builds and off in release builds (in case future compilers have issues).
Cmake: Pull in libXscreensaver so we don't get interrupted by screensavers when playing demos.
Make: Added `make webcl-rel` for a web build without server bloat (eg for sites focused on demo playback. Yes, this means you XantoM).
fteqcc: Include the decompiler in fteqcc (non-gui) builds ('-d' arg).
fteqcc: Decompiler can now mostly handle hexen2 mods without any unknown opcodes.
Allow ezHud and OpenSSL to be compiled as in-engine plugins, potentially for web and windows ports respectively.
Web: Fix support for ogg vorbis. Add support for voip.
Web: Added basic support for WebXR.
QTV: Don't try seeking on unseekable qtv streams. Don't spam when developer 1 is set.
QTV: add support for some eztv extensions.
MVD: added hack to use ktx's vweps in mvd where mvdsv doesn't bother to record the info.
qwfwd: hack around a hack in qwfwd, allowing it to work again.
recording: favour qwd in single player, instead of mvd.
Protocol: reduce client memory used for precache names. Bump maximum precache counts - some people are just abusive, yes you Orl.
hexen2: add enough clientside protocol compat to play the demo included with h2mp. lacks effects.
in_xflip: restored this setting.
fs_hidesyspaths: new cvar, defaults to enabled so you won't find your username or whatever turning up in screenshots or the like. change it to 0 before debuging stuff eg via 'path'.
gl_overbright_models: Added cvar to match QS.
netchan: Added MTU determination, we'll no longer fail to connect when routers stupidly drop icmp packets.
Win: try a few other versions of xinput too.
CSQC: Added a CSQC_GenerateMaterial function, to give the csqc a chance to generate custom materials.
MenuQC: Added support for the skeletal objects API.
2024-04-09 17:13:59 +00:00
char * vidfile [ ] = { " gfx.wad " , " gfx/conback.lmp " /*q1*/ , " gfx/menu/conback.lmp " /*h2*/ , " pics/conback.pcx " /*q2*/ , //misc stuff
2020-04-29 10:43:22 +00:00
" gfx/palette.lmp " , " pics/colormap.pcx " , " gfx/conchars.png " } ; //palettes
2015-08-20 03:17:47 +00:00
searchpathfuncs_t * vidpath [ countof ( vidfile ) ] ;
2023-02-20 07:47:16 +00:00
char * menufile [ ] = { " menu.dat " /*mods*/ , " gfx/ttl_main.lmp " /*q1*/ , " pics/m_main_quit.pcx " /*q2*/ , " gfx/menu/title0.lmp " /*h2*/ } ;
searchpathfuncs_t * menupath [ countof ( menufile ) ] ;
2018-12-28 00:04:36 +00:00
# endif
2015-08-20 03:17:47 +00:00
2013-06-23 02:17:02 +00:00
//if any of these files change location, the configs will be re-execed.
//note that we reuse path handles if they're still valid, so we can just check the pointer to see if it got unloaded/replaced.
2015-08-20 03:17:47 +00:00
char * conffile [ ] = { " quake.rc " , " hexen.rc " , " default.cfg " , " server.cfg " } ;
searchpathfuncs_t * confpath [ countof ( conffile ) ] ;
2018-12-28 00:04:36 +00:00
# ifdef HAVE_CLIENT
2015-08-20 03:17:47 +00:00
for ( i = 0 ; i < countof ( vidfile ) ; i + + )
{
playdemo accepts https urls now. will start playing before the file has finished downloading, to avoid unnecessary delays.
reworked network addresses to separate address family and connection type. this should make banning people more reliable, as well as simplifying a whole load of logic (no need to check for ipv4 AND ipv6).
tcpconnect will keep trying to connect even if the connection wasn't instant, instead of giving up instantly.
rewrote tcp connections quite a bit. sv_port_tcp now handles qtv+qizmo+http+ws+rtcbroker+tls equivalents.
qtv_streamport is now a legacy cvar and now acts equivalently to sv_port_tcp (but still separate).
rewrote screenshot and video capture code to use strides. this solves image-is-upside down issues with vulkan.
ignore alt key in browser port. oh no! no more red text! oh no! no more alt-being-wrongly-down-and-being-unable-to-type-anything-without-forcing-alt-released!
reworked audio decoder interface. now has clearly defined success/unavailable/end-of-file results. this should solve a whole load of issues with audio streaming.
fixed various openal audio streaming issues too. openal also got some workarounds for emscripten's poor emulation.
fixed ogg decoder to retain sync properly if seeked.
updated menu_media a bit. now reads vorbis comments/id3v1 tags to get proper track names. also saves the playlist so you don't have to manually repopulate the list so it might actually be usable now (after how many years?)
r_stains now defaults to 0, and is no longer enabled by presets. use decals if you want that sort of thing.
added fs_noreexec cvar, so configs will not be reexeced on gamedir change. this also means defaults won't be reapplied, etc.
added 'nvvk' renderer on windows, using nvidia's vulkan-inside-opengl gl extension. mostly just to see how much slower it is.
fixed up the ftp server quite a lot. more complete, more compliant, and should do ipv6 properly to-boot. file transfers also threaded.
fixed potential crash inside runclientphys.
experimental sv_antilag=3 setting. totally untested. the aim is to avoid missing due to lagged knockbacks. may be expensive for the server.
browser port's websockets support fixed. experimental support for webrtc ('works for me', requires a broker server).
updated avplug(renamed to ffmpeg so people know what it is) to use ffmpeg 3.2.4 properly, with its new encoder api. should be much more robust... also added experimental audio decoder for game music etc (currently doesn't resample, so playback rates are screwed, disabled by cvar).
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5097 fc73d0e0-1445-4013-8a0c-d673dee63da5
2017-05-10 02:08:58 +00:00
if ( allowvidrestart )
{
FS_FLocateFile ( vidfile [ i ] , FSLF_IFFOUND , & loc ) ; //q1
vidpath [ i ] = loc . search ? loc . search - > handle : NULL ;
}
else
vidpath [ i ] = NULL ;
2015-08-20 03:17:47 +00:00
}
2023-02-20 07:47:16 +00:00
for ( i = 0 ; i < countof ( menufile ) ; i + + )
{
if ( allowreloadconfigs )
{
FS_FLocateFile ( menufile [ i ] , FSLF_IFFOUND | FSLF_SECUREONLY , & loc ) ;
menupath [ i ] = loc . search ? loc . search - > handle : NULL ;
}
else
menupath [ i ] = NULL ;
}
2018-12-28 00:04:36 +00:00
# endif
playdemo accepts https urls now. will start playing before the file has finished downloading, to avoid unnecessary delays.
reworked network addresses to separate address family and connection type. this should make banning people more reliable, as well as simplifying a whole load of logic (no need to check for ipv4 AND ipv6).
tcpconnect will keep trying to connect even if the connection wasn't instant, instead of giving up instantly.
rewrote tcp connections quite a bit. sv_port_tcp now handles qtv+qizmo+http+ws+rtcbroker+tls equivalents.
qtv_streamport is now a legacy cvar and now acts equivalently to sv_port_tcp (but still separate).
rewrote screenshot and video capture code to use strides. this solves image-is-upside down issues with vulkan.
ignore alt key in browser port. oh no! no more red text! oh no! no more alt-being-wrongly-down-and-being-unable-to-type-anything-without-forcing-alt-released!
reworked audio decoder interface. now has clearly defined success/unavailable/end-of-file results. this should solve a whole load of issues with audio streaming.
fixed various openal audio streaming issues too. openal also got some workarounds for emscripten's poor emulation.
fixed ogg decoder to retain sync properly if seeked.
updated menu_media a bit. now reads vorbis comments/id3v1 tags to get proper track names. also saves the playlist so you don't have to manually repopulate the list so it might actually be usable now (after how many years?)
r_stains now defaults to 0, and is no longer enabled by presets. use decals if you want that sort of thing.
added fs_noreexec cvar, so configs will not be reexeced on gamedir change. this also means defaults won't be reapplied, etc.
added 'nvvk' renderer on windows, using nvidia's vulkan-inside-opengl gl extension. mostly just to see how much slower it is.
fixed up the ftp server quite a lot. more complete, more compliant, and should do ipv6 properly to-boot. file transfers also threaded.
fixed potential crash inside runclientphys.
experimental sv_antilag=3 setting. totally untested. the aim is to avoid missing due to lagged knockbacks. may be expensive for the server.
browser port's websockets support fixed. experimental support for webrtc ('works for me', requires a broker server).
updated avplug(renamed to ffmpeg so people know what it is) to use ffmpeg 3.2.4 properly, with its new encoder api. should be much more robust... also added experimental audio decoder for game music etc (currently doesn't resample, so playback rates are screwed, disabled by cvar).
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5097 fc73d0e0-1445-4013-8a0c-d673dee63da5
2017-05-10 02:08:58 +00:00
if ( allowreloadconfigs & & fs_noreexec . ival )
allowreloadconfigs = false ;
2015-08-20 03:17:47 +00:00
for ( i = 0 ; i < countof ( conffile ) ; i + + )
2013-06-23 02:17:02 +00:00
{
playdemo accepts https urls now. will start playing before the file has finished downloading, to avoid unnecessary delays.
reworked network addresses to separate address family and connection type. this should make banning people more reliable, as well as simplifying a whole load of logic (no need to check for ipv4 AND ipv6).
tcpconnect will keep trying to connect even if the connection wasn't instant, instead of giving up instantly.
rewrote tcp connections quite a bit. sv_port_tcp now handles qtv+qizmo+http+ws+rtcbroker+tls equivalents.
qtv_streamport is now a legacy cvar and now acts equivalently to sv_port_tcp (but still separate).
rewrote screenshot and video capture code to use strides. this solves image-is-upside down issues with vulkan.
ignore alt key in browser port. oh no! no more red text! oh no! no more alt-being-wrongly-down-and-being-unable-to-type-anything-without-forcing-alt-released!
reworked audio decoder interface. now has clearly defined success/unavailable/end-of-file results. this should solve a whole load of issues with audio streaming.
fixed various openal audio streaming issues too. openal also got some workarounds for emscripten's poor emulation.
fixed ogg decoder to retain sync properly if seeked.
updated menu_media a bit. now reads vorbis comments/id3v1 tags to get proper track names. also saves the playlist so you don't have to manually repopulate the list so it might actually be usable now (after how many years?)
r_stains now defaults to 0, and is no longer enabled by presets. use decals if you want that sort of thing.
added fs_noreexec cvar, so configs will not be reexeced on gamedir change. this also means defaults won't be reapplied, etc.
added 'nvvk' renderer on windows, using nvidia's vulkan-inside-opengl gl extension. mostly just to see how much slower it is.
fixed up the ftp server quite a lot. more complete, more compliant, and should do ipv6 properly to-boot. file transfers also threaded.
fixed potential crash inside runclientphys.
experimental sv_antilag=3 setting. totally untested. the aim is to avoid missing due to lagged knockbacks. may be expensive for the server.
browser port's websockets support fixed. experimental support for webrtc ('works for me', requires a broker server).
updated avplug(renamed to ffmpeg so people know what it is) to use ffmpeg 3.2.4 properly, with its new encoder api. should be much more robust... also added experimental audio decoder for game music etc (currently doesn't resample, so playback rates are screwed, disabled by cvar).
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5097 fc73d0e0-1445-4013-8a0c-d673dee63da5
2017-05-10 02:08:58 +00:00
if ( allowreloadconfigs )
{
2018-09-23 19:35:24 +00:00
FS_FLocateFile ( conffile [ i ] , FSLF_IFFOUND | FSLF_IGNOREPURE , & loc ) ; //q1
playdemo accepts https urls now. will start playing before the file has finished downloading, to avoid unnecessary delays.
reworked network addresses to separate address family and connection type. this should make banning people more reliable, as well as simplifying a whole load of logic (no need to check for ipv4 AND ipv6).
tcpconnect will keep trying to connect even if the connection wasn't instant, instead of giving up instantly.
rewrote tcp connections quite a bit. sv_port_tcp now handles qtv+qizmo+http+ws+rtcbroker+tls equivalents.
qtv_streamport is now a legacy cvar and now acts equivalently to sv_port_tcp (but still separate).
rewrote screenshot and video capture code to use strides. this solves image-is-upside down issues with vulkan.
ignore alt key in browser port. oh no! no more red text! oh no! no more alt-being-wrongly-down-and-being-unable-to-type-anything-without-forcing-alt-released!
reworked audio decoder interface. now has clearly defined success/unavailable/end-of-file results. this should solve a whole load of issues with audio streaming.
fixed various openal audio streaming issues too. openal also got some workarounds for emscripten's poor emulation.
fixed ogg decoder to retain sync properly if seeked.
updated menu_media a bit. now reads vorbis comments/id3v1 tags to get proper track names. also saves the playlist so you don't have to manually repopulate the list so it might actually be usable now (after how many years?)
r_stains now defaults to 0, and is no longer enabled by presets. use decals if you want that sort of thing.
added fs_noreexec cvar, so configs will not be reexeced on gamedir change. this also means defaults won't be reapplied, etc.
added 'nvvk' renderer on windows, using nvidia's vulkan-inside-opengl gl extension. mostly just to see how much slower it is.
fixed up the ftp server quite a lot. more complete, more compliant, and should do ipv6 properly to-boot. file transfers also threaded.
fixed potential crash inside runclientphys.
experimental sv_antilag=3 setting. totally untested. the aim is to avoid missing due to lagged knockbacks. may be expensive for the server.
browser port's websockets support fixed. experimental support for webrtc ('works for me', requires a broker server).
updated avplug(renamed to ffmpeg so people know what it is) to use ffmpeg 3.2.4 properly, with its new encoder api. should be much more robust... also added experimental audio decoder for game music etc (currently doesn't resample, so playback rates are screwed, disabled by cvar).
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5097 fc73d0e0-1445-4013-8a0c-d673dee63da5
2017-05-10 02:08:58 +00:00
confpath [ i ] = loc . search ? loc . search - > handle : NULL ;
}
else
confpath [ i ] = NULL ;
2013-06-23 02:17:02 +00:00
}
2023-07-01 22:20:13 +00:00
# if defined(FTE_TARGET_WEB) || defined(ANDROID) || defined(WINRT)
2015-04-21 04:12:00 +00:00
//these targets are considered to be sandboxed already, and have their own app-based base directory which they will always use.
Q_strncpyz ( newbasedir , host_parms . basedir , sizeof ( newbasedir ) ) ;
fixedbasedir = true ;
# else
2013-06-23 02:17:02 +00:00
i = COM_CheckParm ( " -basedir " ) ;
fixedbasedir = i & & i < com_argc - 1 ;
Q_strncpyz ( newbasedir , fixedbasedir ? com_argv [ i + 1 ] : host_parms . basedir , sizeof ( newbasedir ) ) ;
2015-04-21 04:12:00 +00:00
# endif
2013-06-23 02:17:02 +00:00
//make sure it has a trailing slash, or is empty. woo.
FS_CleanDir ( newbasedir , sizeof ( newbasedir ) ) ;
2015-04-14 23:12:17 +00:00
if ( ! allowreloadconfigs | | ! allowbasedirchange | | ( man & & fs_manifest & & ! Q_strcasecmp ( man - > installation , fs_manifest - > installation ) ) )
{
fixedbasedir = true ;
Q_strncpyz ( newbasedir , com_gamepath , sizeof ( newbasedir ) ) ;
}
2013-06-23 02:17:02 +00:00
if ( ! man )
{
2023-08-13 01:33:52 +00:00
int found = 0 ;
2013-06-23 02:17:02 +00:00
//if we're already running a game, don't autodetect.
if ( fs_manifest )
return false ;
2014-10-29 05:03:03 +00:00
man = FS_ReadDefaultManifest ( newbasedir , sizeof ( newbasedir ) , fixedbasedir ) ;
2014-03-30 08:55:06 +00:00
2016-09-01 14:31:24 +00:00
if ( ! man )
{
Added sys_openfile console command(and menu option) to web and flatpak(via cmake+dbus) builds, to 'install' packages on sandboxed systems a bit more easily.
Cmake: Add FTE_WERROR option, defaults to true in debug builds and off in release builds (in case future compilers have issues).
Cmake: Pull in libXscreensaver so we don't get interrupted by screensavers when playing demos.
Make: Added `make webcl-rel` for a web build without server bloat (eg for sites focused on demo playback. Yes, this means you XantoM).
fteqcc: Include the decompiler in fteqcc (non-gui) builds ('-d' arg).
fteqcc: Decompiler can now mostly handle hexen2 mods without any unknown opcodes.
Allow ezHud and OpenSSL to be compiled as in-engine plugins, potentially for web and windows ports respectively.
Web: Fix support for ogg vorbis. Add support for voip.
Web: Added basic support for WebXR.
QTV: Don't try seeking on unseekable qtv streams. Don't spam when developer 1 is set.
QTV: add support for some eztv extensions.
MVD: added hack to use ktx's vweps in mvd where mvdsv doesn't bother to record the info.
qwfwd: hack around a hack in qwfwd, allowing it to work again.
recording: favour qwd in single player, instead of mvd.
Protocol: reduce client memory used for precache names. Bump maximum precache counts - some people are just abusive, yes you Orl.
hexen2: add enough clientside protocol compat to play the demo included with h2mp. lacks effects.
in_xflip: restored this setting.
fs_hidesyspaths: new cvar, defaults to enabled so you won't find your username or whatever turning up in screenshots or the like. change it to 0 before debuging stuff eg via 'path'.
gl_overbright_models: Added cvar to match QS.
netchan: Added MTU determination, we'll no longer fail to connect when routers stupidly drop icmp packets.
Win: try a few other versions of xinput too.
CSQC: Added a CSQC_GenerateMaterial function, to give the csqc a chance to generate custom materials.
MenuQC: Added support for the skeletal objects API.
2024-04-09 17:13:59 +00:00
found = FS_EnumerateKnownGames ( FS_FoundManifest , & man , fixedbasedir ) ;
2016-09-01 14:31:24 +00:00
if ( found ! = 1 )
{
//we found more than 1 (or none)
//if we're a client, display a menu to pick between them (or display an error)
//servers can just use the first they find, they'd effectively just crash otherwise, but still give a warning.
if ( ! isDedicated )
2018-09-23 19:35:24 +00:00
{
FS_Manifest_Free ( man ) ;
2016-09-01 14:31:24 +00:00
man = NULL ;
2018-09-23 19:35:24 +00:00
}
2016-09-01 14:31:24 +00:00
else if ( found )
2018-09-23 19:35:24 +00:00
Con_Printf ( CON_WARNING " Warning: found multiple possible games. Using the first found (%s). \n " , man - > formalname ) ;
2016-09-01 14:31:24 +00:00
else
Con_Printf ( CON_ERROR " Error: unable to determine correct game/basedir. \n " ) ;
}
2014-05-20 02:23:37 +00:00
}
2014-03-30 08:55:06 +00:00
if ( ! man )
{
2019-10-18 08:37:38 +00:00
# ifdef _WIN32
2020-04-19 01:23:32 +00:00
//quit straight out on windows. this prevents shitty sandboxed malware scanners from seeing bugs in opengl drivers and blaming us for it.
2023-08-13 01:33:52 +00:00
if ( ! fixedbasedir & & found = = 0 )
Too many changes, sorry.
Change revision displays, use the SVN commit date instead of using __DATE__ (when there's no local changes). This should allow reproducible builds.
Added s_al_disable cvar, to block openal and all the various problems people have had with it, without having to name an explicit fallback (which would vary by system).
Add mastervolume cvar (for ss).
Add r_shadows 2 (aka fake shadows - for ss).
Add scr_loadingscreen_aspect -1 setting, to disable levelshots entirely, also disables the progress bar (for ss).
Better support for some effectinfo hacks (for ss).
Added dpcompat_nocsqcwarnings (because of lazy+buggy mods like ss).
Rework the dpcsqc versions of project+unproject builtins for better compat (for ss).
Added dpcompat_csqcinputeventtypes to block unexpected csqc input events (for ss).
Better compat with DP's loadfont console command (for ss).
Added dpcompat_smallerfonts cvar to replicate a DP bug (for ss).
Detect dp's m_draw extension, to work around it (for ss).
Cvar dpcompat_ignoremodificationtimes added. A value of 0 favour the most recently modified file, 1 will use DP-like alphabetically sorted preferences (for ss).
loadfont builtin can now accept outline=1 in the sizes arg for slightly more readable fonts.
Fix bbox calcs for rotated entities, fix needed for r_ignorenetpvs 0.
Hackily parse emoji.json to provide :poop: etc suggestions.
Skip prediction entirely when there's no local entity info. This fixes stair-smoothing in xonotic.
screenshot_cubemap will now capture half-float images when saving to ktx or dds files.
Fix support for xcf files larger than 4gb, mostly to avoid compiler warnings.
Fixed size of gfx/loading.lmp when replacement textures are used.
Added mipmap support for rg8 and l8a8 textures.
r_hdr_framebuffer cvar updated to support format names instead of random negative numbers. Description updated to name some interesting ones.
Perform autoupdate _checks_ ONLY with explicit user confirmation (actual updating already needed user confirmation, but this extra step should reduce the chances of us getting wrongly accused of exfiltrating user data if we're run in a sandbox - we ONLY ever included the updating engine's version in the checks, though there's nothing we can do to avoid sending the user's router's IP).
Removed the 'summon satan all over your harddrive' quit message, in case paranoid security researchers are idiots and don't bother doing actual research.
Removed the triptohell.info and fte.triptohell.info certificates, they really need to stop being self-signed. The updates domain is still self-signed for autoupdates.
Video drivers are now able to report supported video resolutions, visible to menuqc. Currently only works with SDL2 builds.
Added setmousepos builtin. Should work with glx+win32 build.
VF_SKYROOM_CAMERA can now accept an extra two args, setviewprop(VF_SKYROOM_CAMERA, org, axis, degrees).
Removed v_skyroom_origin+v_skyroom_orientation cvars in favour just v_skyroom, which should make it behave more like the 'fog' command (used when csqc isn't overriding).
Added R_EndPolygonRibbon builtin to make it faster+easier to generate textured ribbon/cable/etc wide lines (for TW).
sdl: Fix up sys_sdl.c's file enumeration to support wildcards in directories.
edit command now displays end1.bin/end2.bin correctly, because we can.
Finally add support for f_modified - though ruleset_allow_larger_models and ruleset_allow_overlong_sounds generally make it redundant.
Fix threading race condition in sha1 lookups.
Updated f_ruleset to include the same extra flags reported by ezquake.
A mod's default.fmf file can now contain an eg 'mainconfig config.cfg' line (to explicitly set the main config saved with cfg_save_auto 1 etc).
fmf: basegame steam:GameName/GameDir can be used to try to load a mod directory from an installed steam game. The resulting gamedir will be read-only.
HOMEDIR CHANGE: use homedirs only if the basedir cannot be written or a homedir already exists, which should further reduce the probability of microsoft randomly uploading our data to their cloud (but mostly because its annoying to never know where your data is written).
Fixed buf_cvarlist, should work in xonotic now, and without segfaults.
Added an extra arg to URI_Get_Callback calls - the response size, also changed the tempstring to contain all bytes of the response, you need to be careful about nulls though.
Try to work around nvidia's forced-panning bug on x11 when changing video modes. This might screw with other programs.
sdl: support custom icons.
sdl: support choosing a specific display.
Added some documentation to menuqc builtins.
menusys: use outlines for slightly more readable fonts.
menusys: switch vid_width and vid_height combos into a single video mode combo to set both according to reported video modes.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5581 fc73d0e0-1445-4013-8a0c-d673dee63da5
2019-11-20 03:09:50 +00:00
Sys_Error ( " No recognised game data found in working directory: \n %s " , com_gamepath ) ;
2019-10-18 08:37:38 +00:00
# endif
2020-04-19 01:23:32 +00:00
man = FS_Manifest_ReadMem ( NULL , NULL ,
2015-04-14 23:12:17 +00:00
" FTEManifestVer 1 \n "
2014-03-30 08:55:06 +00:00
" game \" \" \n "
" name \" " FULLENGINENAME " \" \n "
2020-04-19 01:23:32 +00:00
" -set vid_fullscreen 0 \n "
" -set gl_font cour \n "
" -set vid_width 640 \n "
" -set vid_height 480 \n "
2014-03-30 08:55:06 +00:00
) ;
}
2015-04-14 23:12:17 +00:00
if ( ! man )
Sys_Error ( " couldn't generate dataless manifest \n " ) ;
2013-06-23 02:17:02 +00:00
}
2020-04-19 01:23:32 +00:00
# ifdef PACKAGEMANAGER
2016-11-02 08:01:21 +00:00
if ( fs_manifest & & fs_manifest - > downloadsurl )
olddownloadsurl = Z_StrDup ( fs_manifest - > downloadsurl ) ;
2016-11-25 08:14:54 +00:00
else if ( ! fs_manifest & & man - > downloadsurl )
olddownloadsurl = Z_StrDup ( man - > downloadsurl ) ;
2016-11-02 08:01:21 +00:00
else
olddownloadsurl = NULL ;
2020-04-19 01:23:32 +00:00
# endif
2016-11-02 08:01:21 +00:00
2013-06-23 02:17:02 +00:00
if ( man - > installation & & * man - > installation )
{
for ( i = 0 ; gamemode_info [ i ] . argname ; i + + )
{
if ( ! strcmp ( man - > installation , gamemode_info [ i ] . argname + 1 ) )
2009-03-03 01:52:30 +00:00
{
2013-06-23 02:17:02 +00:00
//if there's no base dirs, edit the manifest to give it its default ones.
for ( j = 0 ; j < sizeof ( man - > gamepath ) / sizeof ( man - > gamepath [ 0 ] ) ; j + + )
2009-03-03 01:52:30 +00:00
{
Too many changes, sorry.
Change revision displays, use the SVN commit date instead of using __DATE__ (when there's no local changes). This should allow reproducible builds.
Added s_al_disable cvar, to block openal and all the various problems people have had with it, without having to name an explicit fallback (which would vary by system).
Add mastervolume cvar (for ss).
Add r_shadows 2 (aka fake shadows - for ss).
Add scr_loadingscreen_aspect -1 setting, to disable levelshots entirely, also disables the progress bar (for ss).
Better support for some effectinfo hacks (for ss).
Added dpcompat_nocsqcwarnings (because of lazy+buggy mods like ss).
Rework the dpcsqc versions of project+unproject builtins for better compat (for ss).
Added dpcompat_csqcinputeventtypes to block unexpected csqc input events (for ss).
Better compat with DP's loadfont console command (for ss).
Added dpcompat_smallerfonts cvar to replicate a DP bug (for ss).
Detect dp's m_draw extension, to work around it (for ss).
Cvar dpcompat_ignoremodificationtimes added. A value of 0 favour the most recently modified file, 1 will use DP-like alphabetically sorted preferences (for ss).
loadfont builtin can now accept outline=1 in the sizes arg for slightly more readable fonts.
Fix bbox calcs for rotated entities, fix needed for r_ignorenetpvs 0.
Hackily parse emoji.json to provide :poop: etc suggestions.
Skip prediction entirely when there's no local entity info. This fixes stair-smoothing in xonotic.
screenshot_cubemap will now capture half-float images when saving to ktx or dds files.
Fix support for xcf files larger than 4gb, mostly to avoid compiler warnings.
Fixed size of gfx/loading.lmp when replacement textures are used.
Added mipmap support for rg8 and l8a8 textures.
r_hdr_framebuffer cvar updated to support format names instead of random negative numbers. Description updated to name some interesting ones.
Perform autoupdate _checks_ ONLY with explicit user confirmation (actual updating already needed user confirmation, but this extra step should reduce the chances of us getting wrongly accused of exfiltrating user data if we're run in a sandbox - we ONLY ever included the updating engine's version in the checks, though there's nothing we can do to avoid sending the user's router's IP).
Removed the 'summon satan all over your harddrive' quit message, in case paranoid security researchers are idiots and don't bother doing actual research.
Removed the triptohell.info and fte.triptohell.info certificates, they really need to stop being self-signed. The updates domain is still self-signed for autoupdates.
Video drivers are now able to report supported video resolutions, visible to menuqc. Currently only works with SDL2 builds.
Added setmousepos builtin. Should work with glx+win32 build.
VF_SKYROOM_CAMERA can now accept an extra two args, setviewprop(VF_SKYROOM_CAMERA, org, axis, degrees).
Removed v_skyroom_origin+v_skyroom_orientation cvars in favour just v_skyroom, which should make it behave more like the 'fog' command (used when csqc isn't overriding).
Added R_EndPolygonRibbon builtin to make it faster+easier to generate textured ribbon/cable/etc wide lines (for TW).
sdl: Fix up sys_sdl.c's file enumeration to support wildcards in directories.
edit command now displays end1.bin/end2.bin correctly, because we can.
Finally add support for f_modified - though ruleset_allow_larger_models and ruleset_allow_overlong_sounds generally make it redundant.
Fix threading race condition in sha1 lookups.
Updated f_ruleset to include the same extra flags reported by ezquake.
A mod's default.fmf file can now contain an eg 'mainconfig config.cfg' line (to explicitly set the main config saved with cfg_save_auto 1 etc).
fmf: basegame steam:GameName/GameDir can be used to try to load a mod directory from an installed steam game. The resulting gamedir will be read-only.
HOMEDIR CHANGE: use homedirs only if the basedir cannot be written or a homedir already exists, which should further reduce the probability of microsoft randomly uploading our data to their cloud (but mostly because its annoying to never know where your data is written).
Fixed buf_cvarlist, should work in xonotic now, and without segfaults.
Added an extra arg to URI_Get_Callback calls - the response size, also changed the tempstring to contain all bytes of the response, you need to be careful about nulls though.
Try to work around nvidia's forced-panning bug on x11 when changing video modes. This might screw with other programs.
sdl: support custom icons.
sdl: support choosing a specific display.
Added some documentation to menuqc builtins.
menusys: use outlines for slightly more readable fonts.
menusys: switch vid_width and vid_height combos into a single video mode combo to set both according to reported video modes.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5581 fc73d0e0-1445-4013-8a0c-d673dee63da5
2019-11-20 03:09:50 +00:00
if ( man - > gamepath [ j ] . path & & ( man - > gamepath [ j ] . flags & GAMEDIR_BASEGAME ) )
2013-06-23 02:17:02 +00:00
break ;
2012-11-27 03:23:19 +00:00
}
2013-06-23 02:17:02 +00:00
if ( j = = sizeof ( man - > gamepath ) / sizeof ( man - > gamepath [ 0 ] ) )
2012-11-27 03:23:19 +00:00
{
for ( j = 0 ; j < 4 ; j + + )
2013-06-23 02:17:02 +00:00
if ( gamemode_info [ i ] . dir [ j ] )
2010-11-02 23:17:25 +00:00
{
2013-06-23 02:17:02 +00:00
Cmd_TokenizeString ( va ( " basegame \" %s \" " , gamemode_info [ i ] . dir [ j ] ) , false , false ) ;
FS_Manifest_ParseTokens ( man ) ;
2010-11-02 23:17:25 +00:00
}
2012-11-27 03:23:19 +00:00
}
2013-06-23 02:17:02 +00:00
2021-08-19 06:01:42 +00:00
if ( ! man - > schemes )
{
Cmd_TokenizeString ( va ( " schemes \" %s \" " , gamemode_info [ i ] . argname + 1 ) , false , false ) ;
FS_Manifest_ParseTokens ( man ) ;
}
2020-04-19 01:23:32 +00:00
# ifdef PACKAGEMANAGER
playdemo accepts https urls now. will start playing before the file has finished downloading, to avoid unnecessary delays.
reworked network addresses to separate address family and connection type. this should make banning people more reliable, as well as simplifying a whole load of logic (no need to check for ipv4 AND ipv6).
tcpconnect will keep trying to connect even if the connection wasn't instant, instead of giving up instantly.
rewrote tcp connections quite a bit. sv_port_tcp now handles qtv+qizmo+http+ws+rtcbroker+tls equivalents.
qtv_streamport is now a legacy cvar and now acts equivalently to sv_port_tcp (but still separate).
rewrote screenshot and video capture code to use strides. this solves image-is-upside down issues with vulkan.
ignore alt key in browser port. oh no! no more red text! oh no! no more alt-being-wrongly-down-and-being-unable-to-type-anything-without-forcing-alt-released!
reworked audio decoder interface. now has clearly defined success/unavailable/end-of-file results. this should solve a whole load of issues with audio streaming.
fixed various openal audio streaming issues too. openal also got some workarounds for emscripten's poor emulation.
fixed ogg decoder to retain sync properly if seeked.
updated menu_media a bit. now reads vorbis comments/id3v1 tags to get proper track names. also saves the playlist so you don't have to manually repopulate the list so it might actually be usable now (after how many years?)
r_stains now defaults to 0, and is no longer enabled by presets. use decals if you want that sort of thing.
added fs_noreexec cvar, so configs will not be reexeced on gamedir change. this also means defaults won't be reapplied, etc.
added 'nvvk' renderer on windows, using nvidia's vulkan-inside-opengl gl extension. mostly just to see how much slower it is.
fixed up the ftp server quite a lot. more complete, more compliant, and should do ipv6 properly to-boot. file transfers also threaded.
fixed potential crash inside runclientphys.
experimental sv_antilag=3 setting. totally untested. the aim is to avoid missing due to lagged knockbacks. may be expensive for the server.
browser port's websockets support fixed. experimental support for webrtc ('works for me', requires a broker server).
updated avplug(renamed to ffmpeg so people know what it is) to use ffmpeg 3.2.4 properly, with its new encoder api. should be much more robust... also added experimental audio decoder for game music etc (currently doesn't resample, so playback rates are screwed, disabled by cvar).
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5097 fc73d0e0-1445-4013-8a0c-d673dee63da5
2017-05-10 02:08:58 +00:00
if ( ! man - > downloadsurl & & gamemode_info [ i ] . downloadsurl )
2016-07-21 19:27:59 +00:00
{
Too many changes, sorry.
Change revision displays, use the SVN commit date instead of using __DATE__ (when there's no local changes). This should allow reproducible builds.
Added s_al_disable cvar, to block openal and all the various problems people have had with it, without having to name an explicit fallback (which would vary by system).
Add mastervolume cvar (for ss).
Add r_shadows 2 (aka fake shadows - for ss).
Add scr_loadingscreen_aspect -1 setting, to disable levelshots entirely, also disables the progress bar (for ss).
Better support for some effectinfo hacks (for ss).
Added dpcompat_nocsqcwarnings (because of lazy+buggy mods like ss).
Rework the dpcsqc versions of project+unproject builtins for better compat (for ss).
Added dpcompat_csqcinputeventtypes to block unexpected csqc input events (for ss).
Better compat with DP's loadfont console command (for ss).
Added dpcompat_smallerfonts cvar to replicate a DP bug (for ss).
Detect dp's m_draw extension, to work around it (for ss).
Cvar dpcompat_ignoremodificationtimes added. A value of 0 favour the most recently modified file, 1 will use DP-like alphabetically sorted preferences (for ss).
loadfont builtin can now accept outline=1 in the sizes arg for slightly more readable fonts.
Fix bbox calcs for rotated entities, fix needed for r_ignorenetpvs 0.
Hackily parse emoji.json to provide :poop: etc suggestions.
Skip prediction entirely when there's no local entity info. This fixes stair-smoothing in xonotic.
screenshot_cubemap will now capture half-float images when saving to ktx or dds files.
Fix support for xcf files larger than 4gb, mostly to avoid compiler warnings.
Fixed size of gfx/loading.lmp when replacement textures are used.
Added mipmap support for rg8 and l8a8 textures.
r_hdr_framebuffer cvar updated to support format names instead of random negative numbers. Description updated to name some interesting ones.
Perform autoupdate _checks_ ONLY with explicit user confirmation (actual updating already needed user confirmation, but this extra step should reduce the chances of us getting wrongly accused of exfiltrating user data if we're run in a sandbox - we ONLY ever included the updating engine's version in the checks, though there's nothing we can do to avoid sending the user's router's IP).
Removed the 'summon satan all over your harddrive' quit message, in case paranoid security researchers are idiots and don't bother doing actual research.
Removed the triptohell.info and fte.triptohell.info certificates, they really need to stop being self-signed. The updates domain is still self-signed for autoupdates.
Video drivers are now able to report supported video resolutions, visible to menuqc. Currently only works with SDL2 builds.
Added setmousepos builtin. Should work with glx+win32 build.
VF_SKYROOM_CAMERA can now accept an extra two args, setviewprop(VF_SKYROOM_CAMERA, org, axis, degrees).
Removed v_skyroom_origin+v_skyroom_orientation cvars in favour just v_skyroom, which should make it behave more like the 'fog' command (used when csqc isn't overriding).
Added R_EndPolygonRibbon builtin to make it faster+easier to generate textured ribbon/cable/etc wide lines (for TW).
sdl: Fix up sys_sdl.c's file enumeration to support wildcards in directories.
edit command now displays end1.bin/end2.bin correctly, because we can.
Finally add support for f_modified - though ruleset_allow_larger_models and ruleset_allow_overlong_sounds generally make it redundant.
Fix threading race condition in sha1 lookups.
Updated f_ruleset to include the same extra flags reported by ezquake.
A mod's default.fmf file can now contain an eg 'mainconfig config.cfg' line (to explicitly set the main config saved with cfg_save_auto 1 etc).
fmf: basegame steam:GameName/GameDir can be used to try to load a mod directory from an installed steam game. The resulting gamedir will be read-only.
HOMEDIR CHANGE: use homedirs only if the basedir cannot be written or a homedir already exists, which should further reduce the probability of microsoft randomly uploading our data to their cloud (but mostly because its annoying to never know where your data is written).
Fixed buf_cvarlist, should work in xonotic now, and without segfaults.
Added an extra arg to URI_Get_Callback calls - the response size, also changed the tempstring to contain all bytes of the response, you need to be careful about nulls though.
Try to work around nvidia's forced-panning bug on x11 when changing video modes. This might screw with other programs.
sdl: support custom icons.
sdl: support choosing a specific display.
Added some documentation to menuqc builtins.
menusys: use outlines for slightly more readable fonts.
menusys: switch vid_width and vid_height combos into a single video mode combo to set both according to reported video modes.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5581 fc73d0e0-1445-4013-8a0c-d673dee63da5
2019-11-20 03:09:50 +00:00
# ifndef FTE_TARGET_WEB
if ( * gamemode_info [ i ] . downloadsurl = = ' / ' )
{
conchar_t musite [ 256 ] , * e ;
char site [ 256 ] ;
char * oldprefix = " http://fte. " ;
char * newprefix = " https://updates. " ;
e = COM_ParseFunString ( CON_WHITEMASK , ENGINEWEBSITE , musite , sizeof ( musite ) , false ) ;
2020-02-11 18:06:10 +00:00
COM_DeFunString ( musite , e , site , sizeof ( site ) - 1 , true , true ) ;
Too many changes, sorry.
Change revision displays, use the SVN commit date instead of using __DATE__ (when there's no local changes). This should allow reproducible builds.
Added s_al_disable cvar, to block openal and all the various problems people have had with it, without having to name an explicit fallback (which would vary by system).
Add mastervolume cvar (for ss).
Add r_shadows 2 (aka fake shadows - for ss).
Add scr_loadingscreen_aspect -1 setting, to disable levelshots entirely, also disables the progress bar (for ss).
Better support for some effectinfo hacks (for ss).
Added dpcompat_nocsqcwarnings (because of lazy+buggy mods like ss).
Rework the dpcsqc versions of project+unproject builtins for better compat (for ss).
Added dpcompat_csqcinputeventtypes to block unexpected csqc input events (for ss).
Better compat with DP's loadfont console command (for ss).
Added dpcompat_smallerfonts cvar to replicate a DP bug (for ss).
Detect dp's m_draw extension, to work around it (for ss).
Cvar dpcompat_ignoremodificationtimes added. A value of 0 favour the most recently modified file, 1 will use DP-like alphabetically sorted preferences (for ss).
loadfont builtin can now accept outline=1 in the sizes arg for slightly more readable fonts.
Fix bbox calcs for rotated entities, fix needed for r_ignorenetpvs 0.
Hackily parse emoji.json to provide :poop: etc suggestions.
Skip prediction entirely when there's no local entity info. This fixes stair-smoothing in xonotic.
screenshot_cubemap will now capture half-float images when saving to ktx or dds files.
Fix support for xcf files larger than 4gb, mostly to avoid compiler warnings.
Fixed size of gfx/loading.lmp when replacement textures are used.
Added mipmap support for rg8 and l8a8 textures.
r_hdr_framebuffer cvar updated to support format names instead of random negative numbers. Description updated to name some interesting ones.
Perform autoupdate _checks_ ONLY with explicit user confirmation (actual updating already needed user confirmation, but this extra step should reduce the chances of us getting wrongly accused of exfiltrating user data if we're run in a sandbox - we ONLY ever included the updating engine's version in the checks, though there's nothing we can do to avoid sending the user's router's IP).
Removed the 'summon satan all over your harddrive' quit message, in case paranoid security researchers are idiots and don't bother doing actual research.
Removed the triptohell.info and fte.triptohell.info certificates, they really need to stop being self-signed. The updates domain is still self-signed for autoupdates.
Video drivers are now able to report supported video resolutions, visible to menuqc. Currently only works with SDL2 builds.
Added setmousepos builtin. Should work with glx+win32 build.
VF_SKYROOM_CAMERA can now accept an extra two args, setviewprop(VF_SKYROOM_CAMERA, org, axis, degrees).
Removed v_skyroom_origin+v_skyroom_orientation cvars in favour just v_skyroom, which should make it behave more like the 'fog' command (used when csqc isn't overriding).
Added R_EndPolygonRibbon builtin to make it faster+easier to generate textured ribbon/cable/etc wide lines (for TW).
sdl: Fix up sys_sdl.c's file enumeration to support wildcards in directories.
edit command now displays end1.bin/end2.bin correctly, because we can.
Finally add support for f_modified - though ruleset_allow_larger_models and ruleset_allow_overlong_sounds generally make it redundant.
Fix threading race condition in sha1 lookups.
Updated f_ruleset to include the same extra flags reported by ezquake.
A mod's default.fmf file can now contain an eg 'mainconfig config.cfg' line (to explicitly set the main config saved with cfg_save_auto 1 etc).
fmf: basegame steam:GameName/GameDir can be used to try to load a mod directory from an installed steam game. The resulting gamedir will be read-only.
HOMEDIR CHANGE: use homedirs only if the basedir cannot be written or a homedir already exists, which should further reduce the probability of microsoft randomly uploading our data to their cloud (but mostly because its annoying to never know where your data is written).
Fixed buf_cvarlist, should work in xonotic now, and without segfaults.
Added an extra arg to URI_Get_Callback calls - the response size, also changed the tempstring to contain all bytes of the response, you need to be careful about nulls though.
Try to work around nvidia's forced-panning bug on x11 when changing video modes. This might screw with other programs.
sdl: support custom icons.
sdl: support choosing a specific display.
Added some documentation to menuqc builtins.
menusys: use outlines for slightly more readable fonts.
menusys: switch vid_width and vid_height combos into a single video mode combo to set both according to reported video modes.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5581 fc73d0e0-1445-4013-8a0c-d673dee63da5
2019-11-20 03:09:50 +00:00
if ( ! strncmp ( site , oldprefix , strlen ( oldprefix ) ) )
{
2020-02-11 18:06:10 +00:00
memmove ( site + strlen ( newprefix ) , site + strlen ( oldprefix ) , strlen ( site ) - strlen ( oldprefix ) + 1 ) ;
Too many changes, sorry.
Change revision displays, use the SVN commit date instead of using __DATE__ (when there's no local changes). This should allow reproducible builds.
Added s_al_disable cvar, to block openal and all the various problems people have had with it, without having to name an explicit fallback (which would vary by system).
Add mastervolume cvar (for ss).
Add r_shadows 2 (aka fake shadows - for ss).
Add scr_loadingscreen_aspect -1 setting, to disable levelshots entirely, also disables the progress bar (for ss).
Better support for some effectinfo hacks (for ss).
Added dpcompat_nocsqcwarnings (because of lazy+buggy mods like ss).
Rework the dpcsqc versions of project+unproject builtins for better compat (for ss).
Added dpcompat_csqcinputeventtypes to block unexpected csqc input events (for ss).
Better compat with DP's loadfont console command (for ss).
Added dpcompat_smallerfonts cvar to replicate a DP bug (for ss).
Detect dp's m_draw extension, to work around it (for ss).
Cvar dpcompat_ignoremodificationtimes added. A value of 0 favour the most recently modified file, 1 will use DP-like alphabetically sorted preferences (for ss).
loadfont builtin can now accept outline=1 in the sizes arg for slightly more readable fonts.
Fix bbox calcs for rotated entities, fix needed for r_ignorenetpvs 0.
Hackily parse emoji.json to provide :poop: etc suggestions.
Skip prediction entirely when there's no local entity info. This fixes stair-smoothing in xonotic.
screenshot_cubemap will now capture half-float images when saving to ktx or dds files.
Fix support for xcf files larger than 4gb, mostly to avoid compiler warnings.
Fixed size of gfx/loading.lmp when replacement textures are used.
Added mipmap support for rg8 and l8a8 textures.
r_hdr_framebuffer cvar updated to support format names instead of random negative numbers. Description updated to name some interesting ones.
Perform autoupdate _checks_ ONLY with explicit user confirmation (actual updating already needed user confirmation, but this extra step should reduce the chances of us getting wrongly accused of exfiltrating user data if we're run in a sandbox - we ONLY ever included the updating engine's version in the checks, though there's nothing we can do to avoid sending the user's router's IP).
Removed the 'summon satan all over your harddrive' quit message, in case paranoid security researchers are idiots and don't bother doing actual research.
Removed the triptohell.info and fte.triptohell.info certificates, they really need to stop being self-signed. The updates domain is still self-signed for autoupdates.
Video drivers are now able to report supported video resolutions, visible to menuqc. Currently only works with SDL2 builds.
Added setmousepos builtin. Should work with glx+win32 build.
VF_SKYROOM_CAMERA can now accept an extra two args, setviewprop(VF_SKYROOM_CAMERA, org, axis, degrees).
Removed v_skyroom_origin+v_skyroom_orientation cvars in favour just v_skyroom, which should make it behave more like the 'fog' command (used when csqc isn't overriding).
Added R_EndPolygonRibbon builtin to make it faster+easier to generate textured ribbon/cable/etc wide lines (for TW).
sdl: Fix up sys_sdl.c's file enumeration to support wildcards in directories.
edit command now displays end1.bin/end2.bin correctly, because we can.
Finally add support for f_modified - though ruleset_allow_larger_models and ruleset_allow_overlong_sounds generally make it redundant.
Fix threading race condition in sha1 lookups.
Updated f_ruleset to include the same extra flags reported by ezquake.
A mod's default.fmf file can now contain an eg 'mainconfig config.cfg' line (to explicitly set the main config saved with cfg_save_auto 1 etc).
fmf: basegame steam:GameName/GameDir can be used to try to load a mod directory from an installed steam game. The resulting gamedir will be read-only.
HOMEDIR CHANGE: use homedirs only if the basedir cannot be written or a homedir already exists, which should further reduce the probability of microsoft randomly uploading our data to their cloud (but mostly because its annoying to never know where your data is written).
Fixed buf_cvarlist, should work in xonotic now, and without segfaults.
Added an extra arg to URI_Get_Callback calls - the response size, also changed the tempstring to contain all bytes of the response, you need to be careful about nulls though.
Try to work around nvidia's forced-panning bug on x11 when changing video modes. This might screw with other programs.
sdl: support custom icons.
sdl: support choosing a specific display.
Added some documentation to menuqc builtins.
menusys: use outlines for slightly more readable fonts.
menusys: switch vid_width and vid_height combos into a single video mode combo to set both according to reported video modes.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5581 fc73d0e0-1445-4013-8a0c-d673dee63da5
2019-11-20 03:09:50 +00:00
memcpy ( site , newprefix , strlen ( newprefix ) ) ;
}
Cmd_TokenizeString ( va ( " downloadsurl \" %s%s \" " , site , gamemode_info [ i ] . downloadsurl ) , false , false ) ;
}
else
# endif
Cmd_TokenizeString ( va ( " downloadsurl \" %s \" " , gamemode_info [ i ] . downloadsurl ) , false , false ) ;
2016-07-21 19:27:59 +00:00
FS_Manifest_ParseTokens ( man ) ;
}
2022-03-08 05:31:34 +00:00
if ( ! man - > installupd & & gamemode_info [ i ] . needpackages )
{
Cmd_TokenizeString ( va ( " install \" %s \" " , gamemode_info [ i ] . needpackages ) , false , false ) ;
FS_Manifest_ParseTokens ( man ) ;
}
2020-04-19 01:23:32 +00:00
# endif
2022-03-08 05:31:34 +00:00
2014-12-23 15:26:42 +00:00
if ( ! man - > protocolname )
2012-11-27 03:23:19 +00:00
{
2013-06-23 02:17:02 +00:00
Cmd_TokenizeString ( va ( " protocolname \" %s \" " , gamemode_info [ i ] . protocolname ) , false , false ) ;
FS_Manifest_ParseTokens ( man ) ;
}
if ( ! man - > defaultexec & & gamemode_info [ i ] . customexec )
{
2021-08-19 06:01:42 +00:00
const char * e = gamemode_info [ i ] . customexec ;
while ( e [ 0 ] = = ' / ' & & e [ 1 ] = = ' / ' )
{
e + = 2 ;
while ( * e )
{
if ( * e + + = = ' \n ' )
break ;
}
}
man - > defaultexec = Z_StrDup ( e ) ;
2009-03-03 01:52:30 +00:00
}
2013-06-23 02:17:02 +00:00
2013-10-29 17:38:22 +00:00
builtingame = true ;
2018-10-11 10:31:23 +00:00
if ( ! fixedbasedir )
{
if ( man - > basedir )
Q_strncpyz ( newbasedir , man - > basedir , sizeof ( newbasedir ) ) ;
else if ( ! FS_DirHasGame ( newbasedir , i ) )
if ( Sys_FindGameData ( man - > formalname , man - > installation , realpath , sizeof ( realpath ) , man - > security ! = MANIFEST_SECURITY_INSTALLER ) & & FS_FixPath ( realpath , sizeof ( realpath ) ) & & FS_DirHasGame ( realpath , i ) )
Q_strncpyz ( newbasedir , realpath , sizeof ( newbasedir ) ) ;
}
2013-06-23 02:17:02 +00:00
break ;
2009-03-03 01:52:30 +00:00
}
}
2005-08-26 22:52:26 +00:00
}
2013-10-29 17:38:22 +00:00
2015-04-14 23:12:17 +00:00
if ( ! fixedbasedir )
2014-03-31 17:06:41 +00:00
{
if ( ! builtingame & & ! fixedbasedir & & ! FS_DirHasAPackage ( newbasedir , man ) )
2015-04-14 23:12:17 +00:00
{
2017-03-04 19:36:06 +00:00
if ( Sys_FindGameData ( man - > formalname , man - > installation , realpath , sizeof ( realpath ) , man - > security ! = MANIFEST_SECURITY_INSTALLER ) & & FS_FixPath ( realpath , sizeof ( realpath ) ) & & FS_DirHasAPackage ( realpath , man ) )
2014-03-31 17:06:41 +00:00
Q_strncpyz ( newbasedir , realpath , sizeof ( newbasedir ) ) ;
2023-04-21 11:36:13 +00:00
else if ( man - > basedir )
Q_strncpyz ( newbasedir , man - > basedir , sizeof ( newbasedir ) ) ;
# if !defined(NOBUILTINMENUS) && defined(HAVE_CLIENT)
else if ( man ! = fs_manifest )
{
# ifdef PACKAGEMANAGER
Z_Free ( olddownloadsurl ) ;
# endif
M_Menu_BasedirPrompt ( man ) ;
return false ;
}
# endif
2018-12-28 00:04:36 +00:00
# ifdef HAVE_CLIENT
2015-04-14 23:12:17 +00:00
else
2020-04-19 01:23:32 +00:00
{ //no basedir known... switch to installer mode and ask the user where they want it (at least on windows)
Z_Free ( man - > filename ) ;
man - > filename = NULL ;
2015-04-14 23:12:17 +00:00
com_installer = true ;
}
2015-04-21 21:49:08 +00:00
# endif
2015-04-14 23:12:17 +00:00
}
2014-03-31 17:06:41 +00:00
}
2015-04-14 23:12:17 +00:00
if ( ! fixedbasedir & & ! com_installer )
2017-04-29 02:45:21 +00:00
{
if ( strcmp ( com_gamepath , newbasedir ) )
Added sys_openfile console command(and menu option) to web and flatpak(via cmake+dbus) builds, to 'install' packages on sandboxed systems a bit more easily.
Cmake: Add FTE_WERROR option, defaults to true in debug builds and off in release builds (in case future compilers have issues).
Cmake: Pull in libXscreensaver so we don't get interrupted by screensavers when playing demos.
Make: Added `make webcl-rel` for a web build without server bloat (eg for sites focused on demo playback. Yes, this means you XantoM).
fteqcc: Include the decompiler in fteqcc (non-gui) builds ('-d' arg).
fteqcc: Decompiler can now mostly handle hexen2 mods without any unknown opcodes.
Allow ezHud and OpenSSL to be compiled as in-engine plugins, potentially for web and windows ports respectively.
Web: Fix support for ogg vorbis. Add support for voip.
Web: Added basic support for WebXR.
QTV: Don't try seeking on unseekable qtv streams. Don't spam when developer 1 is set.
QTV: add support for some eztv extensions.
MVD: added hack to use ktx's vweps in mvd where mvdsv doesn't bother to record the info.
qwfwd: hack around a hack in qwfwd, allowing it to work again.
recording: favour qwd in single player, instead of mvd.
Protocol: reduce client memory used for precache names. Bump maximum precache counts - some people are just abusive, yes you Orl.
hexen2: add enough clientside protocol compat to play the demo included with h2mp. lacks effects.
in_xflip: restored this setting.
fs_hidesyspaths: new cvar, defaults to enabled so you won't find your username or whatever turning up in screenshots or the like. change it to 0 before debuging stuff eg via 'path'.
gl_overbright_models: Added cvar to match QS.
netchan: Added MTU determination, we'll no longer fail to connect when routers stupidly drop icmp packets.
Win: try a few other versions of xinput too.
CSQC: Added a CSQC_GenerateMaterial function, to give the csqc a chance to generate custom materials.
MenuQC: Added support for the skeletal objects API.
2024-04-09 17:13:59 +00:00
{
2017-04-29 02:45:21 +00:00
Q_strncpyz ( com_gamepath , newbasedir , sizeof ( com_gamepath ) ) ;
Added sys_openfile console command(and menu option) to web and flatpak(via cmake+dbus) builds, to 'install' packages on sandboxed systems a bit more easily.
Cmake: Add FTE_WERROR option, defaults to true in debug builds and off in release builds (in case future compilers have issues).
Cmake: Pull in libXscreensaver so we don't get interrupted by screensavers when playing demos.
Make: Added `make webcl-rel` for a web build without server bloat (eg for sites focused on demo playback. Yes, this means you XantoM).
fteqcc: Include the decompiler in fteqcc (non-gui) builds ('-d' arg).
fteqcc: Decompiler can now mostly handle hexen2 mods without any unknown opcodes.
Allow ezHud and OpenSSL to be compiled as in-engine plugins, potentially for web and windows ports respectively.
Web: Fix support for ogg vorbis. Add support for voip.
Web: Added basic support for WebXR.
QTV: Don't try seeking on unseekable qtv streams. Don't spam when developer 1 is set.
QTV: add support for some eztv extensions.
MVD: added hack to use ktx's vweps in mvd where mvdsv doesn't bother to record the info.
qwfwd: hack around a hack in qwfwd, allowing it to work again.
recording: favour qwd in single player, instead of mvd.
Protocol: reduce client memory used for precache names. Bump maximum precache counts - some people are just abusive, yes you Orl.
hexen2: add enough clientside protocol compat to play the demo included with h2mp. lacks effects.
in_xflip: restored this setting.
fs_hidesyspaths: new cvar, defaults to enabled so you won't find your username or whatever turning up in screenshots or the like. change it to 0 before debuging stuff eg via 'path'.
gl_overbright_models: Added cvar to match QS.
netchan: Added MTU determination, we'll no longer fail to connect when routers stupidly drop icmp packets.
Win: try a few other versions of xinput too.
CSQC: Added a CSQC_GenerateMaterial function, to give the csqc a chance to generate custom materials.
MenuQC: Added support for the skeletal objects API.
2024-04-09 17:13:59 +00:00
basedirchanged = true ;
}
2017-04-29 02:45:21 +00:00
}
2015-04-14 23:12:17 +00:00
2023-04-21 11:36:13 +00:00
//now that we know what we're running and where we're running it, we can switch to it.
if ( man = = fs_manifest )
{
//don't close anything. theoretically nothing is changing, and we don't want to load new defaults either.
}
else if ( ! fs_manifest | | ! strcmp ( fs_manifest - > installation ? fs_manifest - > installation : " " , man - > installation ? man - > installation : " " ) )
{
if ( ! fs_manifest )
Added sys_openfile console command(and menu option) to web and flatpak(via cmake+dbus) builds, to 'install' packages on sandboxed systems a bit more easily.
Cmake: Add FTE_WERROR option, defaults to true in debug builds and off in release builds (in case future compilers have issues).
Cmake: Pull in libXscreensaver so we don't get interrupted by screensavers when playing demos.
Make: Added `make webcl-rel` for a web build without server bloat (eg for sites focused on demo playback. Yes, this means you XantoM).
fteqcc: Include the decompiler in fteqcc (non-gui) builds ('-d' arg).
fteqcc: Decompiler can now mostly handle hexen2 mods without any unknown opcodes.
Allow ezHud and OpenSSL to be compiled as in-engine plugins, potentially for web and windows ports respectively.
Web: Fix support for ogg vorbis. Add support for voip.
Web: Added basic support for WebXR.
QTV: Don't try seeking on unseekable qtv streams. Don't spam when developer 1 is set.
QTV: add support for some eztv extensions.
MVD: added hack to use ktx's vweps in mvd where mvdsv doesn't bother to record the info.
qwfwd: hack around a hack in qwfwd, allowing it to work again.
recording: favour qwd in single player, instead of mvd.
Protocol: reduce client memory used for precache names. Bump maximum precache counts - some people are just abusive, yes you Orl.
hexen2: add enough clientside protocol compat to play the demo included with h2mp. lacks effects.
in_xflip: restored this setting.
fs_hidesyspaths: new cvar, defaults to enabled so you won't find your username or whatever turning up in screenshots or the like. change it to 0 before debuging stuff eg via 'path'.
gl_overbright_models: Added cvar to match QS.
netchan: Added MTU determination, we'll no longer fail to connect when routers stupidly drop icmp packets.
Win: try a few other versions of xinput too.
CSQC: Added a CSQC_GenerateMaterial function, to give the csqc a chance to generate custom materials.
MenuQC: Added support for the skeletal objects API.
2024-04-09 17:13:59 +00:00
{
basedirchanged = true ;
2023-04-21 11:36:13 +00:00
reloadconfigs = true ;
Added sys_openfile console command(and menu option) to web and flatpak(via cmake+dbus) builds, to 'install' packages on sandboxed systems a bit more easily.
Cmake: Add FTE_WERROR option, defaults to true in debug builds and off in release builds (in case future compilers have issues).
Cmake: Pull in libXscreensaver so we don't get interrupted by screensavers when playing demos.
Make: Added `make webcl-rel` for a web build without server bloat (eg for sites focused on demo playback. Yes, this means you XantoM).
fteqcc: Include the decompiler in fteqcc (non-gui) builds ('-d' arg).
fteqcc: Decompiler can now mostly handle hexen2 mods without any unknown opcodes.
Allow ezHud and OpenSSL to be compiled as in-engine plugins, potentially for web and windows ports respectively.
Web: Fix support for ogg vorbis. Add support for voip.
Web: Added basic support for WebXR.
QTV: Don't try seeking on unseekable qtv streams. Don't spam when developer 1 is set.
QTV: add support for some eztv extensions.
MVD: added hack to use ktx's vweps in mvd where mvdsv doesn't bother to record the info.
qwfwd: hack around a hack in qwfwd, allowing it to work again.
recording: favour qwd in single player, instead of mvd.
Protocol: reduce client memory used for precache names. Bump maximum precache counts - some people are just abusive, yes you Orl.
hexen2: add enough clientside protocol compat to play the demo included with h2mp. lacks effects.
in_xflip: restored this setting.
fs_hidesyspaths: new cvar, defaults to enabled so you won't find your username or whatever turning up in screenshots or the like. change it to 0 before debuging stuff eg via 'path'.
gl_overbright_models: Added cvar to match QS.
netchan: Added MTU determination, we'll no longer fail to connect when routers stupidly drop icmp packets.
Win: try a few other versions of xinput too.
CSQC: Added a CSQC_GenerateMaterial function, to give the csqc a chance to generate custom materials.
MenuQC: Added support for the skeletal objects API.
2024-04-09 17:13:59 +00:00
}
2023-04-21 11:36:13 +00:00
FS_Manifest_Free ( fs_manifest ) ;
}
else
{
FS_FreePaths ( ) ;
reloadconfigs = true ;
}
fs_manifest = man ;
# ifdef PACKAGEMANAGER
Added sys_openfile console command(and menu option) to web and flatpak(via cmake+dbus) builds, to 'install' packages on sandboxed systems a bit more easily.
Cmake: Add FTE_WERROR option, defaults to true in debug builds and off in release builds (in case future compilers have issues).
Cmake: Pull in libXscreensaver so we don't get interrupted by screensavers when playing demos.
Make: Added `make webcl-rel` for a web build without server bloat (eg for sites focused on demo playback. Yes, this means you XantoM).
fteqcc: Include the decompiler in fteqcc (non-gui) builds ('-d' arg).
fteqcc: Decompiler can now mostly handle hexen2 mods without any unknown opcodes.
Allow ezHud and OpenSSL to be compiled as in-engine plugins, potentially for web and windows ports respectively.
Web: Fix support for ogg vorbis. Add support for voip.
Web: Added basic support for WebXR.
QTV: Don't try seeking on unseekable qtv streams. Don't spam when developer 1 is set.
QTV: add support for some eztv extensions.
MVD: added hack to use ktx's vweps in mvd where mvdsv doesn't bother to record the info.
qwfwd: hack around a hack in qwfwd, allowing it to work again.
recording: favour qwd in single player, instead of mvd.
Protocol: reduce client memory used for precache names. Bump maximum precache counts - some people are just abusive, yes you Orl.
hexen2: add enough clientside protocol compat to play the demo included with h2mp. lacks effects.
in_xflip: restored this setting.
fs_hidesyspaths: new cvar, defaults to enabled so you won't find your username or whatever turning up in screenshots or the like. change it to 0 before debuging stuff eg via 'path'.
gl_overbright_models: Added cvar to match QS.
netchan: Added MTU determination, we'll no longer fail to connect when routers stupidly drop icmp packets.
Win: try a few other versions of xinput too.
CSQC: Added a CSQC_GenerateMaterial function, to give the csqc a chance to generate custom materials.
MenuQC: Added support for the skeletal objects API.
2024-04-09 17:13:59 +00:00
if ( basedirchanged )
PM_ManifestChanged ( man ) ;
2023-04-21 11:36:13 +00:00
if ( man - > security = = MANIFEST_SECURITY_NOT & & strcmp ( man - > downloadsurl ? man - > downloadsurl : " " , olddownloadsurl ? olddownloadsurl : " " ) )
{ //make sure we only fuck over the user if this is a 'secure' manifest, and not hacked in some way.
Z_Free ( man - > downloadsurl ) ;
man - > downloadsurl = olddownloadsurl ;
}
else
Z_Free ( olddownloadsurl ) ;
Added sys_openfile console command(and menu option) to web and flatpak(via cmake+dbus) builds, to 'install' packages on sandboxed systems a bit more easily.
Cmake: Add FTE_WERROR option, defaults to true in debug builds and off in release builds (in case future compilers have issues).
Cmake: Pull in libXscreensaver so we don't get interrupted by screensavers when playing demos.
Make: Added `make webcl-rel` for a web build without server bloat (eg for sites focused on demo playback. Yes, this means you XantoM).
fteqcc: Include the decompiler in fteqcc (non-gui) builds ('-d' arg).
fteqcc: Decompiler can now mostly handle hexen2 mods without any unknown opcodes.
Allow ezHud and OpenSSL to be compiled as in-engine plugins, potentially for web and windows ports respectively.
Web: Fix support for ogg vorbis. Add support for voip.
Web: Added basic support for WebXR.
QTV: Don't try seeking on unseekable qtv streams. Don't spam when developer 1 is set.
QTV: add support for some eztv extensions.
MVD: added hack to use ktx's vweps in mvd where mvdsv doesn't bother to record the info.
qwfwd: hack around a hack in qwfwd, allowing it to work again.
recording: favour qwd in single player, instead of mvd.
Protocol: reduce client memory used for precache names. Bump maximum precache counts - some people are just abusive, yes you Orl.
hexen2: add enough clientside protocol compat to play the demo included with h2mp. lacks effects.
in_xflip: restored this setting.
fs_hidesyspaths: new cvar, defaults to enabled so you won't find your username or whatever turning up in screenshots or the like. change it to 0 before debuging stuff eg via 'path'.
gl_overbright_models: Added cvar to match QS.
netchan: Added MTU determination, we'll no longer fail to connect when routers stupidly drop icmp packets.
Win: try a few other versions of xinput too.
CSQC: Added a CSQC_GenerateMaterial function, to give the csqc a chance to generate custom materials.
MenuQC: Added support for the skeletal objects API.
2024-04-09 17:13:59 +00:00
# else
( void ) basedirchanged ;
2023-04-21 11:36:13 +00:00
# endif
2013-06-23 02:17:02 +00:00
//make sure it has a trailing slash, or is empty. woo.
2014-03-30 08:55:06 +00:00
FS_CleanDir ( com_gamepath , sizeof ( com_gamepath ) ) ;
2014-12-23 15:26:42 +00:00
{
qboolean oldhome = com_homepathenabled ;
2018-10-23 07:09:06 +00:00
COM_InitHomedir ( man ) ;
2014-12-23 15:26:42 +00:00
if ( com_homepathenabled ! = oldhome )
{
if ( com_homepathenabled )
Con_TPrintf ( " Using home directory \" %s \" \n " , com_homepath ) ;
else
2018-08-02 20:10:43 +00:00
Con_TPrintf ( " Disabled home directory support \n " ) ;
2014-12-23 15:26:42 +00:00
}
}
2005-08-26 22:52:26 +00:00
2013-06-23 02:17:02 +00:00
# ifdef ANDROID
2005-08-26 22:52:26 +00:00
{
2016-02-10 23:23:43 +00:00
//write a .nomedia file to avoid people from getting random explosion sounds etc interspersed with their music
2013-06-23 02:17:02 +00:00
vfsfile_t * f ;
2016-02-10 23:23:43 +00:00
char nomedia [ MAX_OSPATH ] ;
//figure out the path we're going to end up writing to
if ( com_homepathenabled )
snprintf ( nomedia , sizeof ( nomedia ) , " %s%s " , com_homepath , " .nomedia " ) ;
else
snprintf ( nomedia , sizeof ( nomedia ) , " %s%s " , com_gamepath , " .nomedia " ) ;
//make sure it exists.
f = VFSOS_Open ( nomedia , " rb " ) ;
if ( ! f ) //don't truncate
{
COM_CreatePath ( nomedia ) ;
f = VFSOS_Open ( nomedia , " wb " ) ;
}
2013-06-23 02:17:02 +00:00
if ( f )
VFS_CLOSE ( f ) ;
}
# endif
2023-02-20 07:47:16 +00:00
//our basic filesystem should be okay, but no packages loaded yet.
# ifdef MANIFESTDOWNLOADS
//make sure the package manager knows what its meant to know...
Added sys_openfile console command(and menu option) to web and flatpak(via cmake+dbus) builds, to 'install' packages on sandboxed systems a bit more easily.
Cmake: Add FTE_WERROR option, defaults to true in debug builds and off in release builds (in case future compilers have issues).
Cmake: Pull in libXscreensaver so we don't get interrupted by screensavers when playing demos.
Make: Added `make webcl-rel` for a web build without server bloat (eg for sites focused on demo playback. Yes, this means you XantoM).
fteqcc: Include the decompiler in fteqcc (non-gui) builds ('-d' arg).
fteqcc: Decompiler can now mostly handle hexen2 mods without any unknown opcodes.
Allow ezHud and OpenSSL to be compiled as in-engine plugins, potentially for web and windows ports respectively.
Web: Fix support for ogg vorbis. Add support for voip.
Web: Added basic support for WebXR.
QTV: Don't try seeking on unseekable qtv streams. Don't spam when developer 1 is set.
QTV: add support for some eztv extensions.
MVD: added hack to use ktx's vweps in mvd where mvdsv doesn't bother to record the info.
qwfwd: hack around a hack in qwfwd, allowing it to work again.
recording: favour qwd in single player, instead of mvd.
Protocol: reduce client memory used for precache names. Bump maximum precache counts - some people are just abusive, yes you Orl.
hexen2: add enough clientside protocol compat to play the demo included with h2mp. lacks effects.
in_xflip: restored this setting.
fs_hidesyspaths: new cvar, defaults to enabled so you won't find your username or whatever turning up in screenshots or the like. change it to 0 before debuging stuff eg via 'path'.
gl_overbright_models: Added cvar to match QS.
netchan: Added MTU determination, we'll no longer fail to connect when routers stupidly drop icmp packets.
Win: try a few other versions of xinput too.
CSQC: Added a CSQC_GenerateMaterial function, to give the csqc a chance to generate custom materials.
MenuQC: Added support for the skeletal objects API.
2024-04-09 17:13:59 +00:00
PM_AddManifestPackages ( man , allowdownload ) ;
2023-02-20 07:47:16 +00:00
# endif
2014-10-05 20:04:11 +00:00
if ( Sys_LockMutex ( fs_thread_mutex ) )
{
2018-12-28 00:04:36 +00:00
# ifdef HAVE_CLIENT
2023-04-21 11:36:13 +00:00
int vidrestart = FS_GameIsInitialised ( ) ? false : 2 ;
2018-12-28 00:04:36 +00:00
# endif
2016-07-12 00:40:13 +00:00
2014-10-05 20:04:11 +00:00
FS_ReloadPackFilesFlags ( ~ 0 ) ;
2013-06-23 02:17:02 +00:00
2016-02-15 06:01:17 +00:00
Sys_UnlockMutex ( fs_thread_mutex ) ;
2014-10-05 20:04:11 +00:00
FS_BeginManifestUpdates ( ) ;
2013-06-23 02:17:02 +00:00
2018-12-28 00:04:36 +00:00
# ifdef MANIFESTDOWNLOADS
2020-04-19 01:23:32 +00:00
if ( FS_DownloadingPackage ( ) & & fs_loadedcommand )
2016-07-12 00:40:13 +00:00
allowreloadconfigs = false ;
# endif
2014-10-05 20:04:11 +00:00
COM_CheckRegistered ( ) ;
2013-06-23 02:17:02 +00:00
2018-12-28 00:04:36 +00:00
# ifdef HAVE_CLIENT
2023-04-21 11:36:13 +00:00
if ( qrenderer ! = QR_NONE & & allowvidrestart & & ! vidrestart )
2016-07-12 00:40:13 +00:00
{
for ( i = 0 ; i < countof ( vidfile ) ; i + + )
2015-08-20 03:17:47 +00:00
{
2016-07-12 00:40:13 +00:00
FS_FLocateFile ( vidfile [ i ] , FSLF_IFFOUND , & loc ) ;
if ( vidpath [ i ] ! = ( loc . search ? loc . search - > handle : NULL ) )
2015-08-20 03:17:47 +00:00
{
2016-07-12 00:40:13 +00:00
vidrestart = true ;
Con_DPrintf ( " Restarting video because %s has changed \n " , vidfile [ i ] ) ;
2015-08-20 03:17:47 +00:00
}
}
2016-07-12 00:40:13 +00:00
}
2018-12-28 00:04:36 +00:00
# endif
2015-08-20 03:17:47 +00:00
2016-07-12 00:40:13 +00:00
if ( allowreloadconfigs )
{
2019-07-16 02:59:12 +00:00
if ( ! reloadconfigs )
for ( i = 0 ; i < countof ( conffile ) ; i + + )
2014-10-05 20:04:11 +00:00
{
2019-07-16 02:59:12 +00:00
FS_FLocateFile ( conffile [ i ] , FSLF_IFFOUND | FSLF_IGNOREPURE , & loc ) ;
if ( confpath [ i ] ! = ( loc . search ? loc . search - > handle : NULL ) )
{
reloadconfigs = true ;
Con_DPrintf ( " Reloading configs because %s has changed \n " , conffile [ i ] ) ;
break ;
}
2014-10-05 20:04:11 +00:00
}
if ( reloadconfigs )
2013-06-23 02:17:02 +00:00
{
2014-12-29 02:35:10 +00:00
Cvar_SetEngineDefault ( & fs_gamename , man - > formalname ? man - > formalname : " FTE " ) ;
Cvar_SetEngineDefault ( & com_protocolname , man - > protocolname ? man - > protocolname : " FTE " ) ;
//FIXME: flag this instead and do it after a delay?
2014-12-23 15:26:42 +00:00
Cvar_ForceSet ( & fs_gamename , fs_gamename . enginevalue ) ;
Cvar_ForceSet ( & com_protocolname , com_protocolname . enginevalue ) ;
2014-10-05 20:04:11 +00:00
2018-12-28 00:04:36 +00:00
# ifdef HAVE_SERVER
2021-04-14 05:21:04 +00:00
if ( isDedicated )
2014-10-05 20:04:11 +00:00
SV_ExecInitialConfigs ( man - > defaultexec ? man - > defaultexec : " " ) ;
else
2021-04-14 05:21:04 +00:00
# endif
2018-12-28 00:04:36 +00:00
# ifdef HAVE_CLIENT
2021-04-14 05:21:04 +00:00
if ( 1 )
2023-04-21 11:36:13 +00:00
{
CL_ExecInitialConfigs ( man - > defaultexec ? man - > defaultexec : " " , vidrestart = = 2 ) ;
vidrestart = false ;
}
2021-04-14 05:21:04 +00:00
else
2018-12-28 00:04:36 +00:00
# endif
2021-04-14 05:21:04 +00:00
{
COM_ParsePlusSets ( true ) ;
Cbuf_Execute ( ) ;
2014-10-05 20:04:11 +00:00
}
2013-06-23 02:17:02 +00:00
}
2018-12-28 00:04:36 +00:00
# ifdef HAVE_CLIENT
2022-03-08 05:32:15 +00:00
if ( Cmd_Exists ( " ui_restart " ) ) //if we're running a q3 ui, restart it now...
Cbuf_InsertText ( " ui_restart \n " , RESTRICT_LOCAL , false ) ;
2018-12-28 00:04:36 +00:00
# endif
2022-03-08 05:32:15 +00:00
2016-07-12 00:40:13 +00:00
if ( fs_loadedcommand )
{
Cbuf_AddText ( fs_loadedcommand , RESTRICT_INSECURE ) ;
Z_Free ( fs_loadedcommand ) ;
fs_loadedcommand = NULL ;
}
}
2018-12-28 00:04:36 +00:00
# ifdef HAVE_CLIENT
2023-04-21 11:36:13 +00:00
if ( vidrestart = = 2 )
{ //done when we picked an initial mod to run (so managed to actually read user settings instead of being forced windowed)
Cbuf_AddText ( " vid_restart \n " , RESTRICT_LOCAL ) ;
vidrestart = false ;
}
else if ( vidrestart )
2016-07-12 00:40:13 +00:00
{
Cbuf_AddText ( " vid_reload \n " , RESTRICT_LOCAL ) ;
vidrestart = false ;
2013-06-23 02:17:02 +00:00
}
2023-02-20 07:47:16 +00:00
if ( qrenderer ! = QR_NONE & & allowreloadconfigs )
{
for ( i = 0 ; i < countof ( menufile ) ; i + + )
{
FS_FLocateFile ( menufile [ i ] , FSLF_IFFOUND , & loc ) ;
if ( menupath [ i ] ! = ( loc . search ? loc . search - > handle : NULL ) )
{
Cbuf_AddText ( " menu_restart \n " , RESTRICT_LOCAL ) ;
break ;
}
}
}
2018-12-28 00:04:36 +00:00
# endif
2014-02-07 08:38:40 +00:00
2014-10-05 20:04:11 +00:00
//rebuild the cache now, should be safe to waste some cycles on it
COM_FlushFSCache ( false , true ) ;
}
2010-12-05 02:46:07 +00:00
2018-12-28 00:04:36 +00:00
# ifdef HAVE_CLIENT
2013-06-23 02:17:02 +00:00
Validation_FlushFileList ( ) ; //prevent previous hacks from making a difference.
# endif
2014-03-30 08:55:06 +00:00
{
2015-04-21 04:12:00 +00:00
void ( QDECL * callback ) ( struct cvar_s * var , char * oldvalue ) = fs_game . callback ;
2014-03-30 08:55:06 +00:00
fs_game . callback = NULL ;
Cvar_ForceSet ( & fs_game , FS_GetGamedir ( false ) ) ;
fs_game . callback = callback ;
}
2022-03-08 05:31:34 +00:00
Cvar_ForceSet ( & fs_gamepath , va ( " %s%s " , com_gamepath , FS_GetGamedir ( false ) ) ) ;
Cvar_ForceSet ( & fs_basepath , com_gamepath ) ;
Cvar_ForceSet ( & fs_homepath , com_gamepath ) ;
2014-02-11 17:51:29 +00:00
2020-04-19 01:23:32 +00:00
Mods_FlushModList ( ) ;
2013-06-23 02:17:02 +00:00
return true ;
}
2015-04-14 23:12:17 +00:00
void FS_CreateBasedir ( const char * path )
{
vfsfile_t * f ;
com_installer = false ;
2019-03-15 04:01:46 +00:00
if ( path )
{
Q_strncpyz ( com_gamepath , path , sizeof ( com_gamepath ) ) ;
COM_CreatePath ( com_gamepath ) ;
}
2017-03-04 19:36:06 +00:00
fs_manifest - > security = MANIFEST_SECURITY_INSTALLER ;
2015-04-14 23:12:17 +00:00
FS_ChangeGame ( fs_manifest , true , false ) ;
2019-03-15 04:01:46 +00:00
if ( path & & host_parms . manifest )
2015-04-14 23:12:17 +00:00
{
f = FS_OpenVFS ( " default.fmf " , " wb " , FS_ROOT ) ;
if ( f )
{
VFS_WRITE ( f , host_parms . manifest , strlen ( host_parms . manifest ) ) ;
VFS_CLOSE ( f ) ;
}
}
}
2014-03-30 08:55:06 +00:00
typedef struct
{
2020-04-19 01:23:32 +00:00
qboolean anygamedir ;
const char * basedir ;
2014-03-30 08:55:06 +00:00
int found ;
2023-07-02 03:19:01 +00:00
qboolean ( * callback ) ( void * usr , ftemanifest_t * man , enum modsourcetype_e sourcetype ) ;
enum modsourcetype_e sourcetype ;
2014-03-30 08:55:06 +00:00
void * usr ;
} fmfenums_t ;
2020-04-19 01:23:32 +00:00
static int QDECL FS_EnumeratedFMF ( const char * fname , qofs_t fsize , time_t mtime , void * inf , searchpathfuncs_t * spath )
2014-03-30 08:55:06 +00:00
{
2020-04-19 01:23:32 +00:00
ftemanifest_t * man = NULL ;
2014-03-30 08:55:06 +00:00
fmfenums_t * e = inf ;
2020-04-19 01:23:32 +00:00
vfsfile_t * f = NULL ;
if ( spath )
2014-03-30 08:55:06 +00:00
{
2020-04-19 01:23:32 +00:00
flocation_t loc ;
if ( spath - > FindFile ( spath , & loc , fname , NULL ) )
2014-03-30 08:55:06 +00:00
{
2020-04-19 01:23:32 +00:00
f = spath - > OpenVFS ( spath , & loc , " rb " ) ;
if ( f )
2014-03-30 08:55:06 +00:00
{
2020-04-19 01:23:32 +00:00
size_t l = VFS_GETLEN ( f ) ;
char * data = Z_Malloc ( l + 1 ) ;
if ( data )
{
VFS_READ ( f , data , l ) ;
data [ l ] = 0 ; //just in case.
man = FS_Manifest_ReadMem ( NULL , e - > basedir , data ) ;
Z_Free ( data ) ;
}
VFS_CLOSE ( f ) ;
2014-03-30 08:55:06 +00:00
}
}
2020-04-19 01:23:32 +00:00
}
2023-04-21 11:36:13 +00:00
else if ( e - > basedir = = com_gamepath )
2020-04-19 01:23:32 +00:00
man = FS_Manifest_ReadMod ( fname ) ;
else
2023-04-21 11:36:13 +00:00
{
man = FS_Manifest_ReadSystem ( fname , e - > basedir ) ;
if ( man & & ! man - > basedir & & man - > installation & & * man - > installation )
{ //try and give it a proper gamedir...
char basedir [ MAX_OSPATH ] ;
//enables sources etc.
man - > security = MANIFEST_SECURITY_INSTALLER ;
if ( Sys_FindGameData ( NULL , man - > installation , basedir , sizeof ( basedir ) , false ) )
man - > basedir = Z_StrDup ( basedir ) ;
}
}
2020-04-19 01:23:32 +00:00
if ( man )
{
Added sys_openfile console command(and menu option) to web and flatpak(via cmake+dbus) builds, to 'install' packages on sandboxed systems a bit more easily.
Cmake: Add FTE_WERROR option, defaults to true in debug builds and off in release builds (in case future compilers have issues).
Cmake: Pull in libXscreensaver so we don't get interrupted by screensavers when playing demos.
Make: Added `make webcl-rel` for a web build without server bloat (eg for sites focused on demo playback. Yes, this means you XantoM).
fteqcc: Include the decompiler in fteqcc (non-gui) builds ('-d' arg).
fteqcc: Decompiler can now mostly handle hexen2 mods without any unknown opcodes.
Allow ezHud and OpenSSL to be compiled as in-engine plugins, potentially for web and windows ports respectively.
Web: Fix support for ogg vorbis. Add support for voip.
Web: Added basic support for WebXR.
QTV: Don't try seeking on unseekable qtv streams. Don't spam when developer 1 is set.
QTV: add support for some eztv extensions.
MVD: added hack to use ktx's vweps in mvd where mvdsv doesn't bother to record the info.
qwfwd: hack around a hack in qwfwd, allowing it to work again.
recording: favour qwd in single player, instead of mvd.
Protocol: reduce client memory used for precache names. Bump maximum precache counts - some people are just abusive, yes you Orl.
hexen2: add enough clientside protocol compat to play the demo included with h2mp. lacks effects.
in_xflip: restored this setting.
fs_hidesyspaths: new cvar, defaults to enabled so you won't find your username or whatever turning up in screenshots or the like. change it to 0 before debuging stuff eg via 'path'.
gl_overbright_models: Added cvar to match QS.
netchan: Added MTU determination, we'll no longer fail to connect when routers stupidly drop icmp packets.
Win: try a few other versions of xinput too.
CSQC: Added a CSQC_GenerateMaterial function, to give the csqc a chance to generate custom materials.
MenuQC: Added support for the skeletal objects API.
2024-04-09 17:13:59 +00:00
if ( ! e - > anygamedir & & man - > basedir & & strcmp ( man - > basedir , com_gamepath ) )
FS_Manifest_Free ( man ) ;
else if ( e - > callback ( e - > usr , man , e - > sourcetype ) )
2020-04-19 01:23:32 +00:00
e - > found + + ;
else
FS_Manifest_Free ( man ) ;
2014-03-30 08:55:06 +00:00
}
return true ;
}
2020-02-26 00:37:52 +00:00
//callback must call FS_Manifest_Free or return false.
Added sys_openfile console command(and menu option) to web and flatpak(via cmake+dbus) builds, to 'install' packages on sandboxed systems a bit more easily.
Cmake: Add FTE_WERROR option, defaults to true in debug builds and off in release builds (in case future compilers have issues).
Cmake: Pull in libXscreensaver so we don't get interrupted by screensavers when playing demos.
Make: Added `make webcl-rel` for a web build without server bloat (eg for sites focused on demo playback. Yes, this means you XantoM).
fteqcc: Include the decompiler in fteqcc (non-gui) builds ('-d' arg).
fteqcc: Decompiler can now mostly handle hexen2 mods without any unknown opcodes.
Allow ezHud and OpenSSL to be compiled as in-engine plugins, potentially for web and windows ports respectively.
Web: Fix support for ogg vorbis. Add support for voip.
Web: Added basic support for WebXR.
QTV: Don't try seeking on unseekable qtv streams. Don't spam when developer 1 is set.
QTV: add support for some eztv extensions.
MVD: added hack to use ktx's vweps in mvd where mvdsv doesn't bother to record the info.
qwfwd: hack around a hack in qwfwd, allowing it to work again.
recording: favour qwd in single player, instead of mvd.
Protocol: reduce client memory used for precache names. Bump maximum precache counts - some people are just abusive, yes you Orl.
hexen2: add enough clientside protocol compat to play the demo included with h2mp. lacks effects.
in_xflip: restored this setting.
fs_hidesyspaths: new cvar, defaults to enabled so you won't find your username or whatever turning up in screenshots or the like. change it to 0 before debuging stuff eg via 'path'.
gl_overbright_models: Added cvar to match QS.
netchan: Added MTU determination, we'll no longer fail to connect when routers stupidly drop icmp packets.
Win: try a few other versions of xinput too.
CSQC: Added a CSQC_GenerateMaterial function, to give the csqc a chance to generate custom materials.
MenuQC: Added support for the skeletal objects API.
2024-04-09 17:13:59 +00:00
int FS_EnumerateKnownGames ( qboolean ( * callback ) ( void * usr , ftemanifest_t * man , enum modsourcetype_e sourcetype ) , void * usr , qboolean fixedbasedir )
2014-03-30 08:55:06 +00:00
{
int i ;
char basedir [ MAX_OSPATH ] ;
fmfenums_t e ;
2020-04-19 01:23:32 +00:00
ftemanifest_t * man ;
Added sys_openfile console command(and menu option) to web and flatpak(via cmake+dbus) builds, to 'install' packages on sandboxed systems a bit more easily.
Cmake: Add FTE_WERROR option, defaults to true in debug builds and off in release builds (in case future compilers have issues).
Cmake: Pull in libXscreensaver so we don't get interrupted by screensavers when playing demos.
Make: Added `make webcl-rel` for a web build without server bloat (eg for sites focused on demo playback. Yes, this means you XantoM).
fteqcc: Include the decompiler in fteqcc (non-gui) builds ('-d' arg).
fteqcc: Decompiler can now mostly handle hexen2 mods without any unknown opcodes.
Allow ezHud and OpenSSL to be compiled as in-engine plugins, potentially for web and windows ports respectively.
Web: Fix support for ogg vorbis. Add support for voip.
Web: Added basic support for WebXR.
QTV: Don't try seeking on unseekable qtv streams. Don't spam when developer 1 is set.
QTV: add support for some eztv extensions.
MVD: added hack to use ktx's vweps in mvd where mvdsv doesn't bother to record the info.
qwfwd: hack around a hack in qwfwd, allowing it to work again.
recording: favour qwd in single player, instead of mvd.
Protocol: reduce client memory used for precache names. Bump maximum precache counts - some people are just abusive, yes you Orl.
hexen2: add enough clientside protocol compat to play the demo included with h2mp. lacks effects.
in_xflip: restored this setting.
fs_hidesyspaths: new cvar, defaults to enabled so you won't find your username or whatever turning up in screenshots or the like. change it to 0 before debuging stuff eg via 'path'.
gl_overbright_models: Added cvar to match QS.
netchan: Added MTU determination, we'll no longer fail to connect when routers stupidly drop icmp packets.
Win: try a few other versions of xinput too.
CSQC: Added a CSQC_GenerateMaterial function, to give the csqc a chance to generate custom materials.
MenuQC: Added support for the skeletal objects API.
2024-04-09 17:13:59 +00:00
e . anygamedir = ( ! fs_manifest | | ! * fs_manifest - > installation ) & & ! fixedbasedir ;
2014-03-30 08:55:06 +00:00
e . found = 0 ;
e . callback = callback ;
e . usr = usr ;
2020-04-19 01:23:32 +00:00
if ( e . anygamedir )
{
e . basedir = com_gamepath ;
man = FS_ReadDefaultManifest ( com_gamepath , 0 , true ) ;
if ( man )
{
2023-07-02 03:19:01 +00:00
if ( e . callback ( e . usr , man , MST_DEFAULT ) )
2020-04-19 01:23:32 +00:00
e . found + + ;
else
FS_Manifest_Free ( man ) ;
}
}
//okay, no manifests in the basepack, try looking in the basedir.
//this defaults to the working directory. perhaps try the exe's location instead?
e . basedir = com_gamepath ;
2023-07-02 03:19:01 +00:00
e . sourcetype = MST_BASEDIR ;
2020-04-19 01:23:32 +00:00
Sys_EnumerateFiles ( com_gamepath , " *.fmf " , FS_EnumeratedFMF , & e , NULL ) ;
if ( * com_homepath )
2023-07-02 03:19:01 +00:00
{
e . sourcetype = MST_HOMEDIR ;
2020-04-19 01:23:32 +00:00
Sys_EnumerateFiles ( com_homepath , " *.fmf " , FS_EnumeratedFMF , & e , NULL ) ;
2023-07-02 03:19:01 +00:00
}
2020-04-19 01:23:32 +00:00
Added sys_openfile console command(and menu option) to web and flatpak(via cmake+dbus) builds, to 'install' packages on sandboxed systems a bit more easily.
Cmake: Add FTE_WERROR option, defaults to true in debug builds and off in release builds (in case future compilers have issues).
Cmake: Pull in libXscreensaver so we don't get interrupted by screensavers when playing demos.
Make: Added `make webcl-rel` for a web build without server bloat (eg for sites focused on demo playback. Yes, this means you XantoM).
fteqcc: Include the decompiler in fteqcc (non-gui) builds ('-d' arg).
fteqcc: Decompiler can now mostly handle hexen2 mods without any unknown opcodes.
Allow ezHud and OpenSSL to be compiled as in-engine plugins, potentially for web and windows ports respectively.
Web: Fix support for ogg vorbis. Add support for voip.
Web: Added basic support for WebXR.
QTV: Don't try seeking on unseekable qtv streams. Don't spam when developer 1 is set.
QTV: add support for some eztv extensions.
MVD: added hack to use ktx's vweps in mvd where mvdsv doesn't bother to record the info.
qwfwd: hack around a hack in qwfwd, allowing it to work again.
recording: favour qwd in single player, instead of mvd.
Protocol: reduce client memory used for precache names. Bump maximum precache counts - some people are just abusive, yes you Orl.
hexen2: add enough clientside protocol compat to play the demo included with h2mp. lacks effects.
in_xflip: restored this setting.
fs_hidesyspaths: new cvar, defaults to enabled so you won't find your username or whatever turning up in screenshots or the like. change it to 0 before debuging stuff eg via 'path'.
gl_overbright_models: Added cvar to match QS.
netchan: Added MTU determination, we'll no longer fail to connect when routers stupidly drop icmp packets.
Win: try a few other versions of xinput too.
CSQC: Added a CSQC_GenerateMaterial function, to give the csqc a chance to generate custom materials.
MenuQC: Added support for the skeletal objects API.
2024-04-09 17:13:59 +00:00
// if (e.anygamedir)
2020-04-19 01:23:32 +00:00
{
2023-04-21 11:36:13 +00:00
# ifdef __unix__
const char * dirs = getenv ( " XDG_CONFIG_DIRS " ) ;
if ( ! dirs | | ! * dirs )
dirs = " /etc/xdg " ;
2020-04-19 01:23:32 +00:00
e . basedir = NULL ;
2023-07-02 03:19:01 +00:00
e . sourcetype = MST_SYSTEM ;
2023-04-21 11:36:13 +00:00
while ( dirs & & * dirs )
{
dirs = COM_ParseStringSetSep ( dirs , ' : ' , basedir , sizeof ( basedir ) ) ;
2023-07-02 03:19:01 +00:00
if ( * basedir )
FS_CleanDir ( basedir , sizeof ( basedir ) ) ;
Q_strncatz ( basedir , " fteqw/*.fmf " , sizeof ( basedir ) ) ;
2023-04-21 11:36:13 +00:00
Sys_EnumerateFiles ( NULL , basedir , FS_EnumeratedFMF , & e , NULL ) ;
}
2020-04-19 01:23:32 +00:00
# endif
}
2014-03-30 08:55:06 +00:00
//-basepack is primarily an android feature, where the apk file is specified.
//this allows custom mods purely by customising the apk
2020-04-19 01:23:32 +00:00
e . basedir = host_parms . basedir ;
2023-07-02 03:19:01 +00:00
e . sourcetype = MST_SYSTEM ;
2014-03-30 08:55:06 +00:00
i = COM_CheckParm ( " -basepack " ) ;
while ( i & & i < com_argc - 1 )
{
const char * pakname = com_argv [ i + 1 ] ;
searchpathfuncs_t * pak ;
vfsfile_t * vfs = VFSOS_Open ( pakname , " rb " ) ;
2023-04-21 11:36:13 +00:00
pak = FS_OpenPackByExtension ( vfs , NULL , pakname , pakname , " " ) ;
2014-03-30 08:55:06 +00:00
if ( pak )
{
2020-04-19 01:23:32 +00:00
pak - > EnumerateFiles ( pak , " *.fmf " , FS_EnumeratedFMF , & e ) ;
2014-03-30 08:55:06 +00:00
pak - > ClosePath ( pak ) ;
}
i = COM_CheckNextParm ( " -basepack " , i ) ;
}
//right, no fmf files anywhere.
//just make stuff up from whatever games they may have installed on their system.
2020-04-19 01:23:32 +00:00
for ( i = 0 ; gamemode_info [ i ] . argname ; i + + )
2014-03-30 08:55:06 +00:00
{
2020-04-19 01:23:32 +00:00
Q_strncpyz ( basedir , com_gamepath , sizeof ( basedir ) ) ;
if ( gamemode_info [ i ] . manifestfile | |
2023-07-02 03:19:01 +00:00
( ( gamemode_info [ i ] . exename | | ( i > 0 & & gamemode_info [ i ] . customexec & & gamemode_info [ i - 1 ] . customexec & & strcmp ( gamemode_info [ i ] . customexec , gamemode_info [ i - 1 ] . customexec ) ) ) & & FS_DirHasGame ( basedir , i ) ) | |
2023-04-03 00:33:35 +00:00
( e . anygamedir & & Sys_FindGameData ( NULL , gamemode_info [ i ] . argname + 1 , basedir , sizeof ( basedir ) , false ) ) )
2014-03-30 08:55:06 +00:00
{
2020-04-19 01:23:32 +00:00
man = FS_GenerateLegacyManifest ( i , basedir ) ;
2023-07-02 03:19:01 +00:00
if ( e . callback ( e . usr , man , MST_INTRINSIC ) )
2020-04-19 01:23:32 +00:00
e . found + + ;
else
FS_Manifest_Free ( man ) ;
2014-03-30 08:55:06 +00:00
}
}
2016-09-01 14:31:24 +00:00
return e . found ;
2014-03-30 08:55:06 +00:00
}
2014-10-11 19:39:45 +00:00
//attempts to find a new basedir for 'input', changing to it as appropriate
//returns fixed up filename relative to the new gamedir.
//input must be an absolute path.
qboolean FS_FixupGamedirForExternalFile ( char * input , char * filename , size_t fnamelen )
{
char syspath [ MAX_OSPATH ] ;
char gamepath [ MAX_OSPATH ] ;
void * iterator ;
char * sep , * bs ;
char * src = NULL ;
Q_strncpyz ( filename , input , fnamelen ) ;
iterator = NULL ;
while ( COM_IteratePaths ( & iterator , syspath , sizeof ( syspath ) , gamepath , sizeof ( gamepath ) ) )
{
if ( ! Q_strncasecmp ( syspath , filename , strlen ( syspath ) ) )
{
src = filename + strlen ( syspath ) ;
memmove ( filename , src , strlen ( src ) + 1 ) ;
break ;
}
}
if ( ! src )
{
for ( ; ; )
{
sep = strchr ( filename , ' \\ ' ) ;
if ( sep )
* sep = ' / ' ;
else
break ;
}
for ( sep = NULL ; ; )
{
bs = sep ;
sep = strrchr ( filename , ' / ' ) ;
if ( bs )
* bs = ' / ' ;
if ( sep )
{
int game ;
* sep = 0 ;
if ( strchr ( filename , ' / ' ) ) //make sure there's always at least one /
{
char temp [ MAX_OSPATH ] ;
Q_snprintfz ( temp , sizeof ( temp ) , " %s/ " , filename ) ;
game = FS_IdentifyDefaultGameFromDir ( temp ) ;
if ( game ! = - 1 )
{
static char newbase [ MAX_OSPATH ] ;
if ( ! host_parms . basedir | | strcmp ( host_parms . basedir , filename ) )
{
Con_Printf ( " switching basedir+game to %s for %s \n " , filename , input ) ;
Q_strncpyz ( newbase , filename , sizeof ( newbase ) ) ;
host_parms . basedir = newbase ;
2020-04-19 01:23:32 +00:00
FS_ChangeGame ( FS_GenerateLegacyManifest ( game , newbase ) , true , true ) ;
2014-10-11 19:39:45 +00:00
}
* sep = ' / ' ;
sep = NULL ;
src = filename + strlen ( host_parms . basedir ) ;
memmove ( filename , src , strlen ( src ) + 1 ) ;
break ;
}
}
}
else
break ;
}
if ( sep )
* sep = ' / ' ;
}
if ( ! src & & host_parms . binarydir & & ! Q_strncasecmp ( host_parms . binarydir , filename , strlen ( host_parms . binarydir ) ) )
{
src = filename + strlen ( host_parms . binarydir ) ;
memmove ( filename , src , strlen ( src ) + 1 ) ;
}
if ( ! src & & host_parms . basedir & & ! Q_strncasecmp ( host_parms . basedir , filename , strlen ( host_parms . basedir ) ) )
{
src = filename + strlen ( host_parms . basedir ) ;
memmove ( filename , src , strlen ( src ) + 1 ) ;
}
if ( ! src )
{
Q_snprintfz ( filename , fnamelen , " #%s " , input ) ;
return false ;
}
if ( * filename = = ' / ' | | * filename = = ' \\ ' )
memmove ( filename , filename + 1 , strlen ( filename + 1 ) + 1 ) ;
sep = strchr ( filename , ' / ' ) ;
bs = strchr ( filename , ' \\ ' ) ;
if ( bs & & ( ! sep | | bs < sep ) )
sep = bs ;
if ( sep )
{
Con_Printf ( " switching gamedir for %s \n " , filename ) ;
* sep = 0 ;
2015-05-14 03:06:58 +00:00
COM_Gamedir ( filename , NULL ) ;
2014-10-11 19:39:45 +00:00
memmove ( filename , sep + 1 , strlen ( sep + 1 ) + 1 ) ;
return true ;
}
Q_snprintfz ( filename , fnamelen , " #%s " , input ) ;
return false ;
}
2022-03-08 05:31:34 +00:00
void Cvar_GamedirChange ( void ) ;
void Plug_Shutdown ( qboolean preliminary ) ;
2020-04-19 01:23:32 +00:00
/*mod listing management*/
static struct modlist_s * modlist ;
static size_t nummods ;
static qboolean modsinited ;
void Mods_FlushModList ( void )
{
while ( nummods )
{
nummods - - ;
if ( modlist [ nummods ] . manifest )
FS_Manifest_Free ( modlist [ nummods ] . manifest ) ;
if ( modlist [ nummods ] . description )
Z_Free ( modlist [ nummods ] . description ) ;
if ( modlist [ nummods ] . gamedir )
Z_Free ( modlist [ nummods ] . gamedir ) ;
}
if ( modlist )
Z_Free ( modlist ) ;
modlist = NULL ;
modsinited = false ;
}
2023-07-02 03:19:01 +00:00
static qboolean Mods_AddManifest ( void * usr , ftemanifest_t * man , enum modsourcetype_e sourcetype )
2020-04-19 01:23:32 +00:00
{
int p , best = - 1 ;
int i = nummods ;
2023-07-02 03:19:01 +00:00
switch ( sourcetype )
{
case MST_SYSTEM : //part of the app's install or via some other system package that should be found upfront.
case MST_INTRINSIC : //embedded into the engine (very little info)
//if we seem to already know about this game in the same basedir then assume its a dupe. don't care
//note that intrinsics are ignored entirely if someone took the time to make any other kind of fmf for that basedir.
for ( p = 0 ; p < nummods ; p + + )
{
Added sys_openfile console command(and menu option) to web and flatpak(via cmake+dbus) builds, to 'install' packages on sandboxed systems a bit more easily.
Cmake: Add FTE_WERROR option, defaults to true in debug builds and off in release builds (in case future compilers have issues).
Cmake: Pull in libXscreensaver so we don't get interrupted by screensavers when playing demos.
Make: Added `make webcl-rel` for a web build without server bloat (eg for sites focused on demo playback. Yes, this means you XantoM).
fteqcc: Include the decompiler in fteqcc (non-gui) builds ('-d' arg).
fteqcc: Decompiler can now mostly handle hexen2 mods without any unknown opcodes.
Allow ezHud and OpenSSL to be compiled as in-engine plugins, potentially for web and windows ports respectively.
Web: Fix support for ogg vorbis. Add support for voip.
Web: Added basic support for WebXR.
QTV: Don't try seeking on unseekable qtv streams. Don't spam when developer 1 is set.
QTV: add support for some eztv extensions.
MVD: added hack to use ktx's vweps in mvd where mvdsv doesn't bother to record the info.
qwfwd: hack around a hack in qwfwd, allowing it to work again.
recording: favour qwd in single player, instead of mvd.
Protocol: reduce client memory used for precache names. Bump maximum precache counts - some people are just abusive, yes you Orl.
hexen2: add enough clientside protocol compat to play the demo included with h2mp. lacks effects.
in_xflip: restored this setting.
fs_hidesyspaths: new cvar, defaults to enabled so you won't find your username or whatever turning up in screenshots or the like. change it to 0 before debuging stuff eg via 'path'.
gl_overbright_models: Added cvar to match QS.
netchan: Added MTU determination, we'll no longer fail to connect when routers stupidly drop icmp packets.
Win: try a few other versions of xinput too.
CSQC: Added a CSQC_GenerateMaterial function, to give the csqc a chance to generate custom materials.
MenuQC: Added support for the skeletal objects API.
2024-04-09 17:13:59 +00:00
if ( modlist [ p ] . manifest & &
! strcmp ( modlist [ p ] . manifest - > basedir ? modlist [ p ] . manifest - > basedir : " " , man - > basedir ? man - > basedir : " " ) & &
! strcmp ( modlist [ p ] . manifest - > mainconfig ? modlist [ p ] . manifest - > mainconfig : " " , man - > mainconfig ? man - > mainconfig : " " ) & &
( ( modlist [ p ] . sourcetype ! = MST_INTRINSIC & & sourcetype = = MST_INTRINSIC ) | | ! Q_strcasecmp ( modlist [ p ] . manifest - > installation , man - > installation ) ) )
2023-07-02 03:19:01 +00:00
return false ;
}
break ;
case MST_DEFAULT : //the default.fmf (basically MST_BASEDIR, but posh)
case MST_BASEDIR : //fmf found inside the basedir we're using (yeah, weird, you'll have to pick the base game to switch basedir first).
case MST_HOMEDIR : //fmf found inside the homedir of the mod we're using (yeah, weird, you'll have to pick the base game first)
case MST_GAMEDIR : //found inside a gamedir...
case MST_UNKNOWN : //shouldn't really be hit.
break ;
}
2020-04-19 01:23:32 +00:00
for ( p = 0 ; p < countof ( man - > gamepath ) ; p + + )
if ( man - > gamepath [ p ] . path )
{
if ( man - > gamepath [ p ] . flags & ( GAMEDIR_PRIVATE | GAMEDIR_STEAMGAME ) )
continue ; //don't pick paths that don't make sense to others.
if ( ! ( man - > gamepath [ p ] . flags & GAMEDIR_BASEGAME ) | | ( best < 0 | | ( man - > gamepath [ best ] . flags & GAMEDIR_BASEGAME ) ) )
best = p ;
}
if ( best < 0 )
2024-04-25 05:57:34 +00:00
{
modlist = BZ_Realloc ( modlist , ( i + 1 ) * sizeof ( * modlist ) ) ;
modlist [ i ] . manifest = man ;
modlist [ i ] . sourcetype = sourcetype ;
modlist [ i ] . gamedir = Z_StrDup ( " ? " ) ;
modlist [ i ] . description = man - > formalname ? Z_StrDup ( man - > formalname ) : NULL ;
nummods = i + 1 ;
return true ; //no gamedirs? wut? some partially-defined game we don't recognise?
}
2020-04-19 01:23:32 +00:00
modlist = BZ_Realloc ( modlist , ( i + 1 ) * sizeof ( * modlist ) ) ;
modlist [ i ] . manifest = man ;
2023-07-02 03:19:01 +00:00
modlist [ i ] . sourcetype = sourcetype ;
2020-04-19 01:23:32 +00:00
modlist [ i ] . gamedir = Z_StrDup ( man - > gamepath [ best ] . path ) ;
modlist [ i ] . description = man - > formalname ? Z_StrDup ( man - > formalname ) : NULL ;
nummods = i + 1 ;
return true ;
}
static int Mods_WasPackageOrDatFound ( const char * fname , qofs_t ofs , time_t modtime , void * usr , searchpathfuncs_t * spath )
{ //we check for *.dat too, because we care about [qw]progs.dat/menu.dat/csprogs.dat or possibly addons. hopefully we can get away with such a generic extension.
const char * ext = COM_GetFileExtension ( fname , NULL ) ;
Added sys_openfile console command(and menu option) to web and flatpak(via cmake+dbus) builds, to 'install' packages on sandboxed systems a bit more easily.
Cmake: Add FTE_WERROR option, defaults to true in debug builds and off in release builds (in case future compilers have issues).
Cmake: Pull in libXscreensaver so we don't get interrupted by screensavers when playing demos.
Make: Added `make webcl-rel` for a web build without server bloat (eg for sites focused on demo playback. Yes, this means you XantoM).
fteqcc: Include the decompiler in fteqcc (non-gui) builds ('-d' arg).
fteqcc: Decompiler can now mostly handle hexen2 mods without any unknown opcodes.
Allow ezHud and OpenSSL to be compiled as in-engine plugins, potentially for web and windows ports respectively.
Web: Fix support for ogg vorbis. Add support for voip.
Web: Added basic support for WebXR.
QTV: Don't try seeking on unseekable qtv streams. Don't spam when developer 1 is set.
QTV: add support for some eztv extensions.
MVD: added hack to use ktx's vweps in mvd where mvdsv doesn't bother to record the info.
qwfwd: hack around a hack in qwfwd, allowing it to work again.
recording: favour qwd in single player, instead of mvd.
Protocol: reduce client memory used for precache names. Bump maximum precache counts - some people are just abusive, yes you Orl.
hexen2: add enough clientside protocol compat to play the demo included with h2mp. lacks effects.
in_xflip: restored this setting.
fs_hidesyspaths: new cvar, defaults to enabled so you won't find your username or whatever turning up in screenshots or the like. change it to 0 before debuging stuff eg via 'path'.
gl_overbright_models: Added cvar to match QS.
netchan: Added MTU determination, we'll no longer fail to connect when routers stupidly drop icmp packets.
Win: try a few other versions of xinput too.
CSQC: Added a CSQC_GenerateMaterial function, to give the csqc a chance to generate custom materials.
MenuQC: Added support for the skeletal objects API.
2024-04-09 17:13:59 +00:00
if ( ! Q_strcasecmp ( ext , " .pk3 " ) | | ! Q_strcasecmp ( ext , " .pak " ) | | ! Q_strcasecmp ( ext , " .dat " ) )
2020-04-19 01:23:32 +00:00
return false ; //found one, can stop searching now
//FIXME: pk3dir
return true ; //keep looking for one
}
static int Mods_WasMapFound ( const char * fname , qofs_t ofs , time_t modtime , void * usr , searchpathfuncs_t * spath )
{
const char * ext = COM_GetFileExtension ( fname , NULL ) ;
Added sys_openfile console command(and menu option) to web and flatpak(via cmake+dbus) builds, to 'install' packages on sandboxed systems a bit more easily.
Cmake: Add FTE_WERROR option, defaults to true in debug builds and off in release builds (in case future compilers have issues).
Cmake: Pull in libXscreensaver so we don't get interrupted by screensavers when playing demos.
Make: Added `make webcl-rel` for a web build without server bloat (eg for sites focused on demo playback. Yes, this means you XantoM).
fteqcc: Include the decompiler in fteqcc (non-gui) builds ('-d' arg).
fteqcc: Decompiler can now mostly handle hexen2 mods without any unknown opcodes.
Allow ezHud and OpenSSL to be compiled as in-engine plugins, potentially for web and windows ports respectively.
Web: Fix support for ogg vorbis. Add support for voip.
Web: Added basic support for WebXR.
QTV: Don't try seeking on unseekable qtv streams. Don't spam when developer 1 is set.
QTV: add support for some eztv extensions.
MVD: added hack to use ktx's vweps in mvd where mvdsv doesn't bother to record the info.
qwfwd: hack around a hack in qwfwd, allowing it to work again.
recording: favour qwd in single player, instead of mvd.
Protocol: reduce client memory used for precache names. Bump maximum precache counts - some people are just abusive, yes you Orl.
hexen2: add enough clientside protocol compat to play the demo included with h2mp. lacks effects.
in_xflip: restored this setting.
fs_hidesyspaths: new cvar, defaults to enabled so you won't find your username or whatever turning up in screenshots or the like. change it to 0 before debuging stuff eg via 'path'.
gl_overbright_models: Added cvar to match QS.
netchan: Added MTU determination, we'll no longer fail to connect when routers stupidly drop icmp packets.
Win: try a few other versions of xinput too.
CSQC: Added a CSQC_GenerateMaterial function, to give the csqc a chance to generate custom materials.
MenuQC: Added support for the skeletal objects API.
2024-04-09 17:13:59 +00:00
if ( ! Q_strcasecmp ( ext , " .gz " ) )
ext = COM_GetFileExtension ( fname , ext ) ;
2020-04-19 01:23:32 +00:00
//don't bother looking for .map
Added sys_openfile console command(and menu option) to web and flatpak(via cmake+dbus) builds, to 'install' packages on sandboxed systems a bit more easily.
Cmake: Add FTE_WERROR option, defaults to true in debug builds and off in release builds (in case future compilers have issues).
Cmake: Pull in libXscreensaver so we don't get interrupted by screensavers when playing demos.
Make: Added `make webcl-rel` for a web build without server bloat (eg for sites focused on demo playback. Yes, this means you XantoM).
fteqcc: Include the decompiler in fteqcc (non-gui) builds ('-d' arg).
fteqcc: Decompiler can now mostly handle hexen2 mods without any unknown opcodes.
Allow ezHud and OpenSSL to be compiled as in-engine plugins, potentially for web and windows ports respectively.
Web: Fix support for ogg vorbis. Add support for voip.
Web: Added basic support for WebXR.
QTV: Don't try seeking on unseekable qtv streams. Don't spam when developer 1 is set.
QTV: add support for some eztv extensions.
MVD: added hack to use ktx's vweps in mvd where mvdsv doesn't bother to record the info.
qwfwd: hack around a hack in qwfwd, allowing it to work again.
recording: favour qwd in single player, instead of mvd.
Protocol: reduce client memory used for precache names. Bump maximum precache counts - some people are just abusive, yes you Orl.
hexen2: add enough clientside protocol compat to play the demo included with h2mp. lacks effects.
in_xflip: restored this setting.
fs_hidesyspaths: new cvar, defaults to enabled so you won't find your username or whatever turning up in screenshots or the like. change it to 0 before debuging stuff eg via 'path'.
gl_overbright_models: Added cvar to match QS.
netchan: Added MTU determination, we'll no longer fail to connect when routers stupidly drop icmp packets.
Win: try a few other versions of xinput too.
CSQC: Added a CSQC_GenerateMaterial function, to give the csqc a chance to generate custom materials.
MenuQC: Added support for the skeletal objects API.
2024-04-09 17:13:59 +00:00
if ( ! Q_strcasecmp ( ext , " .bsp " ) | | ! Q_strcasecmp ( ext , " .hmp " ) | |
! Q_strcasecmp ( ext , " .bsp.gz " ) | | ! Q_strcasecmp ( ext , " .hmp.gz " ) )
2020-04-19 01:23:32 +00:00
return false ; //found one, can stop searching now
return true ; //keep looking for one
}
static int QDECL Mods_AddGamedir ( const char * fname , qofs_t fsize , time_t mtime , void * usr , searchpathfuncs_t * spath )
{
char * desc ;
size_t l = strlen ( fname ) ;
int i , p ;
char gamedir [ MAX_QPATH ] ;
const char * basedir = usr ;
if ( l & & fname [ l - 1 ] = = ' / ' & & l < countof ( gamedir ) )
{
l - - ;
memcpy ( gamedir , fname , l ) ;
gamedir [ l ] = 0 ;
for ( i = 0 ; i < nummods ; i + + )
{
//don't add dupes (can happen from basedir+homedir)
//if the gamedir was already included in one of the manifests, don't bother including it again.
//this generally removes id1.
if ( modlist [ i ] . manifest )
{
for ( p = 0 ; p < countof ( fs_manifest - > gamepath ) ; p + + )
if ( modlist [ i ] . manifest - > gamepath [ p ] . path )
if ( ! Q_strcasecmp ( modlist [ i ] . manifest - > gamepath [ p ] . path , gamedir ) )
return true ;
}
else if ( modlist [ i ] . gamedir )
{
if ( ! Q_strcasecmp ( modlist [ i ] . gamedir , gamedir ) )
return true ;
}
}
if ( ( desc = FS_MallocFile ( va ( " %s%s/modinfo.txt " , basedir , gamedir ) , FS_SYSTEM , NULL ) ) )
; //dp's modinfo.txt thing (which no mod seems to use anyway)
else if ( ( desc = FS_MallocFile ( va ( " %s%s/description.txt " , basedir , gamedir ) , FS_SYSTEM , NULL ) ) )
; //quake3's description stuff
else if ( ( desc = FS_MallocFile ( va ( " %s%s/liblist.gam " , basedir , gamedir ) , FS_SYSTEM , NULL ) ) )
{ //halflifeisms? o.O mneh why not
size_t u ;
Cmd_TokenizeString ( desc , false , false ) ;
FS_FreeFile ( desc ) ;
desc = NULL ;
for ( u = 0 ; u < Cmd_Argc ( ) ; u + = 2 )
{
if ( ! strcasecmp ( Cmd_Argv ( u ) , " game " ) )
desc = Cmd_Argv ( u + 1 ) ;
}
if ( desc )
desc = Z_StrDup ( desc ) ;
}
//we don't really know what it is. probably some useless subdir. report it only if it looks like there's something actually interesting in there
else if ( ! Sys_EnumerateFiles ( va ( " %s%s/ " , basedir , gamedir ) , " *.* " , Mods_WasPackageOrDatFound , NULL , NULL ) | |
! Sys_EnumerateFiles ( va ( " %s%s/maps/ " , basedir , gamedir ) , " *.* " , Mods_WasMapFound , NULL , NULL ) )
; //stopped early means we found a file.
else
return true ; //nothing interesting there... don't bother to list it
if ( strchr ( gamedir , ' ; ' ) | | ! FS_GamedirIsOkay ( gamedir ) )
{
2020-05-14 15:50:26 +00:00
Z_Free ( desc ) ;
2020-04-19 01:23:32 +00:00
return true ; //don't list it if we can't use it anyway
}
modlist = BZ_Realloc ( modlist , ( i + 1 ) * sizeof ( * modlist ) ) ;
modlist [ i ] . manifest = NULL ;
modlist [ i ] . gamedir = Z_StrDup ( gamedir ) ;
modlist [ i ] . description = desc ;
nummods = i + 1 ;
}
return true ;
}
static int QDECL Mods_SortMod ( const void * first , const void * second )
{
const struct modlist_s * a = first ;
const struct modlist_s * b = second ;
2023-07-02 03:19:01 +00:00
int d = 0 ;
if ( a - > manifest | | b - > manifest )
{
if ( a - > manifest & & b - > manifest )
{
if ( ! d )
d = Q_strcasecmp ( a - > manifest - > formalname , b - > manifest - > formalname ) ;
if ( ! d )
d = Q_strcasecmp ( a - > manifest - > basedir , b - > manifest - > basedir ) ;
if ( ! d )
d = strcmp ( a - > gamedir , b - > gamedir ) ;
}
else
d = a - > manifest ? 1 : - 1 ; //put manifest-based ones first.
}
if ( ! d )
d = strcmp ( a - > gamedir , b - > gamedir ) ;
return d ;
2020-04-19 01:23:32 +00:00
}
struct modlist_s * Mods_GetMod ( size_t diridx )
{
if ( ! modsinited )
{
int mancount ;
modsinited = true ;
Added sys_openfile console command(and menu option) to web and flatpak(via cmake+dbus) builds, to 'install' packages on sandboxed systems a bit more easily.
Cmake: Add FTE_WERROR option, defaults to true in debug builds and off in release builds (in case future compilers have issues).
Cmake: Pull in libXscreensaver so we don't get interrupted by screensavers when playing demos.
Make: Added `make webcl-rel` for a web build without server bloat (eg for sites focused on demo playback. Yes, this means you XantoM).
fteqcc: Include the decompiler in fteqcc (non-gui) builds ('-d' arg).
fteqcc: Decompiler can now mostly handle hexen2 mods without any unknown opcodes.
Allow ezHud and OpenSSL to be compiled as in-engine plugins, potentially for web and windows ports respectively.
Web: Fix support for ogg vorbis. Add support for voip.
Web: Added basic support for WebXR.
QTV: Don't try seeking on unseekable qtv streams. Don't spam when developer 1 is set.
QTV: add support for some eztv extensions.
MVD: added hack to use ktx's vweps in mvd where mvdsv doesn't bother to record the info.
qwfwd: hack around a hack in qwfwd, allowing it to work again.
recording: favour qwd in single player, instead of mvd.
Protocol: reduce client memory used for precache names. Bump maximum precache counts - some people are just abusive, yes you Orl.
hexen2: add enough clientside protocol compat to play the demo included with h2mp. lacks effects.
in_xflip: restored this setting.
fs_hidesyspaths: new cvar, defaults to enabled so you won't find your username or whatever turning up in screenshots or the like. change it to 0 before debuging stuff eg via 'path'.
gl_overbright_models: Added cvar to match QS.
netchan: Added MTU determination, we'll no longer fail to connect when routers stupidly drop icmp packets.
Win: try a few other versions of xinput too.
CSQC: Added a CSQC_GenerateMaterial function, to give the csqc a chance to generate custom materials.
MenuQC: Added support for the skeletal objects API.
2024-04-09 17:13:59 +00:00
FS_EnumerateKnownGames ( Mods_AddManifest , NULL , true ) ;
2020-04-19 01:23:32 +00:00
mancount = nummods ;
if ( * fs_manifest - > installation )
{
if ( com_homepathenabled )
Sys_EnumerateFiles ( com_homepath , " * " , Mods_AddGamedir , com_homepath , NULL ) ;
Sys_EnumerateFiles ( com_gamepath , " * " , Mods_AddGamedir , com_gamepath , NULL ) ;
}
qsort ( modlist + mancount , nummods - mancount , sizeof ( * modlist ) , Mods_SortMod ) ;
}
if ( diridx < nummods )
return & modlist [ diridx ] ;
return NULL ;
}
# if defined(HAVE_CLIENT) && defined(WEBCLIENT)
typedef struct
{
char * manifestname ; //manifest getting written
char * url ; //url to get the manifest from.
char * mantext ; //contents of downloaded manifest...
int mansize ;
ftemanifest_t * man ;
} modinstall_t ;
static void FS_ModInstallConfirmed ( void * vctx , promptbutton_t button )
{
modinstall_t * ctx = vctx ;
if ( button = = PROMPT_YES )
{
vfsfile_t * out = FS_OpenVFS ( ctx - > manifestname , " wb " , FS_SYSTEM ) ;
if ( out )
{
VFS_WRITE ( out , ctx - > mantext , ctx - > mansize ) ;
VFS_CLOSE ( out ) ;
FS_ChangeGame ( ctx - > man , true , true ) ;
ctx - > man = NULL ;
}
}
Z_Free ( ctx - > mantext ) ;
Z_Free ( ctx - > url ) ;
Z_Free ( ctx - > manifestname ) ;
FS_Manifest_Free ( ctx - > man ) ;
Z_Free ( ctx ) ;
}
static void FS_ModInstallGot ( struct dl_download * dl )
{
modinstall_t * ctx = dl - > user_ctx ;
if ( dl - > file & & dl - > status = = DL_FINISHED )
{
ctx - > mansize = VFS_GETLEN ( dl - > file ) ;
ctx - > mantext = Z_Malloc ( ctx - > mansize + 1 ) ;
VFS_READ ( dl - > file , ctx - > mantext , ctx - > mansize ) ;
ctx - > mantext [ ctx - > mansize ] = 0 ;
ctx - > man = FS_Manifest_ReadMem ( ctx - > manifestname , com_gamepath , ctx - > mantext ) ;
if ( ctx - > man & & ! strcmp ( ctx - > man - > basedir , com_gamepath ) )
{
//should probably show just the hostname for brevity.
2023-05-27 17:00:32 +00:00
Menu_Prompt ( FS_ModInstallConfirmed , ctx , va ( localtext ( " Install %s from \n %s ? " ) , ctx - > man - > formalname , ctx - > url ) , " Install " , NULL , " Cancel " , true ) ;
2020-04-19 01:23:32 +00:00
return ;
}
}
FS_ModInstallConfirmed ( ctx , PROMPT_CANCEL ) ;
}
static void FS_ModInstall ( const char * dest , const char * url )
{
struct dl_download * dl ;
char fmfpath [ MAX_OSPATH ] ;
ftemanifest_t * man = NULL ;
//find out a writable path for the fmf.
Added sys_openfile console command(and menu option) to web and flatpak(via cmake+dbus) builds, to 'install' packages on sandboxed systems a bit more easily.
Cmake: Add FTE_WERROR option, defaults to true in debug builds and off in release builds (in case future compilers have issues).
Cmake: Pull in libXscreensaver so we don't get interrupted by screensavers when playing demos.
Make: Added `make webcl-rel` for a web build without server bloat (eg for sites focused on demo playback. Yes, this means you XantoM).
fteqcc: Include the decompiler in fteqcc (non-gui) builds ('-d' arg).
fteqcc: Decompiler can now mostly handle hexen2 mods without any unknown opcodes.
Allow ezHud and OpenSSL to be compiled as in-engine plugins, potentially for web and windows ports respectively.
Web: Fix support for ogg vorbis. Add support for voip.
Web: Added basic support for WebXR.
QTV: Don't try seeking on unseekable qtv streams. Don't spam when developer 1 is set.
QTV: add support for some eztv extensions.
MVD: added hack to use ktx's vweps in mvd where mvdsv doesn't bother to record the info.
qwfwd: hack around a hack in qwfwd, allowing it to work again.
recording: favour qwd in single player, instead of mvd.
Protocol: reduce client memory used for precache names. Bump maximum precache counts - some people are just abusive, yes you Orl.
hexen2: add enough clientside protocol compat to play the demo included with h2mp. lacks effects.
in_xflip: restored this setting.
fs_hidesyspaths: new cvar, defaults to enabled so you won't find your username or whatever turning up in screenshots or the like. change it to 0 before debuging stuff eg via 'path'.
gl_overbright_models: Added cvar to match QS.
netchan: Added MTU determination, we'll no longer fail to connect when routers stupidly drop icmp packets.
Win: try a few other versions of xinput too.
CSQC: Added a CSQC_GenerateMaterial function, to give the csqc a chance to generate custom materials.
MenuQC: Added support for the skeletal objects API.
2024-04-09 17:13:59 +00:00
if ( ! FS_SystemPath ( va ( " %s.fmf " , dest ) , FS_ROOT , fmfpath , sizeof ( fmfpath ) ) )
2020-04-19 01:23:32 +00:00
return ;
//read it in if it exists.
man = FS_Manifest_ReadMod ( dest ) ;
if ( man )
{
FS_ChangeGame ( man , cfg_reload_on_gamedir . ival , false ) ;
return ;
}
dl = HTTP_CL_Get ( url , NULL , FS_ModInstallGot ) ;
if ( dl )
{
modinstall_t * m = Z_Malloc ( sizeof ( * m ) ) ;
m - > manifestname = Z_StrDup ( fmfpath ) ;
m - > url = Z_StrDup ( url ) ;
dl - > user_ctx = m ;
# ifdef MULTITHREAD
DL_CreateThread ( dl , NULL , NULL ) ;
# endif
}
}
# else
static void FS_ModInstall ( const char * dest , const char * url )
{
}
# endif
//switches manifests
//no args: lists known games
//1 arg:
// ~/quake/ trailing slash switches basedir (using said basedir's default manifest)
// quake3 loads hardcoded mod
// ~/foo.fmf loads the specified manifest
// http://foo/bar.fmf loads the specified manifest. archaic. doesn't save the fmf anywhere (will download its pk3s)
//2 args:
// foo http://foo/bar.fmf downloads to $basedir/foo.fmf if it doesn't exist (prompts), and then always loads it (like 'gamedir', no prompt when it already exists).
2018-10-11 10:31:23 +00:00
static void FS_ChangeGame_f ( void )
2013-06-23 02:17:02 +00:00
{
2020-04-19 01:23:32 +00:00
unsigned int i ;
const char * arg = Cmd_Argv ( 1 ) ;
char * end ;
struct modlist_s * mod ;
ftemanifest_t * man ;
2013-06-23 02:17:02 +00:00
2020-04-19 01:23:32 +00:00
//don't execute this if we're executing rcon commands, as this can change game directories and ruin logging.
2014-06-24 03:02:32 +00:00
if ( cmd_blockwait )
return ;
2020-04-19 01:23:32 +00:00
if ( ( i = strtol ( arg , & end , 10 ) ) & & ! * end )
{ //for use by qc. loading mods by number...
mod = Mods_GetMod ( - - i ) ;
if ( mod )
{
# ifdef HAVE_CLIENT
CL_Disconnect ( NULL ) ;
# endif
# ifdef HAVE_SERVER
if ( sv . state )
SV_UnspawnServer ( ) ;
# endif
if ( mod - > manifest )
{
man = FS_Manifest_Clone ( mod - > manifest ) ; //FS_ChangeGame takes ownership... don't crash if its cached.
FS_ChangeGame ( man , true , true ) ;
}
else
COM_Gamedir ( mod - > gamedir , NULL ) ;
# ifdef HAVE_CLIENT
2023-04-21 11:36:13 +00:00
// Cbuf_AddText("menu_restart\n", RESTRICT_LOCAL);
2020-04-19 01:23:32 +00:00
# endif
}
return ;
}
else if ( Cmd_Argc ( ) = = 3 )
{ //allowed to bypass insecurity.
//acts like gamedir, but prompts if you try anything else.
FS_ModInstall ( arg , Cmd_Argv ( 2 ) ) ;
return ;
}
else if ( Cmd_IsInsecure ( ) )
2013-06-23 02:17:02 +00:00
{
2020-04-19 01:23:32 +00:00
Con_Printf ( " Blocking insecure command: %s %s \n " , Cmd_Argv ( 0 ) , Cmd_Args ( ) ) ;
return ;
}
else if ( ! * arg )
{
Con_Printf ( " Valid games/mods are: \n " ) ;
for ( i = 0 ; ( mod = Mods_GetMod ( i ) ) ; i + + )
2013-06-23 02:17:02 +00:00
{
2020-04-19 01:23:32 +00:00
man = mod - > manifest ;
if ( man )
2023-07-02 03:19:01 +00:00
Con_Printf ( " \t ^[%s \\ tip \\ %s \n %s \\ type \\ fs_changegame \" %u \" //%s^] (%s) \n " , mod - > description ? mod - > description : man - > formalname , man - > installation , man - > filename ? man - > filename : " <INTERNAL> " , i + 1 , man - > filename , man - > basedir ? man - > basedir : " not installed " ) ;
2020-04-19 01:23:32 +00:00
else
Con_Printf ( " \t ^[%s \\ type \\ gamedir \" %s \" ^] \n " , mod - > description ? mod - > description : mod - > gamedir , mod - > gamedir ) ;
2013-06-23 02:17:02 +00:00
}
}
else
{
2022-03-08 05:31:34 +00:00
arg = Z_StrDup ( arg ) ;
# ifdef HAVE_SERVER
if ( sv . state )
SV_UnspawnServer ( ) ;
# endif
# ifdef HAVE_CLIENT
CL_Disconnect ( NULL ) ;
# endif
# ifdef PLUGINS
Plug_Shutdown ( true ) ;
# endif
Cvar_GamedirChange ( ) ;
2018-01-22 19:18:04 +00:00
if ( strrchr ( arg , ' / ' ) & & ! strrchr ( arg , ' / ' ) [ 1 ] )
2020-04-19 01:23:32 +00:00
{ //ends in slash. a new basedir.
2018-01-22 19:18:04 +00:00
Q_strncpyz ( com_gamepath , arg , sizeof ( com_gamepath ) ) ;
host_parms . basedir = com_gamepath ;
FS_ChangeGame ( FS_ReadDefaultManifest ( NULL , 0 , true ) , true , true ) ;
2005-08-26 22:52:26 +00:00
}
2018-01-22 19:18:04 +00:00
else
{
for ( i = 0 ; gamemode_info [ i ] . argname ; i + + )
2020-04-19 01:23:32 +00:00
{
2018-01-22 19:18:04 +00:00
if ( ! Q_strcasecmp ( gamemode_info [ i ] . argname + 1 , arg ) )
{
Con_Printf ( " Switching to %s \n " , gamemode_info [ i ] . argname + 1 ) ;
2020-04-19 01:23:32 +00:00
FS_ChangeGame ( FS_GenerateLegacyManifest ( i , NULL ) , true , true ) ;
2022-03-08 05:31:34 +00:00
break ;
2018-01-22 19:18:04 +00:00
}
}
2013-08-06 10:48:51 +00:00
2022-03-08 05:31:34 +00:00
if ( ! gamemode_info [ i ] . argname )
{
2018-12-28 00:04:36 +00:00
# ifdef HAVE_CLIENT
2022-03-08 05:31:34 +00:00
if ( ! Host_RunFile ( arg , strlen ( arg ) , NULL ) )
Con_Printf ( " Game unknown \n " ) ;
2013-08-21 08:06:35 +00:00
# endif
2022-03-08 05:31:34 +00:00
}
2018-01-22 19:18:04 +00:00
}
2022-03-08 05:31:34 +00:00
Z_Free ( ( char * ) arg ) ;
# ifdef PLUGINS
Plug_Initialise ( true ) ;
# endif
# if defined(HAVE_CLIENT) && defined(Q3CLIENT)
if ( q3 )
q3 - > ui . Start ( ) ;
# endif
2005-08-26 22:52:26 +00:00
}
2013-06-23 02:17:02 +00:00
}
2016-07-12 00:40:13 +00:00
2020-04-19 01:23:32 +00:00
//this function exists for use by the QI plugin and uses hacked up variations of the default manifest.
2018-10-11 10:31:23 +00:00
static void FS_ChangeMod_f ( void )
2016-07-12 00:40:13 +00:00
{
char cachename [ 512 ] ;
struct gamepacks packagespaths [ 16 ] ;
int i ;
int packages = 0 ;
const char * arg = " ? " ;
qboolean okay = false ;
2023-03-27 17:19:00 +00:00
char * dir = NULL ;
2016-07-12 00:40:13 +00:00
if ( Cmd_IsInsecure ( ) )
return ;
Z_Free ( fs_loadedcommand ) ;
fs_loadedcommand = NULL ;
memset ( packagespaths , 0 , sizeof ( packagespaths ) ) ;
for ( i = 1 ; ; )
{
if ( i = = Cmd_Argc ( ) )
{
okay = true ;
break ;
}
arg = Cmd_Argv ( i + + ) ;
if ( ! strcmp ( arg , " package " ) )
{
arg = Cmd_Argv ( i + + ) ;
2016-11-20 20:52:41 +00:00
if ( packages = = countof ( packagespaths ) ) //must leave space for one, as a terminator.
continue ;
if ( FS_PathURLCache ( arg , cachename , sizeof ( cachename ) ) )
{
packagespaths [ packages ] . url = Z_StrDup ( arg ) ;
packagespaths [ packages ] . path = Z_StrDup ( cachename ) ;
packages + + ;
}
2016-07-12 00:40:13 +00:00
}
2021-04-14 05:21:04 +00:00
else if ( ! strcmp ( arg , " hash " ) )
{
if ( ! packages )
break ;
arg = Cmd_Argv ( i + + ) ;
// packagespaths[packages-1].hash = Z_StrDup(arg);
}
2016-07-12 00:40:13 +00:00
else if ( ! strcmp ( arg , " prefix " ) )
{
if ( ! packages )
break ;
arg = Cmd_Argv ( i + + ) ;
packagespaths [ packages - 1 ] . subpath = Z_StrDup ( arg ) ;
}
2023-03-27 17:19:00 +00:00
else if ( ! strcmp ( arg , " dir " ) )
{
arg = Cmd_Argv ( i + + ) ;
Z_StrDupPtr ( & dir , arg ) ;
}
2016-07-12 00:40:13 +00:00
else if ( ! strcmp ( arg , " map " ) )
{
Z_Free ( fs_loadedcommand ) ;
arg = va ( " map \" %s \" \n " , Cmd_Argv ( i + + ) ) ;
fs_loadedcommand = Z_StrDup ( arg ) ;
}
2019-06-21 03:59:46 +00:00
else if ( ! strcmp ( arg , " spmap " ) )
{
Z_Free ( fs_loadedcommand ) ;
arg = va ( " deathmatch 0;coop 0;spmap \" %s \" \n " , Cmd_Argv ( i + + ) ) ;
fs_loadedcommand = Z_StrDup ( arg ) ;
}
2016-07-12 00:40:13 +00:00
else if ( ! strcmp ( arg , " restart " ) )
{
Z_Free ( fs_loadedcommand ) ;
fs_loadedcommand = Z_StrDup ( " restart \n " ) ;
}
else
break ;
}
if ( okay )
2023-03-27 17:19:00 +00:00
COM_Gamedir ( dir ? dir : " " , packagespaths ) ;
2016-07-12 00:40:13 +00:00
else
{
Con_Printf ( " unsupported args: %s \n " , arg ) ;
Z_Free ( fs_loadedcommand ) ;
fs_loadedcommand = NULL ;
}
2023-03-27 17:19:00 +00:00
Z_Free ( dir ) ;
2016-07-12 00:40:13 +00:00
for ( i = 0 ; i < packages ; i + + )
{
Z_Free ( packagespaths [ i ] . url ) ;
Z_Free ( packagespaths [ i ] . path ) ;
Z_Free ( packagespaths [ i ] . subpath ) ;
}
}
2018-10-11 10:31:23 +00:00
static void FS_ShowManifest_f ( void )
2013-06-23 02:17:02 +00:00
{
2020-04-19 01:23:32 +00:00
if ( Cmd_IsInsecure ( ) )
return ;
2013-06-23 02:17:02 +00:00
if ( fs_manifest )
FS_Manifest_Print ( fs_manifest ) ;
else
Con_Printf ( " no manifest loaded... \n " ) ;
}
2018-10-11 10:31:23 +00:00
static int QDECL FS_ArbitraryFile_cb ( const char * name , qofs_t flags , time_t mtime , void * parm , searchpathfuncs_t * spath )
{
struct xcommandargcompletioncb_s * ctx = parm ;
ctx - > cb ( name , NULL , NULL , ctx ) ;
return true ;
}
void FS_ArbitraryFile_c ( int argn , const char * partial , struct xcommandargcompletioncb_s * ctx )
{
if ( argn = = 1 )
{
COM_EnumerateFiles ( va ( " %s* " , partial ) , FS_ArbitraryFile_cb , ctx ) ;
}
}
Too many changes, sorry.
Change revision displays, use the SVN commit date instead of using __DATE__ (when there's no local changes). This should allow reproducible builds.
Added s_al_disable cvar, to block openal and all the various problems people have had with it, without having to name an explicit fallback (which would vary by system).
Add mastervolume cvar (for ss).
Add r_shadows 2 (aka fake shadows - for ss).
Add scr_loadingscreen_aspect -1 setting, to disable levelshots entirely, also disables the progress bar (for ss).
Better support for some effectinfo hacks (for ss).
Added dpcompat_nocsqcwarnings (because of lazy+buggy mods like ss).
Rework the dpcsqc versions of project+unproject builtins for better compat (for ss).
Added dpcompat_csqcinputeventtypes to block unexpected csqc input events (for ss).
Better compat with DP's loadfont console command (for ss).
Added dpcompat_smallerfonts cvar to replicate a DP bug (for ss).
Detect dp's m_draw extension, to work around it (for ss).
Cvar dpcompat_ignoremodificationtimes added. A value of 0 favour the most recently modified file, 1 will use DP-like alphabetically sorted preferences (for ss).
loadfont builtin can now accept outline=1 in the sizes arg for slightly more readable fonts.
Fix bbox calcs for rotated entities, fix needed for r_ignorenetpvs 0.
Hackily parse emoji.json to provide :poop: etc suggestions.
Skip prediction entirely when there's no local entity info. This fixes stair-smoothing in xonotic.
screenshot_cubemap will now capture half-float images when saving to ktx or dds files.
Fix support for xcf files larger than 4gb, mostly to avoid compiler warnings.
Fixed size of gfx/loading.lmp when replacement textures are used.
Added mipmap support for rg8 and l8a8 textures.
r_hdr_framebuffer cvar updated to support format names instead of random negative numbers. Description updated to name some interesting ones.
Perform autoupdate _checks_ ONLY with explicit user confirmation (actual updating already needed user confirmation, but this extra step should reduce the chances of us getting wrongly accused of exfiltrating user data if we're run in a sandbox - we ONLY ever included the updating engine's version in the checks, though there's nothing we can do to avoid sending the user's router's IP).
Removed the 'summon satan all over your harddrive' quit message, in case paranoid security researchers are idiots and don't bother doing actual research.
Removed the triptohell.info and fte.triptohell.info certificates, they really need to stop being self-signed. The updates domain is still self-signed for autoupdates.
Video drivers are now able to report supported video resolutions, visible to menuqc. Currently only works with SDL2 builds.
Added setmousepos builtin. Should work with glx+win32 build.
VF_SKYROOM_CAMERA can now accept an extra two args, setviewprop(VF_SKYROOM_CAMERA, org, axis, degrees).
Removed v_skyroom_origin+v_skyroom_orientation cvars in favour just v_skyroom, which should make it behave more like the 'fog' command (used when csqc isn't overriding).
Added R_EndPolygonRibbon builtin to make it faster+easier to generate textured ribbon/cable/etc wide lines (for TW).
sdl: Fix up sys_sdl.c's file enumeration to support wildcards in directories.
edit command now displays end1.bin/end2.bin correctly, because we can.
Finally add support for f_modified - though ruleset_allow_larger_models and ruleset_allow_overlong_sounds generally make it redundant.
Fix threading race condition in sha1 lookups.
Updated f_ruleset to include the same extra flags reported by ezquake.
A mod's default.fmf file can now contain an eg 'mainconfig config.cfg' line (to explicitly set the main config saved with cfg_save_auto 1 etc).
fmf: basegame steam:GameName/GameDir can be used to try to load a mod directory from an installed steam game. The resulting gamedir will be read-only.
HOMEDIR CHANGE: use homedirs only if the basedir cannot be written or a homedir already exists, which should further reduce the probability of microsoft randomly uploading our data to their cloud (but mostly because its annoying to never know where your data is written).
Fixed buf_cvarlist, should work in xonotic now, and without segfaults.
Added an extra arg to URI_Get_Callback calls - the response size, also changed the tempstring to contain all bytes of the response, you need to be careful about nulls though.
Try to work around nvidia's forced-panning bug on x11 when changing video modes. This might screw with other programs.
sdl: support custom icons.
sdl: support choosing a specific display.
Added some documentation to menuqc builtins.
menusys: use outlines for slightly more readable fonts.
menusys: switch vid_width and vid_height combos into a single video mode combo to set both according to reported video modes.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5581 fc73d0e0-1445-4013-8a0c-d673dee63da5
2019-11-20 03:09:50 +00:00
//FIXME: this should come from the manifest, as fte_GAME or something
2018-10-23 07:09:06 +00:00
# ifdef _WIN32
Too many changes, sorry.
Change revision displays, use the SVN commit date instead of using __DATE__ (when there's no local changes). This should allow reproducible builds.
Added s_al_disable cvar, to block openal and all the various problems people have had with it, without having to name an explicit fallback (which would vary by system).
Add mastervolume cvar (for ss).
Add r_shadows 2 (aka fake shadows - for ss).
Add scr_loadingscreen_aspect -1 setting, to disable levelshots entirely, also disables the progress bar (for ss).
Better support for some effectinfo hacks (for ss).
Added dpcompat_nocsqcwarnings (because of lazy+buggy mods like ss).
Rework the dpcsqc versions of project+unproject builtins for better compat (for ss).
Added dpcompat_csqcinputeventtypes to block unexpected csqc input events (for ss).
Better compat with DP's loadfont console command (for ss).
Added dpcompat_smallerfonts cvar to replicate a DP bug (for ss).
Detect dp's m_draw extension, to work around it (for ss).
Cvar dpcompat_ignoremodificationtimes added. A value of 0 favour the most recently modified file, 1 will use DP-like alphabetically sorted preferences (for ss).
loadfont builtin can now accept outline=1 in the sizes arg for slightly more readable fonts.
Fix bbox calcs for rotated entities, fix needed for r_ignorenetpvs 0.
Hackily parse emoji.json to provide :poop: etc suggestions.
Skip prediction entirely when there's no local entity info. This fixes stair-smoothing in xonotic.
screenshot_cubemap will now capture half-float images when saving to ktx or dds files.
Fix support for xcf files larger than 4gb, mostly to avoid compiler warnings.
Fixed size of gfx/loading.lmp when replacement textures are used.
Added mipmap support for rg8 and l8a8 textures.
r_hdr_framebuffer cvar updated to support format names instead of random negative numbers. Description updated to name some interesting ones.
Perform autoupdate _checks_ ONLY with explicit user confirmation (actual updating already needed user confirmation, but this extra step should reduce the chances of us getting wrongly accused of exfiltrating user data if we're run in a sandbox - we ONLY ever included the updating engine's version in the checks, though there's nothing we can do to avoid sending the user's router's IP).
Removed the 'summon satan all over your harddrive' quit message, in case paranoid security researchers are idiots and don't bother doing actual research.
Removed the triptohell.info and fte.triptohell.info certificates, they really need to stop being self-signed. The updates domain is still self-signed for autoupdates.
Video drivers are now able to report supported video resolutions, visible to menuqc. Currently only works with SDL2 builds.
Added setmousepos builtin. Should work with glx+win32 build.
VF_SKYROOM_CAMERA can now accept an extra two args, setviewprop(VF_SKYROOM_CAMERA, org, axis, degrees).
Removed v_skyroom_origin+v_skyroom_orientation cvars in favour just v_skyroom, which should make it behave more like the 'fog' command (used when csqc isn't overriding).
Added R_EndPolygonRibbon builtin to make it faster+easier to generate textured ribbon/cable/etc wide lines (for TW).
sdl: Fix up sys_sdl.c's file enumeration to support wildcards in directories.
edit command now displays end1.bin/end2.bin correctly, because we can.
Finally add support for f_modified - though ruleset_allow_larger_models and ruleset_allow_overlong_sounds generally make it redundant.
Fix threading race condition in sha1 lookups.
Updated f_ruleset to include the same extra flags reported by ezquake.
A mod's default.fmf file can now contain an eg 'mainconfig config.cfg' line (to explicitly set the main config saved with cfg_save_auto 1 etc).
fmf: basegame steam:GameName/GameDir can be used to try to load a mod directory from an installed steam game. The resulting gamedir will be read-only.
HOMEDIR CHANGE: use homedirs only if the basedir cannot be written or a homedir already exists, which should further reduce the probability of microsoft randomly uploading our data to their cloud (but mostly because its annoying to never know where your data is written).
Fixed buf_cvarlist, should work in xonotic now, and without segfaults.
Added an extra arg to URI_Get_Callback calls - the response size, also changed the tempstring to contain all bytes of the response, you need to be careful about nulls though.
Try to work around nvidia's forced-panning bug on x11 when changing video modes. This might screw with other programs.
sdl: support custom icons.
sdl: support choosing a specific display.
Added some documentation to menuqc builtins.
menusys: use outlines for slightly more readable fonts.
menusys: switch vid_width and vid_height combos into a single video mode combo to set both according to reported video modes.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5581 fc73d0e0-1445-4013-8a0c-d673dee63da5
2019-11-20 03:09:50 +00:00
//windows gets formal names...
# ifdef GAME_FULLNAME
# define HOMESUBDIR GAME_FULLNAME
# else
# define HOMESUBDIR FULLENGINENAME
# endif
2018-10-23 07:09:06 +00:00
# else
Too many changes, sorry.
Change revision displays, use the SVN commit date instead of using __DATE__ (when there's no local changes). This should allow reproducible builds.
Added s_al_disable cvar, to block openal and all the various problems people have had with it, without having to name an explicit fallback (which would vary by system).
Add mastervolume cvar (for ss).
Add r_shadows 2 (aka fake shadows - for ss).
Add scr_loadingscreen_aspect -1 setting, to disable levelshots entirely, also disables the progress bar (for ss).
Better support for some effectinfo hacks (for ss).
Added dpcompat_nocsqcwarnings (because of lazy+buggy mods like ss).
Rework the dpcsqc versions of project+unproject builtins for better compat (for ss).
Added dpcompat_csqcinputeventtypes to block unexpected csqc input events (for ss).
Better compat with DP's loadfont console command (for ss).
Added dpcompat_smallerfonts cvar to replicate a DP bug (for ss).
Detect dp's m_draw extension, to work around it (for ss).
Cvar dpcompat_ignoremodificationtimes added. A value of 0 favour the most recently modified file, 1 will use DP-like alphabetically sorted preferences (for ss).
loadfont builtin can now accept outline=1 in the sizes arg for slightly more readable fonts.
Fix bbox calcs for rotated entities, fix needed for r_ignorenetpvs 0.
Hackily parse emoji.json to provide :poop: etc suggestions.
Skip prediction entirely when there's no local entity info. This fixes stair-smoothing in xonotic.
screenshot_cubemap will now capture half-float images when saving to ktx or dds files.
Fix support for xcf files larger than 4gb, mostly to avoid compiler warnings.
Fixed size of gfx/loading.lmp when replacement textures are used.
Added mipmap support for rg8 and l8a8 textures.
r_hdr_framebuffer cvar updated to support format names instead of random negative numbers. Description updated to name some interesting ones.
Perform autoupdate _checks_ ONLY with explicit user confirmation (actual updating already needed user confirmation, but this extra step should reduce the chances of us getting wrongly accused of exfiltrating user data if we're run in a sandbox - we ONLY ever included the updating engine's version in the checks, though there's nothing we can do to avoid sending the user's router's IP).
Removed the 'summon satan all over your harddrive' quit message, in case paranoid security researchers are idiots and don't bother doing actual research.
Removed the triptohell.info and fte.triptohell.info certificates, they really need to stop being self-signed. The updates domain is still self-signed for autoupdates.
Video drivers are now able to report supported video resolutions, visible to menuqc. Currently only works with SDL2 builds.
Added setmousepos builtin. Should work with glx+win32 build.
VF_SKYROOM_CAMERA can now accept an extra two args, setviewprop(VF_SKYROOM_CAMERA, org, axis, degrees).
Removed v_skyroom_origin+v_skyroom_orientation cvars in favour just v_skyroom, which should make it behave more like the 'fog' command (used when csqc isn't overriding).
Added R_EndPolygonRibbon builtin to make it faster+easier to generate textured ribbon/cable/etc wide lines (for TW).
sdl: Fix up sys_sdl.c's file enumeration to support wildcards in directories.
edit command now displays end1.bin/end2.bin correctly, because we can.
Finally add support for f_modified - though ruleset_allow_larger_models and ruleset_allow_overlong_sounds generally make it redundant.
Fix threading race condition in sha1 lookups.
Updated f_ruleset to include the same extra flags reported by ezquake.
A mod's default.fmf file can now contain an eg 'mainconfig config.cfg' line (to explicitly set the main config saved with cfg_save_auto 1 etc).
fmf: basegame steam:GameName/GameDir can be used to try to load a mod directory from an installed steam game. The resulting gamedir will be read-only.
HOMEDIR CHANGE: use homedirs only if the basedir cannot be written or a homedir already exists, which should further reduce the probability of microsoft randomly uploading our data to their cloud (but mostly because its annoying to never know where your data is written).
Fixed buf_cvarlist, should work in xonotic now, and without segfaults.
Added an extra arg to URI_Get_Callback calls - the response size, also changed the tempstring to contain all bytes of the response, you need to be careful about nulls though.
Try to work around nvidia's forced-panning bug on x11 when changing video modes. This might screw with other programs.
sdl: support custom icons.
sdl: support choosing a specific display.
Added some documentation to menuqc builtins.
menusys: use outlines for slightly more readable fonts.
menusys: switch vid_width and vid_height combos into a single video mode combo to set both according to reported video modes.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5581 fc73d0e0-1445-4013-8a0c-d673dee63da5
2019-11-20 03:09:50 +00:00
//unix gets short names...
2018-10-23 07:09:06 +00:00
# ifdef GAME_SHORTNAME
# define HOMESUBDIR GAME_SHORTNAME
# else
# define HOMESUBDIR "fte"
# endif
2014-02-11 17:51:29 +00:00
# endif
2009-03-03 01:52:30 +00:00
Too many changes, sorry.
Change revision displays, use the SVN commit date instead of using __DATE__ (when there's no local changes). This should allow reproducible builds.
Added s_al_disable cvar, to block openal and all the various problems people have had with it, without having to name an explicit fallback (which would vary by system).
Add mastervolume cvar (for ss).
Add r_shadows 2 (aka fake shadows - for ss).
Add scr_loadingscreen_aspect -1 setting, to disable levelshots entirely, also disables the progress bar (for ss).
Better support for some effectinfo hacks (for ss).
Added dpcompat_nocsqcwarnings (because of lazy+buggy mods like ss).
Rework the dpcsqc versions of project+unproject builtins for better compat (for ss).
Added dpcompat_csqcinputeventtypes to block unexpected csqc input events (for ss).
Better compat with DP's loadfont console command (for ss).
Added dpcompat_smallerfonts cvar to replicate a DP bug (for ss).
Detect dp's m_draw extension, to work around it (for ss).
Cvar dpcompat_ignoremodificationtimes added. A value of 0 favour the most recently modified file, 1 will use DP-like alphabetically sorted preferences (for ss).
loadfont builtin can now accept outline=1 in the sizes arg for slightly more readable fonts.
Fix bbox calcs for rotated entities, fix needed for r_ignorenetpvs 0.
Hackily parse emoji.json to provide :poop: etc suggestions.
Skip prediction entirely when there's no local entity info. This fixes stair-smoothing in xonotic.
screenshot_cubemap will now capture half-float images when saving to ktx or dds files.
Fix support for xcf files larger than 4gb, mostly to avoid compiler warnings.
Fixed size of gfx/loading.lmp when replacement textures are used.
Added mipmap support for rg8 and l8a8 textures.
r_hdr_framebuffer cvar updated to support format names instead of random negative numbers. Description updated to name some interesting ones.
Perform autoupdate _checks_ ONLY with explicit user confirmation (actual updating already needed user confirmation, but this extra step should reduce the chances of us getting wrongly accused of exfiltrating user data if we're run in a sandbox - we ONLY ever included the updating engine's version in the checks, though there's nothing we can do to avoid sending the user's router's IP).
Removed the 'summon satan all over your harddrive' quit message, in case paranoid security researchers are idiots and don't bother doing actual research.
Removed the triptohell.info and fte.triptohell.info certificates, they really need to stop being self-signed. The updates domain is still self-signed for autoupdates.
Video drivers are now able to report supported video resolutions, visible to menuqc. Currently only works with SDL2 builds.
Added setmousepos builtin. Should work with glx+win32 build.
VF_SKYROOM_CAMERA can now accept an extra two args, setviewprop(VF_SKYROOM_CAMERA, org, axis, degrees).
Removed v_skyroom_origin+v_skyroom_orientation cvars in favour just v_skyroom, which should make it behave more like the 'fog' command (used when csqc isn't overriding).
Added R_EndPolygonRibbon builtin to make it faster+easier to generate textured ribbon/cable/etc wide lines (for TW).
sdl: Fix up sys_sdl.c's file enumeration to support wildcards in directories.
edit command now displays end1.bin/end2.bin correctly, because we can.
Finally add support for f_modified - though ruleset_allow_larger_models and ruleset_allow_overlong_sounds generally make it redundant.
Fix threading race condition in sha1 lookups.
Updated f_ruleset to include the same extra flags reported by ezquake.
A mod's default.fmf file can now contain an eg 'mainconfig config.cfg' line (to explicitly set the main config saved with cfg_save_auto 1 etc).
fmf: basegame steam:GameName/GameDir can be used to try to load a mod directory from an installed steam game. The resulting gamedir will be read-only.
HOMEDIR CHANGE: use homedirs only if the basedir cannot be written or a homedir already exists, which should further reduce the probability of microsoft randomly uploading our data to their cloud (but mostly because its annoying to never know where your data is written).
Fixed buf_cvarlist, should work in xonotic now, and without segfaults.
Added an extra arg to URI_Get_Callback calls - the response size, also changed the tempstring to contain all bytes of the response, you need to be careful about nulls though.
Try to work around nvidia's forced-panning bug on x11 when changing video modes. This might screw with other programs.
sdl: support custom icons.
sdl: support choosing a specific display.
Added some documentation to menuqc builtins.
menusys: use outlines for slightly more readable fonts.
menusys: switch vid_width and vid_height combos into a single video mode combo to set both according to reported video modes.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5581 fc73d0e0-1445-4013-8a0c-d673dee63da5
2019-11-20 03:09:50 +00:00
# if defined(_WIN32) && !defined(FTE_SDL) && !defined(WINRT) && !defined(_XBOX)
//so this is kinda screwy
//"CSIDL_LOCAL_APPDATA/FTE Quake" is what we switched to, but we only use it if the other home dirs don't exist
//"CSIDL_PERSONAL(My Documents)/My Games/FTE Quake" is what we used to use... but personal now somehow means upload-to-internet in a nicely insecure we-own-all-your-data kind of way...
//"%USERPROFILE%/My Documents/My Games/FTE Quake" is an attempt to fall back to the earlier lame path if everything else fails
//"%USERPROFILE%/Saved Games/FTE Quake" is what we probably should be using. I don't know who comes up with these random paths. We have updates+downloads+etc as well as just saves, so we prioritise localdata instead (stuff that you do NOT want microsoft to upload to the internet all the time).
# include <shlobj.h>
static qboolean FS_GetBestHomeDir ( ftemanifest_t * manifest )
{ //win32 sucks.
qboolean usehome = false ;
HRESULT ( WINAPI * dSHGetFolderPathW ) ( HWND hwndOwner , int nFolder , HANDLE hToken , DWORD dwFlags , wchar_t * pszPath ) = NULL ;
HRESULT ( WINAPI * dSHGetKnownFolderPath ) ( const GUID * const rfid , DWORD dwFlags , HANDLE hToken , PWSTR * ppszPath ) = NULL ;
dllfunction_t funcs [ ] =
{
{ ( void * * ) & dSHGetFolderPathW , " SHGetFolderPathW " } ,
{ NULL , NULL }
} ;
dllfunction_t funcsvista [ ] =
{
{ ( void * * ) & dSHGetKnownFolderPath , " SHGetKnownFolderPath " } ,
{ NULL , NULL }
} ;
DWORD winver = ( DWORD ) LOBYTE ( LOWORD ( GetVersion ( ) ) ) ;
enum
{
WINHOME_LOCALDATA ,
WINHOME_SAVEDGAMES ,
WINHOME_DOCUMENTS ,
WINHOME_COUNT
} ;
struct
{
char path [ MAX_OSPATH ] ;
} homedir [ WINHOME_COUNT ] ;
int i ;
2005-08-26 22:52:26 +00:00
Too many changes, sorry.
Change revision displays, use the SVN commit date instead of using __DATE__ (when there's no local changes). This should allow reproducible builds.
Added s_al_disable cvar, to block openal and all the various problems people have had with it, without having to name an explicit fallback (which would vary by system).
Add mastervolume cvar (for ss).
Add r_shadows 2 (aka fake shadows - for ss).
Add scr_loadingscreen_aspect -1 setting, to disable levelshots entirely, also disables the progress bar (for ss).
Better support for some effectinfo hacks (for ss).
Added dpcompat_nocsqcwarnings (because of lazy+buggy mods like ss).
Rework the dpcsqc versions of project+unproject builtins for better compat (for ss).
Added dpcompat_csqcinputeventtypes to block unexpected csqc input events (for ss).
Better compat with DP's loadfont console command (for ss).
Added dpcompat_smallerfonts cvar to replicate a DP bug (for ss).
Detect dp's m_draw extension, to work around it (for ss).
Cvar dpcompat_ignoremodificationtimes added. A value of 0 favour the most recently modified file, 1 will use DP-like alphabetically sorted preferences (for ss).
loadfont builtin can now accept outline=1 in the sizes arg for slightly more readable fonts.
Fix bbox calcs for rotated entities, fix needed for r_ignorenetpvs 0.
Hackily parse emoji.json to provide :poop: etc suggestions.
Skip prediction entirely when there's no local entity info. This fixes stair-smoothing in xonotic.
screenshot_cubemap will now capture half-float images when saving to ktx or dds files.
Fix support for xcf files larger than 4gb, mostly to avoid compiler warnings.
Fixed size of gfx/loading.lmp when replacement textures are used.
Added mipmap support for rg8 and l8a8 textures.
r_hdr_framebuffer cvar updated to support format names instead of random negative numbers. Description updated to name some interesting ones.
Perform autoupdate _checks_ ONLY with explicit user confirmation (actual updating already needed user confirmation, but this extra step should reduce the chances of us getting wrongly accused of exfiltrating user data if we're run in a sandbox - we ONLY ever included the updating engine's version in the checks, though there's nothing we can do to avoid sending the user's router's IP).
Removed the 'summon satan all over your harddrive' quit message, in case paranoid security researchers are idiots and don't bother doing actual research.
Removed the triptohell.info and fte.triptohell.info certificates, they really need to stop being self-signed. The updates domain is still self-signed for autoupdates.
Video drivers are now able to report supported video resolutions, visible to menuqc. Currently only works with SDL2 builds.
Added setmousepos builtin. Should work with glx+win32 build.
VF_SKYROOM_CAMERA can now accept an extra two args, setviewprop(VF_SKYROOM_CAMERA, org, axis, degrees).
Removed v_skyroom_origin+v_skyroom_orientation cvars in favour just v_skyroom, which should make it behave more like the 'fog' command (used when csqc isn't overriding).
Added R_EndPolygonRibbon builtin to make it faster+easier to generate textured ribbon/cable/etc wide lines (for TW).
sdl: Fix up sys_sdl.c's file enumeration to support wildcards in directories.
edit command now displays end1.bin/end2.bin correctly, because we can.
Finally add support for f_modified - though ruleset_allow_larger_models and ruleset_allow_overlong_sounds generally make it redundant.
Fix threading race condition in sha1 lookups.
Updated f_ruleset to include the same extra flags reported by ezquake.
A mod's default.fmf file can now contain an eg 'mainconfig config.cfg' line (to explicitly set the main config saved with cfg_save_auto 1 etc).
fmf: basegame steam:GameName/GameDir can be used to try to load a mod directory from an installed steam game. The resulting gamedir will be read-only.
HOMEDIR CHANGE: use homedirs only if the basedir cannot be written or a homedir already exists, which should further reduce the probability of microsoft randomly uploading our data to their cloud (but mostly because its annoying to never know where your data is written).
Fixed buf_cvarlist, should work in xonotic now, and without segfaults.
Added an extra arg to URI_Get_Callback calls - the response size, also changed the tempstring to contain all bytes of the response, you need to be careful about nulls though.
Try to work around nvidia's forced-panning bug on x11 when changing video modes. This might screw with other programs.
sdl: support custom icons.
sdl: support choosing a specific display.
Added some documentation to menuqc builtins.
menusys: use outlines for slightly more readable fonts.
menusys: switch vid_width and vid_height combos into a single video mode combo to set both according to reported video modes.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5581 fc73d0e0-1445-4013-8a0c-d673dee63da5
2019-11-20 03:09:50 +00:00
/*HMODULE shfolder =*/ Sys_LoadLibrary ( " shfolder.dll " , funcs ) ;
/*HMODULE shfolder =*/ Sys_LoadLibrary ( " shell32.dll " , funcsvista ) ;
2016-08-25 00:12:14 +00:00
Too many changes, sorry.
Change revision displays, use the SVN commit date instead of using __DATE__ (when there's no local changes). This should allow reproducible builds.
Added s_al_disable cvar, to block openal and all the various problems people have had with it, without having to name an explicit fallback (which would vary by system).
Add mastervolume cvar (for ss).
Add r_shadows 2 (aka fake shadows - for ss).
Add scr_loadingscreen_aspect -1 setting, to disable levelshots entirely, also disables the progress bar (for ss).
Better support for some effectinfo hacks (for ss).
Added dpcompat_nocsqcwarnings (because of lazy+buggy mods like ss).
Rework the dpcsqc versions of project+unproject builtins for better compat (for ss).
Added dpcompat_csqcinputeventtypes to block unexpected csqc input events (for ss).
Better compat with DP's loadfont console command (for ss).
Added dpcompat_smallerfonts cvar to replicate a DP bug (for ss).
Detect dp's m_draw extension, to work around it (for ss).
Cvar dpcompat_ignoremodificationtimes added. A value of 0 favour the most recently modified file, 1 will use DP-like alphabetically sorted preferences (for ss).
loadfont builtin can now accept outline=1 in the sizes arg for slightly more readable fonts.
Fix bbox calcs for rotated entities, fix needed for r_ignorenetpvs 0.
Hackily parse emoji.json to provide :poop: etc suggestions.
Skip prediction entirely when there's no local entity info. This fixes stair-smoothing in xonotic.
screenshot_cubemap will now capture half-float images when saving to ktx or dds files.
Fix support for xcf files larger than 4gb, mostly to avoid compiler warnings.
Fixed size of gfx/loading.lmp when replacement textures are used.
Added mipmap support for rg8 and l8a8 textures.
r_hdr_framebuffer cvar updated to support format names instead of random negative numbers. Description updated to name some interesting ones.
Perform autoupdate _checks_ ONLY with explicit user confirmation (actual updating already needed user confirmation, but this extra step should reduce the chances of us getting wrongly accused of exfiltrating user data if we're run in a sandbox - we ONLY ever included the updating engine's version in the checks, though there's nothing we can do to avoid sending the user's router's IP).
Removed the 'summon satan all over your harddrive' quit message, in case paranoid security researchers are idiots and don't bother doing actual research.
Removed the triptohell.info and fte.triptohell.info certificates, they really need to stop being self-signed. The updates domain is still self-signed for autoupdates.
Video drivers are now able to report supported video resolutions, visible to menuqc. Currently only works with SDL2 builds.
Added setmousepos builtin. Should work with glx+win32 build.
VF_SKYROOM_CAMERA can now accept an extra two args, setviewprop(VF_SKYROOM_CAMERA, org, axis, degrees).
Removed v_skyroom_origin+v_skyroom_orientation cvars in favour just v_skyroom, which should make it behave more like the 'fog' command (used when csqc isn't overriding).
Added R_EndPolygonRibbon builtin to make it faster+easier to generate textured ribbon/cable/etc wide lines (for TW).
sdl: Fix up sys_sdl.c's file enumeration to support wildcards in directories.
edit command now displays end1.bin/end2.bin correctly, because we can.
Finally add support for f_modified - though ruleset_allow_larger_models and ruleset_allow_overlong_sounds generally make it redundant.
Fix threading race condition in sha1 lookups.
Updated f_ruleset to include the same extra flags reported by ezquake.
A mod's default.fmf file can now contain an eg 'mainconfig config.cfg' line (to explicitly set the main config saved with cfg_save_auto 1 etc).
fmf: basegame steam:GameName/GameDir can be used to try to load a mod directory from an installed steam game. The resulting gamedir will be read-only.
HOMEDIR CHANGE: use homedirs only if the basedir cannot be written or a homedir already exists, which should further reduce the probability of microsoft randomly uploading our data to their cloud (but mostly because its annoying to never know where your data is written).
Fixed buf_cvarlist, should work in xonotic now, and without segfaults.
Added an extra arg to URI_Get_Callback calls - the response size, also changed the tempstring to contain all bytes of the response, you need to be careful about nulls though.
Try to work around nvidia's forced-panning bug on x11 when changing video modes. This might screw with other programs.
sdl: support custom icons.
sdl: support choosing a specific display.
Added some documentation to menuqc builtins.
menusys: use outlines for slightly more readable fonts.
menusys: switch vid_width and vid_height combos into a single video mode combo to set both according to reported video modes.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5581 fc73d0e0-1445-4013-8a0c-d673dee63da5
2019-11-20 03:09:50 +00:00
if ( dSHGetKnownFolderPath )
{
wchar_t * wide ;
static const GUID qFOLDERID_SavedGames = { 0x4c5c32ff , 0xbb9d , 0x43b0 , { 0xb5 , 0xb4 , 0x2d , 0x72 , 0xe5 , 0x4e , 0xaa , 0xa4 } } ;
# define qKF_FLAG_CREATE 0x00008000
if ( SUCCEEDED ( dSHGetKnownFolderPath ( & qFOLDERID_SavedGames , qKF_FLAG_CREATE , NULL , & wide ) ) )
2015-05-14 03:06:58 +00:00
{
Too many changes, sorry.
Change revision displays, use the SVN commit date instead of using __DATE__ (when there's no local changes). This should allow reproducible builds.
Added s_al_disable cvar, to block openal and all the various problems people have had with it, without having to name an explicit fallback (which would vary by system).
Add mastervolume cvar (for ss).
Add r_shadows 2 (aka fake shadows - for ss).
Add scr_loadingscreen_aspect -1 setting, to disable levelshots entirely, also disables the progress bar (for ss).
Better support for some effectinfo hacks (for ss).
Added dpcompat_nocsqcwarnings (because of lazy+buggy mods like ss).
Rework the dpcsqc versions of project+unproject builtins for better compat (for ss).
Added dpcompat_csqcinputeventtypes to block unexpected csqc input events (for ss).
Better compat with DP's loadfont console command (for ss).
Added dpcompat_smallerfonts cvar to replicate a DP bug (for ss).
Detect dp's m_draw extension, to work around it (for ss).
Cvar dpcompat_ignoremodificationtimes added. A value of 0 favour the most recently modified file, 1 will use DP-like alphabetically sorted preferences (for ss).
loadfont builtin can now accept outline=1 in the sizes arg for slightly more readable fonts.
Fix bbox calcs for rotated entities, fix needed for r_ignorenetpvs 0.
Hackily parse emoji.json to provide :poop: etc suggestions.
Skip prediction entirely when there's no local entity info. This fixes stair-smoothing in xonotic.
screenshot_cubemap will now capture half-float images when saving to ktx or dds files.
Fix support for xcf files larger than 4gb, mostly to avoid compiler warnings.
Fixed size of gfx/loading.lmp when replacement textures are used.
Added mipmap support for rg8 and l8a8 textures.
r_hdr_framebuffer cvar updated to support format names instead of random negative numbers. Description updated to name some interesting ones.
Perform autoupdate _checks_ ONLY with explicit user confirmation (actual updating already needed user confirmation, but this extra step should reduce the chances of us getting wrongly accused of exfiltrating user data if we're run in a sandbox - we ONLY ever included the updating engine's version in the checks, though there's nothing we can do to avoid sending the user's router's IP).
Removed the 'summon satan all over your harddrive' quit message, in case paranoid security researchers are idiots and don't bother doing actual research.
Removed the triptohell.info and fte.triptohell.info certificates, they really need to stop being self-signed. The updates domain is still self-signed for autoupdates.
Video drivers are now able to report supported video resolutions, visible to menuqc. Currently only works with SDL2 builds.
Added setmousepos builtin. Should work with glx+win32 build.
VF_SKYROOM_CAMERA can now accept an extra two args, setviewprop(VF_SKYROOM_CAMERA, org, axis, degrees).
Removed v_skyroom_origin+v_skyroom_orientation cvars in favour just v_skyroom, which should make it behave more like the 'fog' command (used when csqc isn't overriding).
Added R_EndPolygonRibbon builtin to make it faster+easier to generate textured ribbon/cable/etc wide lines (for TW).
sdl: Fix up sys_sdl.c's file enumeration to support wildcards in directories.
edit command now displays end1.bin/end2.bin correctly, because we can.
Finally add support for f_modified - though ruleset_allow_larger_models and ruleset_allow_overlong_sounds generally make it redundant.
Fix threading race condition in sha1 lookups.
Updated f_ruleset to include the same extra flags reported by ezquake.
A mod's default.fmf file can now contain an eg 'mainconfig config.cfg' line (to explicitly set the main config saved with cfg_save_auto 1 etc).
fmf: basegame steam:GameName/GameDir can be used to try to load a mod directory from an installed steam game. The resulting gamedir will be read-only.
HOMEDIR CHANGE: use homedirs only if the basedir cannot be written or a homedir already exists, which should further reduce the probability of microsoft randomly uploading our data to their cloud (but mostly because its annoying to never know where your data is written).
Fixed buf_cvarlist, should work in xonotic now, and without segfaults.
Added an extra arg to URI_Get_Callback calls - the response size, also changed the tempstring to contain all bytes of the response, you need to be careful about nulls though.
Try to work around nvidia's forced-panning bug on x11 when changing video modes. This might screw with other programs.
sdl: support custom icons.
sdl: support choosing a specific display.
Added some documentation to menuqc builtins.
menusys: use outlines for slightly more readable fonts.
menusys: switch vid_width and vid_height combos into a single video mode combo to set both according to reported video modes.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5581 fc73d0e0-1445-4013-8a0c-d673dee63da5
2019-11-20 03:09:50 +00:00
narrowen ( homedir [ WINHOME_SAVEDGAMES ] . path , sizeof ( homedir [ WINHOME_SAVEDGAMES ] . path ) , wide ) ;
CoTaskMemFree ( wide ) ;
}
}
2008-06-13 05:03:54 +00:00
Too many changes, sorry.
Change revision displays, use the SVN commit date instead of using __DATE__ (when there's no local changes). This should allow reproducible builds.
Added s_al_disable cvar, to block openal and all the various problems people have had with it, without having to name an explicit fallback (which would vary by system).
Add mastervolume cvar (for ss).
Add r_shadows 2 (aka fake shadows - for ss).
Add scr_loadingscreen_aspect -1 setting, to disable levelshots entirely, also disables the progress bar (for ss).
Better support for some effectinfo hacks (for ss).
Added dpcompat_nocsqcwarnings (because of lazy+buggy mods like ss).
Rework the dpcsqc versions of project+unproject builtins for better compat (for ss).
Added dpcompat_csqcinputeventtypes to block unexpected csqc input events (for ss).
Better compat with DP's loadfont console command (for ss).
Added dpcompat_smallerfonts cvar to replicate a DP bug (for ss).
Detect dp's m_draw extension, to work around it (for ss).
Cvar dpcompat_ignoremodificationtimes added. A value of 0 favour the most recently modified file, 1 will use DP-like alphabetically sorted preferences (for ss).
loadfont builtin can now accept outline=1 in the sizes arg for slightly more readable fonts.
Fix bbox calcs for rotated entities, fix needed for r_ignorenetpvs 0.
Hackily parse emoji.json to provide :poop: etc suggestions.
Skip prediction entirely when there's no local entity info. This fixes stair-smoothing in xonotic.
screenshot_cubemap will now capture half-float images when saving to ktx or dds files.
Fix support for xcf files larger than 4gb, mostly to avoid compiler warnings.
Fixed size of gfx/loading.lmp when replacement textures are used.
Added mipmap support for rg8 and l8a8 textures.
r_hdr_framebuffer cvar updated to support format names instead of random negative numbers. Description updated to name some interesting ones.
Perform autoupdate _checks_ ONLY with explicit user confirmation (actual updating already needed user confirmation, but this extra step should reduce the chances of us getting wrongly accused of exfiltrating user data if we're run in a sandbox - we ONLY ever included the updating engine's version in the checks, though there's nothing we can do to avoid sending the user's router's IP).
Removed the 'summon satan all over your harddrive' quit message, in case paranoid security researchers are idiots and don't bother doing actual research.
Removed the triptohell.info and fte.triptohell.info certificates, they really need to stop being self-signed. The updates domain is still self-signed for autoupdates.
Video drivers are now able to report supported video resolutions, visible to menuqc. Currently only works with SDL2 builds.
Added setmousepos builtin. Should work with glx+win32 build.
VF_SKYROOM_CAMERA can now accept an extra two args, setviewprop(VF_SKYROOM_CAMERA, org, axis, degrees).
Removed v_skyroom_origin+v_skyroom_orientation cvars in favour just v_skyroom, which should make it behave more like the 'fog' command (used when csqc isn't overriding).
Added R_EndPolygonRibbon builtin to make it faster+easier to generate textured ribbon/cable/etc wide lines (for TW).
sdl: Fix up sys_sdl.c's file enumeration to support wildcards in directories.
edit command now displays end1.bin/end2.bin correctly, because we can.
Finally add support for f_modified - though ruleset_allow_larger_models and ruleset_allow_overlong_sounds generally make it redundant.
Fix threading race condition in sha1 lookups.
Updated f_ruleset to include the same extra flags reported by ezquake.
A mod's default.fmf file can now contain an eg 'mainconfig config.cfg' line (to explicitly set the main config saved with cfg_save_auto 1 etc).
fmf: basegame steam:GameName/GameDir can be used to try to load a mod directory from an installed steam game. The resulting gamedir will be read-only.
HOMEDIR CHANGE: use homedirs only if the basedir cannot be written or a homedir already exists, which should further reduce the probability of microsoft randomly uploading our data to their cloud (but mostly because its annoying to never know where your data is written).
Fixed buf_cvarlist, should work in xonotic now, and without segfaults.
Added an extra arg to URI_Get_Callback calls - the response size, also changed the tempstring to contain all bytes of the response, you need to be careful about nulls though.
Try to work around nvidia's forced-panning bug on x11 when changing video modes. This might screw with other programs.
sdl: support custom icons.
sdl: support choosing a specific display.
Added some documentation to menuqc builtins.
menusys: use outlines for slightly more readable fonts.
menusys: switch vid_width and vid_height combos into a single video mode combo to set both according to reported video modes.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5581 fc73d0e0-1445-4013-8a0c-d673dee63da5
2019-11-20 03:09:50 +00:00
if ( dSHGetFolderPathW )
{
wchar_t wfolder [ MAX_PATH ] ;
if ( dSHGetFolderPathW ( NULL , 0x5 /*CSIDL_PERSONAL*/ , NULL , 0 , wfolder ) = = S_OK )
2008-06-13 05:03:54 +00:00
{
Too many changes, sorry.
Change revision displays, use the SVN commit date instead of using __DATE__ (when there's no local changes). This should allow reproducible builds.
Added s_al_disable cvar, to block openal and all the various problems people have had with it, without having to name an explicit fallback (which would vary by system).
Add mastervolume cvar (for ss).
Add r_shadows 2 (aka fake shadows - for ss).
Add scr_loadingscreen_aspect -1 setting, to disable levelshots entirely, also disables the progress bar (for ss).
Better support for some effectinfo hacks (for ss).
Added dpcompat_nocsqcwarnings (because of lazy+buggy mods like ss).
Rework the dpcsqc versions of project+unproject builtins for better compat (for ss).
Added dpcompat_csqcinputeventtypes to block unexpected csqc input events (for ss).
Better compat with DP's loadfont console command (for ss).
Added dpcompat_smallerfonts cvar to replicate a DP bug (for ss).
Detect dp's m_draw extension, to work around it (for ss).
Cvar dpcompat_ignoremodificationtimes added. A value of 0 favour the most recently modified file, 1 will use DP-like alphabetically sorted preferences (for ss).
loadfont builtin can now accept outline=1 in the sizes arg for slightly more readable fonts.
Fix bbox calcs for rotated entities, fix needed for r_ignorenetpvs 0.
Hackily parse emoji.json to provide :poop: etc suggestions.
Skip prediction entirely when there's no local entity info. This fixes stair-smoothing in xonotic.
screenshot_cubemap will now capture half-float images when saving to ktx or dds files.
Fix support for xcf files larger than 4gb, mostly to avoid compiler warnings.
Fixed size of gfx/loading.lmp when replacement textures are used.
Added mipmap support for rg8 and l8a8 textures.
r_hdr_framebuffer cvar updated to support format names instead of random negative numbers. Description updated to name some interesting ones.
Perform autoupdate _checks_ ONLY with explicit user confirmation (actual updating already needed user confirmation, but this extra step should reduce the chances of us getting wrongly accused of exfiltrating user data if we're run in a sandbox - we ONLY ever included the updating engine's version in the checks, though there's nothing we can do to avoid sending the user's router's IP).
Removed the 'summon satan all over your harddrive' quit message, in case paranoid security researchers are idiots and don't bother doing actual research.
Removed the triptohell.info and fte.triptohell.info certificates, they really need to stop being self-signed. The updates domain is still self-signed for autoupdates.
Video drivers are now able to report supported video resolutions, visible to menuqc. Currently only works with SDL2 builds.
Added setmousepos builtin. Should work with glx+win32 build.
VF_SKYROOM_CAMERA can now accept an extra two args, setviewprop(VF_SKYROOM_CAMERA, org, axis, degrees).
Removed v_skyroom_origin+v_skyroom_orientation cvars in favour just v_skyroom, which should make it behave more like the 'fog' command (used when csqc isn't overriding).
Added R_EndPolygonRibbon builtin to make it faster+easier to generate textured ribbon/cable/etc wide lines (for TW).
sdl: Fix up sys_sdl.c's file enumeration to support wildcards in directories.
edit command now displays end1.bin/end2.bin correctly, because we can.
Finally add support for f_modified - though ruleset_allow_larger_models and ruleset_allow_overlong_sounds generally make it redundant.
Fix threading race condition in sha1 lookups.
Updated f_ruleset to include the same extra flags reported by ezquake.
A mod's default.fmf file can now contain an eg 'mainconfig config.cfg' line (to explicitly set the main config saved with cfg_save_auto 1 etc).
fmf: basegame steam:GameName/GameDir can be used to try to load a mod directory from an installed steam game. The resulting gamedir will be read-only.
HOMEDIR CHANGE: use homedirs only if the basedir cannot be written or a homedir already exists, which should further reduce the probability of microsoft randomly uploading our data to their cloud (but mostly because its annoying to never know where your data is written).
Fixed buf_cvarlist, should work in xonotic now, and without segfaults.
Added an extra arg to URI_Get_Callback calls - the response size, also changed the tempstring to contain all bytes of the response, you need to be careful about nulls though.
Try to work around nvidia's forced-panning bug on x11 when changing video modes. This might screw with other programs.
sdl: support custom icons.
sdl: support choosing a specific display.
Added some documentation to menuqc builtins.
menusys: use outlines for slightly more readable fonts.
menusys: switch vid_width and vid_height combos into a single video mode combo to set both according to reported video modes.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5581 fc73d0e0-1445-4013-8a0c-d673dee63da5
2019-11-20 03:09:50 +00:00
narrowen ( homedir [ WINHOME_DOCUMENTS ] . path , sizeof ( homedir [ WINHOME_DOCUMENTS ] . path ) , wfolder ) ;
Q_strncatz ( homedir [ WINHOME_DOCUMENTS ] . path , " /My Games " , sizeof ( homedir [ WINHOME_DOCUMENTS ] . path ) ) ;
}
//at some point, microsoft (in their infinitesimal wisdom) decided that 'CSIDL_PERSONAL' should mean 'CSIDL_GIVEITALLTOMICROSOFT'
//so use the old/CSIDL_NOTACTUALLYPERSONAL path by default for compat, but if there's nothing there then switch to CSIDL_LOCAL_APPDATA instead
if ( dSHGetFolderPathW ( NULL , 0x1c /*CSIDL_LOCAL_APPDATA*/ , NULL , 0 , wfolder ) = = S_OK )
{
narrowen ( homedir [ WINHOME_LOCALDATA ] . path , sizeof ( homedir [ WINHOME_LOCALDATA ] . path ) , wfolder ) ;
2008-06-13 05:03:54 +00:00
}
Too many changes, sorry.
Change revision displays, use the SVN commit date instead of using __DATE__ (when there's no local changes). This should allow reproducible builds.
Added s_al_disable cvar, to block openal and all the various problems people have had with it, without having to name an explicit fallback (which would vary by system).
Add mastervolume cvar (for ss).
Add r_shadows 2 (aka fake shadows - for ss).
Add scr_loadingscreen_aspect -1 setting, to disable levelshots entirely, also disables the progress bar (for ss).
Better support for some effectinfo hacks (for ss).
Added dpcompat_nocsqcwarnings (because of lazy+buggy mods like ss).
Rework the dpcsqc versions of project+unproject builtins for better compat (for ss).
Added dpcompat_csqcinputeventtypes to block unexpected csqc input events (for ss).
Better compat with DP's loadfont console command (for ss).
Added dpcompat_smallerfonts cvar to replicate a DP bug (for ss).
Detect dp's m_draw extension, to work around it (for ss).
Cvar dpcompat_ignoremodificationtimes added. A value of 0 favour the most recently modified file, 1 will use DP-like alphabetically sorted preferences (for ss).
loadfont builtin can now accept outline=1 in the sizes arg for slightly more readable fonts.
Fix bbox calcs for rotated entities, fix needed for r_ignorenetpvs 0.
Hackily parse emoji.json to provide :poop: etc suggestions.
Skip prediction entirely when there's no local entity info. This fixes stair-smoothing in xonotic.
screenshot_cubemap will now capture half-float images when saving to ktx or dds files.
Fix support for xcf files larger than 4gb, mostly to avoid compiler warnings.
Fixed size of gfx/loading.lmp when replacement textures are used.
Added mipmap support for rg8 and l8a8 textures.
r_hdr_framebuffer cvar updated to support format names instead of random negative numbers. Description updated to name some interesting ones.
Perform autoupdate _checks_ ONLY with explicit user confirmation (actual updating already needed user confirmation, but this extra step should reduce the chances of us getting wrongly accused of exfiltrating user data if we're run in a sandbox - we ONLY ever included the updating engine's version in the checks, though there's nothing we can do to avoid sending the user's router's IP).
Removed the 'summon satan all over your harddrive' quit message, in case paranoid security researchers are idiots and don't bother doing actual research.
Removed the triptohell.info and fte.triptohell.info certificates, they really need to stop being self-signed. The updates domain is still self-signed for autoupdates.
Video drivers are now able to report supported video resolutions, visible to menuqc. Currently only works with SDL2 builds.
Added setmousepos builtin. Should work with glx+win32 build.
VF_SKYROOM_CAMERA can now accept an extra two args, setviewprop(VF_SKYROOM_CAMERA, org, axis, degrees).
Removed v_skyroom_origin+v_skyroom_orientation cvars in favour just v_skyroom, which should make it behave more like the 'fog' command (used when csqc isn't overriding).
Added R_EndPolygonRibbon builtin to make it faster+easier to generate textured ribbon/cable/etc wide lines (for TW).
sdl: Fix up sys_sdl.c's file enumeration to support wildcards in directories.
edit command now displays end1.bin/end2.bin correctly, because we can.
Finally add support for f_modified - though ruleset_allow_larger_models and ruleset_allow_overlong_sounds generally make it redundant.
Fix threading race condition in sha1 lookups.
Updated f_ruleset to include the same extra flags reported by ezquake.
A mod's default.fmf file can now contain an eg 'mainconfig config.cfg' line (to explicitly set the main config saved with cfg_save_auto 1 etc).
fmf: basegame steam:GameName/GameDir can be used to try to load a mod directory from an installed steam game. The resulting gamedir will be read-only.
HOMEDIR CHANGE: use homedirs only if the basedir cannot be written or a homedir already exists, which should further reduce the probability of microsoft randomly uploading our data to their cloud (but mostly because its annoying to never know where your data is written).
Fixed buf_cvarlist, should work in xonotic now, and without segfaults.
Added an extra arg to URI_Get_Callback calls - the response size, also changed the tempstring to contain all bytes of the response, you need to be careful about nulls though.
Try to work around nvidia's forced-panning bug on x11 when changing video modes. This might screw with other programs.
sdl: support custom icons.
sdl: support choosing a specific display.
Added some documentation to menuqc builtins.
menusys: use outlines for slightly more readable fonts.
menusys: switch vid_width and vid_height combos into a single video mode combo to set both according to reported video modes.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5581 fc73d0e0-1445-4013-8a0c-d673dee63da5
2019-11-20 03:09:50 +00:00
}
if ( ! * homedir [ WINHOME_DOCUMENTS ] . path )
{ //guess. sucks for non-english people.
char * ev = getenv ( " USERPROFILE " ) ;
if ( ev )
Q_snprintfz ( homedir [ WINHOME_DOCUMENTS ] . path , sizeof ( homedir [ WINHOME_DOCUMENTS ] . path ) , " %s/My Documents/My Games/%s/ " , ev , HOMESUBDIR ) ;
}
// if (shfolder)
// FreeLibrary(shfolder);
2008-06-13 05:03:54 +00:00
Too many changes, sorry.
Change revision displays, use the SVN commit date instead of using __DATE__ (when there's no local changes). This should allow reproducible builds.
Added s_al_disable cvar, to block openal and all the various problems people have had with it, without having to name an explicit fallback (which would vary by system).
Add mastervolume cvar (for ss).
Add r_shadows 2 (aka fake shadows - for ss).
Add scr_loadingscreen_aspect -1 setting, to disable levelshots entirely, also disables the progress bar (for ss).
Better support for some effectinfo hacks (for ss).
Added dpcompat_nocsqcwarnings (because of lazy+buggy mods like ss).
Rework the dpcsqc versions of project+unproject builtins for better compat (for ss).
Added dpcompat_csqcinputeventtypes to block unexpected csqc input events (for ss).
Better compat with DP's loadfont console command (for ss).
Added dpcompat_smallerfonts cvar to replicate a DP bug (for ss).
Detect dp's m_draw extension, to work around it (for ss).
Cvar dpcompat_ignoremodificationtimes added. A value of 0 favour the most recently modified file, 1 will use DP-like alphabetically sorted preferences (for ss).
loadfont builtin can now accept outline=1 in the sizes arg for slightly more readable fonts.
Fix bbox calcs for rotated entities, fix needed for r_ignorenetpvs 0.
Hackily parse emoji.json to provide :poop: etc suggestions.
Skip prediction entirely when there's no local entity info. This fixes stair-smoothing in xonotic.
screenshot_cubemap will now capture half-float images when saving to ktx or dds files.
Fix support for xcf files larger than 4gb, mostly to avoid compiler warnings.
Fixed size of gfx/loading.lmp when replacement textures are used.
Added mipmap support for rg8 and l8a8 textures.
r_hdr_framebuffer cvar updated to support format names instead of random negative numbers. Description updated to name some interesting ones.
Perform autoupdate _checks_ ONLY with explicit user confirmation (actual updating already needed user confirmation, but this extra step should reduce the chances of us getting wrongly accused of exfiltrating user data if we're run in a sandbox - we ONLY ever included the updating engine's version in the checks, though there's nothing we can do to avoid sending the user's router's IP).
Removed the 'summon satan all over your harddrive' quit message, in case paranoid security researchers are idiots and don't bother doing actual research.
Removed the triptohell.info and fte.triptohell.info certificates, they really need to stop being self-signed. The updates domain is still self-signed for autoupdates.
Video drivers are now able to report supported video resolutions, visible to menuqc. Currently only works with SDL2 builds.
Added setmousepos builtin. Should work with glx+win32 build.
VF_SKYROOM_CAMERA can now accept an extra two args, setviewprop(VF_SKYROOM_CAMERA, org, axis, degrees).
Removed v_skyroom_origin+v_skyroom_orientation cvars in favour just v_skyroom, which should make it behave more like the 'fog' command (used when csqc isn't overriding).
Added R_EndPolygonRibbon builtin to make it faster+easier to generate textured ribbon/cable/etc wide lines (for TW).
sdl: Fix up sys_sdl.c's file enumeration to support wildcards in directories.
edit command now displays end1.bin/end2.bin correctly, because we can.
Finally add support for f_modified - though ruleset_allow_larger_models and ruleset_allow_overlong_sounds generally make it redundant.
Fix threading race condition in sha1 lookups.
Updated f_ruleset to include the same extra flags reported by ezquake.
A mod's default.fmf file can now contain an eg 'mainconfig config.cfg' line (to explicitly set the main config saved with cfg_save_auto 1 etc).
fmf: basegame steam:GameName/GameDir can be used to try to load a mod directory from an installed steam game. The resulting gamedir will be read-only.
HOMEDIR CHANGE: use homedirs only if the basedir cannot be written or a homedir already exists, which should further reduce the probability of microsoft randomly uploading our data to their cloud (but mostly because its annoying to never know where your data is written).
Fixed buf_cvarlist, should work in xonotic now, and without segfaults.
Added an extra arg to URI_Get_Callback calls - the response size, also changed the tempstring to contain all bytes of the response, you need to be careful about nulls though.
Try to work around nvidia's forced-panning bug on x11 when changing video modes. This might screw with other programs.
sdl: support custom icons.
sdl: support choosing a specific display.
Added some documentation to menuqc builtins.
menusys: use outlines for slightly more readable fonts.
menusys: switch vid_width and vid_height combos into a single video mode combo to set both according to reported video modes.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5581 fc73d0e0-1445-4013-8a0c-d673dee63da5
2019-11-20 03:09:50 +00:00
for ( i = 0 ; i < countof ( homedir ) ; i + + )
{
char formal [ MAX_OSPATH ] ;
char informal [ MAX_OSPATH ] ;
if ( ! * homedir [ i ] . path )
continue ; //erk, don't know, not valid/known on this system.
if ( ! manifest | | ! manifest - > formalname | | ( /*legacy compat hack case*/ ! strcmp ( manifest - > formalname , " Quake " ) & & strstr ( HOMESUBDIR , " Quake " ) ) )
{
Q_snprintfz ( formal , sizeof ( formal ) , " %s/%s/ " , homedir [ i ] . path , HOMESUBDIR ) ; //'FTE Quake' or something hardcoded.
* informal = 0 ;
}
else
{
if ( strchr ( manifest - > formalname , ' ( ' ) | | //ugly
strchr ( manifest - > formalname , ' [ ' ) | | //ugly
strchr ( manifest - > formalname , ' . ' ) | | //ugly
strchr ( manifest - > formalname , ' \" ' ) | | //ugly (and invalid)
strchr ( manifest - > formalname , ' | ' ) | | //invalid
strchr ( manifest - > formalname , ' < ' ) | | //invalid
strchr ( manifest - > formalname , ' > ' ) | | //invalid
strchr ( manifest - > formalname , ' \\ ' ) | | //long paths
strchr ( manifest - > formalname , ' / ' ) | | //long paths
strchr ( manifest - > formalname , ' : ' ) | | //alternative data stream separator
strchr ( manifest - > formalname , ' * ' ) | | //wildcard
strchr ( manifest - > formalname , ' ? ' ) ) //wildcard
* formal = 0 ; //don't use filenames with awkward chars...
else
Q_snprintfz ( formal , sizeof ( formal ) , " %s/%s/ " , homedir [ i ] . path , manifest - > formalname ) ; //'Quake' / 'The Wastes' / etc
Q_snprintfz ( informal , sizeof ( informal ) , " %s/%s/ " , homedir [ i ] . path , manifest - > installation ) ; //'quake' / 'wastes' / etc
}
if ( * formal & & GetFileAttributesU ( formal ) ! = INVALID_FILE_ATTRIBUTES ) //path exists, use it.
{
Q_strncpyz ( com_homepath , formal , sizeof ( com_homepath ) ) ;
break ;
}
else if ( * informal & & GetFileAttributesU ( informal ) ! = INVALID_FILE_ATTRIBUTES ) //path exists, use it.
2009-04-01 22:03:56 +00:00
{
Too many changes, sorry.
Change revision displays, use the SVN commit date instead of using __DATE__ (when there's no local changes). This should allow reproducible builds.
Added s_al_disable cvar, to block openal and all the various problems people have had with it, without having to name an explicit fallback (which would vary by system).
Add mastervolume cvar (for ss).
Add r_shadows 2 (aka fake shadows - for ss).
Add scr_loadingscreen_aspect -1 setting, to disable levelshots entirely, also disables the progress bar (for ss).
Better support for some effectinfo hacks (for ss).
Added dpcompat_nocsqcwarnings (because of lazy+buggy mods like ss).
Rework the dpcsqc versions of project+unproject builtins for better compat (for ss).
Added dpcompat_csqcinputeventtypes to block unexpected csqc input events (for ss).
Better compat with DP's loadfont console command (for ss).
Added dpcompat_smallerfonts cvar to replicate a DP bug (for ss).
Detect dp's m_draw extension, to work around it (for ss).
Cvar dpcompat_ignoremodificationtimes added. A value of 0 favour the most recently modified file, 1 will use DP-like alphabetically sorted preferences (for ss).
loadfont builtin can now accept outline=1 in the sizes arg for slightly more readable fonts.
Fix bbox calcs for rotated entities, fix needed for r_ignorenetpvs 0.
Hackily parse emoji.json to provide :poop: etc suggestions.
Skip prediction entirely when there's no local entity info. This fixes stair-smoothing in xonotic.
screenshot_cubemap will now capture half-float images when saving to ktx or dds files.
Fix support for xcf files larger than 4gb, mostly to avoid compiler warnings.
Fixed size of gfx/loading.lmp when replacement textures are used.
Added mipmap support for rg8 and l8a8 textures.
r_hdr_framebuffer cvar updated to support format names instead of random negative numbers. Description updated to name some interesting ones.
Perform autoupdate _checks_ ONLY with explicit user confirmation (actual updating already needed user confirmation, but this extra step should reduce the chances of us getting wrongly accused of exfiltrating user data if we're run in a sandbox - we ONLY ever included the updating engine's version in the checks, though there's nothing we can do to avoid sending the user's router's IP).
Removed the 'summon satan all over your harddrive' quit message, in case paranoid security researchers are idiots and don't bother doing actual research.
Removed the triptohell.info and fte.triptohell.info certificates, they really need to stop being self-signed. The updates domain is still self-signed for autoupdates.
Video drivers are now able to report supported video resolutions, visible to menuqc. Currently only works with SDL2 builds.
Added setmousepos builtin. Should work with glx+win32 build.
VF_SKYROOM_CAMERA can now accept an extra two args, setviewprop(VF_SKYROOM_CAMERA, org, axis, degrees).
Removed v_skyroom_origin+v_skyroom_orientation cvars in favour just v_skyroom, which should make it behave more like the 'fog' command (used when csqc isn't overriding).
Added R_EndPolygonRibbon builtin to make it faster+easier to generate textured ribbon/cable/etc wide lines (for TW).
sdl: Fix up sys_sdl.c's file enumeration to support wildcards in directories.
edit command now displays end1.bin/end2.bin correctly, because we can.
Finally add support for f_modified - though ruleset_allow_larger_models and ruleset_allow_overlong_sounds generally make it redundant.
Fix threading race condition in sha1 lookups.
Updated f_ruleset to include the same extra flags reported by ezquake.
A mod's default.fmf file can now contain an eg 'mainconfig config.cfg' line (to explicitly set the main config saved with cfg_save_auto 1 etc).
fmf: basegame steam:GameName/GameDir can be used to try to load a mod directory from an installed steam game. The resulting gamedir will be read-only.
HOMEDIR CHANGE: use homedirs only if the basedir cannot be written or a homedir already exists, which should further reduce the probability of microsoft randomly uploading our data to their cloud (but mostly because its annoying to never know where your data is written).
Fixed buf_cvarlist, should work in xonotic now, and without segfaults.
Added an extra arg to URI_Get_Callback calls - the response size, also changed the tempstring to contain all bytes of the response, you need to be careful about nulls though.
Try to work around nvidia's forced-panning bug on x11 when changing video modes. This might screw with other programs.
sdl: support custom icons.
sdl: support choosing a specific display.
Added some documentation to menuqc builtins.
menusys: use outlines for slightly more readable fonts.
menusys: switch vid_width and vid_height combos into a single video mode combo to set both according to reported video modes.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5581 fc73d0e0-1445-4013-8a0c-d673dee63da5
2019-11-20 03:09:50 +00:00
Q_strncpyz ( com_homepath , informal , sizeof ( com_homepath ) ) ;
break ;
2009-04-01 22:03:56 +00:00
}
Too many changes, sorry.
Change revision displays, use the SVN commit date instead of using __DATE__ (when there's no local changes). This should allow reproducible builds.
Added s_al_disable cvar, to block openal and all the various problems people have had with it, without having to name an explicit fallback (which would vary by system).
Add mastervolume cvar (for ss).
Add r_shadows 2 (aka fake shadows - for ss).
Add scr_loadingscreen_aspect -1 setting, to disable levelshots entirely, also disables the progress bar (for ss).
Better support for some effectinfo hacks (for ss).
Added dpcompat_nocsqcwarnings (because of lazy+buggy mods like ss).
Rework the dpcsqc versions of project+unproject builtins for better compat (for ss).
Added dpcompat_csqcinputeventtypes to block unexpected csqc input events (for ss).
Better compat with DP's loadfont console command (for ss).
Added dpcompat_smallerfonts cvar to replicate a DP bug (for ss).
Detect dp's m_draw extension, to work around it (for ss).
Cvar dpcompat_ignoremodificationtimes added. A value of 0 favour the most recently modified file, 1 will use DP-like alphabetically sorted preferences (for ss).
loadfont builtin can now accept outline=1 in the sizes arg for slightly more readable fonts.
Fix bbox calcs for rotated entities, fix needed for r_ignorenetpvs 0.
Hackily parse emoji.json to provide :poop: etc suggestions.
Skip prediction entirely when there's no local entity info. This fixes stair-smoothing in xonotic.
screenshot_cubemap will now capture half-float images when saving to ktx or dds files.
Fix support for xcf files larger than 4gb, mostly to avoid compiler warnings.
Fixed size of gfx/loading.lmp when replacement textures are used.
Added mipmap support for rg8 and l8a8 textures.
r_hdr_framebuffer cvar updated to support format names instead of random negative numbers. Description updated to name some interesting ones.
Perform autoupdate _checks_ ONLY with explicit user confirmation (actual updating already needed user confirmation, but this extra step should reduce the chances of us getting wrongly accused of exfiltrating user data if we're run in a sandbox - we ONLY ever included the updating engine's version in the checks, though there's nothing we can do to avoid sending the user's router's IP).
Removed the 'summon satan all over your harddrive' quit message, in case paranoid security researchers are idiots and don't bother doing actual research.
Removed the triptohell.info and fte.triptohell.info certificates, they really need to stop being self-signed. The updates domain is still self-signed for autoupdates.
Video drivers are now able to report supported video resolutions, visible to menuqc. Currently only works with SDL2 builds.
Added setmousepos builtin. Should work with glx+win32 build.
VF_SKYROOM_CAMERA can now accept an extra two args, setviewprop(VF_SKYROOM_CAMERA, org, axis, degrees).
Removed v_skyroom_origin+v_skyroom_orientation cvars in favour just v_skyroom, which should make it behave more like the 'fog' command (used when csqc isn't overriding).
Added R_EndPolygonRibbon builtin to make it faster+easier to generate textured ribbon/cable/etc wide lines (for TW).
sdl: Fix up sys_sdl.c's file enumeration to support wildcards in directories.
edit command now displays end1.bin/end2.bin correctly, because we can.
Finally add support for f_modified - though ruleset_allow_larger_models and ruleset_allow_overlong_sounds generally make it redundant.
Fix threading race condition in sha1 lookups.
Updated f_ruleset to include the same extra flags reported by ezquake.
A mod's default.fmf file can now contain an eg 'mainconfig config.cfg' line (to explicitly set the main config saved with cfg_save_auto 1 etc).
fmf: basegame steam:GameName/GameDir can be used to try to load a mod directory from an installed steam game. The resulting gamedir will be read-only.
HOMEDIR CHANGE: use homedirs only if the basedir cannot be written or a homedir already exists, which should further reduce the probability of microsoft randomly uploading our data to their cloud (but mostly because its annoying to never know where your data is written).
Fixed buf_cvarlist, should work in xonotic now, and without segfaults.
Added an extra arg to URI_Get_Callback calls - the response size, also changed the tempstring to contain all bytes of the response, you need to be careful about nulls though.
Try to work around nvidia's forced-panning bug on x11 when changing video modes. This might screw with other programs.
sdl: support custom icons.
sdl: support choosing a specific display.
Added some documentation to menuqc builtins.
menusys: use outlines for slightly more readable fonts.
menusys: switch vid_width and vid_height combos into a single video mode combo to set both according to reported video modes.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5581 fc73d0e0-1445-4013-8a0c-d673dee63da5
2019-11-20 03:09:50 +00:00
else if ( ! * com_homepath )
{
if ( ! * informal )
Q_strncpyz ( com_homepath , formal , sizeof ( com_homepath ) ) ;
else
Q_strncpyz ( com_homepath , informal , sizeof ( com_homepath ) ) ;
continue ; //keep looking, we might still find one that actually exists.
}
}
2009-04-01 22:03:56 +00:00
Too many changes, sorry.
Change revision displays, use the SVN commit date instead of using __DATE__ (when there's no local changes). This should allow reproducible builds.
Added s_al_disable cvar, to block openal and all the various problems people have had with it, without having to name an explicit fallback (which would vary by system).
Add mastervolume cvar (for ss).
Add r_shadows 2 (aka fake shadows - for ss).
Add scr_loadingscreen_aspect -1 setting, to disable levelshots entirely, also disables the progress bar (for ss).
Better support for some effectinfo hacks (for ss).
Added dpcompat_nocsqcwarnings (because of lazy+buggy mods like ss).
Rework the dpcsqc versions of project+unproject builtins for better compat (for ss).
Added dpcompat_csqcinputeventtypes to block unexpected csqc input events (for ss).
Better compat with DP's loadfont console command (for ss).
Added dpcompat_smallerfonts cvar to replicate a DP bug (for ss).
Detect dp's m_draw extension, to work around it (for ss).
Cvar dpcompat_ignoremodificationtimes added. A value of 0 favour the most recently modified file, 1 will use DP-like alphabetically sorted preferences (for ss).
loadfont builtin can now accept outline=1 in the sizes arg for slightly more readable fonts.
Fix bbox calcs for rotated entities, fix needed for r_ignorenetpvs 0.
Hackily parse emoji.json to provide :poop: etc suggestions.
Skip prediction entirely when there's no local entity info. This fixes stair-smoothing in xonotic.
screenshot_cubemap will now capture half-float images when saving to ktx or dds files.
Fix support for xcf files larger than 4gb, mostly to avoid compiler warnings.
Fixed size of gfx/loading.lmp when replacement textures are used.
Added mipmap support for rg8 and l8a8 textures.
r_hdr_framebuffer cvar updated to support format names instead of random negative numbers. Description updated to name some interesting ones.
Perform autoupdate _checks_ ONLY with explicit user confirmation (actual updating already needed user confirmation, but this extra step should reduce the chances of us getting wrongly accused of exfiltrating user data if we're run in a sandbox - we ONLY ever included the updating engine's version in the checks, though there's nothing we can do to avoid sending the user's router's IP).
Removed the 'summon satan all over your harddrive' quit message, in case paranoid security researchers are idiots and don't bother doing actual research.
Removed the triptohell.info and fte.triptohell.info certificates, they really need to stop being self-signed. The updates domain is still self-signed for autoupdates.
Video drivers are now able to report supported video resolutions, visible to menuqc. Currently only works with SDL2 builds.
Added setmousepos builtin. Should work with glx+win32 build.
VF_SKYROOM_CAMERA can now accept an extra two args, setviewprop(VF_SKYROOM_CAMERA, org, axis, degrees).
Removed v_skyroom_origin+v_skyroom_orientation cvars in favour just v_skyroom, which should make it behave more like the 'fog' command (used when csqc isn't overriding).
Added R_EndPolygonRibbon builtin to make it faster+easier to generate textured ribbon/cable/etc wide lines (for TW).
sdl: Fix up sys_sdl.c's file enumeration to support wildcards in directories.
edit command now displays end1.bin/end2.bin correctly, because we can.
Finally add support for f_modified - though ruleset_allow_larger_models and ruleset_allow_overlong_sounds generally make it redundant.
Fix threading race condition in sha1 lookups.
Updated f_ruleset to include the same extra flags reported by ezquake.
A mod's default.fmf file can now contain an eg 'mainconfig config.cfg' line (to explicitly set the main config saved with cfg_save_auto 1 etc).
fmf: basegame steam:GameName/GameDir can be used to try to load a mod directory from an installed steam game. The resulting gamedir will be read-only.
HOMEDIR CHANGE: use homedirs only if the basedir cannot be written or a homedir already exists, which should further reduce the probability of microsoft randomly uploading our data to their cloud (but mostly because its annoying to never know where your data is written).
Fixed buf_cvarlist, should work in xonotic now, and without segfaults.
Added an extra arg to URI_Get_Callback calls - the response size, also changed the tempstring to contain all bytes of the response, you need to be careful about nulls though.
Try to work around nvidia's forced-panning bug on x11 when changing video modes. This might screw with other programs.
sdl: support custom icons.
sdl: support choosing a specific display.
Added some documentation to menuqc builtins.
menusys: use outlines for slightly more readable fonts.
menusys: switch vid_width and vid_height combos into a single video mode combo to set both according to reported video modes.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5581 fc73d0e0-1445-4013-8a0c-d673dee63da5
2019-11-20 03:09:50 +00:00
/*would it not be better to just check to see if we have write permission to the basedir?*/
if ( winver > = 0x6 ) // Windows Vista and above
usehome = true ; // always use home directory by default, as Vista+ mimics this behavior anyway
else if ( winver > = 0x5 ) // Windows 2000/XP/2003
usehome = true ; //might as well follow this logic. We use .manifest stuff to avoid getting redirected to obscure locations, so access rights is all that is relevant, not whether we're an admin or not.
2008-06-13 07:24:11 +00:00
Too many changes, sorry.
Change revision displays, use the SVN commit date instead of using __DATE__ (when there's no local changes). This should allow reproducible builds.
Added s_al_disable cvar, to block openal and all the various problems people have had with it, without having to name an explicit fallback (which would vary by system).
Add mastervolume cvar (for ss).
Add r_shadows 2 (aka fake shadows - for ss).
Add scr_loadingscreen_aspect -1 setting, to disable levelshots entirely, also disables the progress bar (for ss).
Better support for some effectinfo hacks (for ss).
Added dpcompat_nocsqcwarnings (because of lazy+buggy mods like ss).
Rework the dpcsqc versions of project+unproject builtins for better compat (for ss).
Added dpcompat_csqcinputeventtypes to block unexpected csqc input events (for ss).
Better compat with DP's loadfont console command (for ss).
Added dpcompat_smallerfonts cvar to replicate a DP bug (for ss).
Detect dp's m_draw extension, to work around it (for ss).
Cvar dpcompat_ignoremodificationtimes added. A value of 0 favour the most recently modified file, 1 will use DP-like alphabetically sorted preferences (for ss).
loadfont builtin can now accept outline=1 in the sizes arg for slightly more readable fonts.
Fix bbox calcs for rotated entities, fix needed for r_ignorenetpvs 0.
Hackily parse emoji.json to provide :poop: etc suggestions.
Skip prediction entirely when there's no local entity info. This fixes stair-smoothing in xonotic.
screenshot_cubemap will now capture half-float images when saving to ktx or dds files.
Fix support for xcf files larger than 4gb, mostly to avoid compiler warnings.
Fixed size of gfx/loading.lmp when replacement textures are used.
Added mipmap support for rg8 and l8a8 textures.
r_hdr_framebuffer cvar updated to support format names instead of random negative numbers. Description updated to name some interesting ones.
Perform autoupdate _checks_ ONLY with explicit user confirmation (actual updating already needed user confirmation, but this extra step should reduce the chances of us getting wrongly accused of exfiltrating user data if we're run in a sandbox - we ONLY ever included the updating engine's version in the checks, though there's nothing we can do to avoid sending the user's router's IP).
Removed the 'summon satan all over your harddrive' quit message, in case paranoid security researchers are idiots and don't bother doing actual research.
Removed the triptohell.info and fte.triptohell.info certificates, they really need to stop being self-signed. The updates domain is still self-signed for autoupdates.
Video drivers are now able to report supported video resolutions, visible to menuqc. Currently only works with SDL2 builds.
Added setmousepos builtin. Should work with glx+win32 build.
VF_SKYROOM_CAMERA can now accept an extra two args, setviewprop(VF_SKYROOM_CAMERA, org, axis, degrees).
Removed v_skyroom_origin+v_skyroom_orientation cvars in favour just v_skyroom, which should make it behave more like the 'fog' command (used when csqc isn't overriding).
Added R_EndPolygonRibbon builtin to make it faster+easier to generate textured ribbon/cable/etc wide lines (for TW).
sdl: Fix up sys_sdl.c's file enumeration to support wildcards in directories.
edit command now displays end1.bin/end2.bin correctly, because we can.
Finally add support for f_modified - though ruleset_allow_larger_models and ruleset_allow_overlong_sounds generally make it redundant.
Fix threading race condition in sha1 lookups.
Updated f_ruleset to include the same extra flags reported by ezquake.
A mod's default.fmf file can now contain an eg 'mainconfig config.cfg' line (to explicitly set the main config saved with cfg_save_auto 1 etc).
fmf: basegame steam:GameName/GameDir can be used to try to load a mod directory from an installed steam game. The resulting gamedir will be read-only.
HOMEDIR CHANGE: use homedirs only if the basedir cannot be written or a homedir already exists, which should further reduce the probability of microsoft randomly uploading our data to their cloud (but mostly because its annoying to never know where your data is written).
Fixed buf_cvarlist, should work in xonotic now, and without segfaults.
Added an extra arg to URI_Get_Callback calls - the response size, also changed the tempstring to contain all bytes of the response, you need to be careful about nulls though.
Try to work around nvidia's forced-panning bug on x11 when changing video modes. This might screw with other programs.
sdl: support custom icons.
sdl: support choosing a specific display.
Added some documentation to menuqc builtins.
menusys: use outlines for slightly more readable fonts.
menusys: switch vid_width and vid_height combos into a single video mode combo to set both according to reported video modes.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5581 fc73d0e0-1445-4013-8a0c-d673dee63da5
2019-11-20 03:09:50 +00:00
if ( usehome & & manifest )
{
DWORD homeattr = GetFileAttributesU ( com_homepath ) ;
DWORD baseattr = GetFileAttributesU ( com_gamepath ) ;
if ( homeattr ! = INVALID_FILE_ATTRIBUTES & & ( homeattr & FILE_ATTRIBUTE_DIRECTORY ) )
return true ; //okay something else already created it. continue using it.
if ( baseattr ! = INVALID_FILE_ATTRIBUTES & & ( baseattr & FILE_ATTRIBUTE_DIRECTORY ) )
{ //windows has an _access function, but it doesn't actually bother to check if you're allowed to access it, so its utterly pointless.
//instead try to append nothing to some file that'll probably exist anyway.
//this MAY fail if another program has it open. windows sucks.
vfsfile_t * writetest = VFSOS_Open ( " conhistory.txt " , " a " ) ;
if ( ! writetest )
return true ; //basedir isn't writable, we'll need our home! use it by default.
VFS_CLOSE ( writetest ) ;
2008-06-13 07:24:11 +00:00
}
Too many changes, sorry.
Change revision displays, use the SVN commit date instead of using __DATE__ (when there's no local changes). This should allow reproducible builds.
Added s_al_disable cvar, to block openal and all the various problems people have had with it, without having to name an explicit fallback (which would vary by system).
Add mastervolume cvar (for ss).
Add r_shadows 2 (aka fake shadows - for ss).
Add scr_loadingscreen_aspect -1 setting, to disable levelshots entirely, also disables the progress bar (for ss).
Better support for some effectinfo hacks (for ss).
Added dpcompat_nocsqcwarnings (because of lazy+buggy mods like ss).
Rework the dpcsqc versions of project+unproject builtins for better compat (for ss).
Added dpcompat_csqcinputeventtypes to block unexpected csqc input events (for ss).
Better compat with DP's loadfont console command (for ss).
Added dpcompat_smallerfonts cvar to replicate a DP bug (for ss).
Detect dp's m_draw extension, to work around it (for ss).
Cvar dpcompat_ignoremodificationtimes added. A value of 0 favour the most recently modified file, 1 will use DP-like alphabetically sorted preferences (for ss).
loadfont builtin can now accept outline=1 in the sizes arg for slightly more readable fonts.
Fix bbox calcs for rotated entities, fix needed for r_ignorenetpvs 0.
Hackily parse emoji.json to provide :poop: etc suggestions.
Skip prediction entirely when there's no local entity info. This fixes stair-smoothing in xonotic.
screenshot_cubemap will now capture half-float images when saving to ktx or dds files.
Fix support for xcf files larger than 4gb, mostly to avoid compiler warnings.
Fixed size of gfx/loading.lmp when replacement textures are used.
Added mipmap support for rg8 and l8a8 textures.
r_hdr_framebuffer cvar updated to support format names instead of random negative numbers. Description updated to name some interesting ones.
Perform autoupdate _checks_ ONLY with explicit user confirmation (actual updating already needed user confirmation, but this extra step should reduce the chances of us getting wrongly accused of exfiltrating user data if we're run in a sandbox - we ONLY ever included the updating engine's version in the checks, though there's nothing we can do to avoid sending the user's router's IP).
Removed the 'summon satan all over your harddrive' quit message, in case paranoid security researchers are idiots and don't bother doing actual research.
Removed the triptohell.info and fte.triptohell.info certificates, they really need to stop being self-signed. The updates domain is still self-signed for autoupdates.
Video drivers are now able to report supported video resolutions, visible to menuqc. Currently only works with SDL2 builds.
Added setmousepos builtin. Should work with glx+win32 build.
VF_SKYROOM_CAMERA can now accept an extra two args, setviewprop(VF_SKYROOM_CAMERA, org, axis, degrees).
Removed v_skyroom_origin+v_skyroom_orientation cvars in favour just v_skyroom, which should make it behave more like the 'fog' command (used when csqc isn't overriding).
Added R_EndPolygonRibbon builtin to make it faster+easier to generate textured ribbon/cable/etc wide lines (for TW).
sdl: Fix up sys_sdl.c's file enumeration to support wildcards in directories.
edit command now displays end1.bin/end2.bin correctly, because we can.
Finally add support for f_modified - though ruleset_allow_larger_models and ruleset_allow_overlong_sounds generally make it redundant.
Fix threading race condition in sha1 lookups.
Updated f_ruleset to include the same extra flags reported by ezquake.
A mod's default.fmf file can now contain an eg 'mainconfig config.cfg' line (to explicitly set the main config saved with cfg_save_auto 1 etc).
fmf: basegame steam:GameName/GameDir can be used to try to load a mod directory from an installed steam game. The resulting gamedir will be read-only.
HOMEDIR CHANGE: use homedirs only if the basedir cannot be written or a homedir already exists, which should further reduce the probability of microsoft randomly uploading our data to their cloud (but mostly because its annoying to never know where your data is written).
Fixed buf_cvarlist, should work in xonotic now, and without segfaults.
Added an extra arg to URI_Get_Callback calls - the response size, also changed the tempstring to contain all bytes of the response, you need to be careful about nulls though.
Try to work around nvidia's forced-panning bug on x11 when changing video modes. This might screw with other programs.
sdl: support custom icons.
sdl: support choosing a specific display.
Added some documentation to menuqc builtins.
menusys: use outlines for slightly more readable fonts.
menusys: switch vid_width and vid_height combos into a single video mode combo to set both according to reported video modes.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5581 fc73d0e0-1445-4013-8a0c-d673dee63da5
2019-11-20 03:09:50 +00:00
//else don't use it (unless -usehome, anyway)
}
return false ;
}
# elif defined(NOSTDIO)
2019-11-20 04:53:22 +00:00
static qboolean FS_GetBestHomeDir ( ftemanifest_t * man )
Too many changes, sorry.
Change revision displays, use the SVN commit date instead of using __DATE__ (when there's no local changes). This should allow reproducible builds.
Added s_al_disable cvar, to block openal and all the various problems people have had with it, without having to name an explicit fallback (which would vary by system).
Add mastervolume cvar (for ss).
Add r_shadows 2 (aka fake shadows - for ss).
Add scr_loadingscreen_aspect -1 setting, to disable levelshots entirely, also disables the progress bar (for ss).
Better support for some effectinfo hacks (for ss).
Added dpcompat_nocsqcwarnings (because of lazy+buggy mods like ss).
Rework the dpcsqc versions of project+unproject builtins for better compat (for ss).
Added dpcompat_csqcinputeventtypes to block unexpected csqc input events (for ss).
Better compat with DP's loadfont console command (for ss).
Added dpcompat_smallerfonts cvar to replicate a DP bug (for ss).
Detect dp's m_draw extension, to work around it (for ss).
Cvar dpcompat_ignoremodificationtimes added. A value of 0 favour the most recently modified file, 1 will use DP-like alphabetically sorted preferences (for ss).
loadfont builtin can now accept outline=1 in the sizes arg for slightly more readable fonts.
Fix bbox calcs for rotated entities, fix needed for r_ignorenetpvs 0.
Hackily parse emoji.json to provide :poop: etc suggestions.
Skip prediction entirely when there's no local entity info. This fixes stair-smoothing in xonotic.
screenshot_cubemap will now capture half-float images when saving to ktx or dds files.
Fix support for xcf files larger than 4gb, mostly to avoid compiler warnings.
Fixed size of gfx/loading.lmp when replacement textures are used.
Added mipmap support for rg8 and l8a8 textures.
r_hdr_framebuffer cvar updated to support format names instead of random negative numbers. Description updated to name some interesting ones.
Perform autoupdate _checks_ ONLY with explicit user confirmation (actual updating already needed user confirmation, but this extra step should reduce the chances of us getting wrongly accused of exfiltrating user data if we're run in a sandbox - we ONLY ever included the updating engine's version in the checks, though there's nothing we can do to avoid sending the user's router's IP).
Removed the 'summon satan all over your harddrive' quit message, in case paranoid security researchers are idiots and don't bother doing actual research.
Removed the triptohell.info and fte.triptohell.info certificates, they really need to stop being self-signed. The updates domain is still self-signed for autoupdates.
Video drivers are now able to report supported video resolutions, visible to menuqc. Currently only works with SDL2 builds.
Added setmousepos builtin. Should work with glx+win32 build.
VF_SKYROOM_CAMERA can now accept an extra two args, setviewprop(VF_SKYROOM_CAMERA, org, axis, degrees).
Removed v_skyroom_origin+v_skyroom_orientation cvars in favour just v_skyroom, which should make it behave more like the 'fog' command (used when csqc isn't overriding).
Added R_EndPolygonRibbon builtin to make it faster+easier to generate textured ribbon/cable/etc wide lines (for TW).
sdl: Fix up sys_sdl.c's file enumeration to support wildcards in directories.
edit command now displays end1.bin/end2.bin correctly, because we can.
Finally add support for f_modified - though ruleset_allow_larger_models and ruleset_allow_overlong_sounds generally make it redundant.
Fix threading race condition in sha1 lookups.
Updated f_ruleset to include the same extra flags reported by ezquake.
A mod's default.fmf file can now contain an eg 'mainconfig config.cfg' line (to explicitly set the main config saved with cfg_save_auto 1 etc).
fmf: basegame steam:GameName/GameDir can be used to try to load a mod directory from an installed steam game. The resulting gamedir will be read-only.
HOMEDIR CHANGE: use homedirs only if the basedir cannot be written or a homedir already exists, which should further reduce the probability of microsoft randomly uploading our data to their cloud (but mostly because its annoying to never know where your data is written).
Fixed buf_cvarlist, should work in xonotic now, and without segfaults.
Added an extra arg to URI_Get_Callback calls - the response size, also changed the tempstring to contain all bytes of the response, you need to be careful about nulls though.
Try to work around nvidia's forced-panning bug on x11 when changing video modes. This might screw with other programs.
sdl: support custom icons.
sdl: support choosing a specific display.
Added some documentation to menuqc builtins.
menusys: use outlines for slightly more readable fonts.
menusys: switch vid_width and vid_height combos into a single video mode combo to set both according to reported video modes.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5581 fc73d0e0-1445-4013-8a0c-d673dee63da5
2019-11-20 03:09:50 +00:00
{ //no studio? webgl port? no file system access = no homedirs!
return false ;
}
# else
# include <sys/stat.h>
static qboolean FS_GetBestHomeDir ( ftemanifest_t * man )
{
qboolean usehome = false ;
//on unix, we use environment settings.
//if $HOME/.fte/ exists then we use that because of legacy reasons.
//but if it doesn't exist then we use $XDG_DATA_HOME/.fte instead
//we used to use $HOME/.#HOMESUBDIR/ but this is now only used if it actually exists AND the new path doesn't.
//new installs use $XDG_DATA_HOME/#HOMESUBDIR/ instead
char * ev = getenv ( " FTEHOME " ) ;
if ( ev & & * ev )
{
if ( ev [ strlen ( ev ) - 1 ] = = ' / ' )
Q_strncpyz ( com_homepath , ev , sizeof ( com_homepath ) ) ;
else
Q_snprintfz ( com_homepath , sizeof ( com_homepath ) , " %s/ " , ev ) ;
usehome = true ; // always use home on unix unless told not to
ev = NULL ;
2005-08-26 22:52:26 +00:00
}
Too many changes, sorry.
Change revision displays, use the SVN commit date instead of using __DATE__ (when there's no local changes). This should allow reproducible builds.
Added s_al_disable cvar, to block openal and all the various problems people have had with it, without having to name an explicit fallback (which would vary by system).
Add mastervolume cvar (for ss).
Add r_shadows 2 (aka fake shadows - for ss).
Add scr_loadingscreen_aspect -1 setting, to disable levelshots entirely, also disables the progress bar (for ss).
Better support for some effectinfo hacks (for ss).
Added dpcompat_nocsqcwarnings (because of lazy+buggy mods like ss).
Rework the dpcsqc versions of project+unproject builtins for better compat (for ss).
Added dpcompat_csqcinputeventtypes to block unexpected csqc input events (for ss).
Better compat with DP's loadfont console command (for ss).
Added dpcompat_smallerfonts cvar to replicate a DP bug (for ss).
Detect dp's m_draw extension, to work around it (for ss).
Cvar dpcompat_ignoremodificationtimes added. A value of 0 favour the most recently modified file, 1 will use DP-like alphabetically sorted preferences (for ss).
loadfont builtin can now accept outline=1 in the sizes arg for slightly more readable fonts.
Fix bbox calcs for rotated entities, fix needed for r_ignorenetpvs 0.
Hackily parse emoji.json to provide :poop: etc suggestions.
Skip prediction entirely when there's no local entity info. This fixes stair-smoothing in xonotic.
screenshot_cubemap will now capture half-float images when saving to ktx or dds files.
Fix support for xcf files larger than 4gb, mostly to avoid compiler warnings.
Fixed size of gfx/loading.lmp when replacement textures are used.
Added mipmap support for rg8 and l8a8 textures.
r_hdr_framebuffer cvar updated to support format names instead of random negative numbers. Description updated to name some interesting ones.
Perform autoupdate _checks_ ONLY with explicit user confirmation (actual updating already needed user confirmation, but this extra step should reduce the chances of us getting wrongly accused of exfiltrating user data if we're run in a sandbox - we ONLY ever included the updating engine's version in the checks, though there's nothing we can do to avoid sending the user's router's IP).
Removed the 'summon satan all over your harddrive' quit message, in case paranoid security researchers are idiots and don't bother doing actual research.
Removed the triptohell.info and fte.triptohell.info certificates, they really need to stop being self-signed. The updates domain is still self-signed for autoupdates.
Video drivers are now able to report supported video resolutions, visible to menuqc. Currently only works with SDL2 builds.
Added setmousepos builtin. Should work with glx+win32 build.
VF_SKYROOM_CAMERA can now accept an extra two args, setviewprop(VF_SKYROOM_CAMERA, org, axis, degrees).
Removed v_skyroom_origin+v_skyroom_orientation cvars in favour just v_skyroom, which should make it behave more like the 'fog' command (used when csqc isn't overriding).
Added R_EndPolygonRibbon builtin to make it faster+easier to generate textured ribbon/cable/etc wide lines (for TW).
sdl: Fix up sys_sdl.c's file enumeration to support wildcards in directories.
edit command now displays end1.bin/end2.bin correctly, because we can.
Finally add support for f_modified - though ruleset_allow_larger_models and ruleset_allow_overlong_sounds generally make it redundant.
Fix threading race condition in sha1 lookups.
Updated f_ruleset to include the same extra flags reported by ezquake.
A mod's default.fmf file can now contain an eg 'mainconfig config.cfg' line (to explicitly set the main config saved with cfg_save_auto 1 etc).
fmf: basegame steam:GameName/GameDir can be used to try to load a mod directory from an installed steam game. The resulting gamedir will be read-only.
HOMEDIR CHANGE: use homedirs only if the basedir cannot be written or a homedir already exists, which should further reduce the probability of microsoft randomly uploading our data to their cloud (but mostly because its annoying to never know where your data is written).
Fixed buf_cvarlist, should work in xonotic now, and without segfaults.
Added an extra arg to URI_Get_Callback calls - the response size, also changed the tempstring to contain all bytes of the response, you need to be careful about nulls though.
Try to work around nvidia's forced-panning bug on x11 when changing video modes. This might screw with other programs.
sdl: support custom icons.
sdl: support choosing a specific display.
Added some documentation to menuqc builtins.
menusys: use outlines for slightly more readable fonts.
menusys: switch vid_width and vid_height combos into a single video mode combo to set both according to reported video modes.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5581 fc73d0e0-1445-4013-8a0c-d673dee63da5
2019-11-20 03:09:50 +00:00
else
ev = getenv ( " HOME " ) ;
if ( ev & & * ev )
2018-06-18 16:44:29 +00:00
{
Too many changes, sorry.
Change revision displays, use the SVN commit date instead of using __DATE__ (when there's no local changes). This should allow reproducible builds.
Added s_al_disable cvar, to block openal and all the various problems people have had with it, without having to name an explicit fallback (which would vary by system).
Add mastervolume cvar (for ss).
Add r_shadows 2 (aka fake shadows - for ss).
Add scr_loadingscreen_aspect -1 setting, to disable levelshots entirely, also disables the progress bar (for ss).
Better support for some effectinfo hacks (for ss).
Added dpcompat_nocsqcwarnings (because of lazy+buggy mods like ss).
Rework the dpcsqc versions of project+unproject builtins for better compat (for ss).
Added dpcompat_csqcinputeventtypes to block unexpected csqc input events (for ss).
Better compat with DP's loadfont console command (for ss).
Added dpcompat_smallerfonts cvar to replicate a DP bug (for ss).
Detect dp's m_draw extension, to work around it (for ss).
Cvar dpcompat_ignoremodificationtimes added. A value of 0 favour the most recently modified file, 1 will use DP-like alphabetically sorted preferences (for ss).
loadfont builtin can now accept outline=1 in the sizes arg for slightly more readable fonts.
Fix bbox calcs for rotated entities, fix needed for r_ignorenetpvs 0.
Hackily parse emoji.json to provide :poop: etc suggestions.
Skip prediction entirely when there's no local entity info. This fixes stair-smoothing in xonotic.
screenshot_cubemap will now capture half-float images when saving to ktx or dds files.
Fix support for xcf files larger than 4gb, mostly to avoid compiler warnings.
Fixed size of gfx/loading.lmp when replacement textures are used.
Added mipmap support for rg8 and l8a8 textures.
r_hdr_framebuffer cvar updated to support format names instead of random negative numbers. Description updated to name some interesting ones.
Perform autoupdate _checks_ ONLY with explicit user confirmation (actual updating already needed user confirmation, but this extra step should reduce the chances of us getting wrongly accused of exfiltrating user data if we're run in a sandbox - we ONLY ever included the updating engine's version in the checks, though there's nothing we can do to avoid sending the user's router's IP).
Removed the 'summon satan all over your harddrive' quit message, in case paranoid security researchers are idiots and don't bother doing actual research.
Removed the triptohell.info and fte.triptohell.info certificates, they really need to stop being self-signed. The updates domain is still self-signed for autoupdates.
Video drivers are now able to report supported video resolutions, visible to menuqc. Currently only works with SDL2 builds.
Added setmousepos builtin. Should work with glx+win32 build.
VF_SKYROOM_CAMERA can now accept an extra two args, setviewprop(VF_SKYROOM_CAMERA, org, axis, degrees).
Removed v_skyroom_origin+v_skyroom_orientation cvars in favour just v_skyroom, which should make it behave more like the 'fog' command (used when csqc isn't overriding).
Added R_EndPolygonRibbon builtin to make it faster+easier to generate textured ribbon/cable/etc wide lines (for TW).
sdl: Fix up sys_sdl.c's file enumeration to support wildcards in directories.
edit command now displays end1.bin/end2.bin correctly, because we can.
Finally add support for f_modified - though ruleset_allow_larger_models and ruleset_allow_overlong_sounds generally make it redundant.
Fix threading race condition in sha1 lookups.
Updated f_ruleset to include the same extra flags reported by ezquake.
A mod's default.fmf file can now contain an eg 'mainconfig config.cfg' line (to explicitly set the main config saved with cfg_save_auto 1 etc).
fmf: basegame steam:GameName/GameDir can be used to try to load a mod directory from an installed steam game. The resulting gamedir will be read-only.
HOMEDIR CHANGE: use homedirs only if the basedir cannot be written or a homedir already exists, which should further reduce the probability of microsoft randomly uploading our data to their cloud (but mostly because its annoying to never know where your data is written).
Fixed buf_cvarlist, should work in xonotic now, and without segfaults.
Added an extra arg to URI_Get_Callback calls - the response size, also changed the tempstring to contain all bytes of the response, you need to be careful about nulls though.
Try to work around nvidia's forced-panning bug on x11 when changing video modes. This might screw with other programs.
sdl: support custom icons.
sdl: support choosing a specific display.
Added some documentation to menuqc builtins.
menusys: use outlines for slightly more readable fonts.
menusys: switch vid_width and vid_height combos into a single video mode combo to set both according to reported video modes.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5581 fc73d0e0-1445-4013-8a0c-d673dee63da5
2019-11-20 03:09:50 +00:00
const char * xdghome ;
char oldhome [ MAX_OSPATH ] ;
char newhome [ MAX_OSPATH ] ;
struct stat s ;
char * installation = ( man & & man - > installation & & * man - > installation ) ? man - > installation : HOMESUBDIR ;
usehome = ( man & & man - > installation & & * man - > installation ) ? true : false ; //use it if we're running a game, otherwise don't bother if we're still loading.
xdghome = getenv ( " XDG_DATA_HOME " ) ;
if ( ! xdghome | | ! * xdghome )
xdghome = va ( " %s/.local/share " , ev ) ;
if ( xdghome [ strlen ( xdghome ) - 1 ] = = ' / ' )
Q_snprintfz ( newhome , sizeof ( newhome ) , " %s%s/ " , xdghome , installation ) ;
2018-06-18 16:44:29 +00:00
else
Too many changes, sorry.
Change revision displays, use the SVN commit date instead of using __DATE__ (when there's no local changes). This should allow reproducible builds.
Added s_al_disable cvar, to block openal and all the various problems people have had with it, without having to name an explicit fallback (which would vary by system).
Add mastervolume cvar (for ss).
Add r_shadows 2 (aka fake shadows - for ss).
Add scr_loadingscreen_aspect -1 setting, to disable levelshots entirely, also disables the progress bar (for ss).
Better support for some effectinfo hacks (for ss).
Added dpcompat_nocsqcwarnings (because of lazy+buggy mods like ss).
Rework the dpcsqc versions of project+unproject builtins for better compat (for ss).
Added dpcompat_csqcinputeventtypes to block unexpected csqc input events (for ss).
Better compat with DP's loadfont console command (for ss).
Added dpcompat_smallerfonts cvar to replicate a DP bug (for ss).
Detect dp's m_draw extension, to work around it (for ss).
Cvar dpcompat_ignoremodificationtimes added. A value of 0 favour the most recently modified file, 1 will use DP-like alphabetically sorted preferences (for ss).
loadfont builtin can now accept outline=1 in the sizes arg for slightly more readable fonts.
Fix bbox calcs for rotated entities, fix needed for r_ignorenetpvs 0.
Hackily parse emoji.json to provide :poop: etc suggestions.
Skip prediction entirely when there's no local entity info. This fixes stair-smoothing in xonotic.
screenshot_cubemap will now capture half-float images when saving to ktx or dds files.
Fix support for xcf files larger than 4gb, mostly to avoid compiler warnings.
Fixed size of gfx/loading.lmp when replacement textures are used.
Added mipmap support for rg8 and l8a8 textures.
r_hdr_framebuffer cvar updated to support format names instead of random negative numbers. Description updated to name some interesting ones.
Perform autoupdate _checks_ ONLY with explicit user confirmation (actual updating already needed user confirmation, but this extra step should reduce the chances of us getting wrongly accused of exfiltrating user data if we're run in a sandbox - we ONLY ever included the updating engine's version in the checks, though there's nothing we can do to avoid sending the user's router's IP).
Removed the 'summon satan all over your harddrive' quit message, in case paranoid security researchers are idiots and don't bother doing actual research.
Removed the triptohell.info and fte.triptohell.info certificates, they really need to stop being self-signed. The updates domain is still self-signed for autoupdates.
Video drivers are now able to report supported video resolutions, visible to menuqc. Currently only works with SDL2 builds.
Added setmousepos builtin. Should work with glx+win32 build.
VF_SKYROOM_CAMERA can now accept an extra two args, setviewprop(VF_SKYROOM_CAMERA, org, axis, degrees).
Removed v_skyroom_origin+v_skyroom_orientation cvars in favour just v_skyroom, which should make it behave more like the 'fog' command (used when csqc isn't overriding).
Added R_EndPolygonRibbon builtin to make it faster+easier to generate textured ribbon/cable/etc wide lines (for TW).
sdl: Fix up sys_sdl.c's file enumeration to support wildcards in directories.
edit command now displays end1.bin/end2.bin correctly, because we can.
Finally add support for f_modified - though ruleset_allow_larger_models and ruleset_allow_overlong_sounds generally make it redundant.
Fix threading race condition in sha1 lookups.
Updated f_ruleset to include the same extra flags reported by ezquake.
A mod's default.fmf file can now contain an eg 'mainconfig config.cfg' line (to explicitly set the main config saved with cfg_save_auto 1 etc).
fmf: basegame steam:GameName/GameDir can be used to try to load a mod directory from an installed steam game. The resulting gamedir will be read-only.
HOMEDIR CHANGE: use homedirs only if the basedir cannot be written or a homedir already exists, which should further reduce the probability of microsoft randomly uploading our data to their cloud (but mostly because its annoying to never know where your data is written).
Fixed buf_cvarlist, should work in xonotic now, and without segfaults.
Added an extra arg to URI_Get_Callback calls - the response size, also changed the tempstring to contain all bytes of the response, you need to be careful about nulls though.
Try to work around nvidia's forced-panning bug on x11 when changing video modes. This might screw with other programs.
sdl: support custom icons.
sdl: support choosing a specific display.
Added some documentation to menuqc builtins.
menusys: use outlines for slightly more readable fonts.
menusys: switch vid_width and vid_height combos into a single video mode combo to set both according to reported video modes.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5581 fc73d0e0-1445-4013-8a0c-d673dee63da5
2019-11-20 03:09:50 +00:00
Q_snprintfz ( newhome , sizeof ( newhome ) , " %s/%s/ " , xdghome , installation ) ;
2018-06-18 16:44:29 +00:00
Too many changes, sorry.
Change revision displays, use the SVN commit date instead of using __DATE__ (when there's no local changes). This should allow reproducible builds.
Added s_al_disable cvar, to block openal and all the various problems people have had with it, without having to name an explicit fallback (which would vary by system).
Add mastervolume cvar (for ss).
Add r_shadows 2 (aka fake shadows - for ss).
Add scr_loadingscreen_aspect -1 setting, to disable levelshots entirely, also disables the progress bar (for ss).
Better support for some effectinfo hacks (for ss).
Added dpcompat_nocsqcwarnings (because of lazy+buggy mods like ss).
Rework the dpcsqc versions of project+unproject builtins for better compat (for ss).
Added dpcompat_csqcinputeventtypes to block unexpected csqc input events (for ss).
Better compat with DP's loadfont console command (for ss).
Added dpcompat_smallerfonts cvar to replicate a DP bug (for ss).
Detect dp's m_draw extension, to work around it (for ss).
Cvar dpcompat_ignoremodificationtimes added. A value of 0 favour the most recently modified file, 1 will use DP-like alphabetically sorted preferences (for ss).
loadfont builtin can now accept outline=1 in the sizes arg for slightly more readable fonts.
Fix bbox calcs for rotated entities, fix needed for r_ignorenetpvs 0.
Hackily parse emoji.json to provide :poop: etc suggestions.
Skip prediction entirely when there's no local entity info. This fixes stair-smoothing in xonotic.
screenshot_cubemap will now capture half-float images when saving to ktx or dds files.
Fix support for xcf files larger than 4gb, mostly to avoid compiler warnings.
Fixed size of gfx/loading.lmp when replacement textures are used.
Added mipmap support for rg8 and l8a8 textures.
r_hdr_framebuffer cvar updated to support format names instead of random negative numbers. Description updated to name some interesting ones.
Perform autoupdate _checks_ ONLY with explicit user confirmation (actual updating already needed user confirmation, but this extra step should reduce the chances of us getting wrongly accused of exfiltrating user data if we're run in a sandbox - we ONLY ever included the updating engine's version in the checks, though there's nothing we can do to avoid sending the user's router's IP).
Removed the 'summon satan all over your harddrive' quit message, in case paranoid security researchers are idiots and don't bother doing actual research.
Removed the triptohell.info and fte.triptohell.info certificates, they really need to stop being self-signed. The updates domain is still self-signed for autoupdates.
Video drivers are now able to report supported video resolutions, visible to menuqc. Currently only works with SDL2 builds.
Added setmousepos builtin. Should work with glx+win32 build.
VF_SKYROOM_CAMERA can now accept an extra two args, setviewprop(VF_SKYROOM_CAMERA, org, axis, degrees).
Removed v_skyroom_origin+v_skyroom_orientation cvars in favour just v_skyroom, which should make it behave more like the 'fog' command (used when csqc isn't overriding).
Added R_EndPolygonRibbon builtin to make it faster+easier to generate textured ribbon/cable/etc wide lines (for TW).
sdl: Fix up sys_sdl.c's file enumeration to support wildcards in directories.
edit command now displays end1.bin/end2.bin correctly, because we can.
Finally add support for f_modified - though ruleset_allow_larger_models and ruleset_allow_overlong_sounds generally make it redundant.
Fix threading race condition in sha1 lookups.
Updated f_ruleset to include the same extra flags reported by ezquake.
A mod's default.fmf file can now contain an eg 'mainconfig config.cfg' line (to explicitly set the main config saved with cfg_save_auto 1 etc).
fmf: basegame steam:GameName/GameDir can be used to try to load a mod directory from an installed steam game. The resulting gamedir will be read-only.
HOMEDIR CHANGE: use homedirs only if the basedir cannot be written or a homedir already exists, which should further reduce the probability of microsoft randomly uploading our data to their cloud (but mostly because its annoying to never know where your data is written).
Fixed buf_cvarlist, should work in xonotic now, and without segfaults.
Added an extra arg to URI_Get_Callback calls - the response size, also changed the tempstring to contain all bytes of the response, you need to be careful about nulls though.
Try to work around nvidia's forced-panning bug on x11 when changing video modes. This might screw with other programs.
sdl: support custom icons.
sdl: support choosing a specific display.
Added some documentation to menuqc builtins.
menusys: use outlines for slightly more readable fonts.
menusys: switch vid_width and vid_height combos into a single video mode combo to set both according to reported video modes.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5581 fc73d0e0-1445-4013-8a0c-d673dee63da5
2019-11-20 03:09:50 +00:00
if ( ev [ strlen ( ev ) - 1 ] = = ' / ' )
Q_snprintfz ( oldhome , sizeof ( oldhome ) , " %s.%s/ " , ev , installation ) ;
else
Q_snprintfz ( oldhome , sizeof ( oldhome ) , " %s/.%s/ " , ev , installation ) ;
2018-10-23 07:09:06 +00:00
Too many changes, sorry.
Change revision displays, use the SVN commit date instead of using __DATE__ (when there's no local changes). This should allow reproducible builds.
Added s_al_disable cvar, to block openal and all the various problems people have had with it, without having to name an explicit fallback (which would vary by system).
Add mastervolume cvar (for ss).
Add r_shadows 2 (aka fake shadows - for ss).
Add scr_loadingscreen_aspect -1 setting, to disable levelshots entirely, also disables the progress bar (for ss).
Better support for some effectinfo hacks (for ss).
Added dpcompat_nocsqcwarnings (because of lazy+buggy mods like ss).
Rework the dpcsqc versions of project+unproject builtins for better compat (for ss).
Added dpcompat_csqcinputeventtypes to block unexpected csqc input events (for ss).
Better compat with DP's loadfont console command (for ss).
Added dpcompat_smallerfonts cvar to replicate a DP bug (for ss).
Detect dp's m_draw extension, to work around it (for ss).
Cvar dpcompat_ignoremodificationtimes added. A value of 0 favour the most recently modified file, 1 will use DP-like alphabetically sorted preferences (for ss).
loadfont builtin can now accept outline=1 in the sizes arg for slightly more readable fonts.
Fix bbox calcs for rotated entities, fix needed for r_ignorenetpvs 0.
Hackily parse emoji.json to provide :poop: etc suggestions.
Skip prediction entirely when there's no local entity info. This fixes stair-smoothing in xonotic.
screenshot_cubemap will now capture half-float images when saving to ktx or dds files.
Fix support for xcf files larger than 4gb, mostly to avoid compiler warnings.
Fixed size of gfx/loading.lmp when replacement textures are used.
Added mipmap support for rg8 and l8a8 textures.
r_hdr_framebuffer cvar updated to support format names instead of random negative numbers. Description updated to name some interesting ones.
Perform autoupdate _checks_ ONLY with explicit user confirmation (actual updating already needed user confirmation, but this extra step should reduce the chances of us getting wrongly accused of exfiltrating user data if we're run in a sandbox - we ONLY ever included the updating engine's version in the checks, though there's nothing we can do to avoid sending the user's router's IP).
Removed the 'summon satan all over your harddrive' quit message, in case paranoid security researchers are idiots and don't bother doing actual research.
Removed the triptohell.info and fte.triptohell.info certificates, they really need to stop being self-signed. The updates domain is still self-signed for autoupdates.
Video drivers are now able to report supported video resolutions, visible to menuqc. Currently only works with SDL2 builds.
Added setmousepos builtin. Should work with glx+win32 build.
VF_SKYROOM_CAMERA can now accept an extra two args, setviewprop(VF_SKYROOM_CAMERA, org, axis, degrees).
Removed v_skyroom_origin+v_skyroom_orientation cvars in favour just v_skyroom, which should make it behave more like the 'fog' command (used when csqc isn't overriding).
Added R_EndPolygonRibbon builtin to make it faster+easier to generate textured ribbon/cable/etc wide lines (for TW).
sdl: Fix up sys_sdl.c's file enumeration to support wildcards in directories.
edit command now displays end1.bin/end2.bin correctly, because we can.
Finally add support for f_modified - though ruleset_allow_larger_models and ruleset_allow_overlong_sounds generally make it redundant.
Fix threading race condition in sha1 lookups.
Updated f_ruleset to include the same extra flags reported by ezquake.
A mod's default.fmf file can now contain an eg 'mainconfig config.cfg' line (to explicitly set the main config saved with cfg_save_auto 1 etc).
fmf: basegame steam:GameName/GameDir can be used to try to load a mod directory from an installed steam game. The resulting gamedir will be read-only.
HOMEDIR CHANGE: use homedirs only if the basedir cannot be written or a homedir already exists, which should further reduce the probability of microsoft randomly uploading our data to their cloud (but mostly because its annoying to never know where your data is written).
Fixed buf_cvarlist, should work in xonotic now, and without segfaults.
Added an extra arg to URI_Get_Callback calls - the response size, also changed the tempstring to contain all bytes of the response, you need to be careful about nulls though.
Try to work around nvidia's forced-panning bug on x11 when changing video modes. This might screw with other programs.
sdl: support custom icons.
sdl: support choosing a specific display.
Added some documentation to menuqc builtins.
menusys: use outlines for slightly more readable fonts.
menusys: switch vid_width and vid_height combos into a single video mode combo to set both according to reported video modes.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5581 fc73d0e0-1445-4013-8a0c-d673dee63da5
2019-11-20 03:09:50 +00:00
if ( stat ( newhome , & s ) = = - 1 & & stat ( oldhome , & s ) ! = - 1 )
Q_strncpyz ( com_homepath , oldhome , sizeof ( com_homepath ) ) ;
else
Q_strncpyz ( com_homepath , newhome , sizeof ( com_homepath ) ) ;
2008-06-13 05:03:54 +00:00
}
Too many changes, sorry.
Change revision displays, use the SVN commit date instead of using __DATE__ (when there's no local changes). This should allow reproducible builds.
Added s_al_disable cvar, to block openal and all the various problems people have had with it, without having to name an explicit fallback (which would vary by system).
Add mastervolume cvar (for ss).
Add r_shadows 2 (aka fake shadows - for ss).
Add scr_loadingscreen_aspect -1 setting, to disable levelshots entirely, also disables the progress bar (for ss).
Better support for some effectinfo hacks (for ss).
Added dpcompat_nocsqcwarnings (because of lazy+buggy mods like ss).
Rework the dpcsqc versions of project+unproject builtins for better compat (for ss).
Added dpcompat_csqcinputeventtypes to block unexpected csqc input events (for ss).
Better compat with DP's loadfont console command (for ss).
Added dpcompat_smallerfonts cvar to replicate a DP bug (for ss).
Detect dp's m_draw extension, to work around it (for ss).
Cvar dpcompat_ignoremodificationtimes added. A value of 0 favour the most recently modified file, 1 will use DP-like alphabetically sorted preferences (for ss).
loadfont builtin can now accept outline=1 in the sizes arg for slightly more readable fonts.
Fix bbox calcs for rotated entities, fix needed for r_ignorenetpvs 0.
Hackily parse emoji.json to provide :poop: etc suggestions.
Skip prediction entirely when there's no local entity info. This fixes stair-smoothing in xonotic.
screenshot_cubemap will now capture half-float images when saving to ktx or dds files.
Fix support for xcf files larger than 4gb, mostly to avoid compiler warnings.
Fixed size of gfx/loading.lmp when replacement textures are used.
Added mipmap support for rg8 and l8a8 textures.
r_hdr_framebuffer cvar updated to support format names instead of random negative numbers. Description updated to name some interesting ones.
Perform autoupdate _checks_ ONLY with explicit user confirmation (actual updating already needed user confirmation, but this extra step should reduce the chances of us getting wrongly accused of exfiltrating user data if we're run in a sandbox - we ONLY ever included the updating engine's version in the checks, though there's nothing we can do to avoid sending the user's router's IP).
Removed the 'summon satan all over your harddrive' quit message, in case paranoid security researchers are idiots and don't bother doing actual research.
Removed the triptohell.info and fte.triptohell.info certificates, they really need to stop being self-signed. The updates domain is still self-signed for autoupdates.
Video drivers are now able to report supported video resolutions, visible to menuqc. Currently only works with SDL2 builds.
Added setmousepos builtin. Should work with glx+win32 build.
VF_SKYROOM_CAMERA can now accept an extra two args, setviewprop(VF_SKYROOM_CAMERA, org, axis, degrees).
Removed v_skyroom_origin+v_skyroom_orientation cvars in favour just v_skyroom, which should make it behave more like the 'fog' command (used when csqc isn't overriding).
Added R_EndPolygonRibbon builtin to make it faster+easier to generate textured ribbon/cable/etc wide lines (for TW).
sdl: Fix up sys_sdl.c's file enumeration to support wildcards in directories.
edit command now displays end1.bin/end2.bin correctly, because we can.
Finally add support for f_modified - though ruleset_allow_larger_models and ruleset_allow_overlong_sounds generally make it redundant.
Fix threading race condition in sha1 lookups.
Updated f_ruleset to include the same extra flags reported by ezquake.
A mod's default.fmf file can now contain an eg 'mainconfig config.cfg' line (to explicitly set the main config saved with cfg_save_auto 1 etc).
fmf: basegame steam:GameName/GameDir can be used to try to load a mod directory from an installed steam game. The resulting gamedir will be read-only.
HOMEDIR CHANGE: use homedirs only if the basedir cannot be written or a homedir already exists, which should further reduce the probability of microsoft randomly uploading our data to their cloud (but mostly because its annoying to never know where your data is written).
Fixed buf_cvarlist, should work in xonotic now, and without segfaults.
Added an extra arg to URI_Get_Callback calls - the response size, also changed the tempstring to contain all bytes of the response, you need to be careful about nulls though.
Try to work around nvidia's forced-panning bug on x11 when changing video modes. This might screw with other programs.
sdl: support custom icons.
sdl: support choosing a specific display.
Added some documentation to menuqc builtins.
menusys: use outlines for slightly more readable fonts.
menusys: switch vid_width and vid_height combos into a single video mode combo to set both according to reported video modes.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5581 fc73d0e0-1445-4013-8a0c-d673dee63da5
2019-11-20 03:09:50 +00:00
if ( usehome & & man )
{
struct stat statbuf ;
if ( stat ( com_homepath , & statbuf ) > = 0 & & ( statbuf . st_mode & S_IFMT ) = = S_IFDIR )
return true ; //okay something else already created it. continue using it.
if ( access ( com_gamepath , W_OK ) < 0 )
return true ; //baesdir isn't writable, we'll need our home! use it by default.
//else don't use it (unless -usehome, anyway)
}
return false ;
}
2005-08-26 22:52:26 +00:00
# endif
Too many changes, sorry.
Change revision displays, use the SVN commit date instead of using __DATE__ (when there's no local changes). This should allow reproducible builds.
Added s_al_disable cvar, to block openal and all the various problems people have had with it, without having to name an explicit fallback (which would vary by system).
Add mastervolume cvar (for ss).
Add r_shadows 2 (aka fake shadows - for ss).
Add scr_loadingscreen_aspect -1 setting, to disable levelshots entirely, also disables the progress bar (for ss).
Better support for some effectinfo hacks (for ss).
Added dpcompat_nocsqcwarnings (because of lazy+buggy mods like ss).
Rework the dpcsqc versions of project+unproject builtins for better compat (for ss).
Added dpcompat_csqcinputeventtypes to block unexpected csqc input events (for ss).
Better compat with DP's loadfont console command (for ss).
Added dpcompat_smallerfonts cvar to replicate a DP bug (for ss).
Detect dp's m_draw extension, to work around it (for ss).
Cvar dpcompat_ignoremodificationtimes added. A value of 0 favour the most recently modified file, 1 will use DP-like alphabetically sorted preferences (for ss).
loadfont builtin can now accept outline=1 in the sizes arg for slightly more readable fonts.
Fix bbox calcs for rotated entities, fix needed for r_ignorenetpvs 0.
Hackily parse emoji.json to provide :poop: etc suggestions.
Skip prediction entirely when there's no local entity info. This fixes stair-smoothing in xonotic.
screenshot_cubemap will now capture half-float images when saving to ktx or dds files.
Fix support for xcf files larger than 4gb, mostly to avoid compiler warnings.
Fixed size of gfx/loading.lmp when replacement textures are used.
Added mipmap support for rg8 and l8a8 textures.
r_hdr_framebuffer cvar updated to support format names instead of random negative numbers. Description updated to name some interesting ones.
Perform autoupdate _checks_ ONLY with explicit user confirmation (actual updating already needed user confirmation, but this extra step should reduce the chances of us getting wrongly accused of exfiltrating user data if we're run in a sandbox - we ONLY ever included the updating engine's version in the checks, though there's nothing we can do to avoid sending the user's router's IP).
Removed the 'summon satan all over your harddrive' quit message, in case paranoid security researchers are idiots and don't bother doing actual research.
Removed the triptohell.info and fte.triptohell.info certificates, they really need to stop being self-signed. The updates domain is still self-signed for autoupdates.
Video drivers are now able to report supported video resolutions, visible to menuqc. Currently only works with SDL2 builds.
Added setmousepos builtin. Should work with glx+win32 build.
VF_SKYROOM_CAMERA can now accept an extra two args, setviewprop(VF_SKYROOM_CAMERA, org, axis, degrees).
Removed v_skyroom_origin+v_skyroom_orientation cvars in favour just v_skyroom, which should make it behave more like the 'fog' command (used when csqc isn't overriding).
Added R_EndPolygonRibbon builtin to make it faster+easier to generate textured ribbon/cable/etc wide lines (for TW).
sdl: Fix up sys_sdl.c's file enumeration to support wildcards in directories.
edit command now displays end1.bin/end2.bin correctly, because we can.
Finally add support for f_modified - though ruleset_allow_larger_models and ruleset_allow_overlong_sounds generally make it redundant.
Fix threading race condition in sha1 lookups.
Updated f_ruleset to include the same extra flags reported by ezquake.
A mod's default.fmf file can now contain an eg 'mainconfig config.cfg' line (to explicitly set the main config saved with cfg_save_auto 1 etc).
fmf: basegame steam:GameName/GameDir can be used to try to load a mod directory from an installed steam game. The resulting gamedir will be read-only.
HOMEDIR CHANGE: use homedirs only if the basedir cannot be written or a homedir already exists, which should further reduce the probability of microsoft randomly uploading our data to their cloud (but mostly because its annoying to never know where your data is written).
Fixed buf_cvarlist, should work in xonotic now, and without segfaults.
Added an extra arg to URI_Get_Callback calls - the response size, also changed the tempstring to contain all bytes of the response, you need to be careful about nulls though.
Try to work around nvidia's forced-panning bug on x11 when changing video modes. This might screw with other programs.
sdl: support custom icons.
sdl: support choosing a specific display.
Added some documentation to menuqc builtins.
menusys: use outlines for slightly more readable fonts.
menusys: switch vid_width and vid_height combos into a single video mode combo to set both according to reported video modes.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5581 fc73d0e0-1445-4013-8a0c-d673dee63da5
2019-11-20 03:09:50 +00:00
static void COM_InitHomedir ( ftemanifest_t * man )
{
int i ;
//assume the home directory is the working directory.
* com_homepath = ' \0 ' ;
2005-08-26 22:52:26 +00:00
Too many changes, sorry.
Change revision displays, use the SVN commit date instead of using __DATE__ (when there's no local changes). This should allow reproducible builds.
Added s_al_disable cvar, to block openal and all the various problems people have had with it, without having to name an explicit fallback (which would vary by system).
Add mastervolume cvar (for ss).
Add r_shadows 2 (aka fake shadows - for ss).
Add scr_loadingscreen_aspect -1 setting, to disable levelshots entirely, also disables the progress bar (for ss).
Better support for some effectinfo hacks (for ss).
Added dpcompat_nocsqcwarnings (because of lazy+buggy mods like ss).
Rework the dpcsqc versions of project+unproject builtins for better compat (for ss).
Added dpcompat_csqcinputeventtypes to block unexpected csqc input events (for ss).
Better compat with DP's loadfont console command (for ss).
Added dpcompat_smallerfonts cvar to replicate a DP bug (for ss).
Detect dp's m_draw extension, to work around it (for ss).
Cvar dpcompat_ignoremodificationtimes added. A value of 0 favour the most recently modified file, 1 will use DP-like alphabetically sorted preferences (for ss).
loadfont builtin can now accept outline=1 in the sizes arg for slightly more readable fonts.
Fix bbox calcs for rotated entities, fix needed for r_ignorenetpvs 0.
Hackily parse emoji.json to provide :poop: etc suggestions.
Skip prediction entirely when there's no local entity info. This fixes stair-smoothing in xonotic.
screenshot_cubemap will now capture half-float images when saving to ktx or dds files.
Fix support for xcf files larger than 4gb, mostly to avoid compiler warnings.
Fixed size of gfx/loading.lmp when replacement textures are used.
Added mipmap support for rg8 and l8a8 textures.
r_hdr_framebuffer cvar updated to support format names instead of random negative numbers. Description updated to name some interesting ones.
Perform autoupdate _checks_ ONLY with explicit user confirmation (actual updating already needed user confirmation, but this extra step should reduce the chances of us getting wrongly accused of exfiltrating user data if we're run in a sandbox - we ONLY ever included the updating engine's version in the checks, though there's nothing we can do to avoid sending the user's router's IP).
Removed the 'summon satan all over your harddrive' quit message, in case paranoid security researchers are idiots and don't bother doing actual research.
Removed the triptohell.info and fte.triptohell.info certificates, they really need to stop being self-signed. The updates domain is still self-signed for autoupdates.
Video drivers are now able to report supported video resolutions, visible to menuqc. Currently only works with SDL2 builds.
Added setmousepos builtin. Should work with glx+win32 build.
VF_SKYROOM_CAMERA can now accept an extra two args, setviewprop(VF_SKYROOM_CAMERA, org, axis, degrees).
Removed v_skyroom_origin+v_skyroom_orientation cvars in favour just v_skyroom, which should make it behave more like the 'fog' command (used when csqc isn't overriding).
Added R_EndPolygonRibbon builtin to make it faster+easier to generate textured ribbon/cable/etc wide lines (for TW).
sdl: Fix up sys_sdl.c's file enumeration to support wildcards in directories.
edit command now displays end1.bin/end2.bin correctly, because we can.
Finally add support for f_modified - though ruleset_allow_larger_models and ruleset_allow_overlong_sounds generally make it redundant.
Fix threading race condition in sha1 lookups.
Updated f_ruleset to include the same extra flags reported by ezquake.
A mod's default.fmf file can now contain an eg 'mainconfig config.cfg' line (to explicitly set the main config saved with cfg_save_auto 1 etc).
fmf: basegame steam:GameName/GameDir can be used to try to load a mod directory from an installed steam game. The resulting gamedir will be read-only.
HOMEDIR CHANGE: use homedirs only if the basedir cannot be written or a homedir already exists, which should further reduce the probability of microsoft randomly uploading our data to their cloud (but mostly because its annoying to never know where your data is written).
Fixed buf_cvarlist, should work in xonotic now, and without segfaults.
Added an extra arg to URI_Get_Callback calls - the response size, also changed the tempstring to contain all bytes of the response, you need to be careful about nulls though.
Try to work around nvidia's forced-panning bug on x11 when changing video modes. This might screw with other programs.
sdl: support custom icons.
sdl: support choosing a specific display.
Added some documentation to menuqc builtins.
menusys: use outlines for slightly more readable fonts.
menusys: switch vid_width and vid_height combos into a single video mode combo to set both according to reported video modes.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5581 fc73d0e0-1445-4013-8a0c-d673dee63da5
2019-11-20 03:09:50 +00:00
if ( man & & ( strstr ( man - > installation , " .. " ) | | strchr ( man - > installation , ' / ' ) | | strchr ( man - > installation , ' \\ ' ) ) )
com_homepathusable = false ; //don't even try to generate a relative homedir.
else
com_homepathusable = FS_GetBestHomeDir ( man ) ;
2014-12-23 15:26:42 +00:00
com_homepathenabled = false ;
2005-08-26 22:52:26 +00:00
Too many changes, sorry.
Change revision displays, use the SVN commit date instead of using __DATE__ (when there's no local changes). This should allow reproducible builds.
Added s_al_disable cvar, to block openal and all the various problems people have had with it, without having to name an explicit fallback (which would vary by system).
Add mastervolume cvar (for ss).
Add r_shadows 2 (aka fake shadows - for ss).
Add scr_loadingscreen_aspect -1 setting, to disable levelshots entirely, also disables the progress bar (for ss).
Better support for some effectinfo hacks (for ss).
Added dpcompat_nocsqcwarnings (because of lazy+buggy mods like ss).
Rework the dpcsqc versions of project+unproject builtins for better compat (for ss).
Added dpcompat_csqcinputeventtypes to block unexpected csqc input events (for ss).
Better compat with DP's loadfont console command (for ss).
Added dpcompat_smallerfonts cvar to replicate a DP bug (for ss).
Detect dp's m_draw extension, to work around it (for ss).
Cvar dpcompat_ignoremodificationtimes added. A value of 0 favour the most recently modified file, 1 will use DP-like alphabetically sorted preferences (for ss).
loadfont builtin can now accept outline=1 in the sizes arg for slightly more readable fonts.
Fix bbox calcs for rotated entities, fix needed for r_ignorenetpvs 0.
Hackily parse emoji.json to provide :poop: etc suggestions.
Skip prediction entirely when there's no local entity info. This fixes stair-smoothing in xonotic.
screenshot_cubemap will now capture half-float images when saving to ktx or dds files.
Fix support for xcf files larger than 4gb, mostly to avoid compiler warnings.
Fixed size of gfx/loading.lmp when replacement textures are used.
Added mipmap support for rg8 and l8a8 textures.
r_hdr_framebuffer cvar updated to support format names instead of random negative numbers. Description updated to name some interesting ones.
Perform autoupdate _checks_ ONLY with explicit user confirmation (actual updating already needed user confirmation, but this extra step should reduce the chances of us getting wrongly accused of exfiltrating user data if we're run in a sandbox - we ONLY ever included the updating engine's version in the checks, though there's nothing we can do to avoid sending the user's router's IP).
Removed the 'summon satan all over your harddrive' quit message, in case paranoid security researchers are idiots and don't bother doing actual research.
Removed the triptohell.info and fte.triptohell.info certificates, they really need to stop being self-signed. The updates domain is still self-signed for autoupdates.
Video drivers are now able to report supported video resolutions, visible to menuqc. Currently only works with SDL2 builds.
Added setmousepos builtin. Should work with glx+win32 build.
VF_SKYROOM_CAMERA can now accept an extra two args, setviewprop(VF_SKYROOM_CAMERA, org, axis, degrees).
Removed v_skyroom_origin+v_skyroom_orientation cvars in favour just v_skyroom, which should make it behave more like the 'fog' command (used when csqc isn't overriding).
Added R_EndPolygonRibbon builtin to make it faster+easier to generate textured ribbon/cable/etc wide lines (for TW).
sdl: Fix up sys_sdl.c's file enumeration to support wildcards in directories.
edit command now displays end1.bin/end2.bin correctly, because we can.
Finally add support for f_modified - though ruleset_allow_larger_models and ruleset_allow_overlong_sounds generally make it redundant.
Fix threading race condition in sha1 lookups.
Updated f_ruleset to include the same extra flags reported by ezquake.
A mod's default.fmf file can now contain an eg 'mainconfig config.cfg' line (to explicitly set the main config saved with cfg_save_auto 1 etc).
fmf: basegame steam:GameName/GameDir can be used to try to load a mod directory from an installed steam game. The resulting gamedir will be read-only.
HOMEDIR CHANGE: use homedirs only if the basedir cannot be written or a homedir already exists, which should further reduce the probability of microsoft randomly uploading our data to their cloud (but mostly because its annoying to never know where your data is written).
Fixed buf_cvarlist, should work in xonotic now, and without segfaults.
Added an extra arg to URI_Get_Callback calls - the response size, also changed the tempstring to contain all bytes of the response, you need to be careful about nulls though.
Try to work around nvidia's forced-panning bug on x11 when changing video modes. This might screw with other programs.
sdl: support custom icons.
sdl: support choosing a specific display.
Added some documentation to menuqc builtins.
menusys: use outlines for slightly more readable fonts.
menusys: switch vid_width and vid_height combos into a single video mode combo to set both according to reported video modes.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5581 fc73d0e0-1445-4013-8a0c-d673dee63da5
2019-11-20 03:09:50 +00:00
if ( man & & man - > homedirtype = = MANIFEST_NOHOMEDIR )
com_homepathusable = false ;
else if ( man & & man - > homedirtype = = MANIFEST_FORCEHOMEDIR )
com_homepathusable = true ;
2018-09-23 19:35:24 +00:00
i = COM_CheckParm ( " -homedir " ) ;
if ( i & & i + 1 < com_argc )
{ //explicitly override the homedir.
Q_strncpyz ( com_homepath , com_argv [ i + 1 ] , sizeof ( com_homepath ) ) ;
2020-09-15 08:55:53 +00:00
if ( * com_homepath & & com_homepath [ strlen ( com_homepath ) - 1 ] ! = ' / ' )
Q_strncatz ( com_homepath , " / " , sizeof ( com_homepath ) ) ;
2018-09-23 19:35:24 +00:00
com_homepathusable = true ;
}
2014-03-30 08:55:06 +00:00
if ( COM_CheckParm ( " -usehome " ) )
2014-12-23 15:26:42 +00:00
com_homepathusable = true ;
2005-11-30 01:20:53 +00:00
if ( COM_CheckParm ( " -nohome " ) )
2014-12-23 15:26:42 +00:00
com_homepathusable = false ;
2014-03-30 08:55:06 +00:00
if ( ! * com_homepath )
2014-12-23 15:26:42 +00:00
com_homepathusable = false ;
2014-03-30 08:55:06 +00:00
2018-01-22 19:18:04 +00:00
com_homepathenabled = com_homepathusable ;
2018-10-23 07:09:06 +00:00
}
Added sys_openfile console command(and menu option) to web and flatpak(via cmake+dbus) builds, to 'install' packages on sandboxed systems a bit more easily.
Cmake: Add FTE_WERROR option, defaults to true in debug builds and off in release builds (in case future compilers have issues).
Cmake: Pull in libXscreensaver so we don't get interrupted by screensavers when playing demos.
Make: Added `make webcl-rel` for a web build without server bloat (eg for sites focused on demo playback. Yes, this means you XantoM).
fteqcc: Include the decompiler in fteqcc (non-gui) builds ('-d' arg).
fteqcc: Decompiler can now mostly handle hexen2 mods without any unknown opcodes.
Allow ezHud and OpenSSL to be compiled as in-engine plugins, potentially for web and windows ports respectively.
Web: Fix support for ogg vorbis. Add support for voip.
Web: Added basic support for WebXR.
QTV: Don't try seeking on unseekable qtv streams. Don't spam when developer 1 is set.
QTV: add support for some eztv extensions.
MVD: added hack to use ktx's vweps in mvd where mvdsv doesn't bother to record the info.
qwfwd: hack around a hack in qwfwd, allowing it to work again.
recording: favour qwd in single player, instead of mvd.
Protocol: reduce client memory used for precache names. Bump maximum precache counts - some people are just abusive, yes you Orl.
hexen2: add enough clientside protocol compat to play the demo included with h2mp. lacks effects.
in_xflip: restored this setting.
fs_hidesyspaths: new cvar, defaults to enabled so you won't find your username or whatever turning up in screenshots or the like. change it to 0 before debuging stuff eg via 'path'.
gl_overbright_models: Added cvar to match QS.
netchan: Added MTU determination, we'll no longer fail to connect when routers stupidly drop icmp packets.
Win: try a few other versions of xinput too.
CSQC: Added a CSQC_GenerateMaterial function, to give the csqc a chance to generate custom materials.
MenuQC: Added support for the skeletal objects API.
2024-04-09 17:13:59 +00:00
# if defined(HAVE_DBUS) && !defined(HAVE_CLIENT)
# undef HAVE_DBUS
# endif
# ifdef HAVE_DBUS
void FS_OpenFilePicker_f ( void ) ;
# endif
2018-10-23 07:09:06 +00:00
/*
= = = = = = = = = = = = = = = =
COM_InitFilesystem
note : does not actually load any packs , just makes sure the basedir + cvars + etc is set up . vfs_fopens will still fail .
= = = = = = = = = = = = = = = =
*/
void COM_InitFilesystem ( void )
{
int i ;
FS_RegisterDefaultFileSystems ( ) ;
Cmd_AddCommand ( " fs_restart " , FS_ReloadPackFiles_f ) ;
Cmd_AddCommandD ( " fs_changegame " , FS_ChangeGame_f , " Switch between different manifests (or registered games) " ) ;
Cmd_AddCommandD ( " fs_changemod " , FS_ChangeMod_f , " Provides the backend functionality of a transient online installer. Eg, for quaddicted's map/mod database. " ) ;
Cmd_AddCommand ( " fs_showmanifest " , FS_ShowManifest_f ) ;
Cmd_AddCommand ( " fs_flush " , COM_RefreshFSCache_f ) ;
Cmd_AddCommandAD ( " dir " , COM_Dir_f , FS_ArbitraryFile_c , " Displays filesystem listings. Accepts wildcards. " ) ; //q3 like
2020-02-16 19:18:31 +00:00
Cmd_AddCommandAD ( " ls " , COM_Dir_f , FS_ArbitraryFile_c , " Displays filesystem listings. Accepts wildcards. " ) ; //q3 like
2018-10-23 07:09:06 +00:00
Cmd_AddCommandD ( " path " , COM_Path_f , " prints a list of current search paths. " ) ;
Cmd_AddCommandAD ( " flocate " , COM_Locate_f , FS_ArbitraryFile_c , " Searches for a named file, and displays where it can be found in the OS's filesystem " ) ; //prints the pak or whatever where this file can be found.
Too many changes, sorry.
Change revision displays, use the SVN commit date instead of using __DATE__ (when there's no local changes). This should allow reproducible builds.
Added s_al_disable cvar, to block openal and all the various problems people have had with it, without having to name an explicit fallback (which would vary by system).
Add mastervolume cvar (for ss).
Add r_shadows 2 (aka fake shadows - for ss).
Add scr_loadingscreen_aspect -1 setting, to disable levelshots entirely, also disables the progress bar (for ss).
Better support for some effectinfo hacks (for ss).
Added dpcompat_nocsqcwarnings (because of lazy+buggy mods like ss).
Rework the dpcsqc versions of project+unproject builtins for better compat (for ss).
Added dpcompat_csqcinputeventtypes to block unexpected csqc input events (for ss).
Better compat with DP's loadfont console command (for ss).
Added dpcompat_smallerfonts cvar to replicate a DP bug (for ss).
Detect dp's m_draw extension, to work around it (for ss).
Cvar dpcompat_ignoremodificationtimes added. A value of 0 favour the most recently modified file, 1 will use DP-like alphabetically sorted preferences (for ss).
loadfont builtin can now accept outline=1 in the sizes arg for slightly more readable fonts.
Fix bbox calcs for rotated entities, fix needed for r_ignorenetpvs 0.
Hackily parse emoji.json to provide :poop: etc suggestions.
Skip prediction entirely when there's no local entity info. This fixes stair-smoothing in xonotic.
screenshot_cubemap will now capture half-float images when saving to ktx or dds files.
Fix support for xcf files larger than 4gb, mostly to avoid compiler warnings.
Fixed size of gfx/loading.lmp when replacement textures are used.
Added mipmap support for rg8 and l8a8 textures.
r_hdr_framebuffer cvar updated to support format names instead of random negative numbers. Description updated to name some interesting ones.
Perform autoupdate _checks_ ONLY with explicit user confirmation (actual updating already needed user confirmation, but this extra step should reduce the chances of us getting wrongly accused of exfiltrating user data if we're run in a sandbox - we ONLY ever included the updating engine's version in the checks, though there's nothing we can do to avoid sending the user's router's IP).
Removed the 'summon satan all over your harddrive' quit message, in case paranoid security researchers are idiots and don't bother doing actual research.
Removed the triptohell.info and fte.triptohell.info certificates, they really need to stop being self-signed. The updates domain is still self-signed for autoupdates.
Video drivers are now able to report supported video resolutions, visible to menuqc. Currently only works with SDL2 builds.
Added setmousepos builtin. Should work with glx+win32 build.
VF_SKYROOM_CAMERA can now accept an extra two args, setviewprop(VF_SKYROOM_CAMERA, org, axis, degrees).
Removed v_skyroom_origin+v_skyroom_orientation cvars in favour just v_skyroom, which should make it behave more like the 'fog' command (used when csqc isn't overriding).
Added R_EndPolygonRibbon builtin to make it faster+easier to generate textured ribbon/cable/etc wide lines (for TW).
sdl: Fix up sys_sdl.c's file enumeration to support wildcards in directories.
edit command now displays end1.bin/end2.bin correctly, because we can.
Finally add support for f_modified - though ruleset_allow_larger_models and ruleset_allow_overlong_sounds generally make it redundant.
Fix threading race condition in sha1 lookups.
Updated f_ruleset to include the same extra flags reported by ezquake.
A mod's default.fmf file can now contain an eg 'mainconfig config.cfg' line (to explicitly set the main config saved with cfg_save_auto 1 etc).
fmf: basegame steam:GameName/GameDir can be used to try to load a mod directory from an installed steam game. The resulting gamedir will be read-only.
HOMEDIR CHANGE: use homedirs only if the basedir cannot be written or a homedir already exists, which should further reduce the probability of microsoft randomly uploading our data to their cloud (but mostly because its annoying to never know where your data is written).
Fixed buf_cvarlist, should work in xonotic now, and without segfaults.
Added an extra arg to URI_Get_Callback calls - the response size, also changed the tempstring to contain all bytes of the response, you need to be careful about nulls though.
Try to work around nvidia's forced-panning bug on x11 when changing video modes. This might screw with other programs.
sdl: support custom icons.
sdl: support choosing a specific display.
Added some documentation to menuqc builtins.
menusys: use outlines for slightly more readable fonts.
menusys: switch vid_width and vid_height combos into a single video mode combo to set both according to reported video modes.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5581 fc73d0e0-1445-4013-8a0c-d673dee63da5
2019-11-20 03:09:50 +00:00
Cmd_AddCommandAD ( " which " , COM_Locate_f , FS_ArbitraryFile_c , " Searches for a named file, and displays where it can be found in the OS's filesystem " ) ; //prints the pak or whatever where this file can be found.
2018-10-23 07:09:06 +00:00
2022-01-19 08:27:42 +00:00
Cmd_AddCommandAD ( " fs_hash " , COM_CalcHash_f , FS_ArbitraryFile_c , " Computes a hash of the specified file. " ) ;
Added sys_openfile console command(and menu option) to web and flatpak(via cmake+dbus) builds, to 'install' packages on sandboxed systems a bit more easily.
Cmake: Add FTE_WERROR option, defaults to true in debug builds and off in release builds (in case future compilers have issues).
Cmake: Pull in libXscreensaver so we don't get interrupted by screensavers when playing demos.
Make: Added `make webcl-rel` for a web build without server bloat (eg for sites focused on demo playback. Yes, this means you XantoM).
fteqcc: Include the decompiler in fteqcc (non-gui) builds ('-d' arg).
fteqcc: Decompiler can now mostly handle hexen2 mods without any unknown opcodes.
Allow ezHud and OpenSSL to be compiled as in-engine plugins, potentially for web and windows ports respectively.
Web: Fix support for ogg vorbis. Add support for voip.
Web: Added basic support for WebXR.
QTV: Don't try seeking on unseekable qtv streams. Don't spam when developer 1 is set.
QTV: add support for some eztv extensions.
MVD: added hack to use ktx's vweps in mvd where mvdsv doesn't bother to record the info.
qwfwd: hack around a hack in qwfwd, allowing it to work again.
recording: favour qwd in single player, instead of mvd.
Protocol: reduce client memory used for precache names. Bump maximum precache counts - some people are just abusive, yes you Orl.
hexen2: add enough clientside protocol compat to play the demo included with h2mp. lacks effects.
in_xflip: restored this setting.
fs_hidesyspaths: new cvar, defaults to enabled so you won't find your username or whatever turning up in screenshots or the like. change it to 0 before debuging stuff eg via 'path'.
gl_overbright_models: Added cvar to match QS.
netchan: Added MTU determination, we'll no longer fail to connect when routers stupidly drop icmp packets.
Win: try a few other versions of xinput too.
CSQC: Added a CSQC_GenerateMaterial function, to give the csqc a chance to generate custom materials.
MenuQC: Added support for the skeletal objects API.
2024-04-09 17:13:59 +00:00
# ifdef HAVE_DBUS
Cmd_AddCommandD ( " sys_openfile " , FS_OpenFilePicker_f , " Select a file to open/install/etc. " ) ;
# endif
2018-10-23 07:09:06 +00:00
//
// -basedir <path>
// Overrides the system supplied base directory (under id1)
//
i = COM_CheckParm ( " -basedir " ) ;
if ( i & & i < com_argc - 1 )
strcpy ( com_gamepath , com_argv [ i + 1 ] ) ;
else
strcpy ( com_gamepath , host_parms . basedir ) ;
FS_CleanDir ( com_gamepath , sizeof ( com_gamepath ) ) ;
Cvar_Register ( & cfg_reload_on_gamedir , " Filesystem " ) ;
Too many changes, sorry.
Change revision displays, use the SVN commit date instead of using __DATE__ (when there's no local changes). This should allow reproducible builds.
Added s_al_disable cvar, to block openal and all the various problems people have had with it, without having to name an explicit fallback (which would vary by system).
Add mastervolume cvar (for ss).
Add r_shadows 2 (aka fake shadows - for ss).
Add scr_loadingscreen_aspect -1 setting, to disable levelshots entirely, also disables the progress bar (for ss).
Better support for some effectinfo hacks (for ss).
Added dpcompat_nocsqcwarnings (because of lazy+buggy mods like ss).
Rework the dpcsqc versions of project+unproject builtins for better compat (for ss).
Added dpcompat_csqcinputeventtypes to block unexpected csqc input events (for ss).
Better compat with DP's loadfont console command (for ss).
Added dpcompat_smallerfonts cvar to replicate a DP bug (for ss).
Detect dp's m_draw extension, to work around it (for ss).
Cvar dpcompat_ignoremodificationtimes added. A value of 0 favour the most recently modified file, 1 will use DP-like alphabetically sorted preferences (for ss).
loadfont builtin can now accept outline=1 in the sizes arg for slightly more readable fonts.
Fix bbox calcs for rotated entities, fix needed for r_ignorenetpvs 0.
Hackily parse emoji.json to provide :poop: etc suggestions.
Skip prediction entirely when there's no local entity info. This fixes stair-smoothing in xonotic.
screenshot_cubemap will now capture half-float images when saving to ktx or dds files.
Fix support for xcf files larger than 4gb, mostly to avoid compiler warnings.
Fixed size of gfx/loading.lmp when replacement textures are used.
Added mipmap support for rg8 and l8a8 textures.
r_hdr_framebuffer cvar updated to support format names instead of random negative numbers. Description updated to name some interesting ones.
Perform autoupdate _checks_ ONLY with explicit user confirmation (actual updating already needed user confirmation, but this extra step should reduce the chances of us getting wrongly accused of exfiltrating user data if we're run in a sandbox - we ONLY ever included the updating engine's version in the checks, though there's nothing we can do to avoid sending the user's router's IP).
Removed the 'summon satan all over your harddrive' quit message, in case paranoid security researchers are idiots and don't bother doing actual research.
Removed the triptohell.info and fte.triptohell.info certificates, they really need to stop being self-signed. The updates domain is still self-signed for autoupdates.
Video drivers are now able to report supported video resolutions, visible to menuqc. Currently only works with SDL2 builds.
Added setmousepos builtin. Should work with glx+win32 build.
VF_SKYROOM_CAMERA can now accept an extra two args, setviewprop(VF_SKYROOM_CAMERA, org, axis, degrees).
Removed v_skyroom_origin+v_skyroom_orientation cvars in favour just v_skyroom, which should make it behave more like the 'fog' command (used when csqc isn't overriding).
Added R_EndPolygonRibbon builtin to make it faster+easier to generate textured ribbon/cable/etc wide lines (for TW).
sdl: Fix up sys_sdl.c's file enumeration to support wildcards in directories.
edit command now displays end1.bin/end2.bin correctly, because we can.
Finally add support for f_modified - though ruleset_allow_larger_models and ruleset_allow_overlong_sounds generally make it redundant.
Fix threading race condition in sha1 lookups.
Updated f_ruleset to include the same extra flags reported by ezquake.
A mod's default.fmf file can now contain an eg 'mainconfig config.cfg' line (to explicitly set the main config saved with cfg_save_auto 1 etc).
fmf: basegame steam:GameName/GameDir can be used to try to load a mod directory from an installed steam game. The resulting gamedir will be read-only.
HOMEDIR CHANGE: use homedirs only if the basedir cannot be written or a homedir already exists, which should further reduce the probability of microsoft randomly uploading our data to their cloud (but mostly because its annoying to never know where your data is written).
Fixed buf_cvarlist, should work in xonotic now, and without segfaults.
Added an extra arg to URI_Get_Callback calls - the response size, also changed the tempstring to contain all bytes of the response, you need to be careful about nulls though.
Try to work around nvidia's forced-panning bug on x11 when changing video modes. This might screw with other programs.
sdl: support custom icons.
sdl: support choosing a specific display.
Added some documentation to menuqc builtins.
menusys: use outlines for slightly more readable fonts.
menusys: switch vid_width and vid_height combos into a single video mode combo to set both according to reported video modes.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5581 fc73d0e0-1445-4013-8a0c-d673dee63da5
2019-11-20 03:09:50 +00:00
Cvar_Register ( & dpcompat_ignoremodificationtimes , " Filesystem " ) ;
2018-10-23 07:09:06 +00:00
Cvar_Register ( & com_fs_cache , " Filesystem " ) ;
Added sys_openfile console command(and menu option) to web and flatpak(via cmake+dbus) builds, to 'install' packages on sandboxed systems a bit more easily.
Cmake: Add FTE_WERROR option, defaults to true in debug builds and off in release builds (in case future compilers have issues).
Cmake: Pull in libXscreensaver so we don't get interrupted by screensavers when playing demos.
Make: Added `make webcl-rel` for a web build without server bloat (eg for sites focused on demo playback. Yes, this means you XantoM).
fteqcc: Include the decompiler in fteqcc (non-gui) builds ('-d' arg).
fteqcc: Decompiler can now mostly handle hexen2 mods without any unknown opcodes.
Allow ezHud and OpenSSL to be compiled as in-engine plugins, potentially for web and windows ports respectively.
Web: Fix support for ogg vorbis. Add support for voip.
Web: Added basic support for WebXR.
QTV: Don't try seeking on unseekable qtv streams. Don't spam when developer 1 is set.
QTV: add support for some eztv extensions.
MVD: added hack to use ktx's vweps in mvd where mvdsv doesn't bother to record the info.
qwfwd: hack around a hack in qwfwd, allowing it to work again.
recording: favour qwd in single player, instead of mvd.
Protocol: reduce client memory used for precache names. Bump maximum precache counts - some people are just abusive, yes you Orl.
hexen2: add enough clientside protocol compat to play the demo included with h2mp. lacks effects.
in_xflip: restored this setting.
fs_hidesyspaths: new cvar, defaults to enabled so you won't find your username or whatever turning up in screenshots or the like. change it to 0 before debuging stuff eg via 'path'.
gl_overbright_models: Added cvar to match QS.
netchan: Added MTU determination, we'll no longer fail to connect when routers stupidly drop icmp packets.
Win: try a few other versions of xinput too.
CSQC: Added a CSQC_GenerateMaterial function, to give the csqc a chance to generate custom materials.
MenuQC: Added support for the skeletal objects API.
2024-04-09 17:13:59 +00:00
Cvar_Register ( & fs_hidesyspaths , " Filesystem " ) ;
2018-10-23 07:09:06 +00:00
Cvar_Register ( & fs_gamename , " Filesystem " ) ;
2020-04-19 01:23:32 +00:00
# ifdef PACKAGEMANAGER
2019-06-17 04:21:41 +00:00
Cvar_Register ( & pkg_autoupdate , " Filesystem " ) ;
2020-04-19 01:23:32 +00:00
# endif
2018-10-23 07:09:06 +00:00
Cvar_Register ( & com_protocolname , " Server Info " ) ;
Cvar_Register ( & com_protocolversion , " Server Info " ) ;
Cvar_Register ( & fs_game , " Filesystem " ) ;
2022-03-08 05:31:34 +00:00
Cvar_Register ( & fs_gamepath , " Filesystem " ) ;
Cvar_Register ( & fs_basepath , " Filesystem " ) ;
Cvar_Register ( & fs_homepath , " Filesystem " ) ;
2023-03-27 17:22:00 +00:00
Cvar_Register ( & fs_dlURL , " Filesystem " ) ;
Added sys_openfile console command(and menu option) to web and flatpak(via cmake+dbus) builds, to 'install' packages on sandboxed systems a bit more easily.
Cmake: Add FTE_WERROR option, defaults to true in debug builds and off in release builds (in case future compilers have issues).
Cmake: Pull in libXscreensaver so we don't get interrupted by screensavers when playing demos.
Make: Added `make webcl-rel` for a web build without server bloat (eg for sites focused on demo playback. Yes, this means you XantoM).
fteqcc: Include the decompiler in fteqcc (non-gui) builds ('-d' arg).
fteqcc: Decompiler can now mostly handle hexen2 mods without any unknown opcodes.
Allow ezHud and OpenSSL to be compiled as in-engine plugins, potentially for web and windows ports respectively.
Web: Fix support for ogg vorbis. Add support for voip.
Web: Added basic support for WebXR.
QTV: Don't try seeking on unseekable qtv streams. Don't spam when developer 1 is set.
QTV: add support for some eztv extensions.
MVD: added hack to use ktx's vweps in mvd where mvdsv doesn't bother to record the info.
qwfwd: hack around a hack in qwfwd, allowing it to work again.
recording: favour qwd in single player, instead of mvd.
Protocol: reduce client memory used for precache names. Bump maximum precache counts - some people are just abusive, yes you Orl.
hexen2: add enough clientside protocol compat to play the demo included with h2mp. lacks effects.
in_xflip: restored this setting.
fs_hidesyspaths: new cvar, defaults to enabled so you won't find your username or whatever turning up in screenshots or the like. change it to 0 before debuging stuff eg via 'path'.
gl_overbright_models: Added cvar to match QS.
netchan: Added MTU determination, we'll no longer fail to connect when routers stupidly drop icmp packets.
Win: try a few other versions of xinput too.
CSQC: Added a CSQC_GenerateMaterial function, to give the csqc a chance to generate custom materials.
MenuQC: Added support for the skeletal objects API.
2024-04-09 17:13:59 +00:00
Cvar_Register ( & cl_download_mapsrc , " Filesystem " ) ;
2018-10-23 07:09:06 +00:00
COM_InitHomedir ( NULL ) ;
2014-03-30 08:55:06 +00:00
fs_readonly = COM_CheckParm ( " -readonly " ) ;
2023-01-09 05:12:39 +00:00
if ( COM_CheckParm ( " -allowfileuri " ) | | COM_CheckParm ( " -allowfileurl " ) )
{
fs_allowfileuri = ( searchpath_t * ) Z_Malloc ( sizeof ( searchpath_t ) ) ;
fs_allowfileuri - > handle = VFSOS_OpenPath ( NULL , NULL , " " , " " , " " ) ;
}
2005-11-30 01:20:53 +00:00
2014-10-05 20:04:11 +00:00
fs_thread_mutex = Sys_CreateMutex ( ) ;
2005-08-26 22:52:26 +00:00
}
2009-04-01 22:03:56 +00:00
//this is at the bottom of the file to ensure these globals are not used elsewhere
2018-03-04 14:41:16 +00:00
/*extern searchpathfuncs_t *(QDECL VFSOS_OpenPath) (vfsfile_t *file, searchpathfuncs_t *parent, const char *filename, const char *desc, const char *prefix);
2014-12-09 14:39:54 +00:00
# if 1 //def AVAIL_ZLIB
2018-03-04 14:41:16 +00:00
extern searchpathfuncs_t * ( QDECL FSZIP_LoadArchive ) ( vfsfile_t * packhandle , searchpathfuncs_t * parent , const char * filename , const char * desc , const char * prefix ) ;
2013-06-23 02:17:02 +00:00
# endif
2018-03-04 14:41:16 +00:00
extern searchpathfuncs_t * ( QDECL FSPAK_LoadArchive ) ( vfsfile_t * packhandle , searchpathfuncs_t * parent , const char * filename , const char * desc , const char * prefix ) ;
2017-02-19 00:15:42 +00:00
# ifdef PACKAGE_DOOMWAD
2018-03-04 14:41:16 +00:00
extern searchpathfuncs_t * ( QDECL FSDWD_LoadArchive ) ( vfsfile_t * packhandle , searchpathfuncs_t * parent , const char * filename , const char * desc , const char * prefix ) ;
# endif* /
2009-04-01 22:03:56 +00:00
void FS_RegisterDefaultFileSystems ( void )
2023-01-09 05:12:39 +00:00
{ //packages listed last will be scanned for last (and thus be favoured when searching for game files)
# ifdef PACKAGE_DOOMWAD
FS_RegisterFileSystemType ( NULL , " wad " , FSDWD_LoadArchive , true ) ;
# endif
2017-07-12 08:15:27 +00:00
# ifdef PACKAGE_DZIP
FS_RegisterFileSystemType ( NULL , " dz " , FSDZ_LoadArchive , false ) ;
# endif
2017-02-19 00:15:42 +00:00
# ifdef PACKAGE_Q1PAK
2013-06-23 02:17:02 +00:00
FS_RegisterFileSystemType ( NULL , " pak " , FSPAK_LoadArchive , true ) ;
2011-09-16 05:56:54 +00:00
# if !defined(_WIN32) && !defined(ANDROID)
2010-07-11 10:53:13 +00:00
/*for systems that have case sensitive paths, also include *.PAK */
2013-06-23 02:17:02 +00:00
FS_RegisterFileSystemType ( NULL , " PAK " , FSPAK_LoadArchive , true ) ;
2017-02-19 00:15:42 +00:00
# endif
2010-07-11 10:53:13 +00:00
# endif
2017-02-19 00:15:42 +00:00
# ifdef PACKAGE_PK3
2019-01-13 16:51:50 +00:00
FS_RegisterFileSystemType ( NULL , " pk3 " , FSZIP_LoadArchive , true ) ; //quake3's extension for zips
FS_RegisterFileSystemType ( NULL , " pk4 " , FSZIP_LoadArchive , true ) ; //quake4's extension for zips...
# ifdef Q2CLIENT
FS_RegisterFileSystemType ( NULL , " pkz " , FSZIP_LoadArchive , true ) ; //q2pro uses a different extension
FS_RegisterFileSystemType ( NULL , " pkx " , FSZIP_LoadArchive , true ) ; //q2xp naturally uses a different extension too... you'll be glad to know that yq2 uses pk3 instead. yay consistency - every engine uses something different!
# endif
2024-04-06 00:05:33 +00:00
FS_RegisterFileSystemType ( NULL , " iwd " , FSZIP_LoadArchive , true ) ; //cod2's variation.
2019-01-13 16:51:50 +00:00
FS_RegisterFileSystemType ( NULL , " apk " , FSZIP_LoadArchive , false ) ; //android package
FS_RegisterFileSystemType ( NULL , " zip " , FSZIP_LoadArchive , false ) ; //regular zip file (don't automatically read from these, because it gets messy)
Added sys_openfile console command(and menu option) to web and flatpak(via cmake+dbus) builds, to 'install' packages on sandboxed systems a bit more easily.
Cmake: Add FTE_WERROR option, defaults to true in debug builds and off in release builds (in case future compilers have issues).
Cmake: Pull in libXscreensaver so we don't get interrupted by screensavers when playing demos.
Make: Added `make webcl-rel` for a web build without server bloat (eg for sites focused on demo playback. Yes, this means you XantoM).
fteqcc: Include the decompiler in fteqcc (non-gui) builds ('-d' arg).
fteqcc: Decompiler can now mostly handle hexen2 mods without any unknown opcodes.
Allow ezHud and OpenSSL to be compiled as in-engine plugins, potentially for web and windows ports respectively.
Web: Fix support for ogg vorbis. Add support for voip.
Web: Added basic support for WebXR.
QTV: Don't try seeking on unseekable qtv streams. Don't spam when developer 1 is set.
QTV: add support for some eztv extensions.
MVD: added hack to use ktx's vweps in mvd where mvdsv doesn't bother to record the info.
qwfwd: hack around a hack in qwfwd, allowing it to work again.
recording: favour qwd in single player, instead of mvd.
Protocol: reduce client memory used for precache names. Bump maximum precache counts - some people are just abusive, yes you Orl.
hexen2: add enough clientside protocol compat to play the demo included with h2mp. lacks effects.
in_xflip: restored this setting.
fs_hidesyspaths: new cvar, defaults to enabled so you won't find your username or whatever turning up in screenshots or the like. change it to 0 before debuging stuff eg via 'path'.
gl_overbright_models: Added cvar to match QS.
netchan: Added MTU determination, we'll no longer fail to connect when routers stupidly drop icmp packets.
Win: try a few other versions of xinput too.
CSQC: Added a CSQC_GenerateMaterial function, to give the csqc a chance to generate custom materials.
MenuQC: Added support for the skeletal objects API.
2024-04-09 17:13:59 +00:00
FS_RegisterFileSystemType ( NULL , " kpf " , FSZIP_LoadArchive , true ) ; //regular zip file (don't automatically read from these, because it gets messy)
2017-11-14 14:37:04 +00:00
FS_RegisterFileSystemType ( NULL , " exe " , FSZIP_LoadArchive , false ) ; //for self-extracting zips.
2021-10-05 05:05:22 +00:00
FS_RegisterFileSystemType ( NULL , " dll " , FSZIP_LoadArchive , false ) ; //for plugin metas / self-extracting zips.
FS_RegisterFileSystemType ( NULL , " so " , FSZIP_LoadArchive , false ) ; //for plugin metas / self-extracting zips.
2009-04-01 22:03:56 +00:00
# endif
2023-01-09 05:12:39 +00:00
FS_RegisterFileSystemType ( NULL , " pk3dir " , VFSOS_OpenPath , true ) ; //used for git repos or whatever, to make packaging easier
2009-04-02 22:25:54 +00:00
}
Added sys_openfile console command(and menu option) to web and flatpak(via cmake+dbus) builds, to 'install' packages on sandboxed systems a bit more easily.
Cmake: Add FTE_WERROR option, defaults to true in debug builds and off in release builds (in case future compilers have issues).
Cmake: Pull in libXscreensaver so we don't get interrupted by screensavers when playing demos.
Make: Added `make webcl-rel` for a web build without server bloat (eg for sites focused on demo playback. Yes, this means you XantoM).
fteqcc: Include the decompiler in fteqcc (non-gui) builds ('-d' arg).
fteqcc: Decompiler can now mostly handle hexen2 mods without any unknown opcodes.
Allow ezHud and OpenSSL to be compiled as in-engine plugins, potentially for web and windows ports respectively.
Web: Fix support for ogg vorbis. Add support for voip.
Web: Added basic support for WebXR.
QTV: Don't try seeking on unseekable qtv streams. Don't spam when developer 1 is set.
QTV: add support for some eztv extensions.
MVD: added hack to use ktx's vweps in mvd where mvdsv doesn't bother to record the info.
qwfwd: hack around a hack in qwfwd, allowing it to work again.
recording: favour qwd in single player, instead of mvd.
Protocol: reduce client memory used for precache names. Bump maximum precache counts - some people are just abusive, yes you Orl.
hexen2: add enough clientside protocol compat to play the demo included with h2mp. lacks effects.
in_xflip: restored this setting.
fs_hidesyspaths: new cvar, defaults to enabled so you won't find your username or whatever turning up in screenshots or the like. change it to 0 before debuging stuff eg via 'path'.
gl_overbright_models: Added cvar to match QS.
netchan: Added MTU determination, we'll no longer fail to connect when routers stupidly drop icmp packets.
Win: try a few other versions of xinput too.
CSQC: Added a CSQC_GenerateMaterial function, to give the csqc a chance to generate custom materials.
MenuQC: Added support for the skeletal objects API.
2024-04-09 17:13:59 +00:00
# ifdef HAVE_DBUS
//I'm adding this code primarily for the flatpak builds. this means cmake only, and only when cmake detects the libs. we can also get away with statically linking the dbus lib too, so no dlopen mess, and its only linked in client builds.
# include <dbus/dbus.h>
struct openfile_s
{
DBusConnection * conn ;
char * replypath ;
} ;
static void FS_DBus_Poll ( int iarg , void * vctx )
{ //kept ticking over via timers so we don't stall completely
struct openfile_s * ctx = vctx ;
DBusMessage * msg ;
DBusMessageIter args , opts , dict , var , uris ;
dbus_connection_read_write ( ctx - > conn , 0 ) ; //see if there's anything new, with no timeout so we don't lock up
msg = dbus_connection_pop_message ( ctx - > conn ) ;
if ( msg )
{ //something came back!
if ( dbus_message_is_signal ( msg , " org.freedesktop.portal.Request " , " Response " ) & &
! strcmp ( dbus_message_get_path ( msg ) , ctx - > replypath ) )
{ //okay, this is the one we're interested in.
if ( dbus_message_iter_init ( msg , & args ) & & dbus_message_iter_get_arg_type ( & args ) = = DBUS_TYPE_UINT32 )
{
//dbus_message_iter_get_basic(&dict, &response); //0 for success, 1 for user cancel, 2 for error.
if ( dbus_message_iter_next ( & args ) & & dbus_message_iter_get_arg_type ( & args ) = = DBUS_TYPE_ARRAY )
{
dbus_message_iter_recurse ( & args , & opts ) ;
for ( ; dbus_message_iter_get_arg_type ( & opts ) = = DBUS_TYPE_DICT_ENTRY ; dbus_message_iter_next ( & opts ) )
{
dbus_message_iter_recurse ( & opts , & dict ) ;
if ( dbus_message_iter_get_arg_type ( & dict ) = = DBUS_TYPE_STRING )
{
const char * optname ;
dbus_message_iter_get_basic ( & dict , & optname ) ;
if ( dbus_message_iter_next ( & dict ) & & dbus_message_iter_get_arg_type ( & dict ) = = DBUS_TYPE_VARIANT )
{
dbus_message_iter_recurse ( & dict , & var ) ;
//if (!strcmp(optname, "choices")) //array of string pairs
//if (!strcmp(optname, "currentfilter"))
if ( ! strcmp ( optname , " uris " ) & & dbus_message_iter_get_arg_type ( & var ) = = DBUS_TYPE_ARRAY )
{
dbus_message_iter_recurse ( & var , & uris ) ;
for ( ; dbus_message_iter_get_arg_type ( & uris ) = = DBUS_TYPE_STRING ; dbus_message_iter_next ( & uris ) )
{
char fullname [ MAX_OSPATH ] ;
vfsfile_t * f ;
const char * filename ;
dbus_message_iter_get_basic ( & uris , & filename ) ;
if ( Sys_ResolveFileURL ( filename , strlen ( filename ) , fullname , sizeof ( fullname ) ) )
{
f = VFSOS_Open ( fullname , " rb " ) ;
if ( f )
{
// filename = COM_SkipPath(filename);
Host_RunFile ( filename , strlen ( filename ) , f ) ;
}
}
}
}
}
}
}
}
}
dbus_message_unref ( msg ) ;
dbus_connection_close ( ctx - > conn ) ;
Z_Free ( ( char * ) ctx - > replypath ) ;
return ; //can stop requeing now
}
dbus_message_unref ( msg ) ;
}
Cmd_AddTimer ( 0.2 , FS_DBus_Poll , 0 , ctx , sizeof ( * ctx ) ) ;
}
void FS_OpenFilePicker_f ( void )
{
const char * parentwindow = " " ;
const char * title = " All Files " ;
DBusMessage * msg ;
DBusMessageIter args , opts ;
struct openfile_s ctx ;
DBusError err ;
DBusPendingCall * pending ;
// initialiset the errors
dbus_error_init ( & err ) ;
// connect to the system bus and check for errors
ctx . conn = dbus_bus_get_private ( DBUS_BUS_SESSION , & err ) ;
if ( dbus_error_is_set ( & err ) )
{
fprintf ( stderr , " Connection Error (%s) \n " , err . message ) ;
dbus_error_free ( & err ) ;
}
if ( ! ctx . conn )
return ;
// request our name on the bus
dbus_bus_register ( ctx . conn , & err ) ;
if ( dbus_error_is_set ( & err ) )
dbus_error_free ( & err ) ;
// create a new method call and check for errors
msg = dbus_message_new_method_call (
" org.freedesktop.portal.Desktop " , // target for the method call
" /org/freedesktop/portal/desktop " , // object to call on
" org.freedesktop.portal.FileChooser " , // interface to call on
" OpenFile " ) ; // method name
if ( msg )
{
dbus_message_iter_init_append ( msg , & args ) ;
dbus_message_iter_append_basic ( & args , DBUS_TYPE_STRING , & parentwindow ) ;
dbus_message_iter_append_basic ( & args , DBUS_TYPE_STRING , & title ) ;
dbus_message_iter_open_container ( & args , DBUS_TYPE_ARRAY , " {sv} " , & opts ) ;
dbus_message_iter_close_container ( & args , & opts ) ;
//make sure we get the response (without getting any races)
dbus_bus_add_match ( ctx . conn , " type='signal' "
/*",path='/org/freedesktop/portal/desktop/request/UNIQUE/TOKEN'"*/
" ,interface='org.freedesktop.portal.Request' "
" ,member='Response' " , & err ) ;
//now send our request
if ( ! dbus_connection_send_with_reply ( ctx . conn , msg , & pending , - 1 ) | | ! pending )
{
dbus_message_unref ( msg ) ;
msg = NULL ;
}
else
{
dbus_message_unref ( msg ) ;
dbus_connection_flush ( ctx . conn ) ;
dbus_pending_call_block ( pending ) ;
//see if we got a reply
msg = dbus_pending_call_steal_reply ( pending ) ;
dbus_pending_call_unref ( pending ) ;
}
}
if ( msg )
{ //read the object path from the response.
if ( dbus_message_iter_init ( msg , & args ) & & dbus_message_iter_get_arg_type ( & args ) )
{
dbus_message_iter_get_basic ( & args , & ctx . replypath ) ;
ctx . replypath = Z_StrDup ( ctx . replypath ) ;
}
dbus_message_unref ( msg ) ;
}
if ( dbus_error_is_set ( & err ) )
dbus_error_free ( & err ) ; //oops?
if ( ctx . replypath )
{ //we sent a request, got a valid response... now we need the actual final result... which may take a while...
Cmd_AddTimer ( 0.2 , FS_DBus_Poll , 0 , & ctx , sizeof ( ctx ) ) ;
return ;
}
Z_Free ( ctx . replypath ) ;
dbus_connection_close ( ctx . conn ) ;
}
# endif