cGameLib_12.h 2.52 KB
Newer Older
Peter Achten's avatar
Peter Achten committed
1
2
3
4
5
6
#ifndef _CGAMELIB_H
#define _CGAMELIB_H

/* Clean Game Library by Mike Wiering, Nijmegen */


Mike Wiering's avatar
Mike Wiering committed
7
#include "cOSGameLib.h"  /* OS specific functions */
Peter Achten's avatar
Peter Achten committed
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


/* Nothing value for integer, used with Maybe values */
#define NOTHING (0x80000000)

/* bound directions */
#define UPPER_BOUND (1 << 0)
#define LEFT_BOUND  (1 << 1)
#define LOWER_BOUND (1 << 2)
#define RIGHT_BOUND (1 << 3)

/* predefined bound bits */
#define BND_MAP_CODES       (1 << 30)
#define BND_STATIC_BOUNDS   (1 << 31)

/* object option bits */
#define OO_FIXED                       (1 <<  0)  // obsolete
#define OO_IGNORE_STATIC_BOUNDS        (1 <<  1)  // obsolete
#define OO_IGNORE_LEVEL_BOUNDS         (1 <<  2)
#define OO_BOUNCE_AT_COLLISIONS        (1 <<  3)  // obsolete
#define OO_CHECK_MAP_CODES             (1 <<  4)  // obsolete
#define OO_CHECK_KEYBOARD              (1 <<  5)
#define OO_ALLOW_KEYBOARD_REPEAT       (1 <<  6)
#define OO_STATIC                      (1 <<  7)
#define OO_LAST_DIRECTION_LEFT         (1 <<  8)  /* 0=right, 1=left */
#define OO_LAST_DIRECTION_UP           (1 <<  9)  /* 0=down, 1=up */
#define OO_AUTO_MIRROR_LEFT_RIGHT      (1 << 10)
#define OO_AUTO_MIRROR_UP_DOWN         (1 << 11)
#define OO_FREEZE                      (1 << 12)  /* when timecounter < 0 */
#define OO_REMOVE_MAP_CODE             (1 << 13)

/* statistics options */
#define SO_X_CENTERED             (1 <<  0)
#define SO_Y_CENTERED             (1 <<  1)
#define SO_X_FROM_SCREEN_CENTER   (1 <<  2)
#define SO_Y_FROM_SCREEN_CENTER   (1 <<  3)

/* focus constants */
#define FC_BOUND            (0x80000000)
#define FC_OFFSCREEN        (0x80000001)

/* game keys */
#define GK_UNKNOWN	  0

Mike Wiering's avatar
Mike Wiering committed
52
#define GK_BACKSPACE  8
Peter Achten's avatar
Peter Achten committed
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#define GK_RETURN    10
#define GK_ESCAPE	 11
#define GK_LEFT		 12
#define GK_RIGHT	 13
#define GK_UP	  	 14
#define GK_DOWN	  	 15
#define GK_HOME      16
#define GK_END       17
//#define GK_PAGE_UP   18
//#define GK_PAGE_DOWN 19
#define GK_F1        20
#define GK_F2        21
#define GK_F3        22
#define GK_F4        23
#define GK_F5        24
#define GK_F6        25
#define GK_F7        26
#define GK_F8        27
#define GK_F9        28
#define GK_F10       29
#define GK_F11       30
#define GK_F12       31
#define GK_SPACE     32

#define GK_MAX_KEY  255


Mike Wiering's avatar
Mike Wiering committed
80
/* functions called from cCrossCall */
Peter Achten's avatar
Peter Achten committed
81
82
83
84
85
86
87
88
89
90
void InitGameGlobals ();
void RunGame ();
void PlaySoundSample (int, int, int, int, int);
void CreateGameObject (int, int, int, int, int *);
void ScheduleUserGameEvent (int, int, int, int, int, int);
int CreateGameWindow (int, int, int, BOOL);
void RegisterGameWindowClass ();

#endif