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

Comparing deliantra/server/common/material.C (file contents):
Revision 1.10 by root, Fri Mar 26 01:04:44 2010 UTC vs.
Revision 1.13 by root, Wed Apr 28 19:49:50 2010 UTC

192//-GPL 192//-GPL
193 193
194void 194void
195load_materials () 195load_materials ()
196{ 196{
197 char filename[MAX_BUF];
198
199 sprintf (filename, "%s/materials", settings.datadir);
200 LOG (llevDebug, "Reading material type data from %s...\n", filename);
201
202 //TODO: somehow free old materials, or update them in-place 197 //TODO: somehow free old materials, or update them in-place
198 // currently we effectively leak them.
203 material_null.next = 0; materialt = &material_null; 199 material_null.next = 0; materialt = &material_null;
204 200
205 object_thawer thawer (filename); 201 object_thawer thawer (settings.datadir, "materials");
206 202
207 if (!thawer) 203 if (!thawer)
208 { 204 {
209 LOG (llevError, "Cannot open %s for reading\n", filename); 205 LOG (llevError, "Cannot open %s for reading\n", thawer.name);
210 goto done; 206 goto done;
211 } 207 }
212 208
213 while (thawer.kw != KW_name) 209 while (thawer.kw != KW_name)
214 { 210 {
297 293
298 case KW_EOF: 294 case KW_EOF:
299 goto done; 295 goto done;
300 296
301 default: 297 default:
302 if (!thawer.parse_error ("materials file", "materials")) 298 if (!thawer.parse_error ("materials file"))
303 goto done; 299 goto done;
304 break; 300 break;
305 } 301 }
306 302
307 thawer.next (); 303 thawer.next ();

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines