summaryrefslogtreecommitdiff
path: root/apps/plugins/xrick/ents.h
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/xrick/ents.h')
-rw-r--r--apps/plugins/xrick/ents.h118
1 files changed, 118 insertions, 0 deletions
diff --git a/apps/plugins/xrick/ents.h b/apps/plugins/xrick/ents.h
new file mode 100644
index 0000000000..1014205035
--- /dev/null
+++ b/apps/plugins/xrick/ents.h
@@ -0,0 +1,118 @@
1/*
2 * xrick/ents.h
3 *
4 * Copyright (C) 1998-2002 BigOrno (bigorno@bigorno.net).
5 * Copyright (C) 2008-2014 Pierluigi Vicinanza.
6 * All rights reserved.
7 *
8 * The use and distribution terms for this software are contained in the file
9 * named README, which can be found in the root of this distribution. By
10 * using this software in any fashion, you are agreeing to be bound by the
11 * terms of this license.
12 *
13 * You must not remove this notice, or any other, from this software.
14 */
15
16#ifndef _ENTS_H
17#define _ENTS_H
18
19#include "xrick/rects.h"
20
21#include <stddef.h> /* size_t */
22
23#define ENT_XRICK ent_ents[1]
24
25/*
26 * flags for ent_ents[e].n ("yes" when set)
27 *
28 * ENT_LETHAL: is entity lethal?
29 */
30#define ENT_LETHAL 0x80
31
32/*
33 * flags for ent_ents[e].flag ("yes" when set)
34 *
35 * ENT_FLG_ONCE: should the entity run once only?
36 * ENT_FLG_STOPRICK: does the entity stops rick (and goes to slot zero)?
37 * ENT_FLG_LETHALR: is entity lethal when restarting?
38 * ENT_FLG_LETHALI: is entity initially lethal?
39 * ENT_FLG_TRIGBOMB: can entity be triggered by a bomb?
40 * ENT_FLG_TRIGBULLET: can entity be triggered by a bullet?
41 * ENT_FLG_TRIGSTOP: can entity be triggered by rick stop?
42 * ENT_FLG_TRIGRICK: can entity be triggered by rick?
43 */
44#define ENT_FLG_ONCE 0x01
45#define ENT_FLG_STOPRICK 0x02
46#define ENT_FLG_LETHALR 0x04
47#define ENT_FLG_LETHALI 0x08
48#define ENT_FLG_TRIGBOMB 0x10
49#define ENT_FLG_TRIGBULLET 0x20
50#define ENT_FLG_TRIGSTOP 0x40
51#define ENT_FLG_TRIGRICK 0x80
52
53typedef struct {
54 U8 n; /* b00 */
55 /*U8 b01;*/ /* b01 in ASM code but never used */
56 S16 x; /* b02 - position */
57 S16 y; /* w04 - position */
58 U8 sprite; /* b08 - sprite number */
59 /*U16 w0C;*/ /* w0C in ASM code but never used */
60 U8 w; /* b0E - width */
61 U8 h; /* b10 - height */
62 U16 mark; /* w12 - number of the mark that created the entity */
63 U8 flags; /* b14 */
64 S16 trig_x; /* b16 - position of trigger box */
65 S16 trig_y; /* w18 - position of trigger box */
66 S16 xsave; /* b1C */
67 S16 ysave; /* w1E */
68 U16 sprbase; /* w20 */
69 U16 step_no_i; /* w22 */
70 U16 step_no; /* w24 */
71 S16 c1; /* b26 */
72 S16 c2; /* b28 */
73 U8 ylow; /* b2A */
74 S16 offsy; /* w2C */
75 U8 latency; /* b2E */
76 U8 prev_n; /* new */
77 S16 prev_x; /* new */
78 S16 prev_y; /* new */
79 U8 prev_s; /* new */
80 bool front; /* new */
81 U8 trigsnd; /* new */
82} ent_t;
83
84typedef struct {
85 U8 w, h;
86 U16 spr, sni;
87 U8 trig_w, trig_h;
88 U8 snd;
89} entdata_t;
90
91typedef struct {
92 U8 count;
93 S8 dx, dy;
94} mvstep_t;
95
96enum { ENT_ENTSNUM = 12 };
97extern ent_t ent_ents[ENT_ENTSNUM + 1];
98
99extern size_t ent_nbr_entdata;
100extern entdata_t *ent_entdata;
101
102extern rect_t *ent_rects;
103
104extern size_t ent_nbr_sprseq;
105extern U8 *ent_sprseq;
106
107extern size_t ent_nbr_mvstep;
108extern mvstep_t *ent_mvstep;
109
110extern void ent_reset(void);
111extern void ent_actvis(U8, U8);
112extern void ent_draw(void);
113extern void ent_clprev(void);
114extern void ent_action(void);
115
116#endif /* ndef _ENTS_H */
117
118/* eof */