1 | /* |
1 | /* |
2 | * static char *rcsid_init_c = |
2 | * static char *rcsid_init_c = |
3 | * "$Id: init.C,v 1.2 2006/08/29 08:01:35 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 | |
… | |
… | |
179 | */ |
179 | */ |
180 | |
180 | |
181 | void init_library(void) { |
181 | void init_library(void) { |
182 | init_environ(); |
182 | init_environ(); |
183 | init_globals(); |
183 | init_globals(); |
184 | init_hash_table(); |
|
|
185 | init_objects(); |
184 | init_objects(); |
186 | init_vars(); |
185 | init_vars(); |
187 | init_block(); |
186 | init_block(); |
188 | ReadBmapNames (); |
187 | ReadBmapNames (); |
189 | ReadSmooth(); |
188 | ReadSmooth(); |
… | |
… | |
255 | nrofartifacts = 0; |
254 | nrofartifacts = 0; |
256 | nrofallowedstr=0; |
255 | nrofallowedstr=0; |
257 | ring_arch = NULL; |
256 | ring_arch = NULL; |
258 | amulet_arch = NULL; |
257 | amulet_arch = NULL; |
259 | staff_arch = NULL; |
258 | staff_arch = NULL; |
260 | undead_name = add_string("undead"); |
|
|
261 | trying_emergency_save = 0; |
259 | trying_emergency_save = 0; |
262 | num_animations=0; |
260 | num_animations=0; |
263 | animations=NULL; |
|
|
264 | animations_allocated=0; |
261 | animations_allocated=0; |
265 | init_defaults(); |
262 | init_defaults(); |
266 | } |
263 | } |
267 | |
264 | |
268 | /* |
265 | /* |
… | |
… | |
274 | void init_objects(void) { |
271 | void init_objects(void) { |
275 | int i; |
272 | int i; |
276 | /* Initialize all objects: */ |
273 | /* Initialize all objects: */ |
277 | objects=NULL; |
274 | objects=NULL; |
278 | active_objects = NULL; |
275 | active_objects = NULL; |
279 | |
|
|
280 | #ifdef MEMORY_DEBUG |
|
|
281 | free_objects=NULL; |
|
|
282 | #else |
|
|
283 | free_objects=objarray; |
|
|
284 | objarray[0].prev=NULL, |
|
|
285 | objarray[0].next= &objarray[1], |
|
|
286 | SET_FLAG(&objarray[0], FLAG_REMOVED); |
|
|
287 | SET_FLAG(&objarray[0], FLAG_FREED); |
|
|
288 | for(i=1;i<STARTMAX-1;i++) { |
|
|
289 | objarray[i].next= &objarray[i+1]; |
|
|
290 | objarray[i].prev= &objarray[i-1]; |
|
|
291 | SET_FLAG(&objarray[i], FLAG_REMOVED); |
|
|
292 | SET_FLAG(&objarray[i], FLAG_FREED); |
|
|
293 | } |
|
|
294 | objarray[STARTMAX-1].next=NULL; |
|
|
295 | objarray[STARTMAX-1].prev= &objarray[STARTMAX-2]; |
|
|
296 | SET_FLAG(&objarray[STARTMAX-1], FLAG_REMOVED); |
|
|
297 | SET_FLAG(&objarray[STARTMAX-1], FLAG_FREED); |
|
|
298 | #endif |
|
|
299 | } |
276 | } |
300 | |
277 | |
301 | /* |
278 | /* |
302 | * Initialises global variables which can be changed by options. |
279 | * Initialises global variables which can be changed by options. |
303 | * Called by init_library(). |
280 | * Called by init_library(). |