本文整理汇总了C++中serializer::Writer::Int16方法的典型用法代码示例。如果您正苦于以下问题:C++ Writer::Int16方法的具体用法?C++ Writer::Int16怎么用?C++ Writer::Int16使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类serializer::Writer
的用法示例。
在下文中一共展示了Writer::Int16方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SaveMaterials
void BinaryConverter::SaveMaterials(Serializer::Writer& wr, Model* model)
{
//Look for the .model definition and parse it
//for material definitions
const ModelDefinition &modelDef = FindModelDefinition(model->GetName());
wr.Int32(modelDef.matDefs.size());
for (const auto& m : modelDef.matDefs) {
wr.String(m.name);
wr.String(m.tex_diff);
wr.String(m.tex_spec);
wr.String(m.tex_glow);
wr.String(m.tex_ambi);
wr.String(m.tex_norm);
wr.Color4UB(m.diffuse);
wr.Color4UB(m.specular);
wr.Color4UB(m.ambient);
wr.Color4UB(m.emissive);
wr.Int16(m.shininess);
wr.Int16(m.opacity);
wr.Bool(m.alpha_test);
wr.Bool(m.unlit);
wr.Bool(m.use_pattern);
}
}
示例2: Save
void GeomTree::Save(Serializer::Writer &wr) const
{
wr.Int32(m_numVertices);
wr.Int32(m_numEdges);
wr.Int32(m_numTris);
wr.Double(m_radius);
wr.Vector3d(m_aabb.max);
wr.Vector3d(m_aabb.min);
wr.Double(m_aabb.radius);
wr.Int32(m_numEdges);
for (Sint32 iAabb = 0; iAabb < m_numEdges; ++iAabb) {
wr.Vector3d(m_aabbs[iAabb].max);
wr.Vector3d(m_aabbs[iAabb].min);
wr.Double(m_aabbs[iAabb].radius);
}
for (Sint32 iEdge = 0; iEdge < m_numEdges; ++iEdge) {
m_edges[iEdge].Save(wr);
}
for (Sint32 iVert = 0; iVert < m_numVertices; ++iVert) {
wr.Vector3f(m_vertices[iVert]);
}
for (Sint32 iIndi = 0; iIndi < (m_numTris * 3); ++iIndi) {
wr.Int16(m_indices[iIndi]);
}
for (Sint32 iTri = 0; iTri < m_numTris; ++iTri) {
wr.Int32(m_triFlags[iTri]);
}
}