00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef IOHANDLER_H
00023 #define IOHANDLER_H
00024
00025 #include <iostream>
00026
00027 #include "case.h"
00028 #include "sprite.h"
00029 #include "texture.h"
00030 #include "theme.h"
00031
00033 namespace IO {
00034
00036 struct _PWTHeader {
00037 int ident;
00038 int version;
00039
00040
00041 int overviewOffset;
00042 int overridesOffset;
00043 int charOffset;
00044 int imgOffset;
00045 int bgOffset;
00046 int evidenceOffset;
00047 int locationOffset;
00048 int audioOffset;
00049 int testimonyOffset;
00050 int blockOffset;
00051 };
00052 typedef struct _PWTHeader PWTHeader;
00053
00055 const int FILE_MAGIC_NUM=(('T' << 16) + ('W' << 8) + 'P');
00056
00058 const int FILE_VERSION=10;
00059
00061 const ustring SPR_MAGIC_NUM="SPR";
00062
00064 const int SPR_VERSION=10;
00065
00070 bool unpackResourceFile(const ustring &path);
00071
00077 bool loadCaseFromFile(const ustring &path, Case::Case &pcase);
00078
00084 bool loadSpriteFromFile(const ustring &path, Sprite &sprite);
00085
00091 bool loadStockFile(const ustring &path, Case::Case *pcase);
00092
00098 bool loadThemeXML(const ustring &path, Theme::ColorMap &map);
00099
00104 Textures::Texture readImage(FILE *f);
00105
00110 ustring readString(FILE *f);
00111
00112 };
00113
00114 #endif