Default directories are now shown in the directory configuration dialog.
This commit is contained in:
parent
bca418ff84
commit
2a4e33a08c
|
@ -95,6 +95,12 @@ int eoptions = EO_BGRUN | EO_FORCEISCALE;
|
||||||
|
|
||||||
int soundoptions = SO_SECONDARY | SO_GFOCUS;
|
int soundoptions = SO_SECONDARY | SO_GFOCUS;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Contains the names of the overridden standard directories
|
||||||
|
* in the order cheats, misc, nonvol, states, snaps, ..., base
|
||||||
|
**/
|
||||||
|
char *directory_names[6] = {0, 0, 0, 0, 0, 0};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handle of the main window.
|
* Handle of the main window.
|
||||||
**/
|
**/
|
||||||
|
@ -495,6 +501,35 @@ void do_exit()
|
||||||
FCEUI_Kill();
|
FCEUI_Kill();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Puts the default directory names into the elements of the directory_names array
|
||||||
|
* that aren't already defined.
|
||||||
|
**/
|
||||||
|
void initDirectories()
|
||||||
|
{
|
||||||
|
for (unsigned int i = 0; i < NUMBER_OF_DEFAULT_DIRECTORIES; i++)
|
||||||
|
{
|
||||||
|
if (directory_names[i] == 0)
|
||||||
|
{
|
||||||
|
sprintf(
|
||||||
|
TempArray,
|
||||||
|
"%s\\%s",
|
||||||
|
directory_names[NUMBER_OF_DEFAULT_DIRECTORIES] ? directory_names[NUMBER_OF_DEFAULT_DIRECTORIES] : BaseDirectory,
|
||||||
|
default_directory_names[i]
|
||||||
|
);
|
||||||
|
|
||||||
|
directory_names[i] = (char*)malloc(strlen(TempArray) + 1);
|
||||||
|
strcpy(directory_names[i], TempArray);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (directory_names[NUMBER_OF_DIRECTORIES - 1] == 0)
|
||||||
|
{
|
||||||
|
directory_names[NUMBER_OF_DIRECTORIES - 1] = (char*)malloc(strlen(BaseDirectory) + 1);
|
||||||
|
strcpy(directory_names[NUMBER_OF_DIRECTORIES - 1], BaseDirectory);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
int main(int argc,char *argv[])
|
int main(int argc,char *argv[])
|
||||||
{
|
{
|
||||||
char *t;
|
char *t;
|
||||||
|
@ -525,6 +560,8 @@ int main(int argc,char *argv[])
|
||||||
sprintf(TempArray,"%s\\fceu98.cfg",BaseDirectory);
|
sprintf(TempArray,"%s\\fceu98.cfg",BaseDirectory);
|
||||||
LoadConfig(TempArray);
|
LoadConfig(TempArray);
|
||||||
|
|
||||||
|
initDirectories();
|
||||||
|
|
||||||
// Parse the commandline arguments
|
// Parse the commandline arguments
|
||||||
t = ParseArgies(argc, argv);
|
t = ParseArgies(argc, argv);
|
||||||
|
|
||||||
|
|
|
@ -39,11 +39,7 @@ static int status_icon = 1;
|
||||||
static int vmod = 0;
|
static int vmod = 0;
|
||||||
static char *gfsdir=0;
|
static char *gfsdir=0;
|
||||||
|
|
||||||
/**
|
extern char* directory_names[6];
|
||||||
* Contains the names of the overridden standard directories
|
|
||||||
* in the order cheats, misc, nonvol, states, snaps, ..., base
|
|
||||||
**/
|
|
||||||
static char *directory_names[6] = {0, 0, 0, 0, 0, 0};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Contains the names of the default directories.
|
* Contains the names of the default directories.
|
||||||
|
|
Loading…
Reference in New Issue