本文整理汇总了C++中KeyValue::AsFloat方法的典型用法代码示例。如果您正苦于以下问题:C++ KeyValue::AsFloat方法的具体用法?C++ KeyValue::AsFloat怎么用?C++ KeyValue::AsFloat使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KeyValue
的用法示例。
在下文中一共展示了KeyValue::AsFloat方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
void KVReader2::Dump(KeyValue* inNode, unsigned int startAddress)
{
KeyValue* cur = inNode;
while(cur!=0)
{
for(int i=0;i<cur->depth;i++)
{
printf(" ");
}
if(cur->key!=0)
{
//printf("= '%s' [%X] :",cur->key,cur->keyHash);
printf("'%s' : ",cur->key);
}
else
{
//printf(" : ");
}
if(cur->value != 0)
{
if(cur->type==NTRO_DATA_TYPE_HANDLE || cur->type==NTRO_DATA_TYPE_NAME)
{
printf("(str) '%s'",cur->AsHandle());
}
else if(cur->type==NTRO_DATA_TYPE_INTEGER)
{
printf("(int) %d",cur->AsInt());
}
else if(cur->type==NTRO_DATA_TYPE_UINTEGER)
{
printf("(uint) %u",cur->AsUint());
}
else if(cur->type==NTRO_DATA_TYPE_SHORT)
{
printf("(short) %d",cur->AsShort());
}
else if(cur->type==NTRO_DATA_TYPE_USHORT)
{
printf("(ushort) %u",cur->AsUshort());
}
else if(cur->type==NTRO_DATA_TYPE_BYTE)
{
printf("(byte) %2X",cur->AsByte());
}
else if(cur->type==NTRO_DATA_TYPE_BOOLEAN)
{
printf("(bool) %2X",cur->AsByte());
}
else if(cur->type==NTRO_DATA_TYPE_FLOAT)
{
printf("(float) %f",cur->AsFloat());
}
else if(cur->type==10) // not sure what it is, but it's used as image format
{
printf("(format 10) %u",cur->AsByte());
}
else if(cur->type==NTRO_DATA_TYPE_VECTOR3)
{
glm::vec3 v(cur->AsVec3());
printf("(vec3) [%f, %f, %f]",v[0],v[1],v[2]);
}
else if(cur->type==NTRO_DATA_TYPE_VECTOR4)
{
glm::vec4 v(cur->AsVec4());
printf("(vec4) [%f, %f, %f, %f]",v[0],v[1],v[2],v[3]);
}
else if(cur->type==NTRO_DATA_TYPE_QUATERNION)
{
glm::vec4 v(cur->AsVec4());
printf("(quat) [%f, %f, %f, %f]",v[0],v[1],v[2],v[3]);
}
else if(cur->type==NTRO_DATA_TYPE_COLOR)
{
glm::vec4 v(cur->AsVec4());
printf("(color) [%f, %f, %f, %f]",v[0],v[1],v[2],v[3]);
}
else
{
printf("(unknown %d) %2X",cur->type, (unsigned int) cur->value);
}
printf(" @%X",(unsigned int)cur->value+16 - (unsigned int)startAddress);
}
else
{
printf("[%d/%d]",cur->childCount,cur->realChildCount);
printf(" @%X",(unsigned int)cur->childCountAddress+16 - (unsigned int)startAddress);
}
printf("\n");
Dump(cur->child, startAddress);
cur = cur->sibling;
}
}