forked from teamnwah/openmw-tes3coop
added bright lighting mode
This commit is contained in:
parent
9746f8bd32
commit
ed524b2fd4
5 changed files with 66 additions and 1 deletions
|
@ -70,6 +70,7 @@ opencs_units (view/render
|
||||||
|
|
||||||
opencs_units_noqt (view/render
|
opencs_units_noqt (view/render
|
||||||
navigation navigation1st navigationfree navigationorbit lighting lightingday lightingnight
|
navigation navigation1st navigationfree navigationorbit lighting lightingday lightingnight
|
||||||
|
lightingbright
|
||||||
)
|
)
|
||||||
|
|
||||||
opencs_units_noqt (view/world
|
opencs_units_noqt (view/world
|
||||||
|
|
30
apps/opencs/view/render/lightingbright.cpp
Normal file
30
apps/opencs/view/render/lightingbright.cpp
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
|
||||||
|
#include "lightingbright.hpp"
|
||||||
|
|
||||||
|
#include <OgreSceneManager.h>
|
||||||
|
|
||||||
|
CSVRender::LightingBright::LightingBright() : mSceneManager (0), mLight (0) {}
|
||||||
|
|
||||||
|
void CSVRender::LightingBright::activate (Ogre::SceneManager *sceneManager,
|
||||||
|
const Ogre::ColourValue *defaultAmbient)
|
||||||
|
{
|
||||||
|
mSceneManager = sceneManager;
|
||||||
|
|
||||||
|
mSceneManager->setAmbientLight (Ogre::ColourValue (1.0, 1.0, 1.0, 1));
|
||||||
|
|
||||||
|
mLight = mSceneManager->createLight();
|
||||||
|
mLight->setType (Ogre::Light::LT_DIRECTIONAL);
|
||||||
|
mLight->setDirection (Ogre::Vector3 (0, 0, -1));
|
||||||
|
mLight->setDiffuseColour (Ogre::ColourValue (1.0, 1.0, 1.0));
|
||||||
|
}
|
||||||
|
|
||||||
|
void CSVRender::LightingBright::deactivate()
|
||||||
|
{
|
||||||
|
if (mLight)
|
||||||
|
{
|
||||||
|
mSceneManager->destroyLight (mLight);
|
||||||
|
mLight = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void CSVRender::LightingBright::setDefaultAmbient (const Ogre::ColourValue& colour) {}
|
31
apps/opencs/view/render/lightingbright.hpp
Normal file
31
apps/opencs/view/render/lightingbright.hpp
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
#ifndef OPENCS_VIEW_LIGHTING_BRIGHT_H
|
||||||
|
#define OPENCS_VIEW_LIGHTING_BRIGHT_H
|
||||||
|
|
||||||
|
#include "lighting.hpp"
|
||||||
|
|
||||||
|
namespace Ogre
|
||||||
|
{
|
||||||
|
class Light;
|
||||||
|
}
|
||||||
|
|
||||||
|
namespace CSVRender
|
||||||
|
{
|
||||||
|
class LightingBright : public Lighting
|
||||||
|
{
|
||||||
|
Ogre::SceneManager *mSceneManager;
|
||||||
|
Ogre::Light *mLight;
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
LightingBright();
|
||||||
|
|
||||||
|
virtual void activate (Ogre::SceneManager *sceneManager,
|
||||||
|
const Ogre::ColourValue *defaultAmbient = 0);
|
||||||
|
|
||||||
|
virtual void deactivate();
|
||||||
|
|
||||||
|
virtual void setDefaultAmbient (const Ogre::ColourValue& colour);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
|
@ -347,6 +347,7 @@ namespace CSVRender
|
||||||
setLighting (&mLightingDay);
|
setLighting (&mLightingDay);
|
||||||
else if (mode=="night")
|
else if (mode=="night")
|
||||||
setLighting (&mLightingNight);
|
setLighting (&mLightingNight);
|
||||||
|
else if (mode=="bright")
|
||||||
|
setLighting (&mLightingBright);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
|
|
||||||
#include "lightingday.hpp"
|
#include "lightingday.hpp"
|
||||||
#include "lightingnight.hpp"
|
#include "lightingnight.hpp"
|
||||||
|
#include "lightingbright.hpp"
|
||||||
|
|
||||||
namespace Ogre
|
namespace Ogre
|
||||||
{
|
{
|
||||||
|
@ -101,6 +102,7 @@ namespace CSVRender
|
||||||
bool mHasDefaultAmbient;
|
bool mHasDefaultAmbient;
|
||||||
LightingDay mLightingDay;
|
LightingDay mLightingDay;
|
||||||
LightingNight mLightingNight;
|
LightingNight mLightingNight;
|
||||||
|
LightingBright mLightingBright;
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue