Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Thor 2.0 released!  (Read 379842 times)

0 Members and 6 Guests are viewing this topic.

mateandmetal

  • Full Member
  • ***
  • Posts: 171
  • The bird is the word
    • View Profile
    • my blog
Re: Thor 2.0
« Reply #90 on: May 25, 2012, 02:43:40 pm »
Hi... I'm getting some errors trying to compile Thor with CMake-gui and MinGW

It can´t find SFML. I specified the path manually and works.

It compiles the entire library, but in the animation example:

e:/Programacion/Thor2.0/include/Thor/Animation/Detail/Animation.inl: 52:2
need ´typename´before ´thor::Animator<Animated, Id>::AnimationMap::iterator´ because ´thor::Animator<Animated, Id>::AnimationMap´is a dependent scope

52:25 expected ´;´ before ´itr´
55:16 ´itr´was not declared in this scope
...

using latest SFML2 and Thor2 snapshots dowloaded today from github

and, a weird thing...  the libthor.dll and libthor.dll.a files are created in the Thor2.0/src directory.. shouldnt be in a /lib dir?


(sorry for the bad english)  :o
- Mate (beverage) addict
- Heavy metal addict _lml
- SFML 2 addict
- My first (and free) game: BichingISH!

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Re: Thor 2.0
« Reply #91 on: May 25, 2012, 08:24:20 pm »
Thanks. I hate it, VS 2011 Beta still doesn't recognize these typename errors. Unfortunately, I cannot compile with g++ at the moment, so I hope it works now...

Concerning the "lib" folder, you have to install Thor (make install).
« Last Edit: May 25, 2012, 08:56:06 pm by Nexus »
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

mateandmetal

  • Full Member
  • ***
  • Posts: 171
  • The bird is the word
    • View Profile
    • my blog
Re: Thor 2.0
« Reply #92 on: May 26, 2012, 07:52:17 am »
Concerning the "lib" folder, you have to install Thor (make install).

Thanks!
- Mate (beverage) addict
- Heavy metal addict _lml
- SFML 2 addict
- My first (and free) game: BichingISH!

mguerriero

  • Newbie
  • *
  • Posts: 7
    • View Profile
    • Email
Re: Thor 2.0
« Reply #93 on: June 09, 2012, 07:31:49 pm »
Hi Nexus, this is my first post here and I'd like to know a thing about Thor and SFML.

I installed SFML 2.0 and the latest Thor from git. The installation of the two libs went well but when I try to compile some files using Thor I get the following errors
In file included from /usr/local/include/Thor/Animation.hpp:32:0,
                 from /home/mario/revenge/revenge-test/src/Character.cpp:1:
/usr/local/include/Thor/Animation/Animator.hpp:59:11: error: ‘function’ in namespace ‘std’ does not name a type
/usr/local/include/Thor/Animation/Animator.hpp:73:46: error: ‘AnimationFunction’ does not name a type
/usr/local/include/Thor/Animation/Animator.hpp:99:39: error: ‘AnimationFunction’ does not name a type
/usr/local/include/Thor/Animation/Animator.hpp:105:21: error: ‘AnimationFunction’ was not declared in this scope
/usr/local/include/Thor/Animation/Animator.hpp:105:48: error: template argument 1 is invalid
In file included from /usr/local/include/Thor/Animation/Animator.hpp:129:0,
                 from /usr/local/include/Thor/Animation.hpp:32,
                 from /home/mario/revenge/revenge-test/src/Character.cpp:1:
