~ubuntu-branches/ubuntu/oneiric/airstrike/oneiric

« back to all changes in this revision

Viewing changes to src/signals.h

  • Committer: Bazaar Package Importer
  • Author(s): Sven Velt
  • Date: 2004-02-03 00:25:29 UTC
  • Revision ID: james.westby@ubuntu.com-20040203002529-6n4ejqo7nyqh2hu0
Tags: upstream-0.99+1.0pre6a
ImportĀ upstreamĀ versionĀ 0.99+1.0pre6a

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef SIGNALS_H
 
2
#define SIGNALS_H
 
3
 
 
4
/* This struct may be used as data when a signal
 
5
   asks a question from the sprite */
 
6
struct signal_reply
 
7
{
 
8
  int reply;
 
9
  void *data;
 
10
};
 
11
 
 
12
/* Defines some signals to use with sprite_signal(). In general
 
13
 * -SIGNAL_TYPE means the opposite of SIGNAL_TYPE. It is never
 
14
 * guaranteed that a sprite will catch a specific signal, this must be
 
15
 * implements as needed.
 
16
 */
 
17
enum sprite_signals{
 
18
  SIGNAL_IGNORE = 0, /* Should never have any effect */
 
19
  SIGNAL_DEBUG, /* Target should print info about itself to stderr */
 
20
  SIGNAL_ALARM, /* A previously set alarm was activated. */
 
21
  SIGNAL_DAMAGE,  /* data is a pointer to an int with the amount */
 
22
  SIGNAL_POSTARGET,   /* data is a pointer to position (int[2]) */
 
23
  SIGNAL_SPRITETARGET,/* data points to a sprite */
 
24
  SIGNAL_RESTORE, /* The sprite should return to its initial state */
 
25
  SIGNAL_BGSTUCK, /* This sprite is somehow completely inside the
 
26
                     background. It should be restored or killed. */ 
 
27
  SIGNAL_KILL, /* The sprite should kill itself */
 
28
 
 
29
  SIGNAL_CANCONTROL, /* set the int in data to 1 if the sprite
 
30
                        accepts control signals */
 
31
  /* The following signals are used by the controllers. They all have
 
32
     data=0. -SIGNAL is sent when the key is released */
 
33
  SIGNAL_FIRE,
 
34
  SIGNAL_UP,
 
35
  SIGNAL_DOWN,
 
36
  SIGNAL_LEFT,
 
37
  SIGNAL_RIGHT,
 
38
  SIGNAL_ACCELERATE,
 
39
  SIGNAL_BREAK,
 
40
  SIGNAL_STOP,
 
41
  SIGNAL_NEXT,
 
42
  SIGNAL_PREV,
 
43
  SIGNAL_ACTIVATE,
 
44
  SIGNAL_DEACTIVATE,
 
45
  SIGNAL_NUM0,
 
46
  SIGNAL_NUM1,
 
47
  SIGNAL_NUM2,
 
48
  SIGNAL_NUM3,
 
49
  SIGNAL_NUM4,
 
50
  SIGNAL_NUM5,
 
51
  SIGNAL_NUM6,
 
52
  SIGNAL_NUM7,
 
53
  SIGNAL_NUM8,
 
54
  SIGNAL_NUM9,
 
55
  /* Question signals. data is a struct signal_reply with .data as the
 
56
     asking sprite. It is never guaranteed that the target replies.
 
57
     These signals should never be used through an alarm, since data
 
58
     may be invalid when the signal is delivered. */
 
59
  SIGNAL_ISHARMLESS, /* Are you harmless to .data ? */
 
60
  SIGNAL_ISFRIEND, /* Are you a friend of .data ? */
 
61
  /* When a sprite-specific sound ends send this signal */
 
62
  SIGNAL_ENDOFSOUND,
 
63
  /* Sent when a sprite is moved because is has moved out of the
 
64
     level area */
 
65
  SIGNAL_LEVELWARP,
 
66
  /* Write a status string of this sprite into buffer at data.
 
67
   The buffer has a length of 256, including the terminating 0. */
 
68
  SIGNAL_STATSTRING,
 
69
};
 
70
 
 
71
#endif