-
Notifications
You must be signed in to change notification settings - Fork 2
/
objects.h
110 lines (94 loc) · 2.29 KB
/
objects.h
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
/* :ts=8 bk=0
*
* objects.h: General and specific definitions for objects.
*
* Leo L. Schwab 9306.30
*/
#ifndef _OBJECTS_H
#define _OBJECTS_H
#ifndef _CASTLE_H
#include "castle.h"
#endif
/***************************************************************************
* General case Object and Object definition structures.
*/
typedef struct ObDef {
int32 (*od_Func)(); /* Function handler */
ubyte od_Type;
ubyte od_State;
ubyte od_Flags;
ubyte __pad;
int32 od_ObCount; /* # of objects of this type */
void *od_InstanceBase; /* Ptr to base of object array */
} ObDef;
typedef struct Object {
struct Object *ob_Next; /* Next in chain off MapEntry */
ubyte ob_Type; /* Note these are at the same */
ubyte ob_State; /* offset in the structure as */
ubyte ob_Flags; /* in the ObDef. */
ubyte __pad;
struct ObDef *ob_Def; /* Ptr to ObDef */
int32 ob_VertIdx; /* Index into obverts[] array */
} Object;
typedef struct InitData {
struct MapEntry *id_MapEntry; /* Entry in levelmap[][] */
int32 id_XIdx,
id_ZIdx;
} InitData;
enum ObjectTypes {
OTYP_INVALID = 0,
OTYP_ZOMBIE,
OTYP_BOSSZOMBIE,
OTYP_GEORGE,
OTYP_BOSSGEORGE,
OTYP_HEAD,
OTYP_BOSSHEAD,
OTYP_SPIDER,
OTYP_NSDOOR,
OTYP_EWDOOR,
OTYP_KEY,
OTYP_POWERUP,
OTYP_EXIT,
OTYP_TRIGGER,
MAX_OTYP
};
enum ObjectStates {
OBS_INVALID = 0,
OBS_ASLEEP,
OBS_AWAKENING,
OBS_WALKING,
OBS_CHASING,
OBS_JUMPING,
OBS_ATTACKING,
OBS_DYING,
OBS_DEAD,
OBS_OPENING,
OBS_OPEN,
OBS_CLOSING,
OBS_CLOSED,
MAX_OBS
};
#define OBF_MOVE 1
#define OBF_REGISTER (1<<1)
#define OBF_RENDER (1<<2)
#define OBF_CONTACT (1<<3)
#define OBF_SHOOT (1<<4)
#define OBF_PROBE (1<<5)
#define OBF_SAWME (1<<6)
#define OBF_PLAYERONLY (1<<7)
enum ObjectOperations {
OP_INVALID = 0,
OP_FIATLUX, /* Initialize object definition */
OP_DESTRUCT, /* Free object definition resources */
OP_CREATEOB, /* Create object instance */
OP_DELETEOB, /* Free object instance */
OP_INITOB, /* Initialize next available instance */
OP_MOVE, /* Move object */
OP_REGISTER, /* Place object and req'd data in render list */
OP_RENDER, /* Guess... */
OP_CONTACT, /* If object touches player */
OP_SHOT, /* If object is shot by player */
OP_PROBE, /* Player probes object with 'B' button */
MAX_OP
};
#endif /* _OBJECTS_H */