1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-02-25 03:09:42 +00:00

Pathgrid edge resource management for editing multiple cells or multiple documents.

This commit is contained in:
cc9cii 2014-11-13 06:36:47 +11:00
parent e430dcfd8a
commit 0e0ad97a91

View file

@ -28,6 +28,9 @@ namespace CSVRender
void CSVRender::Cell::createGridMaterials()
{
if(!Ogre::ResourceGroupManager::getSingleton().resourceGroupExists(DEBUGGING_GROUP))
Ogre::ResourceGroupManager::getSingleton().createResourceGroup(DEBUGGING_GROUP);
if(Ogre::MaterialManager::getSingleton().getByName(PG_LINE_MATERIAL, DEBUGGING_GROUP).isNull())
{
Ogre::MaterialPtr lineMatPtr =
@ -56,6 +59,7 @@ Ogre::ManualObject *CSVRender::Cell::createPathgridEdge(const std::string &name,
{
Ogre::ManualObject *result = mSceneMgr->createManualObject(name);
createGridMaterials();
result->begin(PG_LINE_MATERIAL, Ogre::RenderOperation::OT_LINE_LIST);
Ogre::Vector3 direction = (end - start);
@ -323,8 +327,6 @@ float CSVRender::Cell::getTerrainHeightAt(const Ogre::Vector3 &pos) const
// - repainting edges while moving
void CSVRender::Cell::loadPathgrid()
{
if(!Ogre::ResourceGroupManager::getSingleton().resourceGroupExists(DEBUGGING_GROUP))
Ogre::ResourceGroupManager::getSingleton().createResourceGroup(DEBUGGING_GROUP);
createGridMaterials();
int worldsize = ESM::Land::REAL_SIZE;