diff --git a/.github/workflows/build-linux.yml b/.github/workflows/build-linux.yml index 4b23647ad..c325e928d 100644 --- a/.github/workflows/build-linux.yml +++ b/.github/workflows/build-linux.yml @@ -1,11 +1,11 @@ -name: Linux CI +name: Linux on: [push, pull_request] jobs: build-linux: name: Build Linux - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest strategy: fail-fast: false matrix: diff --git a/.github/workflows/build-mac.yml b/.github/workflows/build-mac.yml index a966378e6..1b1fc819e 100644 --- a/.github/workflows/build-mac.yml +++ b/.github/workflows/build-mac.yml @@ -1,11 +1,11 @@ -name: macOS CI +name: macOS on: [push, pull_request] jobs: build-mac-os: name: Build macOS - runs-on: macos-12 + runs-on: macos-latest strategy: fail-fast: false matrix: diff --git a/.github/workflows/build-mingw.yml b/.github/workflows/build-mingw.yml index 82b9d37cf..b5dc7ef40 100644 --- a/.github/workflows/build-mingw.yml +++ b/.github/workflows/build-mingw.yml @@ -1,11 +1,11 @@ -name: MinGW CI +name: Windows (MinGW) on: [push, pull_request] jobs: build-linux: name: Build MinGW - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest strategy: fail-fast: false matrix: diff --git a/.github/workflows/build-windows.yml b/.github/workflows/build-windows.yml index 4923539b9..3050be2c4 100644 --- a/.github/workflows/build-windows.yml +++ b/.github/workflows/build-windows.yml @@ -1,11 +1,11 @@ -name: Windows MSVC CI +name: Windows (MSVC) on: [push, pull_request] jobs: build-windows: name: Build Windows - runs-on: windows-2022 + runs-on: windows-latest strategy: fail-fast: false matrix: @@ -13,7 +13,6 @@ jobs: steps: - uses: actions/checkout@v4 - - uses: microsoft/setup-msbuild@v2 - name: Build ${{ matrix.platform }} diff --git a/MacOSX/QuakeSpasm.xcodeproj/project.pbxproj b/MacOSX/QuakeSpasm.xcodeproj/project.pbxproj index 6d16e3d5a..29ccd2aa7 100644 --- a/MacOSX/QuakeSpasm.xcodeproj/project.pbxproj +++ b/MacOSX/QuakeSpasm.xcodeproj/project.pbxproj @@ -1826,7 +1826,7 @@ "$(SRCROOT)", "$(SRCROOT)/codecs/lib", ); - MACOSX_DEPLOYMENT_TARGET = 10.9; + MACOSX_DEPLOYMENT_TARGET = 10.11; PRODUCT_NAME = "$(TARGET_NAME)"; VALID_ARCHS = x86_64; WRAPPER_EXTENSION = app; @@ -1869,7 +1869,7 @@ "$(SRCROOT)", "$(SRCROOT)/codecs/lib", ); - MACOSX_DEPLOYMENT_TARGET = 10.9; + MACOSX_DEPLOYMENT_TARGET = 10.11; PRODUCT_NAME = "$(TARGET_NAME)"; VALID_ARCHS = x86_64; WRAPPER_EXTENSION = app; diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_cpuinfo.h b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_cpuinfo.h index 518e31e99..967911f41 100644 --- a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_cpuinfo.h +++ b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_cpuinfo.h @@ -53,9 +53,11 @@ _m_prefetch(void *__P) #ifndef __MMX__ #define __MMX__ #endif +/* #ifndef __3dNOW__ #define __3dNOW__ #endif +*/ #endif #ifndef __SSE__ #define __SSE__ diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_endian.h b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_endian.h index 11ea6c663..c164a0783 100644 --- a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_endian.h +++ b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_endian.h @@ -59,7 +59,16 @@ _m_prefetch(void *__P) #ifdef __linux__ #include #define SDL_BYTEORDER __BYTE_ORDER -#elif defined(__OpenBSD__) +#elif defined(__sun) && defined(__SVR4) /* Solaris */ +#include +#if defined(_LITTLE_ENDIAN) +#define SDL_BYTEORDER SDL_LIL_ENDIAN +#elif defined(_BIG_ENDIAN) +#define SDL_BYTEORDER SDL_BIG_ENDIAN +#else +#error Unsupported endianness +#endif +#elif defined(__OpenBSD__) || defined(__DragonFly__) #include #define SDL_BYTEORDER BYTE_ORDER #elif defined(__FreeBSD__) || defined(__NetBSD__) @@ -79,7 +88,7 @@ _m_prefetch(void *__P) defined(__m68k__) || defined(mc68000) || defined(_M_M68K) || \ (defined(__MIPS__) && defined(__MIPSEB__)) || \ defined(__ppc__) || defined(__POWERPC__) || defined(__powerpc__) || defined(__PPC__) || \ - defined(__sparc__) + defined(__sparc__) || defined(__sparc) #define SDL_BYTEORDER SDL_BIG_ENDIAN #else #define SDL_BYTEORDER SDL_LIL_ENDIAN diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_revision.h b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_revision.h index 578d0b820..483e8ad8c 100644 --- a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_revision.h +++ b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_revision.h @@ -1,2 +1,2 @@ -#define SDL_REVISION "https://github.com/sezero/SDL.git@4217b3c97f36eaf44a9468c66b215e973905839f" +#define SDL_REVISION "https://github.com/sezero/SDL.git@b5fcddf2a00e8fafa25c66db19ce47b23ff11ba7" #define SDL_REVISION_NUMBER 0 diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_stdinc.h b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_stdinc.h index cc20e0913..cef9b778e 100644 --- a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_stdinc.h +++ b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_stdinc.h @@ -253,8 +253,8 @@ typedef uint64_t Uint64; #ifndef SDL_PRIs64 #if defined(__WIN32__) #define SDL_PRIs64 "I64d" -#elif defined(PRIs64) -#define SDL_PRIs64 PRIs64 +#elif defined(PRId64) +#define SDL_PRIs64 PRId64 #elif defined(__LP64__) && !defined(__APPLE__) #define SDL_PRIs64 "ld" #else @@ -706,6 +706,14 @@ size_t strlcpy(char* dst, const char* src, size_t size); size_t strlcat(char* dst, const char* src, size_t size); #endif +/* strdup is not ANSI but POSIX, and its prototype might be hidden... */ +char *strdup(const char *str); + +/* Starting LLVM 16, the analyser errors out if these functions do not have + their prototype defined (clang-diagnostic-implicit-function-declaration) */ +#include +#include + #define SDL_malloc malloc #define SDL_calloc calloc #define SDL_realloc realloc diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_vulkan.h b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_vulkan.h index ab86a0b86..a506ef456 100644 --- a/MacOSX/SDL2.framework/Versions/A/Headers/SDL_vulkan.h +++ b/MacOSX/SDL2.framework/Versions/A/Headers/SDL_vulkan.h @@ -52,6 +52,10 @@ extern "C" { VK_DEFINE_HANDLE(VkInstance) VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkSurfaceKHR) +/* Make sure to undef to avoid issues in case of later vulkan include */ +#undef VK_DEFINE_HANDLE +#undef VK_DEFINE_NON_DISPATCHABLE_HANDLE + #endif /* !NO_SDL_VULKAN_TYPEDEFS */ typedef VkInstance SDL_vulkanInstance; diff --git a/MacOSX/SDL2.framework/Versions/A/Headers/begin_code.h b/MacOSX/SDL2.framework/Versions/A/Headers/begin_code.h index 670556780..873d7ea36 100644 --- a/MacOSX/SDL2.framework/Versions/A/Headers/begin_code.h +++ b/MacOSX/SDL2.framework/Versions/A/Headers/begin_code.h @@ -170,7 +170,7 @@ (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202000L) #define SDL_FALLTHROUGH [[fallthrough]] #else -#if defined(__has_attribute) +#if defined(__has_attribute) && !defined(__SUNPRO_C) && !defined(__SUNPRO_CC) #define _HAS_FALLTHROUGH __has_attribute(__fallthrough__) #else #define _HAS_FALLTHROUGH 0 diff --git a/MacOSX/SDL2.framework/Versions/A/SDL2 b/MacOSX/SDL2.framework/Versions/A/SDL2 index 84248cbd3..0f4ae6b6b 100755 Binary files a/MacOSX/SDL2.framework/Versions/A/SDL2 and b/MacOSX/SDL2.framework/Versions/A/SDL2 differ diff --git a/Quake/bspfile.h b/Quake/bspfile.h index 9803b5791..f13c62a75 100644 --- a/Quake/bspfile.h +++ b/Quake/bspfile.h @@ -59,6 +59,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define BSPVERSION 29 +#ifdef BSP29_VALVE +#define BSPVERSION_VALVE 30 +#endif + /* RMQ support (2PSB). 32bits instead of shorts for all but bbox sizes (which * still use shorts) */ #define BSP2VERSION_2PSB (('B' << 24) | ('S' << 16) | ('P' << 8) | '2') diff --git a/Quake/common.c b/Quake/common.c index b4e6c047e..37767523b 100644 --- a/Quake/common.c +++ b/Quake/common.c @@ -188,7 +188,7 @@ void Vec_Append (void **pvec, size_t element_size, const void *data, size_t coun if (!count) return; Vec_Grow (pvec, element_size, count); - memcpy ((byte *)*pvec + VEC_HEADER(*pvec).size, data, count * element_size); + memcpy ((byte *)*pvec + VEC_HEADER(*pvec).size * element_size, data, count * element_size); VEC_HEADER(*pvec).size += count; } @@ -294,6 +294,14 @@ char *q_strupr (char *str) return str; } +char *q_strdup (const char *str) +{ + size_t len = strlen (str) + 1; + char *newstr = (char *)malloc (len); + memcpy (newstr, str, len); + return newstr; +} + /* platform dependant (v)snprintf function names: */ #if defined(_WIN32) #define snprintf_func _snprintf @@ -1138,7 +1146,7 @@ void COM_FileBase (const char *in, char *out, size_t outsize) dot = NULL; while (*s) { - if (*s == '/') + if (*s == '/' || *s == '\\') slash = s + 1; if (*s == '.') dot = s; diff --git a/Quake/common.h b/Quake/common.h index 02b5d5146..228eacc9f 100644 --- a/Quake/common.h +++ b/Quake/common.h @@ -231,6 +231,9 @@ extern char *q_strcasestr(const char *haystack, const char *needle); extern char *q_strlwr (char *str); extern char *q_strupr (char *str); +// strdup that calls malloc +extern char *q_strdup (const char *str); + /* snprintf, vsnprintf : always use our versions. */ extern int q_snprintf (char *str, size_t size, const char *format, ...) FUNC_PRINTF(3,4); extern int q_vsnprintf(char *str, size_t size, const char *format, va_list args) FUNC_PRINTF(3,0); diff --git a/Quake/gl_model.c b/Quake/gl_model.c index cc12d27bf..ea6a68b35 100644 --- a/Quake/gl_model.c +++ b/Quake/gl_model.c @@ -38,6 +38,7 @@ static void Mod_Print (void); static cvar_t external_ents = {"external_ents", "1", CVAR_ARCHIVE}; static cvar_t external_vis = {"external_vis", "1", CVAR_ARCHIVE}; +static cvar_t external_textures = {"external_textures", "1", CVAR_ARCHIVE}; static byte *mod_novis; static int mod_novis_capacity; @@ -62,6 +63,7 @@ void Mod_Init (void) Cvar_RegisterVariable (&gl_subdivide_size); Cvar_RegisterVariable (&external_vis); Cvar_RegisterVariable (&external_ents); + Cvar_RegisterVariable (&external_textures); Cmd_AddCommand ("mcache", Mod_Print); @@ -408,6 +410,173 @@ qmodel_t *Mod_ForName (const char *name, qboolean crash) static byte *mod_base; +/* +============= +Mod_LoadWadFiles + +load all of the wads listed in the worldspawn "wad" field +============= +*/ +static wad_t *Mod_LoadWadFiles (qmodel_t *mod) +{ + char key[128], value[4096]; + const char *data; + + if (!external_textures.value) + return NULL; + + // disregard if this isn't the world model + if (strcmp (mod->name, sv.modelname)) + return NULL; + + data = COM_Parse (mod->entities); + if (!data) + return NULL; // error + if (com_token[0] != '{') + return NULL; // error + while (1) + { + data = COM_Parse (data); + if (!data) + return NULL; // error + if (com_token[0] == '}') + break; // end of worldspawn + if (com_token[0] == '_') + q_strlcpy (key, com_token + 1, sizeof (key)); + else + q_strlcpy (key, com_token, sizeof (key)); + while (key[0] && key[strlen (key) - 1] == ' ') // remove trailing spaces + key[strlen (key) - 1] = 0; + data = COM_ParseEx (data, CPE_ALLOWTRUNC); + if (!data) + return NULL; // error + q_strlcpy (value, com_token, sizeof (value)); + + if (!strcmp ("wad", key)) + { + return W_LoadWadList (value); + } + } + return NULL; +} + +/* +================= +Mod_LoadWadTexture + +look for an external texture in any of the loaded map wads +================= +*/ +static texture_t *Mod_LoadWadTexture (qmodel_t *mod, wad_t *wads, const char *name, qboolean *out_pal, int *out_pixels) +{ + int i, pixels, palette, tex_bytes, lump_bytes, pixels_pos, palette_pos; + lumpinfo_t *info; + wad_t *wad; + miptex_t mt; + texture_t *tx; + qboolean pal; + unsigned short colors; + + // look for the lump in any of the loaded wads + info = W_GetLumpinfoList (wads, name, &wad); + + // ensure we're dealing with a miptex + if (!info || (info->type != TYP_MIPTEX && (wad->id != WADID_VALVE || info->type != TYP_MIPTEX_PALETTE))) + { + Con_Warning ("Missing texture %s in %s!\n", name, mod->name); + return NULL; + } + + // override the texture from the bsp file + FS_fseek (&wad->fh, info->filepos, SEEK_SET); + FS_fread (&mt, 1, sizeof (miptex_t), &wad->fh); + + mt.width = LittleLong (mt.width); + mt.height = LittleLong (mt.height); + for (i = 0; i < MIPLEVELS; i++) + mt.offsets[i] = LittleLong (mt.offsets[i]); + + if (mt.width == 0 || mt.height == 0) + { + Con_Warning ("Zero sized texture %s in %s!\n", mt.name, wad->name); + return NULL; + } + + if ((mt.width & 15) || (mt.height & 15)) + { + if (mod->bspversion != BSPVERSION_QUAKE64) + Con_Warning ("Texture %s (%d x %d) is not 16 aligned\n", mt.name, mt.width, mt.height); + return NULL; + } + + pal = wad->id == WADID_VALVE && info->type == TYP_MIPTEX_PALETTE; + + pixels = mt.width * mt.height; // only copy the first mip, the rest are auto-generated + pixels_pos = info->filepos + sizeof (miptex_t); + // valve textures have a color palette immediately following the pixels + if (pal) + { + palette_pos = pixels_pos + pixels / 64 * 85; + + // add space for the color count + palette = 2; + + if ((pixels / 64 * 85 + 2) <= info->size) + { + // the palette is basically garunteed to be 256 colors but, + // we might as well use the value since it *does* exist + FS_fseek (&wad->fh, palette_pos, SEEK_SET); + FS_fread (&colors, 1, 2, &wad->fh); + colors = LittleShort (colors); + // add space for the color palette + palette += colors * 3; + } + + tex_bytes = pixels + palette; + lump_bytes = pixels / 64 * 85 + palette; + } + else + { + palette_pos = 0; + palette = 0; + tex_bytes = pixels; + lump_bytes = pixels; + } + tx = (texture_t *)Hunk_AllocName (sizeof (texture_t) + tex_bytes, loadname); + + memcpy (tx->name, mt.name, sizeof (tx->name)); + tx->width = mt.width; + tx->height = mt.height; + // the pixels immediately follow the structures + + // check for pixels extending past the end of the lump + if (lump_bytes > info->size) + { + Con_DPrintf ("Texture %s extends past end of lump\n", mt.name); + lump_bytes = info->size; + if (pal) + palette = q_min(palette, q_max(0, lump_bytes - pixels / 64 * 85)); + pixels = q_min(pixels, lump_bytes); + } + + tx->update_warp = false; //johnfitz + tx->warpimage = NULL; //johnfitz + tx->fullbright = NULL; //johnfitz + tx->shift = 0; // Q64 only + + FS_fseek (&wad->fh, pixels_pos, SEEK_SET); + FS_fread (tx + 1, 1, pixels, &wad->fh); + if (pal && palette) + { + FS_fseek (&wad->fh, palette_pos, SEEK_SET); + FS_fread ((byte *)(tx + 1) + pixels, 1, palette, &wad->fh); + } + + *out_pal = pal; + *out_pixels = pixels; + return tx; +} + /* ================= Mod_CheckFullbrights -- johnfitz @@ -424,6 +593,18 @@ static qboolean Mod_CheckFullbrights (byte *pixels, int count) return false; } +/* +================= +Mod_CheckFullbrightsValve +================= +*/ +static qboolean Mod_CheckFullbrightsValve (char *name, byte *pixels, int count) +{ + if (name[0] == '~' || (name[2] == '~' && name[0] == '+')) + return Mod_CheckFullbrights (pixels, count); + return false; +} + /* ================= Mod_CheckAnimTextureArrayQ64 @@ -451,7 +632,7 @@ Mod_LoadTextures */ static void Mod_LoadTextures (lump_t *l) { - int i, j, pixels, num, maxanim, altmax; + int i, j, pixels, num, maxanim, altmax, tex_bytes, lump_bytes; miptex_t *mt; texture_t *tx, *tx2; texture_t *anims[10]; @@ -467,6 +648,17 @@ static void Mod_LoadTextures (lump_t *l) extern byte *hunk_base; //johnfitz unsigned int flags; + wad_t *wads; + qboolean from_wad; + enum srcformat fmt; + qboolean fbright; + const char *source_file; +#ifdef BSP29_VALVE + int palette; + byte *palette_p; + unsigned short colors; +#endif + qboolean pal; //johnfitz -- don't return early if no textures; still need to create dummy texture if (!l->filelen) @@ -486,6 +678,9 @@ static void Mod_LoadTextures (lump_t *l) loadmodel->numtextures = nummiptex + 2; //johnfitz -- need 2 dummy texture chains for missing textures loadmodel->textures = (texture_t **) Hunk_AllocName (loadmodel->numtextures * sizeof(*loadmodel->textures) , loadname); + // load any wads this map may need to load external textures from + wads = Mod_LoadWadFiles (loadmodel); + for (i=0 ; idataofs[i] = LittleLong(m->dataofs[i]); @@ -508,9 +703,58 @@ static void Mod_LoadTextures (lump_t *l) if (loadmodel->bspversion != BSPVERSION_QUAKE64) Con_Warning ("Texture %s (%d x %d) is not 16 aligned\n", mt->name, mt->width, mt->height); } + // an offset of zero indicates an external texture + from_wad = mt->offsets[0] == 0; + + if (from_wad) + { + tx = (texture_t *)Mod_LoadWadTexture (loadmodel, wads, mt->name, &pal, &pixels); + if (!tx) + continue; + loadmodel->textures[i] = tx; + goto _load_texture; + } + +#ifdef BSP29_VALVE + pal = loadmodel->bspversion == BSPVERSION_VALVE; +#else + pal = false; +#endif pixels = mt->width*mt->height; // only copy the first mip, the rest are auto-generated - tx = (texture_t *) Hunk_AllocName (sizeof(texture_t) +pixels, loadname ); +#ifdef BSP29_VALVE + // valve textures have a color palette immediately following the pixels + if (pal) + { + palette_p = (byte *)(mt + 1) + pixels / 64 * 85; + + // add space for the color count + palette = 2; + + if ((palette_p + 2) <= (mod_base + l->fileofs + l->filelen)) + { + // the palette is basically garunteed to be 256 colors but, + // we might as well use the value since it *does* exist + memcpy (&colors, palette_p, 2); + colors = LittleShort (colors); + // add space for the color palette + palette += colors * 3; + } + + tex_bytes = pixels + palette; + lump_bytes = pixels / 64 * 85 + palette; + } + else +#endif + { +#ifdef BSP29_VALVE + palette_p = NULL; + palette = 0; +#endif + tex_bytes = pixels; + lump_bytes = pixels; + } + tx = (texture_t *) Hunk_AllocName (sizeof(texture_t) +tex_bytes, loadname ); loadmodel->textures[i] = tx; memcpy (tx->name, mt->name, sizeof(tx->name)); @@ -522,10 +766,15 @@ static void Mod_LoadTextures (lump_t *l) // appears in the wild; e.g. jam2_tronyn.bsp (func_mapjam2), // kellbase1.bsp (quoth), and can lead to a segfault if we read past // the end of the .bsp file buffer - if (((byte*)(mt+1) + pixels) > (mod_base + l->fileofs + l->filelen)) + if (((byte*)(mt+1) + lump_bytes) > (mod_base + l->fileofs + l->filelen)) { Con_DPrintf("Texture %s extends past end of lump\n", mt->name); - pixels = q_max(0L, (long)((mod_base + l->fileofs + l->filelen) - (byte*)(mt+1))); + lump_bytes = q_max(0L, (long)((mod_base + l->fileofs + l->filelen) - (byte*)(mt+1))); +#ifdef BSP29_VALVE + if (pal) + palette = q_min(palette, q_max(0, lump_bytes - pixels / 64 * 85)); +#endif + pixels = q_min(pixels, lump_bytes); } tx->update_warp = false; //johnfitz @@ -536,6 +785,10 @@ static void Mod_LoadTextures (lump_t *l) if (loadmodel->bspversion != BSPVERSION_QUAKE64) { memcpy ( tx+1, mt+1, pixels); +#ifdef BSP29_VALVE + if (pal && palette) + memcpy ((byte *)(tx + 1) + pixels, palette_p, palette); +#endif } else { // Q64 bsp @@ -544,17 +797,23 @@ static void Mod_LoadTextures (lump_t *l) memcpy ( tx+1, mt64+1, pixels); } +_load_texture: + //johnfitz -- lots of changes if (!isDedicated) //no texture uploading for dedicated server { +#ifdef BSP29_VALVE + if (loadmodel->bspversion != BSPVERSION_VALVE && !q_strncasecmp(tx->name,"sky",3)) +#else if (!q_strncasecmp(tx->name,"sky",3)) //sky texture //also note -- was Q_strncmp, changed to match qbsp +#endif { if (loadmodel->bspversion == BSPVERSION_QUAKE64) Sky_LoadTextureQ64 (loadmodel, tx); else Sky_LoadTexture (loadmodel, tx); } - else if (tx->name[0] == '*') //warping texture + else if (tx->name[0] == '*' || tx->name[0] == '!') //warping texture { //external textures -- first look in "textures/mapname/" then look in "textures/" mark = Hunk_LowMark(); @@ -577,9 +836,22 @@ static void Mod_LoadTextures (lump_t *l) else //use the texture from the bsp file { q_snprintf (texturename, sizeof(texturename), "%s:%s", loadmodel->name, tx->name); - offset = (src_offset_t)(mt+1) - (src_offset_t)mod_base; + + if (from_wad || pal) + { + source_file = ""; + offset = (src_offset_t)(tx + 1); + } + else + { + source_file = loadmodel->name; + offset = (src_offset_t)(mt+1) - (src_offset_t)mod_base; + } + + fmt = pal ? SRC_INDEXED_PALETTE : SRC_INDEXED; + tx->gltexture = TexMgr_LoadImage (loadmodel, texturename, tx->width, tx->height, - SRC_INDEXED, (byte *)(tx+1), loadmodel->name, offset, TEXPREF_NONE); + fmt, (byte *)(tx+1), source_file, offset, TEXPREF_NONE); } //now create the warpimage, using dummy data from the hunk to create the initial image @@ -638,19 +910,41 @@ static void Mod_LoadTextures (lump_t *l) else //use the texture from the bsp file { q_snprintf (texturename, sizeof(texturename), "%s:%s", loadmodel->name, tx->name); - offset = (src_offset_t)(mt+1) - (src_offset_t)mod_base; - if (Mod_CheckFullbrights ((byte *)(tx+1), pixels)) + + if (from_wad || pal) + { + source_file = ""; + offset = (src_offset_t)(tx + 1); + } + else + { + source_file = loadmodel->name; + offset = (src_offset_t)(mt+1) - (src_offset_t)mod_base; + } + + if (pal) + { + fmt = SRC_INDEXED_PALETTE; + fbright = Mod_CheckFullbrightsValve (tx->name, (byte *)(tx + 1), pixels); + } + else + { + fmt = SRC_INDEXED; + fbright = Mod_CheckFullbrights ((byte *)(tx + 1), pixels); + } + + if (fbright) { tx->gltexture = TexMgr_LoadImage (loadmodel, texturename, tx->width, tx->height, - SRC_INDEXED, (byte *)(tx+1), loadmodel->name, offset, TEXPREF_MIPMAP | TEXPREF_NOBRIGHT | extraflags); + fmt, (byte *)(tx+1), source_file, offset, TEXPREF_MIPMAP | TEXPREF_NOBRIGHT | extraflags); q_snprintf (texturename, sizeof(texturename), "%s:%s_glow", loadmodel->name, tx->name); tx->fullbright = TexMgr_LoadImage (loadmodel, texturename, tx->width, tx->height, - SRC_INDEXED, (byte *)(tx+1), loadmodel->name, offset, TEXPREF_MIPMAP | TEXPREF_FULLBRIGHT | extraflags); + fmt, (byte *)(tx+1), source_file, offset, TEXPREF_MIPMAP | TEXPREF_FULLBRIGHT | extraflags); } else { tx->gltexture = TexMgr_LoadImage (loadmodel, texturename, tx->width, tx->height, - SRC_INDEXED, (byte *)(tx+1), loadmodel->name, offset, TEXPREF_MIPMAP | extraflags); + fmt, (byte *)(tx+1), source_file, offset, TEXPREF_MIPMAP | extraflags); } } Hunk_FreeToLowMark (mark); @@ -659,6 +953,9 @@ static void Mod_LoadTextures (lump_t *l) //johnfitz } + // we no longer need the wads after this point + W_FreeWadList (wads); + //johnfitz -- last 2 slots in array should be filled with dummy textures loadmodel->textures[loadmodel->numtextures-2] = r_notexture_mip; //for lightmapped surfs loadmodel->textures[loadmodel->numtextures-1] = r_notexture_mip2; //for SURF_DRAWTILED surfs @@ -842,6 +1139,16 @@ static void Mod_LoadLighting (lump_t *l) return; } +#ifdef BSP29_VALVE + if (loadmodel->bspversion == BSPVERSION_VALVE) + { + // lightmap samples are already stored as rgb + loadmodel->lightdata = (byte *)Hunk_AllocName (l->filelen, litfilename); + memcpy (loadmodel->lightdata, mod_base + l->fileofs, l->filelen); + return; + } +#endif + loadmodel->lightdata = (byte *) Hunk_AllocName ( l->filelen*3, litfilename); in = loadmodel->lightdata + l->filelen*2; // place the file at the end, so it will not be overwritten until the very last write out = loadmodel->lightdata; @@ -1302,6 +1609,10 @@ static void Mod_LoadFaces (lump_t *l, qboolean bsp2) if (lofs == -1) out->samples = NULL; +#ifdef BSP29_VALVE + else if (loadmodel->bspversion == BSPVERSION_VALVE) + out->samples = loadmodel->lightdata + lofs; // accounts for RGB light data +#endif else out->samples = loadmodel->lightdata + (lofs * 3); //johnfitz -- lit support via lordhavoc (was "+ i") @@ -1311,7 +1622,7 @@ static void Mod_LoadFaces (lump_t *l, qboolean bsp2) out->flags |= (SURF_DRAWSKY | SURF_DRAWTILED); Mod_PolyForUnlitSurface (out); //no more subdivision } - else if (out->texinfo->texture->name[0] == '*') // warp surface + else if (out->texinfo->texture->name[0] == '*' || out->texinfo->texture->name[0] == '!') // warp surface { out->flags |= SURF_DRAWTURB; if (out->texinfo->flags & TEX_SPECIAL) @@ -2199,6 +2510,11 @@ static void Mod_LoadBrushModel (qmodel_t *mod, void *buffer) case BSPVERSION: bsp2 = false; break; +#ifdef BSP29_VALVE + case BSPVERSION_VALVE: + bsp2 = false; + break; +#endif case BSP2VERSION_2PSB: bsp2 = 1; //first iteration break; @@ -2224,6 +2540,7 @@ static void Mod_LoadBrushModel (qmodel_t *mod, void *buffer) Mod_LoadVertexes (&header->lumps[LUMP_VERTEXES]); Mod_LoadEdges (&header->lumps[LUMP_EDGES], bsp2); Mod_LoadSurfedges (&header->lumps[LUMP_SURFEDGES]); + Mod_LoadEntities (&header->lumps[LUMP_ENTITIES]); Mod_LoadTextures (&header->lumps[LUMP_TEXTURES]); Mod_LoadLighting (&header->lumps[LUMP_LIGHTING]); Mod_LoadPlanes (&header->lumps[LUMP_PLANES]); @@ -2259,7 +2576,6 @@ static void Mod_LoadBrushModel (qmodel_t *mod, void *buffer) visdone: Mod_LoadNodes (&header->lumps[LUMP_NODES], bsp2); Mod_LoadClipnodes (&header->lumps[LUMP_CLIPNODES], bsp2); - Mod_LoadEntities (&header->lumps[LUMP_ENTITIES]); Mod_LoadSubmodels (&header->lumps[LUMP_MODELS]); Mod_MakeHull0 (); diff --git a/Quake/gl_texmgr.c b/Quake/gl_texmgr.c index b862096ac..fe2ad2100 100644 --- a/Quake/gl_texmgr.c +++ b/Quake/gl_texmgr.c @@ -531,6 +531,80 @@ void TexMgr_LoadPalette (void) Hunk_FreeToLowMark (mark); } +/* +================= +TexMgr_LoadMiptexPalette -- convert a 24bit color palette to 32bit +================= +*/ +static void TexMgr_LoadMiptexPalette (byte *in, byte *out, int numcolors, unsigned flags) +{ + extern cvar_t gl_fullbrights; + int i, numnobright; + + if (numcolors == 0) + return; + + if (!(flags & (TEXPREF_FULLBRIGHT | TEXPREF_NOBRIGHT))) + { + for (i = 0; i < numcolors; i++) + { + *out++ = *in++; + *out++ = *in++; + *out++ = *in++; + *out++ = 255; + } + } + else + { + numnobright = q_min (224, numcolors); + if (flags & TEXPREF_NOBRIGHT) + { + // nobright palette + if (!gl_fullbrights.value) + numnobright = numcolors; + for (i = 0; i < numnobright; i++) + { + *out++ = *in++; + *out++ = *in++; + *out++ = *in++; + *out++ = 255; + } + // 224-255 are black (for additive blending) + for (i = numnobright; i < numcolors; i++) + { + *out++ = 0; + *out++ = 0; + *out++ = 0; + *out++ = 255; + } + } + else + { + // fullbright palette + // 0-223 are black (for additive blending) + for (i = 0; i < numnobright; i++) + { + *out++ = 0; + *out++ = 0; + *out++ = 0; + *out++ = 255; + } + in += numnobright * 3; + for (i = numnobright; i < numcolors; i++) + { + *out++ = *in++; + *out++ = *in++; + *out++ = *in++; + *out++ = 255; + } + } + } + + // 255 is transparent + if (flags & TEXPREF_ALPHA) + out[-1] = 0; +} + /* ================ TexMgr_NewGame @@ -1077,12 +1151,11 @@ static void TexMgr_LoadImage32 (gltexture_t *glt, unsigned *data) TexMgr_LoadImage8 -- handles 8bit source data, then passes it to LoadImage32 ================ */ -static void TexMgr_LoadImage8 (gltexture_t *glt, byte *data) +static void TexMgr_LoadImage8 (gltexture_t *glt, byte *data, unsigned int *usepal) { extern cvar_t gl_fullbrights; qboolean padw = false, padh = false; - byte padbyte; - unsigned int *usepal; + byte padbyte = 0; int i; // HACK HACK HACK -- taken from tomazquake @@ -1107,31 +1180,34 @@ static void TexMgr_LoadImage8 (gltexture_t *glt, byte *data) } // choose palette and padbyte - if (glt->flags & TEXPREF_FULLBRIGHT) - { - if (glt->flags & TEXPREF_ALPHA) - usepal = d_8to24table_fbright_fence; - else - usepal = d_8to24table_fbright; - padbyte = 0; - } - else if (glt->flags & TEXPREF_NOBRIGHT && gl_fullbrights.value) + if (!usepal) { - if (glt->flags & TEXPREF_ALPHA) - usepal = d_8to24table_nobright_fence; + if (glt->flags & TEXPREF_FULLBRIGHT) + { + if (glt->flags & TEXPREF_ALPHA) + usepal = d_8to24table_fbright_fence; + else + usepal = d_8to24table_fbright; + padbyte = 0; + } + else if (glt->flags & TEXPREF_NOBRIGHT && gl_fullbrights.value) + { + if (glt->flags & TEXPREF_ALPHA) + usepal = d_8to24table_nobright_fence; + else + usepal = d_8to24table_nobright; + padbyte = 0; + } + else if (glt->flags & TEXPREF_CONCHARS) + { + usepal = d_8to24table_conchars; + padbyte = 0; + } else - usepal = d_8to24table_nobright; - padbyte = 0; - } - else if (glt->flags & TEXPREF_CONCHARS) - { - usepal = d_8to24table_conchars; - padbyte = 0; - } - else - { - usepal = d_8to24table; - padbyte = 255; + { + usepal = d_8to24table; + padbyte = 255; + } } // pad each dimention, but only if it's not going to be downsampled later @@ -1188,6 +1264,26 @@ static void TexMgr_LoadLightmap (gltexture_t *glt, byte *data) TexMgr_SetFilterModes (glt); } +/* +================ +TexMgr_LoadImage8Valve +================ +*/ +static void TexMgr_LoadImage8Valve (gltexture_t *glt, byte *data) +{ + byte *in, *usepal; + unsigned short colors; + + in = data + glt->source_width * glt->source_height; + + memcpy (&colors, in, 2); + colors = LittleShort (colors); + + usepal = (byte *)Hunk_Alloc (colors * 4); + TexMgr_LoadMiptexPalette (in + 2, usepal, colors, glt->flags); + TexMgr_LoadImage8 (glt, data, (unsigned *)usepal); +} + /* ================ TexMgr_LoadImage -- the one entry point for loading all textures @@ -1207,6 +1303,7 @@ gltexture_t *TexMgr_LoadImage (qmodel_t *owner, const char *name, int width, int switch (format) { case SRC_INDEXED: + case SRC_INDEXED_PALETTE: crc = CRC_Block(data, width * height); break; case SRC_LIGHTMAP: @@ -1247,7 +1344,7 @@ gltexture_t *TexMgr_LoadImage (qmodel_t *owner, const char *name, int width, int switch (glt->source_format) { case SRC_INDEXED: - TexMgr_LoadImage8 (glt, data); + TexMgr_LoadImage8 (glt, data, NULL); break; case SRC_LIGHTMAP: TexMgr_LoadLightmap (glt, data); @@ -1255,6 +1352,9 @@ gltexture_t *TexMgr_LoadImage (qmodel_t *owner, const char *name, int width, int case SRC_RGBA: TexMgr_LoadImage32 (glt, (unsigned *)data); break; + case SRC_INDEXED_PALETTE: + TexMgr_LoadImage8Valve (glt, data); + break; } Hunk_FreeToLowMark(mark); @@ -1384,7 +1484,7 @@ invalid: Con_Printf ("TexMgr_ReloadImage: invalid source for %s\n", glt->name); switch (glt->source_format) { case SRC_INDEXED: - TexMgr_LoadImage8 (glt, data); + TexMgr_LoadImage8 (glt, data, NULL); break; case SRC_LIGHTMAP: TexMgr_LoadLightmap (glt, data); @@ -1392,6 +1492,9 @@ invalid: Con_Printf ("TexMgr_ReloadImage: invalid source for %s\n", glt->name); case SRC_RGBA: TexMgr_LoadImage32 (glt, (unsigned *)data); break; + case SRC_INDEXED_PALETTE: + TexMgr_LoadImage8Valve (glt, data); + break; } Hunk_FreeToLowMark(mark); diff --git a/Quake/gl_texmgr.h b/Quake/gl_texmgr.h index 91d0562ee..c3bfc83d6 100644 --- a/Quake/gl_texmgr.h +++ b/Quake/gl_texmgr.h @@ -39,7 +39,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define TEXPREF_CONCHARS 0x0400 // use conchars palette #define TEXPREF_WARPIMAGE 0x0800 // resize this texture when warpimagesize changes -enum srcformat {SRC_INDEXED, SRC_LIGHTMAP, SRC_RGBA}; +enum srcformat {SRC_INDEXED, SRC_LIGHTMAP, SRC_RGBA, SRC_INDEXED_PALETTE}; typedef uintptr_t src_offset_t; diff --git a/Quake/quakedef.h b/Quake/quakedef.h index 674374be1..5c465279b 100644 --- a/Quake/quakedef.h +++ b/Quake/quakedef.h @@ -52,6 +52,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define GAMENAME "id1" // directory to look in by default +#define BSP29_VALVE // enable Half-Life map support + #include "q_stdinc.h" // !!! if this is changed, it must be changed in d_ifacea.h too !!! diff --git a/Quake/sys_sdl_unix.c b/Quake/sys_sdl_unix.c index 58f7316b5..127cb875a 100644 --- a/Quake/sys_sdl_unix.c +++ b/Quake/sys_sdl_unix.c @@ -251,16 +251,48 @@ static char userdir[MAX_OSPATH]; #define SYS_USERDIR ".quakespasm" #endif +static qboolean Sys_GetUserdirArgs (int argc, char **argv, char *dst, size_t dstsize) +{ + int i = 1; + for (; i < argc - 1; ++i) + { + if (strcmp(argv[i], "-userdir") == 0) + { + char *p = dst; + const char * arg = argv[i + 1]; + const int n = (int)strlen(arg); + if (n < 1) Sys_Error("Bad argument to -userdir"); + if (q_strlcpy(dst, arg, dstsize) >= dstsize) + Sys_Error ("Insufficient array size for userspace directory"); + if (dst[n - 1] == '/') dst[n - 1] = 0; + if (*p == '/') p++; + for (; *p; p++) { + const char c = *p; + if (c == '/') { + *p = 0; + Sys_mkdir (dst); + *p = c; + } + } + return true; + } + } + return false; +} + #ifdef PLATFORM_HAIKU #include #include -static void Sys_GetUserdir (char *dst, size_t dstsize) +static void Sys_GetUserdir (int argc, char **argv, char *dst, size_t dstsize) { dev_t volume = dev_for_path("/boot"); char buffer[B_PATH_NAME_LENGTH]; status_t result; + if (Sys_GetUserdirArgs(argc, argv, dst, dstsize)) + return; + result = find_directory(B_USER_NONPACKAGED_DATA_DIRECTORY, volume, false, buffer, sizeof(buffer)); if (result != B_OK) Sys_Error ("Couldn't determine userspace directory"); @@ -268,12 +300,15 @@ static void Sys_GetUserdir (char *dst, size_t dstsize) q_snprintf (dst, dstsize, "%s/%s", buffer, SYS_USERDIR); } #else -static void Sys_GetUserdir (char *dst, size_t dstsize) +static void Sys_GetUserdir (int argc, char **argv, char *dst, size_t dstsize) { size_t n; const char *home_dir = NULL; struct passwd *pwent; + if (Sys_GetUserdirArgs(argc, argv, dst, dstsize)) + return; + pwent = getpwuid( getuid() ); if (pwent == NULL) perror("getpwuid"); @@ -388,7 +423,7 @@ void Sys_Init (void) host_parms->userdir = host_parms->basedir; /* code elsewhere relies on this ! */ #else memset (userdir, 0, sizeof(userdir)); - Sys_GetUserdir(userdir, sizeof(userdir)); + Sys_GetUserdir (host_parms->argc, host_parms->argv, userdir, sizeof(userdir)); Sys_mkdir (userdir); host_parms->userdir = userdir; #endif diff --git a/Quake/wad.c b/Quake/wad.c index aae5f38f1..9cc329bfb 100644 --- a/Quake/wad.c +++ b/Quake/wad.c @@ -111,7 +111,7 @@ void W_LoadWadFile (void) //johnfitz -- filename is now hard-coded for honesty W_GetLumpinfo ============= */ -lumpinfo_t *W_GetLumpinfo (const char *name) +static lumpinfo_t *W_GetLumpinfo (lumpinfo_t *lumps, int numlumps, const char *name) { int i; lumpinfo_t *lump_p; @@ -119,7 +119,7 @@ lumpinfo_t *W_GetLumpinfo (const char *name) W_CleanupName (name, clean); - for (lump_p=wad_lumps, i=0 ; iname)) return lump_p; @@ -133,7 +133,7 @@ void *W_GetLumpName (const char *name) { lumpinfo_t *lump; - lump = W_GetLumpinfo (name); + lump = W_GetLumpinfo (wad_lumps, wad_numlumps, name); if (!lump) return NULL; //johnfitz @@ -152,6 +152,209 @@ void *W_GetLumpNum (int num) return (void *)(wad_base + lump->filepos); } +/* +================= +W_OpenWadFile +================= +*/ +static qboolean W_OpenWadFile (const char *filename, fshandle_t *fh) +{ + FILE *f; + long length; + + length = (long)COM_FOpenFile (filename, &f, NULL); + if (length == -1) + return false; + + fh->file = f; + fh->start = ftell (f); + fh->pos = 0; + fh->length = length; + fh->pak = file_from_pak; + return true; +} + +/* +================= +W_AddWadFile +================= +*/ +static wad_t *W_AddWadFile (const char *name, fshandle_t *fh) +{ + int i, id, numlumps, infotableofs, disksize; + wadinfo_t header; + lumpinfo_t *lumps, *info; + wad_t *wad; + + FS_fread ((void *)&header, 1, sizeof (header), fh); + + id = LittleLong (header.identification[0] | (header.identification[1] << 8) + | (header.identification[2] << 16) | (header.identification[3] << 24)); + if (id != WADID && id != WADID_VALVE) + { + Con_Warning ("%s is not a valid WAD\n", name); + return NULL; + } + + numlumps = LittleLong (header.numlumps); + infotableofs = LittleLong (header.infotableofs); + + if (numlumps < 0 || infotableofs < 0) + { + Con_Warning ("%s is not a valid WAD (%i lumps, %i info table offset)\n", name, numlumps, infotableofs); + return NULL; + } + if (!numlumps) + { + Con_DPrintf2 ("WAD file %s has no lumps, ignored\n", name); + return NULL; + } + + lumps = (lumpinfo_t *)malloc (numlumps * sizeof (lumpinfo_t)); + + FS_fseek (fh, infotableofs, SEEK_SET); + FS_fread (lumps, 1, numlumps * sizeof (lumpinfo_t), fh); + + // parse the directory + for (i = 0, info = lumps; i < numlumps; i++, info++) + { + W_CleanupName (info->name, info->name); + info->filepos = LittleLong (info->filepos); + info->size = LittleLong (info->size); + disksize = LittleLong (info->disksize); + + if (info->filepos + info->size > fh->length && !(info->filepos + disksize > fh->length)) + info->size = disksize; + + // ensure lump sanity + if (info->filepos < 0 || info->size < 0 || info->filepos + info->size > fh->length) + { + if (info->filepos > fh->length || info->size < 0) + { + Con_Warning ("WAD file %s lump \"%.16s\" begins %li bytes beyond end of WAD\n", name, info->name, info->filepos - fh->length); + + info->filepos = 0; + info->size = q_max (0, info->size - info->filepos); + } + else + { + Con_Warning ( + "WAD file %s lump \"%.16s\" extends %li bytes beyond end of WAD (lump size is %i)\n", name, info->name, + (info->filepos + info->size) - fh->length, info->size); + + info->size = q_max (0, info->size - info->filepos); + } + } + } + + wad = (wad_t *)malloc (sizeof (wad_t)); + q_strlcpy (wad->name, name, sizeof (wad->name)); + wad->id = id; + wad->fh = *fh; + wad->numlumps = numlumps; + wad->lumps = lumps; + + Con_DPrintf ("%s\n", name); + return wad; +} + +/* +================= +W_LoadWadList +================= +*/ +wad_t *W_LoadWadList (const char *names) +{ + char *newnames = q_strdup (names); + char *name, *e; + wad_t *wad, *wads = NULL; + char filename[MAX_QPATH]; + fshandle_t fh; + + for (name = newnames; name && *name;) + { + e = strchr (name, ';'); + if (e) + *e++ = 0; + + // remove all of the leading garbage left by the map editor + COM_FileBase (name, filename, sizeof (filename)); + COM_AddExtension (filename, ".wad", sizeof (filename)); + + if (!W_OpenWadFile (filename, &fh)) + { + // try the "gfx" directory + memmove (filename + 4, filename, sizeof (filename) - 4); + memcpy (filename, "gfx/", 4); + filename[sizeof (filename) - 1] = 0; + + if (!W_OpenWadFile (filename, &fh)) + { + name = e; + continue; + } + } + + wad = W_AddWadFile (filename, &fh); + if (wad) + { + wad->next = wads; + wads = wad; + } + else + FS_fclose (&fh); + + name = e; + } + free (newnames); + + return wads; +} + +/* +================= +W_FreeWadList +================= +*/ +void W_FreeWadList (wad_t *wads) +{ + wad_t *next; + + while (wads) + { + FS_fclose (&wads->fh); + free (wads->lumps); + + next = wads->next; + free (wads); + wads = next; + } +} + +/* +================= +W_GetLumpinfoList +================= +*/ +lumpinfo_t *W_GetLumpinfoList (wad_t *wads, const char *name, wad_t **out_wad) +{ + lumpinfo_t *info; + + while (wads) + { + info = W_GetLumpinfo (wads->lumps, wads->numlumps, name); + if (info) + { + *out_wad = wads; + return info; + } + + wads = wads->next; + } + + return NULL; +} + /* ============================================================================= diff --git a/Quake/wad.h b/Quake/wad.h index 8838e0eac..856d34c0a 100644 --- a/Quake/wad.h +++ b/Quake/wad.h @@ -38,8 +38,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define TYP_QTEX 65 #define TYP_QPIC 66 #define TYP_SOUND 67 +#define TYP_MIPTEX_PALETTE 67 #define TYP_MIPTEX 68 +#define WADID ('W' | ('A' << 8) | ('D' << 16) | ('2' << 24)) +#define WADID_VALVE ('W' | ('A' << 8) | ('D' << 16) | ('3' << 24)) + #define WADFILENAME "gfx.wad" //johnfitz -- filename is now hard-coded for honesty typedef struct @@ -66,16 +70,29 @@ typedef struct char name[16]; // must be null terminated } lumpinfo_t; +typedef struct wad_s +{ + char name[MAX_QPATH]; + int id; + fshandle_t fh; + int numlumps; + lumpinfo_t *lumps; + struct wad_s *next; +} wad_t; + extern int wad_numlumps; extern lumpinfo_t *wad_lumps; extern byte *wad_base; void W_LoadWadFile (void); //johnfitz -- filename is now hard-coded for honesty void W_CleanupName (const char *in, char *out); -lumpinfo_t *W_GetLumpinfo (const char *name); void *W_GetLumpName (const char *name); void *W_GetLumpNum (int num); +wad_t *W_LoadWadList (const char *names); +void W_FreeWadList (wad_t *wads); +lumpinfo_t *W_GetLumpinfoList (wad_t *wads, const char *name, wad_t **out_wad); + void SwapPic (qpic_t *pic); #endif /* _QUAKE_WAD_H */ diff --git a/Windows/SDL2/include/SDL_cpuinfo.h b/Windows/SDL2/include/SDL_cpuinfo.h index 2a9dd380c..db63b5b1c 100644 --- a/Windows/SDL2/include/SDL_cpuinfo.h +++ b/Windows/SDL2/include/SDL_cpuinfo.h @@ -53,9 +53,11 @@ _m_prefetch(void *__P) #ifndef __MMX__ #define __MMX__ #endif +/* #ifndef __3dNOW__ #define __3dNOW__ #endif +*/ #endif #ifndef __SSE__ #define __SSE__ diff --git a/Windows/SDL2/include/SDL_revision.h b/Windows/SDL2/include/SDL_revision.h index f8d4495f1..66dfbf838 100644 --- a/Windows/SDL2/include/SDL_revision.h +++ b/Windows/SDL2/include/SDL_revision.h @@ -1,8 +1,7 @@ -/* #undef SDL_VENDOR_INFO */ -#define SDL_REVISION_NUMBER 0 - +/* Generated by updaterev.sh, do not edit */ #ifdef SDL_VENDOR_INFO -#define SDL_REVISION "SDL-2.30.9 (" SDL_VENDOR_INFO ")" +#define SDL_REVISION "SDL-2.30.10-no-vcs (" SDL_VENDOR_INFO ")" #else -#define SDL_REVISION "SDL-2.30.9" +#define SDL_REVISION "SDL-2.30.10-no-vcs" #endif +#define SDL_REVISION_NUMBER 0 diff --git a/Windows/SDL2/include/SDL_stdinc.h b/Windows/SDL2/include/SDL_stdinc.h index 8eb757957..81e4bd4bf 100644 --- a/Windows/SDL2/include/SDL_stdinc.h +++ b/Windows/SDL2/include/SDL_stdinc.h @@ -255,8 +255,8 @@ typedef uint64_t Uint64; #ifndef SDL_PRIs64 #if defined(__WIN32__) || defined(__GDK__) #define SDL_PRIs64 "I64d" -#elif defined(PRIs64) -#define SDL_PRIs64 PRIs64 +#elif defined(PRId64) +#define SDL_PRIs64 PRId64 #elif defined(__LP64__) && !defined(__APPLE__) && !defined(__EMSCRIPTEN__) #define SDL_PRIs64 "ld" #else diff --git a/Windows/SDL2/include/SDL_version.h b/Windows/SDL2/include/SDL_version.h index fb79785fc..d62269ffa 100644 --- a/Windows/SDL2/include/SDL_version.h +++ b/Windows/SDL2/include/SDL_version.h @@ -59,7 +59,7 @@ typedef struct SDL_version */ #define SDL_MAJOR_VERSION 2 #define SDL_MINOR_VERSION 30 -#define SDL_PATCHLEVEL 9 +#define SDL_PATCHLEVEL 10 /** * Macro to determine SDL version program was compiled against. diff --git a/Windows/SDL2/lib/SDL2.dll b/Windows/SDL2/lib/SDL2.dll index 12ad9f41a..3398bb574 100644 Binary files a/Windows/SDL2/lib/SDL2.dll and b/Windows/SDL2/lib/SDL2.dll differ diff --git a/Windows/SDL2/lib64/SDL2.dll b/Windows/SDL2/lib64/SDL2.dll index 3f455e701..d5d679c9e 100644 Binary files a/Windows/SDL2/lib64/SDL2.dll and b/Windows/SDL2/lib64/SDL2.dll differ diff --git a/Windows/codecs/x86-watcom/FLAC.lib b/Windows/codecs/x86-watcom/FLAC.lib index 26d891fd1..3ff573931 100644 Binary files a/Windows/codecs/x86-watcom/FLAC.lib and b/Windows/codecs/x86-watcom/FLAC.lib differ diff --git a/Windows/codecs/x86-watcom/mpg123.lib b/Windows/codecs/x86-watcom/mpg123.lib index d507e8e2a..a701cd58a 100644 Binary files a/Windows/codecs/x86-watcom/mpg123.lib and b/Windows/codecs/x86-watcom/mpg123.lib differ