Nilorea Library

- Main Page
- Data Structures
- Files

- File List
- Globals

All Data Structures Files Functions Variables Typedefs Macros
n_object.h
Go to the documentation of this file.
1
13 #ifndef ISO_OBJECT_FOR_NILOREA_LIBRARY
14
15
16
17 #define ISO_OBJECT_FOR_NILOREA_LIBRARY
18
19
20
21 #ifdef __cplusplus
22 extern "C"
23 {
24 #endif
25
26
27
29 typedef struct N_COORD
30 {
31 double
32 X,
34 Y,
36 spd_x,
38 spd_y,
40 acc_x,
42 acc_y;
43 } N_COORD;
44
45
46
48 typedef struct OBJECT
49 {
50
51 N_COORD
52 cur_pos,
54 aim_pos;
55
56 int
57 type ,
59 action ,
61 id ,
63 time_stamp ,
65 timeout ,
67 curr_time ;
68
70 struct OBJECT *next ;
72 struct OBJECT *prev ;
73
74 } OBJECT;
75
76
77
79 typedef struct OBJECT_LIST
80 {
82 OBJECT *start ,
84 *end ;
85
87 int nb_items,
89 nb_max_items;
90
91 }OBJECT_LIST;
92
93
94
95 /*
96 * Initialize an OBJECT list
97 */
98
99 int init_object_list( OBJECT_LIST **objlst , int max );
100
101
102
103 /*
104 * Remove an OBJECT list
105 */
106
107 int destroy_object_list( OBJECT_LIST **objlist );
108
109
110 /*
111 * Add a new object or update and existing object
112 */
113
114 int add_object( OBJECT_LIST **objlist , int type , int action , int id , double X , double Y , double speed_x , double speed_y , double acc_x , double acc_y , int time_stamp , int timeout );
115
116
117
118 /*
119 * Remove an object
120 */
121
122 int rem_object( OBJECT_LIST *objlist , int id );
123
124
125
126 /*
127 * Remove timed out entries
128 */
129
130 int refresh_list_of_object( OBJECT_LIST **objlst );
131
132
133
134 /*
135 * Sort the list of object from 0 to SCREEN_W and from 0 to SCREEN_H ( ready to display );
136 */
137
138 int sort_list_of_object( OBJECT_LIST *list );
139
140
141
142 #ifdef __cplusplus
143 }
144 #endif
145
146
147
148 #endif /* ISO_OBJECT_FOR_NILOREA_LIBRARY */