--- deliantra/server/common/image.C 2007/01/15 21:06:18 1.12 +++ deliantra/server/common/image.C 2007/02/15 15:43:36 1.16 @@ -1,5 +1,5 @@ /* - * CrossFire, A Multiplayer game for X-windows + * CrossFire, A Multiplayer game * * Copyright (C) 2005, 2006, 2007 Marc Lehmann & Crossfire+ Development Team * Copyright (C) 2002 Mark Wedel & Crossfire Development Team @@ -26,7 +26,7 @@ #include #include -New_Face *new_faces; +facetile *new_faces; /* bmappair and xbm are used when looking for the image id numbers * of a face by name. xbm is sorted alphabetically so that bsearch @@ -46,15 +46,9 @@ unsigned int number; }; -void free (bmappair *); // guard to catch free when delete should be used - static struct bmappair *xbm = NULL; -/* Following can just as easily be pointers, but - * it is easier to keep them like this. - */ -New_Face *blank_face, *dark_faces[3], *empty_face, *smooth_face; - +facetile *blank_face, *dark_faces[3], *empty_face, *smooth_face; /* nroffiles is the actual number of bitmaps defined. * nrofpixmaps is the number of bitmaps loaded. With @@ -72,14 +66,12 @@ /** * id is the face to smooth, smooth is the 16x2 face used to smooth id. */ -struct smoothing:zero_initialised +struct smoothing : zero_initialised { uint16 id; uint16 smooth; }; -void free (smoothing *); // guard to catch free when delete should be used - /** * Contains all defined smoothing entries. smooth is an array of nrofsmooth * entries. It is sorted by smooth[].id. @@ -149,7 +141,7 @@ ReadFaceData (void) { char buf[MAX_BUF], *cp; - New_Face *on_face = NULL; + facetile *on_face = NULL; FILE *fp; sprintf (buf, "%s/faces", settings.datadir); @@ -274,16 +266,16 @@ * data, it does the job as it lets the client know if * the file has the same data or not. */ - ROTATE_RIGHT (bmaps_checksum); + rotate_right (bmaps_checksum); bmaps_checksum += value & 0xff; bmaps_checksum &= 0xffffffff; - ROTATE_RIGHT (bmaps_checksum); + rotate_right (bmaps_checksum); bmaps_checksum += (value >> 8) & 0xff; bmaps_checksum &= 0xffffffff; for (l = 0; l < strlen (q); l++) { - ROTATE_RIGHT (bmaps_checksum); + rotate_right (bmaps_checksum); bmaps_checksum += q[l]; bmaps_checksum &= 0xffffffff; } @@ -297,7 +289,7 @@ LOG (llevDebug, "done (got %d/%d/%d)\n", nrofpixmaps, nrofbmaps, nroffiles); - new_faces = new New_Face[nrofpixmaps]; + new_faces = new facetile[nrofpixmaps]; for (i = 0; i < nrofpixmaps; i++) { @@ -306,10 +298,9 @@ new_faces[i].visibility = 0; new_faces[i].magicmap = 255; } + for (i = 0; i < nroffiles; i++) - { - new_faces[xbm[i].number].name = xbm[i].name; - } + new_faces[xbm[i].number].name = xbm[i].name; // non-pod datatype, likely not allowed qsort (xbm, nroffiles, sizeof (struct bmappair), (int (*)(const void *, const void *)) compar);