disable 360 screenshots in vanity/preview mode

0.6.3
Miloslav Číž 7 years ago
parent 497b33e403
commit 319ed2f9b8

@ -450,7 +450,7 @@ namespace MWBase
/// \todo this does not belong here
virtual void screenshot (osg::Image* image, int w, int h) = 0;
virtual void screenshot360 (osg::Image* image) = 0;
virtual bool screenshot360 (osg::Image* image) = 0;
/// Find default position inside exterior cell specified by name
/// \return false if exterior with given name not exists, true otherwise

@ -1028,10 +1028,9 @@ namespace MWInput
void InputManager::screenshot360()
{
osg::ref_ptr<osg::Image> screenshot (new osg::Image);
MWBase::Environment::get().getWorld()->screenshot360(screenshot.get());
// calling mScreenCaptureHandler->getCaptureOperation() here caused segfault for some reason
if (MWBase::Environment::get().getWorld()->screenshot360(screenshot.get()))
(*mScreenCaptureOperation) (*(screenshot.get()),0);
// calling mScreenCaptureHandler->getCaptureOperation() here caused segfault for some reason
}
void InputManager::toggleInventory()

@ -771,8 +771,11 @@ namespace MWRender
int mSize;
};
void RenderingManager::screenshot360(osg::Image* image)
bool RenderingManager::screenshot360(osg::Image* image)
{
if (mCamera->isVanityOrPreviewModeEnabled())
return false;
int screenshotWidth = Settings::Manager::tryGetInt("s360 width","Video",mViewer->getCamera()->getViewport()->width());
int screenshotHeight = Settings::Manager::tryGetInt("s360 height","Video",mViewer->getCamera()->getViewport()->height());
SphericalScreenshot::SphericalScreenshotMapping mapping = static_cast<SphericalScreenshot::SphericalScreenshotMapping>(
@ -811,6 +814,8 @@ namespace MWRender
mPlayerAnimation->getObjectRoot()->setNodeMask(maskBackup);
mFieldOfView = fovBackup;
return true;
}
void RenderingManager::screenshot(osg::Image *image, int w, int h, osg::Vec3 direction, bool disableWaterEffects)

@ -126,7 +126,7 @@ namespace MWRender
/// Take a screenshot of w*h onto the given image, not including the GUI.
void screenshot(osg::Image* image, int w, int h, osg::Vec3 direction=osg::Vec3(0,0,-1), bool disableWaterEffects=false);
void screenshot360(osg::Image* image);
bool screenshot360(osg::Image* image);
struct RayResult
{

@ -2281,9 +2281,9 @@ namespace MWWorld
mRendering->screenshot(image, w, h);
}
void World::screenshot360 (osg::Image* image)
bool World::screenshot360(osg::Image* image)
{
mRendering->screenshot360(image);
return mRendering->screenshot360(image);
}
void World::activateDoor(const MWWorld::Ptr& door)

@ -560,7 +560,7 @@ namespace MWWorld
/// \todo this does not belong here
void screenshot (osg::Image* image, int w, int h) override;
void screenshot360 (osg::Image* image) override;
bool screenshot360 (osg::Image* image) override;
/// Find center of exterior cell above land surface
/// \return false if exterior with given name not exists, true otherwise

Loading…
Cancel
Save