本文整理汇总了C++中common::Stream::Read方法的典型用法代码示例。如果您正苦于以下问题:C++ Stream::Read方法的具体用法?C++ Stream::Read怎么用?C++ Stream::Read使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类common::Stream
的用法示例。
在下文中一共展示了Stream::Read方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: load_room
//.........这里部分代码省略.........
delete[] rstruc->objectScripts;
rstruc->objectScripts = NULL;
}
if (rstruc->regionScripts != NULL)
{
for (i = 0; i < rstruc->numRegions; i++)
{
delete rstruc->regionScripts[i];
}
delete[] rstruc->regionScripts;
rstruc->regionScripts = NULL;
}
if (rstruc->localvars != NULL)
free (rstruc->localvars);
rstruc->localvars = NULL;
rstruc->numLocalVars = 0;
memset(&rstruc->ebpalShared[0], 0, MAX_BSCENE);
update_polled_stuff_if_runtime();
opty = Common::AssetManager::OpenAsset(files);
if (opty == NULL) {
char errbuffr[500];
sprintf(errbuffr,"Load_room: Unable to load the room file '%s'\n"
"Make sure that you saved the room to the correct folder (it should be\n"
"in your game's sub-folder of the AGS directory).\n"
"Also check that the player character's starting room is set correctly.\n",files);
quit(errbuffr);
}
update_polled_stuff_if_runtime(); // it can take a while to load the file sometimes
rfh.ReadFromFile(opty);
//fclose(opty);
rstruc->wasversion = rfh.version;
if (load_room_is_version_bad(rstruc))
{
delete opty;
quit("Load_Room: Bad packed file. Either the file requires a newer or older version of\n"
"this program or the file is corrupt.\n");
}
int thisblock = 0;
int bloklen;
while (thisblock != BLOCKTYPE_EOF) {
update_polled_stuff_if_runtime();
thisblock = opty->ReadByte();
if (thisblock == BLOCKTYPE_EOF)
break;
bloklen = opty->ReadInt32();
bloklen += opty->GetPosition(); // make it the new position for after block read
if (thisblock == BLOCKTYPE_MAIN)
load_main_block(rstruc, files, opty, rfh);
else if (thisblock == BLOCKTYPE_SCRIPT) {
int lee;
int hh;
lee = opty->ReadInt32();
rstruc->scripts = (char *)malloc(lee + 5);
// MACPORT FIX: swap