File: sysfunc.h

package info (click to toggle)
bomberclone 0.11.5-1sarge2
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 9,608 kB
  • ctags: 1,437
  • sloc: ansic: 13,356; sh: 3,292; makefile: 183
file content (62 lines) | stat: -rw-r--r-- 1,470 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/* $Id: sysfunc.h,v 1.6 2004/01/07 23:04:31 patty21 Exp $ */
/* include some system near functions */

#ifndef _SYSFUNC_H_
#define _SYSFUNC_H_

#define MAX_DIRENTRYS 1024

enum _dirflags {
	DF_dir  = 1,
	DF_file = 2
};

enum _dirbitmask { 			  // bit mask for the directions
	DIRM_left = 1,
	DIRM_right = 2,
	DIRM_up = 4,
	DIRM_down = 8,
	DIRM_under = 16
};

struct __direntry {
	unsigned char flags;
	char name[LEN_FILENAME];
	struct __direntry *next;
} typedef _direntry;

extern void s_delay (int ms);
extern int s_random (int maxnr);
extern char *s_gethomedir ();
extern int s_countbits (int nbomb, int nr);
extern char* getfilename(char* path);

extern inline Sint16 s_swap16 (Sint16 i);
extern inline Sint32 s_swap32 (Sint32 i);

extern _direntry *s_getdir (char *path);
extern _direntry *s_dirfilter (_direntry *dirstart, signed char dirflags);

#ifndef HAVE_RINTF
	#ifndef HAVE_RINT
		extern inline float rintf (float f);
	#else
		#define rintf(__x) ((float)rint(double)__x)
	#endif
#endif

#ifndef HAVE_FLOORF
	#ifndef HAVE_FLOOR
		#define floorf(__x) ((float)((int)__x))
	#else
		#define floorf(__x) ((float)floor((double)__x))
	#endif
#endif

extern inline void s_calctimesync ();
extern void rect_clipping (SDL_Rect *src, SDL_Rect *dest, SDL_Rect *window, SDL_Rect *csrc, SDL_Rect *cdest);
extern void charlist_fillarraypointer (_charlist *list, int c);
extern _charlist *charlist_findtext (_charlist *list, char *text);
extern float absol(float f);

#endif