Pre-resize fillparent
This commit is contained in:
@@ -123,8 +123,8 @@ void cPongStart::MainMenu()
|
|||||||
|
|
||||||
void cPongStart::Start()
|
void cPongStart::Start()
|
||||||
{
|
{
|
||||||
VideoEngine::cImage* p_image = new VideoEngine::cImage("img/", "Equipment.png", true, 0, 0, 0);
|
VideoEngine::cImageFile* p_image = new VideoEngine::cImageFile("img/", "Equipment.png", true, 0, 0, 0);
|
||||||
VideoEngine::cImage* p_court = new VideoEngine::cImage("img/", "Court.png");
|
VideoEngine::cImageFile* p_court = new VideoEngine::cImageFile("img/", "Court.png");
|
||||||
|
|
||||||
Equipment::cBall* ball = new Equipment::cBall(400, 400, 17, 65, 12, 12, &p_image);
|
Equipment::cBall* ball = new Equipment::cBall(400, 400, 17, 65, 12, 12, &p_image);
|
||||||
Equipment::cPaddle* paddle = new Equipment::cPaddle(0, 0, 0, 0, 16, 77, &p_image);
|
Equipment::cPaddle* paddle = new Equipment::cPaddle(0, 0, 0, 0, 16, 77, &p_image);
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ cAudio::~cAudio()
|
|||||||
CleanUp();
|
CleanUp();
|
||||||
}
|
}
|
||||||
|
|
||||||
//Functions
|
/// Functions
|
||||||
/*static*/ cAudio& cAudio::Inst()
|
/*static*/ cAudio& cAudio::Inst()
|
||||||
{
|
{
|
||||||
if (sp_inst == nullptr)
|
if (sp_inst == nullptr)
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ namespace AudioEngine {
|
|||||||
~cAudio();
|
~cAudio();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
//Functions
|
/// Functions
|
||||||
static cAudio& Inst();
|
static cAudio& Inst();
|
||||||
static void Delete();
|
static void Delete();
|
||||||
|
|
||||||
@@ -61,12 +61,12 @@ namespace AudioEngine {
|
|||||||
private:
|
private:
|
||||||
private:
|
private:
|
||||||
/// Variables
|
/// Variables
|
||||||
unsigned long int m_rate;// = 22050;
|
unsigned long int m_rate;/// = 22050;
|
||||||
unsigned long int m_format;// = AUDIO_S16;
|
unsigned long int m_format;/// = AUDIO_S16;
|
||||||
unsigned long int m_channels;// = 2;
|
unsigned long int m_channels;/// = 2;
|
||||||
unsigned long int m_buffers;// = 4096;
|
unsigned long int m_buffers;/// = 4096;
|
||||||
|
|
||||||
static cAudio* sp_inst;// = nullptr;
|
static cAudio* sp_inst;/// = nullptr;
|
||||||
};/// END CLASS DEFINITION cAudio
|
};/// END CLASS DEFINITION cAudio
|
||||||
}/// END NAMESPACE DEFINITION AudioEngine
|
}/// END NAMESPACE DEFINITION AudioEngine
|
||||||
#endif/// END IFNDEF _CAUDIO_HPP_
|
#endif/// END IFNDEF _CAUDIO_HPP_
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ namespace AudioEngine {
|
|||||||
/// Variables
|
/// Variables
|
||||||
Mix_Music* mp_music;
|
Mix_Music* mp_music;
|
||||||
|
|
||||||
unsigned char m_volume;// = 255
|
unsigned char m_volume;/// = 255
|
||||||
|
|
||||||
|
|
||||||
};/// END CLASS DEFINITION cMusic
|
};/// END CLASS DEFINITION cMusic
|
||||||
|
|||||||
@@ -74,10 +74,10 @@ namespace AudioEngine {
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
/// Variables
|
/// Variables
|
||||||
Mix_Chunk* mp_sound;// = nullptr
|
Mix_Chunk* mp_sound;/// = nullptr
|
||||||
|
|
||||||
cString m_dir;// = ""
|
cString m_dir;/// = ""
|
||||||
cString m_fileName;// = ""
|
cString m_fileName;/// = ""
|
||||||
|
|
||||||
|
|
||||||
unsigned char m_volume;// = 255
|
unsigned char m_volume;// = 255
|
||||||
|
|||||||
@@ -13,14 +13,14 @@ using UtilityEngine::cUtility;
|
|||||||
|
|
||||||
/*static*/ cGFX* cGFX::sp_inst = nullptr;
|
/*static*/ cGFX* cGFX::sp_inst = nullptr;
|
||||||
|
|
||||||
//private:
|
/// private:
|
||||||
cGFX::cGFX()
|
cGFX::cGFX()
|
||||||
{}
|
{}
|
||||||
|
|
||||||
cGFX::~cGFX()
|
cGFX::~cGFX()
|
||||||
{}
|
{}
|
||||||
|
|
||||||
//public:
|
/// public:
|
||||||
/// Functions
|
/// Functions
|
||||||
/*static*/ cGFX& cGFX::Inst()
|
/*static*/ cGFX& cGFX::Inst()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ namespace EXPORT_FROM_MYDLL FXEngine {
|
|||||||
void ZoomIn( SDL_Texture* texture, const double zoomx, const double zoomy, const unsigned long int smooth = SMOOTHING_ON ) const;
|
void ZoomIn( SDL_Texture* texture, const double zoomx, const double zoomy, const unsigned long int smooth = SMOOTHING_ON ) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static cGFX* sp_inst;// = nullptr
|
static cGFX* sp_inst;/// = nullptr
|
||||||
};/// END CLASS DEFINITION cGFX
|
};/// END CLASS DEFINITION cGFX
|
||||||
}/// END NAMESPACE DEFINITION FXEngine
|
}/// END NAMESPACE DEFINITION FXEngine
|
||||||
#endif/// END IFNDEF _CGFX_HPP_
|
#endif/// END IFNDEF _CGFX_HPP_
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
using namespace GUIHelpers;
|
using namespace GUIHelpers;
|
||||||
|
|
||||||
const RGBA& GUIHelpers::StringtoRGBA( const cString& colour )
|
const RGBA GUIHelpers::StringtoRGBA( const cString& colour )
|
||||||
{
|
{
|
||||||
RGBA rtn = DEFAULT;
|
RGBA rtn = DEFAULT;
|
||||||
cString check = colour.upper();
|
cString check = colour.upper();
|
||||||
|
|||||||
@@ -18,8 +18,6 @@ namespace GUIHelpers {
|
|||||||
typedef struct SDL_Colour RGBA;
|
typedef struct SDL_Colour RGBA;
|
||||||
typedef struct SDL_Rect Area;
|
typedef struct SDL_Rect Area;
|
||||||
|
|
||||||
static const RGBA DEFAULT = { 0, 0, 0, 0 };
|
|
||||||
|
|
||||||
static const RGBA WHITE = { 255, 255, 255, 255 };
|
static const RGBA WHITE = { 255, 255, 255, 255 };
|
||||||
static const RGBA BLACK = { 0, 0, 0, 255 };
|
static const RGBA BLACK = { 0, 0, 0, 255 };
|
||||||
|
|
||||||
@@ -38,8 +36,9 @@ namespace GUIHelpers {
|
|||||||
static const RGBA MAGENTA = { 255, 0, 255, 255 };
|
static const RGBA MAGENTA = { 255, 0, 255, 255 };
|
||||||
static const RGBA ROSE = { 255, 0, 128, 255 };
|
static const RGBA ROSE = { 255, 0, 128, 255 };
|
||||||
|
|
||||||
|
static const RGBA DEFAULT = WHITE;
|
||||||
|
|
||||||
const RGBA& StringtoRGBA(const cString& colour);
|
const RGBA StringtoRGBA(const cString& colour);
|
||||||
}/// END NAMESPACE DEFINITION GUIHelpers
|
}/// END NAMESPACE DEFINITION GUIHelpers
|
||||||
#endif/// END IFNDEF _GUIUTILITY_HPP_
|
#endif/// END IFNDEF _GUIUTILITY_HPP_
|
||||||
|
|
||||||
|
|||||||
@@ -14,8 +14,6 @@ cTexture::~cTexture()
|
|||||||
{}
|
{}
|
||||||
|
|
||||||
/// Functions
|
/// Functions
|
||||||
|
|
||||||
//private
|
|
||||||
SDL_Texture* cTexture::GenerateTexture( const SDL_Rect& dimensions, TextTypeEngine::cText* text /*= nullptr*/ )
|
SDL_Texture* cTexture::GenerateTexture( const SDL_Rect& dimensions, TextTypeEngine::cText* text /*= nullptr*/ )
|
||||||
{
|
{
|
||||||
SDL_Rect t = text->getWH();
|
SDL_Rect t = text->getWH();
|
||||||
|
|||||||
@@ -12,21 +12,15 @@ using UtilityEngine::cUtility;
|
|||||||
|
|
||||||
|
|
||||||
cXMLoader::cXMLoader()
|
cXMLoader::cXMLoader()
|
||||||
{
|
: m_loadDef(false), m_debugXML(false), m_orientation(GUIHelpers::eOrientation::DEFAULT_ORIENTATION),
|
||||||
m_loadDef = false;
|
m_align(GUIHelpers::eAlign::DEFAULT_ALIGN), m_layout(GUIHelpers::eLayout::DEFAULT_LAYOUT), m_pos({ -1, -1 }),
|
||||||
m_orientation = GUIHelpers::eOrientation::DEFAULT_ORIENTATION;
|
m_size({ -1, -1 }), m_pad({ -1, -1, -1, -1 })
|
||||||
m_align = GUIHelpers::eAlign::DEFAULT_ALIGN;
|
{}
|
||||||
m_layout = GUIHelpers::eLayout::DEFAULT_LAYOUT;
|
|
||||||
m_pos = { -1, -1 };
|
|
||||||
m_size = { -1, -1 };
|
|
||||||
m_pad = { -1, -1, -1, -1 };
|
|
||||||
}
|
|
||||||
|
|
||||||
cXMLoader::~cXMLoader()
|
cXMLoader::~cXMLoader()
|
||||||
{}
|
{}
|
||||||
|
|
||||||
/// Functions
|
/// Functions
|
||||||
|
|
||||||
void cXMLoader::Load( const cString& filename, const cString& dir /*= ""*/, GUIEngine::cWindow* parent /*= nullptr*/ )
|
void cXMLoader::Load( const cString& filename, const cString& dir /*= ""*/, GUIEngine::cWindow* parent /*= nullptr*/ )
|
||||||
{
|
{
|
||||||
cString file = dir + filename;
|
cString file = dir + filename;
|
||||||
@@ -83,14 +77,17 @@ void cXMLoader::GetElement( tinyxml2::XMLElement& element, GUIEngine::cWindow* p
|
|||||||
tmp->Resize();
|
tmp->Resize();
|
||||||
}
|
}
|
||||||
|
|
||||||
const cString& cXMLoader::GetAttribute( const tinyxml2::XMLElement& element, const cString& attribute ) const
|
const cString cXMLoader::GetAttribute( const tinyxml2::XMLElement& element, const cString& attribute ) const
|
||||||
{
|
{
|
||||||
cString rtn;
|
cString rtn = "";
|
||||||
const char* str = element.Attribute(attribute.c_str());
|
const char* str = element.Attribute(attribute.c_str());
|
||||||
if ((str == nullptr) && (m_debugXML == true))
|
if ((str == nullptr) && (m_debugXML == true))
|
||||||
cUtility::Inst().Message("Error no attribute: " + attribute + " found in tag <" + element.Value() + ">");
|
cUtility::Inst().Message("Error no attribute: " + attribute + " found in tag <" + element.Value() + ">");
|
||||||
else
|
else {
|
||||||
|
if (str != nullptr)
|
||||||
rtn = str;
|
rtn = str;
|
||||||
|
}
|
||||||
|
//rtn = str;
|
||||||
return rtn;
|
return rtn;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -211,12 +208,12 @@ GUIEngine::cBoxSizer* cXMLoader::BoxSizerBuild(const tinyxml2::XMLElement& eleme
|
|||||||
return rtn;
|
return rtn;
|
||||||
}
|
}
|
||||||
|
|
||||||
const cString& cXMLoader::getDir(const tinyxml2::XMLElement& element) const
|
const cString cXMLoader::getDir(const tinyxml2::XMLElement& element) const
|
||||||
{
|
{
|
||||||
return GetAttribute(element, "dir");
|
return GetAttribute(element, "dir");
|
||||||
}
|
}
|
||||||
|
|
||||||
const cString& cXMLoader::getFileName(const tinyxml2::XMLElement& element) const
|
const cString cXMLoader::getFileName(const tinyxml2::XMLElement& element) const
|
||||||
{
|
{
|
||||||
return GetAttribute(element, "filename");
|
return GetAttribute(element, "filename");
|
||||||
}
|
}
|
||||||
@@ -315,7 +312,7 @@ const GUIHelpers::eLayout cXMLoader::getLayout( const tinyxml2::XMLElement& elem
|
|||||||
return rtn;
|
return rtn;
|
||||||
}
|
}
|
||||||
|
|
||||||
const GUIHelpers::Position& cXMLoader::getPosition( const tinyxml2::XMLElement& element ) const
|
const GUIHelpers::Position cXMLoader::getPosition( const tinyxml2::XMLElement& element ) const
|
||||||
{
|
{
|
||||||
GUIHelpers::Position rtn = { -1, -1 };
|
GUIHelpers::Position rtn = { -1, -1 };
|
||||||
|
|
||||||
@@ -337,7 +334,7 @@ const GUIHelpers::Position& cXMLoader::getPosition( const tinyxml2::XMLElement&
|
|||||||
return rtn;
|
return rtn;
|
||||||
}
|
}
|
||||||
|
|
||||||
const GUIHelpers::Size& cXMLoader::getSize( const tinyxml2::XMLElement& element ) const
|
const GUIHelpers::Size cXMLoader::getSize( const tinyxml2::XMLElement& element ) const
|
||||||
{
|
{
|
||||||
GUIHelpers::Size rtn = { -1, -1 };
|
GUIHelpers::Size rtn = { -1, -1 };
|
||||||
|
|
||||||
@@ -359,7 +356,7 @@ const GUIHelpers::Size& cXMLoader::getSize( const tinyxml2::XMLElement& element
|
|||||||
return rtn;
|
return rtn;
|
||||||
}
|
}
|
||||||
|
|
||||||
const GUIHelpers::Padding& cXMLoader::getPadding( const tinyxml2::XMLElement& element ) const
|
const GUIHelpers::Padding cXMLoader::getPadding( const tinyxml2::XMLElement& element ) const
|
||||||
{
|
{
|
||||||
GUIHelpers::Padding rtn = { -1, -1, -1, -1 };
|
GUIHelpers::Padding rtn = { -1, -1, -1, -1 };
|
||||||
|
|
||||||
@@ -385,12 +382,12 @@ const GUIHelpers::Padding& cXMLoader::getPadding( const tinyxml2::XMLElement& el
|
|||||||
return rtn;
|
return rtn;
|
||||||
}
|
}
|
||||||
|
|
||||||
const cString& cXMLoader::getText( const tinyxml2::XMLElement& element ) const
|
const cString cXMLoader::getText( const tinyxml2::XMLElement& element ) const
|
||||||
{
|
{
|
||||||
return GetAttribute(element, "text");
|
return GetAttribute(element, "text");
|
||||||
}
|
}
|
||||||
|
|
||||||
const GUIHelpers::RGBA& cXMLoader::getColour( const tinyxml2::XMLElement& element ) const
|
const GUIHelpers::RGBA cXMLoader::getColour( const tinyxml2::XMLElement& element ) const
|
||||||
{
|
{
|
||||||
GUIHelpers::RGBA rtn = GUIHelpers::DEFAULT;
|
GUIHelpers::RGBA rtn = GUIHelpers::DEFAULT;
|
||||||
cString str = GetAttribute(element, "colour");
|
cString str = GetAttribute(element, "colour");
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ namespace GUIHelpers {
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
void GetElement( tinyxml2::XMLElement& element, GUIEngine::cWindow* parent = nullptr ) const;
|
void GetElement( tinyxml2::XMLElement& element, GUIEngine::cWindow* parent = nullptr ) const;
|
||||||
const cString& GetAttribute( const tinyxml2::XMLElement& element, const cString& attribute ) const;
|
const cString GetAttribute( const tinyxml2::XMLElement& element, const cString& attribute ) const;
|
||||||
|
|
||||||
void Include( const tinyxml2::XMLElement& element, GUIEngine::cWindow* parent ) const;
|
void Include( const tinyxml2::XMLElement& element, GUIEngine::cWindow* parent ) const;
|
||||||
void GUISetup( const tinyxml2::XMLElement& element ) const;
|
void GUISetup( const tinyxml2::XMLElement& element ) const;
|
||||||
@@ -43,34 +43,34 @@ namespace GUIHelpers {
|
|||||||
GUIEngine::cLabel* LabelBuild( const tinyxml2::XMLElement& element, GUIEngine::cWindow* parent ) const;
|
GUIEngine::cLabel* LabelBuild( const tinyxml2::XMLElement& element, GUIEngine::cWindow* parent ) const;
|
||||||
GUIEngine::cBoxSizer* BoxSizerBuild( const tinyxml2::XMLElement& element, GUIEngine::cWindow* parent ) const;
|
GUIEngine::cBoxSizer* BoxSizerBuild( const tinyxml2::XMLElement& element, GUIEngine::cWindow* parent ) const;
|
||||||
|
|
||||||
const cString& getDir( const tinyxml2::XMLElement& element ) const;
|
const cString getDir( const tinyxml2::XMLElement& element ) const;
|
||||||
const cString& getFileName( const tinyxml2::XMLElement& element ) const;
|
const cString getFileName( const tinyxml2::XMLElement& element ) const;
|
||||||
const unsigned long int getDebug( const tinyxml2::XMLElement& element ) const;
|
const unsigned long int getDebug( const tinyxml2::XMLElement& element ) const;
|
||||||
const bool cXMLoader::getDebugXML(const tinyxml2::XMLElement& element) const;
|
const bool cXMLoader::getDebugXML(const tinyxml2::XMLElement& element) const;
|
||||||
const signed long int getID( const tinyxml2::XMLElement& element ) const;
|
const signed long int getID( const tinyxml2::XMLElement& element ) const;
|
||||||
const GUIHelpers::eOrientation getOrientation( const tinyxml2::XMLElement& element ) const;
|
const GUIHelpers::eOrientation getOrientation( const tinyxml2::XMLElement& element ) const;
|
||||||
const GUIHelpers::eAlign getAlign( const tinyxml2::XMLElement& element ) const;
|
const GUIHelpers::eAlign getAlign( const tinyxml2::XMLElement& element ) const;
|
||||||
const GUIHelpers::eLayout getLayout( const tinyxml2::XMLElement& element ) const;
|
const GUIHelpers::eLayout getLayout( const tinyxml2::XMLElement& element ) const;
|
||||||
const GUIHelpers::Position& getPosition( const tinyxml2::XMLElement& element ) const;
|
const GUIHelpers::Position getPosition( const tinyxml2::XMLElement& element ) const;
|
||||||
const GUIHelpers::Size& getSize( const tinyxml2::XMLElement& element ) const;
|
const GUIHelpers::Size getSize( const tinyxml2::XMLElement& element ) const;
|
||||||
const GUIHelpers::Padding& getPadding( const tinyxml2::XMLElement& element ) const;
|
const GUIHelpers::Padding getPadding( const tinyxml2::XMLElement& element ) const;
|
||||||
const cString& getText( const tinyxml2::XMLElement& element ) const;
|
const cString getText( const tinyxml2::XMLElement& element ) const;
|
||||||
|
|
||||||
const GUIHelpers::RGBA& getColour( const tinyxml2::XMLElement& element ) const;
|
const GUIHelpers::RGBA getColour( const tinyxml2::XMLElement& element ) const;
|
||||||
const signed long int getFontSize( const tinyxml2::XMLElement& element ) const;
|
const signed long int getFontSize( const tinyxml2::XMLElement& element ) const;
|
||||||
|
|
||||||
void LoadDefault() const;
|
void LoadDefault() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool m_loadDef;// = false;
|
bool m_loadDef;/// = false;
|
||||||
bool m_debugXML;
|
bool m_debugXML;/// = false;
|
||||||
|
|
||||||
GUIHelpers::eOrientation m_orientation;// = GUIHelpers::eOrientation::DEFAULT_ORIENTATION;
|
GUIHelpers::eOrientation m_orientation;/// = GUIHelpers::eOrientation::DEFAULT_ORIENTATION;
|
||||||
GUIHelpers::eAlign m_align;// = GUIHelpers::eAlign::DEFAULT_ALIGN;
|
GUIHelpers::eAlign m_align;/// = GUIHelpers::eAlign::DEFAULT_ALIGN;
|
||||||
GUIHelpers::eLayout m_layout;// = GUIHelpers::eLayout::DEFAULT_LAYOUT;
|
GUIHelpers::eLayout m_layout;/// = GUIHelpers::eLayout::DEFAULT_LAYOUT;
|
||||||
GUIHelpers::Position m_pos;// = { -1, -1 };
|
GUIHelpers::Position m_pos;/// = { -1, -1 };
|
||||||
GUIHelpers::Size m_size;// = { -1, -1 };
|
GUIHelpers::Size m_size;/// = { -1, -1 };
|
||||||
GUIHelpers::Padding m_pad;// = { -1, -1, -1, -1 };
|
GUIHelpers::Padding m_pad;/// = { -1, -1, -1, -1 };
|
||||||
};/// END CLASS DEFINITION cXMLoader
|
};/// END CLASS DEFINITION cXMLoader
|
||||||
}/// END NAMESPACE DEFINITION GUIHelpers
|
}/// END NAMESPACE DEFINITION GUIHelpers
|
||||||
#endif/// END IFNDEF _CXMLOADER_HPP_
|
#endif/// END IFNDEF _CXMLOADER_HPP_
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ void cButton::Create( cWindow* parent, const signed int id, const GUIHelpers::eA
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//private
|
/// private
|
||||||
void cButton::GenerateImage()
|
void cButton::GenerateImage()
|
||||||
{
|
{
|
||||||
GenerateTexture();
|
GenerateTexture();
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ namespace GUIEngine {
|
|||||||
|
|
||||||
virtual void Press();
|
virtual void Press();
|
||||||
|
|
||||||
//Sets
|
/// Sets
|
||||||
|
|
||||||
/// Gets
|
/// Gets
|
||||||
virtual const GUIHelpers::eType getType() const;
|
virtual const GUIHelpers::eType getType() const;
|
||||||
@@ -53,11 +53,11 @@ namespace GUIEngine {
|
|||||||
void GenerateTexture();
|
void GenerateTexture();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
VideoEngine::cImage* mp_texture;// = nullptr
|
VideoEngine::cImage* mp_texture;/// = nullptr
|
||||||
VideoEngine::cImage* mp_texturePress;// = nullptr
|
VideoEngine::cImage* mp_texturePress;/// = nullptr
|
||||||
|
|
||||||
//Pointer to the image that will be displayed on the button.
|
//Pointer to the image that will be displayed on the button.
|
||||||
VideoEngine::cImage** mpp_image;// = nullptr
|
VideoEngine::cImage** mpp_image;/// = nullptr
|
||||||
};/// END CLASS DEFINITION cButton
|
};/// END CLASS DEFINITION cButton
|
||||||
}/// END NAMESPACE DEFINITION GUIEngine
|
}/// END NAMESPACE DEFINITION GUIEngine
|
||||||
#endif/// END IFNDEF _CBUTTON_HPP_
|
#endif/// END IFNDEF _CBUTTON_HPP_
|
||||||
@@ -81,14 +81,14 @@ namespace GUIEngine {
|
|||||||
const bool IsInit() const;
|
const bool IsInit() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static cGUI* sp_inst;// = nullptr
|
static cGUI* sp_inst;/// = nullptr
|
||||||
|
|
||||||
unsigned long int m_debugLevel;// = 0
|
unsigned long int m_debugLevel;/// = 0
|
||||||
|
|
||||||
bool m_inited;// = false
|
bool m_inited;/// = false
|
||||||
|
|
||||||
/* default GUI font */
|
/* default GUI font */
|
||||||
TextTypeEngine::cFont* mp_font;// = nullptr
|
TextTypeEngine::cFont* mp_font;/// = nullptr
|
||||||
|
|
||||||
/* default GUI text colour black*/
|
/* default GUI text colour black*/
|
||||||
//GUIHelpers::RBGA m_textColour;// = { 0, 0, 0 }
|
//GUIHelpers::RBGA m_textColour;// = { 0, 0, 0 }
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ void cLabel::GenerateTexture()
|
|||||||
//this->setPosition()
|
//this->setPosition()
|
||||||
}
|
}
|
||||||
|
|
||||||
//Sets
|
/// Sets
|
||||||
void cLabel::setFontColour(const GUIHelpers::RGBA& colour)
|
void cLabel::setFontColour(const GUIHelpers::RGBA& colour)
|
||||||
{
|
{
|
||||||
mp_text->setColour(colour);
|
mp_text->setColour(colour);
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ namespace GUIEngine {
|
|||||||
|
|
||||||
void GenerateTexture();
|
void GenerateTexture();
|
||||||
|
|
||||||
//Sets
|
/// Sets
|
||||||
void setFontColour( const GUIHelpers::RGBA& colour );
|
void setFontColour( const GUIHelpers::RGBA& colour );
|
||||||
void setFontSize( const unsigned long int size );
|
void setFontSize( const unsigned long int size );
|
||||||
void setText( const cString& text );
|
void setText( const cString& text );
|
||||||
@@ -58,7 +58,7 @@ namespace GUIEngine {
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
VideoEngine::cSprite m_sprite;
|
VideoEngine::cSprite m_sprite;
|
||||||
TextTypeEngine::cText* mp_text;// = nullptr
|
TextTypeEngine::cText* mp_text;/// = nullptr
|
||||||
};/// END CLASS DEFINITION cLabel
|
};/// END CLASS DEFINITION cLabel
|
||||||
}/// END NAMESPACE DEFINITION GUIEngine
|
}/// END NAMESPACE DEFINITION GUIEngine
|
||||||
#endif/// END IFNDEF _CLABEL_HPP_
|
#endif/// END IFNDEF _CLABEL_HPP_
|
||||||
|
|||||||
@@ -37,7 +37,6 @@ cLayout::cLayout(cWindow* parent, const signed int id, const GUIHelpers::eOrient
|
|||||||
/// Set
|
/// Set
|
||||||
|
|
||||||
/// Get
|
/// Get
|
||||||
|
|
||||||
/*virtual*/ const GUIHelpers::eType cLayout::getType() const
|
/*virtual*/ const GUIHelpers::eType cLayout::getType() const
|
||||||
{
|
{
|
||||||
return GUIHelpers::eType::CLAYOUT;
|
return GUIHelpers::eType::CLAYOUT;
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ void cTextButton::Create(cWindow* parent, const signed int id, const cString& te
|
|||||||
setText(text);
|
setText(text);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Sets
|
/// Sets
|
||||||
void cTextButton::setText(const cString& text)
|
void cTextButton::setText(const cString& text)
|
||||||
{
|
{
|
||||||
m_label.setText(text);
|
m_label.setText(text);
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ namespace GUIEngine {
|
|||||||
const GUIHelpers::eLayout& layout = GUIHelpers::eLayout::FILL_PARENT, const GUIHelpers::Position& pos = sPOSITION,
|
const GUIHelpers::eLayout& layout = GUIHelpers::eLayout::FILL_PARENT, const GUIHelpers::Position& pos = sPOSITION,
|
||||||
const GUIHelpers::Size& size = sSIZE, const GUIHelpers::Padding& padding = sPADDING, const cString& name = sNAME);
|
const GUIHelpers::Size& size = sSIZE, const GUIHelpers::Padding& padding = sPADDING, const cString& name = sNAME);
|
||||||
|
|
||||||
//Sets
|
/// Sets
|
||||||
void setText( const cString& text );
|
void setText( const cString& text );
|
||||||
void setTextColour( const GUIHelpers::RGBA& colour );
|
void setTextColour( const GUIHelpers::RGBA& colour );
|
||||||
void setTextSize( const unsigned long int size );
|
void setTextSize( const unsigned long int size );
|
||||||
@@ -56,7 +56,7 @@ namespace GUIEngine {
|
|||||||
void GenerateTexture();
|
void GenerateTexture();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
cLabel m_label;// = nullptr
|
cLabel m_label;/// = nullptr
|
||||||
};/// END CLASS DEFINITION cButton
|
};/// END CLASS DEFINITION cButton
|
||||||
}/// END NAMESPACE DEFINITION GUIEngine
|
}/// END NAMESPACE DEFINITION GUIEngine
|
||||||
#endif/// END IFNDEF _CBUTTON_HPP_
|
#endif/// END IFNDEF _CBUTTON_HPP_
|
||||||
@@ -292,7 +292,7 @@ cWindow* cWindow::getParent()
|
|||||||
return GUIHelpers::eType::CWINDOW;
|
return GUIHelpers::eType::CWINDOW;
|
||||||
}
|
}
|
||||||
|
|
||||||
///Protected
|
/// protected
|
||||||
|
|
||||||
/*virtual*/ void cWindow::Resize()
|
/*virtual*/ void cWindow::Resize()
|
||||||
{
|
{
|
||||||
@@ -459,14 +459,14 @@ std::vector<cWindow*>& cWindow::getChildren()
|
|||||||
return m_children;
|
return m_children;
|
||||||
}
|
}
|
||||||
|
|
||||||
//private
|
/// private
|
||||||
void cWindow::AddSize( int x, int y, GUIHelpers::Size& mySize ) const
|
void cWindow::AddSize( const int x, const int y, GUIHelpers::Size& mySize ) const
|
||||||
{
|
{
|
||||||
int& addFrom = x;
|
int addFrom = x;
|
||||||
int& largestFrom = y;
|
int largestFrom = y;
|
||||||
|
|
||||||
int& addTo = mySize.x;
|
int addTo = mySize.x;
|
||||||
int& largestTo = mySize.y;
|
int largestTo = mySize.y;
|
||||||
|
|
||||||
if (m_orientation == GUIHelpers::eOrientation::HORIZONTAL) {
|
if (m_orientation == GUIHelpers::eOrientation::HORIZONTAL) {
|
||||||
addFrom = y;
|
addFrom = y;
|
||||||
|
|||||||
@@ -105,22 +105,22 @@ namespace GUIEngine {
|
|||||||
private:
|
private:
|
||||||
void Rebuild( cWindow* const parent, const GUIHelpers::eLayout& layout );
|
void Rebuild( cWindow* const parent, const GUIHelpers::eLayout& layout );
|
||||||
|
|
||||||
void AddSize( int x, int y, GUIHelpers::Size& mySize ) const;
|
void AddSize( const int x, const int y, GUIHelpers::Size& mySize ) const;
|
||||||
|
|
||||||
void DebugDisplay() const;
|
void DebugDisplay() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
GUIHelpers::eOrientation m_orientation;// = GUIHelper::eOrientation::NONE;
|
GUIHelpers::eOrientation m_orientation;/// = GUIHelper::eOrientation::NONE;
|
||||||
GUIHelpers::eAlign m_align;// = GUIHelper::eAlign::CENTER;
|
GUIHelpers::eAlign m_align;/// = GUIHelper::eAlign::CENTER;
|
||||||
GUIHelpers::eLayout m_layout;// = GUIHelper::eLayout::FILL_PARENT;
|
GUIHelpers::eLayout m_layout;/// = GUIHelper::eLayout::FILL_PARENT;
|
||||||
GUIHelpers::Position m_pos;// = POSITION;
|
GUIHelpers::Position m_pos;/// = POSITION;
|
||||||
GUIHelpers::Size m_size;// = SIZE;
|
GUIHelpers::Size m_size;/// = SIZE;
|
||||||
GUIHelpers::Padding m_padding;// = PADDING;
|
GUIHelpers::Padding m_padding;/// = PADDING;
|
||||||
GUIHelpers::Size m_content;// = m_size;
|
GUIHelpers::Size m_content;/// = m_size;
|
||||||
cString m_name;// = NAME;
|
cString m_name;/// = sNAME;
|
||||||
|
|
||||||
std::vector<cWindow*> m_children;
|
std::vector<cWindow*> m_children;
|
||||||
cWindow* mp_parent;// = nullptr;
|
cWindow* mp_parent;/// = nullptr;
|
||||||
};/// END CLASS DEFINITION cBoxSizer
|
};/// END CLASS DEFINITION cBoxSizer
|
||||||
}/// END NAMESPACE DEFINITION GUIEngine
|
}/// END NAMESPACE DEFINITION GUIEngine
|
||||||
#endif/// END IFNDEF _CBOXSIZER_HPP_
|
#endif/// END IFNDEF _CBOXSIZER_HPP_
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ using UtilityEngine::cUtility;
|
|||||||
|
|
||||||
/*static*/ cInput* cInput::sp_inst = nullptr;
|
/*static*/ cInput* cInput::sp_inst = nullptr;
|
||||||
|
|
||||||
//Private
|
/// private
|
||||||
cInput::cInput()
|
cInput::cInput()
|
||||||
{}
|
{}
|
||||||
|
|
||||||
@@ -17,7 +17,7 @@ cInput::~cInput()
|
|||||||
CleanUp();
|
CleanUp();
|
||||||
}
|
}
|
||||||
|
|
||||||
//Public
|
/// public
|
||||||
/*static*/ cInput& cInput::Inst()
|
/*static*/ cInput& cInput::Inst()
|
||||||
{
|
{
|
||||||
if (sp_inst == nullptr)
|
if (sp_inst == nullptr)
|
||||||
@@ -31,7 +31,7 @@ cInput::~cInput()
|
|||||||
sp_inst = nullptr;
|
sp_inst = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Functions
|
/// Functions
|
||||||
const bool cInput::Initialize() const
|
const bool cInput::Initialize() const
|
||||||
{
|
{
|
||||||
bool rtn = IsInit();
|
bool rtn = IsInit();
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ namespace InputEngine {
|
|||||||
static cInput& Inst();
|
static cInput& Inst();
|
||||||
static void Delete();
|
static void Delete();
|
||||||
|
|
||||||
//Functions
|
/// Functions
|
||||||
const bool Initialize() const;
|
const bool Initialize() const;
|
||||||
|
|
||||||
const bool Setup();
|
const bool Setup();
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ namespace InputEngine {
|
|||||||
|
|
||||||
virtual void OnJoyBall(SDL_JoystickID which, Uint8 ball, Sint16 xrel, Sint16 yrel);
|
virtual void OnJoyBall(SDL_JoystickID which, Uint8 ball, Sint16 xrel, Sint16 yrel);
|
||||||
|
|
||||||
//Used when looking for keys that have been add to the check list
|
/// Used when looking for keys that have been add to the check list
|
||||||
void JoystickCheck();
|
void JoystickCheck();
|
||||||
|
|
||||||
};/// END CLASS DEFINITION cJoystick
|
};/// END CLASS DEFINITION cJoystick
|
||||||
|
|||||||
@@ -66,6 +66,7 @@ void cKeyboard::DeleteAllKeys()
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Sets
|
/// Sets
|
||||||
|
/// Gets
|
||||||
const cString& cKeyboard::getLabel() const
|
const cString& cKeyboard::getLabel() const
|
||||||
{
|
{
|
||||||
return m_label;
|
return m_label;
|
||||||
|
|||||||
@@ -32,9 +32,9 @@ namespace InputEngine {
|
|||||||
cKeyboard( const cKeyboard& copy );
|
cKeyboard( const cKeyboard& copy );
|
||||||
virtual ~cKeyboard();
|
virtual ~cKeyboard();
|
||||||
|
|
||||||
///Funtions
|
/// Functions
|
||||||
|
|
||||||
//Used when looking for keys that have been add to the check list
|
/// Used when looking for keys that have been add to the check list
|
||||||
virtual void KeyboardCheck( const SDL_Event& event );
|
virtual void KeyboardCheck( const SDL_Event& event );
|
||||||
|
|
||||||
void AddKey( InputEngine::cKey* key );
|
void AddKey( InputEngine::cKey* key );
|
||||||
@@ -47,7 +47,7 @@ namespace InputEngine {
|
|||||||
const cString& getLabel() const;
|
const cString& getLabel() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
cString m_label;// = ""
|
cString m_label;/// = ""
|
||||||
|
|
||||||
std::vector<InputEngine::cKey*> m_keys;
|
std::vector<InputEngine::cKey*> m_keys;
|
||||||
};/// END CLASS DEFINITION cKeyboard
|
};/// END CLASS DEFINITION cKeyboard
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ const cString& cTextInput::getText() const
|
|||||||
return m_text;
|
return m_text;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Private
|
/// private
|
||||||
const char cTextInput::UnicodeValue( const SDL_Event& event )
|
const char cTextInput::UnicodeValue( const SDL_Event& event )
|
||||||
{
|
{
|
||||||
event;
|
event;
|
||||||
|
|||||||
@@ -38,13 +38,13 @@ namespace InputEngine {
|
|||||||
const char UnicodeValue( const SDL_Event& event );
|
const char UnicodeValue( const SDL_Event& event );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
cString m_text;// = ""
|
cString m_text;/// = ""
|
||||||
bool m_caps;// = false
|
bool m_caps;/// = false
|
||||||
bool m_shift;// = false
|
bool m_shift;/// = false
|
||||||
|
|
||||||
// magic numbers courtesy of SDL docs
|
/// magic numbers courtesy of SDL docs
|
||||||
const unsigned long int INTERNATIONAL_MASK;// = 0xFF80
|
const unsigned long int INTERNATIONAL_MASK;/// = 0xFF80
|
||||||
const unsigned long int UNICODE_MASK;// = 0x7F
|
const unsigned long int UNICODE_MASK;/// = 0x7F
|
||||||
};/// END CLASS DEFINITION cTextInput
|
};/// END CLASS DEFINITION cTextInput
|
||||||
}/// END NAMESPACE DEFINITION InputEngine
|
}/// END NAMESPACE DEFINITION InputEngine
|
||||||
#endif/// END IFNDEF _CTEXTINPUT_HPP_
|
#endif/// END IFNDEF _CTEXTINPUT_HPP_
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ cCollision::~cCollision()
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Functions
|
||||||
/*static*/ const bool cCollision::BoundingBox( const SDL_Rect& a, const SDL_Rect& b )
|
/*static*/ const bool cCollision::BoundingBox( const SDL_Rect& a, const SDL_Rect& b )
|
||||||
{
|
{
|
||||||
if ((b.x + b.w) < a.x)
|
if ((b.x + b.w) < a.x)
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ cRandom::cRandom()
|
|||||||
cRandom::~cRandom()
|
cRandom::~cRandom()
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
/// Functions
|
||||||
/*static*/ cRandom& cRandom::Inst()
|
/*static*/ cRandom& cRandom::Inst()
|
||||||
{
|
{
|
||||||
if (sp_inst == nullptr)
|
if (sp_inst == nullptr)
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ namespace MathEngine {
|
|||||||
const float Rand( const float max, const float min = 0.0f ) const;
|
const float Rand( const float max, const float min = 0.0f ) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static cRandom* sp_inst;// = nullptr
|
static cRandom* sp_inst;/// = nullptr
|
||||||
};/// END CLASS DEFINITION cRandom
|
};/// END CLASS DEFINITION cRandom
|
||||||
}/// END NAMESPACE DEFINITION MathEngine
|
}/// END NAMESPACE DEFINITION MathEngine
|
||||||
#endif/// END IFNDEF _CRANDOM_HPP_
|
#endif/// END IFNDEF _CRANDOM_HPP_
|
||||||
@@ -14,15 +14,15 @@ namespace TextTypeHelpers {
|
|||||||
public:
|
public:
|
||||||
cFontHolder( TTF_Font* font, const unsigned long int size );
|
cFontHolder( TTF_Font* font, const unsigned long int size );
|
||||||
~cFontHolder();
|
~cFontHolder();
|
||||||
///Sets
|
|
||||||
|
|
||||||
|
/// Sets
|
||||||
/// Gets
|
/// Gets
|
||||||
TTF_Font* getFont() const;
|
TTF_Font* getFont() const;
|
||||||
const unsigned long int getSize() const;
|
const unsigned long int getSize() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
TTF_Font* mp_font;// = nullptr
|
TTF_Font* mp_font;/// = nullptr
|
||||||
unsigned long int m_size;// = 16
|
unsigned long int m_size;/// = 16
|
||||||
};/// END CLASS DEFINITION cFontHolder
|
};/// END CLASS DEFINITION cFontHolder
|
||||||
}/// END NAMESPACE DEFINITION TextTypeHelpers
|
}/// END NAMESPACE DEFINITION TextTypeHelpers
|
||||||
#endif/// END IFNDEF _CFONTHOLDER_HPP_
|
#endif/// END IFNDEF _CFONTHOLDER_HPP_
|
||||||
@@ -84,7 +84,23 @@ TTF_Font* cFont::getFont( const unsigned long int size )
|
|||||||
return rtn;
|
return rtn;
|
||||||
}
|
}
|
||||||
|
|
||||||
//private:
|
bool cFont::operator == ( const cFont& rhs ) const
|
||||||
|
{
|
||||||
|
if ((this->m_dir == rhs.getDir()) && (this->m_fileName == rhs.getFileName()) && (this->getSize() == rhs.getSize()))
|
||||||
|
return true;
|
||||||
|
else
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool cFont::operator != ( const cFont& rhs ) const
|
||||||
|
{
|
||||||
|
if (*this == rhs)
|
||||||
|
return false;
|
||||||
|
else
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// private:
|
||||||
TTF_Font* cFont::LoadFont( const unsigned long int size )
|
TTF_Font* cFont::LoadFont( const unsigned long int size )
|
||||||
{
|
{
|
||||||
TTF_Font* rtn = nullptr;
|
TTF_Font* rtn = nullptr;
|
||||||
|
|||||||
@@ -57,6 +57,10 @@ namespace TextTypeEngine {
|
|||||||
/* Gets the TTF_Font. */
|
/* Gets the TTF_Font. */
|
||||||
TTF_Font* getFont( const unsigned long int size );
|
TTF_Font* getFont( const unsigned long int size );
|
||||||
|
|
||||||
|
/// operators
|
||||||
|
bool operator == ( const cFont& rhs ) const;
|
||||||
|
bool operator != ( const cFont& rhs ) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
TTF_Font* LoadFont( const unsigned long int size );
|
TTF_Font* LoadFont( const unsigned long int size );
|
||||||
TextTypeHelpers::cFontHolder* getFontHolder( 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;
|
std::vector<TextTypeHelpers::cFontHolder*> m_fonts;
|
||||||
//cFontHolder m_fonts;
|
//cFontHolder m_fonts;
|
||||||
//cFont::cFontHolder m_fonts;
|
//cFont::cFontHolder m_fonts;
|
||||||
TextTypeHelpers::cFontHolder** mpp_default;
|
TextTypeHelpers::cFontHolder** mpp_default;/// = nullptr
|
||||||
cString m_dir;// = ""
|
cString m_dir;/// = ""
|
||||||
cString m_fileName;// = ""
|
cString m_fileName;/// = ""
|
||||||
|
|
||||||
};/// END CLASS DEFINITION cFont
|
};/// END CLASS DEFINITION cFont
|
||||||
}/// END NAMESPACE DEFINITION TextTypeEngine
|
}/// END NAMESPACE DEFINITION TextTypeEngine
|
||||||
|
|||||||
@@ -72,16 +72,20 @@ void cText::Red()
|
|||||||
/// Sets
|
/// Sets
|
||||||
void cText::setSize(const unsigned long int size /*= 8*/)
|
void cText::setSize(const unsigned long int size /*= 8*/)
|
||||||
{
|
{
|
||||||
|
if (m_size != size) {
|
||||||
m_size = size;
|
m_size = size;
|
||||||
if ((mpp_font != nullptr) && ((*mpp_font) != nullptr))
|
if ((mpp_font != nullptr) && ((*mpp_font) != nullptr))
|
||||||
(*mpp_font)->setSize(size);
|
(*mpp_font)->setSize(size);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void cText::setFont( TextTypeEngine::cFont** font )
|
void cText::setFont( TextTypeEngine::cFont** font )
|
||||||
{
|
{
|
||||||
|
if ((*mpp_font) != (*font)) {
|
||||||
mpp_font = font;
|
mpp_font = font;
|
||||||
Text();
|
Text();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void cText::setText( const cString& text )
|
void cText::setText( const cString& text )
|
||||||
{
|
{
|
||||||
@@ -93,9 +97,11 @@ void cText::setText( const cString& text )
|
|||||||
|
|
||||||
void cText::setColour( const SDL_Colour& colour )
|
void cText::setColour( const SDL_Colour& colour )
|
||||||
{
|
{
|
||||||
|
if ((colour.a != m_colour.a) || (colour.b != m_colour.b) || (colour.g != m_colour.g) || (colour.r != m_colour.r)){
|
||||||
m_colour = colour;
|
m_colour = colour;
|
||||||
Text();
|
Text();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void cText::setColour( const unsigned long int red /*= 0*/, const unsigned long int green /*= 0*/, const unsigned long int blue /*= 0*/, unsigned long int alpha /*= 255*/ )
|
void cText::setColour( const unsigned long int red /*= 0*/, const unsigned long int green /*= 0*/, const unsigned long int blue /*= 0*/, unsigned long int alpha /*= 255*/ )
|
||||||
{
|
{
|
||||||
@@ -105,9 +111,11 @@ void cText::setColour( const unsigned long int red /*= 0*/, const unsigned long
|
|||||||
|
|
||||||
void cText::setRender( const eRender& render /*= eRender::Solid*/ )
|
void cText::setRender( const eRender& render /*= eRender::Solid*/ )
|
||||||
{
|
{
|
||||||
|
if (m_render != render) {
|
||||||
m_render = render;
|
m_render = render;
|
||||||
Text();
|
Text();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// Gets
|
/// Gets
|
||||||
const unsigned long int cText::getSize() const
|
const unsigned long int cText::getSize() const
|
||||||
@@ -146,7 +154,7 @@ const cText::eRender& cText::getRender() const
|
|||||||
return m_render;
|
return m_render;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Private
|
/// private
|
||||||
void cText::Text()
|
void cText::Text()
|
||||||
{
|
{
|
||||||
if((mpp_font != nullptr) && (*mpp_font != nullptr)) {
|
if((mpp_font != nullptr) && (*mpp_font != nullptr)) {
|
||||||
@@ -169,7 +177,7 @@ void cText::Text()
|
|||||||
} else {
|
} else {
|
||||||
SDL_Rect pos = { 0, 0, 0, 0 };
|
SDL_Rect pos = { 0, 0, 0, 0 };
|
||||||
//m_size == 25;
|
//m_size == 25;
|
||||||
SDL_Texture* texture = cRenderer::Inst().NewTexture(8 * m_text.length(), 8, SDL_TEXTUREACCESS_TARGET);
|
SDL_Texture* texture = cRenderer::Inst().NewTexture(8 * m_text.length(), 8, false, SDL_TEXTUREACCESS_TARGET);
|
||||||
SDL_SetTextureBlendMode(texture, SDL_BLENDMODE_BLEND);
|
SDL_SetTextureBlendMode(texture, SDL_BLENDMODE_BLEND);
|
||||||
|
|
||||||
//int t = SDL_SetTextureColorMod(texture, 0, 255, 0);
|
//int t = SDL_SetTextureColorMod(texture, 0, 255, 0);
|
||||||
|
|||||||
@@ -81,12 +81,12 @@ namespace TextTypeEngine {
|
|||||||
void Text();
|
void Text();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
TextTypeEngine::cFont** mpp_font;
|
TextTypeEngine::cFont** mpp_font;/// = nullptr
|
||||||
cString m_text;// = ""
|
cString m_text;/// = ""
|
||||||
|
|
||||||
unsigned long int m_size;// = 16
|
unsigned long int m_size;// = 16
|
||||||
SDL_Colour m_colour;// = nullptr
|
SDL_Colour m_colour;/// = nullptr
|
||||||
eRender m_render;// = Solid
|
eRender m_render;/// = Solid
|
||||||
};/// END CLASS DEFINITION cText
|
};/// END CLASS DEFINITION cText
|
||||||
}/// END NAMESPACE DEFINITION TextTypeEngine
|
}/// END NAMESPACE DEFINITION TextTypeEngine
|
||||||
#endif/// END IFNDEF _CTEXT_HPP_
|
#endif/// END IFNDEF _CTEXT_HPP_
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ using UtilityEngine::cUtility;
|
|||||||
|
|
||||||
/*static*/ cTextType* cTextType::sp_inst = nullptr;
|
/*static*/ cTextType* cTextType::sp_inst = nullptr;
|
||||||
|
|
||||||
//private
|
/// private
|
||||||
cTextType::cTextType()
|
cTextType::cTextType()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@@ -19,7 +19,7 @@ cTextType::~cTextType()
|
|||||||
TTF_Quit();
|
TTF_Quit();
|
||||||
}
|
}
|
||||||
|
|
||||||
//public:
|
/// public:
|
||||||
/// Functions
|
/// Functions
|
||||||
/*static*/ cTextType& cTextType::Inst()
|
/*static*/ cTextType& cTextType::Inst()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ namespace TextTypeEngine {
|
|||||||
const bool IsInit() const;
|
const bool IsInit() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static cTextType* sp_inst;// = nullptr
|
static cTextType* sp_inst;/// = nullptr
|
||||||
};/// END CLASS DEFINITION cTextType
|
};/// END CLASS DEFINITION cTextType
|
||||||
}/// END NAMESPACE DEFINITION TextTypeEngine
|
}/// END NAMESPACE DEFINITION TextTypeEngine
|
||||||
#endif/// END IFNDEF _CTEXTTYPE_HPP_
|
#endif/// END IFNDEF _CTEXTTYPE_HPP_
|
||||||
|
|||||||
@@ -126,7 +126,7 @@ const float cTiming::getFrameTime() const
|
|||||||
return m_frameTime;
|
return m_frameTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
///Private
|
/// private
|
||||||
/// Functions
|
/// Functions
|
||||||
const unsigned long int cTiming::TimeLeft()
|
const unsigned long int cTiming::TimeLeft()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -52,17 +52,17 @@ namespace TimingEngine {
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
/// Variables
|
/// Variables
|
||||||
unsigned long int m_nextTime;// = 0
|
unsigned long int m_nextTime;/// = 0
|
||||||
|
|
||||||
unsigned long int m_rate;// = (1000 / m_ftp)
|
unsigned long int m_rate;/// = (1000 / m_ftp)
|
||||||
|
|
||||||
unsigned long int m_ftp;// = 30
|
unsigned long int m_ftp;/// = 30
|
||||||
|
|
||||||
static cTiming* sp_inst;// = nullptr
|
static cTiming* sp_inst;/// = nullptr
|
||||||
|
|
||||||
unsigned long int m_start;// = 0
|
unsigned long int m_start;/// = 0
|
||||||
float m_lastTime;// = 0.0
|
float m_lastTime;/// = 0.0
|
||||||
float m_frameTime;// = 0.0
|
float m_frameTime;/// = 0.0
|
||||||
};/// END CLASS DEFINITION cTiming
|
};/// END CLASS DEFINITION cTiming
|
||||||
}/// END NAMESPACE DEFINITION TimingEngine
|
}/// END NAMESPACE DEFINITION TimingEngine
|
||||||
#endif/// END IFNDEF _CTIMING_HPP_
|
#endif/// END IFNDEF _CTIMING_HPP_
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ namespace TrooperEngineCore {
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
/// Variables
|
/// Variables
|
||||||
static cTrooperEngineCore* sp_inst;// = nullptr
|
static cTrooperEngineCore* sp_inst;/// = nullptr
|
||||||
};/// END CLASS DEFINITION cTrooperEngineCore
|
};/// END CLASS DEFINITION cTrooperEngineCore
|
||||||
}/// END NAMESPACE DEFINITION TroopperENgineCore
|
}/// END NAMESPACE DEFINITION TroopperENgineCore
|
||||||
#endif/// END IFNDEF _CTROOPERENGINECORE_HPP_
|
#endif/// END IFNDEF _CTROOPERENGINECORE_HPP_
|
||||||
|
|||||||
@@ -4,9 +4,9 @@
|
|||||||
#include <stdlib.h> /* strtol */
|
#include <stdlib.h> /* strtol */
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
// disable _s warnings
|
/// disable _s warnings
|
||||||
# define _CRT_SECURE_NO_WARNINGS
|
# define _CRT_SECURE_NO_WARNINGS
|
||||||
// disable pragma warnings
|
/// disable pragma warnings
|
||||||
# pragma warning( disable : 4068 )
|
# pragma warning( disable : 4068 )
|
||||||
# pragma warning( disable : 4996 )
|
# pragma warning( disable : 4996 )
|
||||||
# include "MSUNIX/msunix.hpp"
|
# include "MSUNIX/msunix.hpp"
|
||||||
@@ -86,7 +86,7 @@ size_t cString::size() const
|
|||||||
return m_len;
|
return m_len;
|
||||||
}
|
}
|
||||||
|
|
||||||
// string format
|
/// string format
|
||||||
cString& cString::format(const char* format, ...)
|
cString& cString::format(const char* format, ...)
|
||||||
{
|
{
|
||||||
char * buffer;
|
char * buffer;
|
||||||
@@ -100,7 +100,7 @@ cString& cString::format(const char* format, ...)
|
|||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
// trim leading and trailing spaces
|
/// trim leading and trailing spaces
|
||||||
cString& cString::trim()
|
cString& cString::trim()
|
||||||
{
|
{
|
||||||
const static char * whitespace = "\x20\x1b\t\r\n\v\b\f\a";
|
const static char * whitespace = "\x20\x1b\t\r\n\v\b\f\a";
|
||||||
@@ -164,7 +164,7 @@ const char& cString::last_char() const
|
|||||||
return mp_str[length() - 1];
|
return mp_str[length() - 1];
|
||||||
}
|
}
|
||||||
|
|
||||||
// non-destructive split
|
/// non-destructive split
|
||||||
const std::vector<cString> cString::split(const char match) const
|
const std::vector<cString> cString::split(const char match) const
|
||||||
{
|
{
|
||||||
const char match_s[2] = { match, 0 };
|
const char match_s[2] = { match, 0 };
|
||||||
@@ -185,14 +185,14 @@ const std::vector<cString> cString::split(const char* match, int max_split) cons
|
|||||||
if (match_len >= __cString__MAX_LEN)
|
if (match_len >= __cString__MAX_LEN)
|
||||||
return rtn;
|
return rtn;
|
||||||
|
|
||||||
char* mi; // match index
|
char* mi; /// match index
|
||||||
char* pstr = mp_str; // string pointer
|
char* pstr = mp_str; /// string pointer
|
||||||
while ((mi = strstr(pstr, match)) && (max_split < 0 || --max_split)) {
|
while ((mi = strstr(pstr, match)) && (max_split < 0 || --max_split)) {
|
||||||
if (mi != pstr) {
|
if (mi != pstr) {
|
||||||
size_t lhsz = mi - pstr;
|
size_t lhsz = mi - pstr;
|
||||||
char* cslhs = (char *)malloc(lhsz + 1);
|
char* cslhs = (char *)malloc(lhsz + 1);
|
||||||
cslhs[lhsz] = '\0'; // strncpy doesn't terminate it
|
cslhs[lhsz] = '\0'; /// strncpy doesn't terminate it
|
||||||
rtn.emplace_back(strncpy(cslhs, pstr, lhsz)); // calls cString copy ctor
|
rtn.emplace_back(strncpy(cslhs, pstr, lhsz)); /// calls cString copy ctor
|
||||||
pstr += lhsz;
|
pstr += lhsz;
|
||||||
free(cslhs);
|
free(cslhs);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,17 +22,17 @@ namespace UtilityEngine {
|
|||||||
class EXPORT_FROM_MYDLL cString
|
class EXPORT_FROM_MYDLL cString
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
cString(); // default constructor
|
cString(); /// default constructor
|
||||||
cString(const char* s);
|
cString(const char* s);
|
||||||
cString(const cString& copy); // copy constructor
|
cString(const cString& copy); /// copy constructor
|
||||||
~cString();
|
~cString();
|
||||||
|
|
||||||
const char* alloc_str(size_t sz); // smart alloc string
|
const char* alloc_str(size_t sz); /// smart alloc string
|
||||||
void clear(); // frees the string
|
void clear(); /// frees the string
|
||||||
const char* c_str() const; // getter
|
const char* c_str() const; /// getter
|
||||||
const char* copy_str(const char* copy); // alloc & copy
|
const char* copy_str(const char* copy); /// alloc & copy
|
||||||
|
|
||||||
// utility methods
|
/// utility methods
|
||||||
bool have_value() const;
|
bool have_value() const;
|
||||||
size_t length() const;
|
size_t length() const;
|
||||||
size_t size() const;
|
size_t size() const;
|
||||||
@@ -54,14 +54,14 @@ namespace UtilityEngine {
|
|||||||
const bool IsInt() const;
|
const bool IsInt() const;
|
||||||
const long int ToInt() const;
|
const long int ToInt() const;
|
||||||
|
|
||||||
// operators
|
/// operators
|
||||||
cString& operator = (const char* rhs); // assignment operator
|
cString& operator = (const char* rhs); /// assignment operator
|
||||||
cString& operator = (const cString& rhs); // assignment operator
|
cString& operator = (const cString& rhs); /// assignment operator
|
||||||
cString& operator += (const char rhs);
|
cString& operator += (const char rhs);
|
||||||
cString& operator += (const char* rhs); // concatenation operator
|
cString& operator += (const char* rhs); /// concatenation operator
|
||||||
cString& operator += (const cString& rhs); // concatenation operator
|
cString& operator += (const cString& rhs); /// concatenation operator
|
||||||
|
|
||||||
bool operator == (const char* rhs) const; // comparisons
|
bool operator == (const char* rhs) const; /// comparisons
|
||||||
bool operator == (const cString& rhs) const;
|
bool operator == (const cString& rhs) const;
|
||||||
bool operator != (const char* rhs) const;
|
bool operator != (const char* rhs) const;
|
||||||
bool operator != (const cString& rhs) const;
|
bool operator != (const cString& rhs) const;
|
||||||
@@ -70,16 +70,16 @@ namespace UtilityEngine {
|
|||||||
bool operator >= (const cString& rhs) const;
|
bool operator >= (const cString& rhs) const;
|
||||||
bool operator <= (const cString& rhs) const;
|
bool operator <= (const cString& rhs) const;
|
||||||
|
|
||||||
// conversion operators
|
/// conversion operators
|
||||||
operator const char* () const; // c-string type
|
operator const char* () const; /// c-string type
|
||||||
operator std::string () const; // c++ string class
|
operator std::string () const; /// c++ string class
|
||||||
|
|
||||||
private:
|
private:
|
||||||
char* mp_str = nullptr;
|
char* mp_str = nullptr;
|
||||||
size_t m_len = 0;
|
size_t m_len = 0;
|
||||||
|
|
||||||
};/// END CLASS DEFINITION cString
|
};/// END CLASS DEFINITION cString
|
||||||
// function overloads
|
|
||||||
}/// END NAMESPACE DEFINITION UtilityEngine
|
}/// END NAMESPACE DEFINITION UtilityEngine
|
||||||
|
/// function overloads
|
||||||
UtilityEngine::cString operator + (const UtilityEngine::cString& lhs, const UtilityEngine::cString& rhs);
|
UtilityEngine::cString operator + (const UtilityEngine::cString& lhs, const UtilityEngine::cString& rhs);
|
||||||
#endif/// END IFNDEF _CSTRING_HPP_
|
#endif/// END IFNDEF _CSTRING_HPP_
|
||||||
|
|||||||
@@ -11,14 +11,14 @@ using UtilityEngine::cUtility;
|
|||||||
|
|
||||||
/*static*/ cUtility* cUtility::sp_inst = nullptr;
|
/*static*/ cUtility* cUtility::sp_inst = nullptr;
|
||||||
|
|
||||||
//private:
|
/// private:
|
||||||
cUtility::cUtility()
|
cUtility::cUtility()
|
||||||
{}
|
{}
|
||||||
|
|
||||||
cUtility::~cUtility()
|
cUtility::~cUtility()
|
||||||
{}
|
{}
|
||||||
|
|
||||||
//public:
|
/// public:
|
||||||
// cUtility& cUtility::operator=( const cUtility& copy )
|
// cUtility& cUtility::operator=( const cUtility& copy )
|
||||||
// {
|
// {
|
||||||
// if (this != ©)
|
// if (this != ©)
|
||||||
@@ -124,7 +124,7 @@ void cUtility::PrintVersion( const eTypeSDL typeSDL /*= eTypeSDL::ALL*/ ) const
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
///Private:
|
/// private:
|
||||||
/// Functions
|
/// Functions
|
||||||
void cUtility::VersionParser( const cString& runCompiled, const SDL_version& version, const cString& type ) const
|
void cUtility::VersionParser( const cString& runCompiled, const SDL_version& version, const cString& type ) const
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
#define _CUTILITY_HPP_
|
#define _CUTILITY_HPP_
|
||||||
|
|
||||||
/*** ANSI C Header Files ***/
|
/*** ANSI C Header Files ***/
|
||||||
#include <stdio.h> //for __FUNCTION__
|
#include <stdio.h> /// for __FUNCTION__
|
||||||
|
|
||||||
#ifndef __FUNCTION__
|
#ifndef __FUNCTION__
|
||||||
# define __FUNCTION__ __func__
|
# define __FUNCTION__ __func__
|
||||||
@@ -56,7 +56,7 @@ namespace UtilityEngine {
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
/// Variables
|
/// Variables
|
||||||
static cUtility* sp_inst;// = nullptr
|
static cUtility* sp_inst;/// = nullptr
|
||||||
};/// END CLASS DEFINITION cUtility
|
};/// END CLASS DEFINITION cUtility
|
||||||
}/// END NAMESPACE DEFINITION UtilityEngine
|
}/// END NAMESPACE DEFINITION UtilityEngine
|
||||||
#endif/// END IFNDEF _CUTILITY_HPP_
|
#endif/// END IFNDEF _CUTILITY_HPP_
|
||||||
@@ -56,14 +56,14 @@ namespace VideoEngine {
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
/// Variables
|
/// Variables
|
||||||
unsigned long int m_xIncrement;// = 0
|
unsigned long int m_xIncrement;/// = 0
|
||||||
unsigned long int m_yIncrement;// = 0
|
unsigned long int m_yIncrement;/// = 0
|
||||||
|
|
||||||
unsigned long int m_fps;// = 16
|
unsigned long int m_fps;/// = 16
|
||||||
|
|
||||||
unsigned long int m_nextTime;// = 0
|
unsigned long int m_nextTime;/// = 0
|
||||||
|
|
||||||
unsigned long int m_RATE;// = 0
|
unsigned long int m_RATE;/// = 0
|
||||||
|
|
||||||
};/// END CLASS DEFINITION cAnimatedSprite
|
};/// END CLASS DEFINITION cAnimatedSprite
|
||||||
}/// END NAMESPACE DEFINITION VideoEngine
|
}/// END NAMESPACE DEFINITION VideoEngine
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ namespace VideoEngine {
|
|||||||
/// Variables
|
/// Variables
|
||||||
SDL_Rect m_position;
|
SDL_Rect m_position;
|
||||||
|
|
||||||
SDL_Texture* mp_texture;// = nullptr
|
SDL_Texture* mp_texture;/// = nullptr
|
||||||
|
|
||||||
//std::vector<cSprite*> m_sprites;
|
//std::vector<cSprite*> m_sprites;
|
||||||
//LinkList::cLList m_sprites;
|
//LinkList::cLList m_sprites;
|
||||||
|
|||||||
@@ -187,7 +187,7 @@ const bool cImage::getIsSurface() const
|
|||||||
return m_isSurface;
|
return m_isSurface;
|
||||||
}
|
}
|
||||||
|
|
||||||
//protected:
|
/// protected:
|
||||||
void cImage::setImage( SDL_Surface* surface )
|
void cImage::setImage( SDL_Surface* surface )
|
||||||
{
|
{
|
||||||
UnloadImage();
|
UnloadImage();
|
||||||
|
|||||||
@@ -82,16 +82,16 @@ namespace VideoEngine {
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
/// Variables
|
/// Variables
|
||||||
SDL_Texture* mp_texture;// = nullptr
|
SDL_Texture* mp_texture;/// = nullptr
|
||||||
SDL_Surface* mp_surface;// = nullptr
|
SDL_Surface* mp_surface;// = nullptr
|
||||||
|
|
||||||
bool m_transparent;// = false
|
bool m_transparent;/// = false
|
||||||
|
|
||||||
unsigned char m_transRed;// = 0
|
unsigned char m_transRed;/// = 0
|
||||||
unsigned char m_transBlue;// = 0
|
unsigned char m_transBlue;/// = 0
|
||||||
unsigned char m_transGreen;// = 255
|
unsigned char m_transGreen;/// = 255
|
||||||
|
|
||||||
unsigned char m_transLevel;// = 255
|
unsigned char m_transLevel;/// = 255
|
||||||
|
|
||||||
bool m_isSurface;
|
bool m_isSurface;
|
||||||
};/// END CLASS DEFINITION cImage
|
};/// END CLASS DEFINITION cImage
|
||||||
|
|||||||
@@ -45,8 +45,8 @@ namespace VideoEngine {
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
/// Variables
|
/// Variables
|
||||||
cString m_dir;// = ""
|
cString m_dir;/// = ""
|
||||||
cString m_fileName;// = ""
|
cString m_fileName;/// = ""
|
||||||
};/// END CLASS DEFINITION cImageFile
|
};/// END CLASS DEFINITION cImageFile
|
||||||
}/// END NAMESPACE DEFINITION VideoEngine
|
}/// END NAMESPACE DEFINITION VideoEngine
|
||||||
#endif/// END IFNDEF _CIMAGEFILE_HPP_
|
#endif/// END IFNDEF _CIMAGEFILE_HPP_
|
||||||
@@ -10,7 +10,7 @@ using UtilityEngine::cUtility;
|
|||||||
|
|
||||||
/*static*/ cRenderer* cRenderer::sp_inst = nullptr;
|
/*static*/ cRenderer* cRenderer::sp_inst = nullptr;
|
||||||
|
|
||||||
//private:
|
/// private:
|
||||||
cRenderer::cRenderer()
|
cRenderer::cRenderer()
|
||||||
: mp_renderer(nullptr), mp_rendererSoftware(nullptr)
|
: mp_renderer(nullptr), mp_rendererSoftware(nullptr)
|
||||||
{
|
{
|
||||||
@@ -22,7 +22,7 @@ cRenderer::~cRenderer()
|
|||||||
CleanUp();
|
CleanUp();
|
||||||
}
|
}
|
||||||
|
|
||||||
//public:
|
/// public:
|
||||||
/// Functions
|
/// Functions
|
||||||
/*static*/ cRenderer& cRenderer::Inst()
|
/*static*/ cRenderer& cRenderer::Inst()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -27,18 +27,24 @@ cSprite::cSprite( VideoEngine::cImage** image, VideoEngine::cCamera** camera /*=
|
|||||||
setEndImageArea(Uint16((*mpp_image)->getWidth()), Uint16((*mpp_image)->getHeight()));
|
setEndImageArea(Uint16((*mpp_image)->getWidth()), Uint16((*mpp_image)->getHeight()));
|
||||||
}
|
}
|
||||||
|
|
||||||
//cSprite::cSprite( TextTypeEngine::cText** image, VideoEngine::cCamera** camera /*= nullptr*/ )
|
cSprite::cSprite( const cSprite& copy )
|
||||||
/*: mpp_camera(camera)
|
|
||||||
{
|
{
|
||||||
image;
|
Copy(copy);
|
||||||
//VideoEngine::cImage* im = VideoEngine::cImage(*image);
|
}
|
||||||
setPosition(0, 0);
|
|
||||||
|
|
||||||
setStartImageArea(0, 0);
|
|
||||||
setEndImageArea(Uint16((*mpp_image)->getWidth()), Uint16((*mpp_image)->getHeight()));
|
|
||||||
}*/
|
|
||||||
|
|
||||||
cSprite& cSprite::operator=( const cSprite& copy )
|
cSprite& cSprite::operator=( const cSprite& copy )
|
||||||
|
{
|
||||||
|
return Copy(copy);
|
||||||
|
}
|
||||||
|
|
||||||
|
cSprite::~cSprite()
|
||||||
|
{
|
||||||
|
mpp_image = nullptr;
|
||||||
|
mpp_camera = nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Functions
|
||||||
|
cSprite& cSprite::Copy( const cSprite & copy )
|
||||||
{
|
{
|
||||||
if (this != ©)
|
if (this != ©)
|
||||||
{
|
{
|
||||||
@@ -63,17 +69,9 @@ cSprite& cSprite::operator=( const cSprite& copy )
|
|||||||
*mpp_image = copy.getImage();
|
*mpp_image = copy.getImage();
|
||||||
*mpp_camera = copy.getCamera();
|
*mpp_camera = copy.getCamera();
|
||||||
}
|
}
|
||||||
|
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
cSprite::~cSprite()
|
|
||||||
{
|
|
||||||
mpp_image = nullptr;
|
|
||||||
mpp_camera = nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
///Functions
|
|
||||||
void cSprite::Draw()
|
void cSprite::Draw()
|
||||||
{
|
{
|
||||||
//SDL_Texture* texture = (*mpp_image)->getImage();
|
//SDL_Texture* texture = (*mpp_image)->getImage();
|
||||||
@@ -196,7 +194,7 @@ void cSprite::setCamera( VideoEngine::cCamera** camera )
|
|||||||
mpp_camera = camera;
|
mpp_camera = camera;
|
||||||
}
|
}
|
||||||
|
|
||||||
///Get's
|
/// Gets
|
||||||
const signed long int cSprite::getPosX() const
|
const signed long int cSprite::getPosX() const
|
||||||
{
|
{
|
||||||
return m_position.x;
|
return m_position.x;
|
||||||
|
|||||||
@@ -28,10 +28,12 @@ namespace VideoEngine {
|
|||||||
const signed long int yarea = 0, const unsigned long int warea = 0, const unsigned long int harea = 0,
|
const signed long int yarea = 0, const unsigned long int warea = 0, const unsigned long int harea = 0,
|
||||||
VideoEngine::cImage** image = nullptr, VideoEngine::cCamera** camera = nullptr );
|
VideoEngine::cImage** image = nullptr, VideoEngine::cCamera** camera = nullptr );
|
||||||
|
|
||||||
|
cSprite( const cSprite& copy );
|
||||||
cSprite& operator=( const cSprite& copy );
|
cSprite& operator=( const cSprite& copy );
|
||||||
~cSprite();
|
~cSprite();
|
||||||
|
|
||||||
/// Functions
|
/// Functions
|
||||||
|
cSprite& Copy(const cSprite& copy);
|
||||||
/* Draws the sprite to the video buffer */
|
/* Draws the sprite to the video buffer */
|
||||||
void Draw();
|
void Draw();
|
||||||
/* Draws the sprite to the camera */
|
/* Draws the sprite to the camera */
|
||||||
@@ -109,8 +111,8 @@ namespace VideoEngine {
|
|||||||
|
|
||||||
SDL_Rect m_imageArea; /// What part of the image to take
|
SDL_Rect m_imageArea; /// What part of the image to take
|
||||||
|
|
||||||
VideoEngine::cImage** mpp_image;// = nullptr
|
VideoEngine::cImage** mpp_image;/// = nullptr
|
||||||
VideoEngine::cCamera** mpp_camera;// = nullptr
|
VideoEngine::cCamera** mpp_camera;/// = nullptr
|
||||||
};/// END CLASS DEFINITION cSprite
|
};/// END CLASS DEFINITION cSprite
|
||||||
}/// END NAMESPACE DEFINITION VideoEngine
|
}/// END NAMESPACE DEFINITION VideoEngine
|
||||||
#endif/// END IFNDEF _CSPRITE_HPP_
|
#endif/// END IFNDEF _CSPRITE_HPP_
|
||||||
|
|||||||
@@ -125,7 +125,7 @@ void cVideo::VideoSettings()
|
|||||||
m_videoSettings = (m_videoSettings | SDL_WINDOW_FULLSCREEN);
|
m_videoSettings = (m_videoSettings | SDL_WINDOW_FULLSCREEN);
|
||||||
}
|
}
|
||||||
|
|
||||||
///Set's
|
/// Sets
|
||||||
void cVideo::setWidth( const unsigned long int width /*= 640*/ )
|
void cVideo::setWidth( const unsigned long int width /*= 640*/ )
|
||||||
{
|
{
|
||||||
m_width = width;
|
m_width = width;
|
||||||
|
|||||||
@@ -105,22 +105,22 @@ namespace VideoEngine {
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
/// Variables
|
/// Variables
|
||||||
SDL_Window* mp_window;// = nullptr
|
SDL_Window* mp_window;/// = nullptr
|
||||||
//SDL_Renderer* mp_rend;// = nullptr
|
//SDL_Renderer* mp_rend;/// = nullptr
|
||||||
|
|
||||||
unsigned long int m_xPos;// = 100
|
unsigned long int m_xPos;/// = 100
|
||||||
unsigned long int m_yPos;// = 100
|
unsigned long int m_yPos;/// = 100
|
||||||
unsigned long int m_width;// = 640
|
unsigned long int m_width;/// = 640
|
||||||
unsigned long int m_height;// = 480
|
unsigned long int m_height;/// = 480
|
||||||
unsigned long int m_colour;// = 32
|
unsigned long int m_colour;/// = 32
|
||||||
|
|
||||||
bool m_hardwareVideo;// = false
|
bool m_hardwareVideo;/// = false
|
||||||
bool m_fullscreen;// = false
|
bool m_fullscreen;/// = false
|
||||||
bool m_vsync;// = false
|
bool m_vsync;/// = false
|
||||||
|
|
||||||
unsigned long int m_videoSettings;// = SDL_RENDERER_SOFTWARE
|
unsigned long int m_videoSettings;/// = SDL_RENDERER_SOFTWARE
|
||||||
|
|
||||||
static cVideo* sp_inst;// = nullptr
|
static cVideo* sp_inst;/// = nullptr
|
||||||
|
|
||||||
/*SDL interprets each pixel as a 32-bit number, so our masks must depend
|
/*SDL interprets each pixel as a 32-bit number, so our masks must depend
|
||||||
on the endianness (byte order) of the machine */
|
on the endianness (byte order) of the machine */
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
void EventEngineTest()
|
void EventEngineTest()
|
||||||
{
|
{
|
||||||
// cString
|
/// cString
|
||||||
printf("\nTesting cString -----\n\n");
|
printf("\nTesting cString -----\n\n");
|
||||||
|
|
||||||
UTest u("cString");
|
UTest u("cString");
|
||||||
|
|||||||
@@ -3,4 +3,4 @@
|
|||||||
|
|
||||||
void EventEngineTest();
|
void EventEngineTest();
|
||||||
|
|
||||||
#endif //__EVENTENGINETEST__
|
#endif ///__EVENTENGINETEST__
|
||||||
@@ -316,8 +316,6 @@ void GUIXMLBoxSizerTest()
|
|||||||
u.report();
|
u.report();
|
||||||
|
|
||||||
GUIEngine::cGUI::Inst().Delete();
|
GUIEngine::cGUI::Inst().Delete();
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void LoadFile( const cString& filename, const bool show /*= false*/ )
|
void LoadFile( const cString& filename, const bool show /*= false*/ )
|
||||||
|
|||||||
@@ -34,4 +34,4 @@ void cWindowTest( const cString& msg, UTest& u, GUIEngine::cWindow* win, const S
|
|||||||
void cWindowTest( const cString& msg, UTest& u, GUIEngine::cWindow* win, const GUIHelpers::Position& pos,
|
void cWindowTest( const cString& msg, UTest& u, GUIEngine::cWindow* win, const GUIHelpers::Position& pos,
|
||||||
const GUIHelpers::Size& size, const GUIHelpers::Padding& pad, const GUIHelpers::Position& center );
|
const GUIHelpers::Size& size, const GUIHelpers::Padding& pad, const GUIHelpers::Position& center );
|
||||||
|
|
||||||
#endif // __GUIXMLTEST__
|
#endif /// __GUIXMLTEST__
|
||||||
|
|||||||
@@ -150,6 +150,7 @@
|
|||||||
<ClCompile Include="main.cpp" />
|
<ClCompile Include="main.cpp" />
|
||||||
<ClCompile Include="UTest\UTest.cpp" />
|
<ClCompile Include="UTest\UTest.cpp" />
|
||||||
<ClCompile Include="UtilityEngineTest\StringTest.cpp" />
|
<ClCompile Include="UtilityEngineTest\StringTest.cpp" />
|
||||||
|
<ClCompile Include="UtilityEngineTest\UtilityEngineTest.cpp" />
|
||||||
<ClCompile Include="VideoEngineTest\ImageFileTest.cpp" />
|
<ClCompile Include="VideoEngineTest\ImageFileTest.cpp" />
|
||||||
<ClCompile Include="VideoEngineTest\RendererTest.cpp" />
|
<ClCompile Include="VideoEngineTest\RendererTest.cpp" />
|
||||||
<ClCompile Include="VideoEngineTest\VideoEngineTest.cpp" />
|
<ClCompile Include="VideoEngineTest\VideoEngineTest.cpp" />
|
||||||
@@ -160,6 +161,7 @@
|
|||||||
<ClInclude Include="GUIEngineTest\GUIXMLTest.hpp" />
|
<ClInclude Include="GUIEngineTest\GUIXMLTest.hpp" />
|
||||||
<ClInclude Include="UTest\UTest.hpp" />
|
<ClInclude Include="UTest\UTest.hpp" />
|
||||||
<ClInclude Include="UtilityEngineTest\StringTest.hpp" />
|
<ClInclude Include="UtilityEngineTest\StringTest.hpp" />
|
||||||
|
<ClInclude Include="UtilityEngineTest\UtilityEngineTest.hpp" />
|
||||||
<ClInclude Include="VideoEngineTest\ImageFileTest.hpp" />
|
<ClInclude Include="VideoEngineTest\ImageFileTest.hpp" />
|
||||||
<ClInclude Include="VideoEngineTest\RendererTest.hpp" />
|
<ClInclude Include="VideoEngineTest\RendererTest.hpp" />
|
||||||
<ClInclude Include="VideoEngineTest\VideoEngineTest.hpp" />
|
<ClInclude Include="VideoEngineTest\VideoEngineTest.hpp" />
|
||||||
|
|||||||
@@ -45,6 +45,9 @@
|
|||||||
<ClInclude Include="VideoEngineTest\VideoEngineTest.hpp">
|
<ClInclude Include="VideoEngineTest\VideoEngineTest.hpp">
|
||||||
<Filter>VideoEngineTest</Filter>
|
<Filter>VideoEngineTest</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
|
<ClInclude Include="UtilityEngineTest\UtilityEngineTest.hpp">
|
||||||
|
<Filter>UtitlityEngineTest</Filter>
|
||||||
|
</ClInclude>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClCompile Include="UTest\UTest.cpp">
|
<ClCompile Include="UTest\UTest.cpp">
|
||||||
@@ -72,6 +75,9 @@
|
|||||||
<ClCompile Include="VideoEngineTest\VideoEngineTest.cpp">
|
<ClCompile Include="VideoEngineTest\VideoEngineTest.cpp">
|
||||||
<Filter>VideoEngineTest</Filter>
|
<Filter>VideoEngineTest</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
<ClCompile Include="UtilityEngineTest\UtilityEngineTest.cpp">
|
||||||
|
<Filter>UtitlityEngineTest</Filter>
|
||||||
|
</ClCompile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Xml Include="xml\GUI.xml">
|
<Xml Include="xml\GUI.xml">
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ using UtilityEngine::cString;
|
|||||||
|
|
||||||
void StringTest()
|
void StringTest()
|
||||||
{
|
{
|
||||||
// cString
|
/// cString
|
||||||
printf("\nTesting cString -----\n\n");
|
printf("\nTesting cString -----\n\n");
|
||||||
|
|
||||||
UTest u("cString");
|
UTest u("cString");
|
||||||
|
|||||||
@@ -3,4 +3,4 @@
|
|||||||
|
|
||||||
void StringTest();
|
void StringTest();
|
||||||
|
|
||||||
#endif // __STRINGTEST__
|
#endif /// __STRINGTEST__
|
||||||
|
|||||||
@@ -0,0 +1,8 @@
|
|||||||
|
#include "UtilityEngineTest.hpp"
|
||||||
|
|
||||||
|
#include "StringTest.hpp"
|
||||||
|
|
||||||
|
void UtilityEngineTest()
|
||||||
|
{
|
||||||
|
StringTest();
|
||||||
|
}
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
#ifndef __UTILITYENGINETEST__
|
||||||
|
#define __UTILITYENGINETEST__
|
||||||
|
|
||||||
|
void UtilityEngineTest();
|
||||||
|
|
||||||
|
#endif /// __UTILITYENGINETEST__
|
||||||
@@ -11,7 +11,7 @@ using VideoEngine::cSprite;
|
|||||||
|
|
||||||
void ImageFileTest()
|
void ImageFileTest()
|
||||||
{
|
{
|
||||||
// cImageFile
|
/// cImageFile
|
||||||
printf("\nTesting cImageFile -----\n\n");
|
printf("\nTesting cImageFile -----\n\n");
|
||||||
|
|
||||||
UTest u("cImageFile");
|
UTest u("cImageFile");
|
||||||
|
|||||||
@@ -3,4 +3,4 @@
|
|||||||
|
|
||||||
void ImageFileTest();
|
void ImageFileTest();
|
||||||
|
|
||||||
#endif // __IMAGEFILETEST__
|
#endif /// __IMAGEFILETEST__
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ void RendererTest()
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
//u.test("Screen Shot", RendererTextureToSurface());
|
///u.test("Screen Shot", RendererTextureToSurface());
|
||||||
|
|
||||||
|
|
||||||
u.report();
|
u.report();
|
||||||
|
|||||||
@@ -9,4 +9,4 @@ const bool RendererAreaEqualNotEqual();
|
|||||||
|
|
||||||
const bool RendererTextureToSurface();
|
const bool RendererTextureToSurface();
|
||||||
|
|
||||||
#endif // __RENDERERTEST__
|
#endif /// __RENDERERTEST__
|
||||||
@@ -3,4 +3,4 @@
|
|||||||
|
|
||||||
void VideoEngineTest();
|
void VideoEngineTest();
|
||||||
|
|
||||||
#endif // __VIDEOENGINETEST__
|
#endif /// __VIDEOENGINETEST__
|
||||||
@@ -9,7 +9,7 @@ using VideoEngine::cVideo;
|
|||||||
|
|
||||||
void VideoTest()
|
void VideoTest()
|
||||||
{
|
{
|
||||||
// cVideo
|
/// cVideo
|
||||||
printf("\nTesting cVideo -----\n\n");
|
printf("\nTesting cVideo -----\n\n");
|
||||||
|
|
||||||
UTest u("cVideo");
|
UTest u("cVideo");
|
||||||
@@ -22,7 +22,7 @@ void VideoTest()
|
|||||||
|
|
||||||
u.test("Video Setup. Setup()", video.Setup());
|
u.test("Video Setup. Setup()", video.Setup());
|
||||||
|
|
||||||
// CaptionTest
|
/// CaptionTest
|
||||||
u.test("setCaption() and getCaption()", CaptionTest());
|
u.test("setCaption() and getCaption()", CaptionTest());
|
||||||
|
|
||||||
u.report();
|
u.report();
|
||||||
|
|||||||
@@ -5,4 +5,4 @@ void VideoTest();
|
|||||||
|
|
||||||
const bool CaptionTest();
|
const bool CaptionTest();
|
||||||
|
|
||||||
#endif // __VIDEOTEST__
|
#endif /// __VIDEOTEST__
|
||||||
@@ -26,7 +26,7 @@ see license.txt for details
|
|||||||
#include "VideoEngineTest/VideoEngineTest.hpp"
|
#include "VideoEngineTest/VideoEngineTest.hpp"
|
||||||
|
|
||||||
/*** Utility Engine Test ***/
|
/*** Utility Engine Test ***/
|
||||||
#include "UtilityEngineTest/StringTest.hpp"
|
#include "UtilityEngineTest/UtilityEngineTest.hpp"
|
||||||
|
|
||||||
/*** GUI Engine Test ***/
|
/*** GUI Engine Test ***/
|
||||||
#include "GUIEngineTest/GUIXMLTest.hpp"
|
#include "GUIEngineTest/GUIXMLTest.hpp"
|
||||||
@@ -47,12 +47,12 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
VideoEngineTest();
|
VideoEngineTest();
|
||||||
|
|
||||||
//UtilityEngineTest();
|
UtilityEngineTest();
|
||||||
|
|
||||||
|
|
||||||
//StringTest();
|
|
||||||
|
|
||||||
//GUIXMLTest();
|
|
||||||
|
GUIXMLTest();
|
||||||
|
|
||||||
//ImageTest();
|
//ImageTest();
|
||||||
|
|
||||||
|
|||||||
@@ -4,5 +4,6 @@
|
|||||||
<Layout>
|
<Layout>
|
||||||
<Boxsizer />
|
<Boxsizer />
|
||||||
<Label text="Box Sizer" />
|
<Label text="Box Sizer" />
|
||||||
|
<Boxsizer />
|
||||||
</Layout>
|
</Layout>
|
||||||
</Panel>
|
</Panel>
|
||||||
@@ -3,5 +3,6 @@
|
|||||||
<debug/>
|
<debug/>
|
||||||
<Layout>
|
<Layout>
|
||||||
<Label text="Hello world" />
|
<Label text="Hello world" />
|
||||||
|
<Include dir ="xml/" filename="include.xml"/>
|
||||||
</Layout>
|
</Layout>
|
||||||
</Panel>
|
</Panel>
|
||||||
|
|||||||
@@ -1,8 +1,3 @@
|
|||||||
<?xml version="1.0"?>
|
<?xml version="1.0"?>
|
||||||
<Layout layout="wrap_content">
|
<Boxsizer />
|
||||||
<Label
|
<Label text="Box Sizer" />
|
||||||
text="Hello World2"
|
|
||||||
padding=""/>
|
|
||||||
<Label
|
|
||||||
text="Richard Allen2"/>
|
|
||||||
</Layout>
|
|
||||||
Reference in New Issue
Block a user