Moved arch/sdl_* to arch/sdl
This commit is contained in:
parent
c611d23c19
commit
72915cd52b
7
arch/sdl/Makefile.am
Normal file
7
arch/sdl/Makefile.am
Normal file
|
@ -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
|
46
arch/sdl/init.c
Normal file
46
arch/sdl/init.c
Normal file
|
@ -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 <conf.h>
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <SDL/SDL.h>
|
||||
#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);
|
||||
}
|
27
arch/sdl/timer.c
Normal file
27
arch/sdl/timer.c
Normal file
|
@ -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 <conf.h>
|
||||
#endif
|
||||
|
||||
#include <SDL/SDL.h>
|
||||
#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;
|
||||
}
|
Loading…
Reference in a new issue