当前位置: 首页>>代码示例>>C++>>正文


C++ Listener::removeWallpaper方法代码示例

本文整理汇总了C++中loading::Listener::removeWallpaper方法的典型用法代码示例。如果您正苦于以下问题:C++ Listener::removeWallpaper方法的具体用法?C++ Listener::removeWallpaper怎么用?C++ Listener::removeWallpaper使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在loading::Listener的用法示例。


在下文中一共展示了Listener::removeWallpaper方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: changeToInteriorCell

void Scene::changeToInteriorCell (const std::string& cellName, const ESM::Position& position)
{
    Nif::NIFFile::CacheLock lock;
    MWBase::Environment::get().getWorld ()->getFader ()->fadeOut(0.5);

    Loading::Listener* loadingListener = MWBase::Environment::get().getWindowManager()->getLoadingScreen();
    Loading::ScopedLoad load(loadingListener);

    mRendering.enableTerrain(false);

    std::string loadingInteriorText = "#{sLoadingMessage2}";
    loadingListener->setLabel(loadingInteriorText);

    CellStore *cell = MWBase::Environment::get().getWorld()->getInterior(cellName);
    bool loadcell = (mCurrentCell == NULL);
    if(!loadcell)
        loadcell = *mCurrentCell != *cell;

    if(!loadcell)
    {
        MWBase::World *world = MWBase::Environment::get().getWorld();
        world->moveObject(world->getPlayerPtr(), position.pos[0], position.pos[1], position.pos[2]);

        float x = Ogre::Radian(position.rot[0]).valueDegrees();
        float y = Ogre::Radian(position.rot[1]).valueDegrees();
        float z = Ogre::Radian(position.rot[2]).valueDegrees();
        world->rotateObject(world->getPlayerPtr(), x, y, z);

        world->getPlayerPtr().getClass().adjustPosition(world->getPlayerPtr());
        world->getFader()->fadeIn(0.5f);
        return;
    }

    std::cout << "Changing to interior\n";

    // remove active
    CellStoreCollection::iterator active = mActiveCells.begin();

    // count number of cells to unload
    int numUnload = 0;
    while (active!=mActiveCells.end())
    {
        ++active;
        ++numUnload;
    }

    // unload
    int current = 0;
    active = mActiveCells.begin();
    while (active!=mActiveCells.end())
    {
        unloadCell (active++);
        ++current;
    }

    int refsToLoad = cell->count();
    loadingListener->setProgressRange(refsToLoad);

    // Load cell.
    std::cout << "cellName: " << cell->getCell()->mName << std::endl;

    //Loading Interior loading text

    loadCell (cell, loadingListener);

    mCurrentCell = cell;

    // adjust fog
    mRendering.configureFog(*mCurrentCell);

    // adjust player
    playerCellChange (mCurrentCell, position);

    // Sky system
    MWBase::Environment::get().getWorld()->adjustSky();

    mCellChanged = true;
    MWBase::Environment::get().getWorld ()->getFader ()->fadeIn(0.5);

    loadingListener->removeWallpaper();
}
开发者ID:0xmono,项目名称:openmw,代码行数:81,代码来源:scene.cpp

示例2: changeCell


//.........这里部分代码省略.........
                continue;
            }
        }
        ++active;
        ++numUnload;
    }

    active = mActiveCells.begin();
    while (active!=mActiveCells.end())
    {
        if ((*active)->getCell()->isExterior())
        {
            if (std::abs (X-(*active)->getCell()->getGridX())<=1 &&
                    std::abs (Y-(*active)->getCell()->getGridY())<=1)
            {
                // keep cells within the new 3x3 grid
                ++active;
                continue;
            }
        }
        unloadCell (active++);
    }

    int refsToLoad = 0;
    // get the number of refs to load
    for (int x=X-1; x<=X+1; ++x)
        for (int y=Y-1; y<=Y+1; ++y)
        {
            CellStoreCollection::iterator iter = mActiveCells.begin();

            while (iter!=mActiveCells.end())
            {
                assert ((*iter)->getCell()->isExterior());

                if (x==(*iter)->getCell()->getGridX() &&
                        y==(*iter)->getCell()->getGridY())
                    break;

                ++iter;
            }

            if (iter==mActiveCells.end())
                refsToLoad += MWBase::Environment::get().getWorld()->getExterior(x, y)->count();
        }

    loadingListener->setProgressRange(refsToLoad);

    // Load cells
    for (int x=X-1; x<=X+1; ++x)
        for (int y=Y-1; y<=Y+1; ++y)
        {
            CellStoreCollection::iterator iter = mActiveCells.begin();

            while (iter!=mActiveCells.end())
            {
                assert ((*iter)->getCell()->isExterior());

                if (x==(*iter)->getCell()->getGridX() &&
                        y==(*iter)->getCell()->getGridY())
                    break;

                ++iter;
            }

            if (iter==mActiveCells.end())
            {
                CellStore *cell = MWBase::Environment::get().getWorld()->getExterior(x, y);

                loadCell (cell, loadingListener);
            }
        }

    // find current cell
    CellStoreCollection::iterator iter = mActiveCells.begin();

    while (iter!=mActiveCells.end())
    {
        assert ((*iter)->getCell()->isExterior());

        if (X==(*iter)->getCell()->getGridX() &&
                Y==(*iter)->getCell()->getGridY())
            break;

        ++iter;
    }

    assert (iter!=mActiveCells.end());

    mCurrentCell = *iter;

    // adjust player
    playerCellChange (mCurrentCell, position, adjustPlayerPos);

    // Sky system
    MWBase::Environment::get().getWorld()->adjustSky();

    mCellChanged = true;

    loadingListener->removeWallpaper();
}
开发者ID:0xmono,项目名称:openmw,代码行数:101,代码来源:scene.cpp


注:本文中的loading::Listener::removeWallpaper方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。