1 | |
1 | |
2 | /* |
2 | /* |
3 | * static char *rcsid_arch_c = |
3 | * static char *rcsid_arch_c = |
4 | * "$Id: arch.C,v 1.15 2006/09/10 13:20:12 root Exp $"; |
4 | * "$Id: arch.C,v 1.16 2006/09/10 16:00:23 root Exp $"; |
5 | */ |
5 | */ |
6 | |
6 | |
7 | /* |
7 | /* |
8 | CrossFire, A Multiplayer game for X-windows |
8 | CrossFire, A Multiplayer game for X-windows |
9 | |
9 | |
… | |
… | |
59 | typedef |
59 | typedef |
60 | std::tr1::unordered_map < |
60 | std::tr1::unordered_map < |
61 | size_t, archetype *> |
61 | size_t, archetype *> |
62 | HT; |
62 | HT; |
63 | |
63 | |
64 | static HT |
64 | static |
|
|
65 | HT |
65 | ht; |
66 | ht; |
66 | #endif |
67 | #endif |
67 | |
68 | |
68 | /** |
69 | /** |
69 | * GROS - This function retrieves an archetype given the name that appears |
70 | * GROS - This function retrieves an archetype given the name that appears |
… | |
… | |
423 | if (at->more) |
424 | if (at->more) |
424 | next = at->more; |
425 | next = at->more; |
425 | else |
426 | else |
426 | next = at->next; |
427 | next = at->next; |
427 | |
428 | |
428 | delete at; |
429 | delete |
|
|
430 | at; |
|
|
431 | |
429 | i++; |
432 | i++; |
430 | } |
433 | } |
431 | LOG (llevDebug, "Freed %d archetypes, %d faces\n", i, f); |
434 | LOG (llevDebug, "Freed %d archetypes, %d faces\n", i, f); |
432 | } |
435 | } |
433 | |
436 | |
… | |
… | |
517 | at = new archetype; |
520 | at = new archetype; |
518 | |
521 | |
519 | at->clone.arch = at; |
522 | at->clone.arch = at; |
520 | } |
523 | } |
521 | |
524 | |
522 | delete |
525 | delete at; |
523 | at; |
|
|
524 | } |
526 | } |
525 | |
527 | |
526 | /* |
528 | /* |
527 | * Reads the archetype file once more, and links all pointers between |
529 | * Reads the archetype file once more, and links all pointers between |
528 | * archetypes. |
530 | * archetypes. |
… | |
… | |
616 | |
618 | |
617 | sprintf (filename, "%s/%s", settings.datadir, settings.archetypes); |
619 | sprintf (filename, "%s/%s", settings.datadir, settings.archetypes); |
618 | LOG (llevDebug, "Reading archetypes from %s:\n", filename); |
620 | LOG (llevDebug, "Reading archetypes from %s:\n", filename); |
619 | |
621 | |
620 | { |
622 | { |
|
|
623 | object_thawer |
621 | object_thawer thawer (filename); |
624 | thawer (filename); |
622 | |
625 | |
623 | clear_archetable (); |
626 | clear_archetable (); |
624 | LOG (llevDebug, " arch-pass 1...\n"); |
627 | LOG (llevDebug, " arch-pass 1...\n"); |
625 | first_arch_pass (thawer); |
628 | first_arch_pass (thawer); |
626 | LOG (llevDebug, " done\n"); |
629 | LOG (llevDebug, " done\n"); |
… | |
… | |
628 | |
631 | |
629 | init_archetable (); |
632 | init_archetable (); |
630 | warn_archetypes = 1; |
633 | warn_archetypes = 1; |
631 | |
634 | |
632 | { |
635 | { |
|
|
636 | object_thawer |
633 | object_thawer thawer (filename); |
637 | thawer (filename); |
634 | |
638 | |
635 | LOG (llevDebug, " loading treasure...\n"); |
639 | LOG (llevDebug, " loading treasure...\n"); |
636 | load_treasures (); |
640 | load_treasures (); |
637 | LOG (llevDebug, " done\n arch-pass 2...\n"); |
641 | LOG (llevDebug, " done\n arch-pass 2...\n"); |
638 | second_arch_pass (thawer); |
642 | second_arch_pass (thawer); |