/usr/local/include/Thor/Animation/Detail/Animator.inl: In constructor ‘thor::Animator<Animated, Id>::Animator()’:
/usr/local/include/Thor/Animation/Detail/Animator.inl:35:21: error: ‘nullptr’ was not declared in this scope
/usr/local/include/Thor/Animation/Detail/Animator.inl: At global scope:
/usr/local/include/Thor/Animation/Detail/Animator.inl:43:63: error: ‘AnimationFunction’ does not name a type
/usr/local/include/Thor/Animation/Detail/Animator.inl: In member function ‘void thor::Animator<Animated, Id>::stopAnimation()’:
/usr/local/include/Thor/Animation/Detail/Animator.inl:62:24: error: request for member ‘first’ in ‘((thor::Animator<Animated, Id>*)this)->thor::Animator<Animated, Id>::mDefaultAnimation’, which is of non-class type ‘thor::Animator<Animated, Id>::ScaledAnimation {aka int}’
/usr/local/include/Thor/Animation/Detail/Animator.inl:65:23: error: ‘nullptr’ was not declared in this scope
/usr/local/include/Thor/Animation/Detail/Animator.inl: In member function ‘void thor::Animator<Animated, Id>::update(sf::Time)’:
/usr/local/include/Thor/Animation/Detail/Animator.inl:76:51: error: request for member ‘second’ in ‘((thor::Animator<Animated, Id>*)this)->thor::Animator<Animated, Id>::mPlayingAnimation->’, which is of non-class type ‘const ScaledAnimation {aka const int}’
/usr/local/include/Thor/Animation/Detail/Animator.inl: In member function ‘void thor::Animator<Animated, Id>::animate(Animated&) const’:
/usr/local/include/Thor/Animation/Detail/Animator.inl:93:22: error: request for member ‘first’ in ‘((const thor::Animator<Animated, Id>*)this)->thor::Animator<Animated, Id>::mPlayingAnimation->’, which is of non-class type ‘const ScaledAnimation {aka const int}’
/usr/local/include/Thor/Animation/Detail/Animator.inl: At global scope:
/usr/local/include/Thor/Animation/Detail/Animator.inl:105:56: error: ‘AnimationFunction’ does not name a type
/usr/local/include/Thor/Animation/Detail/Animator.inl: In member function ‘void thor::Animator<Animated, Id>::setDefaultAnimation(const int&, sf::Time)’:
/usr/local/include/Thor/Animation/Detail/Animator.inl:109:23: error: ‘nullptr’ was not declared in this scope
/usr/local/include/Thor/Animation/Detail/Animator.inl:112:20: error: request for member ‘first’ in ‘((thor::Animator<Animated, Id>*)this)->thor::Animator<Animated, Id>::mDefaultAnimation’, which is of non-class type ‘thor::Animator<Animated, Id>::ScaledAnimation {aka int}’
/usr/local/include/Thor/Animation/Detail/Animator.inl:113:20: error: request for member ‘second’ in ‘((thor::Animator<Animated, Id>*)this)->thor::Animator<Animated, Id>::mDefaultAnimation’, which is of non-class type ‘thor::Animator<Animated, Id>::ScaledAnimation {aka int}’
I am on Ubuntu 12.04 and I use gcc 4.6.3 to compile. Can you help me solve this problem?

MorleyDev

  • Full Member
  • ***
  • Posts: 219
  • "It is not enough for code to work."
    • View Profile
    • http://www.morleydev.co.uk/
Re: Thor 2.0
« Reply #94 on: June 09, 2012, 07:53:39 pm »
You need to compile with the flag -std=c++0x to enable the new C++11 features Thor uses, such as nullptr.
UnitTest11 - A unit testing library in C++ written to take advantage of C++11.

All code is guilty until proven innocent, unworthy until tested, and pointless without singular and well-defined purpose.

mguerriero

  • Newbie
  • *
  • Posts: 7
    • View Profile
    • Email
Re: Thor 2.0
« Reply #95 on: June 10, 2012, 08:54:14 am »
ok thanks, I forgot to add C++11 flag

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Re: Thor 2.0
« Reply #96 on: June 10, 2012, 11:32:08 am »
I implemented a modifiaction already requested some time ago: To make triangulations work with arbitrary vertex types. While I originally thought it would require to transform all functions of the algorithm to templates, I later found a way to avoid this. Type erasure is really an uncomparable abstraction mechanism, I use it quite a lot meanwhile.

