BoxSizer to Sizer

This commit is contained in:
2018-08-15 22:04:06 -04:00
parent 353dc21750
commit bd3c111fa1
67 changed files with 369 additions and 308 deletions
@@ -4,14 +4,14 @@ using VideoEngine::cAnimatedSprite;
cAnimatedSprite::cAnimatedSprite( const unsigned long int x /*= 0*/, const unsigned long int y /*= 0*/,
const unsigned long int fps /*= 16*/ )
: m_nextTime(0), m_RATE(0)
: m_nextTime(0), m_RATE(0)
{
setFPS(fps);
setIncrement(x, y);
}
cAnimatedSprite::cAnimatedSprite( const cAnimatedSprite& copy )
: m_nextTime(0), m_RATE(0)
: m_nextTime(0), m_RATE(0)
{
setFPS(copy.getFPS());
setIncrement(copy.getXIncrement(), copy.getYIncrement());
@@ -9,7 +9,7 @@ using UtilityEngine::cUtility;
cCamera::cCamera( const signed long int xPos /*= 0*/, const signed long int yPos /*= 0*/,
const unsigned long int reswidth /*= 640*/, const unsigned long int reshight /*= 480*/ )
: mp_texture(nullptr)
: mp_texture(nullptr)
{
m_position.x = Sint16(xPos);
m_position.y = Sint16(yPos);
@@ -9,27 +9,27 @@ using UtilityEngine::cUtility;
cImage::cImage( 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*/ )
: mp_texture(nullptr), mp_surface(nullptr), m_transparent(transparent),
m_transRed(red), m_transBlue(blue), m_transGreen(green), m_transLevel(translevel), m_isSurface(isSurface)
: mp_texture(nullptr), mp_surface(nullptr), m_transparent(transparent),
m_transRed(red), m_transBlue(blue), m_transGreen(green), m_transLevel(translevel), m_isSurface(isSurface)
{}
cImage::cImage( SDL_Surface* surface )
: mp_texture(nullptr), mp_surface(nullptr), m_transparent(false),
m_transRed(0), m_transBlue(0), m_transGreen(255), m_transLevel(255)
: mp_texture(nullptr), mp_surface(nullptr), m_transparent(false),
m_transRed(0), m_transBlue(0), m_transGreen(255), m_transLevel(255)
{
setImage(surface);
}
cImage::cImage( SDL_Texture* texture )
: mp_texture(nullptr), mp_surface(nullptr), m_transparent(false),
m_transRed(0), m_transBlue(0), m_transGreen(255), m_transLevel(255)
m_transRed(0), m_transBlue(0), m_transGreen(255), m_transLevel(255)
{
setImage(texture);
}
cImage::cImage( const cImage& copy, const bool surfaceCopy /*= true*/)
: mp_texture(nullptr), mp_surface(nullptr), m_transparent(copy.getTransparent()), m_transRed(copy.getRedTrans()),
m_transBlue(copy.getBlueTrans()), m_transGreen(copy.getGreenTrans()), m_transLevel(copy.getLevelTrans())
: mp_texture(nullptr), mp_surface(nullptr), m_transparent(copy.getTransparent()), m_transRed(copy.getRedTrans()),
m_transBlue(copy.getBlueTrans()), m_transGreen(copy.getGreenTrans()), m_transLevel(copy.getLevelTrans())
{
if (surfaceCopy == true)
mp_texture = copy.getImage();
@@ -47,7 +47,7 @@ namespace VideoEngine {
SDL_Texture* SurfaceToTexture( SDL_Surface* surface );
SDL_Surface* TextureToSurface( SDL_Texture* texture );
void CopyTexture( SDL_Texture* src, SDL_Texture* dst, bool software = false);
void CopyTexture( SDL_Texture* src, SDL_Texture* dst, bool software = false );
SDL_Surface* CopySurface( SDL_Surface* src );
@@ -7,19 +7,8 @@ using VideoEngine::cSprite;
using MathEngine::iVector2;
using MathEngine::iVector4;
cSprite::cSprite( const signed long int xpos /*= 0*/, const signed long int ypos /*= 0*/, const signed long int xarea /*= 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*/ )
: mpp_image(image), mpp_camera(camera)
{
setPosition(Sint16(xpos), Sint16(ypos));
setStartImageArea(Sint16(xarea), Sint16(yarea));
setEndImageArea(Uint16(warea), Uint16(harea));
}
cSprite::cSprite( VideoEngine::cImage** image, VideoEngine::cCamera** camera /*= nullptr*/ )
: mpp_image(image), mpp_camera(camera)
: mpp_image(image), mpp_camera(camera)
{
setPosition(0, 0);
@@ -27,6 +16,17 @@ cSprite::cSprite( VideoEngine::cImage** image, VideoEngine::cCamera** camera /*=
setEndImageArea(Uint16((*mpp_image)->getWidth()), Uint16((*mpp_image)->getHeight()));
}
cSprite::cSprite( const signed long int xpos /*= 0*/, const signed long int ypos /*= 0*/, const signed long int xarea /*= 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*/ )
: mpp_image(image), mpp_camera(camera)
{
setPosition(Sint16(xpos), Sint16(ypos));
setStartImageArea(Sint16(xarea), Sint16(yarea));
setEndImageArea(Uint16(warea), Uint16(harea));
}
cSprite::cSprite( const cSprite& copy )
{
Copy(copy);
@@ -156,7 +156,7 @@ void cSprite::setPosition( const MathEngine::iVector2& position /*= MathEngine::
setPosition(position.x, position.y);
}
void cSprite::setImageArea( const MathEngine::iVector4& area /*= MathEngine::iVector4(0,0,0,0)*/)
void cSprite::setImageArea( const MathEngine::iVector4& area /*= MathEngine::iVector4(0,0,0,0)*/ )
{
if (area == iVector4(0,0,0,0)) {
setStartImageArea(0,0);
@@ -189,6 +189,11 @@ void cSprite::setImage( VideoEngine::cImage** image )
mpp_image = image;
}
void cSprite::setImage(VideoEngine::cImageFile** image)
{
setImage((VideoEngine::cImage**) image);
}
void cSprite::setCamera( VideoEngine::cCamera** camera )
{
mpp_camera = camera;
@@ -6,6 +6,7 @@
/*** Custom Header Files ***/
#include "cImage.hpp"
#include "cImageFile.hpp"
#include "cCamera.hpp"
#include "../TextTypeEngine/cText.hpp"
@@ -27,13 +28,13 @@ namespace VideoEngine {
cSprite( const signed long int xpos = 0, const signed long int ypos = 0, const signed long int xarea = 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 );
cSprite( const cSprite& copy );
cSprite& operator=( const cSprite& copy );
~cSprite();
/// Functions
cSprite& Copy(const cSprite& copy);
cSprite& Copy( const cSprite& copy );
/* Draws the sprite to the video buffer */
void Draw();
/* Draws the sprite to the camera */
@@ -67,6 +68,7 @@ namespace VideoEngine {
/* Sets the pointer to a pointer for the image that the sprite will use */
void setImage( VideoEngine::cImage** image );
void setImage( VideoEngine::cImageFile** image );
/* Sets the pointer to a pointer for the camera the sprite will be draw on */
void setCamera( VideoEngine::cCamera** camera );