本文整理汇总了C++中Files::createReadStream方法的典型用法代码示例。如果您正苦于以下问题:C++ Files::createReadStream方法的具体用法?C++ Files::createReadStream怎么用?C++ Files::createReadStream使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Files
的用法示例。
在下文中一共展示了Files::createReadStream方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: stream
void HiRes1Engine::initGameState() {
_state.vars.resize(IDI_HR1_NUM_VARS);
StreamPtr stream(_files->createReadStream(IDS_HR1_EXE_1));
// Load room data from executable
_roomDesc.clear();
stream->seek(IDI_HR1_OFS_ROOMS);
for (uint i = 0; i < IDI_HR1_NUM_ROOMS; ++i) {
Room room;
stream->readByte();
_roomDesc.push_back(stream->readByte());
for (uint j = 0; j < 6; ++j)
room.connections[j] = stream->readByte();
room.picture = stream->readByte();
room.curPicture = stream->readByte();
_state.rooms.push_back(room);
}
// Load item data from executable
stream->seek(IDI_HR1_OFS_ITEMS);
byte id;
while ((id = stream->readByte()) != 0xff) {
Item item = Item();
item.id = id;
item.noun = stream->readByte();
item.room = stream->readByte();
item.picture = stream->readByte();
item.isLineArt = stream->readByte();
item.position.x = stream->readByte();
item.position.y = stream->readByte();
item.state = stream->readByte();
item.description = stream->readByte();
stream->readByte();
byte size = stream->readByte();
for (uint i = 0; i < size; ++i)
item.roomPictures.push_back(stream->readByte());
_state.items.push_back(item);
}
}