00001 #ifdef WIN32
00002 #pragma warning(disable : 4786 )
00003 #endif
00004
00005 #include "CSMouseCursor.h"
00006 #include "CSPicture.h"
00007
00008 const char *CSMouseCursor::CLASS = "CSMouseCursor";
00009
00010
00011
00012
00013
00014 CSMouseCursor::CSMouseCursor(std::string pictureName)
00015 {
00016 static char *functionName="CSMouseCursor";
00017 LOG_ENTER
00018 mPicture = CSPictureLoader::INSTANCE.load(pictureName);
00019 mVisible = 1;
00020 mX = 0;
00021 mY = 0;
00022 LOG_EXIT
00023 }
00024
00025
00026
00027
00028
00029 CSMouseCursor::~CSMouseCursor()
00030 {
00031 static char *functionName="~CSMouseCursor";
00032 LOG_ENTER
00033 mPicture = 0;
00034 LOG_EXIT
00035 }
00036
00037
00038
00039
00040
00041 void CSMouseCursor::paint(SDL_Surface *destination, SDL_Rect *parentViewport)
00042 {
00043 static char *functionName="paint";
00044 if (mVisible)
00045 {
00046 mPicture->display(parentViewport->x + mX, parentViewport->y + mY);
00047 }
00048 }
00049
00050
00051
00052
00053
00054 void CSMouseCursor::setPosition(int x, int y)
00055 {
00056 static char *functionName="setPosition";
00057 mX = x;
00058 mY = y;
00059 }
00060
00061
00062
00063
00064
00065 void CSMouseCursor::hide()
00066 {
00067 static char *functionName="hide";
00068 mVisible = 0;
00069 }
00070
00071
00072
00073
00074
00075 void CSMouseCursor::show()
00076 {
00077 static char *functionName="show";
00078 mVisible = 1;
00079 }