Skip to content

Commit

Permalink
#5911: Minor simplification.
Browse files Browse the repository at this point in the history
Try to fix gcc compilation.
  • Loading branch information
codereader committed Mar 2, 2022
1 parent 9891ae9 commit 6cd041f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
3 changes: 2 additions & 1 deletion libs/parser/ThreadedDeclParser.h
Expand Up @@ -5,6 +5,7 @@
#include "idecltypes.h"
#include "ThreadedDefLoader.h"
#include "debugging/ScopedDebugTimer.h"
#include "parser/ParseException.h"

namespace parser
{
Expand All @@ -18,7 +19,7 @@ class ThreadedDeclParser :
public util::ThreadedDefLoader<ReturnType>
{
public:
using LoadFunction = util::ThreadedDefLoader<ReturnType>::LoadFunction;
using LoadFunction = util::ThreadedDefLoader<typename ReturnType>::LoadFunction;

private:
decl::Type _declType;
Expand Down
14 changes: 7 additions & 7 deletions plugins/sound/SoundFileLoader.h
Expand Up @@ -28,22 +28,22 @@ using ShaderMap = std::map<std::string, SoundShader::Ptr>;
* Threaded parser class loading the sndshd files
*/
class SoundFileLoader final :
public parser::ThreadedDeclParser<std::shared_ptr<ShaderMap>>
public parser::ThreadedDeclParser<ShaderMap>
{
private:
// Shader map to populate
std::shared_ptr<ShaderMap> _shaders;
ShaderMap _shaders;

public:
SoundFileLoader() :
parser::ThreadedDeclParser<std::shared_ptr<ShaderMap>>(
parser::ThreadedDeclParser<ShaderMap>(
decl::Type::SoundShader, SOUND_FOLDER, SOUND_FILE_EXTENSION, 99)
{}

protected:
void onBeginParsing() override
{
_shaders = std::make_shared<ShaderMap>();
_shaders.clear();
}

void parse(std::istream& stream, const vfs::FileInfo& fileInfo, const std::string& modDir) override
Expand All @@ -57,7 +57,7 @@ class SoundFileLoader final :
parser::BlockTokeniser::Block block = tok.nextBlock();

// Create a new shader with this name
auto result = _shaders->emplace(block.name,
auto result = _shaders.emplace(block.name,
std::make_shared<SoundShader>(block.name, block.contents, fileInfo, modDir)
);

Expand All @@ -69,9 +69,9 @@ class SoundFileLoader final :
}
}

std::shared_ptr<ShaderMap> onFinishParsing() override
ShaderMap onFinishParsing() override
{
rMessage() << _shaders->size() << " sound shaders found." << std::endl;
rMessage() << _shaders.size() << " sound shaders found." << std::endl;

return std::move(_shaders);
}
Expand Down
2 changes: 1 addition & 1 deletion plugins/sound/SoundManager.cpp
Expand Up @@ -140,7 +140,7 @@ void SoundManager::ensureShadersLoaded()
{
if (_shaders.empty())
{
_shaders = std::move(*_defLoader.get());
_shaders = _defLoader.get();
}
}

Expand Down

0 comments on commit 6cd041f

Please sign in to comment.