diff --git a/README b/README index f1fc65f..f1d010c 100644 --- a/README +++ b/README @@ -1,8 +1,10 @@ ++~~~~~~~~~~~~~~~~~~~~~~~++ +++~~~~~~~~~~~~~~~~~~~~~~~++ :: :: :: SFW (SDL Framework) :: :: :: ++~~~~~~~~~~~~~~~~~~~~~~~++ +++~~~~~~~~~~~~~~~~~~~~~~~++ SFW is a C++ framework that facilitates the creation of SDL projects. It provides generic game objects that can be used, extended or overwritten. Games @@ -88,24 +90,25 @@ License The original code for this framework is licensed to freely use, copy, modify and sell, without restriction under the zlib license. See LICENSE.txt for details. -BPmono.ttf is licensed under the Creative Commons Attribution - No Derivative -Works 3.0 license. See LICENSE_BPmono.txt for details. +Included libraries are included under various permissive licenses: -gif-h is unlicensed, public domain code released under the The Unlicense. See -lib/gif-h/LICENSE +- BPmono.ttf is licensed under the Creative Commons Attribution - No Derivative + Works 3.0 license. See LICENSE_BPmono.txt for details. -GLEW is included under a permissive license in lib/glew/LICENSE.txt +- gif-h is unlicensed, public domain code released under the The Unlicense. See + lib/gif-h/LICENSE -GLM is included under the MIT license in lib/glm/LICENSE +- GLEW is included under a permissive license in lib/glew/LICENSE.txt -nlohmann's json library is included under the MIT license in -lib/json/LICENSE.MIT +- GLM is included under the MIT license in lib/glm/LICENSE -SDL2 GFX is included under a permissive license in lib/sdl2-gfx/LICENSE +- nlohmann's json library is included under the MIT license in + lib/json/LICENSE.MIT -superxbr.cpp is included under a permissive license at the top of -lib/superxbr.cpp +- SDL2 GFX is included under a permissive license in lib/sdl2-gfx/LICENSE +- superxbr.cpp is included under a permissive license at the top of + lib/superxbr.cpp Business ```````` diff --git a/demo/Demo.cpp b/demo/Demo.cpp index be4cdda..1b5230c 100644 --- a/demo/Demo.cpp +++ b/demo/Demo.cpp @@ -21,7 +21,7 @@ generate documentation from comments, get resource function, automatically update animations, add arguments list to animation call, queue multiple calls to animation, print list of chunk and music decoders available, allow nodes - that aren't connected to root + that aren't connected to root, add imagemagick to library, add curl to library :) SWEATY HANDS :) OILY SNACKS :) AND BAD HYGIENE :) diff --git a/src/Box.cpp b/src/Box.cpp index c23561e..8910ba8 100644 --- a/src/Box.cpp +++ b/src/Box.cpp @@ -57,11 +57,6 @@ glm::vec2 Box::get_size() const return glm::vec2(get_w(), get_h()); } -float Box::get_area() const -{ - return get_w() * get_h(); -} - void Box::set_size(const glm::vec2& size, bool preserve_center) { glm::vec2 center = get_center(); @@ -73,6 +68,17 @@ void Box::set_size(const glm::vec2& size, bool preserve_center) } } +/* Returns width divided by height regardless of which side is longer */ +float Box::aspect() const +{ + return get_w() / get_h(); +} + +float Box::get_area() const +{ + return get_w() * get_h(); +} + float Box::get_top() const { return get_y(); diff --git a/src/Box.hpp b/src/Box.hpp index 7cd4bae..8dc0f5f 100644 --- a/src/Box.hpp +++ b/src/Box.hpp @@ -29,6 +29,7 @@ public: void set_h(float); glm::vec2 get_size() const; void set_size(const glm::vec2&, bool = false); + float aspect() const; float get_area() const; float get_top() const; float get_right() const;