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.94 by root, Mon Mar 12 01:13:10 2007 UTC vs.
Revision 1.97 by root, Sat Mar 17 21:13:21 2007 UTC

454} 454}
455 455
456bool 456bool
457maptile::_save_objects (object_freezer &f, int flags) 457maptile::_save_objects (object_freezer &f, int flags)
458{ 458{
459 static int cede_count = 0; 459 coroapi::cede ();
460 460
461 if (flags & IO_HEADER) 461 if (flags & IO_HEADER)
462 _save_header (f); 462 _save_header (f);
463 463
464 if (!spaces) 464 if (!spaces)
465 return false; 465 return false;
466 466
467 for (int i = 0; i < size (); ++i) 467 for (int i = 0; i < size (); ++i)
468 { 468 {
469#if 0 // temporarily disabled for improved(?) stability, schmorp #TODO#d#//D 469#if 0 // disabled, there still seem to be races somewhere
470 static int cede_count = 0;
471
470 if (cede_count >= 500) 472 if (cede_count >= 500)
471 { 473 {
472 cede_count = 0; 474 cede_count = 0;
473 coroapi::cede (); 475 coroapi::cede ();
474 } 476 }
493 } 495 }
494 else if (flags & IO_OBJECTS) 496 else if (flags & IO_OBJECTS)
495 op->write (f); 497 op->write (f);
496 } 498 }
497 } 499 }
500
501 coroapi::cede ();
498 502
499 return true; 503 return true;
500} 504}
501 505
502bool 506bool
1081 1085
1082 //object *middle = 0; 1086 //object *middle = 0;
1083 //object *top = 0; 1087 //object *top = 0;
1084 //object *floor = 0; 1088 //object *floor = 0;
1085 // this seems to generate better code than using locals, above 1089 // this seems to generate better code than using locals, above
1086 object *&top = faces_obj[0]; 1090 object *&top = faces_obj[0] = 0;
1087 object *&middle = faces_obj[1]; 1091 object *&middle = faces_obj[1] = 0;
1088 object *&floor = faces_obj[2]; 1092 object *&floor = faces_obj[2] = 0;
1089 1093
1090 for (tmp = bot; tmp; last = tmp, tmp = tmp->above) 1094 for (tmp = bot; tmp; last = tmp, tmp = tmp->above)
1091 { 1095 {
1092 /* This could be made additive I guess (two lights better than 1096 /* This could be made additive I guess (two lights better than
1093 * one). But if so, it shouldn't be a simple additive - 2 1097 * one). But if so, it shouldn't be a simple additive - 2

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines