--- deliantra/server/socket/image.C 2007/02/15 15:43:36 1.18 +++ deliantra/server/socket/image.C 2007/03/01 12:28:17 1.22 @@ -36,6 +36,8 @@ #include #include +#include "crc.h" + #define MAX_FACE_SETS 20 /**< Maximum number of image sets the program will handle */ /** Information about one image */ @@ -282,7 +284,9 @@ } /* Skip accross the number data */ - for (cp = buf + 6; *cp != ' '; cp++); + for (cp = buf + 6; *cp != ' '; cp++) + ; + len = atoi (cp); if (len == 0 || len > MAX_IMAGE_SIZE) { @@ -301,13 +305,12 @@ abort (); } - facesets[fileno].faces[num].checksum = 0; + crc32 chksum; + for (i = 0; i < len; i++) - { - rotate_right (facesets[fileno].faces[num].checksum); - facesets[fileno].faces[num].checksum += facesets[fileno].faces[num].data[i]; - facesets[fileno].faces[num].checksum &= 0xffffffff; - } + chksum (facesets[fileno].faces[num].data[i]); + + facesets[fileno].faces[num].checksum = chksum; } close_and_delete (infile, compressed); @@ -416,7 +419,7 @@ { packet sl; - sl.printf ("replyinfo image_info\n%d\n%d\n", nrofpixmaps - 1, bmaps_checksum); + sl.printf ("replyinfo image_info\n%d\n%u\n", nrofpixmaps - 1, (unsigned int)bmaps_checksum); for (int i = 0; i < MAX_FACE_SETS; i++) if (facesets[i].prefix) @@ -440,7 +443,7 @@ send_image_sums (client *ns, char *params) { int start, stop; - char *cp, buf[MAX_BUF]; + char *cp; packet sl;