示例#1
0
文件: main.cpp 项目: jacekburys/omim
int main(int argc, char *argv[])
{
  qt_qhash_seed.store(0);
  google::ParseCommandLineFlags(&argc, &argv, true);
  QApplication app(argc, argv);

  tools::SkinGenerator gen(FLAGS_colorCorrection);

  std::vector<QSize> symbolSizes;
  symbolSizes.push_back(QSize(FLAGS_symbolWidth, FLAGS_symbolHeight));

  std::vector<std::string> suffixes;
  suffixes.push_back(FLAGS_skinSuffix);

  gen.processSymbols(FLAGS_symbolsDir, FLAGS_skinName, symbolSizes, suffixes);

  if (!gen.renderPages(FLAGS_maxSize))
  {
    LOG(LINFO, ("Skin generation finished with error."));
    return 1;
  }

  QString newSkin(FLAGS_skinName.c_str());
  newSkin.replace("basic", "symbols");
  gen.writeToFileNewStyle(newSkin.toStdString() + FLAGS_skinSuffix);

  return 0;
}
示例#2
0
void TSStatic::reSkin()
{
   if ( isGhost() && mShapeInstance && mSkinNameHandle.isValidString() )
   {
      Vector<String> skins;
      String(mSkinNameHandle.getString()).split( ";", skins );

      for (int i = 0; i < skins.size(); i++)
      {
         String oldSkin( mAppliedSkinName.c_str() );
         String newSkin( skins[i] );

         // Check if the skin handle contains an explicit "old" base string. This
         // allows all models to support skinning, even if they don't follow the 
         // "base_xxx" material naming convention.
         S32 split = newSkin.find( '=' );    // "old=new" format skin?
         if ( split != String::NPos )
         {
            oldSkin = newSkin.substr( 0, split );
            newSkin = newSkin.erase( 0, split+1 );
         }

         mShapeInstance->reSkin( newSkin, oldSkin );
         mAppliedSkinName = newSkin;
      }
   }
}