From 5ee3d1698fd10584b07213f74c0a2a97b0fb06a9 Mon Sep 17 00:00:00 2001 From: scrawl Date: Fri, 5 Feb 2016 23:05:37 +0100 Subject: [PATCH] Remove getWarningTexture in favor of getWarningImage --- apps/openmw/mwrender/sky.cpp | 2 +- components/resource/imagemanager.cpp | 14 +++++--------- components/resource/imagemanager.hpp | 3 +-- 3 files changed, 7 insertions(+), 12 deletions(-) diff --git a/apps/openmw/mwrender/sky.cpp b/apps/openmw/mwrender/sky.cpp index 0f70e2c02..69fbb2379 100644 --- a/apps/openmw/mwrender/sky.cpp +++ b/apps/openmw/mwrender/sky.cpp @@ -137,7 +137,7 @@ public: AtmosphereNightUpdater(Resource::ImageManager* textureManager) { // we just need a texture, its contents don't really matter - mTexture = textureManager->getWarningTexture(); + mTexture = new osg::Texture2D(textureManager->getWarningImage()); } void setFade(const float fade) diff --git a/components/resource/imagemanager.cpp b/components/resource/imagemanager.cpp index 8b14e7237..e1c0572c7 100644 --- a/components/resource/imagemanager.cpp +++ b/components/resource/imagemanager.cpp @@ -17,7 +17,7 @@ USE_OSGPLUGIN(jpeg) namespace { - osg::ref_ptr createWarningTexture() + osg::ref_ptr createWarningImage() { osg::ref_ptr warningImage = new osg::Image; @@ -31,10 +31,7 @@ namespace data[3*i+1] = (0); data[3*i+2] = (255); } - - osg::ref_ptr warningTexture = new osg::Texture2D; - warningTexture->setImage(warningImage); - return warningTexture; + return warningImage; } } @@ -44,8 +41,7 @@ namespace Resource ImageManager::ImageManager(const VFS::Manager *vfs) : mVFS(vfs) - , mWarningTexture(createWarningTexture()) - , mWarningImage(mWarningTexture->getImage()) + , mWarningImage(createWarningImage()) , mOptions(new osgDB::Options("dds_flip dds_dxt1_detect_rgba")) { } @@ -137,9 +133,9 @@ namespace Resource } } - osg::Texture2D* ImageManager::getWarningTexture() + osg::Image *ImageManager::getWarningImage() { - return mWarningTexture.get(); + return mWarningImage; } } diff --git a/components/resource/imagemanager.hpp b/components/resource/imagemanager.hpp index 14d0b673e..ee0c0f2e2 100644 --- a/components/resource/imagemanager.hpp +++ b/components/resource/imagemanager.hpp @@ -39,7 +39,7 @@ namespace Resource const VFS::Manager* getVFS() { return mVFS; } - osg::Texture2D* getWarningTexture(); + osg::Image* getWarningImage(); private: const VFS::Manager* mVFS; @@ -47,7 +47,6 @@ namespace Resource // TODO: use ObjectCache std::map > mImages; - osg::ref_ptr mWarningTexture; osg::ref_ptr mWarningImage; osg::ref_ptr mOptions;