本文整理汇总了C++中OutputPersistenceBlock::write方法的典型用法代码示例。如果您正苦于以下问题:C++ OutputPersistenceBlock::write方法的具体用法?C++ OutputPersistenceBlock::write怎么用?C++ OutputPersistenceBlock::write使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OutputPersistenceBlock
的用法示例。
在下文中一共展示了OutputPersistenceBlock::write方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: persist
bool WalkRegion::persist(OutputPersistenceBlock &writer) {
bool result = true;
// Persist the parent region
result &= Region::persist(writer);
// Persist the nodes
writer.write((uint32)_nodes.size());
Common::Array<Vertex>::const_iterator it = _nodes.begin();
while (it != _nodes.end()) {
writer.write((int32)it->x);
writer.write((int32)it->y);
++it;
}
// Persist the visibility matrix
writer.write((uint32)_visibilityMatrix.size());
Common::Array< Common::Array<int> >::const_iterator rowIter = _visibilityMatrix.begin();
while (rowIter != _visibilityMatrix.end()) {
writer.write((uint32)rowIter->size());
Common::Array<int>::const_iterator colIter = rowIter->begin();
while (colIter != rowIter->end()) {
writer.write((int32)*colIter);
++colIter;
}
++rowIter;
}
return result;
}
示例2: persist
bool AnimationTemplate::persist(OutputPersistenceBlock &writer) {
bool Result = true;
// Parent persistieren.
Result &= AnimationDescription::persist(writer);
// Frameanzahl schreiben.
writer.write(_frames.size());
// Frames einzeln persistieren.
Common::Array<const Frame>::const_iterator Iter = _frames.begin();
while (Iter != _frames.end()) {
writer.write(Iter->hotspotX);
writer.write(Iter->hotspotY);
writer.write(Iter->flipV);
writer.write(Iter->flipH);
writer.writeString(Iter->fileName);
writer.writeString(Iter->action);
++Iter;
}
// Restliche Member persistieren.
writer.writeString(_sourceAnimationPtr->getFileName());
writer.write(_valid);
return Result;
}
示例3: persist
bool SoundEngine::persist(OutputPersistenceBlock &writer) {
writer.write(_maxHandleId);
for (uint i = 0; i < SOUND_HANDLES; i++) {
writer.write(_handles[i].id);
// Don't restart sounds which already finished playing.
if (_handles[i].type != kFreeHandle && !_mixer->isSoundHandleActive(_handles[i].handle))
_handles[i].type = kFreeHandle;
writer.writeString(_handles[i].fileName);
if (_handles[i].type == kFreeHandle)
writer.write((int32)-1);
else
writer.write(_handles[i].sndType);
writer.write(_handles[i].volume);
writer.write(_handles[i].pan);
writer.write(_handles[i].loop);
writer.write(_handles[i].loopStart);
writer.write(_handles[i].loopEnd);
writer.write(_handles[i].layer);
}
return true;
}
示例4: persist
bool Polygon::persist(OutputPersistenceBlock &writer) {
writer.write(vertexCount);
for (int i = 0; i < vertexCount; ++i) {
writer.write(vertices[i].x);
writer.write(vertices[i].y);
}
return true;
}
示例5: persist
bool Bitmap::persist(OutputPersistenceBlock &writer) {
bool result = true;
result &= RenderObject::persist(writer);
writer.write(_flipH);
writer.write(_flipV);
writer.write(_scaleFactorX);
writer.write(_scaleFactorY);
writer.write(_modulationColor);
writer.write(_originalWidth);
writer.write(_originalHeight);
return result;
}
示例6: persist
bool Text::persist(OutputPersistenceBlock &writer) {
bool result = true;
result &= RenderObject::persist(writer);
writer.write(_modulationColor);
writer.writeString(_font);
writer.writeString(_text);
writer.write(_autoWrap);
writer.write(_autoWrapThreshold);
result &= RenderObject::persistChildren(writer);
return result;
}
示例7: persist
bool InputEngine::persist(OutputPersistenceBlock &writer) {
// Write out the number of command callbacks and their names.
// Note: We do this only for compatibility with older engines resp.
// the original engine.
writer.write((uint32)1);
writer.writeString("LuaCommandCB");
// Write out the number of command callbacks and their names.
// Note: We do this only for compatibility with older engines resp.
// the original engine.
writer.write((uint32)1);
writer.writeString("LuaCharacterCB");
return true;
}
示例8: persist
bool RenderObjectManager::persist(OutputPersistenceBlock &writer) {
bool result = true;
// Alle Kinder des Wurzelknotens speichern. Dadurch werden alle BS_RenderObjects gespeichert rekursiv gespeichert.
result &= _rootPtr->persistChildren(writer);
writer.write(_frameStarted);
// Referenzen auf die TimedRenderObjects persistieren.
writer.write((uint32)_timedRenderObjects.size());
RenderObjectList::const_iterator iter = _timedRenderObjects.begin();
while (iter != _timedRenderObjects.end()) {
writer.write((*iter)->getHandle());
++iter;
}
// Alle BS_AnimationTemplates persistieren.
result &= AnimationTemplateRegistry::instance().persist(writer);
return result;
}
示例9: persist
// Persistence
bool Region::persist(OutputPersistenceBlock &writer) {
bool Result = true;
writer.write(static_cast<uint32>(_type));
writer.write(_valid);
writer.write((int32)_position.x);
writer.write((int32)_position.y);
writer.write((uint32)_polygons.size());
Common::Array<Polygon>::iterator It = _polygons.begin();
while (It != _polygons.end()) {
Result &= It->persist(writer);
++It;
}
writer.write((int32)_boundingBox.left);
writer.write((int32)_boundingBox.top);
writer.write((int32)_boundingBox.right);
writer.write((int32)_boundingBox.bottom);
return Result;
}