Ignore:
Timestamp:
10/19/06 12:24:18 (18 years ago)
Author:
szirmay
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/OgreRenderingRun.cpp

    r1592 r1644  
    11#include "OgreRenderingrun.h" 
    22#include "OgreIlluminationManager.h" 
     3#include "OgreTerrainSceneManager.h" 
    34 
    45MovablePlane* OgreRenderingRun::fullScreenQuad = NULL; 
     
    121122void OgreRenderingRun::setMaterialForRenderables(String& materialName, RenderQueue* rq,  bool solidsonly) 
    122123{ 
     124        SceneManager* sm = Ogre::Root::getSingleton()._getCurrentSceneManager(); 
     125        if(sm->getTypeName()==TerrainSceneManagerFactory::FACTORY_TYPE_NAME) 
     126        { 
     127                terrainMaterial = ((TerrainSceneManager*)sm)->getTerrainMaterial()->getName(); 
     128                ((TerrainSceneManager*)sm)->setCustomMaterial(materialName); 
     129        } 
     130 
    123131        RenderQueue::QueueGroupIterator queueIt = rq->_getQueueGroupIterator(); 
    124132    
     
    153161        } 
    154162 
    155         SceneManager* sm = Ogre::Root::getSingleton()._getCurrentSceneManager(); 
    156163        sm->setFindVisibleObjects(false);        
    157164} 
     
    178185void OgreRenderingRun::restoreMaterials() 
    179186{ 
     187        SceneManager* sm = Ogre::Root::getSingleton()._getCurrentSceneManager(); 
     188        if(sm->getTypeName()==TerrainSceneManagerFactory::FACTORY_TYPE_NAME) 
     189                ((TerrainSceneManager*)sm)->setCustomMaterial(terrainMaterial); 
     190         
     191 
    180192        std::map<Renderable*, String>::iterator it = visibleObjects.begin(); 
    181193        std::map<Renderable*, String>::iterator itend = visibleObjects.end(); 
     
    189201        visibleObjects.clear(); 
    190202 
    191         SceneManager* sm = Ogre::Root::getSingleton()._getCurrentSceneManager(); 
    192203        sm->setFindVisibleObjects(true); 
    193204} 
Note: See TracChangeset for help on using the changeset viewer.