sdl now builds, but archives are currently broken.

This commit is contained in:
punkrockguy318 2008-07-13 05:03:17 +00:00
parent 595881979c
commit 6cffaa98ee
1 changed files with 17 additions and 1 deletions

View File

@ -250,7 +250,7 @@ FCEUFILE * FCEU_fopen(const char *path, const char *ipsfn, char *mode, char *ext
//try to setup the ips file //try to setup the ips file
if(ipsfn && read) if(ipsfn && read)
ipsfile=FCEUD_UTF8fopen(ipsfn,"rb"); ipsfile=FCEUD_UTF8fopen(ipsfn,"rb");
#ifdef WIN32
if(read) if(read)
{ {
ArchiveScanRecord asr = FCEUD_ScanArchive(fileToOpen); ArchiveScanRecord asr = FCEUD_ScanArchive(fileToOpen);
@ -281,6 +281,22 @@ FCEUFILE * FCEU_fopen(const char *path, const char *ipsfn, char *mode, char *ext
return fceufp; return fceufp;
} }
} }
#else
std::fstream* fp = FCEUD_UTF8_fstream(fileToOpen,mode);
if(!fp)
{
return 0;
}
fceufp = new FCEUFILE();
fceufp->filename = fileToOpen;
fceufp->archiveIndex = -1;
fceufp->stream = (std::iostream*)fp;
FCEU_fseek(fceufp,0,SEEK_END);
fceufp->size = FCEU_ftell(fceufp);
FCEU_fseek(fceufp,0,SEEK_SET);
return fceufp;
#endif
return 0; return 0;
} }