├── .gitattributes ├── .gitignore ├── LICENSE ├── README.md └── SpriteAnimator ├── SpriteAnimator.sln ├── SpriteAnimator.vcxproj ├── dll ├── sfml-graphics-d-2.dll ├── sfml-system-d-2.dll ├── sfml-window-d-2.dll └── thor-d.dll ├── imgui.ini ├── src ├── editor │ ├── Application.cpp │ └── Application.hpp ├── imgui │ ├── imgui-SFML.cpp │ ├── imgui.cpp │ └── imgui_draw.cpp ├── loader │ ├── SpriteAnimator.cpp │ └── SpriteAnimator.hpp ├── main.cpp ├── res │ ├── data │ │ ├── left_orc.anim │ │ └── up_orc.anim │ ├── icons │ │ ├── pause_button.png │ │ └── play_button.png │ └── sprites │ │ └── orc.png └── utils │ ├── TileInfo.hpp │ ├── Utility.hpp │ └── imguiSTL.hpp └── third-party ├── imgui └── include │ ├── imconfig.h │ ├── imgui-SFML.h │ ├── imgui.h │ ├── imgui_internal.h │ ├── stb_rect_pack.h │ ├── stb_textedit.h │ └── stb_truetype.h ├── json └── include │ └── json.hpp ├── nfd ├── include │ └── nfd.h └── lib │ └── nfd_d.lib ├── sfml ├── include │ └── SFML │ │ ├── Audio.hpp │ │ ├── Audio │ │ ├── AlResource.hpp │ │ ├── Export.hpp │ │ ├── InputSoundFile.hpp │ │ ├── Listener.hpp │ │ ├── Music.hpp │ │ ├── OutputSoundFile.hpp │ │ ├── Sound.hpp │ │ ├── SoundBuffer.hpp │ │ ├── SoundBufferRecorder.hpp │ │ ├── SoundFileFactory.hpp │ │ ├── SoundFileFactory.inl │ │ ├── SoundFileReader.hpp │ │ ├── SoundFileWriter.hpp │ │ ├── SoundRecorder.hpp │ │ ├── SoundSource.hpp │ │ └── SoundStream.hpp │ │ ├── Config.hpp │ │ ├── GpuPreference.hpp │ │ ├── Graphics.hpp │ │ ├── Graphics │ │ ├── BlendMode.hpp │ │ ├── CircleShape.hpp │ │ ├── Color.hpp │ │ ├── ConvexShape.hpp │ │ ├── Drawable.hpp │ │ ├── Export.hpp │ │ ├── Font.hpp │ │ ├── Glsl.hpp │ │ ├── Glsl.inl │ │ ├── Glyph.hpp │ │ ├── Image.hpp │ │ ├── PrimitiveType.hpp │ │ ├── Rect.hpp │ │ ├── Rect.inl │ │ ├── RectangleShape.hpp │ │ ├── RenderStates.hpp │ │ ├── RenderTarget.hpp │ │ ├── RenderTexture.hpp │ │ ├── RenderWindow.hpp │ │ ├── Shader.hpp │ │ ├── Shape.hpp │ │ ├── Sprite.hpp │ │ ├── Text.hpp │ │ ├── Texture.hpp │ │ ├── Transform.hpp │ │ ├── Transformable.hpp │ │ ├── Vertex.hpp │ │ ├── VertexArray.hpp │ │ ├── VertexBuffer.hpp │ │ └── View.hpp │ │ ├── Main.hpp │ │ ├── Network.hpp │ │ ├── Network │ │ ├── Export.hpp │ │ ├── Ftp.hpp │ │ ├── Http.hpp │ │ ├── IpAddress.hpp │ │ ├── Packet.hpp │ │ ├── Socket.hpp │ │ ├── SocketHandle.hpp │ │ ├── SocketSelector.hpp │ │ ├── TcpListener.hpp │ │ ├── TcpSocket.hpp │ │ └── UdpSocket.hpp │ │ ├── OpenGL.hpp │ │ ├── System.hpp │ │ ├── System │ │ ├── Clock.hpp │ │ ├── Err.hpp │ │ ├── Export.hpp │ │ ├── FileInputStream.hpp │ │ ├── InputStream.hpp │ │ ├── Lock.hpp │ │ ├── MemoryInputStream.hpp │ │ ├── Mutex.hpp │ │ ├── NativeActivity.hpp │ │ ├── NonCopyable.hpp │ │ ├── Sleep.hpp │ │ ├── String.hpp │ │ ├── String.inl │ │ ├── Thread.hpp │ │ ├── Thread.inl │ │ ├── ThreadLocal.hpp │ │ ├── ThreadLocalPtr.hpp │ │ ├── ThreadLocalPtr.inl │ │ ├── Time.hpp │ │ ├── Utf.hpp │ │ ├── Utf.inl │ │ ├── Vector2.hpp │ │ ├── Vector2.inl │ │ ├── Vector3.hpp │ │ └── Vector3.inl │ │ ├── Window.hpp │ │ └── Window │ │ ├── Clipboard.hpp │ │ ├── Context.hpp │ │ ├── ContextSettings.hpp │ │ ├── Cursor.hpp │ │ ├── Event.hpp │ │ ├── Export.hpp │ │ ├── GlResource.hpp │ │ ├── Joystick.hpp │ │ ├── Keyboard.hpp │ │ ├── Mouse.hpp │ │ ├── Sensor.hpp │ │ ├── Touch.hpp │ │ ├── VideoMode.hpp │ │ ├── Window.hpp │ │ ├── WindowHandle.hpp │ │ └── WindowStyle.hpp └── lib │ ├── sfml-audio-d.lib │ ├── sfml-graphics-d.lib │ ├── sfml-network-d.lib │ ├── sfml-system-d.lib │ └── sfml-window-d.lib └── thor ├── include ├── Aurora │ ├── Config.hpp │ ├── Dispatch.hpp │ ├── Dispatch │ │ ├── Detail │ │ │ ├── DoubleDispatcher.inl │ │ │ └── SingleDispatcher.inl │ │ ├── DispatchTraits.hpp │ │ ├── DoubleDispatcher.hpp │ │ └── SingleDispatcher.hpp │ ├── Meta.hpp │ ├── Meta │ │ ├── Preprocessor.hpp │ │ ├── Templates.hpp │ │ ├── Tuple.hpp │ │ └── Variadic.hpp │ ├── SmartPtr.hpp │ ├── SmartPtr │ │ ├── ClonersAndDeleters.hpp │ │ ├── CopiedPtr.hpp │ │ ├── Detail │ │ │ ├── Factories.hpp │ │ │ └── PtrOwner.hpp │ │ └── MakeUnique.hpp │ ├── Tools.hpp │ └── Tools │ │ ├── Algorithms.hpp │ │ ├── Any.hpp │ │ ├── Downcast.hpp │ │ ├── Exceptions.hpp │ │ ├── ForEach.hpp │ │ ├── Hash.hpp │ │ ├── NamedTuple.hpp │ │ ├── NonCopyable.hpp │ │ ├── Optional.hpp │ │ ├── PImpl.hpp │ │ ├── SafeBool.hpp │ │ ├── Swap.hpp │ │ └── Typeid.hpp └── Thor │ ├── Animations.hpp │ ├── Animations │ ├── AnimationMap.hpp │ ├── AnimationPrimitives.hpp │ ├── Animator.hpp │ ├── ColorAnimation.hpp │ ├── Detail │ │ ├── AnimationMap.inl │ │ ├── Animator.inl │ │ ├── PlaybackSchemes.hpp │ │ └── RefAnimation.inl │ ├── FadeAnimation.hpp │ ├── FrameAnimation.hpp │ ├── Playback.hpp │ └── RefAnimation.hpp │ ├── Config.hpp │ ├── Graphics.hpp │ ├── Graphics │ ├── BigSprite.hpp │ ├── BigTexture.hpp │ ├── ColorGradient.hpp │ ├── Detail │ │ ├── ToString.inl │ │ └── UniformAccess.inl │ ├── ToString.hpp │ └── UniformAccess.hpp │ ├── Input.hpp │ ├── Input │ ├── Action.hpp │ ├── ActionContext.hpp │ ├── ActionMap.hpp │ ├── Connection.hpp │ ├── Detail │ │ ├── ActionMap.inl │ │ ├── ActionOperations.hpp │ │ ├── ConnectionImpl.hpp │ │ ├── EventListener.hpp │ │ └── EventSystem.inl │ ├── EventSystem.hpp │ ├── InputNames.hpp │ └── Joystick.hpp │ ├── Math.hpp │ ├── Math │ ├── Detail │ │ ├── Triangulation.inl │ │ └── TriangulationFigures.inl │ ├── Distribution.hpp │ ├── Distributions.hpp │ ├── Random.hpp │ ├── Triangulation.hpp │ ├── TriangulationFigures.hpp │ └── Trigonometry.hpp │ ├── Particles.hpp │ ├── Particles │ ├── Affectors.hpp │ ├── EmissionInterface.hpp │ ├── Emitters.hpp │ ├── Particle.hpp │ └── ParticleSystem.hpp │ ├── Resources.hpp │ ├── Resources │ ├── Detail │ │ ├── ResourceHolder.inl │ │ └── ResourceLoaderHelpers.hpp │ ├── KnownIdStrategy.hpp │ ├── OwnershipModels.hpp │ ├── ResourceExceptions.hpp │ ├── ResourceHolder.hpp │ ├── ResourceLoader.hpp │ └── SfmlLoaders.hpp │ ├── Shapes.hpp │ ├── Shapes │ ├── Arrow.hpp │ ├── ConcaveShape.hpp │ └── Shapes.hpp │ ├── Time.hpp │ ├── Time │ ├── CallbackTimer.hpp │ ├── StopWatch.hpp │ └── Timer.hpp │ ├── Vectors.hpp │ └── Vectors │ ├── Detail │ ├── PolarVector2.inl │ ├── VectorAlgebra2D.inl │ └── VectorAlgebra3D.inl │ ├── PolarVector2.hpp │ ├── VectorAlgebra2D.hpp │ └── VectorAlgebra3D.hpp └── lib └── thor-d.lib /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | 7 | # Standard to msysgit 8 | *.doc diff=astextplain 9 | *.DOC diff=astextplain 10 | *.docx diff=astextplain 11 | *.DOCX diff=astextplain 12 | *.dot diff=astextplain 13 | *.DOT diff=astextplain 14 | *.pdf diff=astextplain 15 | *.PDF diff=astextplain 16 | *.rtf diff=astextplain 17 | *.RTF diff=astextplain 18 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Jakob Ahrneteg 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Sprite Animator 2 | 3 | Sprite animation editor based on the [Thor](https://github.com/Bromeon/Thor) library extension to [SFML](https://github.com/SFML/SFML). 4 | 5 | ## Features 6 | 7 | Sprite Animator is an easy and flexible editor which allows you to create animations in a matter of seconds. The editor 8 | is built upon the animation module from Thor and has support for: 9 | 10 | * Sprite sheet selection 11 | * Grid generation for sprite sheets based on tile size 12 | * Export animation data directly to animation files 13 | 14 | ## Screenshot 15 | 16 | ![screenshot](https://i.imgur.com/muFHwVh.png) 17 | 18 | 19 | ![screenshot](https://i.imgur.com/xWhEtIl.png) 20 | 21 | ## How-to 22 | 23 | Setting up: 24 | 25 | * Build the provided Visual Studio 2017 solution (`sln`) as x86 (Debug) 26 | * Copy the contents of the `dll` folder to your `Debug` folder 27 | * Run the program 28 | 29 | ## How-to integrate 30 | 31 | * Add [json](https://github.com/nlohmann/json) to your project include settings 32 | * Add `SpriteAnimator.hpp` and `SpriteAnimator.cpp` to your project 33 | 34 | ## Example code 35 | 36 | ```c++ 37 | #include 38 | #include 39 | #include 40 | #include 41 | 42 | int main() 43 | { 44 | sf::RenderWindow window(sf::VideoMode(800, 600), "Animation"); 45 | sf::Clock clock; 46 | sf::Sprite sprite; 47 | sf::Texture spriteSheet; 48 | px::SpriteAnimator animator; 49 | 50 | // Prepare sprite 51 | spriteSheet.loadFromFile("src/res/sprites/orc.png"); 52 | sprite.setTexture(spriteSheet); 53 | sprite.setPosition(sf::Vector2f(400.f, 300.f)); 54 | 55 | // Load animations 56 | animator.loadAnimation("src/res/data/up_orc.anim"); 57 | animator.loadAnimation("src/res/data/left_orc.anim"); 58 | animator.playAnimation("left_orc", true); 59 | 60 | while (window.isOpen()) 61 | { 62 | sf::Event event; 63 | 64 | while (window.pollEvent(event)) 65 | { 66 | if (event.type == sf::Event::Closed) 67 | window.close(); 68 | } 69 | 70 | // Update animation system 71 | animator.update(sprite, clock.restart()); 72 | 73 | window.clear(); 74 | window.draw(sprite); 75 | window.display(); 76 | } 77 | 78 | return 0; 79 | } 80 | ``` 81 | 82 | ## Remarks 83 | 84 | * The Thor animation module have been slightly modified as crucical functionality was missing for the editor 85 | * These changes can be found in `AnimationMap.hpp` and `AnimationMap.inl` 86 | * If you want to use these files you can also uncomment `removeAnimation(...)` in `SpriteAnimator.hpp` 87 | 88 | ## Limitations 89 | 90 | * Support is limited to one spritesheet 91 | 92 | ## Dependencies 93 | 94 | * [imgui](https://github.com/ocornut/imgui) 95 | * [imgui-sfml](https://github.com/eliasdaler/imgui-sfml) 96 | * [nfd](https://github.com/mlabbe/nativefiledialog) 97 | * [json](https://github.com/nlohmann/json) 98 | * [SFML](https://github.com/SFML/SFML) 99 | * [Thor](https://github.com/Bromeon/Thor) 100 | 101 | ## License 102 | 103 | This library is licensed under the MIT License, see LICENSE for more information. 104 | -------------------------------------------------------------------------------- /SpriteAnimator/SpriteAnimator.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.28010.2003 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SpriteAnimator", "SpriteAnimator.vcxproj", "{D22D84FD-E3D7-49D6-AE6D-DAB17DE69D12}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|x64 = Debug|x64 11 | Debug|x86 = Debug|x86 12 | Release|x64 = Release|x64 13 | Release|x86 = Release|x86 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {D22D84FD-E3D7-49D6-AE6D-DAB17DE69D12}.Debug|x64.ActiveCfg = Debug|x64 17 | {D22D84FD-E3D7-49D6-AE6D-DAB17DE69D12}.Debug|x64.Build.0 = Debug|x64 18 | {D22D84FD-E3D7-49D6-AE6D-DAB17DE69D12}.Debug|x86.ActiveCfg = Debug|Win32 19 | {D22D84FD-E3D7-49D6-AE6D-DAB17DE69D12}.Debug|x86.Build.0 = Debug|Win32 20 | {D22D84FD-E3D7-49D6-AE6D-DAB17DE69D12}.Release|x64.ActiveCfg = Release|x64 21 | {D22D84FD-E3D7-49D6-AE6D-DAB17DE69D12}.Release|x64.Build.0 = Release|x64 22 | {D22D84FD-E3D7-49D6-AE6D-DAB17DE69D12}.Release|x86.ActiveCfg = Release|Win32 23 | {D22D84FD-E3D7-49D6-AE6D-DAB17DE69D12}.Release|x86.Build.0 = Release|Win32 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | GlobalSection(ExtensibilityGlobals) = postSolution 29 | SolutionGuid = {556C002A-36AF-4A10-AA05-B2BC96DBAEA3} 30 | EndGlobalSection 31 | EndGlobal 32 | -------------------------------------------------------------------------------- /SpriteAnimator/dll/sfml-graphics-d-2.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rikora/SpriteAnimator/28ff574636438c97c58f2786e7896441e847f14b/SpriteAnimator/dll/sfml-graphics-d-2.dll -------------------------------------------------------------------------------- /SpriteAnimator/dll/sfml-system-d-2.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rikora/SpriteAnimator/28ff574636438c97c58f2786e7896441e847f14b/SpriteAnimator/dll/sfml-system-d-2.dll -------------------------------------------------------------------------------- /SpriteAnimator/dll/sfml-window-d-2.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rikora/SpriteAnimator/28ff574636438c97c58f2786e7896441e847f14b/SpriteAnimator/dll/sfml-window-d-2.dll -------------------------------------------------------------------------------- /SpriteAnimator/dll/thor-d.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rikora/SpriteAnimator/28ff574636438c97c58f2786e7896441e847f14b/SpriteAnimator/dll/thor-d.dll -------------------------------------------------------------------------------- /SpriteAnimator/imgui.ini: -------------------------------------------------------------------------------- 1 | [Window][Debug##Default] 2 | Pos=60,60 3 | Size=400,400 4 | Collapsed=0 5 | 6 | [Window][Hello, world!] 7 | Pos=900,2 8 | Size=298,798 9 | Collapsed=0 10 | 11 | [Window][Particle Editor] 12 | Pos=908,3 13 | Size=290,801 14 | Collapsed=0 15 | 16 | [Window][Particle System] 17 | Pos=824,21 18 | Size=374,777 19 | Collapsed=0 20 | 21 | [Window][Test] 22 | Pos=60,60 23 | Size=283,371 24 | Collapsed=0 25 | 26 | [Window][Animator] 27 | Pos=1047,18 28 | Size=393,882 29 | Collapsed=0 30 | 31 | [Window][Sprite sheet] 32 | Pos=1,20 33 | Size=1206,880 34 | Collapsed=0 35 | 36 | [Window][Tile] 37 | Pos=1214,750 38 | Size=183,78 39 | Collapsed=0 40 | 41 | [Window][Sprite] 42 | Pos=1209,729 43 | Size=227,169 44 | Collapsed=0 45 | 46 | -------------------------------------------------------------------------------- /SpriteAnimator/src/editor/Application.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | //////////////////////////////////////////////////////////// 4 | // Headers 5 | //////////////////////////////////////////////////////////// 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | namespace px 12 | { 13 | class Application 14 | { 15 | public: 16 | Application(); 17 | ~Application(); 18 | 19 | public: 20 | void run(); 21 | 22 | private: 23 | void drawGrid(); 24 | void addAnimationsToGUI(); 25 | void pollEvents(); 26 | void update(sf::Time dt); 27 | void updateGUI(); 28 | void openTextureFile(); 29 | void saveAnimations(); 30 | void outputAnimationData(const std::string& folderPath); 31 | const bool hasLoadedTexture() const; 32 | const bool hasSelectedTileSize() const; 33 | 34 | private: 35 | // Animations 36 | void addAnimation(const std::string& id, const thor::FrameAnimation& anim, float duration); 37 | void addFrameAnimation(thor::FrameAnimation& anim, const sf::FloatRect& rect, float duration); 38 | void playAnimation(const std::string& id, bool repeat = false); 39 | void updateAnimation(sf::Time dt); 40 | 41 | private: 42 | // Types 43 | using AnimationsHolder = thor::AnimationMap; 44 | using Animator = thor::Animator; 45 | 46 | private: 47 | struct FrameInfo 48 | { 49 | int spriteIndex = 0; 50 | float duration = 1.f; 51 | }; 52 | 53 | struct AnimationInfo 54 | { 55 | std::vector framesDetail; 56 | thor::FrameAnimation frameAnimation; 57 | float duration = 1.f; 58 | bool submitted = false; 59 | }; 60 | 61 | private: 62 | std::string m_playingAnimation; 63 | sf::Vector2f m_selectedTile; 64 | sf::Vector2i m_tileSize; 65 | std::map m_animations; 66 | std::vector m_tiles; 67 | AnimationsHolder m_spriteAnimations; 68 | Animator m_animator; 69 | 70 | private: 71 | sf::RenderWindow m_window; 72 | thor::ActionMap m_actions; 73 | sf::Sprite m_sprite; 74 | sf::Sprite m_playButton; 75 | sf::Sprite m_pauseButton; 76 | sf::Texture m_playButtonTexture; 77 | sf::Texture m_pauseButtonTexture; 78 | sf::Texture m_spritesheet; 79 | 80 | private: 81 | static bool m_showSpriteSheet; 82 | }; 83 | } -------------------------------------------------------------------------------- /SpriteAnimator/src/loader/SpriteAnimator.cpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////// 2 | // Headers 3 | //////////////////////////////////////////////////////////// 4 | #include "SpriteAnimator.hpp" 5 | #include 6 | #include 7 | #include 8 | 9 | using namespace nlohmann; 10 | 11 | namespace px 12 | { 13 | SpriteAnimator::SpriteAnimator() : 14 | m_animator(m_animations) 15 | { 16 | } 17 | 18 | void SpriteAnimator::update(sf::Sprite& animated, sf::Time dt) 19 | { 20 | m_animator.update(dt); 21 | m_animator.animate(animated); 22 | } 23 | 24 | void SpriteAnimator::loadAnimation(const std::string& animation) 25 | { 26 | // Parse the animation file 27 | std::ifstream i(animation); 28 | json data; 29 | i >> data; 30 | i.close(); 31 | 32 | // Load all the frames 33 | thor::FrameAnimation anim; 34 | for (unsigned i = 0; i < data["frames"].get(); ++i) 35 | { 36 | sf::FloatRect rect = sf::FloatRect(data["frame"][i]["floatRect"][0], data["frame"][i]["floatRect"][1], 37 | data["frame"][i]["floatRect"][2], data["frame"][i]["floatRect"][3]); 38 | float duration = data["frame"][i]["duration"]; 39 | addFrameAnimation(anim, rect, duration); 40 | } 41 | 42 | // Add the animation to the container 43 | addAnimation(data["id"], anim, data["duration"]); 44 | } 45 | 46 | /*void SpriteAnimator::removeAnimation(const std::string & id) 47 | { 48 | m_animations.removeAnimation(id); 49 | }*/ 50 | 51 | void SpriteAnimator::playAnimation(const std::string& id, bool repeat) 52 | { 53 | repeat ? m_animator.play() << id << thor::Playback::loop(id) : m_animator.play(); 54 | } 55 | 56 | void SpriteAnimator::stop() 57 | { 58 | m_animator.stop(); 59 | } 60 | 61 | void SpriteAnimator::addAnimation(const std::string& id, const thor::FrameAnimation& anim, float duration) 62 | { 63 | m_animations.addAnimation(id, anim, sf::seconds(duration)); 64 | } 65 | 66 | void SpriteAnimator::addFrameAnimation(thor::FrameAnimation& anim, const sf::FloatRect& rect, float duration) 67 | { 68 | anim.addFrame(duration, static_cast(rect)); 69 | } 70 | } -------------------------------------------------------------------------------- /SpriteAnimator/src/loader/SpriteAnimator.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | //////////////////////////////////////////////////////////// 4 | // Headers 5 | //////////////////////////////////////////////////////////// 6 | #include 7 | #include 8 | 9 | namespace sf 10 | { 11 | class Sprite; 12 | } 13 | 14 | namespace px 15 | { 16 | class SpriteAnimator 17 | { 18 | public: 19 | SpriteAnimator(); 20 | ~SpriteAnimator() = default; 21 | 22 | public: 23 | void update(sf::Sprite& animated, sf::Time dt); 24 | void loadAnimation(const std::string& animation); 25 | //void removeAnimation(const std::string& id); 26 | void playAnimation(const std::string& id, bool repeat = false); 27 | void stop(); 28 | 29 | private: 30 | void addAnimation(const std::string& id, const thor::FrameAnimation& anim, float duration); 31 | void addFrameAnimation(thor::FrameAnimation& anim, const sf::FloatRect& rect, float duration); 32 | 33 | private: 34 | // Types 35 | using AnimationsHolder = thor::AnimationMap; 36 | using Animator = thor::Animator; 37 | 38 | private: 39 | AnimationsHolder m_animations; 40 | Animator m_animator; 41 | }; 42 | } 43 | -------------------------------------------------------------------------------- /SpriteAnimator/src/main.cpp: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////// 2 | //// Headers 3 | ////////////////////////////////////////////////////////////// 4 | #include 5 | 6 | int main() 7 | { 8 | px::Application app; 9 | app.run(); 10 | return 0; 11 | } 12 | 13 | /// Usage example of integration 14 | //#include 15 | //#include 16 | //#include 17 | //#include 18 | // 19 | //int main() 20 | //{ 21 | // sf::RenderWindow window(sf::VideoMode(800, 600), "Animation"); 22 | // sf::Clock clock; 23 | // sf::Sprite sprite; 24 | // sf::Texture spriteSheet; 25 | // px::SpriteAnimator animator; 26 | // 27 | // // Prepare sprite 28 | // spriteSheet.loadFromFile("src/res/sprites/orc.png"); 29 | // sprite.setTexture(spriteSheet); 30 | // sprite.setPosition(sf::Vector2f(400.f, 300.f)); 31 | // 32 | // // Load animations 33 | // animator.loadAnimation("src/res/data/up_orc.anim"); 34 | // animator.loadAnimation("src/res/data/left_orc.anim"); 35 | // animator.playAnimation("left_orc", true); 36 | // 37 | // while (window.isOpen()) 38 | // { 39 | // sf::Event event; 40 | // 41 | // while (window.pollEvent(event)) 42 | // { 43 | // if (event.type == sf::Event::Closed) 44 | // window.close(); 45 | // } 46 | // 47 | // // Update animation system 48 | // animator.update(sprite, clock.restart()); 49 | // 50 | // window.clear(); 51 | // window.draw(sprite); 52 | // window.display(); 53 | // } 54 | // 55 | // return 0; 56 | //} -------------------------------------------------------------------------------- /SpriteAnimator/src/res/data/left_orc.anim: -------------------------------------------------------------------------------- 1 | { 2 | "duration": 1.0, 3 | "frame": [ 4 | { 5 | "duration": 1.0, 6 | "floatRect": [ 7 | 0.0, 8 | 64.0, 9 | 64.0, 10 | 64.0 11 | ] 12 | }, 13 | { 14 | "duration": 1.0, 15 | "floatRect": [ 16 | 64.0, 17 | 64.0, 18 | 64.0, 19 | 64.0 20 | ] 21 | }, 22 | { 23 | "duration": 1.0, 24 | "floatRect": [ 25 | 128.0, 26 | 64.0, 27 | 64.0, 28 | 64.0 29 | ] 30 | }, 31 | { 32 | "duration": 1.0, 33 | "floatRect": [ 34 | 192.0, 35 | 64.0, 36 | 64.0, 37 | 64.0 38 | ] 39 | } 40 | ], 41 | "frames": 4, 42 | "id": "left_orc" 43 | } 44 | -------------------------------------------------------------------------------- /SpriteAnimator/src/res/data/up_orc.anim: -------------------------------------------------------------------------------- 1 | { 2 | "duration": 1.0, 3 | "frame": [ 4 | { 5 | "duration": 1.0, 6 | "floatRect": [ 7 | 0.0, 8 | 0.0, 9 | 64.0, 10 | 64.0 11 | ] 12 | }, 13 | { 14 | "duration": 1.0, 15 | "floatRect": [ 16 | 64.0, 17 | 0.0, 18 | 64.0, 19 | 64.0 20 | ] 21 | }, 22 | { 23 | "duration": 1.0, 24 | "floatRect": [ 25 | 128.0, 26 | 0.0, 27 | 64.0, 28 | 64.0 29 | ] 30 | }, 31 | { 32 | "duration": 1.0, 33 | "floatRect": [ 34 | 192.0, 35 | 0.0, 36 | 64.0, 37 | 64.0 38 | ] 39 | } 40 | ], 41 | "frames": 4, 42 | "id": "up_orc" 43 | } 44 | -------------------------------------------------------------------------------- /SpriteAnimator/src/res/icons/pause_button.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rikora/SpriteAnimator/28ff574636438c97c58f2786e7896441e847f14b/SpriteAnimator/src/res/icons/pause_button.png -------------------------------------------------------------------------------- /SpriteAnimator/src/res/icons/play_button.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rikora/SpriteAnimator/28ff574636438c97c58f2786e7896441e847f14b/SpriteAnimator/src/res/icons/play_button.png -------------------------------------------------------------------------------- /SpriteAnimator/src/res/sprites/orc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rikora/SpriteAnimator/28ff574636438c97c58f2786e7896441e847f14b/SpriteAnimator/src/res/sprites/orc.png -------------------------------------------------------------------------------- /SpriteAnimator/src/utils/TileInfo.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | //////////////////////////////////////////////////////////// 4 | // Headers 5 | //////////////////////////////////////////////////////////// 6 | #include 7 | #include 8 | 9 | namespace px 10 | { 11 | struct TileInfo 12 | { 13 | std::string name; 14 | sf::FloatRect tile; 15 | }; 16 | } -------------------------------------------------------------------------------- /SpriteAnimator/src/utils/Utility.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | //////////////////////////////////////////////////////////// 4 | // Headers 5 | //////////////////////////////////////////////////////////// 6 | #include 7 | #include 8 | 9 | namespace px 10 | { 11 | namespace utils 12 | { 13 | inline void constrainNegativesFloat(float& value, float min = 0.f) 14 | { 15 | value = std::clamp(value, min, std::numeric_limits::max()); 16 | } 17 | 18 | inline void constrainNegativesVec(sf::Vector2i& value) 19 | { 20 | value.x = std::clamp(value.x, 0, std::numeric_limits::max()); 21 | value.y = std::clamp(value.y, 0, std::numeric_limits::max()); 22 | }; 23 | } 24 | } -------------------------------------------------------------------------------- /SpriteAnimator/src/utils/imguiSTL.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | //////////////////////////////////////////////////////////// 4 | // Headers 5 | //////////////////////////////////////////////////////////// 6 | #include 7 | #include 8 | #include 9 | 10 | // ImGui overloads for STL containers 11 | namespace ImGui 12 | { 13 | static auto vector_getter = [](void* vec, int idx, const char** out_text) 14 | { 15 | auto& vector = *static_cast*>(vec); 16 | if (idx < 0 || idx >= static_cast(vector.size())) { return false; } 17 | *out_text = vector.at(idx).name.c_str(); 18 | return true; 19 | }; 20 | 21 | bool Combo(const char* label, int* currIndex, std::vector& values) 22 | { 23 | if (values.empty()) { return false; } 24 | return Combo(label, currIndex, vector_getter, static_cast(&values), values.size()); 25 | } 26 | } -------------------------------------------------------------------------------- /SpriteAnimator/third-party/nfd/include/nfd.h: -------------------------------------------------------------------------------- 1 | /* 2 | Native File Dialog 3 | 4 | User API 5 | 6 | http://www.frogtoss.com/labs 7 | */ 8 | 9 | 10 | #ifndef _NFD_H 11 | #define _NFD_H 12 | 13 | #ifdef __cplusplus 14 | extern "C" { 15 | #endif 16 | 17 | #include 18 | 19 | /* denotes UTF-8 char */ 20 | typedef char nfdchar_t; 21 | 22 | /* opaque data structure -- see NFD_PathSet_* */ 23 | typedef struct { 24 | nfdchar_t *buf; 25 | size_t *indices; /* byte offsets into buf */ 26 | size_t count; /* number of indices into buf */ 27 | }nfdpathset_t; 28 | 29 | typedef enum { 30 | NFD_ERROR, /* programmatic error */ 31 | NFD_OKAY, /* user pressed okay, or successful return */ 32 | NFD_CANCEL /* user pressed cancel */ 33 | }nfdresult_t; 34 | 35 | 36 | /* nfd_.c */ 37 | 38 | /* single file open dialog */ 39 | nfdresult_t NFD_OpenDialog( const nfdchar_t *filterList, 40 | const nfdchar_t *defaultPath, 41 | nfdchar_t **outPath ); 42 | 43 | /* multiple file open dialog */ 44 | nfdresult_t NFD_OpenDialogMultiple( const nfdchar_t *filterList, 45 | const nfdchar_t *defaultPath, 46 | nfdpathset_t *outPaths ); 47 | 48 | /* save dialog */ 49 | nfdresult_t NFD_SaveDialog( const nfdchar_t *filterList, 50 | const nfdchar_t *defaultPath, 51 | nfdchar_t **outPath ); 52 | 53 | 54 | /* select folder dialog */ 55 | nfdresult_t NFD_PickFolder( const nfdchar_t *defaultPath, 56 | nfdchar_t **outPath); 57 | 58 | /* nfd_common.c */ 59 | 60 | /* get last error -- set when nfdresult_t returns NFD_ERROR */ 61 | const char *NFD_GetError( void ); 62 | /* get the number of entries stored in pathSet */ 63 | size_t NFD_PathSet_GetCount( const nfdpathset_t *pathSet ); 64 | /* Get the UTF-8 path at offset index */ 65 | nfdchar_t *NFD_PathSet_GetPath( const nfdpathset_t *pathSet, size_t index ); 66 | /* Free the pathSet */ 67 | void NFD_PathSet_Free( nfdpathset_t *pathSet ); 68 | 69 | 70 | #ifdef __cplusplus 71 | } 72 | #endif 73 | 74 | #endif 75 | -------------------------------------------------------------------------------- /SpriteAnimator/third-party/nfd/lib/nfd_d.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rikora/SpriteAnimator/28ff574636438c97c58f2786e7896441e847f14b/SpriteAnimator/third-party/nfd/lib/nfd_d.lib -------------------------------------------------------------------------------- /SpriteAnimator/third-party/sfml/include/SFML/Audio.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////// 2 | // 3 | // SFML - Simple and Fast Multimedia Library 4 | // Copyright (C) 2007-2018 Laurent Gomila (laurent@sfml-dev.org) 5 | // 6 | // This software is provided 'as-is', without any express or implied warranty. 7 | // In no event will the authors be held liable for any damages arising from the use of this software. 8 | // 9 | // Permission is granted to anyone to use this software for any purpose, 10 | // including commercial applications, and to alter it and redistribute it freely, 11 | // subject to the following restrictions: 12 | // 13 | // 1. The origin of this software must not be misrepresented; 14 | // you must not claim that you wrote the original software. 15 | // If you use this software in a product, an acknowledgment 16 | // in the product documentation would be appreciated but is not required. 17 | // 18 | // 2. Altered source versions must be plainly marked as such, 19 | // and must not be misrepresented as being the original software. 20 | // 21 | // 3. This notice may not be removed or altered from any source distribution. 22 | // 23 | //////////////////////////////////////////////////////////// 24 | 25 | #ifndef SFML_AUDIO_HPP 26 | #define SFML_AUDIO_HPP 27 | 28 | //////////////////////////////////////////////////////////// 29 | // Headers 30 | //////////////////////////////////////////////////////////// 31 | 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | #include 41 | #include 42 | #include 43 | #include 44 | #include 45 | #include 46 | 47 | 48 | #endif // SFML_AUDIO_HPP 49 | 50 | //////////////////////////////////////////////////////////// 51 | /// \defgroup audio Audio module 52 | /// 53 | /// Sounds, streaming (musics or custom sources), recording, 54 | /// spatialization. 55 | /// 56 | //////////////////////////////////////////////////////////// 57 | -------------------------------------------------------------------------------- /SpriteAnimator/third-party/sfml/include/SFML/Audio/AlResource.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////// 2 | // 3 | // SFML - Simple and Fast Multimedia Library 4 | // Copyright (C) 2007-2018 Laurent Gomila (laurent@sfml-dev.org) 5 | // 6 | // This software is provided 'as-is', without any express or implied warranty. 7 | // In no event will the authors be held liable for any damages arising from the use of this software. 8 | // 9 | // Permission is granted to anyone to use this software for any purpose, 10 | // including commercial applications, and to alter it and redistribute it freely, 11 | // subject to the following restrictions: 12 | // 13 | // 1. The origin of this software must not be misrepresented; 14 | // you must not claim that you wrote the original software. 15 | // If you use this software in a product, an acknowledgment 16 | // in the product documentation would be appreciated but is not required. 17 | // 18 | // 2. Altered source versions must be plainly marked as such, 19 | // and must not be misrepresented as being the original software. 20 | // 21 | // 3. This notice may not be removed or altered from any source distribution. 22 | // 23 | //////////////////////////////////////////////////////////// 24 | 25 | #ifndef SFML_ALRESOURCE_HPP 26 | #define SFML_ALRESOURCE_HPP 27 | 28 | //////////////////////////////////////////////////////////// 29 | // Headers 30 | //////////////////////////////////////////////////////////// 31 | #include 32 | 33 | 34 | namespace sf 35 | { 36 | //////////////////////////////////////////////////////////// 37 | /// \brief Base class for classes that require an OpenAL context 38 | /// 39 | //////////////////////////////////////////////////////////// 40 | class SFML_AUDIO_API AlResource 41 | { 42 | protected: 43 | 44 | //////////////////////////////////////////////////////////// 45 | /// \brief Default constructor 46 | /// 47 | //////////////////////////////////////////////////////////// 48 | AlResource(); 49 | 50 | //////////////////////////////////////////////////////////// 51 | /// \brief Destructor 52 | /// 53 | //////////////////////////////////////////////////////////// 54 | ~AlResource(); 55 | }; 56 | 57 | } // namespace sf 58 | 59 | 60 | #endif // SFML_ALRESOURCE_HPP 61 | 62 | //////////////////////////////////////////////////////////// 63 | /// \class sf::AlResource 64 | /// \ingroup audio 65 | /// 66 | /// This class is for internal use only, it must be the base 67 | /// of every class that requires a valid OpenAL context in 68 | /// order to work. 69 | /// 70 | //////////////////////////////////////////////////////////// 71 | -------------------------------------------------------------------------------- /SpriteAnimator/third-party/sfml/include/SFML/Audio/Export.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////// 2 | // 3 | // SFML - Simple and Fast Multimedia Library 4 | // Copyright (C) 2007-2018 Laurent Gomila (laurent@sfml-dev.org) 5 | // 6 | // This software is provided 'as-is', without any express or implied warranty. 7 | // In no event will the authors be held liable for any damages arising from the use of this software. 8 | // 9 | // Permission is granted to anyone to use this software for any purpose, 10 | // including commercial applications, and to alter it and redistribute it freely, 11 | // subject to the following restrictions: 12 | // 13 | // 1. The origin of this software must not be misrepresented; 14 | // you must not claim that you wrote the original software. 15 | // If you use this software in a product, an acknowledgment 16 | // in the product documentation would be appreciated but is not required. 17 | // 18 | // 2. Altered source versions must be plainly marked as such, 19 | // and must not be misrepresented as being the original software. 20 | // 21 | // 3. This notice may not be removed or altered from any source distribution. 22 | // 23 | //////////////////////////////////////////////////////////// 24 | 25 | #ifndef SFML_AUDIO_EXPORT_HPP 26 | #define SFML_AUDIO_EXPORT_HPP 27 | 28 | //////////////////////////////////////////////////////////// 29 | // Headers 30 | //////////////////////////////////////////////////////////// 31 | #include 32 | 33 | 34 | //////////////////////////////////////////////////////////// 35 | // Define portable import / export macros 36 | //////////////////////////////////////////////////////////// 37 | #if defined(SFML_AUDIO_EXPORTS) 38 | 39 | #define SFML_AUDIO_API SFML_API_EXPORT 40 | 41 | #else 42 | 43 | #define SFML_AUDIO_API SFML_API_IMPORT 44 | 45 | #endif 46 | 47 | 48 | #endif // SFML_AUDIO_EXPORT_HPP 49 | -------------------------------------------------------------------------------- /SpriteAnimator/third-party/sfml/include/SFML/Audio/SoundFileFactory.inl: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////// 2 | // 3 | // SFML - Simple and Fast Multimedia Library 4 | // Copyright (C) 2007-2018 Laurent Gomila (laurent@sfml-dev.org) 5 | // 6 | // This software is provided 'as-is', without any express or implied warranty. 7 | // In no event will the authors be held liable for any damages arising from the use of this software. 8 | // 9 | // Permission is granted to anyone to use this software for any purpose, 10 | // including commercial applications, and to alter it and redistribute it freely, 11 | // subject to the following restrictions: 12 | // 13 | // 1. The origin of this software must not be misrepresented; 14 | // you must not claim that you wrote the original software. 15 | // If you use this software in a product, an acknowledgment 16 | // in the product documentation would be appreciated but is not required. 17 | // 18 | // 2. Altered source versions must be plainly marked as such, 19 | // and must not be misrepresented as being the original software. 20 | // 21 | // 3. This notice may not be removed or altered from any source distribution. 22 | // 23 | //////////////////////////////////////////////////////////// 24 | 25 | //////////////////////////////////////////////////////////// 26 | // Headers 27 | //////////////////////////////////////////////////////////// 28 | 29 | 30 | namespace sf 31 | { 32 | namespace priv 33 | { 34 | template SoundFileReader* createReader() {return new T;} 35 | template SoundFileWriter* createWriter() {return new T;} 36 | } 37 | 38 | //////////////////////////////////////////////////////////// 39 | template 40 | void SoundFileFactory::registerReader() 41 | { 42 | // Make sure the same class won't be registered twice 43 | unregisterReader(); 44 | 45 | // Create a new factory with the functions provided by the class 46 | ReaderFactory factory; 47 | factory.check = &T::check; 48 | factory.create = &priv::createReader; 49 | 50 | // Add it 51 | s_readers.push_back(factory); 52 | } 53 | 54 | 55 | //////////////////////////////////////////////////////////// 56 | template 57 | void SoundFileFactory::unregisterReader() 58 | { 59 | // Remove the instance(s) of the reader from the array of factories 60 | for (ReaderFactoryArray::iterator it = s_readers.begin(); it != s_readers.end(); ) 61 | { 62 | if (it->create == &priv::createReader) 63 | it = s_readers.erase(it); 64 | else 65 | ++it; 66 | } 67 | } 68 | 69 | //////////////////////////////////////////////////////////// 70 | template 71 | void SoundFileFactory::registerWriter() 72 | { 73 | // Make sure the same class won't be registered twice 74 | unregisterWriter(); 75 | 76 | // Create a new factory with the functions provided by the class 77 | WriterFactory factory; 78 | factory.check = &T::check; 79 | factory.create = &priv::createWriter; 80 | 81 | // Add it 82 | s_writers.push_back(factory); 83 | } 84 | 85 | 86 | //////////////////////////////////////////////////////////// 87 | template 88 | void SoundFileFactory::unregisterWriter() 89 | { 90 | // Remove the instance(s) of the writer from the array of factories 91 | for (WriterFactoryArray::iterator it = s_writers.begin(); it != s_writers.end(); ) 92 | { 93 | if (it->create == &priv::createWriter) 94 | it = s_writers.erase(it); 95 | else 96 | ++it; 97 | } 98 | } 99 | 100 | } // namespace sf 101 | -------------------------------------------------------------------------------- /SpriteAnimator/third-party/sfml/include/SFML/GpuPreference.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////// 2 | // 3 | // SFML - Simple and Fast Multimedia Library 4 | // Copyright (C) 2007-2018 Laurent Gomila (laurent@sfml-dev.org) 5 | // 6 | // This software is provided 'as-is', without any express or implied warranty. 7 | // In no event will the authors be held liable for any damages arising from the use of this software. 8 | // 9 | // Permission is granted to anyone to use this software for any purpose, 10 | // including commercial applications, and to alter it and redistribute it freely, 11 | // subject to the following restrictions: 12 | // 13 | // 1. The origin of this software must not be misrepresented; 14 | // you must not claim that you wrote the original software. 15 | // If you use this software in a product, an acknowledgment 16 | // in the product documentation would be appreciated but is not required. 17 | // 18 | // 2. Altered source versions must be plainly marked as such, 19 | // and must not be misrepresented as being the original software. 20 | // 21 | // 3. This notice may not be removed or altered from any source distribution. 22 | // 23 | //////////////////////////////////////////////////////////// 24 | 25 | #ifndef SFML_GPUPREFERENCE_HPP 26 | #define SFML_GPUPREFERENCE_HPP 27 | 28 | 29 | //////////////////////////////////////////////////////////// 30 | /// Headers 31 | //////////////////////////////////////////////////////////// 32 | #include 33 | 34 | 35 | //////////////////////////////////////////////////////////// 36 | /// \file 37 | /// 38 | /// \brief File containing SFML_DEFINE_DISCRETE_GPU_PREFERENCE 39 | /// 40 | //////////////////////////////////////////////////////////// 41 | 42 | 43 | //////////////////////////////////////////////////////////// 44 | /// \def SFML_DEFINE_DISCRETE_GPU_PREFERENCE 45 | /// 46 | /// \brief A macro to encourage usage of the discrete GPU 47 | /// 48 | /// In order to inform the Nvidia/AMD driver that an SFML 49 | /// application could benefit from using the more powerful 50 | /// discrete GPU, special symbols have to be publicly 51 | /// exported from the final executable. 52 | /// 53 | /// SFML defines a helper macro to easily do this. 54 | /// 55 | /// Place SFML_DEFINE_DISCRETE_GPU_PREFERENCE in the 56 | /// global scope of a source file that will be linked into 57 | /// the final executable. Typically it is best to place it 58 | /// where the main function is also defined. 59 | /// 60 | //////////////////////////////////////////////////////////// 61 | #if defined(SFML_SYSTEM_WINDOWS) 62 | 63 | #define SFML_DEFINE_DISCRETE_GPU_PREFERENCE \ 64 | extern "C" __declspec(dllexport) unsigned long NvOptimusEnablement = 1; \ 65 | extern "C" __declspec(dllexport) unsigned long AmdPowerXpressRequestHighPerformance = 1; 66 | 67 | #else 68 | 69 | #define SFML_DEFINE_DISCRETE_GPU_PREFERENCE 70 | 71 | #endif 72 | 73 | 74 | #endif // SFML_GPUPREFERENCE_HPP 75 | -------------------------------------------------------------------------------- /SpriteAnimator/third-party/sfml/include/SFML/Graphics.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////// 2 | // 3 | // SFML - Simple and Fast Multimedia Library 4 | // Copyright (C) 2007-2018 Laurent Gomila (laurent@sfml-dev.org) 5 | // 6 | // This software is provided 'as-is', without any express or implied warranty. 7 | // In no event will the authors be held liable for any damages arising from the use of this software. 8 | // 9 | // Permission is granted to anyone to use this software for any purpose, 10 | // including commercial applications, and to alter it and redistribute it freely, 11 | // subject to the following restrictions: 12 | // 13 | // 1. The origin of this software must not be misrepresented; 14 | // you must not claim that you wrote the original software. 15 | // If you use this software in a product, an acknowledgment 16 | // in the product documentation would be appreciated but is not required. 17 | // 18 | // 2. Altered source versions must be plainly marked as such, 19 | // and must not be misrepresented as being the original software. 20 | // 21 | // 3. This notice may not be removed or altered from any source distribution. 22 | // 23 | //////////////////////////////////////////////////////////// 24 | 25 | #ifndef SFML_GRAPHICS_HPP 26 | #define SFML_GRAPHICS_HPP 27 | 28 | //////////////////////////////////////////////////////////// 29 | // Headers 30 | //////////////////////////////////////////////////////////// 31 | 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | #include 41 | #include 42 | #include 43 | #include 44 | #include 45 | #include 46 | #include 47 | #include 48 | #include 49 | #include 50 | #include 51 | #include 52 | #include 53 | #include 54 | #include 55 | #include 56 | #include 57 | #include 58 | #include 59 | 60 | 61 | #endif // SFML_GRAPHICS_HPP 62 | 63 | //////////////////////////////////////////////////////////// 64 | /// \defgroup graphics Graphics module 65 | /// 66 | /// 2D graphics module: sprites, text, shapes, ... 67 | /// 68 | //////////////////////////////////////////////////////////// 69 | -------------------------------------------------------------------------------- /SpriteAnimator/third-party/sfml/include/SFML/Graphics/Export.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////// 2 | // 3 | // SFML - Simple and Fast Multimedia Library 4 | // Copyright (C) 2007-2018 Laurent Gomila (laurent@sfml-dev.org) 5 | // 6 | // This software is provided 'as-is', without any express or implied warranty. 7 | // In no event will the authors be held liable for any damages arising from the use of this software. 8 | // 9 | // Permission is granted to anyone to use this software for any purpose, 10 | // including commercial applications, and to alter it and redistribute it freely, 11 | // subject to the following restrictions: 12 | // 13 | // 1. The origin of this software must not be misrepresented; 14 | // you must not claim that you wrote the original software. 15 | // If you use this software in a product, an acknowledgment 16 | // in the product documentation would be appreciated but is not required. 17 | // 18 | // 2. Altered source versions must be plainly marked as such, 19 | // and must not be misrepresented as being the original software. 20 | // 21 | // 3. This notice may not be removed or altered from any source distribution. 22 | // 23 | //////////////////////////////////////////////////////////// 24 | 25 | #ifndef SFML_GRAPHICS_EXPORT_HPP 26 | #define SFML_GRAPHICS_EXPORT_HPP 27 | 28 | //////////////////////////////////////////////////////////// 29 | // Headers 30 | //////////////////////////////////////////////////////////// 31 | #include 32 | 33 | 34 | //////////////////////////////////////////////////////////// 35 | // Define portable import / export macros 36 | //////////////////////////////////////////////////////////// 37 | #if defined(SFML_GRAPHICS_EXPORTS) 38 | 39 | #define SFML_GRAPHICS_API SFML_API_EXPORT 40 | 41 | #else 42 | 43 | #define SFML_GRAPHICS_API SFML_API_IMPORT 44 | 45 | #endif 46 | 47 | 48 | #endif // SFML_GRAPHICS_EXPORT_HPP 49 | -------------------------------------------------------------------------------- /SpriteAnimator/third-party/sfml/include/SFML/Graphics/Glyph.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////// 2 | // 3 | // SFML - Simple and Fast Multimedia Library 4 | // Copyright (C) 2007-2018 Laurent Gomila (laurent@sfml-dev.org) 5 | // 6 | // This software is provided 'as-is', without any express or implied warranty. 7 | // In no event will the authors be held liable for any damages arising from the use of this software. 8 | // 9 | // Permission is granted to anyone to use this software for any purpose, 10 | // including commercial applications, and to alter it and redistribute it freely, 11 | // subject to the following restrictions: 12 | // 13 | // 1. The origin of this software must not be misrepresented; 14 | // you must not claim that you wrote the original software. 15 | // If you use this software in a product, an acknowledgment 16 | // in the product documentation would be appreciated but is not required. 17 | // 18 | // 2. Altered source versions must be plainly marked as such, 19 | // and must not be misrepresented as being the original software. 20 | // 21 | // 3. This notice may not be removed or altered from any source distribution. 22 | // 23 | //////////////////////////////////////////////////////////// 24 | 25 | #ifndef SFML_GLYPH_HPP 26 | #define SFML_GLYPH_HPP 27 | 28 | //////////////////////////////////////////////////////////// 29 | // Headers 30 | //////////////////////////////////////////////////////////// 31 | #include 32 | #include 33 | 34 | 35 | namespace sf 36 | { 37 | //////////////////////////////////////////////////////////// 38 | /// \brief Structure describing a glyph 39 | /// 40 | //////////////////////////////////////////////////////////// 41 | class SFML_GRAPHICS_API Glyph 42 | { 43 | public: 44 | 45 | //////////////////////////////////////////////////////////// 46 | /// \brief Default constructor 47 | /// 48 | //////////////////////////////////////////////////////////// 49 | Glyph() : advance(0) {} 50 | 51 | //////////////////////////////////////////////////////////// 52 | // Member data 53 | //////////////////////////////////////////////////////////// 54 | float advance; ///< Offset to move horizontally to the next character 55 | FloatRect bounds; ///< Bounding rectangle of the glyph, in coordinates relative to the baseline 56 | IntRect textureRect; ///< Texture coordinates of the glyph inside the font's texture 57 | }; 58 | 59 | } // namespace sf 60 | 61 | 62 | #endif // SFML_GLYPH_HPP 63 | 64 | 65 | //////////////////////////////////////////////////////////// 66 | /// \class sf::Glyph 67 | /// \ingroup graphics 68 | /// 69 | /// A glyph is the visual representation of a character. 70 | /// 71 | /// The sf::Glyph structure provides the information needed 72 | /// to handle the glyph: 73 | /// \li its coordinates in the font's texture 74 | /// \li its bounding rectangle 75 | /// \li the offset to apply to get the starting position of the next glyph 76 | /// 77 | /// \see sf::Font 78 | /// 79 | //////////////////////////////////////////////////////////// 80 | -------------------------------------------------------------------------------- /SpriteAnimator/third-party/sfml/include/SFML/Graphics/PrimitiveType.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////// 2 | // 3 | // SFML - Simple and Fast Multimedia Library 4 | // Copyright (C) 2007-2018 Laurent Gomila (laurent@sfml-dev.org) 5 | // 6 | // This software is provided 'as-is', without any express or implied warranty. 7 | // In no event will the authors be held liable for any damages arising from the use of this software. 8 | // 9 | // Permission is granted to anyone to use this software for any purpose, 10 | // including commercial applications, and to alter it and redistribute it freely, 11 | // subject to the following restrictions: 12 | // 13 | // 1. The origin of this software must not be misrepresented; 14 | // you must not claim that you wrote the original software. 15 | // If you use this software in a product, an acknowledgment 16 | // in the product documentation would be appreciated but is not required. 17 | // 18 | // 2. Altered source versions must be plainly marked as such, 19 | // and must not be misrepresented as being the original software. 20 | // 21 | // 3. This notice may not be removed or altered from any source distribution. 22 | // 23 | //////////////////////////////////////////////////////////// 24 | 25 | #ifndef SFML_PRIMITIVETYPE_HPP 26 | #define SFML_PRIMITIVETYPE_HPP 27 | 28 | namespace sf 29 | { 30 | //////////////////////////////////////////////////////////// 31 | /// \ingroup graphics 32 | /// \brief Types of primitives that a sf::VertexArray can render 33 | /// 34 | /// Points and lines have no area, therefore their thickness 35 | /// will always be 1 pixel, regardless the current transform 36 | /// and view. 37 | /// 38 | //////////////////////////////////////////////////////////// 39 | enum PrimitiveType 40 | { 41 | Points, ///< List of individual points 42 | Lines, ///< List of individual lines 43 | LineStrip, ///< List of connected lines, a point uses the previous point to form a line 44 | Triangles, ///< List of individual triangles 45 | TriangleStrip, ///< List of connected triangles, a point uses the two previous points to form a triangle 46 | TriangleFan, ///< List of connected triangles, a point uses the common center and the previous point to form a triangle 47 | Quads, ///< List of individual quads (deprecated, don't work with OpenGL ES) 48 | 49 | // Deprecated names 50 | LinesStrip = LineStrip, ///< \deprecated Use LineStrip instead 51 | TrianglesStrip = TriangleStrip, ///< \deprecated Use TriangleStrip instead 52 | TrianglesFan = TriangleFan ///< \deprecated Use TriangleFan instead 53 | }; 54 | 55 | } // namespace sf 56 | 57 | 58 | #endif // SFML_PRIMITIVETYPE_HPP 59 | -------------------------------------------------------------------------------- /SpriteAnimator/third-party/sfml/include/SFML/Main.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////// 2 | // 3 | // SFML - Simple and Fast Multimedia Library 4 | // Copyright (C) 2007-2018 Laurent Gomila (laurent@sfml-dev.org) 5 | // 6 | // This software is provided 'as-is', without any express or implied warranty. 7 | // In no event will the authors be held liable for any damages arising from the use of this software. 8 | // 9 | // Permission is granted to anyone to use this software for any purpose, 10 | // including commercial applications, and to alter it and redistribute it freely, 11 | // subject to the following restrictions: 12 | // 13 | // 1. The origin of this software must not be misrepresented; 14 | // you must not claim that you wrote the original software. 15 | // If you use this software in a product, an acknowledgment 16 | // in the product documentation would be appreciated but is not required. 17 | // 18 | // 2. Altered source versions must be plainly marked as such, 19 | // and must not be misrepresented as being the original software. 20 | // 21 | // 3. This notice may not be removed or altered from any source distribution. 22 | // 23 | //////////////////////////////////////////////////////////// 24 | 25 | #ifndef SFML_MAIN_HPP 26 | #define SFML_MAIN_HPP 27 | 28 | //////////////////////////////////////////////////////////// 29 | // Headers 30 | //////////////////////////////////////////////////////////// 31 | #include 32 | 33 | 34 | #if defined(SFML_SYSTEM_IOS) 35 | 36 | // On iOS, we have no choice but to have our own main, 37 | // so we need to rename the user one and call it later 38 | #define main sfmlMain 39 | 40 | #endif 41 | 42 | 43 | #endif // SFML_MAIN_HPP 44 | -------------------------------------------------------------------------------- /SpriteAnimator/third-party/sfml/include/SFML/Network.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////// 2 | // 3 | // SFML - Simple and Fast Multimedia Library 4 | // Copyright (C) 2007-2018 Laurent Gomila (laurent@sfml-dev.org) 5 | // 6 | // This software is provided 'as-is', without any express or implied warranty. 7 | // In no event will the authors be held liable for any damages arising from the use of this software. 8 | // 9 | // Permission is granted to anyone to use this software for any purpose, 10 | // including commercial applications, and to alter it and redistribute it freely, 11 | // subject to the following restrictions: 12 | // 13 | // 1. The origin of this software must not be misrepresented; 14 | // you must not claim that you wrote the original software. 15 | // If you use this software in a product, an acknowledgment 16 | // in the product documentation would be appreciated but is not required. 17 | // 18 | // 2. Altered source versions must be plainly marked as such, 19 | // and must not be misrepresented as being the original software. 20 | // 21 | // 3. This notice may not be removed or altered from any source distribution. 22 | // 23 | //////////////////////////////////////////////////////////// 24 | 25 | #ifndef SFML_NETWORK_HPP 26 | #define SFML_NETWORK_HPP 27 | 28 | //////////////////////////////////////////////////////////// 29 | // Headers 30 | //////////////////////////////////////////////////////////// 31 | 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | #include 41 | #include 42 | #include 43 | 44 | 45 | #endif // SFML_NETWORK_HPP 46 | 47 | //////////////////////////////////////////////////////////// 48 | /// \defgroup network Network module 49 | /// 50 | /// Socket-based communication, utilities and higher-level 51 | /// network protocols (HTTP, FTP). 52 | /// 53 | //////////////////////////////////////////////////////////// 54 | -------------------------------------------------------------------------------- /SpriteAnimator/third-party/sfml/include/SFML/Network/Export.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////// 2 | // 3 | // SFML - Simple and Fast Multimedia Library 4 | // Copyright (C) 2007-2018 Laurent Gomila (laurent@sfml-dev.org) 5 | // 6 | // This software is provided 'as-is', without any express or implied warranty. 7 | // In no event will the authors be held liable for any damages arising from the use of this software. 8 | // 9 | // Permission is granted to anyone to use this software for any purpose, 10 | // including commercial applications, and to alter it and redistribute it freely, 11 | // subject to the following restrictions: 12 | // 13 | // 1. The origin of this software must not be misrepresented; 14 | // you must not claim that you wrote the original software. 15 | // If you use this software in a product, an acknowledgment 16 | // in the product documentation would be appreciated but is not required. 17 | // 18 | // 2. Altered source versions must be plainly marked as such, 19 | // and must not be misrepresented as being the original software. 20 | // 21 | // 3. This notice may not be removed or altered from any source distribution. 22 | // 23 | //////////////////////////////////////////////////////////// 24 | 25 | #ifndef SFML_NETWORK_EXPORT_HPP 26 | #define SFML_NETWORK_EXPORT_HPP 27 | 28 | //////////////////////////////////////////////////////////// 29 | // Headers 30 | //////////////////////////////////////////////////////////// 31 | #include 32 | 33 | 34 | //////////////////////////////////////////////////////////// 35 | // Define portable import / export macros 36 | //////////////////////////////////////////////////////////// 37 | #if defined(SFML_NETWORK_EXPORTS) 38 | 39 | #define SFML_NETWORK_API SFML_API_EXPORT 40 | 41 | #else 42 | 43 | #define SFML_NETWORK_API SFML_API_IMPORT 44 | 45 | #endif 46 | 47 | 48 | #endif // SFML_NETWORK_EXPORT_HPP 49 | -------------------------------------------------------------------------------- /SpriteAnimator/third-party/sfml/include/SFML/Network/SocketHandle.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////// 2 | // 3 | // SFML - Simple and Fast Multimedia Library 4 | // Copyright (C) 2007-2018 Laurent Gomila (laurent@sfml-dev.org) 5 | // 6 | // This software is provided 'as-is', without any express or implied warranty. 7 | // In no event will the authors be held liable for any damages arising from the use of this software. 8 | // 9 | // Permission is granted to anyone to use this software for any purpose, 10 | // including commercial applications, and to alter it and redistribute it freely, 11 | // subject to the following restrictions: 12 | // 13 | // 1. The origin of this software must not be misrepresented; 14 | // you must not claim that you wrote the original software. 15 | // If you use this software in a product, an acknowledgment 16 | // in the product documentation would be appreciated but is not required. 17 | // 18 | // 2. Altered source versions must be plainly marked as such, 19 | // and must not be misrepresented as being the original software. 20 | // 21 | // 3. This notice may not be removed or altered from any source distribution. 22 | // 23 | //////////////////////////////////////////////////////////// 24 | 25 | #ifndef SFML_SOCKETHANDLE_HPP 26 | #define SFML_SOCKETHANDLE_HPP 27 | 28 | //////////////////////////////////////////////////////////// 29 | // Headers 30 | //////////////////////////////////////////////////////////// 31 | #include 32 | 33 | #if defined(SFML_SYSTEM_WINDOWS) 34 | #include 35 | #endif 36 | 37 | 38 | namespace sf 39 | { 40 | //////////////////////////////////////////////////////////// 41 | // Define the low-level socket handle type, specific to 42 | // each platform 43 | //////////////////////////////////////////////////////////// 44 | #if defined(SFML_SYSTEM_WINDOWS) 45 | 46 | typedef UINT_PTR SocketHandle; 47 | 48 | #else 49 | 50 | typedef int SocketHandle; 51 | 52 | #endif 53 | 54 | } // namespace sf 55 | 56 | 57 | #endif // SFML_SOCKETHANDLE_HPP 58 | -------------------------------------------------------------------------------- /SpriteAnimator/third-party/sfml/include/SFML/OpenGL.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////// 2 | // 3 | // SFML - Simple and Fast Multimedia Library 4 | // Copyright (C) 2007-2018 Laurent Gomila (laurent@sfml-dev.org) 5 | // 6 | // This software is provided 'as-is', without any express or implied warranty. 7 | // In no event will the authors be held liable for any damages arising from the use of this software. 8 | // 9 | // Permission is granted to anyone to use this software for any purpose, 10 | // including commercial applications, and to alter it and redistribute it freely, 11 | // subject to the following restrictions: 12 | // 13 | // 1. The origin of this software must not be misrepresented; 14 | // you must not claim that you wrote the original software. 15 | // If you use this software in a product, an acknowledgment 16 | // in the product documentation would be appreciated but is not required. 17 | // 18 | // 2. Altered source versions must be plainly marked as such, 19 | // and must not be misrepresented as being the original software. 20 | // 21 | // 3. This notice may not be removed or altered from any source distribution. 22 | // 23 | //////////////////////////////////////////////////////////// 24 | 25 | #ifndef SFML_OPENGL_HPP 26 | #define SFML_OPENGL_HPP 27 | 28 | 29 | //////////////////////////////////////////////////////////// 30 | /// Headers 31 | //////////////////////////////////////////////////////////// 32 | #include 33 | 34 | 35 | //////////////////////////////////////////////////////////// 36 | /// This file just includes the OpenGL headers, 37 | /// which have actually different paths on each system 38 | //////////////////////////////////////////////////////////// 39 | #if defined(SFML_SYSTEM_WINDOWS) 40 | 41 | // The Visual C++ version of gl.h uses WINGDIAPI and APIENTRY but doesn't define them 42 | #ifdef _MSC_VER 43 | #include 44 | #endif 45 | 46 | #include 47 | 48 | #elif defined(SFML_SYSTEM_LINUX) || defined(SFML_SYSTEM_FREEBSD) || defined(SFML_SYSTEM_OPENBSD) 49 | 50 | #if defined(SFML_OPENGL_ES) 51 | #include 52 | #include 53 | #else 54 | #include 55 | #endif 56 | 57 | #elif defined(SFML_SYSTEM_MACOS) 58 | 59 | #include 60 | 61 | #elif defined (SFML_SYSTEM_IOS) 62 | 63 | #include 64 | #include 65 | 66 | #elif defined (SFML_SYSTEM_ANDROID) 67 | 68 | #include 69 | #include 70 | 71 | // We're not using OpenGL ES 2+ yet, but we can use the sRGB extension 72 | #include 73 | #include 74 | 75 | #endif 76 | 77 | 78 | #endif // SFML_OPENGL_HPP 79 | -------------------------------------------------------------------------------- /SpriteAnimator/third-party/sfml/include/SFML/System.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////// 2 | // 3 | // SFML - Simple and Fast Multimedia Library 4 | // Copyright (C) 2007-2018 Laurent Gomila (laurent@sfml-dev.org) 5 | // 6 | // This software is provided 'as-is', without any express or implied warranty. 7 | // In no event will the authors be held liable for any damages arising from the use of this software. 8 | // 9 | // Permission is granted to anyone to use this software for any purpose, 10 | // including commercial applications, and to alter it and redistribute it freely, 11 | // subject to the following restrictions: 12 | // 13 | // 1. The origin of this software must not be misrepresented; 14 | // you must not claim that you wrote the original software. 15 | // If you use this software in a product, an acknowledgment 16 | // in the product documentation would be appreciated but is not required. 17 | // 18 | // 2. Altered source versions must be plainly marked as such, 19 | // and must not be misrepresented as being the original software. 20 | // 21 | // 3. This notice may not be removed or altered from any source distribution. 22 | // 23 | //////////////////////////////////////////////////////////// 24 | 25 | #ifndef SFML_SYSTEM_HPP 26 | #define SFML_SYSTEM_HPP 27 | 28 | //////////////////////////////////////////////////////////// 29 | // Headers 30 | //////////////////////////////////////////////////////////// 31 | 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | #include 41 | #include 42 | #include 43 | #include 44 | #include 45 | #include 46 | #include 47 | #include 48 | #include 49 | #include 50 | 51 | #endif // SFML_SYSTEM_HPP 52 | 53 | //////////////////////////////////////////////////////////// 54 | /// \defgroup system System module 55 | /// 56 | /// Base module of SFML, defining various utilities. It provides 57 | /// vector classes, Unicode strings and conversion functions, 58 | /// threads and mutexes, timing classes. 59 | /// 60 | //////////////////////////////////////////////////////////// 61 | -------------------------------------------------------------------------------- /SpriteAnimator/third-party/sfml/include/SFML/System/Err.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////// 2 | // 3 | // SFML - Simple and Fast Multimedia Library 4 | // Copyright (C) 2007-2018 Laurent Gomila (laurent@sfml-dev.org) 5 | // 6 | // This software is provided 'as-is', without any express or implied warranty. 7 | // In no event will the authors be held liable for any damages arising from the use of this software. 8 | // 9 | // Permission is granted to anyone to use this software for any purpose, 10 | // including commercial applications, and to alter it and redistribute it freely, 11 | // subject to the following restrictions: 12 | // 13 | // 1. The origin of this software must not be misrepresented; 14 | // you must not claim that you wrote the original software. 15 | // If you use this software in a product, an acknowledgment 16 | // in the product documentation would be appreciated but is not required. 17 | // 18 | // 2. Altered source versions must be plainly marked as such, 19 | // and must not be misrepresented as being the original software. 20 | // 21 | // 3. This notice may not be removed or altered from any source distribution. 22 | // 23 | //////////////////////////////////////////////////////////// 24 | 25 | #ifndef SFML_ERR_HPP 26 | #define SFML_ERR_HPP 27 | 28 | //////////////////////////////////////////////////////////// 29 | // Headers 30 | //////////////////////////////////////////////////////////// 31 | #include 32 | #include 33 | 34 | 35 | namespace sf 36 | { 37 | //////////////////////////////////////////////////////////// 38 | /// \brief Standard stream used by SFML to output warnings and errors 39 | /// 40 | //////////////////////////////////////////////////////////// 41 | SFML_SYSTEM_API std::ostream& err(); 42 | 43 | } // namespace sf 44 | 45 | 46 | #endif // SFML_ERR_HPP 47 | 48 | 49 | //////////////////////////////////////////////////////////// 50 | /// \fn sf::err 51 | /// \ingroup system 52 | /// 53 | /// By default, sf::err() outputs to the same location as std::cerr, 54 | /// (-> the stderr descriptor) which is the console if there's 55 | /// one available. 56 | /// 57 | /// It is a standard std::ostream instance, so it supports all the 58 | /// insertion operations defined by the STL 59 | /// (operator <<, manipulators, etc.). 60 | /// 61 | /// sf::err() can be redirected to write to another output, independently 62 | /// of std::cerr, by using the rdbuf() function provided by the 63 | /// std::ostream class. 64 | /// 65 | /// Example: 66 | /// \code 67 | /// // Redirect to a file 68 | /// std::ofstream file("sfml-log.txt"); 69 | /// std::streambuf* previous = sf::err().rdbuf(file.rdbuf()); 70 | /// 71 | /// // Redirect to nothing 72 | /// sf::err().rdbuf(NULL); 73 | /// 74 | /// // Restore the original output 75 | /// sf::err().rdbuf(previous); 76 | /// \endcode 77 | /// 78 | /// \return Reference to std::ostream representing the SFML error stream 79 | /// 80 | //////////////////////////////////////////////////////////// 81 | -------------------------------------------------------------------------------- /SpriteAnimator/third-party/sfml/include/SFML/System/Export.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////// 2 | // 3 | // SFML - Simple and Fast Multimedia Library 4 | // Copyright (C) 2007-2018 Laurent Gomila (laurent@sfml-dev.org) 5 | // 6 | // This software is provided 'as-is', without any express or implied warranty. 7 | // In no event will the authors be held liable for any damages arising from the use of this software. 8 | // 9 | // Permission is granted to anyone to use this software for any purpose, 10 | // including commercial applications, and to alter it and redistribute it freely, 11 | // subject to the following restrictions: 12 | // 13 | // 1. The origin of this software must not be misrepresented; 14 | // you must not claim that you wrote the original software. 15 | // If you use this software in a product, an acknowledgment 16 | // in the product documentation would be appreciated but is not required. 17 | // 18 | // 2. Altered source versions must be plainly marked as such, 19 | // and must not be misrepresented as being the original software. 20 | // 21 | // 3. This notice may not be removed or altered from any source distribution. 22 | // 23 | //////////////////////////////////////////////////////////// 24 | 25 | #ifndef SFML_SYSTEM_EXPORT_HPP 26 | #define SFML_SYSTEM_EXPORT_HPP 27 | 28 | //////////////////////////////////////////////////////////// 29 | // Headers 30 | //////////////////////////////////////////////////////////// 31 | #include 32 | 33 | 34 | //////////////////////////////////////////////////////////// 35 | // Define portable import / export macros 36 | //////////////////////////////////////////////////////////// 37 | #if defined(SFML_SYSTEM_EXPORTS) 38 | 39 | #define SFML_SYSTEM_API SFML_API_EXPORT 40 | 41 | #else 42 | 43 | #define SFML_SYSTEM_API SFML_API_IMPORT 44 | 45 | #endif 46 | 47 | 48 | #endif // SFML_SYSTEM_EXPORT_HPP 49 | -------------------------------------------------------------------------------- /SpriteAnimator/third-party/sfml/include/SFML/System/NativeActivity.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////// 2 | // 3 | // SFML - Simple and Fast Multimedia Library 4 | // Copyright (C) 2007-2018 Laurent Gomila (laurent@sfml-dev.org) 5 | // 6 | // This software is provided 'as-is', without any express or implied warranty. 7 | // In no event will the authors be held liable for any damages arising from the use of this software. 8 | // 9 | // Permission is granted to anyone to use this software for any purpose, 10 | // including commercial applications, and to alter it and redistribute it freely, 11 | // subject to the following restrictions: 12 | // 13 | // 1. The origin of this software must not be misrepresented; 14 | // you must not claim that you wrote the original software. 15 | // If you use this software in a product, an acknowledgment 16 | // in the product documentation would be appreciated but is not required. 17 | // 18 | // 2. Altered source versions must be plainly marked as such, 19 | // and must not be misrepresented as being the original software. 20 | // 21 | // 3. This notice may not be removed or altered from any source distribution. 22 | // 23 | //////////////////////////////////////////////////////////// 24 | 25 | #ifndef SFML_NATIVEACTIVITY_HPP 26 | #define SFML_NATIVEACTIVITY_HPP 27 | 28 | 29 | //////////////////////////////////////////////////////////// 30 | // Headers 31 | //////////////////////////////////////////////////////////// 32 | #include 33 | 34 | 35 | #if !defined(SFML_SYSTEM_ANDROID) 36 | #error NativeActivity.hpp: This header is Android only. 37 | #endif 38 | 39 | 40 | struct ANativeActivity; 41 | 42 | namespace sf 43 | { 44 | //////////////////////////////////////////////////////////// 45 | /// \ingroup system 46 | /// \brief Return a pointer to the Android native activity 47 | /// 48 | /// You shouldn't have to use this function, unless you want 49 | /// to implement very specific details, that SFML doesn't 50 | /// support, or to use a workaround for a known issue. 51 | /// 52 | /// \return Pointer to Android native activity structure 53 | /// 54 | /// \sfplatform{Android,SFML/System/NativeActivity.hpp} 55 | /// 56 | //////////////////////////////////////////////////////////// 57 | SFML_SYSTEM_API ANativeActivity* getNativeActivity(); 58 | 59 | } // namespace sf 60 | 61 | 62 | #endif // SFML_NATIVEACTIVITY_HPP 63 | -------------------------------------------------------------------------------- /SpriteAnimator/third-party/sfml/include/SFML/System/Sleep.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////// 2 | // 3 | // SFML - Simple and Fast Multimedia Library 4 | // Copyright (C) 2007-2018 Laurent Gomila (laurent@sfml-dev.org) 5 | // 6 | // This software is provided 'as-is', without any express or implied warranty. 7 | // In no event will the authors be held liable for any damages arising from the use of this software. 8 | // 9 | // Permission is granted to anyone to use this software for any purpose, 10 | // including commercial applications, and to alter it and redistribute it freely, 11 | // subject to the following restrictions: 12 | // 13 | // 1. The origin of this software must not be misrepresented; 14 | // you must not claim that you wrote the original software. 15 | // If you use this software in a product, an acknowledgment 16 | // in the product documentation would be appreciated but is not required. 17 | // 18 | // 2. Altered source versions must be plainly marked as such, 19 | // and must not be misrepresented as being the original software. 20 | // 21 | // 3. This notice may not be removed or altered from any source distribution. 22 | // 23 | //////////////////////////////////////////////////////////// 24 | 25 | #ifndef SFML_SLEEP_HPP 26 | #define SFML_SLEEP_HPP 27 | 28 | //////////////////////////////////////////////////////////// 29 | // Headers 30 | //////////////////////////////////////////////////////////// 31 | #include 32 | #include 33 | 34 | 35 | namespace sf 36 | { 37 | //////////////////////////////////////////////////////////// 38 | /// \ingroup system 39 | /// \brief Make the current thread sleep for a given duration 40 | /// 41 | /// sf::sleep is the best way to block a program or one of its 42 | /// threads, as it doesn't consume any CPU power. 43 | /// 44 | /// \param duration Time to sleep 45 | /// 46 | //////////////////////////////////////////////////////////// 47 | void SFML_SYSTEM_API sleep(Time duration); 48 | 49 | } // namespace sf 50 | 51 | 52 | #endif // SFML_SLEEP_HPP 53 | -------------------------------------------------------------------------------- /SpriteAnimator/third-party/sfml/include/SFML/System/String.inl: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////// 2 | // 3 | // SFML - Simple and Fast Multimedia Library 4 | // Copyright (C) 2007-2018 Laurent Gomila (laurent@sfml-dev.org) 5 | // 6 | // This software is provided 'as-is', without any express or implied warranty. 7 | // In no event will the authors be held liable for any damages arising from the use of this software. 8 | // 9 | // Permission is granted to anyone to use this software for any purpose, 10 | // including commercial applications, and to alter it and redistribute it freely, 11 | // subject to the following restrictions: 12 | // 13 | // 1. The origin of this software must not be misrepresented; 14 | // you must not claim that you wrote the original software. 15 | // If you use this software in a product, an acknowledgment 16 | // in the product documentation would be appreciated but is not required. 17 | // 18 | // 2. Altered source versions must be plainly marked as such, 19 | // and must not be misrepresented as being the original software. 20 | // 21 | // 3. This notice may not be removed or altered from any source distribution. 22 | // 23 | //////////////////////////////////////////////////////////// 24 | 25 | 26 | //////////////////////////////////////////////////////////// 27 | template 28 | String String::fromUtf8(T begin, T end) 29 | { 30 | String string; 31 | Utf8::toUtf32(begin, end, std::back_inserter(string.m_string)); 32 | return string; 33 | } 34 | 35 | 36 | //////////////////////////////////////////////////////////// 37 | template 38 | String String::fromUtf16(T begin, T end) 39 | { 40 | String string; 41 | Utf16::toUtf32(begin, end, std::back_inserter(string.m_string)); 42 | return string; 43 | } 44 | 45 | 46 | //////////////////////////////////////////////////////////// 47 | template 48 | String String::fromUtf32(T begin, T end) 49 | { 50 | String string; 51 | string.m_string.assign(begin, end); 52 | return string; 53 | } 54 | -------------------------------------------------------------------------------- /SpriteAnimator/third-party/sfml/include/SFML/System/Thread.inl: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////// 2 | // 3 | // SFML - Simple and Fast Multimedia Library 4 | // Copyright (C) 2007-2018 Laurent Gomila (laurent@sfml-dev.org) 5 | // 6 | // This software is provided 'as-is', without any express or implied warranty. 7 | // In no event will the authors be held liable for any damages arising from the use of this software. 8 | // 9 | // Permission is granted to anyone to use this software for any purpose, 10 | // including commercial applications, and to alter it and redistribute it freely, 11 | // subject to the following restrictions: 12 | // 13 | // 1. The origin of this software must not be misrepresented; 14 | // you must not claim that you wrote the original software. 15 | // If you use this software in a product, an acknowledgment 16 | // in the product documentation would be appreciated but is not required. 17 | // 18 | // 2. Altered source versions must be plainly marked as such, 19 | // and must not be misrepresented as being the original software. 20 | // 21 | // 3. This notice may not be removed or altered from any source distribution. 22 | // 23 | //////////////////////////////////////////////////////////// 24 | 25 | namespace priv 26 | { 27 | // Base class for abstract thread functions 28 | struct ThreadFunc 29 | { 30 | virtual ~ThreadFunc() {} 31 | virtual void run() = 0; 32 | }; 33 | 34 | // Specialization using a functor (including free functions) with no argument 35 | template 36 | struct ThreadFunctor : ThreadFunc 37 | { 38 | ThreadFunctor(T functor) : m_functor(functor) {} 39 | virtual void run() {m_functor();} 40 | T m_functor; 41 | }; 42 | 43 | // Specialization using a functor (including free functions) with one argument 44 | template 45 | struct ThreadFunctorWithArg : ThreadFunc 46 | { 47 | ThreadFunctorWithArg(F function, A arg) : m_function(function), m_arg(arg) {} 48 | virtual void run() {m_function(m_arg);} 49 | F m_function; 50 | A m_arg; 51 | }; 52 | 53 | // Specialization using a member function 54 | template 55 | struct ThreadMemberFunc : ThreadFunc 56 | { 57 | ThreadMemberFunc(void(C::*function)(), C* object) : m_function(function), m_object(object) {} 58 | virtual void run() {(m_object->*m_function)();} 59 | void(C::*m_function)(); 60 | C* m_object; 61 | }; 62 | 63 | } // namespace priv 64 | 65 | 66 | //////////////////////////////////////////////////////////// 67 | template 68 | Thread::Thread(F functor) : 69 | m_impl (NULL), 70 | m_entryPoint(new priv::ThreadFunctor(functor)) 71 | { 72 | } 73 | 74 | 75 | //////////////////////////////////////////////////////////// 76 | template 77 | Thread::Thread(F function, A argument) : 78 | m_impl (NULL), 79 | m_entryPoint(new priv::ThreadFunctorWithArg(function, argument)) 80 | { 81 | } 82 | 83 | 84 | //////////////////////////////////////////////////////////// 85 | template 86 | Thread::Thread(void(C::*function)(), C* object) : 87 | m_impl (NULL), 88 | m_entryPoint(new priv::ThreadMemberFunc(function, object)) 89 | { 90 | } 91 | -------------------------------------------------------------------------------- /SpriteAnimator/third-party/sfml/include/SFML/System/ThreadLocal.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////// 2 | // 3 | // SFML - Simple and Fast Multimedia Library 4 | // Copyright (C) 2007-2018 Laurent Gomila (laurent@sfml-dev.org) 5 | // 6 | // This software is provided 'as-is', without any express or implied warranty. 7 | // In no event will the authors be held liable for any damages arising from the use of this software. 8 | // 9 | // Permission is granted to anyone to use this software for any purpose, 10 | // including commercial applications, and to alter it and redistribute it freely, 11 | // subject to the following restrictions: 12 | // 13 | // 1. The origin of this software must not be misrepresented; 14 | // you must not claim that you wrote the original software. 15 | // If you use this software in a product, an acknowledgment 16 | // in the product documentation would be appreciated but is not required. 17 | // 18 | // 2. Altered source versions must be plainly marked as such, 19 | // and must not be misrepresented as being the original software. 20 | // 21 | // 3. This notice may not be removed or altered from any source distribution. 22 | // 23 | //////////////////////////////////////////////////////////// 24 | 25 | #ifndef SFML_THREADLOCAL_HPP 26 | #define SFML_THREADLOCAL_HPP 27 | 28 | //////////////////////////////////////////////////////////// 29 | // Headers 30 | //////////////////////////////////////////////////////////// 31 | #include 32 | #include 33 | #include 34 | 35 | 36 | namespace sf 37 | { 38 | namespace priv 39 | { 40 | class ThreadLocalImpl; 41 | } 42 | 43 | //////////////////////////////////////////////////////////// 44 | /// \brief Defines variables with thread-local storage 45 | /// 46 | //////////////////////////////////////////////////////////// 47 | class SFML_SYSTEM_API ThreadLocal : NonCopyable 48 | { 49 | public: 50 | 51 | //////////////////////////////////////////////////////////// 52 | /// \brief Default constructor 53 | /// 54 | /// \param value Optional value to initialize the variable 55 | /// 56 | //////////////////////////////////////////////////////////// 57 | ThreadLocal(void* value = NULL); 58 | 59 | //////////////////////////////////////////////////////////// 60 | /// \brief Destructor 61 | /// 62 | //////////////////////////////////////////////////////////// 63 | ~ThreadLocal(); 64 | 65 | //////////////////////////////////////////////////////////// 66 | /// \brief Set the thread-specific value of the variable 67 | /// 68 | /// \param value Value of the variable for the current thread 69 | /// 70 | //////////////////////////////////////////////////////////// 71 | void setValue(void* value); 72 | 73 | //////////////////////////////////////////////////////////// 74 | /// \brief Retrieve the thread-specific value of the variable 75 | /// 76 | /// \return Value of the variable for the current thread 77 | /// 78 | //////////////////////////////////////////////////////////// 79 | void* getValue() const; 80 | 81 | private: 82 | 83 | //////////////////////////////////////////////////////////// 84 | // Member data 85 | //////////////////////////////////////////////////////////// 86 | priv::ThreadLocalImpl* m_impl; ///< Pointer to the OS specific implementation 87 | }; 88 | 89 | } // namespace sf 90 | 91 | 92 | #endif // SFML_THREADLOCAL_HPP 93 | 94 | 95 | //////////////////////////////////////////////////////////// 96 | /// \class sf::ThreadLocal 97 | /// \ingroup system 98 | /// 99 | /// This class manipulates void* parameters and thus is not 100 | /// appropriate for strongly-typed variables. You should rather 101 | /// use the sf::ThreadLocalPtr template class. 102 | /// 103 | //////////////////////////////////////////////////////////// 104 | -------------------------------------------------------------------------------- /SpriteAnimator/third-party/sfml/include/SFML/System/ThreadLocalPtr.inl: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////// 2 | // 3 | // SFML - Simple and Fast Multimedia Library 4 | // Copyright (C) 2007-2018 Laurent Gomila (laurent@sfml-dev.org) 5 | // 6 | // This software is provided 'as-is', without any express or implied warranty. 7 | // In no event will the authors be held liable for any damages arising from the use of this software. 8 | // 9 | // Permission is granted to anyone to use this software for any purpose, 10 | // including commercial applications, and to alter it and redistribute it freely, 11 | // subject to the following restrictions: 12 | // 13 | // 1. The origin of this software must not be misrepresented; 14 | // you must not claim that you wrote the original software. 15 | // If you use this software in a product, an acknowledgment 16 | // in the product documentation would be appreciated but is not required. 17 | // 18 | // 2. Altered source versions must be plainly marked as such, 19 | // and must not be misrepresented as being the original software. 20 | // 21 | // 3. This notice may not be removed or altered from any source distribution. 22 | // 23 | //////////////////////////////////////////////////////////// 24 | 25 | 26 | namespace sf 27 | { 28 | //////////////////////////////////////////////////////////// 29 | template 30 | ThreadLocalPtr::ThreadLocalPtr(T* value) : 31 | ThreadLocal(value) 32 | { 33 | } 34 | 35 | 36 | //////////////////////////////////////////////////////////// 37 | template 38 | T& ThreadLocalPtr::operator *() const 39 | { 40 | return *static_cast(getValue()); 41 | } 42 | 43 | 44 | //////////////////////////////////////////////////////////// 45 | template 46 | T* ThreadLocalPtr::operator ->() const 47 | { 48 | return static_cast(getValue()); 49 | } 50 | 51 | 52 | //////////////////////////////////////////////////////////// 53 | template 54 | ThreadLocalPtr::operator T*() const 55 | { 56 | return static_cast(getValue()); 57 | } 58 | 59 | 60 | //////////////////////////////////////////////////////////// 61 | template 62 | ThreadLocalPtr& ThreadLocalPtr::operator =(T* value) 63 | { 64 | setValue(value); 65 | return *this; 66 | } 67 | 68 | 69 | //////////////////////////////////////////////////////////// 70 | template 71 | ThreadLocalPtr& ThreadLocalPtr::operator =(const ThreadLocalPtr& right) 72 | { 73 | setValue(right.getValue()); 74 | return *this; 75 | } 76 | 77 | } // namespace sf 78 | -------------------------------------------------------------------------------- /SpriteAnimator/third-party/sfml/include/SFML/Window.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////// 2 | // 3 | // SFML - Simple and Fast Multimedia Library 4 | // Copyright (C) 2007-2018 Laurent Gomila (laurent@sfml-dev.org) 5 | // 6 | // This software is provided 'as-is', without any express or implied warranty. 7 | // In no event will the authors be held liable for any damages arising from the use of this software. 8 | // 9 | // Permission is granted to anyone to use this software for any purpose, 10 | // including commercial applications, and to alter it and redistribute it freely, 11 | // subject to the following restrictions: 12 | // 13 | // 1. The origin of this software must not be misrepresented; 14 | // you must not claim that you wrote the original software. 15 | // If you use this software in a product, an acknowledgment 16 | // in the product documentation would be appreciated but is not required. 17 | // 18 | // 2. Altered source versions must be plainly marked as such, 19 | // and must not be misrepresented as being the original software. 20 | // 21 | // 3. This notice may not be removed or altered from any source distribution. 22 | // 23 | //////////////////////////////////////////////////////////// 24 | 25 | #ifndef SFML_SFML_WINDOW_HPP 26 | #define SFML_SFML_WINDOW_HPP 27 | 28 | //////////////////////////////////////////////////////////// 29 | // Headers 30 | //////////////////////////////////////////////////////////// 31 | 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | #include 41 | #include 42 | #include 43 | #include 44 | #include 45 | #include 46 | #include 47 | 48 | 49 | 50 | #endif // SFML_SFML_WINDOW_HPP 51 | 52 | //////////////////////////////////////////////////////////// 53 | /// \defgroup window Window module 54 | /// 55 | /// Provides OpenGL-based windows, and abstractions for 56 | /// events and input handling. 57 | /// 58 | //////////////////////////////////////////////////////////// 59 | -------------------------------------------------------------------------------- /SpriteAnimator/third-party/sfml/include/SFML/Window/Export.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////// 2 | // 3 | // SFML - Simple and Fast Multimedia Library 4 | // Copyright (C) 2007-2018 Laurent Gomila (laurent@sfml-dev.org) 5 | // 6 | // This software is provided 'as-is', without any express or implied warranty. 7 | // In no event will the authors be held liable for any damages arising from the use of this software. 8 | // 9 | // Permission is granted to anyone to use this software for any purpose, 10 | // including commercial applications, and to alter it and redistribute it freely, 11 | // subject to the following restrictions: 12 | // 13 | // 1. The origin of this software must not be misrepresented; 14 | // you must not claim that you wrote the original software. 15 | // If you use this software in a product, an acknowledgment 16 | // in the product documentation would be appreciated but is not required. 17 | // 18 | // 2. Altered source versions must be plainly marked as such, 19 | // and must not be misrepresented as being the original software. 20 | // 21 | // 3. This notice may not be removed or altered from any source distribution. 22 | // 23 | //////////////////////////////////////////////////////////// 24 | 25 | #ifndef SFML_WINDOW_EXPORT_HPP 26 | #define SFML_WINDOW_EXPORT_HPP 27 | 28 | //////////////////////////////////////////////////////////// 29 | // Headers 30 | //////////////////////////////////////////////////////////// 31 | #include 32 | 33 | 34 | //////////////////////////////////////////////////////////// 35 | // Define portable import / export macros 36 | //////////////////////////////////////////////////////////// 37 | #if defined(SFML_WINDOW_EXPORTS) 38 | 39 | #define SFML_WINDOW_API SFML_API_EXPORT 40 | 41 | #else 42 | 43 | #define SFML_WINDOW_API SFML_API_IMPORT 44 | 45 | #endif 46 | 47 | 48 | #endif // SFML_WINDOW_EXPORT_HPP 49 | -------------------------------------------------------------------------------- /SpriteAnimator/third-party/sfml/include/SFML/Window/WindowHandle.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////// 2 | // 3 | // SFML - Simple and Fast Multimedia Library 4 | // Copyright (C) 2007-2018 Laurent Gomila (laurent@sfml-dev.org) 5 | // 6 | // This software is provided 'as-is', without any express or implied warranty. 7 | // In no event will the authors be held liable for any damages arising from the use of this software. 8 | // 9 | // Permission is granted to anyone to use this software for any purpose, 10 | // including commercial applications, and to alter it and redistribute it freely, 11 | // subject to the following restrictions: 12 | // 13 | // 1. The origin of this software must not be misrepresented; 14 | // you must not claim that you wrote the original software. 15 | // If you use this software in a product, an acknowledgment 16 | // in the product documentation would be appreciated but is not required. 17 | // 18 | // 2. Altered source versions must be plainly marked as such, 19 | // and must not be misrepresented as being the original software. 20 | // 21 | // 3. This notice may not be removed or altered from any source distribution. 22 | // 23 | //////////////////////////////////////////////////////////// 24 | 25 | #ifndef SFML_WINDOWHANDLE_HPP 26 | #define SFML_WINDOWHANDLE_HPP 27 | 28 | //////////////////////////////////////////////////////////// 29 | // Headers 30 | //////////////////////////////////////////////////////////// 31 | #include 32 | 33 | // Windows' HWND is a typedef on struct HWND__* 34 | #if defined(SFML_SYSTEM_WINDOWS) 35 | struct HWND__; 36 | #endif 37 | 38 | namespace sf 39 | { 40 | #if defined(SFML_SYSTEM_WINDOWS) 41 | 42 | // Window handle is HWND (HWND__*) on Windows 43 | typedef HWND__* WindowHandle; 44 | 45 | #elif defined(SFML_SYSTEM_LINUX) || defined(SFML_SYSTEM_FREEBSD) || defined(SFML_SYSTEM_OPENBSD) 46 | 47 | // Window handle is Window (unsigned long) on Unix - X11 48 | typedef unsigned long WindowHandle; 49 | 50 | #elif defined(SFML_SYSTEM_MACOS) 51 | 52 | // Window handle is NSWindow or NSView (void*) on Mac OS X - Cocoa 53 | typedef void* WindowHandle; 54 | 55 | #elif defined(SFML_SYSTEM_IOS) 56 | 57 | // Window handle is UIWindow (void*) on iOS - UIKit 58 | typedef void* WindowHandle; 59 | 60 | #elif defined(SFML_SYSTEM_ANDROID) 61 | 62 | // Window handle is ANativeWindow* (void*) on Android 63 | typedef void* WindowHandle; 64 | 65 | #elif defined(SFML_DOXYGEN) 66 | 67 | // Define typedef symbol so that Doxygen can attach some documentation to it 68 | typedef "platform-specific" WindowHandle; 69 | 70 | #endif 71 | 72 | } // namespace sf 73 | 74 | 75 | #endif // SFML_WINDOWHANDLE_HPP 76 | 77 | //////////////////////////////////////////////////////////// 78 | /// \typedef sf::WindowHandle 79 | /// \ingroup window 80 | /// 81 | /// Define a low-level window handle type, specific to 82 | /// each platform. 83 | /// 84 | /// Platform | Type 85 | /// ----------------|------------------------------------------------------------ 86 | /// Windows | \p HWND 87 | /// Linux/FreeBSD | \p %Window 88 | /// Mac OS X | either \p NSWindow* or \p NSView*, disguised as \p void* 89 | /// iOS | \p UIWindow* 90 | /// Android | \p ANativeWindow* 91 | /// 92 | /// \par Mac OS X Specification 93 | /// 94 | /// On Mac OS X, a sf::Window can be created either from an 95 | /// existing \p NSWindow* or an \p NSView*. When the window 96 | /// is created from a window, SFML will use its content view 97 | /// as the OpenGL area. sf::Window::getSystemHandle() will 98 | /// return the handle that was used to create the window, 99 | /// which is a \p NSWindow* by default. 100 | /// 101 | //////////////////////////////////////////////////////////// 102 | -------------------------------------------------------------------------------- /SpriteAnimator/third-party/sfml/include/SFML/Window/WindowStyle.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////// 2 | // 3 | // SFML - Simple and Fast Multimedia Library 4 | // Copyright (C) 2007-2018 Laurent Gomila (laurent@sfml-dev.org) 5 | // 6 | // This software is provided 'as-is', without any express or implied warranty. 7 | // In no event will the authors be held liable for any damages arising from the use of this software. 8 | // 9 | // Permission is granted to anyone to use this software for any purpose, 10 | // including commercial applications, and to alter it and redistribute it freely, 11 | // subject to the following restrictions: 12 | // 13 | // 1. The origin of this software must not be misrepresented; 14 | // you must not claim that you wrote the original software. 15 | // If you use this software in a product, an acknowledgment 16 | // in the product documentation would be appreciated but is not required. 17 | // 18 | // 2. Altered source versions must be plainly marked as such, 19 | // and must not be misrepresented as being the original software. 20 | // 21 | // 3. This notice may not be removed or altered from any source distribution. 22 | // 23 | //////////////////////////////////////////////////////////// 24 | 25 | #ifndef SFML_WINDOWSTYLE_HPP 26 | #define SFML_WINDOWSTYLE_HPP 27 | 28 | 29 | namespace sf 30 | { 31 | namespace Style 32 | { 33 | //////////////////////////////////////////////////////////// 34 | /// \ingroup window 35 | /// \brief Enumeration of the window styles 36 | /// 37 | //////////////////////////////////////////////////////////// 38 | enum 39 | { 40 | None = 0, ///< No border / title bar (this flag and all others are mutually exclusive) 41 | Titlebar = 1 << 0, ///< Title bar + fixed border 42 | Resize = 1 << 1, ///< Title bar + resizable border + maximize button 43 | Close = 1 << 2, ///< Title bar + close button 44 | Fullscreen = 1 << 3, ///< Fullscreen mode (this flag and all others are mutually exclusive) 45 | 46 | Default = Titlebar | Resize | Close ///< Default window style 47 | }; 48 | } 49 | 50 | } // namespace sf 51 | 52 | 53 | #endif // SFML_WINDOWSTYLE_HPP 54 | -------------------------------------------------------------------------------- /SpriteAnimator/third-party/sfml/lib/sfml-audio-d.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rikora/SpriteAnimator/28ff574636438c97c58f2786e7896441e847f14b/SpriteAnimator/third-party/sfml/lib/sfml-audio-d.lib -------------------------------------------------------------------------------- /SpriteAnimator/third-party/sfml/lib/sfml-graphics-d.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rikora/SpriteAnimator/28ff574636438c97c58f2786e7896441e847f14b/SpriteAnimator/third-party/sfml/lib/sfml-graphics-d.lib -------------------------------------------------------------------------------- /SpriteAnimator/third-party/sfml/lib/sfml-network-d.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rikora/SpriteAnimator/28ff574636438c97c58f2786e7896441e847f14b/SpriteAnimator/third-party/sfml/lib/sfml-network-d.lib -------------------------------------------------------------------------------- /SpriteAnimator/third-party/sfml/lib/sfml-system-d.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rikora/SpriteAnimator/28ff574636438c97c58f2786e7896441e847f14b/SpriteAnimator/third-party/sfml/lib/sfml-system-d.lib -------------------------------------------------------------------------------- /SpriteAnimator/third-party/sfml/lib/sfml-window-d.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rikora/SpriteAnimator/28ff574636438c97c58f2786e7896441e847f14b/SpriteAnimator/third-party/sfml/lib/sfml-window-d.lib -------------------------------------------------------------------------------- /SpriteAnimator/third-party/thor/include/Aurora/Config.hpp: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Aurora C++ Library 4 | // Copyright (c) 2012-2016 Jan Haller 5 | // 6 | // This software is provided 'as-is', without any express or implied 7 | // warranty. In no event will the authors be held liable for any damages 8 | // arising from the use of this software. 9 | // 10 | // Permission is granted to anyone to use this software for any purpose, 11 | // including commercial applications, and to alter it and redistribute it 12 | // freely, subject to the following restrictions: 13 | // 14 | // 1. The origin of this software must not be misrepresented; you must not 15 | // claim that you wrote the original software. If you use this software 16 | // in a product, an acknowledgment in the product documentation would be 17 | // appreciated but is not required. 18 | // 19 | // 2. Altered source versions must be plainly marked as such, and must not be 20 | // misrepresented as being the original software. 21 | // 22 | // 3. This notice may not be removed or altered from any source distribution. 23 | // 24 | ///////////////////////////////////////////////////////////////////////////////// 25 | 26 | /// @file 27 | /// @brief Configuration header of the library 28 | 29 | #ifndef AURORA_CONFIG_HPP 30 | #define AURORA_CONFIG_HPP 31 | 32 | 33 | // Version of the library 34 | #define AURORA_VERSION_MAJOR 1 35 | #define AURORA_VERSION_MINOR 0 36 | 37 | 38 | // Mislead doxygen to keep documentation clean from internals 39 | #define AURORA_FAKE_DOC(real, fake) real 40 | #define AURORA_IMPL_DEF(...) __VA_ARGS__ 41 | 42 | 43 | // Tell the compiler that a code path is unreachable, to disable warnings and enable optimizations 44 | // Most common case: default label in switch statements 45 | #if defined(_MSC_VER) 46 | #define AURORA_UNREACHABLE __assume(false) 47 | #elif defined(__GNUC__) || defined(__clang__) 48 | #define AURORA_UNREACHABLE __builtin_unreachable() 49 | #endif 50 | 51 | 52 | // Output useful error message if MSVC, Clang or g++ compilers do not support C++11 53 | // Cascaded because symbols are not 100% reliable, clang sometimes defines g++ macros 54 | #if defined(_MSC_VER) 55 | #if _MSC_VER < 1600 56 | #error At least Visual Studio 2010 is required. 57 | #endif 58 | #elif defined(__clang__) 59 | #if 100*__clang_major__ + __clang_minor__ < 301 60 | #error At least Clang 3.1 is required. 61 | #endif 62 | #elif defined(__GNUC__) 63 | #if 100*__GNUC__ + __GNUC_MINOR__ < 406 64 | #error At least g++ 4.6 is required. 65 | #endif 66 | #endif 67 | 68 | 69 | // Find out whether variadic templates are supported (VC++, gcc, clang) 70 | #if defined(_MSC_VER) && _MSC_VER >= 1800 71 | #define AURORA_HAS_VARIADIC_TEMPLATES 72 | #elif defined(__clang__) 73 | #if __has_feature(cxx_variadic_templates) 74 | #define AURORA_HAS_VARIADIC_TEMPLATES 75 | #endif 76 | #elif defined(__GNUG__) && (defined(__VARIADIC_TEMPLATES) || __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4 && defined(__GXX_EXPERIMENTAL_CXX0X__))) 77 | #define AURORA_HAS_VARIADIC_TEMPLATES 78 | #endif 79 | 80 | #endif // AURORA_CONFIG_HPP 81 | -------------------------------------------------------------------------------- /SpriteAnimator/third-party/thor/include/Aurora/Dispatch.hpp: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Aurora C++ Library 4 | // Copyright (c) 2012-2016 Jan Haller 5 | // 6 | // This software is provided 'as-is', without any express or implied 7 | // warranty. In no event will the authors be held liable for any damages 8 | // arising from the use of this software. 9 | // 10 | // Permission is granted to anyone to use this software for any purpose, 11 | // including commercial applications, and to alter it and redistribute it 12 | // freely, subject to the following restrictions: 13 | // 14 | // 1. The origin of this software must not be misrepresented; you must not 15 | // claim that you wrote the original software. If you use this software 16 | // in a product, an acknowledgment in the product documentation would be 17 | // appreciated but is not required. 18 | // 19 | // 2. Altered source versions must be plainly marked as such, and must not be 20 | // misrepresented as being the original software. 21 | // 22 | // 3. This notice may not be removed or altered from any source distribution. 23 | // 24 | ///////////////////////////////////////////////////////////////////////////////// 25 | 26 | /// @file 27 | /// @brief Complete Dispatch module 28 | 29 | #ifndef AURORA_MODULE_DISPATCH_HPP 30 | #define AURORA_MODULE_DISPATCH_HPP 31 | 32 | #include 33 | #include 34 | #include 35 | 36 | #endif // AURORA_MODULE_DISPATCH_HPP 37 | -------------------------------------------------------------------------------- /SpriteAnimator/third-party/thor/include/Aurora/Meta.hpp: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Aurora C++ Library 4 | // Copyright (c) 2012-2016 Jan Haller 5 | // 6 | // This software is provided 'as-is', without any express or implied 7 | // warranty. In no event will the authors be held liable for any damages 8 | // arising from the use of this software. 9 | // 10 | // Permission is granted to anyone to use this software for any purpose, 11 | // including commercial applications, and to alter it and redistribute it 12 | // freely, subject to the following restrictions: 13 | // 14 | // 1. The origin of this software must not be misrepresented; you must not 15 | // claim that you wrote the original software. If you use this software 16 | // in a product, an acknowledgment in the product documentation would be 17 | // appreciated but is not required. 18 | // 19 | // 2. Altered source versions must be plainly marked as such, and must not be 20 | // misrepresented as being the original software. 21 | // 22 | // 3. This notice may not be removed or altered from any source distribution. 23 | // 24 | ///////////////////////////////////////////////////////////////////////////////// 25 | 26 | /// @file 27 | /// @brief Complete Meta module 28 | 29 | #ifndef AURORA_MODULE_META_HPP 30 | #define AURORA_MODULE_META_HPP 31 | 32 | #include 33 | #include 34 | #include 35 | #include 36 | 37 | #endif // AURORA_MODULE_META_HPP 38 | -------------------------------------------------------------------------------- /SpriteAnimator/third-party/thor/include/Aurora/SmartPtr.hpp: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Aurora C++ Library 4 | // Copyright (c) 2012-2016 Jan Haller 5 | // 6 | // This software is provided 'as-is', without any express or implied 7 | // warranty. In no event will the authors be held liable for any damages 8 | // arising from the use of this software. 9 | // 10 | // Permission is granted to anyone to use this software for any purpose, 11 | // including commercial applications, and to alter it and redistribute it 12 | // freely, subject to the following restrictions: 13 | // 14 | // 1. The origin of this software must not be misrepresented; you must not 15 | // claim that you wrote the original software. If you use this software 16 | // in a product, an acknowledgment in the product documentation would be 17 | // appreciated but is not required. 18 | // 19 | // 2. Altered source versions must be plainly marked as such, and must not be 20 | // misrepresented as being the original software. 21 | // 22 | // 3. This notice may not be removed or altered from any source distribution. 23 | // 24 | ///////////////////////////////////////////////////////////////////////////////// 25 | 26 | /// @file 27 | /// @brief Complete SmartPtr module 28 | 29 | #ifndef AURORA_MODULE_SMARTPTR_HPP 30 | #define AURORA_MODULE_SMARTPTR_HPP 31 | 32 | #include 33 | #include 34 | #include 35 | 36 | #endif // AURORA_MODULE_SMARTPTR_HPP 37 | -------------------------------------------------------------------------------- /SpriteAnimator/third-party/thor/include/Aurora/SmartPtr/ClonersAndDeleters.hpp: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Aurora C++ Library 4 | // Copyright (c) 2012-2016 Jan Haller 5 | // 6 | // This software is provided 'as-is', without any express or implied 7 | // warranty. In no event will the authors be held liable for any damages 8 | // arising from the use of this software. 9 | // 10 | // Permission is granted to anyone to use this software for any purpose, 11 | // including commercial applications, and to alter it and redistribute it 12 | // freely, subject to the following restrictions: 13 | // 14 | // 1. The origin of this software must not be misrepresented; you must not 15 | // claim that you wrote the original software. If you use this software 16 | // in a product, an acknowledgment in the product documentation would be 17 | // appreciated but is not required. 18 | // 19 | // 2. Altered source versions must be plainly marked as such, and must not be 20 | // misrepresented as being the original software. 21 | // 22 | // 3. This notice may not be removed or altered from any source distribution. 23 | // 24 | ///////////////////////////////////////////////////////////////////////////////// 25 | 26 | /// @file 27 | /// @brief Cloner and deleter functors for smart pointers 28 | 29 | #ifndef AURORA_PTRFUNCTORS_HPP 30 | #define AURORA_PTRFUNCTORS_HPP 31 | 32 | #include 33 | 34 | 35 | namespace aurora 36 | { 37 | 38 | /// @addtogroup SmartPtr 39 | /// @{ 40 | 41 | /// @brief Cloner that invokes the copy constructor and new operator. 42 | /// @details Makes a copy of the origin using the copy constructor. The resulting object is allocated with new, so the 43 | /// recommended deleter to use together with this cloner is OperatorDelete. 44 | template 45 | struct OperatorNewCopy 46 | { 47 | T* operator() (const T* pointer) const 48 | { 49 | return new T(*pointer); 50 | } 51 | }; 52 | 53 | /// @brief Cloner that invokes a member function clone(). 54 | /// @details clone() shall be a virtual function with the signature C* C::clone() const, where C is the class type. 55 | /// The returned pointer has to point to a new copy of the object on which clone() is invoked. In case you do not call 56 | /// the new operator to allocate the copy, make sure you also use a corresponding deleter in CopiedPtr. 57 | template 58 | struct VirtualClone 59 | { 60 | T* operator() (const T* pointer) const 61 | { 62 | return pointer->clone(); 63 | } 64 | }; 65 | 66 | /// @brief Deleter that invokes the delete operator. 67 | /// @details If you use this deleter, ensure that the object has been allocated with new. Note that for CopiedPtr, also the 68 | /// cloner has to return a copy allocated with new (like OperatorNewCopy). The type T shall be complete at the time of deletion. 69 | template 70 | struct OperatorDelete 71 | { 72 | void operator() (T* pointer) 73 | { 74 | AURORA_REQUIRE_COMPLETE_TYPE(T); 75 | delete pointer; 76 | } 77 | }; 78 | 79 | /// @} 80 | 81 | } // namespace aurora 82 | 83 | #endif // AURORA_PTRFUNCTORS_HPP 84 | -------------------------------------------------------------------------------- /SpriteAnimator/third-party/thor/include/Aurora/SmartPtr/Detail/Factories.hpp: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Aurora C++ Library 4 | // Copyright (c) 2012-2016 Jan Haller 5 | // 6 | // This software is provided 'as-is', without any express or implied 7 | // warranty. In no event will the authors be held liable for any damages 8 | // arising from the use of this software. 9 | // 10 | // Permission is granted to anyone to use this software for any purpose, 11 | // including commercial applications, and to alter it and redistribute it 12 | // freely, subject to the following restrictions: 13 | // 14 | // 1. The origin of this software must not be misrepresented; you must not 15 | // claim that you wrote the original software. If you use this software 16 | // in a product, an acknowledgment in the product documentation would be 17 | // appreciated but is not required. 18 | // 19 | // 2. Altered source versions must be plainly marked as such, and must not be 20 | // misrepresented as being the original software. 21 | // 22 | // 3. This notice may not be removed or altered from any source distribution. 23 | // 24 | ///////////////////////////////////////////////////////////////////////////////// 25 | 26 | // Contains preprocessor metaprograms for code generation of smart pointer makeXY() factories 27 | 28 | #ifndef AURORA_FACTORIES_HPP 29 | #define AURORA_FACTORIES_HPP 30 | 31 | #include 32 | 33 | 34 | #define AURORA_DETAIL_TYPENAME(n) typename A ## n 35 | #define AURORA_DETAIL_PARAMETER(n) A ## n && arg ## n 36 | #define AURORA_DETAIL_FORWARD_ARG(n) std::forward(arg ## n) 37 | 38 | #define AURORA_DETAIL_SMARTPTR_FACTORY(SmartPtr, factoryFunction, n) \ 39 | template \ 40 | SmartPtr factoryFunction(AURORA_PP_ENUMERATE_COMMA(n, AURORA_DETAIL_PARAMETER)) \ 41 | { \ 42 | return SmartPtr(new T( AURORA_PP_ENUMERATE_COMMA(n, AURORA_DETAIL_FORWARD_ARG) )); \ 43 | } 44 | 45 | #endif // AURORA_FACTORIES_HPP 46 | -------------------------------------------------------------------------------- /SpriteAnimator/third-party/thor/include/Aurora/SmartPtr/MakeUnique.hpp: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Aurora C++ Library 4 | // Copyright (c) 2012-2016 Jan Haller 5 | // 6 | // This software is provided 'as-is', without any express or implied 7 | // warranty. In no event will the authors be held liable for any damages 8 | // arising from the use of this software. 9 | // 10 | // Permission is granted to anyone to use this software for any purpose, 11 | // including commercial applications, and to alter it and redistribute it 12 | // freely, subject to the following restrictions: 13 | // 14 | // 1. The origin of this software must not be misrepresented; you must not 15 | // claim that you wrote the original software. If you use this software 16 | // in a product, an acknowledgment in the product documentation would be 17 | // appreciated but is not required. 18 | // 19 | // 2. Altered source versions must be plainly marked as such, and must not be 20 | // misrepresented as being the original software. 21 | // 22 | // 3. This notice may not be removed or altered from any source distribution. 23 | // 24 | ///////////////////////////////////////////////////////////////////////////////// 25 | 26 | /// @file 27 | /// @brief Factory function aurora::makeUnique() 28 | 29 | #ifndef AURORA_MAKEUNIQUE_HPP 30 | #define AURORA_MAKEUNIQUE_HPP 31 | 32 | #include 33 | 34 | 35 | namespace aurora 36 | { 37 | 38 | // For documentation and modern compilers 39 | #ifdef AURORA_HAS_VARIADIC_TEMPLATES 40 | 41 | /// @addtogroup SmartPtr 42 | /// @{ 43 | 44 | /// @brief Emplaces an object directly inside the unique pointer. 45 | /// @param args Variable argument list, the single arguments are forwarded to T's constructor. If your compiler does not 46 | /// support variadic templates, the number of arguments must be smaller than @ref AURORA_PP_LIMIT. 47 | /// @details Does the same as std::make_unique() in C++14. Example: 48 | /// @code 49 | /// auto ptr = aurora::makeUnique(arg1, arg2); // instead of 50 | /// std::unique_ptr ptr(new MyClass(arg1, arg2)); 51 | /// @endcode 52 | template 53 | std::unique_ptr makeUnique(Args&&... args) 54 | { 55 | return std::unique_ptr(new T(std::forward(args)...)); 56 | } 57 | 58 | /// @} 59 | 60 | // --------------------------------------------------------------------------------------------------------------------------- 61 | 62 | 63 | // Unoptimized fallback for compilers that don't support variadic templates, emulated by preprocessor metaprogramming 64 | #else // AURORA_HAS_VARIADIC_TEMPLATES 65 | 66 | #include 67 | 68 | // Define metafunction to generate overloads for aurora::CopiedPtr 69 | #define AURORA_DETAIL_UNIQUEPTR_FACTORY(n) AURORA_DETAIL_SMARTPTR_FACTORY(std::unique_ptr, makeUnique, n) 70 | 71 | // Generate code 72 | AURORA_PP_ENUMERATE(AURORA_PP_LIMIT, AURORA_DETAIL_UNIQUEPTR_FACTORY) 73 | 74 | #endif // AURORA_HAS_VARIADIC_TEMPLATES 75 | 76 | } // namespace aurora 77 | 78 | #endif // AURORA_MAKEUNIQUE_HPP 79 | -------------------------------------------------------------------------------- /SpriteAnimator/third-party/thor/include/Aurora/Tools.hpp: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Aurora C++ Library 4 | // Copyright (c) 2012-2016 Jan Haller 5 | // 6 | // This software is provided 'as-is', without any express or implied 7 | // warranty. In no event will the authors be held liable for any damages 8 | // arising from the use of this software. 9 | // 10 | // Permission is granted to anyone to use this software for any purpose, 11 | // including commercial applications, and to alter it and redistribute it 12 | // freely, subject to the following restrictions: 13 | // 14 | // 1. The origin of this software must not be misrepresented; you must not 15 | // claim that you wrote the original software. If you use this software 16 | // in a product, an acknowledgment in the product documentation would be 17 | // appreciated but is not required. 18 | // 19 | // 2. Altered source versions must be plainly marked as such, and must not be 20 | // misrepresented as being the original software. 21 | // 22 | // 3. This notice may not be removed or altered from any source distribution. 23 | // 24 | ///////////////////////////////////////////////////////////////////////////////// 25 | 26 | /// @file 27 | /// @brief Complete Tools module 28 | 29 | #ifndef AURORA_MODULE_TOOLS_HPP 30 | #define AURORA_MODULE_TOOLS_HPP 31 | 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | #include 41 | #include 42 | 43 | #endif // AURORA_MODULE_TOOLS_HPP 44 | -------------------------------------------------------------------------------- /SpriteAnimator/third-party/thor/include/Aurora/Tools/Downcast.hpp: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Aurora C++ Library 4 | // Copyright (c) 2012-2016 Jan Haller 5 | // 6 | // This software is provided 'as-is', without any express or implied 7 | // warranty. In no event will the authors be held liable for any damages 8 | // arising from the use of this software. 9 | // 10 | // Permission is granted to anyone to use this software for any purpose, 11 | // including commercial applications, and to alter it and redistribute it 12 | // freely, subject to the following restrictions: 13 | // 14 | // 1. The origin of this software must not be misrepresented; you must not 15 | // claim that you wrote the original software. If you use this software 16 | // in a product, an acknowledgment in the product documentation would be 17 | // appreciated but is not required. 18 | // 19 | // 2. Altered source versions must be plainly marked as such, and must not be 20 | // misrepresented as being the original software. 21 | // 22 | // 3. This notice may not be removed or altered from any source distribution. 23 | // 24 | ///////////////////////////////////////////////////////////////////////////////// 25 | 26 | /// @file 27 | /// @brief Function template aurora::downcast() 28 | 29 | #ifndef AURORA_DOWNCAST_HPP 30 | #define AURORA_DOWNCAST_HPP 31 | 32 | #include 33 | #include 34 | 35 | 36 | namespace aurora 37 | { 38 | 39 | /// @addtogroup Tools 40 | /// @{ 41 | 42 | /// @brief Safe polymorphic downcast for references 43 | /// @details Can be used in place of a static_cast from a base class to a derived class -- that is, 44 | /// you expect the downcast to succeed. In debug mode, types are checked at runtime using dynamic_cast. 45 | /// In release mode (with the NDBEBUG macro defined), a static_cast at full speed is used. 46 | template 47 | To downcast(From& base) 48 | { 49 | assert(dynamic_cast::type*>(&base)); 50 | return static_cast(base); 51 | } 52 | 53 | /// @brief Safe polymorphic downcast for pointers 54 | /// @details Can be used in place of a static_cast from a base class to a derived class -- that is, 55 | /// you expect the downcast to succeed. In debug mode, types are checked at runtime using dynamic_cast. 56 | /// In release mode (with the NDBEBUG macro defined), a static_cast at full speed is used. 57 | template 58 | To downcast(From* base) 59 | { 60 | assert(dynamic_cast(base)); 61 | return static_cast(base); 62 | } 63 | 64 | /// @} 65 | 66 | } // namespace aurora 67 | 68 | #endif // AURORA_DOWNCAST_HPP 69 | -------------------------------------------------------------------------------- /SpriteAnimator/third-party/thor/include/Aurora/Tools/Exceptions.hpp: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Aurora C++ Library 4 | // Copyright (c) 2012-2016 Jan Haller 5 | // 6 | // This software is provided 'as-is', without any express or implied 7 | // warranty. In no event will the authors be held liable for any damages 8 | // arising from the use of this software. 9 | // 10 | // Permission is granted to anyone to use this software for any purpose, 11 | // including commercial applications, and to alter it and redistribute it 12 | // freely, subject to the following restrictions: 13 | // 14 | // 1. The origin of this software must not be misrepresented; you must not 15 | // claim that you wrote the original software. If you use this software 16 | // in a product, an acknowledgment in the product documentation would be 17 | // appreciated but is not required. 18 | // 19 | // 2. Altered source versions must be plainly marked as such, and must not be 20 | // misrepresented as being the original software. 21 | // 22 | // 3. This notice may not be removed or altered from any source distribution. 23 | // 24 | ///////////////////////////////////////////////////////////////////////////////// 25 | 26 | /// @file 27 | /// @brief Definition of Aurora exception classes 28 | 29 | #ifndef AURORA_EXCEPTIONS_HPP 30 | #define AURORA_EXCEPTIONS_HPP 31 | 32 | #include 33 | 34 | #include 35 | #include 36 | 37 | 38 | namespace aurora 39 | { 40 | 41 | /// @addtogroup Tools 42 | /// @{ 43 | 44 | // MSVC: Disable DLL warning because we derive from std::runtime_error 45 | #ifdef _MSC_VER 46 | #pragma warning(push) 47 | #pragma warning(disable: 4275) 48 | #endif 49 | 50 | /// @brief %Exception base class. 51 | /// @details All exceptions thrown by the Aurora Library are derived from this class. Exception inherits from 52 | /// std::runtime_error, hence all Aurora exceptions contain a (here undocumented) virtual function what(). 53 | class Exception : public std::runtime_error 54 | { 55 | // --------------------------------------------------------------------------------------------------------------------------- 56 | // Public member functions 57 | public: 58 | /// @brief Constructor 59 | /// @param message The exception message (how the error occurred). 60 | explicit Exception(const std::string& message) 61 | : std::runtime_error(message) 62 | { 63 | } 64 | }; 65 | 66 | 67 | /// @brief %Exception class for failed function calls. 68 | /// @details Is used inside aurora::SingleDispatcher and aurora::DoubleDispatcher. 69 | class FunctionCallException : public Exception 70 | { 71 | // --------------------------------------------------------------------------------------------------------------------------- 72 | // Public member functions 73 | public: 74 | /// @brief Constructor 75 | /// @param message The exception message (how the error occurred). 76 | explicit FunctionCallException(const std::string& message) 77 | : Exception(message) 78 | { 79 | } 80 | }; 81 | 82 | #ifdef _MSC_VER 83 | #pragma warning(pop) 84 | #endif 85 | 86 | /// @} 87 | 88 | } // namespace aurora 89 | 90 | #endif // AURORA_EXCEPTIONS_HPP 91 | -------------------------------------------------------------------------------- /SpriteAnimator/third-party/thor/include/Aurora/Tools/ForEach.hpp: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Aurora C++ Library 4 | // Copyright (c) 2012-2016 Jan Haller 5 | // 6 | // This software is provided 'as-is', without any express or implied 7 | // warranty. In no event will the authors be held liable for any damages 8 | // arising from the use of this software. 9 | // 10 | // Permission is granted to anyone to use this software for any purpose, 11 | // including commercial applications, and to alter it and redistribute it 12 | // freely, subject to the following restrictions: 13 | // 14 | // 1. The origin of this software must not be misrepresented; you must not 15 | // claim that you wrote the original software. If you use this software 16 | // in a product, an acknowledgment in the product documentation would be 17 | // appreciated but is not required. 18 | // 19 | // 2. Altered source versions must be plainly marked as such, and must not be 20 | // misrepresented as being the original software. 21 | // 22 | // 3. This notice may not be removed or altered from any source distribution. 23 | // 24 | ///////////////////////////////////////////////////////////////////////////////// 25 | 26 | /// @file 27 | /// @brief Macros to simplify container iteration 28 | 29 | #ifndef AURORA_FOREACH_HPP 30 | #define AURORA_FOREACH_HPP 31 | 32 | #include 33 | 34 | 35 | // Preprocessor metaprogramming to ensure line-unique identifiers 36 | #define AURORA_ID(identifier) AURORA_PP_CAT(auroraDetail_, identifier) 37 | #define AURORA_LINE_ID(identifier) AURORA_PP_CAT(AURORA_ID(identifier), __LINE__) 38 | 39 | 40 | /// @addtogroup Tools 41 | /// @{ 42 | 43 | /// @brief Macro that emulates C++11 range-based for loop. 44 | /// @details Code example: 45 | /// @code 46 | /// std::vector v = createVector(); 47 | /// AURORA_FOREACH(int& i, v) 48 | /// { 49 | /// i += 2; 50 | /// } 51 | /// @endcode 52 | /// @hideinitializer 53 | #define AURORA_FOREACH(declaration, container) \ 54 | if (bool AURORA_LINE_ID(broken) = false) {} else \ 55 | for (auto AURORA_LINE_ID(itr) = (container).begin(); AURORA_LINE_ID(itr) != (container).end() && !AURORA_LINE_ID(broken); ++AURORA_LINE_ID(itr)) \ 56 | if (bool AURORA_LINE_ID(passed) = false) {} else \ 57 | if (AURORA_LINE_ID(broken) = true, false) {} else \ 58 | for (declaration = *AURORA_LINE_ID(itr); !AURORA_LINE_ID(passed); AURORA_LINE_ID(passed) = true, AURORA_LINE_ID(broken) = false) 59 | 60 | /// @} 61 | 62 | #endif // AURORA_FOREACH_HPP 63 | -------------------------------------------------------------------------------- /SpriteAnimator/third-party/thor/include/Aurora/Tools/Hash.hpp: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Aurora C++ Library 4 | // Copyright (c) 2012-2016 Jan Haller 5 | // 6 | // This software is provided 'as-is', without any express or implied 7 | // warranty. In no event will the authors be held liable for any damages 8 | // arising from the use of this software. 9 | // 10 | // Permission is granted to anyone to use this software for any purpose, 11 | // including commercial applications, and to alter it and redistribute it 12 | // freely, subject to the following restrictions: 13 | // 14 | // 1. The origin of this software must not be misrepresented; you must not 15 | // claim that you wrote the original software. If you use this software 16 | // in a product, an acknowledgment in the product documentation would be 17 | // appreciated but is not required. 18 | // 19 | // 2. Altered source versions must be plainly marked as such, and must not be 20 | // misrepresented as being the original software. 21 | // 22 | // 3. This notice may not be removed or altered from any source distribution. 23 | // 24 | ///////////////////////////////////////////////////////////////////////////////// 25 | 26 | /// @file 27 | /// @brief Extensions to std::hash 28 | 29 | #ifndef AURORA_HASH_HPP 30 | #define AURORA_HASH_HPP 31 | 32 | #include 33 | 34 | #include 35 | 36 | 37 | namespace aurora 38 | { 39 | 40 | /// @addtogroup Tools 41 | /// @{ 42 | 43 | /// @brief Computes the hash value of an object (short-hand notation). 44 | /// 45 | template 46 | std::size_t hashValue(const T& object 47 | AURORA_ENABLE_IF(!std::is_enum::value)) 48 | { 49 | std::hash hasher; 50 | return hasher(object); 51 | } 52 | 53 | // Overload for enums 54 | template 55 | std::size_t hashValue(const T& enumerator 56 | AURORA_ENABLE_IF(std::is_enum::value)) 57 | { 58 | return hashValue(static_cast::type>(enumerator)); 59 | } 60 | 61 | /// @brief Combines a hash with the hash value of another object. 62 | /// 63 | template 64 | void hashCombine(std::size_t& seed, const T& object) 65 | { 66 | // Implementation from Boost.Functional/Hash 67 | seed ^= hashValue(object) + 0x9e3779b9u + (seed << 6) + (seed >> 2); 68 | } 69 | 70 | /// @brief Combines a hash with the hash value of a range of objects. 71 | /// 72 | template 73 | void hashRange(std::size_t& seed, Itr begin, Itr end) 74 | { 75 | for (; begin != end; ++begin) 76 | hashCombine(seed, *begin); 77 | } 78 | 79 | /// @brief Hash object for std::pair 80 | /// 81 | struct PairHasher 82 | { 83 | template 84 | std::size_t operator() (const std::pair& pair) const 85 | { 86 | std::size_t hash = 0u; 87 | hashCombine(hash, pair.first); 88 | hashCombine(hash, pair.second); 89 | 90 | return hash; 91 | } 92 | }; 93 | 94 | /// @} 95 | 96 | } // namespace aurora 97 | 98 | #endif // AURORA_HASH_HPP 99 | -------------------------------------------------------------------------------- /SpriteAnimator/third-party/thor/include/Aurora/Tools/NonCopyable.hpp: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Aurora C++ Library 4 | // Copyright (c) 2012-2016 Jan Haller 5 | // 6 | // This software is provided 'as-is', without any express or implied 7 | // warranty. In no event will the authors be held liable for any damages 8 | // arising from the use of this software. 9 | // 10 | // Permission is granted to anyone to use this software for any purpose, 11 | // including commercial applications, and to alter it and redistribute it 12 | // freely, subject to the following restrictions: 13 | // 14 | // 1. The origin of this software must not be misrepresented; you must not 15 | // claim that you wrote the original software. If you use this software 16 | // in a product, an acknowledgment in the product documentation would be 17 | // appreciated but is not required. 18 | // 19 | // 2. Altered source versions must be plainly marked as such, and must not be 20 | // misrepresented as being the original software. 21 | // 22 | // 3. This notice may not be removed or altered from any source distribution. 23 | // 24 | ///////////////////////////////////////////////////////////////////////////////// 25 | 26 | /// @file 27 | /// @brief Class aurora::NonCopyable 28 | 29 | #ifndef AURORA_NONCOPYABLE_HPP 30 | #define AURORA_NONCOPYABLE_HPP 31 | 32 | 33 | namespace aurora 34 | { 35 | 36 | /// @addtogroup Tools 37 | /// @{ 38 | 39 | /// @brief Non-copyable base class. 40 | /// @details Copy constructor and copy assignment operator are not accessible. 41 | /// Derive from this class to prevent copying of your class. 42 | class NonCopyable 43 | { 44 | // --------------------------------------------------------------------------------------------------------------------------- 45 | // Protected member functions 46 | protected: 47 | // Default constructor 48 | NonCopyable() {} 49 | ~NonCopyable() {} 50 | 51 | // --------------------------------------------------------------------------------------------------------------------------- 52 | // Private member functions 53 | private: 54 | // Copy constructor (forbidden) 55 | NonCopyable(const NonCopyable& origin); 56 | 57 | // Assignment operator (forbidden) 58 | NonCopyable& operator= (const NonCopyable& origin); 59 | }; 60 | 61 | /// @} 62 | 63 | } // namespace aurora 64 | 65 | #endif // AURORA_NONCOPYABLE_HPP 66 | -------------------------------------------------------------------------------- /SpriteAnimator/third-party/thor/include/Aurora/Tools/SafeBool.hpp: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Aurora C++ Library 4 | // Copyright (c) 2012-2016 Jan Haller 5 | // 6 | // This software is provided 'as-is', without any express or implied 7 | // warranty. In no event will the authors be held liable for any damages 8 | // arising from the use of this software. 9 | // 10 | // Permission is granted to anyone to use this software for any purpose, 11 | // including commercial applications, and to alter it and redistribute it 12 | // freely, subject to the following restrictions: 13 | // 14 | // 1. The origin of this software must not be misrepresented; you must not 15 | // claim that you wrote the original software. If you use this software 16 | // in a product, an acknowledgment in the product documentation would be 17 | // appreciated but is not required. 18 | // 19 | // 2. Altered source versions must be plainly marked as such, and must not be 20 | // misrepresented as being the original software. 21 | // 22 | // 3. This notice may not be removed or altered from any source distribution. 23 | // 24 | ///////////////////////////////////////////////////////////////////////////////// 25 | 26 | /// @file 27 | /// @brief Type aurora::SafeBool and corresponding functionality 28 | 29 | #ifndef AURORA_SAFEBOOL_HPP 30 | #define AURORA_SAFEBOOL_HPP 31 | 32 | 33 | namespace aurora 34 | { 35 | namespace detail 36 | { 37 | 38 | // Helpers for Safe-Bool idiom (use member-function pointers since they support quite few operators) 39 | struct SafeBoolHolder 40 | { 41 | // Dummy function 42 | void function() {} 43 | }; 44 | 45 | } // namespace detail 46 | 47 | // --------------------------------------------------------------------------------------------------------------------------- 48 | 49 | 50 | /// @addtogroup Tools 51 | /// @{ 52 | 53 | /// @brief SafeBool type 54 | /// @hideinitializer 55 | typedef void (detail::SafeBoolHolder::*SafeBool)(); 56 | 57 | /// @brief SafeBool literal, evaluates to true 58 | /// @hideinitializer 59 | const SafeBool SafeBoolTrue = &detail::SafeBoolHolder::function; 60 | 61 | /// @brief SafeBool literal, evaluates to false 62 | /// @hideinitializer 63 | const SafeBool SafeBoolFalse = nullptr; 64 | 65 | /// @brief Conversion function from bool to SafeBool 66 | /// 67 | inline SafeBool toSafeBool(bool condition) 68 | { 69 | return condition ? SafeBoolTrue : SafeBoolFalse; 70 | } 71 | 72 | /// @} 73 | 74 | } // namespace aurora 75 | 76 | #endif // AURORA_SAFEBOOL_HPP 77 | -------------------------------------------------------------------------------- /SpriteAnimator/third-party/thor/include/Aurora/Tools/Swap.hpp: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Aurora C++ Library 4 | // Copyright (c) 2012-2016 Jan Haller 5 | // 6 | // This software is provided 'as-is', without any express or implied 7 | // warranty. In no event will the authors be held liable for any damages 8 | // arising from the use of this software. 9 | // 10 | // Permission is granted to anyone to use this software for any purpose, 11 | // including commercial applications, and to alter it and redistribute it 12 | // freely, subject to the following restrictions: 13 | // 14 | // 1. The origin of this software must not be misrepresented; you must not 15 | // claim that you wrote the original software. If you use this software 16 | // in a product, an acknowledgment in the product documentation would be 17 | // appreciated but is not required. 18 | // 19 | // 2. Altered source versions must be plainly marked as such, and must not be 20 | // misrepresented as being the original software. 21 | // 22 | // 3. This notice may not be removed or altered from any source distribution. 23 | // 24 | ///////////////////////////////////////////////////////////////////////////////// 25 | 26 | /// @file 27 | /// @brief Helpers to declare and invoke swap() functions 28 | 29 | #ifndef AURORA_SWAP_HPP 30 | #define AURORA_SWAP_HPP 31 | 32 | #include // std::swap (until C++11, it was in header) 33 | 34 | 35 | /// @addtogroup Tools 36 | /// @{ 37 | 38 | /// @brief Macro to implement a global overload of swap(lhs, rhs) to allow argument-dependent lookup. 39 | /// @details Accesses the member function void Class::swap(Class&). 40 | #define AURORA_GLOBAL_SWAP(Class) \ 41 | inline void swap(Class& lhs, Class& rhs) \ 42 | { \ 43 | lhs.swap(rhs); \ 44 | } 45 | 46 | /// @brief %swap() function with argument-dependent lookup 47 | /// @details Chooses the best overload of swap(lhs, rhs) with argument-dependent lookup. If none is found, @c std::swap() will be called. 48 | template 49 | inline void adlSwap(T& lhs, T& rhs) 50 | { 51 | using namespace std; 52 | swap(lhs, rhs); 53 | } 54 | 55 | /// @} 56 | 57 | #endif // AURORA_SWAP_HPP 58 | -------------------------------------------------------------------------------- /SpriteAnimator/third-party/thor/include/Aurora/Tools/Typeid.hpp: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Aurora C++ Library 4 | // Copyright (c) 2012-2016 Jan Haller 5 | // 6 | // This software is provided 'as-is', without any express or implied 7 | // warranty. In no event will the authors be held liable for any damages 8 | // arising from the use of this software. 9 | // 10 | // Permission is granted to anyone to use this software for any purpose, 11 | // including commercial applications, and to alter it and redistribute it 12 | // freely, subject to the following restrictions: 13 | // 14 | // 1. The origin of this software must not be misrepresented; you must not 15 | // claim that you wrote the original software. If you use this software 16 | // in a product, an acknowledgment in the product documentation would be 17 | // appreciated but is not required. 18 | // 19 | // 2. Altered source versions must be plainly marked as such, and must not be 20 | // misrepresented as being the original software. 21 | // 22 | // 3. This notice may not be removed or altered from any source distribution. 23 | // 24 | ///////////////////////////////////////////////////////////////////////////////// 25 | 26 | /// @file 27 | /// @brief Function template aurora::typeIndex() 28 | 29 | #ifndef AURORA_TYPEID_HPP 30 | #define AURORA_TYPEID_HPP 31 | 32 | #include 33 | 34 | #include 35 | #include 36 | 37 | 38 | namespace aurora 39 | { 40 | namespace detail 41 | { 42 | 43 | template 44 | void verifyRttiType() 45 | { 46 | AURORA_REQUIRE_COMPLETE_TYPE(T); 47 | static_assert(std::is_polymorphic::value, "T must be a polymorphic type."); 48 | #ifndef AURORA_TYPEID_ALLOW_NONVIRTUAL_DTOR 49 | static_assert(std::has_virtual_destructor::value, "Polymorphic types should have a virtual destructor. " 50 | "Define AURORA_TYPEID_ALLOW_NONVIRTUAL_DTOR to let this code compile."); 51 | #endif 52 | } 53 | 54 | } // namespace detail 55 | 56 | /// @addtogroup Tools 57 | /// @{ 58 | 59 | /// @brief Safe typeid operator for references 60 | /// @details The C++ typeid operator can easily be used incorrectly in RTTI scenarios, leading to tedious bugs at runtime: 61 | /// * The operand is a value instead of a reference. 62 | /// * The operand is a pointer which was not dereferenced. 63 | /// * The operand is an incomplete type. The compiler has no knowledge about the polymorphic class hierarchy at this point. 64 | /// * The class is not polymorphic. This can happen when a destructor was not declared virtual. 65 | /// 66 | /// This implementation makes sure that the above-mentioned cases do not occur. %Type verification happens at compile time, so 67 | /// there is no performance overhead in using this function. This function is specifically designed for the use of RTTI in 68 | /// polymorphic class hierarchies, it cannot be used in other scenarios (e.g. printing arbitrary type names for debugging). 69 | /// 70 | /// Usage: 71 | /// @code 72 | /// Base& baseRef = ...; 73 | /// std::type_index t = aurora::typeIndex(baseRef); 74 | /// @endcode 75 | template 76 | std::type_index typeIndex(T& reference) 77 | { 78 | detail::verifyRttiType(); 79 | return typeid(reference); 80 | } 81 | 82 | /// @brief Safe typeid operator for types 83 | /// @details Same as typeIndex(T& reference), but for types. 84 | /// 85 | /// Usage: 86 | /// @code 87 | /// std::type_index t = aurora::typeIndex(); 88 | /// @endcode 89 | template 90 | std::type_index typeIndex() 91 | { 92 | detail::verifyRttiType(); 93 | return typeid(T); 94 | } 95 | 96 | 97 | /// @} 98 | 99 | } // namespace aurora 100 | 101 | #endif // AURORA_TYPEID_HPP 102 | -------------------------------------------------------------------------------- /SpriteAnimator/third-party/thor/include/Thor/Animations.hpp: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Thor C++ Library 4 | // Copyright (c) 2011-2017 Jan Haller 5 | // 6 | // This software is provided 'as-is', without any express or implied 7 | // warranty. In no event will the authors be held liable for any damages 8 | // arising from the use of this software. 9 | // 10 | // Permission is granted to anyone to use this software for any purpose, 11 | // including commercial applications, and to alter it and redistribute it 12 | // freely, subject to the following restrictions: 13 | // 14 | // 1. The origin of this software must not be misrepresented; you must not 15 | // claim that you wrote the original software. If you use this software 16 | // in a product, an acknowledgment in the product documentation would be 17 | // appreciated but is not required. 18 | // 19 | // 2. Altered source versions must be plainly marked as such, and must not be 20 | // misrepresented as being the original software. 21 | // 22 | // 3. This notice may not be removed or altered from any source distribution. 23 | // 24 | ///////////////////////////////////////////////////////////////////////////////// 25 | 26 | /// @file 27 | /// @brief Complete header for the Animations module 28 | 29 | #ifndef THOR_MODULE_ANIMATIONS_HPP 30 | #define THOR_MODULE_ANIMATIONS_HPP 31 | 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | 40 | #endif // THOR_MODULE_ANIMATIONS_HPP 41 | -------------------------------------------------------------------------------- /SpriteAnimator/third-party/thor/include/Thor/Animations/AnimationPrimitives.hpp: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Thor C++ Library 4 | // Copyright (c) 2011-2017 Jan Haller 5 | // 6 | // This software is provided 'as-is', without any express or implied 7 | // warranty. In no event will the authors be held liable for any damages 8 | // arising from the use of this software. 9 | // 10 | // Permission is granted to anyone to use this software for any purpose, 11 | // including commercial applications, and to alter it and redistribute it 12 | // freely, subject to the following restrictions: 13 | // 14 | // 1. The origin of this software must not be misrepresented; you must not 15 | // claim that you wrote the original software. If you use this software 16 | // in a product, an acknowledgment in the product documentation would be 17 | // appreciated but is not required. 18 | // 19 | // 2. Altered source versions must be plainly marked as such, and must not be 20 | // misrepresented as being the original software. 21 | // 22 | // 3. This notice may not be removed or altered from any source distribution. 23 | // 24 | ///////////////////////////////////////////////////////////////////////////////// 25 | 26 | /// @file 27 | /// @brief Functions to create and combine animations 28 | 29 | #ifndef THOR_ANIMATIONPRIMITIVES_HPP 30 | #define THOR_ANIMATIONPRIMITIVES_HPP 31 | 32 | #include 33 | #include 34 | 35 | #include 36 | 37 | #include 38 | #include 39 | #include 40 | #include 41 | 42 | 43 | namespace thor 44 | { 45 | namespace detail 46 | { 47 | 48 | } // namespace 49 | 50 | 51 | /// @addtogroup Animations 52 | /// @{ 53 | 54 | 55 | 56 | 57 | 58 | /// @} 59 | 60 | } // namespace thor 61 | 62 | #include 63 | #endif // THOR_ANIMATIONMAP_HPP 64 | -------------------------------------------------------------------------------- /SpriteAnimator/third-party/thor/include/Thor/Animations/ColorAnimation.hpp: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Thor C++ Library 4 | // Copyright (c) 2011-2017 Jan Haller 5 | // 6 | // This software is provided 'as-is', without any express or implied 7 | // warranty. In no event will the authors be held liable for any damages 8 | // arising from the use of this software. 9 | // 10 | // Permission is granted to anyone to use this software for any purpose, 11 | // including commercial applications, and to alter it and redistribute it 12 | // freely, subject to the following restrictions: 13 | // 14 | // 1. The origin of this software must not be misrepresented; you must not 15 | // claim that you wrote the original software. If you use this software 16 | // in a product, an acknowledgment in the product documentation would be 17 | // appreciated but is not required. 18 | // 19 | // 2. Altered source versions must be plainly marked as such, and must not be 20 | // misrepresented as being the original software. 21 | // 22 | // 3. This notice may not be removed or altered from any source distribution. 23 | // 24 | ///////////////////////////////////////////////////////////////////////////////// 25 | 26 | /// @file 27 | /// @brief Class thor::ColorAnimation 28 | 29 | #ifndef THOR_COLORANIMATION_HPP 30 | #define THOR_COLORANIMATION_HPP 31 | 32 | #include 33 | #include 34 | #include 35 | 36 | 37 | namespace thor 38 | { 39 | 40 | /// @addtogroup Animations 41 | /// @{ 42 | 43 | /// @brief Changes an object's color smoothly over time. 44 | /// @details This class stores a ColorGradient which is applied to animated objects. 45 | class THOR_API ColorAnimation 46 | { 47 | // --------------------------------------------------------------------------------------------------------------------------- 48 | // Public member functions 49 | public: 50 | /// @brief Constructor 51 | /// @param gradient The color gradient affecting the objects. Can also be a single sf::Color. 52 | explicit ColorAnimation(const ColorGradient& gradient); 53 | 54 | /// @brief Animates the object. 55 | /// @param animated Object to colorize according to the color gradient. 56 | /// @param progress Value in [0,1] determining the progress of the animation. 57 | /// @tparam Animated Type of animated object. The function thor::setColor() is invoked for it. 58 | template 59 | void operator() (Animated& animated, float progress) const; 60 | 61 | 62 | // --------------------------------------------------------------------------------------------------------------------------- 63 | // Private variables 64 | private: 65 | ColorGradient mGradient; 66 | }; 67 | 68 | /// @} 69 | 70 | // --------------------------------------------------------------------------------------------------------------------------- 71 | 72 | 73 | template 74 | void ColorAnimation::operator() (Animated& target, float progress) const 75 | { 76 | setColor(target, mGradient.sampleColor(progress)); 77 | } 78 | 79 | } // namespace thor 80 | 81 | #endif // THOR_COLORANIMATION_HPP 82 | -------------------------------------------------------------------------------- /SpriteAnimator/third-party/thor/include/Thor/Animations/Detail/AnimationMap.inl: -------------------------------------------------------------------------------- 1 | #include "..\AnimationMap.hpp" 2 | ///////////////////////////////////////////////////////////////////////////////// 3 | // 4 | // Thor C++ Library 5 | // Copyright (c) 2011-2017 Jan Haller 6 | // 7 | // This software is provided 'as-is', without any express or implied 8 | // warranty. In no event will the authors be held liable for any damages 9 | // arising from the use of this software. 10 | // 11 | // Permission is granted to anyone to use this software for any purpose, 12 | // including commercial applications, and to alter it and redistribute it 13 | // freely, subject to the following restrictions: 14 | // 15 | // 1. The origin of this software must not be misrepresented; you must not 16 | // claim that you wrote the original software. If you use this software 17 | // in a product, an acknowledgment in the product documentation would be 18 | // appreciated but is not required. 19 | // 20 | // 2. Altered source versions must be plainly marked as such, and must not be 21 | // misrepresented as being the original software. 22 | // 23 | // 3. This notice may not be removed or altered from any source distribution. 24 | // 25 | ///////////////////////////////////////////////////////////////////////////////// 26 | 27 | namespace thor 28 | { 29 | 30 | template 31 | AnimationMap::AnimationMap() 32 | : mAnimationMap() 33 | { 34 | } 35 | 36 | template 37 | void AnimationMap::addAnimation(Id id, std::function animation, sf::Time duration) 38 | { 39 | assert(mAnimationMap.find(id) == mAnimationMap.end()); 40 | assert(duration > sf::Time::Zero); 41 | 42 | mAnimationMap.insert(std::make_pair(std::move(id), TimedAnimation(std::move(animation), duration))); 43 | } 44 | 45 | template 46 | inline void AnimationMap::removeAnimation(const Id& id) 47 | { 48 | assert(mAnimationMap.find(id) != mAnimationMap.end()); 49 | 50 | mAnimationMap.erase(id); 51 | } 52 | 53 | template 54 | inline void AnimationMap::setDuration(const Id& id, const float& duration) 55 | { 56 | auto itr = mAnimationMap.find(id); 57 | assert(itr != mAnimationMap.end()); 58 | 59 | itr->second.duration = sf::seconds(duration); 60 | } 61 | 62 | template 63 | inline const std::size_t AnimationMap::getSize() const 64 | { 65 | return mAnimationMap.size(); 66 | } 67 | 68 | template 69 | const typename AnimationMap::TimedAnimation& AnimationMap::getAnimation(const Id& id) const 70 | { 71 | auto itr = mAnimationMap.find(id); 72 | assert(itr != mAnimationMap.end()); 73 | 74 | return itr->second; 75 | } 76 | 77 | } // namespace thor 78 | -------------------------------------------------------------------------------- /SpriteAnimator/third-party/thor/include/Thor/Animations/Detail/RefAnimation.inl: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Thor C++ Library 4 | // Copyright (c) 2011-2017 Jan Haller 5 | // 6 | // This software is provided 'as-is', without any express or implied 7 | // warranty. In no event will the authors be held liable for any damages 8 | // arising from the use of this software. 9 | // 10 | // Permission is granted to anyone to use this software for any purpose, 11 | // including commercial applications, and to alter it and redistribute it 12 | // freely, subject to the following restrictions: 13 | // 14 | // 1. The origin of this software must not be misrepresented; you must not 15 | // claim that you wrote the original software. If you use this software 16 | // in a product, an acknowledgment in the product documentation would be 17 | // appreciated but is not required. 18 | // 19 | // 2. Altered source versions must be plainly marked as such, and must not be 20 | // misrepresented as being the original software. 21 | // 22 | // 3. This notice may not be removed or altered from any source distribution. 23 | // 24 | ///////////////////////////////////////////////////////////////////////////////// 25 | 26 | namespace thor 27 | { 28 | 29 | template 30 | RefAnimation::RefAnimation(Animation& referenced) 31 | : mReferenced(&referenced) 32 | { 33 | } 34 | 35 | template 36 | template 37 | void RefAnimation::operator() (Animated& animated, float progress) 38 | { 39 | (*mReferenced)(animated, progress); 40 | } 41 | 42 | template 43 | RefAnimation refAnimation(Animation& referenced) 44 | { 45 | return RefAnimation(referenced); 46 | } 47 | 48 | } // namespace thor 49 | -------------------------------------------------------------------------------- /SpriteAnimator/third-party/thor/include/Thor/Animations/FadeAnimation.hpp: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Thor C++ Library 4 | // Copyright (c) 2011-2017 Jan Haller 5 | // 6 | // This software is provided 'as-is', without any express or implied 7 | // warranty. In no event will the authors be held liable for any damages 8 | // arising from the use of this software. 9 | // 10 | // Permission is granted to anyone to use this software for any purpose, 11 | // including commercial applications, and to alter it and redistribute it 12 | // freely, subject to the following restrictions: 13 | // 14 | // 1. The origin of this software must not be misrepresented; you must not 15 | // claim that you wrote the original software. If you use this software 16 | // in a product, an acknowledgment in the product documentation would be 17 | // appreciated but is not required. 18 | // 19 | // 2. Altered source versions must be plainly marked as such, and must not be 20 | // misrepresented as being the original software. 21 | // 22 | // 3. This notice may not be removed or altered from any source distribution. 23 | // 24 | ///////////////////////////////////////////////////////////////////////////////// 25 | 26 | /// @file 27 | /// @brief Class thor::FadeAnimation 28 | 29 | #ifndef THOR_FADEANIMATION_HPP 30 | #define THOR_FADEANIMATION_HPP 31 | 32 | #include 33 | #include 34 | 35 | 36 | namespace thor 37 | { 38 | 39 | /// @addtogroup Animations 40 | /// @{ 41 | 42 | /// @brief Lets an object fade in or out. 43 | /// @details Changes the alpha value of animated objects at the beginning and/or end of the animation. 44 | class THOR_API FadeAnimation 45 | { 46 | // --------------------------------------------------------------------------------------------------------------------------- 47 | // Public member functions 48 | public: 49 | /// @brief Constructor 50 | /// @param inRatio The part of time during which the object is faded @b in. Must be in the interval [0, 1]. 51 | /// @param outRatio The part of time during which the object is faded @b out. Must be in the interval [0, 1-inRatio]. 52 | /// @details Example: Let's say you want an object to fade in during the first quarter of its animation, and to fade out 53 | /// during the second half of its animation. Therefore, inRatio = 0.25 and outRatio = 0.5. 54 | FadeAnimation(float inRatio, float outRatio); 55 | 56 | /// @brief Animates the object. 57 | /// @param animated Object to fade in and/or out. 58 | /// @param progress Value in [0,1] determining the progress of the animation. 59 | /// @tparam Animated Type of animated object. The function thor::setAlpha() is invoked for it. 60 | template 61 | void operator() (Animated& animated, float progress) const; 62 | 63 | 64 | // --------------------------------------------------------------------------------------------------------------------------- 65 | // Private variables 66 | private: 67 | float mInRatio; 68 | float mOutRatio; 69 | }; 70 | 71 | /// @} 72 | 73 | // --------------------------------------------------------------------------------------------------------------------------- 74 | 75 | 76 | template 77 | void FadeAnimation::operator() (Animated& target, float progress) const 78 | { 79 | if (progress < mInRatio) 80 | setAlpha(target, static_cast(256 * progress / mInRatio)); 81 | else if (progress > 1.f - mOutRatio) 82 | setAlpha(target, static_cast(256 * (1.f-progress) / mOutRatio)); 83 | } 84 | 85 | } // namespace thor 86 | 87 | #endif // THOR_FADEANIMATION_HPP 88 | -------------------------------------------------------------------------------- /SpriteAnimator/third-party/thor/include/Thor/Animations/Playback.hpp: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Thor C++ Library 4 | // Copyright (c) 2011-2017 Jan Haller 5 | // 6 | // This software is provided 'as-is', without any express or implied 7 | // warranty. In no event will the authors be held liable for any damages 8 | // arising from the use of this software. 9 | // 10 | // Permission is granted to anyone to use this software for any purpose, 11 | // including commercial applications, and to alter it and redistribute it 12 | // freely, subject to the following restrictions: 13 | // 14 | // 1. The origin of this software must not be misrepresented; you must not 15 | // claim that you wrote the original software. If you use this software 16 | // in a product, an acknowledgment in the product documentation would be 17 | // appreciated but is not required. 18 | // 19 | // 2. Altered source versions must be plainly marked as such, and must not be 20 | // misrepresented as being the original software. 21 | // 22 | // 3. This notice may not be removed or altered from any source distribution. 23 | // 24 | ///////////////////////////////////////////////////////////////////////////////// 25 | 26 | /// @file 27 | /// @brief Namespace thor::Playback 28 | 29 | #ifndef THOR_PLAYBACK_HPP 30 | #define THOR_PLAYBACK_HPP 31 | 32 | #include 33 | #include 34 | 35 | #include 36 | 37 | 38 | namespace thor 39 | { 40 | 41 | /// @addtogroup Animations 42 | /// @{ 43 | 44 | /// @brief Namespace for animation playback schemes 45 | /// @details Provides functions that define the way in which animations can be queued and repeated. 46 | /// @see thor::Animator 47 | namespace Playback 48 | { 49 | 50 | /// @brief Repeat animation a finite number of times 51 | /// @param id Identifier referring to the animation 52 | /// @param times Number of times > 0 53 | /// @return Queue object with @c operator<< to chain multiple playback schemes 54 | template 55 | AURORA_IMPL_DEF(typename detail::DecayedScheme::Type) repeat(Id id, std::size_t times) 56 | { 57 | assert(times > 0u); 58 | return typename detail::DecayedScheme::Type(std::move(id), times); 59 | } 60 | 61 | /// @brief Repeat animation an infinite number of times 62 | /// @param id Identifier referring to the animation 63 | /// @return Queue object with @c operator<< to chain multiple playback schemes 64 | template 65 | AURORA_IMPL_DEF(typename detail::DecayedScheme::Type) loop(Id id) 66 | { 67 | return typename detail::DecayedScheme::Type(std::move(id)); 68 | } 69 | 70 | /// @brief Register a callback function in the queue 71 | /// @param callback Function to be called. 72 | /// @return Queue object with @c operator<< to chain multiple playback schemes 73 | inline AURORA_IMPL_DEF(detail::NotifyScheme) notify(std::function callback) 74 | { 75 | return detail::NotifyScheme(std::move(callback)); 76 | } 77 | 78 | } // namespace Playback 79 | 80 | /// @} 81 | 82 | } // namespace thor 83 | 84 | #endif // THOR_PLAYBACK_HPP 85 | -------------------------------------------------------------------------------- /SpriteAnimator/third-party/thor/include/Thor/Animations/RefAnimation.hpp: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Thor C++ Library 4 | // Copyright (c) 2011-2017 Jan Haller 5 | // 6 | // This software is provided 'as-is', without any express or implied 7 | // warranty. In no event will the authors be held liable for any damages 8 | // arising from the use of this software. 9 | // 10 | // Permission is granted to anyone to use this software for any purpose, 11 | // including commercial applications, and to alter it and redistribute it 12 | // freely, subject to the following restrictions: 13 | // 14 | // 1. The origin of this software must not be misrepresented; you must not 15 | // claim that you wrote the original software. If you use this software 16 | // in a product, an acknowledgment in the product documentation would be 17 | // appreciated but is not required. 18 | // 19 | // 2. Altered source versions must be plainly marked as such, and must not be 20 | // misrepresented as being the original software. 21 | // 22 | // 3. This notice may not be removed or altered from any source distribution. 23 | // 24 | ///////////////////////////////////////////////////////////////////////////////// 25 | 26 | /// @file 27 | /// @brief Class template thor::RefAnimation 28 | 29 | #ifndef THOR_REFANIMATION_HPP 30 | #define THOR_REFANIMATION_HPP 31 | 32 | namespace thor 33 | { 34 | 35 | /// @addtogroup Animations 36 | /// @{ 37 | 38 | /// @brief Class to reference another animation. 39 | /// @details This class can be used to create an animation that has no functionality on its own, but references another 40 | /// existing animation. By using it, you can avoid copies and change the original animation object, even after it has been 41 | /// added to a thor::Animator. On the other side, you must make sure the original animation stays alive while being referenced. 42 | /// @n@n Usually, you create objects of this class by calling @ref refAnimation() "thor::refAnimation()". 43 | template 44 | class RefAnimation 45 | { 46 | // --------------------------------------------------------------------------------------------------------------------------- 47 | // Public member functions 48 | public: 49 | /// @brief Constructor 50 | /// @param referenced Animation to reference. Must remain valid during usage. 51 | explicit RefAnimation(Animation& referenced); 52 | 53 | /// @brief Animates the object. 54 | /// @details Forwards the call to the referenced animation. 55 | template 56 | void operator() (Animated& animated, float progress); 57 | 58 | 59 | // --------------------------------------------------------------------------------------------------------------------------- 60 | // Private variables 61 | private: 62 | Animation* mReferenced; 63 | }; 64 | 65 | /// @relates RefAnimation 66 | /// @brief Creates an animation that references another one. 67 | /// @param referenced Animation to reference. Must remain valid during usage. 68 | /// @details Creates an animation object that has no functionality on its own, but references another existing animation. 69 | /// By using it, you can avoid copies and change the original animation object, even after it has been added to a 70 | /// thor::AnimationMap. On the other side, you must make sure the original animation stays alive while being referenced. 71 | /// @n@n Example: 72 | /// @code 73 | /// // Create animation 74 | /// thor::FrameAnimation anim; 75 | /// 76 | /// // Insert reference into animation map 77 | /// thor::AnimationMap<...> animations; 78 | /// animations.addAnimation(..., thor::refAnimation(anim), ...); 79 | /// 80 | /// // Later changes will affect animation inside animator 81 | /// anim.addFrame(...); 82 | /// @endcode 83 | template 84 | RefAnimation refAnimation(Animation& referenced); 85 | 86 | /// @} 87 | 88 | } // namespace thor 89 | 90 | #include 91 | #endif // THOR_REFANIMATION_HPP 92 | -------------------------------------------------------------------------------- /SpriteAnimator/third-party/thor/include/Thor/Config.hpp: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Thor C++ Library 4 | // Copyright (c) 2011-2017 Jan Haller 5 | // 6 | // This software is provided 'as-is', without any express or implied 7 | // warranty. In no event will the authors be held liable for any damages 8 | // arising from the use of this software. 9 | // 10 | // Permission is granted to anyone to use this software for any purpose, 11 | // including commercial applications, and to alter it and redistribute it 12 | // freely, subject to the following restrictions: 13 | // 14 | // 1. The origin of this software must not be misrepresented; you must not 15 | // claim that you wrote the original software. If you use this software 16 | // in a product, an acknowledgment in the product documentation would be 17 | // appreciated but is not required. 18 | // 19 | // 2. Altered source versions must be plainly marked as such, and must not be 20 | // misrepresented as being the original software. 21 | // 22 | // 3. This notice may not be removed or altered from any source distribution. 23 | // 24 | ///////////////////////////////////////////////////////////////////////////////// 25 | 26 | /// @file 27 | /// @brief Configuration header of the library 28 | 29 | #ifndef THOR_CONFIG_HPP 30 | #define THOR_CONFIG_HPP 31 | 32 | #include 33 | 34 | 35 | // Define DLL import/export macros (only Windows, and only dynamic configuration) 36 | #if (defined(_WIN32) || defined(__WIN32__)) && !defined(SFML_STATIC) 37 | 38 | // Export dynamic link library (from DLL side) 39 | #ifdef THOR_EXPORTS 40 | #define THOR_API __declspec(dllexport) 41 | 42 | // Import dynamic link library (from client side) 43 | #else 44 | #define THOR_API __declspec(dllimport) 45 | 46 | #endif // THOR_EXPORTS 47 | 48 | // Disable annoying MSVC++ warning 49 | #ifdef _MSC_VER 50 | #pragma warning(disable: 4251) 51 | #endif // _MSC_VER 52 | 53 | 54 | // Other platforms don't have DLLs 55 | #else 56 | #define THOR_API 57 | 58 | #endif 59 | 60 | 61 | // Version of the library 62 | #define THOR_VERSION_MAJOR 2 63 | #define THOR_VERSION_MINOR 0 64 | 65 | 66 | #endif // THOR_CONFIG_HPP 67 | -------------------------------------------------------------------------------- /SpriteAnimator/third-party/thor/include/Thor/Graphics.hpp: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Thor C++ Library 4 | // Copyright (c) 2011-2017 Jan Haller 5 | // 6 | // This software is provided 'as-is', without any express or implied 7 | // warranty. In no event will the authors be held liable for any damages 8 | // arising from the use of this software. 9 | // 10 | // Permission is granted to anyone to use this software for any purpose, 11 | // including commercial applications, and to alter it and redistribute it 12 | // freely, subject to the following restrictions: 13 | // 14 | // 1. The origin of this software must not be misrepresented; you must not 15 | // claim that you wrote the original software. If you use this software 16 | // in a product, an acknowledgment in the product documentation would be 17 | // appreciated but is not required. 18 | // 19 | // 2. Altered source versions must be plainly marked as such, and must not be 20 | // misrepresented as being the original software. 21 | // 22 | // 3. This notice may not be removed or altered from any source distribution. 23 | // 24 | ///////////////////////////////////////////////////////////////////////////////// 25 | 26 | /// @file 27 | /// @brief Complete header for the Graphics module 28 | 29 | #ifndef THOR_MODULE_GRAPHICS_HPP 30 | #define THOR_MODULE_GRAPHICS_HPP 31 | 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | 38 | #endif // THOR_MODULE_GRAPHICS_HPP 39 | -------------------------------------------------------------------------------- /SpriteAnimator/third-party/thor/include/Thor/Graphics/Detail/ToString.inl: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Thor C++ Library 4 | // Copyright (c) 2011-2017 Jan Haller 5 | // 6 | // This software is provided 'as-is', without any express or implied 7 | // warranty. In no event will the authors be held liable for any damages 8 | // arising from the use of this software. 9 | // 10 | // Permission is granted to anyone to use this software for any purpose, 11 | // including commercial applications, and to alter it and redistribute it 12 | // freely, subject to the following restrictions: 13 | // 14 | // 1. The origin of this software must not be misrepresented; you must not 15 | // claim that you wrote the original software. If you use this software 16 | // in a product, an acknowledgment in the product documentation would be 17 | // appreciated but is not required. 18 | // 19 | // 2. Altered source versions must be plainly marked as such, and must not be 20 | // misrepresented as being the original software. 21 | // 22 | // 3. This notice may not be removed or altered from any source distribution. 23 | // 24 | ///////////////////////////////////////////////////////////////////////////////// 25 | 26 | namespace thor 27 | { 28 | 29 | template 30 | std::string toString(const sf::Vector2& vector) 31 | { 32 | std::ostringstream stream; 33 | stream << '(' << vector.x << ',' << vector.y << ')'; 34 | return stream.str(); 35 | } 36 | 37 | template 38 | std::string toString(const sf::Vector3& vector) 39 | { 40 | std::ostringstream stream; 41 | stream << '(' << vector.x << ',' << vector.y << ',' << vector.z << ')'; 42 | return stream.str(); 43 | } 44 | 45 | template 46 | std::string toString(const sf::Rect& rect) 47 | { 48 | std::ostringstream stream; 49 | stream << '(' << rect.left << ',' << rect.top << ';' << rect.width << ',' << rect.height << ')'; 50 | return stream.str(); 51 | } 52 | 53 | template 54 | std::string toString(const PolarVector2& vector) 55 | { 56 | std::ostringstream stream; 57 | stream << "(" << vector.r << "," << vector.phi << "\x00B0)"; 58 | return stream.str(); 59 | } 60 | 61 | } // namespace thor 62 | -------------------------------------------------------------------------------- /SpriteAnimator/third-party/thor/include/Thor/Graphics/Detail/UniformAccess.inl: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Thor C++ Library 4 | // Copyright (c) 2011-2017 Jan Haller 5 | // 6 | // This software is provided 'as-is', without any express or implied 7 | // warranty. In no event will the authors be held liable for any damages 8 | // arising from the use of this software. 9 | // 10 | // Permission is granted to anyone to use this software for any purpose, 11 | // including commercial applications, and to alter it and redistribute it 12 | // freely, subject to the following restrictions: 13 | // 14 | // 1. The origin of this software must not be misrepresented; you must not 15 | // claim that you wrote the original software. If you use this software 16 | // in a product, an acknowledgment in the product documentation would be 17 | // appreciated but is not required. 18 | // 19 | // 2. Altered source versions must be plainly marked as such, and must not be 20 | // misrepresented as being the original software. 21 | // 22 | // 3. This notice may not be removed or altered from any source distribution. 23 | // 24 | ///////////////////////////////////////////////////////////////////////////////// 25 | 26 | namespace thor 27 | { 28 | 29 | template 30 | void setColor(T& object, const sf::Color& color) 31 | { 32 | object.setColor(color); 33 | } 34 | 35 | template 36 | void setAlpha(T& object, sf::Uint8 alpha) 37 | { 38 | sf::Color color = object.getColor(); 39 | color.a = alpha; 40 | object.setColor(color); 41 | } 42 | 43 | } // namespace thor 44 | -------------------------------------------------------------------------------- /SpriteAnimator/third-party/thor/include/Thor/Graphics/ToString.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rikora/SpriteAnimator/28ff574636438c97c58f2786e7896441e847f14b/SpriteAnimator/third-party/thor/include/Thor/Graphics/ToString.hpp -------------------------------------------------------------------------------- /SpriteAnimator/third-party/thor/include/Thor/Graphics/UniformAccess.hpp: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Thor C++ Library 4 | // Copyright (c) 2011-2017 Jan Haller 5 | // 6 | // This software is provided 'as-is', without any express or implied 7 | // warranty. In no event will the authors be held liable for any damages 8 | // arising from the use of this software. 9 | // 10 | // Permission is granted to anyone to use this software for any purpose, 11 | // including commercial applications, and to alter it and redistribute it 12 | // freely, subject to the following restrictions: 13 | // 14 | // 1. The origin of this software must not be misrepresented; you must not 15 | // claim that you wrote the original software. If you use this software 16 | // in a product, an acknowledgment in the product documentation would be 17 | // appreciated but is not required. 18 | // 19 | // 2. Altered source versions must be plainly marked as such, and must not be 20 | // misrepresented as being the original software. 21 | // 22 | // 3. This notice may not be removed or altered from any source distribution. 23 | // 24 | ///////////////////////////////////////////////////////////////////////////////// 25 | 26 | /// @file 27 | /// @brief Global functions to access SFML and Thor objects uniformly 28 | 29 | #ifndef THOR_UNIFORMACCESS_HPP 30 | #define THOR_UNIFORMACCESS_HPP 31 | 32 | #include 33 | 34 | #include 35 | 36 | 37 | namespace thor 38 | { 39 | 40 | class Particle; 41 | 42 | /// @addtogroup Graphics 43 | /// @{ 44 | 45 | /// @brief Sets the color of a graphical object. 46 | /// 47 | template 48 | void setColor(T& object, const sf::Color& color); 49 | 50 | /// @brief Sets the color of a particle. 51 | /// 52 | void THOR_API setColor(Particle& particle, const sf::Color& color); 53 | 54 | /// @brief Sets the alpha color value of a graphical object. 55 | /// @details The object shall support the methods @a getColor() and @a setColor(). 56 | template 57 | void setAlpha(T& object, sf::Uint8 alpha); 58 | 59 | /// @brief Sets the alpha color value of a particle. 60 | /// 61 | void THOR_API setAlpha(Particle& particle, sf::Uint8 alpha); 62 | 63 | /// @} 64 | 65 | } // namespace thor 66 | 67 | #include 68 | #endif // THOR_UNIFORMACCESS_HPP 69 | -------------------------------------------------------------------------------- /SpriteAnimator/third-party/thor/include/Thor/Input.hpp: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Thor C++ Library 4 | // Copyright (c) 2011-2017 Jan Haller 5 | // 6 | // This software is provided 'as-is', without any express or implied 7 | // warranty. In no event will the authors be held liable for any damages 8 | // arising from the use of this software. 9 | // 10 | // Permission is granted to anyone to use this software for any purpose, 11 | // including commercial applications, and to alter it and redistribute it 12 | // freely, subject to the following restrictions: 13 | // 14 | // 1. The origin of this software must not be misrepresented; you must not 15 | // claim that you wrote the original software. If you use this software 16 | // in a product, an acknowledgment in the product documentation would be 17 | // appreciated but is not required. 18 | // 19 | // 2. Altered source versions must be plainly marked as such, and must not be 20 | // misrepresented as being the original software. 21 | // 22 | // 3. This notice may not be removed or altered from any source distribution. 23 | // 24 | ///////////////////////////////////////////////////////////////////////////////// 25 | 26 | /// @file 27 | /// @brief Complete header for the Input module 28 | 29 | #ifndef THOR_MODULE_INPUT_HPP 30 | #define THOR_MODULE_INPUT_HPP 31 | 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | 40 | #endif // THOR_MODULE_INPUT_HPP 41 | -------------------------------------------------------------------------------- /SpriteAnimator/third-party/thor/include/Thor/Input/Detail/ConnectionImpl.hpp: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Thor C++ Library 4 | // Copyright (c) 2011-2017 Jan Haller 5 | // 6 | // This software is provided 'as-is', without any express or implied 7 | // warranty. In no event will the authors be held liable for any damages 8 | // arising from the use of this software. 9 | // 10 | // Permission is granted to anyone to use this software for any purpose, 11 | // including commercial applications, and to alter it and redistribute it 12 | // freely, subject to the following restrictions: 13 | // 14 | // 1. The origin of this software must not be misrepresented; you must not 15 | // claim that you wrote the original software. If you use this software 16 | // in a product, an acknowledgment in the product documentation would be 17 | // appreciated but is not required. 18 | // 19 | // 2. Altered source versions must be plainly marked as such, and must not be 20 | // misrepresented as being the original software. 21 | // 22 | // 3. This notice may not be removed or altered from any source distribution. 23 | // 24 | ///////////////////////////////////////////////////////////////////////////////// 25 | 26 | #ifndef THOR_CONNECTIONIMPL_HPP 27 | #define THOR_CONNECTIONIMPL_HPP 28 | 29 | #include 30 | #include 31 | 32 | 33 | namespace thor 34 | { 35 | namespace detail 36 | { 37 | 38 | // Abstract class that allows to disconnect listeners using type erasure 39 | class AbstractConnectionImpl 40 | { 41 | public: 42 | // Disconnects a listener from an event 43 | virtual void disconnect() = 0; 44 | 45 | // Virtual destructor 46 | virtual ~AbstractConnectionImpl() 47 | { 48 | } 49 | }; 50 | 51 | // Concrete class implementing the actual disconnection for std::list and iterator 52 | template 53 | class IteratorConnectionImpl : public AbstractConnectionImpl 54 | { 55 | private: 56 | typedef typename List::Iterator Iterator; 57 | 58 | public: 59 | // Constructor 60 | IteratorConnectionImpl(List& container, Iterator iterator) 61 | : mContainer(&container) 62 | , mIterator(iterator) 63 | { 64 | } 65 | 66 | virtual void disconnect() 67 | { 68 | mContainer->remove(mIterator); 69 | } 70 | 71 | private: 72 | List* mContainer; 73 | Iterator mIterator; 74 | }; 75 | 76 | // Concrete class implementing the actual disconnection for any container and ID 77 | template 78 | class IdConnectionImpl : public AbstractConnectionImpl 79 | { 80 | private: 81 | typedef typename Container::value_type ValueType; 82 | 83 | public: 84 | // Constructor 85 | IdConnectionImpl(Container& container, unsigned int id) 86 | : mContainer(&container) 87 | , mId(id) 88 | { 89 | } 90 | 91 | virtual void disconnect() 92 | { 93 | // TODO: Use binary search 94 | auto found = std::find_if(mContainer->begin(), mContainer->end(), [this] (ValueType& v) { return v.id == mId; }); 95 | 96 | if (found != mContainer->end()) 97 | mContainer->erase(found); 98 | } 99 | 100 | private: 101 | Container* mContainer; 102 | unsigned int mId; 103 | }; 104 | 105 | template 106 | std::shared_ptr> makeIteratorConnectionImpl(List& container, typename List::Iterator iterator) 107 | { 108 | return std::make_shared>(container, iterator); 109 | } 110 | 111 | template 112 | std::shared_ptr> makeIdConnectionImpl(Container& container, unsigned int id) 113 | { 114 | return std::make_shared>(container, id); 115 | } 116 | 117 | } // namespace detail 118 | } // namespace thor 119 | 120 | #endif // THOR_CONNECTIONIMPL_HPP 121 | -------------------------------------------------------------------------------- /SpriteAnimator/third-party/thor/include/Thor/Input/Detail/EventSystem.inl: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Thor C++ Library 4 | // Copyright (c) 2011-2017 Jan Haller 5 | // 6 | // This software is provided 'as-is', without any express or implied 7 | // warranty. In no event will the authors be held liable for any damages 8 | // arising from the use of this software. 9 | // 10 | // Permission is granted to anyone to use this software for any purpose, 11 | // including commercial applications, and to alter it and redistribute it 12 | // freely, subject to the following restrictions: 13 | // 14 | // 1. The origin of this software must not be misrepresented; you must not 15 | // claim that you wrote the original software. If you use this software 16 | // in a product, an acknowledgment in the product documentation would be 17 | // appreciated but is not required. 18 | // 19 | // 2. Altered source versions must be plainly marked as such, and must not be 20 | // misrepresented as being the original software. 21 | // 22 | // 3. This notice may not be removed or altered from any source distribution. 23 | // 24 | ///////////////////////////////////////////////////////////////////////////////// 25 | 26 | namespace thor 27 | { 28 | 29 | template 30 | EventSystem::EventSystem() 31 | : mListeners() 32 | { 33 | } 34 | 35 | template 36 | void EventSystem::triggerEvent(const Event& event) 37 | { 38 | // Import symbol getEventId to qualify for ADL. 39 | using namespace detail; 40 | 41 | mListeners.call(getEventId(event), event); 42 | } 43 | 44 | template 45 | Connection EventSystem::connect(const EventId& trigger, std::function unaryListener) 46 | { 47 | return mListeners.add(trigger, std::move(unaryListener)); 48 | } 49 | 50 | template 51 | Connection EventSystem::connect0(const EventId& trigger, std::function nullaryListener) 52 | { 53 | return connect(trigger, std::bind(std::move(nullaryListener))); 54 | } 55 | 56 | template 57 | void EventSystem::clearConnections(EventId identifier) 58 | { 59 | mListeners.clear(identifier); 60 | } 61 | 62 | template 63 | void EventSystem::clearAllConnections() 64 | { 65 | mListeners.clearAll(); 66 | } 67 | 68 | // --------------------------------------------------------------------------------------------------------------------------- 69 | 70 | 71 | namespace detail 72 | { 73 | 74 | // Default implementation for events where the Event type is the same as the EventId type. 75 | // This declaration must appear after the invocation in call(), since g++ otherwise prefers 76 | // this function for overload resolution (while the overload for sf::Event isn't considered). 77 | template 78 | const Event& getEventId(const Event& event) 79 | { 80 | return event; 81 | } 82 | 83 | } // namespace detail 84 | } // namespace thor 85 | -------------------------------------------------------------------------------- /SpriteAnimator/third-party/thor/include/Thor/Math.hpp: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Thor C++ Library 4 | // Copyright (c) 2011-2017 Jan Haller 5 | // 6 | // This software is provided 'as-is', without any express or implied 7 | // warranty. In no event will the authors be held liable for any damages 8 | // arising from the use of this software. 9 | // 10 | // Permission is granted to anyone to use this software for any purpose, 11 | // including commercial applications, and to alter it and redistribute it 12 | // freely, subject to the following restrictions: 13 | // 14 | // 1. The origin of this software must not be misrepresented; you must not 15 | // claim that you wrote the original software. If you use this software 16 | // in a product, an acknowledgment in the product documentation would be 17 | // appreciated but is not required. 18 | // 19 | // 2. Altered source versions must be plainly marked as such, and must not be 20 | // misrepresented as being the original software. 21 | // 22 | // 3. This notice may not be removed or altered from any source distribution. 23 | // 24 | ///////////////////////////////////////////////////////////////////////////////// 25 | 26 | /// @file 27 | /// @brief Complete header for the Math module 28 | 29 | #ifndef THOR_MODULE_MATH_HPP 30 | #define THOR_MODULE_MATH_HPP 31 | 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | 39 | #endif // THOR_MODULE_MATH_HPP 40 | -------------------------------------------------------------------------------- /SpriteAnimator/third-party/thor/include/Thor/Math/Detail/TriangulationFigures.inl: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Thor C++ Library 4 | // Copyright (c) 2011-2017 Jan Haller 5 | // 6 | // This software is provided 'as-is', without any express or implied 7 | // warranty. In no event will the authors be held liable for any damages 8 | // arising from the use of this software. 9 | // 10 | // Permission is granted to anyone to use this software for any purpose, 11 | // including commercial applications, and to alter it and redistribute it 12 | // freely, subject to the following restrictions: 13 | // 14 | // 1. The origin of this software must not be misrepresented; you must not 15 | // claim that you wrote the original software. If you use this software 16 | // in a product, an acknowledgment in the product documentation would be 17 | // appreciated but is not required. 18 | // 19 | // 2. Altered source versions must be plainly marked as such, and must not be 20 | // misrepresented as being the original software. 21 | // 22 | // 3. This notice may not be removed or altered from any source distribution. 23 | // 24 | ///////////////////////////////////////////////////////////////////////////////// 25 | 26 | namespace thor 27 | { 28 | namespace detail 29 | { 30 | 31 | bool THOR_API isClockwiseOriented(sf::Vector2f v0, sf::Vector2f v1, sf::Vector2f v2); 32 | 33 | template 34 | sf::Vector2f getVertexPosition(const V& vertex); 35 | 36 | } // namespace detail 37 | 38 | // --------------------------------------------------------------------------------------------------------------------------- 39 | 40 | 41 | template 42 | Edge::Edge(V& corner0, V& corner1) 43 | { 44 | assert(detail::getVertexPosition(corner0) != detail::getVertexPosition(corner1)); 45 | 46 | mCorners[0] = &corner0; 47 | mCorners[1] = &corner1; 48 | } 49 | 50 | template 51 | V& Edge::operator[] (std::size_t cornerIndex) 52 | { 53 | return *mCorners[cornerIndex]; 54 | } 55 | 56 | template 57 | const V& Edge::operator[] (std::size_t cornerIndex) const 58 | { 59 | return *mCorners[cornerIndex]; 60 | } 61 | 62 | // --------------------------------------------------------------------------------------------------------------------------- 63 | 64 | 65 | template 66 | Triangle::Triangle(V& corner0, V& corner1, V& corner2) 67 | { 68 | assert(detail::isClockwiseOriented( 69 | detail::getVertexPosition(corner0), 70 | detail::getVertexPosition(corner1), 71 | detail::getVertexPosition(corner2))); 72 | 73 | mCorners[0] = &corner0; 74 | mCorners[1] = &corner1; 75 | mCorners[2] = &corner2; 76 | } 77 | 78 | template 79 | V& Triangle::operator[] (std::size_t cornerIndex) 80 | { 81 | return *mCorners[cornerIndex]; 82 | } 83 | 84 | template 85 | const V& Triangle::operator[] (std::size_t cornerIndex) const 86 | { 87 | return *mCorners[cornerIndex]; 88 | } 89 | 90 | } // namespace thor 91 | -------------------------------------------------------------------------------- /SpriteAnimator/third-party/thor/include/Thor/Math/Distributions.hpp: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Thor C++ Library 4 | // Copyright (c) 2011-2017 Jan Haller 5 | // 6 | // This software is provided 'as-is', without any express or implied 7 | // warranty. In no event will the authors be held liable for any damages 8 | // arising from the use of this software. 9 | // 10 | // Permission is granted to anyone to use this software for any purpose, 11 | // including commercial applications, and to alter it and redistribute it 12 | // freely, subject to the following restrictions: 13 | // 14 | // 1. The origin of this software must not be misrepresented; you must not 15 | // claim that you wrote the original software. If you use this software 16 | // in a product, an acknowledgment in the product documentation would be 17 | // appreciated but is not required. 18 | // 19 | // 2. Altered source versions must be plainly marked as such, and must not be 20 | // misrepresented as being the original software. 21 | // 22 | // 3. This notice may not be removed or altered from any source distribution. 23 | // 24 | ///////////////////////////////////////////////////////////////////////////////// 25 | 26 | /// @file 27 | /// @brief Functors to create random distributions of geometric shapes 28 | 29 | #ifndef THOR_DISTRIBUTIONS_HPP 30 | #define THOR_DISTRIBUTIONS_HPP 31 | 32 | #include 33 | #include 34 | 35 | #include 36 | #include 37 | 38 | 39 | namespace thor 40 | { 41 | 42 | /// @addtogroup Math 43 | /// @{ 44 | 45 | /// @brief Namespace for some predefined distribution functions 46 | /// 47 | namespace Distributions 48 | { 49 | 50 | /// @brief %Uniform random distribution in an int interval 51 | /// 52 | Distribution THOR_API uniform(int min, int max); 53 | 54 | /// @brief %Uniform random distribution in an unsigned int interval 55 | /// 56 | Distribution THOR_API uniform(unsigned int min, unsigned int max); 57 | 58 | /// @brief %Uniform random distribution in a float interval 59 | /// 60 | Distribution THOR_API uniform(float min, float max); 61 | 62 | /// @brief %Uniform random distribution in a time interval 63 | /// 64 | Distribution THOR_API uniform(sf::Time min, sf::Time max); 65 | 66 | /// @brief %Uniform random distribution in a rectangle 67 | /// 68 | Distribution THOR_API rect(sf::Vector2f center, sf::Vector2f halfSize); 69 | 70 | /// @brief %Uniform random distribution in a circle 71 | /// 72 | Distribution THOR_API circle(sf::Vector2f center, float radius); 73 | 74 | /// @brief Vector rotation with a random angle 75 | /// 76 | Distribution THOR_API deflect(sf::Vector2f direction, float maxRotation); 77 | 78 | } // namespace Distributions 79 | 80 | /// @} 81 | 82 | } // namespace thor 83 | 84 | #endif // THOR_DISTRIBUTIONS_HPP 85 | -------------------------------------------------------------------------------- /SpriteAnimator/third-party/thor/include/Thor/Math/Random.hpp: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Thor C++ Library 4 | // Copyright (c) 2011-2017 Jan Haller 5 | // 6 | // This software is provided 'as-is', without any express or implied 7 | // warranty. In no event will the authors be held liable for any damages 8 | // arising from the use of this software. 9 | // 10 | // Permission is granted to anyone to use this software for any purpose, 11 | // including commercial applications, and to alter it and redistribute it 12 | // freely, subject to the following restrictions: 13 | // 14 | // 1. The origin of this software must not be misrepresented; you must not 15 | // claim that you wrote the original software. If you use this software 16 | // in a product, an acknowledgment in the product documentation would be 17 | // appreciated but is not required. 18 | // 19 | // 2. Altered source versions must be plainly marked as such, and must not be 20 | // misrepresented as being the original software. 21 | // 22 | // 3. This notice may not be removed or altered from any source distribution. 23 | // 24 | ///////////////////////////////////////////////////////////////////////////////// 25 | 26 | /// @file 27 | /// @brief Functions for random number generation 28 | 29 | #ifndef THOR_RANDOM_HPP 30 | #define THOR_RANDOM_HPP 31 | 32 | #include 33 | 34 | 35 | namespace thor 36 | { 37 | 38 | /// @addtogroup Math 39 | /// @{ 40 | 41 | /// @brief Returns an int random number in the interval [min, max]. 42 | /// @pre min <= max 43 | int THOR_API random(int min, int max); 44 | 45 | /// @brief Returns an unsigned int random number in the interval [min, max]. 46 | /// @pre min <= max 47 | unsigned int THOR_API random(unsigned int min, unsigned int max); 48 | 49 | /// @brief Returns a float random number in the interval [min, max]. 50 | /// @pre min <= max 51 | float THOR_API random(float min, float max); 52 | 53 | /// @brief Returns a float random number in the interval [middle-deviation, middle+deviation]. 54 | /// @pre deviation >= 0 55 | float THOR_API randomDev(float middle, float deviation); 56 | 57 | /// @brief Sets the seed of the random number generator. 58 | /// @details Setting the seed manually is useful when you want to reproduce a given sequence of random 59 | /// numbers. Without calling this function, the seed is different at each program startup. 60 | void THOR_API setRandomSeed(unsigned long seed); 61 | 62 | /// @} 63 | 64 | } // namespace thor 65 | 66 | #endif // THOR_RANDOM_HPP 67 | -------------------------------------------------------------------------------- /SpriteAnimator/third-party/thor/include/Thor/Particles.hpp: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Thor C++ Library 4 | // Copyright (c) 2011-2017 Jan Haller 5 | // 6 | // This software is provided 'as-is', without any express or implied 7 | // warranty. In no event will the authors be held liable for any damages 8 | // arising from the use of this software. 9 | // 10 | // Permission is granted to anyone to use this software for any purpose, 11 | // including commercial applications, and to alter it and redistribute it 12 | // freely, subject to the following restrictions: 13 | // 14 | // 1. The origin of this software must not be misrepresented; you must not 15 | // claim that you wrote the original software. If you use this software 16 | // in a product, an acknowledgment in the product documentation would be 17 | // appreciated but is not required. 18 | // 19 | // 2. Altered source versions must be plainly marked as such, and must not be 20 | // misrepresented as being the original software. 21 | // 22 | // 3. This notice may not be removed or altered from any source distribution. 23 | // 24 | ///////////////////////////////////////////////////////////////////////////////// 25 | 26 | /// @file 27 | /// @brief Complete header for the Particles module 28 | 29 | #ifndef THOR_MODULE_PARTICLES_HPP 30 | #define THOR_MODULE_PARTICLES_HPP 31 | 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | 38 | #endif // THOR_MODULE_PARTICLES_HPP 39 | -------------------------------------------------------------------------------- /SpriteAnimator/third-party/thor/include/Thor/Particles/EmissionInterface.hpp: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Thor C++ Library 4 | // Copyright (c) 2011-2017 Jan Haller 5 | // 6 | // This software is provided 'as-is', without any express or implied 7 | // warranty. In no event will the authors be held liable for any damages 8 | // arising from the use of this software. 9 | // 10 | // Permission is granted to anyone to use this software for any purpose, 11 | // including commercial applications, and to alter it and redistribute it 12 | // freely, subject to the following restrictions: 13 | // 14 | // 1. The origin of this software must not be misrepresented; you must not 15 | // claim that you wrote the original software. If you use this software 16 | // in a product, an acknowledgment in the product documentation would be 17 | // appreciated but is not required. 18 | // 19 | // 2. Altered source versions must be plainly marked as such, and must not be 20 | // misrepresented as being the original software. 21 | // 22 | // 3. This notice may not be removed or altered from any source distribution. 23 | // 24 | ///////////////////////////////////////////////////////////////////////////////// 25 | 26 | /// @file 27 | /// @brief Class thor::EmissionInterface 28 | 29 | #ifndef THOR_EMISSIONINTERFACE_HPP 30 | #define THOR_EMISSIONINTERFACE_HPP 31 | 32 | #include 33 | 34 | 35 | namespace thor 36 | { 37 | 38 | class Particle; 39 | 40 | 41 | /// @addtogroup Particles 42 | /// @{ 43 | 44 | /// @brief Class that connects emitters with their corresponding particle system. 45 | /// @details This class acts as an interface from emitters to particle systems. A single method to emit particles is provided. 46 | class THOR_API EmissionInterface 47 | { 48 | // --------------------------------------------------------------------------------------------------------------------------- 49 | // Public member functions 50 | public: 51 | /// @brief Virtual destructor 52 | /// 53 | virtual ~EmissionInterface() {} 54 | 55 | /// @brief Emits a particle into the particle system. 56 | /// @param particle Particle to emit. 57 | virtual void emitParticle(const Particle& particle) = 0; 58 | }; 59 | 60 | /// @} 61 | 62 | } // namespace thor 63 | 64 | #endif // THOR_EMISSIONINTERFACE_HPP 65 | -------------------------------------------------------------------------------- /SpriteAnimator/third-party/thor/include/Thor/Resources.hpp: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Thor C++ Library 4 | // Copyright (c) 2011-2017 Jan Haller 5 | // 6 | // This software is provided 'as-is', without any express or implied 7 | // warranty. In no event will the authors be held liable for any damages 8 | // arising from the use of this software. 9 | // 10 | // Permission is granted to anyone to use this software for any purpose, 11 | // including commercial applications, and to alter it and redistribute it 12 | // freely, subject to the following restrictions: 13 | // 14 | // 1. The origin of this software must not be misrepresented; you must not 15 | // claim that you wrote the original software. If you use this software 16 | // in a product, an acknowledgment in the product documentation would be 17 | // appreciated but is not required. 18 | // 19 | // 2. Altered source versions must be plainly marked as such, and must not be 20 | // misrepresented as being the original software. 21 | // 22 | // 3. This notice may not be removed or altered from any source distribution. 23 | // 24 | ///////////////////////////////////////////////////////////////////////////////// 25 | 26 | /// @file 27 | /// @brief Complete header for the Resources module 28 | 29 | #ifndef THOR_MODULE_RESOURCES_HPP 30 | #define THOR_MODULE_RESOURCES_HPP 31 | 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | 39 | #endif // THOR_MODULE_RESOURCES_HPP 40 | -------------------------------------------------------------------------------- /SpriteAnimator/third-party/thor/include/Thor/Resources/Detail/ResourceLoaderHelpers.hpp: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Thor C++ Library 4 | // Copyright (c) 2011-2017 Jan Haller 5 | // 6 | // This software is provided 'as-is', without any express or implied 7 | // warranty. In no event will the authors be held liable for any damages 8 | // arising from the use of this software. 9 | // 10 | // Permission is granted to anyone to use this software for any purpose, 11 | // including commercial applications, and to alter it and redistribute it 12 | // freely, subject to the following restrictions: 13 | // 14 | // 1. The origin of this software must not be misrepresented; you must not 15 | // claim that you wrote the original software. If you use this software 16 | // in a product, an acknowledgment in the product documentation would be 17 | // appreciated but is not required. 18 | // 19 | // 2. Altered source versions must be plainly marked as such, and must not be 20 | // misrepresented as being the original software. 21 | // 22 | // 3. This notice may not be removed or altered from any source distribution. 23 | // 24 | ///////////////////////////////////////////////////////////////////////////////// 25 | 26 | #ifndef THOR_RESOURCELOADERHELPERS_HPP 27 | #define THOR_RESOURCELOADERHELPERS_HPP 28 | 29 | #include 30 | #include 31 | #include 32 | 33 | #include 34 | #include 35 | 36 | #include 37 | #include 38 | #include 39 | #include 40 | #include 41 | 42 | 43 | namespace sf 44 | { 45 | 46 | class InputStream; 47 | class Image; 48 | 49 | } // namespace sf 50 | 51 | 52 | namespace thor 53 | { 54 | namespace detail 55 | { 56 | 57 | // Helper class to build unique string tags from several properties 58 | struct Tagger 59 | { 60 | Tagger(const char* text = "") 61 | : stream() 62 | , begin(true) 63 | { 64 | if (std::strlen(text) != 0) 65 | stream << "[From" << text << "] "; 66 | } 67 | 68 | // Enable If to exclude sf::InputStream derivates 69 | template 70 | Tagger& operator<< (const T& value) 71 | { 72 | // Insert separator before every value except the first 73 | if (!begin) 74 | stream << "; "; 75 | begin = false; 76 | 77 | // Push actual value 78 | stream << value; 79 | return *this; 80 | } 81 | 82 | Tagger& operator<< (const sf::Color& color) 83 | { 84 | return operator<< (toString(color)); 85 | } 86 | 87 | Tagger& operator<< (const sf::IntRect& rect) 88 | { 89 | return operator<< (toString(rect)); 90 | } 91 | 92 | operator std::string() const 93 | { 94 | // Remove last separator 95 | std::string s = stream.str(); 96 | if (!s.empty() && s.rfind("; ") == s.size() - 2) 97 | s.erase(s.size() - 2); 98 | return s; 99 | } 100 | 101 | std::ostringstream stream; 102 | bool begin; 103 | }; 104 | 105 | // Creates a resource loader by transforming the function 106 | // bool boolLoader(R&) 107 | // to: std::unique_ptr loader() 108 | template 109 | ResourceLoader makeResourceLoader(Fn boolLoader, std::string key) 110 | { 111 | auto loader = [=] () -> std::unique_ptr 112 | { 113 | std::unique_ptr resource(new R()); 114 | if (boolLoader(*resource)) 115 | return resource; 116 | else 117 | return nullptr; 118 | }; 119 | 120 | return ResourceLoader(loader, key); 121 | } 122 | 123 | } // namespace detail 124 | } // namespace thor 125 | 126 | #endif // THOR_RESOURCELOADERHELPERS_HPP 127 | -------------------------------------------------------------------------------- /SpriteAnimator/third-party/thor/include/Thor/Resources/KnownIdStrategy.hpp: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Thor C++ Library 4 | // Copyright (c) 2011-2017 Jan Haller 5 | // 6 | // This software is provided 'as-is', without any express or implied 7 | // warranty. In no event will the authors be held liable for any damages 8 | // arising from the use of this software. 9 | // 10 | // Permission is granted to anyone to use this software for any purpose, 11 | // including commercial applications, and to alter it and redistribute it 12 | // freely, subject to the following restrictions: 13 | // 14 | // 1. The origin of this software must not be misrepresented; you must not 15 | // claim that you wrote the original software. If you use this software 16 | // in a product, an acknowledgment in the product documentation would be 17 | // appreciated but is not required. 18 | // 19 | // 2. Altered source versions must be plainly marked as such, and must not be 20 | // misrepresented as being the original software. 21 | // 22 | // 3. This notice may not be removed or altered from any source distribution. 23 | // 24 | ///////////////////////////////////////////////////////////////////////////////// 25 | 26 | /// @file 27 | /// @brief Enum KnownIdStrategy, used by thor::ResourceHolder 28 | 29 | #ifndef THOR_KNOWNIDSTRATEGY_HPP 30 | #define THOR_KNOWNIDSTRATEGY_HPP 31 | 32 | 33 | namespace thor 34 | { 35 | 36 | /// @addtogroup Resources 37 | /// @{ 38 | 39 | namespace Resources 40 | { 41 | 42 | /// @brief Strategy to deal with already known resource IDs 43 | /// @details Determines what happens if the user calls ResourceHolder::acquire() with an ID that is already 44 | /// associated with a different resource. 45 | enum KnownIdStrategy 46 | { 47 | AssumeNew, ///< Loads a new resource if the ID is unknown. Otherwise, a ResourceAccessException is thrown. 48 | Reuse, ///< Loads a new resource if the ID is unknown. Otherwise, the resource associated with the ID is reused. 49 | Reload, ///< Always loads a new resource. If the ID is already known, the corresponding resource is released. 50 | }; 51 | 52 | } // namespace Resources 53 | 54 | /// @} 55 | 56 | } // namespace thor 57 | 58 | #endif // THOR_KNOWNIDSTRATEGY_HPP 59 | -------------------------------------------------------------------------------- /SpriteAnimator/third-party/thor/include/Thor/Resources/ResourceExceptions.hpp: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Thor C++ Library 4 | // Copyright (c) 2011-2017 Jan Haller 5 | // 6 | // This software is provided 'as-is', without any express or implied 7 | // warranty. In no event will the authors be held liable for any damages 8 | // arising from the use of this software. 9 | // 10 | // Permission is granted to anyone to use this software for any purpose, 11 | // including commercial applications, and to alter it and redistribute it 12 | // freely, subject to the following restrictions: 13 | // 14 | // 1. The origin of this software must not be misrepresented; you must not 15 | // claim that you wrote the original software. If you use this software 16 | // in a product, an acknowledgment in the product documentation would be 17 | // appreciated but is not required. 18 | // 19 | // 2. Altered source versions must be plainly marked as such, and must not be 20 | // misrepresented as being the original software. 21 | // 22 | // 3. This notice may not be removed or altered from any source distribution. 23 | // 24 | ///////////////////////////////////////////////////////////////////////////////// 25 | 26 | /// @file 27 | /// @brief Classes thor::ResourceLoadingException, thor::ResourceAccessException 28 | 29 | #ifndef THOR_RESOURCEEXCEPTIONS_HPP 30 | #define THOR_RESOURCEEXCEPTIONS_HPP 31 | 32 | #include 33 | 34 | 35 | namespace thor 36 | { 37 | 38 | /// @addtogroup Resources 39 | /// @{ 40 | 41 | /// @brief %Exception class for failed resource allocation. 42 | /// @details Is thrown when an error occurs while loading a resource. 43 | class ResourceLoadingException : public aurora::Exception 44 | { 45 | // --------------------------------------------------------------------------------------------------------------------------- 46 | // Public member functions 47 | public: 48 | /// @brief Constructor 49 | /// @param message The exception message (how the error occurred). 50 | explicit ResourceLoadingException(const std::string& message) 51 | : aurora::Exception(message) 52 | { 53 | } 54 | }; 55 | 56 | /// @brief %Exception class for invalid resource access. 57 | /// @details Is thrown when the user tries to access an invalid resource. Usually, this means that a requested resource has been 58 | /// already released or not yet loaded. 59 | class ResourceAccessException : public aurora::Exception 60 | { 61 | // --------------------------------------------------------------------------------------------------------------------------- 62 | // Public member functions 63 | public: 64 | /// @brief Constructor 65 | /// @param message The exception message (how the error occurred). 66 | explicit ResourceAccessException(const std::string& message) 67 | : aurora::Exception(message) 68 | { 69 | } 70 | }; 71 | 72 | /// @} 73 | 74 | } // namespace thor 75 | 76 | #endif // THOR_RESOURCEEXCEPTIONS_HPP 77 | -------------------------------------------------------------------------------- /SpriteAnimator/third-party/thor/include/Thor/Resources/ResourceLoader.hpp: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Thor C++ Library 4 | // Copyright (c) 2011-2017 Jan Haller 5 | // 6 | // This software is provided 'as-is', without any express or implied 7 | // warranty. In no event will the authors be held liable for any damages 8 | // arising from the use of this software. 9 | // 10 | // Permission is granted to anyone to use this software for any purpose, 11 | // including commercial applications, and to alter it and redistribute it 12 | // freely, subject to the following restrictions: 13 | // 14 | // 1. The origin of this software must not be misrepresented; you must not 15 | // claim that you wrote the original software. If you use this software 16 | // in a product, an acknowledgment in the product documentation would be 17 | // appreciated but is not required. 18 | // 19 | // 2. Altered source versions must be plainly marked as such, and must not be 20 | // misrepresented as being the original software. 21 | // 22 | // 3. This notice may not be removed or altered from any source distribution. 23 | // 24 | ///////////////////////////////////////////////////////////////////////////////// 25 | 26 | /// @file 27 | /// @brief Class template thor::ResourceLoader 28 | 29 | #ifndef THOR_RESOURCELOADER_HPP 30 | #define THOR_RESOURCELOADER_HPP 31 | 32 | #include 33 | 34 | #include 35 | #include 36 | #include 37 | 38 | 39 | namespace thor 40 | { 41 | 42 | /// @addtogroup Resources 43 | /// @{ 44 | 45 | /// @brief Class storing loading information for resources 46 | /// 47 | template 48 | class ResourceLoader 49 | { 50 | // --------------------------------------------------------------------------------------------------------------------------- 51 | // Public types 52 | public: 53 | /// @brief Function type to load a resource. 54 | /// 55 | typedef std::function< std::unique_ptr() > Loader; 56 | 57 | 58 | // --------------------------------------------------------------------------------------------------------------------------- 59 | // Public member functions 60 | public: 61 | /// @brief Constructor 62 | /// @param loader Function returning a unique_ptr. Shall return a unique pointer to the resource if it has been loaded, 63 | /// and nullptr in case of loading failure. The function shall not throw any exceptions. 64 | /// @param id Identifier which is equal to another identifier if and only if the key refers to the same resource. Can also 65 | /// contain debug information in case of loading failures. 66 | ResourceLoader(std::function< std::unique_ptr() > loader, std::string id) 67 | : mLoader(std::move(loader)) 68 | , mId(std::move(id)) 69 | { 70 | } 71 | 72 | /// @brief Loads a resource. 73 | /// @return Unique pointer to resource if loaded, nullptr in case of loading failure. 74 | std::unique_ptr load() const 75 | { 76 | return mLoader(); 77 | } 78 | 79 | /// @brief Returns a string describing the resource loader. 80 | /// 81 | std::string getInfo() const 82 | { 83 | return mId; 84 | } 85 | 86 | 87 | // --------------------------------------------------------------------------------------------------------------------------- 88 | // Private variables 89 | private: 90 | Loader mLoader; 91 | std::string mId; 92 | }; 93 | 94 | /// @} 95 | 96 | } // namespace thor 97 | 98 | #endif // THOR_RESOURCELOADER_HPP 99 | -------------------------------------------------------------------------------- /SpriteAnimator/third-party/thor/include/Thor/Shapes.hpp: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Thor C++ Library 4 | // Copyright (c) 2011-2017 Jan Haller 5 | // 6 | // This software is provided 'as-is', without any express or implied 7 | // warranty. In no event will the authors be held liable for any damages 8 | // arising from the use of this software. 9 | // 10 | // Permission is granted to anyone to use this software for any purpose, 11 | // including commercial applications, and to alter it and redistribute it 12 | // freely, subject to the following restrictions: 13 | // 14 | // 1. The origin of this software must not be misrepresented; you must not 15 | // claim that you wrote the original software. If you use this software 16 | // in a product, an acknowledgment in the product documentation would be 17 | // appreciated but is not required. 18 | // 19 | // 2. Altered source versions must be plainly marked as such, and must not be 20 | // misrepresented as being the original software. 21 | // 22 | // 3. This notice may not be removed or altered from any source distribution. 23 | // 24 | ///////////////////////////////////////////////////////////////////////////////// 25 | 26 | /// @file 27 | /// @brief Complete header for the Shapes module 28 | 29 | #ifndef THOR_MODULE_SHAPES_HPP 30 | #define THOR_MODULE_SHAPES_HPP 31 | 32 | #include 33 | #include 34 | #include 35 | 36 | #endif // THOR_MODULE_SHAPES_HPP 37 | -------------------------------------------------------------------------------- /SpriteAnimator/third-party/thor/include/Thor/Time.hpp: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Thor C++ Library 4 | // Copyright (c) 2011-2017 Jan Haller 5 | // 6 | // This software is provided 'as-is', without any express or implied 7 | // warranty. In no event will the authors be held liable for any damages 8 | // arising from the use of this software. 9 | // 10 | // Permission is granted to anyone to use this software for any purpose, 11 | // including commercial applications, and to alter it and redistribute it 12 | // freely, subject to the following restrictions: 13 | // 14 | // 1. The origin of this software must not be misrepresented; you must not 15 | // claim that you wrote the original software. If you use this software 16 | // in a product, an acknowledgment in the product documentation would be 17 | // appreciated but is not required. 18 | // 19 | // 2. Altered source versions must be plainly marked as such, and must not be 20 | // misrepresented as being the original software. 21 | // 22 | // 3. This notice may not be removed or altered from any source distribution. 23 | // 24 | ///////////////////////////////////////////////////////////////////////////////// 25 | 26 | /// @file 27 | /// @brief Complete header for the Time module 28 | 29 | #ifndef THOR_MODULE_TIME_HPP 30 | #define THOR_MODULE_TIME_HPP 31 | 32 | #include 33 | #include 34 | #include 35 | 36 | #endif // THOR_MODULE_TIME_HPP 37 | -------------------------------------------------------------------------------- /SpriteAnimator/third-party/thor/include/Thor/Time/StopWatch.hpp: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Thor C++ Library 4 | // Copyright (c) 2011-2017 Jan Haller 5 | // 6 | // This software is provided 'as-is', without any express or implied 7 | // warranty. In no event will the authors be held liable for any damages 8 | // arising from the use of this software. 9 | // 10 | // Permission is granted to anyone to use this software for any purpose, 11 | // including commercial applications, and to alter it and redistribute it 12 | // freely, subject to the following restrictions: 13 | // 14 | // 1. The origin of this software must not be misrepresented; you must not 15 | // claim that you wrote the original software. If you use this software 16 | // in a product, an acknowledgment in the product documentation would be 17 | // appreciated but is not required. 18 | // 19 | // 2. Altered source versions must be plainly marked as such, and must not be 20 | // misrepresented as being the original software. 21 | // 22 | // 3. This notice may not be removed or altered from any source distribution. 23 | // 24 | ///////////////////////////////////////////////////////////////////////////////// 25 | 26 | /// @file 27 | /// @brief Class thor::StopWatch 28 | 29 | #ifndef THOR_STOPWATCH_HPP 30 | #define THOR_STOPWATCH_HPP 31 | 32 | #include 33 | 34 | #include 35 | #include 36 | 37 | 38 | namespace thor 39 | { 40 | 41 | /// @addtogroup Time 42 | /// @{ 43 | 44 | /// @brief Pausable clock class that measures elapsed time. 45 | /// @details Unlike sf::Clock, this clock can be paused and continued at any time. 46 | class THOR_API StopWatch 47 | { 48 | // --------------------------------------------------------------------------------------------------------------------------- 49 | // Public member functions 50 | public: 51 | /// @brief Constructor: Sets up a paused stopwatch with time zero. 52 | /// @details The stopwatch is initially not running. Call start() to run it. 53 | StopWatch(); 54 | 55 | /// @brief Returns the totally elapsed time. 56 | /// 57 | sf::Time getElapsedTime() const; 58 | 59 | /// @brief Checks if the stopwatch is currently running. 60 | /// 61 | bool isRunning() const; 62 | 63 | /// @brief Starts or continues the stopwatch. 64 | /// @details If it is already running, nothing happens. 65 | void start(); 66 | 67 | /// @brief Pauses the stopwatch. 68 | /// @details If it is already paused, nothing happens. 69 | void stop(); 70 | 71 | /// @brief Resets the stopwatch's elapsed time to zero and stops it. 72 | /// @details In contrast to restart(), the stopwatch is not running after the call. 73 | void reset(); 74 | 75 | /// @brief Resets the stopwatch's elapsed time to zero and starts it again. 76 | /// @details The behavior is equivalent to reset() followed by start(). 77 | void restart(); 78 | 79 | 80 | // --------------------------------------------------------------------------------------------------------------------------- 81 | // Private variables 82 | private: 83 | sf::Clock mClock; 84 | sf::Time mTimeBuffer; 85 | bool mRunning; 86 | }; 87 | 88 | /// @} 89 | 90 | } // namespace thor 91 | 92 | #endif // THOR_STOPWATCH_HPP 93 | -------------------------------------------------------------------------------- /SpriteAnimator/third-party/thor/include/Thor/Vectors.hpp: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Thor C++ Library 4 | // Copyright (c) 2011-2017 Jan Haller 5 | // 6 | // This software is provided 'as-is', without any express or implied 7 | // warranty. In no event will the authors be held liable for any damages 8 | // arising from the use of this software. 9 | // 10 | // Permission is granted to anyone to use this software for any purpose, 11 | // including commercial applications, and to alter it and redistribute it 12 | // freely, subject to the following restrictions: 13 | // 14 | // 1. The origin of this software must not be misrepresented; you must not 15 | // claim that you wrote the original software. If you use this software 16 | // in a product, an acknowledgment in the product documentation would be 17 | // appreciated but is not required. 18 | // 19 | // 2. Altered source versions must be plainly marked as such, and must not be 20 | // misrepresented as being the original software. 21 | // 22 | // 3. This notice may not be removed or altered from any source distribution. 23 | // 24 | ///////////////////////////////////////////////////////////////////////////////// 25 | 26 | /// @file 27 | /// @brief Complete header for the Vectors module 28 | 29 | #ifndef THOR_MODULE_VECTORS_HPP 30 | #define THOR_MODULE_VECTORS_HPP 31 | 32 | #include 33 | #include 34 | #include 35 | 36 | #endif // THOR_MODULE_VECTORS_HPP 37 | -------------------------------------------------------------------------------- /SpriteAnimator/third-party/thor/include/Thor/Vectors/Detail/PolarVector2.inl: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Thor C++ Library 4 | // Copyright (c) 2011-2017 Jan Haller 5 | // 6 | // This software is provided 'as-is', without any express or implied 7 | // warranty. In no event will the authors be held liable for any damages 8 | // arising from the use of this software. 9 | // 10 | // Permission is granted to anyone to use this software for any purpose, 11 | // including commercial applications, and to alter it and redistribute it 12 | // freely, subject to the following restrictions: 13 | // 14 | // 1. The origin of this software must not be misrepresented; you must not 15 | // claim that you wrote the original software. If you use this software 16 | // in a product, an acknowledgment in the product documentation would be 17 | // appreciated but is not required. 18 | // 19 | // 2. Altered source versions must be plainly marked as such, and must not be 20 | // misrepresented as being the original software. 21 | // 22 | // 3. This notice may not be removed or altered from any source distribution. 23 | // 24 | ///////////////////////////////////////////////////////////////////////////////// 25 | 26 | namespace thor 27 | { 28 | 29 | template 30 | PolarVector2::PolarVector2() 31 | : r() 32 | , phi() 33 | { 34 | } 35 | 36 | template 37 | PolarVector2::PolarVector2(T radius, T angle) 38 | : r(radius) 39 | , phi(angle) 40 | { 41 | } 42 | 43 | template 44 | PolarVector2::PolarVector2(const sf::Vector2& vector) 45 | : r(length(vector)) 46 | , phi(vector == sf::Vector2() ? 0.f : polarAngle(vector)) 47 | { 48 | } 49 | 50 | template 51 | PolarVector2::operator sf::Vector2() const 52 | { 53 | return sf::Vector2( 54 | r * TrigonometricTraits::cos(phi), 55 | r * TrigonometricTraits::sin(phi)); 56 | } 57 | 58 | template 59 | T length(const PolarVector2& vector) 60 | { 61 | return vector.r; 62 | } 63 | 64 | template 65 | T polarAngle(const PolarVector2& vector) 66 | { 67 | return vector.phi; 68 | } 69 | 70 | } // namespace thor 71 | -------------------------------------------------------------------------------- /SpriteAnimator/third-party/thor/include/Thor/Vectors/Detail/VectorAlgebra3D.inl: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Thor C++ Library 4 | // Copyright (c) 2011-2017 Jan Haller 5 | // 6 | // This software is provided 'as-is', without any express or implied 7 | // warranty. In no event will the authors be held liable for any damages 8 | // arising from the use of this software. 9 | // 10 | // Permission is granted to anyone to use this software for any purpose, 11 | // including commercial applications, and to alter it and redistribute it 12 | // freely, subject to the following restrictions: 13 | // 14 | // 1. The origin of this software must not be misrepresented; you must not 15 | // claim that you wrote the original software. If you use this software 16 | // in a product, an acknowledgment in the product documentation would be 17 | // appreciated but is not required. 18 | // 19 | // 2. Altered source versions must be plainly marked as such, and must not be 20 | // misrepresented as being the original software. 21 | // 22 | // 3. This notice may not be removed or altered from any source distribution. 23 | // 24 | ///////////////////////////////////////////////////////////////////////////////// 25 | 26 | namespace thor 27 | { 28 | 29 | template 30 | T length(const sf::Vector3& vector) 31 | { 32 | return TrigonometricTraits::sqrt(squaredLength(vector)); 33 | } 34 | 35 | template 36 | T squaredLength(const sf::Vector3& vector) 37 | { 38 | return dotProduct(vector, vector); 39 | } 40 | 41 | template 42 | sf::Vector3 unitVector(const sf::Vector3& vector) 43 | { 44 | assert(vector != sf::Vector3()); 45 | return vector / length(vector); 46 | } 47 | 48 | template 49 | T polarAngle(const sf::Vector3& vector) 50 | { 51 | assert(vector != sf::Vector3()); 52 | return TrigonometricTraits::arcTan2(vector.y, vector.x); 53 | } 54 | 55 | template 56 | T elevationAngle(const sf::Vector3& vector) 57 | { 58 | assert(vector != sf::Vector3()); 59 | 60 | T baseLength = length(sf::Vector2(vector.x, vector.y)); 61 | return TrigonometricTraits::arcTan2(vector.z, baseLength); 62 | } 63 | 64 | // --------------------------------------------------------------------------------------------------------------------------- 65 | 66 | 67 | template 68 | T dotProduct(const sf::Vector3& lhs, const sf::Vector3& rhs) 69 | { 70 | return lhs.x * rhs.x + lhs.y * rhs.y + lhs.z * rhs.z; 71 | } 72 | 73 | template 74 | sf::Vector3 crossProduct(const sf::Vector3& lhs, const sf::Vector3& rhs) 75 | { 76 | return sf::Vector3( 77 | lhs.y * rhs.z - lhs.z * rhs.y, 78 | lhs.z * rhs.x - lhs.x * rhs.z, 79 | lhs.x * rhs.y - lhs.y * rhs.x); 80 | } 81 | 82 | template 83 | sf::Vector3 cwiseProduct(const sf::Vector3& lhs, const sf::Vector3& rhs) 84 | { 85 | return sf::Vector3(lhs.x * rhs.x, lhs.y * rhs.y, lhs.z * rhs.z); 86 | } 87 | 88 | template 89 | sf::Vector3 cwiseQuotient(const sf::Vector3& lhs, const sf::Vector3& rhs) 90 | { 91 | assert(rhs.x != 0 && rhs.y != 0 && rhs.z != 0); 92 | return sf::Vector3(lhs.x / rhs.x, lhs.y / rhs.y, lhs.z / rhs.z); 93 | } 94 | 95 | // --------------------------------------------------------------------------------------------------------------------------- 96 | 97 | 98 | template 99 | sf::Vector3 toVector3(const sf::Vector2& vector2) 100 | { 101 | return sf::Vector3(vector2.x, vector2.y, T()); 102 | } 103 | 104 | } // namespace thor 105 | -------------------------------------------------------------------------------- /SpriteAnimator/third-party/thor/include/Thor/Vectors/PolarVector2.hpp: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Thor C++ Library 4 | // Copyright (c) 2011-2017 Jan Haller 5 | // 6 | // This software is provided 'as-is', without any express or implied 7 | // warranty. In no event will the authors be held liable for any damages 8 | // arising from the use of this software. 9 | // 10 | // Permission is granted to anyone to use this software for any purpose, 11 | // including commercial applications, and to alter it and redistribute it 12 | // freely, subject to the following restrictions: 13 | // 14 | // 1. The origin of this software must not be misrepresented; you must not 15 | // claim that you wrote the original software. If you use this software 16 | // in a product, an acknowledgment in the product documentation would be 17 | // appreciated but is not required. 18 | // 19 | // 2. Altered source versions must be plainly marked as such, and must not be 20 | // misrepresented as being the original software. 21 | // 22 | // 3. This notice may not be removed or altered from any source distribution. 23 | // 24 | ///////////////////////////////////////////////////////////////////////////////// 25 | 26 | /// @file 27 | /// @brief Class template thor::PolarVector2 28 | 29 | #ifndef THOR_POLARVECTOR2_HPP 30 | #define THOR_POLARVECTOR2_HPP 31 | 32 | #include 33 | #include 34 | 35 | 36 | namespace thor 37 | { 38 | 39 | /// @addtogroup Vectors 40 | /// @{ 41 | 42 | /// @brief Vector in polar coordinate system 43 | /// @details 2D vector which stores its components in polar instead of cartesian coordinates. 44 | template 45 | struct PolarVector2 46 | { 47 | T r; ///< Radius 48 | T phi; ///< Angle in degrees 49 | 50 | /// @brief Default constructor 51 | /// @details Creates a zero vector. The angle @a phi measures 0 degrees. 52 | PolarVector2(); 53 | 54 | /// @brief Constructs a polar vector with specified radius and angle. 55 | /// @param radius The radial component (length of the vector). 56 | /// @param angle The angular component in degrees. 57 | PolarVector2(T radius, T angle); 58 | 59 | /// @brief Constructs a polar vector from a cartesian SFML vector. 60 | /// @param vector Cartesian (x,y) vector being converted to polar coordinates. 61 | /// Zero vectors are allowed and result in a polar vector with r=0 and phi=0. 62 | PolarVector2(const sf::Vector2& vector); 63 | 64 | /// @brief Converts the polar vector into a cartesian SFML vector. 65 | /// @return Equivalent (x,y) vector in cartesian coordinates. 66 | operator sf::Vector2 () const; 67 | }; 68 | 69 | /// @brief Type definition for float polar vectors 70 | /// 71 | typedef PolarVector2 PolarVector2f; 72 | 73 | /// @relates PolarVector2 74 | /// @brief Returns the length of a polar vector. 75 | /// @details The returned value is @a vector.r. 76 | template 77 | T length(const PolarVector2& vector); 78 | 79 | /// @relates PolarVector2 80 | /// @brief Returns the angle of a polar vector in degrees. 81 | /// @details The returned value is @a vector.phi. 82 | template 83 | T polarAngle(const PolarVector2& vector); 84 | 85 | /// @} 86 | 87 | } // namespace thor 88 | 89 | #include 90 | #endif // THOR_POLARVECTOR2_HPP 91 | -------------------------------------------------------------------------------- /SpriteAnimator/third-party/thor/lib/thor-d.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rikora/SpriteAnimator/28ff574636438c97c58f2786e7896441e847f14b/SpriteAnimator/third-party/thor/lib/thor-d.lib --------------------------------------------------------------------------------