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

Function _texture

source/src/texture.cpp:441–470  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

439COMMANDF(texturereset, "", () { if(execcontext==IEXC_MAPCFG) slots.setsize(0); });
440
441void _texture(Slot &s, float *scale, char *name)
442{
443 if(name)
444 {
445 filtertext(s.name, parentdir(name), FTXT__MEDIAFILEPATH); // filter parts separately, because filename may (legally) contain "<decal>"
446 if(s.name[0] == '.' && s.name[1] == '/') memmove(s.name, s.name + 2, sizeof(s.name) - 2);
447 if(*s.name) concatstring(s.name, "/");
448 name = (char *)behindpath(name);
449 if(*name == '<')
450 {
451 char *endcmd = strchr(name, '>');
452 if(endcmd)
453 {
454 *endcmd = '\0';
455 concatstring(s.name, name);
456 concatstring(s.name, ">");
457 name = endcmd + 1;
458 }
459 }
460 filtertext(name, name, FTXT__MEDIAFILENAME);
461 concatstring(s.name, name);
462 }
463 s.tex = NULL;
464 s.loaded = false;
465 if(scale)
466 {
467 s.orgscale = *scale;
468 s.scale = (*scale > 0 && *scale <= 4.0f) ? *scale : 1.0f;
469 }
470}
471
472void checktexturefilename(const char *name)
473{

Callers 4

texture.cppFile · 0.85
edittextureslotFunction · 0.85
texconfig_pasteFunction · 0.85
loopvFunction · 0.85

Calls 4

filtertextFunction · 0.85
parentdirFunction · 0.85
concatstringFunction · 0.85
behindpathFunction · 0.85

Tested by

no test coverage detected