20 #include "common/files.h"
33 char scratch[MAX_OSPATH];
36 Q_strlcat(scratch,
"_i.pcx",
sizeof(scratch));
38 for (i = 0; i < npcxfiles; i++) {
39 if (strcmp(pcxfiles[i], scratch) == 0)
46 static int pmicmpfnc(
const void *_a,
const void *_b)
56 else if (strcmp(b->
directory,
"male") == 0)
61 else if (strcmp(b->
directory,
"female") == 0)
69 char scratch[MAX_QPATH];
82 if (!(list = (
char **)
FS_ListFiles(NULL,
"players/*/tris.md2", FS_SEARCH_BYFILTER | FS_SEARCH_SAVEPATH, &numFiles))) {
86 for (i = 0; i < numFiles; i++) {
87 len =
Q_strlcpy(scratch, list[i],
sizeof(scratch));
88 if (len >=
sizeof(scratch))
92 if (!(s = strchr(scratch,
'/')))
96 if (!(p = strchr(s,
'/')))
100 for (j = 0; j < ndirs; j++) {
101 if (!strcmp(dirnames[j], s)) {
123 for (i = 0; i < ndirs; i++) {
131 Q_concat(scratch,
sizeof(scratch),
"players/", dirnames[i],
"/tris.md2", NULL);
132 if (!FS_FileExists(scratch)) {
137 Q_concat(scratch,
sizeof(scratch),
"players/", dirnames[i], NULL);
138 pcxnames = (
char **)
FS_ListFiles(scratch,
".pcx", 0, &npcxfiles);
144 for (k = 0; k < npcxfiles; k++) {
145 if (!strstr(pcxnames[k],
"_i.pcx")) {
157 skinnames =
UI_Malloc(
sizeof(
char *) * (nskins + 1));
158 skinnames[nskins] = NULL;
161 for (s = 0, k = 0; k < npcxfiles; k++) {
162 if (!strstr(pcxnames[k],
"_i.pcx")) {
193 for (j = 0; j < pmi->
nskins; j++) {
199 memset(pmi, 0,
sizeof(*pmi));