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

Comparing deliantra/server/common/map.C (file contents):
Revision 1.123 by root, Thu Aug 30 07:28:24 2007 UTC vs.
Revision 1.124 by root, Tue Sep 4 05:43:20 2007 UTC

408 408
409 return true; 409 return true;
410} 410}
411 411
412bool 412bool
413maptile::_load_objects (const char *path, bool skip_header)
414{
415 object_thawer f (path);
416
417 if (!f)
418 return false;
419
420 f.next ();
421
422 if (skip_header)
423 for (;;)
424 {
425 keyword kw = f.kw;
426 f.skip ();
427 if (kw == KW_end)
428 break;
429 }
430
431 return _load_objects (f);
432}
433
434bool
435maptile::_save_objects (const char *path, int flags) 413maptile::_save_objects (const char *path, int flags)
436{ 414{
437 object_freezer freezer; 415 object_freezer freezer;
438 416
439 if (!_save_objects (freezer, flags)) 417 if (!_save_objects (freezer, flags))
611bool 589bool
612maptile::_load_header (object_thawer &thawer) 590maptile::_load_header (object_thawer &thawer)
613{ 591{
614 for (;;) 592 for (;;)
615 { 593 {
616 thawer.next ();
617
618 switch (thawer.kw) 594 switch (thawer.kw)
619 { 595 {
620 case KW_msg: 596 case KW_msg:
621 thawer.get_ml (KW_endmsg, msg); 597 thawer.get_ml (KW_endmsg, msg);
622 break; 598 break;
681 case KW_ERROR: 657 case KW_ERROR:
682 set_key_text (thawer.kw_str, thawer.value); 658 set_key_text (thawer.kw_str, thawer.value);
683 break; 659 break;
684 660
685 case KW_end: 661 case KW_end:
662 thawer.next ();
686 return true; 663 return true;
687 664
688 default: 665 default:
689 if (!thawer.parse_error ("map", 0)) 666 if (!thawer.parse_error ("map", 0))
690 return false; 667 return false;
691 break; 668 break;
692 } 669 }
670
671 thawer.next ();
693 } 672 }
694 673
695 abort (); 674 abort ();
696}
697
698bool
699maptile::_load_header (const char *path)
700{
701 object_thawer thawer (path);
702
703 if (!thawer)
704 return false;
705
706 return _load_header (thawer);
707} 675}
708 676
709/****************************************************************************** 677/******************************************************************************
710 * This is the start of unique map handling code 678 * This is the start of unique map handling code
711 *****************************************************************************/ 679 *****************************************************************************/

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines