TilesetPtr TilesetType_HarryCHR::create(stream::inout_sptr psTileset, SuppData& suppData) const { psTileset->truncate(CHR_WIDTH * CHR_HEIGHT * 256); psTileset->seekp(0, stream::start); char empty[CHR_WIDTH * CHR_HEIGHT]; memset(empty, 0x00, CHR_WIDTH * CHR_HEIGHT); for (int i = 0; i < 256; i++) psTileset->write(empty, CHR_WIDTH * CHR_HEIGHT); PaletteTablePtr pal; if (suppData.find(SuppItem::Palette) != suppData.end()) { ImagePtr palFile(new Palette_VGA(suppData[SuppItem::Palette], 6)); pal = palFile->getPalette(); } else { throw stream::error("no palette specified (missing supplementary item)"); } return TilesetPtr(new Tileset_HarryCHR(psTileset, pal)); }
ArchivePtr ArchiveType_DAT_Sango::newArchive(stream::inout_sptr psArchive, SuppData& suppData) const { psArchive->seekp(0, stream::start); psArchive->write("\x04\0\0\0", 4); return ArchivePtr(new Archive_DAT_Sango(psArchive)); }