本文整理汇总了C++中common::Stream::GetPosition方法的典型用法代码示例。如果您正苦于以下问题:C++ Stream::GetPosition方法的具体用法?C++ Stream::GetPosition怎么用?C++ Stream::GetPosition使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类common::Stream
的用法示例。
在下文中一共展示了Stream::GetPosition方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: load_room
//.........这里部分代码省略.........
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
opty->Read(rstruc->scripts, lee);
rstruc->scripts[lee] = 0;
for (hh = 0; hh < lee; hh++)
rstruc->scripts[hh] += passwencstring[hh % 11];
}
else if (thisblock == BLOCKTYPE_COMPSCRIPT3) {
rstruc->compiled_script = ccScript::CreateFromStream(opty);
rstruc->compiled_script_shared = false;
if (rstruc->compiled_script == NULL)
quit("Load_room: Script load failed; need newer version?");
}
else if ((thisblock == BLOCKTYPE_COMPSCRIPT) || (thisblock == BLOCKTYPE_COMPSCRIPT2))
#ifdef LOADROOM_ALLOWOLD
rstruc->compiled_script = NULL;
#else
quit("Load_room: old room format. Please upgrade the room.");
#endif
else if (thisblock == BLOCKTYPE_OBJECTNAMES) {
if (opty->ReadByte() != rstruc->numsprs)
quit("Load_room: inconsistent blocks for object names");