Fixed the old fs stuff here, to use the vfs thingie.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@1737 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
c5b3483145
commit
06b2836ecc
1 changed files with 7 additions and 5 deletions
|
@ -328,7 +328,7 @@ int QCEditor (progfuncs_t *prinst, char *filename, int line, int nump, char **pa
|
||||||
int i;
|
int i;
|
||||||
char buffer[8192];
|
char buffer[8192];
|
||||||
char *r;
|
char *r;
|
||||||
FILE *f;
|
vfsfile_t *f;
|
||||||
|
|
||||||
SV_EndRedirect();
|
SV_EndRedirect();
|
||||||
|
|
||||||
|
@ -336,13 +336,15 @@ int QCEditor (progfuncs_t *prinst, char *filename, int line, int nump, char **pa
|
||||||
return -1;
|
return -1;
|
||||||
SV_EndRedirect();
|
SV_EndRedirect();
|
||||||
if (developer.value)
|
if (developer.value)
|
||||||
COM_FOpenFile(filename, &f);
|
{
|
||||||
|
f = FS_OpenVFS(filename, "rb", FS_GAME);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
f = NULL; //faster.
|
f = NULL; //faster.
|
||||||
if (!f)
|
if (!f)
|
||||||
{
|
{
|
||||||
Q_snprintfz(buffer, sizeof(buffer), "src/%s", filename);
|
Q_snprintfz(buffer, sizeof(buffer), "src/%s", filename);
|
||||||
COM_FOpenFile(buffer, &f);
|
f = FS_OpenVFS(buffer, "rb", FS_GAME);
|
||||||
}
|
}
|
||||||
if (!f)
|
if (!f)
|
||||||
Con_Printf("-%s - %i\n", filename, line);
|
Con_Printf("-%s - %i\n", filename, line);
|
||||||
|
@ -350,12 +352,12 @@ int QCEditor (progfuncs_t *prinst, char *filename, int line, int nump, char **pa
|
||||||
{
|
{
|
||||||
for (i = 0; i < line; i++)
|
for (i = 0; i < line; i++)
|
||||||
{
|
{
|
||||||
fgets(buffer, sizeof(buffer), f);
|
VFS_GETS(buffer, sizeof(buffer), f);
|
||||||
}
|
}
|
||||||
if ((r = strchr(buffer, '\r')))
|
if ((r = strchr(buffer, '\r')))
|
||||||
{ r[0] = '\n';r[1]='\0';}
|
{ r[0] = '\n';r[1]='\0';}
|
||||||
Con_Printf("-%s", buffer);
|
Con_Printf("-%s", buffer);
|
||||||
fclose(f);
|
VFS_CLOSE(f);
|
||||||
}
|
}
|
||||||
//PF_break(NULL);
|
//PF_break(NULL);
|
||||||
return line;
|
return line;
|
||||||
|
|
Loading…
Reference in a new issue