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

Function gettextureorigin

source/src/texture.cpp:1104–1118  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1102COMMAND(edittextureslot, "iss");
1103
1104void gettextureorigin(char *fname)
1105{
1106 if(!*fname) return;
1107 defformatstring(s)("packages/textures/%s", fname);
1108 findfile(path(s), "r");
1109 const char *res = s;
1110 switch(findfilelocation)
1111 {
1112 case FFL_ZIP: res = "zip"; break;
1113 case FFL_WORKDIR: res = fileexists(s, "r") ? "official" : "<file not found>"; break;
1114 case FFL_HOME: res = "custom"; break;
1115 default: formatstring(s)("package dir #%d", findfilelocation); break;
1116 }
1117 result(res);
1118}
1119COMMAND(gettextureorigin, "s");
1120
1121void textureslotbyname(char *name) // returns the slot(s) that a certain texture file is configured in

Callers

nothing calls this directly

Calls 4

findfileFunction · 0.85
pathFunction · 0.85
fileexistsFunction · 0.85
resultFunction · 0.85

Tested by

no test coverage detected