]>
git.cameronkatri.com Git - bsdgames-darwin.git/blob - warp/object.c
1 /* Header: object.c,v 7.0 86/10/08 15:12:55 lwall Exp */
4 * Revision 7.0 86/10/08 15:12:55 lwall
5 * Split into separate files. Added amoebas and pirates.
21 make_object(char typ
, char img
, int px
, int py
, int vx
, int vy
, long energ
,
22 long mas
, OBJECT
*where
)
26 if (free_root
.next
== &free_root
)
28 obj
= (OBJECT
*) malloc(sizeof root
);
34 free_root
.next
= obj
->next
;
35 obj
->next
->prev
= &free_root
;
40 obj
->prev
= where
->prev
;
42 obj
->prev
->next
= obj
;
50 if (typ
!= Torp
&& typ
!= Web
) {
51 occupant
[py
][px
] = obj
;
59 unmake_object(OBJECT
*curobj
)
61 curobj
->prev
->next
= curobj
->next
;
62 curobj
->next
->prev
= curobj
->prev
;
63 if (curobj
== movers
) {
64 movers
= curobj
->next
;
70 free_object(OBJECT
*curobj
)
72 curobj
->next
= free_root
.next
;
73 curobj
->prev
= &free_root
;
74 free_root
.next
->prev
= curobj
;
75 free_root
.next
= curobj
;