bool ComplexSceneManager::init(const std::vector<std::string> &vParams)
{
    bool returnValue = true;

    bool bDoData = false;

    for(UInt32 i = 1; i < vParams.size(); ++i)
    {
        if(vParams[i][0] == '-' && vParams[i][1] == '-')
        {
            if(vParams[i][2] == 'd' && vParams[i][3] == 'a' && 
               vParams[i][4] == 't' && vParams[i][5] == 'a')
            {
                bDoData = true;
            }
            else if(vParams[i][2] == 'g' && vParams[i][3] == 'l' && 
                    vParams[i][4] == 'o' && vParams[i][5] == 'b' &&
                    vParams[i][6] == 'a' && vParams[i][7] == 'l')
            {
                bDoData = false;
            }
            else
            {
                fprintf(stderr, "Unknow option %s\n", vParams[i].c_str());
                return false;
            }
               
        }
        else
        {
            if(bDoData == true)
            {
                addData(vParams[i]);
            }
            else
            {
                addGlobals(vParams[i]);
            }
        }
    }

    if(_sfDrawManager.getValue() == NULL)
    {
        return false;
    }

    commitChanges();

    returnValue = _sfDrawManager.getValue()->init();

    if(returnValue == true && FrameHandler::the() != NULL)
    {
        returnValue &= FrameHandler::the()->init();
    }

    return returnValue;
}
Пример #2
0
 static void jitTopLevel(llvm::ArrayRef<TopLevelItemPtr> toplevels)
 {
     if (toplevels.empty()) {
         return;
     }
     if (printAST) {
         for (size_t i = 0; i < toplevels.size(); ++i) {
             llvm::errs() << i << ": " << toplevels[i] << "\n";
         }
     }
     addGlobals(module, toplevels);
 }