Merge remote-tracking branch 'sf/master' into qss

This commit is contained in:
Shpoike 2023-06-29 17:00:32 +01:00
commit 09b982158e
23 changed files with 166 additions and 84 deletions

View File

@ -3,7 +3,7 @@
<title>QuakeSpasm
<toc>
<em>Page last edited: March 2023.</em>
<em>Page last edited: May 2023.</em>
<sect>About<p>
@ -144,6 +144,12 @@ QuakeSpasm 0.94 has support for playing the 2021 re-release content: Copy the qu
<item> <url url="https://github.com/sezero/quakespasm/pull/51" name="Adjustments"> to joystick defaults, behaviour (patch by Chris Cowan). See the "Controller support / Cvars" section above.
<item> Fix for a mouse grabbing issue on macOS.
<item> Add missing support for <em>-ip</em> command line option on unix / macOS.
<item> Bump the progs execution runaway loop limit to 16M.
<item> Bump the MAXALIASFRAMES limit to 1024.
<item> Increase chase cam target trace distance to allow for chasecam to function in large open maps (useful e.g. for the func_vehicle mod.)
<item> Fix on-screen keyboard showing up suddenly on Steam Deck when starting a map.
<item> Fix a memory leak when exiting game in SDL2 builds.
<item> Fix console animation with scr_conspeed <= 0.
<item> Minor code cleanups. Updated third party code, e.g. SDL, music codecs, etc.
<item> Thanks to Andrei Drexler, Chris Cowan and Maciej Olędzki for their patches.
</itemize>

View File

@ -1,2 +1,2 @@
#define SDL_REVISION "@9c3c6383d894e2ddcfe60115cd1d1efb81ef3046"
#define SDL_REVISION "https://github.com/sezero/SDL.git@07bb804955f66a954dbe7a71db29d76847de69f2"
#define SDL_REVISION_NUMBER 0

View File

