~ubuntu-branches/ubuntu/natty/plee-the-bear/natty

« back to all changes in this revision

Viewing changes to bear-factory/model-editor/src/bf/code/gui_model.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 - Model editor
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
72
72
bf::action& bf::gui_model::get_active_action()
73
73
{
74
74
  CLAW_PRECOND( m_active_action != NULL );
75
 
  
 
75
 
76
76
  return *m_active_action;
77
77
} // gui_model::get_active_action()
78
78
 
88
88
} // gui_model::get_active_action()
89
89
 
90
90
/*----------------------------------------------------------------------------*/
91
 
/** 
 
91
/**
92
92
 * \brief Reset the active action.
93
93
 */
94
94
void bf::gui_model::reset_active_action()
155
155
{
156
156
  CLAW_PRECOND( has_active_action() );
157
157
  CLAW_PRECOND( get_active_action().has_mark_label(label) );
158
 
  
 
158
 
159
159
  m_selection[m_active_action].insert
160
160
    ( get_active_action().get_mark(label), is_main_selection );
161
161
} // gui_model::add_to_mark_selection()
197
197
{
198
198
  bool result = false;
199
199
 
200
 
  if ( m_active_action != NULL ) 
201
 
    result = ( m_active_action->has_snapshot_date(m_date) ); 
202
 
      
 
200
  if ( m_active_action != NULL )
 
201
    result = ( m_active_action->has_snapshot_date(m_date) );
 
202
 
203
203
  return result;
204
204
} // gui_model::has_selected_snapshot()
205
205
 
210
210
bf::snapshot* bf::gui_model::get_selected_snapshot()
211
211
{
212
212
  snapshot* result = NULL;
213
 
  
214
 
  if ( m_active_action != NULL ) 
215
 
    if ( m_active_action->has_snapshot_date(m_date) ) 
216
 
      result = m_active_action->get_snapshot(m_date);
 
213
 
 
214
  if ( m_active_action != NULL )
 
215
    if ( m_active_action->has_snapshot_date(m_date) )
 
216
      result = m_active_action->get_snapshot_before_or_at_date(m_date);
217
217
 
218
218
  return result;
219
219
} // gui_model::get_selected_snapshot()
231
231
 
232
232
  if ( mk != NULL )
233
233
    if ( mk->has_animation() )
234
 
      if ( !mk->get_animation().empty() )
 
234
      if ( !mk->get_animation_data().empty() )
235
235
        {
236
 
          result = mk->get_animation().get_frame(0).get_sprite();
 
236
          result = mk->get_animation_data().get_frame(0).get_sprite();
237
237
 
238
238
          if ( mk->apply_angle_to_animation() )
239
239
            result.set_angle( result.get_angle() + m.get_angle() );
276
276
  CLAW_PRECOND( has_action( action_name ) );
277
277
 
278
278
  action* result = model::remove_action( action_name );
279
 
  
280
 
  if ( m_active_action == result ) 
 
279
 
 
280
  if ( m_active_action == result )
281
281
    reset_active_action();
282
282
 
283
283
  m_selection.erase(result);
310
310
void bf::gui_model::add_snapshot(const std::string& action_name, snapshot* m)
311
311
{
312
312
  CLAW_PRECOND( has_action( action_name ) );
313
 
  CLAW_PRECOND( ! get_action( action_name ).has_snapshot(m) );
 
313
  CLAW_PRECOND( !get_action( action_name ).has_snapshot(m) );
314
314
 
315
315
  get_action(action_name).add_snapshot(m);
316
316
} // gui_model::add_snapshot()