ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/socket/image.C
(Generate patch)

Comparing deliantra/server/socket/image.C (file contents):
Revision 1.19 by root, Thu Feb 15 18:09:34 2007 UTC vs.
Revision 1.21 by root, Fri Feb 16 22:33:46 2007 UTC

33 * things like all the structures as globals. 33 * things like all the structures as globals.
34 */ 34 */
35 35
36#include <global.h> 36#include <global.h>
37#include <sproto.h> 37#include <sproto.h>
38
39#include "crc.h"
38 40
39#define MAX_FACE_SETS 20 /**< Maximum number of image sets the program will handle */ 41#define MAX_FACE_SETS 20 /**< Maximum number of image sets the program will handle */
40 42
41/** Information about one image */ 43/** Information about one image */
42typedef struct FaceInfo 44typedef struct FaceInfo
280 LOG (llevError, "read_client_images: Image num %d not in 0..%d\n%s", num, nrofpixmaps, buf); 282 LOG (llevError, "read_client_images: Image num %d not in 0..%d\n%s", num, nrofpixmaps, buf);
281 abort (); 283 abort ();
282 } 284 }
283 285
284 /* Skip accross the number data */ 286 /* Skip accross the number data */
285 for (cp = buf + 6; *cp != ' '; cp++); 287 for (cp = buf + 6; *cp != ' '; cp++)
288 ;
289
286 len = atoi (cp); 290 len = atoi (cp);
287 if (len == 0 || len > MAX_IMAGE_SIZE) 291 if (len == 0 || len > MAX_IMAGE_SIZE)
288 { 292 {
289 LOG (llevError, "read_client_images: length not valid: %d > %d \n%s", len, MAX_IMAGE_SIZE, buf); 293 LOG (llevError, "read_client_images: length not valid: %d > %d \n%s", len, MAX_IMAGE_SIZE, buf);
290 abort (); 294 abort ();
299 { 303 {
300 LOG (llevError, "read_client_images: Did not read desired amount of data, wanted %d, got %d\n%s", len, i, buf); 304 LOG (llevError, "read_client_images: Did not read desired amount of data, wanted %d, got %d\n%s", len, i, buf);
301 abort (); 305 abort ();
302 } 306 }
303 307
304 facesets[fileno].faces[num].checksum = 0; 308 crc32 chksum;
309
305 for (i = 0; i < len; i++) 310 for (i = 0; i < len; i++)
306 { 311 chksum (facesets[fileno].faces[num].data[i]);
307 rotate_right (facesets[fileno].faces[num].checksum); 312
308 facesets[fileno].faces[num].checksum += facesets[fileno].faces[num].data[i];
309 facesets[fileno].faces[num].checksum &= 0xffffffff; 313 facesets[fileno].faces[num].checksum = chksum;
310 }
311 } 314 }
312 315
313 close_and_delete (infile, compressed); 316 close_and_delete (infile, compressed);
314 } /* For fileno < MAX_FACE_SETS */ 317 } /* For fileno < MAX_FACE_SETS */
315} 318}

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines