aboutsummaryrefslogtreecommitdiff
path: root/engines/gob/dataio.h
diff options
context:
space:
mode:
authorSven Hesse2007-03-20 14:51:57 +0000
committerSven Hesse2007-03-20 14:51:57 +0000
commit2dc7cb2cd49c20a5f6bcfe5446fb8340f6a555c8 (patch)
tree4b442eb88ed1bcc6b4a664890c0b8d8d10b5a912 /engines/gob/dataio.h
parentd94979c936c4edca5eaa23532b4814b2bf4cb933 (diff)
downloadscummvm-rg350-2dc7cb2cd49c20a5f6bcfe5446fb8340f6a555c8.tar.gz
scummvm-rg350-2dc7cb2cd49c20a5f6bcfe5446fb8340f6a555c8.tar.bz2
scummvm-rg350-2dc7cb2cd49c20a5f6bcfe5446fb8340f6a555c8.zip
Major clean-up, including:
- Cutting down the code-dup - Plucking leaks - Removing dead/unused code - Properly naming "word_2342F"-style variables and functions (removing the warnings alongside) - Fleshing out the "stubby" functions - Moving functions and variables to more appropriate/logical places - Re-ordering functions and variables - Re-structuring functions - Moving the IMD stuff into a new "Imd" class in the new imd.cpp/.h (still to be completely implemented and cleaned up) - Formatting - Getting rid off the classes "Anim", "Pack" and "Timer", along with their files svn-id: r26252
Diffstat (limited to 'engines/gob/dataio.h')
-rw-r--r--engines/gob/dataio.h46
1 files changed, 31 insertions, 15 deletions
diff --git a/engines/gob/dataio.h b/engines/gob/dataio.h
index cf6b5347a3..2fb90f15d5 100644
--- a/engines/gob/dataio.h
+++ b/engines/gob/dataio.h
@@ -20,11 +20,11 @@
* $Id$
*
*/
+
#ifndef GOB_DATAIO_H
#define GOB_DATAIO_H
#include "common/file.h"
-#include "gob/gob.h"
namespace Gob {
@@ -41,31 +41,47 @@ public:
ChunkDesc() : size(0), offset(0), packed(0) { chunkName[0] = 0; }
};
- int16 file_open(const char *path, Common::File::AccessMode mode = Common::File::kFileReadMode);
- Common::File *file_getHandle(int16 handle);
- int16 getChunk(const char *chunkName);
- char freeChunk(int16 handle);
- int32 readChunk(int16 handle, char *buf, int16 size);
- int16 seekChunk(int16 handle, int32 pos, int16 from);
- int32 getChunkSize(const char *chunkName);
- void openDataFile(const char *src);
- void closeDataFile(void);
+ int32 unpackData(char *source, char *dest);
+
+ void openDataFile(const char *src, bool itk = 0);
+ void closeDataFile(bool itk = 0);
char *getUnpackedData(const char *name);
void closeData(int16 handle);
- int16 openData(const char *path, Common::File::AccessMode mode = Common::File::kFileReadMode);
- int32 readData(int16 handle, char *buf, int16 size);
+ int16 openData(const char *path,
+ Common::File::AccessMode mode = Common::File::kFileReadMode);
+ int32 readData(int16 handle, char *buf, uint16 size);
+ int32 writeData(int16 handle, char *buf, uint16 size);
void seekData(int16 handle, int32 pos, int16 from);
int32 getPos(int16 handle);
int32 getDataSize(const char *name);
char *getData(const char *path);
- char *getSmallData(const char *path);
DataIO(class GobEngine *vm);
protected:
+ struct ChunkDesc *_dataFiles[MAX_DATA_FILES];
+ int16 _numDataChunks[MAX_DATA_FILES];
+ int16 _dataFileHandles[MAX_DATA_FILES];
+ bool _dataFileItk[MAX_DATA_FILES];
+ int32 _chunkPos[MAX_SLOT_COUNT * MAX_DATA_FILES];
+ int32 _chunkOffset[MAX_SLOT_COUNT * MAX_DATA_FILES];
+ int32 _chunkSize[MAX_SLOT_COUNT * MAX_DATA_FILES];
+ bool _isCurrentSlot[MAX_SLOT_COUNT * MAX_DATA_FILES];
+ int32 _packedSize;
+
class GobEngine *_vm;
+
+ int16 file_open(const char *path,
+ Common::File::AccessMode mode = Common::File::kFileReadMode);
+ Common::File *file_getHandle(int16 handle);
+
+ int16 getChunk(const char *chunkName);
+ char freeChunk(int16 handle);
+ int32 readChunk(int16 handle, char *buf, uint16 size);
+ int16 seekChunk(int16 handle, int32 pos, int16 from);
+ int32 getChunkSize(const char *chunkName);
};
-} // End of namespace Gob
+} // End of namespace Gob
-#endif
+#endif // GOB_DATAIO_H