| 314 | hashtable<const char *, mapmodelattributes *> mdlregistry; |
| 315 | |
| 316 | void setmodelattributes(const char *name, mapmodelattributes &ma) |
| 317 | { |
| 318 | if(!strchr(name, ' ') && !strncmp(name, mmpath, strlen(mmpath))) name += strlen(mmpath); // for now: ignore mapmodels with spaces in the path (next release: ban them) |
| 319 | else return; // we only want mapmodels |
| 320 | mapmodelattributes **mrp = mdlregistry.access(name), *mr = mrp ? *mrp : NULL, *r = mr; |
| 321 | if(!r) |
| 322 | { |
| 323 | r = new mapmodelattributes; |
| 324 | copystring(r->name, name); |
| 325 | } |
| 326 | loopi(MMA_NUM) |
| 327 | { |
| 328 | if(ma.n[i]) |
| 329 | { |
| 330 | if(!r->n[i]) mapmodelchanged = 1; |
| 331 | DELSTRING(r->n[i]); // overwrite existing attributes |
| 332 | r->n[i] = ma.n[i]; |
| 333 | ma.n[i] = NULL; |
| 334 | } |
| 335 | } |
| 336 | if(!mr) mdlregistry.access(r->name, r); |
| 337 | } |
| 338 | |
| 339 | void mapmodelregister_(char **args, int numargs) // read model attributes without loading the model |
| 340 | { |
no test coverage detected