@ -16,19 +16,33 @@ extern "C" {
#define XMP_VER_RELEASE 1
#if defined(_WIN32) && !defined(__CYGWIN__)
# if defined(BUILDING_STATIC)
# if defined(LIBXMP_STATIC)
# define LIBXMP_EXPORT
# elif defined(BUILDING_DLL)
# define LIBXMP_EXPORT __declspec(dllexport)
# else
# define LIBXMP_EXPORT __declspec(dllimport)
# endif
#elif defined(__OS2__) && defined(__WATCOMC__) && defined(__SW_BD)
#elif defined(__OS2__) && defined(__WATCOMC__)
# if defined(LIBXMP_STATIC)
# define LIBXMP_EXPORT
# elif defined(BUILDING_DLL)
# define LIBXMP_EXPORT __declspec(dllexport)
# else
# define LIBXMP_EXPORT
# endif
#elif (defined(__GNUC__) || defined(__clang__) || defined(__HP_cc)) && defined(XMP_SYM_VISIBILITY)
# define LIBXMP_EXPORT __attribute__((visibility ("default")))
# if defined(LIBXMP_STATIC)
# define LIBXMP_EXPORT
# else
# define LIBXMP_EXPORT __attribute__((visibility("default")))
# endif
#elif defined(__SUNPRO_C) && defined(XMP_LDSCOPE_GLOBAL)
# define LIBXMP_EXPORT __global
# if defined(LIBXMP_STATIC)
# define LIBXMP_EXPORT
# else
# define LIBXMP_EXPORT __global
# endif
#elif defined(EMSCRIPTEN)
# define LIBXMP_EXPORT EMSCRIPTEN_KEEPALIVE
# define LIBXMP_EXPORT_VAR
@ -36,7 +50,7 @@ extern "C" {
# define LIBXMP_EXPORT
#endif
#if !defined (LIBXMP_EXPORT_VAR)
#if !defined(LIBXMP_EXPORT_VAR)
# define LIBXMP_EXPORT_VAR LIBXMP_EXPORT
#endif
@ -241,6 +255,7 @@ struct xmp_sample {
#define XMP_SAMPLE_LOOP_FULL (1 << 4) /* Play full sample before looping */
#define XMP_SAMPLE_SLOOP (1 << 5) /* Sample has sustain loop */
#define XMP_SAMPLE_SLOOP_BIDIR (1 << 6) /* Bidirectional sustain loop */
#define XMP_SAMPLE_STEREO (1 << 7) /* Interlaced stereo sample */
#define XMP_SAMPLE_SYNTH (1 << 15) /* Data contains synth patch */
int flg; /* Flags */
unsigned char *data; /* Sample data */

Binary file not shown.

View File

@ -13,6 +13,9 @@ USE_SDL2=1
### Enable the use of zlib, for compressed pk3s.
USE_ZLIB=1
### Do we need to link the math library?
LINK_M=1
### Enable/Disable codecs for streaming music support
USE_CODEC_WAVE=1
USE_CODEC_FLAC=0
@ -116,6 +119,8 @@ SDL_LIBS := $(shell $(SDL_CONFIG) --libs)
ifeq ($(HOST_OS),sunos)
NET_LIBS :=-lsocket -lnsl -lresolv
else ifdef HAIKU_OS
NET_LIBS :=-lnetwork
else
NET_LIBS :=
endif
@ -188,13 +193,17 @@ ifeq ($(USE_CODEC_UMX),1)
CFLAGS+= -DUSE_CODEC_UMX
endif
COMMON_LIBS:= -ldl -lm -lGL
COMMON_LIBS:= -lGL
ifeq ($(USE_ZLIB),1)
CFLAGS+= -DUSE_ZLIB
COMMON_LIBS+= -lz
endif
ifeq ($(LINK_M),1)
COMMON_LIBS += -lm
endif
LIBS := $(COMMON_LIBS) $(NET_LIBS) $(CODECLIBS)
# ---------------------------

View File

@ -1,5 +1,5 @@
# makefile to build quakespasm.exe for Windows using Open Watcom:
# wmake -f Makefile.wat
# wmake -f Makefile.wat
### Enable/disable SDL2
USE_SDL2=0
@ -102,7 +102,7 @@ CODECLIBS+= $(LIBCODEC)mikmod.lib
!endif
!ifeq USE_CODEC_XMP 1
CFLAGS+= -DUSE_CODEC_XMP
CFLAGS+= -DXMP_NO_DLL
CFLAGS+= -DLIBXMP_STATIC
CODECLIBS+= $(LIBCODEC)libxmp.lib
!endif
!ifeq USE_CODEC_MODPLUG 1

View File

@ -72,6 +72,12 @@
# define PLATFORM_RISCOS 1
# endif
#elif defined(__HAIKU__)
# if !defined(PLATFORM_HAIKU)
# define PLATFORM_HAIKU 1
# endif
#else /* here goes the unix platforms */
#if defined(__unix) || defined(__unix__) || defined(unix) || \
@ -159,6 +165,8 @@
# define PLATFORM_STRING "RiscOS"
#elif defined(__GNU__)
# define PLATFORM_STRING "GNU/Hurd"
#elif defined(PLATFORM_HAIKU)
# define PLATFORM_STRING "Haiku"
#elif defined(PLATFORM_UNIX)
# define PLATFORM_STRING "Unix"
#else

View File

@ -0,0 +1,17 @@
#!/bin/sh
# Change this script to meet your needs and/or environment.
TARGET=i586-pc-haiku
MAKE_CMD=make
CC="$TARGET-gcc"
AS="$TARGET-as"
RANLIB="$TARGET-ranlib"
AR="$TARGET-ar"
STRIP="$TARGET-strip"
LDFLAGS=-L/usr/lib32 # hack
export CC AS AR RANLIB STRIP LDFLAGS
exec $MAKE_CMD HAIKU_OS=1 LINK_M=0 USE_SDL2=1 LDFLAGS=$LDFLAGS CC=$CC AS=$AS RANLIB=$RANLIB AR=$AR STRIP=$STRIP -f Makefile $*

View File

@ -0,0 +1,16 @@
#!/bin/sh
# Change this script to meet your needs and/or environment.
TARGET=x86_64-unknown-haiku
MAKE_CMD=make
CC="$TARGET-gcc"
AS="$TARGET-as"
RANLIB="$TARGET-ranlib"
AR="$TARGET-ar"
STRIP="$TARGET-strip"
export CC AS AR RANLIB STRIP
exec $MAKE_CMD HAIKU_OS=1 LINK_M=0 USE_SDL2=1 CC=$CC AS=$AS RANLIB=$RANLIB AR=$AR STRIP=$STRIP -f Makefile $*

View File

@ -106,7 +106,7 @@ void Chase_UpdateForDrawing (void)
VectorCopy (ideal, r_refdef.vieworg);
// find the spot the player is looking at
VectorMA (cl.viewent.origin, 4096, forward, temp);
VectorMA (cl.viewent.origin, 1<<20, forward, temp);
TraceLine (cl.viewent.origin, temp, crosshair);
// calculate camera angles to look at the same spot

View File

@ -1169,7 +1169,7 @@ static void GL_CheckExtensions (void)
gl_texture_etc2 = GL_CompressedTexImage2D && (gl_version_major > 4 || (gl_version_major == 4 && gl_version_minor >= 3) || GL_ParseExtensionList(gl_extensions, "GL_ARB_ES3_compatibility"));
gl_texture_astc = GL_CompressedTexImage2D && ( GL_ParseExtensionList(gl_extensions, "GL_ARB_ES3_2_compatibility") || GL_ParseExtensionList(gl_extensions, "GL_KHR_texture_compression_astc_ldr"));
gl_texture_e5bgr9 = gl_version_major >= 3;
// GLSL
//
if (COM_CheckParm("-noglsl"))
@ -1268,10 +1268,14 @@ static void GL_CheckExtensions (void)
// glGenerateMipmap for warp textures
if (COM_CheckParm("-nowarpmipmaps"))
Con_Warning ("glGenerateMipmap disabled at command line\n");
else if ((GL_GenerateMipmap = SDL_GL_GetProcAddress("glGenerateMipmap")) != NULL)
Con_Printf ("FOUND: glGenerateMipmap\n");
else
Con_Warning ("glGenerateMipmap not available, liquids won't have mipmaps\n");
{
GL_GenerateMipmap = (QS_PFNGENERATEMIPMAP) SDL_GL_GetProcAddress("glGenerateMipmap");
if (GL_GenerateMipmap != NULL)
Con_Printf ("FOUND: glGenerateMipmap\n");
else
Con_Warning ("glGenerateMipmap not available, liquids won't have mipmaps\n");
}
}
/*
@ -1385,12 +1389,13 @@ void VID_Shutdown (void)
if (vid_initialized)
{
VID_Gamma_Shutdown (); //johnfitz
#if defined(USE_SDL2)
SDL_GL_DeleteContext(gl_context);
gl_context = NULL;
SDL_DestroyWindow(draw_context);
#endif
SDL_QuitSubSystem(SDL_INIT_VIDEO);
draw_context = NULL;
#if defined(USE_SDL2)
gl_context = NULL;
#endif
PL_VID_Shutdown();
}
}
@ -2409,4 +2414,5 @@ void VID_SetCursor(qcvm_t *vm, const char *cursorname, float hotspot[2], float c
VID_UpdateCursor();
if (oldcursor)
SDL_FreeCursor(oldcursor);
}
}

View File

@ -31,7 +31,8 @@
#if defined(PLATFORM_BSD) || defined(PLATFORM_OSX) || \
defined(PLATFORM_AMIGA) /* bsdsocket.library */ || \
defined(__GNU__) /* GNU/Hurd */ || defined(__riscos__)
defined(__GNU__) /* GNU/Hurd */ || defined(__riscos__) || \
defined(PLATFORM_HAIKU) /* Haiku OS */
/* struct sockaddr has unsigned char sa_len as the first member in BSD
* variants and the family member is also an unsigned char instead of an
* unsigned short. This should matter only when PLATFORM_UNIX is defined,
@ -47,7 +48,7 @@
#endif /* BSD, sockaddr */
/* unix includes and compatibility macros */
#if defined(PLATFORM_UNIX) || defined(PLATFORM_RISCOS)
#if defined(PLATFORM_UNIX) || defined(PLATFORM_RISCOS) || defined(PLATFORM_HAIKU)
#include <sys/param.h>
#include <sys/ioctl.h>

View File

@ -653,4 +653,3 @@ void PR_ExecuteProgram (func_t fnum)
#undef OPA
#undef OPB
#undef OPC

View File

@ -58,24 +58,22 @@ void Sys_CloseLibrary(dllhandle_t *lib);
#include "arch_def.h"
#ifdef _WIN32
#include <windows.h>
void Sys_CloseLibrary(dllhandle_t *lib)
{
FreeLibrary((HMODULE)lib);
SDL_UnloadObject((void*)lib);
}
dllhandle_t *Sys_LoadLibrary(const char *name, dllfunction_t *funcs)
{
int i;
HMODULE lib;
void *lib;
lib = LoadLibrary(name);
lib = SDL_LoadObject(name);
if (!lib)
{
#ifdef _WIN64
lib = LoadLibrary(va("%s_64", name));
lib = SDL_LoadObject(va("%s_64", name));
#elif defined(_WIN32)
lib = LoadLibrary(va("%s_32", name));
lib = SDL_LoadObject(va("%s_32", name));
#endif
if (!lib)
return NULL;
@ -85,7 +83,7 @@ dllhandle_t *Sys_LoadLibrary(const char *name, dllfunction_t *funcs)
{
for (i = 0; funcs[i].name; i++)
{
*funcs[i].funcptr = GetProcAddress(lib, funcs[i].name);
*funcs[i].funcptr = SDL_LoadFunction(lib, funcs[i].name);
if (!*funcs[i].funcptr)
break;
}
@ -99,50 +97,6 @@ dllhandle_t *Sys_LoadLibrary(const char *name, dllfunction_t *funcs)
return (dllhandle_t*)lib;
}
#elif defined(PLATFORM_UNIX)
//unixes should have a dlopen (this test includes osx)
#include <dlfcn.h>
void Sys_CloseLibrary(dllhandle_t *lib)
{
dlclose((void*)lib);
}
dllhandle_t *Sys_LoadLibrary(const char *name, dllfunction_t *funcs)
{
int i;
dllhandle_t *lib;
lib = dlopen (name, RTLD_LAZY|RTLD_LOCAL);
if (!lib)
return NULL;
if (funcs)
{
for (i = 0; funcs[i].name; i++)
{
*funcs[i].funcptr = dlsym(lib, funcs[i].name);
if (!*funcs[i].funcptr)
break;
}
if (funcs[i].name)
{
Con_SafePrintf("Symbol %s missing in module %s\n", funcs[i].name, name);
Sys_CloseLibrary((dllhandle_t*)lib);
lib = NULL;
}
}
return (dllhandle_t*)lib;
}
#else
void Sys_CloseLibrary(dllhandle_t *lib)
{
}
dllhandle_t *Sys_LoadLibrary(const char *name, dllfunction_t *funcs)
{
Con_SafePrintf("Sys_LoadLibrary(%s) is not implemented on this platform\n", name);
return NULL;
}
#endif
/*****************************************************************************************************************************/

View File

@ -26,7 +26,7 @@
#include "snd_codec.h"
#include "snd_codeci.h"
#include "snd_xmp.h"
#if defined(_WIN32) && defined(XMP_NO_DLL)
#if defined(_WIN32) && defined(LIBXMP_STATIC)
#define BUILDING_STATIC
#endif
#include <xmp.h>

View File

@ -27,7 +27,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <sys/types.h>
#include <errno.h>
#include <unistd.h>
#ifdef PLATFORM_OSX
#if defined(PLATFORM_OSX) || defined(PLATFORM_HAIKU)
#include <libgen.h> /* dirname() and basename() */
#endif
#include <sys/stat.h>
@ -333,6 +333,21 @@ static void Sys_GetBasedir (char *argv0, char *dst, size_t dstsize)
{
char *tmp;
#ifdef PLATFORM_HAIKU
if (realpath(argv0, dst) == NULL)
{
perror("realpath");
if (getcwd(dst, dstsize - 1) == NULL)
_fail: Sys_Error ("Couldn't determine current directory");
}
else
{
/* strip off the binary name */
if (! (tmp = strdup (dst))) goto _fail;
q_strlcpy (dst, dirname(tmp), dstsize);
free (tmp);
}
#else
if (getcwd(dst, dstsize - 1) == NULL)
Sys_Error ("Couldn't determine current directory");
@ -345,6 +360,7 @@ static void Sys_GetBasedir (char *argv0, char *dst, size_t dstsize)
if (tmp != dst && *tmp == '/')
*tmp = 0;
}
#endif
}
#endif

View File

@ -8,7 +8,7 @@
<H1>QuakeSpasm</H1>
<H2></H2>
<P><EM>Page last edited: March 2023.</EM></P>
<P><EM>Page last edited: May 2023.</EM></P>
<P>
<H2><A NAME="toc1">1.</A> <A HREF="Quakespasm.html#s1">About</A></H2>
@ -219,6 +219,12 @@ Alternatively, have a look at <B>Makefile.darwin</B> for more instructions on bu
<LI> <A HREF="https://github.com/sezero/quakespasm/pull/51">Adjustments</A> to joystick defaults, behaviour (patch by Chris Cowan). See the <A HREF="Quakespasm.html#ss3.2">"Controller support / Cvars"</A> section above.</LI>
<LI> Fix for a mouse grabbing issue on macOS.</LI>
<LI> Add missing support for <EM>-ip</EM> command line option on unix / macOS.</LI>
<LI> Bump the progs execution runaway loop limit to 16M.</LI>
<LI> Bump the MAXALIASFRAMES limit to 1024.</LI>
<LI> Increase chase cam target trace distance to allow for chasecam to function in large open maps (useful e.g. for the func_vehicle mod.)</LI>
<LI> Fix on-screen keyboard showing up suddenly on Steam Deck when starting a map.</LI>
<LI> Fix a memory leak when exiting game in SDL2 builds.</LI>
<LI> Fix console animation with scr_conspeed &lt;= 0.</LI>
<LI> Minor code cleanups. Updated third party code, e.g. SDL, music codecs, etc.</LI>
<LI> Thanks to Andrei Drexler, Chris Cowan and Maciej Olędzki for their patches.</LI>
</UL>

View File

@ -3,7 +3,7 @@
______________________________________________________________________
Page last edited: March 2023.
Page last edited: May 2023.
1. About
@ -230,6 +230,20 @@
- Add missing support for -ip command line option on unix / macOS.
- Bump the progs execution runaway loop limit to 16M.
- Bump the MAXALIASFRAMES limit to 1024.
- Increase chase cam target trace distance to allow for chasecam to
function in large open maps (useful e.g. for the func_vehicle mod.)
- Fix on-screen keyboard showing up suddenly on Steam Deck when
starting a map.
- Fix a memory leak when exiting game in SDL2 builds.
- Fix console animation with scr_conspeed <= 0.
- Minor code cleanups. Updated third party code, e.g. SDL, music
codecs, etc.

View File

@ -16,19 +16,33 @@ extern "C" {
#define XMP_VER_RELEASE 1
#if defined(_WIN32) && !defined(__CYGWIN__)
# if defined(BUILDING_STATIC)
# if defined(LIBXMP_STATIC)
# define LIBXMP_EXPORT
# elif defined(BUILDING_DLL)
# define LIBXMP_EXPORT __declspec(dllexport)
# else
# define LIBXMP_EXPORT __declspec(dllimport)
# endif
#elif defined(__OS2__) && defined(__WATCOMC__) && defined(__SW_BD)
#elif defined(__OS2__) && defined(__WATCOMC__)
# if defined(LIBXMP_STATIC)
# define LIBXMP_EXPORT
# elif defined(BUILDING_DLL)
# define LIBXMP_EXPORT __declspec(dllexport)
# else
# define LIBXMP_EXPORT
# endif
#elif (defined(__GNUC__) || defined(__clang__) || defined(__HP_cc)) && defined(XMP_SYM_VISIBILITY)
# define LIBXMP_EXPORT __attribute__((visibility ("default")))
# if defined(LIBXMP_STATIC)
# define LIBXMP_EXPORT
# else
# define LIBXMP_EXPORT __attribute__((visibility("default")))
# endif
#elif defined(__SUNPRO_C) && defined(XMP_LDSCOPE_GLOBAL)
# define LIBXMP_EXPORT __global
# if defined(LIBXMP_STATIC)
# define LIBXMP_EXPORT
# else
# define LIBXMP_EXPORT __global
# endif
#elif defined(EMSCRIPTEN)
# define LIBXMP_EXPORT EMSCRIPTEN_KEEPALIVE
# define LIBXMP_EXPORT_VAR
@ -36,7 +50,7 @@ extern "C" {
# define LIBXMP_EXPORT
#endif
#if !defined (LIBXMP_EXPORT_VAR)
#if !defined(LIBXMP_EXPORT_VAR)
# define LIBXMP_EXPORT_VAR LIBXMP_EXPORT
#endif
@ -241,6 +255,7 @@ struct xmp_sample {
#define XMP_SAMPLE_LOOP_FULL (1 << 4) /* Play full sample before looping */
#define XMP_SAMPLE_SLOOP (1 << 5) /* Sample has sustain loop */
#define XMP_SAMPLE_SLOOP_BIDIR (1 << 6) /* Bidirectional sustain loop */
#define XMP_SAMPLE_STEREO (1 << 7) /* Interlaced stereo sample */
#define XMP_SAMPLE_SYNTH (1 << 15) /* Data contains synth patch */
int flg; /* Flags */
unsigned char *data; /* Sample data */

Binary file not shown.

Binary file not shown.

Binary file not shown.