Browse Source

Merge branch 'master' into compatibility

Conflicts:
	CMakeLists.txt
Vladimír Vondruš 13 years ago
parent
commit
83f348256e
  1. 1
      CMakeLists.txt
  2. 5
      Doxyfile
  3. 2
      src/Audio/AbstractImporter.cpp
  4. 2
      src/Audio/AbstractImporter.h
  5. 10
      src/Platform/NaClApplication.h
  6. 7
      src/Platform/Sdl2Application.cpp
  7. 17
      src/Platform/Sdl2Application.h
  8. 2
      src/Plugins/MagnumFont/MagnumFont.cpp
  9. 2
      src/Plugins/MagnumFont/MagnumFont.h
  10. 2
      src/Plugins/MagnumFontConverter/MagnumFontConverter.cpp
  11. 2
      src/Plugins/MagnumFontConverter/MagnumFontConverter.h
  12. 2
      src/Plugins/TgaImageConverter/TgaImageConverter.cpp
  13. 2
      src/Plugins/TgaImageConverter/TgaImageConverter.h
  14. 2
      src/Plugins/TgaImporter/TgaImporter.cpp
  15. 2
      src/Plugins/TgaImporter/TgaImporter.h
  16. 2
      src/Plugins/WavAudioImporter/WavImporter.cpp
  17. 2
      src/Plugins/WavAudioImporter/WavImporter.h
  18. 3
      src/Shaders/Flat.h
  19. 9
      src/Shaders/Vector.h
  20. 2
      src/Text/AbstractFont.cpp
  21. 2
      src/Text/AbstractFont.h
  22. 2
      src/Text/AbstractFontConverter.cpp
  23. 2
      src/Text/AbstractFontConverter.h
  24. 2
      src/Trade/AbstractImageConverter.cpp
  25. 2
      src/Trade/AbstractImageConverter.h
  26. 2
      src/Trade/AbstractImporter.cpp
  27. 2
      src/Trade/AbstractImporter.h
  28. 2
      toolchains

1
CMakeLists.txt

@ -22,7 +22,6 @@
# DEALINGS IN THE SOFTWARE. # DEALINGS IN THE SOFTWARE.
# #
# CMake 2.8.8 required for OBJECT library target
cmake_minimum_required(VERSION 2.8) cmake_minimum_required(VERSION 2.8)
project(Magnum) project(Magnum)

5
Doxyfile

@ -1611,7 +1611,7 @@ ENABLE_PREPROCESSING = YES
# compilation will be performed. Macro expansion can be done in a controlled # compilation will be performed. Macro expansion can be done in a controlled
# way by setting EXPAND_ONLY_PREDEF to YES. # way by setting EXPAND_ONLY_PREDEF to YES.
MACRO_EXPANSION = NO MACRO_EXPANSION = YES
# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES # If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES
# then the macro expansion is limited to the macros specified with the # then the macro expansion is limited to the macros specified with the
@ -1645,7 +1645,8 @@ INCLUDE_FILE_PATTERNS =
# undefined via #undef or recursively expanded use the := operator # undefined via #undef or recursively expanded use the := operator
# instead of the = operator. # instead of the = operator.
PREDEFINED = DOXYGEN_GENERATING_OUTPUT MAGNUM_BUILD_DEPRECATED PREDEFINED = DOXYGEN_GENERATING_OUTPUT \
MAGNUM_BUILD_DEPRECATED CORRADE_DEPRECATED(message)=
# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
# this tag can be used to specify a list of macro names that should be expanded. # this tag can be used to specify a list of macro names that should be expanded.

2
src/Audio/AbstractImporter.cpp

