本文整理汇总了C++中Stamp::CheckTilesBatched方法的典型用法代码示例。如果您正苦于以下问题:C++ Stamp::CheckTilesBatched方法的具体用法?C++ Stamp::CheckTilesBatched怎么用?C++ Stamp::CheckTilesBatched使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Stamp
的用法示例。
在下文中一共展示了Stamp::CheckTilesBatched方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ExportStampTiles
void SpriteSheet::ExportStampTiles(const PlatformConfig& config, const Stamp& referenceStamp, std::stringstream& stream, const std::string& actorName) const
{
#if defined _DEBUG
ion::debug::Assert(referenceStamp.CheckTilesBatched(), "SpriteSheet::ExportStampTiles() - Tiles not in sequential order");
#endif
//Get all unique tiles
std::vector<TileId> tileIndices;
int numUniqueTiles = referenceStamp.GetSortedUniqueTileBatch(tileIndices);
//Offset by first index
int firstIndex = tileIndices[0];
int frameIdx = 0;
for(std::vector<SpriteSheetFrame>::const_iterator it = m_frames.begin(), end = m_frames.end(); it != end; ++it, ++frameIdx)
{
std::stringstream label;
label << "actor_" << actorName << "_sheet_" << m_name << "_frame_" << frameIdx;
stream << label.str() << ":" << std::endl;
//Export in sorted unique order
for(int i = 0; i < tileIndices.size(); i++)
{
//Find index of first use of this tile id in reference stamp
int tileIndex = referenceStamp.GetTileIndex(tileIndices[i]);
//Transpose to sprite (column major) order
ion::Vector2i pos(tileIndex / referenceStamp.GetWidth(), tileIndex % referenceStamp.GetWidth());
int rowMajorIndex = (pos.y * referenceStamp.GetHeight()) + pos.x;
//Export tile of animation frame
(*it)[rowMajorIndex].Export(config, stream);
stream << std::endl;
}
}
}