From d1d52a49ac3c9e909905dabe5ae28ed73cb18144 Mon Sep 17 00:00:00 2001 From: Spoike Date: Mon, 18 Apr 2005 03:21:16 +0000 Subject: [PATCH] sw client builds and runs now git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@959 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/Makefile | 9 +++++---- engine/client/cl_main.c | 1 + engine/client/m_download.c | 2 +- engine/client/snd_linux.c | 2 +- engine/client/snd_ov.c | 25 +++++++++++++++++++++---- engine/client/sys_linux.c | 1 - engine/common/bothdefs.h | 2 +- 7 files changed, 30 insertions(+), 12 deletions(-) diff --git a/engine/Makefile b/engine/Makefile index b23c78dfd..7cb3b3bf8 100644 --- a/engine/Makefile +++ b/engine/Makefile @@ -127,6 +127,7 @@ CLIENT_OBJS = $(CLIENT_ASM_OBJS) \ image.o \ keys.o \ menu.o \ + m_download.o \ m_master.o \ m_multi.o \ m_items.o \ @@ -389,8 +390,8 @@ else endif GL_EXE_NAME=../fteqw.gl GLCL_EXE_NAME=../fteqwcl.gl - GL_LDFLAGS=$(GLLDFLAGS) $(GLXLDFLAGS) - GL_CFLAGS=$(GLCFLAGS) + GL_LDFLAGS= -L/usr/local/lib $(GLLDFLAGS) $(GLXLDFLAGS) + GL_CFLAGS=$(GLCFLAGS) -I/usr/local/include GLB_DIR=gl_bsd GLCL_DIR=glcl_bsd @@ -401,8 +402,8 @@ else endif SW_EXE_NAME=../fteqw.sw SWCL_EXE_NAME=../fteqwcl.sw - SW_LDFLAGS=$(SWLDFLAGS) $(XLDFLAGS) - SW_CFLAGS=$(SWCFLAGS) + SW_LDFLAGS=-L/usr/local/lib $(SWLDFLAGS) $(XLDFLAGS) + SW_CFLAGS=$(SWCFLAGS) -I/usr/local/include SWB_DIR=sw_bsd SWCL_DIR=swcl_bsd diff --git a/engine/client/cl_main.c b/engine/client/cl_main.c index de7ecbb17..af015247a 100644 --- a/engine/client/cl_main.c +++ b/engine/client/cl_main.c @@ -21,6 +21,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "quakedef.h" #include "winquake.h" +#include #ifdef _WIN32 #include "winsock.h" #else diff --git a/engine/client/m_download.c b/engine/client/m_download.c index 0c3ef70dc..6e144862c 100644 --- a/engine/client/m_download.c +++ b/engine/client/m_download.c @@ -31,7 +31,7 @@ typedef struct package_s { typedef struct { menucustom_t *list; - char intermediatefilename[MAX_PATH]; + char intermediatefilename[MAX_QPATH]; int parsedsourcenum; int firstpackagenum; diff --git a/engine/client/snd_linux.c b/engine/client/snd_linux.c index 439165fae..bf8e17926 100644 --- a/engine/client/snd_linux.c +++ b/engine/client/snd_linux.c @@ -47,7 +47,7 @@ int snd_speed; #include #include #include -#include +#include #include #include "quakedef.h" diff --git a/engine/client/snd_ov.c b/engine/client/snd_ov.c index e99f67e5b..5914646e0 100644 --- a/engine/client/snd_ov.c +++ b/engine/client/snd_ov.c @@ -6,10 +6,13 @@ -#if defined(_WIN32) && !defined(STATICVORBIS) +#if defined(_WIN32) #define WINDOWSDYNAMICLINK #include HINSTANCE oggvorbislibrary; +#else +#include +void *oggvorbislibrary; #endif int (*p_ov_open_callbacks) (void *datasource, OggVorbis_File *vf, char *initial, long ibytes, ov_callbacks callbacks); @@ -41,7 +44,7 @@ typedef struct { int OV_DecodeSome(sfx_t *s, int minlength); void OV_CancelDecoder(sfx_t *s); -int OV_StartDecode(unsigned char *start, unsigned long length, ovdecoderbuffer_t *buffer); +qboolean OV_StartDecode(unsigned char *start, unsigned long length, ovdecoderbuffer_t *buffer); qbyte *COM_LoadFile (char *path, int usehunk); @@ -272,9 +275,9 @@ static ov_callbacks callbacks = { }; qboolean OV_StartDecode(unsigned char *start, unsigned long length, ovdecoderbuffer_t *buffer) { -#ifdef WINDOWSDYNAMICLINK static qboolean tried; if (!oggvorbislibrary && !tried) +#ifdef WINDOWSDYNAMICLINK { tried = true; oggvorbislibrary = LoadLibrary("vorbisfile.dll"); @@ -291,7 +294,21 @@ qboolean OV_StartDecode(unsigned char *start, unsigned long length, ovdecoderbuf p_ov_read = (void *)GetProcAddress(oggvorbislibrary, "ov_read"); } #else - p_ov_open_callbacks = ov_open_callbacks; + { + tried = true; + oggvorbislibrary = dlopen("libvorbisfile.so", RTLD_LOCAL | RTLD_LAZY); + if (!oggvorbislibrary) + { + Con_Printf("Couldn't load DLL: \"vorbisfile.dll\".\n"); + return false; + } + p_ov_open_callbacks = (void *)dlsym(oggvorbislibrary, "ov_open_callbacks"); + p_ov_comment = (void *)dlsym(oggvorbislibrary, "ov_comment"); + p_ov_pcm_total = (void *)dlsym(oggvorbislibrary, "ov_pcm_total"); + p_ov_clear = (void *)dlsym(oggvorbislibrary, "ov_clear"); + p_ov_info = (void *)dlsym(oggvorbislibrary, "ov_info"); + p_ov_read = (void *)dlsym(oggvorbislibrary, "ov_read"); + } #endif buffer->start = start; diff --git a/engine/client/sys_linux.c b/engine/client/sys_linux.c index 7562afbe2..a6da1bc17 100644 --- a/engine/client/sys_linux.c +++ b/engine/client/sys_linux.c @@ -171,7 +171,6 @@ void Sys_Error (const char *error, ...) va_end (argptr); fprintf(stderr, "Error: %s\n", string); - *(int*)NULL = 0; Host_Shutdown (); diff --git a/engine/common/bothdefs.h b/engine/common/bothdefs.h index 4b88834ee..485b8efce 100644 --- a/engine/common/bothdefs.h +++ b/engine/common/bothdefs.h @@ -39,7 +39,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define AVAIL_JPEGLIB #define AVAIL_ZLIB - #define AVAIL_MP3 +// #define AVAIL_MP3 #define AVAIL_OGGVORBIS #endif