@ -32,7 +32,7 @@ namespace Magnum { namespace Audio {
AbstractImporter::AbstractImporter() = default; AbstractImporter::AbstractImporter() = default;
AbstractImporter::AbstractImporter(PluginManager::AbstractManager* manager, std::string plugin): PluginManager::AbstractPlugin(manager, std::move(plugin)) {} AbstractImporter::AbstractImporter(PluginManager::AbstractManager& manager, std::string plugin): PluginManager::AbstractPlugin(manager, std::move(plugin)) {}
bool AbstractImporter::openData(Containers::ArrayReference<const unsigned char> data) { bool AbstractImporter::openData(Containers::ArrayReference<const unsigned char> data) {
CORRADE_ASSERT(features() & Feature::OpenData, CORRADE_ASSERT(features() & Feature::OpenData,

2
src/Audio/AbstractImporter.h

@ -83,7 +83,7 @@ class MAGNUM_AUDIO_EXPORT AbstractImporter: public PluginManager::AbstractPlugin
explicit AbstractImporter(); explicit AbstractImporter();
/** @brief Plugin manager constructor */ /** @brief Plugin manager constructor */
explicit AbstractImporter(PluginManager::AbstractManager* manager, std::string plugin); explicit AbstractImporter(PluginManager::AbstractManager& manager, std::string plugin);
/** @brief Features supported by this importer */ /** @brief Features supported by this importer */
Features features() const { return doFeatures(); } Features features() const { return doFeatures(); }

10
src/Platform/NaClApplication.h

@ -349,6 +349,16 @@ class NaClApplication::Configuration {
public: public:
constexpr /*implicit*/ Configuration(): _size(640, 480), _sampleCount(0) {} constexpr /*implicit*/ Configuration(): _size(640, 480), _sampleCount(0) {}
/**
* @brief Set window title
* @return Reference to self (for method chaining)
*
* @note This function does nothing and is included only for
* compatibility with other toolkits. You need to set the title
* separately in application's HTML markup.
*/
template<class T> Configuration& setTitle(const T&) { return *this; }
/** @brief Window size */ /** @brief Window size */
Vector2i size() const { return _size; } Vector2i size() const { return _size; }

7
src/Platform/Sdl2Application.cpp

@ -257,7 +257,12 @@ void Sdl2Application::mousePressEvent(MouseEvent&) {}
void Sdl2Application::mouseReleaseEvent(MouseEvent&) {} void Sdl2Application::mouseReleaseEvent(MouseEvent&) {}
void Sdl2Application::mouseMoveEvent(MouseMoveEvent&) {} void Sdl2Application::mouseMoveEvent(MouseMoveEvent&) {}
Sdl2Application::Configuration::Configuration(): _title("Magnum SDL2 Application"), _size(800, 600), _flags(Flag::Resizable), _sampleCount(0) {} Sdl2Application::Configuration::Configuration():
#ifndef CORRADE_TARGET_EMSCRIPTEN
_title("Magnum SDL2 Application"),
#endif
_size(800, 600), _flags(Flag::Resizable), _sampleCount(0) {}
Sdl2Application::Configuration::~Configuration() = default; Sdl2Application::Configuration::~Configuration() = default;
Sdl2Application::InputEvent::Modifiers Sdl2Application::MouseEvent::modifiers() { Sdl2Application::InputEvent::Modifiers Sdl2Application::MouseEvent::modifiers() {

17
src/Platform/Sdl2Application.h

@ -397,19 +397,32 @@ class Sdl2Application::Configuration {
/*implicit*/ Configuration(); /*implicit*/ Configuration();
~Configuration(); ~Configuration();
/** @brief Window title */ #ifndef CORRADE_TARGET_EMSCRIPTEN
/**
* @brief Window title
*
* @note Not available in @ref CORRADE_TARGET_EMSCRIPTEN.
*/
std::string title() const { return _title; } std::string title() const { return _title; }
#endif
/** /**
* @brief Set window title * @brief Set window title
* @return Reference to self (for method chaining) * @return Reference to self (for method chaining)
* *
* Default is `"Magnum SDL2 Application"`. * Default is `"Magnum SDL2 Application"`.
* @note In @ref CORRADE_TARGET_EMSCRIPTEN "Emscripten" this function
* does nothing and is included only for compatibility. You need
* to set the title separately in application's HTML markup.
*/ */
#ifndef CORRADE_TARGET_EMSCRIPTEN
Configuration& setTitle(std::string title) { Configuration& setTitle(std::string title) {
_title = std::move(title); _title = std::move(title);
return *this; return *this;
} }
#else
template<class T> Configuration& setTitle(const T&) { return *this; }
#endif
/** @brief Window size */ /** @brief Window size */
Vector2i size() const { return _size; } Vector2i size() const { return _size; }
@ -455,7 +468,9 @@ class Sdl2Application::Configuration {
} }
private: private:
#ifndef CORRADE_TARGET_EMSCRIPTEN
std::string _title; std::string _title;
#endif
Vector2i _size; Vector2i _size;
Flags _flags; Flags _flags;
Int _sampleCount; Int _sampleCount;

2
src/Plugins/MagnumFont/MagnumFont.cpp

@ -64,7 +64,7 @@ namespace {
MagnumFont::MagnumFont(): _opened(nullptr) {} MagnumFont::MagnumFont(): _opened(nullptr) {}
MagnumFont::MagnumFont(PluginManager::AbstractManager* const manager, std::string plugin): AbstractFont(manager, std::move(plugin)), _opened(nullptr) {} MagnumFont::MagnumFont(PluginManager::AbstractManager& manager, std::string plugin): AbstractFont(manager, std::move(plugin)), _opened(nullptr) {}
MagnumFont::~MagnumFont() { close(); } MagnumFont::~MagnumFont() { close(); }

2
src/Plugins/MagnumFont/MagnumFont.h

@ -105,7 +105,7 @@ class MagnumFont: public AbstractFont {
explicit MagnumFont(); explicit MagnumFont();
/** @brief Plugin manager constructor */ /** @brief Plugin manager constructor */
explicit MagnumFont(PluginManager::AbstractManager* manager, std::string plugin); explicit MagnumFont(PluginManager::AbstractManager& manager, std::string plugin);
~MagnumFont(); ~MagnumFont();

2
src/Plugins/MagnumFontConverter/MagnumFontConverter.cpp

@ -38,7 +38,7 @@ namespace Magnum { namespace Text {
MagnumFontConverter::MagnumFontConverter() = default; MagnumFontConverter::MagnumFontConverter() = default;
MagnumFontConverter::MagnumFontConverter(PluginManager::AbstractManager* manager, std::string plugin): AbstractFontConverter(manager, std::move(plugin)) {} MagnumFontConverter::MagnumFontConverter(PluginManager::AbstractManager& manager, std::string plugin): AbstractFontConverter(manager, std::move(plugin)) {}
auto MagnumFontConverter::doFeatures() const -> Features { auto MagnumFontConverter::doFeatures() const -> Features {
return Feature::ExportFont|Feature::ConvertData|Feature::MultiFile; return Feature::ExportFont|Feature::ConvertData|Feature::MultiFile;

2
src/Plugins/MagnumFontConverter/MagnumFontConverter.h

@ -55,7 +55,7 @@ class MagnumFontConverter: public Text::AbstractFontConverter {
explicit MagnumFontConverter(); explicit MagnumFontConverter();
/** @brief Plugin manager constructor */ /** @brief Plugin manager constructor */
explicit MagnumFontConverter(PluginManager::AbstractManager* manager, std::string plugin); explicit MagnumFontConverter(PluginManager::AbstractManager& manager, std::string plugin);
private: private:
Features doFeatures() const override; Features doFeatures() const override;

2
src/Plugins/TgaImageConverter/TgaImageConverter.cpp

@ -57,7 +57,7 @@ namespace {
TgaImageConverter::TgaImageConverter() = default; TgaImageConverter::TgaImageConverter() = default;
TgaImageConverter::TgaImageConverter(PluginManager::AbstractManager* manager, std::string plugin): AbstractImageConverter(manager, std::move(plugin)) {} TgaImageConverter::TgaImageConverter(PluginManager::AbstractManager& manager, std::string plugin): AbstractImageConverter(manager, std::move(plugin)) {}
auto TgaImageConverter::doFeatures() const -> Features { return Feature::ConvertData; } auto TgaImageConverter::doFeatures() const -> Features { return Feature::ConvertData; }

2
src/Plugins/TgaImageConverter/TgaImageConverter.h

@ -65,7 +65,7 @@ class MAGNUM_TRADE_TGAIMAGECONVERTER_EXPORT TgaImageConverter: public AbstractIm
explicit TgaImageConverter(); explicit TgaImageConverter();
/** @brief Plugin manager constructor */ /** @brief Plugin manager constructor */
explicit TgaImageConverter(PluginManager::AbstractManager* manager, std::string plugin); explicit TgaImageConverter(PluginManager::AbstractManager& manager, std::string plugin);
private: private:
Features MAGNUM_TRADE_TGAIMAGECONVERTER_LOCAL doFeatures() const override; Features MAGNUM_TRADE_TGAIMAGECONVERTER_LOCAL doFeatures() const override;

2
src/Plugins/TgaImporter/TgaImporter.cpp

@ -58,7 +58,7 @@ namespace {
TgaImporter::TgaImporter(): in(nullptr) {} TgaImporter::TgaImporter(): in(nullptr) {}
TgaImporter::TgaImporter(PluginManager::AbstractManager* manager, std::string plugin): AbstractImporter(manager, std::move(plugin)), in(nullptr) {} TgaImporter::TgaImporter(PluginManager::AbstractManager& manager, std::string plugin): AbstractImporter(manager, std::move(plugin)), in(nullptr) {}
TgaImporter::~TgaImporter() { close(); } TgaImporter::~TgaImporter() { close(); }

2
src/Plugins/TgaImporter/TgaImporter.h

@ -74,7 +74,7 @@ class MAGNUM_TRADE_TGAIMPORTER_EXPORT TgaImporter: public AbstractImporter {
explicit TgaImporter(); explicit TgaImporter();
/** @brief Plugin manager constructor */ /** @brief Plugin manager constructor */
explicit TgaImporter(PluginManager::AbstractManager* manager, std::string plugin); explicit TgaImporter(PluginManager::AbstractManager& manager, std::string plugin);
~TgaImporter(); ~TgaImporter();

2
src/Plugins/WavAudioImporter/WavImporter.cpp

@ -34,7 +34,7 @@ namespace Magnum { namespace Audio {
WavImporter::WavImporter() = default; WavImporter::WavImporter() = default;
WavImporter::WavImporter(PluginManager::AbstractManager* manager, std::string plugin): AbstractImporter(manager, std::move(plugin)) {} WavImporter::WavImporter(PluginManager::AbstractManager& manager, std::string plugin): AbstractImporter(manager, std::move(plugin)) {}
WavImporter::~WavImporter() { close(); } WavImporter::~WavImporter() { close(); }

2
src/Plugins/WavAudioImporter/WavImporter.h

@ -55,7 +55,7 @@ class WavImporter: public AbstractImporter {
explicit WavImporter(); explicit WavImporter();
/** @brief Plugin manager constructor */ /** @brief Plugin manager constructor */
explicit WavImporter(PluginManager::AbstractManager* manager, std::string plugin); explicit WavImporter(PluginManager::AbstractManager& manager, std::string plugin);
~WavImporter(); ~WavImporter();

3
src/Shaders/Flat.h

@ -25,7 +25,7 @@
*/ */
/** @file /** @file
* @brief Class Magnum::Shaders::Flat * @brief Class @ref Magnum::Shaders::Flat, typedef @ref Magnum::Shaders::Flat2D, @ref Magnum::Shaders::Flat3D
*/ */
#include "Math/Matrix3.h" #include "Math/Matrix3.h"
@ -62,6 +62,7 @@ Shaders::Flat2D shader(Shaders::Flat2D::Flag::Textured);
myTexture.bind(Shaders::Flat2D::TextureLayer); myTexture.bind(Shaders::Flat2D::TextureLayer);
@endcode @endcode
For coloring the texture based on intensity you can use the @ref Vector shader.
@see @ref Flat2D, @ref Flat3D @see @ref Flat2D, @ref Flat3D
*/ */
template<UnsignedInt dimensions> class MAGNUM_SHADERS_EXPORT Flat: public AbstractShaderProgram { template<UnsignedInt dimensions> class MAGNUM_SHADERS_EXPORT Flat: public AbstractShaderProgram {

9
src/Shaders/Vector.h

@ -25,7 +25,7 @@
*/ */
/** @file /** @file
* @brief Class Magnum::Shaders::Vector, typedef Magnum::Shaders::Vector2D, Magnum::Shaders::Vector3D * @brief Class @ref Magnum::Shaders::Vector, typedef @ref Magnum::Shaders::Vector2D, @ref Magnum::Shaders::Vector3D
*/ */
#include "Math/Matrix3.h" #include "Math/Matrix3.h"
@ -41,9 +41,10 @@ namespace Magnum { namespace Shaders {
/** /**
@brief %Vector shader @brief %Vector shader
Renders vector art in plain grayscale form. See also DistanceFieldVector Renders vector art in plain grayscale form. See also @ref DistanceFieldVector
for more advanced effects. for more advanced effects. For rendering unchanged texture you can use the
@see Vector2D, Vector3D @ref Flat shader.
@see @ref Vector2D, @ref Vector3D
*/ */
template<UnsignedInt dimensions> class MAGNUM_SHADERS_EXPORT Vector: public AbstractVector<dimensions> { template<UnsignedInt dimensions> class MAGNUM_SHADERS_EXPORT Vector: public AbstractVector<dimensions> {
public: public:

2
src/Text/AbstractFont.cpp

@ -34,7 +34,7 @@ namespace Magnum { namespace Text {
AbstractFont::AbstractFont(): _size(0.0f) {} AbstractFont::AbstractFont(): _size(0.0f) {}
AbstractFont::AbstractFont(PluginManager::AbstractManager* manager, std::string plugin): AbstractPlugin(manager, std::move(plugin)), _size(0.0f), _lineHeight(0.0f) {} AbstractFont::AbstractFont(PluginManager::AbstractManager& manager, std::string plugin): AbstractPlugin(manager, std::move(plugin)), _size(0.0f), _lineHeight(0.0f) {}
bool AbstractFont::openData(const std::vector<std::pair<std::string, Containers::ArrayReference<const unsigned char>>>& data, const Float size) { bool AbstractFont::openData(const std::vector<std::pair<std::string, Containers::ArrayReference<const unsigned char>>>& data, const Float size) {
CORRADE_ASSERT(features() & Feature::OpenData, CORRADE_ASSERT(features() & Feature::OpenData,

2
src/Text/AbstractFont.h

@ -105,7 +105,7 @@ class MAGNUM_TEXT_EXPORT AbstractFont: public PluginManager::AbstractPlugin {
explicit AbstractFont(); explicit AbstractFont();
/** @brief Plugin manager constructor */ /** @brief Plugin manager constructor */
explicit AbstractFont(PluginManager::AbstractManager* manager, std::string plugin); explicit AbstractFont(PluginManager::AbstractManager& manager, std::string plugin);
/** @brief Features supported by this font */ /** @brief Features supported by this font */
Features features() const { return doFeatures(); } Features features() const { return doFeatures(); }

2
src/Text/AbstractFontConverter.cpp

@ -36,7 +36,7 @@ namespace Magnum { namespace Text {
AbstractFontConverter::AbstractFontConverter() = default; AbstractFontConverter::AbstractFontConverter() = default;
AbstractFontConverter::AbstractFontConverter(PluginManager::AbstractManager* manager, std::string plugin): PluginManager::AbstractPlugin(manager, std::move(plugin)) {} AbstractFontConverter::AbstractFontConverter(PluginManager::AbstractManager& manager, std::string plugin): PluginManager::AbstractPlugin(manager, std::move(plugin)) {}
std::vector<std::pair<std::string, Containers::Array<unsigned char>>> AbstractFontConverter::exportFontToData(AbstractFont& font, GlyphCache& cache, const std::string& filename, const std::string& characters) const { std::vector<std::pair<std::string, Containers::Array<unsigned char>>> AbstractFontConverter::exportFontToData(AbstractFont& font, GlyphCache& cache, const std::string& filename, const std::string& characters) const {
CORRADE_ASSERT(features() >= (Feature::ExportFont|Feature::ConvertData), CORRADE_ASSERT(features() >= (Feature::ExportFont|Feature::ConvertData),

2
src/Text/AbstractFontConverter.h

@ -122,7 +122,7 @@ class MAGNUM_TEXT_EXPORT AbstractFontConverter: public PluginManager::AbstractPl
explicit AbstractFontConverter(); explicit AbstractFontConverter();
/** @brief Plugin manager constructor */ /** @brief Plugin manager constructor */
explicit AbstractFontConverter(PluginManager::AbstractManager* manager, std::string plugin); explicit AbstractFontConverter(PluginManager::AbstractManager& manager, std::string plugin);
/** @brief Features supported by this converter */ /** @brief Features supported by this converter */
Features features() const { return doFeatures(); } Features features() const { return doFeatures(); }

2
src/Trade/AbstractImageConverter.cpp

@ -32,7 +32,7 @@ namespace Magnum { namespace Trade {
AbstractImageConverter::AbstractImageConverter() = default; AbstractImageConverter::AbstractImageConverter() = default;
AbstractImageConverter::AbstractImageConverter(PluginManager::AbstractManager* manager, std::string plugin): AbstractPlugin(manager, std::move(plugin)) {} AbstractImageConverter::AbstractImageConverter(PluginManager::AbstractManager& manager, std::string plugin): AbstractPlugin(manager, std::move(plugin)) {}
Image2D* AbstractImageConverter::exportToImage(const ImageReference2D& image) const { Image2D* AbstractImageConverter::exportToImage(const ImageReference2D& image) const {
CORRADE_ASSERT(features() & Feature::ConvertImage, CORRADE_ASSERT(features() & Feature::ConvertImage,

2
src/Trade/AbstractImageConverter.h

@ -83,7 +83,7 @@ class MAGNUM_EXPORT AbstractImageConverter: public PluginManager::AbstractPlugin
explicit AbstractImageConverter(); explicit AbstractImageConverter();
/** @brief Plugin manager constructor */ /** @brief Plugin manager constructor */
explicit AbstractImageConverter(PluginManager::AbstractManager* manager, std::string plugin); explicit AbstractImageConverter(PluginManager::AbstractManager& manager, std::string plugin);
/** @brief Features supported by this converter */ /** @brief Features supported by this converter */
Features features() const { return doFeatures(); } Features features() const { return doFeatures(); }

2
src/Trade/AbstractImporter.cpp

@ -43,7 +43,7 @@ namespace Magnum { namespace Trade {
AbstractImporter::AbstractImporter() = default; AbstractImporter::AbstractImporter() = default;
AbstractImporter::AbstractImporter(PluginManager::AbstractManager* manager, std::string plugin): AbstractPlugin(manager, std::move(plugin)) {} AbstractImporter::AbstractImporter(PluginManager::AbstractManager& manager, std::string plugin): AbstractPlugin(manager, std::move(plugin)) {}
bool AbstractImporter::openData(Containers::ArrayReference<const unsigned char> data) { bool AbstractImporter::openData(Containers::ArrayReference<const unsigned char> data) {
CORRADE_ASSERT(features() & Feature::OpenData, CORRADE_ASSERT(features() & Feature::OpenData,

2
src/Trade/AbstractImporter.h

@ -95,7 +95,7 @@ class MAGNUM_EXPORT AbstractImporter: public PluginManager::AbstractPlugin {
explicit AbstractImporter(); explicit AbstractImporter();
/** @brief Plugin manager constructor */ /** @brief Plugin manager constructor */
explicit AbstractImporter(PluginManager::AbstractManager* manager, std::string plugin); explicit AbstractImporter(PluginManager::AbstractManager& manager, std::string plugin);
/** @brief Features supported by this importer */ /** @brief Features supported by this importer */
Features features() const { return doFeatures(); } Features features() const { return doFeatures(); }

2
toolchains

@ -1 +1 @@
Subproject commit ca539cf413142e70a6084b090ae5cfee77fd810a Subproject commit 7490953943d6f23e7971b1b5076426dceb3c62eb
Loading…
Cancel
Save