forgotten commit. disabled until egl is adapted.
[AROS-Contrib.git] / Games / XInvaders3D / object.h
blob8307ddab38831f70096b2a3a7e842279b0de4e63
1 /*------------------------------------------------------------------
2 object.h: Model Data, Object, and Object-List managment struct & functions
4 XINVADERS 3D - 3d Shoot'em up
5 Copyright (C) 2000 Don Llopis
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 ------------------------------------------------------------------*/
22 #ifndef OBJECT_HEADER
23 #define OBJECT_HEADER
25 typedef struct MODELSTRUCT MODEL;
26 typedef struct OBJECTSTRUCT OBJECT;
27 typedef struct OBJLISTSTRUCT OBJLIST;
29 typedef void (*PFV1) ( OBJECT * );
30 typedef void (*PFV2) ( OBJECT *, MATRIX4 );
32 /*------------------------------------------------------------------
33 * MODEL:
34 * Model data management Struct & Funtions
36 ------------------------------------------------------------------*/
38 struct MODELSTRUCT
40 float **vertex;
41 int **edge;
42 int **poly;
43 int num_vertex;
44 int num_polys;
47 /*------------------------------------------------------------------
48 * OBJECT:
49 * Object Managment Struct & Funtions
51 ------------------------------------------------------------------*/
52 struct OBJECTSTRUCT
54 int active;
56 long frame;
57 long delay;
58 long max_frame;
60 int zone;
61 int zheight;
62 int vpos;
64 float radius;
65 float radius_squared;
67 double rot;
69 VECTOR4 pos;
70 VECTOR4 old_pos;
71 VECTOR4 dir;
72 VECTOR4 thrust;
74 PFV1 actionfn;
75 PFV2 drawfn;
77 MODEL *model;
79 OBJECT *next;
80 OBJECT *prev;
83 extern OBJECT * Object_new ( void );
84 extern void Object_delete ( OBJECT * );
85 extern void Object_init ( OBJECT * );
87 extern void Object_set_actionfn ( OBJECT *, PFV1 );
88 extern void Object_set_drawfn ( OBJECT *, PFV2 );
90 extern void Object_set_model ( OBJECT *, MODEL * );
92 extern void Object_set_pos ( OBJECT *, VECTOR4 );
93 extern void Object_get_pos ( OBJECT *, VECTOR4 );
95 extern void Object_set_dir ( OBJECT *, VECTOR4 );
96 extern void Object_get_dir ( OBJECT *, VECTOR4 );
98 extern void Object_draw ( OBJECT * );
101 /*------------------------------------------------------------------
102 * OBJLIST:
103 * gobject list managment struct & routines
105 ------------------------------------------------------------------*/
107 struct OBJLISTSTRUCT
109 int obj_count;
110 OBJECT *head;
111 OBJECT *tail;
114 extern void Objlist_clear ( OBJLIST * );
115 extern void Objlist_add ( OBJLIST *, OBJECT * );
116 extern void Objlist_del ( OBJLIST *, OBJECT * );
117 extern int Objlist_count ( OBJLIST * );
119 #endif