diff options
author | Max Horn | 2009-02-27 01:17:24 +0000 |
---|---|---|
committer | Max Horn | 2009-02-27 01:17:24 +0000 |
commit | bf0860fc5e2013883292dc8efabde1e2f919d9d7 (patch) | |
tree | 09a39402d5270800ac3006932d756ba5d94ad8a1 /engines/sci/include | |
parent | 5a5c51bb489d9b88bc3477dfda5af533e37b19a7 (diff) | |
download | scummvm-rg350-bf0860fc5e2013883292dc8efabde1e2f919d9d7.tar.gz scummvm-rg350-bf0860fc5e2013883292dc8efabde1e2f919d9d7.tar.bz2 scummvm-rg350-bf0860fc5e2013883292dc8efabde1e2f919d9d7.zip |
SCI: Commited file handling revamp, work in progress
svn-id: r38919
Diffstat (limited to 'engines/sci/include')
-rw-r--r-- | engines/sci/include/engine.h | 34 |
1 files changed, 25 insertions, 9 deletions
diff --git a/engines/sci/include/engine.h b/engines/sci/include/engine.h index 085b50b2e4..8035b16025 100644 --- a/engines/sci/include/engine.h +++ b/engines/sci/include/engine.h @@ -48,7 +48,22 @@ namespace Sci { struct menubar_t; struct kfunct_sig_pair_t; // from kernel.h -class DirSeeker; +class DirSeeker { +protected: + EngineState *_vm; + reg_t _outbuffer; + Common::StringList _savefiles; + Common::StringList::const_iterator _iter; + +public: + DirSeeker(EngineState *s) : _vm(s) { + _outbuffer = NULL_REG; + _iter = _savefiles.begin(); + } + + void firstFile(const char *mask, reg_t buffer); + void nextFile(); +}; #define FREESCI_CURRENT_SAVEGAME_VERSION 8 #define FREESCI_MINIMUM_SAVEGAME_VERSION 8 @@ -81,15 +96,16 @@ struct SavegameMetadata { class FileHandle { public: - FILE *_file; + Common::String _name; + Common::SeekableReadStream *_in; + Common::WriteStream *_out; - FileHandle() : _file(0) { - } +public: + FileHandle(); + ~FileHandle(); - ~FileHandle() { - if (_file) - fclose(_file); - } + void close(); + bool isOpen() const; }; struct EngineState { @@ -187,7 +203,7 @@ struct EngineState { Common::Array<FileHandle> _fileHandles; /* Array of file handles. Dynamically increased if required. */ - DirSeeker *dirseeker; + DirSeeker _dirseeker; /* VM Information */ |