Skip to content

Commit

Permalink
Remove obsolete and unused OLD_BOGUS_PATH_CODE conditional code, remo…
Browse files Browse the repository at this point in the history
…ve path parameter from SetQdirFromPath

#138
  • Loading branch information
SamVanheer committed Mar 16, 2022
1 parent 22bbd60 commit 0caf96a
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 71 deletions.
65 changes: 1 addition & 64 deletions utils/common/cmdlib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,8 @@ char qproject[ 1024 ]={'\0'};
char qdir[1024]={'\0'};
char gamedir[1024]={'\0'};

void SetQdirFromPath(const char* path)
void SetQdirFromPath()
{
#ifndef OLD_BOGUS_PATH_CODE

if ( qproject[0]=='\0' )
{
if ( getenv("QPROJECT") )
Expand All @@ -131,67 +129,6 @@ void SetQdirFromPath(const char* path)
strcat( qdir, qproject );
strcpy( gamedir, qdir );
strcat( gamedir, "\\valve\\" );

#else
char temp[1024];
const char* c;

if (!(path[0] == '/' || path[0] == '\\' || path[1] == ':'))
{ // path is partial
Q_getwd (temp);
strcat (temp, path);
path = temp;
}

// search for "quake" or quiver in path
if( !qproject[0] ) {
char *pszProj;

pszProj = getenv("QPROJECT");

if (pszProj != NULL)
strcpy(qproject, pszProj);
else
strcpy(qproject, "quiver");
}

try_again:

for (c=path ; *c ; c++)
{
int iSize = 0;

if (!Q_strncasecmp( c, qproject, strlen( qproject ) ) )
iSize = strlen( qproject ) + 1;

if (iSize > 0)
{
strncpy (qdir, path, c + iSize - path);
printf ("qdir: %s\n", qdir);
c += iSize;
while (*c)
{
if (*c == '/' || *c == '\\')
{
strncpy (gamedir, path, c+1-path);
printf ("gamedir: %s\n", gamedir);
return;
}
c++;
}
Error ("No gamedir in %s", path);
return;
}
}

if (!strcmp(qproject, "quiver"))
{
strcpy(qproject, "prospero");
goto try_again;
}

Error ("SetQdirFromPath: no '%s' in %s", qproject, path);
#endif
}


Expand Down
2 changes: 1 addition & 1 deletion utils/common/cmdlib.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ void Q_mkdir(const char* path);

extern char qdir[1024];
extern char gamedir[1024];
void SetQdirFromPath(const char* path);
void SetQdirFromPath();
char* ExpandArg(char* path); // from cmd line
char* ExpandPath(char* path); // from scripts
char* ExpandPathAndArchive(char* path);
Expand Down
2 changes: 1 addition & 1 deletion utils/qbsp2/qbsp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -994,7 +994,7 @@ int main (int argc, char **argv)

ThreadSetDefault ();

SetQdirFromPath (argv[i]);
SetQdirFromPath ();
strcpy (bspfilename, ExpandArg(argv[i]));
StripExtension (bspfilename);

Expand Down
2 changes: 1 addition & 1 deletion utils/qcsg/qcsg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -798,7 +798,7 @@ int main (int argc, char **argv)
CheckHullFile( hullfile, qhullfile );

ThreadSetDefault ();
SetQdirFromPath (argv[i]);
SetQdirFromPath ();

strcpy (source, ExpandArg (argv[i]));
COM_FixSlashes(source);
Expand Down
2 changes: 1 addition & 1 deletion utils/qlumpy/qlumpy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ int main (int argc, char **argv)
strcat (szTemp, pszPath);
pszPath = szTemp;
}
SetQdirFromPath(pszPath);
SetQdirFromPath();
ProcessLumpyScript(pszPath);
}

Expand Down
2 changes: 1 addition & 1 deletion utils/qrad/qrad.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1501,7 +1501,7 @@ int main (int argc, char **argv)

strcpy (source, argv[i]);
StripExtension (source);
SetQdirFromPath (source);
SetQdirFromPath ();

// Set the required global lights filename
strcat( strcpy( global_lights, gamedir ), "lights.rad" );
Expand Down
2 changes: 1 addition & 1 deletion utils/sprgen/sprgen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -601,7 +601,7 @@ int main (int argc, char **argv)
break;
}

// SetQdirFromPath (argv[i]);
// SetQdirFromPath ();
ExtractFilePath (argv[i], spritedir); // chop the filename

//
Expand Down
2 changes: 1 addition & 1 deletion utils/studiomdl/studiomdl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3417,7 +3417,7 @@ int main (int argc, char **argv)
//
strcpy (path, argv[i]);
DefaultExtension (path, ".qc");
// SetQdirFromPath (path);
// SetQdirFromPath ();
LoadScriptFile (path);

//
Expand Down

0 comments on commit 0caf96a

Please sign in to comment.