1 | |
|
|
2 | /* |
|
|
3 | * static char *rcsid_image_c = |
|
|
4 | * "$Id: image.C,v 1.6 2006/09/10 16:00:23 root Exp $"; |
|
|
5 | */ |
|
|
6 | |
|
|
7 | /* |
1 | /* |
8 | CrossFire, A Multiplayer game for X-windows |
2 | CrossFire, A Multiplayer game for X-windows |
9 | |
3 | |
10 | Copyright (C) 2002 Mark Wedel & Crossfire Development Team |
4 | Copyright (C) 2002 Mark Wedel & Crossfire Development Team |
11 | Copyright (C) 1992 Frank Tore Johansen |
5 | Copyright (C) 1992 Frank Tore Johansen |
… | |
… | |
22 | |
16 | |
23 | You should have received a copy of the GNU General Public License |
17 | You should have received a copy of the GNU General Public License |
24 | along with this program; if not, write to the Free Software |
18 | along with this program; if not, write to the Free Software |
25 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
19 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
26 | |
20 | |
27 | The maintainer of this code can be reached at crossfire-devel@real-time.com |
21 | The maintainer of this code can be reached at <crossfire@schmorp.de> |
28 | */ |
22 | */ |
29 | |
23 | |
30 | |
24 | |
31 | #include <global.h> |
25 | #include <global.h> |
32 | #include <stdio.h> |
26 | #include <stdio.h> |
… | |
… | |
158 | char buf[MAX_BUF], *cp; |
152 | char buf[MAX_BUF], *cp; |
159 | New_Face *on_face = NULL; |
153 | New_Face *on_face = NULL; |
160 | FILE *fp; |
154 | FILE *fp; |
161 | |
155 | |
162 | sprintf (buf, "%s/faces", settings.datadir); |
156 | sprintf (buf, "%s/faces", settings.datadir); |
163 | LOG (llevDebug, "Reading faces from %s...", buf); |
157 | LOG (llevDebug, "Reading faces from %s...\n", buf); |
164 | if ((fp = fopen (buf, "r")) == NULL) |
158 | if ((fp = fopen (buf, "r")) == NULL) |
165 | { |
159 | { |
166 | LOG (llevError, "Cannot open faces file %s: %s\n", buf, strerror (errno)); |
160 | LOG (llevError, "Cannot open faces file %s: %s\n", buf, strerror (errno)); |
167 | exit (-1); |
161 | exit (-1); |
168 | } |
162 | } |
… | |
… | |
242 | int value, nrofbmaps = 0, i; |
236 | int value, nrofbmaps = 0, i; |
243 | size_t l; |
237 | size_t l; |
244 | |
238 | |
245 | bmaps_checksum = 0; |
239 | bmaps_checksum = 0; |
246 | sprintf (buf, "%s/bmaps", settings.datadir); |
240 | sprintf (buf, "%s/bmaps", settings.datadir); |
247 | LOG (llevDebug, "Reading bmaps from %s...", buf); |
241 | LOG (llevDebug, "Reading bmaps from %s...\n", buf); |
248 | if ((fp = fopen (buf, "r")) == NULL) |
242 | if ((fp = fopen (buf, "r")) == NULL) |
249 | { |
243 | { |
250 | LOG (llevError, "Cannot open bmaps file %s: %s\n", buf, strerror (errno)); |
244 | LOG (llevError, "Cannot open bmaps file %s: %s\n", buf, strerror (errno)); |
251 | exit (-1); |
245 | exit (-1); |
252 | } |
246 | } |
… | |
… | |
270 | { |
264 | { |
271 | LOG (llevDebug, "Warning, syntax error: %s\n", buf); |
265 | LOG (llevDebug, "Warning, syntax error: %s\n", buf); |
272 | continue; |
266 | continue; |
273 | } |
267 | } |
274 | value = atoi (p); |
268 | value = atoi (p); |
275 | xbm[nroffiles].name = strdup_local (q); |
269 | xbm[nroffiles].name = strdup (q); |
276 | |
270 | |
277 | /* We need to calculate the checksum of the bmaps file |
271 | /* We need to calculate the checksum of the bmaps file |
278 | * name->number mapping to send to the client. This does not |
272 | * name->number mapping to send to the client. This does not |
279 | * need to match what sum or other utility may come up with - |
273 | * need to match what sum or other utility may come up with - |
280 | * as long as we get the same results on the same real file |
274 | * as long as we get the same results on the same real file |
… | |
… | |
393 | FILE *fp; |
387 | FILE *fp; |
394 | int smoothcount = 0; |
388 | int smoothcount = 0; |
395 | |
389 | |
396 | bmaps_checksum = 0; |
390 | bmaps_checksum = 0; |
397 | sprintf (buf, "%s/smooth", settings.datadir); |
391 | sprintf (buf, "%s/smooth", settings.datadir); |
398 | LOG (llevDebug, "Reading smooth from %s...", buf); |
392 | LOG (llevDebug, "Reading smooth from %s...\n", buf); |
399 | if ((fp = fopen (buf, "r")) == NULL) |
393 | if ((fp = fopen (buf, "r")) == NULL) |
400 | { |
394 | { |
401 | LOG (llevError, "Cannot open smooth file %s: %s\n", strerror (errno)); |
395 | LOG (llevError, "Cannot open smooth file %s: %s\n", strerror (errno)); |
402 | exit (-1); |
396 | exit (-1); |
403 | } |
397 | } |