sw client builds and runs now

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@959 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2005-04-18 03:21:16 +00:00
parent e7d4f7739b
commit d1d52a49ac
7 changed files with 30 additions and 12 deletions

View File

@ -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

View File

@ -21,6 +21,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "quakedef.h"
#include "winquake.h"
#include <sys/types.h>
#ifdef _WIN32
#include "winsock.h"
#else

View File

@ -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;

View File

@ -47,7 +47,7 @@ int snd_speed;
#include <sys/mman.h>
#include <sys/shm.h>
#include <sys/wait.h>
#include <linux/soundcard.h>
#include <sys/soundcard.h>
#include <stdio.h>
#include "quakedef.h"

View File

@ -6,10 +6,13 @@
#if defined(_WIN32) && !defined(STATICVORBIS)
#if defined(_WIN32)
#define WINDOWSDYNAMICLINK
#include <windows.h>
HINSTANCE oggvorbislibrary;
#else
#include <dlfcn.h>
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;

View File

@ -171,7 +171,6 @@ void Sys_Error (const char *error, ...)
va_end (argptr);
fprintf(stderr, "Error: %s\n", string);
*(int*)NULL = 0;
Host_Shutdown ();

View File

@ -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