From 808e533b025bbc65d6d716ff2b3846f9715bf9e0 Mon Sep 17 00:00:00 2001 From: Alex Szpakowski Date: Sun, 28 Sep 2014 14:58:59 -0300 Subject: [PATCH] Tweaked streaming Sources to use fewer OpenAL buffers (and increased the amount of decoded data per buffer to compensate), and removed some unnecessary #include statements. --- src/modules/audio/openal/Audio.h | 1 - src/modules/audio/openal/Pool.h | 1 - src/modules/audio/openal/Source.h | 2 +- src/modules/audio/wrap_Audio.cpp | 3 +++ src/modules/event/sdl/Event.h | 2 +- src/modules/filesystem/physfs/Filesystem.h | 1 - src/modules/graphics/opengl/Graphics.cpp | 3 ++- src/modules/graphics/opengl/Graphics.h | 1 - src/modules/sound/Decoder.h | 2 +- 9 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/modules/audio/openal/Audio.h b/src/modules/audio/openal/Audio.h index 6e5f50696..35fe8afbb 100644 --- a/src/modules/audio/openal/Audio.h +++ b/src/modules/audio/openal/Audio.h @@ -24,7 +24,6 @@ // STD #include #include -#include #include // LOVE diff --git a/src/modules/audio/openal/Pool.h b/src/modules/audio/openal/Pool.h index f0896ea97..8ce7e0483 100644 --- a/src/modules/audio/openal/Pool.h +++ b/src/modules/audio/openal/Pool.h @@ -24,7 +24,6 @@ // STD #include #include -#include #include // LOVE diff --git a/src/modules/audio/openal/Source.h b/src/modules/audio/openal/Source.h index 6c923e3e3..8166e7336 100644 --- a/src/modules/audio/openal/Source.h +++ b/src/modules/audio/openal/Source.h @@ -145,7 +145,7 @@ private: ALuint source; bool valid; - static const unsigned int MAX_BUFFERS = 32; + static const unsigned int MAX_BUFFERS = 8; ALuint streamBuffers[MAX_BUFFERS]; Object::StrongRef staticBuffer; diff --git a/src/modules/audio/wrap_Audio.cpp b/src/modules/audio/wrap_Audio.cpp index c2be44f85..5d33373ec 100644 --- a/src/modules/audio/wrap_Audio.cpp +++ b/src/modules/audio/wrap_Audio.cpp @@ -26,6 +26,9 @@ #include "common/runtime.h" +// C++ +#include + namespace love { namespace audio diff --git a/src/modules/event/sdl/Event.h b/src/modules/event/sdl/Event.h index 1028a7211..e6274a9cc 100644 --- a/src/modules/event/sdl/Event.h +++ b/src/modules/event/sdl/Event.h @@ -27,7 +27,7 @@ #include "common/EnumMap.h" // SDL -#include +#include // STL #include diff --git a/src/modules/filesystem/physfs/Filesystem.h b/src/modules/filesystem/physfs/Filesystem.h index 8c2f96209..483033304 100644 --- a/src/modules/filesystem/physfs/Filesystem.h +++ b/src/modules/filesystem/physfs/Filesystem.h @@ -24,7 +24,6 @@ // STD #include #include -#include #include // LOVE diff --git a/src/modules/graphics/opengl/Graphics.cpp b/src/modules/graphics/opengl/Graphics.cpp index 59c0b0226..a402fd638 100644 --- a/src/modules/graphics/opengl/Graphics.cpp +++ b/src/modules/graphics/opengl/Graphics.cpp @@ -35,6 +35,7 @@ // C #include +#include namespace love { @@ -259,7 +260,7 @@ bool Graphics::setMode(int width, int height, bool &sRGB) // Reload all volatile objects. if (!Volatile::loadAll()) - std::cerr << "Could not reload all volatile objects." << std::endl; + ::printf("Could not reload all volatile objects.\n"); // Restore the graphics state. restoreState(states.back()); diff --git a/src/modules/graphics/opengl/Graphics.h b/src/modules/graphics/opengl/Graphics.h index 811a76d4f..4c1aadb1d 100644 --- a/src/modules/graphics/opengl/Graphics.h +++ b/src/modules/graphics/opengl/Graphics.h @@ -22,7 +22,6 @@ #define LOVE_GRAPHICS_OPENGL_GRAPHICS_H // STD -#include #include #include diff --git a/src/modules/sound/Decoder.h b/src/modules/sound/Decoder.h index 50c522c1b..eede6efcc 100644 --- a/src/modules/sound/Decoder.h +++ b/src/modules/sound/Decoder.h @@ -40,7 +40,7 @@ public: * Indicates how many bytes of raw data should be generated at each * call to Decode. **/ - static const int DEFAULT_BUFFER_SIZE = 2048; + static const int DEFAULT_BUFFER_SIZE = 16384; /** * Indicates the quality of the sound.