ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/common/init.C
(Generate patch)

Comparing deliantra/server/common/init.C (file contents):
Revision 1.2 by root, Tue Aug 29 08:01:35 2006 UTC vs.
Revision 1.6 by pippijn, Thu Sep 7 09:37:11 2006 UTC

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.6 2006/09/07 09:37:11 pippijn 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
181void init_library(void) { 181void 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/*
269 * Sets up and initialises the linked list of free and used objects. 266 * Sets up and initialises the linked list of free and used objects.
270 * Allocates a certain chunk of objects and puts them on the free list. 267 * Allocates a certain chunk of objects and puts them on the free list.
271 * Called by init_library(); 268 * Called by init_library();
272 */ 269 */
273 270
271void
274void init_objects(void) { 272init_objects(void)
275 int i; 273{
276/* Initialize all objects: */ 274 /* Initialize all objects: */
277 objects=NULL; 275 objects = NULL;
278 active_objects = NULL; 276 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} 277}
300 278
301/* 279/*
302 * Initialises global variables which can be changed by options. 280 * Initialises global variables which can be changed by options.
303 * Called by init_library(). 281 * Called by init_library().

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines