Skip to content

Commit

Permalink
Revert "Abstract over data dir"
Browse files Browse the repository at this point in the history
  • Loading branch information
addictgamer authored May 17, 2017
1 parent ca29d4b commit 5cb8063
Show file tree
Hide file tree
Showing 12 changed files with 238 additions and 289 deletions.
10 changes: 5 additions & 5 deletions src/buttons.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ void buttonOpen(button_t* my)
button->focused = 1;

// file list
if ( (dir = openDataDir("maps/")) != NULL )
if ( (dir = opendir("maps/")) != NULL )
{
while ( (ent = readdir(dir)) != NULL )
{
Expand All @@ -340,7 +340,7 @@ void buttonOpen(button_t* my)
d_names[c] = (char*) malloc(sizeof(char) * FILENAME_MAX);
}
c = 0;
if ( (dir = openDataDir("maps/")) != NULL )
if ( (dir = opendir("maps/")) != NULL )
{
while ( (ent = readdir(dir)) != NULL )
{
Expand Down Expand Up @@ -484,7 +484,7 @@ void buttonSaveAs(button_t* my)
button->focused = 1;

// file list
if ( (dir = openDataDir("maps/")) != NULL )
if ( (dir = opendir("maps/")) != NULL )
{
while ( (ent = readdir(dir)) != NULL )
{
Expand All @@ -511,7 +511,7 @@ void buttonSaveAs(button_t* my)
d_names[c] = (char*) malloc(sizeof(char) * FILENAME_MAX);
}
c = 0;
if ( (dir = openDataDir("maps/")) != NULL )
if ( (dir = opendir("maps/")) != NULL )
{
while ( (ent = readdir(dir)) != NULL )
{
Expand Down Expand Up @@ -965,4 +965,4 @@ void buttonCloseSubwindow(button_t* my)
d_names = NULL;
}
strcpy(filename, oldfilename);
}
}
6 changes: 0 additions & 6 deletions src/editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -703,7 +703,6 @@ void redo()
void processCommandLine(int argc, char** argv)
{
int c = 0;
strcpy(datadir, "./");
if ( argc > 1 )
{
for ( c = 1; c < argc; c++ )
Expand All @@ -715,14 +714,9 @@ void processCommandLine(int argc, char** argv)
strcpy(maptoload, argv[c] + 5);
loadingmap = true;
}
else if (!strncmp(argv[c], "-datadir=", 9))
{
strcpy(datadir, argv[c] + 9);
}
}
}
}
printlog("Data path is %s", datadir);
}

/*-------------------------------------------------------------------------------
Expand Down
Loading

0 comments on commit 5cb8063

Please sign in to comment.