mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-29 15:41:59 +00:00
Move screenshots to $fs_userpath/QF.
I got tired of screenshots getting scatter across the tree. ShotsPath in the dirconf can override this.
This commit is contained in:
parent
91cb875115
commit
b13a2b6dbd
7 changed files with 13 additions and 4 deletions
|
@ -93,6 +93,9 @@ Supported attributes are:
|
||||||
<dt><code>MapPath</code></dt>
|
<dt><code>MapPath</code></dt>
|
||||||
<dd>Where to look for maps. Defaults to
|
<dd>Where to look for maps. Defaults to
|
||||||
<code>\${path}/maps</code>.</dd>
|
<code>\${path}/maps</code>.</dd>
|
||||||
|
<dt><code>ShotsPath</code></dt>
|
||||||
|
<dd>Where to write screenshots. Defaults to
|
||||||
|
<code>QF</code>.</dd>
|
||||||
</dl>
|
</dl>
|
||||||
|
|
||||||
Attribute allow variable substitution. Variables can take the form of
|
Attribute allow variable substitution. Variables can take the form of
|
||||||
|
|
|
@ -64,6 +64,7 @@ typedef struct gamedir_s {
|
||||||
const char *models; ///< directory to which to write models
|
const char *models; ///< directory to which to write models
|
||||||
const char *sound; ///< directory to which to write sounds
|
const char *sound; ///< directory to which to write sounds
|
||||||
const char *maps; ///< directory to which to write maps
|
const char *maps; ///< directory to which to write maps
|
||||||
|
const char *shots; ///< directory to which to write screenshots
|
||||||
} dir;
|
} dir;
|
||||||
} gamedir_t;
|
} gamedir_t;
|
||||||
|
|
||||||
|
|
|
@ -338,6 +338,8 @@ qfs_get_gd_params (plitem_t *gdpl, gamedir_t *gamedir, dstring_t *path,
|
||||||
gamedir->dir.sound = qfs_var_subst (PL_String (p), vars);
|
gamedir->dir.sound = qfs_var_subst (PL_String (p), vars);
|
||||||
if (!gamedir->dir.maps && (p = PL_ObjectForKey (gdpl, "MapPath")))
|
if (!gamedir->dir.maps && (p = PL_ObjectForKey (gdpl, "MapPath")))
|
||||||
gamedir->dir.maps = qfs_var_subst (PL_String (p), vars);
|
gamedir->dir.maps = qfs_var_subst (PL_String (p), vars);
|
||||||
|
if (!gamedir->dir.shots && (p = PL_ObjectForKey (gdpl, "ShotsPath")))
|
||||||
|
gamedir->dir.shots = qfs_var_subst (PL_String (p), vars);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -550,6 +552,8 @@ qfs_build_gamedir (const char **list)
|
||||||
gamedir->dir.sound = nva ("%s/sound", gamedir->dir.def);
|
gamedir->dir.sound = nva ("%s/sound", gamedir->dir.def);
|
||||||
if (!gamedir->dir.maps)
|
if (!gamedir->dir.maps)
|
||||||
gamedir->dir.maps = nva ("%s/maps", gamedir->dir.def);
|
gamedir->dir.maps = nva ("%s/maps", gamedir->dir.def);
|
||||||
|
if (!gamedir->dir.shots)
|
||||||
|
gamedir->dir.shots = strdup ("QF");
|
||||||
|
|
||||||
qfs_gamedir = gamedir;
|
qfs_gamedir = gamedir;
|
||||||
Sys_MaskPrintf (SYS_FS, "%s\n", qfs_gamedir->name);
|
Sys_MaskPrintf (SYS_FS, "%s\n", qfs_gamedir->name);
|
||||||
|
|
|
@ -138,7 +138,7 @@ SCR_ScreenShot_f (void)
|
||||||
|
|
||||||
// find a file name to save it to
|
// find a file name to save it to
|
||||||
if (!QFS_NextFilename (pcxname,
|
if (!QFS_NextFilename (pcxname,
|
||||||
va ("%s/qf", qfs_gamedir->dir.def), ".tga")) {
|
va ("%s/qf", qfs_gamedir->dir.shots), ".tga")) {
|
||||||
Sys_Printf ("SCR_ScreenShot_f: Couldn't create a TGA file\n");
|
Sys_Printf ("SCR_ScreenShot_f: Couldn't create a TGA file\n");
|
||||||
} else {
|
} else {
|
||||||
buffer = malloc (vid.width * vid.height * 3);
|
buffer = malloc (vid.width * vid.height * 3);
|
||||||
|
|
|
@ -217,7 +217,8 @@ SCR_ScreenShot_f (void)
|
||||||
int size, i;
|
int size, i;
|
||||||
|
|
||||||
// find a file name to save it to
|
// find a file name to save it to
|
||||||
if (!QFS_NextFilename (name, va ("%s/qf", qfs_gamedir->dir.def), ".png")) {
|
if (!QFS_NextFilename (name,
|
||||||
|
va ("%s/qf", qfs_gamedir->dir.shots), ".png")) {
|
||||||
Sys_Printf ("SCR_ScreenShot_f: Couldn't create a PNG file\n");
|
Sys_Printf ("SCR_ScreenShot_f: Couldn't create a PNG file\n");
|
||||||
} else {
|
} else {
|
||||||
size = vid.width * vid.height;
|
size = vid.width * vid.height;
|
||||||
|
|
|
@ -161,7 +161,7 @@ SCR_ScreenShot_f (void)
|
||||||
|
|
||||||
// find a file name to save it to
|
// find a file name to save it to
|
||||||
if (!QFS_NextFilename (pcxname,
|
if (!QFS_NextFilename (pcxname,
|
||||||
va ("%s/qf", qfs_gamedir->dir.def), ".pcx")) {
|
va ("%s/qf", qfs_gamedir->dir.shots), ".pcx")) {
|
||||||
Sys_Printf ("SCR_ScreenShot_f: Couldn't create a PCX");
|
Sys_Printf ("SCR_ScreenShot_f: Couldn't create a PCX");
|
||||||
} else {
|
} else {
|
||||||
// enable direct drawing of console to back buffer
|
// enable direct drawing of console to back buffer
|
||||||
|
|
|
@ -170,7 +170,7 @@ SCR_ScreenShot_f (void)
|
||||||
|
|
||||||
// find a file name to save it to
|
// find a file name to save it to
|
||||||
if (!QFS_NextFilename (pcxname,
|
if (!QFS_NextFilename (pcxname,
|
||||||
va ("%s/qf", qfs_gamedir->dir.def), ".pcx")) {
|
va ("%s/qf", qfs_gamedir->dir.shots), ".pcx")) {
|
||||||
Sys_Printf ("SCR_ScreenShot_f: Couldn't create a PCX");
|
Sys_Printf ("SCR_ScreenShot_f: Couldn't create a PCX");
|
||||||
} else {
|
} else {
|
||||||
// enable direct drawing of console to back buffer
|
// enable direct drawing of console to back buffer
|
||||||
|
|
Loading…
Reference in a new issue