Skip to content

Commit

Permalink
Hlms::reloadFrom now includes datablock custom pieces
Browse files Browse the repository at this point in the history
Only those that are loaded from files can be refreshed
  • Loading branch information
darksylinc committed Aug 19, 2024
1 parent b392249 commit 4051467
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions OgreMain/src/OgreHlms.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1876,6 +1876,18 @@ namespace Ogre

mDataFolder = newDataFolder;
enumeratePieceFiles();

// Reload datablock pieces (those that can be reloaded from disk).
for( auto &itor : mDatablockCustomPieceFiles )
{
DatablockCustomPieceFile &datablockCustomPiece = itor.second;
if( datablockCustomPiece.isCacheable() )
{
const DataStreamPtr stream = ResourceGroupManager::getSingleton().openResource(
datablockCustomPiece.filename, datablockCustomPiece.resourceGroup );
datablockCustomPiece.sourceCode = stream->getAsString();
}
}
}
//-----------------------------------------------------------------------------------
ArchiveVec Hlms::getPiecesLibraryAsArchiveVec() const
Expand Down

0 comments on commit 4051467

Please sign in to comment.