Modified the getRomFile Qt GUI function for ROMs opened from zip archives. The returned path will be the directory to the zip file and the base and suffix file parts come from the inner deflated zip file name.
This commit is contained in:
parent
c09b1f6c7a
commit
78d78ceab9
|
@ -38,6 +38,8 @@ int getDirFromFile( const char *path, char *dir )
|
|||
//---------------------------------------------------------------------------
|
||||
const char *getRomFile( void )
|
||||
{
|
||||
static char filePath[2048];
|
||||
|
||||
if ( GameInfo )
|
||||
{
|
||||
//printf("filename: '%s' \n", GameInfo->filename );
|
||||
|
@ -45,7 +47,25 @@ const char *getRomFile( void )
|
|||
|
||||
if ( GameInfo->archiveFilename != NULL )
|
||||
{
|
||||
return GameInfo->archiveFilename;
|
||||
char dir[1024], base[512], suffix[64];
|
||||
|
||||
parseFilepath( GameInfo->archiveFilename, dir, base, suffix );
|
||||
|
||||
filePath[0] = 0;
|
||||
|
||||
if ( dir[0] != 0 )
|
||||
{
|
||||
strcat( filePath, dir );
|
||||
}
|
||||
|
||||
parseFilepath( GameInfo->filename, dir, base, suffix );
|
||||
|
||||
strcat( filePath, base );
|
||||
strcat( filePath, suffix );
|
||||
|
||||
//printf("ArchivePath: '%s' \n", filePath );
|
||||
|
||||
return filePath;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue