Graphic module improvements.

--HG--
branch : dev
This commit is contained in:
Martín Lucas Golini
2017-02-17 23:22:49 -03:00
parent fdf67752a3
commit ba3781229d
62 changed files with 589 additions and 567 deletions

View File

@@ -41,10 +41,10 @@ class EE_API BatchRenderer {
void setBlendMode( const EE_BLEND_MODE& Blend );
/** Set if every batch call have to be immediately rendered */
void batchForceRendering( const bool& force ) { mForceRendering = force; }
void setBatchForceRendering( const bool& force ) { mForceRendering = force; }
/** Get if the rendering is force on every batch call */
bool batchForceRendering() const { return mForceRendering; }
bool getBatchForceRendering() const { return mForceRendering; }
/** Force the batch rendering */
void draw();
@@ -53,31 +53,31 @@ class EE_API BatchRenderer {
void drawOpt();
/** Set the rotation of the rendered vertex. */
void batchRotation( const Float& Rotation ) { mRotation = Rotation; }
void setBatchRotation( const Float& Rotation ) { mRotation = Rotation; }
/** Get the rotation of the rendered vertex. */
Float batchRotation() const { return mRotation; }
Float getBatchRotation() const { return mRotation; }
/** Set the scale of the rendered vertex. */
void batchScale( const Vector2f& Scale ) { mScale = Scale; }
void setBatchScale( const Vector2f& Scale ) { mScale = Scale; }
/** Set the scale of the rendered vertex. */
void batchScale( const Float& Scale ) { mScale = Vector2f( Scale, Scale ); }
void setBatchScale( const Float& Scale ) { mScale = Vector2f( Scale, Scale ); }
/** Get the scale of the rendered vertex. */
Vector2f batchScale() const { return mScale; }
Vector2f getBatchScale() const { return mScale; }
/** The batch position */
void batchPosition( const Vector2f Pos ) { mPosition = Pos; }
void setBatchPosition( const Vector2f Pos ) { mPosition = Pos; }
/** @return The batch position */
Vector2f batchPosition() const { return mPosition; }
Vector2f getBatchPosition() const { return mPosition; }
/** This will set a center position for rotating and scaling the batched vertex. */
void batchCenter( const Vector2f Pos ) { mCenter = Pos; }
void setBatchCenter( const Vector2f Pos ) { mCenter = Pos; }
/** @return The batch center position */
Vector2f batchCenter() const { return mCenter; }
Vector2f getBatchCenter() const { return mCenter; }
/** Add to the batch a quad ( this will change your batch rendering method to DM_QUADS, so if you were using another one will Draw all the batched vertexs first ) */
void batchQuadEx( Float x, Float y, Float width, Float height, Float angle = 0.0f, Vector2f scale = Vector2f::One, OriginPoint originPoint = OriginPoint(OriginPoint::OriginCenter) );
@@ -227,10 +227,10 @@ class EE_API BatchRenderer {
void batchPolygonByPoint( const Vector2f& Vector );
/** Foce the blending mode change, ignoring if it's the same that before ( so you can change the blend mode and restore it without problems ) */
void forceBlendModeChange( const bool& Force );
void setForceBlendModeChange( const bool& Force );
/** @return If the blending mode switch is forced */
const bool& forceBlendModeChange() const;
const bool& getForceBlendModeChange() const;
protected:
eeVertex * mVertex;
unsigned int mVertexSize;

View File

@@ -12,16 +12,16 @@ class EE_API BlendMode {
* @param SrcFactor Source Factor
* @param DestFactor Destination Factor
*/
static void SetBlendFunc( const EE_BLEND_FUNC& SrcFactor, const EE_BLEND_FUNC& DestFactor );
static void setBlendFunc( const EE_BLEND_FUNC& SrcFactor, const EE_BLEND_FUNC& DestFactor );
/** Set a Predefined Blend Function
* @param blend The Blend Mode
* @param force If force to apply the blend ( no matters if the last blend was the same blend )
*/
static void SetMode( const EE_BLEND_MODE& blend, bool force = false );
static void setMode( const EE_BLEND_MODE& blend, bool force = false );
/** @return The last used predefined blend func */
static EE_BLEND_MODE GetPreBlendFunc();
static EE_BLEND_MODE getPreBlendFunc();
protected:
static EE_BLEND_MODE sLastBlend;
};

View File

@@ -27,40 +27,40 @@ class EE_API Console : protected LogReaderInterface {
~Console();
/** Set the Console Height when it's Minimized ( Not Maximized ) */
void consoleMinimizedHeight( const Float& MinHeight ) { mHeightMin = MinHeight; if (mVisible && !mExpand) mCurHeight = mHeightMin; }
void setConsoleMinimizedHeight( const Float& MinHeight ) { mHeightMin = MinHeight; if (mVisible && !mExpand) mCurHeight = mHeightMin; }
/** Get the Console Height when it's Minimized ( Not Maximized ) */
Float consoleMinimizedHeight() const { return mHeightMin; }
Float getConsoleMinimizedHeight() const { return mHeightMin; }
/** Set the Texture Id for the Background, 0 will disable texture background */
void textureId( const Uint32& TexId ) { mTexId = TexId; }
void setBackgroundTextureId( const Uint32& TexId ) { mTexId = TexId; }
/** Get the Background Texture Id */
Uint32 textureId() const { return mTexId; }
Uint32 getBackgroundTextureId() const { return mTexId; }
/** Set the Console Background Color */
void backgroundColor( const ColorA& BackColor ) { mConColor = BackColor; }
void setBackgroundColor( const ColorA& BackColor ) { mConColor = BackColor; }
/** Get the Console Background Color */
const ColorA& backgroundColor() const { return mConColor; }
const ColorA& getBackgroundColor() const { return mConColor; }
/** Set the Console Border Line Background Color */
void backgroundLineColor( const ColorA& BackColor ) { mConLineColor = BackColor; }
void setBackgroundLineColor( const ColorA& BackColor ) { mConLineColor = BackColor; }
/** Get the Console Border Line Background Color */
const ColorA& backgroundLineColor() const { return mConLineColor; }
const ColorA& getBackgroundLineColor() const { return mConLineColor; }
/** Set the Console Font Color */
void fontColor( const ColorA& FntColor ) { mFontColor = FntColor; }
void setFontColor( const ColorA& FntColor ) { mFontColor = FntColor; }
/** Get the Console Font Color */
const ColorA& fontColor() const { return mFontColor; }
const ColorA& getFontColor() const { return mFontColor; }
/** Set the Console Client Input ( Writeable Line ) Font Color */
void fontLineColor( const ColorA& FntColor ) { mFontLineColor = FntColor; }
void setFontLineColor( const ColorA& FntColor ) { mFontLineColor = FntColor; }
/** Get the Console Client Input ( Writeable Line ) Font Color */
const ColorA& fontLineColor() const { return mFontLineColor; }
const ColorA& getFontLineColor() const { return mFontLineColor; }
/** Toogle the console between visible and hided with Fade In or Fade Out effect. */
void toggle();
@@ -72,19 +72,19 @@ class EE_API Console : protected LogReaderInterface {
void fadeOut();
/** @return If Console Active ( Visible ) */
bool active() const { return mVisible; }
bool isActive() const { return mVisible; }
/** Maximize or Minimize the Console */
void expand(const bool& Exp) { mExpand = Exp; }
void setExpanded(const bool& Exp) { mExpand = Exp; }
/** @return If console is maximized */
bool expand() const { return mExpand; }
bool isExpanded() const { return mExpand; }
/** Set the fade time */
void fadeSpeed( const Time& fadespeed ) { mFadeSpeed = fadespeed; }
void setFadeSpeed( const Time& fadespeed ) { mFadeSpeed = fadespeed; }
/** @return The fading speed in ms */
const Time& fadeSpeed() const { return mFadeSpeed; }
const Time& getFadeSpeed() const { return mFadeSpeed; }
/** @brief Creates the new console
* @param Font The Font pointer to class

View File

@@ -31,16 +31,16 @@ class EE_API Font {
virtual int getNumLines();
/** @return The Font Color */
const ColorA& color() const;
const ColorA& getColor() const;
/** Set the color of the string rendered */
void color(const ColorA& color);
void setColor(const ColorA& color);
/** @return The Shadow Font Color */
const ColorA& shadowColor() const;
const ColorA& getShadowColor() const;
/** Set the shadow color of the string rendered */
void shadowColor(const ColorA& color);
void setShadowColor(const ColorA& color);
/** @return The current font size */
Uint32 getFontSize() const;

View File

@@ -48,10 +48,10 @@ class EE_API FrameBuffer {
Texture * getTexture() const;
/** @brief Sets the frame buffer clear color. */
void clearColor( ColorAf Color );
void setClearColor( ColorAf Color );
/** @return The clear color used for the frame buffer. */
ColorAf clearColor() const;
ColorAf getClearColor() const;
/** @return The frame buffer width. */
const Int32& getWidth() const;

View File

@@ -100,28 +100,28 @@ class EE_API Image {
Uint8 * getPixels() const;
/** Set the image Width */
void width( const unsigned int& width );
void setWidth( const unsigned int& width );
/** @return The image Width */
unsigned int width() const;
unsigned int getWidth() const;
/** Set the image Height */
void height( const unsigned int& height );
void setHeight( const unsigned int& height );
/** @return The image Height */
unsigned int height() const;
unsigned int getHeight() const;
/** @return The number of channels used by the image */
unsigned int channels() const;
unsigned int getChannels() const;
/** Set the number of channels of the image */
void channels( const unsigned int& channels );
void setChannels( const unsigned int& setChannels );
/** Clears the current image cache if exists */
void clearCache();
/** @return The Image Size on Memory (in bytes) */
unsigned int memSize() const;
unsigned int getMemSize() const;
/** @return The image dimensions */
Sizei getSize();

View File

@@ -12,8 +12,9 @@ class EE_API Particle{
Particle();
~Particle();
void Color(ColorAf Color, Float alphaDecay);
ColorAf Color() const { return mColor; }
void setColor(ColorAf Color, Float alphaDecay);
const ColorAf& getColor() const { return mColor; }
Float r() { return mColor.r(); }
Float g() { return mColor.g(); }
@@ -21,37 +22,48 @@ class EE_API Particle{
Float a() { return mColor.a(); }
void reset(const Float &x, const Float &y, const Float &xspeed, const Float &yspeed, const Float &xacc, const Float &yacc, const Float size = 16);
void update(const Float &pTime);
void X(const Float x) { mX = x; }
Float X() const { return mX; }
void setX(const Float& x) { mX = x; }
const Float& getX() const { return mX; }
void Y(const Float y) { mY = y; }
Float Y() const { return mY; }
void setY(const Float& y) { mY = y; }
const Float& getY() const { return mY; }
void xSpeed(const Float xspeed) { mXSpeed = xspeed; }
Float xSpeed() const { return mXSpeed; }
void setXSpeed(const Float xspeed) { mXSpeed = xspeed; }
const Float& getXSpeed() const { return mXSpeed; }
void ySpeed(const Float yspeed) { mYSpeed = yspeed; }
Float ySpeed() const { return mYSpeed; }
void setYSpeed(const Float& yspeed) { mYSpeed = yspeed; }
const Float& getYSpeed() const { return mYSpeed; }
void xAcc(const Float xacc) { mXAcc = xacc; }
Float xAcc() const { return mXAcc; }
void setXAcc(const Float& xacc) { mXAcc = xacc; }
const Float& getXAcc() const { return mXAcc; }
void yAcc(const Float yacc) { mYAcc = yacc; }
Float yAcc() const { return mYAcc; }
void setYAcc(const Float& yacc) { mYAcc = yacc; }
const Float& getYAcc() const { return mYAcc; }
void alphaDecay(const Float alphadecay) { mAlphaDecay = alphadecay; }
Float alphaDecay() const { return mAlphaDecay; }
void setAlphaDecay(const Float& alphadecay) { mAlphaDecay = alphadecay; }
const Float& getAlphaDecay() const { return mAlphaDecay; }
void size(const Float size) { if (size>0) mSize = size; }
Float size() const { return mSize; }
void setSize(const Float& size) { if (size>0) mSize = size; }
const Float& getSize() const { return mSize; }
void used(const bool used) { mUsed = used; }
bool used() const { return mUsed; }
void setUsed(const bool& used) { mUsed = used; }
bool isUsed() const { return mUsed; }
void id(const Uint32 id) { mId = id; }
Uint32 id() const { return mId; }
void setId(const Uint32& id) { mId = id; }
const Uint32& getId() const { return mId; }
private:
Float mX, mY;
ColorAf mColor;

View File

@@ -101,55 +101,55 @@ class EE_API ParticleSystem {
bool isUsing() const;
/** Update the effect position */
void position( const Float& x, const Float& y );
void setPosition( const Float& x, const Float& y );
/** Update the effect position */
void position( const Vector2f& Pos );
void setPosition( const Vector2f& Pos );
/** @return The effect position */
const Vector2f& position() const;
const Vector2f& getPosition() const;
/** Update the effect position 2 */
void position2( const Float& x, const Float& y );
void setPosition2( const Float& x, const Float& y );
/** Update the effect position 2 */
void position2( const Vector2f& Pos );
void setPosition2( const Vector2f& Pos );
/** @return The effect position 2 */
const Vector2f& position2() const;
const Vector2f& getPosition2() const;
/** Set a callback function for the reset effect of the particles. \n The reset it's where do you create the effect for every single particle. */
void setCallbackReset( const ParticleCallback& pc );
/** @return The effect blend mode */
const EE_BLEND_MODE& blendMode() const;
const EE_BLEND_MODE& getBlendMode() const;
/** Set the effect blend mode */
void blendMode( const EE_BLEND_MODE& mode );
void setBlendMode( const EE_BLEND_MODE& mode );
/** @return The color of the effect */
const ColorAf& color() const;
const ColorAf& getColor() const;
/** Set the color of the effect */
void color( const ColorAf& Col );
void setColor( const ColorAf& Col );
/** @return The alpha decay of the effect */
const Float& alphaDecay() const;
const Float& getAlphaDecay() const;
/** Set the alpha decay of the effect */
void alphaDecay( const Float& Decay );
void setAlphaDecay( const Float& Decay );
/** @return The Speed of the effect */
const Vector2f& speed() const;
const Vector2f& getSpeed() const;
/** Set the Speed of the effect */
void speed( const Vector2f& speed );
void setSpeed( const Vector2f& speed );
/** @return The Acceleration of the effect */
const Vector2f& acceleration() const;
const Vector2f& getAcceleration() const;
/** Set The Acceleration of the effect */
void acceleration( const Vector2f& acc );
void setAcceleration( const Vector2f& acc );
private:
Particle * mParticle;
Uint32 mPCount;

View File

@@ -116,33 +116,36 @@ class EE_API Primitives {
/** Set the current color for drawing primitives */
void setColor( const ColorA& Color );
/** Forcing the draw, will force the batch renderer to draw the batched vertexs immediately ( active by default ). */
void forceDraw( const bool& force );
/** @return The color used to draw the primitives */
const ColorA& getColor();
const bool& forceDraw() const;
/** Forcing the draw, will force the batch renderer to draw the batched vertexs immediately ( active by default ). */
void setForceDraw( const bool& force );
const bool& getForceDraw() const;
/** Force to draw the batched vertexs. */
void drawBatch();
/** Set the fill mode used to draw primitives */
void fillMode( const EE_FILL_MODE& Mode );
void setFillMode( const EE_FILL_MODE& Mode );
/** @return The fill mode used to draw primitives */
const EE_FILL_MODE& fillMode() const;
const EE_FILL_MODE& getFillMode() const;
/** Set the blend mode used to draw primitives */
void blendMode( const EE_BLEND_MODE& Mode );
void setBlendMode( const EE_BLEND_MODE& Mode );
/** @return The blend mode used to draw primitives */
const EE_BLEND_MODE& blendMode() const;
const EE_BLEND_MODE& getBlendMode() const;
/** Set the line width to draw primitives */
void lineWidth( const Float& width );
void setLineWidth( const Float& width );
/** @return The line with to draw primitives */
const Float& lineWidth() const;
const Float& getLineWidth() const;
private:
ColorA mColor;
ColorA mColor;
EE_FILL_MODE mFillMode;
EE_BLEND_MODE mBlendMode;
Float mLineWidth;

View File

@@ -37,45 +37,45 @@ class EE_API ScrollParallax {
bool create( Graphics::SubTexture * subTexture, const Vector2f& position = Vector2f(), const Sizef& size = Sizef(), const Vector2f& speed = Vector2f(), const ColorA& color = ColorA(), const EE_BLEND_MODE& Blend = ALPHA_NORMAL );
/** Set the parallax texture color. */
void color( const ColorA& Color ) { mColor = Color; }
void setColor( const ColorA& Color ) { mColor = Color; }
/** Get the parallax texture color. */
ColorA color() const { return mColor; }
ColorA getColor() const { return mColor; }
/** Set the Blend Mode used. */
void blendMode( const EE_BLEND_MODE& Blend ) { mBlend = Blend; }
void setBlendMode( const EE_BLEND_MODE& Blend ) { mBlend = Blend; }
/** @return The Blend Mode used for the parallax. */
const EE_BLEND_MODE& blendMode() const { return mBlend; }
const EE_BLEND_MODE& getBlendMode() const { return mBlend; }
/** Draw the Scroll Parallax. */
void draw();
/** Change the size of the current parallax
* @param size The new size */
void size( const Sizef& size );
void setSize( const Sizef& size );
/** @return Size */
const Sizef& size() const;
const Sizef& getSize() const;
/** Change the Parallax position
* @param Pos The new parallax position */
void position( const Vector2f& Pos );
void setPosition( const Vector2f& Pos );
/** @return The parallax position */
const Vector2f& position() const;
const Vector2f& getPosition() const;
/** @return The SubTexture used for the parallax.*/
Graphics::SubTexture * subTexture() const;
Graphics::SubTexture * getSubTexture() const;
/** Set Change the SubTexture used for the parallax. */
void subTexture( Graphics::SubTexture * subTexture );
void setSubTexture( Graphics::SubTexture * subTexture );
/** Set the parallax speed movement. */
void speed( const Vector2f& speed );
void setSpeed( const Vector2f& speed );
/** @return The parallax movement speed. */
const Vector2f& speed() const;
const Vector2f& getSpeed() const;
private:
Graphics::SubTexture * mSubTexture;
EE_BLEND_MODE mBlend;

View File

@@ -55,10 +55,10 @@ class EE_API ShaderProgram {
virtual void unbind() const;
/** @return The location of the location name */
Int32 uniformLocation( const std::string& getName );
Int32 getUniformLocation( const std::string& getName );
/** @return The location of the attribute name */
Int32 attributeLocation( const std::string& getName );
Int32 getAttributeLocation( const std::string& getName );
/** Clear the locations */
void invalidateLocations();

View File

@@ -52,35 +52,35 @@ class EE_API Sprite {
Sprite& operator =( const Sprite& Other );
/** Set the x axis position */
void x( const Float& x );
void setX( const Float& getX );
/** @return The x axis position */
Float x() const;
Float getX() const;
/** Set the y axis position */
void y( const Float& y );
void setY( const Float& y );
/** @return The y axis position */
Float y() const;
Float getY() const;
/** Set the Angle for the rendered sprite */
void angle( const Float& angle );
void setRotation( const Float& rotation );
/** @return The Angle for the rendered sprite */
Float angle() const;
Float getRotation() const;
/** Rotates the sprite. Adds the new angle to the current rotation. Same as:
** @code sprite.Angle( sprite.Angle() + angle ); @endcode */
void rotate( const Float& angle );
/** Set the Scale for the rendered sprite */
void scale( const Float& scale );
void setScale( const Float& scale );
/** Set the Scale for the rendered sprite */
void scale( const Vector2f& scale );
void setScale( const Vector2f& scale );
/** @return The Scale for the rendered sprite */
const Vector2f& scale() const;
const Vector2f& getScale() const;
/** @brief Set the local origin of the sprite
** The origin of an object defines the center point for
@@ -88,85 +88,85 @@ class EE_API Sprite {
** The coordinates of this point must be relative to the
** top-left corner of the sprite.
** The default origin point is the center of the sprite. */
void origin( const OriginPoint& origin );
void setOrigin( const OriginPoint& origin );
/** @return The local origin of the sprite */
const OriginPoint& origin() const;
const OriginPoint& getOrigin() const;
/** Set the Frame Number Sprite Size
* @param Size The new size
* @param FrameNum If the Frame Number is 0 it will use the Current Frame Number
* @param SubFrame If the Sub Frame Number is 0 it will use the Current Sub Frame Number
*/
void size( const Sizef& size, const unsigned int& FrameNum, const unsigned int& SubFrame );
void setSize( const Sizef& size, const unsigned int& FrameNum, const unsigned int& SubFrame );
/** Set the current SubTexture Size ( destination size ) */
void size( const Sizef& size );
void setSize( const Sizef& size );
/** @return the Frame Number Sprite Size
* @param FrameNum If the Frame Number is 0 it will use the Current Frame Number
* @param SubFrame If the Sub Frame Number is 0 it will use the Current Sub Frame Number
*/
Sizef size( const unsigned int& FrameNum, const unsigned int& SubFrame );
Sizef setSize( const unsigned int& FrameNum, const unsigned int& SubFrame );
/** @return The current Frame Size */
Sizef size();
Sizef getSize();
/** Set the sprite animation speed ( AnimSpeed equals to Animation Frames per Second ) */
void animSpeed( const Float& animSpeed );
void setAnimationSpeed( const Float& animSpeed );
/** @return The sprite animation speed ( AnimSpeed equals to Animation Frames per Second ) */
Float animSpeed() const;
Float getAnimationSpeed() const;
/** @return If the animation is paused */
bool animPaused() const;
bool isAnimationPaused() const;
/** Set the animation paused or not */
void animPaused( const bool& Pause );
void setAnimationPaused( const bool& Pause );
/** Set the sprite color */
void color( const ColorA& color);
void setColor( const ColorA& color);
/** @return The sprite color */
const ColorA& color() const;
const ColorA& getColor() const;
/** Set the sprite Color Alpha */
void alpha( const Uint8& alpha );
void setAlpha( const Uint8& alpha );
/** @return The sprite Color Alpha */
const Uint8& alpha() const;
const Uint8& getAlpha() const;
/** Set the Current Frame */
void currentFrame( unsigned int CurFrame );
void setCurrentFrame( unsigned int CurFrame );
/** @return The Current Frame */
const unsigned int& currentFrame() const;
const unsigned int& getCurrentFrame() const;
/** @return The Exact Current FrameData
* @return The Float fpoint of the current frame, the exact position of the interpolation.
*/
const Float& exactCurrentFrame() const;
const Float& getExactCurrentFrame() const;
/** Set the exact current FrameData */
void exactCurrentFrame( const Float& currentFrame );
void setExactCurrentFrame( const Float& currentFrame );
/** Set the Current Sub Frame */
void currentSubFrame( const unsigned int &CurSubFrame );
void setCurrentSubFrame( const unsigned int &CurSubFrame );
/** @return The Current Sub Frame */
const unsigned int& currentSubFrame() const;
const unsigned int& getCurrentSubFrame() const;
/** Set the Render Type */
void renderMode( const EE_RENDER_MODE& Effect );
void setRenderMode( const EE_RENDER_MODE& Effect );
/** @return The Render Type */
const EE_RENDER_MODE& renderMode() const;
const EE_RENDER_MODE& getRenderMode() const;
/** Set the Blend Mode */
void blendMode( const EE_BLEND_MODE& Blend );
void setBlendMode( const EE_BLEND_MODE& Blend );
/** @return The Blend Mode */
const EE_BLEND_MODE& blendMode() const;
const EE_BLEND_MODE& getBlendMode() const;
/** Reset the sprite as a new one. */
void reset();
@@ -175,13 +175,13 @@ class EE_API Sprite {
eeAABB getAABB();
/** Set the sprite position */
void position( const Float& x, const Float& y );
void setPosition( const Float& getX, const Float& y );
/** Set the sprite position from a Vector */
void position( const Vector2f& NewPos );
void setPosition( const Vector2f& NewPos );
/** @return The Position of the sprite */
const Vector2f position() const;
const Vector2f getPosition() const;
/** Update the colors of every vertex rendered of the sprite ( this will override the default color )
* @param Color0 The Left - Top vertex color
@@ -281,25 +281,25 @@ class EE_API Sprite {
void setRepetitions( const int& Repeations );
/** Set if the class auto-animate the sprite ( default it's active ) */
void autoAnimate( const bool& Autoanim );
void setAutoAnimate( const bool& Autoanim );
/** @return If the class is auto-animated */
bool autoAnimate() const;
bool getAutoAnimate() const;
/** @return The four vertex position of the Sprite */
Quad2f getQuad();
/** @return The Offset of the current frame */
Vector2i offset();
Vector2i getOffset();
/** Set the Offset of the current frame */
void offset( const Vector2i& offset );
void setOffset( const Vector2i& offset );
/** Reverse the animation from last frame to first mFrames. */
void reverseAnim( const bool& Reverse );
/** Reverse the animation from last frame to first frame. */
void setReverseAnimation( const bool& Reverse );
/** @return If the animation is reversed */
bool reverseAnim() const;
bool getReverseAnimation() const;
/** @return The current last frame */
unsigned int getEndFrame();
@@ -361,7 +361,7 @@ class EE_API Sprite {
Uint32 mFlags;
Vector2f mPos;
OriginPoint mOrigin;
Float mAngle;
Float mRotation;
Vector2f mScale;
Float mAnimSpeed;

View File

@@ -10,3 +10,5 @@
#define EE_OPENSSL
#define EE_BACKEND_SFML_ACTIVE
#define EE_BACKEND_SDL2
#define EE_GL3_ENABLED
#define EE_SHADERS_SUPPORTED

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 4.2.0, 2017-02-17T17:01:42. -->
<!-- Written by QtCreator 4.2.0, 2017-02-17T23:21:27. -->
<qtcreator>
<data>
<variable>EnvironmentId</variable>

View File

@@ -39,11 +39,11 @@ void GameObjectObject::Draw() {
Int32 colFill = 100 + selAdd;
Primitives P;
P.fillMode( DRAW_FILL );
P.setFillMode( DRAW_FILL );
P.setColor( ColorA( colFill, colFill, colFill, colFill ) );
P.drawRectangle( mRect );
P.fillMode( DRAW_LINE );
P.setFillMode( DRAW_LINE );
P.setColor( ColorA( 255, 255, 0, 200 ) );
P.drawRectangle( mRect );
}

View File

@@ -32,11 +32,11 @@ void GameObjectPolygon::Draw() {
Int32 colFill = 100 + selAdd;
Primitives P;
P.fillMode( DRAW_FILL );
P.setFillMode( DRAW_FILL );
P.setColor( ColorA( colFill, colFill, colFill, colFill ) );
P.drawPolygon( mPoly );
P.fillMode( DRAW_LINE );
P.setFillMode( DRAW_LINE );
P.setColor( ColorA( 255, 255, 0, 200 ) );
P.drawPolygon( mPoly );
}

View File

@@ -26,12 +26,12 @@ void GameObjectPolyline::Draw() {
Primitives P;
if ( mSelected ) {
P.fillMode( DRAW_FILL );
P.setFillMode( DRAW_FILL );
P.setColor( ColorA( 150, 150, 150, 150 ) );
P.drawPolygon( mPoly );
}
P.fillMode( DRAW_LINE );
P.setFillMode( DRAW_LINE );
P.setColor( ColorA( 255, 255, 0, 200 ) );
P.drawPolygon( mPoly );
}

View File

@@ -11,7 +11,7 @@ GameObjectSprite::GameObjectSprite( const Uint32& Flags, MapLayer * Layer, Graph
mSprite( Sprite )
{
if ( NULL != mSprite )
mSprite->renderMode( RenderModeFromFlags() );
mSprite->setRenderMode( RenderModeFromFlags() );
AssignTilePos();
}
@@ -30,7 +30,7 @@ bool GameObjectSprite::IsType( const Uint32& type ) {
void GameObjectSprite::Draw() {
if ( NULL != mSprite ) {
mSprite->angle( GetAngle() );
mSprite->setRotation( GetAngle() );
if ( mLayer->Map()->LightsEnabled() && mLayer->LightsEnabled() ) {
MapLightManager * LM = mLayer->Map()->GetLightManager();
@@ -46,7 +46,7 @@ void GameObjectSprite::Draw() {
*LM->GetTileColor( Tile, 3 )
);
} else {
mSprite->color( *LM->GetTileColor( Tile ) );
mSprite->setColor( *LM->GetTileColor( Tile ) );
}
} else {
if ( LM->IsByVertex() ) {
@@ -59,7 +59,7 @@ void GameObjectSprite::Draw() {
LM->GetColorFromPos( Q.V[3] )
);
} else {
mSprite->color( LM->GetColorFromPos( mSprite->position() ) );
mSprite->setColor( LM->GetColorFromPos( mSprite->getPosition() ) );
}
}
}
@@ -70,14 +70,14 @@ void GameObjectSprite::Draw() {
Vector2f GameObjectSprite::Pos() const {
if ( NULL != mSprite )
return mSprite->position();
return mSprite->getPosition();
return Vector2f();
}
void GameObjectSprite::Pos( Vector2f pos ) {
if ( NULL != mSprite ) {
mSprite->position( pos );
mSprite->setPosition( pos );
GameObject::Pos( pos );
}
}
@@ -104,12 +104,12 @@ Graphics::Sprite * GameObjectSprite::Sprite() const {
void GameObjectSprite::Sprite( Graphics::Sprite * sprite ) {
eeSAFE_DELETE( mSprite );
mSprite = sprite;
mSprite->renderMode( RenderModeFromFlags() );
mSprite->setRenderMode( RenderModeFromFlags() );
}
void GameObjectSprite::FlagSet( const Uint32& Flag ) {
if ( NULL != mSprite )
mSprite->renderMode( RenderModeFromFlags() );
mSprite->setRenderMode( RenderModeFromFlags() );
GameObject::FlagSet( Flag );
}

View File

@@ -371,7 +371,7 @@ void UIMap::MapDraw() {
Vector2f Pos( mSelLight->GetAABB().Left, mSelLight->GetAABB().Top );
eeAABB AB( mSelLight->GetAABB() );
mP.fillMode( DRAW_LINE );
mP.setFillMode( DRAW_LINE );
mP.drawRectangle( Rectf( Pos, AB.getSize() ) );
}
} else if ( EDITING_OBJECT == mEditingMode ) {
@@ -379,11 +379,11 @@ void UIMap::MapDraw() {
case INSERT_OBJECT:
{
if ( mObjRECTEditing ) {
mP.fillMode( DRAW_FILL );
mP.setFillMode( DRAW_FILL );
mP.setColor( ColorA( 100, 100, 100, 20 ) );
mP.drawRectangle( mObjRECT );
mP.fillMode( DRAW_LINE );
mP.setFillMode( DRAW_LINE );
mP.setColor( ColorA( 255, 0, 0, 200 ) );
mP.drawRectangle( mObjRECT );
}
@@ -392,22 +392,22 @@ void UIMap::MapDraw() {
}
case INSERT_POLYGON:
{
mP.fillMode( DRAW_FILL );
mP.setFillMode( DRAW_FILL );
mP.setColor( ColorA( 50, 50, 50, 50 ) );
mP.drawPolygon( mObjPoly );
mP.fillMode( DRAW_LINE );
mP.setFillMode( DRAW_LINE );
mP.setColor( ColorA( 255, 0, 0, 200 ) );
mP.drawPolygon( mObjPoly );
Polygon2f polyN( mObjPoly );
polyN.pushBack( GetMouseMapPos() );
mP.fillMode( DRAW_FILL );
mP.setFillMode( DRAW_FILL );
mP.setColor( ColorA( 100, 100, 100, 100 ) );
mP.drawPolygon( polyN );
mP.fillMode( DRAW_LINE );
mP.setFillMode( DRAW_LINE );
mP.setColor( ColorA( 255, 255, 0, 200 ) );
mP.drawPolygon( polyN );
@@ -415,14 +415,14 @@ void UIMap::MapDraw() {
}
case INSERT_POLYLINE:
{
mP.fillMode( DRAW_LINE );
mP.setFillMode( DRAW_LINE );
mP.setColor( ColorA( 255, 0, 0, 200 ) );
mP.drawPolygon( mObjPoly );
Polygon2f polyN( mObjPoly );
polyN.pushBack( GetMouseMapPos() );
mP.fillMode( DRAW_LINE );
mP.setFillMode( DRAW_LINE );
mP.setColor( ColorA( 255, 255, 0, 200 ) );
mP.drawPolygon( polyN );
@@ -433,10 +433,10 @@ void UIMap::MapDraw() {
if ( NULL != mSelObj && eeINDEX_NOT_FOUND != mSelPointIndex ) {
mP.setColor( ColorA( 255, 255, 100, 100 ) );
mP.fillMode( DRAW_FILL );
mP.setFillMode( DRAW_FILL );
mP.drawRectangle( mSelPointRect );
mP.fillMode( DRAW_LINE );
mP.setFillMode( DRAW_LINE );
mP.drawRectangle( mSelPointRect );
}

View File

@@ -131,21 +131,21 @@ void TileMap::CreateEmptyTile() {
Img.fillWithColor( ColorA( 0, 0, 0, 0 ) );
for ( x = 0; x < Img.width(); x++ ) {
for ( x = 0; x < Img.getWidth(); x++ ) {
Img.setPixel( x, 0, Col );
Img.setPixel( x, mTileSize.y - 1, Col );
}
for ( y = 0; y < Img.height(); y++ ) {
for ( y = 0; y < Img.getHeight(); y++ ) {
Img.setPixel( 0, y, Col );
Img.setPixel( mTileSize.x - 1, y, Col );
}
Uint32 TileTexId = TF->loadFromPixels(
Img.getPixelsPtr(),
Img.width(),
Img.height(),
Img.channels(),
Img.getWidth(),
Img.getHeight(),
Img.getChannels(),
true,
CLAMP_TO_EDGE,
false,

View File

@@ -111,11 +111,11 @@ void BatchRenderer::flush() {
bool CreateMatrix = ( mRotation || mScale != 1.0f || mPosition.x || mPosition.y );
BlendMode::SetMode( mBlend );
BlendMode::setMode( mBlend );
if ( mCurrentMode == DM_POINTS && NULL != mTexture ) {
GLi->enable( GL_POINT_SPRITE );
GLi->pointSize( (float)mTexture->width() );
GLi->pointSize( (float)mTexture->getWidth() );
}
if ( CreateMatrix ) {
@@ -814,11 +814,11 @@ Float BatchRenderer::getPointSize() {
return GLi->pointSize();
}
void BatchRenderer::forceBlendModeChange( const bool& Force ) {
void BatchRenderer::setForceBlendModeChange( const bool& Force ) {
mForceBlendMode = Force;
}
const bool& BatchRenderer::forceBlendModeChange() const {
const bool& BatchRenderer::getForceBlendModeChange() const {
return mForceBlendMode;
}

View File

@@ -6,7 +6,7 @@ namespace EE { namespace Graphics {
EE_BLEND_MODE BlendMode::sLastBlend = ALPHA_NORMAL;
void BlendMode::SetMode( const EE_BLEND_MODE& blend, bool force ) {
void BlendMode::setMode( const EE_BLEND_MODE& blend, bool force ) {
if ( sLastBlend != blend || force ) {
if (blend == ALPHA_NONE) {
GLi->disable( GL_BLEND );
@@ -56,7 +56,7 @@ void BlendMode::SetMode( const EE_BLEND_MODE& blend, bool force ) {
}
}
void BlendMode::SetBlendFunc( const EE_BLEND_FUNC& SrcFactor, const EE_BLEND_FUNC& DestFactor ) {
void BlendMode::setBlendFunc( const EE_BLEND_FUNC& SrcFactor, const EE_BLEND_FUNC& DestFactor ) {
GLi->enable( GL_BLEND );
GLi->blendFunc( (unsigned int)SrcFactor, (unsigned int)DestFactor );
@@ -64,7 +64,7 @@ void BlendMode::SetBlendFunc( const EE_BLEND_FUNC& SrcFactor, const EE_BLEND_FUN
sLastBlend = ALPHA_CUSTOM;
}
EE_BLEND_MODE BlendMode::GetPreBlendFunc() {
EE_BLEND_MODE BlendMode::getPreBlendFunc() {
return sLastBlend;
}

View File

@@ -155,7 +155,7 @@ void Console::addCommand( const String& Command, ConsoleCallback CB ) {
void Console::draw() {
if ( mEnabled && NULL != mFont ) {
ColorA OldColor( mFont->color() );
ColorA OldColor( mFont->getColor() );
fade();
@@ -188,7 +188,7 @@ void Console::draw() {
mCon.ConMin = mEx;
mCon.ConMax = (int)mCmdLog.size() - 1;
mFont->color( ColorA ( mFontColor.r(), mFontColor.g(), mFontColor.b(), static_cast<Uint8>(mA) ) );
mFont->setColor( ColorA ( mFontColor.r(), mFontColor.g(), mFontColor.b(), static_cast<Uint8>(mA) ) );
for (int i = mCon.ConMax - mCon.ConModif; i >= mCon.ConMin - mCon.ConModif; i-- ) {
if ( i < static_cast<Int16>( mCmdLog.size() ) && i >= 0 ) {
@@ -202,11 +202,11 @@ void Console::draw() {
CurY = mTempY + mY + mCurHeight - mFontSize - 1;
mFont->color( ColorA ( mFontLineColor.r(), mFontLineColor.g(), mFontLineColor.b(), static_cast<Uint8>(mA) ) );
mFont->setColor( ColorA ( mFontLineColor.r(), mFontLineColor.g(), mFontLineColor.b(), static_cast<Uint8>(mA) ) );
mFont->setText( "> " + mTBuf->getBuffer() );
mFont->draw( mFontSize, CurY );
mFont->color( ColorA ( mFontLineColor.r(), mFontLineColor.g(), mFontLineColor.b(), static_cast<Uint8>(mCurAlpha) ) );
mFont->setColor( ColorA ( mFontLineColor.r(), mFontLineColor.g(), mFontLineColor.b(), static_cast<Uint8>(mCurAlpha) ) );
if ( (unsigned int)mTBuf->getCursorPos() == mTBuf->getBuffer().size() ) {
mFont->draw( "_", mFontSize + mFont->getTextWidth() , CurY );
@@ -215,16 +215,16 @@ void Console::draw() {
mFont->draw( "_", mFontSize + mFont->getTextWidth() , CurY );
}
mFont->color( OldColor );
mFont->setColor( OldColor );
}
}
if ( mShowFps && NULL != mFont ) {
ColorA OldColor1( mFont->color() );
mFont->color( ColorA () );
ColorA OldColor1( mFont->getColor() );
mFont->setColor( ColorA () );
mFont->setText( "FPS: " + String::toStr( mWindow->getFPS() ) );
mFont->draw( mWindow->getWidth() - mFont->getTextWidth() - 15, 6 );
mFont->color( OldColor1 );
mFont->setColor( OldColor1 );
}
}

View File

@@ -32,20 +32,20 @@ void Font::setText( const String& Text ) {
mTextCache.text( Text );
}
const ColorA& Font::color() const {
const ColorA& Font::getColor() const {
return mTextCache.color();
}
void Font::color(const ColorA& Color) {
mTextCache.color( Color );
void Font::setColor(const ColorA& color) {
mTextCache.color( color );
}
const ColorA& Font::shadowColor() const {
const ColorA& Font::getShadowColor() const {
return mTextCache.shadowColor();
}
void Font::shadowColor(const ColorA& Color) {
mTextCache.shadowColor( Color );
void Font::setShadowColor(const ColorA& color) {
mTextCache.shadowColor( color );
}
int Font::getNumLines() {
@@ -109,7 +109,7 @@ void Font::draw( TextCache& TextCache, const Float& X, const Float& Y, const Uin
GlobalBatchRenderer::instance()->draw();
TextureFactory::instance()->bind( mTexId );
BlendMode::SetMode( Effect );
BlendMode::setMode( Effect );
if ( Flags & FONT_DRAW_SHADOW ) {
Uint32 f = Flags;
@@ -125,16 +125,16 @@ void Font::draw( TextCache& TextCache, const Float& X, const Float& Y, const Uin
ShadowColor.Alpha = (Uint8)( (Float)ShadowColor.Alpha * ( (Float)Col.a() / (Float)255 ) );
color( ShadowColor );
setColor( ShadowColor );
} else {
color( TextCache.shadowColor() );
setColor( TextCache.shadowColor() );
}
draw( X + 1, Y + 1, f, Scale, Angle, Effect );
mTextCache.flags( Flags );
color( Col );
setColor( Col );
}
Float cX = (Float) ( (Int32)X );

View File

@@ -44,11 +44,11 @@ Texture * FrameBuffer::getTexture() const {
return mTexture;
}
void FrameBuffer::clearColor( ColorAf Color ) {
void FrameBuffer::setClearColor( ColorAf Color ) {
mClearColor = Color;
}
ColorAf FrameBuffer::clearColor() const {
ColorAf FrameBuffer::getClearColor() const {
return mClearColor;
}

View File

@@ -418,7 +418,7 @@ void Image::allocate( const Uint32& size, ColorA DefaultColor, bool memsetData )
}
}
unsigned int Image::memSize() const {
unsigned int Image::getMemSize() const {
return mSize;
}
@@ -435,27 +435,27 @@ void Image::clearCache() {
}
}
void Image::width( const unsigned int& width ) {
void Image::setWidth( const unsigned int& width ) {
mWidth = width;
}
unsigned int Image::width() const {
unsigned int Image::getWidth() const {
return mWidth;
}
void Image::height( const unsigned int& height ) {
void Image::setHeight( const unsigned int& height ) {
mHeight = height;
}
unsigned int Image::height() const {
unsigned int Image::getHeight() const {
return mHeight;
}
void Image::channels( const unsigned int& channels ) {
void Image::setChannels( const unsigned int& channels ) {
mChannels = channels;
}
unsigned int Image::channels() const {
unsigned int Image::getChannels() const {
return mChannels;
}
@@ -547,11 +547,11 @@ void Image::fillWithColor( const ColorA& Color ) {
}
void Image::copyImage( Graphics::Image * image, const Uint32& x, const Uint32& y ) {
if ( NULL != mPixels && NULL != image->getPixels() && mWidth >= x + image->width() && mHeight >= y + image->height() ) {
unsigned int dWidth = image->width();
unsigned int dHeight = image->height();
if ( NULL != mPixels && NULL != image->getPixels() && mWidth >= x + image->getWidth() && mHeight >= y + image->getHeight() ) {
unsigned int dWidth = image->getWidth();
unsigned int dHeight = image->getHeight();
if ( mChannels != image->channels() ) {
if ( mChannels != image->getChannels() ) {
for ( unsigned int ty = 0; ty < dHeight; ty++ ) {
for ( unsigned int tx = 0; tx < dWidth; tx++ ) {
setPixel( x + tx, y + ty, image->getPixel( tx, ty ) );
@@ -641,8 +641,8 @@ void Image::flip() {
clearCache();
mPixels = tImg.getPixels();
mWidth = tImg.width();
mHeight = tImg.height();
mWidth = tImg.getWidth();
mHeight = tImg.getHeight();
tImg.avoidFreeImage( true );
}
@@ -654,8 +654,8 @@ void Image::avoidFreeImage( const bool& AvoidFree ) {
void Image::blit( Graphics::Image * image, const Uint32& x, const Uint32& y ) {
if ( NULL != image && NULL != image->getPixelsPtr() && x < mWidth && y < mHeight ) {
unsigned int dh = eemin( mHeight , y + image->height() );
unsigned int dw = eemin( mWidth , x + image->width() );
unsigned int dh = eemin( mHeight , y + image->getHeight() );
unsigned int dw = eemin( mWidth , x + image->getWidth() );
for ( unsigned int ty = y; ty < dh; ty++ ) {
for ( unsigned int tx = x; tx < dw; tx++ ) {

View File

@@ -8,7 +8,7 @@ Particle::Particle() {
Particle::~Particle() {}
void Particle::Color(ColorAf Color, Float AlphaDecay) {
void Particle::setColor(ColorAf Color, Float AlphaDecay) {
mColor = Color;
mAlphaDecay = AlphaDecay;
}

View File

@@ -82,8 +82,8 @@ void ParticleSystem::begin() {
for ( Uint32 i=0; i < mPCount; i++ ) {
P = &mParticle[i];
P->used(true);
P->id(i+1);
P->setUsed(true);
P->setId(i+1);
reset( P );
}
@@ -100,13 +100,13 @@ void ParticleSystem::reset( Particle * P ) {
case PSE_Nofx:
{
P->reset( mPos.x, mPos.y, mSpeed.x, mSpeed.y, mAcc.x, mAcc.y, mSize );
P->Color( mColor , mAlphaDecay );
P->setColor( mColor , mAlphaDecay );
break;
}
case PSE_BlueBall:
{
P->reset( mPos.x, mPos.y, -10, ( -1 * Math::randf() ), 0.01f, Math::randf(), mSize );
P->Color( ColorAf( 0.25f ,0.25f ,1 ,1 ), 0.1f + ( 0.1f * Math::randf() ) );
P->setColor( ColorAf( 0.25f ,0.25f ,1 ,1 ), 0.1f + ( 0.1f * Math::randf() ) );
break;
}
case PSE_Fire:
@@ -115,7 +115,7 @@ void ParticleSystem::reset( Particle * P ) {
y = ( mPos2.y - mPos.y + 1 ) * Math::randf() + mPos.y;
P->reset( x, y, Math::randf() - 0.5f, ( Math::randf() - 1.1f ) * 8.5f, 0.f, 0.05f, mSize );
P->Color( ColorAf( 1.f, 0.5f, 0.1f, ( Math::randf() * 0.5f ) ), Math::randf() * 0.4f + 0.01f );
P->setColor( ColorAf( 1.f, 0.5f, 0.1f, ( Math::randf() * 0.5f ) ), Math::randf() * 0.4f + 0.01f );
break;
}
case PSE_Smoke:
@@ -124,7 +124,7 @@ void ParticleSystem::reset( Particle * P ) {
y = ( mPos2.y - mPos.y + 1 ) * Math::randf() + mPos.y;
P->reset( x, y, -( Math::randf() / 3.f + 0.1f ), ( ( Math::randf() * 0.5f ) - 0.7f ) * 3, ( Math::randf() / 200.f ), ( Math::randf() - 0.5f ) / 200.f );
P->Color( ColorAf( 0.8f, 0.8f, 0.8f, 0.3f ), ( Math::randf() * 0.005f ) + 0.005f );
P->setColor( ColorAf( 0.8f, 0.8f, 0.8f, 0.3f ), ( Math::randf() * 0.005f ) + 0.005f );
break;
}
case PSE_Snow:
@@ -134,31 +134,31 @@ void ParticleSystem::reset( Particle * P ) {
w = ( Math::randf() + 0.3f ) * 4;
P->reset( x, y, Math::randf() - 0.5f, w, 0.f, 0.f, w * 3 );
P->Color( ColorAf( 1.f, 1.f, 1.f, 0.5f ), 0 );
P->setColor( ColorAf( 1.f, 1.f, 1.f, 0.5f ), 0 );
break;
}
case PSE_MagicFire:
{
P->reset( mPos.x + Math::randf() , mPos.y, -0.4f + Math::randf() * 0.8f, -0.5f - Math::randf() * 0.4f, 0.f, -( Math::randf() * 0.3f ) );
P->Color( ColorAf( 1.f, 0.5f, 0.1f, 0.7f + 0.2f * Math::randf() ), 0.01f + Math::randf() * 0.05f );
P->setColor( ColorAf( 1.f, 0.5f, 0.1f, 0.7f + 0.2f * Math::randf() ), 0.01f + Math::randf() * 0.05f );
break;
}
case PSE_LevelUp:
{
P->reset( mPos.x, mPos.y, Math::randf() * 1.5f - 0.75f, Math::randf() * 1.5f - 0.75f, Math::randf() * 4 - 2, Math::randf() * -4 + 2 );
P->Color( ColorAf( 1.f, 0.5f, 0.1f, 1.f ), 0.07f + Math::randf() * 0.01f );
P->setColor( ColorAf( 1.f, 0.5f, 0.1f, 1.f ), 0.07f + Math::randf() * 0.01f );
break;
}
case PSE_LevelUp2:
{
P->reset( mPos.x + Math::randf() * 32 - 16, mPos.y + Math::randf() * 64 - 32, Math::randf() - 0.5f, Math::randf() - 0.5f, Math::randf() - 0.5f, Math::randf() * -0.9f + 0.45f );
P->Color( ColorAf( 0.1f + Math::randf() * 0.1f, 0.1f + Math::randf() * 0.1f, 0.8f + Math::randf() * 0.3f, 1 ), 0.07f + Math::randf() * 0.01f );
P->setColor( ColorAf( 0.1f + Math::randf() * 0.1f, 0.1f + Math::randf() * 0.1f, 0.8f + Math::randf() * 0.3f, 1 ), 0.07f + Math::randf() * 0.01f );
break;
}
case PSE_Heal:
{
P->reset( mPos.x, mPos.y, Math::randf() * 1.4f - 0.7f, Math::randf() * -0.4f - 1.5f, Math::randf() - 0.5f, Math::randf() * -0.2f + 0.1f );
P->Color( ColorAf( 0.2f, 0.3f, 0.9f, 0.4f ), 0.01f + Math::randf() * 0.01f );
P->setColor( ColorAf( 0.2f, 0.3f, 0.9f, 0.4f ), 0.01f + Math::randf() * 0.01f );
break;
}
case PSE_WormHole:
@@ -175,12 +175,12 @@ void ParticleSystem::reset( Particle * P ) {
}
mProgression = (int) Math::randf() * 10;
radio = ( P->id() * 0.125f ) * mProgression;
x = mPos.x + ( radio * eecos( (Float)P->id() ) );
y = mPos.y + ( radio * eesin( (Float)P->id() ) );
radio = ( P->getId() * 0.125f ) * mProgression;
x = mPos.x + ( radio * eecos( (Float)P->getId() ) );
y = mPos.y + ( radio * eesin( (Float)P->getId() ) );
P->reset( x, y, VarB[0], VarB[1], VarB[2], VarB[3] );
P->Color( ColorAf( 1.f, 0.6f, 0.3f, 1.f ), 0.02f + Math::randf() * 0.3f );
P->setColor( ColorAf( 1.f, 0.6f, 0.3f, 1.f ), 0.02f + Math::randf() * 0.3f );
break;
}
case PSE_Twirl:
@@ -195,65 +195,65 @@ void ParticleSystem::reset( Particle * P ) {
else if ( mProgression < -50 )
mDirection = 1;
q = ( ( P->id() * 0.01f ) + mProgression ) * 2;
q = ( ( P->getId() * 0.01f ) + mProgression ) * 2;
x = mPos.x - w * eesin( q );
y = mPos.y - z * eecos( q );
P->reset( x, y, 1, 1, 0, 0 );
P->Color( ColorAf( 1.f, 0.25f, 0.25f, 1 ), 0.6f + Math::randf() * 0.3f );
P->setColor( ColorAf( 1.f, 0.25f, 0.25f, 1 ), 0.6f + Math::randf() * 0.3f );
break;
}
case PSE_Flower:
{
radio = eecos( 2 * ( (Float)P->id() * 0.1f ) ) * 50;
x = mPos.x + radio * eecos( (Float)P->id() * 0.1f );
y = mPos.y + radio * eesin( (Float)P->id() * 0.1f );
radio = eecos( 2 * ( (Float)P->getId() * 0.1f ) ) * 50;
x = mPos.x + radio * eecos( (Float)P->getId() * 0.1f );
y = mPos.y + radio * eesin( (Float)P->getId() * 0.1f );
P->reset( x, y, 1, 1, 0, 0 );
P->Color( ColorAf( 1.f, 0.25f, 0.1f, 0.1f ), 0.3f + ( 0.2f * Math::randf()) + Math::randf() * 0.3f );
P->setColor( ColorAf( 1.f, 0.25f, 0.1f, 0.1f ), 0.3f + ( 0.2f * Math::randf()) + Math::randf() * 0.3f );
break;
}
case PSE_Galaxy:
{
radio = ( Math::randf( 1.f, 1.2f ) + eesin( 20.f / (Float)P->id() ) ) * 60;
x = mPos.x + radio * eecos( (Float)P->id() );
y = mPos.y + radio * eesin( (Float)P->id() );
radio = ( Math::randf( 1.f, 1.2f ) + eesin( 20.f / (Float)P->getId() ) ) * 60;
x = mPos.x + radio * eecos( (Float)P->getId() );
y = mPos.y + radio * eesin( (Float)P->getId() );
P->reset( x, y, 0, 0, 0, 0 );
P->Color( ColorAf( 0.2f, 0.2f, 0.6f + 0.4f * Math::randf(), 1.f ), Math::randf( 0.05f, 0.15f ) );
P->setColor( ColorAf( 0.2f, 0.2f, 0.6f + 0.4f * Math::randf(), 1.f ), Math::randf( 0.05f, 0.15f ) );
break;
}
case PSE_Heart:
{
q = P->id() * 0.01f;
q = P->getId() * 0.01f;
x = mPos.x - 50 * eesin( q * 2 ) * eesqrt( eeabs( eecos( q ) ) );
y = mPos.y - 50 * eecos( q * 2 ) * eesqrt( eeabs( eesin( q ) ) );
P->reset( x, y, 0.f, 0.f, 0.f, -( Math::randf() * 0.2f ) );
P->Color( ColorAf( 1.f, 0.5f, 0.2f, 0.6f + 0.2f * Math::randf() ), 0.01f + Math::randf() * 0.08f );
P->setColor( ColorAf( 1.f, 0.5f, 0.2f, 0.6f + 0.2f * Math::randf() ), 0.01f + Math::randf() * 0.08f );
break;
}
case PSE_BlueExplosion:
{
if ( P->id() == 0 )
if ( P->getId() == 0 )
mProgression += 10;
radio = atan( static_cast<Float>( P->id() % 12 ) );
x = mPos.x + ( radio * eecos( (Float)P->id() / mProgression ) * 30 );
y = mPos.y + ( radio * eesin( (Float)P->id() / mProgression ) * 30 );
radio = atan( static_cast<Float>( P->getId() % 12 ) );
x = mPos.x + ( radio * eecos( (Float)P->getId() / mProgression ) * 30 );
y = mPos.y + ( radio * eesin( (Float)P->getId() / mProgression ) * 30 );
P->reset(x, y, eecos( (Float)P->id() ), eesin( (Float)P->id() ), 0, 0 );
P->Color( ColorAf( 0.3f, 0.6f, 1.f, 1.f ), 0.03f );
P->reset(x, y, eecos( (Float)P->getId() ), eesin( (Float)P->getId() ), 0, 0 );
P->setColor( ColorAf( 0.3f, 0.6f, 1.f, 1.f ), 0.03f );
break;
}
case PSE_GP:
{
radio = 50 + Math::randf() * 15 * eecos( (Float)P->id() * 3.5f );
x = mPos.x + ( radio * eecos( (Float)P->id() * (Float)0.01428571428 ) );
y = mPos.y + ( radio * eesin( (Float)P->id() * (Float)0.01428571428 ) );
radio = 50 + Math::randf() * 15 * eecos( (Float)P->getId() * 3.5f );
x = mPos.x + ( radio * eecos( (Float)P->getId() * (Float)0.01428571428 ) );
y = mPos.y + ( radio * eesin( (Float)P->getId() * (Float)0.01428571428 ) );
P->reset( x, y, 0, 0, 0, 0 );
P->Color( ColorAf( 0.2f, 0.8f, 0.4f, 0.5f ), Math::randf() * 0.3f );
P->setColor( ColorAf( 0.2f, 0.8f, 0.4f, 0.5f ), Math::randf() * 0.3f );
break;
}
case PSE_BTwirl:
@@ -267,12 +267,12 @@ void ParticleSystem::reset( Particle * P ) {
else if ( mProgression < -50 )
mDirection = 1;
q = ( P->id() * 0.01f + mProgression ) * 2;
q = ( P->getId() * 0.01f + mProgression ) * 2;
x = mPos.x + w * eesin( q );
y = mPos.y - w * eecos( q );
P->reset( x, y, 1, 1, 0, 0 );
P->Color( ColorAf( 0.25f, 0.25f, 1.f, 1.f ), 0.1f + Math::randf() * 0.3f + Math::randf() * 0.3f );
P->setColor( ColorAf( 0.25f, 0.25f, 1.f, 1.f ), 0.1f + Math::randf() * 0.3f + Math::randf() * 0.3f );
break;
}
case PSE_BT:
@@ -286,22 +286,22 @@ void ParticleSystem::reset( Particle * P ) {
else if ( mProgression < -50 )
mDirection = 1;
q = ( P->id() * 0.01f + mProgression ) * 2;
q = ( P->getId() * 0.01f + mProgression ) * 2;
x = mPos.x + w * eesin( q );
y = mPos.y - w * eecos( q );
P->reset( x, y, -10, -1 * Math::randf(), 0, Math::randf() );
P->Color( ColorAf( 0.25f, 0.25f, 1.f, 1.f ), 0.1f + Math::randf() * 0.1f + Math::randf() * 0.3f );
P->setColor( ColorAf( 0.25f, 0.25f, 1.f, 1.f ), 0.1f + Math::randf() * 0.1f + Math::randf() * 0.3f );
break;
}
case PSE_Atomic:
{
radio = 10 + eesin( 2 * ( (Float)P->id() * 0.1f ) ) * 50;
x = mPos.x + radio * eecos( (Float)P->id() * 0.033333 );
y = mPos.y + radio * eesin( (Float)P->id() * 0.033333 );
radio = 10 + eesin( 2 * ( (Float)P->getId() * 0.1f ) ) * 50;
x = mPos.x + radio * eecos( (Float)P->getId() * 0.033333 );
y = mPos.y + radio * eesin( (Float)P->getId() * 0.033333 );
P->reset( x, y, 1, 1, 0, 0 );
P->Color( ColorAf( 0.4f, 0.25f, 1.f, 1.f ), 0.3f + Math::randf() * 0.2f + Math::randf() * 0.3f );
P->setColor( ColorAf( 0.4f, 0.25f, 1.f, 1.f ), 0.3f + Math::randf() * 0.2f + Math::randf() * 0.3f );
break;
}
case PSE_Callback:
@@ -322,7 +322,7 @@ void ParticleSystem::draw() {
TextureFactory * TF = TextureFactory::instance();
TF->bind( mTexId );
BlendMode::SetMode( mBlend );
BlendMode::setMode( mBlend );
if ( mPointsSup ) {
GLi->enable( GL_POINT_SPRITE );
@@ -352,9 +352,9 @@ void ParticleSystem::draw() {
for ( Uint32 i = 0; i < mPCount; i++ ) {
P = &mParticle[i];
if ( P->used() ) {
if ( P->isUsed() ) {
BR->quadsSetColor( ColorA( static_cast<Uint8> ( P->r() * 255 ), static_cast<Uint8> ( P->g() * 255 ), static_cast<Uint8>( P->b() * 255 ), static_cast<Uint8>( P->a() * 255 ) ) );
BR->batchQuad( P->X() - mHSize, P->Y() - mHSize, mSize, mSize );
BR->batchQuad( P->getX() - mHSize, P->getY() - mHSize, mSize, mSize );
}
}
@@ -375,14 +375,14 @@ void ParticleSystem::update( const System::Time& time ) {
for ( Uint32 i = 0; i < mPCount; i++ ) {
P = &mParticle[i];
if ( P->used() || P->a() > 0.f ) {
if ( P->isUsed() || P->a() > 0.f ) {
P->update( time.asMilliseconds() * mTime );
// If not alive
if ( P->a() <= 0.f ) {
if ( !mLoop ) { // If not loop
if ( mLoops == 1 ) { // If left only one loop
P->used(false);
P->setUsed(false);
mPLeft--;
} else { // more than one
if ( i == 0 )
@@ -411,39 +411,39 @@ void ParticleSystem::reuse() {
mLoops = 0;
for ( Uint32 i = 0; i < mPCount; i++ )
mParticle[i].used( true );
mParticle[i].setUsed( true );
}
void ParticleSystem::kill() {
mUsed = false;
}
void ParticleSystem::position( const Vector2f& Pos ) {
void ParticleSystem::setPosition( const Vector2f& Pos ) {
mPos2.x = Pos.x + ( mPos2.x - mPos.x );
mPos2.y = Pos.y + ( mPos2.y - mPos.y );
mPos.x = Pos.x;
mPos.y = Pos.y;
}
const Vector2f& ParticleSystem::position() const {
const Vector2f& ParticleSystem::getPosition() const {
return mPos;
}
void ParticleSystem::position(const Float& x, const Float& y) {
position( Vector2f( x, y ) );
void ParticleSystem::setPosition(const Float& x, const Float& y) {
setPosition( Vector2f( x, y ) );
}
void ParticleSystem::position2( const Vector2f& Pos ) {
void ParticleSystem::setPosition2( const Vector2f& Pos ) {
mPos2.x = Pos.x + ( Pos.x - mPos.x );
mPos2.y = Pos.y + ( Pos.y - mPos.y );
}
const Vector2f& ParticleSystem::position2() const {
const Vector2f& ParticleSystem::getPosition2() const {
return mPos2;
}
void ParticleSystem::position2( const Float& x, const Float& y ) {
position( Vector2f( x, y ) );
void ParticleSystem::setPosition2( const Float& x, const Float& y ) {
setPosition( Vector2f( x, y ) );
}
void ParticleSystem::time( const Float& time ) {
@@ -462,43 +462,43 @@ bool ParticleSystem::isUsing() const {
return mUsed;
}
const EE_BLEND_MODE& ParticleSystem::blendMode() const {
const EE_BLEND_MODE& ParticleSystem::getBlendMode() const {
return mBlend;
}
void ParticleSystem::blendMode( const EE_BLEND_MODE& mode ) {
void ParticleSystem::setBlendMode( const EE_BLEND_MODE& mode ) {
mBlend = mode;
}
const ColorAf& ParticleSystem::color() const {
const ColorAf& ParticleSystem::getColor() const {
return mColor;
}
void ParticleSystem::color( const ColorAf& Col ) {
void ParticleSystem::setColor( const ColorAf& Col ) {
mColor = Col;
}
const Float& ParticleSystem::alphaDecay() const {
const Float& ParticleSystem::getAlphaDecay() const {
return mAlphaDecay;
}
void ParticleSystem::alphaDecay( const Float& Decay ) {
void ParticleSystem::setAlphaDecay( const Float& Decay ) {
mAlphaDecay = Decay;
}
const Vector2f& ParticleSystem::speed() const {
const Vector2f& ParticleSystem::getSpeed() const {
return mSpeed;
}
void ParticleSystem::speed( const Vector2f& speed ) {
void ParticleSystem::setSpeed( const Vector2f& speed ) {
mSpeed = speed;
}
const Vector2f& ParticleSystem::acceleration() const {
const Vector2f& ParticleSystem::getAcceleration() const {
return mAcc;
}
void ParticleSystem::acceleration( const Vector2f& acc ) {
void ParticleSystem::setAcceleration( const Vector2f& acc ) {
mAcc = acc;
}

View File

@@ -14,8 +14,8 @@ bool pixelPerfectCollide( Texture * Tex1, const unsigned int& x1, const unsigned
ax2 = ax1 + Tex1_SrcRECT.Right - Tex1_SrcRECT.Left - 1;
ay2 = ay1 + Tex1_SrcRECT.Bottom - Tex1_SrcRECT.Top - 1;
} else {
ax2 = ax1 + Tex1->width() - 1;
ay2 = ay1 + Tex1->height() - 1;
ax2 = ax1 + Tex1->getWidth() - 1;
ay2 = ay1 + Tex1->getHeight() - 1;
}
bx1 = x2;
@@ -24,8 +24,8 @@ bool pixelPerfectCollide( Texture * Tex1, const unsigned int& x1, const unsigned
bx2 = bx1 + Tex2_SrcRECT.Right - Tex2_SrcRECT.Left - 1;
by2 = by1 + Tex2_SrcRECT.Bottom - Tex2_SrcRECT.Top - 1;
} else {
bx2 = bx1 + Tex2->width() - 1;
by2 = by1 + Tex2->height() - 1;
bx2 = bx1 + Tex2->getWidth() - 1;
by2 = by1 + Tex2->getHeight() - 1;
}
if ( !(ax1 > bx2 || ax2 < bx1 || ay1 > by2 || ay2 < by1) ) {
@@ -77,8 +77,8 @@ bool pixelPerfectCollide( Texture * Tex, const unsigned int& x1, const unsigned
ax2 = ax1 + Tex1_SrcRECT.Right - Tex1_SrcRECT.Left - 1;
ay2 = ay1 + Tex1_SrcRECT.Bottom - Tex1_SrcRECT.Top - 1;
} else {
ax2 = ax1 + Tex->width() - 1;
ay2 = ay1 + Tex->height() - 1;
ax2 = ax1 + Tex->getWidth() - 1;
ay2 = ay1 + Tex->getHeight() - 1;
}
if ( !( ax1 >= x2 && ax2 <= x2 && ay1 >= y2 && ay2 <= y2 ) ) {

View File

@@ -416,14 +416,14 @@ void Primitives::drawBatch() {
sBR->drawOpt();
}
void Primitives::forceDraw( const bool& force ) {
void Primitives::setForceDraw( const bool& force ) {
mForceDraw = force;
if ( force )
drawBatch();
}
const bool& Primitives::forceDraw() const {
const bool& Primitives::getForceDraw() const {
return mForceDraw;
}
@@ -431,27 +431,32 @@ void Primitives::setColor( const ColorA& Color ) {
mColor = Color;
}
void Primitives::fillMode( const EE_FILL_MODE& Mode ) {
const ColorA& Primitives::getColor()
{
return mColor;
}
void Primitives::setFillMode( const EE_FILL_MODE& Mode ) {
mFillMode = Mode;
}
const EE_FILL_MODE& Primitives::fillMode() const {
const EE_FILL_MODE& Primitives::getFillMode() const {
return mFillMode;
}
void Primitives::blendMode( const EE_BLEND_MODE& Mode ) {
void Primitives::setBlendMode( const EE_BLEND_MODE& Mode ) {
mBlendMode = Mode;
}
const EE_BLEND_MODE& Primitives::blendMode() const {
const EE_BLEND_MODE& Primitives::getBlendMode() const {
return mBlendMode;
}
void Primitives::lineWidth( const Float& width ) {
void Primitives::setLineWidth( const Float& width ) {
mLineWidth = width;
}
const Float& Primitives::lineWidth() const {
const Float& Primitives::getLineWidth() const {
return mLineWidth;
}

View File

@@ -162,25 +162,25 @@ void RendererGL3::setShader( ShaderProgram * Shader ) {
mShaderPrev = mCurShader;
mCurShader = Shader;
mProjectionMatrix_id = mCurShader->uniformLocation( "dgl_ProjectionMatrix" );
mModelViewMatrix_id = mCurShader->uniformLocation( "dgl_ModelViewMatrix" );
mTexActiveLoc = mCurShader->uniformLocation( "dgl_TexActive" );
mPointSpriteLoc = mCurShader->uniformLocation( "dgl_PointSpriteActive" );
mClippingEnabledLoc = mCurShader->uniformLocation( "dgl_ClippingEnabled" );
mProjectionMatrix_id = mCurShader->getUniformLocation( "dgl_ProjectionMatrix" );
mModelViewMatrix_id = mCurShader->getUniformLocation( "dgl_ModelViewMatrix" );
mTexActiveLoc = mCurShader->getUniformLocation( "dgl_TexActive" );
mPointSpriteLoc = mCurShader->getUniformLocation( "dgl_PointSpriteActive" );
mClippingEnabledLoc = mCurShader->getUniformLocation( "dgl_ClippingEnabled" );
mCurActiveTex = 0;
Uint32 i;
for ( i = 0; i < EEGL_ARRAY_STATES_COUNT; i++ ) {
mAttribsLoc[ i ] = mCurShader->attributeLocation( EEGL3_STATES_NAME[ i ] );
mAttribsLoc[ i ] = mCurShader->getAttributeLocation( EEGL3_STATES_NAME[ i ] );
}
for ( i = 0; i < EE_MAX_PLANES; i++ ) {
mPlanes[ i ] = mCurShader->uniformLocation( EEGL3_PLANES_NAME[ i ] );
mPlanes[ i ] = mCurShader->getUniformLocation( EEGL3_PLANES_NAME[ i ] );
}
for ( i = 0; i < EE_MAX_TEXTURE_UNITS; i++ ) {
mTextureUnits[ i ] = mCurShader->attributeLocation( EEGL3_TEXTUREUNIT_NAMES[ i ] );
mTextureUnits[ i ] = mCurShader->getAttributeLocation( EEGL3_TEXTUREUNIT_NAMES[ i ] );
}
glUseProgram( mCurShader->getHandler() );

View File

@@ -192,25 +192,25 @@ void RendererGL3CP::setShader( ShaderProgram * Shader ) {
mShaderPrev = mCurShader;
mCurShader = Shader;
mProjectionMatrix_id = mCurShader->uniformLocation( "dgl_ProjectionMatrix" );
mModelViewMatrix_id = mCurShader->uniformLocation( "dgl_ModelViewMatrix" );
mTexActiveLoc = mCurShader->uniformLocation( "dgl_TexActive" );
mPointSpriteLoc = mCurShader->uniformLocation( "dgl_PointSpriteActive" );
mClippingEnabledLoc = mCurShader->uniformLocation( "dgl_ClippingEnabled" );
mProjectionMatrix_id = mCurShader->getUniformLocation( "dgl_ProjectionMatrix" );
mModelViewMatrix_id = mCurShader->getUniformLocation( "dgl_ModelViewMatrix" );
mTexActiveLoc = mCurShader->getUniformLocation( "dgl_TexActive" );
mPointSpriteLoc = mCurShader->getUniformLocation( "dgl_PointSpriteActive" );
mClippingEnabledLoc = mCurShader->getUniformLocation( "dgl_ClippingEnabled" );
mCurActiveTex = 0;
Uint32 i;
for ( i = 0; i < EEGL_ARRAY_STATES_COUNT; i++ ) {
mAttribsLoc[ i ] = mCurShader->attributeLocation( EEGL3CP_STATES_NAME[ i ] );
mAttribsLoc[ i ] = mCurShader->getAttributeLocation( EEGL3CP_STATES_NAME[ i ] );
}
for ( i = 0; i < EE_MAX_PLANES; i++ ) {
mPlanes[ i ] = mCurShader->uniformLocation( EEGL3CP_PLANES_NAME[ i ] );
mPlanes[ i ] = mCurShader->getUniformLocation( EEGL3CP_PLANES_NAME[ i ] );
}
for ( i = 0; i < EE_MAX_TEXTURE_UNITS; i++ ) {
mTextureUnits[ i ] = mCurShader->attributeLocation( EEGL3CP_TEXTUREUNIT_NAMES[ i ] );
mTextureUnits[ i ] = mCurShader->getAttributeLocation( EEGL3CP_TEXTUREUNIT_NAMES[ i ] );
}
glUseProgram( mCurShader->getHandler() );

View File

@@ -210,28 +210,28 @@ void RendererGLES2::setShader( ShaderProgram * Shader ) {
checkLocalShader();
mProjectionMatrix_id = mCurShader->uniformLocation( "dgl_ProjectionMatrix" );
mModelViewMatrix_id = mCurShader->uniformLocation( "dgl_ModelViewMatrix" );
mTexActiveLoc = mCurShader->uniformLocation( "dgl_TexActive" );
mClippingEnabledLoc = mCurShader->uniformLocation( "dgl_ClippingEnabled" );
mProjectionMatrix_id = mCurShader->getUniformLocation( "dgl_ProjectionMatrix" );
mModelViewMatrix_id = mCurShader->getUniformLocation( "dgl_ModelViewMatrix" );
mTexActiveLoc = mCurShader->getUniformLocation( "dgl_TexActive" );
mClippingEnabledLoc = mCurShader->getUniformLocation( "dgl_ClippingEnabled" );
mCurActiveTex = 0;
Uint32 i;
for ( i = 0; i < EEGL_ARRAY_STATES_COUNT; i++ ) {
mAttribsLoc[ i ] = mCurShader->attributeLocation( EEGLES2_STATES_NAME[ i ] );
mAttribsLoc[ i ] = mCurShader->getAttributeLocation( EEGLES2_STATES_NAME[ i ] );
}
for ( i = 0; i < EE_MAX_PLANES; i++ ) {
if ( -1 != mClippingEnabledLoc ) {
mPlanes[ i ] = mCurShader->uniformLocation( EEGLES2_PLANES_NAMENABLED_NAME[ i ] );
mPlanes[ i ] = mCurShader->getUniformLocation( EEGLES2_PLANES_NAMENABLED_NAME[ i ] );
} else {
mPlanes[ i ] = -1;
}
}
for ( i = 0; i < EE_MAX_TEXTURE_UNITS; i++ ) {
mTextureUnits[ i ] = mCurShader->attributeLocation( EEGLES2_TEXTUREUNIT_NAMES[ i ] );
mTextureUnits[ i ] = mCurShader->getAttributeLocation( EEGLES2_TEXTUREUNIT_NAMES[ i ] );
}
glUseProgram( mCurShader->getHandler() );

View File

@@ -16,11 +16,11 @@ ScrollParallax::ScrollParallax( Graphics::SubTexture * SubTexture, const Vector2
create( SubTexture, Position, Size, Speed, Color, Blend );
}
Graphics::SubTexture * ScrollParallax::subTexture() const {
Graphics::SubTexture * ScrollParallax::getSubTexture() const {
return mSubTexture;
}
void ScrollParallax::subTexture( Graphics::SubTexture * subTexture ) {
void ScrollParallax::setSubTexture( Graphics::SubTexture * subTexture ) {
mSubTexture = subTexture;
setSubTexture();
@@ -55,14 +55,14 @@ bool ScrollParallax::create( Graphics::SubTexture * SubTexture, const Vector2f&
return true;
}
void ScrollParallax::size( const Sizef& size ) {
void ScrollParallax::setSize( const Sizef& size ) {
mSize = size;
setSubTexture();
setAABB();
}
void ScrollParallax::position( const Vector2f& Pos ) {
void ScrollParallax::setPosition( const Vector2f& Pos ) {
Vector2f Diff = mPos - mInitPos;
mInitPos = Pos;
@@ -72,11 +72,11 @@ void ScrollParallax::position( const Vector2f& Pos ) {
setAABB();
}
const Sizef& ScrollParallax::size() const {
const Sizef& ScrollParallax::getSize() const {
return mSize;
}
const Vector2f& ScrollParallax::position() const {
const Vector2f& ScrollParallax::getPosition() const {
return mInitPos;
}
@@ -148,11 +148,11 @@ void ScrollParallax::draw() {
}
}
void ScrollParallax::speed( const Vector2f& speed ) {
void ScrollParallax::setSpeed( const Vector2f& speed ) {
mSpeed = speed;
}
const Vector2f& ScrollParallax::speed() const {
const Vector2f& ScrollParallax::getSpeed() const {
return mSpeed;
}

View File

@@ -268,7 +268,7 @@ void ShaderProgram::unbind() const {
GLi->setShader( NULL );
}
Int32 ShaderProgram::uniformLocation( const std::string& Name ) {
Int32 ShaderProgram::getUniformLocation( const std::string& Name ) {
if ( !mValid )
return -1;
@@ -282,7 +282,7 @@ Int32 ShaderProgram::uniformLocation( const std::string& Name ) {
return mUniformLocations[Name];
}
Int32 ShaderProgram::attributeLocation( const std::string& Name ) {
Int32 ShaderProgram::getAttributeLocation( const std::string& Name ) {
if ( !mValid )
return -1;
@@ -302,7 +302,7 @@ void ShaderProgram::invalidateLocations() {
}
bool ShaderProgram::setUniform( const std::string& Name, float Value ) {
Int32 Location = uniformLocation( Name );
Int32 Location = getUniformLocation( Name );
if ( Location >= 0 ) {
#ifdef EE_SHADERS_SUPPORTED
@@ -314,7 +314,7 @@ bool ShaderProgram::setUniform( const std::string& Name, float Value ) {
}
bool ShaderProgram::setUniform( const std::string& Name, Vector2ff Value ) {
Int32 Location = uniformLocation( Name );
Int32 Location = getUniformLocation( Name );
if ( Location >= 0 ) {
#ifdef EE_SHADERS_SUPPORTED
@@ -326,7 +326,7 @@ bool ShaderProgram::setUniform( const std::string& Name, Vector2ff Value ) {
}
bool ShaderProgram::setUniform( const std::string& Name, Vector3ff Value ) {
Int32 Location = uniformLocation( Name );
Int32 Location = getUniformLocation( Name );
if ( Location >= 0 ) {
#ifdef EE_SHADERS_SUPPORTED
@@ -338,7 +338,7 @@ bool ShaderProgram::setUniform( const std::string& Name, Vector3ff Value ) {
}
bool ShaderProgram::setUniform( const std::string& Name, float x, float y, float z, float w ) {
Int32 Location = uniformLocation( Name );
Int32 Location = getUniformLocation( Name );
if ( Location >= 0 ) {
#ifdef EE_SHADERS_SUPPORTED
@@ -350,7 +350,7 @@ bool ShaderProgram::setUniform( const std::string& Name, float x, float y, float
}
bool ShaderProgram::setUniform( const std::string& Name, Int32 Value ) {
Int32 Location = uniformLocation( Name );
Int32 Location = getUniformLocation( Name );
if ( Location >= 0 ) {
#ifdef EE_SHADERS_SUPPORTED
@@ -434,7 +434,7 @@ bool ShaderProgram::setUniformMatrix( const Int32& Location, const float * Value
}
bool ShaderProgram::setUniformMatrix( const std::string Name, const float * Value ) {
Int32 Location = uniformLocation( Name );
Int32 Location = getUniformLocation( Name );
if ( Location >= 0 ) {
#ifdef EE_SHADERS_SUPPORTED
@@ -465,7 +465,7 @@ void ShaderProgram::setReloadCb( ShaderProgramReloadCb Cb ) {
}
void ShaderProgram::enableVertexAttribArray( const std::string& Name ) {
enableVertexAttribArray( attributeLocation( Name ) );
enableVertexAttribArray( getAttributeLocation( Name ) );
}
void ShaderProgram::enableVertexAttribArray( const Int32& Location ) {
@@ -475,7 +475,7 @@ void ShaderProgram::enableVertexAttribArray( const Int32& Location ) {
}
void ShaderProgram::disableVertexAttribArray( const std::string& Name ) {
disableVertexAttribArray( attributeLocation( Name ) );
disableVertexAttribArray( getAttributeLocation( Name ) );
}
void ShaderProgram::disableVertexAttribArray( const Int32& Location ) {

View File

@@ -13,7 +13,7 @@ namespace EE { namespace Graphics {
Sprite::Sprite() :
mFlags( SPRITE_FLAG_AUTO_ANIM | SPRITE_FLAG_EVENTS_ENABLED ),
mPos(),
mAngle( 0.f ),
mRotation( 0.f ),
mScale( 1.f, 1.f ),
mAnimSpeed( 16.f ),
mColor( 255,255,255,255 ),
@@ -34,7 +34,7 @@ Sprite::Sprite() :
Sprite::Sprite( const std::string& name, const std::string& extension, TextureAtlas * SearchInTextureAtlas ) :
mFlags( SPRITE_FLAG_AUTO_ANIM | SPRITE_FLAG_EVENTS_ENABLED ),
mPos(),
mAngle( 0.f ),
mRotation( 0.f ),
mScale( 1.f, 1.f ),
mAnimSpeed( 16.f ),
mColor( 255,255,255,255 ),
@@ -56,7 +56,7 @@ Sprite::Sprite( const std::string& name, const std::string& extension, TextureAt
Sprite::Sprite( SubTexture * SubTexture ) :
mFlags( SPRITE_FLAG_AUTO_ANIM | SPRITE_FLAG_EVENTS_ENABLED ),
mPos(),
mAngle( 0.f ),
mRotation( 0.f ),
mScale( 1.f, 1.f ),
mAnimSpeed( 16.f ),
mColor( 255,255,255,255 ),
@@ -78,7 +78,7 @@ Sprite::Sprite( SubTexture * SubTexture ) :
Sprite::Sprite( const Uint32& TexId, const Sizef &DestSize, const Vector2i &Offset, const Recti& TexSector ) :
mFlags( SPRITE_FLAG_AUTO_ANIM | SPRITE_FLAG_EVENTS_ENABLED ),
mPos(),
mAngle( 0.f ),
mRotation( 0.f ),
mScale( 1.f, 1.f ),
mAnimSpeed( 16.f ),
mColor( 255,255,255,255 ),
@@ -105,7 +105,7 @@ Sprite& Sprite::operator =( const Sprite& Other ) {
mFrames = Other.mFrames;
mFlags = Other.mFlags;
mPos = Other.mPos;
mAngle = Other.mAngle;
mRotation = Other.mRotation;
mScale = Other.mScale;
mAnimSpeed = Other.mAnimSpeed;
mColor = Other.mColor;
@@ -138,7 +138,7 @@ Sprite * Sprite::copy() {
Spr->mFrames = mFrames;
Spr->mFlags = mFlags;
Spr->mPos = mPos;
Spr->mAngle = mAngle;
Spr->mRotation = mRotation;
Spr->mScale = mScale;
Spr->mAnimSpeed = mAnimSpeed;
Spr->mColor = mColor;
@@ -181,7 +181,7 @@ void Sprite::reset() {
mScale = Vector2f::One;
mRepeations = -1;
mAngle = 0;
mRotation = 0;
mColor = ColorA(255, 255, 255, 255);
mBlend = ALPHA_NORMAL;
@@ -196,7 +196,7 @@ void Sprite::reset() {
disableVertexColors();
}
void Sprite::currentFrame ( unsigned int CurFrame ) {
void Sprite::setCurrentFrame ( unsigned int CurFrame ) {
if ( CurFrame )
CurFrame--;
@@ -214,7 +214,7 @@ void Sprite::currentFrame ( unsigned int CurFrame ) {
}
}
void Sprite::currentSubFrame( const unsigned int& CurSubFrame ) {
void Sprite::setCurrentSubFrame( const unsigned int& CurSubFrame ) {
if ( CurSubFrame < mSubFrames )
mCurrentSubFrame = CurSubFrame;
}
@@ -267,7 +267,7 @@ Quad2f Sprite::getQuad() {
break;
}
Q.rotate( mAngle, Center );
Q.rotate( mRotation, Center );
Q.scale( mScale, Center );
return Q;
@@ -281,7 +281,7 @@ eeAABB Sprite::getAABB() {
SubTexture * S;
if ( mFrames.size() && ( S = getCurrentSubTexture() ) ) {
if ( mAngle != 0 || mEffect >= 4 ) {
if ( mRotation != 0 || mEffect >= 4 ) {
return getQuad().toAABB();
} else { // The method used if mAngle != 0 works for mAngle = 0, but i prefer to use the faster way
TmpR = Rectf( mPos.x, mPos.y, mPos.x + S->destSize().x, mPos.y + S->destSize().y );
@@ -303,16 +303,16 @@ eeAABB Sprite::getAABB() {
return TmpR;
}
const Vector2f Sprite::position() const {
const Vector2f Sprite::getPosition() const {
return mPos;
}
void Sprite::position(const Float& x, const Float& y) {
void Sprite::setPosition(const Float& x, const Float& y) {
mPos.x = x;
mPos.y = y;
}
void Sprite::position( const Vector2f& NewPos ) {
void Sprite::setPosition( const Vector2f& NewPos ) {
mPos = NewPos;
}
@@ -588,9 +588,9 @@ void Sprite::draw( const EE_BLEND_MODE& Blend, const EE_RENDER_MODE& Effect ) {
return;
if ( NULL == mVertexColors )
S->draw( mPos.x, mPos.y, mColor, mAngle, mScale, Blend, Effect, mOrigin );
S->draw( mPos.x, mPos.y, mColor, mRotation, mScale, Blend, Effect, mOrigin );
else
S->draw( mPos.x, mPos.y, mAngle, mScale, mVertexColors[0], mVertexColors[1], mVertexColors[2], mVertexColors[3], Blend, Effect, mOrigin );
S->draw( mPos.x, mPos.y, mRotation, mScale, mVertexColors[0], mVertexColors[1], mVertexColors[2], mVertexColors[3], Blend, Effect, mOrigin );
}
void Sprite::draw() {
@@ -627,7 +627,7 @@ unsigned int Sprite::getSubFrame( const unsigned int& SubFrame ) {
return SFN;
}
Vector2i Sprite::offset() {
Vector2i Sprite::getOffset() {
SubTexture* S = getCurrentSubTexture();
if ( S != NULL )
@@ -636,7 +636,7 @@ Vector2i Sprite::offset() {
return Vector2i();
}
void Sprite::offset( const Vector2i& offset ) {
void Sprite::setOffset( const Vector2i& offset ) {
SubTexture* S = getCurrentSubTexture();
if ( S != NULL ) {
@@ -644,19 +644,19 @@ void Sprite::offset( const Vector2i& offset ) {
}
}
void Sprite::size( const Sizef& Size, const unsigned int& FrameNum, const unsigned int& SubFrame ) {
void Sprite::setSize( const Sizef& Size, const unsigned int& FrameNum, const unsigned int& SubFrame ) {
mFrames[ getFrame(FrameNum) ].Spr[ getSubFrame(SubFrame) ]->destSize( Size );
}
void Sprite::size( const Sizef& Size ) {
void Sprite::setSize( const Sizef& Size ) {
mFrames[ mCurrentFrame ].Spr[ mCurrentSubFrame ]->destSize( Size );
}
Sizef Sprite::size( const unsigned int& FrameNum, const unsigned int& SubFrame ) {
Sizef Sprite::setSize( const unsigned int& FrameNum, const unsigned int& SubFrame ) {
return mFrames[ getFrame(FrameNum) ].Spr[ getSubFrame(SubFrame) ]->destSize();
}
Sizef Sprite::size() {
Sizef Sprite::getSize() {
return mFrames[ mCurrentFrame ].Spr[ mCurrentSubFrame ]->destSize();
}
@@ -664,7 +664,7 @@ void Sprite::setRepetitions( const int& Repeations ) {
mRepeations = Repeations;
}
void Sprite::autoAnimate( const bool& Autoanim ) {
void Sprite::setAutoAnimate( const bool& Autoanim ) {
if ( Autoanim ) {
if ( !SPR_FGET( SPRITE_FLAG_AUTO_ANIM ) )
mFlags |= SPRITE_FLAG_AUTO_ANIM;
@@ -675,7 +675,7 @@ void Sprite::autoAnimate( const bool& Autoanim ) {
}
bool Sprite::autoAnimate() const {
bool Sprite::getAutoAnimate() const {
return 0 != SPR_FGET( SPRITE_FLAG_AUTO_ANIM );
}
@@ -700,55 +700,55 @@ SubTexture * Sprite::getSubTexture( const unsigned int& frame, const unsigned in
return NULL;
}
void Sprite::x( const Float& X ) {
void Sprite::setX( const Float& X ) {
mPos.x = X;
}
Float Sprite::x() const {
Float Sprite::getX() const {
return mPos.x;
}
void Sprite::y( const Float& Y ) {
void Sprite::setY( const Float& Y ) {
mPos.y = Y;
}
Float Sprite::y() const {
Float Sprite::getY() const {
return mPos.y;
}
void Sprite::angle( const Float& Angle) {
mAngle = Angle;
void Sprite::setRotation( const Float& rotation ) {
mRotation = rotation;
}
Float Sprite::angle() const {
return mAngle;
Float Sprite::getRotation() const {
return mRotation;
}
void Sprite::scale( const Float& Scale ) {
this->scale( Vector2f( Scale, Scale ) );
void Sprite::setScale( const Float& Scale ) {
this->setScale( Vector2f( Scale, Scale ) );
}
void Sprite::scale( const Vector2f& Scale ) {
void Sprite::setScale( const Vector2f& Scale ) {
mScale = Scale;
}
const Vector2f& Sprite::scale() const {
const Vector2f& Sprite::getScale() const {
return mScale;
}
void Sprite::animSpeed( const Float& AnimSpeed ) {
void Sprite::setAnimationSpeed( const Float& AnimSpeed ) {
mAnimSpeed = AnimSpeed;
}
Float Sprite::animSpeed() const {
Float Sprite::getAnimationSpeed() const {
return mAnimSpeed;
}
bool Sprite::animPaused() const {
bool Sprite::isAnimationPaused() const {
return 0 != SPR_FGET( SPRITE_FLAG_ANIM_PAUSED );
}
void Sprite::animPaused( const bool& Pause ) {
void Sprite::setAnimationPaused( const bool& Pause ) {
if ( Pause ) {
if ( !SPR_FGET( SPRITE_FLAG_ANIM_PAUSED ) )
mFlags |= SPRITE_FLAG_ANIM_PAUSED;
@@ -758,55 +758,55 @@ void Sprite::animPaused( const bool& Pause ) {
}
}
void Sprite::color( const ColorA& Color) {
void Sprite::setColor( const ColorA& Color) {
mColor = Color;
}
const ColorA& Sprite::color() const {
const ColorA& Sprite::getColor() const {
return mColor;
}
void Sprite::alpha( const Uint8& Alpha ) {
void Sprite::setAlpha( const Uint8& Alpha ) {
mColor.Alpha = Alpha;
}
const Uint8& Sprite::alpha() const {
const Uint8& Sprite::getAlpha() const {
return mColor.Alpha;
}
const unsigned int& Sprite::currentFrame() const {
const unsigned int& Sprite::getCurrentFrame() const {
return mCurrentFrame;
}
const Float& Sprite::exactCurrentFrame() const {
const Float& Sprite::getExactCurrentFrame() const {
return mfCurrentFrame;
}
void Sprite::exactCurrentFrame( const Float& CurrentFrame ) {
void Sprite::setExactCurrentFrame( const Float& CurrentFrame ) {
mfCurrentFrame = CurrentFrame;
}
const unsigned int& Sprite::currentSubFrame() const {
const unsigned int& Sprite::getCurrentSubFrame() const {
return mCurrentSubFrame;
}
void Sprite::renderMode( const EE_RENDER_MODE& Effect ) {
void Sprite::setRenderMode( const EE_RENDER_MODE& Effect ) {
mEffect = Effect;
}
const EE_RENDER_MODE& Sprite::renderMode() const {
const EE_RENDER_MODE& Sprite::getRenderMode() const {
return mEffect;
}
void Sprite::blendMode( const EE_BLEND_MODE& Blend ) {
void Sprite::setBlendMode( const EE_BLEND_MODE& Blend ) {
mBlend = Blend;
}
const EE_BLEND_MODE& Sprite::blendMode() const {
const EE_BLEND_MODE& Sprite::getBlendMode() const {
return mBlend;
}
void Sprite::reverseAnim( const bool& Reverse ) {
void Sprite::setReverseAnimation( const bool& Reverse ) {
if ( Reverse ) {
if ( !SPR_FGET( SPRITE_FLAG_REVERSE_ANIM ) )
mFlags |= SPRITE_FLAG_REVERSE_ANIM;
@@ -816,7 +816,7 @@ void Sprite::reverseAnim( const bool& Reverse ) {
}
}
bool Sprite::reverseAnim() const {
bool Sprite::getReverseAnimation() const {
return 0 != SPR_FGET( SPRITE_FLAG_REVERSE_ANIM );
}
@@ -832,13 +832,13 @@ void Sprite::goToAndPlay( Uint32 GoTo ) {
mCurrentFrame = GoTo;
mfCurrentFrame = (Float)GoTo;
animPaused( false );
setAnimationPaused( false );
}
}
void Sprite::goToAndStop( Uint32 GoTo ) {
goToAndPlay( GoTo );
animPaused( true );
setAnimationPaused( true );
}
void Sprite::animToFrameAndStop( Uint32 GoTo ) {
@@ -850,7 +850,7 @@ void Sprite::animToFrameAndStop( Uint32 GoTo ) {
mFlags |= SPRITE_FLAG_ANIM_TO_FRAME_AND_STOP;
animPaused( false );
setAnimationPaused( false );
}
}
@@ -869,16 +869,16 @@ void Sprite::fireEvent( const Uint32& Event ) {
}
}
void Sprite::origin( const OriginPoint& origin ) {
void Sprite::setOrigin( const OriginPoint& origin ) {
mOrigin = origin;
}
const OriginPoint& Sprite:: origin() const {
const OriginPoint& Sprite:: getOrigin() const {
return mOrigin;
}
void Sprite::rotate( const Float& angle ) {
mAngle += angle;
mRotation += angle;
}
}}

View File

@@ -206,7 +206,7 @@ void SubTexture::cacheAlphaMask() {
void SubTexture::cacheColors() {
mTexture->lock();
Uint32 size = ( mSrcRect.Right - mSrcRect.Left ) * ( mSrcRect.Bottom - mSrcRect.Top ) * mTexture->channels();
Uint32 size = ( mSrcRect.Right - mSrcRect.Left ) * ( mSrcRect.Bottom - mSrcRect.Top ) * mTexture->getChannels();
eeSAFE_DELETE_ARRAY( mPixels );
@@ -216,7 +216,7 @@ void SubTexture::cacheColors() {
int rX = 0;
int rW = mSrcRect.Right - mSrcRect.Left;
ColorA tColor;
Uint32 Channels = mTexture->channels();
Uint32 Channels = mTexture->getChannels();
int Pos;
for ( int y = mSrcRect.Top; y < mSrcRect.Bottom; y++ ) {
@@ -247,7 +247,7 @@ Uint8 SubTexture::getAlphaAt( const Int32& X, const Int32& Y ) {
return mAlpha[ X + Y * ( mSrcRect.Right - mSrcRect.Left ) ];
if ( NULL != mPixels )
return mPixels[ ( X + Y * ( mSrcRect.Right - mSrcRect.Left ) ) * mTexture->channels() + 3 ];
return mPixels[ ( X + Y * ( mSrcRect.Right - mSrcRect.Left ) ) * mTexture->getChannels() + 3 ];
cacheAlphaMask();
@@ -259,7 +259,7 @@ ColorA SubTexture::getColorAt( const Int32& X, const Int32& Y ) {
return mTexture->getPixel( mSrcRect.Left + X, mSrcRect.Right + Y );
if ( NULL != mPixels ) {
Uint32 Channels = mTexture->channels();
Uint32 Channels = mTexture->getChannels();
unsigned int Pos = ( X + Y * ( mSrcRect.Right - mSrcRect.Left ) ) * Channels;
if ( 4 == Channels )
@@ -279,7 +279,7 @@ ColorA SubTexture::getColorAt( const Int32& X, const Int32& Y ) {
void SubTexture::setColorAt( const Int32& X, const Int32& Y, const ColorA& Color ) {
if ( NULL != mPixels ) {
Uint32 Channels = mTexture->channels();
Uint32 Channels = mTexture->getChannels();
unsigned int Pos = ( X + Y * ( mSrcRect.Right - mSrcRect.Left ) ) * Channels;
if ( Channels >= 1 ) mPixels[ Pos ] = Color.r();
@@ -308,7 +308,7 @@ bool SubTexture::unlock( const bool& KeepData, const bool& Modified ) {
if ( Modified ) {
TextureSaver saver( mTexture->handle() );
Uint32 Channels = mTexture->channels();
Uint32 Channels = mTexture->getChannels();
Uint32 Channel = GL_RGBA;
if ( 3 == Channels )
@@ -355,11 +355,11 @@ bool SubTexture::saveToFile(const std::string& filepath, const EE_SAVE_TYPE& For
if ( NULL != mTexture ) {
if ( SAVE_TYPE_JPG != Format ) {
Res = 0 != ( SOIL_save_image ( filepath.c_str(), Format, realSize().getWidth(), realSize().getHeight(), mTexture->channels(), getPixelsPtr() ) );
Res = 0 != ( SOIL_save_image ( filepath.c_str(), Format, realSize().getWidth(), realSize().getHeight(), mTexture->getChannels(), getPixelsPtr() ) );
} else {
jpge::params params;
params.m_quality = Image::jpegQuality();
Res = jpge::compress_image_to_jpeg_file( filepath.c_str(), realSize().getWidth(), realSize().getHeight(), mTexture->channels(), getPixelsPtr(), params);
Res = jpge::compress_image_to_jpeg_file( filepath.c_str(), realSize().getWidth(), realSize().getHeight(), mTexture->getChannels(), getPixelsPtr(), params);
}
}

View File

@@ -389,7 +389,7 @@ void Texture::update( const Uint8* pixels ) {
}
void Texture::update( Image *image, Uint32 x, Uint32 y ) {
update( image->getPixelsPtr(), image->width(), image->height(), x, y, channelsToPixelFormat( image->channels() ) );
update( image->getPixelsPtr(), image->getWidth(), image->getHeight(), x, y, channelsToPixelFormat( image->getChannels() ) );
}
const Uint32& Texture::hashName() const {
@@ -493,9 +493,9 @@ void Texture::drawEx( Float x, Float y, Float width, Float height, const Float &
Int32 tmpX;
sBR->draw();
Vector2f oCenter( sBR->batchCenter() );
Float oAngle = sBR->batchRotation();
Vector2f oScale = sBR->batchScale();
Vector2f oCenter( sBR->getBatchCenter() );
Float oAngle = sBR->getBatchRotation();
Vector2f oScale = sBR->getBatchScale();
if ( Center.OriginType == OriginPoint::OriginCenter ) {
Center.x = x + width * 0.5f;
@@ -508,9 +508,9 @@ void Texture::drawEx( Float x, Float y, Float width, Float height, const Float &
Center.y += y;
}
sBR->batchCenter( Center );
sBR->batchRotation( Angle );
sBR->batchScale( Scale );
sBR->setBatchCenter( Center );
sBR->setBatchRotation( Angle );
sBR->setBatchScale( Scale );
for ( tmpY = 0; tmpY < tty; tmpY++ ) {
for ( tmpX = 0; tmpX < ttx; tmpX++ ) {
@@ -541,9 +541,9 @@ void Texture::drawEx( Float x, Float y, Float width, Float height, const Float &
}
sBR->draw();
sBR->batchCenter( oCenter );
sBR->batchRotation( oAngle );
sBR->batchScale( oScale );
sBR->setBatchCenter( oCenter );
sBR->setBatchRotation( oAngle );
sBR->setBatchScale( oScale );
return;
} else {

View File

@@ -151,7 +151,7 @@ bool TextureFactory::remove( Uint32 TexId ) {
}
void TextureFactory::removeReference( Texture * Tex ) {
mMemSize -= Tex->memSize();
mMemSize -= Tex->getMemSize();
int glTexId = Tex->handle();

View File

@@ -34,8 +34,8 @@ bool TextureFont::load( const Uint32& TexId, const unsigned int& StartChar, cons
mtX = ( 1 / static_cast<Float>( mTexColumns ) );
mtY = ( 1 / static_cast<Float>( mTexRows ) );
mFWidth = (Float)( Tex->width() / mTexColumns );
mFHeight = (Float)( Tex->height() / mTexRows );
mFWidth = (Float)( Tex->getWidth() / mTexColumns );
mFHeight = (Float)( Tex->getHeight() / mTexRows );
mHeight = mSize = mLineSkip = (unsigned int)mFHeight;
if ( Spacing == 0 )
@@ -114,11 +114,11 @@ void TextureFont::buildFromGlyphs() {
for (unsigned int i = 0; i < mNumChars; i++) {
tGlyph = mGlyphs[i];
tR.Left = (Float)tGlyph.CurX / Tex->width();
tR.Top = (Float)tGlyph.CurY / Tex->height();
tR.Left = (Float)tGlyph.CurX / Tex->getWidth();
tR.Top = (Float)tGlyph.CurY / Tex->getHeight();
tR.Right = (Float)(tGlyph.CurX + tGlyph.CurW) / Tex->width();
tR.Bottom = (Float)(tGlyph.CurY + tGlyph.CurH) / Tex->height();
tR.Right = (Float)(tGlyph.CurX + tGlyph.CurW) / Tex->getWidth();
tR.Bottom = (Float)(tGlyph.CurY + tGlyph.CurH) / Tex->getHeight();
Top = mHeight + mDescent - tGlyph.GlyphH - tGlyph.MinY;
Bottom = mHeight + mDescent + tGlyph.GlyphH - tGlyph.MaxY;

View File

@@ -28,9 +28,9 @@ TexturePackerTex::TexturePackerTex( const std::string& Name ) :
TexturePackerTex::TexturePackerTex( EE::Graphics::Image * Img , const std::string& Name ) :
mName( Name ),
mWidth( Img->width() ),
mHeight( Img->height() ),
mChannels( Img->channels() ),
mWidth( Img->getWidth() ),
mHeight( Img->getHeight() ),
mChannels( Img->getChannels() ),
mX(0),
mY(0),
mLongestEdge(0),

View File

@@ -191,8 +191,8 @@ bool TTFFont::iLoad( const unsigned int& Size, EE_TTF_FONT_STYLE Style, const Ui
Image out( TempOutGlyphSurface, GlyphRect.x, GlyphRect.y, 4 ); out.avoidFreeImage( true );
Image in( TempGlyphSurface, mFont->Current()->Pixmap()->width, mFont->Current()->Pixmap()->rows, 4 ); in.avoidFreeImage( true );
Uint32 px = ( ( (Float)out.width() - (Float)in.width() ) * 0.5f );
Uint32 py = ( ( (Float)out.height() - (Float)in.height() ) * 0.5f );
Uint32 px = ( ( (Float)out.getWidth() - (Float)in.getWidth() ) * 0.5f );
Uint32 py = ( ( (Float)out.getHeight() - (Float)in.getHeight() ) * 0.5f );
out.blit( &in, px, py );
@@ -340,11 +340,11 @@ void TTFFont::rebuildFromGlyphs() {
for (unsigned int i = 0; i < mNumChars; i++) {
tGlyph = mGlyphs[i];
tR.Left = (Float)tGlyph.CurX / Tex->width();
tR.Top = (Float)tGlyph.CurY / Tex->height();
tR.Left = (Float)tGlyph.CurX / Tex->getWidth();
tR.Top = (Float)tGlyph.CurY / Tex->getHeight();
tR.Right = (Float)(tGlyph.CurX + tGlyph.CurW) / Tex->width();
tR.Bottom = (Float)(tGlyph.CurY + tGlyph.CurH) / Tex->height();
tR.Right = (Float)(tGlyph.CurX + tGlyph.CurW) / Tex->getWidth();
tR.Bottom = (Float)(tGlyph.CurY + tGlyph.CurH) / Tex->getHeight();
Top = (Float)mHeight + mDescent - tGlyph.GlyphH - tGlyph.MinY;
Bottom = (Float)mHeight + mDescent + tGlyph.GlyphH - tGlyph.MaxY;

View File

@@ -170,7 +170,7 @@ void Shape::drawBB() {
#ifdef PHYSICS_RENDERER_ENABLED
Primitives P;
P.setColor( ColorA( 76, 128, 76, 255 ) );
P.forceDraw( false );
P.setForceDraw( false );
P.drawLine( Line2f( Vector2f( mShape->bb.l, mShape->bb.t ), Vector2f( mShape->bb.r, mShape->bb.t ) ) );
P.drawLine( Line2f( Vector2f( mShape->bb.l, mShape->bb.t ), Vector2f( mShape->bb.l, mShape->bb.b ) ) );
P.drawLine( Line2f( Vector2f( mShape->bb.l, mShape->bb.b ), Vector2f( mShape->bb.r, mShape->bb.b ) ) );

View File

@@ -26,14 +26,14 @@ ShapeCircleSprite::~ShapeCircleSprite() {
void ShapeCircleSprite::draw( Space * space ) {
cVect Pos = body()->pos();
mSprite->position( Pos.x, Pos.y );
mSprite->angle( body()->angleDeg() );
mSprite->setPosition( Pos.x, Pos.y );
mSprite->setRotation( body()->angleDeg() );
mSprite->draw();
}
void ShapeCircleSprite::offsetSet() {
mSprite->size( Sizef( ShapeCircle::radius() * 2, ShapeCircle::radius() * 2 ) );
mSprite->offset( Vector2i( -ShapeCircle::radius() + ShapeCircle::offset().x, -ShapeCircle::radius() + ShapeCircle::offset().y ) );
mSprite->setSize( Sizef( ShapeCircle::radius() * 2, ShapeCircle::radius() * 2 ) );
mSprite->setOffset( Vector2i( -ShapeCircle::radius() + ShapeCircle::offset().x, -ShapeCircle::radius() + ShapeCircle::offset().y ) );
}
Sprite * ShapeCircleSprite::getSprite() const {

View File

@@ -27,7 +27,7 @@ ShapePolySprite::ShapePolySprite( Physics::Body * body, cpFloat width, cpFloat h
mSprite( Sprite ),
mSpriteAutoDelete( AutoDeleteSprite )
{
mSprite->size( Sizef( width, height ) );
mSprite->setSize( Sizef( width, height ) );
offsetSet( cVectNew( width / 2, height / 2 ) );
}
@@ -39,14 +39,14 @@ ShapePolySprite::~ShapePolySprite() {
void ShapePolySprite::draw( Space * space ) {
cVect Pos = body()->pos();
mSprite->offset( mOffset );
mSprite->position( Pos.x, Pos.y );
mSprite->angle( body()->angleDeg() );
mSprite->setOffset( mOffset );
mSprite->setPosition( Pos.x, Pos.y );
mSprite->setRotation( body()->angleDeg() );
mSprite->draw();
}
void ShapePolySprite::offsetSet( cVect center ) {
cVect myCenter = cVectNew( ( mSprite->size().x / 2 ), ( mSprite->size().y / 2 ) );
cVect myCenter = cVectNew( ( mSprite->getSize().x / 2 ), ( mSprite->getSize().y / 2 ) );
mOffset = Vector2i( (Int32)( -myCenter.x + ( center.x - myCenter.x ) ) , (Int32)( -myCenter.y + ( center.y - myCenter.y ) ) );
}

View File

@@ -256,16 +256,16 @@ void UIControl::draw() {
if ( UIManager::instance()->highlightFocus() && UIManager::instance()->focusControl() == this ) {
Primitives P;
P.fillMode( DRAW_LINE );
P.blendMode( blend() );
P.setFillMode( DRAW_LINE );
P.setBlendMode( blend() );
P.setColor( UIManager::instance()->highlightFocusColor() );
P.drawRectangle( getRectf() );
}
if ( UIManager::instance()->highlightOver() && UIManager::instance()->overControl() == this ) {
Primitives P;
P.fillMode( DRAW_LINE );
P.blendMode( blend() );
P.setFillMode( DRAW_LINE );
P.setBlendMode( blend() );
P.setColor( UIManager::instance()->highlightOverColor() );
P.drawRectangle( getRectf() );
}
@@ -528,7 +528,7 @@ Rectf UIControl::getRectf() {
void UIControl::backgroundDraw() {
Primitives P;
Rectf R = getRectf();
P.blendMode( mBackground->blend() );
P.setBlendMode( mBackground->blend() );
P.setColor( mBackground->color() );
if ( 4 == mBackground->colors().size() ) {
@@ -548,9 +548,9 @@ void UIControl::backgroundDraw() {
void UIControl::borderDraw() {
Primitives P;
P.fillMode( DRAW_LINE );
P.blendMode( blend() );
P.lineWidth( (Float)mBorder->width() );
P.setFillMode( DRAW_LINE );
P.setBlendMode( blend() );
P.setLineWidth( (Float)mBorder->width() );
P.setColor( mBorder->color() );
//! @TODO: Check why was this +0.1f -0.1f?

View File

@@ -49,16 +49,16 @@ void UIControlAnim::draw() {
if ( UIManager::instance()->highlightFocus() && UIManager::instance()->focusControl() == this ) {
Primitives P;
P.fillMode( DRAW_LINE );
P.blendMode( blend() );
P.setFillMode( DRAW_LINE );
P.setBlendMode( blend() );
P.setColor( UIManager::instance()->highlightFocusColor() );
P.drawRectangle( getRectf() );
}
if ( UIManager::instance()->highlightOver() && UIManager::instance()->overControl() == this ) {
Primitives P;
P.fillMode( DRAW_LINE );
P.blendMode( blend() );
P.setFillMode( DRAW_LINE );
P.setBlendMode( blend() );
P.setColor( UIManager::instance()->highlightOverColor() );
P.drawRectangle( getRectf() );
}
@@ -348,7 +348,7 @@ Interpolation * UIControlAnim::disableFadeOut( const Time& Time, const bool& Alp
void UIControlAnim::backgroundDraw() {
Primitives P;
Rectf R = getRectf();
P.blendMode( mBackground->blend() );
P.setBlendMode( mBackground->blend() );
P.setColor( getColor( mBackground->color() ) );
if ( 4 == mBackground->colors().size() ) {
@@ -368,9 +368,9 @@ void UIControlAnim::backgroundDraw() {
void UIControlAnim::borderDraw() {
Primitives P;
P.fillMode( DRAW_LINE );
P.blendMode( blend() );
P.lineWidth( (Float)mBorder->width() );
P.setFillMode( DRAW_LINE );
P.setBlendMode( blend() );
P.setLineWidth( (Float)mBorder->width() );
P.setColor( getColor( mBorder->color() ) );
//! @TODO: Check why was this +0.1f -0.1f?

View File

@@ -42,11 +42,11 @@ void UIProgressBar::draw() {
UIControlAnim::draw();
if ( NULL != mParallax && 0.f != mAlpha ) {
ColorA C( mParallax->color() );
ColorA C( mParallax->getColor() );
C.Alpha = (Uint8)mAlpha;
mParallax->color( C );
mParallax->position( Vector2f( mScreenPos.x + mFillerMargin.Left, mScreenPos.y + mFillerMargin.Top ) );
mParallax->setColor( C );
mParallax->setPosition( Vector2f( mScreenPos.x + mFillerMargin.Left, mScreenPos.y + mFillerMargin.Top ) );
mParallax->draw();
}
}
@@ -91,13 +91,13 @@ void UIProgressBar::onSizeChange() {
if ( NULL != mParallax ) {
Float Height = (Float)mSize.getHeight();
if ( !mVerticalExpand && mParallax->subTexture() )
Height = (Float)mParallax->subTexture()->realSize().getHeight();
if ( !mVerticalExpand && mParallax->getSubTexture() )
Height = (Float)mParallax->getSubTexture()->realSize().getHeight();
if ( Height > mSize.getHeight() )
Height = mSize.getHeight();
mParallax->size( Sizef( ( ( mSize.getWidth() - mFillerMargin.Left - mFillerMargin.Right ) * mProgress ) / mTotalSteps, Height - mFillerMargin.Top - mFillerMargin.Bottom ) );
mParallax->setSize( Sizef( ( ( mSize.getWidth() - mFillerMargin.Left - mFillerMargin.Right ) * mProgress ) / mTotalSteps, Height - mFillerMargin.Top - mFillerMargin.Bottom ) );
}
updateTextBox();
@@ -129,7 +129,7 @@ void UIProgressBar::movementSpeed( const Vector2f& Speed ) {
mSpeed = Speed;
if ( NULL != mParallax )
mParallax->speed( mSpeed );
mParallax->setSpeed( mSpeed );
}
const Vector2f& UIProgressBar::movementSpeed() const {

View File

@@ -52,7 +52,7 @@ void UISprite::draw() {
if ( mVisible ) {
if ( NULL != mSprite && 0.f != mAlpha ) {
checkSubTextureUpdate();
mSprite->position( (Float)( mScreenPos.x + mAlignOffset.x ), (Float)( mScreenPos.y + mAlignOffset.y ) );
mSprite->setPosition( (Float)( mScreenPos.x + mAlignOffset.x ), (Float)( mScreenPos.y + mAlignOffset.y ) );
mSprite->draw( blend(), mRender );
}
}
@@ -70,7 +70,7 @@ void UISprite::alpha( const Float& alpha ) {
UIControlAnim::alpha( alpha );
if ( NULL != mSprite )
mSprite->alpha( alpha );
mSprite->setAlpha( alpha );
}
Graphics::Sprite * UISprite::sprite() const {
@@ -79,14 +79,14 @@ Graphics::Sprite * UISprite::sprite() const {
ColorA UISprite::color() const {
if ( NULL != mSprite )
return mSprite->color();
return mSprite->getColor();
return ColorA();
}
void UISprite::color( const ColorA& color ) {
if ( NULL != mSprite )
mSprite->color( color );
mSprite->setColor( color );
alpha( color.a() );
}

View File

@@ -103,7 +103,7 @@ void UITabWidget::draw() {
controlToScreen( p1 );
controlToScreen( p2 );
P.lineWidth( 1 );
P.setLineWidth( 1 );
P.setColor( mLineBelowTabsColor );
P.drawLine( Line2f( Vector2f( p1.x, p1.y ), Vector2f( p2.x, p2.y ) ) );

View File

@@ -654,7 +654,7 @@ void UIWindow::draw() {
if ( mWinFlags & UI_WIN_DRAW_SHADOW ) {
Primitives P;
P.forceDraw( false );
P.setForceDraw( false );
ColorA BeginC( 0, 0, 0, 25 * ( alpha() / (Float)255 ) );
ColorA EndC( 0, 0, 0, 0 );
@@ -680,7 +680,7 @@ void UIWindow::draw() {
P.drawTriangle( Triangle2f( Vector2f( ShadowPos.x, ShadowPos.y + mSize.getHeight() ), Vector2f( ShadowPos.x - SSize, ShadowPos.y + mSize.getHeight() ), Vector2f( ShadowPos.x, ShadowPos.y + mSize.getHeight() + SSize ) ), BeginC, EndC, EndC );
P.forceDraw( true );
P.setForceDraw( true );
}
}

View File

@@ -46,11 +46,11 @@ void CursorSDL::create() {
bmask = 0x00ff0000;
amask = 0xff000000;
#endif
SDL_Surface * TempGlyphSheet = SDL_CreateRGBSurface( SDL_SWSURFACE, mImage->width(), mImage->height(), mImage->channels() * 8, rmask, gmask, bmask, amask );
SDL_Surface * TempGlyphSheet = SDL_CreateRGBSurface( SDL_SWSURFACE, mImage->getWidth(), mImage->getHeight(), mImage->getChannels() * 8, rmask, gmask, bmask, amask );
SDL_LockSurface( TempGlyphSheet );
Uint32 ssize = TempGlyphSheet->w * TempGlyphSheet->h * mImage->channels();
Uint32 ssize = TempGlyphSheet->w * TempGlyphSheet->h * mImage->getChannels();
Uint8 * Ptr = mImage->getPixels();

View File

@@ -506,9 +506,9 @@ bool WindowSDL::setIcon( const std::string& Path ) {
if ( NULL != Img.getPixelsPtr() ) {
const Uint8 * Ptr = Img.getPixelsPtr();
x = Img.width();
y = Img.height();
c = Img.channels();
x = Img.getWidth();
y = Img.getHeight();
c = Img.getChannels();
if ( ( x % 8 ) == 0 && ( y % 8 ) == 0 ) {
Uint32 rmask, gmask, bmask, amask;

View File

@@ -133,7 +133,7 @@ bool WindowSFML::setIcon( const std::string& Path ) {
Image Img( Path );
mSFMLWindow.setIcon( Img.width(), Img.height(), Img.getPixelsPtr() );
mSFMLWindow.setIcon( Img.getWidth(), Img.getHeight(), Img.getPixelsPtr() );
return true;
}

View File

@@ -10,7 +10,7 @@ Cursor::Cursor( Texture * tex, const Vector2i& hotspot, const std::string& name,
mWindow( window )
{
if ( NULL != tex && tex->lock() ) {
mImage = eeNew( Graphics::Image, ( tex->getPixelsPtr(), tex->width(), tex->height(), tex->channels() ) );
mImage = eeNew( Graphics::Image, ( tex->getPixelsPtr(), tex->getWidth(), tex->getHeight(), tex->getChannels() ) );
tex->unlock();
} else {
@@ -25,8 +25,8 @@ Cursor::Cursor( Graphics::Image * img, const Vector2i& hotspot, const std::strin
mHotSpot( hotspot ),
mWindow( window )
{
if ( img->memSize() ) {
mImage = eeNew( Graphics::Image, ( img->getPixelsPtr(), img->width(), img->height(), img->channels() ) );
if ( img->getMemSize() ) {
mImage = eeNew( Graphics::Image, ( img->getPixelsPtr(), img->getWidth(), img->getHeight(), img->getChannels() ) );
} else {
eePRINTL( "Cursor::Cursor: Error creating cursor from Image." );
}

View File

@@ -42,20 +42,20 @@ CursorX11::~CursorX11() {
}
void CursorX11::create() {
if ( NULL == mImage || 0 == mImage->memSize() )
if ( NULL == mImage || 0 == mImage->getMemSize() )
return;
XcursorImage * image;
unsigned int c, ix, iy;
image = XcursorImageCreate( mImage->width(), mImage->height() );
image = XcursorImageCreate( mImage->getWidth(), mImage->getHeight() );
if ( image == None )
return;
c = 0;
for ( iy = 0; iy < mImage->height(); iy++ ) {
for ( ix = 0; ix < mImage->width(); ix++ ) {
for ( iy = 0; iy < mImage->getHeight(); iy++ ) {
for ( ix = 0; ix < mImage->getWidth(); ix++ ) {
ColorA C = mImage->getPixel( ix, iy );
image->pixels[c++] = ( C.a() << 24 ) | ( C.r() << 16 ) | ( C.g() <<8 ) | ( C.b() );

View File

@@ -149,7 +149,7 @@ void Window::setup2D( const bool& KeepView ) {
mCurrentView->needUpdate();
}
BlendMode::SetMode( ALPHA_NORMAL, true );
BlendMode::setMode( ALPHA_NORMAL, true );
if ( GLv_3 != GLi->version() ) {
#if !defined( EE_GLES2 ) || defined( EE_GLES_BOTH )

View File

@@ -63,7 +63,7 @@ void videoResize( EE::Window::Window * w ) {
GLi->enableClientState( GL_COLOR_ARRAY );
/// Reset the default blend func ( by default eepp use ALPHA_NORMAL )
BlendMode::SetMode( ALPHA_BLENDONE );
BlendMode::setMode( ALPHA_BLENDONE );
/// Set the line width
GlobalBatchRenderer::instance()->setLineWidth( 2 );

View File

@@ -98,8 +98,8 @@ EE_MAIN_FUNC int main (int argc, char * argv [])
TexF2->setText( TTF->getText() );
// Set the font color
TTF2->color( RGB(0,0,0) );
TexF->color( RGB(0,0,0) );
TTF2->setColor( RGB(0,0,0) );
TexF->setColor( RGB(0,0,0) );
// Create a new text string
String Txt( "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum." );

View File

@@ -26,15 +26,15 @@ void spriteCallback( Uint32 Event, Sprite * Sprite, void * UserData ) {
// Create an interpolation to change the angle of the sprite
Interpolation * RotationInterpolation = reinterpret_cast<Interpolation*>( UserData );
RotationInterpolation->clearWaypoints();
RotationInterpolation->addWaypoint( Sprite->angle() );
RotationInterpolation->addWaypoint( Sprite->angle() + 45.f );
RotationInterpolation->addWaypoint( Sprite->getRotation() );
RotationInterpolation->addWaypoint( Sprite->getRotation() + 45.f );
RotationInterpolation->setTotalTime( Milliseconds( 500 ) );
RotationInterpolation->setType( Ease::BounceOut ); // Set the easing effect used for the interpolation
RotationInterpolation->start();
// Scale the sprite
if ( Sprite->scale().x < 3 ) {
Sprite->scale( Sprite->scale() + 0.25f );
if ( Sprite->getScale().x < 3 ) {
Sprite->setScale( Sprite->getScale() + 0.25f );
}
}
}
@@ -56,7 +56,7 @@ void MainLoop()
// Check if the D key was pressed
if ( win->getInput()->isKeyUp( KEY_D ) ) {
// Reverse the Rock animation
Rock->reverseAnim( !Rock->reverseAnim() );
Rock->setReverseAnimation( !Rock->getReverseAnimation() );
}
// Update the angle interpolation
@@ -64,8 +64,8 @@ void MainLoop()
RockAngle.update( win->getElapsed() );
// Set the Planet and Rock angle from the interpolation
Planet->angle( PlanetAngle.getPos() );
Rock->angle( RockAngle.getPos() );
Planet->setRotation( PlanetAngle.getPos() );
Rock->setRotation( RockAngle.getPos() );
// Draw the static planet sprite
Planet->draw();
@@ -128,25 +128,25 @@ EE_MAIN_FUNC int main (int argc, char * argv [])
// Set the sprite animation speed, set in Frames per Second
// Sprites are auto-animated by default.
Rock->animSpeed( 32 );
Rock->setAnimationSpeed( 32 );
// Set the render mode of the sprite
Blindy->renderMode( RN_MIRROR );
Blindy->setRenderMode( RN_MIRROR );
// Set the Blend Mode of the sprite
Blindy->blendMode( ALPHA_BLENDONE );
Blindy->setBlendMode( ALPHA_BLENDONE );
// Set the primitive fill mode
P.fillMode( DRAW_LINE );
P.setFillMode( DRAW_LINE );
// Set the sprites position to the screen center
Vector2i ScreenCenter( Engine::instance()->getWidth() / 2, Engine::instance()->getHeight() / 2 );
Planet->position( ScreenCenter.x - Planet->getAABB().getSize().getWidth() / 2, ScreenCenter.y - Planet->getAABB().getSize().getHeight() / 2 );
Planet->setPosition( ScreenCenter.x - Planet->getAABB().getSize().getWidth() / 2, ScreenCenter.y - Planet->getAABB().getSize().getHeight() / 2 );
Rock->position( ScreenCenter.x - Rock->getAABB().getSize().getWidth() / 2, ScreenCenter.y - Rock->getAABB().getSize().getHeight() / 2 );
Rock->setPosition( ScreenCenter.x - Rock->getAABB().getSize().getWidth() / 2, ScreenCenter.y - Rock->getAABB().getSize().getHeight() / 2 );
Blindy->position( ScreenCenter.x - Blindy->getAABB().getSize().getWidth() / 2, ScreenCenter.y - Blindy->getAABB().getSize().getHeight() / 2 );
Blindy->setPosition( ScreenCenter.x - Blindy->getAABB().getSize().getWidth() / 2, ScreenCenter.y - Blindy->getAABB().getSize().getHeight() / 2 );
// Set the planet angle interpolation
PlanetAngle.addWaypoint( 0 );

View File

@@ -59,9 +59,9 @@ void MainLoop()
Float HHeight = win->getHeight() * 0.5f;
// The batch can be rotated, scale and moved
Batch->batchRotation( ang );
Batch->batchScale( scale );
Batch->batchCenter( Vector2f( HWidth, HHeight ) );
Batch->setBatchRotation( ang );
Batch->setBatchScale( scale );
Batch->setBatchCenter( Vector2f( HWidth, HHeight ) );
// Create a quad to render
Float aX = HWidth - 256.f;

View File

@@ -117,7 +117,7 @@ void EETest::Init() {
mFBO = FrameBuffer::New( 256, 256, false );
if ( NULL != mFBO )
mFBO->clearColor( ColorAf( 0, 0, 0, 0.5f ) );
mFBO->setClearColor( ColorAf( 0, 0, 0, 0.5f ) );
Polygon2f Poly = Polygon2f::createRoundedRectangle( 0, 0, 256, 50 );
@@ -679,9 +679,9 @@ void EETest::ItemClick( const UIEvent * Event ) {
SetScreen( 5 );
} else if ( "Show Console" == txt ) {
Con.toggle();
InBuf.setActive( !Con.active() );
InBuf.setActive( !Con.isActive() );
if ( Con.active() ) {
if ( Con.isActive() ) {
mWindow->startTextInput();
} else {
mWindow->stopTextInput();
@@ -886,8 +886,8 @@ void EETest::LoadTextures() {
Texture * Tex = TNP[2];
if ( NULL != Tex && Tex->lock() ) {
w = (int)Tex->width();
h = (int)Tex->height();
w = (int)Tex->getWidth();
h = (int)Tex->getHeight();
for ( y = 0; y < h; y++) {
for ( x = 0; x < w; x++) {
@@ -914,16 +914,16 @@ void EETest::LoadTextures() {
CurMan->set( EE_CURSOR_ARROW );
CL1.addFrame( TN[2] );
CL1.position( 500, 400 );
CL1.scale( 0.5f );
CL1.setPosition( 500, 400 );
CL1.setScale( 0.5f );
CL2.addFrame(TN[0], Sizef(96, 96) );
CL2.color( ColorA( 255, 255, 255, 255 ) );
CL2.setColor( ColorA( 255, 255, 255, 255 ) );
mTGL = eeNew( TextureAtlasLoader, ( MyPath + "atlases/bnb" + EE_TEXTURE_ATLAS_EXTENSION ) );
mBlindy.addFramesByPattern( "rn" );
mBlindy.position( 320.f, 0.f );
mBlindy.setPosition( 320.f, 0.f );
mBoxSprite = eeNew( Sprite, ( GlobalTextureAtlas::instance()->add( eeNew( SubTexture, ( TN[3], "ilmare" ) ) ) ) );
mCircleSprite = eeNew( Sprite, ( GlobalTextureAtlas::instance()->add( eeNew( SubTexture, ( TN[1], "thecircle" ) ) ) ) );
@@ -980,9 +980,9 @@ void EETest::Screen2() {
Batch.quadsSetColor( ColorA(150,150,150,100) );
Batch.quadsSetSubset( 0.0f, 0.0f, 0.5f, 0.5f );
Batch.batchRotation( ang );
Batch.batchScale( scale );
Batch.batchCenter( Vector2f( HWidth, HHeight ) );
Batch.setBatchRotation( ang );
Batch.setBatchScale( scale );
Batch.setBatchCenter( Vector2f( HWidth, HHeight ) );
Float aX = HWidth - 256.f;
Float aY = HHeight - 256.f;
@@ -1005,12 +1005,12 @@ void EETest::Screen2() {
Batch.draw();
Batch.batchRotation( 0.0f );
Batch.batchScale( 1.0f );
Batch.batchCenter( Vector2f( 0, 0 ) );
Batch.setBatchRotation( 0.0f );
Batch.setBatchScale( 1.0f );
Batch.setBatchCenter( Vector2f( 0, 0 ) );
Float PlanetX = HWidth - TNP[6]->width() * 0.5f;
Float PlanetY = HHeight - TNP[6]->height() * 0.5f;
Float PlanetX = HWidth - TNP[6]->getWidth() * 0.5f;
Float PlanetY = HHeight - TNP[6]->getHeight() * 0.5f;
ang+=et.asMilliseconds() * 0.1f;
ang = (ang>=360) ? 0 : ang;
@@ -1052,33 +1052,33 @@ void EETest::Screen2() {
ColorA Col(255,255,255,(int)alpha);
TNP[1]->drawEx( (Float)mWindow->getWidth() - 128.f, (Float)mWindow->getHeight() - 128.f, 128.f, 128.f, ang, Vector2f::One, Col, Col, Col, Col, ALPHA_BLENDONE, RN_FLIPMIRROR);
SP.position( alpha, alpha );
SP.setPosition( alpha, alpha );
SP.draw();
#ifndef EE_GLES
CL1.renderMode( RN_ISOMETRIC );
CL1.setRenderMode( RN_ISOMETRIC );
if ( CL1.getAABB().intersectCircle( Mousef, 80.f ) )
CL1.color( ColorA(255, 0, 0, 200) );
CL1.setColor( ColorA(255, 0, 0, 200) );
else
CL1.color( ColorA(255, 255, 255, 200) );
CL1.setColor( ColorA(255, 255, 255, 200) );
if ( Polygon2f::intersectQuad2( CL1.getQuad() , CL2.getQuad() ) ) {
CL1.color( ColorA(0, 255, 0, 255) );
CL2.color( ColorA(0, 255, 0, 255) );
CL1.setColor( ColorA(0, 255, 0, 255) );
CL2.setColor( ColorA(0, 255, 0, 255) );
} else
CL2.color( ColorA(255, 255, 255, 255) );
CL2.setColor( ColorA(255, 255, 255, 255) );
CL1.angle(ang);
CL1.scale(scale * 0.5f);
CL1.setRotation(ang);
CL1.setScale(scale * 0.5f);
CL2.position( (Float)Mousef.x - 64.f, (Float)Mousef.y + 128.f );
CL2.angle(-ang);
CL2.setPosition( (Float)Mousef.x - 64.f, (Float)Mousef.y + 128.f );
CL2.setRotation(-ang);
CL1.draw();
CL2.draw();
PR.fillMode( DRAW_LINE );
PR.setFillMode( DRAW_LINE );
PR.drawRectangle( CL1.getAABB() );
PR.drawQuad( CL1.getQuad() );
@@ -1114,15 +1114,15 @@ void EETest::Screen2() {
else if (iL2)
PR.setColor( ColorA(255, 255, 0, 255) );
PR.fillMode( DRAW_LINE );
PR.setFillMode( DRAW_LINE );
PR.drawCircle( Vector2f( Mousef.x, Mousef.y ), 80.f, (Uint32)(Ang/3) );
PR.drawTriangle( Triangle2f( Vector2f( Mousef.x, Mousef.y - 10.f ), Vector2f( Mousef.x - 10.f, Mousef.y + 10.f ), Vector2f( Mousef.x + 10.f, Mousef.y + 10.f ) ) );
PR.drawLine( Line2f( Vector2f(Mousef.x - 80.f, Mousef.y - 80.f), Vector2f(Mousef.x + 80.f, Mousef.y + 80.f) ) );
PR.drawLine( Line2f( Vector2f(Mousef.x - 80.f, Mousef.y + 80.f), Vector2f(Mousef.x + 80.f, Mousef.y - 80.f) ) );
PR.drawLine( Line2f( Vector2f((Float)mWindow->getWidth(), 0.f), Vector2f( 0.f, (Float)mWindow->getHeight() ) ) );
PR.fillMode( DRAW_FILL );
PR.setFillMode( DRAW_FILL );
PR.drawQuad( Quad2f( Vector2f(0.f, 0.f), Vector2f(0.f, 100.f), Vector2f(150.f, 150.f), Vector2f(200.f, 150.f) ), ColorA(220, 240, 0, 125), ColorA(100, 0, 240, 125), ColorA(250, 50, 25, 125), ColorA(50, 150, 150, 125) );
PR.fillMode( DRAW_LINE );
PR.setFillMode( DRAW_LINE );
PR.drawRectangle( Rectf( Vector2f( Mousef.x - 80.f, Mousef.y - 80.f ), Sizef( 160.f, 160.f ) ), 45.f );
PR.drawLine( Line2f( Vector2f(0.f, 0.f), Vector2f( (Float)mWindow->getWidth(), (Float)mWindow->getHeight() ) ) );
@@ -1158,7 +1158,7 @@ void EETest::Screen4() {
}
if ( NULL != mVBO ) {
mBlindy.position( 128-16, 128-16 );
mBlindy.setPosition( 128-16, 128-16 );
mBlindy.draw();
mVBO->bind();
@@ -1242,7 +1242,7 @@ void EETest::Render() {
mEEText.flags( FONT_DRAW_CENTER );
PR.setColor( ColorA(150, 150, 150, 220) );
PR.fillMode( DRAW_FILL );
PR.setFillMode( DRAW_FILL );
PR.drawRectangle(
Rectf(
Vector2f(
@@ -1329,7 +1329,7 @@ void EETest::Input() {
if ( KM->isAltPressed() && KM->isKeyUp( KEY_C ) )
mWindow->centerToScreen();
if ( KM->isAltPressed() && KM->isKeyUp( KEY_M ) && !Con.active() ) {
if ( KM->isAltPressed() && KM->isKeyUp( KEY_M ) && !Con.isActive() ) {
if ( !mWindow->isMaximized() )
mWindow->maximize();
}
@@ -1359,7 +1359,7 @@ void EETest::Input() {
if ( KM->isKeyUp( KEY_F3 ) || KM->isKeyUp( KEY_WORLD_26 ) || KM->isKeyUp( KEY_BACKSLASH ) ) {
Con.toggle();
InBuf.setActive( !Con.active() );
InBuf.setActive( !Con.isActive() );
}
if ( KM->isKeyUp(KEY_1) && KM->isControlPressed() )
@@ -1480,7 +1480,7 @@ void EETest::Input() {
SP.setRepetitions(-1);
if ( KM->isKeyUp(KEY_D) )
SP.reverseAnim( !SP.reverseAnim() );
SP.setReverseAnimation( !SP.getReverseAnimation() );
if ( KM->isMouseRightPressed() )
DrawBack = true;
@@ -1536,24 +1536,24 @@ void EETest::Process() {
void EETest::ParticlesCallback( Particle * P, ParticleSystem * Me ) {
Float x, y, radio;
Vector2f MePos( Me->position() );
Vector2f MePos( Me->getPosition() );
radio = (Math::randf(1.f, 1.2f) + sin( 20.0f / P->id() )) * 24;
x = MePos.x + radio * cos( (Float)P->id() );
y = MePos.y + radio * sin( (Float)P->id() );
radio = (Math::randf(1.f, 1.2f) + sin( 20.0f / P->getId() )) * 24;
x = MePos.x + radio * cos( (Float)P->getId() );
y = MePos.y + radio * sin( (Float)P->getId() );
P->reset(x, y, Math::randf(-10.f, 10.f), Math::randf(-10.f, 10.f), Math::randf(-10.f, 10.f), Math::randf(-10.f, 10.f));
P->Color( ColorAf(1.f, 0.6f, 0.3f, 1.f), 0.02f + Math::randf() * 0.3f );
P->setColor( ColorAf(1.f, 0.6f, 0.3f, 1.f), 0.02f + Math::randf() * 0.3f );
}
void EETest::Particles() {
PS[0].position( Mousef );
PS[0].setPosition( Mousef );
if ( DrawBack )
PS[1].position( Mousef );
PS[1].setPosition( Mousef );
PS[2].position( HWidth, HHeight );
PS[3].position( Math::cosAng(Ang) * 220.f + HWidth + Math::randf(0.f, 10.f), Math::sinAng(Ang) * 220.f + HHeight + Math::randf(0.f, 10.f) );
PS[4].position( -Math::cosAng(Ang) * 220.f + HWidth + Math::randf(0.f, 10.f), -Math::sinAng(Ang) * 220.f + HHeight + Math::randf(0.f, 10.f) );
PS[2].setPosition( HWidth, HHeight );
PS[3].setPosition( Math::cosAng(Ang) * 220.f + HWidth + Math::randf(0.f, 10.f), Math::sinAng(Ang) * 220.f + HHeight + Math::randf(0.f, 10.f) );
PS[4].setPosition( -Math::cosAng(Ang) * 220.f + HWidth + Math::randf(0.f, 10.f), -Math::sinAng(Ang) * 220.f + HHeight + Math::randf(0.f, 10.f) );
for ( Uint32 i = 0; i < PS.size(); i++ )
PS[i].draw();
@@ -1565,11 +1565,11 @@ void EETest::Particles() {
void EETest::CreateJointAndBody() {
#ifndef EE_PLATFORM_TOUCH
mMouseJoint = NULL;
mMouseBody = eeNew( Body, ( INFINITY, INFINITY ) );
mMouseBody = Body::New( INFINITY, INFINITY );
#else
for ( Uint32 i = 0; i < EE_MAX_FINGERS; i++ ) {
mMouseJoint[i] = NULL;
mMouseBody[i] = eeNew( Body, ( INFINITY, INFINITY ) );
mMouseBody[i] = Body::New( INFINITY, INFINITY );
}
#endif
}