fix some of the things that baker didn't like. sorry it took so long.
try to appease msvc6, just because. update the downloads menu. now even betterer!... fix proquake server angle snapping precision issue. also accept _glow textures as an alternative to the more standard _luma. compat for dp_water shader terms. tcgen stuff is still fscked up. menu tooltip code can now properly deal with variable width etc stuff. add missing te_flamejet builtin. r_dynamic -1 can now cope with q3bsp for a small speedup. added -watch commandline arg, to make it easier to figure out where cvar changes are coming from. git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5015 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
8d2af6ff7b
commit
c08a0aa139
104 changed files with 3629 additions and 2828 deletions
|
@ -859,7 +859,7 @@ unsigned int WINAPI BlockingClient(FTPclient_t *cl)
|
|||
unsigned long _false = false;
|
||||
if (ioctlsocket (cl->controlsock, FIONBIO, &_false) == -1)
|
||||
{
|
||||
IWebPrintf ("FTP_ServerRun: blocking error: %s\n", strerror(qerrno));
|
||||
IWebPrintf ("FTP_ServerRun: blocking error: %s\n", strerror(neterrno()));
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -1425,6 +1425,19 @@ qboolean DL_CreateThread(struct dl_download *dl, vfsfile_t *file, void (*NotifyF
|
|||
|
||||
return true;
|
||||
}
|
||||
#else
|
||||
qboolean DL_CreateThread(struct dl_download *dl, vfsfile_t *file, void (*NotifyFunction)(struct dl_download *dl))
|
||||
{
|
||||
if (!dl)
|
||||
return false;
|
||||
|
||||
if (file)
|
||||
dl->file = file;
|
||||
if (NotifyFunction)
|
||||
dl->notifycomplete = NotifyFunction;
|
||||
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*create a standalone download context*/
|
||||
|
|
|
@ -523,19 +523,26 @@ cont:
|
|||
cl->file = IWebGenerateFile(resource+1, content, contentlen);
|
||||
else
|
||||
{
|
||||
char filename[MAX_OSPATH], *q;
|
||||
cl->file = NULL;
|
||||
if (SV_AllowDownload(resource+1))
|
||||
Q_strncpyz(filename, resource+1, sizeof(filename));
|
||||
q = strchr(filename, '?');
|
||||
if (q) *q = 0;
|
||||
|
||||
if (SV_AllowDownload(filename))
|
||||
{
|
||||
char nbuf[MAX_OSPATH];
|
||||
if (cl->acceptgzip && strlen(resource+1) < sizeof(nbuf)-4)
|
||||
|
||||
if (cl->acceptgzip && strlen(filename) < sizeof(nbuf)-4)
|
||||
{
|
||||
sprintf(nbuf, "%s.gz", resource+1);
|
||||
Q_strncpyz(nbuf, filename, sizeof(nbuf));
|
||||
Q_strncatz(nbuf, ".gz", sizeof(nbuf));
|
||||
cl->file = FS_OpenVFS(nbuf, "rb", FS_GAME);
|
||||
}
|
||||
if (cl->file)
|
||||
gzipped = true;
|
||||
else
|
||||
cl->file = FS_OpenVFS(resource+1, "rb", FS_GAME);
|
||||
cl->file = FS_OpenVFS(filename, "rb", FS_GAME);
|
||||
}
|
||||
|
||||
if (!cl->file)
|
||||
|
@ -695,7 +702,12 @@ void VARGS Q_snprintfz (char *dest, size_t size, const char *fmt, ...)
|
|||
{
|
||||
va_list args;
|
||||
va_start (args, fmt);
|
||||
#ifdef _WIN32
|
||||
#undef _vsnprintf
|
||||
_vsnprintf (dest, size-1, fmt, args);
|
||||
#else
|
||||
vsnprintf (dest, size-1, fmt, args);
|
||||
#endif
|
||||
va_end (args);
|
||||
//make sure its terminated.
|
||||
dest[size-1] = 0;
|
||||
|
|
|
@ -8,6 +8,12 @@
|
|||
|
||||
qboolean SV_AllowDownload (const char *name)
|
||||
{
|
||||
if (strstr(name, ".."))
|
||||
return false;
|
||||
if (strchr(name, ':'))
|
||||
return false;
|
||||
if (*name == '/' || *name == '\\')
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
char com_token[sizeof(com_token)];
|
||||
|
@ -120,12 +126,18 @@ int main(int argc, char **argv)
|
|||
}
|
||||
|
||||
#ifdef _WIN32
|
||||
#ifdef _MSC_VER
|
||||
#define ULL(x) x##ui64
|
||||
#else
|
||||
#define ULL(x) x##ull
|
||||
#endif
|
||||
|
||||
static time_t Sys_FileTimeToTime(FILETIME ft)
|
||||
{
|
||||
ULARGE_INTEGER ull;
|
||||
ull.LowPart = ft.dwLowDateTime;
|
||||
ull.HighPart = ft.dwHighDateTime;
|
||||
return ull.QuadPart / 10000000ULL - 11644473600ULL;
|
||||
return ull.QuadPart / ULL(10000000) - ULL(11644473600);
|
||||
}
|
||||
void COM_EnumerateFiles (const char *match, int (*func)(const char *, qofs_t, time_t mtime, void *, searchpathfuncs_t *f), void *parm)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue