Subversion Repositories eduke32

Compare Revisions

Ignore whitespace Rev 5060 → Rev 5061

/polymer/eduke32/build/include/cache1d.h
39,6 → 39,8
int32_t ktell(int32_t handle);
void kclose(int32_t handle);
 
void krename(const char *filename, const char *newname);
 
typedef struct { intptr_t *hand; int32_t leng; char *lock ; } cactype;
 
enum {
/polymer/eduke32/build/src/cache1d.c
1039,6 → 1039,40
return -1;
}
 
void krename(const char *filename, const char *newname)
{
int32_t i, j, k;
char bad, *gfileptr;
 
for (k=numgroupfiles-1; k>=0; k--)
{
if (groupfil[k] >= 0)
{
for (i=gnumfiles[k]-1; i>=0; i--)
{
gfileptr = (char *)&gfilelist[k][i<<4];
 
bad = 0;
for (j=0; j<13; j++)
{
if (!filename[j]) break;
if (toupperlookup[filename[j]] != toupperlookup[gfileptr[j]])
{
bad = 1;
break;
}
}
if (bad) continue;
if (j<13 && gfileptr[j]) continue; // JBF: because e1l1.map might exist before e1l1
if (j==13 && filename[j]) continue; // JBF: long file name
 
Bstrncpy(gfileptr, newname, 12);
return;
}
}
}
}
 
int32_t kopen4load(const char *filename, char searchfirst)
{
int32_t newhandle = MAXOPENFILES-1;
/polymer/eduke32/build/src/defs.c
93,6 → 93,7
T_MAPINFO, T_MAPFILE, T_MAPTITLE, T_MAPMD4, T_MHKFILE,
T_ECHO,
T_GLOBALFLAGS,
T_RENAMEFILE,
};
 
static int32_t lastmodelid = -1, lastvoxid = -1, modelskin = -1, lastmodelskin = -1, seenframe = 0;
279,6 → 280,7
{ "mapinfo", T_MAPINFO },
{ "echo", T_ECHO },
{ "globalflags", T_GLOBALFLAGS },
{ "renamefile", T_RENAMEFILE },
};
 
while (1)
2218,6 → 2220,15
}
break;
 
case T_RENAMEFILE:
{
char *filename = NULL, *newname = NULL;
if (scriptfile_getstring(script,&filename)) break;
if (scriptfile_getstring(script,&newname)) break;
krename(filename, newname);
}
break;
 
default:
initprintf("Unknown token.\n"); break;
}