From fdd6112d7482bbdf5e329a633e4d02781c70261c Mon Sep 17 00:00:00 2001 From: Joseph Carter Date: Mon, 14 Feb 2000 03:27:10 +0000 Subject: [PATCH] svgalib input works again. --- AUTHORS | 2 ++ CREDITS | 7 +++++++ common/host.c | 12 ++++++++++-- common/quakefs.h | 2 +- common/vid_svgalib.c | 3 +++ 5 files changed, 23 insertions(+), 3 deletions(-) diff --git a/AUTHORS b/AUTHORS index ed5757e..38a07e7 100644 --- a/AUTHORS +++ b/AUTHORS @@ -52,6 +52,7 @@ E: knghtbrd@debian.org D: QW/Q1 tree merging D: Autoconf support and portability D: Documentation +D: Driver module support/design N: Peter Andreasen E: pandr@pandr.dk @@ -124,6 +125,7 @@ D: Help with the speed cheat fix N: Dan Olson E: theoddone@quakefiles.com D: Misc. code fixes +D: Driver modules N: Mads Bondo Dydensborg E: madsdyd@challenge.dk diff --git a/CREDITS b/CREDITS index ac10585..c334fa9 100644 --- a/CREDITS +++ b/CREDITS @@ -119,3 +119,10 @@ Network code fixes/cleanups: IPv6 support (not complete): Pontus Lidman + +Driver modules: + Zephaniah E. Hull + Bill Currie + Joseph Carter + Dan Olson + diff --git a/common/host.c b/common/host.c index 4501abc..557d07f 100644 --- a/common/host.c +++ b/common/host.c @@ -60,6 +60,7 @@ jmp_buf host_abort; double realtime; // without any filtering or bounding double oldrealtime; // last frame run qboolean isDedicated; +qboolean vid_initialized; int fps_count; int vcrFile = -1; double host_time; @@ -582,6 +583,10 @@ Host_Init ( quakeparms_t *parms) // IN->Init(); // Not the best place to load the plugin... VID_Init(host_basepal); + // DDOI - I made this so host.c wouldn't try to unload a plugin + // that it hasn't loaded. Could be done better I'm sure. + vid_initialized = true; + Draw_Init(); SCR_Init(); R_Init(); @@ -642,8 +647,11 @@ Host_Shutdown( void ) CDAudio_Shutdown (); NET_Shutdown (); S_Shutdown(); - IN->Shutdown(); - plugin_unload(IN->handle); + // Don't unload what hasn't been loaded! + if (vid_initialized == true) { + IN->Shutdown(); + plugin_unload(IN->handle); + } #if QUAKEWORLD if (host_basepal) { diff --git a/common/quakefs.h b/common/quakefs.h index 95bf690..c3bf457 100644 --- a/common/quakefs.h +++ b/common/quakefs.h @@ -37,7 +37,7 @@ struct cache_user_s; extern char com_gamedir[MAX_OSPATH]; void COM_WriteFile (char *filename, void *data, int len); -int COM_FOpenFile (char *filename, QFile **file); +int COM_FOpenFile (char *filename, QFile **gzfile); void COM_CloseFile (QFile *h); byte *COM_LoadStackFile (char *path, void *buffer, int bufsize); diff --git a/common/vid_svgalib.c b/common/vid_svgalib.c index 3cd4786..b138750 100644 --- a/common/vid_svgalib.c +++ b/common/vid_svgalib.c @@ -32,6 +32,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include #include #include +#include #include #ifdef HAVE_UNISTD_H @@ -491,6 +492,8 @@ VID_Init(unsigned char *palette) int w, h, d; int err; + plugin_load("./in_svgalib.so"); + IN->Init(); /* Sound gets initialized here */ S_Init();