bugWarmux - Bugs: bug #10707, Bad Sprite constructor

 
 
Show feedback again

You are not allowed to post comments on this tracker with your current authentification level.

bug #10707: Bad Sprite constructor

Submitted by:  Yannig <drayan>
Submitted on:  Mon 07 Jan 2008 08:09:46 PM UTC  
 
Category: DisplaySeverity: 3 - Normal
Priority: 5 - NormalStatus: Fixed
Assigned to: Yannig <drayan>Open/Closed: Closed
Release: svn

Sat 12 Jan 2008 06:12:05 PM UTC, SVN revision 3881:

[bug #10707] Bad Sprite constructor. Fix sprite animation of wind particle.

(Browse SVN revision 3881)

Yannig <drayan>
Project AdministratorIn charge of this item.
Tue 08 Jan 2008 11:31:00 AM UTC, comment #1:

Hi people, so here's my clipboard of the day.

in sprite.cpp :
...
Sprite::Sprite(const Sprite &other) :
cache(*this),
animation(other.animation, *this),
frames()
{
Constructor();
current_surface = Surface(other.current_surface);
show = other.show;
current_frame = other.current_frame;
frame_width_pix = other.frame_width_pix;
frame_height_pix = other.frame_height_pix;
alpha = other.alpha;
scale_x = other.scale_x;
scale_y = other.scale_y;
rotation_rad = other.rotation_rad;
rhs_pos = other.rhs_pos;
rot_hotspot = other.rot_hotspot;
rotation_point = other.rotation_point;

for(unsigned int f=0;f<other.frames.size();f++)
AddFrame(other.frames[f].surface,other.frames[f].delay);

if(other.cache.have_lastframe_cache)
cache.EnableLastFrameCache();
if(other.cache.have_rotation_cache)
EnableRotationCache(other.cache.rotation_cache_size);
if(other.cache.have_flipping_cache)
EnableFlippingCache();
}
...

and in wind.cpp :

...
sprite = new Sprite(*tmp);
sprite->SetAlpha(scale);
sprite->SetCurrentFrame ( randomObj.GetLong(0, sprite->GetFrameCount()-1));

if(ActiveMap().GetWind().need_flip)
{
tmp->Scale(-scale, scale);
tmp->RefreshSurface();
flipped = new Sprite(*tmp);
flipped->SetAlpha(scale);
flipped->SetCurrentFrame ( randomObj.GetLong(0, sprite->GetFrameCount()-1));
}
else
flipped = NULL;
...

Have a good time !

Yannig <drayan>
Project AdministratorIn charge of this item.
Mon 07 Jan 2008 08:09:46 PM UTC, original submission:

Wind particle are not animated since we keep only the first frame.

In sprite.cpp, line 86, we use a constructor with the Surface. If we try to use a Sprite, we get an error => Error while using a sprite constructor initialized with another sprite.

Yannig <drayan>
Project AdministratorIn charge of this item.

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by gentildemon (Updated the item)
  • -unavailable- added by drayan (Submitted the item)
  •  

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Mon 14 Jan 2008 09:58:54 PM UTCgentildemonStatusReady For Test=>Fixed
      Open/ClosedOpen=>Closed
    Sat 12 Jan 2008 06:12:29 PM UTCdrayanStatusIn Progress=>Ready For Test
    Show feedback again

    Back to the top


    Powered by Savane 3.1-cleanup