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