本文整理汇总了C++中trpgWriteBuffer::End方法的典型用法代码示例。如果您正苦于以下问题:C++ trpgWriteBuffer::End方法的具体用法?C++ trpgWriteBuffer::End怎么用?C++ trpgWriteBuffer::End使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类trpgWriteBuffer
的用法示例。
在下文中一共展示了trpgWriteBuffer::End方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Write
// Write function
bool trpgTextureEnv::Write(trpgWriteBuffer &buf)
{
if (!isValid())
return false;
buf.Begin(TRPGMAT_TEXENV);
buf.Begin(TRPGMAT_TXENV_MODE);
buf.Add(envMode);
buf.End();
buf.Begin(TRPGMAT_TXENV_FILTER);
buf.Add(minFilter);
buf.Add(magFilter);
buf.End();
buf.Begin(TRPGMAT_TXENV_WRAP);
buf.Add(wrapS);
buf.Add(wrapT);
buf.End();
buf.Begin(TRPGMAT_TXENV_BORDER);
buf.Add(borderCol);
buf.End();
buf.End();
return true;
}
示例2: 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;
}
示例3: Write
// Write method
bool trpgSupportStyle::Write(trpgWriteBuffer &buf)
{
buf.Begin(TRPG_SUPPORT_STYLE);
buf.Begin(TRPG_SUPPORT_STYLE_BASIC);
buf.Add(type);
buf.Add(matId);
buf.End();
buf.End();
return true;
}
示例4: Write
// Write model reference
bool trpgModelRef::Write(trpgWriteBuffer &buf)
{
if (!isValid())
return false;
buf.Begin(TRPG_MODELREF);
buf.Add(modelRef);
for (int i=0;i<4;i++)
for (int j=0;j<4;j++)
buf.Add(m[i][j]);
buf.End();
return true;
}
示例5: Write
bool trpgRange::Write(trpgWriteBuffer &buf)
{
buf.Begin(TRPG_RANGE);
buf.Add(inLod);
buf.Add(outLod);
buf.Add(priority);
buf.Add((category ? category : ""));
buf.Add((subCategory ? subCategory : ""));
if(writeHandle) {
buf.Add((int32)handle);
}
buf.End();
return true;
}
示例6: Write
// Write out the model table
bool trpgModelTable::Write(trpgWriteBuffer &buf)
{
if (!isValid())
return false;
buf.Begin(TRPGMODELTABLE);
buf.Add((int32)modelsMap.size());
ModelMapType::iterator itr = modelsMap.begin();
for ( ; itr != modelsMap.end( ); itr++) {
itr->second.Write(buf);
}
buf.End();
return true;
}
示例7: Write
// Writes this class to a write buffer
bool trpgLight::Write(trpgWriteBuffer &buf)
{
int numVertices = lightPoints.size();
if (!isValid())
return false;
buf.Begin(TRPGLIGHT);
buf.Add(index);
buf.Add(numVertices);
for (unsigned int i=0;i<lightPoints.size();i++)
buf.Add(lightPoints[i]);
buf.End();
return true;
}
示例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();
//.........这里部分代码省略.........