本文整理汇总了C++中Stream::EOS方法的典型用法代码示例。如果您正苦于以下问题:C++ Stream::EOS方法的具体用法?C++ Stream::EOS怎么用?C++ Stream::EOS使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Stream
的用法示例。
在下文中一共展示了Stream::EOS方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: File_ReadStringBack
const char* File_ReadStringBack(sc_File *fil) {
Stream *in = get_valid_file_stream_from_handle(fil->handle, "File.ReadStringBack");
if (in->EOS()) {
return CreateNewScriptString("");
}
int lle = in->ReadInt32();
if ((lle >= 20000) || (lle < 1))
quit("!File.ReadStringBack: file was not written by WriteString");
char *retVal = (char*)malloc(lle);
in->Read(retVal, lle);
return CreateNewScriptString(retVal, false);
}
示例2: File_ReadRawLine
void File_ReadRawLine(sc_File *fil, char* buffer) {
Stream *in = get_valid_file_stream_from_handle(fil->handle, "File.ReadRawLine");
check_strlen(buffer);
int i = 0;
while (i < MAXSTRLEN - 1) {
buffer[i] = in->ReadInt8();
if (buffer[i] == 13) {
// CR -- skip LF and abort
in->ReadInt8();
break;
}
if (buffer[i] == 10) // LF only -- abort
break;
if (in->EOS()) // EOF -- abort
break;
i++;
}
buffer[i] = 0;
}
示例3: wloadsprites
int wloadsprites(color * pall, char *filnam, Bitmap ** sarray, int strt, int eend)
{
int vers;
char buff[20];
int numspri = 0, vv, hh, wdd, htt;
Stream *in = Common::AssetManager::OpenAsset(filnam);
if (in == NULL)
return -1;
vers = in->ReadInt16();
in->ReadArray(&buff[0], 13, 1);
for (vv = 0; vv < 256; vv++) // there's a filler byte
in->ReadArray(&pall[vv], 3, 1);
if (vers > 4)
return -1;
if (vers == 4)
numspri = in->ReadInt16();
else {
numspri = in->ReadInt16();
if ((numspri < 2) || (numspri > 200))
numspri = 200;
}
for (vv = strt; vv <= eend; vv++)
sarray[vv] = NULL;
for (vv = 0; vv <= numspri; vv++) {
int coldep = in->ReadInt16();
if (coldep == 0) {
sarray[vv] = NULL;
if (in->EOS())
break;
continue;
}
if (in->EOS())
break;
if (vv > eend)
break;
wdd = in->ReadInt16();
htt = in->ReadInt16();
if (vv < strt) {
in->Seek(Common::kSeekCurrent, wdd * htt);
continue;
}
sarray[vv] = BitmapHelper::CreateBitmap(wdd, htt, coldep * 8);
if (sarray[vv] == NULL) {
delete in;
return -1;
}
for (hh = 0; hh < htt; hh++)
in->ReadArray(&sarray[vv]->GetScanLineForWriting(hh)[0], wdd * coldep, 1);
}
delete in;
return 0;
}