Main Page | Class Hierarchy | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals

Picture Class Reference

Inheritance diagram for Picture:

Inheritance graph
[legend]
Collaboration diagram for Picture:

Collaboration graph
[legend]

Detailed Description

Static picture at fixed screen position.

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


Constructor & Destructor Documentation

Picture::Picture const Path file,
const V2 loc
 

Load surface.

Definition at line 17 of file Picture.cpp.

00018     : m_loc(loc)
00019 {
00020     m_surface = ResImagePack::loadImage(file);
00021 }

Picture::Picture SDL_Surface *  new_surface,
const V2 loc
 

Use this surface.

Definition at line 26 of file Picture.cpp.

00027     : m_loc(loc)
00028 {
00029     m_surface = new_surface;
00030 }

Picture::~Picture  )  [virtual]
 

Free surface.

Definition at line 36 of file Picture.cpp.

00037 {
00038     SDL_FreeSurface(m_surface);
00039 }


Member Function Documentation

void Picture::changePicture SDL_Surface *  new_surface  ) 
 

Definition at line 49 of file Picture.cpp.

00050 {
00051     SDL_FreeSurface(m_surface);
00052     m_surface = new_surface;
00053 }

void Picture::changePicture const Path file  ) 
 

Definition at line 42 of file Picture.cpp.

00043 {
00044     SDL_FreeSurface(m_surface);
00045     m_surface = ResImagePack::loadImage(file);
00046 }

void Picture::drawOn SDL_Surface *  screen  )  [virtual]
 

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 }

int Picture::getH  )  const [inline]
 

Definition at line 22 of file Picture.h.

00022 { return m_surface->h; }

int Picture::getW  )  const [inline]
 

Definition at line 21 of file Picture.h.

00021 { return m_surface->w; }

void Picture::setLoc const V2 loc  )  [inline]
 

Definition at line 25 of file Picture.h.

00025 { m_loc = loc; }


Field Documentation

V2 Picture::m_loc [protected]
 

Definition at line 14 of file Picture.h.

SDL_Surface* Picture::m_surface [protected]
 

Definition at line 15 of file Picture.h.


The documentation for this class was generated from the following files:
Generated on Wed Jun 1 09:56:13 2005 for Fish Fillets - Next Generation by  doxygen 1.4.2