Skip to content

Commit

Permalink
Moved definition of Audio_clip constructor out of line.
Browse files Browse the repository at this point in the history
  • Loading branch information
tov committed Mar 7, 2020
1 parent 46e721e commit 79d9bb5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
6 changes: 1 addition & 5 deletions include/ge211_audio.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

#include "ge211_forward.hxx"
#include "ge211_error.hxx"
#include "ge211_session.hxx"
#include "ge211_time.hxx"
#include "ge211_util.hxx"

Expand Down Expand Up @@ -73,10 +72,7 @@ public:
virtual ~Audio_clip() = default;

protected:
Audio_clip()
{
detail::Session::check_session("Audio loading");
}
Audio_clip();

/// Derived classes must override this to provide an implementation
/// for Audio_clip::try_load(const std::string&, const Mixer&).
Expand Down
7 changes: 6 additions & 1 deletion src/ge211_audio.cxx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "ge211_audio.hxx"
#include "ge211_resource.hxx"
#include "ge211_session.hxx"

#include <SDL.h>
#include <SDL_mixer.h>
Expand All @@ -23,6 +24,11 @@ static inline double volume_to_unit(int int_volume)
return int_volume / double(MIX_MAX_VOLUME);
}

Audio_clip::Audio_clip()
{
Session::check_session("Audio loading");
}

Music_track::Music_track(const std::string& filename, const Mixer& mixer)
{
load(filename, mixer);
Expand Down Expand Up @@ -410,7 +416,6 @@ void Sound_effect_handle::set_volume(double unit_value)
Mix_Volume(ptr_->channel, unit_to_volume(unit_value));
}


} // end namespace audio

} // end namespace ge211

0 comments on commit 79d9bb5

Please sign in to comment.