diff --git a/olcConsoleGameEngine.h b/olcConsoleGameEngine.h index a99b679..7745c3c 100644 --- a/olcConsoleGameEngine.h +++ b/olcConsoleGameEngine.h @@ -4,6 +4,20 @@ OneLoneCoder.com - Command Line Game Engine The Original & Best :P +One Lone Coder License +~~~~~~~~~~~~~~~~~~~~~~ +- This software is Copyright (C) 2018 Javidx9 +- This is free software +- This software comes with absolutely no warranty +- The copyright holder is not liable or responsible for anything + this software does or does not +- You use this software at your own risk +- You can distribute this software +- You can modify this software +- Redistribution of this software or a derivative of this software + must attribute the Copyright holder named above, in a manner + visible to the end user + License ~~~~~~~ One Lone Coder Console Game Engine Copyright (C) 2018 Javidx9 @@ -1091,7 +1105,12 @@ protected: // Audio Engine ===================================================== // Add sample 'id' to the mixers sounds to play list void PlaySample(int id, bool bLoop = false) { - listActiveSamples.push_back({ id, 0, false, bLoop }); + sCurrentlyPlayingSample a; + a.nAudioSampleID = id; + a.nSamplePosition = 0; + a.bFinished = false; + a.bLoop = bLoop; + listActiveSamples.push_back(a); } void StopSample(int id) diff --git a/olcConsoleGameEngineGL.h b/olcConsoleGameEngineGL.h index 4e5275f..dbb6f85 100644 --- a/olcConsoleGameEngineGL.h +++ b/olcConsoleGameEngineGL.h @@ -1802,7 +1802,12 @@ protected: // Add sample 'id' to the mixers sounds to play list void PlaySample(int id, bool bLoop = false) { - listActiveSamples.push_back({ id, 0, false, bLoop }); + sCurrentlyPlayingSample a; + a.nAudioSampleID = id; + a.nSamplePosition = 0; + a.bFinished = false; + a.bLoop = bLoop; + listActiveSamples.push_back(a); } void StopSample(int id) diff --git a/olcConsoleGameEngineGLOOP.cpp b/olcConsoleGameEngineGLOOP.cpp index ba3a71c..0170a3a 100644 --- a/olcConsoleGameEngineGLOOP.cpp +++ b/olcConsoleGameEngineGLOOP.cpp @@ -1413,9 +1413,14 @@ unsigned int olcConsoleGameEngineGLOOP::LoadAudioSample(std::wstring sWavFile) } // Add sample 'id' to the mixers sounds to play list -void olcConsoleGameEngineGLOOP::PlaySample(int id, bool bLoop) +void olcConsoleGameEngineOOP::PlaySample(int id, bool bLoop = false) { - listActiveSamples.push_back({ id, 0, false, bLoop }); + sCurrentlyPlayingSample a; + a.nAudioSampleID = id; + a.nSamplePosition = 0; + a.bFinished = false; + a.bLoop = bLoop; + listActiveSamples.push_back(a); } void olcConsoleGameEngineGLOOP::StopSample(int id) diff --git a/olcConsoleGameEngineOOP.cpp b/olcConsoleGameEngineOOP.cpp index 56d6791..517af4e 100644 --- a/olcConsoleGameEngineOOP.cpp +++ b/olcConsoleGameEngineOOP.cpp @@ -594,9 +594,14 @@ unsigned int olcConsoleGameEngineOOP::LoadAudioSample(std::wstring sWavFile) } // Add sample 'id' to the mixers sounds to play list -void olcConsoleGameEngineOOP::PlaySample(int id, bool bLoop) -{ - listActiveSamples.push_back({ id, 0, false, bLoop }); +void olcConsoleGameEngineOOP::PlaySample(int id, bool bLoop = false) +{ + sCurrentlyPlayingSample a; + a.nAudioSampleID = id; + a.nSamplePosition = 0; + a.bFinished = false; + a.bLoop = bLoop; + listActiveSamples.push_back(a); } void StopSample(int id)