本文整理汇总了C++中CDataReader::canSeekTo方法的典型用法代码示例。如果您正苦于以下问题:C++ CDataReader::canSeekTo方法的具体用法?C++ CDataReader::canSeekTo怎么用?C++ CDataReader::canSeekTo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CDataReader
的用法示例。
在下文中一共展示了CDataReader::canSeekTo方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getCOLVersion
//.........这里部分代码省略.........
else
{
// COL 2 3 & 4 header
setCollisionSphereCount(pDataReader->readUint16());
setCollisionBoxCount(pDataReader->readUint16());
setCollisionMeshFaceCount(pDataReader->readUint16());
setCollisionConeCount(pDataReader->readUint8());
uint8 ucPadding1 = pDataReader->readUint8(); // 1 byte padding
setFlags(pDataReader->readUint32());
setCollisionSpheresOffset(pDataReader->readUint32());
setCollisionBoxesOffset(pDataReader->readUint32());
setCollisionConesOffset(pDataReader->readUint32());
setCollisionMeshVerticesOffset(pDataReader->readUint32());
setCollisionMeshFacesOffset(pDataReader->readUint32());
setTrianglePlanesOffset(pDataReader->readUint32());
if ((getFlags() & 8) != 0)
{
// entry does have face groups
uint32 uiCurrentSeek = pDataReader->getSeek();
// read face group count
uint32 uiFaceGroupCountSeek = (getHeaderStartOffset() + 4 + getCollisionMeshFacesOffset()) - 4;
pDataReader->setSeek(uiFaceGroupCountSeek);
setCollisionMeshFaceGroupCount(pDataReader->readUint32());
// read face groups offset
setCollisionMeshFaceGroupsOffset((getCollisionMeshFacesOffset() - 4) - (28 * getCollisionMeshFaceGroupCount())); // 28 = sizeof(TFaceGroup)
// restore parser seek position
pDataReader->setSeek(uiCurrentSeek);
}
else
{
// entry does not have face groups
setCollisionMeshFaceGroupCount(0);
setCollisionMeshFaceGroupsOffset(0);
}
if (eCOLVersionValue == COL_3 || eCOLVersionValue == COL_4)
{
// COL 3 & 4 header
setShadowMeshFaceCount(pDataReader->readUint32());
setShadowMeshVerticesOffset(pDataReader->readUint32());
setShadowMeshFacesOffset(pDataReader->readUint32());
if (eCOLVersionValue == COL_4)
{
// COL 4 header
setUnknown1(pDataReader->readUint32());
}
}
// calculate vertex counts
// COL 2 3 & 4
uint32 uiCollisionMeshVertexCount = calculateCollisionMeshVertexCount();
setCollisionMeshVertexCount(uiCollisionMeshVertexCount);
if (eCOLVersionValue == COL_3 || eCOLVersionValue == COL_4)
{
// COL 3 & 4
uint32 uiShadowMeshVertexCount = calculateShadowMeshVertexCount();
setShadowMeshVertexCount(uiShadowMeshVertexCount);
}
// COL 2 3 & 4 body
pDataReader->setSeek(getHeaderStartOffset() + 4 + getCollisionSpheresOffset());
parseCollisionSpheres();
pDataReader->setSeek(getHeaderStartOffset() + 4 + getCollisionBoxesOffset());
parseCollisionBoxes();
pDataReader->setSeek(getHeaderStartOffset() + 4 + getCollisionMeshVerticesOffset());
parseCollisionMeshVertices();
pDataReader->setSeek(getHeaderStartOffset() + 4 + getCollisionMeshFaceGroupsOffset());
parseCollisionMeshFaceGroups();
pDataReader->setSeek(getHeaderStartOffset() + 4 + getCollisionMeshFacesOffset());
parseCollisionMeshFaces();
if (eCOLVersionValue == COL_3 || eCOLVersionValue == COL_4)
{
// COL 3 & 4 body
pDataReader->setSeek(getHeaderStartOffset() + 4 + getShadowMeshVerticesOffset());
parseShadowMeshVertices();
pDataReader->setSeek(getHeaderStartOffset() + 4 + getShadowMeshFacesOffset());
parseShadowMeshFaces();
}
}
if (!pDataReader->canSeekTo(getHeaderStartOffset() + uiEntrySize + 8))
{
// EOF
return;
}
pDataReader->setSeek(getHeaderStartOffset() + uiEntrySize + 8);
}