本文整理汇总了C++中trpgWriteBuffer类的典型用法代码示例。如果您正苦于以下问题:C++ trpgWriteBuffer类的具体用法?C++ trpgWriteBuffer怎么用?C++ trpgWriteBuffer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了trpgWriteBuffer类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: Write
// Write out LOD
bool trpgLod::Write(trpgWriteBuffer &buf)
{
if (!isValid())
return false;
buf.Begin(TRPG_LOD);
buf.Add(id);
buf.Add(numRange);
buf.Add(center);
buf.Add(switchIn);
buf.Add(switchOut);
buf.Add(width);
if ( name && strlen(name) ) {
buf.Add(name);
} else
buf.Add("");
buf.End();
return true;
}
开发者ID:LaurensVoerman,项目名称:OpenSceneGraph,代码行数:24,代码来源:trpage_nodes.cpp
示例2: Write
// Write method
bool trpgLabelProperty::Write(trpgWriteBuffer &buf)
{
buf.Begin(TRPG_LABEL_PROPERTY);
buf.Begin(TRPG_LABEL_PROPERTY_BASIC);
buf.Add(fontId);
buf.Add(supportId);
buf.Add(type);
buf.End();
buf.End();
return true;
}
开发者ID:yueying,项目名称:osg,代码行数:15,代码来源:trpage_label.cpp
示例3: Write
// Write billboard
bool trpgBillboard::Write(trpgWriteBuffer &buf)
{
if (!isValid())
return false;
buf.Begin(TRPG_BILLBOARD);
buf.Add(numChild);
buf.Add(id);
buf.Add((uint8)type);
buf.Add((uint8)mode);
buf.Add(center);
buf.Add(axis);
if ( name && strlen(name) ) {
buf.Add(name);
}
buf.End();
return true;
}
开发者ID:BlitzMaxModules,项目名称:osg.mod,代码行数:21,代码来源:trpage_nodes.cpp
示例4: Write
bool trpgLocalMaterial::Write(trpgWriteBuffer &buf)
{
if (!isValid())
return false;
buf.Begin(TRPGLOCALMATERIAL);
// Write the data
buf.Add(baseMatTable);
buf.Add(baseMat);
buf.Add(sx);
buf.Add(sy);
buf.Add(ex);
buf.Add(ey);
buf.Add(destWidth);
buf.Add(destHeight);
buf.Add(addr[0].file);
buf.Add(addr[0].offset);
// and in case there's more...
int numAddrs=(int)(addr.size());
if (numAddrs>1) {
buf.Add(numAddrs-1); // suppressed due to breaking old readers.
for (int i=1;i<numAddrs;i++) {
buf.Add(addr[i].file);
buf.Add(addr[i].offset);
}
}
buf.End();
return true;
}
开发者ID:BlitzMaxModules,项目名称:osg.mod,代码行数:31,代码来源:trpage_material.cpp
示例5: Write
// Write to a buffer
bool trpgTileHeader::Write(trpgWriteBuffer &buf)
{
unsigned int i;
if (!isValid())
return false;
for (i=0;i<locMats.size();i++)
if (!locMats[i].isValid())
return false;
buf.Begin(TRPGTILEHEADER);
buf.Begin(TRPG_TILE_MATLIST);
buf.Add((int32)matList.size());
for (i=0;i<matList.size();i++)
buf.Add(matList[i]);
buf.End();
buf.Begin(TRPG_TILE_MODELLIST);
buf.Add((int32)modelList.size());
for (i=0;i<modelList.size();i++)
buf.Add(modelList[i]);
buf.End();
buf.Begin(TRPG_TILE_DATE);
buf.Add(date);
buf.End();
buf.Begin(TRPG_TILE_LOCMATLIST);
buf.Add((int32)locMats.size());
for (i=0;i<locMats.size();i++)
locMats[i].Write(buf);
buf.End();
buf.End();
return true;
}
开发者ID:BlitzMaxModules,项目名称:osg.mod,代码行数:36,代码来源:trpage_tile.cpp
示例6: Write
// Write out to a buffer
bool trpgHeader::Write(trpgWriteBuffer &buf)
{
if (!isValid())
return false;
buf.Begin(TRPGHEADER);
buf.Add((int32)verMajor);
buf.Add((int32)verMinor);
buf.Add((int32)dbVerMajor);
buf.Add((int32)dbVerMinor);
buf.Add(origin);
buf.Add(sw);
buf.Add(ne);
buf.Add((uint8)tileType);
buf.Add((int32)numLods);
buf.Begin(TRPGHEAD_LODINFO);
for (int i=0;i<numLods;i++) {
buf.Add(lodSizes[i]);
buf.Add(lodRanges[i]);
buf.Add(tileSize[i]);
}
buf.End();
buf.Add(maxGroupID);
if((verMajor >= TRPG_NOMERGE_VERSION_MAJOR) && (verMinor >=TRPG_NOMERGE_VERSION_MINOR)) {
buf.Add(flags);
buf.Add(rows);
buf.Add(cols);
}
buf.End();
return true;
}
开发者ID:151706061,项目名称:OpenSceneGraph,代码行数:39,代码来源:trpage_header.cpp
示例7: Write
// Writes this class to a write buffer
bool trpgLightAttr::Write(trpgWriteBuffer &buf)
{
buf.Begin(TRPGLIGHTATTR);
buf.Begin(TRPGLIGHTATTR_BASIC);
buf.Add((int)data.type);
buf.Add((int)data.directionality);
buf.Add(data.frontColor);
buf.Add(data.frontIntensity);
buf.Add(data.backColor);
buf.Add(data.backIntensity);
buf.Add(data.normal);
buf.Add(data.smc);
buf.Add(data.fid);
buf.Add(data.flags);
buf.Add(data.horizontalLobeAngle);
buf.Add(data.verticalLobeAngle);
buf.Add(data.lobeRollAngle);
buf.Add(data.lobeFalloff);
buf.Add(data.ambientIntensity);
buf.Add((int)data.quality);
buf.Add((int)data.randomIntensity);
buf.End();
buf.Begin(TRPGLIGHTATTR_RASCAL);
buf.Add(data.rascalSignificance);
buf.End();
buf.Begin(TRPGLIGHTATTR_CALLIGRAPHIC);
buf.Add(data.calligraphicAttr.drawOrder);
buf.Add(data.calligraphicAttr.minDefocus);
buf.Add(data.calligraphicAttr.maxDefocus);
buf.End();
buf.Begin(TRPGLIGHTATTR_PERFORMER);
buf.Add(data.performerAttr.actualSize);
buf.Add(data.performerAttr.fogScale);
buf.Add(data.performerAttr.minPixelSize);
buf.Add(data.performerAttr.maxPixelSize);
buf.Add(data.performerAttr.transparentClamp);
buf.Add(data.performerAttr.transparentFallofExp);
buf.Add(data.performerAttr.transparentPixelSize);
buf.Add(data.performerAttr.transparentScale);
buf.End();
buf.Begin(TRPGLIGHTATTR_ANIMATION);
buf.Add(data.animationAttr.period);
buf.Add(data.animationAttr.phaseDelay);
buf.Add(data.animationAttr.timeOn);
buf.Add(data.animationAttr.vector);
buf.End();
if (data.commentStr) {
buf.Begin(TRPGLIGHTATTR_COMMENT);
buf.Add(data.commentStr);
buf.End();
}
if(writeHandle) {
buf.Begin(TRPGLIGHTATTR_HANDLE);
buf.Add((int)handle);
buf.End();
}
buf.End();
return true;
}
开发者ID:yueying,项目名称:osg,代码行数:68,代码来源:trpage_light.cpp
示例8: Write
// Write geometry fields.
// Order doesn't matter very much for this
bool trpgGeometry::Write(trpgWriteBuffer &buf)
{
unsigned int i,j;
if (!isValid())
return false;
buf.Begin(TRPG_GEOMETRY);
/* Primitive info
Primitive Type
Number of primitives
Primitive array lengths
*/
buf.Begin(TRPG_GEOM_PRIM);
buf.Add(primType);
buf.Add(numPrim);
if (primLength.size() != 0) {
buf.Add((uint8)1);
for (i=0;i<(unsigned int)numPrim;i++)
buf.Add(primLength[i]);
} else
buf.Add((uint8)0);
buf.End();
/* Material info
Num materials
Material indicies
*/
if (materials.size() > 0) {
buf.Begin(TRPG_GEOM_MATERIAL);
buf.Add((int32)materials.size());
for (i=0;i<materials.size();i++)
buf.Add(materials[i]);
buf.End();
}
/* Vertices
Float and Double should never both be here
Num vertex
Vertex data
*/
if (vertDataFloat.size() > 0) {
buf.Begin(TRPG_GEOM_VERT32);
int32 num = vertDataFloat.size()/3;
buf.Add(num);
for (i=0;i<(unsigned int)3*num;i++)
buf.Add(vertDataFloat[i]);
buf.End();
}
if (vertDataDouble.size() > 0) {
buf.Begin(TRPG_GEOM_VERT64);
int32 num = vertDataDouble.size()/3;
buf.Add(num);
for (i=0;i<(unsigned int)3*num;i++)
buf.Add(vertDataDouble[i]);
buf.End();
}
/* Normals
Normal binding
Num normals
Normal data
*/
if (normDataFloat.size() > 0) {
buf.Begin(TRPG_GEOM_NORM32);
buf.Add((int32)normBind);
int32 num = normDataFloat.size()/3;
buf.Add(num);
for (i=0;i<(unsigned int)3*num;i++)
buf.Add(normDataFloat[i]);
buf.End();
}
if (normDataDouble.size() > 0) {
buf.Begin(TRPG_GEOM_NORM64);
buf.Add((int32)normBind);
int32 num = normDataDouble.size()/3;
buf.Add(num);
for (i=0;i<(unsigned int)3*num;i++)
buf.Add(normDataDouble[i]);
buf.End();
}
/* Colors
Color binding
Num colors
Colors
*/
if (colors.size() > 0) {
for (i=0;i<colors.size();i++) {
trpgColorInfo &ci = colors[i];
if (ci.data.size()) {
buf.Begin(TRPG_GEOM_COLOR);
buf.Add((int32)ci.type);
buf.Add((int32)ci.bind);
buf.Add((int32)ci.data.size());
for (j=0;j<ci.data.size();j++)
buf.Add(ci.data[j]);
buf.End();
//.........这里部分代码省略.........
开发者ID:BlitzMaxModules,项目名称:osg.mod,代码行数:101,代码来源:trpage_geom.cpp
注:本文中的trpgWriteBuffer类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论