mirror of
https://github.com/nzp-team/fteqw.git
synced 2025-02-16 17:01:44 +00:00
blurgh
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4859 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
edbe154e19
commit
1d72e710fa
6 changed files with 26 additions and 7 deletions
|
@ -5059,7 +5059,7 @@ void Host_FinishLoading(void)
|
||||||
"\n"
|
"\n"
|
||||||
"See the GNU General Public License for more details.\n");
|
"See the GNU General Public License for more details.\n");
|
||||||
|
|
||||||
#ifdef _WIN32
|
#if defined(_WIN32) && defined(WEBCLIENT)
|
||||||
if (Sys_RunInstaller())
|
if (Sys_RunInstaller())
|
||||||
Sys_Quit();
|
Sys_Quit();
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -851,7 +851,9 @@ static void VARGS png_onerror(png_structp png_ptr, png_const_charp error_msg)
|
||||||
static void VARGS png_onwarning(png_structp png_ptr, png_const_charp warning_msg)
|
static void VARGS png_onwarning(png_structp png_ptr, png_const_charp warning_msg)
|
||||||
{
|
{
|
||||||
struct pngerr *err = qpng_get_error_ptr(png_ptr);
|
struct pngerr *err = qpng_get_error_ptr(png_ptr);
|
||||||
|
#ifndef NPFTE
|
||||||
Con_DPrintf("libpng %s: %s\n", err->fname, warning_msg);
|
Con_DPrintf("libpng %s: %s\n", err->fname, warning_msg);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
qbyte *ReadPNGFile(qbyte *buf, int length, int *width, int *height, const char *fname)
|
qbyte *ReadPNGFile(qbyte *buf, int length, int *width, int *height, const char *fname)
|
||||||
|
@ -4393,6 +4395,7 @@ image_t *Image_GetTexture(const char *identifier, const char *subpath, unsigned
|
||||||
Image_LoadHiResTextureWorker(tex, NULL, 0, 0);
|
Image_LoadHiResTextureWorker(tex, NULL, 0, 0);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
#ifdef WEBCLIENT
|
||||||
if (!strncmp(tex->ident, "http://", 7) || !strncmp(tex->ident, "https://", 8))
|
if (!strncmp(tex->ident, "http://", 7) || !strncmp(tex->ident, "https://", 8))
|
||||||
{
|
{
|
||||||
struct dl_download *dl = HTTP_CL_Get(tex->ident, NULL, Image_Downloaded);
|
struct dl_download *dl = HTTP_CL_Get(tex->ident, NULL, Image_Downloaded);
|
||||||
|
@ -4405,7 +4408,9 @@ image_t *Image_GetTexture(const char *identifier, const char *subpath, unsigned
|
||||||
tex->status = TEX_FAILED; //HACK: so nothing waits for it.
|
tex->status = TEX_FAILED; //HACK: so nothing waits for it.
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
else if (lowpri)
|
else
|
||||||
|
#endif
|
||||||
|
if (lowpri)
|
||||||
COM_AddWork(5, Image_LoadHiResTextureWorker, tex, NULL, 0, 0);
|
COM_AddWork(5, Image_LoadHiResTextureWorker, tex, NULL, 0, 0);
|
||||||
else
|
else
|
||||||
COM_AddWork(2+(seq++%3), Image_LoadHiResTextureWorker, tex, NULL, 0, 0);
|
COM_AddWork(2+(seq++%3), Image_LoadHiResTextureWorker, tex, NULL, 0, 0);
|
||||||
|
|
|
@ -3178,10 +3178,11 @@ static int Sys_ProcessCommandline(char **argv, int maxargc, char *argv0)
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef WEBCLIENT
|
||||||
//using this like posix' access function, but with much more code, microsoftisms, and no errno codes/info
|
//using this like posix' access function, but with much more code, microsoftisms, and no errno codes/info
|
||||||
//no, I don't really have a clue why it needs to be so long.
|
//no, I don't really have a clue why it needs to be so long.
|
||||||
#include <svrapi.h>
|
#include <svrapi.h>
|
||||||
BOOL microsoft_access(LPCSTR pszFolder, DWORD dwAccessDesired)
|
static BOOL microsoft_access(LPCSTR pszFolder, DWORD dwAccessDesired)
|
||||||
{
|
{
|
||||||
HANDLE hToken;
|
HANDLE hToken;
|
||||||
PRIVILEGE_SET PrivilegeSet;
|
PRIVILEGE_SET PrivilegeSet;
|
||||||
|
@ -3211,7 +3212,7 @@ BOOL microsoft_access(LPCSTR pszFolder, DWORD dwAccessDesired)
|
||||||
return fAccessGranted;
|
return fAccessGranted;
|
||||||
}
|
}
|
||||||
|
|
||||||
int MessageBoxU(HWND hWnd, char *lpText, char *lpCaption, UINT uType)
|
static int MessageBoxU(HWND hWnd, char *lpText, char *lpCaption, UINT uType)
|
||||||
{
|
{
|
||||||
wchar_t widecaption[256];
|
wchar_t widecaption[256];
|
||||||
wchar_t widetext[2048];
|
wchar_t widetext[2048];
|
||||||
|
@ -3223,7 +3224,7 @@ int MessageBoxU(HWND hWnd, char *lpText, char *lpCaption, UINT uType)
|
||||||
|
|
||||||
|
|
||||||
static WNDPROC omgwtfwhyohwhy;
|
static WNDPROC omgwtfwhyohwhy;
|
||||||
LRESULT CALLBACK stoopidstoopidstoopid(HWND w, UINT m, WPARAM wp, LPARAM lp)
|
static LRESULT CALLBACK stoopidstoopidstoopid(HWND w, UINT m, WPARAM wp, LPARAM lp)
|
||||||
{
|
{
|
||||||
switch (m)
|
switch (m)
|
||||||
{
|
{
|
||||||
|
@ -3764,6 +3765,7 @@ static void Sys_MakeInstaller(const char *name)
|
||||||
if (error)
|
if (error)
|
||||||
Sys_Error("%s", error);
|
Sys_Error("%s", error);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
|
int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
|
||||||
{
|
{
|
||||||
|
@ -3943,6 +3945,7 @@ int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLin
|
||||||
Sys_Error ("Couldn't determine current directory");
|
Sys_Error ("Couldn't determine current directory");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef WEBCLIENT
|
||||||
c = COM_CheckParm("-makeinstaller");
|
c = COM_CheckParm("-makeinstaller");
|
||||||
if (c)
|
if (c)
|
||||||
{
|
{
|
||||||
|
@ -3950,6 +3953,7 @@ int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLin
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
parms.manifest = Sys_FindManifest();
|
parms.manifest = Sys_FindManifest();
|
||||||
|
#endif
|
||||||
|
|
||||||
if (parms.argc >= 2)
|
if (parms.argc >= 2)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1207,6 +1207,7 @@ static qboolean Alias_BuildSkelLerps(skellerps_t *lerps, struct framestateregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef SERVERONLY
|
||||||
if (r_nolerp.ival && l > 1)
|
if (r_nolerp.ival && l > 1)
|
||||||
{ //when lerping is completely disabled, find the strongest influence
|
{ //when lerping is completely disabled, find the strongest influence
|
||||||
frame1 = 0;
|
frame1 = 0;
|
||||||
|
@ -1223,7 +1224,9 @@ static qboolean Alias_BuildSkelLerps(skellerps_t *lerps, struct framestateregion
|
||||||
lerps->pose[0] = lerps->pose[frame1];
|
lerps->pose[0] = lerps->pose[frame1];
|
||||||
l = 1;
|
l = 1;
|
||||||
}
|
}
|
||||||
else if (l && totalweight != 1)
|
else
|
||||||
|
#endif
|
||||||
|
if (l && totalweight != 1)
|
||||||
{ //don't rescale if some animation got dropped.
|
{ //don't rescale if some animation got dropped.
|
||||||
totalweight = 1 / totalweight;
|
totalweight = 1 / totalweight;
|
||||||
for (b = 0; b < l; b++)
|
for (b = 0; b < l; b++)
|
||||||
|
|
|
@ -3117,6 +3117,7 @@ static INT CALLBACK StupidBrowseCallbackProc(HWND hwnd, UINT uMsg, LPARAM lp, LP
|
||||||
|
|
||||||
qboolean Sys_DoDirectoryPrompt(char *basepath, size_t basepathsize, const char *poshname, const char *savedname)
|
qboolean Sys_DoDirectoryPrompt(char *basepath, size_t basepathsize, const char *poshname, const char *savedname)
|
||||||
{
|
{
|
||||||
|
#ifndef SERVERONLY
|
||||||
char resultpath[MAX_PATH];
|
char resultpath[MAX_PATH];
|
||||||
BROWSEINFO bi;
|
BROWSEINFO bi;
|
||||||
LPITEMIDLIST il;
|
LPITEMIDLIST il;
|
||||||
|
@ -3160,6 +3161,7 @@ qboolean Sys_DoDirectoryPrompt(char *basepath, size_t basepathsize, const char *
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
qboolean Sys_FindGameData(const char *poshname, const char *gamename, char *basepath, int basepathlen, qboolean allowprompts)
|
qboolean Sys_FindGameData(const char *poshname, const char *gamename, char *basepath, int basepathlen, qboolean allowprompts)
|
||||||
|
@ -4318,12 +4320,14 @@ qboolean FS_ChangeGame(ftemanifest_t *man, qboolean allowreloadconfigs, qboolean
|
||||||
{
|
{
|
||||||
if (Sys_FindGameData(man->formalname, man->installation, realpath, sizeof(realpath), !man->doinstall) && FS_DirHasAPackage(realpath, man))
|
if (Sys_FindGameData(man->formalname, man->installation, realpath, sizeof(realpath), !man->doinstall) && FS_DirHasAPackage(realpath, man))
|
||||||
Q_strncpyz (newbasedir, realpath, sizeof(newbasedir));
|
Q_strncpyz (newbasedir, realpath, sizeof(newbasedir));
|
||||||
|
#ifndef SERVERONLY
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Z_Free(man->updatefile);
|
Z_Free(man->updatefile);
|
||||||
man->updatefile = NULL;
|
man->updatefile = NULL;
|
||||||
com_installer = true;
|
com_installer = true;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!fixedbasedir && !com_installer)
|
if (!fixedbasedir && !com_installer)
|
||||||
|
|
|
@ -1097,10 +1097,12 @@ qboolean DL_Decide(struct dl_download *dl)
|
||||||
#endif /*!defined(NACL)*/
|
#endif /*!defined(NACL)*/
|
||||||
|
|
||||||
#ifdef MULTITHREAD
|
#ifdef MULTITHREAD
|
||||||
|
#if defined(LOADERTHREAD) && !defined(NPFTE)
|
||||||
static void HTTP_Wake_Think(void *ctx, void *data, size_t a, size_t b)
|
static void HTTP_Wake_Think(void *ctx, void *data, size_t a, size_t b)
|
||||||
{
|
{
|
||||||
HTTP_CL_Think();
|
HTTP_CL_Think();
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
static int DL_Thread_Work(void *arg)
|
static int DL_Thread_Work(void *arg)
|
||||||
{
|
{
|
||||||
struct dl_download *dl = arg;
|
struct dl_download *dl = arg;
|
||||||
|
@ -1123,8 +1125,9 @@ static int DL_Thread_Work(void *arg)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(LOADERTHREAD) && !defined(NPFTE)
|
||||||
COM_AddWork(0, HTTP_Wake_Think, NULL, NULL, 0, 0);
|
COM_AddWork(0, HTTP_Wake_Think, NULL, NULL, 0, 0);
|
||||||
|
#endif
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue