Pre-resize fillparent

This commit is contained in:
2018-08-13 22:22:10 -04:00
parent 58fa6f0503
commit 353dc21750
95 changed files with 478 additions and 437 deletions
+2 -2
View File
@@ -123,8 +123,8 @@ void cPongStart::MainMenu()
void cPongStart::Start() void cPongStart::Start()
{ {
VideoEngine::cImage* p_image = new VideoEngine::cImage("img/", "Equipment.png", true, 0, 0, 0); VideoEngine::cImageFile* p_image = new VideoEngine::cImageFile("img/", "Equipment.png", true, 0, 0, 0);
VideoEngine::cImage* p_court = new VideoEngine::cImage("img/", "Court.png"); VideoEngine::cImageFile* p_court = new VideoEngine::cImageFile("img/", "Court.png");
Equipment::cBall* ball = new Equipment::cBall(400, 400, 17, 65, 12, 12, &p_image); Equipment::cBall* ball = new Equipment::cBall(400, 400, 17, 65, 12, 12, &p_image);
Equipment::cPaddle* paddle = new Equipment::cPaddle(0, 0, 0, 0, 16, 77, &p_image); Equipment::cPaddle* paddle = new Equipment::cPaddle(0, 0, 0, 0, 16, 77, &p_image);
@@ -17,7 +17,7 @@ cAudio::~cAudio()
CleanUp(); CleanUp();
} }
//Functions /// Functions
/*static*/ cAudio& cAudio::Inst() /*static*/ cAudio& cAudio::Inst()
{ {
if (sp_inst == nullptr) if (sp_inst == nullptr)
@@ -70,7 +70,7 @@ void cAudio::MusicPlay()
} }
///Sets /// Sets
void cAudio::setRate( const unsigned long int rate /*= 22050*/ ) void cAudio::setRate( const unsigned long int rate /*= 22050*/ )
{ {
m_rate = rate; m_rate = rate;
@@ -91,7 +91,7 @@ void cAudio::setBuffers( const unsigned long int buffers /*= 4096*/ )
m_buffers = buffers; m_buffers = buffers;
} }
///Gets /// Gets
const bool cAudio::IsInit() const const bool cAudio::IsInit() const
{ {
bool rtn = false; bool rtn = false;
@@ -17,7 +17,7 @@ namespace AudioEngine {
~cAudio(); ~cAudio();
public: public:
//Functions /// Functions
static cAudio& Inst(); static cAudio& Inst();
static void Delete(); static void Delete();
@@ -34,7 +34,7 @@ namespace AudioEngine {
void MusicPlay(); void MusicPlay();
///Set /// Set
/* Sets the rate */ /* Sets the rate */
void setRate( const unsigned long int rate = 22050 ); void setRate( const unsigned long int rate = 22050 );
/* Sets the audio format */ /* Sets the audio format */
@@ -45,7 +45,7 @@ namespace AudioEngine {
/* Sets the buffer */ /* Sets the buffer */
void setBuffers( const unsigned long int buffers = 4096 ); void setBuffers( const unsigned long int buffers = 4096 );
///Get /// Get
/* Gets return true if Audio was initialized */ /* Gets return true if Audio was initialized */
const bool IsInit() const; const bool IsInit() const;
/* Gets the rate */ /* Gets the rate */
@@ -60,13 +60,13 @@ namespace AudioEngine {
private: private:
private: private:
///Variables /// Variables
unsigned long int m_rate;// = 22050; unsigned long int m_rate;/// = 22050;
unsigned long int m_format;// = AUDIO_S16; unsigned long int m_format;/// = AUDIO_S16;
unsigned long int m_channels;// = 2; unsigned long int m_channels;/// = 2;
unsigned long int m_buffers;// = 4096; unsigned long int m_buffers;/// = 4096;
static cAudio* sp_inst;// = nullptr; static cAudio* sp_inst;/// = nullptr;
};/// END CLASS DEFINITION cAudio };/// END CLASS DEFINITION cAudio
}/// END NAMESPACE DEFINITION AudioEngine }/// END NAMESPACE DEFINITION AudioEngine
#endif/// END IFNDEF _CAUDIO_HPP_ #endif/// END IFNDEF _CAUDIO_HPP_
@@ -14,7 +14,7 @@ cMusic::cMusic(const cMusic& copy)
cMusic::~cMusic() cMusic::~cMusic()
{} {}
///Functions /// Functions
/* Plays the music if loaded */ /* Plays the music if loaded */
void cMusic::PlayMusic() void cMusic::PlayMusic()
{} {}
@@ -32,7 +32,7 @@ void cMusic::FideOut(const unsigned int time /*= 1000*/) const
} }
/* private:*/ /* private:*/
///Functions /// Functions
void cMusic::LoadMusic() void cMusic::LoadMusic()
{} {}
@@ -22,7 +22,7 @@ namespace AudioEngine {
cMusic( const cMusic& copy ); cMusic( const cMusic& copy );
~cMusic(); ~cMusic();
///Functions /// Functions
/* Plays the music if loaded */ /* Plays the music if loaded */
void PlayMusic(); void PlayMusic();
/* Fades in the music for time */ /* Fades in the music for time */
@@ -31,15 +31,15 @@ namespace AudioEngine {
void FideOut( const unsigned int time = 1000 ) const; void FideOut( const unsigned int time = 1000 ) const;
private: private:
///Functions /// Functions
void LoadMusic(); void LoadMusic();
void UnloadMusic(); void UnloadMusic();
private: private:
///Variables /// Variables
Mix_Music* mp_music; Mix_Music* mp_music;
unsigned char m_volume;// = 255 unsigned char m_volume;/// = 255
};/// END CLASS DEFINITION cMusic };/// END CLASS DEFINITION cMusic
@@ -24,7 +24,7 @@ namespace AudioEngine {
cSound( const cSound& copy ); cSound( const cSound& copy );
~cSound(); ~cSound();
///Functions /// Functions
/* Plays the sound if loaded */ /* Plays the sound if loaded */
void PlaySound(); void PlaySound();
/* Fades in the sound for time */ /* Fades in the sound for time */
@@ -32,7 +32,7 @@ namespace AudioEngine {
/* Fades out the sound for time */ /* Fades out the sound for time */
void FadeOut( const unsigned int time = 1000 ) const; void FadeOut( const unsigned int time = 1000 ) const;
///Sets /// Sets
/* Sets the directory of the sound */ /* Sets the directory of the sound */
void setDir( const cString& dir ); void setDir( const cString& dir );
/* Sets the file name of the sound */ /* Sets the file name of the sound */
@@ -51,7 +51,7 @@ namespace AudioEngine {
void setLoops( const long int loops = -1 ); void setLoops( const long int loops = -1 );
///Gets /// Gets
/* Gets the directory of the sound */ /* Gets the directory of the sound */
const cString& getDir() const; const cString& getDir() const;
/* Gets the file name of the sound */ /* Gets the file name of the sound */
@@ -68,16 +68,16 @@ namespace AudioEngine {
const long int getLoops() const; const long int getLoops() const;
private: private:
///Functions /// Functions
void LoadSound(); void LoadSound();
void UnloadSound(); void UnloadSound();
private: private:
///Variables /// Variables
Mix_Chunk* mp_sound;// = nullptr Mix_Chunk* mp_sound;/// = nullptr
cString m_dir;// = "" cString m_dir;/// = ""
cString m_fileName;// = "" cString m_fileName;/// = ""
unsigned char m_volume;// = 255 unsigned char m_volume;// = 255
@@ -13,15 +13,15 @@ using UtilityEngine::cUtility;
/*static*/ cGFX* cGFX::sp_inst = nullptr; /*static*/ cGFX* cGFX::sp_inst = nullptr;
//private: /// private:
cGFX::cGFX() cGFX::cGFX()
{} {}
cGFX::~cGFX() cGFX::~cGFX()
{} {}
//public: /// public:
///Functions /// Functions
/*static*/ cGFX& cGFX::Inst() /*static*/ cGFX& cGFX::Inst()
{ {
if (sp_inst == nullptr) if (sp_inst == nullptr)
@@ -48,13 +48,13 @@ void cGFX::StringDefault( const cString& text, const SDL_Rect& pos, const SDL_Co
cRenderer::Inst().ResetRenderTarget(); cRenderer::Inst().ResetRenderTarget();
} }
void cGFX::Box(const SDL_Rect& rect, const SDL_Colour& colour) const void cGFX::Box( const SDL_Rect& rect, const SDL_Colour& colour ) const
{ {
if (boxRGBA(cRenderer::Inst().getRenderer(), (Sint16)rect.x, (Sint16)rect.y, (Sint16)rect.w, (Sint16)rect.h, colour.r, colour.g, colour.b, colour.a) < 0) if (boxRGBA(cRenderer::Inst().getRenderer(), (Sint16)rect.x, (Sint16)rect.y, (Sint16)rect.w, (Sint16)rect.h, colour.r, colour.g, colour.b, colour.a) < 0)
cUtility::Inst().Message("Unable to make Rounded Rectangle. boxRGBA():", __AT__, cUtility::eTypeSDL::GFX); cUtility::Inst().Message("Unable to make Rounded Rectangle. boxRGBA():", __AT__, cUtility::eTypeSDL::GFX);
} }
void cGFX::Box(const SDL_Rect& rect, const SDL_Colour& colour, SDL_Texture* texture) const void cGFX::Box( const SDL_Rect& rect, const SDL_Colour& colour, SDL_Texture* texture ) const
{ {
cRenderer::Inst().SetRenderTarget(texture); cRenderer::Inst().SetRenderTarget(texture);
Box(rect, colour); Box(rect, colour);
@@ -74,33 +74,33 @@ void cGFX::RoundedBox( const SDL_Rect& rect, const unsigned long int rad, const
cRenderer::Inst().ResetRenderTarget(); cRenderer::Inst().ResetRenderTarget();
} }
void cGFX::Pixel(const unsigned long int x, const unsigned long int y, const SDL_Colour& colour) const void cGFX::Pixel( const unsigned long int x, const unsigned long int y, const SDL_Colour& colour ) const
{ {
if (pixelRGBA(cRenderer::Inst().getRenderer(), (Sint16)x, (Sint16)y, colour.r, colour.g, colour.b, colour.a) < 0) if (pixelRGBA(cRenderer::Inst().getRenderer(), (Sint16)x, (Sint16)y, colour.r, colour.g, colour.b, colour.a) < 0)
cUtility::Inst().Message("Unable to make pixel. pixelRGBA():", __AT__, cUtility::eTypeSDL::GFX); cUtility::Inst().Message("Unable to make pixel. pixelRGBA():", __AT__, cUtility::eTypeSDL::GFX);
} }
void cGFX::Pixel(const unsigned long int x, const unsigned long int y, const SDL_Colour& colour, SDL_Texture* texture) const void cGFX::Pixel( const unsigned long int x, const unsigned long int y, const SDL_Colour& colour, SDL_Texture* texture ) const
{ {
cRenderer::Inst().SetRenderTarget(texture); cRenderer::Inst().SetRenderTarget(texture);
Pixel(x, y, colour); Pixel(x, y, colour);
cRenderer::Inst().ResetRenderTarget(); cRenderer::Inst().ResetRenderTarget();
} }
void cGFX::Rectangle(const SDL_Rect& rect, const SDL_Colour& colour) const void cGFX::Rectangle( const SDL_Rect& rect, const SDL_Colour& colour ) const
{ {
if (rectangleRGBA(cRenderer::Inst().getRenderer(), (Sint16)rect.x, (Sint16)rect.y, (Sint16)rect.w, (Sint16)rect.h, colour.r, colour.g, colour.b, colour.a) < 0) if (rectangleRGBA(cRenderer::Inst().getRenderer(), (Sint16)rect.x, (Sint16)rect.y, (Sint16)rect.w, (Sint16)rect.h, colour.r, colour.g, colour.b, colour.a) < 0)
cUtility::Inst().Message("Unable to make pixel. rectangleRGBA():", __AT__, cUtility::eTypeSDL::GFX); cUtility::Inst().Message("Unable to make pixel. rectangleRGBA():", __AT__, cUtility::eTypeSDL::GFX);
} }
void cGFX::Rectangle(const SDL_Rect& rect, const SDL_Colour& colour, SDL_Texture* texture) const void cGFX::Rectangle( const SDL_Rect& rect, const SDL_Colour& colour, SDL_Texture* texture ) const
{ {
cRenderer::Inst().SetRenderTarget(texture); cRenderer::Inst().SetRenderTarget(texture);
Rectangle(rect, colour); Rectangle(rect, colour);
cRenderer::Inst().ResetRenderTarget(); cRenderer::Inst().ResetRenderTarget();
} }
void cGFX::ZoomIn(SDL_Texture* texture, const double zoomx, const double zoomy, const unsigned long int smooth /*= SMOOTHING_ON*/) const void cGFX::ZoomIn( SDL_Texture* texture, const double zoomx, const double zoomy, const unsigned long int smooth /*= SMOOTHING_ON*/ ) const
{ {
SDL_Surface* surface = cRenderer::Inst().TextureToSurface(texture); SDL_Surface* surface = cRenderer::Inst().TextureToSurface(texture);
@@ -43,7 +43,7 @@ namespace EXPORT_FROM_MYDLL FXEngine {
void ZoomIn( SDL_Texture* texture, const double zoomx, const double zoomy, const unsigned long int smooth = SMOOTHING_ON ) const; void ZoomIn( SDL_Texture* texture, const double zoomx, const double zoomy, const unsigned long int smooth = SMOOTHING_ON ) const;
private: private:
static cGFX* sp_inst;// = nullptr static cGFX* sp_inst;/// = nullptr
};/// END CLASS DEFINITION cGFX };/// END CLASS DEFINITION cGFX
}/// END NAMESPACE DEFINITION FXEngine }/// END NAMESPACE DEFINITION FXEngine
#endif/// END IFNDEF _CGFX_HPP_ #endif/// END IFNDEF _CGFX_HPP_
@@ -2,7 +2,7 @@
using namespace GUIHelpers; using namespace GUIHelpers;
const RGBA& GUIHelpers::StringtoRGBA( const cString& colour ) const RGBA GUIHelpers::StringtoRGBA( const cString& colour )
{ {
RGBA rtn = DEFAULT; RGBA rtn = DEFAULT;
cString check = colour.upper(); cString check = colour.upper();
@@ -18,8 +18,6 @@ namespace GUIHelpers {
typedef struct SDL_Colour RGBA; typedef struct SDL_Colour RGBA;
typedef struct SDL_Rect Area; typedef struct SDL_Rect Area;
static const RGBA DEFAULT = { 0, 0, 0, 0 };
static const RGBA WHITE = { 255, 255, 255, 255 }; static const RGBA WHITE = { 255, 255, 255, 255 };
static const RGBA BLACK = { 0, 0, 0, 255 }; static const RGBA BLACK = { 0, 0, 0, 255 };
@@ -38,8 +36,9 @@ namespace GUIHelpers {
static const RGBA MAGENTA = { 255, 0, 255, 255 }; static const RGBA MAGENTA = { 255, 0, 255, 255 };
static const RGBA ROSE = { 255, 0, 128, 255 }; static const RGBA ROSE = { 255, 0, 128, 255 };
static const RGBA DEFAULT = WHITE;
const RGBA& StringtoRGBA(const cString& colour); const RGBA StringtoRGBA(const cString& colour);
}/// END NAMESPACE DEFINITION GUIHelpers }/// END NAMESPACE DEFINITION GUIHelpers
#endif/// END IFNDEF _GUIUTILITY_HPP_ #endif/// END IFNDEF _GUIUTILITY_HPP_
@@ -21,15 +21,15 @@ bool cObject::operator == (const cObject& other)
return false; return false;
} }
///Functions /// Functions
///Sets /// Sets
const void cObject::setID( const signed int id ) const void cObject::setID( const signed int id )
{ {
m_id = id; m_id = id;
} }
///Gets /// Gets
const signed int cObject::getID() const const signed int cObject::getID() const
{ {
return m_id; return m_id;
@@ -13,9 +13,7 @@ cTexture::cTexture()
cTexture::~cTexture() cTexture::~cTexture()
{} {}
///Functions /// Functions
//private
SDL_Texture* cTexture::GenerateTexture( const SDL_Rect& dimensions, TextTypeEngine::cText* text /*= nullptr*/ ) SDL_Texture* cTexture::GenerateTexture( const SDL_Rect& dimensions, TextTypeEngine::cText* text /*= nullptr*/ )
{ {
SDL_Rect t = text->getWH(); SDL_Rect t = text->getWH();
@@ -18,7 +18,7 @@ namespace GUIHelpers {
cTexture(); cTexture();
~cTexture(); ~cTexture();
///Functions /// Functions
SDL_Texture* GenerateTexture( const SDL_Rect& dimensions, TextTypeEngine::cText* text = nullptr ); SDL_Texture* GenerateTexture( const SDL_Rect& dimensions, TextTypeEngine::cText* text = nullptr );
private: private:
@@ -12,21 +12,15 @@ using UtilityEngine::cUtility;
cXMLoader::cXMLoader() cXMLoader::cXMLoader()
{ : m_loadDef(false), m_debugXML(false), m_orientation(GUIHelpers::eOrientation::DEFAULT_ORIENTATION),
m_loadDef = false; m_align(GUIHelpers::eAlign::DEFAULT_ALIGN), m_layout(GUIHelpers::eLayout::DEFAULT_LAYOUT), m_pos({ -1, -1 }),
m_orientation = GUIHelpers::eOrientation::DEFAULT_ORIENTATION; m_size({ -1, -1 }), m_pad({ -1, -1, -1, -1 })
m_align = GUIHelpers::eAlign::DEFAULT_ALIGN; {}
m_layout = GUIHelpers::eLayout::DEFAULT_LAYOUT;
m_pos = { -1, -1 };
m_size = { -1, -1 };
m_pad = { -1, -1, -1, -1 };
}
cXMLoader::~cXMLoader() cXMLoader::~cXMLoader()
{} {}
///Functions /// Functions
void cXMLoader::Load( const cString& filename, const cString& dir /*= ""*/, GUIEngine::cWindow* parent /*= nullptr*/ ) void cXMLoader::Load( const cString& filename, const cString& dir /*= ""*/, GUIEngine::cWindow* parent /*= nullptr*/ )
{ {
cString file = dir + filename; cString file = dir + filename;
@@ -83,14 +77,17 @@ void cXMLoader::GetElement( tinyxml2::XMLElement& element, GUIEngine::cWindow* p
tmp->Resize(); tmp->Resize();
} }
const cString& cXMLoader::GetAttribute( const tinyxml2::XMLElement& element, const cString& attribute ) const const cString cXMLoader::GetAttribute( const tinyxml2::XMLElement& element, const cString& attribute ) const
{ {
cString rtn; cString rtn = "";
const char* str = element.Attribute(attribute.c_str()); const char* str = element.Attribute(attribute.c_str());
if ((str == nullptr) && (m_debugXML == true)) if ((str == nullptr) && (m_debugXML == true))
cUtility::Inst().Message("Error no attribute: " + attribute + " found in tag <" + element.Value() + ">"); cUtility::Inst().Message("Error no attribute: " + attribute + " found in tag <" + element.Value() + ">");
else else {
rtn = str; if (str != nullptr)
rtn = str;
}
//rtn = str;
return rtn; return rtn;
} }
@@ -211,12 +208,12 @@ GUIEngine::cBoxSizer* cXMLoader::BoxSizerBuild(const tinyxml2::XMLElement& eleme
return rtn; return rtn;
} }
const cString& cXMLoader::getDir(const tinyxml2::XMLElement& element) const const cString cXMLoader::getDir(const tinyxml2::XMLElement& element) const
{ {
return GetAttribute(element, "dir"); return GetAttribute(element, "dir");
} }
const cString& cXMLoader::getFileName(const tinyxml2::XMLElement& element) const const cString cXMLoader::getFileName(const tinyxml2::XMLElement& element) const
{ {
return GetAttribute(element, "filename"); return GetAttribute(element, "filename");
} }
@@ -315,7 +312,7 @@ const GUIHelpers::eLayout cXMLoader::getLayout( const tinyxml2::XMLElement& elem
return rtn; return rtn;
} }
const GUIHelpers::Position& cXMLoader::getPosition( const tinyxml2::XMLElement& element ) const const GUIHelpers::Position cXMLoader::getPosition( const tinyxml2::XMLElement& element ) const
{ {
GUIHelpers::Position rtn = { -1, -1 }; GUIHelpers::Position rtn = { -1, -1 };
@@ -337,7 +334,7 @@ const GUIHelpers::Position& cXMLoader::getPosition( const tinyxml2::XMLElement&
return rtn; return rtn;
} }
const GUIHelpers::Size& cXMLoader::getSize( const tinyxml2::XMLElement& element ) const const GUIHelpers::Size cXMLoader::getSize( const tinyxml2::XMLElement& element ) const
{ {
GUIHelpers::Size rtn = { -1, -1 }; GUIHelpers::Size rtn = { -1, -1 };
@@ -359,7 +356,7 @@ const GUIHelpers::Size& cXMLoader::getSize( const tinyxml2::XMLElement& element
return rtn; return rtn;
} }
const GUIHelpers::Padding& cXMLoader::getPadding( const tinyxml2::XMLElement& element ) const const GUIHelpers::Padding cXMLoader::getPadding( const tinyxml2::XMLElement& element ) const
{ {
GUIHelpers::Padding rtn = { -1, -1, -1, -1 }; GUIHelpers::Padding rtn = { -1, -1, -1, -1 };
@@ -385,12 +382,12 @@ const GUIHelpers::Padding& cXMLoader::getPadding( const tinyxml2::XMLElement& el
return rtn; return rtn;
} }
const cString& cXMLoader::getText( const tinyxml2::XMLElement& element ) const const cString cXMLoader::getText( const tinyxml2::XMLElement& element ) const
{ {
return GetAttribute(element, "text"); return GetAttribute(element, "text");
} }
const GUIHelpers::RGBA& cXMLoader::getColour( const tinyxml2::XMLElement& element ) const const GUIHelpers::RGBA cXMLoader::getColour( const tinyxml2::XMLElement& element ) const
{ {
GUIHelpers::RGBA rtn = GUIHelpers::DEFAULT; GUIHelpers::RGBA rtn = GUIHelpers::DEFAULT;
cString str = GetAttribute(element, "colour"); cString str = GetAttribute(element, "colour");
@@ -31,7 +31,7 @@ namespace GUIHelpers {
private: private:
void GetElement( tinyxml2::XMLElement& element, GUIEngine::cWindow* parent = nullptr ) const; void GetElement( tinyxml2::XMLElement& element, GUIEngine::cWindow* parent = nullptr ) const;
const cString& GetAttribute( const tinyxml2::XMLElement& element, const cString& attribute ) const; const cString GetAttribute( const tinyxml2::XMLElement& element, const cString& attribute ) const;
void Include( const tinyxml2::XMLElement& element, GUIEngine::cWindow* parent ) const; void Include( const tinyxml2::XMLElement& element, GUIEngine::cWindow* parent ) const;
void GUISetup( const tinyxml2::XMLElement& element ) const; void GUISetup( const tinyxml2::XMLElement& element ) const;
@@ -43,34 +43,34 @@ namespace GUIHelpers {
GUIEngine::cLabel* LabelBuild( const tinyxml2::XMLElement& element, GUIEngine::cWindow* parent ) const; GUIEngine::cLabel* LabelBuild( const tinyxml2::XMLElement& element, GUIEngine::cWindow* parent ) const;
GUIEngine::cBoxSizer* BoxSizerBuild( const tinyxml2::XMLElement& element, GUIEngine::cWindow* parent ) const; GUIEngine::cBoxSizer* BoxSizerBuild( const tinyxml2::XMLElement& element, GUIEngine::cWindow* parent ) const;
const cString& getDir( const tinyxml2::XMLElement& element ) const; const cString getDir( const tinyxml2::XMLElement& element ) const;
const cString& getFileName( const tinyxml2::XMLElement& element ) const; const cString getFileName( const tinyxml2::XMLElement& element ) const;
const unsigned long int getDebug( const tinyxml2::XMLElement& element ) const; const unsigned long int getDebug( const tinyxml2::XMLElement& element ) const;
const bool cXMLoader::getDebugXML(const tinyxml2::XMLElement& element) const; const bool cXMLoader::getDebugXML(const tinyxml2::XMLElement& element) const;
const signed long int getID( const tinyxml2::XMLElement& element ) const; const signed long int getID( const tinyxml2::XMLElement& element ) const;
const GUIHelpers::eOrientation getOrientation( const tinyxml2::XMLElement& element ) const; const GUIHelpers::eOrientation getOrientation( const tinyxml2::XMLElement& element ) const;
const GUIHelpers::eAlign getAlign( const tinyxml2::XMLElement& element ) const; const GUIHelpers::eAlign getAlign( const tinyxml2::XMLElement& element ) const;
const GUIHelpers::eLayout getLayout( const tinyxml2::XMLElement& element ) const; const GUIHelpers::eLayout getLayout( const tinyxml2::XMLElement& element ) const;
const GUIHelpers::Position& getPosition( const tinyxml2::XMLElement& element ) const; const GUIHelpers::Position getPosition( const tinyxml2::XMLElement& element ) const;
const GUIHelpers::Size& getSize( const tinyxml2::XMLElement& element ) const; const GUIHelpers::Size getSize( const tinyxml2::XMLElement& element ) const;
const GUIHelpers::Padding& getPadding( const tinyxml2::XMLElement& element ) const; const GUIHelpers::Padding getPadding( const tinyxml2::XMLElement& element ) const;
const cString& getText( const tinyxml2::XMLElement& element ) const; const cString getText( const tinyxml2::XMLElement& element ) const;
const GUIHelpers::RGBA& getColour( const tinyxml2::XMLElement& element ) const; const GUIHelpers::RGBA getColour( const tinyxml2::XMLElement& element ) const;
const signed long int getFontSize( const tinyxml2::XMLElement& element ) const; const signed long int getFontSize( const tinyxml2::XMLElement& element ) const;
void LoadDefault() const; void LoadDefault() const;
private: private:
bool m_loadDef;// = false; bool m_loadDef;/// = false;
bool m_debugXML; bool m_debugXML;/// = false;
GUIHelpers::eOrientation m_orientation;// = GUIHelpers::eOrientation::DEFAULT_ORIENTATION; GUIHelpers::eOrientation m_orientation;/// = GUIHelpers::eOrientation::DEFAULT_ORIENTATION;
GUIHelpers::eAlign m_align;// = GUIHelpers::eAlign::DEFAULT_ALIGN; GUIHelpers::eAlign m_align;/// = GUIHelpers::eAlign::DEFAULT_ALIGN;
GUIHelpers::eLayout m_layout;// = GUIHelpers::eLayout::DEFAULT_LAYOUT; GUIHelpers::eLayout m_layout;/// = GUIHelpers::eLayout::DEFAULT_LAYOUT;
GUIHelpers::Position m_pos;// = { -1, -1 }; GUIHelpers::Position m_pos;/// = { -1, -1 };
GUIHelpers::Size m_size;// = { -1, -1 }; GUIHelpers::Size m_size;/// = { -1, -1 };
GUIHelpers::Padding m_pad;// = { -1, -1, -1, -1 }; GUIHelpers::Padding m_pad;/// = { -1, -1, -1, -1 };
};/// END CLASS DEFINITION cXMLoader };/// END CLASS DEFINITION cXMLoader
}/// END NAMESPACE DEFINITION GUIHelpers }/// END NAMESPACE DEFINITION GUIHelpers
#endif/// END IFNDEF _CXMLOADER_HPP_ #endif/// END IFNDEF _CXMLOADER_HPP_
@@ -15,7 +15,7 @@ cBoxSizer::cBoxSizer( cWindow* parent, const signed int id, const GUIHelpers::eA
/*virtual*/ cBoxSizer::~cBoxSizer() /*virtual*/ cBoxSizer::~cBoxSizer()
{} {}
///Functions /// Functions
void cBoxSizer::Create( cWindow* parent, const signed int id, const GUIHelpers::eAlign& align /*= sALIGN*/, const GUIHelpers::eLayout& layout /*= sLAYOUT*/, void cBoxSizer::Create( cWindow* parent, const signed int id, const GUIHelpers::eAlign& align /*= sALIGN*/, const GUIHelpers::eLayout& layout /*= sLAYOUT*/,
const GUIHelpers::Position& pos/* = sPOSITION*/, const GUIHelpers::Size& size /*= sSIZE*/, const GUIHelpers::Padding& padding /*= sPADDING*/, const GUIHelpers::Position& pos/* = sPOSITION*/, const GUIHelpers::Size& size /*= sSIZE*/, const GUIHelpers::Padding& padding /*= sPADDING*/,
const cString& name /*= sNAME*/ ) const cString& name /*= sNAME*/ )
@@ -31,7 +31,7 @@ namespace GUIEngine {
const cString& name = sNAME ); const cString& name = sNAME );
virtual ~cBoxSizer(); virtual ~cBoxSizer();
///Functions /// Functions
void Create( cWindow* parent, const signed int id, const GUIHelpers::eAlign& align = sALIGN, const GUIHelpers::eLayout& layout = sLAYOUT, void Create( cWindow* parent, const signed int id, const GUIHelpers::eAlign& align = sALIGN, const GUIHelpers::eLayout& layout = sLAYOUT,
const GUIHelpers::Position& pos = sPOSITION, const GUIHelpers::Size& size = sSIZE, const GUIHelpers::Padding& padding = sPADDING, const GUIHelpers::Position& pos = sPOSITION, const GUIHelpers::Size& size = sSIZE, const GUIHelpers::Padding& padding = sPADDING,
const cString& name = sNAME ); const cString& name = sNAME );
@@ -39,7 +39,7 @@ cButton::cButton( cWindow* parent, const signed int id, const GUIHelpers::eAlign
} }
///Functions /// Functions
void cButton::Create( cWindow* parent, const signed int id, const GUIHelpers::eAlign& align /*= sALIGN*/, const GUIHelpers::eLayout& layout /*= sLAYOUT*/, void cButton::Create( cWindow* parent, const signed int id, const GUIHelpers::eAlign& align /*= sALIGN*/, const GUIHelpers::eLayout& layout /*= sLAYOUT*/,
const GUIHelpers::Position& pos /*= sPOSITION*/, const GUIHelpers::Size& size /*= sSIZE*/, const GUIHelpers::Padding& padding /*= sPADDING*/, const GUIHelpers::Position& pos /*= sPOSITION*/, const GUIHelpers::Size& size /*= sSIZE*/, const GUIHelpers::Padding& padding /*= sPADDING*/,
const cString& name /*= sNAME*/, VideoEngine::cImage** image /*= nullptr*/ ) const cString& name /*= sNAME*/, VideoEngine::cImage** image /*= nullptr*/ )
@@ -68,7 +68,7 @@ void cButton::Create( cWindow* parent, const signed int id, const GUIHelpers::eA
// } // }
// } // }
///Gets /// Gets
// const cString cButton::getLabel() const // const cString cButton::getLabel() const
// { // {
// cString rtn = ""; // cString rtn = "";
@@ -83,7 +83,7 @@ void cButton::Create( cWindow* parent, const signed int id, const GUIHelpers::eA
} }
//private /// private
void cButton::GenerateImage() void cButton::GenerateImage()
{ {
GenerateTexture(); GenerateTexture();
@@ -35,16 +35,16 @@ namespace GUIEngine {
const cString& name = sNAME, VideoEngine::cImage** image = nullptr ); const cString& name = sNAME, VideoEngine::cImage** image = nullptr );
virtual ~cButton(); virtual ~cButton();
///Functions /// Functions
void Create( cWindow* parent, const signed int id, const GUIHelpers::eAlign& align = sALIGN, const GUIHelpers::eLayout& layout = sLAYOUT, void Create( cWindow* parent, const signed int id, const GUIHelpers::eAlign& align = sALIGN, const GUIHelpers::eLayout& layout = sLAYOUT,
const GUIHelpers::Position& pos = sPOSITION, const GUIHelpers::Size& size = sSIZE, const GUIHelpers::Padding& padding = sPADDING, const GUIHelpers::Position& pos = sPOSITION, const GUIHelpers::Size& size = sSIZE, const GUIHelpers::Padding& padding = sPADDING,
const cString& name = sNAME, VideoEngine::cImage** image = nullptr ); const cString& name = sNAME, VideoEngine::cImage** image = nullptr );
virtual void Press(); virtual void Press();
//Sets /// Sets
///Gets /// Gets
virtual const GUIHelpers::eType getType() const; virtual const GUIHelpers::eType getType() const;
private: private:
@@ -53,11 +53,11 @@ namespace GUIEngine {
void GenerateTexture(); void GenerateTexture();
private: private:
VideoEngine::cImage* mp_texture;// = nullptr VideoEngine::cImage* mp_texture;/// = nullptr
VideoEngine::cImage* mp_texturePress;// = nullptr VideoEngine::cImage* mp_texturePress;/// = nullptr
//Pointer to the image that will be displayed on the button. //Pointer to the image that will be displayed on the button.
VideoEngine::cImage** mpp_image;// = nullptr VideoEngine::cImage** mpp_image;/// = nullptr
};/// END CLASS DEFINITION cButton };/// END CLASS DEFINITION cButton
}/// END NAMESPACE DEFINITION GUIEngine }/// END NAMESPACE DEFINITION GUIEngine
#endif/// END IFNDEF _CBUTTON_HPP_ #endif/// END IFNDEF _CBUTTON_HPP_
@@ -111,7 +111,7 @@ void cGUI::Display()
} }
} }
///Sets /// Sets
void cGUI::setDebugLevel(const unsigned long int debugLevel) void cGUI::setDebugLevel(const unsigned long int debugLevel)
{ {
m_debugLevel = debugLevel; m_debugLevel = debugLevel;
@@ -159,7 +159,7 @@ void cGUI::setAlign( const GUIHelpers::eAlign& align /*= GUIHelpers::eAlign::CEN
//cWindow::sALIGN = align; //cWindow::sALIGN = align;
} }
///Gets /// Gets
const unsigned long int cGUI::getDebugLevel() const const unsigned long int cGUI::getDebugLevel() const
{ {
return m_debugLevel; return m_debugLevel;
@@ -36,7 +36,7 @@ namespace GUIEngine {
MouseButton3, MouseButton3,
Keyboard Keyboard
}; };
///Functions /// Functions
static cGUI& Inst(); static cGUI& Inst();
static void Delete(); static void Delete();
@@ -51,7 +51,7 @@ namespace GUIEngine {
void Display(); void Display();
///Sets /// Sets
void setDebugLevel( const unsigned long int debugLevel ); void setDebugLevel( const unsigned long int debugLevel );
void setFont( TextTypeEngine::cFont* font ); void setFont( TextTypeEngine::cFont* font );
@@ -65,7 +65,7 @@ namespace GUIEngine {
void setAlign( const GUIHelpers::eAlign& align = GUIHelpers::eAlign::CENTER ); void setAlign( const GUIHelpers::eAlign& align = GUIHelpers::eAlign::CENTER );
///Gets /// Gets
const unsigned long int getDebugLevel() const; const unsigned long int getDebugLevel() const;
TextTypeEngine::cFont* getFont(); TextTypeEngine::cFont* getFont();
@@ -81,14 +81,14 @@ namespace GUIEngine {
const bool IsInit() const; const bool IsInit() const;
private: private:
static cGUI* sp_inst;// = nullptr static cGUI* sp_inst;/// = nullptr
unsigned long int m_debugLevel;// = 0 unsigned long int m_debugLevel;/// = 0
bool m_inited;// = false bool m_inited;/// = false
/* default GUI font */ /* default GUI font */
TextTypeEngine::cFont* mp_font;// = nullptr TextTypeEngine::cFont* mp_font;/// = nullptr
/* default GUI text colour black*/ /* default GUI text colour black*/
//GUIHelpers::RBGA m_textColour;// = { 0, 0, 0 } //GUIHelpers::RBGA m_textColour;// = { 0, 0, 0 }
@@ -19,7 +19,7 @@ cLabel::cLabel(cWindow* parent, const signed int id, const cString& label /*= ""
mp_text = nullptr; mp_text = nullptr;
} }
///Functions /// Functions
void cLabel::Create(cWindow* parent, const signed int id, const cString& label /*= ""*/, const GUIHelpers::eAlign& align /*= sALIGN*/, void cLabel::Create(cWindow* parent, const signed int id, const cString& label /*= ""*/, const GUIHelpers::eAlign& align /*= sALIGN*/,
const GUIHelpers::eLayout& layout /*= sLAYOUT*/, const GUIHelpers::Position& pos /*= sPOSITION*/, const GUIHelpers::Size& size /*= sSIZE*/, const GUIHelpers::eLayout& layout /*= sLAYOUT*/, const GUIHelpers::Position& pos /*= sPOSITION*/, const GUIHelpers::Size& size /*= sSIZE*/,
const GUIHelpers::Padding& padding /*= sPADDING*/, const cString& name /*= sNAME*/) const GUIHelpers::Padding& padding /*= sPADDING*/, const cString& name /*= sNAME*/)
@@ -53,7 +53,7 @@ void cLabel::GenerateTexture()
//this->setPosition() //this->setPosition()
} }
//Sets /// Sets
void cLabel::setFontColour(const GUIHelpers::RGBA& colour) void cLabel::setFontColour(const GUIHelpers::RGBA& colour)
{ {
mp_text->setColour(colour); mp_text->setColour(colour);
@@ -76,7 +76,7 @@ void cLabel::setFont(const TextTypeEngine::cFont* font)
mp_text->setFont((TextTypeEngine::cFont**)(&font)); mp_text->setFont((TextTypeEngine::cFont**)(&font));
} }
///Gets /// Gets
const GUIHelpers::RGBA& cLabel::getFontColour() const const GUIHelpers::RGBA& cLabel::getFontColour() const
{ {
return mp_text->getColour(); return mp_text->getColour();
@@ -24,7 +24,7 @@ namespace GUIEngine {
const GUIHelpers::Padding& padding = sPADDING, const cString& name = sNAME); const GUIHelpers::Padding& padding = sPADDING, const cString& name = sNAME);
virtual ~cLabel(); virtual ~cLabel();
///Functions /// Functions
void Create(cWindow* parent, const signed int id, const cString& label = "", const GUIHelpers::eAlign& align = sALIGN, void Create(cWindow* parent, const signed int id, const cString& label = "", const GUIHelpers::eAlign& align = sALIGN,
const GUIHelpers::eLayout& layout = sLAYOUT, const GUIHelpers::Position& pos = sPOSITION, const GUIHelpers::Size& size = sSIZE, const GUIHelpers::eLayout& layout = sLAYOUT, const GUIHelpers::Position& pos = sPOSITION, const GUIHelpers::Size& size = sSIZE,
const GUIHelpers::Padding& padding = sPADDING, const cString& name = sNAME); const GUIHelpers::Padding& padding = sPADDING, const cString& name = sNAME);
@@ -33,13 +33,13 @@ namespace GUIEngine {
void GenerateTexture(); void GenerateTexture();
//Sets /// Sets
void setFontColour( const GUIHelpers::RGBA& colour ); void setFontColour( const GUIHelpers::RGBA& colour );
void setFontSize( const unsigned long int size ); void setFontSize( const unsigned long int size );
void setText( const cString& text ); void setText( const cString& text );
void setFont( const TextTypeEngine::cFont* font ); void setFont( const TextTypeEngine::cFont* font );
///Gets /// Gets
const GUIHelpers::RGBA& getFontColour() const; const GUIHelpers::RGBA& getFontColour() const;
const unsigned long int getFontSize() const; const unsigned long int getFontSize() const;
const TextTypeEngine::cFont* getFont() const; const TextTypeEngine::cFont* getFont() const;
@@ -58,7 +58,7 @@ namespace GUIEngine {
private: private:
VideoEngine::cSprite m_sprite; VideoEngine::cSprite m_sprite;
TextTypeEngine::cText* mp_text;// = nullptr TextTypeEngine::cText* mp_text;/// = nullptr
};/// END CLASS DEFINITION cLabel };/// END CLASS DEFINITION cLabel
}/// END NAMESPACE DEFINITION GUIEngine }/// END NAMESPACE DEFINITION GUIEngine
#endif/// END IFNDEF _CLABEL_HPP_ #endif/// END IFNDEF _CLABEL_HPP_
@@ -15,7 +15,7 @@ cLayout::cLayout(cWindow* parent, const signed int id, const GUIHelpers::eOrient
/*virtual*/ cLayout::~cLayout() /*virtual*/ cLayout::~cLayout()
{} {}
///Functions /// Functions
/*virtual*/ void cLayout::Create(cWindow* parent, const signed int id, const GUIHelpers::eOrientation& orientation /*= sORIENTATION*/, const GUIHelpers::eAlign& align /*= sALIGN*/, /*virtual*/ void cLayout::Create(cWindow* parent, const signed int id, const GUIHelpers::eOrientation& orientation /*= sORIENTATION*/, const GUIHelpers::eAlign& align /*= sALIGN*/,
const GUIHelpers::eLayout& layout /*= sLAYOUT*/, const GUIHelpers::Position& pos /*= sPOSITION*/, const GUIHelpers::Size& size /*= sSIZE*/, const GUIHelpers::eLayout& layout /*= sLAYOUT*/, const GUIHelpers::Position& pos /*= sPOSITION*/, const GUIHelpers::Size& size /*= sSIZE*/,
const GUIHelpers::Padding& padding/* = sPADDING*/, const cString& name /*= sNAME*/) const GUIHelpers::Padding& padding/* = sPADDING*/, const cString& name /*= sNAME*/)
@@ -34,10 +34,9 @@ cLayout::cLayout(cWindow* parent, const signed int id, const GUIHelpers::eOrient
cWindow::Display(); cWindow::Display();
} }
///Set /// Set
///Get
/// Get
/*virtual*/ const GUIHelpers::eType cLayout::getType() const /*virtual*/ const GUIHelpers::eType cLayout::getType() const
{ {
return GUIHelpers::eType::CLAYOUT; return GUIHelpers::eType::CLAYOUT;
@@ -30,16 +30,16 @@ namespace GUIEngine {
const GUIHelpers::Padding& padding = sPADDING, const cString& name = sNAME ); const GUIHelpers::Padding& padding = sPADDING, const cString& name = sNAME );
virtual ~cLayout(); virtual ~cLayout();
///Functions /// Functions
virtual void Create( cWindow* parent, const signed int id, const GUIHelpers::eOrientation& orientation = sORIENTATION, const GUIHelpers::eAlign& align = sALIGN, virtual void Create( cWindow* parent, const signed int id, const GUIHelpers::eOrientation& orientation = sORIENTATION, const GUIHelpers::eAlign& align = sALIGN,
const GUIHelpers::eLayout& layout = sLAYOUT, const GUIHelpers::Position& pos = sPOSITION, const GUIHelpers::Size& size = sSIZE, const GUIHelpers::eLayout& layout = sLAYOUT, const GUIHelpers::Position& pos = sPOSITION, const GUIHelpers::Size& size = sSIZE,
const GUIHelpers::Padding& padding = sPADDING, const cString& name = sNAME ); const GUIHelpers::Padding& padding = sPADDING, const cString& name = sNAME );
virtual void Display(); virtual void Display();
///Set /// Set
///Get /// Get
virtual const GUIHelpers::eType getType() const; virtual const GUIHelpers::eType getType() const;
virtual const GUIHelpers::RGBA& getDebugColour() const; virtual const GUIHelpers::RGBA& getDebugColour() const;
@@ -15,7 +15,7 @@ cPanel::cPanel( cWindow* parent /*= nullptr*/, const signed int id /*= -1*/, con
/*virtual*/ cPanel::~cPanel() /*virtual*/ cPanel::~cPanel()
{} {}
///Functions /// Functions
/*virtual*/ void cPanel::Create(cWindow* parent /*= nullptr*/, const signed int id /*= -1*/, const GUIHelpers::eOrientation& orientation /*= sORIENTATION*/, const GUIHelpers::eAlign& align /*= sALIGN*/, /*virtual*/ void cPanel::Create(cWindow* parent /*= nullptr*/, const signed int id /*= -1*/, const GUIHelpers::eOrientation& orientation /*= sORIENTATION*/, const GUIHelpers::eAlign& align /*= sALIGN*/,
const GUIHelpers::eLayout& layout /*= sLAYOUT*/, const GUIHelpers::Position& pos /*= sPOSITION*/, const GUIHelpers::Size& size /*= sSIZE*/, const GUIHelpers::eLayout& layout /*= sLAYOUT*/, const GUIHelpers::Position& pos /*= sPOSITION*/, const GUIHelpers::Size& size /*= sSIZE*/,
const GUIHelpers::Padding& padding /*= sPADDING*/, const cString& name /*= sNAME*/) const GUIHelpers::Padding& padding /*= sPADDING*/, const cString& name /*= sNAME*/)
@@ -25,7 +25,7 @@ namespace GUIEngine {
const GUIHelpers::Padding& padding = sPADDING, const cString& name = sNAME ); const GUIHelpers::Padding& padding = sPADDING, const cString& name = sNAME );
virtual ~cPanel(); virtual ~cPanel();
///Functions /// Functions
virtual void Create( cWindow* parent = nullptr, const signed int id = -1, const GUIHelpers::eOrientation& orientation = sORIENTATION, const GUIHelpers::eAlign& align = sALIGN, virtual void Create( cWindow* parent = nullptr, const signed int id = -1, const GUIHelpers::eOrientation& orientation = sORIENTATION, const GUIHelpers::eAlign& align = sALIGN,
const GUIHelpers::eLayout& layout = sLAYOUT, const GUIHelpers::Position& pos = sPOSITION, const GUIHelpers::Size& size = sSIZE, const GUIHelpers::eLayout& layout = sLAYOUT, const GUIHelpers::Position& pos = sPOSITION, const GUIHelpers::Size& size = sSIZE,
const GUIHelpers::Padding& padding = sPADDING, const cString& name = sNAME ); const GUIHelpers::Padding& padding = sPADDING, const cString& name = sNAME );
@@ -24,7 +24,7 @@ void cTextButton::Create(cWindow* parent, const signed int id, const cString& te
setText(text); setText(text);
} }
//Sets /// Sets
void cTextButton::setText(const cString& text) void cTextButton::setText(const cString& text)
{ {
m_label.setText(text); m_label.setText(text);
@@ -40,7 +40,7 @@ void cTextButton::setTextSize(const unsigned long int size)
m_label.setSize(size); m_label.setSize(size);
} }
///Gets /// Gets
const cString& cTextButton::getText() const const cString& cTextButton::getText() const
{ {
return m_label.getText(); return m_label.getText();
@@ -33,17 +33,17 @@ namespace GUIEngine {
const GUIHelpers::Size& size = sSIZE, const GUIHelpers::Padding& padding = sPADDING, const cString& name = sNAME); const GUIHelpers::Size& size = sSIZE, const GUIHelpers::Padding& padding = sPADDING, const cString& name = sNAME);
virtual ~cTextButton(); virtual ~cTextButton();
///Functions /// Functions
void Create(cWindow* parent, const signed int id, const cString& text, const GUIHelpers::eAlign& align = GUIHelpers::eAlign::CENTER, void Create(cWindow* parent, const signed int id, const cString& text, const GUIHelpers::eAlign& align = GUIHelpers::eAlign::CENTER,
const GUIHelpers::eLayout& layout = GUIHelpers::eLayout::FILL_PARENT, const GUIHelpers::Position& pos = sPOSITION, const GUIHelpers::eLayout& layout = GUIHelpers::eLayout::FILL_PARENT, const GUIHelpers::Position& pos = sPOSITION,
const GUIHelpers::Size& size = sSIZE, const GUIHelpers::Padding& padding = sPADDING, const cString& name = sNAME); const GUIHelpers::Size& size = sSIZE, const GUIHelpers::Padding& padding = sPADDING, const cString& name = sNAME);
//Sets /// Sets
void setText( const cString& text ); void setText( const cString& text );
void setTextColour( const GUIHelpers::RGBA& colour ); void setTextColour( const GUIHelpers::RGBA& colour );
void setTextSize( const unsigned long int size ); void setTextSize( const unsigned long int size );
///Gets /// Gets
const cString& getText() const; const cString& getText() const;
const GUIHelpers::RGBA& getTextColour(); const GUIHelpers::RGBA& getTextColour();
const unsigned long int getTextSize(); const unsigned long int getTextSize();
@@ -56,7 +56,7 @@ namespace GUIEngine {
void GenerateTexture(); void GenerateTexture();
private: private:
cLabel m_label;// = nullptr cLabel m_label;/// = nullptr
};/// END CLASS DEFINITION cButton };/// END CLASS DEFINITION cButton
}/// END NAMESPACE DEFINITION GUIEngine }/// END NAMESPACE DEFINITION GUIEngine
#endif/// END IFNDEF _CBUTTON_HPP_ #endif/// END IFNDEF _CBUTTON_HPP_
@@ -63,7 +63,7 @@ cWindow::cWindow( cWindow* parent /*= nullptr*/, const signed int id /*= -1*/, c
DebugDisplay(); DebugDisplay();
} }
///Functions /// Functions
const bool cWindow::Inside( const MathEngine::iVector2& location ) const const bool cWindow::Inside( const MathEngine::iVector2& location ) const
{ {
bool rtn = false; bool rtn = false;
@@ -96,7 +96,7 @@ const bool cWindow::RemoveChild( cWindow* obj )
return rtn; return rtn;
} }
///Sets /// Sets
/*static*/ void cWindow::PositionDefault( const GUIHelpers::Position& pos ) /*static*/ void cWindow::PositionDefault( const GUIHelpers::Position& pos )
{ {
if (pos.x >= 0) if (pos.x >= 0)
@@ -197,7 +197,7 @@ void cWindow::setParent( cWindow* parent )
mp_parent = parent; mp_parent = parent;
} }
///Gets /// Gets
const GUIHelpers::Position cWindow::getCenter( const bool pad /*= true*/ ) const const GUIHelpers::Position cWindow::getCenter( const bool pad /*= true*/ ) const
{ {
GUIHelpers::Position rtn = { 0, 0 }; GUIHelpers::Position rtn = { 0, 0 };
@@ -292,7 +292,7 @@ cWindow* cWindow::getParent()
return GUIHelpers::eType::CWINDOW; return GUIHelpers::eType::CWINDOW;
} }
///Protected /// protected
/*virtual*/ void cWindow::Resize() /*virtual*/ void cWindow::Resize()
{ {
@@ -459,14 +459,14 @@ std::vector<cWindow*>& cWindow::getChildren()
return m_children; return m_children;
} }
//private /// private
void cWindow::AddSize( int x, int y, GUIHelpers::Size& mySize ) const void cWindow::AddSize( const int x, const int y, GUIHelpers::Size& mySize ) const
{ {
int& addFrom = x; int addFrom = x;
int& largestFrom = y; int largestFrom = y;
int& addTo = mySize.x; int addTo = mySize.x;
int& largestTo = mySize.y; int largestTo = mySize.y;
if (m_orientation == GUIHelpers::eOrientation::HORIZONTAL) { if (m_orientation == GUIHelpers::eOrientation::HORIZONTAL) {
addFrom = y; addFrom = y;
@@ -45,7 +45,7 @@ namespace GUIEngine {
const GUIHelpers::Padding& padding = sPADDING, const cString& name = sNAME ); const GUIHelpers::Padding& padding = sPADDING, const cString& name = sNAME );
public: public:
///Functions /// Functions
virtual void Display(); virtual void Display();
const bool Inside( const MathEngine::iVector2& location ) const; const bool Inside( const MathEngine::iVector2& location ) const;
@@ -54,7 +54,7 @@ namespace GUIEngine {
const bool RemoveChild( cWindow* obj ); const bool RemoveChild( cWindow* obj );
///Sets /// Sets
static void PositionDefault( const GUIHelpers::Position& pos ); static void PositionDefault( const GUIHelpers::Position& pos );
static void SizeDefault( const GUIHelpers::Size& size ); static void SizeDefault( const GUIHelpers::Size& size );
static void PaddingDefault( const GUIHelpers::Padding& pad ); static void PaddingDefault( const GUIHelpers::Padding& pad );
@@ -73,7 +73,7 @@ namespace GUIEngine {
void setParent( cWindow* parent ); void setParent( cWindow* parent );
///Gets /// Gets
const GUIHelpers::Position getCenter( const bool pad = true ) const; const GUIHelpers::Position getCenter( const bool pad = true ) const;
const GUIHelpers::eOrientation& getOrientation() const; const GUIHelpers::eOrientation& getOrientation() const;
@@ -105,22 +105,22 @@ namespace GUIEngine {
private: private:
void Rebuild( cWindow* const parent, const GUIHelpers::eLayout& layout ); void Rebuild( cWindow* const parent, const GUIHelpers::eLayout& layout );
void AddSize( int x, int y, GUIHelpers::Size& mySize ) const; void AddSize( const int x, const int y, GUIHelpers::Size& mySize ) const;
void DebugDisplay() const; void DebugDisplay() const;
private: private:
GUIHelpers::eOrientation m_orientation;// = GUIHelper::eOrientation::NONE; GUIHelpers::eOrientation m_orientation;/// = GUIHelper::eOrientation::NONE;
GUIHelpers::eAlign m_align;// = GUIHelper::eAlign::CENTER; GUIHelpers::eAlign m_align;/// = GUIHelper::eAlign::CENTER;
GUIHelpers::eLayout m_layout;// = GUIHelper::eLayout::FILL_PARENT; GUIHelpers::eLayout m_layout;/// = GUIHelper::eLayout::FILL_PARENT;
GUIHelpers::Position m_pos;// = POSITION; GUIHelpers::Position m_pos;/// = POSITION;
GUIHelpers::Size m_size;// = SIZE; GUIHelpers::Size m_size;/// = SIZE;
GUIHelpers::Padding m_padding;// = PADDING; GUIHelpers::Padding m_padding;/// = PADDING;
GUIHelpers::Size m_content;// = m_size; GUIHelpers::Size m_content;/// = m_size;
cString m_name;// = NAME; cString m_name;/// = sNAME;
std::vector<cWindow*> m_children; std::vector<cWindow*> m_children;
cWindow* mp_parent;// = nullptr; cWindow* mp_parent;/// = nullptr;
};/// END CLASS DEFINITION cBoxSizer };/// END CLASS DEFINITION cBoxSizer
}/// END NAMESPACE DEFINITION GUIEngine }/// END NAMESPACE DEFINITION GUIEngine
#endif/// END IFNDEF _CBOXSIZER_HPP_ #endif/// END IFNDEF _CBOXSIZER_HPP_
@@ -8,7 +8,7 @@ using UtilityEngine::cUtility;
/*static*/ cInput* cInput::sp_inst = nullptr; /*static*/ cInput* cInput::sp_inst = nullptr;
//Private /// private
cInput::cInput() cInput::cInput()
{} {}
@@ -17,7 +17,7 @@ cInput::~cInput()
CleanUp(); CleanUp();
} }
//Public /// public
/*static*/ cInput& cInput::Inst() /*static*/ cInput& cInput::Inst()
{ {
if (sp_inst == nullptr) if (sp_inst == nullptr)
@@ -31,7 +31,7 @@ cInput::~cInput()
sp_inst = nullptr; sp_inst = nullptr;
} }
//Functions /// Functions
const bool cInput::Initialize() const const bool cInput::Initialize() const
{ {
bool rtn = IsInit(); bool rtn = IsInit();
@@ -150,9 +150,9 @@ void cInput::RemoveAllInputs()
RemoveAllKeyboards(); RemoveAllKeyboards();
} }
///Sets /// Sets
///Gets /// Gets
/* Gets return true if Input was initialized */ /* Gets return true if Input was initialized */
const bool cInput::IsInit() const const bool cInput::IsInit() const
{ {
@@ -27,7 +27,7 @@ namespace InputEngine {
static cInput& Inst(); static cInput& Inst();
static void Delete(); static void Delete();
//Functions /// Functions
const bool Initialize() const; const bool Initialize() const;
const bool Setup(); const bool Setup();
@@ -54,9 +54,9 @@ namespace InputEngine {
void DeleteAllInputs(); void DeleteAllInputs();
void RemoveAllInputs(); void RemoveAllInputs();
///Sets /// Sets
///Gets /// Gets
/* Gets return true if Input was initialized */ /* Gets return true if Input was initialized */
const bool IsInit() const; const bool IsInit() const;
@@ -17,7 +17,7 @@ namespace InputEngine {
cJoystick(); cJoystick();
virtual ~cJoystick(); virtual ~cJoystick();
///Functions /// Functions
virtual void OnEvent(const SDL_Event& event); virtual void OnEvent(const SDL_Event& event);
virtual void OnJoyAxis(SDL_JoystickID which, Uint8 axis, Sint16 value); virtual void OnJoyAxis(SDL_JoystickID which, Uint8 axis, Sint16 value);
@@ -30,7 +30,7 @@ namespace InputEngine {
virtual void OnJoyBall(SDL_JoystickID which, Uint8 ball, Sint16 xrel, Sint16 yrel); virtual void OnJoyBall(SDL_JoystickID which, Uint8 ball, Sint16 xrel, Sint16 yrel);
//Used when looking for keys that have been add to the check list /// Used when looking for keys that have been add to the check list
void JoystickCheck(); void JoystickCheck();
};/// END CLASS DEFINITION cJoystick };/// END CLASS DEFINITION cJoystick
@@ -16,7 +16,7 @@ cKey::cKey( const cKey& copy )
/*virtual*/ cKey::~cKey() /*virtual*/ cKey::~cKey()
{} {}
///Funtions /// Funtions
/*virtual*/ void cKey::KeyPress() /*virtual*/ void cKey::KeyPress()
{} {}
@@ -26,13 +26,13 @@ cKey::cKey( const cKey& copy )
/*virtual*/ void cKey::KeyDown() /*virtual*/ void cKey::KeyDown()
{} {}
///Sets /// Sets
void cKey::setKey( const SDL_Keycode& key ) void cKey::setKey( const SDL_Keycode& key )
{ {
m_key = key; m_key = key;
} }
///Gets /// Gets
const SDL_Keycode& cKey::getKey() const const SDL_Keycode& cKey::getKey() const
{ {
return m_key; return m_key;
@@ -15,7 +15,7 @@ namespace InputEngine {
cKey( const cKey& copy ); cKey( const cKey& copy );
virtual ~cKey(); virtual ~cKey();
///Funtions /// Funtions
/* Call to check if the key is pressed */ /* Call to check if the key is pressed */
virtual void KeyPress(); virtual void KeyPress();
/* Call to check if the key is released */ /* Call to check if the key is released */
@@ -23,10 +23,10 @@ namespace InputEngine {
/* Call to check if the key is pressed */ /* Call to check if the key is pressed */
virtual void KeyDown(); virtual void KeyDown();
///Sets /// Sets
void setKey( const SDL_Keycode& key ); void setKey( const SDL_Keycode& key );
///Gets /// Gets
const SDL_Keycode& getKey() const; const SDL_Keycode& getKey() const;
private: private:
@@ -15,7 +15,7 @@ cKeyboard::cKeyboard( const cKeyboard& copy )
DeleteAllKeys(); DeleteAllKeys();
} }
///Functions /// Functions
/*virtual*/ void cKeyboard::KeyboardCheck( const SDL_Event& event ) /*virtual*/ void cKeyboard::KeyboardCheck( const SDL_Event& event )
{ {
SDL_Keycode key = event.key.keysym.sym; SDL_Keycode key = event.key.keysym.sym;
@@ -65,7 +65,8 @@ void cKeyboard::DeleteAllKeys()
m_keys.clear(); m_keys.clear();
} }
///Sets /// Sets
/// Gets
const cString& cKeyboard::getLabel() const const cString& cKeyboard::getLabel() const
{ {
return m_label; return m_label;
@@ -32,9 +32,9 @@ namespace InputEngine {
cKeyboard( const cKeyboard& copy ); cKeyboard( const cKeyboard& copy );
virtual ~cKeyboard(); virtual ~cKeyboard();
///Funtions /// Functions
//Used when looking for keys that have been add to the check list /// Used when looking for keys that have been add to the check list
virtual void KeyboardCheck( const SDL_Event& event ); virtual void KeyboardCheck( const SDL_Event& event );
void AddKey( InputEngine::cKey* key ); void AddKey( InputEngine::cKey* key );
@@ -42,12 +42,12 @@ namespace InputEngine {
void DeleteAllKeys(); void DeleteAllKeys();
///Sets /// Sets
///Gets /// Gets
const cString& getLabel() const; const cString& getLabel() const;
private: private:
cString m_label;// = "" cString m_label;/// = ""
std::vector<InputEngine::cKey*> m_keys; std::vector<InputEngine::cKey*> m_keys;
};/// END CLASS DEFINITION cKeyboard };/// END CLASS DEFINITION cKeyboard
@@ -3,7 +3,7 @@
using InputEngine::cTextInput; using InputEngine::cTextInput;
cTextInput::cTextInput() cTextInput::cTextInput()
: cKeyboard("TextInput"), m_text(""), m_caps(false), m_shift(false), INTERNATIONAL_MASK(0xFF80), UNICODE_MASK(0x7F) : cKeyboard("TextInput"), m_text(""), m_caps(false), m_shift(false), INTERNATIONAL_MASK(0xFF80), UNICODE_MASK(0x7F)
{ {
/*if (SDL_EnableUNICODE(SDL_QUERY) != SDL_ENABLE) { /*if (SDL_EnableUNICODE(SDL_QUERY) != SDL_ENABLE) {
SDL_EnableUNICODE(SDL_ENABLE); SDL_EnableUNICODE(SDL_ENABLE);
@@ -21,7 +21,7 @@ cTextInput::cTextInput( const cTextInput& copy )
/*virtual*/ cTextInput::~cTextInput() /*virtual*/ cTextInput::~cTextInput()
{} {}
///Functions /// Functions
/* */ /* */
/*virtual*/ void cTextInput::KeyboardCheck( const SDL_Event& event ) /*virtual*/ void cTextInput::KeyboardCheck( const SDL_Event& event )
{ {
@@ -49,19 +49,19 @@ void cTextInput::ClearText()
m_text = ""; m_text = "";
} }
///Sets /// Sets
void cTextInput::setText( const cString& text ) void cTextInput::setText( const cString& text )
{ {
m_text = text; m_text = text;
} }
///Gets /// Gets
const cString& cTextInput::getText() const const cString& cTextInput::getText() const
{ {
return m_text; return m_text;
} }
//Private /// private
const char cTextInput::UnicodeValue( const SDL_Event& event ) const char cTextInput::UnicodeValue( const SDL_Event& event )
{ {
event; event;
@@ -24,27 +24,27 @@ namespace InputEngine {
cTextInput( const cTextInput& copy ); cTextInput( const cTextInput& copy );
virtual ~cTextInput(); virtual ~cTextInput();
///Functions /// Functions
/* */ /* */
virtual void KeyboardCheck( const SDL_Event& event ); virtual void KeyboardCheck( const SDL_Event& event );
/* Clears out the Text */ /* Clears out the Text */
void ClearText(); void ClearText();
///Sets /// Sets
void setText( const cString& text ); void setText( const cString& text );
///Gets /// Gets
const cString& getText() const; const cString& getText() const;
private: private:
const char UnicodeValue( const SDL_Event& event ); const char UnicodeValue( const SDL_Event& event );
private: private:
cString m_text;// = "" cString m_text;/// = ""
bool m_caps;// = false bool m_caps;/// = false
bool m_shift;// = false bool m_shift;/// = false
// magic numbers courtesy of SDL docs /// magic numbers courtesy of SDL docs
const unsigned long int INTERNATIONAL_MASK;// = 0xFF80 const unsigned long int INTERNATIONAL_MASK;/// = 0xFF80
const unsigned long int UNICODE_MASK;// = 0x7F const unsigned long int UNICODE_MASK;/// = 0x7F
};/// END CLASS DEFINITION cTextInput };/// END CLASS DEFINITION cTextInput
}/// END NAMESPACE DEFINITION InputEngine }/// END NAMESPACE DEFINITION InputEngine
#endif/// END IFNDEF _CTEXTINPUT_HPP_ #endif/// END IFNDEF _CTEXTINPUT_HPP_
@@ -14,6 +14,7 @@ cCollision::~cCollision()
{ {
} }
/// Functions
/*static*/ const bool cCollision::BoundingBox( const SDL_Rect& a, const SDL_Rect& b ) /*static*/ const bool cCollision::BoundingBox( const SDL_Rect& a, const SDL_Rect& b )
{ {
if ((b.x + b.w) < a.x) if ((b.x + b.w) < a.x)
@@ -21,7 +21,7 @@ namespace MathEngine {
cCollision(); cCollision();
~cCollision(); ~cCollision();
public: public:
///Functions /// Functions
static const bool BoundingBox( const SDL_Rect& a, const SDL_Rect& b ); static const bool BoundingBox( const SDL_Rect& a, const SDL_Rect& b );
static const bool BoundingBox( const Vector4& a, const Vector4& b ); static const bool BoundingBox( const Vector4& a, const Vector4& b );
static const bool BoundingBox( const SDL_Rect& a, const Vector4& b ); static const bool BoundingBox( const SDL_Rect& a, const Vector4& b );
@@ -16,6 +16,7 @@ cRandom::cRandom()
cRandom::~cRandom() cRandom::~cRandom()
{} {}
/// Functions
/*static*/ cRandom& cRandom::Inst() /*static*/ cRandom& cRandom::Inst()
{ {
if (sp_inst == nullptr) if (sp_inst == nullptr)
@@ -16,7 +16,7 @@ namespace MathEngine {
~cRandom(); ~cRandom();
public: public:
///Functions /// Functions
static cRandom& Inst(); static cRandom& Inst();
static void Delete(); static void Delete();
@@ -26,7 +26,7 @@ namespace MathEngine {
const float Rand( const float max, const float min = 0.0f ) const; const float Rand( const float max, const float min = 0.0f ) const;
private: private:
static cRandom* sp_inst;// = nullptr static cRandom* sp_inst;/// = nullptr
};/// END CLASS DEFINITION cRandom };/// END CLASS DEFINITION cRandom
}/// END NAMESPACE DEFINITION MathEngine }/// END NAMESPACE DEFINITION MathEngine
#endif/// END IFNDEF _CRANDOM_HPP_ #endif/// END IFNDEF _CRANDOM_HPP_
@@ -3,7 +3,7 @@
/*** SDL Header Files ***/ /*** SDL Header Files ***/
#include <SDL.h> #include <SDL.h>
///#include <SDL/SDL_net.h> ///For networking ///#include <SDL/SDL_net.h> /// For networking
/*** DLL Header File ***/ /*** DLL Header File ***/
#include "dllExport.h" #include "dllExport.h"
@@ -14,15 +14,15 @@ namespace TextTypeHelpers {
public: public:
cFontHolder( TTF_Font* font, const unsigned long int size ); cFontHolder( TTF_Font* font, const unsigned long int size );
~cFontHolder(); ~cFontHolder();
///Sets
/// Sets
///Gets /// Gets
TTF_Font* getFont() const; TTF_Font* getFont() const;
const unsigned long int getSize() const; const unsigned long int getSize() const;
private: private:
TTF_Font* mp_font;// = nullptr TTF_Font* mp_font;/// = nullptr
unsigned long int m_size;// = 16 unsigned long int m_size;/// = 16
};/// END CLASS DEFINITION cFontHolder };/// END CLASS DEFINITION cFontHolder
}/// END NAMESPACE DEFINITION TextTypeHelpers }/// END NAMESPACE DEFINITION TextTypeHelpers
#endif/// END IFNDEF _CFONTHOLDER_HPP_ #endif/// END IFNDEF _CFONTHOLDER_HPP_
@@ -24,8 +24,8 @@ cFont::~cFont()
UnloadFont(); UnloadFont();
} }
///Functions /// Functions
///Sets /// Sets
void cFont::setDir( const cString& dir ) void cFont::setDir( const cString& dir )
{ {
m_dir = dir; m_dir = dir;
@@ -50,7 +50,7 @@ void cFont::setSize( const unsigned long int size /*= 16*/ )
} }
} }
///Gets /// Gets
const cString& cFont::getDir() const const cString& cFont::getDir() const
{ {
return m_dir; return m_dir;
@@ -84,7 +84,23 @@ TTF_Font* cFont::getFont( const unsigned long int size )
return rtn; return rtn;
} }
//private: bool cFont::operator == ( const cFont& rhs ) const
{
if ((this->m_dir == rhs.getDir()) && (this->m_fileName == rhs.getFileName()) && (this->getSize() == rhs.getSize()))
return true;
else
return false;
}
bool cFont::operator != ( const cFont& rhs ) const
{
if (*this == rhs)
return false;
else
return true;
}
/// private:
TTF_Font* cFont::LoadFont( const unsigned long int size ) TTF_Font* cFont::LoadFont( const unsigned long int size )
{ {
TTF_Font* rtn = nullptr; TTF_Font* rtn = nullptr;
@@ -28,14 +28,14 @@ namespace TextTypeEngine {
class EXPORT_FROM_MYDLL cFont class EXPORT_FROM_MYDLL cFont
{ {
public: public:
cFont(const cString& filename = "", const cString& dir = "", const unsigned long int size = 16 ); cFont( const cString& filename = "", const cString& dir = "", const unsigned long int size = 16 );
cFont( const cFont& copy ); cFont( const cFont& copy );
~cFont(); ~cFont();
///Functions /// Functions
///Sets /// Sets
/* Sets the Directory of the TTF file */ /* Sets the Directory of the TTF file */
void setDir( const cString& dir ); void setDir( const cString& dir );
/* Sets the Filename of the TTF file */ /* Sets the Filename of the TTF file */
@@ -45,7 +45,7 @@ namespace TextTypeEngine {
/* Sets the size of the TTF. Default is 16 */ /* Sets the size of the TTF. Default is 16 */
void setSize( const unsigned long int size = 16 ); void setSize( const unsigned long int size = 16 );
///Gets /// Gets
/* Gets the Directory of the TTF file */ /* Gets the Directory of the TTF file */
const cString& getDir() const; const cString& getDir() const;
/* Gets the Filename of the TTF file */ /* Gets the Filename of the TTF file */
@@ -56,6 +56,10 @@ namespace TextTypeEngine {
TTF_Font* getFont(); TTF_Font* getFont();
/* Gets the TTF_Font. */ /* Gets the TTF_Font. */
TTF_Font* getFont( const unsigned long int size ); TTF_Font* getFont( const unsigned long int size );
/// operators
bool operator == ( const cFont& rhs ) const;
bool operator != ( const cFont& rhs ) const;
private: private:
TTF_Font* LoadFont( const unsigned long int size ); TTF_Font* LoadFont( const unsigned long int size );
@@ -66,9 +70,9 @@ namespace TextTypeEngine {
std::vector<TextTypeHelpers::cFontHolder*> m_fonts; std::vector<TextTypeHelpers::cFontHolder*> m_fonts;
//cFontHolder m_fonts; //cFontHolder m_fonts;
//cFont::cFontHolder m_fonts; //cFont::cFontHolder m_fonts;
TextTypeHelpers::cFontHolder** mpp_default; TextTypeHelpers::cFontHolder** mpp_default;/// = nullptr
cString m_dir;// = "" cString m_dir;/// = ""
cString m_fileName;// = "" cString m_fileName;/// = ""
};/// END CLASS DEFINITION cFont };/// END CLASS DEFINITION cFont
}/// END NAMESPACE DEFINITION TextTypeEngine }/// END NAMESPACE DEFINITION TextTypeEngine
@@ -43,7 +43,7 @@ cText::cText( const cText& copy )
cText::~cText() cText::~cText()
{} {}
///Function /// Function
void cText::White() void cText::White()
{ {
setColour(255, 255, 255); setColour(255, 255, 255);
@@ -69,18 +69,22 @@ void cText::Red()
setColour(255); setColour(255);
} }
///Sets /// Sets
void cText::setSize(const unsigned long int size /*= 8*/) void cText::setSize(const unsigned long int size /*= 8*/)
{ {
m_size = size; if (m_size != size) {
if ((mpp_font != nullptr) && ((*mpp_font) != nullptr)) m_size = size;
(*mpp_font)->setSize(size); if ((mpp_font != nullptr) && ((*mpp_font) != nullptr))
(*mpp_font)->setSize(size);
}
} }
void cText::setFont( TextTypeEngine::cFont** font ) void cText::setFont( TextTypeEngine::cFont** font )
{ {
mpp_font = font; if ((*mpp_font) != (*font)) {
Text(); mpp_font = font;
Text();
}
} }
void cText::setText( const cString& text ) void cText::setText( const cString& text )
@@ -93,8 +97,10 @@ void cText::setText( const cString& text )
void cText::setColour( const SDL_Colour& colour ) void cText::setColour( const SDL_Colour& colour )
{ {
m_colour = colour; if ((colour.a != m_colour.a) || (colour.b != m_colour.b) || (colour.g != m_colour.g) || (colour.r != m_colour.r)){
Text(); m_colour = colour;
Text();
}
} }
void cText::setColour( const unsigned long int red /*= 0*/, const unsigned long int green /*= 0*/, const unsigned long int blue /*= 0*/, unsigned long int alpha /*= 255*/ ) void cText::setColour( const unsigned long int red /*= 0*/, const unsigned long int green /*= 0*/, const unsigned long int blue /*= 0*/, unsigned long int alpha /*= 255*/ )
@@ -105,11 +111,13 @@ void cText::setColour( const unsigned long int red /*= 0*/, const unsigned long
void cText::setRender( const eRender& render /*= eRender::Solid*/ ) void cText::setRender( const eRender& render /*= eRender::Solid*/ )
{ {
m_render = render; if (m_render != render) {
Text(); m_render = render;
Text();
}
} }
///Gets /// Gets
const unsigned long int cText::getSize() const const unsigned long int cText::getSize() const
{ {
unsigned long int rtn = m_size; unsigned long int rtn = m_size;
@@ -146,7 +154,7 @@ const cText::eRender& cText::getRender() const
return m_render; return m_render;
} }
//Private /// private
void cText::Text() void cText::Text()
{ {
if((mpp_font != nullptr) && (*mpp_font != nullptr)) { if((mpp_font != nullptr) && (*mpp_font != nullptr)) {
@@ -169,7 +177,7 @@ void cText::Text()
} else { } else {
SDL_Rect pos = { 0, 0, 0, 0 }; SDL_Rect pos = { 0, 0, 0, 0 };
//m_size == 25; //m_size == 25;
SDL_Texture* texture = cRenderer::Inst().NewTexture(8 * m_text.length(), 8, SDL_TEXTUREACCESS_TARGET); SDL_Texture* texture = cRenderer::Inst().NewTexture(8 * m_text.length(), 8, false, SDL_TEXTUREACCESS_TARGET);
SDL_SetTextureBlendMode(texture, SDL_BLENDMODE_BLEND); SDL_SetTextureBlendMode(texture, SDL_BLENDMODE_BLEND);
//int t = SDL_SetTextureColorMod(texture, 0, 255, 0); //int t = SDL_SetTextureColorMod(texture, 0, 255, 0);
@@ -38,7 +38,7 @@ namespace TextTypeEngine {
~cText(); ~cText();
///Function /// Function
/* Change the colour of the text to White */ /* Change the colour of the text to White */
void White(); void White();
@@ -51,7 +51,7 @@ namespace TextTypeEngine {
/* Change the colour of the text to Red */ /* Change the colour of the text to Red */
void Red(); void Red();
///Sets /// Sets
/* Sets the Size */ /* Sets the Size */
void setSize( const unsigned long int size = 8 ); void setSize( const unsigned long int size = 8 );
void setFont( cFont** font ); void setFont( cFont** font );
@@ -64,7 +64,7 @@ namespace TextTypeEngine {
/* Sets the render of the text. Default is Solid */ /* Sets the render of the text. Default is Solid */
void setRender( const eRender& render = eRender::Solid ); void setRender( const eRender& render = eRender::Solid );
///Gets /// Gets
/* Gets the Size */ /* Gets the Size */
const unsigned long int getSize() const; const unsigned long int getSize() const;
cFont* getFont() const; cFont* getFont() const;
@@ -81,12 +81,12 @@ namespace TextTypeEngine {
void Text(); void Text();
private: private:
TextTypeEngine::cFont** mpp_font; TextTypeEngine::cFont** mpp_font;/// = nullptr
cString m_text;// = "" cString m_text;/// = ""
unsigned long int m_size;// = 16 unsigned long int m_size;// = 16
SDL_Colour m_colour;// = nullptr SDL_Colour m_colour;/// = nullptr
eRender m_render;// = Solid eRender m_render;/// = Solid
};/// END CLASS DEFINITION cText };/// END CLASS DEFINITION cText
}/// END NAMESPACE DEFINITION TextTypeEngine }/// END NAMESPACE DEFINITION TextTypeEngine
#endif/// END IFNDEF _CTEXT_HPP_ #endif/// END IFNDEF _CTEXT_HPP_
@@ -8,7 +8,7 @@ using UtilityEngine::cUtility;
/*static*/ cTextType* cTextType::sp_inst = nullptr; /*static*/ cTextType* cTextType::sp_inst = nullptr;
//private /// private
cTextType::cTextType() cTextType::cTextType()
{ {
} }
@@ -19,8 +19,8 @@ cTextType::~cTextType()
TTF_Quit(); TTF_Quit();
} }
//public: /// public:
///Functions /// Functions
/*static*/ cTextType& cTextType::Inst() /*static*/ cTextType& cTextType::Inst()
{ {
if (sp_inst == nullptr) if (sp_inst == nullptr)
@@ -70,8 +70,8 @@ void cTextType::PrintVersion() const
cUtility::Inst().PrintVersion(cUtility::eTypeSDL::TTF); cUtility::Inst().PrintVersion(cUtility::eTypeSDL::TTF);
} }
///Sets /// Sets
///Gets /// Gets
const bool cTextType::IsInit() const const bool cTextType::IsInit() const
{ {
bool rtn = false; bool rtn = false;
@@ -17,7 +17,7 @@ namespace TextTypeEngine {
~cTextType(); ~cTextType();
public: public:
///Functions /// Functions
static cTextType& Inst(); static cTextType& Inst();
static void Delete(); static void Delete();
@@ -28,13 +28,13 @@ namespace TextTypeEngine {
void PrintVersion() const; void PrintVersion() const;
///Sets /// Sets
///Gets /// Gets
/* Gets return true if Text was initialized */ /* Gets return true if Text was initialized */
const bool IsInit() const; const bool IsInit() const;
private: private:
static cTextType* sp_inst;// = nullptr static cTextType* sp_inst;/// = nullptr
};/// END CLASS DEFINITION cTextType };/// END CLASS DEFINITION cTextType
}/// END NAMESPACE DEFINITION TextTypeEngine }/// END NAMESPACE DEFINITION TextTypeEngine
#endif/// END IFNDEF _CTEXTTYPE_HPP_ #endif/// END IFNDEF _CTEXTTYPE_HPP_
@@ -27,7 +27,7 @@ cTiming& cTiming::operator=( const cTiming& copy )
return *this; return *this;
} }
///Functions /// Functions
/*static*/ cTiming& cTiming::Inst() /*static*/ cTiming& cTiming::Inst()
{ {
if (sp_inst == nullptr) if (sp_inst == nullptr)
@@ -94,7 +94,7 @@ const float/*unsigned long int*/ cTiming::FrameTime()
return (float)(thisTime - m_lastTime) / m_ftp; return (float)(thisTime - m_lastTime) / m_ftp;
} }
///Sets /// Sets
void cTiming::setFTP( const unsigned long int ftp /*= 30*/ ) void cTiming::setFTP( const unsigned long int ftp /*= 30*/ )
{ {
m_ftp = ftp; m_ftp = ftp;
@@ -102,7 +102,7 @@ void cTiming::setFTP( const unsigned long int ftp /*= 30*/ )
Setup(); Setup();
} }
///Gets /// Gets
const unsigned long int cTiming::getFTP() const const unsigned long int cTiming::getFTP() const
{ {
return m_ftp; return m_ftp;
@@ -126,8 +126,8 @@ const float cTiming::getFrameTime() const
return m_frameTime; return m_frameTime;
} }
///Private /// private
///Functions /// Functions
const unsigned long int cTiming::TimeLeft() const unsigned long int cTiming::TimeLeft()
{ {
unsigned long int now = SDL_GetTicks(); unsigned long int now = SDL_GetTicks();
@@ -23,7 +23,7 @@ namespace TimingEngine {
public: public:
cTiming& operator=( const cTiming& copy ); cTiming& operator=( const cTiming& copy );
///Functions /// Functions
static cTiming& Inst(); static cTiming& Inst();
static void Delete(); static void Delete();
@@ -34,9 +34,9 @@ namespace TimingEngine {
/* Sleeps if need */ /* Sleeps if need */
void Time(); void Time();
///Sets /// Sets
void setFTP( const unsigned long int ftp = 30 ); void setFTP( const unsigned long int ftp = 30 );
///Gets /// Gets
const unsigned long int getFTP() const; const unsigned long int getFTP() const;
/* Gets return true if Timer was initialized */ /* Gets return true if Timer was initialized */
const bool IsInit() const; const bool IsInit() const;
@@ -51,18 +51,18 @@ namespace TimingEngine {
const float FrameTime(); const float FrameTime();
private: private:
///Variables /// Variables
unsigned long int m_nextTime;// = 0 unsigned long int m_nextTime;/// = 0
unsigned long int m_rate;// = (1000 / m_ftp) unsigned long int m_rate;/// = (1000 / m_ftp)
unsigned long int m_ftp;// = 30 unsigned long int m_ftp;/// = 30
static cTiming* sp_inst;// = nullptr static cTiming* sp_inst;/// = nullptr
unsigned long int m_start;// = 0 unsigned long int m_start;/// = 0
float m_lastTime;// = 0.0 float m_lastTime;/// = 0.0
float m_frameTime;// = 0.0 float m_frameTime;/// = 0.0
};/// END CLASS DEFINITION cTiming };/// END CLASS DEFINITION cTiming
}/// END NAMESPACE DEFINITION TimingEngine }/// END NAMESPACE DEFINITION TimingEngine
#endif/// END IFNDEF _CTIMING_HPP_ #endif/// END IFNDEF _CTIMING_HPP_
@@ -43,7 +43,7 @@ cTrooperEngineCore::~cTrooperEngineCore()
GUIEngine::cGUI::Delete(); GUIEngine::cGUI::Delete();
} }
///Functions /// Functions
/*static*/ const char* cTrooperEngineCore::Version() /*static*/ const char* cTrooperEngineCore::Version()
{ {
return __TROOPERENGINE__VERSION; return __TROOPERENGINE__VERSION;
@@ -113,7 +113,7 @@ void cTrooperEngineCore::CleanUp()
EventEngine::cEventControl::Inst().CleanUp(); EventEngine::cEventControl::Inst().CleanUp();
} }
///Gets /// Gets
const bool cTrooperEngineCore::getVideo() const const bool cTrooperEngineCore::getVideo() const
{ {
return VideoEngine::cVideo::Inst().IsInit(); return VideoEngine::cVideo::Inst().IsInit();
@@ -18,7 +18,7 @@ namespace TrooperEngineCore {
~cTrooperEngineCore(); ~cTrooperEngineCore();
public: public:
///Functions /// Functions
static const char* Version(); static const char* Version();
static cTrooperEngineCore& Inst(); static cTrooperEngineCore& Inst();
static void Delete(); static void Delete();
@@ -44,7 +44,7 @@ namespace TrooperEngineCore {
/* Cleans up */ /* Cleans up */
void CleanUp(); void CleanUp();
///Gets /// Gets
/* Gets returns true if Video was initiated other wise it returns false */ /* Gets returns true if Video was initiated other wise it returns false */
const bool getVideo() const; const bool getVideo() const;
/* Gets returns true if Audio was initiated other wise it returns false */ /* Gets returns true if Audio was initiated other wise it returns false */
@@ -61,8 +61,8 @@ namespace TrooperEngineCore {
const bool getEvent() const; const bool getEvent() const;
private: private:
///Variables /// Variables
static cTrooperEngineCore* sp_inst;// = nullptr static cTrooperEngineCore* sp_inst;/// = nullptr
};/// END CLASS DEFINITION cTrooperEngineCore };/// END CLASS DEFINITION cTrooperEngineCore
}/// END NAMESPACE DEFINITION TroopperENgineCore }/// END NAMESPACE DEFINITION TroopperENgineCore
#endif/// END IFNDEF _CTROOPERENGINECORE_HPP_ #endif/// END IFNDEF _CTROOPERENGINECORE_HPP_
@@ -4,9 +4,9 @@
#include <stdlib.h> /* strtol */ #include <stdlib.h> /* strtol */
#ifdef _MSC_VER #ifdef _MSC_VER
// disable _s warnings /// disable _s warnings
# define _CRT_SECURE_NO_WARNINGS # define _CRT_SECURE_NO_WARNINGS
// disable pragma warnings /// disable pragma warnings
# pragma warning( disable : 4068 ) # pragma warning( disable : 4068 )
# pragma warning( disable : 4996 ) # pragma warning( disable : 4996 )
# include "MSUNIX/msunix.hpp" # include "MSUNIX/msunix.hpp"
@@ -86,7 +86,7 @@ size_t cString::size() const
return m_len; return m_len;
} }
// string format /// string format
cString& cString::format(const char* format, ...) cString& cString::format(const char* format, ...)
{ {
char * buffer; char * buffer;
@@ -100,7 +100,7 @@ cString& cString::format(const char* format, ...)
return *this; return *this;
} }
// trim leading and trailing spaces /// trim leading and trailing spaces
cString& cString::trim() cString& cString::trim()
{ {
const static char * whitespace = "\x20\x1b\t\r\n\v\b\f\a"; const static char * whitespace = "\x20\x1b\t\r\n\v\b\f\a";
@@ -164,7 +164,7 @@ const char& cString::last_char() const
return mp_str[length() - 1]; return mp_str[length() - 1];
} }
// non-destructive split /// non-destructive split
const std::vector<cString> cString::split(const char match) const const std::vector<cString> cString::split(const char match) const
{ {
const char match_s[2] = { match, 0 }; const char match_s[2] = { match, 0 };
@@ -185,14 +185,14 @@ const std::vector<cString> cString::split(const char* match, int max_split) cons
if (match_len >= __cString__MAX_LEN) if (match_len >= __cString__MAX_LEN)
return rtn; return rtn;
char* mi; // match index char* mi; /// match index
char* pstr = mp_str; // string pointer char* pstr = mp_str; /// string pointer
while ((mi = strstr(pstr, match)) && (max_split < 0 || --max_split)) { while ((mi = strstr(pstr, match)) && (max_split < 0 || --max_split)) {
if (mi != pstr) { if (mi != pstr) {
size_t lhsz = mi - pstr; size_t lhsz = mi - pstr;
char* cslhs = (char *)malloc(lhsz + 1); char* cslhs = (char *)malloc(lhsz + 1);
cslhs[lhsz] = '\0'; // strncpy doesn't terminate it cslhs[lhsz] = '\0'; /// strncpy doesn't terminate it
rtn.emplace_back(strncpy(cslhs, pstr, lhsz)); // calls cString copy ctor rtn.emplace_back(strncpy(cslhs, pstr, lhsz)); /// calls cString copy ctor
pstr += lhsz; pstr += lhsz;
free(cslhs); free(cslhs);
} }
@@ -22,17 +22,17 @@ namespace UtilityEngine {
class EXPORT_FROM_MYDLL cString class EXPORT_FROM_MYDLL cString
{ {
public: public:
cString(); // default constructor cString(); /// default constructor
cString(const char* s); cString(const char* s);
cString(const cString& copy); // copy constructor cString(const cString& copy); /// copy constructor
~cString(); ~cString();
const char* alloc_str(size_t sz); /// smart alloc string
void clear(); /// frees the string
const char* c_str() const; /// getter
const char* copy_str(const char* copy); /// alloc & copy
const char* alloc_str(size_t sz); // smart alloc string /// utility methods
void clear(); // frees the string
const char* c_str() const; // getter
const char* copy_str(const char* copy); // alloc & copy
// utility methods
bool have_value() const; bool have_value() const;
size_t length() const; size_t length() const;
size_t size() const; size_t size() const;
@@ -54,14 +54,14 @@ namespace UtilityEngine {
const bool IsInt() const; const bool IsInt() const;
const long int ToInt() const; const long int ToInt() const;
// operators /// operators
cString& operator = (const char* rhs); // assignment operator cString& operator = (const char* rhs); /// assignment operator
cString& operator = (const cString& rhs); // assignment operator cString& operator = (const cString& rhs); /// assignment operator
cString& operator += (const char rhs); cString& operator += (const char rhs);
cString& operator += (const char* rhs); // concatenation operator cString& operator += (const char* rhs); /// concatenation operator
cString& operator += (const cString& rhs); // concatenation operator cString& operator += (const cString& rhs); /// concatenation operator
bool operator == (const char* rhs) const; // comparisons bool operator == (const char* rhs) const; /// comparisons
bool operator == (const cString& rhs) const; bool operator == (const cString& rhs) const;
bool operator != (const char* rhs) const; bool operator != (const char* rhs) const;
bool operator != (const cString& rhs) const; bool operator != (const cString& rhs) const;
@@ -70,16 +70,16 @@ namespace UtilityEngine {
bool operator >= (const cString& rhs) const; bool operator >= (const cString& rhs) const;
bool operator <= (const cString& rhs) const; bool operator <= (const cString& rhs) const;
// conversion operators /// conversion operators
operator const char* () const; // c-string type operator const char* () const; /// c-string type
operator std::string () const; // c++ string class operator std::string () const; /// c++ string class
private: private:
char* mp_str = nullptr; char* mp_str = nullptr;
size_t m_len = 0; size_t m_len = 0;
};/// END CLASS DEFINITION cString };/// END CLASS DEFINITION cString
// function overloads
}/// END NAMESPACE DEFINITION UtilityEngine }/// END NAMESPACE DEFINITION UtilityEngine
/// function overloads
UtilityEngine::cString operator + (const UtilityEngine::cString& lhs, const UtilityEngine::cString& rhs); UtilityEngine::cString operator + (const UtilityEngine::cString& lhs, const UtilityEngine::cString& rhs);
#endif/// END IFNDEF _CSTRING_HPP_ #endif/// END IFNDEF _CSTRING_HPP_
@@ -11,14 +11,14 @@ using UtilityEngine::cUtility;
/*static*/ cUtility* cUtility::sp_inst = nullptr; /*static*/ cUtility* cUtility::sp_inst = nullptr;
//private: /// private:
cUtility::cUtility() cUtility::cUtility()
{} {}
cUtility::~cUtility() cUtility::~cUtility()
{} {}
//public: /// public:
// cUtility& cUtility::operator=( const cUtility& copy ) // cUtility& cUtility::operator=( const cUtility& copy )
// { // {
// if (this != &copy) // if (this != &copy)
@@ -28,7 +28,7 @@ cUtility::~cUtility()
// return *this; // return *this;
// } // }
///Functions /// Functions
/*static*/ cUtility& cUtility::Inst() /*static*/ cUtility& cUtility::Inst()
{ {
if (sp_inst == nullptr) if (sp_inst == nullptr)
@@ -124,8 +124,8 @@ void cUtility::PrintVersion( const eTypeSDL typeSDL /*= eTypeSDL::ALL*/ ) const
} }
} }
///Private: /// private:
///Functions /// Functions
void cUtility::VersionParser( const cString& runCompiled, const SDL_version& version, const cString& type ) const void cUtility::VersionParser( const cString& runCompiled, const SDL_version& version, const cString& type ) const
{ {
fprintf(stderr, "%s with %s version: %u.%u.%u \n", runCompiled.c_str(), type.c_str(), version.major, version.minor, version.patch); fprintf(stderr, "%s with %s version: %u.%u.%u \n", runCompiled.c_str(), type.c_str(), version.major, version.minor, version.patch);
@@ -2,7 +2,7 @@
#define _CUTILITY_HPP_ #define _CUTILITY_HPP_
/*** ANSI C Header Files ***/ /*** ANSI C Header Files ***/
#include <stdio.h> //for __FUNCTION__ #include <stdio.h> /// for __FUNCTION__
#ifndef __FUNCTION__ #ifndef __FUNCTION__
# define __FUNCTION__ __func__ # define __FUNCTION__ __func__
@@ -42,7 +42,7 @@ namespace UtilityEngine {
~cUtility(); ~cUtility();
public: public:
///Functions /// Functions
static cUtility& Inst(); static cUtility& Inst();
static void Delete(); static void Delete();
@@ -51,12 +51,12 @@ namespace UtilityEngine {
void PrintVersion( const eTypeSDL typeSDL = eTypeSDL::ALL ) const; void PrintVersion( const eTypeSDL typeSDL = eTypeSDL::ALL ) const;
private: private:
///Functions /// Functions
void VersionParser( const cString& runCompiled, const SDL_version& version, const cString& type ) const; void VersionParser( const cString& runCompiled, const SDL_version& version, const cString& type ) const;
private: private:
///Variables /// Variables
static cUtility* sp_inst;// = nullptr static cUtility* sp_inst;/// = nullptr
};/// END CLASS DEFINITION cUtility };/// END CLASS DEFINITION cUtility
}/// END NAMESPACE DEFINITION UtilityEngine }/// END NAMESPACE DEFINITION UtilityEngine
#endif/// END IFNDEF _CUTILITY_HPP_ #endif/// END IFNDEF _CUTILITY_HPP_
@@ -21,7 +21,7 @@ cAnimatedSprite::~cAnimatedSprite()
{ {
} }
///Functions /// Functions
void cAnimatedSprite::UptoDown() void cAnimatedSprite::UptoDown()
{ {
//if (TimeLeft() == 0) //if (TimeLeft() == 0)
@@ -91,7 +91,7 @@ void cAnimatedSprite::RighttoLeft()
Draw(); Draw();
} }
///Sets /// Sets
void cAnimatedSprite::setXIncrement( const unsigned long int x ) void cAnimatedSprite::setXIncrement( const unsigned long int x )
{ {
m_xIncrement = x; m_xIncrement = x;
@@ -115,7 +115,7 @@ void cAnimatedSprite::setFPS( const unsigned long int fps /*= 16*/ )
m_nextTime = ((unsigned long int)SDL_GetTicks()) + m_RATE; m_nextTime = ((unsigned long int)SDL_GetTicks()) + m_RATE;
} }
///Gets /// Gets
const unsigned long int cAnimatedSprite::getXIncrement() const const unsigned long int cAnimatedSprite::getXIncrement() const
{ {
return m_xIncrement; return m_xIncrement;
@@ -19,7 +19,7 @@ namespace VideoEngine {
cAnimatedSprite( const cAnimatedSprite& copy ); cAnimatedSprite( const cAnimatedSprite& copy );
~cAnimatedSprite(); ~cAnimatedSprite();
///Functions /// Functions
/* Runs down the image */ /* Runs down the image */
void UptoDown(); void UptoDown();
/* Runs up the image */ /* Runs up the image */
@@ -29,7 +29,7 @@ namespace VideoEngine {
/* Runs Left of the image */ /* Runs Left of the image */
void RighttoLeft(); void RighttoLeft();
///Sets /// Sets
/* Sets the x increment */ /* Sets the x increment */
void setXIncrement( const unsigned long int x ); void setXIncrement( const unsigned long int x );
/* Sets the y increment */ /* Sets the y increment */
@@ -39,7 +39,7 @@ namespace VideoEngine {
/* Sets the speed of going from one frame to the next */ /* Sets the speed of going from one frame to the next */
void setFPS( const unsigned long int fps = 16 ); void setFPS( const unsigned long int fps = 16 );
///Gets /// Gets
/* Gets the x increment */ /* Gets the x increment */
const unsigned long int getXIncrement() const; const unsigned long int getXIncrement() const;
/* Gets the y increment */ /* Gets the y increment */
@@ -55,15 +55,15 @@ namespace VideoEngine {
void AddTimeandRate(); void AddTimeandRate();
private: private:
///Variables /// Variables
unsigned long int m_xIncrement;// = 0 unsigned long int m_xIncrement;/// = 0
unsigned long int m_yIncrement;// = 0 unsigned long int m_yIncrement;/// = 0
unsigned long int m_fps;// = 16 unsigned long int m_fps;/// = 16
unsigned long int m_nextTime;// = 0 unsigned long int m_nextTime;/// = 0
unsigned long int m_RATE;// = 0 unsigned long int m_RATE;/// = 0
};/// END CLASS DEFINITION cAnimatedSprite };/// END CLASS DEFINITION cAnimatedSprite
}/// END NAMESPACE DEFINITION VideoEngine }/// END NAMESPACE DEFINITION VideoEngine
@@ -46,7 +46,7 @@ void cCamera::SaveImage( const cString& fileName, const cString& dir /*= ""*/ )
cRenderer::Inst().SaveTexture(mp_texture, fileName, dir); cRenderer::Inst().SaveTexture(mp_texture, fileName, dir);
} }
///Sets /// Sets
void cCamera::setXPosandYPos( const signed long int xPos /*= 0*/, const signed long int yPos /*= 0*/ ) void cCamera::setXPosandYPos( const signed long int xPos /*= 0*/, const signed long int yPos /*= 0*/ )
{ {
m_position.x = Sint16(xPos); m_position.x = Sint16(xPos);
@@ -71,7 +71,7 @@ void cCamera::setTexture( SDL_Texture* texture )
cRenderer::Inst().CopyTexture(texture, mp_texture); cRenderer::Inst().CopyTexture(texture, mp_texture);
} }
///Gets /// Gets
const unsigned long int cCamera::getXPos() const const unsigned long int cCamera::getXPos() const
{ {
return m_position.x; return m_position.x;
@@ -28,7 +28,7 @@ namespace VideoEngine {
/* Saves the Camera Image to a BMP file */ /* Saves the Camera Image to a BMP file */
void SaveImage( const cString& fileName, const cString& dir = "" ); void SaveImage( const cString& fileName, const cString& dir = "" );
///Sets /// Sets
/* Sets the x and y position on the video buffer */ /* Sets the x and y position on the video buffer */
void setXPosandYPos( const signed long int xPos = 0, const signed long int yPos = 0 ); void setXPosandYPos( const signed long int xPos = 0, const signed long int yPos = 0 );
/* Sets the width and height the camera should be */ /* Sets the width and height the camera should be */
@@ -36,7 +36,7 @@ namespace VideoEngine {
/* Sets the Surface */ /* Sets the Surface */
void setTexture( SDL_Texture* texture ); void setTexture( SDL_Texture* texture );
///Gets /// Gets
/* Gets the x position of the camera */ /* Gets the x position of the camera */
const unsigned long int getXPos() const; const unsigned long int getXPos() const;
/* Gets the y position of the camera */ /* Gets the y position of the camera */
@@ -54,15 +54,15 @@ namespace VideoEngine {
SDL_Texture* getTexture() const; SDL_Texture* getTexture() const;
private: private:
///Functions /// Functions
void CreateCamera(); void CreateCamera();
void DeleteCamera(); void DeleteCamera();
private: private:
///Variables /// Variables
SDL_Rect m_position; SDL_Rect m_position;
SDL_Texture* mp_texture;// = nullptr SDL_Texture* mp_texture;/// = nullptr
//std::vector<cSprite*> m_sprites; //std::vector<cSprite*> m_sprites;
//LinkList::cLList m_sprites; //LinkList::cLList m_sprites;
@@ -70,7 +70,7 @@ const cImage* cImage::NewImage( SDL_Rect& area ) const
return rtn; return rtn;
} }
///Sets /// Sets
void cImage::setTransparent( const bool transparent /*= true*/ ) void cImage::setTransparent( const bool transparent /*= true*/ )
{ {
m_transparent = transparent; m_transparent = transparent;
@@ -90,7 +90,7 @@ void cImage::setLevelTrans( const unsigned char translevel /*= 255*/ )
m_transLevel = translevel; m_transLevel = translevel;
} }
///Gets /// Gets
SDL_Surface* cImage::getSurface() const SDL_Surface* cImage::getSurface() const
{ {
SDL_Surface* rtn = nullptr; SDL_Surface* rtn = nullptr;
@@ -187,7 +187,7 @@ const bool cImage::getIsSurface() const
return m_isSurface; return m_isSurface;
} }
//protected: /// protected:
void cImage::setImage( SDL_Surface* surface ) void cImage::setImage( SDL_Surface* surface )
{ {
UnloadImage(); UnloadImage();
@@ -206,8 +206,8 @@ void cImage::setImage( SDL_Texture* texture )
mp_texture = texture; mp_texture = texture;
} }
///private /// private
///Functions /// Functions
void cImage::TransparentSetup() void cImage::TransparentSetup()
{ {
if (m_transparent == false) if (m_transparent == false)
@@ -30,7 +30,7 @@ namespace VideoEngine {
/* Creates a New Image based on input */ /* Creates a New Image based on input */
const cImage* NewImage( SDL_Rect& area ) const; const cImage* NewImage( SDL_Rect& area ) const;
///Sets /// Sets
/* Sets Transparent on if set to true */ /* Sets Transparent on if set to true */
void setTransparent( const bool transparent = true ); void setTransparent( const bool transparent = true );
/* Sets the colour to be made transparent */ /* Sets the colour to be made transparent */
@@ -38,7 +38,7 @@ namespace VideoEngine {
/* Sets the level of the transparent 255 = clear, 0 = solid */ /* Sets the level of the transparent 255 = clear, 0 = solid */
void setLevelTrans( const unsigned char translevel = 255 ); void setLevelTrans( const unsigned char translevel = 255 );
///Gets /// Gets
/* Gets a pointer to the SDL_Surface */ /* Gets a pointer to the SDL_Surface */
SDL_Surface* getSurface() const; SDL_Surface* getSurface() const;
/* Gets a pointer to the SDL_Texture */ /* Gets a pointer to the SDL_Texture */
@@ -76,22 +76,22 @@ namespace VideoEngine {
void setImage( SDL_Texture* texture ); void setImage( SDL_Texture* texture );
private: private:
///Functions /// Functions
void TransparentSetup(); void TransparentSetup();
void UnloadImage(); void UnloadImage();
private: private:
///Variables /// Variables
SDL_Texture* mp_texture;// = nullptr SDL_Texture* mp_texture;/// = nullptr
SDL_Surface* mp_surface;// = nullptr SDL_Surface* mp_surface;// = nullptr
bool m_transparent;// = false bool m_transparent;/// = false
unsigned char m_transRed;// = 0 unsigned char m_transRed;/// = 0
unsigned char m_transBlue;// = 0 unsigned char m_transBlue;/// = 0
unsigned char m_transGreen;// = 255 unsigned char m_transGreen;/// = 255
unsigned char m_transLevel;// = 255 unsigned char m_transLevel;/// = 255
bool m_isSurface; bool m_isSurface;
};/// END CLASS DEFINITION cImage };/// END CLASS DEFINITION cImage
@@ -7,35 +7,35 @@
using VideoEngine::cImageFile; using VideoEngine::cImageFile;
using UtilityEngine::cUtility; using UtilityEngine::cUtility;
cImageFile::cImageFile(const cString& filename, const cString& dir /*= ""*/, const bool transparent /*= false*/, cImageFile::cImageFile( const cString& filename, const cString& dir /*= ""*/, const bool transparent /*= false*/,
const unsigned char red /*= 0*/, const unsigned char blue /*= 0*/, const unsigned char green /*= 255*/, const unsigned char red /*= 0*/, const unsigned char blue /*= 0*/, const unsigned char green /*= 255*/,
const unsigned char translevel /*= 255*/, const bool isSurface /*= false*/) const unsigned char translevel /*= 255*/, const bool isSurface /*= false*/ )
: cImage(transparent, red, blue, green, translevel, isSurface), m_dir(dir), m_fileName(filename) : cImage(transparent, red, blue, green, translevel, isSurface), m_dir(dir), m_fileName(filename)
{ {
if (m_fileName != (char*)"") if (m_fileName != (char*)"")
LoadImage(); LoadImage();
} }
cImageFile::cImageFile(const cImageFile& copy, const bool surfaceCopy /*= true*/) cImageFile::cImageFile( const cImageFile& copy, const bool surfaceCopy /*= true*/ )
: cImage(copy) : cImage(copy)
{} {}
cImageFile::~cImageFile() cImageFile::~cImageFile()
{} {}
///Sets /// Sets
void cImageFile::setDir(const cString& dir) void cImageFile::setDir( const cString& dir )
{ {
m_dir = dir; m_dir = dir;
} }
void cImageFile::setFileName(const cString& filename) void cImageFile::setFileName( const cString& filename )
{ {
m_fileName = filename; m_fileName = filename;
LoadImage(); LoadImage();
} }
void cImageFile::setFileNameandDir(const cString& filename, const cString& dir /*= ""*/) void cImageFile::setFileNameandDir( const cString& filename, const cString& dir /*= ""*/ )
{ {
setDir(dir); setDir(dir);
setFileName(filename); setFileName(filename);
@@ -51,8 +51,8 @@ const cString& cImageFile::getFileName() const
return m_fileName; return m_fileName;
} }
///private /// private
///Functions /// Functions
void cImageFile::LoadImage() void cImageFile::LoadImage()
{ {
SDL_Texture* tempText = nullptr; SDL_Texture* tempText = nullptr;
@@ -18,35 +18,35 @@ namespace VideoEngine {
class EXPORT_FROM_MYDLL cImageFile : public cImage class EXPORT_FROM_MYDLL cImageFile : public cImage
{ {
public: public:
cImageFile(const cString& filename = "", const cString& dir = "", const bool transparent = false, cImageFile( const cString& filename = "", const cString& dir = "", const bool transparent = false,
const unsigned char red = 0, const unsigned char blue = 0, const unsigned char green = 255, const unsigned char red = 0, const unsigned char blue = 0, const unsigned char green = 255,
const unsigned char translevel = 255, const bool isSurface = false); const unsigned char translevel = 255, const bool isSurface = false );
/* Copy constructor */ /* Copy constructor */
cImageFile(const cImageFile& copy, const bool surfaceCopy = true); cImageFile( const cImageFile& copy, const bool surfaceCopy = true );
~cImageFile(); ~cImageFile();
///Sets /// Sets
/* Sets the Directory of the image */ /* Sets the Directory of the image */
void setDir(const cString& dir); void setDir( const cString& dir );
/* Sets the File Name of the image */ /* Sets the File Name of the image */
void setFileName(const cString& filename); void setFileName( const cString& filename );
/* Sets the File Name and the Directory of the image */ /* Sets the File Name and the Directory of the image */
void setFileNameandDir(const cString& filename, const cString& dir = ""); void setFileNameandDir( const cString& filename, const cString& dir = "" );
///Gets /// Gets
/* Gets the Directory of the image */ /* Gets the Directory of the image */
const cString& getDir() const; const cString& getDir() const;
/* Gets the File Name of the image */ /* Gets the File Name of the image */
const cString& getFileName() const; const cString& getFileName() const;
private: private:
///Functions /// Functions
void LoadImage(); void LoadImage();
private: private:
///Variables /// Variables
cString m_dir;// = "" cString m_dir;/// = ""
cString m_fileName;// = "" cString m_fileName;/// = ""
};/// END CLASS DEFINITION cImageFile };/// END CLASS DEFINITION cImageFile
}/// END NAMESPACE DEFINITION VideoEngine }/// END NAMESPACE DEFINITION VideoEngine
#endif/// END IFNDEF _CIMAGEFILE_HPP_ #endif/// END IFNDEF _CIMAGEFILE_HPP_
@@ -10,7 +10,7 @@ using UtilityEngine::cUtility;
/*static*/ cRenderer* cRenderer::sp_inst = nullptr; /*static*/ cRenderer* cRenderer::sp_inst = nullptr;
//private: /// private:
cRenderer::cRenderer() cRenderer::cRenderer()
: mp_renderer(nullptr), mp_rendererSoftware(nullptr) : mp_renderer(nullptr), mp_rendererSoftware(nullptr)
{ {
@@ -22,8 +22,8 @@ cRenderer::~cRenderer()
CleanUp(); CleanUp();
} }
//public: /// public:
///Functions /// Functions
/*static*/ cRenderer& cRenderer::Inst() /*static*/ cRenderer& cRenderer::Inst()
{ {
if (sp_inst == nullptr) if (sp_inst == nullptr)
@@ -229,7 +229,7 @@ SDL_Texture* cRenderer::NewTexture( long int width, long int height, const bool
return rtn; return rtn;
} }
const bool cRenderer::AreEqual(SDL_Surface& one, SDL_Surface& two) const bool cRenderer::AreEqual( SDL_Surface& one, SDL_Surface& two )
{ {
bool rtn = false; bool rtn = false;
@@ -270,7 +270,7 @@ const bool cRenderer::AreEqual(SDL_Surface& one, SDL_Surface& two)
return rtn; return rtn;
} }
void cRenderer::SetRenderTarget(SDL_Renderer* renderer, SDL_Texture* target /*= nullptr*/) void cRenderer::SetRenderTarget( SDL_Renderer* renderer, SDL_Texture* target /*= nullptr*/ )
{ {
if (SDL_SetRenderTarget(renderer, target) < 0) if (SDL_SetRenderTarget(renderer, target) < 0)
cUtility::Inst().Message("Unable to set render target to dst. SDL_SetRenderTarget():", __AT__, cUtility::eTypeSDL::SDL); cUtility::Inst().Message("Unable to set render target to dst. SDL_SetRenderTarget():", __AT__, cUtility::eTypeSDL::SDL);
@@ -54,15 +54,15 @@ namespace VideoEngine {
SDL_Surface* NewSurface( long int width = -1, long int height = -1 ) const; SDL_Surface* NewSurface( long int width = -1, long int height = -1 ) const;
SDL_Texture* NewTexture( long int width = -1, long int height = -1, const bool copyRenderer = false, const unsigned long int access = SDL_TEXTUREACCESS_TARGET ) const; SDL_Texture* NewTexture( long int width = -1, long int height = -1, const bool copyRenderer = false, const unsigned long int access = SDL_TEXTUREACCESS_TARGET ) const;
const bool AreEqual(SDL_Surface& one, SDL_Surface& two); const bool AreEqual( SDL_Surface& one, SDL_Surface& two );
void SetRenderTarget(SDL_Renderer* renderer, SDL_Texture* target = nullptr); void SetRenderTarget( SDL_Renderer* renderer, SDL_Texture* target = nullptr );
void SetRenderTarget(SDL_Texture* target = nullptr); void SetRenderTarget( SDL_Texture* target = nullptr );
void ResetRenderTarget(); void ResetRenderTarget();
///Sets /// Sets
///Gets /// Gets
SDL_Renderer* getRenderer(); SDL_Renderer* getRenderer();
SDL_Renderer* getRendererCopy(); SDL_Renderer* getRendererCopy();
@@ -27,18 +27,24 @@ cSprite::cSprite( VideoEngine::cImage** image, VideoEngine::cCamera** camera /*=
setEndImageArea(Uint16((*mpp_image)->getWidth()), Uint16((*mpp_image)->getHeight())); setEndImageArea(Uint16((*mpp_image)->getWidth()), Uint16((*mpp_image)->getHeight()));
} }
//cSprite::cSprite( TextTypeEngine::cText** image, VideoEngine::cCamera** camera /*= nullptr*/ ) cSprite::cSprite( const cSprite& copy )
/*: mpp_camera(camera)
{ {
image; Copy(copy);
//VideoEngine::cImage* im = VideoEngine::cImage(*image); }
setPosition(0, 0);
setStartImageArea(0, 0);
setEndImageArea(Uint16((*mpp_image)->getWidth()), Uint16((*mpp_image)->getHeight()));
}*/
cSprite& cSprite::operator=( const cSprite& copy ) cSprite& cSprite::operator=( const cSprite& copy )
{
return Copy(copy);
}
cSprite::~cSprite()
{
mpp_image = nullptr;
mpp_camera = nullptr;
}
/// Functions
cSprite& cSprite::Copy( const cSprite & copy )
{ {
if (this != &copy) if (this != &copy)
{ {
@@ -63,17 +69,9 @@ cSprite& cSprite::operator=( const cSprite& copy )
*mpp_image = copy.getImage(); *mpp_image = copy.getImage();
*mpp_camera = copy.getCamera(); *mpp_camera = copy.getCamera();
} }
return *this; return *this;
} }
cSprite::~cSprite()
{
mpp_image = nullptr;
mpp_camera = nullptr;
}
///Functions
void cSprite::Draw() void cSprite::Draw()
{ {
//SDL_Texture* texture = (*mpp_image)->getImage(); //SDL_Texture* texture = (*mpp_image)->getImage();
@@ -135,7 +133,7 @@ void cSprite::SaveImage( const cString& fileName, const cString& dir /*= ""*/ )
} }
} }
///Sets /// Sets
void cSprite::setPosX( const signed long int x ) void cSprite::setPosX( const signed long int x )
{ {
setPosition( x, getPosY()); setPosition( x, getPosY());
@@ -196,7 +194,7 @@ void cSprite::setCamera( VideoEngine::cCamera** camera )
mpp_camera = camera; mpp_camera = camera;
} }
///Get's /// Gets
const signed long int cSprite::getPosX() const const signed long int cSprite::getPosX() const
{ {
return m_position.x; return m_position.x;
@@ -28,10 +28,12 @@ namespace VideoEngine {
const signed long int yarea = 0, const unsigned long int warea = 0, const unsigned long int harea = 0, const signed long int yarea = 0, const unsigned long int warea = 0, const unsigned long int harea = 0,
VideoEngine::cImage** image = nullptr, VideoEngine::cCamera** camera = nullptr ); VideoEngine::cImage** image = nullptr, VideoEngine::cCamera** camera = nullptr );
cSprite( const cSprite& copy );
cSprite& operator=( const cSprite& copy ); cSprite& operator=( const cSprite& copy );
~cSprite(); ~cSprite();
///Functions /// Functions
cSprite& Copy(const cSprite& copy);
/* Draws the sprite to the video buffer */ /* Draws the sprite to the video buffer */
void Draw(); void Draw();
/* Draws the sprite to the camera */ /* Draws the sprite to the camera */
@@ -46,7 +48,7 @@ namespace VideoEngine {
void SaveImage( const cString& fileName, const cString& dir = "" ); void SaveImage( const cString& fileName, const cString& dir = "" );
///Sets /// Sets
/* Sets the X position of the sprite on the surface, camera or video buffer */ /* Sets the X position of the sprite on the surface, camera or video buffer */
void setPosX( const signed long int x ); void setPosX( const signed long int x );
/* Sets the Y position of the sprite on the surface, camera or video buffer */ /* Sets the Y position of the sprite on the surface, camera or video buffer */
@@ -68,7 +70,7 @@ namespace VideoEngine {
/* Sets the pointer to a pointer for the camera the sprite will be draw on */ /* Sets the pointer to a pointer for the camera the sprite will be draw on */
void setCamera( VideoEngine::cCamera** camera ); void setCamera( VideoEngine::cCamera** camera );
///Gets /// Gets
/* Gets the X position of the sprite on the surface, camera or video buffer */ /* Gets the X position of the sprite on the surface, camera or video buffer */
const signed long int getPosX() const; const signed long int getPosX() const;
/* Gets the Y position of the sprite on the surface, camera of video buffer */ /* Gets the Y position of the sprite on the surface, camera of video buffer */
@@ -104,13 +106,13 @@ namespace VideoEngine {
void setPositionEnd(); void setPositionEnd();
private: private:
///Variables /// Variables
SDL_Rect m_position; /// Were the Sprite will be position on the screen (Upper Left) SDL_Rect m_position; /// Were the Sprite will be position on the screen (Upper Left)
SDL_Rect m_imageArea; /// What part of the image to take SDL_Rect m_imageArea; /// What part of the image to take
VideoEngine::cImage** mpp_image;// = nullptr VideoEngine::cImage** mpp_image;/// = nullptr
VideoEngine::cCamera** mpp_camera;// = nullptr VideoEngine::cCamera** mpp_camera;/// = nullptr
};/// END CLASS DEFINITION cSprite };/// END CLASS DEFINITION cSprite
}/// END NAMESPACE DEFINITION VideoEngine }/// END NAMESPACE DEFINITION VideoEngine
#endif/// END IFNDEF _CSPRITE_HPP_ #endif/// END IFNDEF _CSPRITE_HPP_
@@ -32,7 +32,7 @@ cVideo::~cVideo()
CleanUp(); CleanUp();
} }
///Functions /// Functions
/*static*/ cVideo& cVideo::Inst() /*static*/ cVideo& cVideo::Inst()
{ {
if (sp_inst == nullptr) if (sp_inst == nullptr)
@@ -125,7 +125,7 @@ void cVideo::VideoSettings()
m_videoSettings = (m_videoSettings | SDL_WINDOW_FULLSCREEN); m_videoSettings = (m_videoSettings | SDL_WINDOW_FULLSCREEN);
} }
///Set's /// Sets
void cVideo::setWidth( const unsigned long int width /*= 640*/ ) void cVideo::setWidth( const unsigned long int width /*= 640*/ )
{ {
m_width = width; m_width = width;
@@ -173,7 +173,7 @@ void cVideo::setDisplayMode( const SDL_DisplayMode& mode )
cUtility::Inst().Message("Unable to set display mode. SDL_SetWindowDisplayMode()", __AT__, cUtility::eTypeSDL::SDL); cUtility::Inst().Message("Unable to set display mode. SDL_SetWindowDisplayMode()", __AT__, cUtility::eTypeSDL::SDL);
} }
///Gets /// Gets
const bool cVideo::IsInit() const const bool cVideo::IsInit() const
{ {
bool rtn = false; bool rtn = false;
@@ -22,7 +22,7 @@ namespace VideoEngine {
~cVideo(); ~cVideo();
public: public:
///Functions /// Functions
static cVideo& Inst(); static cVideo& Inst();
static void Delete(); static void Delete();
@@ -41,7 +41,7 @@ namespace VideoEngine {
SDL_Renderer* CreateRender(); SDL_Renderer* CreateRender();
///Sets /// Sets
/* Sets the videos width resolution */ /* Sets the videos width resolution */
void setWidth( const unsigned long int width = 640 ); void setWidth( const unsigned long int width = 640 );
/* Sets the videos height resolution */ /* Sets the videos height resolution */
@@ -60,7 +60,7 @@ namespace VideoEngine {
void setDisplayMode( const SDL_DisplayMode& mode ); void setDisplayMode( const SDL_DisplayMode& mode );
///Gets /// Gets
/* Gets return true if video was initialized */ /* Gets return true if video was initialized */
const bool IsInit() const; const bool IsInit() const;
/* Gets the videos width resolution */ /* Gets the videos width resolution */
@@ -100,27 +100,27 @@ namespace VideoEngine {
const unsigned long int getAmask() const; const unsigned long int getAmask() const;
private: private:
///Functions /// Functions
void VideoSettings(); void VideoSettings();
private: private:
///Variables /// Variables
SDL_Window* mp_window;// = nullptr SDL_Window* mp_window;/// = nullptr
//SDL_Renderer* mp_rend;// = nullptr //SDL_Renderer* mp_rend;/// = nullptr
unsigned long int m_xPos;// = 100 unsigned long int m_xPos;/// = 100
unsigned long int m_yPos;// = 100 unsigned long int m_yPos;/// = 100
unsigned long int m_width;// = 640 unsigned long int m_width;/// = 640
unsigned long int m_height;// = 480 unsigned long int m_height;/// = 480
unsigned long int m_colour;// = 32 unsigned long int m_colour;/// = 32
bool m_hardwareVideo;// = false bool m_hardwareVideo;/// = false
bool m_fullscreen;// = false bool m_fullscreen;/// = false
bool m_vsync;// = false bool m_vsync;/// = false
unsigned long int m_videoSettings;// = SDL_RENDERER_SOFTWARE unsigned long int m_videoSettings;/// = SDL_RENDERER_SOFTWARE
static cVideo* sp_inst;// = nullptr static cVideo* sp_inst;/// = nullptr
/*SDL interprets each pixel as a 32-bit number, so our masks must depend /*SDL interprets each pixel as a 32-bit number, so our masks must depend
on the endianness (byte order) of the machine */ on the endianness (byte order) of the machine */
@@ -7,7 +7,7 @@
void EventEngineTest() void EventEngineTest()
{ {
// cString /// cString
printf("\nTesting cString -----\n\n"); printf("\nTesting cString -----\n\n");
UTest u("cString"); UTest u("cString");
@@ -3,4 +3,4 @@
void EventEngineTest(); void EventEngineTest();
#endif //__EVENTENGINETEST__ #endif ///__EVENTENGINETEST__
@@ -316,8 +316,6 @@ void GUIXMLBoxSizerTest()
u.report(); u.report();
GUIEngine::cGUI::Inst().Delete(); GUIEngine::cGUI::Inst().Delete();
} }
void LoadFile( const cString& filename, const bool show /*= false*/ ) void LoadFile( const cString& filename, const bool show /*= false*/ )
@@ -34,4 +34,4 @@ void cWindowTest( const cString& msg, UTest& u, GUIEngine::cWindow* win, const S
void cWindowTest( const cString& msg, UTest& u, GUIEngine::cWindow* win, const GUIHelpers::Position& pos, void cWindowTest( const cString& msg, UTest& u, GUIEngine::cWindow* win, const GUIHelpers::Position& pos,
const GUIHelpers::Size& size, const GUIHelpers::Padding& pad, const GUIHelpers::Position& center ); const GUIHelpers::Size& size, const GUIHelpers::Padding& pad, const GUIHelpers::Position& center );
#endif // __GUIXMLTEST__ #endif /// __GUIXMLTEST__
@@ -150,6 +150,7 @@
<ClCompile Include="main.cpp" /> <ClCompile Include="main.cpp" />
<ClCompile Include="UTest\UTest.cpp" /> <ClCompile Include="UTest\UTest.cpp" />
<ClCompile Include="UtilityEngineTest\StringTest.cpp" /> <ClCompile Include="UtilityEngineTest\StringTest.cpp" />
<ClCompile Include="UtilityEngineTest\UtilityEngineTest.cpp" />
<ClCompile Include="VideoEngineTest\ImageFileTest.cpp" /> <ClCompile Include="VideoEngineTest\ImageFileTest.cpp" />
<ClCompile Include="VideoEngineTest\RendererTest.cpp" /> <ClCompile Include="VideoEngineTest\RendererTest.cpp" />
<ClCompile Include="VideoEngineTest\VideoEngineTest.cpp" /> <ClCompile Include="VideoEngineTest\VideoEngineTest.cpp" />
@@ -160,6 +161,7 @@
<ClInclude Include="GUIEngineTest\GUIXMLTest.hpp" /> <ClInclude Include="GUIEngineTest\GUIXMLTest.hpp" />
<ClInclude Include="UTest\UTest.hpp" /> <ClInclude Include="UTest\UTest.hpp" />
<ClInclude Include="UtilityEngineTest\StringTest.hpp" /> <ClInclude Include="UtilityEngineTest\StringTest.hpp" />
<ClInclude Include="UtilityEngineTest\UtilityEngineTest.hpp" />
<ClInclude Include="VideoEngineTest\ImageFileTest.hpp" /> <ClInclude Include="VideoEngineTest\ImageFileTest.hpp" />
<ClInclude Include="VideoEngineTest\RendererTest.hpp" /> <ClInclude Include="VideoEngineTest\RendererTest.hpp" />
<ClInclude Include="VideoEngineTest\VideoEngineTest.hpp" /> <ClInclude Include="VideoEngineTest\VideoEngineTest.hpp" />
@@ -45,6 +45,9 @@
<ClInclude Include="VideoEngineTest\VideoEngineTest.hpp"> <ClInclude Include="VideoEngineTest\VideoEngineTest.hpp">
<Filter>VideoEngineTest</Filter> <Filter>VideoEngineTest</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="UtilityEngineTest\UtilityEngineTest.hpp">
<Filter>UtitlityEngineTest</Filter>
</ClInclude>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClCompile Include="UTest\UTest.cpp"> <ClCompile Include="UTest\UTest.cpp">
@@ -72,6 +75,9 @@
<ClCompile Include="VideoEngineTest\VideoEngineTest.cpp"> <ClCompile Include="VideoEngineTest\VideoEngineTest.cpp">
<Filter>VideoEngineTest</Filter> <Filter>VideoEngineTest</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="UtilityEngineTest\UtilityEngineTest.cpp">
<Filter>UtitlityEngineTest</Filter>
</ClCompile>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Xml Include="xml\GUI.xml"> <Xml Include="xml\GUI.xml">
@@ -9,7 +9,7 @@ using UtilityEngine::cString;
void StringTest() void StringTest()
{ {
// cString /// cString
printf("\nTesting cString -----\n\n"); printf("\nTesting cString -----\n\n");
UTest u("cString"); UTest u("cString");
@@ -3,4 +3,4 @@
void StringTest(); void StringTest();
#endif // __STRINGTEST__ #endif /// __STRINGTEST__
@@ -0,0 +1,8 @@
#include "UtilityEngineTest.hpp"
#include "StringTest.hpp"
void UtilityEngineTest()
{
StringTest();
}
@@ -0,0 +1,6 @@
#ifndef __UTILITYENGINETEST__
#define __UTILITYENGINETEST__
void UtilityEngineTest();
#endif /// __UTILITYENGINETEST__
@@ -11,7 +11,7 @@ using VideoEngine::cSprite;
void ImageFileTest() void ImageFileTest()
{ {
// cImageFile /// cImageFile
printf("\nTesting cImageFile -----\n\n"); printf("\nTesting cImageFile -----\n\n");
UTest u("cImageFile"); UTest u("cImageFile");
@@ -3,4 +3,4 @@
void ImageFileTest(); void ImageFileTest();
#endif // __IMAGEFILETEST__ #endif /// __IMAGEFILETEST__
@@ -23,7 +23,7 @@ void RendererTest()
//u.test("Screen Shot", RendererTextureToSurface()); ///u.test("Screen Shot", RendererTextureToSurface());
u.report(); u.report();
@@ -9,4 +9,4 @@ const bool RendererAreaEqualNotEqual();
const bool RendererTextureToSurface(); const bool RendererTextureToSurface();
#endif // __RENDERERTEST__ #endif /// __RENDERERTEST__
@@ -3,4 +3,4 @@
void VideoEngineTest(); void VideoEngineTest();
#endif // __VIDEOENGINETEST__ #endif /// __VIDEOENGINETEST__
@@ -9,7 +9,7 @@ using VideoEngine::cVideo;
void VideoTest() void VideoTest()
{ {
// cVideo /// cVideo
printf("\nTesting cVideo -----\n\n"); printf("\nTesting cVideo -----\n\n");
UTest u("cVideo"); UTest u("cVideo");
@@ -22,7 +22,7 @@ void VideoTest()
u.test("Video Setup. Setup()", video.Setup()); u.test("Video Setup. Setup()", video.Setup());
// CaptionTest /// CaptionTest
u.test("setCaption() and getCaption()", CaptionTest()); u.test("setCaption() and getCaption()", CaptionTest());
u.report(); u.report();
@@ -5,4 +5,4 @@ void VideoTest();
const bool CaptionTest(); const bool CaptionTest();
#endif // __VIDEOTEST__ #endif /// __VIDEOTEST__
+4 -4
View File
@@ -26,7 +26,7 @@ see license.txt for details
#include "VideoEngineTest/VideoEngineTest.hpp" #include "VideoEngineTest/VideoEngineTest.hpp"
/*** Utility Engine Test ***/ /*** Utility Engine Test ***/
#include "UtilityEngineTest/StringTest.hpp" #include "UtilityEngineTest/UtilityEngineTest.hpp"
/*** GUI Engine Test ***/ /*** GUI Engine Test ***/
#include "GUIEngineTest/GUIXMLTest.hpp" #include "GUIEngineTest/GUIXMLTest.hpp"
@@ -47,12 +47,12 @@ int main(int argc, char *argv[])
VideoEngineTest(); VideoEngineTest();
//UtilityEngineTest(); UtilityEngineTest();
//StringTest();
//GUIXMLTest(); GUIXMLTest();
//ImageTest(); //ImageTest();
+2 -1
View File
@@ -1,8 +1,9 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Panel size="200,200"> <Panel size="200,200">
<debug/> <debug />
<Layout> <Layout>
<Boxsizer /> <Boxsizer />
<Label text="Box Sizer" /> <Label text="Box Sizer" />
<Boxsizer />
</Layout> </Layout>
</Panel> </Panel>
@@ -3,5 +3,6 @@
<debug/> <debug/>
<Layout> <Layout>
<Label text="Hello world" /> <Label text="Hello world" />
<Include dir ="xml/" filename="include.xml"/>
</Layout> </Layout>
</Panel> </Panel>
+2 -7
View File
@@ -1,8 +1,3 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<Layout layout="wrap_content"> <Boxsizer />
<Label <Label text="Box Sizer" />
text="Hello World2"
padding=""/>
<Label
text="Richard Allen2"/>
</Layout>