本文整理汇总了C++中CColor::parseColor方法的典型用法代码示例。如果您正苦于以下问题:C++ CColor::parseColor方法的具体用法?C++ CColor::parseColor怎么用?C++ CColor::parseColor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CColor
的用法示例。
在下文中一共展示了CColor::parseColor方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: load
void BoxObject::load ( trObjectParserBlock &parserBlock )
{
depthWrites = true;
// scan elements
tvStringPairList::iterator itr = parserBlock.elements.begin();
std::string grimeTexture;
float grimeZ = 1;
while ( itr != parserBlock.elements.end() )
{
if ( !basicElement(*itr) )
{
std::string tag = string_util::toupper(itr->first);
if ( tag == "COLOR" )
color.parseColor(itr->second);
if ( tag == "DEPTHWRITE" )
depthWrites = atoi(itr->second.c_str()) != 0;
if ( tag == "NOTOP" )
noTop = atoi(itr->second.c_str()) != 0;
if ( tag == "GRIMETEXTURE" )
grimeTexture = itr->second.c_str();
if ( tag == "GRIMEZ" )
grimeZ = (float)atof(itr->second.c_str());
}
itr++;
}
glList = DisplayListManager::instance().newList(this);
if ( grimeTexture.size() )
{
// we need to make a child grim object
// we copy the elements so it gets all the same stuff
// but we DON'T do the sub blocks
trObjectParserBlock miniBlock;
miniBlock.name = parserBlock.name;
miniBlock.elements.push_back(tpStringPair(std::string("SIZE"),string_util::format("%f,%f,%f",size.X(),size.Y(),grimeZ*0.5f)));
float localCenter = -(size.Z()-grimeZ/2.0f);
miniBlock.elements.push_back(tpStringPair(std::string("POSITION"),string_util::format("%f,%f,%f",0.0f,0.0f,localCenter)));
miniBlock.elements.push_back(tpStringPair(std::string("DEPTHWRITE"),std::string("0")));
miniBlock.elements.push_back(tpStringPair(std::string("NOTOP"),std::string("1")));
miniBlock.elements.push_back(tpStringPair(std::string("TEXTURE"),grimeTexture));
C3DVertex uvScale(1,1,1);
if ((int)uvScales.size())
uvScale = uvScales[(int)uvScales.size()-1];
miniBlock.elements.push_back(tpStringPair(std::string("UVSCALE"),string_util::format("%f,%f,%f",uvScale.X(),uvScale.Y(),uvScale.Z()*(grimeZ/size.Z()))));
world->AddObject("BOX",miniBlock,this);
}
MapBaseObject::load(parserBlock);
}