completing multiplatform archive/fopen cleanup

This commit is contained in:
zeromus 2008-08-13 07:52:32 +00:00
parent 9a32bff677
commit 709f1a2b4c
2 changed files with 4 additions and 19 deletions

View File

@ -561,3 +561,7 @@ bool FCEUD_PauseAfterPlayback() { return false; }
void FCEUD_TurboOn (void) { NoWaiting|= 1; } void FCEUD_TurboOn (void) { NoWaiting|= 1; }
void FCEUD_TurboOff (void) { NoWaiting&=~1; } void FCEUD_TurboOff (void) { NoWaiting&=~1; }
void FCEUD_TurboToggle(void) { NoWaiting^= 1; } void FCEUD_TurboToggle(void) { NoWaiting^= 1; }
FCEUFILE* FCEUD_OpenArchiveIndex(ArchiveScanRecord& asr, std::string &fname, int innerIndex) { return 0; }
FCEUFILE* FCEUD_OpenArchive(ArchiveScanRecord& asr, std::string& fname, std::string* innerFilename) { return 0; }
ArchiveScanRecord FCEUD_ScanArchive(std::string fname) { return ArchiveScanRecord(); }

View File

@ -202,7 +202,6 @@ 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);
@ -248,24 +247,6 @@ FCEUFILE * FCEU_fopen(const char *path, const char *ipsfn, char *mode, char *ext
ApplyIPS(ipsfile,fceufp); ApplyIPS(ipsfile,fceufp);
return fceufp; return fceufp;
} }
#else
std::fstream* fp = FCEUD_UTF8_fstream(fileToOpen,mode);
if(!fp)
{
return 0;
}
fceufp = new FCEUFILE();
fceufp->filename = fileToOpen;
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;
} }