Concerning the API, this means that there is no more thor::Vertex class, thus you don't have to derive from it for your own vertices. When you have a custom vertex, all you have to do is to specialize the thor::TriangulationTraits template to say Thor how it knows the position of the vertex:
class MyVertex { ... };

namespace thor
{
    template <>
    struct TriangulationTraits<MyVertex>
    {
        static sf::Vector2f getPosition(const MyVertex& vertex);
    }
};

There are still some optimizations possible, and maybe I find a way to reduce the template bloat a little bit.
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

Tank

  • SFML Team
  • Hero Member
  • *****
  • Posts: 1486
    • View Profile
    • Blog
    • Email
Re: Thor 2.0
« Reply #97 on: June 10, 2012, 05:07:34 pm »
To be honest I've never used a single line of code of Thor, but I'm always having a great time reading your code design and especially the refactorings. Keep it up, very interesting (and I think also useful for those using it ;)).

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Re: Thor 2.0
« Reply #98 on: June 10, 2012, 05:57:36 pm »
Thank you! Good to know that there are interested readers :)
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

DJuego

  • Jr. Member
  • **
  • Posts: 50
    • View Profile
Re: Thor 2.0
« Reply #99 on: June 10, 2012, 06:07:57 pm »
He/She is not the only one.  :-X

DJuego


eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11030
    • View Profile
    • development blog
    • Email
Re: Thor 2.0
« Reply #100 on: June 11, 2012, 12:19:29 am »
He/She is not the only one.  :-X

Tank is defently male. xD


Not sure if you've already see those warnings and they aren't a problem or something, but I'll post them anyways.

VS 2010 @ Debug & Release
2>  ConcaveShape.cpp
2>D:\Programming\Libraries\Thor\src\ConcaveShape.cpp(137): warning C4267: 'return': Konvertierung von 'size_t' nach 'unsigned int', Datenverlust möglich
2>  InputNames.cpp
2>  Shapes.cpp
2>  Triangulation.cpp
2>D:\Programming\Libraries\Thor\src\Triangulation.cpp(188): warning C4267: 'Initialisierung': Konvertierung von 'size_t' nach 'unsigned int', Datenverlust möglich
2>D:\Programming\Libraries\Thor\src\Triangulation.cpp(194): warning C4267: 'Initialisierung': Konvertierung von 'size_t' nach 'unsigned int', Datenverlust möglich
« Last Edit: June 11, 2012, 12:23:05 am by eXpl0it3r »
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

mguerriero

  • Newbie
  • *
  • Posts: 7
    • View Profile
    • Email
Re: Thor 2.0
« Reply #101 on: June 11, 2012, 10:27:01 pm »
Nexus can you implement the function isAnimating() in Animator? It should return bool and should be used to know if there is an animation in progress or not

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Re: Thor 2.0
« Reply #102 on: June 12, 2012, 05:57:34 pm »
expl0it3r, I haven't seen them, thanks. I don't like std::size_t because although it is intended to be the size type, it is difficult to use it consistently (see here). I want to have a uniform API -- that is, no coexistence of unsigned int, unsigned long, std::size_t (unless it should be consistent with SFML, such as in sf::Image::loadFromMemory()). Because it misleads users when different types are used for the same/extremely similar use case.

mguerriero, that's a good idea, thank you.
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11030
    • View Profile
    • development blog
    • Email
Re: Thor 2.0
« Reply #103 on: June 13, 2012, 12:28:29 am »
I fully agree. To be honest I didn't even look at the source code, just thought maybe you have overlooked them.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Re: Thor 2.0
« Reply #104 on: June 16, 2012, 08:19:25 pm »
Some days ago, I improved the implementation of the type-erasure vertex approach. Nothing changes for the user, however I have drastically reduced the per-vertex overhead (virtual function calls, dynamic allocations, amount of template instantiations).

Furthermore, I added Animator::isPlayingAnimation() to check if an animation is being played. I eliminated some compiler warnings, but with VS and warning level 4, there is this annoying "assignment operator couldn't be generated". I'll probably deactivate it throughout the whole project (and maybe leave a macro for the people who still need this warning).
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

 

anything