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.3 by root, Sun Sep 3 00:18:39 2006 UTC vs.
Revision 1.9 by root, Sat Sep 9 23:49:06 2006 UTC

1/* 1/*
2 * static char *rcsid_init_c = 2 * static char *rcsid_init_c =
3 * "$Id: init.C,v 1.3 2006/09/03 00:18:39 root Exp $"; 3 * "$Id: init.C,v 1.9 2006/09/09 23:49:06 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
24 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 24 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
25 25
26 The authors can be reached via e-mail at crossfire-devel@real-time.com 26 The authors can be reached via e-mail at crossfire-devel@real-time.com
27*/ 27*/
28 28
29#define EXTERN 29#define EXTERN // horrible hack
30#define INIT_C 30
31#include <global.h> 31#include <global.h>
32#include <object.h> 32#include <object.h>
33
34extern const char* const attacktype_desc[NROFATTACKS] = {
35# define def(uc, lc, name, plus, change) # name,
36# include "attackinc.h"
37# undef def
38};
39
40extern const keyword resist_save[NROFATTACKS] = {
41# define def(uc, lc, name, plus, change) KW_resist_ ## lc,
42# include "attackinc.h"
43# undef def
44};
45
46extern const char* const resist_plus[NROFATTACKS] = {
47# define def(uc, lc, name, plus, change) # plus,
48# include "attackinc.h"
49# undef def
50};
51
52extern const char* const change_resist_msg[NROFATTACKS] = {
53# define def(uc, lc, name, plus, change) # change,
54# include "attackinc.h"
55# undef def
56};
57
58int resist_table[NROFATTACKS] = {
59# define def(uc, lc, name, plus, change) ATNR_ ## uc,
60# include "attackinc.h"
61# undef def
62};
33 63
34/* You unforunately need to looking in include/global.h to see what these 64/* You unforunately need to looking in include/global.h to see what these
35 * correspond to. 65 * correspond to.
36 */ 66 */
37struct Settings settings = { 67struct Settings settings = {
256 ring_arch = NULL; 286 ring_arch = NULL;
257 amulet_arch = NULL; 287 amulet_arch = NULL;
258 staff_arch = NULL; 288 staff_arch = NULL;
259 trying_emergency_save = 0; 289 trying_emergency_save = 0;
260 num_animations=0; 290 num_animations=0;
261 animations=NULL;
262 animations_allocated=0; 291 animations_allocated=0;
263 init_defaults(); 292 init_defaults();
264} 293}
265 294
266/* 295/*
267 * Sets up and initialises the linked list of free and used objects. 296 * Sets up and initialises the linked list of free and used objects.
268 * Allocates a certain chunk of objects and puts them on the free list. 297 * Allocates a certain chunk of objects and puts them on the free list.
269 * Called by init_library(); 298 * Called by init_library();
270 */ 299 */
271 300
301void
272void init_objects(void) { 302init_objects(void)
273 int i; 303{
274/* Initialize all objects: */ 304 /* Initialize all objects: */
275 objects=NULL; 305 objects = NULL;
276 active_objects = NULL; 306 active_objects = NULL;
277
278#ifdef MEMORY_DEBUG
279 free_objects=NULL;
280#else
281 free_objects=objarray;
282 objarray[0].prev=NULL,
283 objarray[0].next= &objarray[1],
284 SET_FLAG(&objarray[0], FLAG_REMOVED);
285 SET_FLAG(&objarray[0], FLAG_FREED);
286 for(i=1;i<STARTMAX-1;i++) {
287 objarray[i].next= &objarray[i+1];
288 objarray[i].prev= &objarray[i-1];
289 SET_FLAG(&objarray[i], FLAG_REMOVED);
290 SET_FLAG(&objarray[i], FLAG_FREED);
291 }
292 objarray[STARTMAX-1].next=NULL;
293 objarray[STARTMAX-1].prev= &objarray[STARTMAX-2];
294 SET_FLAG(&objarray[STARTMAX-1], FLAG_REMOVED);
295 SET_FLAG(&objarray[STARTMAX-1], FLAG_FREED);
296#endif
297} 307}
298 308
299/* 309/*
300 * Initialises global variables which can be changed by options. 310 * Initialises global variables which can be changed by options.
301 * Called by init_library(). 311 * Called by init_library().

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines