~ubuntu-branches/ubuntu/trusty/plee-the-bear/trusty-proposed

« back to all changes in this revision

Viewing changes to bear-factory/bear-editor/src/bf/any_animation.hpp

  • Committer: Bazaar Package Importer
  • Author(s): Julien Jorge, Julien Jorge
  • Date: 2010-11-17 20:13:34 UTC
  • mfrom: (6.1.1 sid)
  • Revision ID: james.westby@ubuntu.com-20101117201334-o4dp7uq437to7oxb
Tags: 0.5.1-1
[ Julien Jorge ]
* New upstream release (Closes: #565062, #546514).
* Add armhf architecture (Closes: #604689).
* Remove patches integrated upstream: rpath-editors.diff, rpath-game.diff,
  editors-menu-section.diff.
* Bump the Standard-Version, no changes.
* Update my email address.
* Set build dependency of libclaw to 1.6.0.
* Add the missing ${misc:Depends} in debian/control.
* List gettext translations in bear-factory.install and plee-the-bear.install.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
  Bear Engine - Editor library
 
3
 
 
4
  Copyright (C) 2005-2010 Julien Jorge, Sebastien Angibaud
 
5
 
 
6
  This program is free software; you can redistribute it and/or modify it
 
7
  under the terms of the GNU General Public License as published by the
 
8
  Free Software Foundation; either version 2 of the License, or (at your
 
9
  option) any later version.
 
10
 
 
11
  This program is distributed in the hope that it will be useful, but WITHOUT
 
12
  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 
13
  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
 
14
  more details.
 
15
 
 
16
  You should have received a copy of the GNU General Public License along
 
17
  with this program; if not, write to the Free Software Foundation, Inc.,
 
18
  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
19
 
 
20
  contact: plee-the-bear@gamned.org
 
21
 
 
22
  Please add the tag [Bear] in the subject of your mails.
 
23
*/
 
24
/**
 
25
 * \file bf/any_animation.hpp
 
26
 * \brief A class that contains an animation or an animation_file_type, only one
 
27
 *        at once.
 
28
 * \author Julien Jorge
 
29
 */
 
30
#ifndef __BF_ANY_ANIMATION_HPP__
 
31
#define __BF_ANY_ANIMATION_HPP__
 
32
 
 
33
#include "bf/animation_file_type.hpp"
 
34
#include "bf/libeditor_export.hpp"
 
35
 
 
36
namespace bf
 
37
{
 
38
  /**
 
39
   * \brief A class that contains an animation or an animation_file_type, only
 
40
   *        one at once.
 
41
   * \author Julien Jorge
 
42
   */
 
43
  class BEAR_EDITOR_EXPORT any_animation
 
44
  {
 
45
  public:
 
46
    /** \brief The type of the animation effectively stored. */
 
47
    enum content_type
 
48
      {
 
49
        /** \brief A completely detailed animation. */
 
50
        content_animation,
 
51
 
 
52
        /** \brief An animation file.*/
 
53
        content_file
 
54
 
 
55
      }; // enum content_type
 
56
 
 
57
  public:
 
58
    static std::string content_to_string( content_type c );
 
59
    static content_type string_to_content( const std::string& c );
 
60
 
 
61
    any_animation( content_type c = content_animation );
 
62
 
 
63
    void set_animation_file( const animation_file_type& a );
 
64
    void set_animation( const animation& a );
 
65
 
 
66
    const animation_file_type& get_animation_file() const;
 
67
    const animation& get_animation() const;
 
68
 
 
69
    animation get_current_animation() const;
 
70
 
 
71
    void switch_to( content_type c );
 
72
    content_type get_content_type() const;
 
73
 
 
74
    void compile( compiled_file& f ) const;
 
75
 
 
76
    bool operator==( const any_animation& that ) const;
 
77
    bool operator!=( const any_animation& that ) const;
 
78
    bool operator<( const any_animation& that ) const;
 
79
 
 
80
  private:
 
81
    /** \brief The type of the animation on which we are working. */
 
82
    content_type m_content_type;
 
83
 
 
84
    /** \brief The path of the animation file. */
 
85
    animation_file_type m_animation_file;
 
86
 
 
87
    /** \brief The animation returned by original_animation(). */
 
88
    animation m_animation;
 
89
 
 
90
  }; // class any_animation
 
91
} // namespace bf
 
92
 
 
93
#endif // __BF_ANY_ANIMATION_HPP__