blob: 63d8cc6ca5558409df660fec06fa99b73a8f0360 (
plain)
ofs | hex dump | ascii |
---|
0000 | 89 50 4e 47 0d 0a 1a 0a 00 00 00 0d 49 48 44 52 00 00 01 5e 00 00 00 c5 08 06 00 00 00 1c fd 9a | .PNG........IHDR...^............ |
0020 | 2e 00 00 00 04 73 42 49 54 08 08 08 08 7c 08 64 88 00 00 1a 97 49 44 41 54 78 9c ed dd 7b 6c 5b | .....sBIT....|.d.....IDATx...{l[ |
0040 | d7 7d 07 f0 2f 49 f1 4d 49 a4 de b4 6c eb e1 f8 15 c7 76 92 2a 4b a3 36 2d da 02 fd 63 e8 86 a1 | .}../I.MI...l.....v.*K.6-...c... |
0060 | eb d6 02 6d 0a 14 2d 8a c2 46 8b 6e cb da a1 4f 2c e9 33 43 37 60 98 9d a2 58 b1 47 b7 01 1b b6 | ...m..-..F.n...O,.3C7`...X.G.... |
0080 | e5 af a1 43 ff 69 8b b6 09 d2 c4 76 9c f8 21 39 8b 25 d9 7a 50 6f be 79 f9 ba dc 1f f7 9e c3 7b | ...C.i.....v..!9.%
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#pragma once
#include <set>
#include <string>
#include "util/serialize.h"
#include "irrlichttypes_bloated.h"
struct SimpleSoundSpec
{
SimpleSoundSpec(const std::string &name = "", float gain = 1.0f,
float fade = 0.0f, float pitch = 1.0f) :
name(name),
gain(gain), fade(fade), pitch(pitch)
{
}
bool exists() const { return !name.empty(); }
// Take cf_version from ContentFeatures::serialize to
// keep in sync with item definitions
void serialize(std::ostream &os, u8 cf_version) const
{
os << serializeString(name);
writeF32(os, gain);
writeF32(os, pitch);
writeF32(os, fade);
// if (cf_version < ?)
// return;
}
void deSerialize(std::istream &is, u8 cf_version)
{
name = deSerializeString(is);
gain = readF32(is);
pitch = readF32(is);
fade = readF32(is);
}
std::string name;
float gain = 1.0f;
float fade = 0.0f;
float pitch = 1.0f;
};
|