From f70557ea856366f3cde1244d7692e65340b70fab Mon Sep 17 00:00:00 2001 From: Eric Wasylishen Date: Thu, 19 Nov 2015 14:38:50 -0800 Subject: [PATCH] WIP MSVC support --- bsputil/bsputil.c | 3 ++ common/cmdlib.c | 23 +++++++++------ include/common/cmdlib.h | 18 ++++++++++-- include/common/log.h | 1 + include/vis/leafbits.h | 12 +++++++- light/entities.c | 2 +- qbsp/brush.c | 16 +++++------ qbsp/cmdlib.c | 56 +++++++++++++++++++++++++++++++++--- qbsp/map.c | 36 +++++++++++------------ qbsp/qbsp.c | 64 ++++++++++++++++++++--------------------- qbsp/qbsp.h | 35 +++++++++++++++------- qbsp/wad.c | 4 +-- vis/soundpvs.c | 10 +++---- vis/state.c | 3 ++ 14 files changed, 192 insertions(+), 91 deletions(-) diff --git a/bsputil/bsputil.c b/bsputil/bsputil.c index 467e6dd6..a0cbf0dd 100644 --- a/bsputil/bsputil.c +++ b/bsputil/bsputil.c @@ -18,7 +18,10 @@ */ #include + +#ifndef WIN32 #include +#endif #include #include diff --git a/common/cmdlib.c b/common/cmdlib.c index 0d114f2e..9c75e000 100644 --- a/common/cmdlib.c +++ b/common/cmdlib.c @@ -23,21 +23,20 @@ #include #include -#include #ifdef WIN32 #include -#endif - -#ifdef NeXT -#include +#include #endif #ifdef LINUX +#include #include #include #endif +#include + #define PATHSEPERATOR '/' /* set these before calling CheckParm */ @@ -161,7 +160,7 @@ ExpandPathAndArchive(char *path) if (archive) { sprintf(archivename, "%s/%s", archivedir, path); - CopyFile(expanded, archivename); + Q_CopyFile(expanded, archivename); } return expanded; } @@ -185,11 +184,19 @@ copystring(const char *s) double I_FloatTime(void) { +#ifdef WIN32 + FILETIME ft; + uint64_t hundred_ns; + GetSystemTimeAsFileTime(&ft); + hundred_ns = (((uint64_t)ft.dwHighDateTime) << 32) + ((uint64_t)ft.dwLowDateTime); + return (double)hundred_ns / 10000000.0; +#else struct timeval tv; gettimeofday(&tv, NULL); return (double)tv.tv_sec + (tv.tv_usec / 1000000.0); +#endif } void @@ -903,12 +910,12 @@ CreatePath(char *path) /* * ============ - * CopyFile + * Q_CopyFile * Used to archive source files *============ */ void -CopyFile(const char *from, char *to) +Q_CopyFile(const char *from, char *to) { void *buffer; int length; diff --git a/include/common/cmdlib.h b/include/common/cmdlib.h index 3869f24e..f9337c4c 100644 --- a/include/common/cmdlib.h +++ b/include/common/cmdlib.h @@ -27,13 +27,23 @@ #include #include #include +#include #define stringify__(x) #x #define stringify(x) stringify__(x) -typedef enum { false, true } qboolean; +typedef bool qboolean; typedef unsigned char byte; +#ifndef __GNUC__ +#define __attribute__(x) +#endif + +#ifdef _MSC_VER +#define __func__ __FUNCTION__ +#endif + +#ifdef __GNUC__ /* min and max macros with type checking */ #define qmax(a,b) ({ \ typeof(a) a_ = (a); \ @@ -47,6 +57,10 @@ typedef unsigned char byte; (void)(&a_ == &b_); \ (a_ < b_) ? a_ : b_; \ }) +#else +#define qmax(a,b) (((a)>(b)) ? (a) : (b)) +#define qmin(a,b) (((a)>(b)) ? (b) : (a)) +#endif /* set these before calling CheckParm */ extern int myargc; @@ -115,7 +129,7 @@ void CRC_ProcessByte(unsigned short *crcvalue, byte data); unsigned short CRC_Value(unsigned short crcvalue); void CreatePath(char *path); -void CopyFile(const char *from, char *to); +void Q_CopyFile(const char *from, char *to); extern qboolean archive; extern char archivedir[1024]; diff --git a/include/common/log.h b/include/common/log.h index fba5420e..1063afc8 100644 --- a/include/common/log.h +++ b/include/common/log.h @@ -29,6 +29,7 @@ #include #include +#include void init_log(const char *filename); void close_log(); diff --git a/include/vis/leafbits.h b/include/vis/leafbits.h index f70826cf..45a44dd5 100644 --- a/include/vis/leafbits.h +++ b/include/vis/leafbits.h @@ -24,9 +24,19 @@ #include /* Use some GCC builtins */ -#ifndef ffsl +#if !defined(ffsl) && defined(__GNUC__) #define ffsl __builtin_ffsl +#elif defined(WIN32) +inline int ffsl(long int val) +{ + unsigned long indexout; + unsigned char res = _BitScanForward(&indexout, val); + if (!res) return 0; + else return indexout + 1; +} #endif + + #ifndef offsetof #define offsetof(type, member) __builtin_offsetof(type, member) #endif diff --git a/light/entities.c b/light/entities.c index ec026ac4..34a1c223 100644 --- a/light/entities.c +++ b/light/entities.c @@ -1146,7 +1146,7 @@ static void SubdividePolygon (const bsp2_dface_t *face, const bsp2_t *bsp, int n const char *texname = miptex->name; for (i=0; ilumps[LUMP_TEXINFO].data; const char *texname = map.miptex[texinfo[mapface->texinfo].miptex]; - if (!strcasecmp(texname, "hintskip")) + if (!Q_strcasecmp(texname, "hintskip")) continue; } @@ -787,20 +787,20 @@ Brush_GetContents(const mapbrush_t *mapbrush) mapface = mapbrush->faces; texname = map.miptex[texinfo[mapface->texinfo].miptex]; - if (!strcasecmp(texname, "hint") || !strcasecmp(texname, "hintskip")) + if (!Q_strcasecmp(texname, "hint") || !Q_strcasecmp(texname, "hintskip")) return CONTENTS_HINT; - if (!strcasecmp(texname, "clip")) + if (!Q_strcasecmp(texname, "clip")) return CONTENTS_CLIP; if (texname[0] == '*') { - if (!strncasecmp(texname + 1, "lava", 4)) + if (!Q_strncasecmp(texname + 1, "lava", 4)) return CONTENTS_LAVA; - if (!strncasecmp(texname + 1, "slime", 5)) + if (!Q_strncasecmp(texname + 1, "slime", 5)) return CONTENTS_SLIME; return CONTENTS_WATER; } - if (!strncasecmp(texname, "sky", 3)) + if (!Q_strncasecmp(texname, "sky", 3)) return CONTENTS_SKY; return CONTENTS_SOLID; @@ -948,7 +948,7 @@ Brush_LoadEntity(mapentity_t *dst, const mapentity_t *src, const int hullnum) } /* If the source entity is func_detail, set the content flag */ - if (!strcasecmp(classname, "func_detail")) + if (!Q_strcasecmp(classname, "func_detail")) cflags |= CFLAGS_DETAIL; mapbrush = src->mapbrushes; diff --git a/qbsp/cmdlib.c b/qbsp/cmdlib.c index ed6cb6b3..fae1d675 100644 --- a/qbsp/cmdlib.c +++ b/qbsp/cmdlib.c @@ -23,9 +23,16 @@ #include "qbsp.h" #include -#include #include +#ifdef WIN32 +#include +#endif + +#ifdef LINUX +#include +#endif + #define PATHSEPERATOR '/' char * @@ -48,11 +55,19 @@ I_FloatTime double I_FloatTime(void) { - struct timeval tv; +#ifdef WIN32 + FILETIME ft; + uint64_t hundred_ns; + GetSystemTimeAsFileTime(&ft); + hundred_ns = (((uint64_t)ft.dwHighDateTime) << 32) + ((uint64_t)ft.dwLowDateTime); + return (double)hundred_ns / 10000000.0; +#else + struct timeval tv; - gettimeofday(&tv, NULL); + gettimeofday(&tv, NULL); - return (double)tv.tv_sec + (tv.tv_usec / 1000000.0); + return (double)tv.tv_sec + (tv.tv_usec / 1000000.0); +#endif } @@ -117,3 +132,36 @@ IsAbsolutePath(const char *path) { return path[0] == PATHSEPERATOR || (isalpha(path[0]) && path[1] == ':'); } + +int +Q_strncasecmp(const char *s1, const char *s2, int n) +{ + int c1, c2; + + while (1) { + c1 = *s1++; + c2 = *s2++; + + if (!n--) + return 0; /* strings are equal until end point */ + + if (c1 != c2) { + if (c1 >= 'a' && c1 <= 'z') + c1 -= ('a' - 'A'); + if (c2 >= 'a' && c2 <= 'z') + c2 -= ('a' - 'A'); + if (c1 != c2) + return -1; /* strings not equal */ + } + if (!c1) + return 0; /* strings are equal */ + } + + return -1; +} + +int +Q_strcasecmp(const char *s1, const char *s2) +{ + return Q_strncasecmp(s1, s2, 99999); +} diff --git a/qbsp/map.c b/qbsp/map.c index f5d7d798..203a3d50 100644 --- a/qbsp/map.c +++ b/qbsp/map.c @@ -60,7 +60,7 @@ AddAnimTex(const char *name) for (i = 0; i < frame; i++) { framename[1] = basechar + i; for (j = 0; j < map.nummiptex; j++) { - if (!strcasecmp(framename, map.miptex[j])) + if (!Q_strcasecmp(framename, map.miptex[j])) break; } if (j < map.nummiptex) @@ -85,7 +85,7 @@ FindMiptex(const char *name) name = pathsep + 1; for (i = 0; i < map.nummiptex; i++) { - if (!strcasecmp(name, map.miptex[i])) + if (!Q_strcasecmp(name, map.miptex[i])) return i; } if (map.nummiptex == map.maxmiptex) @@ -108,13 +108,13 @@ IsSkipName(const char *name) { if (options.fNoskip) return false; - if (!strcasecmp(name, "skip")) + if (!Q_strcasecmp(name, "skip")) return true; - if (!strcasecmp(name, "*waterskip")) + if (!Q_strcasecmp(name, "*waterskip")) return true; - if (!strcasecmp(name, "*slimeskip")) + if (!Q_strcasecmp(name, "*slimeskip")) return true; - if (!strcasecmp(name, "*lavaskip")) + if (!Q_strcasecmp(name, "*lavaskip")) return true; return false; } @@ -124,7 +124,7 @@ IsSplitName(const char *name) { if (options.fSplitspecial) return false; - if (name[0] == '*' || !strncasecmp(name, "sky", 3)) + if (name[0] == '*' || !Q_strncasecmp(name, "sky", 3)) return true; return false; } @@ -132,9 +132,9 @@ IsSplitName(const char *name) static bool IsHintName(const char *name) { - if (!strcasecmp(name, "hint")) + if (!Q_strcasecmp(name, "hint")) return true; - if (!strcasecmp(name, "hintskip")) + if (!Q_strcasecmp(name, "hintskip")) return true; return false; } @@ -216,16 +216,16 @@ ParseEpair(parser_t *parser, mapentity_t *entity) goto parse_error; epair->value = copystring(parser->token); - if (!strcasecmp(epair->key, "origin")) { + if (!Q_strcasecmp(epair->key, "origin")) { GetVectorForKey(entity, epair->key, entity->origin); - } else if (!strcasecmp(epair->key, "classname")) { - if (!strcasecmp(epair->value, "info_player_start")) { + } else if (!Q_strcasecmp(epair->key, "classname")) { + if (!Q_strcasecmp(epair->value, "info_player_start")) { if (rgfStartSpots & info_player_start) Message(msgWarning, warnMultipleStarts); rgfStartSpots |= info_player_start; - } else if (!strcasecmp(epair->value, "info_player_deathmatch")) { + } else if (!Q_strcasecmp(epair->value, "info_player_deathmatch")) { rgfStartSpots |= info_player_deathmatch; - } else if (!strcasecmp(epair->value, "info_player_coop")) { + } else if (!Q_strcasecmp(epair->value, "info_player_coop")) { rgfStartSpots |= info_player_coop; } } @@ -712,9 +712,9 @@ IsWorldBrushEntity(const mapentity_t *entity) { const char *classname = ValueForKey(entity, "classname"); - if (!strcasecmp(classname, "func_detail")) + if (!Q_strcasecmp(classname, "func_detail")) return true; - if (!strcasecmp(classname, "func_group")) + if (!Q_strcasecmp(classname, "func_group")) return true; return false; } @@ -786,7 +786,7 @@ ValueForKey(const mapentity_t *entity, const char *key) const epair_t *ep; for (ep = entity->epairs; ep; ep = ep->next) - if (!strcasecmp(ep->key, key)) + if (!Q_strcasecmp(ep->key, key)) return ep->value; return ""; @@ -799,7 +799,7 @@ SetKeyValue(mapentity_t *entity, const char *key, const char *value) epair_t *ep; for (ep = entity->epairs; ep; ep = ep->next) - if (!strcasecmp(ep->key, key)) { + if (!Q_strcasecmp(ep->key, key)) { free(ep->value); /* FIXME */ ep->value = copystring(value); return; diff --git a/qbsp/qbsp.c b/qbsp/qbsp.c index 96f5f8b4..17d9aabb 100644 --- a/qbsp/qbsp.c +++ b/qbsp/qbsp.c @@ -53,9 +53,9 @@ ProcessEntity(mapentity_t *entity, const int hullnum) * worldspawn */ classname = ValueForKey(entity, "classname"); - if (!strcasecmp(classname, "func_group")) + if (!Q_strcasecmp(classname, "func_group")) return; - if (!strcasecmp(classname, "func_detail")) + if (!Q_strcasecmp(classname, "func_detail")) return; if (entity != pWorldEnt) { @@ -104,7 +104,7 @@ ProcessEntity(mapentity_t *entity, const int hullnum) source = map.entities + 1; for (i = 1; i < map.numentities; i++, source++) { classname = ValueForKey(source, "classname"); - if (!strcasecmp(classname, "func_group")) + if (!Q_strcasecmp(classname, "func_group")) Brush_LoadEntity(entity, source, hullnum); } @@ -113,7 +113,7 @@ ProcessEntity(mapentity_t *entity, const int hullnum) source = map.entities + 1; for (i = 1; i < map.numentities; i++, source++) { classname = ValueForKey(source, "classname"); - if (!strcasecmp(classname, "func_detail")) { + if (!Q_strcasecmp(classname, "func_detail")) { int detailstart = entity->numbrushes; Brush_LoadEntity(entity, source, hullnum); detailcount += entity->numbrushes - detailstart; @@ -220,9 +220,9 @@ UpdateEntLump(void) if (!entity->nummapbrushes) continue; classname = ValueForKey(entity, "classname"); - if (!strcasecmp(classname, "func_detail")) + if (!Q_strcasecmp(classname, "func_detail")) continue; - if (!strcasecmp(classname, "func_group")) + if (!Q_strcasecmp(classname, "func_group")) continue; snprintf(modname, sizeof(modname), "*%d", modnum); @@ -479,59 +479,59 @@ ParseOptions(char *szOptions) NameCount++; } else { szTok++; - if (!strcasecmp(szTok, "nofill")) + if (!Q_strcasecmp(szTok, "nofill")) options.fNofill = true; - else if (!strcasecmp(szTok, "noclip")) + else if (!Q_strcasecmp(szTok, "noclip")) options.fNoclip = true; - else if (!strcasecmp(szTok, "noskip")) + else if (!Q_strcasecmp(szTok, "noskip")) options.fNoskip = true; - else if (!strcasecmp(szTok, "onlyents")) + else if (!Q_strcasecmp(szTok, "onlyents")) options.fOnlyents = true; - else if (!strcasecmp(szTok, "verbose")) + else if (!Q_strcasecmp(szTok, "verbose")) options.fAllverbose = true; - else if (!strcasecmp(szTok, "splitspecial")) + else if (!Q_strcasecmp(szTok, "splitspecial")) options.fSplitspecial = true; - else if (!strcasecmp(szTok, "notranswater")) + else if (!Q_strcasecmp(szTok, "notranswater")) options.fTranswater = false; - else if (!strcasecmp(szTok, "transwater")) + else if (!Q_strcasecmp(szTok, "transwater")) options.fTranswater = true; - else if (!strcasecmp(szTok, "transsky")) + else if (!Q_strcasecmp(szTok, "transsky")) options.fTranssky = true; - else if (!strcasecmp(szTok, "oldaxis")) + else if (!Q_strcasecmp(szTok, "oldaxis")) logprint("-oldaxis is now the default and the flag is ignored.\nUse -nooldaxis to get the alternate behaviour.\n"); - else if (!strcasecmp(szTok, "nooldaxis")) + else if (!Q_strcasecmp(szTok, "nooldaxis")) options.fOldaxis = false; - else if (!strcasecmp(szTok, "forcegoodtree")) + else if (!Q_strcasecmp(szTok, "forcegoodtree")) options.forceGoodTree = true; - else if (!strcasecmp(szTok, "bspleak")) + else if (!Q_strcasecmp(szTok, "bspleak")) options.fBspleak = true; - else if (!strcasecmp(szTok, "noverbose")) + else if (!Q_strcasecmp(szTok, "noverbose")) options.fNoverbose = true; - else if (!strcasecmp(szTok, "oldleak")) + else if (!Q_strcasecmp(szTok, "oldleak")) options.fOldleak = true; - else if (!strcasecmp(szTok, "nopercent")) + else if (!Q_strcasecmp(szTok, "nopercent")) options.fNopercent = true; - else if (!strcasecmp(szTok, "hexen2")) + else if (!Q_strcasecmp(szTok, "hexen2")) options.hexen2 = true; - else if (!strcasecmp(szTok, "bsp2")) { + else if (!Q_strcasecmp(szTok, "bsp2")) { options.BSPVersion = BSP2VERSION; MemSize = MemSize_BSP2; - } else if (!strcasecmp(szTok, "2psb")) { + } else if (!Q_strcasecmp(szTok, "2psb")) { options.BSPVersion = BSP2RMQVERSION; MemSize = MemSize_BSP2rmq; - } else if (!strcasecmp(szTok, "leakdist")) { + } else if (!Q_strcasecmp(szTok, "leakdist")) { szTok2 = GetTok(szTok + strlen(szTok) + 1, szEnd); if (!szTok2) Error("Invalid argument to option %s", szTok); options.dxLeakDist = atoi(szTok2); szTok = szTok2; - } else if (!strcasecmp(szTok, "subdivide")) { + } else if (!Q_strcasecmp(szTok, "subdivide")) { szTok2 = GetTok(szTok + strlen(szTok) + 1, szEnd); if (!szTok2) Error("Invalid argument to option %s", szTok); options.dxSubdivide = atoi(szTok2); szTok = szTok2; - } else if (!strcasecmp(szTok, "wadpath")) { + } else if (!Q_strcasecmp(szTok, "wadpath")) { szTok2 = GetTok(szTok + strlen(szTok) + 1, szEnd); if (!szTok2) Error("Invalid argument to option %s", szTok); @@ -540,21 +540,21 @@ ParseOptions(char *szOptions) /* Remove trailing /, if any */ if (options.wadPath[strlen(options.wadPath) - 1] == '/') options.wadPath[strlen(options.wadPath) - 1] = 0; - } else if (!strcasecmp(szTok, "oldrottex")) { + } else if (!Q_strcasecmp(szTok, "oldrottex")) { options.fixRotateObjTexture = false; - } else if (!strcasecmp(szTok, "maxnodesize")) { + } else if (!Q_strcasecmp(szTok, "maxnodesize")) { szTok2 = GetTok(szTok + strlen(szTok) + 1, szEnd); if (!szTok2) Error("Invalid argument to option %s", szTok); options.maxNodeSize= atoi(szTok2); szTok = szTok2; - } else if (!strcasecmp(szTok, "epsilon")) { + } else if (!Q_strcasecmp(szTok, "epsilon")) { szTok2 = GetTok(szTok + strlen(szTok) + 1, szEnd); if (!szTok2) Error("Invalid argument to option %s", szTok); options.on_epsilon= atof(szTok2); szTok = szTok2; - } else if (!strcasecmp(szTok, "?") || !strcasecmp(szTok, "help")) + } else if (!Q_strcasecmp(szTok, "?") || !Q_strcasecmp(szTok, "help")) PrintOptions(); else Error("Unknown option '%s'", szTok); diff --git a/qbsp/qbsp.h b/qbsp/qbsp.h index b201c9d4..760b7ce3 100644 --- a/qbsp/qbsp.h +++ b/qbsp/qbsp.h @@ -42,6 +42,14 @@ #define offsetof(type, member) __builtin_offsetof(type, member) #endif +#ifdef _MSC_VER +#define __func__ __FUNCTION__ +#endif + +#ifndef __GNUC__ +#define __attribute__(x) +#endif + //===== cmdlib.h /* @@ -173,6 +181,7 @@ void DefaultExtension(char *path, const char *extension); void StripExtension(char *path); void StripFilename(char *path); int IsAbsolutePath(const char *path); +int Q_strcasecmp(const char *s1, const char *s2); char *copystring(const char *s); @@ -207,18 +216,24 @@ vec_t VectorNormalize(vec3_t v); void VectorInverse(vec3_t v); void VectorScale(const vec3_t v, const vec_t scale, vec3_t out); -#define min(a,b) ({ \ - typeof(a) a_ = (a); \ - typeof(b) b_ = (b); \ - (void)(&a_ == &b_); \ - (a_ < b_) ? a_ : b_; \ +#ifdef __GNUC__ +/* min and max macros with type checking */ +#define max(a,b) ({ \ + typeof(a) a_ = (a); \ + typeof(b) b_ = (b); \ + (void)(&a_ == &b_); \ + (a_ > b_) ? a_ : b_; \ }) -#define max(a,b) ({ \ - typeof(a) a_ = (a); \ - typeof(b) b_ = (b); \ - (void)(&a_ == &b_); \ - (a_ > b_) ? a_ : b_; \ +#define min(a,b) ({ \ + typeof(a) a_ = (a); \ + typeof(b) b_ = (b); \ + (void)(&a_ == &b_); \ + (a_ < b_) ? a_ : b_; \ }) +#else +#define max(a,b) (((a)>(b)) ? (a) : (b)) +#define min(a,b) (((a)>(b)) ? (b) : (a)) +#endif #define stringify__(x) #x #define stringify(x) stringify__(x) diff --git a/qbsp/wad.c b/qbsp/wad.c index e73ba8af..2fdbd623 100644 --- a/qbsp/wad.c +++ b/qbsp/wad.c @@ -147,7 +147,7 @@ WADList_FindTexture(const wad_t *wadlist, const char *name) for (wad = wadlist; wad; wad = wad->next) for (i = 0; i < wad->header.numlumps; i++) - if (!strcasecmp(name, wad->lumps[i].name)) + if (!Q_strcasecmp(name, wad->lumps[i].name)) return &wad->lumps[i]; return NULL; @@ -225,7 +225,7 @@ WAD_LoadLump(const wad_t *wad, const char *name, byte *dest) int size; for (i = 0; i < wad->header.numlumps; i++) { - if (!strcasecmp(name, wad->lumps[i].name)) { + if (!Q_strcasecmp(name, wad->lumps[i].name)) { fseek(wad->file, wad->lumps[i].filepos, SEEK_SET); size = fread(dest, 1, wad->lumps[i].disksize, wad->file); if (size != wad->lumps[i].disksize) diff --git a/vis/soundpvs.c b/vis/soundpvs.c index 2a18dba9..41634bb1 100644 --- a/vis/soundpvs.c +++ b/vis/soundpvs.c @@ -111,15 +111,15 @@ CalcAmbientSounds(bsp2_t *bsp) ofs = bsp->dtexdata.header->dataofs[info->miptex]; miptex = (const miptex_t *)(bsp->dtexdata.base + ofs); - if (!strncasecmp(miptex->name, "sky", 3) && ambientsky) + if (!Q_strncasecmp(miptex->name, "sky", 3) && ambientsky) ambient_type = AMBIENT_SKY; - else if (!strncasecmp(miptex->name, "*water", 6) && ambientwater) + else if (!Q_strncasecmp(miptex->name, "*water", 6) && ambientwater) ambient_type = AMBIENT_WATER; - else if (!strncasecmp(miptex->name, "*04water", 8) && ambientwater) + else if (!Q_strncasecmp(miptex->name, "*04water", 8) && ambientwater) ambient_type = AMBIENT_WATER; - else if (!strncasecmp(miptex->name, "*slime", 6) && ambientslime) + else if (!Q_strncasecmp(miptex->name, "*slime", 6) && ambientslime) ambient_type = AMBIENT_WATER; // AMBIENT_SLIME; - else if (!strncasecmp(miptex->name, "*lava", 5) && ambientlava) + else if (!Q_strncasecmp(miptex->name, "*lava", 5) && ambientlava) ambient_type = AMBIENT_LAVA; else continue; diff --git a/vis/state.c b/vis/state.c index 330e3dce..c6aade85 100644 --- a/vis/state.c +++ b/vis/state.c @@ -19,7 +19,10 @@ #include #include + +#ifdef LINUX #include +#endif #include #include