| 507 | } |
| 508 | |
| 509 | Texture *lookuptexture(int tex, Texture *failtex, bool trydl) |
| 510 | { |
| 511 | Texture *t = failtex; |
| 512 | if(slots.inrange(tex)) |
| 513 | { |
| 514 | Slot &s = slots[tex]; |
| 515 | if(!s.loaded) |
| 516 | { |
| 517 | defformatstring(pname)("packages/textures/%s", path(s.name, true)); |
| 518 | s.tex = textureload(pname, 0, true, true, s.scale, trydl); |
| 519 | if(s.tex != notexture) s.loaded = true; |
| 520 | if(!trydl) |
| 521 | { |
| 522 | if(s.tex==notexture) s.tex = failtex; |
| 523 | s.loaded = true; |
| 524 | } |
| 525 | } |
| 526 | if(s.tex) t = s.tex; |
| 527 | } |
| 528 | return t; |
| 529 | } |
| 530 | |
| 531 | void cleanuptextures() |
| 532 | { |
no test coverage detected