projects
/
supertux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
81969b2
)
We could been losting frames. Fixed.
author
Ricardo Cruz
<rick2@aeiou.pt>
Sat, 14 Aug 2004 18:45:25 +0000
(18:45 +0000)
committer
Ricardo Cruz
<rick2@aeiou.pt>
Sat, 14 Aug 2004 18:45:25 +0000
(18:45 +0000)
SVN-Revision: 1778
lib/special/sprite.cpp
patch
|
blob
|
history
diff --git
a/lib/special/sprite.cpp
b/lib/special/sprite.cpp
index
f676c08
..
f37e5ee
100644
(file)
--- a/
lib/special/sprite.cpp
+++ b/
lib/special/sprite.cpp
@@
-141,31
+141,39
@@
Sprite::update()
if(animation_loops == 0)
return;
if(animation_loops == 0)
return;
-float
inc_frame = (action->fps/100
0) * (SDL_GetTicks() - last_tick);
+float
frame_inc = (action->fps/1000.
0) * (SDL_GetTicks() - last_tick);
if(animation_reversed)
if(animation_reversed)
- frame -=
inc_frame
;
+ frame -=
frame_inc
;
else
else
- frame +=
inc_frame
;
+ frame +=
frame_inc
;
last_tick = SDL_GetTicks();
if(animation_reversed)
{
last_tick = SDL_GetTicks();
if(animation_reversed)
{
- if((unsigned int)frame < 0)
+ float expedient = frame - 0;
+ if(expedient < 0)
{
frame = get_frames()-1;
if(animation_loops > 0)
animation_loops--;
{
frame = get_frames()-1;
if(animation_loops > 0)
animation_loops--;
+
+ if(expedient > -get_frames())
+ frame -= expedient;
}
}
else
{
}
}
else
{
- if((unsigned int)frame >= action->surfaces.size())
+ float expedient = frame - action->surfaces.size();
+ if(expedient >= 0)
{
frame = 0;
if(animation_loops > 0)
animation_loops--;
{
frame = 0;
if(animation_loops > 0)
animation_loops--;
+
+ if(expedient < get_frames())
+ frame += expedient;
}
}
}
}
}
}