From cef2952156ab09371ed04beec00d0f1e8615ada9 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 18 Apr 2013 01:32:58 +0300 Subject: add support for using sound delays. hurt sounds now can be delayed for "delay" of hit sound. --- src/being.h | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'src/being.h') diff --git a/src/being.h b/src/being.h index c1adbbbcb..8a07330f5 100644 --- a/src/being.h +++ b/src/being.h @@ -72,6 +72,22 @@ enum Gender }; +struct NextSoundInfo +{ + NextSoundInfo() : + sound(nullptr), + x(0), + y(0), + time(0) + { + } + + const SoundInfo *sound; + int x; + int y; + int time; +}; + class BeingEquipBackend final : public Equipment::Backend { public: @@ -878,12 +894,15 @@ class Being : public ActorSprite, public ConfigListener void setOwner(Being *const owner) { mOwner = owner; } - void playSfx(const SoundInfo &sound, const int x, const int y); + void playSfx(const SoundInfo &sound, Being *const being, + const bool main, const int x, const int y); static uint8_t genderToInt(const Gender sex) A_WARN_UNUSED; static Gender intToGender(uint8_t sex) A_WARN_UNUSED; + NextSoundInfo mNextSound; + protected: /** * Sets the new path for this being. -- cgit v1.2.3-60-g2f50