diff --git a/engine/client/cl_main.c b/engine/client/cl_main.c index af9bebca6..af3d3fe8c 100644 --- a/engine/client/cl_main.c +++ b/engine/client/cl_main.c @@ -5059,7 +5059,7 @@ void Host_FinishLoading(void) "\n" "See the GNU General Public License for more details.\n"); -#ifdef _WIN32 +#if defined(_WIN32) && defined(WEBCLIENT) if (Sys_RunInstaller()) Sys_Quit(); #endif diff --git a/engine/client/image.c b/engine/client/image.c index 1a1e5660f..c584ff098 100644 --- a/engine/client/image.c +++ b/engine/client/image.c @@ -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) { struct pngerr *err = qpng_get_error_ptr(png_ptr); +#ifndef NPFTE Con_DPrintf("libpng %s: %s\n", err->fname, warning_msg); +#endif } 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); else { +#ifdef WEBCLIENT if (!strncmp(tex->ident, "http://", 7) || !strncmp(tex->ident, "https://", 8)) { 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. #endif } - else if (lowpri) + else +#endif + if (lowpri) COM_AddWork(5, Image_LoadHiResTextureWorker, tex, NULL, 0, 0); else COM_AddWork(2+(seq++%3), Image_LoadHiResTextureWorker, tex, NULL, 0, 0); diff --git a/engine/client/sys_win.c b/engine/client/sys_win.c index 518d43832..b42860314 100644 --- a/engine/client/sys_win.c +++ b/engine/client/sys_win.c @@ -3178,10 +3178,11 @@ static int Sys_ProcessCommandline(char **argv, int maxargc, char *argv0) return i; } +#ifdef WEBCLIENT //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. #include -BOOL microsoft_access(LPCSTR pszFolder, DWORD dwAccessDesired) +static BOOL microsoft_access(LPCSTR pszFolder, DWORD dwAccessDesired) { HANDLE hToken; PRIVILEGE_SET PrivilegeSet; @@ -3211,7 +3212,7 @@ BOOL microsoft_access(LPCSTR pszFolder, DWORD dwAccessDesired) 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 widetext[2048]; @@ -3223,7 +3224,7 @@ int MessageBoxU(HWND hWnd, char *lpText, char *lpCaption, UINT uType) 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) { @@ -3764,6 +3765,7 @@ static void Sys_MakeInstaller(const char *name) if (error) Sys_Error("%s", error); } +#endif 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"); } +#ifdef WEBCLIENT c = COM_CheckParm("-makeinstaller"); if (c) { @@ -3950,6 +3953,7 @@ int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLin return true; } parms.manifest = Sys_FindManifest(); +#endif if (parms.argc >= 2) { diff --git a/engine/common/com_mesh.c b/engine/common/com_mesh.c index 9257f50b5..ebf854720 100644 --- a/engine/common/com_mesh.c +++ b/engine/common/com_mesh.c @@ -1207,6 +1207,7 @@ static qboolean Alias_BuildSkelLerps(skellerps_t *lerps, struct framestateregion } } +#ifndef SERVERONLY if (r_nolerp.ival && l > 1) { //when lerping is completely disabled, find the strongest influence frame1 = 0; @@ -1223,7 +1224,9 @@ static qboolean Alias_BuildSkelLerps(skellerps_t *lerps, struct framestateregion lerps->pose[0] = lerps->pose[frame1]; l = 1; } - else if (l && totalweight != 1) + else +#endif + if (l && totalweight != 1) { //don't rescale if some animation got dropped. totalweight = 1 / totalweight; for (b = 0; b < l; b++) diff --git a/engine/common/fs.c b/engine/common/fs.c index 493bc84d0..0ee050c31 100644 --- a/engine/common/fs.c +++ b/engine/common/fs.c @@ -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) { +#ifndef SERVERONLY char resultpath[MAX_PATH]; BROWSEINFO bi; LPITEMIDLIST il; @@ -3160,6 +3161,7 @@ qboolean Sys_DoDirectoryPrompt(char *basepath, size_t basepathsize, const char * } return true; } +#endif return false; } 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)) Q_strncpyz (newbasedir, realpath, sizeof(newbasedir)); +#ifndef SERVERONLY else { Z_Free(man->updatefile); man->updatefile = NULL; com_installer = true; } +#endif } } if (!fixedbasedir && !com_installer) diff --git a/engine/http/httpclient.c b/engine/http/httpclient.c index 3c229fc18..dc7184aab 100644 --- a/engine/http/httpclient.c +++ b/engine/http/httpclient.c @@ -1097,10 +1097,12 @@ qboolean DL_Decide(struct dl_download *dl) #endif /*!defined(NACL)*/ #ifdef MULTITHREAD +#if defined(LOADERTHREAD) && !defined(NPFTE) static void HTTP_Wake_Think(void *ctx, void *data, size_t a, size_t b) { HTTP_CL_Think(); } +#endif static int DL_Thread_Work(void *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); - +#endif return 0; }