… | |
… | |
72 | typedef signed char sint8; |
72 | typedef signed char sint8; |
73 | #define SINT8_MAX 127 |
73 | #define SINT8_MAX 127 |
74 | |
74 | |
75 | typedef unsigned short Fontindex; |
75 | typedef unsigned short Fontindex; |
76 | |
76 | |
77 | #ifdef WIN32 |
|
|
78 | /* Python plugin stuff defines SIZEOF_LONG_LONG as 8, and besides __int64 is a 64b type on MSVC... |
|
|
79 | * So let's force the typedef */ |
|
|
80 | typedef unsigned __int64 uint64; |
|
|
81 | typedef signed __int64 sint64; |
|
|
82 | /* Needed for experience */ |
|
|
83 | #define atoll _atoi64 |
|
|
84 | |
|
|
85 | /* To reduce number of warnings */ |
|
|
86 | #pragma warning( disable: 4244 ) /* conversion from 'xxx' to 'yyy', possible loss of data */ |
|
|
87 | #pragma warning( disable: 4305 ) /* initializing float f = 0.05; instead of f = 0.05f; */ |
|
|
88 | |
|
|
89 | #else /* WIN32 */ |
|
|
90 | |
|
|
91 | #if SIZEOF_LONG == 8 |
77 | #if SIZEOF_LONG == 8 |
92 | typedef unsigned long uint64; |
78 | typedef unsigned long uint64; |
93 | typedef signed long sint64; |
79 | typedef signed long sint64; |
94 | #elif SIZEOF_LONG_LONG == 8 |
80 | #elif SIZEOF_LONG_LONG == 8 |
95 | typedef unsigned long long uint64; |
81 | typedef unsigned long long uint64; |
… | |
… | |
97 | #else |
83 | #else |
98 | #error do not know how to get a 64 bit value on this system. |
84 | #error do not know how to get a 64 bit value on this system. |
99 | #error correct and send mail to crossfire-devel on how to do this |
85 | #error correct and send mail to crossfire-devel on how to do this |
100 | #endif |
86 | #endif |
101 | |
87 | |
102 | #endif |
|
|
103 | |
|
|
104 | #include <vector> |
88 | #include <vector> |
105 | |
89 | |
106 | #define ACC_CLASS(name) |
90 | #define ACC_CLASS(name) |
107 | #define ACC(meta,member) member |
91 | #define ACC(meta,member) member |
108 | |
92 | |
… | |
… | |
139 | #include "book.h" |
123 | #include "book.h" |
140 | /* |
124 | /* |
141 | * So far only used when dealing with artifacts. |
125 | * So far only used when dealing with artifacts. |
142 | * (now used by alchemy and other code too. Nov 95 b.t). |
126 | * (now used by alchemy and other code too. Nov 95 b.t). |
143 | */ |
127 | */ |
144 | typedef struct linked_char { |
128 | struct linked_char |
|
|
129 | { |
145 | shstr name; |
130 | shstr name; |
146 | struct linked_char *next; |
131 | struct linked_char *next; |
147 | } linked_char; |
132 | }; |
148 | |
133 | |
149 | /* Pull in artifacts */ |
134 | /* Pull in artifacts */ |
150 | #include "artifact.h" |
135 | #include "artifact.h" |
151 | |
136 | |
152 | /* Now for gods */ |
137 | /* Now for gods */ |
… | |
… | |
171 | |
156 | |
172 | /* |
157 | /* |
173 | * These are the beginnings of linked lists: |
158 | * These are the beginnings of linked lists: |
174 | */ |
159 | */ |
175 | EXTERN player *first_player; |
160 | EXTERN player *first_player; |
176 | EXTERN mapstruct *first_map; |
161 | EXTERN maptile *first_map; |
177 | EXTERN region *first_region; |
162 | EXTERN region *first_region; |
178 | EXTERN treasurelist *first_treasurelist; |
163 | EXTERN treasurelist *first_treasurelist; |
179 | EXTERN artifactlist *first_artifactlist; |
164 | EXTERN artifactlist *first_artifactlist; |
180 | EXTERN archetype *first_archetype; |
165 | EXTERN archetype *first_archetype; |
181 | EXTERN objectlink *first_friendly_object; /* Objects monsters will go after */ |
166 | EXTERN objectlink *first_friendly_object; /* Objects monsters will go after */ |
… | |
… | |
279 | #else |
264 | #else |
280 | # define CALLOC(x,y) malloc(x*y) |
265 | # define CALLOC(x,y) malloc(x*y) |
281 | # define CFREE(x) free(x) |
266 | # define CFREE(x) free(x) |
282 | #endif |
267 | #endif |
283 | |
268 | |
284 | #ifndef WIN32 /* ---win32 we define this stuff in win32.h */ |
|
|
285 | #if HAVE_DIRENT_H |
269 | #if HAVE_DIRENT_H |
286 | # include <dirent.h> |
270 | # include <dirent.h> |
287 | # define NAMLEN(dirent) strlen((dirent)->d_name) |
271 | # define NAMLEN(dirent) strlen((dirent)->d_name) |
288 | #else |
272 | #else |
289 | # define dirent direct |
273 | # define dirent direct |
… | |
… | |
295 | # include <sys/dir.h> |
279 | # include <sys/dir.h> |
296 | # endif |
280 | # endif |
297 | # if HAVE_NDIR_H |
281 | # if HAVE_NDIR_H |
298 | # include <ndir.h> |
282 | # include <ndir.h> |
299 | # endif |
283 | # endif |
300 | #endif |
|
|
301 | #endif |
284 | #endif |
302 | |
285 | |
303 | typedef struct Settings { |
286 | typedef struct Settings { |
304 | char *logfilename; /* logfile to use */ |
287 | char *logfilename; /* logfile to use */ |
305 | uint16 csport; /* port for new client/server */ |
288 | uint16 csport; /* port for new client/server */ |
… | |
… | |
403 | void free (object *); |
386 | void free (object *); |
404 | void free (archetype *); |
387 | void free (archetype *); |
405 | void free (recipe *); |
388 | void free (recipe *); |
406 | void free (linked_char *); |
389 | void free (linked_char *); |
407 | void free (godlink *); |
390 | void free (godlink *); |
|
|
391 | void free (objectlink *); |
|
|
392 | void free (oblinkpt *); |
408 | void free (mapstruct *); |
393 | void free (maptile *); |
409 | void free (key_value *); |
394 | void free (key_value *); |
410 | void free (treasure *); |
395 | void free (treasure *); |
411 | void free (materialtype_t *); |
396 | void free (materialtype_t *); |
412 | void free (player *); |
397 | void free (player *); |
413 | void free (New_Face *); |
398 | void free (New_Face *); |