Skip to content

Commit

Permalink
Merge branch '2.3.x'
Browse files Browse the repository at this point in the history
  • Loading branch information
eXpl0it3r committed Jul 4, 2015
2 parents 80214d1 + b735777 commit 26fc872
Show file tree
Hide file tree
Showing 34 changed files with 518 additions and 300 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/Config.cmake)
# setup version numbers
set(VERSION_MAJOR 2)
set(VERSION_MINOR 3)
set(VERSION_PATCH 0)
set(VERSION_PATCH 1)

# add the SFML header path
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)
Expand Down
36 changes: 36 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,39 @@
SFML 2.3.1
==========

Also available on the website: http://www.sfml-dev.org/changelog.php#sfml-2.3.1

Window
======

Bugfixes
--------
* [Android] Make sure a window still exists before trying to access its dimensions (#854)
* [Android] Added Android API level checks (#856)
* [Android] Updated the JNI/event handling code (#906)
* [Linux] Resized events are only spawned when the window size actually changes (#878, #893)
* [Linux] Whitelisted X SHAPE events (#879, #883)
* [Linux] Remap Unix keyboard when user changes layout (#895, #897)
* [Linux] Fix undefined behavior in ewmhSupported() (#892, #901)


Graphics
========

Bugfixes
--------
* Added support for GL_EXT_texture_edge_clamp for systems that don't expose GL_SGIS_texture_edge_clamp (#880, #882)


Audio
=====

Bugfixes
--------
* [Android] Fixed audio files not loading (and possibly crashing) (#855, #887)



SFML 2.3
========

Expand Down
24 changes: 16 additions & 8 deletions include/SFML/Audio/Music.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ class SFML_AUDIO_API Music : public SoundStream
/// See the documentation of sf::InputSoundFile for the list
/// of supported formats.
///
/// \warning Since the music is not loaded at once but rather
/// streamed continuously, the file must remain accessible until
/// the sf::Music object loads a new music or is destroyed.
///
/// \param filename Path of the music file to open
///
/// \return True if loading succeeded, false if it failed
Expand All @@ -85,10 +89,11 @@ class SFML_AUDIO_API Music : public SoundStream
/// to do so).
/// See the documentation of sf::InputSoundFile for the list
/// of supported formats.
/// Since the music is not loaded completely but rather streamed
/// continuously, the \a data must remain available as long as the
/// music is playing (i.e. you can't deallocate it right after calling
/// this function).
///
/// \warning Since the music is not loaded at once but rather streamed
/// continuously, the \a data buffer must remain accessible until
/// the sf::Music object loads a new music or is destroyed. That is,
/// you can't deallocate the buffer right after calling this function.
///
/// \param data Pointer to the file data in memory
/// \param sizeInBytes Size of the data to load, in bytes
Expand All @@ -107,10 +112,10 @@ class SFML_AUDIO_API Music : public SoundStream
/// to do so).
/// See the documentation of sf::InputSoundFile for the list
/// of supported formats.
/// Since the music is not loaded completely but rather streamed
/// continuously, the \a stream must remain alive as long as the
/// music is playing (i.e. you can't destroy it right after calling
/// this function).
///
/// \warning Since the music is not loaded at once but rather
/// streamed continuously, the \a stream must remain accessible
/// until the sf::Music object loads a new music or is destroyed.
///
/// \param stream Source stream to read from
///
Expand Down Expand Up @@ -184,6 +189,9 @@ class SFML_AUDIO_API Music : public SoundStream
/// musics that usually take hundreds of MB when they are
/// uncompressed: by streaming it instead of loading it entirely,
/// you avoid saturating the memory and have almost no loading delay.
/// This implies that the underlying resource (file, stream or
/// memory buffer) must remain valid for the lifetime of the
/// sf::Music object.
///
/// Apart from that, a sf::Music has almost the same features as
/// the sf::SoundBuffer / sf::Sound pair: you can play/pause/stop
Expand Down
4 changes: 2 additions & 2 deletions include/SFML/Audio/SoundRecorder.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ class SFML_AUDIO_API SoundRecorder : AlResource
/// \param interval Processing interval
///
////////////////////////////////////////////////////////////
void setProcessingInterval(sf::Time interval);
void setProcessingInterval(Time interval);

////////////////////////////////////////////////////////////
/// \brief Start capturing audio data
Expand Down Expand Up @@ -260,7 +260,7 @@ class SFML_AUDIO_API SoundRecorder : AlResource
Thread m_thread; ///< Thread running the background recording task
std::vector<Int16> m_samples; ///< Buffer to store captured samples
unsigned int m_sampleRate; ///< Sample rate
sf::Time m_processingInterval; ///< Time period between calls to onProcessSamples
Time m_processingInterval; ///< Time period between calls to onProcessSamples
bool m_isCapturing; ///< Capturing state
std::string m_deviceName; ///< Name of the audio capture device
};
Expand Down
2 changes: 1 addition & 1 deletion include/SFML/Config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
////////////////////////////////////////////////////////////
#define SFML_VERSION_MAJOR 2
#define SFML_VERSION_MINOR 3
#define SFML_VERSION_PATCH 0
#define SFML_VERSION_PATCH 1


////////////////////////////////////////////////////////////
Expand Down
16 changes: 13 additions & 3 deletions include/SFML/Graphics/Font.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,10 @@ class SFML_GRAPHICS_API Font
/// fonts installed on the user's system, thus you can't
/// load them directly.
///
/// \warning SFML cannot preload all the font data in this
/// function, so the file has to remain accessible until
/// the sf::Font object loads a new font or is destroyed.
///
/// \param filename Path of the font file to load
///
/// \return True if loading succeeded, false if it failed
Expand All @@ -109,9 +113,11 @@ class SFML_GRAPHICS_API Font
///
/// The supported font formats are: TrueType, Type 1, CFF,
/// OpenType, SFNT, X11 PCF, Windows FNT, BDF, PFR and Type 42.
/// Warning: SFML cannot preload all the font data in this
///
/// \warning SFML cannot preload all the font data in this
/// function, so the buffer pointed by \a data has to remain
/// valid as long as the font is used.
/// valid until the sf::Font object loads a new font or
/// is destroyed.
///
/// \param data Pointer to the file data in memory
/// \param sizeInBytes Size of the data to load, in bytes
Expand All @@ -132,6 +138,10 @@ class SFML_GRAPHICS_API Font
/// function, so the contents of \a stream have to remain
/// valid as long as the font is used.
///
/// \warning SFML cannot preload all the font data in this
/// function, so the stream has to remain accessible until
/// the sf::Font object loads a new font or is destroyed.
///
/// \param stream Source stream to read from
///
/// \return True if loading succeeded, false if it failed
Expand Down Expand Up @@ -278,7 +288,7 @@ class SFML_GRAPHICS_API Font
Page();

GlyphTable glyphs; ///< Table mapping code points to their corresponding glyph
sf::Texture texture; ///< Texture containing the pixels of the glyphs
Texture texture; ///< Texture containing the pixels of the glyphs
unsigned int nextRow; ///< Y position of the next new row in the texture
std::vector<Row> rows; ///< List containing the position of all the existing rows
};
Expand Down
2 changes: 1 addition & 1 deletion include/SFML/Graphics/RenderStates.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ class SFML_GRAPHICS_API RenderStates
/// directly without defining render states explicitly -- the
/// default set of states is ok in most cases.
/// \code
/// window.Draw(sprite);
/// window.draw(sprite);
/// \endcode
///
/// If you want to use a single specific render state,
Expand Down
2 changes: 1 addition & 1 deletion include/SFML/Graphics/Shader.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ class SFML_GRAPHICS_API Shader : GlResource, NonCopyable
/// \param transform Transform to assign
///
////////////////////////////////////////////////////////////
void setParameter(const std::string& name, const sf::Transform& transform);
void setParameter(const std::string& name, const Transform& transform);

////////////////////////////////////////////////////////////
/// \brief Change a texture parameter of the shader
Expand Down
2 changes: 1 addition & 1 deletion include/SFML/Graphics/Texture.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ class SFML_GRAPHICS_API Texture : GlResource
/// \see loadFromFile, loadFromMemory, loadFromImage
///
////////////////////////////////////////////////////////////
bool loadFromStream(sf::InputStream& stream, const IntRect& area = IntRect());
bool loadFromStream(InputStream& stream, const IntRect& area = IntRect());

////////////////////////////////////////////////////////////
/// \brief Load the texture from an image
Expand Down
2 changes: 1 addition & 1 deletion include/SFML/System/FileInputStream.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ class SFML_SYSTEM_API FileInputStream : public InputStream, NonCopyable
// Member data
////////////////////////////////////////////////////////////
#ifdef ANDROID
sf::priv::ResourceStream *m_file;
priv::ResourceStream* m_file;
#else
std::FILE* m_file; ///< stdio file stream
#endif
Expand Down
2 changes: 1 addition & 1 deletion include/SFML/Window/Joystick.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class SFML_WINDOW_API Joystick
{
Identification();

sf::String name; ///< Name of the joystick
String name; ///< Name of the joystick
unsigned int vendorId; ///< Manufacturer identifier
unsigned int productId; ///< Product identifier
};
Expand Down
9 changes: 0 additions & 9 deletions src/SFML/Audio/InputSoundFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,7 @@ bool InputSoundFile::openFromFile(const std::string& filename)
// Find a suitable reader for the file type
m_reader = SoundFileFactory::createReaderFromFilename(filename);
if (!m_reader)
{
err() << "Failed to open sound file \"" << filename << "\" (format not supported)" << std::endl;
return false;
}

// Wrap the file into a stream
FileInputStream* file = new FileInputStream;
Expand Down Expand Up @@ -108,10 +105,7 @@ bool InputSoundFile::openFromMemory(const void* data, std::size_t sizeInBytes)
// Find a suitable reader for the file type
m_reader = SoundFileFactory::createReaderFromMemory(data, sizeInBytes);
if (!m_reader)
{
err() << "Failed to open sound file from memory (format not supported)" << std::endl;
return false;
}

// Wrap the memory file into a stream
MemoryInputStream* memory = new MemoryInputStream;
Expand Down Expand Up @@ -147,10 +141,7 @@ bool InputSoundFile::openFromStream(InputStream& stream)
// Find a suitable reader for the file type
m_reader = SoundFileFactory::createReaderFromStream(stream);
if (!m_reader)
{
err() << "Failed to open sound file from stream (format not supported)" << std::endl;
return false;
}

// store the stream
m_stream = &stream;
Expand Down
4 changes: 0 additions & 4 deletions src/SFML/Audio/OutputSoundFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
#include <SFML/Audio/OutputSoundFile.hpp>
#include <SFML/Audio/SoundFileWriter.hpp>
#include <SFML/Audio/SoundFileFactory.hpp>
#include <SFML/System/Err.hpp>


namespace sf
Expand Down Expand Up @@ -57,10 +56,7 @@ bool OutputSoundFile::openFromFile(const std::string& filename, unsigned int sam
// Find a suitable writer for the file type
m_writer = SoundFileFactory::createWriterFromFilename(filename);
if (!m_writer)
{
err() << "Failed to open sound file \"" << filename << "\" (format not supported)" << std::endl;
return false;
}

// Pass the stream to the reader
if (!m_writer->open(filename, sampleRate, channelCount))
Expand Down
9 changes: 8 additions & 1 deletion src/SFML/Audio/SoundFileFactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
#include <SFML/Audio/SoundFileWriterWav.hpp>
#include <SFML/System/FileInputStream.hpp>
#include <SFML/System/MemoryInputStream.hpp>
#include <SFML/System/Err.hpp>


namespace
Expand Down Expand Up @@ -69,8 +70,10 @@ SoundFileReader* SoundFileFactory::createReaderFromFilename(const std::string& f

// Wrap the input file into a file stream
FileInputStream stream;
if (!stream.open(filename))
if (!stream.open(filename)) {
err() << "Failed to open sound file \"" << filename << "\" (couldn't open stream)" << std::endl;
return NULL;
}

// Test the filename in all the registered factories
for (ReaderFactoryArray::const_iterator it = s_readers.begin(); it != s_readers.end(); ++it)
Expand All @@ -81,6 +84,7 @@ SoundFileReader* SoundFileFactory::createReaderFromFilename(const std::string& f
}

// No suitable reader found
err() << "Failed to open sound file \"" << filename << "\" (format not supported)" << std::endl;
return NULL;
}

Expand All @@ -104,6 +108,7 @@ SoundFileReader* SoundFileFactory::createReaderFromMemory(const void* data, std:
}

// No suitable reader found
err() << "Failed to open sound file from memory (format not supported)" << std::endl;
return NULL;
}

Expand All @@ -123,6 +128,7 @@ SoundFileReader* SoundFileFactory::createReaderFromStream(InputStream& stream)
}

// No suitable reader found
err() << "Failed to open sound file from stream (format not supported)" << std::endl;
return NULL;
}

Expand All @@ -141,6 +147,7 @@ SoundFileWriter* SoundFileFactory::createWriterFromFilename(const std::string& f
}

// No suitable writer found
err() << "Failed to open sound file \"" << filename << "\" (format not supported)" << std::endl;
return NULL;
}

Expand Down
4 changes: 2 additions & 2 deletions src/SFML/Audio/SoundRecorder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ std::vector<std::string> SoundRecorder::getAvailableDevices()
{
std::vector<std::string> deviceNameList;

const ALchar *deviceList = alcGetString(NULL, ALC_CAPTURE_DEVICE_SPECIFIER);
const ALchar* deviceList = alcGetString(NULL, ALC_CAPTURE_DEVICE_SPECIFIER);
if (deviceList)
{
while (*deviceList)
Expand Down Expand Up @@ -210,7 +210,7 @@ bool SoundRecorder::isAvailable()


////////////////////////////////////////////////////////////
void SoundRecorder::setProcessingInterval(sf::Time interval)
void SoundRecorder::setProcessingInterval(Time interval)
{
m_processingInterval = interval;
}
Expand Down
4 changes: 4 additions & 0 deletions src/SFML/Graphics/GLExtensions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
// Core since 1.0
#define GLEXT_multitexture true
#define GLEXT_texture_edge_clamp true
#define GLEXT_EXT_texture_edge_clamp true
#define GLEXT_blend_minmax true
#define GLEXT_glClientActiveTexture glClientActiveTexture
#define GLEXT_glActiveTexture glActiveTexture
Expand Down Expand Up @@ -130,6 +131,9 @@
#define GLEXT_texture_edge_clamp sfogl_ext_SGIS_texture_edge_clamp
#define GLEXT_GL_CLAMP_TO_EDGE GL_CLAMP_TO_EDGE_SGIS

// Core since 1.2 - EXT_texture_edge_clamp
#define GLEXT_EXT_texture_edge_clamp sfogl_ext_EXT_texture_edge_clamp

// Core since 1.2 - EXT_blend_minmax
#define GLEXT_blend_minmax sfogl_ext_EXT_blend_minmax
#define GLEXT_glBlendEquation glBlendEquationEXT
Expand Down
1 change: 1 addition & 0 deletions src/SFML/Graphics/GLExtensions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
// lua LoadGen.lua -style=pointer_c -spec=gl -version=1.1 -indent=space -prefix=sf -extfile=GLExtensions.txt GLLoader

SGIS_texture_edge_clamp
//EXT_texture_edge_clamp
EXT_blend_minmax
EXT_blend_subtract
ARB_multitexture
Expand Down
Loading

0 comments on commit 26fc872

Please sign in to comment.