diff options
-rw-r--r-- | engines/hdb/gfx.cpp | 32 | ||||
-rw-r--r-- | engines/hdb/gfx.h | 4 |
2 files changed, 36 insertions, 0 deletions
diff --git a/engines/hdb/gfx.cpp b/engines/hdb/gfx.cpp index 57d0cc7ad4..ba656c81eb 100644 --- a/engines/hdb/gfx.cpp +++ b/engines/hdb/gfx.cpp @@ -237,6 +237,38 @@ Tile *Gfx::loadTile(const char *tileName) { return tile; } +void Gfx::savePic(Picture *pic, Common::OutSaveFile *out) { + if (pic == NULL) { + for (int i = 0; i < 64; i++) + out->writeByte(0); + } else { + out->write(pic->getName(), 64); + } +} + +void Gfx::saveTile(Tile *tile, Common::OutSaveFile *out) { + if (tile == NULL) { + for (int i = 0; i < 64; i++) + out->writeByte(0); + } else { + out->write(tile->getName(), 64); + } +} + +void Gfx::loadPicSave(Picture *pic, Common::InSaveFile *in) { + delete pic; + char readName[64]; + in->read(readName, 64); + pic = loadPic(readName); +} + +void Gfx::loadTileSave(Tile *tile, Common::InSaveFile *in) { + delete tile; + char readName[64]; + in->read(readName, 64); + tile = loadTile(readName); +} + Tile *Gfx::getTile(int index) { if (index < 0 || index > _numTiles) { diff --git a/engines/hdb/gfx.h b/engines/hdb/gfx.h index 88fb25063b..6439fbff6a 100644 --- a/engines/hdb/gfx.h +++ b/engines/hdb/gfx.h @@ -114,6 +114,10 @@ public: Picture *loadPic(const char *picName); Tile *loadTile(const char *tileName); + void savePic(Picture *pic, Common::OutSaveFile *out); + void saveTile(Tile *tile, Common::OutSaveFile *out); + void loadPicSave(Picture *pic, Common::InSaveFile *in); + void loadTileSave(Tile *tile, Common::InSaveFile *in); Tile *getTile(int index); void cacheTileSequence(int index, int count); |