Cleaning out some old bits

This commit is contained in:
scrawl 2013-02-13 18:39:36 +01:00
parent de90b911c9
commit 6a49ea9b4f
9 changed files with 16 additions and 70 deletions

View file

@ -39,9 +39,6 @@ namespace MWBase
virtual int getNumActions() = 0;
virtual void enableDetectingBindingMode (int action) = 0;
virtual void resetToDefaultBindings() = 0;
virtual void create () = 0;
virtual void destroy () = 0;
};
}

View file

@ -370,6 +370,12 @@ namespace MWGui
apply();
}
}
else if (_sender == mVSyncButton)
{
Settings::Manager::setBool("vsync", "Video", newState);
MWBase::Environment::get().getWindowManager()->
messageBox("VSync will be applied after a restart", std::vector<std::string>());
}
else
{
if (_sender == mVSyncButton)

View file

@ -53,14 +53,6 @@ namespace MWInput
, mUIYMultiplier (Settings::Manager::getFloat("ui y multiplier", "Input"))
, mPreviewPOVDelay(0.f)
, mTimeIdle(0.f)
{
create();
changeInputMode(false);
}
void InputManager::create()
{
Ogre::RenderWindow* window = mOgre.getWindow ();
size_t windowHnd;
@ -139,9 +131,11 @@ namespace MWInput
mControlSwitch["playermagic"] = true;
mControlSwitch["playerviewswitch"] = true;
mControlSwitch["vanitymode"] = true;
changeInputMode(false);
}
void InputManager::destroy()
InputManager::~InputManager()
{
mInputCtrl->save (mUserFile);
@ -152,11 +146,6 @@ namespace MWInput
OIS::InputManager::destroyInputSystem(mInputManager);
}
InputManager::~InputManager()
{
destroy();
}
void InputManager::channelChanged(ICS::Channel* channel, float currentValue, float previousValue)
{
if (mDragDrop)

View file

@ -153,10 +153,6 @@ namespace MWInput
std::map<std::string, bool> mControlSwitch;
public:
virtual void create();
virtual void destroy();
private:
void adjustMouseRegion(int width, int height);

View file

@ -31,6 +31,7 @@ namespace MWRender
vp->setShadowsEnabled(false);
vp->setVisibilityMask(RV_Actors + RV_Misc + RV_Statics + RV_StaticsSmall + RV_Terrain + RV_Sky);
vp->setMaterialScheme("water_reflection");
vp->setBackgroundColour (Ogre::ColourValue(0.0078, 0.0576, 0.150));
mRenderTarget->setAutoUpdated(true);
mRenderTarget->addListener(this);
}
@ -66,11 +67,6 @@ namespace MWRender
mNearClipPlaneUnderwater = Ogre::Plane( Ogre::Vector3(0,1,0), height - 5);
}
void Refraction::setViewportBackground (Ogre::ColourValue colour)
{
mRenderTarget->getViewport (0)->setBackgroundColour (colour);
}
void Refraction::renderQueueStarted (Ogre::uint8 queueGroupId, const Ogre::String &invocation, bool &skipThisInvocation)
{
// We don't want the sky to get clipped by custom near clip plane (the water plane)

View file

@ -24,7 +24,6 @@ namespace MWRender
void setHeight (float height);
void preRenderTargetUpdate(const Ogre::RenderTargetEvent& evt);
void postRenderTargetUpdate(const Ogre::RenderTargetEvent& evt);
void setViewportBackground(Ogre::ColourValue colour);
void setUnderwater(bool underwater) {mIsUnderwater = underwater;}
void renderQueueStarted (Ogre::uint8 queueGroupId, const Ogre::String &invocation, bool &skipThisInvocation);

View file

@ -46,8 +46,12 @@ namespace MWRender {
RenderingManager::RenderingManager (OEngine::Render::OgreRenderer& _rend, const boost::filesystem::path& resDir,
const boost::filesystem::path& cacheDir, OEngine::Physic::PhysicEngine* engine)
: mRendering(_rend), mObjects(mRendering), mActors(mRendering), mAmbientMode(0), mSunEnabled(0), mPhysicsEngine(engine),
mRecreateWindowInNextFrame(false)
: mRendering(_rend)
, mObjects(mRendering)
, mActors(mRendering)
, mAmbientMode(0)
, mSunEnabled(0)
, mPhysicsEngine(engine)
{
// select best shader mode
bool openGL = (Ogre::Root::getSingleton ().getRenderSystem ()->getName().find("OpenGL") != std::string::npos);
@ -324,33 +328,6 @@ RenderingManager::moveObjectToCell(
void RenderingManager::update (float duration, bool paused)
{
if (mRecreateWindowInNextFrame)
{
mRecreateWindowInNextFrame = false;
mRendering.removeWindowEventListener(this);
mRendering.getWindow()->removeListener(this);
MWBase::Environment::get().getInputManager()->destroy();
OEngine::Render::WindowSettings windowSettings;
windowSettings.fullscreen = Settings::Manager::getBool("fullscreen", "Video");
windowSettings.window_x = Settings::Manager::getInt("resolution x", "Video");
windowSettings.window_y = Settings::Manager::getInt("resolution y", "Video");
windowSettings.vsync = Settings::Manager::getBool("vsync", "Video");
std::string aa = Settings::Manager::getString("antialiasing", "Video");
windowSettings.fsaa = (aa.substr(0, 4) == "MSAA") ? aa.substr(5, aa.size()-5) : "0";
mRendering.recreateWindow("OpenMW", windowSettings);
MWBase::Environment::get().getInputManager()->create();
mRendering.setWindowEventListener (this);
mRendering.getWindow()->addListener(this);
// this is necessary, otherwise it would just endlessly wait for the last query and it would never return
delete mOcclusionQuery;
mOcclusionQuery = new OcclusionQuery(&mRendering, mSkyManager->getSunNode());
}
Ogre::Vector3 orig, dest;
mPlayer->setCameraDistance();
if (!mPlayer->getPosition(orig, dest)) {
@ -784,7 +761,6 @@ Compositors* RenderingManager::getCompositors()
void RenderingManager::processChangedSettings(const Settings::CategorySettingVector& settings)
{
bool changeRes = false;
bool recreateWindow = false;
bool rebuild = false; // rebuild static geometry (necessary after any material changes)
for (Settings::CategorySettingVector::const_iterator it=settings.begin();
it != settings.end(); ++it)
@ -803,8 +779,6 @@ void RenderingManager::processChangedSettings(const Settings::CategorySettingVec
|| it->second == "resolution y"
|| it->second == "fullscreen"))
changeRes = true;
else if (it->first == "Video" && it->second == "vsync")
recreateWindow = true;
else if (it->second == "field of view" && it->first == "General")
mRendering.setFov(Settings::Manager::getFloat("field of view", "General"));
else if ((it->second == "texture filtering" && it->first == "General")
@ -876,13 +850,6 @@ void RenderingManager::processChangedSettings(const Settings::CategorySettingVec
mRendering.getWindow()->setFullscreen(Settings::Manager::getBool("fullscreen", "Video"), x, y);
}
if (recreateWindow)
{
mRecreateWindowInNextFrame = true;
// We can not do this now, because this might get triggered from the input listener
// and destroying/recreating the input system at that point would cause a crash
}
if (mWater)
mWater->processChangedSettings(settings);

View file

@ -260,8 +260,6 @@ class RenderingManager: private RenderingInterface, public Ogre::WindowEventList
MWRender::Compositors* mCompositors;
VideoPlayer* mVideoPlayer;
bool mRecreateWindowInNextFrame;
};
}

View file

@ -380,8 +380,6 @@ void Water::setViewportBackground(const ColourValue& bg)
{
if (mReflection)
mReflection->setViewportBackground(bg);
if (mRefraction)
mRefraction->setViewportBackground(bg);
}
void Water::updateVisible()