Skip to content

Commit

Permalink
ApplicationContextBase: changing raw pointer to smart ptr
Browse files Browse the repository at this point in the history
  • Loading branch information
Joilnen committed Jan 12, 2025
1 parent 85921de commit eef18b2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
4 changes: 2 additions & 2 deletions Components/Bites/src/OgreApplicationContextBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ static const char* SHADER_CACHE_FILENAME = "cache.bin";
ApplicationContextBase::ApplicationContextBase(const Ogre::String& appName)
{
mAppName = appName;
mFSLayer = new Ogre::FileSystemLayer(mAppName);
mFSLayer.reset(new Ogre::FileSystemLayer(mAppName));

if (char* val = getenv("OGRE_CONFIG_DIR"))
{
Expand All @@ -53,7 +53,7 @@ ApplicationContextBase::ApplicationContextBase(const Ogre::String& appName)

ApplicationContextBase::~ApplicationContextBase()
{
delete mFSLayer;

}

void ApplicationContextBase::initApp()
Expand Down
17 changes: 8 additions & 9 deletions Tests/VisualTests/Context/src/TestContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ void TestContext::setup()
mWindows.push_back({mWindow});

mWindow->setDeactivateOnFocusChange(false);

locateResources();
initialiseRTShaderSystem();

Expand Down Expand Up @@ -208,7 +208,7 @@ OgreBites::Sample* TestContext::loadTests()
return startSample;
}
else
return 0;
return 0;
}
//-----------------------------------------------------------------------

Expand Down Expand Up @@ -401,11 +401,11 @@ void TestContext::setupDirectories(Ogre::String batchName)
if(mOutputDir.empty())
{
mOutputDir = mFSLayer->getWritablePath("VisualTests/");
static_cast<Ogre::FileSystemLayer*>(mFSLayer)->createDirectory(mOutputDir);
mFSLayer->createDirectory(mOutputDir);

// make sure there's a directory for the test set
mOutputDir += mTestSetName + "/";
static_cast<Ogre::FileSystemLayer*>(mFSLayer)->createDirectory(mOutputDir);
mFSLayer->createDirectory(mOutputDir);

// add a directory for the render system
Ogre::String rsysName = Ogre::Root::getSingleton().getRenderSystem()->getName();
Expand All @@ -414,17 +414,16 @@ void TestContext::setupDirectories(Ogre::String batchName)
if (i != ' ')
mOutputDir += i;
mOutputDir += "/";
static_cast<Ogre::FileSystemLayer*>(mFSLayer)->createDirectory(mOutputDir);
mFSLayer->createDirectory(mOutputDir);
}

if(mSummaryOutputDir != "NONE")
{
static_cast<Ogre::FileSystemLayer*>(mFSLayer)->createDirectory(mSummaryOutputDir);
mFSLayer->createDirectory(mSummaryOutputDir);
}

// and finally a directory for the test batch itself
static_cast<Ogre::FileSystemLayer*>(mFSLayer)->createDirectory(mOutputDir
+ batchName + "/");
mFSLayer->createDirectory(mOutputDir + batchName + "/");
}
//-----------------------------------------------------------------------

Expand All @@ -449,7 +448,7 @@ void TestContext::finishedTests()
// if no luck, just grab the most recent compatible set
foundReference = false;
batches = TestBatch::loadTestBatches(mOutputDir);

TestBatchSet::iterator i;
for (i = batches.begin(); i != batches.end(); ++i)
{
Expand Down

0 comments on commit eef18b2

Please sign in to comment.