Skip to content

Commit

Permalink
Implement stop_looping_sounds / play_looping_sounds in AmbientSound
Browse files Browse the repository at this point in the history
  • Loading branch information
tobbi committed Jul 24, 2023
1 parent 17be3f4 commit 81172c3
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/object/ambient_sound.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -258,4 +258,16 @@ AmbientSound::draw(DrawingContext& context)
}
}

void
AmbientSound::stop_looping_sounds()
{
stop_playing();
}

void
AmbientSound::play_looping_sounds()
{
start_playing();
}

/* EOF */
3 changes: 3 additions & 0 deletions src/object/ambient_sound.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ class AmbientSound final : public MovingObject,

virtual int get_layer() const override { return LAYER_OBJECTS; }

virtual void stop_looping_sounds() override;
virtual void play_looping_sounds() override;

protected:
virtual void update(float dt_sec) override;
virtual void start_playing();
Expand Down

0 comments on commit 81172c3

Please sign in to comment.