mikymod 12 лет назад
Родитель
Сommit
c07df493e0
2 измененных файлов с 14 добавлено и 2 удалено
  1. 2 2
      engine/resource/Resource.h
  2. 12 0
      engine/resource/SoundResource.h

+ 2 - 2
engine/resource/Resource.h

@@ -39,14 +39,14 @@ const char* const MESH_EXTENSION			= "dae";
 const char* const SCRIPT_EXTENSION			= "lua";
 const char* const TEXT_EXTENSION			= "txt";
 const char* const MATERIAL_EXTENSION		= "material";
-const char* const SOUND_EXTENSION			= "wav";
+const char* const SOUND_EXTENSION			= "sound";
 
 const uint32_t TEXTURE_TYPE					= 0x1410A16A;
 const uint32_t MESH_TYPE					= 0xE8239EEC;
 const uint32_t SCRIPT_TYPE					= 0xD96E7C37;
 const uint32_t TEXT_TYPE					= 0x9000BF0B;
 const uint32_t MATERIAL_TYPE				= 0x46807A92;
-const uint32_t SOUND_TYPE					= 0x8E128AA1;
+const uint32_t SOUND_TYPE					= 0xD196AB6E;
 
 /// ResourceId uniquely identifies a resource by its name and type.
 /// In order to speed up the lookup by the manager, it also keeps

+ 12 - 0
engine/resource/SoundResource.h

@@ -32,8 +32,17 @@ OTHER DEALINGS IN THE SOFTWARE.
 namespace crown
 {
 
+//-----------------------------------------------------------------------------
+enum SoundType
+{
+	ST_WAV = 0,
+	ST_MIDI,
+	ST_OGG
+};
+
 const uint32_t SOUND_VERSION = 1;
 
+//-----------------------------------------------------------------------------
 struct SoundHeader
 {
 	uint32_t	version;	// Sound file version
@@ -41,11 +50,13 @@ struct SoundHeader
 	uint32_t	sample_rate;
 	uint32_t	channels;
 	uint32_t 	bits_per_sample;
+	uint8_t		sound_type;
 };
 
 class Bundle;
 class Allocator;
 
+//-----------------------------------------------------------------------------
 class SoundResource
 {
 public:
@@ -61,6 +72,7 @@ public:
 	uint32_t			sample_rate() const { return m_header.sample_rate; }
 	uint32_t			channels() const { return m_header.channels; }
 	uint32_t			bits_per_sample() const { return m_header.bits_per_sample; }
+	uint8_t				sound_type() const { return m_header.sound_type; }
 	const uint8_t*		data() const { return m_data; }
 
 private: