当前位置: 首页>>代码示例>>C++>>正文


C++ CFileIO::WriteBinary方法代码示例

本文整理汇总了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);
}
开发者ID:ptitSeb,项目名称:prototype,代码行数:10,代码来源:Generator.cpp

示例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);
		}
	}
}
开发者ID:ppiecuch,项目名称:Prototype,代码行数:15,代码来源:Entity.cpp

示例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);
		}
	}
}
开发者ID:RangerKarl,项目名称:Prototype,代码行数:18,代码来源:Demo.cpp

示例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();
}
开发者ID:RangerKarl,项目名称:Prototype,代码行数:46,代码来源:Engine.cpp

示例5: WriteToFile

void TriggerSpeedUp::WriteToFile(CFileIO &fIO)
{
	fIO.WriteBinary(&iMaxTicks,1);
}
开发者ID:RangerKarl,项目名称:Prototype,代码行数:4,代码来源:TriggerSpeedUp.cpp

示例6: WriteToFile

void Serpent::WriteToFile(CFileIO &fIO)
{
	fIO.WriteBinary(&RateofFire,1);
	fIO.WriteBinary(&bStartDirection,1);
	WriteBufferToFile(fIO);
}
开发者ID:fabiensanglard,项目名称:Prototype,代码行数:6,代码来源:Serpent.cpp

示例7: WriteToFile

void FireBug::WriteToFile(CFileIO &fIO)
{
	fIO.WriteBinary(&RateofFire,1);
	fIO.WriteBinary(&bStartMovement,1);
}
开发者ID:RangerKarl,项目名称:Prototype,代码行数:5,代码来源:firebug.cpp

示例8: WriteToFile

void SuperTurret::WriteToFile(CFileIO &fIO)
{
	fIO.WriteBinary(&bDirection,1);
}
开发者ID:RangerKarl,项目名称:Prototype,代码行数:4,代码来源:SuperTurret.cpp

示例9: WriteToFile

void BreakScenery::WriteToFile(CFileIO &fIO)
{
	fIO.WriteBinary(&frame,1);
	fIO.WriteBinary(&iRotation,1);
}
开发者ID:RangerKarl,项目名称:Prototype,代码行数:5,代码来源:BreakScenery.cpp


注:本文中的CFileIO::WriteBinary方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。