Skip to content

Commit

Permalink
Add LoadDummySoundFiles() to Loader
Browse files Browse the repository at this point in the history
  • Loading branch information
falbrechtskirchinger committed Jul 28, 2023
1 parent c1faa91 commit d550d2a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
12 changes: 12 additions & 0 deletions libs/s25main/Loader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include "ogl/glArchivItem_Bitmap_RLE.h"
#include "ogl/glArchivItem_Bitmap_Raw.h"
#include "ogl/glArchivItem_Bob.h"
#include "ogl/glArchivItem_Sound_Wave.h"
#include "ogl/glFont.h"
#include "ogl/glSmartBitmap.h"
#include "ogl/glTexturePacker.h"
Expand Down Expand Up @@ -385,6 +386,17 @@ void Loader::LoadDummyMapFiles()
}
}

void Loader::LoadDummySoundFiles()
{
libsiedler2::Archiv& resource = files_["sound"].archive;
resource.alloc(116);
for(unsigned id = 51; id < resource.size(); id++)
{
auto snd = std::make_unique<glArchivItem_Sound_Wave>();
resource.set(id, std::move(snd));
}
}

namespace {
struct NationResourcesSource
{
Expand Down
1 change: 1 addition & 0 deletions libs/s25main/Loader.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ class Loader
/// Creates archives with empty files for the GUI (for testing purposes)
void LoadDummyGUIFiles();
void LoadDummyMapFiles();
void LoadDummySoundFiles();
/// Load a file and save it into the loader repo
bool Load(const boost::filesystem::path& path, const libsiedler2::ArchivItem_Palette* palette = nullptr);
bool Load(const ResourceId& resId, const libsiedler2::ArchivItem_Palette* palette = nullptr);
Expand Down

0 comments on commit d550d2a

Please sign in to comment.