From cb0f6fa6aa6e25341d8cea998cafcfb566dad731 Mon Sep 17 00:00:00 2001 From: Spoike Date: Mon, 19 Nov 2018 08:06:07 +0000 Subject: [PATCH] Fix some compile issues. git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5339 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/client/api_menu.h | 5 ++--- engine/client/cl_screen.c | 4 +++- engine/client/image.c | 4 +++- engine/client/renderer.c | 4 ++++ engine/common/cmd.c | 2 ++ engine/common/gl_q2bsp.c | 2 ++ engine/gl/gl_shader.c | 2 ++ engine/server/sv_move.c | 2 ++ engine/web/gl_vidweb.c | 6 +++--- 9 files changed, 23 insertions(+), 8 deletions(-) diff --git a/engine/client/api_menu.h b/engine/client/api_menu.h index ab003e727..1c55d6c5f 100644 --- a/engine/client/api_menu.h +++ b/engine/client/api_menu.h @@ -51,10 +51,9 @@ struct shader_s; #if 1 //c++ or standard C #include "cl_master.h" -#else - enum slist_test_e; - enum hostcachekey_e; //obtained via calls to gethostcacheindexforkey #endif +enum slist_test_e; +enum hostcachekey_e; //obtained via calls to gethostcacheindexforkey enum fs_relative; enum com_tokentype_e; diff --git a/engine/client/cl_screen.c b/engine/client/cl_screen.c index 87b014869..387851257 100644 --- a/engine/client/cl_screen.c +++ b/engine/client/cl_screen.c @@ -3057,7 +3057,7 @@ void SCR_ScreenShot_Cubemap_f(void) VectorCopy(oldangles, cl.playerview->viewangles); } - +#ifdef IMAGEFMT_PCX // from gl_draw.c qbyte *draw_chars; // 8*8 graphic characters @@ -3116,6 +3116,7 @@ static void SCR_DrawStringToSnap (const char *s, qbyte *buf, int x, int y, int w SCR_RSShot ================== */ +int MipColor(int r, int g, int b); qboolean SCR_RSShot (void) { int stride; @@ -3251,6 +3252,7 @@ qboolean SCR_RSShot (void) return true; } +#endif //============================================================================= diff --git a/engine/client/image.c b/engine/client/image.c index 1bc8576b5..b94835a79 100644 --- a/engine/client/image.c +++ b/engine/client/image.c @@ -69,6 +69,7 @@ static image_t *imagelist; +#if defined(AVAIL_JPEGLIB) || defined(AVAIL_PNGLIB) static void GenerateXMPData(char *blob, size_t blobsize, int width, int height, unsigned int metainfo) { //XMP is a general thing that applies to multiple formats - or at least png+jpeg. //we need this if we want to correctly flag the data as a 360 image. @@ -104,6 +105,7 @@ static void GenerateXMPData(char *blob, size_t blobsize, int width, int height, ); } #endif +#endif #ifndef _WIN32 #include @@ -8645,4 +8647,4 @@ qboolean SCR_ScreenShot (char *filename, enum fs_relative fsroot, void **buffer, else //extension / type not recognised. return false; return true; -} \ No newline at end of file +} diff --git a/engine/client/renderer.c b/engine/client/renderer.c index 6c04c0e97..88325ffb8 100644 --- a/engine/client/renderer.c +++ b/engine/client/renderer.c @@ -1482,6 +1482,7 @@ qboolean R_ApplyRenderer_Load (rendererstate_t *newr) host_basepal = (qbyte *)FS_LoadMallocFile ("gfx/palette.lmp", &sz); if (!host_basepal) host_basepal = (qbyte *)FS_LoadMallocFile ("wad/playpal", &sz); +#if defined(Q2CLIENT) && defined(IMAGEFMT_PCX) if (!host_basepal || sz != 768) { qbyte *pcx=NULL; @@ -1499,6 +1500,7 @@ qboolean R_ApplyRenderer_Load (rendererstate_t *newr) goto q2colormap; //skip the colormap.lmp file as we already read it } } +#endif { qbyte *colormap = (qbyte *)FS_LoadMallocFile ("gfx/colormap.lmp", NULL); @@ -1527,7 +1529,9 @@ qboolean R_ApplyRenderer_Load (rendererstate_t *newr) if (vid.fullbright < 2) vid.fullbright = 0; //transparent colour doesn't count. +#if defined(Q2CLIENT) && defined(IMAGEFMT_PCX) q2colormap: +#endif TRACE(("dbg: R_ApplyRenderer: Palette loaded\n")); diff --git a/engine/common/cmd.c b/engine/common/cmd.c index 3d7ea285c..58912f666 100644 --- a/engine/common/cmd.c +++ b/engine/common/cmd.c @@ -2636,11 +2636,13 @@ static void Cmd_ForwardToServer_f (void) return; } +#ifdef IMAGEFMT_PCX if (Q_strcasecmp(Cmd_Argv(1), "snap") == 0 && cls.protocol == CP_QUAKEWORLD) { if (SCR_RSShot()) return; } +#endif #ifdef NQPROT if (Q_strcasecmp(Cmd_Argv(1), "protocols") == 0 && cls.protocol == CP_NETQUAKE) { diff --git a/engine/common/gl_q2bsp.c b/engine/common/gl_q2bsp.c index e9e77a3f3..21d17631d 100644 --- a/engine/common/gl_q2bsp.c +++ b/engine/common/gl_q2bsp.c @@ -6708,6 +6708,7 @@ size_t CM_WritePortalState (model_t *mod, void **data) *data = prv->q2portalopen; return sizeof(prv->q2portalopen); #endif + default: break; } } *data = NULL; @@ -6756,6 +6757,7 @@ qofs_t CM_ReadPortalState (model_t *mod, qbyte *ptr, qofs_t ptrsize) } break; #endif + default: break; } } return 0; diff --git a/engine/gl/gl_shader.c b/engine/gl/gl_shader.c index 1ff23a4b8..a75fa4214 100644 --- a/engine/gl/gl_shader.c +++ b/engine/gl/gl_shader.c @@ -767,6 +767,7 @@ texid_t R_LoadColourmapImage(void) unsigned int x; unsigned int data[256*(VID_GRADES)]; qbyte *colourmappal = (qbyte *)FS_LoadMallocFile ("gfx/colormap.lmp", NULL); +#if defined(Q2CLIENT) && defined(IMAGEFMT_PCX) if (!colourmappal) { size_t sz; @@ -778,6 +779,7 @@ texid_t R_LoadColourmapImage(void) BZ_Free(pcx); } } +#endif if (colourmappal) { for (x = 0; x < sizeof(data)/sizeof(data[0]); x++) diff --git a/engine/server/sv_move.c b/engine/server/sv_move.c index d5efb69fa..f15fdde2d 100644 --- a/engine/server/sv_move.c +++ b/engine/server/sv_move.c @@ -629,7 +629,9 @@ qboolean World_MoveToGoal (world_t *world, wedict_t *ent, float dist) #ifdef ENGINE_ROUTING +#ifndef SERVERONLY static cvar_t route_shownodes = CVAR("route_shownodes", "0"); +#endif #define LF_EDGE 0x00000001 #define LF_JUMP 0x00000002 diff --git a/engine/web/gl_vidweb.c b/engine/web/gl_vidweb.c index d17306c79..ca89b89d3 100644 --- a/engine/web/gl_vidweb.c +++ b/engine/web/gl_vidweb.c @@ -380,17 +380,17 @@ void INS_EnumerateDevices(void *ctx, void(*callback)(void *ctx, const char *type char foobar[64]; for (i = 0; i < countof(gamepaddeviceids); i++) { - Q_snprintfz(foobar, sizeof(foobar), "gp%i", i); + Q_snprintfz(foobar, sizeof(foobar), "gp%i", (int)i); callback(ctx, "gamepad", foobar, &gamepaddeviceids[i]); } for (i = 0; i < countof(mouseid); i++) { - Q_snprintfz(foobar, sizeof(foobar), "m%i", i); + Q_snprintfz(foobar, sizeof(foobar), "m%i", (int)i); callback(ctx, "mouse", foobar, &mouseid[i]); } for (i = 0; i < countof(keyboardid); i++) { - Q_snprintfz(foobar, sizeof(foobar), "kb%i", i); + Q_snprintfz(foobar, sizeof(foobar), "kb%i", (int)i); callback(ctx, "keyboard", foobar, &keyboardid[i]); } }