MCPcopy Index your code
hub / github.com/assaultcube/AC / textureload

Function textureload

source/src/texture.cpp:405–427  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

403// additional frames can be used for various shaders
404
405Texture *textureload(const char *name, int clamp, bool mipmap, bool canreduce, float scale, bool trydl)
406{
407 defformatstring(pname)("%.7g ", scale);
408 copystring(pname + TEXSCALEPREFIXSIZE, name, MAXSTRLEN - TEXSCALEPREFIXSIZE);
409 path(pname + TEXSCALEPREFIXSIZE);
410 Texture *t = textures.access(pname);
411 if(t) return t;
412 int xs, ys, bpp;
413 GLuint id = loadsurface(pname + TEXSCALEPREFIXSIZE, xs, ys, bpp, clamp, mipmap, canreduce, scale, trydl);
414 if(!id) return notexture;
415 char *key = newstring(pname);
416 t = &textures[key];
417 t->name = key + TEXSCALEPREFIXSIZE;
418 t->xs = xs;
419 t->ys = ys;
420 t->bpp = bpp;
421 t->clamp = clamp;
422 t->mipmap = mipmap;
423 t->canreduce = canreduce;
424 t->id = id;
425 t->scale = scale;
426 return t;
427}
428
429struct Slot
430{

Callers 15

lookuptextureFunction · 0.85
loadskymapFunction · 0.85
loadnotextureFunction · 0.85
guidetoggleFunction · 0.85
renderaboveheadiconFunction · 0.85
renderclientpFunction · 0.85
mitemimagemanualMethod · 0.85
renderMethod · 0.85
rendermenumdlFunction · 0.85
rendermenutexturepreviewFunction · 0.85
renderbgMethod · 0.85
drawequipiconFunction · 0.85

Calls 5

copystringFunction · 0.85
pathFunction · 0.85
loadsurfaceFunction · 0.85
newstringFunction · 0.85
accessMethod · 0.80

Tested by

no test coverage detected