scr_fov_mode 4 is now the default, to better match other quake engines (reverting to vertical fov when in portrait mode.

Fix cfg_save trying to use a hardcoded path that doesn't exist.
Change the 'play' command to use chan_auto instead of -1. I don't know why it was ever -1. This makes it more consistent with ezquake (where the feature is often abused to avoid ezquake's protocol limits or mvdsv's lack of unicast sounds).


git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5403 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2019-02-20 17:21:10 +00:00
parent 3250de5851
commit 519630045c
5 changed files with 41 additions and 50 deletions

View File

@ -75,7 +75,9 @@ qboolean Master_MasterProtocolIsEnabled(enum masterprotocol_e protocol)
#ifdef HAVE_SERVER
static void QDECL Net_Masterlist_Callback(struct cvar_s *var, char *oldvalue);
#ifndef NOLEGACY
static void SV_SetMaster_f (void);
#endif
#else
#define Net_Masterlist_Callback NULL
#endif
@ -533,6 +535,7 @@ void SV_Master_Heartbeat (void)
}
}
#ifndef NOLEGACY
static void SV_Master_Add(int type, char *stringadr)
{
int i;
@ -556,7 +559,7 @@ static void SV_Master_Add(int type, char *stringadr)
svs.last_heartbeat = -99999;
}
void SV_Master_ClearAll(void)
static void SV_Master_ClearAll(void)
{
int i;
for (i = 0; net_masterlist[i].cv.name; i++)
@ -565,7 +568,6 @@ void SV_Master_ClearAll(void)
}
}
#ifndef NOLEGACY
/*
====================
SV_SetMaster_f

View File

@ -231,7 +231,7 @@ cvar_t scr_conalpha = CVARC ("scr_conalpha", "0.7",
Cvar_Limiter_ZeroToOne_Callback);
cvar_t scr_consize = CVAR ("scr_consize", "0.5");
cvar_t scr_conspeed = CVAR ("scr_conspeed", "2000");
cvar_t scr_fov_mode = CVARFD ("scr_fov_mode", "0", CVAR_ARCHIVE, "Controls what the fov cvar actually controls:\n0: largest axis (ultra-wide monitors means less height will be visible).\n1: smallest axis (ultra-wide monitors will distort at the edges).\n2: horizontal axis.\n3: vertical axis.\n4: horizontally-padded 4:3");
cvar_t scr_fov_mode = CVARFD ("scr_fov_mode", "4", CVAR_ARCHIVE, "Controls what the fov cvar actually controls:\n0: largest axis (ultra-wide monitors means less height will be visible).\n1: smallest axis (ultra-wide monitors will distort at the edges).\n2: horizontal axis.\n3: vertical axis.\n4: 4:3 horizontal axis, padded for wider resolutions (for a more classic fov)");
cvar_t scr_fov = CVARFCD("fov", "90", CVAR_ARCHIVE, SCR_Fov_Callback,
"field of vision, 1-170 degrees, standard fov is 90, nquake defaults to 108.");
cvar_t scr_fov_viewmodel = CVARFD("r_viewmodel_fov", "", CVAR_ARCHIVE,

View File

@ -27,8 +27,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
extern world_t csqc_world;
#endif
static void S_Play(void);
static void S_PlayVol(void);
static void S_Play_f(void);
static void S_SoundList_f(void);
#ifdef HAVE_MIXER
static void S_Update_(soundcardinfo_t *sc);
@ -2212,9 +2211,9 @@ void S_Init (void)
Con_DPrintf("\nSound Initialization\n");
Cmd_AddCommand("play", S_Play);
Cmd_AddCommand("play2", S_Play);
Cmd_AddCommand("playvol", S_PlayVol);
Cmd_AddCommand("play", S_Play_f); //sound that doesn't follow the player
Cmd_AddCommand("play2", S_Play_f); //sound that DOES follow the player
Cmd_AddCommand("playvol", S_Play_f);
Cmd_AddCommand("stopsound", S_StopAllSounds_f);
Cmd_AddCommand("soundlist", S_SoundList_f);
Cmd_AddCommand("soundinfo", S_SoundInfo_f);
@ -3884,34 +3883,27 @@ console functions
===============================================================================
*/
void S_Play(void)
void S_Play_f(void)
{ //plays a sound located around the player
int i;
char name[256];
sfx_t *sfx;
const char *cmdname = Cmd_Argv(0);
float vol, attenuation = 0;
unsigned int flags = CF_NOSPACIALISE;
int entnum = 0;
float *origin = NULL;
i = 1;
while (i<Cmd_Argc())
/* //Vanilla compat (breaks modern QW mods):
if (!strcmp(cmdname, "play"))
{
if (!Q_strrchr(Cmd_Argv(i), '.'))
{
Q_strncpyz(name, Cmd_Argv(i), sizeof(name)-4);
Q_strcat(name, ".wav");
}
else
Q_strncpyz(name, Cmd_Argv(i), sizeof(name));
sfx = S_PrecacheSound(name);
S_StartSound(0, -1, sfx, NULL, NULL, 1.0, 0.0, 0, 0, CF_NOSPACIALISE);
i++;
flags = 0;
attenuation = 1;
origin = listener[0].origin;
entnum = listener[0].entnum;
}
}
void S_PlayVol(void)
{
int i;
float vol;
char name[256];
sfx_t *sfx;
*/
i = 1;
while (i<Cmd_Argc())
@ -3923,10 +3915,14 @@ void S_PlayVol(void)
}
else
Q_strncpyz(name, Cmd_Argv(i), sizeof(name));
i++;
sfx = S_PrecacheSound(name);
vol = Q_atof(Cmd_Argv(i+1));
S_StartSound(0, -1, sfx, NULL, NULL, vol, 0.0, 0, 0, CF_NOSPACIALISE);
i+=2;
if (!strcmp(cmdname, "playvol"))
vol = Q_atof(Cmd_Argv(i++));
else
vol = 1.0;
S_StartSound(entnum, 0, sfx, origin, NULL, vol, attenuation, 0, 0, flags);
}
}

