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

Function textureslotusage

source/src/texture.cpp:1014–1025  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1012}
1013
1014void textureslotusage(int *n) // returns all mapmodel entity indices that use a certain texture to skin the model
1015 // if the texture is used in map geometry, at least a space is returned
1016 // if the texture is unused, an empty string is returned
1017{
1018 string res = "";
1019 loopv(ents) if(ents[i].type == MAPMODEL && ents[i].attr4 == *n) concatformatstring(res, "%s%d", i ? " " : "", i);
1020 if(!*res)
1021 { // not used to skin a mapmodel: check world usage...
1022 if(testworldtexusage(*n)) copystring(res, " ");
1023 }
1024 result(res);
1025}
1026COMMAND(textureslotusage, "i");
1027
1028void deletetextureslot(int *n, char *opt, char *_replace) // delete texture slot - only if unused or "purge" is specified

Callers

nothing calls this directly

Calls 5

concatformatstringFunction · 0.85
testworldtexusageFunction · 0.85
copystringFunction · 0.85
resultFunction · 0.85
loopvFunction · 0.70

Tested by

no test coverage detected