Ignore:
Timestamp:
01/25/06 17:45:45 (18 years ago)
Author:
mattausch
Message:

fixed loading function: the view cell manager is chosen depending on
the type in the file. the view space box is saved with the file

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/VUT/GtpVisibilityPreprocessor/src/Preprocessor.cpp

    r576 r577  
    190190bool Preprocessor::PrepareViewCells() 
    191191{ 
    192         //-- parse type of view cell container 
    193         char viewCellsStr[64]; 
    194         environment->GetStringValue("ViewCells.type", viewCellsStr); 
    195  
    196         mViewCellsManager = CreateViewCellsManager(viewCellsStr); 
     192        //-- parse view cells construction method 
     193        environment->GetBoolValue("ViewCells.loadFromFile", mLoadViewCells); 
     194        char buf[100]; 
     195         
     196        if (mLoadViewCells) 
     197        { 
     198                environment->GetStringValue("ViewCells.filename", buf); 
     199                mViewCellsManager = ViewCellsManager::LoadViewCells(buf, &mObjects); 
     200        } 
     201        else 
     202        { 
     203                //-- parse type of view cell container 
     204                char viewCellsStr[64]; 
     205                environment->GetStringValue("ViewCells.type", viewCellsStr); 
     206            mViewCellsManager = CreateViewCellsManager(viewCellsStr); 
     207        } 
    197208 
    198209        float objRenderCost = 0, vcOverhead = 0, moveSpeed = 0; 
     
    207218        mViewCellsManager->SetRenderer(mRenderSimulator); 
    208219 
    209         //-- parse view cells construction method 
    210         environment->GetBoolValue("ViewCells.loadFromFile", mLoadViewCells); 
    211         char buf[100]; 
    212  
    213         if (mLoadViewCells) 
    214         { 
    215                 environment->GetStringValue("ViewCells.filename", buf); 
    216                 mViewCellsFilename = buf; 
    217         } 
    218220 
    219221        if (mUseGlRenderer || mUseGlDebugger) 
     
    228230        environment->GetBoolValue("Preprocessor.detectEmptyViewSpace", mDetectEmptyViewSpace); 
    229231         
    230  
    231  
    232232        return true; 
    233233} 
     
    242242        else if (strcmp(name, "bspTree") == 0) 
    243243        { 
     244                Debug << "view cell type: Bsp" << endl; 
     245 
    244246                mBspTree = new BspTree(); 
    245  
    246                 Debug << "view cell type: Bsp" << endl; 
    247  
    248247                mViewCellsManager = new BspViewCellsManager(mBspTree); 
    249248        } 
    250249        else if (strcmp(name, "vspBspTree") == 0) 
    251250        { 
     251                Debug << "view cell type: VspBsp" << endl; 
     252 
    252253                mVspBspTree = new VspBspTree(); 
    253  
    254                 Debug << "view cell type: VspBsp" << endl; 
    255  
    256254                mViewCellsManager = new VspBspViewCellsManager(mVspBspTree); 
    257255        } 
Note: See TracChangeset for help on using the changeset viewer.