00001 #include "OSDLSprite.h"
00002
00003 #include "OSDLBoundingBox2D.h"
00004
00005
00006 using namespace Ceylan::Log ;
00007
00008 using namespace OSDL::Rendering ;
00009
00010 using std::string ;
00011
00012
00013 #ifdef OSDL_USES_CONFIG_H
00014 #include <OSDLConfig.h>
00015 #endif // OSDL_USES_CONFIG_H
00016
00017
00018 #if OSDL_DEBUG_SPRITE
00019
00020 #define OSDL_RENDER_LOG(message) LogPlug::debug( message ) ;
00021
00022 #else // OSDL_DEBUG_SPRITE
00023
00024 #define OSDL_RENDER_LOG(message)
00025
00026 #endif // OSDL_DEBUG_SPRITE
00027
00028
00029
00030 Sprite::Sprite( bool ownBoundingBox ) throw() :
00031 View(),
00032 _ownBoundingBox( ownBoundingBox ),
00033 _box( 0 )
00034 {
00035
00036 }
00037
00038
00039 Sprite::~Sprite() throw()
00040 {
00041
00042 if ( _ownBoundingBox && ( _box != 0 ) )
00043 delete _box ;
00044
00045 }
00046
00047
00048 const string Sprite::toString( Ceylan::VerbosityLevels level ) const throw()
00049 {
00050
00051 string res = "Sprite which " ;
00052
00053 if ( _ownBoundingBox )
00054 res += "owns" ;
00055 else
00056 res += " does not own" ;
00057
00058 res += " its bounding box. " + View::toString( level ) ;
00059
00060 return res ;
00061
00062 }
00063