Quellcode durchsuchen

fix windows, start XAudio2Renderer in next commit

mikymod vor 12 Jahren
Ursprung
Commit
3f11858bac

+ 0 - 1
engine/CMakeLists.txt

@@ -492,7 +492,6 @@ if (WINDOWS)
 		OpenGL32
 		glew32
 		lua51
-		libogg
 		libvorbis
 		libvorbisfile
 	)

+ 2 - 3
engine/Device.cpp

@@ -26,7 +26,6 @@ OTHER DEALINGS IN THE SOFTWARE.
 */
 
 #include <cstdlib>
-#include <unistd.h>
 
 #include "Config.h"
 #include "Device.h"
@@ -154,7 +153,7 @@ void Device::init()
 	m_sound_renderer->init();
 	Log::d("SoundRenderer created.");
 
-	ResourceId id = m_resource_manager->load("sound", "sounds/mono1");
+/*	ResourceId id = m_resource_manager->load("sound", "sounds/mono1");
 	m_resource_manager->flush();
 
 	SoundResource* res = (SoundResource*)m_resource_manager->data(id);
@@ -162,7 +161,7 @@ void Device::init()
 	SoundId sound = m_sound_renderer->create_sound(res);
 	m_sound_renderer->set_sound_loop(sound, true);
 
-	m_sound_renderer->play_sound(sound);
+	m_sound_renderer->play_sound(sound);*/
 
 	Log::i("Crown Engine initialized.");
 	Log::i("Initializing Game...");

+ 0 - 3
engine/audio/OggDecoder.h

@@ -246,7 +246,4 @@ private:
 	size_t					m_size;
 };
 
-
-
-
 } // namespace crown

+ 1 - 0
engine/audio/SoundRenderer.h

@@ -28,6 +28,7 @@ OTHER DEALINGS IN THE SOFTWARE.
 
 #include "IdTable.h"
 #include "Allocator.h"
+#include "Types.h"
 
 #define	MAX_SOUNDS 64
 

+ 5 - 10
engine/compilers/sound/SoundCompiler.cpp

@@ -27,12 +27,9 @@ OTHER DEALINGS IN THE SOFTWARE.
 #include <stdio.h>
 #include <limits.h>
 #include <errno.h>
-
-#include <ogg/ogg.h>
-#include <vorbis/codec.h>
-#include <vorbis/vorbisenc.h>
 #include <vorbis/vorbisfile.h>
 
+#include "Config.h"
 #include "SoundCompiler.h"
 #include "Allocator.h"
 #include "Filesystem.h"
@@ -44,9 +41,9 @@ namespace crown
 {
 
 //-----------------------------------------------------------------------------
-SoundCompiler::SoundCompiler() :
-	m_sound_data_size(0),
-	m_sound_data(NULL)
+SoundCompiler::SoundCompiler() 
+	: m_sound_data_size(0)
+	, m_sound_data(NULL)
 {
 }
 
@@ -135,8 +132,6 @@ size_t SoundCompiler::compile_if_ogg(Filesystem& fs, const char* resource_path)
 	fs.get_absolute_path(resource_path, s);
 	const char* abs_path = s.c_str();
 
-	Log::i("abs_path = %s", abs_path);
-
 	if ((tmp_file = fopen(abs_path, "rb")) == NULL)
 	{
 		printf("Unable to open file: '%s'\n", resource_path);
@@ -146,7 +141,7 @@ size_t SoundCompiler::compile_if_ogg(Filesystem& fs, const char* resource_path)
 
 	OggVorbis_File ogg_stream;
 
-	bool result = ov_open(tmp_file, &ogg_stream, NULL, 0) == 0;
+	bool result = ov_fopen(os::normalize_path(abs_path), &ogg_stream) == 0;
 
 	if (result == false)
 	{

+ 2 - 2
engine/compilers/sound/SoundCompiler.h

@@ -30,7 +30,7 @@ OTHER DEALINGS IN THE SOFTWARE.
 
 #include "Compiler.h"
 #include "SoundResource.h"
-
+#include "Types.h"
 
 namespace crown
 {
@@ -54,7 +54,7 @@ struct WAVHeader
 };
 
 //-----------------------------------------------------------------------------
-class SoundCompiler : public Compiler
+class CE_EXPORT SoundCompiler : public Compiler
 {
 public: