1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-27 12:35:46 +00:00

visibility fixes

This commit is contained in:
scrawl 2012-02-24 18:47:09 +01:00
parent 67c7b965f0
commit 9560904d8a

View File

@ -274,7 +274,8 @@ void SkyManager::ModVertexAlpha(Entity* ent, unsigned int meshType)
ent->getMesh()->getSubMesh(0)->vertexData->vertexBufferBinding->getBuffer(ves_diffuse->getSource())->unlock(); ent->getMesh()->getSubMesh(0)->vertexData->vertexBufferBinding->getBuffer(ves_diffuse->getSource())->unlock();
} }
SkyManager::SkyManager (SceneNode* pMwRoot, Camera* pCamera) SkyManager::SkyManager (SceneNode* pMwRoot, Camera* pCamera) :
mGlareEnabled(false)
{ {
mViewport = pCamera->getViewport(); mViewport = pCamera->getViewport();
mSceneMgr = pMwRoot->getCreator(); mSceneMgr = pMwRoot->getCreator();
@ -445,12 +446,18 @@ void SkyManager::update(float duration)
{ {
// UV Scroll the clouds // UV Scroll the clouds
mCloudMaterial->getTechnique(0)->getPass(0)->getFragmentProgramParameters()->setNamedConstantFromTime("time", 1); mCloudMaterial->getTechnique(0)->getPass(0)->getFragmentProgramParameters()->setNamedConstantFromTime("time", 1);
mSunGlare->setVisible(mGlareEnabled && mSunEnabled && mEnabled);
mSun->setVisible(mSunEnabled && mEnabled);
} }
void SkyManager::enable() void SkyManager::enable()
{ {
mRootNode->setVisible(true); mRootNode->setVisible(true);
mEnabled = true; mEnabled = true;
mSunGlare->setVisible(mGlareEnabled && mSunEnabled && mEnabled);
mSun->setVisible(mSunEnabled && mEnabled);
} }
void SkyManager::disable() void SkyManager::disable()
@ -530,15 +537,11 @@ Vector3 SkyManager::getRealSunPos()
void SkyManager::sunEnable() void SkyManager::sunEnable()
{ {
mSun->setVisible(true);
mSunGlare->setVisible(mGlareEnabled);
mSunEnabled = true; mSunEnabled = true;
} }
void SkyManager::sunDisable() void SkyManager::sunDisable()
{ {
mSun->setVisible(false);
mSunGlare->setVisible(false);
mSunEnabled = false; mSunEnabled = false;
} }