View File

@ -1258,9 +1258,14 @@ restart:
}
break;
case 4: //wide 4:3
*y = tan(scr_fov.value * M_PI / 360.0) * (3.0 / 4.0);
*x = *y * (float)w / (float)h;
case 4: //wide 4:3, to match vanilla more closely.
if (w/4 < h/3)
{ //don't bug out if they're running on a tall screen
mode = 3;
goto restart;
}
*y = tan(afov * M_PI / 360.0) * (3.0 / 4.0);
*x = *y * w / h;
*x = atan(*x) * (360.0 / M_PI);
*y = atan(*y) * (360.0 / M_PI);
break;

View File

@ -1768,7 +1768,6 @@ qboolean FS_NativePath(const char *fname, enum fs_relative relativeto, char *out
last = fs_manifest->gamepath[i].path;
if (*last == '*')
last++;
break;
}
}
if (!last)
@ -1955,14 +1954,15 @@ vfsfile_t *QDECL FS_OpenVFS(const char *filename, const char *mode, enum fs_rela
if (vfs || !(*mode == 'w' || *mode == 'a'))
return vfs;
//fall through
case FS_PUBGAMEONLY:
case FS_PUBGAMEONLY: //used for $gamedir/downloads
case FS_BASEGAMEONLY: //used for fte/configs/*
case FS_PUBBASEGAMEONLY: //used for qw/skins/*
if (!FS_NativePath(filename, relativeto, fullname, sizeof(fullname)))
return NULL;
if (*mode == 'w')
COM_CreatePath(fullname);
return VFSOS_Open(fullname, mode);
case FS_GAME: //load from paks in preference to system paths. overwriting be damned.
case FS_PUBBASEGAMEONLY: //load from paks in preference to system paths. overwriting be damned.
if (!FS_NativePath(filename, relativeto, fullname, sizeof(fullname)))
return NULL;
break;
@ -1986,18 +1986,6 @@ vfsfile_t *QDECL FS_OpenVFS(const char *filename, const char *mode, enum fs_rela
if (!try_snprintf(fullname, sizeof(fullname), "%s%s", com_gamepath, filename))
return NULL;
return VFSOS_Open(fullname, mode);
case FS_BASEGAMEONLY: //always bypass packs+pure.
if (com_homepathenabled)
{
if (!try_snprintf(fullname, sizeof(fullname), "%sfte/%s", com_homepath, filename))
return NULL;
vfs = VFSOS_Open(fullname, mode);
if (vfs)
return vfs;
}
if (!try_snprintf(fullname, sizeof(fullname), "%sfte/%s", com_gamepath, filename))
return NULL;
return VFSOS_Open(fullname, mode);
default:
Sys_Error("FS_OpenVFS: Bad relative path (%i)", relativeto);
break;