author | andyq <andyq> | 2003-01-21 20:37:00 (UTC) |
---|---|---|
committer | andyq <andyq> | 2003-01-21 20:37:00 (UTC) |
commit | 0a6563fcc2f49857c581d9def24407a3a4ef526c (patch) (unidiff) | |
tree | f1b82a4bd7582ef2cb722cffb87eecff1e1f96e6 /noncore/games/sfcave-sdl/animatedimage.cpp | |
parent | 50b5915b48fc5cbacf23e4d2b75d7a266f141a4a (diff) | |
download | opie-0a6563fcc2f49857c581d9def24407a3a4ef526c.zip opie-0a6563fcc2f49857c581d9def24407a3a4ef526c.tar.gz opie-0a6563fcc2f49857c581d9def24407a3a4ef526c.tar.bz2 |
Clean up of code - fixed memory leaks (most of them) and added new custom config menu
Diffstat (limited to 'noncore/games/sfcave-sdl/animatedimage.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/games/sfcave-sdl/animatedimage.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/noncore/games/sfcave-sdl/animatedimage.cpp b/noncore/games/sfcave-sdl/animatedimage.cpp index d9d6ff6..441c647 100644 --- a/noncore/games/sfcave-sdl/animatedimage.cpp +++ b/noncore/games/sfcave-sdl/animatedimage.cpp | |||
@@ -4,7 +4,7 @@ | |||
4 | #include "constants.h" | 4 | #include "constants.h" |
5 | #include "animatedimage.h" | 5 | #include "animatedimage.h" |
6 | 6 | ||
7 | AnimatedImage :: AnimatedImage( QString file, int nFrames ) | 7 | AnimatedImage :: AnimatedImage( string file, int nFrames ) |
8 | { | 8 | { |
9 | nrFrames = nFrames; | 9 | nrFrames = nFrames; |
10 | currentFrame = 0; | 10 | currentFrame = 0; |
@@ -19,9 +19,6 @@ AnimatedImage :: AnimatedImage( QString file, int nFrames ) | |||
19 | } | 19 | } |
20 | 20 | ||
21 | SDL_SetColorKey(image, SDL_SRCCOLORKEY | SDL_RLEACCEL, SDL_MapRGB( image->format, 0, 0, 0 ) ); | 21 | SDL_SetColorKey(image, SDL_SRCCOLORKEY | SDL_RLEACCEL, SDL_MapRGB( image->format, 0, 0, 0 ) ); |
22 | //image = SDL_DisplayFormat( tmp ); | ||
23 | |||
24 | //SDL_FreeSurface( tmp ); | ||
25 | frameWidth = image->w/nrFrames; | 22 | frameWidth = image->w/nrFrames; |
26 | frameHeight = image->h; | 23 | frameHeight = image->h; |
27 | } | 24 | } |
@@ -47,6 +44,9 @@ bool AnimatedImage :: nextFrame() | |||
47 | 44 | ||
48 | void AnimatedImage :: draw( SDL_Surface *screen, int x, int y ) | 45 | void AnimatedImage :: draw( SDL_Surface *screen, int x, int y ) |
49 | { | 46 | { |
47 | if ( !image ) | ||
48 | return; | ||
49 | |||
50 | SDL_Rect dst; | 50 | SDL_Rect dst; |
51 | dst.x = currentFrame * frameWidth; | 51 | dst.x = currentFrame * frameWidth; |
52 | dst.y = 0; | 52 | dst.y = 0; |