1 | /* |
1 | /* |
2 | * static char *rcsid_arch_c = |
2 | * static char *rcsid_arch_c = |
3 | * "$Id: arch.C,v 1.4 2006/08/27 16:15:11 root Exp $"; |
3 | * "$Id: arch.C,v 1.5 2006/08/28 14:05:23 root Exp $"; |
4 | */ |
4 | */ |
5 | |
5 | |
6 | /* |
6 | /* |
7 | CrossFire, A Multiplayer game for X-windows |
7 | CrossFire, A Multiplayer game for X-windows |
8 | |
8 | |
… | |
… | |
399 | |
399 | |
400 | /* |
400 | /* |
401 | * Reads/parses the archetype-file, and copies into a linked list |
401 | * Reads/parses the archetype-file, and copies into a linked list |
402 | * of archetype-structures. |
402 | * of archetype-structures. |
403 | */ |
403 | */ |
404 | void first_arch_pass(FILE *fp) { |
404 | void first_arch_pass(object_thawer &fp) { |
405 | object *op; |
405 | object *op; |
406 | archetype *at,*head=NULL,*last_more=NULL; |
406 | archetype *at,*head=NULL,*last_more=NULL; |
407 | int i,first=2; |
407 | int i,first=2; |
408 | |
408 | |
409 | object_thawer thawer; |
|
|
410 | |
|
|
411 | op=get_object(); |
409 | op=get_object(); |
412 | op->arch=first_archetype=at=get_archetype_struct(); |
410 | op->arch=first_archetype=at=get_archetype_struct(); |
413 | |
411 | |
414 | while((i=load_object(fp,thawer,op,first,0))) { |
412 | while((i=load_object(fp,op,first,0))) { |
415 | first=0; |
413 | first=0; |
416 | copy_object(op,&at->clone); |
414 | copy_object(op,&at->clone); |
417 | at->clone.speed_left= (float) (-0.1); |
415 | at->clone.speed_left= (float) (-0.1); |
418 | /* copy the body_info to the body_used - this is only really |
416 | /* copy the body_info to the body_used - this is only really |
419 | * need for monsters, but doesn't hurt to do it for everything. |
417 | * need for monsters, but doesn't hurt to do it for everything. |
… | |
… | |
548 | clear_archetable(); |
546 | clear_archetable(); |
549 | LOG(llevDebug," arch-pass 1...\n"); |
547 | LOG(llevDebug," arch-pass 1...\n"); |
550 | #if TIME_ARCH_LOAD |
548 | #if TIME_ARCH_LOAD |
551 | GETTIMEOFDAY(&tv1); |
549 | GETTIMEOFDAY(&tv1); |
552 | #endif |
550 | #endif |
|
|
551 | { |
|
|
552 | object_thawer thawer (fp); |
553 | first_arch_pass(fp); |
553 | first_arch_pass (thawer); |
|
|
554 | } |
554 | #if TIME_ARCH_LOAD |
555 | #if TIME_ARCH_LOAD |
555 | { int sec, usec; |
556 | { int sec, usec; |
556 | GETTIMEOFDAY(&tv2); |
557 | GETTIMEOFDAY(&tv2); |
557 | sec = tv2.tv_sec - tv1.tv_sec; |
558 | sec = tv2.tv_sec - tv1.tv_sec; |
558 | usec = tv2.tv_usec - tv1.tv_usec; |
559 | usec = tv2.tv_usec - tv1.tv_usec; |