MCPcopy Create free account
hub / github.com/assaultcube/AC / lookuptexture

Function lookuptexture

source/src/texture.cpp:509–529  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

507}
508
509Texture *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
531void cleanuptextures()
532{

Callers 3

lookupworldtextureFunction · 0.85
loopvFunction · 0.85
renderMethod · 0.85

Calls 3

pathFunction · 0.85
textureloadFunction · 0.85
inrangeMethod · 0.80

Tested by

no test coverage detected