本文整理汇总了C++中CFileIO::ReadBinary方法的典型用法代码示例。如果您正苦于以下问题:C++ CFileIO::ReadBinary方法的具体用法?C++ CFileIO::ReadBinary怎么用?C++ CFileIO::ReadBinary使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CFileIO
的用法示例。
在下文中一共展示了CFileIO::ReadBinary方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: LoadDemo
bool LoadDemo(demoSystem& dem, int demo)
{
char name[256];
sprintf(name,"Data/Demo%i.dem",demo);
dem.mKeyBuffer.clear();
CFileIO fIO;
if(!fIO.GetFile(name,"rb"))
return false;
fIO.ReadBinary(&dem.iScrollOffset,1);
int bufsize,n;
fIO.ReadBinary(&bufsize,1);
if(bufsize>0)
{
for(n=0;n<bufsize;n++)
{
keyBuffer kb;
fIO.ReadBinary(&kb.tick,1);
fIO.ReadBinary(&kb.KeyStateChange,1);
fIO.ReadBinary(&kb.KeyStates,1);
dem.mKeyBuffer.push_back(kb);
}
}
return true;
}
示例2: LoadFromFile
void Generator::LoadFromFile(CFileIO &fIO)
{
fIO.ReadBinary(&iEntType,1);
fIO.ReadBinary(&ScrollOffset,1);
fIO.ReadBinary(&Pos.x,1);
fIO.ReadBinary(&Pos.y,1);
fIO.ReadBinary(&numEnts,1);
fIO.ReadBinary(&tickDelay,1);
if(!(mpEntity = gpEngine->CreateEntity(iEntType)))
return;
mpEntity->LoadFromFile(fIO);
}
示例3: ReadBufferFromFile
void ControlledEntity::ReadBufferFromFile(CFileIO &fIO)
{
int bufsize,n;
fIO.ReadBinary(&bufsize,1);
if(bufsize>0)
{
for(n=0;n<bufsize;n++)
{
keyBuffer kb;
fIO.ReadBinary(&kb.tick,1);
fIO.ReadBinary(&kb.KeyStateChange,1);
fIO.ReadBinary(&kb.KeyStates,1);
mKeyBuffer.push_back(kb);
}
}
}
示例4: LoadMapData
//================================================================================================//
bool Engine::LoadMapData()
{
char sz[256];
ClearMapArrays();
ClearMapEntities();
CFileIO fIO;
sprintf(sz,"Data/Maps/Stage%i.stg",iStage);
if(!fIO.GetFile(sz,"rb"))
return false;
int x,y;
//read block data
for(x=0;x<400;x++)
{
for(y=0;y<15;y++)
{
fIO.ReadBinary(&mTilesLayer1[x][y].ID,1);
fIO.ReadBinary(&mTilesLayer1[x][y].properties,1);
fIO.ReadBinary(&mTilesLayer2[x][y].ID,1);
fIO.ReadBinary(&mTilesLayer2[x][y].properties,1);
fIO.ReadBinary(&mTilesLayer3[x][y].ID,1);
fIO.ReadBinary(&mTilesLayer3[x][y].properties,1);
}
}
//read entities
int numEnt,n;
fIO.ReadBinary(&numEnt,1);
for(n=0;n<numEnt;n++)
{
Generator g;
g.LoadFromFile(fIO);
mGenerators.push_back(g);
}
fIO.ReadBinary(&numEnt,1);
for(n=0;n<numEnt;n++)
{
AnimGenerator g;
g.LoadFromFile(fIO);
mAnimGenerators.push_back(g);
}
return true;
}
示例5: LoadFromFile
void TriggerSpeedUp::LoadFromFile(CFileIO &fIO)
{
fIO.ReadBinary(&iMaxTicks,1);
}
示例6: LoadFromFile
void Serpent::LoadFromFile(CFileIO &fIO)
{
fIO.ReadBinary(&RateofFire,1);
fIO.ReadBinary(&bStartDirection,1);
ReadBufferFromFile(fIO);
}
示例7: LoadFromFile
void FireBug::LoadFromFile(CFileIO &fIO)
{
fIO.ReadBinary(&RateofFire,1);
fIO.ReadBinary(&bStartMovement,1);
}
示例8: LoadFromFile
void SuperTurret::LoadFromFile(CFileIO &fIO)
{
fIO.ReadBinary(&bDirection,1);
}
示例9: LoadFromFile
void BreakScenery::LoadFromFile(CFileIO &fIO)
{
fIO.ReadBinary(&frame,1);
fIO.ReadBinary(&iRotation,1);
spr = gpEngine->sprBreak1;
}