Definition at line 12 of file Picture.h.
Public Member Functions | |
Picture (const Path &file, const V2 &loc) | |
Load surface. | |
Picture (SDL_Surface *new_surface, const V2 &loc) | |
Use this surface. | |
virtual | ~Picture () |
Free surface. | |
int | getW () const |
int | getH () const |
virtual void | drawOn (SDL_Surface *screen) |
Blit entire surface to [x,y]. | |
void | setLoc (const V2 &loc) |
void | changePicture (const Path &file) |
void | changePicture (SDL_Surface *new_surface) |
Protected Attributes | |
V2 | m_loc |
SDL_Surface * | m_surface |
|
Load surface.
Definition at line 17 of file Picture.cpp. 00018 : m_loc(loc) 00019 { 00020 m_surface = ResImagePack::loadImage(file); 00021 }
|
|
Use this surface.
Definition at line 26 of file Picture.cpp.
|
|
Free surface.
Definition at line 36 of file Picture.cpp. 00037 { 00038 SDL_FreeSurface(m_surface); 00039 }
|
|
Definition at line 49 of file Picture.cpp.
|
|
Definition at line 42 of file Picture.cpp. 00043 { 00044 SDL_FreeSurface(m_surface); 00045 m_surface = ResImagePack::loadImage(file); 00046 }
|
|
Blit entire surface to [x,y].
Implements Drawable. Reimplemented in LayeredPicture, and WavyPicture. Definition at line 59 of file Picture.cpp. 00060 { 00061 SDL_Rect rect; 00062 rect.x = m_loc.getX(); 00063 rect.y = m_loc.getY(); 00064 00065 SDL_BlitSurface(m_surface, NULL, screen, &rect); 00066 }
|
|
Definition at line 22 of file Picture.h. 00022 { return m_surface->h; }
|
|
Definition at line 21 of file Picture.h. 00021 { return m_surface->w; }
|
|
Definition at line 25 of file Picture.h. 00025 { m_loc = loc; }
|
|
|
|
|