Fix accidental switch/teleporter behavior changes
[neverball] / share / state.h
1 #ifndef STATE_H
2 #define STATE_H
3
4 #include <stdlib.h>
5 #include <stdio.h>
6
7 /*---------------------------------------------------------------------------*/
8
9 struct state
10 {
11     int  (*enter)(struct state *, struct state *prev);
12     void (*leave)(struct state *, struct state *next, int id);
13     void (*paint)(int id, float t);
14     void (*timer)(int id, float dt);
15     void (*point)(int id, int x, int y, int dx, int dy);
16     void (*stick)(int id, int a, int v);
17     void (*angle)(int id, int x, int z);
18     int  (*click)(int b,  int d);
19     int  (*keybd)(int c,  int d);
20     int  (*buttn)(int b,  int d);
21
22     int pointer;
23     int gui_id;
24 };
25
26 struct state *curr_state(void);
27 float time_state(void);
28 void  init_state(struct state *);
29 int   goto_state(struct state *);
30
31 void st_paint(float);
32 void st_timer(float);
33 void st_point(int, int, int, int);
34 void st_stick(int, int);
35 void st_angle(int, int);
36 int  st_click(int, int);
37 int  st_keybd(int, int);
38 int  st_buttn(int, int);
39
40 /*---------------------------------------------------------------------------*/
41
42 #endif