From 72915cd52bdd852fe7c933455b66adcce2eb8a33 Mon Sep 17 00:00:00 2001 From: Bradley Bell Date: Fri, 19 Oct 2001 09:45:02 +0000 Subject: [PATCH] Moved arch/sdl_* to arch/sdl --- arch/sdl/Makefile.am | 7 +++++++ arch/sdl/init.c | 46 ++++++++++++++++++++++++++++++++++++++++++++ arch/sdl/timer.c | 27 ++++++++++++++++++++++++++ 3 files changed, 80 insertions(+) create mode 100644 arch/sdl/Makefile.am create mode 100644 arch/sdl/init.c create mode 100644 arch/sdl/timer.c diff --git a/arch/sdl/Makefile.am b/arch/sdl/Makefile.am new file mode 100644 index 00000000..f9bcdb16 --- /dev/null +++ b/arch/sdl/Makefile.am @@ -0,0 +1,7 @@ +EXTRA_SUBDIRS = include + +noinst_LIBRARIES = libarch_sdl.a + +INCLUDES = -I$(top_srcdir)/arch/include -I$(top_srcdir)/includes -I$(top_srcdir)/main + +libarch_sdl_a_SOURCES = init.c timer.c diff --git a/arch/sdl/init.c b/arch/sdl/init.c new file mode 100644 index 00000000..ae5a9980 --- /dev/null +++ b/arch/sdl/init.c @@ -0,0 +1,46 @@ +/* + * $Source: /cvs/cvsroot/d2x/arch/sdl/init.c,v $ + * $Revision: 1.4 $ + * $Author: bradleyb $ + * $Date: 2001-10-19 09:45:02 $ + * + * SDL architecture support + * + * $Log: not supported by cvs2svn $ + * Revision 1.4 2001/01/29 13:35:09 bradleyb + * Fixed build system, minor fixes + * + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include "text.h" +#include "event.h" +#include "error.h" +#include "args.h" +#include "digi.h" + +extern void d_mouse_init(); + +void sdl_close() +{ + SDL_Quit(); +} + +void arch_sdl_init() +{ + // Initialise the library +//edited on 01/03/99 by Matt Mueller - if we use SDL_INIT_EVERYTHING, cdrom is initialized even if -nocdaudio is used +#ifdef SDL_INPUT + if (!FindArg("-nomouse")) + d_mouse_init(); +#endif + if (!FindArg("-nosound")) + digi_init(); + atexit(sdl_close); +} diff --git a/arch/sdl/timer.c b/arch/sdl/timer.c new file mode 100644 index 00000000..bbec27f3 --- /dev/null +++ b/arch/sdl/timer.c @@ -0,0 +1,27 @@ +/* + * $Source: /cvs/cvsroot/d2x/arch/sdl/timer.c,v $ + * $Revision: 1.3 $ + * $Author: bradleyb $ + * $Date: 2001-10-19 09:45:02 $ + * + * SDL library timer functions + * + * $Log: not supported by cvs2svn $ + * Revision 1.2 2001/01/29 13:35:09 bradleyb + * Fixed build system, minor fixes + * + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include "maths.h" + +fix timer_get_fixed_seconds(void) { + fix x; + unsigned long tv_now = SDL_GetTicks(); + x=i2f(tv_now/1000) | fixdiv(i2f(tv_now % 1000),i2f(1000)); + return x; +} -- 2.39.2