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