make some tweaks to fix some model skin issues.

tweak manifest package lines to support key/value argument pairs for extensibility. unrecognised args are still assumed to be mirrors.
package lines can now contain condition "CONDITIONSTRING" pair, a (quoted) equivalent to the if console command. fps presets now do a fs_restart in order to give the filesystem a chance to download any new packages.
fix svc_finale bug resulting in corrupted svc_cdtracks.
change q1mdl code to use the same shader names as dp does. expect issues with dodgy shaders.
fix animmap to support float framerates.
fix 'if (a&&b) then' logic.

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4984 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2015-09-07 14:34:39 +00:00
parent 390d42d694
commit cc414506a8
14 changed files with 262 additions and 116 deletions

View File

@ -411,8 +411,8 @@ PROFILE_CFLAGS=-pg
DX7SDK=-I./libs/dxsdk7/include/
GLCFLAGS=-DGLQUAKE
D3DCFLAGS=-DD3D9QUAKE
GLCFLAGS?=-DGLQUAKE
D3DCFLAGS?=-DD3D9QUAKE
NPFTECFLAGS=-DNPFTE
SPEEXCFLAGS=-DSPEEX_STATIC -I$(BASE_DIR)/libs/speex/include -DFIXED_POINT -DUSE_KISS_FFT -DEXPORT=""

View File

@ -3467,6 +3467,7 @@ void CL_LinkPacketEntities (void)
#endif
ent->light_known = 0;
ent->forcedshader = NULL;
ent->shaderTime = 0;
memset(&ent->framestate, 0, sizeof(ent->framestate));

View File

@ -5162,6 +5162,7 @@ void CL_StartCinematicOrMenu(void)
else if (idcin_depth != 0x7fffffff)
Media_PlayFilm("video/idlog.cin", true);
#ifndef NOLEGACY
//and for fun:
if (COM_FCheckExists("data/local/video/New_Bliz640x480.bik"))
Media_PlayFilm("av:data/local/video/New_Bliz640x480.bik", true);
@ -5171,6 +5172,7 @@ void CL_StartCinematicOrMenu(void)
Media_PlayFilm("av:data/local/video/eng/d2intro640x292.bik", true);
if (COM_FCheckExists("Data/Local/Video/ENG/D2x_Intro_640x292.bik"))
Media_PlayFilm("av:Data/Local/Video/ENG/D2x_Intro_640x292.bik", true);
#endif
}
#endif

View File

