#include <CSArea.h>
Inheritance diagram for CSPictureArea:
Public Member Functions | |
virtual std::string | getType () |
CSPictureArea () | |
virtual void | paint (SDL_Surface *destination, SDL_Rect *parentViewport) |
void | setPicture (CSPicture *picture) |
void | setCentered (bool centered) |
void | setStretched (bool stretched) |
Static Public Attributes | |
const char * | CLASS = "CSPictureArea" |
Protected Attributes | |
bool | mStretched |
bool | mCentered |
CSPicture * | mPicture |
|
Definition at line 80 of file CSArea.cpp. References LOG_ENTER, LOG_EXIT, mCentered, mPicture, and mStretched.
00081 { 00082 static char *functionName="CSRoundedArea"; 00083 LOG_ENTER 00084 mStretched = true; 00085 mCentered = true; 00086 mPicture = 0; 00087 LOG_EXIT 00088 } |
|
Reimplemented from CSArea. Definition at line 74 of file CSArea.h. References CLASS.
00074 {return (std::string) CLASS;} |
|
Reimplemented from CSArea. Definition at line 90 of file CSArea.cpp. References CSPicture::display(), CSPicture::getHeight(), CSPicture::getScaledPicture(), CSPicture::getWidth(), mCentered, mPicture, mStretched, and SDLMain::shutdown().
00091 { 00092 static char *functionName="paint"; 00093 if (mPicture == 0) 00094 { 00095 SDL_FillRect(destination, area, mColor); 00096 } 00097 if (mStretched) 00098 { 00099 SDL_Surface *pic = mPicture->getScaledPicture(area->w, area->h); 00100 if (pic) 00101 { 00102 if (SDL_BlitSurface(pic, 0, destination, area)< 0) 00103 { 00104 SDLMain::shutdown((std::string)"BlitSurface error: " + SDL_GetError(), 1); 00105 } 00106 00107 return; 00108 } 00109 } 00110 if (mCentered) 00111 { 00112 int x = area->w/2 - mPicture->getWidth()/2; 00113 int y = area->h - mPicture->getHeight()/2; 00114 mPicture->display(destination, x, y); 00115 return; 00116 } 00117 mPicture->display(destination, area->x, area->y); 00118 } |
Here is the call graph for this function:
|
Definition at line 77 of file CSArea.h. References mPicture.
00077 {mPicture = picture;} |
|
Definition at line 78 of file CSArea.h. References mCentered.
00078 {mCentered = centered;} |
|
Definition at line 79 of file CSArea.h. References mStretched.
00079 {mStretched = stretched;} |
|
Definition at line 68 of file CSArea.h. Referenced by CSPictureArea(), paint(), and setStretched(). |
|
Definition at line 69 of file CSArea.h. Referenced by CSPictureArea(), paint(), and setCentered(). |
|
Definition at line 70 of file CSArea.h. Referenced by CSPictureArea(), paint(), and setPicture(). |
|
Reimplemented from CSArea. Definition at line 14 of file CSArea.cpp. Referenced by getType(). |