~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/code/animation.cpp

  • 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
1
/*
2
2
    Bear Engine - Editor library
3
3
 
4
 
    Copyright (C) 2005-2009 Julien Jorge, Sebastien Angibaud
 
4
    Copyright (C) 2005-2010 Julien Jorge, Sebastien Angibaud
5
5
 
6
6
    This program is free software; you can redistribute it and/or modify it
7
7
    under the terms of the GNU General Public License as published by the
28
28
 */
29
29
#include "bf/animation.hpp"
30
30
 
 
31
#include "bf/compiled_file.hpp"
 
32
#include "bf/version.hpp"
 
33
 
31
34
#include <claw/assert.hpp>
32
35
 
33
36
/*----------------------------------------------------------------------------*/
251
254
 
252
255
/*----------------------------------------------------------------------------*/
253
256
/**
 
257
 * \brief Get a sprite given its index. The sprite has the attributes of the
 
258
 *        frame combined with those of the animation.
 
259
 * \param index The index of the sprite to get.
 
260
 */
 
261
bf::sprite bf::animation::get_sprite(unsigned int index) const
 
262
{
 
263
  CLAW_PRECOND(index < size() );
 
264
 
 
265
  sprite result( get_frame(index).get_sprite() );
 
266
  result.combine(*this);
 
267
  result.set_size( result.width() * width() / get_max_size().x,
 
268
                   result.height() * height() / get_max_size().y );
 
269
 
 
270
  return result;
 
271
} // animation::get_sprite()
 
272
 
 
273
/*----------------------------------------------------------------------------*/
 
274
/**
254
275
 * \brief Get the biggest size of the frames.
255
276
 */
256
277
claw::math::coordinate_2d<unsigned int> bf::animation::get_max_size() const