本文整理汇总了C++中OutputBlob类的典型用法代码示例。如果您正苦于以下问题:C++ OutputBlob类的具体用法?C++ OutputBlob怎么用?C++ OutputBlob使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了OutputBlob类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: serializePluginList
void serializePluginList(OutputBlob& serializer)
{
serializer.write((int32)m_plugin_manager->getPlugins().size());
for (auto* plugin : m_plugin_manager->getPlugins())
{
serializer.writeString(plugin->getName());
}
}
示例2:
void ParticleEmitter::PlaneModule::serialize(OutputBlob& blob)
{
blob.write(m_bounce);
blob.write(m_count);
for (int i = 0; i < m_count; ++i)
{
blob.write(m_entities[i]);
}
}
示例3: serialize
void serialize(OutputBlob& serializer) override
{
serializer.write((int32_t)m_script_entities.size());
for (int i = 0; i < m_script_entities.size(); ++i)
{
serializer.write((int32_t)m_script_entities[i]);
serializer.writeString(m_paths[i].c_str());
}
}
示例4: serialize
void PathManager::serialize(OutputBlob& serializer)
{
MT::SpinLock lock(m_mutex);
serializer.write((int32)m_paths.size());
for (int i = 0; i < m_paths.size(); ++i)
{
serializer.writeString(m_paths.at(i)->m_path);
}
}
示例5: serializerSceneVersions
void serializerSceneVersions(OutputBlob& serializer, UniverseContext& ctx)
{
serializer.write(ctx.m_scenes.size());
for (auto* scene : ctx.m_scenes)
{
serializer.write(crc32(scene->getPlugin().getName()));
serializer.write(scene->getVersion());
}
}
示例6: serialize
void serialize(OutputBlob& serializer) override
{
serializer.write((int32)m_animables.size());
for (const Animable& animable : m_animables)
{
serializer.write(animable.entity);
serializer.write(animable.time_scale);
serializer.write(animable.start_time);
serializer.writeString(animable.animation ? animable.animation->getPath().c_str() : "");
}
}
示例7: serialize
void serialize(OutputBlob& serializer) override
{
serializer.write((int32)m_animables.size());
for (int i = 0; i < m_animables.size(); ++i)
{
serializer.write(m_animables[i].m_entity);
serializer.write(m_animables[i].m_time);
serializer.write(m_animables[i].m_is_free);
serializer.writeString(
m_animables[i].m_animation ? m_animables[i].m_animation->getPath().c_str() : "");
}
}
示例8: get
void get(ComponentUID cmp, int index, OutputBlob& stream) const override
{
int value;
if (index == -1)
{
value = (static_cast<PhysicsScene*>(cmp.scene)->*m_single.getter)(cmp.handle);
}
else
{
value = (static_cast<PhysicsScene*>(cmp.scene)->*m_array.getter)(cmp.handle, index);
}
stream.write(&value, sizeof(value));
};
示例9: serialize
void ParticleEmitter::serialize(OutputBlob& blob)
{
blob.write((int)ParticleEmitterVersion::LATEST);
blob.write(m_spawn_count);
blob.write(m_spawn_period);
blob.write(m_initial_life);
blob.write(m_initial_size);
blob.write(m_entity);
blob.writeString(m_material ? m_material->getPath().c_str() : "");
blob.write(m_modules.size());
for (auto* module : m_modules)
{
blob.write(module->getType());
module->serialize(blob);
}
}
示例10: serialize
void Universe::serialize(OutputBlob& serializer)
{
serializer.write((int32)m_transformations.size());
serializer.write(
&m_transformations[0], sizeof(m_transformations[0]) * m_transformations.size());
serializer.write((int32)m_id_to_name_map.size());
for (int i = 0, c = m_id_to_name_map.size(); i < c; ++i)
{
serializer.write(m_id_to_name_map.getKey(i));
serializer.writeString(m_id_to_name_map.at(i).c_str());
}
serializer.write(m_first_free_slot);
serializer.write((int32)m_id_map.size());
if (!m_id_map.empty())
{
serializer.write(&m_id_map[0], sizeof(m_id_map[0]) * m_id_map.size());
}
}
示例11: serialize
void serialize(OutputBlob& serializer) override
{
serializer.write(m_prefabs.size());
if(!m_prefabs.empty()) serializer.write(&m_prefabs[0], m_prefabs.size() * sizeof(m_prefabs[0]));
serializer.write(m_instances.size());
for (int i = 0, c = m_instances.size(); i < c; ++i)
{
serializer.write(m_instances.getKey(i));
serializer.write(m_instances.at(i));
}
serializer.write(m_resources.size());
for (PrefabResource* res : m_resources)
{
serializer.writeString(res->getPath().c_str());
}
}
示例12: serialize
void serialize(OutputBlob& serializer) override
{
serializer.write((int32)m_template_names.size());
for (int i = 0, c = m_template_names.size(); i < c; ++i)
{
serializer.writeString(m_template_names[i].c_str());
}
serializer.write((int32)m_instances.size());
for (int i = 0; i < m_instances.size(); ++i)
{
serializer.write(m_instances.getKey(i));
Array<Entity>& entities = m_instances.at(i);
serializer.write((int32)entities.size());
for (int j = 0, c = entities.size(); j < c; ++j)
{
serializer.write(entities[j]);
}
}
}
示例13: serialize
uint32 serialize(UniverseContext& ctx, OutputBlob& serializer) override
{
SerializedEngineHeader header;
header.m_magic = SERIALIZED_ENGINE_MAGIC; // == '_LEN'
header.m_version = SerializedEngineVersion::LATEST;
header.m_reserved = 0;
serializer.write(header);
serializePluginList(serializer);
serializerSceneVersions(serializer, ctx);
m_path_manager.serialize(serializer);
int pos = serializer.getSize();
ctx.m_universe->serialize(serializer);
m_plugin_manager->serialize(serializer);
serializer.write((int32)ctx.m_scenes.size());
for (int i = 0; i < ctx.m_scenes.size(); ++i)
{
serializer.writeString(ctx.m_scenes[i]->getPlugin().getName());
serializer.write(ctx.m_scenes[i]->getVersion());
ctx.m_scenes[i]->serialize(serializer);
}
uint32 crc = crc32((const uint8*)serializer.getData() + pos,
serializer.getSize() - pos);
return crc;
}
示例14: getContents
void IFile::getContents(OutputBlob& blob)
{
size_t tmp = size();
blob.resize((int)tmp);
read(blob.getMutableData(), tmp);
}
示例15:
InputBlob::InputBlob(const OutputBlob& blob)
: m_data((const u8*)blob.getData())
, m_size(blob.getPos())
, m_pos(0)
{}