16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-18 04:19:19 +02:00

tmj merge

This commit is contained in:
milek7
2018-01-15 14:08:43 +01:00
32 changed files with 1564 additions and 2294 deletions

View File

@@ -64,6 +64,22 @@ openal_buffer::openal_buffer( std::string const &Filename ) :
if (si.channels != 1)
delete[] buf;
delete[] fbuf;
fetch_caption();
}
// retrieves sound caption in currently set language
void
openal_buffer::fetch_caption() {
std::string captionfilename{ name };
captionfilename.erase(captionfilename.rfind('.')); // obcięcie rozszerzenia
captionfilename += "-" + Global::asLang + ".txt"; // już może być w różnych językach
if (true == FileExists(captionfilename)) {
// wczytanie
std::ifstream inputfile(captionfilename);
caption.assign(std::istreambuf_iterator<char>(inputfile), std::istreambuf_iterator<char>());
}
}
buffer_manager::~buffer_manager() {