@ -832,7 +832,7 @@ static void ApplyPreset (int presetnum)
//this function is written backwards, to ensure things work properly in configs etc.
// TODO: work backwards and only set cvars once
Cbuf_InsertText("vid_reload\n", RESTRICT_LOCAL, true);
Cbuf_InsertText("\nfs_restart\nvid_reload\n", RESTRICT_LOCAL, true);
for (i = presetnum; i >= 0; i--)
{
Cbuf_InsertText(presetexec[i], RESTRICT_LOCAL, true);
@ -905,7 +905,7 @@ void FPS_Preset_f (void)
{
char buffer[MAX_OSPATH];
COM_QuotedString(presetfname, buffer, sizeof(buffer), false);
Cbuf_AddText(va("\nexec %s\n", buffer), RESTRICT_LOCAL);
Cbuf_AddText(va("\nexec %s\nfs_restart\n", buffer), RESTRICT_LOCAL);
return;
}

View File

@ -321,7 +321,7 @@ void Host_InitCommands (void);
void Host_Init (quakeparms_t *parms);
void Host_FinishInit(void);
void Host_Shutdown(void);
qboolean com_workererror; //supresses shutdown prints+threads
extern qboolean com_workererror; //supresses shutdown prints+threads
NORETURN void VARGS Host_Error (char *error, ...) LIKEPRINTF(1);
NORETURN void VARGS Host_EndGame (char *message, ...) LIKEPRINTF(1);
qboolean Host_SimulationTime(float time);

View File

@ -2388,6 +2388,16 @@ qboolean is_numeric (const char *c)
((*c == '-' || *c == '+') && (c[1] == '.' || (c[1]>='0' && c[1]<='9'))) ||
(*c == '.' && (c[1]>='0' && c[1]<='9'))?true:false;
}
qboolean is_true (const char *c)
{
if (is_numeric(c))
return !!atof(c);
if (!Q_strcasecmp(c, "true") || !Q_strcasecmp(c, "yes"))
return true;
if (!Q_strcasecmp(c, "false") || !Q_strcasecmp(c, "no") || !Q_strcasecmp(c, "null") || !Q_strcasecmp(c, "nil"))
return false;
return !!*c;
}
#define IFPUNCT "(,{})(\':;=!><&|+*/-"
const char *If_Token(const char *func, const char **end)
{
@ -2446,26 +2456,26 @@ const char *If_Token(const char *func, const char **end)
func = If_Token(s, end);
for (s = func; *s; s++);
if (func && *func)
return "";
s2 = "";
else
return "true";
s2 = "true";
}
else if (!strcmp(com_token, "int"))
{
func = If_Token(s, end);
return retint(atoi(func));
s2 = retint(atoi(func));
}
else if (!strcmp(com_token, "strlen"))
{
func = If_Token(s, end);
return retfloat(strlen(func));
s2 = retfloat(strlen(func));
}
else if (!strcmp(com_token, "defined")) //functions
{
s = COM_ParseToken(s, IFPUNCT);
var = Cvar_FindVar(com_token);
*end = s;
return retstring((var != NULL)?"true":"");
s2 = retstring((var != NULL)?"true":"");
}
else if (!strcmp(com_token, "random"))
{
@ -2586,7 +2596,7 @@ const char *If_Token(const char *func, const char **end)
{
func=COM_ParseToken(s, IFPUNCT);
if (*com_token == '&')
return retfloat(*s2&&*If_Token(s, end));
return retfloat(is_true(s2)&&is_true(If_Token(func, end)));
else
return retfloat(atoi(s2)&atoi(If_Token(s, end)));
}
@ -2602,10 +2612,7 @@ const char *If_Token(const char *func, const char **end)
{
func=COM_ParseToken(s, IFPUNCT);
if (*com_token == '|')
{
func = If_Token(func, end);
return retfloat(atoi(s2)||atoi(func));
}
return retfloat(is_true(s2)||is_true(If_Token(func, end)));
else
return retfloat(atoi(s2)|atoi(If_Token(s, end)));
}
@ -2613,6 +2620,20 @@ const char *If_Token(const char *func, const char **end)
return s2;
}
qboolean If_EvaluateBoolean(const char *text, int restriction)
{
qboolean ret;
const char *end;
tempstack_t *ts = If_Token_GetMark();
int restore = Cmd_ExecLevel;
Cmd_ExecLevel = restriction;
text = If_Token(text, &end);
ret = is_true(text);
If_Token_Clear(ts);
Cmd_ExecLevel = restore;
return ret;
}
void Cbuf_ExecBlock(int level)
{
char *remainingcbuf;

View File

@ -162,6 +162,7 @@ void Cmd_MessageTrigger (char *message, int type);
void Cmd_ShiftArgs (int ammount, qboolean expandstring);
char *Cmd_ExpandString (char *data, char *dest, int destlen, int maxaccesslevel, qboolean expandcvars, qboolean expandmacros);
qboolean If_EvaluateBoolean(const char *text, int restriction);
extern cvar_t rcon_level;

View File

@ -3138,7 +3138,7 @@ static void *Q1_LoadSkins_GL (model_t *loadmodel, daliasskintype_t *pskintype, u
frames[0].shader = NULL;
frames[0].defaultshader = NULL;
Q_snprintfz(frames[0].shadername, sizeof(frames[0].shadername), "%s_%i.lmp", basename, i);
Q_snprintfz(frames[0].shadername, sizeof(frames[0].shadername), "%s_%i.lmp", loadmodel->name, i);
Q_snprintfz(skinname, sizeof(skinname), "%s_%i.lmp", slash, i);
frames[0].texnums.base = R_LoadReplacementTexture(skinname, alttexpath, texflags, frames[0].texels, outskin->skinwidth, outskin->skinheight, skintranstype);
@ -3255,7 +3255,7 @@ static void *Q1_LoadSkins_GL (model_t *loadmodel, daliasskintype_t *pskintype, u
Q_snprintfz(skinname, sizeof(skinname), "%s_%i_%i_pants.lmp", slash, i, t);
frames[t].texnums.loweroverlay = R_LoadReplacementTexture(skinname, alttexpath, texflags, NULL, outskin->skinwidth, outskin->skinheight, TF_INVALID);
Q_snprintfz(frames[t].shadername, sizeof(frames[t].shadername), "%s_%i_%i.lmp", basename, i, t);
Q_snprintfz(frames[t].shadername, sizeof(frames[t].shadername), "%s_%i_%i.lmp", loadmodel->name, i, t);
frames[t].defaultshader = NULL;
}
pskintype = (daliasskintype_t *)data;

View File

@ -540,14 +540,18 @@ enum manifestdeptype_e
{
mdt_invalid,
mdt_singlepackage, //regular package, versioned.
mdt_installation //allowed to install to the root.
mdt_installation //allowed to install to the root, only downloaded as part of an initial install.
};
typedef struct
{
qboolean blockupdate; //set to block the updateurl from being used this session. this avoids recursive updates when manifests contain the same update url.
qboolean doinstall; //manifest was embedded in the engine. don't assume its already installed, but ask to install it (also, enable some extra permissions for writing dlls)
int parsever;
enum
{
MANIFEST_UNSPECIFIED=0,
MANIFEST_CURRENTVER
} parsever;
int minver; //if the engine svn revision is lower than this, the manifest will not be used as an 'upgrade'.
int maxver; //if not 0, the manifest will not be used
qboolean disablehomedir;
@ -569,8 +573,8 @@ typedef struct
char *path; //the 'pure' name
qboolean crcknown; //if the crc was specified
unsigned int crc; //the public crc
char *extractname; //if specified, this is the filename that should be extracted.
char *mirrors[8]; //a randomized (prioritized-on-load) list of http mirrors to use.
char *mirrors[8]; //a randomized (prioritized-on-load) list of mirrors to use. (may be 'prompt:game,package', 'unzip:file,url', 'xz:url', 'gz:url'
char *condition; //only downloaded if this cvar is set | delimited allows multiple cvars.
int mirrornum; //the index we last tried to download from, so we still work even if mirrors are down.
} package[64];
} ftemanifest_t;

View File

@ -12,6 +12,7 @@
#include "winquake.h"
#endif
void FS_BeginManifestUpdates(void);
static void QDECL fs_game_callback(cvar_t *var, char *oldvalue);
hashtable_t filesystemhash;
qboolean com_fschanged = true;
@ -214,7 +215,7 @@ void FS_Manifest_Free(ftemanifest_t *man)
for (i = 0; i < sizeof(man->package) / sizeof(man->package[0]); i++)
{
Z_Free(man->package[i].path);
Z_Free(man->package[i].extractname);
Z_Free(man->package[i].condition);
for (j = 0; j < sizeof(man->package[i].mirrors) / sizeof(man->package[i].mirrors[0]); j++)
Z_Free(man->package[i].mirrors[j]);
}
@ -251,8 +252,8 @@ static ftemanifest_t *FS_Manifest_Clone(ftemanifest_t *oldm)
{
if (oldm->package[i].path)
newm->package[i].path = Z_StrDup(oldm->package[i].path);
if (oldm->package[i].extractname)
newm->package[i].extractname = Z_StrDup(oldm->package[i].extractname);
if (oldm->package[i].condition)
newm->package[i].condition = Z_StrDup(oldm->package[i].condition);
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]);
@ -293,14 +294,15 @@ void FS_Manifest_Print(ftemanifest_t *man)
{
if (man->package[i].path)
{
if (man->package[i].extractname)
Con_Printf("archived");
if (man->package[i].crcknown)
Con_Printf("package %s 0x%x", COM_QuotedString(man->package[i].path, buffer, sizeof(buffer), false), man->package[i].crc);
if (man->package[i].type == mdt_installation)
Con_Printf("library ");
else
Con_Printf("package %s -", COM_QuotedString(man->package[i].path, buffer, sizeof(buffer), false));
if (man->package[i].extractname)
Con_Printf(" %s", COM_QuotedString(man->package[i].extractname, buffer, sizeof(buffer), false));
Con_Printf("package ");
Con_Printf("%s", COM_QuotedString(man->package[i].path, buffer, sizeof(buffer), false));
if (man->package[i].condition)
Con_Printf(" condition=%s", COM_QuotedString(man->package[i].condition, buffer, sizeof(buffer), false));
if (man->package[i].crcknown)
Con_Printf(" crc=0x%x", man->package[i].crc);
for (j = 0; j < sizeof(man->package[i].mirrors) / sizeof(man->package[i].mirrors[0]); j++)
if (man->package[i].mirrors[j])
Con_Printf(" %s", COM_QuotedString(man->package[i].mirrors[j], buffer, sizeof(buffer), false));
@ -332,43 +334,121 @@ static ftemanifest_t *FS_Manifest_Create(const char *syspath)
man->formalname = Z_StrDup(FULLENGINENAME);
#ifdef _DEBUG //FOR TEMPORARY TESTING ONLY.
// man->doinstall = true;
#endif
if (syspath)
man->updatefile = Z_StrDup(syspath); //this should be a system path.
return man;
}
static qboolean FS_Manifest_ParsePackage(ftemanifest_t *man, int type, char *path, unsigned int crc, qboolean crcknown, char *extractname, unsigned int mirrorarg)
static qboolean FS_Manifest_ParsePackage(ftemanifest_t *man, int type)
{
char *path = "";
unsigned int crc = 0;
qboolean crcknown = false;
char *legacyextractname = NULL;
char *condition = NULL;
char *arch = NULL;
unsigned int arg = 1;
unsigned int mirrors = 0;
char *mirror[countof(man->package[0].mirrors)];
size_t i, j;
if (type == mdt_singlepackage)
char *a;
a = Cmd_Argv(0);
if (!Q_strcasecmp(a, "filedependancies") || !Q_strcasecmp(a, "archiveddependancies"))
arch = Cmd_Argv(arg++);
path = Cmd_Argv(arg++);
#ifndef NOLEGACY
a = Cmd_Argv(arg);
if (!strcmp(a, "-"))
{
if (!strchr(path, '/') || strchr(path, ':') || strchr(path, '\\'))
arg++;
}
else if (*a)
{
crc = strtoul(a, &a, 0);
if (!*a)
{
Con_Printf("invalid package path specified in manifest (%s)\n", path);
return false;
crcknown = true;
arg++;
}
}
for (i = 0; i < sizeof(man->package) / sizeof(man->package[0]); i++)
if (!strncmp(Cmd_Argv(0), "archived", 8))
legacyextractname = Cmd_Argv(arg++);
#endif
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++);
else if (!strcmp(a, "arch"))
arch = Cmd_Argv(arg++);
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))
Con_Printf("too many mirrors for package %s\n", path);
else if (legacyextractname)
{
if (!strcmp(legacyextractname, "xz") || !strcmp(legacyextractname, "gz"))
mirror[mirrors++] = Z_StrDup(va("%s:%s", legacyextractname, a));
else
mirror[mirrors++] = Z_StrDup(va("unzip:%s,%s", legacyextractname, a));
}
else
mirror[mirrors++] = Z_StrDup(a);
}
else if (man->parsever <= MANIFEST_CURRENTVER)
Con_Printf("unknown mirror / property %s for package %s\n", a, path);
}
for (i = 0; i < countof(man->package); i++)
{
if (!man->package[i].path)
{
if (type == mdt_singlepackage && (!strchr(path, '/') || strchr(path, ':') || strchr(path, '\\')))
{
Con_Printf("invalid package path specified in manifest (%s)\n", path);
break;
}
if (arch)
{
#ifdef PLATFORM
if (Q_strcasecmp(PLATFORM, arch))
#endif
break;
}
man->package[i].type = type;
man->package[i].path = Z_StrDup(path);
man->package[i].condition = condition?Z_StrDup(condition):NULL;
man->package[i].crcknown = crcknown;
man->package[i].crc = crc;
if (extractname)
man->package[i].extractname = Z_StrDup(extractname);
else
man->package[i].extractname = NULL;
for (j = 0; mirrorarg+j < Cmd_Argc() && j < sizeof(man->package[i].mirrors) / sizeof(man->package[i].mirrors[0]); j++)
{
man->package[i].mirrors[j] = Z_StrDup(Cmd_Argv(mirrorarg+j));
}
for (j = 0; j < mirrors; j++)
man->package[i].mirrors[j] = mirror[j];
return true;
}
}
Con_Printf("Too many packages specified in manifest\n");
if (i == countof(man->package))
Con_Printf("Too many packages specified in manifest\n");
for (j = 0; j < mirrors; j++)
Z_Free(mirror[j]);
return false;
}
@ -458,33 +538,19 @@ static qboolean FS_Manifest_ParseTokens(ftemanifest_t *man)
}
}
}
#ifndef NOLEGACY
else if (!Q_strcasecmp(cmd, "filedependancies") || !Q_strcasecmp(cmd, "archiveddependancies"))
{
int arg = 1;
char *arch = Cmd_Argv(arg++);
char *files = Cmd_Argv(arg++);
char *extract = (!Q_strncasecmp(cmd, "archived", 8))?Cmd_Argv(arg++):NULL;
#ifdef PLATFORM
//just ignore other archs
if (!Q_strcasecmp(arch, PLATFORM))
FS_Manifest_ParsePackage(man, mdt_installation, files, 0, false, extract, arg);
FS_Manifest_ParsePackage(man, mdt_installation);
else if (!Q_strcasecmp(cmd, "archivedpackage"))
FS_Manifest_ParsePackage(man, mdt_singlepackage);
#endif
}
else if (!Q_strcasecmp(cmd, "library"))
FS_Manifest_ParsePackage(man, mdt_installation);
else if (!Q_strcasecmp(cmd, "package") || !Q_strcasecmp(cmd, "archivedpackage"))
{
int arg = 1;
char *fname = Cmd_Argv(arg++);
qboolean crcknown = (strcmp(Cmd_Argv(arg), "-") && *Cmd_Argv(arg));
int crc = strtoul(Cmd_Argv(arg++), NULL, 0);
char *extract = (!Q_strncasecmp(cmd, "archived", 8))?Cmd_Argv(arg++):NULL;
FS_Manifest_ParsePackage(man, mdt_singlepackage, fname, crc, crcknown, extract, arg);
}
FS_Manifest_ParsePackage(man, mdt_singlepackage);
else
{
Con_Printf("Unknown token: %s %s\n", cmd, Cmd_Args());
Con_Printf("Unknown token: %s\n", cmd);
result = false;
}
return result;
@ -3252,6 +3318,8 @@ void FS_ReloadPackFiles_f(void)
FS_ReloadPackFilesFlags(~0);
Sys_UnlockMutex(fs_thread_mutex);
}
if (host_initialized)
FS_BeginManifestUpdates();
}
#if defined(_WIN32) && !defined(WINRT)
@ -3771,6 +3839,14 @@ static char *FS_RelativeURL(char *base, char *file, char *buffer, int bufferlen)
#ifdef WEBCLIENT
static struct dl_download *curpackagedownload;
static enum manifestdeptype_e fspdl_type;
static enum {
X_DLONLY,
X_COPY,
X_MULTIUNZIP,
X_UNZIP,
X_GZ,
X_XZ
} fspdl_extracttype;
static char fspdl_internalname[MAX_QPATH];
static char fspdl_temppath[MAX_OSPATH];
static char fspdl_finalpath[MAX_OSPATH];
@ -3907,13 +3983,13 @@ static void FS_PackageDownloaded(struct dl_download *dl)
//rename the file as needed.
COM_CreatePath(fspdl_finalpath);
if (*fspdl_internalname) //if zip...
if (fspdl_extracttype == X_UNZIP || fspdl_extracttype == X_MULTIUNZIP) //if zip...
{ //archive
searchpathfuncs_t *archive = FSZIP_LoadArchive(VFSOS_Open(fspdl_temppath, "rb"), dl->url);
if (archive)
{
flocation_t loc;
if (fspdl_type == mdt_installation)
if (fspdl_extracttype == X_MULTIUNZIP)
{
char *f = fspdl_internalname;
char *e;
@ -3979,9 +4055,21 @@ static qboolean FS_BeginPackageDownload(struct manpack_s *pack, char *baseurl, q
vfsfile_t *tmpf;
char buffer[MAX_OSPATH], *url;
if (pack->type == mdt_installation)
qboolean multiex = false;
//check this package's conditional
if (pack->condition)
{
if (!If_EvaluateBoolean(pack->condition, RESTRICT_LOCAL))
return false;
}
if (pack->type == mdt_installation)
{ //libraries are in the root directory. we allow extracting multiple of them from a zip, etc.
//they are not packages and thus do NOT support crcs.
char *s, *e;
if (!allownoncache) //don't even THINK about allowing the download unless its part of an initial install.
return false;
for (s = pack->path; *s; s = e)
{
while(*s == ':')
@ -4033,44 +4121,31 @@ static qboolean FS_BeginPackageDownload(struct manpack_s *pack, char *baseurl, q
if (pack->type == mdt_installation)
{
//extract-all is only allowed when we're ALREADY writing to the base dir.
//this should only be possible when the manifest was embedded in the exe.
if (!allownoncache)
if (!strchr(pack->path, ':'))
{
*fspdl_internalname = 0;
return false;
}
if (!pack->extractname)
{
FS_NativePath(pack->path, FS_ROOT, fspdl_finalpath, sizeof(fspdl_finalpath));
FS_NativePath(va("%s.tmp", pack->path), FS_ROOT, fspdl_temppath, sizeof(fspdl_temppath));
Q_strncpyz(fspdl_internalname, "", sizeof(fspdl_internalname));
if (!FS_NativePath(pack->path, FS_ROOT, fspdl_finalpath, sizeof(fspdl_finalpath)) ||
!FS_NativePath(va("%s.tmp", pack->path), FS_ROOT, fspdl_temppath, sizeof(fspdl_temppath)))
return false;
}
else
{
if (pack->extractname && *pack->extractname)
Q_strncpyz(fspdl_internalname, pack->extractname, sizeof(fspdl_internalname));
else
Q_strncpyz(fspdl_internalname, pack->path, sizeof(fspdl_internalname));
FS_NativePath("", FS_ROOT, fspdl_finalpath, sizeof(fspdl_finalpath));
FS_NativePath(va("%s.tmp", fs_manifest->installation), FS_ROOT, fspdl_temppath, sizeof(fspdl_temppath));
if (!FS_NativePath("", FS_ROOT, fspdl_finalpath, sizeof(fspdl_finalpath)) ||
!FS_NativePath(va("%s.tmp", fs_manifest->installation), FS_ROOT, fspdl_temppath, sizeof(fspdl_temppath)))
return false;
multiex = true;
}
}
else
{
if (pack->extractname)
Q_strncpyz(fspdl_internalname, pack->extractname, sizeof(fspdl_internalname));
else
Q_strncpyz(fspdl_internalname, "", sizeof(fspdl_internalname));
//figure out a temp name and figure out where we're going to get it from.
FS_NativePath(buffer, FS_ROOT, fspdl_finalpath, sizeof(fspdl_finalpath));
if (!FS_NativePath(buffer, FS_ROOT, fspdl_finalpath, sizeof(fspdl_finalpath)))
return false;
if (!pack->crcknown && allownoncache)
Q_strncpyz(buffer, va("%s.tmp", pack->path), sizeof(buffer));
else if (!FS_GenCachedPakName(va("%s.tmp", pack->path), crcstr, buffer, sizeof(buffer)))
return false;
FS_NativePath(buffer, FS_ROOT, fspdl_temppath, sizeof(fspdl_temppath));
if (!FS_NativePath(buffer, FS_ROOT, fspdl_temppath, sizeof(fspdl_temppath)))
return false;
}
url = NULL;
@ -4088,18 +4163,62 @@ static qboolean FS_BeginPackageDownload(struct manpack_s *pack, char *baseurl, q
if (!url)
return false;
fspdl_extracttype = X_DLONLY;
if (!strncmp(url, "gz:", 3))
{
url+=3;
fspdl_extracttype = X_GZ;
}
else if (!strncmp(url, "xz:", 3))
{
url+=3;
fspdl_extracttype = X_XZ;
}
else if (!strncmp(url, "unzip:", 6))
{
url+=6;
fspdl_extracttype = X_UNZIP;
}
else if (!strncmp(url, "prompt:", 7))
{
url+=7;
fspdl_extracttype = X_COPY;
}
else
fspdl_extracttype = X_DLONLY;
if (fspdl_extracttype == X_UNZIP || fspdl_extracttype == X_COPY)
{
char *o = fspdl_internalname;
while(o+1 < fspdl_internalname+sizeof(fspdl_internalname) && *url)
{
if (*url == ',')
{
url++;
break;
}
*o++ = *url++;
}
*o = 0;
}
else
*fspdl_internalname = 0;
if (multiex)
{
if (fspdl_extracttype != X_UNZIP && fspdl_extracttype != X_DLONLY)
return false; //multiunzip is only supported with unzip urls... (or assumed if its a direct download
fspdl_extracttype = X_MULTIUNZIP;
if (!*fspdl_internalname)
Q_strncpyz(fspdl_internalname, pack->path, sizeof(fspdl_internalname));
}
fspdl_type = pack->type;
if (!Q_strncasecmp(url, "prompt:", 7) && !*fspdl_internalname && fspdl_type != mdt_installation)
if (fspdl_extracttype == X_COPY)
{
char file[MAX_QPATH];
char *game;
Q_strncpyz(file, url+7, sizeof(file));
game = strchr(file, ',');
if (game)
*game++ = 0;
FS_PackagePrompt(fspdl_finalpath, file, game);
FS_PackagePrompt(fspdl_finalpath, url, fspdl_internalname);
return false;
}
@ -4108,25 +4227,24 @@ static qboolean FS_BeginPackageDownload(struct manpack_s *pack, char *baseurl, q
if (tmpf)
{
if (!strcmp(fspdl_internalname, "xz"))
switch(fspdl_extracttype)
{
case X_XZ:
#ifdef AVAIL_XZDEC
tmpf = FS_XZ_DecompressWriteFilter(tmpf);
#else
VFS_CLOSE(tmpf);
tmpf = NULL;
#endif
*fspdl_internalname = 0;
}
if (!strcmp(fspdl_internalname, "gz"))
{
break;
case X_GZ:
#ifdef AVAIL_ZLIB
tmpf = FS_GZ_DecompressWriteFilter(tmpf, true);
#else
VFS_CLOSE(tmpf);
tmpf = NULL;
#endif
*fspdl_internalname = 0;
break;
}
if (!tmpf)

View File

@ -73,7 +73,6 @@ void GLDraw_Init (void)
((int)vid.height - 48 - pic->height)/2, pic->width, pic->height, pic);
}
TRACE(("dbg: GLDraw_ReInit: GL_EndRendering\n"));
if (R2D_Flush)
R2D_Flush();
VID_SwapBuffers();

View File

@ -41,7 +41,7 @@ sh_config_t sh_config;
//cvars that affect shader generation
cvar_t r_vertexlight = CVARFD("r_vertexlight", "0", CVAR_SHADERSYSTEM, "Hack loaded shaders to remove detail pass and lightmap sampling for faster rendering.");
cvar_t r_forceprogramify = CVARAFD("r_forceprogramify", "0", "dpcompat_makeshitup", CVAR_SHADERSYSTEM, "Reduce the shader to a single texture, and then make stuff up about its mother. The resulting fist fight results in more colour when you shine a light upon its face.\nSet to 2 to ignore 'depthfunc equal' and 'tcmod scale' in order to tolerate bizzare shaders made for a bizzare engine.");
cvar_t r_forceprogramify = CVARAFD("r_forceprogramify", "0", "dpcompat_makeshitup", CVAR_SHADERSYSTEM, "Reduce the shader to a single texture, and then make stuff up about its mother. The resulting fist fight results in more colour when you shine a light upon its face.\nSet to 2 to ignore 'depthfunc equal' and 'tcmod scale' in order to tolerate bizzare shaders made for a bizzare engine.\nBecause most shaders made for DP are by people who _clearly_ have no idea what the heck they're doing, you'll typically need the '2' setting.");
extern cvar_t r_glsl_offsetmapping_reliefmapping;
extern cvar_t r_fastturb, r_fastsky, r_skyboxname;
extern cvar_t r_drawflat;
@ -2407,7 +2407,7 @@ static void Shaderpass_AnimMap (shader_t *shader, shaderpass_t *pass, char **ptr
pass->tcgen = TC_GEN_BASE;
pass->flags |= SHADER_PASS_ANIMMAP;
pass->texgen = T_GEN_ANIMMAP;
pass->anim_fps = (int)Shader_ParseFloat (shader, ptr, 0);
pass->anim_fps = Shader_ParseFloat (shader, ptr, 0);
pass->anim_numframes = 0;
for ( ; ; )

View File

@ -264,7 +264,6 @@ qboolean GLVID_Init (rendererstate_t *info, unsigned char *palette)
glClearColor(1.0f, 0.0f, 0.0f, 1.0f);
glClear(GL_COLOR_BUFFER_BIT);
GL_EndRendering();
GLVID_SwapBuffers();
// vid.pixelwidth = info->width;
@ -279,7 +278,6 @@ void GLVID_Shutdown (void)
{
glClearColor(1.0f, 0.0f, 0.0f, 1.0f);
glClear(GL_COLOR_BUFFER_BIT);
GL_EndRendering();
GLVID_SwapBuffers();
ppb_core->ReleaseResource(glcontext);

View File

@ -1013,6 +1013,7 @@ void NPP_NQWriteByte(int dest, qbyte data) //replacement write func (nq to qw)
break;
case svc_finale:
nullterms = 1;
protocollen = 2;
break;
case svcdp_skybox:
protocollen = 2;//it's just a string
@ -2001,6 +2002,7 @@ void NPP_QWWriteByte(int dest, qbyte data) //replacement write func (nq to qw)
break;
case svc_finale:
nullterms = 1;
protocollen = 2;
break;
case svc_updatepl:
case svc_muzzleflash: