DREAMWEB: Streamline text file handling

This commit is contained in:
Willem Jan Palenstijn 2011-12-27 18:34:23 +01:00
parent df7bb24184
commit 08be0411b1
10 changed files with 132 additions and 108 deletions

View file

@ -292,6 +292,23 @@ struct MapFlag {
uint8 _type;
};
struct TextFile {
TextFile() : _text(0) { }
uint16 _offsetsLE[66];
char *_text;
const char *getString(unsigned int i) const {
assert(i < 66);
return _text + READ_LE_UINT16(&_offsetsLE[i]);
}
void clear() {
delete[] _text;
_text = 0;
}
};
} // End of namespace DreamWeb
#endif