1 | /* |
1 | /* |
2 | * static char *rcsid_init_c = |
2 | * static char *rcsid_init_c = |
3 | * "$Id: init.C,v 1.4 2006/09/03 07:57:54 root Exp $"; |
3 | * "$Id: init.C,v 1.5 2006/09/04 11:07:59 root Exp $"; |
4 | */ |
4 | */ |
5 | |
5 | |
6 | /* |
6 | /* |
7 | CrossFire, A Multiplayer game for X-windows |
7 | CrossFire, A Multiplayer game for X-windows |
8 | |
8 | |
… | |
… | |
271 | void init_objects(void) { |
271 | void init_objects(void) { |
272 | int i; |
272 | int i; |
273 | /* Initialize all objects: */ |
273 | /* Initialize all objects: */ |
274 | objects=NULL; |
274 | objects=NULL; |
275 | active_objects = NULL; |
275 | active_objects = NULL; |
276 | |
|
|
277 | #ifdef MEMORY_DEBUG |
|
|
278 | free_objects=NULL; |
|
|
279 | #else |
|
|
280 | free_objects=objarray; |
|
|
281 | objarray[0].prev=NULL, |
|
|
282 | objarray[0].next= &objarray[1], |
|
|
283 | SET_FLAG(&objarray[0], FLAG_REMOVED); |
|
|
284 | SET_FLAG(&objarray[0], FLAG_FREED); |
|
|
285 | for(i=1;i<STARTMAX-1;i++) { |
|
|
286 | objarray[i].next= &objarray[i+1]; |
|
|
287 | objarray[i].prev= &objarray[i-1]; |
|
|
288 | SET_FLAG(&objarray[i], FLAG_REMOVED); |
|
|
289 | SET_FLAG(&objarray[i], FLAG_FREED); |
|
|
290 | } |
|
|
291 | objarray[STARTMAX-1].next=NULL; |
|
|
292 | objarray[STARTMAX-1].prev= &objarray[STARTMAX-2]; |
|
|
293 | SET_FLAG(&objarray[STARTMAX-1], FLAG_REMOVED); |
|
|
294 | SET_FLAG(&objarray[STARTMAX-1], FLAG_FREED); |
|
|
295 | #endif |
|
|
296 | } |
276 | } |
297 | |
277 | |
298 | /* |
278 | /* |
299 | * Initialises global variables which can be changed by options. |
279 | * Initialises global variables which can be changed by options. |
300 | * Called by init_library(). |
280 | * Called by init_library(). |