1
0
Fork 0
forked from fte/fteqw

Fix some compile issues.

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5339 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2018-11-19 08:06:07 +00:00
parent 2ee8387644
commit cb0f6fa6aa
9 changed files with 23 additions and 8 deletions

View file

@ -51,10 +51,9 @@ struct shader_s;
#if 1 //c++ or standard C #if 1 //c++ or standard C
#include "cl_master.h" #include "cl_master.h"
#else
enum slist_test_e;
enum hostcachekey_e; //obtained via calls to gethostcacheindexforkey
#endif #endif
enum slist_test_e;
enum hostcachekey_e; //obtained via calls to gethostcacheindexforkey
enum fs_relative; enum fs_relative;
enum com_tokentype_e; enum com_tokentype_e;

View file

@ -3057,7 +3057,7 @@ void SCR_ScreenShot_Cubemap_f(void)
VectorCopy(oldangles, cl.playerview->viewangles); VectorCopy(oldangles, cl.playerview->viewangles);
} }
#ifdef IMAGEFMT_PCX
// from gl_draw.c // from gl_draw.c
qbyte *draw_chars; // 8*8 graphic characters 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 SCR_RSShot
================== ==================
*/ */
int MipColor(int r, int g, int b);
qboolean SCR_RSShot (void) qboolean SCR_RSShot (void)
{ {
int stride; int stride;
@ -3251,6 +3252,7 @@ qboolean SCR_RSShot (void)
return true; return true;
} }
#endif
//============================================================================= //=============================================================================

View file

@ -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) 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. { //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. //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
#endif
#ifndef _WIN32 #ifndef _WIN32
#include <unistd.h> #include <unistd.h>
@ -8645,4 +8647,4 @@ qboolean SCR_ScreenShot (char *filename, enum fs_relative fsroot, void **buffer,
else //extension / type not recognised. else //extension / type not recognised.
return false; return false;
return true; return true;
} }

View file

@ -1482,6 +1482,7 @@ qboolean R_ApplyRenderer_Load (rendererstate_t *newr)
host_basepal = (qbyte *)FS_LoadMallocFile ("gfx/palette.lmp", &sz); host_basepal = (qbyte *)FS_LoadMallocFile ("gfx/palette.lmp", &sz);
if (!host_basepal) if (!host_basepal)
host_basepal = (qbyte *)FS_LoadMallocFile ("wad/playpal", &sz); host_basepal = (qbyte *)FS_LoadMallocFile ("wad/playpal", &sz);
#if defined(Q2CLIENT) && defined(IMAGEFMT_PCX)
if (!host_basepal || sz != 768) if (!host_basepal || sz != 768)
{ {
qbyte *pcx=NULL; 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 goto q2colormap; //skip the colormap.lmp file as we already read it
} }
} }
#endif
{ {
qbyte *colormap = (qbyte *)FS_LoadMallocFile ("gfx/colormap.lmp", NULL); qbyte *colormap = (qbyte *)FS_LoadMallocFile ("gfx/colormap.lmp", NULL);
@ -1527,7 +1529,9 @@ qboolean R_ApplyRenderer_Load (rendererstate_t *newr)
if (vid.fullbright < 2) if (vid.fullbright < 2)
vid.fullbright = 0; //transparent colour doesn't count. vid.fullbright = 0; //transparent colour doesn't count.
#if defined(Q2CLIENT) && defined(IMAGEFMT_PCX)
q2colormap: q2colormap:
#endif
TRACE(("dbg: R_ApplyRenderer: Palette loaded\n")); TRACE(("dbg: R_ApplyRenderer: Palette loaded\n"));

View file

@ -2636,11 +2636,13 @@ static void Cmd_ForwardToServer_f (void)
return; return;
} }
#ifdef IMAGEFMT_PCX
if (Q_strcasecmp(Cmd_Argv(1), "snap") == 0 && cls.protocol == CP_QUAKEWORLD) if (Q_strcasecmp(Cmd_Argv(1), "snap") == 0 && cls.protocol == CP_QUAKEWORLD)
{ {
if (SCR_RSShot()) if (SCR_RSShot())
return; return;
} }
#endif
#ifdef NQPROT #ifdef NQPROT
if (Q_strcasecmp(Cmd_Argv(1), "protocols") == 0 && cls.protocol == CP_NETQUAKE) if (Q_strcasecmp(Cmd_Argv(1), "protocols") == 0 && cls.protocol == CP_NETQUAKE)
{ {

View file

@ -6708,6 +6708,7 @@ size_t CM_WritePortalState (model_t *mod, void **data)
*data = prv->q2portalopen; *data = prv->q2portalopen;
return sizeof(prv->q2portalopen); return sizeof(prv->q2portalopen);
#endif #endif
default: break;
} }
} }
*data = NULL; *data = NULL;
@ -6756,6 +6757,7 @@ qofs_t CM_ReadPortalState (model_t *mod, qbyte *ptr, qofs_t ptrsize)
} }
break; break;
#endif #endif
default: break;
} }
} }
return 0; return 0;

View file

@ -767,6 +767,7 @@ texid_t R_LoadColourmapImage(void)
unsigned int x; unsigned int x;
unsigned int data[256*(VID_GRADES)]; unsigned int data[256*(VID_GRADES)];
qbyte *colourmappal = (qbyte *)FS_LoadMallocFile ("gfx/colormap.lmp", NULL); qbyte *colourmappal = (qbyte *)FS_LoadMallocFile ("gfx/colormap.lmp", NULL);
#if defined(Q2CLIENT) && defined(IMAGEFMT_PCX)
if (!colourmappal) if (!colourmappal)
{ {
size_t sz; size_t sz;
@ -778,6 +779,7 @@ texid_t R_LoadColourmapImage(void)
BZ_Free(pcx); BZ_Free(pcx);
} }
} }
#endif
if (colourmappal) if (colourmappal)
{ {
for (x = 0; x < sizeof(data)/sizeof(data[0]); x++) for (x = 0; x < sizeof(data)/sizeof(data[0]); x++)

View file

@ -629,7 +629,9 @@ qboolean World_MoveToGoal (world_t *world, wedict_t *ent, float dist)
#ifdef ENGINE_ROUTING #ifdef ENGINE_ROUTING
#ifndef SERVERONLY
static cvar_t route_shownodes = CVAR("route_shownodes", "0"); static cvar_t route_shownodes = CVAR("route_shownodes", "0");
#endif
#define LF_EDGE 0x00000001 #define LF_EDGE 0x00000001
#define LF_JUMP 0x00000002 #define LF_JUMP 0x00000002

View file

@ -380,17 +380,17 @@ void INS_EnumerateDevices(void *ctx, void(*callback)(void *ctx, const char *type
char foobar[64]; char foobar[64];
for (i = 0; i < countof(gamepaddeviceids); i++) 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]); callback(ctx, "gamepad", foobar, &gamepaddeviceids[i]);
} }
for (i = 0; i < countof(mouseid); 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]); callback(ctx, "mouse", foobar, &mouseid[i]);
} }
for (i = 0; i < countof(keyboardid); 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]); callback(ctx, "keyboard", foobar, &keyboardid[i]);
} }
} }