diff --git a/include/eepp/graphics/batchrenderer.hpp b/include/eepp/graphics/batchrenderer.hpp index 15996c24a..81ded583b 100755 --- a/include/eepp/graphics/batchrenderer.hpp +++ b/include/eepp/graphics/batchrenderer.hpp @@ -15,7 +15,7 @@ struct eeTexCoord { struct eeVertex { Vector2f pos; eeTexCoord tex; - ColorA color; + Color color; }; class TextureFactory; @@ -101,16 +101,16 @@ class EE_API BatchRenderer { void quadsSetSubsetFree( const Float& x0, const Float& y0, const Float& x1, const Float& y1, const Float& x2, const Float& y2, const Float& x3, const Float& y3 ); /** Set the quad color */ - void quadsSetColor( const ColorA& Color ); + void quadsSetColor( const Color& Color ); /** Set the quad color per vertex */ - void quadsSetColorFree( const ColorA& Color0, const ColorA& Color1, const ColorA& Color2, const ColorA& Color3 ); + void quadsSetColorFree( const Color& Color0, const Color& Color1, const Color& Color2, const Color& Color3 ); /** This will set as the default batch rendering to DM_POINTS. And will reset the point color to ColorA(255,255,255,255). */ void pointsBegin(); /** Set the point color */ - void pointSetColor( const ColorA& Color ); + void pointSetColor( const Color& Color ); /** Add to the batch a point ( this will change your batch rendering method to DM_POINTS, so if you were using another one will Draw all the batched vertexs first ) */ void batchPoint( const Float& x, const Float& y ); @@ -119,10 +119,10 @@ class EE_API BatchRenderer { void linesBegin(); /** Set the line color */ - void linesSetColor( const ColorA& Color ); + void linesSetColor( const Color& Color ); /** Set the line color, per vertex */ - void linesSetColorFree( const ColorA& Color0, const ColorA& Color1 ); + void linesSetColorFree( const Color& Color0, const Color& Color1 ); /** Add to the batch a line ( this will change your batch rendering method to DM_LINES, so if you were using another one will Draw all the batched vertexs first ) */ void batchLine( const Float& x0, const Float& y0, const Float& x1, const Float& y1 ); @@ -131,10 +131,10 @@ class EE_API BatchRenderer { void lineLoopBegin(); /** Set the line color */ - void lineLoopSetColor( const ColorA& Color ); + void lineLoopSetColor( const Color& Color ); /** Set the line color, per vertex */ - void lineLoopSetColorFree( const ColorA& Color0, const ColorA& Color1 ); + void lineLoopSetColorFree( const Color& Color0, const Color& Color1 ); /** Add to the batch a line ( this will change your batch rendering method to DM_LINE_LOOP, so if you were using another one will Draw all the batched vertexs first ) */ void batchLineLoop( const Float& x0, const Float& y0, const Float& x1, const Float& y1 ); @@ -152,10 +152,10 @@ class EE_API BatchRenderer { void lineStripBegin(); /** Set the line color */ - void lineStripSetColor( const ColorA& Color ); + void lineStripSetColor( const Color& Color ); /** Set the line color, per vertex */ - void lineStripSetColorFree( const ColorA& Color0, const ColorA& Color1 ); + void lineStripSetColorFree( const Color& Color0, const Color& Color1 ); /** Add to the batch a line ( this will change your batch rendering method to DM_LINE_STRIP, so if you were using another one will Draw all the batched vertexs first ) */ void batchLineStrip( const Float& x0, const Float& y0, const Float& x1, const Float& y1 ); @@ -173,10 +173,10 @@ class EE_API BatchRenderer { void triangleFanBegin(); /** Set the triangle fan color */ - void triangleFanSetColor( const ColorA& Color ); + void triangleFanSetColor( const Color& Color ); /** Set the triangle fan color, per vertex */ - void triangleFanSetColorFree( const ColorA& Color0, const ColorA& Color1, const ColorA& Color2 ); + void triangleFanSetColorFree( const Color& Color0, const Color& Color1, const Color& Color2 ); /** Set the texture sector to be rendered but freely seted */ void triangleFanSetSubset( const Float& x0, const Float& y0, const Float& x1, const Float& y1, const Float& x2, const Float& y2 ); @@ -191,10 +191,10 @@ class EE_API BatchRenderer { void trianglesBegin(); /** Set the triangles color */ - void trianglesSetColor( const ColorA& Color ); + void trianglesSetColor( const Color& Color ); /** Set the triangles color, per vertex */ - void trianglesSetColorFree( const ColorA& Color0, const ColorA& Color1, const ColorA& Color2 ); + void trianglesSetColorFree( const Color& Color0, const Color& Color1, const Color& Color2 ); /** Set the texture sector to be rendered but freely seted */ void trianglesSetSubset( const Float& x0, const Float& y0, const Float& x1, const Float& y1, const Float& x2, const Float& y2 ); @@ -203,7 +203,7 @@ class EE_API BatchRenderer { void batchTriangle( const Float& x0, const Float& y0, const Float& x1, const Float& y1, const Float& x2, const Float& y2 ); /** Set the polygon color */ - void polygonSetColor( const ColorA& Color ); + void polygonSetColor( const Color& Color ); /** Add to the batch a polygon ( this will change your batch rendering method to DM_POLYGON, so if you were using another one will Draw all the batched vertexs first ) */ void batchPolygon( const Polygon2f& Polygon ); @@ -242,7 +242,7 @@ class EE_API BatchRenderer { EE_BLEND_MODE mBlend; eeTexCoord mTexCoord[4]; - ColorA mVerColor[4]; + Color mVerColor[4]; EE_DRAW_MODE mCurrentMode; diff --git a/include/eepp/graphics/console.hpp b/include/eepp/graphics/console.hpp index d3368cb67..392e90cf5 100755 --- a/include/eepp/graphics/console.hpp +++ b/include/eepp/graphics/console.hpp @@ -40,30 +40,30 @@ class EE_API Console : protected LogReaderInterface { Uint32 getBackgroundTextureId() const { return mTexId; } /** Set the Console Background Color */ - void setBackgroundColor( const ColorA& BackColor ) { mConColor = BackColor; mMaxAlpha = mConColor.a; } + void setBackgroundColor( const Color& BackColor ) { mConColor = BackColor; mMaxAlpha = mConColor.a; } void setCharacterSize( const Uint32& characterSize ); /** Get the Console Background Color */ - const ColorA& getBackgroundColor() const { return mConColor; } + const Color& getBackgroundColor() const { return mConColor; } /** Set the Console Border Line Background Color */ - void setBackgroundLineColor( const ColorA& BackColor ) { mConLineColor = BackColor; } + void setBackgroundLineColor( const Color& BackColor ) { mConLineColor = BackColor; } /** Get the Console Border Line Background Color */ - const ColorA& getBackgroundLineColor() const { return mConLineColor; } + const Color& getBackgroundLineColor() const { return mConLineColor; } /** Set the Console Font Color */ - void setFontColor( const ColorA& FntColor ) { mFontStyleConfig.Color = FntColor; } + void setFontColor( const Color& FntColor ) { mFontStyleConfig.FontColor = FntColor; } /** Get the Console Font Color */ - const ColorA& getFontColor() const { return mFontStyleConfig.Color; } + const Color& getFontColor() const { return mFontStyleConfig.FontColor; } /** Set the Console Client Input ( Writeable Line ) Font Color */ - void setFontLineColor( const ColorA& FntColor ) { mFontLineColor = FntColor; } + void setFontLineColor( const Color& FntColor ) { mFontLineColor = FntColor; } /** Get the Console Client Input ( Writeable Line ) Font Color */ - const ColorA& getFontLineColor() const { return mFontLineColor; } + const Color& getFontLineColor() const { return mFontLineColor; } /** Toogle the console between visible and hided with Fade In or Fade Out effect. */ void toggle(); @@ -135,9 +135,9 @@ class EE_API Console : protected LogReaderInterface { EE::Window::Window * mWindow; - ColorA mConColor; - ColorA mConLineColor; - ColorA mFontLineColor; + Color mConColor; + Color mConLineColor; + Color mFontLineColor; Float mWidth; Float mHeight; diff --git a/include/eepp/graphics/drawable.hpp b/include/eepp/graphics/drawable.hpp index 1feb65945..b8f89fa05 100644 --- a/include/eepp/graphics/drawable.hpp +++ b/include/eepp/graphics/drawable.hpp @@ -25,13 +25,13 @@ class EE_API Drawable { const Uint8& getAlpha(); - void setColor( const ColorA& color ); + void setColor( const Color& color ); - const ColorA& getColor() const; + const Color& getColor() const; - void setColorFilter( const ColorA& color ); + void setColorFilter( const Color& color ); - Color getColorFilter(); + RGB getColorFilter(); void clearColor(); @@ -46,7 +46,7 @@ class EE_API Drawable { void setPosition( const Vector2f& position ); protected: EE_DRAWABLE_TYPE mDrawableType; - ColorA mColor; + Color mColor; Vector2f mPosition; virtual void onAlphaChange(); diff --git a/include/eepp/graphics/fontstyleconfig.hpp b/include/eepp/graphics/fontstyleconfig.hpp index b269d5aea..9acb31c34 100644 --- a/include/eepp/graphics/fontstyleconfig.hpp +++ b/include/eepp/graphics/fontstyleconfig.hpp @@ -15,11 +15,11 @@ class FontStyleConfig { return Font; } - const ColorA& getFontColor() const { - return Color; + const Color& getFontColor() const { + return FontColor; } - const ColorA& getFontShadowColor() const { + const Color& getFontShadowColor() const { return ShadowColor; } @@ -35,7 +35,7 @@ class FontStyleConfig { return OutlineThickness; } - ColorA getOutlineColor() const { + Color getOutlineColor() const { return OutlineColor; } @@ -45,7 +45,7 @@ class FontStyleConfig { Font( fontStyleConfig.Font ), CharacterSize( fontStyleConfig.CharacterSize ), Style( fontStyleConfig.Style ), - Color( fontStyleConfig.Color ), + FontColor( fontStyleConfig.FontColor ), ShadowColor( fontStyleConfig.ShadowColor ), OutlineThickness( fontStyleConfig.OutlineThickness ), OutlineColor( fontStyleConfig.OutlineColor ) @@ -55,7 +55,7 @@ class FontStyleConfig { Font = fontStyleConfig.Font; Style = fontStyleConfig.Style; CharacterSize = fontStyleConfig.CharacterSize; - Color = fontStyleConfig.Color; + FontColor = fontStyleConfig.FontColor; ShadowColor = fontStyleConfig.ShadowColor; OutlineThickness = fontStyleConfig.OutlineThickness; OutlineColor = fontStyleConfig.OutlineColor; @@ -64,10 +64,10 @@ class FontStyleConfig { Graphics::Font * Font = NULL; Uint32 CharacterSize = 12; Uint32 Style = 0; - ColorA Color = ColorA(255,255,255,255); - ColorA ShadowColor = ColorA(50,50,50,230); + Color FontColor = Color(255,255,255,255); + Color ShadowColor = Color(50,50,50,230); Float OutlineThickness = 0; - ColorA OutlineColor = ColorA(0,0,0,255); + Color OutlineColor = Color(0,0,0,255); }; }} diff --git a/include/eepp/graphics/image.hpp b/include/eepp/graphics/image.hpp index b03a1f09e..e597878b6 100644 --- a/include/eepp/graphics/image.hpp +++ b/include/eepp/graphics/image.hpp @@ -64,7 +64,7 @@ class EE_API Image { Image( const Uint8* data, const unsigned int& width, const unsigned int& height, const unsigned int& channels ); /** Create an empty image */ - Image( const Uint32& width, const Uint32& height, const Uint32& channels, const ColorA& DefaultColor = ColorA(0,0,0,0), const bool& initWithDefaultColor = true ); + Image( const Uint32& width, const Uint32& height, const Uint32& channels, const Color& DefaultColor = Color(0,0,0,0), const bool& initWithDefaultColor = true ); /** Load an image from path * @param Path The path to the file. @@ -82,13 +82,13 @@ class EE_API Image { virtual ~Image(); /** Create an empty image data */ - void create( const Uint32& width, const Uint32& height, const Uint32& channels, const ColorA &DefaultColor = ColorA(0,0,0,0), const bool& initWithDefaultColor = true ); + void create( const Uint32& width, const Uint32& height, const Uint32& channels, const Color &DefaultColor = Color(0,0,0,0), const bool& initWithDefaultColor = true ); /** Return the pixel color from the image. \n You must have a copy of the image on local memory. For that you need to Lock the image first. */ - virtual ColorA getPixel(const unsigned int& x, const unsigned int& y); + virtual Color getPixel(const unsigned int& x, const unsigned int& y); /** Set the pixel color to the image. \n You must have a copy of the image on local memory. For that you need to Lock the image first. */ - virtual void setPixel(const unsigned int& x, const unsigned int& y, const ColorA& Color); + virtual void setPixel(const unsigned int& x, const unsigned int& y, const Color& Color); /** Assign a new array of pixels to the image in local memory ( it has to be exactly of the same size of the image ) */ virtual void setPixels( const Uint8* data ); @@ -130,16 +130,16 @@ class EE_API Image { virtual bool saveToFile( const std::string& filepath, const EE_SAVE_TYPE& Format ); /** Create an Alpha mask from a Color */ - virtual void createMaskFromColor( const ColorA& ColorKey, Uint8 Alpha ); + virtual void createMaskFromColor( const Color& ColorKey, Uint8 Alpha ); /** Create an Alpha mask from a Color */ void createMaskFromColor( const RGB& ColorKey, Uint8 Alpha ); /** Replace a color on the image */ - virtual void replaceColor( const ColorA& ColorKey, const ColorA& NewColor ); + virtual void replaceColor( const Color& ColorKey, const Color& NewColor ); /** Fill the image with a color */ - virtual void fillWithColor( const ColorA& Color ); + virtual void fillWithColor( const Color& Color ); /** Copy the image to this image data, starting from the position x,y */ virtual void copyImage( Graphics::Image * image, const Uint32& x = 0, const Uint32& y = 0 ); @@ -184,7 +184,7 @@ class EE_API Image { bool mAvoidFree; bool mLoadedFromStbi; - void allocate( const Uint32& size, ColorA DefaultColor = ColorA(0,0,0,0), bool memsetData = true ); + void allocate( const Uint32& size, Color DefaultColor = Color(0,0,0,0), bool memsetData = true ); void loadFromPack( Pack * Pack, const std::string& FilePackPath ); }; diff --git a/include/eepp/graphics/primitives.hpp b/include/eepp/graphics/primitives.hpp index 3301c2d2f..aa0364d8e 100755 --- a/include/eepp/graphics/primitives.hpp +++ b/include/eepp/graphics/primitives.hpp @@ -49,7 +49,7 @@ class EE_API Primitives { * @param Color2 Second Point Color * @param Color3 Third Point Color */ - void drawTriangle( const Triangle2f& t, const ColorA& Color1, const ColorA& Color2, const ColorA& Color3 ); + void drawTriangle( const Triangle2f& t, const Color& Color1, const Color& Color2, const Color& Color3 ); /** Draw a rectangle on the screen * @param R The Rectangle Rectf @@ -75,7 +75,7 @@ class EE_API Primitives { * @param Angle Rectangle Angle * @param Scale Rectangle Scale ( default 1.0f ) */ - void drawRectangle( const Rectf& R, const ColorA& TopLeft, const ColorA& BottomLeft, const ColorA& BottomRight, const ColorA& TopRight, const Float& Angle = 0, const Vector2f& Scale = Vector2f::One ); + void drawRectangle( const Rectf& R, const Color& TopLeft, const Color& BottomLeft, const Color& BottomRight, const Color& TopRight, const Float& Angle = 0, const Vector2f& Scale = Vector2f::One ); /** Draw a rounded rectangle on the screen setting per vertex color * @param R The Rectangle Rectf @@ -87,7 +87,7 @@ class EE_API Primitives { * @param Scale Rectangle Scale ( default 1.0f ) * @param Corners Number of vertices per corner ( how rounded is each corner ) */ - void drawRoundedRectangle( const Rectf& R, const ColorA& TopLeft, const ColorA& BottomLeft, const ColorA& BottomRight, const ColorA& TopRight, const Float& Angle = 0, const Vector2f& Scale = Vector2f::One, const unsigned int& Corners = 8 ); + void drawRoundedRectangle( const Rectf& R, const Color& TopLeft, const Color& BottomLeft, const Color& BottomRight, const Color& TopRight, const Float& Angle = 0, const Vector2f& Scale = Vector2f::One, const unsigned int& Corners = 8 ); /** Draw a four edges polygon on screen * @param q The Quad @@ -105,7 +105,7 @@ class EE_API Primitives { * @param OffsetX X offset for the quad * @param OffsetY Y offset for the quad */ - void drawQuad( const Quad2f& q, const ColorA& Color1, const ColorA& Color2, const ColorA& Color3, const ColorA& Color4, const Float& OffsetX = 0, const Float& OffsetY = 0 ); + void drawQuad( const Quad2f& q, const Color& Color1, const Color& Color2, const Color& Color3, const Color& Color4, const Float& OffsetX = 0, const Float& OffsetY = 0 ); /** Draw a polygon on screen * @param p The Polygon @@ -113,10 +113,10 @@ class EE_API Primitives { void drawPolygon( const Polygon2f& p ); /** Set the current color for drawing primitives */ - void setColor( const ColorA& Color ); + void setColor( const Color& Color ); /** @return The color used to draw the primitives */ - const ColorA& getColor(); + const Color& getColor(); /** Forcing the draw, will force the batch renderer to draw the batched vertexs immediately ( active by default ). */ void setForceDraw( const bool& force ); @@ -144,7 +144,7 @@ class EE_API Primitives { /** @return The line with to draw primitives */ const Float& getLineWidth() const; private: - ColorA mColor; + Color mColor; EE_FILL_MODE mFillMode; EE_BLEND_MODE mBlendMode; Float mLineWidth; diff --git a/include/eepp/graphics/rectangledrawable.hpp b/include/eepp/graphics/rectangledrawable.hpp index a9bb3fae8..81f10e3fe 100644 --- a/include/eepp/graphics/rectangledrawable.hpp +++ b/include/eepp/graphics/rectangledrawable.hpp @@ -45,7 +45,7 @@ class EE_API RectangleDrawable : public PrimitiveDrawable { RectColors mRectColors; bool mUsingRectColors; - void drawRectangle( const Rectf& R, const ColorA& TopLeft, const ColorA& BottomLeft, const ColorA& BottomRight, const ColorA& TopRight, const Float& Angle, const Vector2f& Scale ); + void drawRectangle( const Rectf& R, const Color& TopLeft, const Color& BottomLeft, const Color& BottomRight, const Color& TopRight, const Float& Angle, const Vector2f& Scale ); void updateVertex(); diff --git a/include/eepp/graphics/scrollparallax.hpp b/include/eepp/graphics/scrollparallax.hpp index cdff070fa..50e87cff8 100755 --- a/include/eepp/graphics/scrollparallax.hpp +++ b/include/eepp/graphics/scrollparallax.hpp @@ -23,7 +23,7 @@ class EE_API ScrollParallax { * @param Speed Speed of movement ( in Pixels Per Second ) * @param Color The Texture Color * @param Blend The Blend Mode ( default ALPHA_NORMAL ) */ - ScrollParallax( 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 ); + ScrollParallax( Graphics::SubTexture * subTexture, const Vector2f& position = Vector2f(), const Sizef& size = Sizef(), const Vector2f& speed = Vector2f(), const Color& color = Color(), const EE_BLEND_MODE& Blend = ALPHA_NORMAL ); /** Create's the Scroll Parallax * @param SubTexture The SubTexture to Draw @@ -34,13 +34,13 @@ class EE_API ScrollParallax { * @param Blend The Blend Mode ( default ALPHA_NORMAL ) * @return True if success */ - 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 ); + bool create( Graphics::SubTexture * subTexture, const Vector2f& position = Vector2f(), const Sizef& size = Sizef(), const Vector2f& speed = Vector2f(), const Color& color = Color(), const EE_BLEND_MODE& Blend = ALPHA_NORMAL ); /** Set the parallax texture color. */ - void setColor( const ColorA& Color ) { mColor = Color; } + void setColor( const Color& Color ) { mColor = Color; } /** Get the parallax texture color. */ - ColorA getColor() const { return mColor; } + Color getColor() const { return mColor; } /** Set the Blend Mode used. */ void setBlendMode( const EE_BLEND_MODE& Blend ) { mBlend = Blend; } @@ -79,7 +79,7 @@ class EE_API ScrollParallax { private: Graphics::SubTexture * mSubTexture; EE_BLEND_MODE mBlend; - ColorA mColor; + Color mColor; Vector2f mInitPos; Vector2f mPos; Vector2f mSpeed; diff --git a/include/eepp/graphics/sprite.hpp b/include/eepp/graphics/sprite.hpp index e7d970d83..981b811c1 100755 --- a/include/eepp/graphics/sprite.hpp +++ b/include/eepp/graphics/sprite.hpp @@ -156,7 +156,7 @@ class EE_API Sprite : public Drawable { * @param Color2 The Right - Bottom vertex color * @param Color3 The Right - Top vertex color */ - void updateVertexColors( const ColorA& Color0, const ColorA& Color1, const ColorA& Color2, const ColorA& Color3 ); + void updateVertexColors( const Color& Color0, const Color& Color1, const Color& Color2, const Color& Color3 ); /** This will disable the vertex colors */ void disableVertexColors(); @@ -325,7 +325,7 @@ class EE_API Sprite : public Drawable { Vector2f mScale; Float mAnimSpeed; - ColorA * mVertexColors; + Color * mVertexColors; int mRepetitions; //!< Number of repetions of the animation, default -1 that equals to loop. diff --git a/include/eepp/graphics/subtexture.hpp b/include/eepp/graphics/subtexture.hpp index 2266e670e..19be8627b 100644 --- a/include/eepp/graphics/subtexture.hpp +++ b/include/eepp/graphics/subtexture.hpp @@ -81,11 +81,11 @@ class EE_API SubTexture : public Drawable { /** Set the SubTexture offset. */ void setOffset( const Vector2i& offset ); - void draw( const Float& X, const Float& Y, const ColorA& Color = ColorA(), const Float& Angle = 0.f, const Vector2f& Scale = Vector2f::One, const EE_BLEND_MODE& Blend = ALPHA_NORMAL, const EE_RENDER_MODE& Effect = RN_NORMAL, OriginPoint Center = OriginPoint(OriginPoint::OriginCenter) ); + void draw( const Float& X, const Float& Y, const Color& Color = Color(), const Float& Angle = 0.f, const Vector2f& Scale = Vector2f::One, const EE_BLEND_MODE& Blend = ALPHA_NORMAL, const EE_RENDER_MODE& Effect = RN_NORMAL, OriginPoint Center = OriginPoint(OriginPoint::OriginCenter) ); - void draw( const Float& X, const Float& Y, const Float& Angle, const Vector2f& Scale, const ColorA& Color0 = ColorA(), const ColorA& Color1 = ColorA(), const ColorA& Color2 = ColorA(), const ColorA& Color3 = ColorA(), const EE_BLEND_MODE& Blend = ALPHA_NORMAL, const EE_RENDER_MODE& Effect = RN_NORMAL, OriginPoint Center = OriginPoint(OriginPoint::OriginCenter) ); + void draw( const Float& X, const Float& Y, const Float& Angle, const Vector2f& Scale, const Color& Color0 = Color(), const Color& Color1 = Color(), const Color& Color2 = Color(), const Color& Color3 = Color(), const EE_BLEND_MODE& Blend = ALPHA_NORMAL, const EE_RENDER_MODE& Effect = RN_NORMAL, OriginPoint Center = OriginPoint(OriginPoint::OriginCenter) ); - void draw( const Quad2f Q, const Vector2f& offset = Vector2f(), const Float& Angle = 0.f, const Vector2f& Scale = Vector2f::One, const ColorA& Color0 = ColorA(), const ColorA& Color1 = ColorA(), const ColorA& Color2 = ColorA(), const ColorA& Color3 = ColorA(), const EE_BLEND_MODE& Blend = ALPHA_NORMAL ); + void draw( const Quad2f Q, const Vector2f& offset = Vector2f(), const Float& Angle = 0.f, const Vector2f& Scale = Vector2f::One, const Color& Color0 = Color(), const Color& Color1 = Color(), const Color& Color2 = Color(), const Color& Color3 = Color(), const EE_BLEND_MODE& Blend = ALPHA_NORMAL ); virtual void draw(); @@ -97,10 +97,10 @@ class EE_API SubTexture : public Drawable { Graphics::Texture * getTexture(); /** Replaces a color in the SubTexture ( needs Lock() ) */ - void replaceColor( ColorA ColorKey, ColorA NewColor ); + void replaceColor( Color ColorKey, Color NewColor ); /** Creates a mask from a color. */ - void createMaskFromColor( ColorA ColorKey, Uint8 Alpha ); + void createMaskFromColor( Color ColorKey, Uint8 Alpha ); /** Creates a mask from a color. */ void createMaskFromColor( RGB ColorKey, Uint8 Alpha ); @@ -117,12 +117,12 @@ class EE_API SubTexture : public Drawable { /** @return The color that corresponds to the position indicated in the SubTexture. * If the SubTexture wasn't locked before this call, it will be locked automatically. */ - ColorA getColorAt( const Int32& X, const Int32& Y ); + Color getColorAt( const Int32& X, const Int32& Y ); /** @brief Set a color to the position indicated in the SubTexture. * If the SubTexture wasn't locked before this call, it will be locked automatically. */ - void setColorAt( const Int32& X, const Int32& Y, const ColorA& Color ); + void setColorAt( const Int32& X, const Int32& Y, const Color& Color ); /** Deletes the texture buffer from memory ( not from VRAM ) if it was cached before ( using Lock() ). */ void clearCache(); diff --git a/include/eepp/graphics/text.hpp b/include/eepp/graphics/text.hpp index 376891d1c..4fd6822bb 100644 --- a/include/eepp/graphics/text.hpp +++ b/include/eepp/graphics/text.hpp @@ -26,7 +26,7 @@ class EE_API Text { Text(Font * font, unsigned int characterSize = 30); /** Create a text from a font */ - void create(Graphics::Font * font, const String& text = "", ColorA FontColor = ColorA(255,255,255,255), ColorA FontShadowColor = ColorA(0,0,0,255) , Uint32 characterSize = 12); + void create(Graphics::Font * font, const String& text = "", Color FontColor = Color(255,255,255,255), Color FontShadowColor = Color(0,0,0,255) , Uint32 characterSize = 12); void setString(const String& string); @@ -36,13 +36,13 @@ class EE_API Text { void setStyle(Uint32 style); - void setColor(const ColorA& color); + void setColor(const Color& color); - void setFillColor(const ColorA& color); + void setFillColor(const Color& color); - void setFillColor(const ColorA& color, Uint32 from, Uint32 to); + void setFillColor(const Color& color, Uint32 from, Uint32 to); - void setOutlineColor(const ColorA& color); + void setOutlineColor(const Color& color); void setOutlineThickness(Float thickness); @@ -62,11 +62,11 @@ class EE_API Text { ** This doesn't break any custom color per-character setted. */ void setAlpha( const Uint8& alpha ); - const ColorA& getFillColor() const; + const Color& getFillColor() const; - const ColorA& getColor() const; + const Color& getColor() const; - const ColorA& getOutlineColor() const; + const Color& getOutlineColor() const; Float getOutlineThickness() const; @@ -84,10 +84,10 @@ class EE_API Text { void draw( const Float& X, const Float& Y, const Vector2f& Scale = Vector2f::One, const Float& Angle = 0, EE_BLEND_MODE Effect = ALPHA_NORMAL ); /** @return The Shadow Font Color */ - const ColorA& getShadowColor() const; + const Color& getShadowColor() const; /** Set the shadow color of the string rendered */ - void setShadowColor(const ColorA& color); + void setShadowColor(const Color& color); /** @return Every cached text line width */ const std::vector& getLinesWidth(); @@ -127,8 +127,8 @@ class EE_API Text { unsigned int mCharacterSize; ///< Base size of characters, in pixels unsigned int mRealCharacterSize; Uint32 mStyle; ///< Text style (see Style enum) - ColorA mFillColor; ///< Text fill color - ColorA mOutlineColor; ///< Text outline color + Color mFillColor; ///< Text fill color + Color mOutlineColor; ///< Text outline color Float mOutlineThickness; ///< Thickness of the text's outline Sizei mTextureSize; @@ -140,15 +140,15 @@ class EE_API Text { Float mCachedWidth; int mNumLines; int mLargestLineCharCount; - ColorA mFontShadowColor; + Color mFontShadowColor; Uint32 mAlign; Uint32 mFontHeight; std::vector mVertices; - std::vector mColors; + std::vector mColors; std::vector mOutlineVertices; - std::vector mOutlineColors; + std::vector mOutlineColors; std::vector mLinesWidth; void ensureGeometryUpdate(); diff --git a/include/eepp/graphics/texture.hpp b/include/eepp/graphics/texture.hpp index 85e02cdb4..d86720fe4 100755 --- a/include/eepp/graphics/texture.hpp +++ b/include/eepp/graphics/texture.hpp @@ -71,13 +71,13 @@ class EE_API Texture : public Image, public Drawable, private NonCopyable { bool saveToFile( const std::string& filepath, const EE_SAVE_TYPE& Format ); /** Replace a color on the texture */ - void replaceColor( const ColorA& ColorKey, const ColorA& NewColor); + void replaceColor( const Color& ColorKey, const Color& NewColor); /** Create an Alpha mask from a Color */ - void createMaskFromColor( const ColorA& ColorKey, Uint8 Alpha ); + void createMaskFromColor( const Color& ColorKey, Uint8 Alpha ); /** Fill a texture with a color */ - void fillWithColor( const ColorA& Color ); + void fillWithColor( const Color& Color ); /** Resize the texture */ void resize( const Uint32& newWidth, const Uint32& newHeight, EE_RESAMPLER_FILTER filter = RESAMPLER_LANCZOS4 ); @@ -158,7 +158,7 @@ class EE_API Texture : public Image, public Drawable, private NonCopyable { * @param width The width of the texture rendered * @param height The height of the texture rendered */ - void drawFast( const Float& x, const Float& y, const Float& Angle = 0.0f, const Vector2f& scale = Vector2f::One, const ColorA& Color = ColorA(), const EE_BLEND_MODE &Blend = ALPHA_NORMAL, const Float &width = 0, const Float &height = 0 ); + void drawFast( const Float& x, const Float& y, const Float& Angle = 0.0f, const Vector2f& scale = Vector2f::One, const Color& Color = Color(), const EE_BLEND_MODE &Blend = ALPHA_NORMAL, const Float &width = 0, const Float &height = 0 ); /** Render the texture on screen * @param x The x position on screen @@ -171,7 +171,7 @@ class EE_API Texture : public Image, public Drawable, private NonCopyable { * @param Center The rotation and scaling center. The center point is relative to the top-left corner of the object. * @param texSector The texture sector to render. You can render only a part of the texture. ( default render all the texture ) */ - void draw( const Float &x, const Float &y, const Float &Angle = 0, const Vector2f &scale = Vector2f::One, const ColorA& Color = ColorA(255,255,255,255), const EE_BLEND_MODE &Blend = ALPHA_NORMAL, const EE_RENDER_MODE &Effect = RN_NORMAL, OriginPoint Center = OriginPoint(OriginPoint::OriginCenter), const Recti& texSector = Recti(0,0,0,0) ); + void draw( const Float &x, const Float &y, const Float &Angle = 0, const Vector2f &scale = Vector2f::One, const Color& Color = Color(255,255,255,255), const EE_BLEND_MODE &Blend = ALPHA_NORMAL, const EE_RENDER_MODE &Effect = RN_NORMAL, OriginPoint Center = OriginPoint(OriginPoint::OriginCenter), const Recti& texSector = Recti(0,0,0,0) ); /** Render the texture on screen. Extended because can set the vertex colors individually * @param x The x position on screen @@ -189,7 +189,7 @@ class EE_API Texture : public Image, public Drawable, private NonCopyable { * @param Center The rotation and scaling center. The center point is relative to the top-left corner of the object. * @param texSector The texture sector to render. You can render only a part of the texture. ( default render all the texture ) */ - void drawEx( Float x, Float y, Float width = 0.0f, Float height = 0.0f, const Float &Angle = 0, const Vector2f &scale = Vector2f::One, const ColorA& Color0 = ColorA(255,255,255,255), const ColorA& Color1 = ColorA(255,255,255,255), const ColorA& Color2 = ColorA(255,255,255,255), const ColorA& Color3 = ColorA(255,255,255,255), const EE_BLEND_MODE &Blend = ALPHA_NORMAL, const EE_RENDER_MODE &Effect = RN_NORMAL, OriginPoint Center = OriginPoint(OriginPoint::OriginCenter), const Recti& texSector = Recti(0,0,0,0) ); + void drawEx( Float x, Float y, Float width = 0.0f, Float height = 0.0f, const Float &Angle = 0, const Vector2f &scale = Vector2f::One, const Color& Color0 = Color(255,255,255,255), const Color& Color1 = Color(255,255,255,255), const Color& Color2 = Color(255,255,255,255), const Color& Color3 = Color(255,255,255,255), const EE_BLEND_MODE &Blend = ALPHA_NORMAL, const EE_RENDER_MODE &Effect = RN_NORMAL, OriginPoint Center = OriginPoint(OriginPoint::OriginCenter), const Recti& texSector = Recti(0,0,0,0) ); /** Render a quad on Screen * @param Q The Quad2f @@ -200,7 +200,7 @@ class EE_API Texture : public Image, public Drawable, private NonCopyable { * @param Blend Set the Blend Mode ( default ALPHA_NORMAL ) * @param texSector The texture sector to render. You can render only a part of the texture. ( default render all the texture ) */ - void drawQuad( const Quad2f& Q, const Vector2f& Offset = Vector2f(), const Float &Angle = 0.0f, const Vector2f &scale = Vector2f::One, const ColorA& Color = ColorA(255,255,255,255), const EE_BLEND_MODE &Blend = ALPHA_NORMAL, const Recti& texSector = Recti(0,0,0,0) ); + void drawQuad( const Quad2f& Q, const Vector2f& Offset = Vector2f(), const Float &Angle = 0.0f, const Vector2f &scale = Vector2f::One, const Color& Color = Color(255,255,255,255), const EE_BLEND_MODE &Blend = ALPHA_NORMAL, const Recti& texSector = Recti(0,0,0,0) ); /** Render a quad on Screen * @param Q The Quad2f @@ -214,7 +214,7 @@ class EE_API Texture : public Image, public Drawable, private NonCopyable { * @param Blend Set the Blend Mode ( default ALPHA_NORMAL ) * @param texSector The texture sector to render. You can render only a part of the texture. ( default render all the texture ) */ - void drawQuadEx( Quad2f Q, const Vector2f& Offset = Vector2f(), const Float &Angle = 0.0f, const Vector2f &scale = Vector2f::One, const ColorA& Color0 = ColorA(255,255,255,255), const ColorA& Color1 = ColorA(255,255,255,255), const ColorA& Color2 = ColorA(255,255,255,255), const ColorA& Color3 = ColorA(255,255,255,255), const EE_BLEND_MODE &Blend = ALPHA_NORMAL, Recti texSector = Recti(0,0,0,0) ); + void drawQuadEx( Quad2f Q, const Vector2f& Offset = Vector2f(), const Float &Angle = 0.0f, const Vector2f &scale = Vector2f::One, const Color& Color0 = Color(255,255,255,255), const Color& Color1 = Color(255,255,255,255), const Color& Color2 = Color(255,255,255,255), const Color& Color3 = Color(255,255,255,255), const EE_BLEND_MODE &Blend = ALPHA_NORMAL, Recti texSector = Recti(0,0,0,0) ); Sizef getSize(); @@ -236,7 +236,7 @@ class EE_API Texture : public Image, public Drawable, private NonCopyable { void reload(); /** Set a pixel to the locked texture. */ - void setPixel( const unsigned int& x, const unsigned int& y, const ColorA& Color ); + void setPixel( const unsigned int& x, const unsigned int& y, const Color& Color ); /** Bind the texture. Activate the texture for rendering. */ void bind(); diff --git a/include/eepp/graphics/texturefactory.hpp b/include/eepp/graphics/texturefactory.hpp index 38be6fa03..12f25dc3a 100755 --- a/include/eepp/graphics/texturefactory.hpp +++ b/include/eepp/graphics/texturefactory.hpp @@ -24,7 +24,7 @@ class EE_API TextureFactory : protected Mutex { * @param KeepLocalCopy Keep the array data copy. ( useful if want to reload the texture ) * @return Internal Texture Id */ - Uint32 createEmptyTexture( const unsigned int& Width, const unsigned int& Height, const unsigned int& Channels = 4, const ColorA& DefaultColor = ColorA(0,0,0,255), const bool& Mipmap = false, const EE_CLAMP_MODE& ClampMode = CLAMP_TO_EDGE, const bool& CompressTexture = false, const bool& KeepLocalCopy = false ); + Uint32 createEmptyTexture( const unsigned int& Width, const unsigned int& Height, const unsigned int& Channels = 4, const Color& DefaultColor = Color(0,0,0,255), const bool& Mipmap = false, const EE_CLAMP_MODE& ClampMode = CLAMP_TO_EDGE, const bool& CompressTexture = false, const bool& KeepLocalCopy = false ); /** Loads a RAW Texture from Memory * @param Pixels The Texture array diff --git a/include/eepp/graphics/vertexbuffer.hpp b/include/eepp/graphics/vertexbuffer.hpp index 749bc226c..1dcc67aac 100644 --- a/include/eepp/graphics/vertexbuffer.hpp +++ b/include/eepp/graphics/vertexbuffer.hpp @@ -43,7 +43,7 @@ class EE_API VertexBuffer { /** @brief Adds a color to the buffer. * @param Color The color value. */ - void addColor( const ColorA& Color ); + void addColor( const Color& Color ); /** @brief Adds an index to the buffer. * @param Index The index value. @@ -86,7 +86,7 @@ class EE_API VertexBuffer { /** @return The color at the buffer position. * @param Index The position in the buffer. */ - ColorA getColor( const Uint32& Index ); + Color getColor( const Uint32& Index ); /** @return The index at the buffer position. * @param Index The position in the buffer. diff --git a/include/eepp/maps/gameobjectsubtextureex.hpp b/include/eepp/maps/gameobjectsubtextureex.hpp index 2326fb52e..08f80611f 100644 --- a/include/eepp/maps/gameobjectsubtextureex.hpp +++ b/include/eepp/maps/gameobjectsubtextureex.hpp @@ -8,7 +8,7 @@ namespace EE { namespace Maps { class EE_API GameObjectSubTextureEx : public GameObjectSubTexture { public: - GameObjectSubTextureEx( const Uint32& Flags, MapLayer * Layer, Graphics::SubTexture * SubTexture = NULL, const Vector2f& Pos = Vector2f(), EE_BLEND_MODE Blend = ALPHA_NORMAL, EE_RENDER_MODE Render = RN_NORMAL, Float Angle = 0.f, Vector2f Scale = Vector2f::One, ColorA Color = ColorA() ); + GameObjectSubTextureEx( const Uint32& Flags, MapLayer * Layer, Graphics::SubTexture * SubTexture = NULL, const Vector2f& Pos = Vector2f(), EE_BLEND_MODE Blend = ALPHA_NORMAL, EE_RENDER_MODE Render = RN_NORMAL, Float Angle = 0.f, Vector2f Scale = Vector2f::One, Color Color = Color() ); virtual ~GameObjectSubTextureEx(); @@ -24,8 +24,8 @@ class EE_API GameObjectSubTextureEx : public GameObjectSubTexture { EE_RENDER_MODE mRender; Float mAngle; Vector2f mScale; - ColorA mColor; - ColorA * mVertexColors; + Color mColor; + Color * mVertexColors; }; }} diff --git a/include/eepp/maps/maplight.hpp b/include/eepp/maps/maplight.hpp index 32a5efcf5..94afd93ad 100644 --- a/include/eepp/maps/maplight.hpp +++ b/include/eepp/maps/maplight.hpp @@ -23,11 +23,11 @@ class EE_API MapLight { virtual RGB processVertex( const Float& PointX, const Float& PointY, const RGB& VertexColor, const RGB& BaseColor ); - virtual ColorA processVertex( const Float& PointX, const Float& PointY, const ColorA& VertexColor, const ColorA& BaseColor ); + virtual Color processVertex( const Float& PointX, const Float& PointY, const Color& VertexColor, const Color& BaseColor ); RGB processVertex( const Vector2f& Pos, const RGB& VertexColor, const RGB& BaseColor ); - ColorA processVertex( const Vector2f& Pos, const ColorA& VertexColor, const ColorA& BaseColor ); + Color processVertex( const Vector2f& Pos, const Color& VertexColor, const Color& BaseColor ); void move( const Float& addtox, const Float& addtoy ); diff --git a/include/eepp/maps/maplightmanager.hpp b/include/eepp/maps/maplightmanager.hpp index 0ec46e849..adcad7ae5 100644 --- a/include/eepp/maps/maplightmanager.hpp +++ b/include/eepp/maps/maplightmanager.hpp @@ -27,11 +27,11 @@ class EE_API MapLightManager { Uint32 getCount(); - const ColorA * getTileColor( const Vector2i& TilePos ); + const Color * getTileColor( const Vector2i& TilePos ); - const ColorA * getTileColor( const Vector2i& TilePos, const Uint32& Vertex ); + const Color * getTileColor( const Vector2i& TilePos, const Uint32& Vertex ); - ColorA getColorFromPos( const Vector2f& Pos ); + Color getColorFromPos( const Vector2f& Pos ); const bool& isByVertex() const; @@ -41,7 +41,7 @@ class EE_API MapLightManager { protected: TileMap * mMap; Int32 mNumVertex; - ColorA**** mTileColors; + Color**** mTileColors; LightsList mLights; bool mIsByVertex; diff --git a/include/eepp/maps/tilemap.hpp b/include/eepp/maps/tilemap.hpp index cb9bada13..cee397794 100644 --- a/include/eepp/maps/tilemap.hpp +++ b/include/eepp/maps/tilemap.hpp @@ -168,9 +168,9 @@ class EE_API TileMap { const std::string& getPath() const; - void setBaseColor( const ColorA& color ); + void setBaseColor( const Color& color ); - const ColorA& getBaseColor() const; + const Color& getBaseColor() const; const eeAABB& getViewAreaAABB() const; @@ -201,9 +201,9 @@ class EE_API TileMap { void setBackAlpha( const Uint8& alpha ); - const ColorA& getBackColor() const; + const Color& getBackColor() const; - void setBackColor( const ColorA& col ); + void setBackColor( const Color& col ); const Float& getScale() const; @@ -219,9 +219,9 @@ class EE_API TileMap { void disableForcedHeaders(); - void setGridLinesColor( const ColorA& Col ); + void setGridLinesColor( const Color& Col ); - const ColorA& setGridLinesColor() const; + const Color& setGridLinesColor() const; protected: friend class EE::Maps::Private::UIMapNew; @@ -260,7 +260,7 @@ class EE_API TileMap { Vector2i mMouseOverTile; Vector2i mMouseOverTileFinal; Vector2i mMouseMapPos; - ColorA mBaseColor; + Color mBaseColor; PropertiesMap mProperties; GOTypesList mObjTypes; CreateGOCb mCreateGOCb; @@ -270,9 +270,9 @@ class EE_API TileMap { MapDrawCb mDrawCb; MapUpdateCb mUpdateCb; void * mData; - ColorA mTileOverColor; - ColorA mBackColor; - ColorA mGridLinesColor; + Color mTileOverColor; + Color mBackColor; + Color mGridLinesColor; Uint8 mBackAlpha; bool mMouseOver; std::string mPath; diff --git a/include/eepp/physics/physicshelper.hpp b/include/eepp/physics/physicshelper.hpp index 89490f9e6..7d4bf10b0 100644 --- a/include/eepp/physics/physicshelper.hpp +++ b/include/eepp/physics/physicshelper.hpp @@ -78,7 +78,7 @@ typedef cpBB cBB; #ifdef PHYSICS_RENDERER_ENABLED -inline ColorA colorFromPointer(void *ptr) { +inline Color colorFromPointer(void *ptr) { unsigned long val = (long)ptr; // hash the pointer up nicely @@ -101,10 +101,10 @@ inline ColorA colorFromPointer(void *ptr) { g = (g*mult)/max + add; b = (b*mult)/max + add; - return ColorA(r, g, b, 255); + return Color(r, g, b, 255); } -inline ColorA colorForShape( cpShape *shape, cpSpace *space ) { +inline Color colorForShape( cpShape *shape, cpSpace *space ) { cpBody *body = shape->body; int nc; @@ -112,11 +112,11 @@ inline ColorA colorForShape( cpShape *shape, cpSpace *space ) { if(cpBodyIsSleeping(body)){ float v = 0.25f; nc = (int)( v * 255 ); - return ColorA( nc, nc, nc, 255 ); + return Color( nc, nc, nc, 255 ); } else if(body->CP_PRIVATE(node).idleTime > space->sleepTimeThreshold) { float v = 0.9f; nc = (int)( v * 255 ); - return ColorA( nc, nc, nc, 255 ); + return Color( nc, nc, nc, 255 ); } } diff --git a/include/eepp/system/color.hpp b/include/eepp/system/color.hpp index e1ef74e8f..bae4c12ca 100755 --- a/include/eepp/system/color.hpp +++ b/include/eepp/system/color.hpp @@ -9,13 +9,13 @@ namespace EE { namespace System { /** @brief Template class for a RGB color */ template -class tColor { +class tRGB { public: T r; T g; T b; - tColor() : + tRGB() : r(255), g(255), b(255) @@ -27,7 +27,7 @@ class tColor { ** @param g Green component ** @param b Blue component */ - tColor(T r, T g, T b) : + tRGB(T r, T g, T b) : r(r), g(g), b(b) @@ -35,7 +35,7 @@ class tColor { } /** From 32 bits value with RGB(A) byte order */ - tColor( Uint32 Col ) + tRGB( Uint32 Col ) { Col = BitOp::swapLE32( Col ); r = static_cast( Col >> 16 ); @@ -43,18 +43,18 @@ class tColor { b = static_cast( Col >> 0 ); } - bool operator==( const tColor& Col ) { + bool operator==( const tRGB& Col ) { return ( r == Col.r && g == Col.g && b == Col.b ); } - bool operator!=( const tColor& Col ) { + bool operator!=( const tRGB& Col ) { return !( r == Col.r && g == Col.g && b == Col.b ); } }; /** @brief Template class for a RGBA color */ template -class tColorA { +class tColor { public: union { Uint32 Value; @@ -68,7 +68,7 @@ class tColorA { }; }; - tColorA() : + tColor() : r(255), g(255), b(255), @@ -82,7 +82,7 @@ class tColorA { ** @param b Blue component ** @param a Alpha component */ - tColorA(T r, T g, T b, T a) : + tColor(T r, T g, T b, T a) : r(r), g(g), b(b), @@ -91,7 +91,7 @@ class tColorA { } /** @brief Creates a RGBA color from a RGB color, the Alpha component is set as non-transparent. */ - tColorA( const tColor& Col ) : + tColor( const tRGB& Col ) : r( Col.r ), g( Col.g ), b( Col.b ), @@ -103,7 +103,7 @@ class tColorA { ** @param Col The RGB color ** @param a The Alpha component value */ - tColorA( const tColor& Col, T a ) : + tColor( const tRGB& Col, T a ) : r( Col.r ), g( Col.g ), b( Col.b ), @@ -111,13 +111,13 @@ class tColorA { { } - tColorA( const tColorA& Col ) : + tColor( const tColor& Col ) : Value( Col.Value ) { } /** From a 32 bits value with RGBA byte order */ - tColorA( const Uint32& Col ) : + tColor( const Uint32& Col ) : Value( BitOp::swapBE32( Col ) ) { } @@ -133,128 +133,124 @@ class tColorA { } /** @brief Assign the color value from other RGBA color. */ - void assign( const tColorA& Col ) { + void assign( const tColor& Col ) { Value = Col.Value; } - bool operator==( const tColorA& Col ) const { + bool operator==( const tColor& Col ) const { return ( r == Col.r && g == Col.g && b == Col.b && a == Col.a ); } - bool operator!=( const tColorA& Col ) const { + bool operator!=( const tColor& Col ) const { return !(*this == Col); } - tColorA operator+( const tColorA& Col ) const { - return tColorA( eemin( this->r + Col.r , 255 ), + tColor operator+( const tColor& Col ) const { + return tColor( eemin( this->r + Col.r , 255 ), eemin( this->g + Col.g , 255 ), eemin( this->b + Col.b , 255 ), eemin( this->a + Col.a , 255 ) ); } - tColorA operator-( const tColorA& Col ) const { - return tColorA( eemax( this->r - Col.r , 0 ), + tColor operator-( const tColor& Col ) const { + return tColor( eemax( this->r - Col.r , 0 ), eemax( this->g - Col.g , 0 ), eemax( this->b - Col.b , 0 ), eemax( this->a - Col.a , 0 ) ); } - tColorA operator*( const tColorA& Col ) const { - return tColorA( ( this->r * Col.r / 255 ), + tColor operator*( const tColor& Col ) const { + return tColor( ( this->r * Col.r / 255 ), ( this->g * Col.g / 255 ), ( this->b * Col.b / 255 ), ( this->a * Col.a / 255 ) ); } - tColor toColor() { - return tColor( r, g, b ); + tRGB toRGB() { + return tRGB( r, g, b ); } }; -class EE_API ColorA : public tColorA + +typedef tColor ColorAf; + +class EE_API Color : public tColor { public: - ColorA(); + Color(); - ColorA( Uint8 r, Uint8 g, Uint8 b, Uint8 a ); + Color( Uint8 r, Uint8 g, Uint8 b, Uint8 a = 255 ); - ColorA( const tColor& Col ); + Color( const tRGB& Col ); - ColorA( const tColor& Col, Uint8 a ); + Color( const tRGB& Col, Uint8 a ); - ColorA( const tColorA& Col ); + Color( const tColor& Col ); - ColorA( const Uint32& Col ); + Color( const Uint32& Col ); - static ColorA colorFromPointer( void *ptr ); + /** Blend a source color to destination color */ + static ColorAf blend( ColorAf srcf, ColorAf dstf ); - static ColorA fromString( const char * str ); + /** Blend a source color to destination color */ + static Color blend( Color src, Color dst ); - static ColorA fromString( const std::string& str ); + static Color colorFromPointer( void *ptr ); - static const ColorA Transparent; - static const ColorA White; - static const ColorA Black; + static Color fromString( const char * str ); + + static Color fromString( std::string str ); + + static const Color Transparent; + static const Color White; + static const Color Black; + static const Color Red; + static const Color Green; + static const Color Blue; + static const Color Yellow; + static const Color Cyan; + static const Color Magenta; + static const Color Silver; + static const Color Gray; + static const Color Maroon; + static const Color Olive; + static const Color OfficeGreen; + static const Color Purple; + static const Color Teal; + static const Color Navy; }; -typedef tColor Colorf; -typedef tColorA ColorAf; -typedef tColorA ColorAff; +typedef Color ColorA; +typedef tColor ColorAf; //! @brief Small class to help in some color operations -class EE_API Color : public tColor { +class EE_API RGB : public tRGB { public: - Color(); + RGB(); /** Creates an RGB color from each component. ** @param r Red component ** @param g Green component ** @param b Blue component */ - Color(Uint8 r, Uint8 g, Uint8 b); + RGB( Uint8 r, Uint8 g, Uint8 b ); - Color( const tColor& color ); + RGB( const tRGB& color ); - Color( Uint32 Col ); + RGB( Uint32 Col ); - /** Blend a source color to destination color */ - static ColorAf blend( ColorAf srcf, ColorAf dstf ); - - /** Blend a source color to destination color */ - static ColorA blend( ColorA src, ColorA dst ); - - static const Color White; - static const Color Black; - static const Color Red; - static const Color Green; - static const Color Blue; - static const Color Yellow; - static const Color Cyan; - static const Color Magenta; - static const Color Silver; - static const Color Gray; - static const Color Maroon; - static const Color Olive; - static const Color OfficeGreen; - static const Color Purple; - static const Color Teal; - static const Color Navy; + Color toColor(); }; -typedef Color RGB; -typedef Colorf RGBf; -typedef ColorA RGBA; -typedef ColorAf RGBAf; - class RectColors { public: - ColorA TopLeft; - ColorA TopRight; - ColorA BottomLeft; - ColorA BottomRight; + Color TopLeft; + Color TopRight; + Color BottomLeft; + Color BottomRight; }; }} diff --git a/include/eepp/ui/uibackground.hpp b/include/eepp/ui/uibackground.hpp index 5a47a315d..fd87cc28f 100644 --- a/include/eepp/ui/uibackground.hpp +++ b/include/eepp/ui/uibackground.hpp @@ -11,15 +11,15 @@ class EE_API UIBackground { UIBackground(); - ColorA& getColor( const unsigned int& index = 0 ); + Color& getColor( const unsigned int& index = 0 ); - UIBackground * setColor( const ColorA& Col ); + UIBackground * setColor( const Color& Col ); - const std::vector& getColors(); + const std::vector& getColors(); - UIBackground * setColors( const ColorA& TopLeftColor, const ColorA& BottomLeftColor, const ColorA& BottomRightColor, const ColorA& TopRightColor ); + UIBackground * setColors( const Color& TopLeftColor, const Color& BottomLeftColor, const Color& BottomRightColor, const Color& TopRightColor ); - UIBackground * setColorsTo( const ColorA& color ); + UIBackground * setColorsTo( const Color& color ); const EE_BLEND_MODE& getBlendMode() const; @@ -29,7 +29,7 @@ class EE_API UIBackground { UIBackground * setCorners( const unsigned int& corners ); protected: - std::vector mColor; + std::vector mColor; EE_BLEND_MODE mBlendMode; unsigned int mCorners; diff --git a/include/eepp/ui/uiborder.hpp b/include/eepp/ui/uiborder.hpp index b18f0a34e..32428060f 100644 --- a/include/eepp/ui/uiborder.hpp +++ b/include/eepp/ui/uiborder.hpp @@ -11,15 +11,15 @@ class EE_API UIBorder { UIBorder(); - const ColorA& getColor() const; + const Color& getColor() const; - UIBorder * setColor( const ColorA& Col ); + UIBorder * setColor( const Color& Col ); const unsigned int& getWidth() const; UIBorder * setWidth( const unsigned int& width ); protected: - ColorA mColor; + Color mColor; unsigned int mWidth; }; diff --git a/include/eepp/ui/uicontrolanim.hpp b/include/eepp/ui/uicontrolanim.hpp index f35fce292..7e8374b1e 100644 --- a/include/eepp/ui/uicontrolanim.hpp +++ b/include/eepp/ui/uicontrolanim.hpp @@ -105,7 +105,7 @@ class EE_API UIControlAnim : public UIDragableControl { virtual void drawSkin(); - ColorA getColor( const ColorA& Col ); + Color getColor( const Color& Col ); virtual void updateQuad(); diff --git a/include/eepp/ui/uiimage.hpp b/include/eepp/ui/uiimage.hpp index 239aa8abd..1492c1295 100644 --- a/include/eepp/ui/uiimage.hpp +++ b/include/eepp/ui/uiimage.hpp @@ -25,9 +25,9 @@ class EE_API UIImage : public UIWidget { void setDrawable( Drawable * drawable ); - const ColorA& getColor() const; + const Color& getColor() const; - void setColor( const ColorA& col ); + void setColor( const Color& col ); const EE_RENDER_MODE& getRenderMode() const; @@ -43,7 +43,7 @@ class EE_API UIImage : public UIWidget { protected: Uint32 mScaleType; Drawable * mDrawable; - ColorA mColor; + Color mColor; Vector2i mAlignOffset; Vector2f mDestSize; diff --git a/include/eepp/ui/uilistbox.hpp b/include/eepp/ui/uilistbox.hpp index 9ad2638c6..1425c021b 100644 --- a/include/eepp/ui/uilistbox.hpp +++ b/include/eepp/ui/uilistbox.hpp @@ -60,17 +60,17 @@ class EE_API UIListBox : public UIWidget { std::list getItemsSelected(); - void setFontColor( const ColorA& Color ); + void setFontColor( const Color& Color ); - const ColorA& getFontColor() const; + const Color& getFontColor() const; - void setFontOverColor( const ColorA& Color ); + void setFontOverColor( const Color& Color ); - const ColorA& getFontOverColor() const; + const Color& getFontOverColor() const; - void setFontSelectedColor( const ColorA& Color ); + void setFontSelectedColor( const Color& Color ); - const ColorA& getFontSelectedColor() const; + const Color& getFontSelectedColor() const; void setFont( Graphics::Font * font ); diff --git a/include/eepp/ui/uiloader.hpp b/include/eepp/ui/uiloader.hpp index d2c34a200..58dc6a714 100644 --- a/include/eepp/ui/uiloader.hpp +++ b/include/eepp/ui/uiloader.hpp @@ -25,9 +25,9 @@ class EE_API UILoader : public UIWidget { const Float& getRadius() const; - UILoader * setFillColor( const ColorA& color ); + UILoader * setFillColor( const Color& color ); - const ColorA& getFillColor() const; + const Color& getFillColor() const; const bool& isIndeterminate() const; @@ -51,7 +51,7 @@ class EE_API UILoader : public UIWidget { Float mOutlineThickness; ArcDrawable mArc; CircleDrawable mCircle; - ColorA mColor; + Color mColor; Float mArcAngle; Float mArcStartAngle; Float mProgress; diff --git a/include/eepp/ui/uimanager.hpp b/include/eepp/ui/uimanager.hpp index c5f85193a..b9109ac0a 100644 --- a/include/eepp/ui/uimanager.hpp +++ b/include/eepp/ui/uimanager.hpp @@ -80,17 +80,17 @@ class EE_API UIManager { bool getDrawBoxes() const; - void setHighlightFocusColor( const ColorA& Color ); + void setHighlightFocusColor( const Color& Color ); - const ColorA& getHighlightFocusColor() const; + const Color& getHighlightFocusColor() const; void setHighlightOver( bool Highlight ); bool getHighlightOver() const; - void setHighlightOverColor( const ColorA& Color ); + void setHighlightOverColor( const Color& Color ); - const ColorA& getHighlightOverColor() const; + const Color& getHighlightOverColor() const; void sendMouseClick( UIControl * ToCtrl, const Vector2i& Pos, const Uint32 Flags ); @@ -151,8 +151,8 @@ class EE_API UIManager { Uint32 mResizeCb; Uint32 mFlags; - ColorA mHighlightFocusColor; - ColorA mHighlightOverColor; + Color mHighlightFocusColor; + Color mHighlightOverColor; Vector2i mMouseDownPos; bool mInit; diff --git a/include/eepp/ui/uipushbutton.hpp b/include/eepp/ui/uipushbutton.hpp index b3b407057..baebe2dfb 100644 --- a/include/eepp/ui/uipushbutton.hpp +++ b/include/eepp/ui/uipushbutton.hpp @@ -43,17 +43,17 @@ class EE_API UIPushButton : public UIWidget { Font * getFont(); - const ColorA& getFontColor() const; + const Color& getFontColor() const; - void setFontColor( const ColorA& color ); + void setFontColor( const Color& color ); - const ColorA& getFontOverColor() const; + const Color& getFontOverColor() const; - void setFontOverColor( const ColorA& color ); + void setFontOverColor( const Color& color ); - const ColorA& getFontShadowColor() const; + const Color& getFontShadowColor() const; - void setFontShadowColor( const ColorA& color ); + void setFontShadowColor( const Color& color ); Uint32 getCharacterSize(); @@ -67,9 +67,9 @@ class EE_API UIPushButton : public UIWidget { UIPushButton * setOutlineThickness( const Float& outlineThickness ); - const ColorA& getOutlineColor() const; + const Color& getOutlineColor() const; - UIPushButton * setOutlineColor( const ColorA& outlineColor ); + UIPushButton * setOutlineColor( const Color& outlineColor ); UITooltipStyleConfig getStyleConfig() const; diff --git a/include/eepp/ui/uiselectbutton.hpp b/include/eepp/ui/uiselectbutton.hpp index 996a68ac2..70cc54ae5 100644 --- a/include/eepp/ui/uiselectbutton.hpp +++ b/include/eepp/ui/uiselectbutton.hpp @@ -23,9 +23,9 @@ class EE_API UISelectButton : public UIPushButton { virtual void select(); - void setFontSelectedColor( const ColorA& color ); + void setFontSelectedColor( const Color& color ); - const ColorA& getFontSelectedColor() const; + const Color& getFontSelectedColor() const; virtual void loadFromXmlNode( const pugi::xml_node& node ); protected: diff --git a/include/eepp/ui/uiskin.hpp b/include/eepp/ui/uiskin.hpp index 57e728a96..0f8fcca43 100644 --- a/include/eepp/ui/uiskin.hpp +++ b/include/eepp/ui/uiskin.hpp @@ -32,9 +32,9 @@ class EE_API UISkin { virtual bool stateExists( const Uint32& State ) = 0; - virtual void setColor( const Uint32& State, const ColorA& Color ); + virtual void setColor( const Uint32& State, const Color& Color ); - virtual const ColorA& getColor( const Uint32& State ) const; + virtual const Color& getColor( const Uint32& State ) const; virtual void setSkins(); @@ -63,7 +63,7 @@ class EE_API UISkin { std::string mName; Uint32 mNameHash; Uint32 mColorDefault; - ColorA mColor[ UISkinState::StateCount ]; + Color mColor[ UISkinState::StateCount ]; UITheme * mTheme; void stateBack( const Uint32& State ); diff --git a/include/eepp/ui/uiskincomplex.hpp b/include/eepp/ui/uiskincomplex.hpp index e1c1070d5..6ebeb14dc 100644 --- a/include/eepp/ui/uiskincomplex.hpp +++ b/include/eepp/ui/uiskincomplex.hpp @@ -50,7 +50,7 @@ class EE_API UISkinComplex : public UISkin { Sizei getBorderSize( const Uint32 &state ); protected: Drawable * mDrawable[ UISkinState::StateCount ][ SideCount ]; - ColorA mTempColor; + Color mTempColor; Sizei mSize[ UISkinState::StateCount ]; Sizei mBorderSize[ UISkinState::StateCount ]; diff --git a/include/eepp/ui/uiskinsimple.hpp b/include/eepp/ui/uiskinsimple.hpp index b4c455a6e..60da4c736 100644 --- a/include/eepp/ui/uiskinsimple.hpp +++ b/include/eepp/ui/uiskinsimple.hpp @@ -33,7 +33,7 @@ class EE_API UISkinSimple : public UISkin { Sizei getBorderSize( const Uint32 & state ); protected: Drawable * mDrawable[ UISkinState::StateCount ]; - ColorA mTempColor; + Color mTempColor; void stateNormalToState( const Uint32& State ); }; diff --git a/include/eepp/ui/uisprite.hpp b/include/eepp/ui/uisprite.hpp index 017997271..c7b0f8521 100644 --- a/include/eepp/ui/uisprite.hpp +++ b/include/eepp/ui/uisprite.hpp @@ -32,9 +32,9 @@ class EE_API UISprite : public UIWidget { void setSprite( Graphics::Sprite * sprite ); - ColorA getColor() const; + Color getColor() const; - void setColor( const ColorA& color ); + void setColor( const Color& color ); const EE_RENDER_MODE& getRenderMode() const; diff --git a/include/eepp/ui/uisubtexture.hpp b/include/eepp/ui/uisubtexture.hpp index 396d82fb2..0c2ad8112 100644 --- a/include/eepp/ui/uisubtexture.hpp +++ b/include/eepp/ui/uisubtexture.hpp @@ -29,9 +29,9 @@ class EE_API UISubTexture : public UIWidget { UISubTexture * setSubTexture( Graphics::SubTexture * subTexture ); - const ColorA& getColor() const; + const Color& getColor() const; - void setColor( const ColorA& col ); + void setColor( const Color& col ); const EE_RENDER_MODE& getRenderMode() const; @@ -47,7 +47,7 @@ class EE_API UISubTexture : public UIWidget { protected: Uint32 mScaleType; Graphics::SubTexture * mSubTexture; - ColorA mColor; + Color mColor; EE_RENDER_MODE mRender; Vector2i mAlignOffset; diff --git a/include/eepp/ui/uitabwidget.hpp b/include/eepp/ui/uitabwidget.hpp index b4613d822..a9fe13a97 100644 --- a/include/eepp/ui/uitabwidget.hpp +++ b/include/eepp/ui/uitabwidget.hpp @@ -57,21 +57,21 @@ class EE_API UITabWidget : public UIWidget { void setFont(Font * font); - ColorA getFontColor() const; + Color getFontColor() const; - void setFontColor(const ColorA & fontColor); + void setFontColor(const Color & fontColor); - ColorA getFontShadowColor() const; + Color getFontShadowColor() const; - void setFontShadowColor(const ColorA & fontShadowColor); + void setFontShadowColor(const Color & fontShadowColor); - ColorA getFontOverColor() const; + Color getFontOverColor() const; - void setFontOverColor(const ColorA & fontOverColor); + void setFontOverColor(const Color & fontOverColor); - ColorA getFontSelectedColor() const; + Color getFontSelectedColor() const; - void setFontSelectedColor(const ColorA & fontSelectedColor); + void setFontSelectedColor(const Color & fontSelectedColor); Uint32 getCharacterSize(); @@ -85,9 +85,9 @@ class EE_API UITabWidget : public UIWidget { UITabWidget * setOutlineThickness( const Float& outlineThickness ); - const ColorA& getOutlineColor() const; + const Color& getOutlineColor() const; - UITabWidget * setOutlineColor( const ColorA& outlineColor ); + UITabWidget * setOutlineColor( const Color& outlineColor ); Int32 getTabSeparation() const; @@ -119,9 +119,9 @@ class EE_API UITabWidget : public UIWidget { void setDrawLineBelowTabs(bool drawLineBelowTabs); - ColorA getLineBelowTabsColor() const; + Color getLineBelowTabsColor() const; - void setLineBelowTabsColor(const ColorA & lineBelowTabsColor); + void setLineBelowTabsColor(const Color & lineBelowTabsColor); Int32 getLineBelowTabsYOffset() const; diff --git a/include/eepp/ui/uitextview.hpp b/include/eepp/ui/uitextview.hpp index 41adda0b0..a5d779c2f 100644 --- a/include/eepp/ui/uitextview.hpp +++ b/include/eepp/ui/uitextview.hpp @@ -38,25 +38,25 @@ class EE_API UITextView : public UIWidget { UITextView * setOutlineThickness( const Float& outlineThickness ); - const ColorA& getOutlineColor() const; + const Color& getOutlineColor() const; - UITextView * setOutlineColor( const ColorA& outlineColor ); + UITextView * setOutlineColor( const Color& outlineColor ); virtual const String& getText(); virtual UITextView * setText( const String& text ); - const ColorA& getFontColor() const; + const Color& getFontColor() const; - UITextView * setFontColor( const ColorA& color ); + UITextView * setFontColor( const Color& color ); - const ColorA& getFontShadowColor() const; + const Color& getFontShadowColor() const; - UITextView * setFontShadowColor( const ColorA& color ); + UITextView * setFontShadowColor( const Color& color ); - const ColorA& getSelectionBackColor() const; + const Color& getSelectionBackColor() const; - UITextView * setSelectionBackColor( const ColorA& color ); + UITextView * setSelectionBackColor( const Color& color ); virtual void setTheme( UITheme * Theme ); diff --git a/include/eepp/ui/uithemeconfig.hpp b/include/eepp/ui/uithemeconfig.hpp index 1165981b9..5a08d9b62 100644 --- a/include/eepp/ui/uithemeconfig.hpp +++ b/include/eepp/ui/uithemeconfig.hpp @@ -13,31 +13,31 @@ namespace EE { namespace UI { class UIFontStyleConfig : public FontStyleConfig { public: - const ColorA& getFontOverColor() const { + const Color& getFontOverColor() const { return FontOverColor; } - const ColorA& getFontSelectedColor() const { + const Color& getFontSelectedColor() const { return FontSelectedColor; } - ColorA getFontSelectionBackColor() const { + Color getFontSelectionBackColor() const { return FontSelectionBackColor; } - void setFontShadowColor( const ColorA& color ) { + void setFontShadowColor( const Color& color ) { ShadowColor = color; } - void setFontOverColor( const ColorA& color ) { + void setFontOverColor( const Color& color ) { FontOverColor = color; } - void setFontSelectedColor( const ColorA& color ) { + void setFontSelectedColor( const Color& color ) { FontSelectedColor = color; } - void setFontSelectionBackColor(const ColorA& color) { + void setFontSelectionBackColor(const Color& color) { FontSelectionBackColor = color; } @@ -57,9 +57,9 @@ class UIFontStyleConfig : public FontStyleConfig { FontSelectionBackColor = fontStyleConfig.FontSelectionBackColor; } - ColorA FontOverColor = ColorA(255,255,255,255); - ColorA FontSelectedColor = ColorA(255,255,255,255); - ColorA FontSelectionBackColor = ColorA(255,255,255,255); + Color FontOverColor = Color(255,255,255,255); + Color FontSelectedColor = Color(255,255,255,255); + Color FontSelectionBackColor = Color(255,255,255,255); }; class UITabWidgetStyleConfig : public UIFontStyleConfig { @@ -79,7 +79,7 @@ class UITabWidgetStyleConfig : public UIFontStyleConfig { bool TabsClosable = false; bool SpecialBorderTabs = false; //! Indicates if the periferical tabs ( the left and right border tab ) are different from the central tabs. bool DrawLineBelowTabs = false; - ColorA LineBelowTabsColor; + Color LineBelowTabsColor; Int32 LineBelowTabsYOffset = 0; }; @@ -138,7 +138,7 @@ class UIWindowStyleConfig : public UIFontStyleConfig { Vector2i ButtonsPositionFixer; Uint32 ButtonsSeparation = 4; Int32 MinCornerDistance = 24; - ColorA TitleFontColor = ColorA( 255, 255, 255, 255 ); + Color TitleFontColor = Color( 255, 255, 255, 255 ); Uint8 BaseAlpha = 255; bool DecorationAutoSize = true; bool BorderAutoSize = true; diff --git a/include/eepp/ui/uitooltip.hpp b/include/eepp/ui/uitooltip.hpp index 5f05e22c3..25332d917 100644 --- a/include/eepp/ui/uitooltip.hpp +++ b/include/eepp/ui/uitooltip.hpp @@ -39,13 +39,13 @@ class EE_API UITooltip : public UIControlAnim { virtual void setText( const String& text ); - const ColorA& getFontColor() const; + const Color& getFontColor() const; - void setFontColor( const ColorA& color ); + void setFontColor( const Color& color ); - const ColorA& getFontShadowColor() const; + const Color& getFontShadowColor() const; - void setFontShadowColor( const ColorA& color ); + void setFontShadowColor( const Color& color ); virtual void onTextChanged(); diff --git a/src/eepp/graphics/batchrenderer.cpp b/src/eepp/graphics/batchrenderer.cpp index 9afd33fbe..bc777981e 100755 --- a/src/eepp/graphics/batchrenderer.cpp +++ b/src/eepp/graphics/batchrenderer.cpp @@ -426,14 +426,14 @@ void BatchRenderer::batchQuadFreeEx( const Float& x0, const Float& y0, const Flo void BatchRenderer::quadsBegin() { setDrawMode( DM_QUADS, true ); quadsSetSubset( 0, 0, 1, 1 ); - quadsSetColor( ColorA() ); + quadsSetColor( Color() ); } -void BatchRenderer::quadsSetColor( const ColorA& Color ) { +void BatchRenderer::quadsSetColor( const Color& Color ) { mVerColor[0] = mVerColor[1] = mVerColor[2] = mVerColor[3] = Color; } -void BatchRenderer::quadsSetColorFree( const ColorA& Color0, const ColorA& Color1, const ColorA& Color2, const ColorA& Color3 ) { +void BatchRenderer::quadsSetColorFree( const Color& Color0, const Color& Color1, const Color& Color2, const Color& Color3 ) { mVerColor[0] = Color0; mVerColor[1] = Color1; mVerColor[2] = Color2; @@ -467,10 +467,10 @@ void BatchRenderer::rotate( const Vector2f& center, Vector2f* point, const Float void BatchRenderer::pointsBegin() { setDrawMode( DM_POINTS, true ); quadsSetSubset( 0, 0, 1, 1 ); - pointSetColor( ColorA() ); + pointSetColor( Color() ); } -void BatchRenderer::pointSetColor( const ColorA& Color ) { +void BatchRenderer::pointSetColor( const Color& Color ) { quadsSetColor( Color ); } @@ -492,14 +492,14 @@ void BatchRenderer::batchPoint( const Float& x, const Float& y ) { void BatchRenderer::linesBegin() { setDrawMode( DM_LINES, true ); quadsSetSubset( 0, 0, 1, 1 ); - pointSetColor( ColorA() ); + pointSetColor( Color() ); } -void BatchRenderer::linesSetColor( const ColorA& Color ) { +void BatchRenderer::linesSetColor( const Color& Color ) { quadsSetColor( Color ); } -void BatchRenderer::linesSetColorFree( const ColorA& Color0, const ColorA& Color1 ) { +void BatchRenderer::linesSetColorFree( const Color& Color0, const Color& Color1 ) { quadsSetColorFree( Color0, Color1, Color0, Color0 ); } @@ -527,14 +527,14 @@ void BatchRenderer::batchLine( const Float& x0, const Float& y0, const Float& x1 void BatchRenderer::lineLoopBegin() { setDrawMode( DM_LINE_LOOP, true ); quadsSetSubset( 0, 0, 1, 1 ); - pointSetColor( ColorA() ); + pointSetColor( Color() ); } -void BatchRenderer::lineLoopSetColor( const ColorA& Color ) { +void BatchRenderer::lineLoopSetColor( const Color& Color ) { quadsSetColor( Color ); } -void BatchRenderer::lineLoopSetColorFree( const ColorA& Color0, const ColorA& Color1 ) { +void BatchRenderer::lineLoopSetColorFree( const Color& Color0, const Color& Color1 ) { quadsSetColorFree( Color0, Color1, Color0, Color0 ); } @@ -585,14 +585,14 @@ void BatchRenderer::batchLineLoop( const Vector2f& vector1 ) { void BatchRenderer::lineStripBegin() { setDrawMode( DM_LINE_STRIP, true ); quadsSetSubset( 0, 0, 1, 1 ); - pointSetColor( ColorA() ); + pointSetColor( Color() ); } -void BatchRenderer::lineStripSetColor( const ColorA& Color ) { +void BatchRenderer::lineStripSetColor( const Color& Color ) { quadsSetColor( Color ); } -void BatchRenderer::lineStripSetColorFree( const ColorA& Color0, const ColorA& Color1 ) { +void BatchRenderer::lineStripSetColorFree( const Color& Color0, const Color& Color1 ) { quadsSetColorFree( Color0, Color1, Color0, Color0 ); } @@ -643,14 +643,14 @@ void BatchRenderer::batchLineStrip( const Vector2f& vector1 ) { void BatchRenderer::triangleFanBegin() { setDrawMode( DM_TRIANGLE_FAN, true ); triangleFanSetSubset( 0, 0, 0, 1, 1, 1 ); - triangleFanSetColor( ColorA() ); + triangleFanSetColor( Color() ); } -void BatchRenderer::triangleFanSetColor( const ColorA& Color ) { +void BatchRenderer::triangleFanSetColor( const Color& Color ) { quadsSetColor( Color ); } -void BatchRenderer::triangleFanSetColorFree( const ColorA& Color0, const ColorA& Color1, const ColorA& Color2 ) { +void BatchRenderer::triangleFanSetColorFree( const Color& Color0, const Color& Color1, const Color& Color2 ) { quadsSetColorFree( Color0, Color1, Color2, Color0 ); } @@ -706,14 +706,14 @@ void BatchRenderer::batchTriangleFan( const Float& x0, const Float& y0 ) { void BatchRenderer::trianglesBegin() { setDrawMode( DM_TRIANGLES, true ); trianglesSetSubset( 0, 0, 0, 1, 1, 1 ); - trianglesSetColor( ColorA() ); + trianglesSetColor( Color() ); } -void BatchRenderer::trianglesSetColor( const ColorA& Color ) { +void BatchRenderer::trianglesSetColor( const Color& Color ) { quadsSetColor( Color ); } -void BatchRenderer::trianglesSetColorFree( const ColorA& Color0, const ColorA& Color1, const ColorA& Color2 ) { +void BatchRenderer::trianglesSetColorFree( const Color& Color0, const Color& Color1, const Color& Color2 ) { quadsSetColorFree( Color0, Color1, Color2, Color0 ); } @@ -751,7 +751,7 @@ void BatchRenderer::batchTriangle( const Float& x0, const Float& y0, const Float addVertexs(3); } -void BatchRenderer::polygonSetColor( const ColorA& Color ) { +void BatchRenderer::polygonSetColor( const Color& Color ) { pointSetColor( Color ); } diff --git a/src/eepp/graphics/console.cpp b/src/eepp/graphics/console.cpp index 4aecd159e..21a3e48f1 100755 --- a/src/eepp/graphics/console.cpp +++ b/src/eepp/graphics/console.cpp @@ -39,7 +39,7 @@ Console::Console( EE::Window::Window * window ) : mShowFps(false), mCurSide(false) { - mFontStyleConfig.Color = ColorA(153, 153, 179, 230); + mFontStyleConfig.FontColor = Color(153, 153, 179, 230); if ( NULL == mWindow ) { mWindow = Engine::instance()->getCurrentWindow(); @@ -73,7 +73,7 @@ Console::Console( Font * font, const bool& MakeDefaultCommands, const bool& Atta mShowFps(false), mCurSide(false) { - mFontStyleConfig.Color = ColorA(153, 153, 179, 230); + mFontStyleConfig.FontColor = Color(153, 153, 179, 230); if ( NULL == mWindow ) { mWindow = Engine::instance()->getCurrentWindow(); @@ -168,17 +168,17 @@ void Console::draw() { if ( mY > 0.0f ) { if ( mTexId == 0 ) { - mPri.setColor( ColorA( mConColor.r, mConColor.g, mConColor.b, static_cast(mA) ) ); + mPri.setColor( Color( mConColor.r, mConColor.g, mConColor.b, static_cast(mA) ) ); mPri.drawRectangle( Rectf( Vector2f( 0.0f, 0.0f ), Sizef( mWidth, mY ) ) ); } else { - ColorA C( mConColor.r, mConColor.g, mConColor.b, static_cast(mA) ); + Color C( mConColor.r, mConColor.g, mConColor.b, static_cast(mA) ); Texture * Tex = TextureFactory::instance()->getTexture( mTexId ); if ( NULL != Tex ) Tex->drawEx( 0.0f, 0.0f, mWidth, mY, 0.0f, Vector2f::One, C, C, C, C ); } - mPri.setColor( ColorA( mConLineColor.r, mConLineColor.g, mConLineColor.b, static_cast(mA) ) ); + mPri.setColor( Color( mConLineColor.r, mConLineColor.g, mConLineColor.b, static_cast(mA) ) ); mPri.drawRectangle( Rectf( Vector2f( 0.0f, mY ), Sizef( mWidth, PixelDensity::dpToPx( 2.0f ) ) ) ); Int32 linesInScreen = this->linesOnScreen(); @@ -202,7 +202,7 @@ void Console::draw() { Text& text = mTextCache[Pos]; text.setStyleConfig( mFontStyleConfig ); - text.setFillColor( ColorA( mFontStyleConfig.Color.r, mFontStyleConfig.Color.g, mFontStyleConfig.Color.b, static_cast(mA) ) ); + text.setFillColor( Color( mFontStyleConfig.FontColor.r, mFontStyleConfig.FontColor.g, mFontStyleConfig.FontColor.b, static_cast(mA) ) ); text.setString( mCmdLog[i] ); text.draw( mFontSize, CurY ); @@ -214,13 +214,13 @@ void Console::draw() { Text& text = mTextCache[ mTextCache.size() - 1 ]; text.setStyleConfig( mFontStyleConfig ); - text.setFillColor( ColorA( mFontLineColor.r, mFontLineColor.g, mFontLineColor.b, static_cast(mA) ) ); + text.setFillColor( Color( mFontLineColor.r, mFontLineColor.g, mFontLineColor.b, static_cast(mA) ) ); text.setString( "> " + mTBuf->getBuffer() ); text.draw( mFontSize, CurY ); Text& text2 = mTextCache[ mTextCache.size() - 2 ]; text2.setStyleConfig( mFontStyleConfig ); - text2.setFillColor( ColorA ( mFontLineColor.r, mFontLineColor.g, mFontLineColor.b, static_cast(mCurAlpha) ) ); + text2.setFillColor( Color( mFontLineColor.r, mFontLineColor.g, mFontLineColor.b, static_cast(mCurAlpha) ) ); if ( (unsigned int)mTBuf->getCursorPos() == mTBuf->getBuffer().size() ) { Uint32 width = text.getTextWidth(); @@ -237,9 +237,9 @@ void Console::draw() { if ( mShowFps && NULL != mFontStyleConfig.Font ) { Text& text = mTextCache[ mTextCache.size() - 3 ]; - ColorA OldColor1( text.getColor() ); + Color OldColor1( text.getColor() ); text.setStyleConfig( mFontStyleConfig ); - text.setFillColor( ColorA () ); + text.setFillColor( Color() ); text.setString( "FPS: " + String::toStr( mWindow->getFPS() ) ); text.draw( mWindow->getWidth() - text.getTextWidth() - 15, 6 ); text.setFillColor( OldColor1 ); diff --git a/src/eepp/graphics/drawable.cpp b/src/eepp/graphics/drawable.cpp index a16b5d091..05351ed5a 100644 --- a/src/eepp/graphics/drawable.cpp +++ b/src/eepp/graphics/drawable.cpp @@ -19,17 +19,17 @@ const Uint8& Drawable::getAlpha() { return mColor.a; } -void Drawable::setColor(const ColorA & color) { +void Drawable::setColor(const Color & color) { mColor = color; onColorFilterChange(); onAlphaChange(); } -const ColorA& Drawable::getColor() const { +const Color& Drawable::getColor() const { return mColor; } -void Drawable::setColorFilter( const ColorA& color ) { +void Drawable::setColorFilter( const Color& color ) { if ( mColor.r != color.r || mColor.g != color.g || mColor.b != color.b ) { mColor.r = color.r; mColor.g = color.g; @@ -39,13 +39,13 @@ void Drawable::setColorFilter( const ColorA& color ) { } } -Color Drawable::getColorFilter() { - return Color( mColor.r, mColor.g, mColor.b ); +RGB Drawable::getColorFilter() { + return RGB( mColor.r, mColor.g, mColor.b ); } void Drawable::clearColor() { - if ( mColor != ColorA::White ) { - mColor = ColorA::White; + if ( mColor != Color::White ) { + mColor = Color::White; onColorFilterChange(); onAlphaChange(); diff --git a/src/eepp/graphics/fonttruetype.cpp b/src/eepp/graphics/fonttruetype.cpp index 882ded9fd..a73eeff95 100644 --- a/src/eepp/graphics/fonttruetype.cpp +++ b/src/eepp/graphics/fonttruetype.cpp @@ -637,7 +637,7 @@ FontTrueType::Page::Page() : // Reserve a 2x2 white square for texturing underlines for (int x = 0; x < 2; ++x) for (int y = 0; y < 2; ++y) - image.setPixel(x, y, ColorA(255, 255, 255, 255)); + image.setPixel(x, y, Color(255, 255, 255, 255)); // Create the texture Uint32 texId = TextureFactory::instance()->loadFromPixels( image.getPixelsPtr(), image.getWidth(), image.getHeight(), image.getChannels(), false, CLAMP_TO_EDGE, false, true ); diff --git a/src/eepp/graphics/framebufferfbo.cpp b/src/eepp/graphics/framebufferfbo.cpp index b08172f6d..65955ac2c 100644 --- a/src/eepp/graphics/framebufferfbo.cpp +++ b/src/eepp/graphics/framebufferfbo.cpp @@ -95,7 +95,7 @@ bool FrameBufferFBO::create( const Uint32& Width, const Uint32& Height, bool Dep } if ( NULL == mTexture ) { - Uint32 TexId = TextureFactory::instance()->createEmptyTexture( Width, Height, 4, ColorA(0,0,0,0) ); + Uint32 TexId = TextureFactory::instance()->createEmptyTexture( Width, Height, 4, Color(0,0,0,0) ); if ( TextureFactory::instance()->existsId( TexId ) ) { mTexture = TextureFactory::instance()->getTexture( TexId ); diff --git a/src/eepp/graphics/image.cpp b/src/eepp/graphics/image.cpp index 1adf2a949..3aa68f713 100644 --- a/src/eepp/graphics/image.cpp +++ b/src/eepp/graphics/image.cpp @@ -263,7 +263,7 @@ Image::Image( const Uint8* data, const unsigned int& Width, const unsigned int& setPixels( data ); } -Image::Image( const Uint32& Width, const Uint32& Height, const Uint32& Channels, const ColorA& DefaultColor, const bool& initWithDefaultColor ) : +Image::Image( const Uint32& Width, const Uint32& Height, const Uint32& Channels, const Color& DefaultColor, const bool& initWithDefaultColor ) : mPixels(NULL), mWidth(Width), mHeight(Height), @@ -374,7 +374,7 @@ void Image::loadFromPack( Pack * Pack, const std::string& FilePackPath ) { void Image::setPixels( const Uint8* data ) { if ( data != NULL ) { - allocate( mWidth * mHeight * mChannels, ColorA(0,0,0,0), false ); + allocate( mWidth * mHeight * mChannels, Color(0,0,0,0), false ); memcpy( reinterpret_cast( &mPixels[0] ), reinterpret_cast ( data ), mSize ); } @@ -384,19 +384,19 @@ const Uint8* Image::getPixelsPtr() { return reinterpret_cast (&mPixels[0]); } -ColorA Image::getPixel( const unsigned int& x, const unsigned int& y ) { +Color Image::getPixel( const unsigned int& x, const unsigned int& y ) { eeASSERT( !( mPixels == NULL || x > mWidth || y > mHeight ) ); - ColorA dst; + Color dst; memcpy( &dst, &mPixels[ ( ( x + y * mWidth ) * mChannels ) ], mChannels ); return dst; } -void Image::setPixel(const unsigned int& x, const unsigned int& y, const ColorA& Color) { +void Image::setPixel(const unsigned int& x, const unsigned int& y, const Color& Color) { eeASSERT( !( mPixels == NULL || x > mWidth || y > mHeight ) ); memcpy( &mPixels[ ( ( x + y * mWidth ) * mChannels ) ], &Color, mChannels ); } -void Image::create( const Uint32& Width, const Uint32& Height, const Uint32& Channels, const ColorA& DefaultColor, const bool& initWithDefaultColor ) { +void Image::create( const Uint32& Width, const Uint32& Height, const Uint32& Channels, const Color& DefaultColor, const bool& initWithDefaultColor ) { mWidth = Width; mHeight = Height; mChannels = Channels; @@ -408,7 +408,7 @@ Uint8* Image::getPixels() const { return mPixels; } -void Image::allocate( const Uint32& size, ColorA DefaultColor, bool memsetData ) { +void Image::allocate( const Uint32& size, Color DefaultColor, bool memsetData ) { clearCache(); mPixels = eeNewArray( unsigned char, size ); @@ -481,7 +481,7 @@ bool Image::saveToFile( const std::string& filepath, const EE_SAVE_TYPE& Format return Res; } -void Image::replaceColor( const ColorA& ColorKey, const ColorA& NewColor ) { +void Image::replaceColor( const Color& ColorKey, const Color& NewColor ) { unsigned int Pos = 0; if ( NULL == mPixels ) @@ -518,15 +518,15 @@ void Image::replaceColor( const ColorA& ColorKey, const ColorA& NewColor ) { } } -void Image::createMaskFromColor( const ColorA& ColorKey, Uint8 Alpha ) { - replaceColor( ColorKey, ColorA( ColorKey.r, ColorKey.g, ColorKey.b, Alpha ) ); +void Image::createMaskFromColor( const Color& ColorKey, Uint8 Alpha ) { + replaceColor( ColorKey, Color( ColorKey.r, ColorKey.g, ColorKey.b, Alpha ) ); } void Image::createMaskFromColor( const RGB& ColorKey, Uint8 Alpha ) { - createMaskFromColor( ColorA( ColorKey.r, ColorKey.g, ColorKey.b, 255 ), Alpha ); + createMaskFromColor( Color( ColorKey.r, ColorKey.g, ColorKey.b, 255 ), Alpha ); } -void Image::fillWithColor( const ColorA& Color ) { +void Image::fillWithColor( const Color& Color ) { if ( NULL == mPixels ) return; @@ -661,8 +661,8 @@ void Image::blit( Graphics::Image * image, const Uint32& x, const Uint32& y ) { for ( unsigned int ty = y; ty < dh; ty++ ) { for ( unsigned int tx = x; tx < dw; tx++ ) { - ColorA ts( image->getPixel( tx - x, ty - y ) ); - ColorA td( getPixel( tx, ty ) ); + Color ts( image->getPixel( tx - x, ty - y ) ); + Color td( getPixel( tx, ty ) ); setPixel( tx, ty, Color::blend( ts, td ) ); } diff --git a/src/eepp/graphics/particlesystem.cpp b/src/eepp/graphics/particlesystem.cpp index 93fdb4c8d..01800e0db 100755 --- a/src/eepp/graphics/particlesystem.cpp +++ b/src/eepp/graphics/particlesystem.cpp @@ -353,7 +353,7 @@ void ParticleSystem::draw() { P = &mParticle[i]; if ( P->isUsed() ) { - BR->quadsSetColor( ColorA( static_cast ( P->r() * 255 ), static_cast ( P->g() * 255 ), static_cast( P->b() * 255 ), static_cast( P->a() * 255 ) ) ); + BR->quadsSetColor( Color( static_cast ( P->r() * 255 ), static_cast ( P->g() * 255 ), static_cast( P->b() * 255 ), static_cast( P->a() * 255 ) ) ); BR->batchQuad( P->getX() - mHSize, P->getY() - mHSize, mSize, mSize ); } } diff --git a/src/eepp/graphics/primitives.cpp b/src/eepp/graphics/primitives.cpp index 7a9ec3bc9..e33f455c4 100755 --- a/src/eepp/graphics/primitives.cpp +++ b/src/eepp/graphics/primitives.cpp @@ -47,7 +47,7 @@ void Primitives::drawLine( const Line2f& line ) { drawBatch(); } -void Primitives::drawTriangle( const Triangle2f& t, const ColorA& Color1, const ColorA& Color2, const ColorA& Color3 ) { +void Primitives::drawTriangle( const Triangle2f& t, const Color& Color1, const Color& Color2, const Color& Color3 ) { sBR->setTexture( NULL ); sBR->setBlendMode( mBlendMode ); @@ -128,7 +128,7 @@ void Primitives::drawCircle( const Vector2f& p, const Float& radius, Uint32 segm GLi->vertexPointer( 2, GL_FLOAT, 0, circleVAR, circleVAR_count * sizeof(float) * 2 ); - std::vector colors( circleVAR_count - 1 ,mColor ); + std::vector colors( circleVAR_count - 1 ,mColor ); GLi->colorPointer( 4, GL_UNSIGNED_BYTE, 0, &colors[0], circleVAR_count * 4 ); @@ -217,7 +217,7 @@ void Primitives::drawArc( const Vector2f& p, const Float& radius, Uint32 segment drawBatch(); } -void Primitives::drawRectangle( const Rectf& R, const ColorA& TopLeft, const ColorA& BottomLeft, const ColorA& BottomRight, const ColorA& TopRight, const Float& Angle, const Vector2f& Scale ) { +void Primitives::drawRectangle( const Rectf& R, const Color& TopLeft, const Color& BottomLeft, const Color& BottomRight, const Color& TopRight, const Float& Angle, const Vector2f& Scale ) { sBR->setTexture( NULL ); sBR->setBlendMode( mBlendMode ); @@ -266,7 +266,7 @@ void Primitives::drawRectangle( const Rectf& R, const Float& Angle, const Vector drawRectangle( R, mColor, mColor, mColor, mColor, Angle, Scale ); } -void Primitives::drawRoundedRectangle( const Rectf& R, const ColorA& TopLeft, const ColorA& BottomLeft, const ColorA& BottomRight, const ColorA& TopRight, const Float& Angle, const Vector2f& Scale, const unsigned int& Corners ) { +void Primitives::drawRoundedRectangle( const Rectf& R, const Color& TopLeft, const Color& BottomLeft, const Color& BottomRight, const Color& TopRight, const Float& Angle, const Vector2f& Scale, const unsigned int& Corners ) { sBR->setTexture( NULL ); sBR->setBlendMode( mBlendMode ); @@ -349,7 +349,7 @@ void Primitives::drawRoundedRectangle( const Rectf& R, const Float& Angle, const drawRoundedRectangle( R, mColor, mColor, mColor, mColor, Angle, Scale, Corners ); } -void Primitives::drawQuad( const Quad2f& q, const ColorA& Color1, const ColorA& Color2, const ColorA& Color3, const ColorA& Color4, const Float& OffsetX, const Float& OffsetY ) { +void Primitives::drawQuad( const Quad2f& q, const Color& Color1, const Color& Color2, const Color& Color3, const Color& Color4, const Float& OffsetX, const Float& OffsetY ) { sBR->setTexture( NULL ); sBR->setBlendMode( mBlendMode ); @@ -427,11 +427,11 @@ const bool& Primitives::getForceDraw() const { return mForceDraw; } -void Primitives::setColor( const ColorA& Color ) { +void Primitives::setColor( const Color& Color ) { mColor = Color; } -const ColorA& Primitives::getColor() +const Color& Primitives::getColor() { return mColor; } diff --git a/src/eepp/graphics/rectangledrawable.cpp b/src/eepp/graphics/rectangledrawable.cpp index 1cbc24bcd..acd854158 100644 --- a/src/eepp/graphics/rectangledrawable.cpp +++ b/src/eepp/graphics/rectangledrawable.cpp @@ -95,7 +95,7 @@ void RectangleDrawable::setRectColors(const RectColors & rectColors) { mUsingRectColors = true; } -void RectangleDrawable::drawRectangle( const Rectf& R, const ColorA& TopLeft, const ColorA& BottomLeft, const ColorA& BottomRight, const ColorA& TopRight, const Float& Angle, const Vector2f& Scale ) { +void RectangleDrawable::drawRectangle( const Rectf& R, const Color& TopLeft, const Color& BottomLeft, const Color& BottomRight, const Color& TopRight, const Float& Angle, const Vector2f& Scale ) { BatchRenderer * sBR = GlobalBatchRenderer::instance(); sBR->setTexture( NULL ); sBR->setBlendMode( mBlendMode ); diff --git a/src/eepp/graphics/scrollparallax.cpp b/src/eepp/graphics/scrollparallax.cpp index 909de8e8a..ffc460224 100755 --- a/src/eepp/graphics/scrollparallax.cpp +++ b/src/eepp/graphics/scrollparallax.cpp @@ -12,7 +12,7 @@ ScrollParallax::ScrollParallax() : ScrollParallax::~ScrollParallax() {} -ScrollParallax::ScrollParallax( Graphics::SubTexture * SubTexture, const Vector2f& Position, const Sizef& Size, const Vector2f& Speed, const ColorA& Color, const EE_BLEND_MODE& Blend ) { +ScrollParallax::ScrollParallax( Graphics::SubTexture * SubTexture, const Vector2f& Position, const Sizef& Size, const Vector2f& Speed, const Color& Color, const EE_BLEND_MODE& Blend ) { create( SubTexture, Position, Size, Speed, Color, Blend ); } @@ -40,7 +40,7 @@ void ScrollParallax::setAABB() { mAABB = Rectf( mInitPos.x, mInitPos.y, mInitPos.x + mSize.getWidth(), mInitPos.y + mSize.getHeight() ); } -bool ScrollParallax::create( Graphics::SubTexture * SubTexture, const Vector2f& Position, const Sizef& Size, const Vector2f& Speed, const ColorA& Color, const EE_BLEND_MODE& Blend ) { +bool ScrollParallax::create( Graphics::SubTexture * SubTexture, const Vector2f& Position, const Sizef& Size, const Vector2f& Speed, const Color& Color, const EE_BLEND_MODE& Blend ) { mSubTexture = SubTexture; mPos = Position; mSize = Size; diff --git a/src/eepp/graphics/sprite.cpp b/src/eepp/graphics/sprite.cpp index a6646ca02..4ebc3224f 100755 --- a/src/eepp/graphics/sprite.cpp +++ b/src/eepp/graphics/sprite.cpp @@ -118,7 +118,7 @@ Sprite& Sprite::operator =( const Sprite& Other ) { mCb = Other.mCb; if ( NULL != Other.mVertexColors ) { - mVertexColors = eeNewArray( ColorA, 4 ); + mVertexColors = eeNewArray( Color, 4 ); mVertexColors[0] = Other.mVertexColors[0]; mVertexColors[1] = Other.mVertexColors[1]; mVertexColors[2] = Other.mVertexColors[2]; @@ -154,7 +154,7 @@ Sprite Sprite::clone() { Spr.mUserData = mUserData; if ( NULL != mVertexColors ) { - Spr.mVertexColors = eeNewArray( ColorA, 4 ); + Spr.mVertexColors = eeNewArray( Color, 4 ); Spr.mVertexColors[0] = mVertexColors[0]; Spr.mVertexColors[1] = mVertexColors[1]; Spr.mVertexColors[2] = mVertexColors[2]; @@ -183,7 +183,7 @@ void Sprite::reset() { mRepetitions = -1; mRotation = 0; - mColor = ColorA(255, 255, 255, 255); + mColor = Color(255, 255, 255, 255); mBlend = ALPHA_NORMAL; mEffect = RN_NORMAL; @@ -304,9 +304,9 @@ eeAABB Sprite::getAABB() { return TmpR; } -void Sprite::updateVertexColors( const ColorA& Color0, const ColorA& Color1, const ColorA& Color2, const ColorA& Color3 ) { +void Sprite::updateVertexColors( const Color& Color0, const Color& Color1, const Color& Color2, const Color& Color3 ) { if ( NULL == mVertexColors ) - mVertexColors = eeNewArray( ColorA, 4 ); + mVertexColors = eeNewArray( Color, 4 ); mVertexColors[0] = Color0; mVertexColors[1] = Color1; diff --git a/src/eepp/graphics/subtexture.cpp b/src/eepp/graphics/subtexture.cpp index 112a83fa5..ebd47911e 100644 --- a/src/eepp/graphics/subtexture.cpp +++ b/src/eepp/graphics/subtexture.cpp @@ -158,17 +158,17 @@ void SubTexture::setOffset( const Vector2i& offset ) { mOffset = offset; } -void SubTexture::draw( const Float& X, const Float& Y, const ColorA& Color, const Float& Angle, const Vector2f& Scale, const EE_BLEND_MODE& Blend, const EE_RENDER_MODE& Effect, OriginPoint Center ) { +void SubTexture::draw( const Float& X, const Float& Y, const Color& Color, const Float& Angle, const Vector2f& Scale, const EE_BLEND_MODE& Blend, const EE_RENDER_MODE& Effect, OriginPoint Center ) { if ( NULL != mTexture ) mTexture->drawEx( X + mOffset.x, Y + mOffset.y, mDestSize.x, mDestSize.y, Angle, Scale, Color, Color, Color, Color, Blend, Effect, Center, mSrcRect ); } -void SubTexture::draw( const Float& X, const Float& Y, const Float& Angle, const Vector2f& Scale, const ColorA& Color0, const ColorA& Color1, const ColorA& Color2, const ColorA& Color3, const EE_BLEND_MODE& Blend, const EE_RENDER_MODE& Effect, OriginPoint Center ) { +void SubTexture::draw( const Float& X, const Float& Y, const Float& Angle, const Vector2f& Scale, const Color& Color0, const Color& Color1, const Color& Color2, const Color& Color3, const EE_BLEND_MODE& Blend, const EE_RENDER_MODE& Effect, OriginPoint Center ) { if ( NULL != mTexture ) mTexture->drawEx( X + mOffset.x, Y + mOffset.y, mDestSize.x, mDestSize.y, Angle, Scale, Color0, Color1, Color2, Color3, Blend, Effect, Center, mSrcRect ); } -void SubTexture::draw( const Quad2f Q, const Vector2f& Offset, const Float& Angle, const Vector2f& Scale, const ColorA& Color0, const ColorA& Color1, const ColorA& Color2, const ColorA& Color3, const EE_BLEND_MODE& Blend ) { +void SubTexture::draw( const Quad2f Q, const Vector2f& Offset, const Float& Angle, const Vector2f& Scale, const Color& Color0, const Color& Color1, const Color& Color2, const Color& Color3, const EE_BLEND_MODE& Blend ) { if ( NULL != mTexture ) mTexture->drawQuadEx( Q, Offset, Angle, Scale, Color0, Color1, Color2, Color3, Blend, mSrcRect ); } @@ -192,7 +192,7 @@ Graphics::Texture * SubTexture::getTexture() { return mTexture; } -void SubTexture::replaceColor( ColorA ColorKey, ColorA NewColor ) { +void SubTexture::replaceColor( Color ColorKey, Color NewColor ) { mTexture->lock(); for ( int y = mSrcRect.Top; y < mSrcRect.Bottom; y++ ) { @@ -205,12 +205,12 @@ void SubTexture::replaceColor( ColorA ColorKey, ColorA NewColor ) { mTexture->unlock( false, true ); } -void SubTexture::createMaskFromColor(ColorA ColorKey, Uint8 Alpha) { - replaceColor( ColorKey, ColorA( ColorKey.r, ColorKey.g, ColorKey.b, Alpha ) ); +void SubTexture::createMaskFromColor(Color ColorKey, Uint8 Alpha) { + replaceColor( ColorKey, Color( ColorKey.r, ColorKey.g, ColorKey.b, Alpha ) ); } void SubTexture::createMaskFromColor(RGB ColorKey, Uint8 Alpha) { - createMaskFromColor( ColorA( ColorKey.r, ColorKey.g, ColorKey.b, 255 ), Alpha ); + createMaskFromColor( Color( ColorKey.r, ColorKey.g, ColorKey.b, 255 ), Alpha ); } void SubTexture::cacheAlphaMask() { @@ -250,7 +250,7 @@ void SubTexture::cacheColors() { int rY = 0; int rX = 0; int rW = mSrcRect.Right - mSrcRect.Left; - ColorA tColor; + Color tColor; Uint32 Channels = mTexture->getChannels(); int Pos; @@ -289,7 +289,7 @@ Uint8 SubTexture::getAlphaAt( const Int32& X, const Int32& Y ) { return getAlphaAt( X, Y ); } -ColorA SubTexture::getColorAt( const Int32& X, const Int32& Y ) { +Color SubTexture::getColorAt( const Int32& X, const Int32& Y ) { if ( mTexture->hasLocalCopy() ) return mTexture->getPixel( mSrcRect.Left + X, mSrcRect.Right + Y ); @@ -298,13 +298,13 @@ ColorA SubTexture::getColorAt( const Int32& X, const Int32& Y ) { unsigned int Pos = ( X + Y * ( mSrcRect.Right - mSrcRect.Left ) ) * Channels; if ( 4 == Channels ) - return ColorA( mPixels[ Pos ], mPixels[ Pos + 1 ], mPixels[ Pos + 2 ], mPixels[ Pos + 3 ] ); + return Color( mPixels[ Pos ], mPixels[ Pos + 1 ], mPixels[ Pos + 2 ], mPixels[ Pos + 3 ] ); else if ( 3 == Channels ) - return ColorA( mPixels[ Pos ], mPixels[ Pos + 1 ], mPixels[ Pos + 2 ], 255 ); + return Color( mPixels[ Pos ], mPixels[ Pos + 1 ], mPixels[ Pos + 2 ], 255 ); else if ( 2 == Channels ) - return ColorA( mPixels[ Pos ], mPixels[ Pos + 1 ], 255, 255 ); + return Color( mPixels[ Pos ], mPixels[ Pos + 1 ], 255, 255 ); else - return ColorA( mPixels[ Pos ], 255, 255, 255 ); + return Color( mPixels[ Pos ], 255, 255, 255 ); } cacheColors(); @@ -312,7 +312,7 @@ ColorA SubTexture::getColorAt( const Int32& X, const Int32& Y ) { return getColorAt( X, Y ); } -void SubTexture::setColorAt( const Int32& X, const Int32& Y, const ColorA& Color ) { +void SubTexture::setColorAt( const Int32& X, const Int32& Y, const Color& Color ) { if ( NULL != mPixels ) { Uint32 Channels = mTexture->getChannels(); unsigned int Pos = ( X + Y * ( mSrcRect.Right - mSrcRect.Left ) ) * Channels; diff --git a/src/eepp/graphics/text.cpp b/src/eepp/graphics/text.cpp index 146c34594..276679c02 100644 --- a/src/eepp/graphics/text.cpp +++ b/src/eepp/graphics/text.cpp @@ -24,7 +24,7 @@ Text::Text() : mCachedWidth(0), mNumLines(0), mLargestLineCharCount(0), - mFontShadowColor( ColorA( 0, 0, 0, 255 ) ), + mFontShadowColor( Color( 0, 0, 0, 255 ) ), mAlign(0), mFontHeight(0) { @@ -45,7 +45,7 @@ Text::Text(const String& string, Font * font, unsigned int characterSize) : mCachedWidth(0), mNumLines(0), mLargestLineCharCount(0), - mFontShadowColor( ColorA( 0, 0, 0, 255 ) ), + mFontShadowColor( Color( 0, 0, 0, 255 ) ), mAlign(0), mFontHeight( mFont->getFontHeight( mRealCharacterSize ) ) { @@ -65,13 +65,13 @@ Text::Text(Font * font, unsigned int characterSize) : mCachedWidth(0), mNumLines(0), mLargestLineCharCount(0), - mFontShadowColor( ColorA( 0, 0, 0, 255 ) ), + mFontShadowColor( Color( 0, 0, 0, 255 ) ), mAlign(0), mFontHeight( mFont->getFontHeight( mRealCharacterSize ) ) { } -void Text::create(Font * font, const String & text, ColorA FontColor, ColorA FontShadowColor, Uint32 characterSize ) { +void Text::create(Font * font, const String & text, Color FontColor, Color FontShadowColor, Uint32 characterSize ) { mFont = font; mString = text; mCharacterSize = characterSize; @@ -127,18 +127,18 @@ void Text::setStyle(Uint32 style) { } } -void Text::setColor(const ColorA & color) { +void Text::setColor(const Color & color) { setFillColor(color); } -void Text::setFillColor(const ColorA& color) { +void Text::setFillColor(const Color& color) { if (color != mFillColor) { mFillColor = color; mColorsNeedUpdate = true; } } -void Text::setOutlineColor(const ColorA& color) { +void Text::setOutlineColor(const Color& color) { if (color != mOutlineColor) { mOutlineColor = color; mColorsNeedUpdate = true; @@ -185,15 +185,15 @@ void Text::setAlpha( const Uint8& alpha ) { } } -const ColorA& Text::getFillColor() const { +const Color& Text::getFillColor() const { return mFillColor; } -const ColorA &Text::getColor() const { +const Color &Text::getColor() const { return getFillColor(); } -const ColorA& Text::getOutlineColor() const { +const Color& Text::getOutlineColor() const { return mOutlineColor; } @@ -510,10 +510,10 @@ void Text::draw(const Float & X, const Float & Y, const Vector2f & Scale, const mStyle &= ~Shadow; - ColorA Col = getFillColor(); + Color Col = getFillColor(); if ( Col.a != 255 ) { - ColorA ShadowColor = getShadowColor(); + Color ShadowColor = getShadowColor(); ShadowColor.a = (Uint8)( (Float)ShadowColor.a * ( (Float)Col.a / (Float)255 ) ); setFillColor( ShadowColor ); @@ -791,11 +791,11 @@ void Text::ensureColorUpdate() { } } -const ColorA& Text::getShadowColor() const { +const Color& Text::getShadowColor() const { return mFontShadowColor; } -void Text::setShadowColor(const ColorA& color) { +void Text::setShadowColor(const Color& color) { mFontShadowColor = color; } @@ -837,13 +837,13 @@ void Text::cacheWidth() { void Text::setStyleConfig( const FontStyleConfig& styleConfig ) { setFont( styleConfig.Font ); setCharacterSize( styleConfig.CharacterSize ); - setFillColor( styleConfig.Color ); + setFillColor( styleConfig.FontColor ); setStyle( styleConfig.Style ); setOutlineThickness( styleConfig.OutlineThickness ); setOutlineColor( styleConfig.OutlineColor ); } -void Text::setFillColor( const ColorA& color, Uint32 from, Uint32 to ) { +void Text::setFillColor( const Color& color, Uint32 from, Uint32 to ) { if ( mString.empty() ) return; @@ -851,7 +851,7 @@ void Text::setFillColor( const ColorA& color, Uint32 from, Uint32 to ) { bool underlined = (mStyle & Underlined) != 0; bool strikeThrough = (mStyle & StrikeThrough) != 0; - std::vector colors( GLi->quadVertexs(), color ); + std::vector colors( GLi->quadVertexs(), color ); std::size_t s = mString.size(); if ( to >= s ) { @@ -863,7 +863,7 @@ void Text::setFillColor( const ColorA& color, Uint32 from, Uint32 to ) { Int32 rpos = from; Int32 lpos = 0; Uint32 i; - Uint32 qsize = sizeof(ColorA) * GLi->quadVertexs(); + Uint32 qsize = sizeof(Color) * GLi->quadVertexs(); String::StringBaseType curChar; // Spaces, new lines and tabs are not rendered, and not counted as a color diff --git a/src/eepp/graphics/texture.cpp b/src/eepp/graphics/texture.cpp index 67ec7ffce..dbdfcd011 100755 --- a/src/eepp/graphics/texture.cpp +++ b/src/eepp/graphics/texture.cpp @@ -229,7 +229,7 @@ const Uint8 * Texture::getPixelsPtr() { return Image::getPixelsPtr(); } -void Texture::setPixel( const unsigned int& x, const unsigned int& y, const ColorA& Color ) { +void Texture::setPixel( const unsigned int& x, const unsigned int& y, const Color& Color ) { Image::setPixel( x, y, Color ); mFlags |= TEX_FLAG_MODIFIED; @@ -278,7 +278,7 @@ const EE_TEX_FILTER& Texture::getFilter() const { return mFilter; } -void Texture::replaceColor( const ColorA& ColorKey, const ColorA& NewColor ) { +void Texture::replaceColor( const Color& ColorKey, const Color& NewColor ) { lock(); Image::replaceColor( ColorKey, NewColor ); @@ -286,15 +286,15 @@ void Texture::replaceColor( const ColorA& ColorKey, const ColorA& NewColor ) { unlock( false, true ); } -void Texture::createMaskFromColor( const ColorA& ColorKey, Uint8 Alpha ) { +void Texture::createMaskFromColor( const Color& ColorKey, Uint8 Alpha ) { lock( true ); - Image::replaceColor( ColorKey, ColorA( ColorKey.r, ColorKey.g, ColorKey.b, Alpha ) ); + Image::replaceColor( ColorKey, Color( ColorKey.r, ColorKey.g, ColorKey.b, Alpha ) ); unlock( false, true ); } -void Texture::fillWithColor( const ColorA& Color ) { +void Texture::fillWithColor( const Color& Color ) { lock(); Image::fillWithColor( Color ); @@ -454,7 +454,7 @@ void Texture::replace( Image * image ) { if ( hasLocalCopy() ) { // Renew the local copy - allocate( image->getMemSize(), ColorA(0,0,0,0), false ); + allocate( image->getMemSize(), Color(0,0,0,0), false ); Image::copyImage( image ); } } @@ -495,11 +495,11 @@ bool Texture::isCompressed() const { return 0 != ( mFlags & TEX_FLAG_COMPRESSED ); } -void Texture::draw( const Float &x, const Float &y, const Float &Angle, const Vector2f &Scale, const ColorA& Color, const EE_BLEND_MODE &Blend, const EE_RENDER_MODE &Effect, OriginPoint Center, const Recti& texSector) { +void Texture::draw( const Float &x, const Float &y, const Float &Angle, const Vector2f &Scale, const Color& Color, const EE_BLEND_MODE &Blend, const EE_RENDER_MODE &Effect, OriginPoint Center, const Recti& texSector) { drawEx( x, y, 0, 0, Angle, Scale, Color, Color, Color, Color, Blend, Effect, Center, texSector ); } -void Texture::drawFast( const Float& x, const Float& y, const Float& Angle, const Vector2f& Scale, const ColorA& Color, const EE_BLEND_MODE &Blend, const Float &width, const Float &height ) { +void Texture::drawFast( const Float& x, const Float& y, const Float& Angle, const Vector2f& Scale, const Color& Color, const EE_BLEND_MODE &Blend, const Float &width, const Float &height ) { Float w = 0.f != width ? width : (Float)getImageWidth(); Float h = 0.f != height ? height : (Float)getImageHeight(); @@ -518,7 +518,7 @@ void Texture::drawFast( const Float& x, const Float& y, const Float& Angle, cons sBR->drawOpt(); } -void Texture::drawEx( Float x, Float y, Float width, Float height, const Float &Angle, const Vector2f &Scale, const ColorA& Color0, const ColorA& Color1, const ColorA& Color2, const ColorA& Color3, const EE_BLEND_MODE &Blend, const EE_RENDER_MODE &Effect, OriginPoint Center, const Recti& texSector ) { +void Texture::drawEx( Float x, Float y, Float width, Float height, const Float &Angle, const Vector2f &Scale, const Color& Color0, const Color& Color1, const Color& Color2, const Color& Color3, const EE_BLEND_MODE &Blend, const EE_RENDER_MODE &Effect, OriginPoint Center, const Recti& texSector ) { bool renderSector = true; Recti Sector = texSector; Float w = (Float)getImageWidth(); @@ -685,11 +685,11 @@ void Texture::drawEx( Float x, Float y, Float width, Float height, const Float & sBR->drawOpt(); } -void Texture::drawQuad( const Quad2f& Q, const Vector2f& Offset, const Float &Angle, const Vector2f &Scale, const ColorA& Color, const EE_BLEND_MODE &Blend, const Recti& texSector) { +void Texture::drawQuad( const Quad2f& Q, const Vector2f& Offset, const Float &Angle, const Vector2f &Scale, const Color& Color, const EE_BLEND_MODE &Blend, const Recti& texSector) { drawQuadEx( Q, Offset, Angle, Scale, Color, Color, Color, Color, Blend, texSector ); } -void Texture::drawQuadEx( Quad2f Q, const Vector2f& Offset, const Float &Angle, const Vector2f &Scale, const ColorA& Color0, const ColorA& Color1, const ColorA& Color2, const ColorA& Color3, const EE_BLEND_MODE &Blend, Recti texSector ) { +void Texture::drawQuadEx( Quad2f Q, const Vector2f& Offset, const Float &Angle, const Vector2f &Scale, const Color& Color0, const Color& Color1, const Color& Color2, const Color& Color3, const EE_BLEND_MODE &Blend, Recti texSector ) { bool renderSector = true; Float w = (Float)getImageWidth(); Float h = (Float)getImageHeight(); diff --git a/src/eepp/graphics/texturefactory.cpp b/src/eepp/graphics/texturefactory.cpp index e7fc43d7a..fb3d2db45 100755 --- a/src/eepp/graphics/texturefactory.cpp +++ b/src/eepp/graphics/texturefactory.cpp @@ -26,7 +26,7 @@ TextureFactory::~TextureFactory() { unloadTextures(); } -Uint32 TextureFactory::createEmptyTexture( const unsigned int& Width, const unsigned int& Height, const unsigned int& Channels, const ColorA& DefaultColor, const bool& Mipmap, const EE_CLAMP_MODE& ClampMode, const bool& CompressTexture, const bool& KeepLocalCopy ) { +Uint32 TextureFactory::createEmptyTexture( const unsigned int& Width, const unsigned int& Height, const unsigned int& Channels, const Color& DefaultColor, const bool& Mipmap, const EE_CLAMP_MODE& ClampMode, const bool& CompressTexture, const bool& KeepLocalCopy ) { Image TmpImg( Width, Height, Channels, DefaultColor ); return loadFromPixels( TmpImg.getPixelsPtr(), Width, Height, Channels, Mipmap, ClampMode, CompressTexture, KeepLocalCopy ); } diff --git a/src/eepp/graphics/textureloader.cpp b/src/eepp/graphics/textureloader.cpp index 578a17071..f29edde86 100644 --- a/src/eepp/graphics/textureloader.cpp +++ b/src/eepp/graphics/textureloader.cpp @@ -450,7 +450,7 @@ void TextureLoader::loadFromPixels() { Image * tImg = eeNew ( Image, ( mPixels, mImgWidth, mImgHeight, mChannels ) ); - tImg->createMaskFromColor( ColorA( mColorKey->r, mColorKey->g, mColorKey->b, 255 ), 0 ); + tImg->createMaskFromColor( Color( mColorKey->r, mColorKey->g, mColorKey->b, 255 ), 0 ); tImg->avoidFreeImage( true ); diff --git a/src/eepp/graphics/texturepacker.cpp b/src/eepp/graphics/texturepacker.cpp index 10087155f..0a86abf10 100644 --- a/src/eepp/graphics/texturepacker.cpp +++ b/src/eepp/graphics/texturepacker.cpp @@ -521,7 +521,7 @@ void TexturePacker::save( const std::string& Filepath, const EE_SAVE_TYPE& Forma Image Img( (Uint32)mWidth, (Uint32)mHeight, (Uint32)4 ); - Img.fillWithColor( ColorA(0,0,0,0) ); + Img.fillWithColor( Color(0,0,0,0) ); TexturePackerTex * t = NULL; int w, h, c; diff --git a/src/eepp/graphics/vertexbuffer.cpp b/src/eepp/graphics/vertexbuffer.cpp index 2ef978eae..19633d08c 100644 --- a/src/eepp/graphics/vertexbuffer.cpp +++ b/src/eepp/graphics/vertexbuffer.cpp @@ -61,7 +61,7 @@ void VertexBuffer::addTextureCoord( const Vector2f& VertexCoord, const Uint32& T addVertex( VERTEX_FLAG_TEXTURE0 + TextureLevel, VertexCoord ); } -void VertexBuffer::addColor( const ColorA& Color ) { +void VertexBuffer::addColor( const Color& Color ) { mColorArray.push_back( Color.r ); mColorArray.push_back( Color.g ); mColorArray.push_back( Color.b ); @@ -122,12 +122,12 @@ Vector2f VertexBuffer::getVector2( const Uint32& Type, const Uint32& Index ) { return Vector2f( mVertexArray[ Type ][ pos ], mVertexArray[ Type ][ pos + 1 ] ); } -ColorA VertexBuffer::getColor( const Uint32& Index ) { +Color VertexBuffer::getColor( const Uint32& Index ) { eeASSERT( !VERTEX_FLAG_QUERY( mVertexFlags, VERTEX_FLAG_COLOR ) ); Int32 pos = Index * eeVertexElements[ VERTEX_FLAG_COLOR ]; - return ColorA( mColorArray[ pos ], mColorArray[ pos + 1 ], mColorArray[ pos + 2 ], mColorArray[ pos + 3 ] ); + return Color( mColorArray[ pos ], mColorArray[ pos + 1 ], mColorArray[ pos + 2 ], mColorArray[ pos + 3 ] ); } Uint32 VertexBuffer::getIndex( const Uint32& Index ) { diff --git a/src/eepp/maps/gameobjectobject.cpp b/src/eepp/maps/gameobjectobject.cpp index 834314e77..3ee581412 100644 --- a/src/eepp/maps/gameobjectobject.cpp +++ b/src/eepp/maps/gameobjectobject.cpp @@ -40,11 +40,11 @@ void GameObjectObject::draw() { Primitives P; P.setFillMode( DRAW_FILL ); - P.setColor( ColorA( colFill, colFill, colFill, colFill ) ); + P.setColor( Color( colFill, colFill, colFill, colFill ) ); P.drawRectangle( mRect ); P.setFillMode( DRAW_LINE ); - P.setColor( ColorA( 255, 255, 0, 200 ) ); + P.setColor( Color( 255, 255, 0, 200 ) ); P.drawRectangle( mRect ); } diff --git a/src/eepp/maps/gameobjectpolygon.cpp b/src/eepp/maps/gameobjectpolygon.cpp index 551caa29e..a819525b6 100644 --- a/src/eepp/maps/gameobjectpolygon.cpp +++ b/src/eepp/maps/gameobjectpolygon.cpp @@ -33,11 +33,11 @@ void GameObjectPolygon::draw() { Primitives P; P.setFillMode( DRAW_FILL ); - P.setColor( ColorA( colFill, colFill, colFill, colFill ) ); + P.setColor( Color( colFill, colFill, colFill, colFill ) ); P.drawPolygon( mPoly ); P.setFillMode( DRAW_LINE ); - P.setColor( ColorA( 255, 255, 0, 200 ) ); + P.setColor( Color( 255, 255, 0, 200 ) ); P.drawPolygon( mPoly ); } diff --git a/src/eepp/maps/gameobjectpolyline.cpp b/src/eepp/maps/gameobjectpolyline.cpp index e2201014a..f4d14e1b4 100644 --- a/src/eepp/maps/gameobjectpolyline.cpp +++ b/src/eepp/maps/gameobjectpolyline.cpp @@ -27,12 +27,12 @@ void GameObjectPolyline::draw() { if ( mSelected ) { P.setFillMode( DRAW_FILL ); - P.setColor( ColorA( 150, 150, 150, 150 ) ); + P.setColor( Color( 150, 150, 150, 150 ) ); P.drawPolygon( mPoly ); } P.setFillMode( DRAW_LINE ); - P.setColor( ColorA( 255, 255, 0, 200 ) ); + P.setColor( Color( 255, 255, 0, 200 ) ); P.drawPolygon( mPoly ); } diff --git a/src/eepp/maps/gameobjectsubtexture.cpp b/src/eepp/maps/gameobjectsubtexture.cpp index 391fa05fa..da0f3ba9e 100644 --- a/src/eepp/maps/gameobjectsubtexture.cpp +++ b/src/eepp/maps/gameobjectsubtexture.cpp @@ -72,7 +72,7 @@ void GameObjectSubTexture::draw() { } } } else { - mSubTexture->draw( mPos.x, mPos.y, ColorA(), getRotation(), Vector2f::One, ALPHA_NORMAL, getRenderModeFromFlags() ); + mSubTexture->draw( mPos.x, mPos.y, Color(), getRotation(), Vector2f::One, ALPHA_NORMAL, getRenderModeFromFlags() ); } mSubTexture->setDestSize( destSizeO ); diff --git a/src/eepp/maps/gameobjectsubtextureex.cpp b/src/eepp/maps/gameobjectsubtextureex.cpp index 3f8c5db95..e2fc2d7e3 100644 --- a/src/eepp/maps/gameobjectsubtextureex.cpp +++ b/src/eepp/maps/gameobjectsubtextureex.cpp @@ -4,7 +4,7 @@ namespace EE { namespace Maps { -GameObjectSubTextureEx::GameObjectSubTextureEx( const Uint32& Flags, MapLayer * Layer, Graphics::SubTexture * SubTexture, const Vector2f& Pos, EE_BLEND_MODE Blend, EE_RENDER_MODE Render, Float Angle, Vector2f Scale, ColorA Color ) : +GameObjectSubTextureEx::GameObjectSubTextureEx( const Uint32& Flags, MapLayer * Layer, Graphics::SubTexture * SubTexture, const Vector2f& Pos, EE_BLEND_MODE Blend, EE_RENDER_MODE Render, Float Angle, Vector2f Scale, Color Color ) : GameObjectSubTexture( Flags, Layer, SubTexture, Pos ), mBlend( Blend ), mRender( Render ), diff --git a/src/eepp/maps/gameobjectvirtual.cpp b/src/eepp/maps/gameobjectvirtual.cpp index b55b0e0bc..0e64c4e26 100644 --- a/src/eepp/maps/gameobjectvirtual.cpp +++ b/src/eepp/maps/gameobjectvirtual.cpp @@ -98,12 +98,12 @@ void GameObjectVirtual::draw() { } } } else { - mSubTexture->draw( mPos.x, mPos.y, ColorA(), getRotation(), Vector2f::One, ALPHA_NORMAL, getRenderModeFromFlags() ); + mSubTexture->draw( mPos.x, mPos.y, Color(), getRotation(), Vector2f::One, ALPHA_NORMAL, getRenderModeFromFlags() ); } } else { Primitives P; - ColorA C( mDataId ); + Color C( mDataId ); C.a = 255; P.setColor( C ); diff --git a/src/eepp/maps/mapeditor/mapeditor.cpp b/src/eepp/maps/mapeditor/mapeditor.cpp index 49dfc3dff..35b06cec0 100644 --- a/src/eepp/maps/mapeditor/mapeditor.cpp +++ b/src/eepp/maps/mapeditor/mapeditor.cpp @@ -348,7 +348,7 @@ void MapEditor::createSubTextureContainer( Int32 Width ) { ->setParent( mSGCont )->setSize( Width, Width ) ->setPosition( 0, mSubTextureList->getPosition().y + mSubTextureList->getSize().getHeight() + 4 ); - mGfxPreview->setBorderEnabled( true )->setColor( ColorA( 0, 0, 0, 200 ) ); + mGfxPreview->setBorderEnabled( true )->setColor( Color( 0, 0, 0, 200 ) ); mDICont = UIWidget::New(); mDICont->setParent( mSubTextureCont )->setPosition( TAB_CONT_X_DIST, mChkDI->getPosition().y + mChkDI->getSize().getHeight() + 8 ); @@ -379,8 +379,8 @@ void MapEditor::createLighContainer() { mUIBaseColor->setParent( mLightCont ); mUIBaseColor->setPosition( Txt->getPosition().x, Txt->getPosition().y + Txt->getSize().getHeight() + 4 ); mUIBaseColor->setSize( 58, 64 ); - mUIBaseColor->getBackground()->setColor( ColorA(255,255,255,255) ); - mUIBaseColor->getBorder()->setColor( ColorA( 100, 100, 100, 200 ) ); + mUIBaseColor->getBackground()->setColor( Color(255,255,255,255) ); + mUIBaseColor->getBorder()->setColor( Color( 100, 100, 100, 200 ) ); Txt = createTextBox( "R:", mLightCont, Sizei(), Vector2i( mUIBaseColor->getPosition().x + mUIBaseColor->getSize().getWidth() + 4, mUIBaseColor->getPosition().y ), UI_CONTROL_DEFAULT_FLAGS | UI_AUTO_SIZE, Text::Shadow ); @@ -566,7 +566,7 @@ void MapEditor::onLightRadiusChange( MapLight * Light ) { } void MapEditor::onLightSelect( MapLight * Light ) { - ColorA Col( Light->getColor() ); + Color Col( Light->getColor() ); mUIRedSlider->setValue( Col.r ); mUIGreenSlider->setValue( Col.g ); @@ -580,12 +580,12 @@ void MapEditor::onNewLight( const UIEvent * Event ) { if ( MEvent->getFlags() & EE_BUTTON_LMASK ) { Vector2i Pos = mUIMap->Map()->getMouseMapPos(); - mUIMap->addLight( eeNew( MapLight, ( mLightRadius->getValue(), Pos.x, Pos.y, mUIBaseColor->getBackground()->getColor().toColor(), mLightTypeChk->isActive() ? LIGHT_ISOMETRIC : LIGHT_NORMAL ) ) ); + mUIMap->addLight( eeNew( MapLight, ( mLightRadius->getValue(), Pos.x, Pos.y, mUIBaseColor->getBackground()->getColor().toRGB(), mLightTypeChk->isActive() ? LIGHT_ISOMETRIC : LIGHT_NORMAL ) ) ); } } void MapEditor::onRedChange( const UIEvent * Event ) { - ColorA Col = mUIBaseColor->getBackground()->getColor(); + Color Col = mUIBaseColor->getBackground()->getColor(); Col.r = (Uint8)mUIRedSlider->getValue(); mUIBaseColor->getBackground()->setColor( Col ); mUIRedTxt->setText( String::toStr( (Int32)mUIRedSlider->getValue() ) ); @@ -598,7 +598,7 @@ void MapEditor::onRedChange( const UIEvent * Event ) { } void MapEditor::onGreenChange( const UIEvent * Event ) { - ColorA Col = mUIBaseColor->getBackground()->getColor(); + Color Col = mUIBaseColor->getBackground()->getColor(); Col.g = (Uint8)mUIGreenSlider->getValue(); mUIBaseColor->getBackground()->setColor( Col ); mUIGreenTxt->setText( String::toStr( (Uint32)mUIGreenSlider->getValue() ) ); @@ -611,7 +611,7 @@ void MapEditor::onGreenChange( const UIEvent * Event ) { } void MapEditor::onBlueChange( const UIEvent * Event ) { - ColorA Col = mUIBaseColor->getBackground()->getColor(); + Color Col = mUIBaseColor->getBackground()->getColor(); Col.b = (Uint8)mUIBlueSlider->getValue(); mUIBaseColor->getBackground()->setColor( Col ); mUIBlueTxt->setText( String::toStr( (Uint32)mUIBlueSlider->getValue() ) ); diff --git a/src/eepp/maps/mapeditor/tilemapproperties.cpp b/src/eepp/maps/mapeditor/tilemapproperties.cpp index d2ad64a3f..21f9546e0 100644 --- a/src/eepp/maps/mapeditor/tilemapproperties.cpp +++ b/src/eepp/maps/mapeditor/tilemapproperties.cpp @@ -46,7 +46,7 @@ TileMapProperties::TileMapProperties( TileMap * Map ) : mUIBaseColor->setPosition( Txt->getPosition().x, Txt->getPosition().y + Txt->getSize().getHeight() + 4 ); mUIBaseColor->setSize( 64, 64 ); mUIBaseColor->getBackground()->setColor( mMap->getBaseColor() ); - mUIBaseColor->getBorder()->setColor( ColorA( 100, 100, 100, 200 ) ); + mUIBaseColor->getBorder()->setColor( Color( 100, 100, 100, 200 ) ); Txt = createTextBox( "Red Color:", mUIWindow->getContainer(), Sizei(), Vector2i( mUIBaseColor->getPosition().x + mUIBaseColor->getSize().getWidth() + 4, mUIBaseColor->getPosition().y ), UI_CONTROL_DEFAULT_FLAGS | UI_AUTO_SIZE, Text::Shadow ); mUIRedSlider = UISlider::New()->setOrientation( UI_HORIZONTAL ); @@ -139,34 +139,34 @@ TileMapProperties::~TileMapProperties() { } void TileMapProperties::onRedChange( const UIEvent * Event ) { - ColorA Col = mUIBaseColor->getBackground()->getColor(); + Color Col = mUIBaseColor->getBackground()->getColor(); Col.r = (Uint8)mUIRedSlider->getValue(); mUIBaseColor->getBackground()->setColor( Col ); mUIRedTxt->setText( String::toStr( (Int32)mUIRedSlider->getValue() ) ); - ColorA MapCol = mMap->getBaseColor(); + Color MapCol = mMap->getBaseColor(); MapCol.r = Col.r; mMap->setBaseColor( MapCol ); } void TileMapProperties::onGreenChange( const UIEvent * Event ) { - ColorA Col = mUIBaseColor->getBackground()->getColor(); + Color Col = mUIBaseColor->getBackground()->getColor(); Col.g = (Uint8)mUIGreenSlider->getValue(); mUIBaseColor->getBackground()->setColor( Col ); mUIGreenTxt->setText( String::toStr( (Uint32)mUIGreenSlider->getValue() ) ); - ColorA MapCol = mMap->getBaseColor(); + Color MapCol = mMap->getBaseColor(); MapCol.g = Col.g; mMap->setBaseColor( MapCol ); } void TileMapProperties::onBlueChange( const UIEvent * Event ) { - ColorA Col = mUIBaseColor->getBackground()->getColor(); + Color Col = mUIBaseColor->getBackground()->getColor(); Col.b = (Uint8)mUIBlueSlider->getValue(); mUIBaseColor->getBackground()->setColor( Col ); mUIBlueTxt->setText( String::toStr( (Uint32)mUIBlueSlider->getValue() ) ); - ColorA MapCol = mMap->getBaseColor(); + Color MapCol = mMap->getBaseColor(); MapCol.b = Col.b; mMap->setBaseColor( MapCol ); } diff --git a/src/eepp/maps/mapeditor/uimap.cpp b/src/eepp/maps/mapeditor/uimap.cpp index 81c56ad0d..346d61234 100644 --- a/src/eepp/maps/mapeditor/uimap.cpp +++ b/src/eepp/maps/mapeditor/uimap.cpp @@ -32,8 +32,8 @@ UIMap::UIMap( UITheme * Theme, TileMap * Map ) : mMap = eeNew( TileMap, () ); } - mMap->setBackColor( ColorA( 100, 100, 100, 100 ) ); - mMap->setGridLinesColor( ColorA( 150, 150, 150, 150 ) ); + mMap->setBackColor( Color( 100, 100, 100, 100 ) ); + mMap->setGridLinesColor( Color( 150, 150, 150, 150 ) ); mMap->setScale( PixelDensity::getPixelDensity() ); mMap->setDrawCallback( cb::Make0( this, &UIMap::mapDraw ) ); mMap->setViewSize( mRealSize ); @@ -370,7 +370,7 @@ void UIMap::addLight( MapLight * Light ) { void UIMap::mapDraw() { if ( EDITING_LIGHT == mEditingMode ) { if ( NULL != mSelLight ) { - mP.setColor( ColorA( 255, 0, 0, (Uint8)mAlpha ) ); + mP.setColor( Color( 255, 0, 0, (Uint8)mAlpha ) ); Vector2f Pos( mSelLight->getAABB().Left, mSelLight->getAABB().Top ); eeAABB AB( mSelLight->getAABB() ); @@ -384,11 +384,11 @@ void UIMap::mapDraw() { { if ( mObjRECTEditing ) { mP.setFillMode( DRAW_FILL ); - mP.setColor( ColorA( 100, 100, 100, 20 ) ); + mP.setColor( Color( 100, 100, 100, 20 ) ); mP.drawRectangle( mObjRECT ); mP.setFillMode( DRAW_LINE ); - mP.setColor( ColorA( 255, 0, 0, 200 ) ); + mP.setColor( Color( 255, 0, 0, 200 ) ); mP.drawRectangle( mObjRECT ); } @@ -397,22 +397,22 @@ void UIMap::mapDraw() { case INSERT_POLYGON: { mP.setFillMode( DRAW_FILL ); - mP.setColor( ColorA( 50, 50, 50, 50 ) ); + mP.setColor( Color( 50, 50, 50, 50 ) ); mP.drawPolygon( mObjPoly ); mP.setFillMode( DRAW_LINE ); - mP.setColor( ColorA( 255, 0, 0, 200 ) ); + mP.setColor( Color( 255, 0, 0, 200 ) ); mP.drawPolygon( mObjPoly ); Polygon2f polyN( mObjPoly ); polyN.pushBack( getMouseMapPos() ); mP.setFillMode( DRAW_FILL ); - mP.setColor( ColorA( 100, 100, 100, 100 ) ); + mP.setColor( Color( 100, 100, 100, 100 ) ); mP.drawPolygon( polyN ); mP.setFillMode( DRAW_LINE ); - mP.setColor( ColorA( 255, 255, 0, 200 ) ); + mP.setColor( Color( 255, 255, 0, 200 ) ); mP.drawPolygon( polyN ); break; @@ -420,14 +420,14 @@ void UIMap::mapDraw() { case INSERT_POLYLINE: { mP.setFillMode( DRAW_LINE ); - mP.setColor( ColorA( 255, 0, 0, 200 ) ); + mP.setColor( Color( 255, 0, 0, 200 ) ); mP.drawPolygon( mObjPoly ); Polygon2f polyN( mObjPoly ); polyN.pushBack( getMouseMapPos() ); mP.setFillMode( DRAW_LINE ); - mP.setColor( ColorA( 255, 255, 0, 200 ) ); + mP.setColor( Color( 255, 255, 0, 200 ) ); mP.drawPolygon( polyN ); break; @@ -435,7 +435,7 @@ void UIMap::mapDraw() { case EDIT_POLYGONS: { if ( NULL != mSelObj && eeINDEX_NOT_FOUND != mSelPointIndex ) { - mP.setColor( ColorA( 255, 255, 100, 100 ) ); + mP.setColor( Color( 255, 255, 100, 100 ) ); mP.setFillMode( DRAW_FILL ); mP.drawRectangle( mSelPointRect ); diff --git a/src/eepp/maps/mapeditor/uimapnew.cpp b/src/eepp/maps/mapeditor/uimapnew.cpp index 63ac6458a..97c12bedb 100644 --- a/src/eepp/maps/mapeditor/uimapnew.cpp +++ b/src/eepp/maps/mapeditor/uimapnew.cpp @@ -138,8 +138,8 @@ UIMapNew::UIMapNew( UIMap * Map, cb::Callback0 NewMapCb, bool ResizeMap ) mUIBaseColor = UIWidget::New(); mUIBaseColor->setFlags( UI_FILL_BACKGROUND | UI_BORDER ); - mUIBaseColor->getBorder()->setColor( ColorA( 100, 100, 100, 200 ) ); - mUIBaseColor->getBackground()->setColor( ResizeMap ? mUIMap->Map()->getBaseColor() : ColorA( 255, 255, 255, 255 ) ); + mUIBaseColor->getBorder()->setColor( Color( 100, 100, 100, 200 ) ); + mUIBaseColor->getBackground()->setColor( ResizeMap ? mUIMap->Map()->getBaseColor() : Color( 255, 255, 255, 255 ) ); mUIBaseColor->setParent( mUIWindow->getContainer() )->setPosition( Txt->getPosition().x, Txt->getPosition().y + Txt->getSize().getHeight() + 4 )->setSize( 64, 64 ); Txt = createTextBox( "Red Color:", mUIWindow->getContainer(), Sizei(), Vector2i( mUIBaseColor->getPosition().x + mUIBaseColor->getSize().getWidth() + 4, mUIBaseColor->getPosition().y ), UI_CONTROL_DEFAULT_FLAGS | UI_AUTO_SIZE, Text::Shadow ); @@ -205,21 +205,21 @@ UIMapNew::~UIMapNew() { } void UIMapNew::onRedChange( const UIEvent * Event ) { - ColorA Col = mUIBaseColor->getBackground()->getColor(); + Color Col = mUIBaseColor->getBackground()->getColor(); Col.r = (Uint8)mUIRedSlider->getValue(); mUIBaseColor->getBackground()->setColor( Col ); mUIRedTxt->setText( String::toStr( (Int32)mUIRedSlider->getValue() ) ); } void UIMapNew::onGreenChange( const UIEvent * Event ) { - ColorA Col = mUIBaseColor->getBackground()->getColor(); + Color Col = mUIBaseColor->getBackground()->getColor(); Col.g = (Uint8)mUIGreenSlider->getValue(); mUIBaseColor->getBackground()->setColor( Col ); mUIGreenTxt->setText( String::toStr( (Uint32)mUIGreenSlider->getValue() ) ); } void UIMapNew::onBlueChange( const UIEvent * Event ) { - ColorA Col = mUIBaseColor->getBackground()->getColor(); + Color Col = mUIBaseColor->getBackground()->getColor(); Col.b = (Uint8)mUIBlueSlider->getValue(); mUIBaseColor->getBackground()->setColor( Col ); mUIBlueTxt->setText( String::toStr( (Uint32)mUIBlueSlider->getValue() ) ); @@ -256,8 +256,8 @@ void UIMapNew::onOKClick( const UIEvent * Event ) { mUIMap->Map()->saveToFile( mapPath ); TileMap * Map = eeNew( TileMap, () ); - Map->setBackColor( ColorA( 100, 100, 100, 100 ) ); - Map->setGridLinesColor( ColorA( 150, 150, 150, 150 ) ); + Map->setBackColor( Color( 100, 100, 100, 100 ) ); + Map->setGridLinesColor( Color( 150, 150, 150, 150 ) ); Map->forceHeadersOnLoad( Sizei( w, h ), Sizei( tw, th ), ml, Flags ); Map->loadFromFile( mapPath ); Map->disableForcedHeaders(); diff --git a/src/eepp/maps/maplight.cpp b/src/eepp/maps/maplight.cpp index 73fbbd7e1..2486ef6ac 100755 --- a/src/eepp/maps/maplight.cpp +++ b/src/eepp/maps/maplight.cpp @@ -67,7 +67,7 @@ RGB MapLight::processVertex( const Float& PointX, const Float& PointY, const RGB return BaseColor; } -ColorA MapLight::processVertex( const Float& PointX, const Float& PointY, const ColorA& VertexColor, const ColorA& BaseColor ) { +Color MapLight::processVertex( const Float& PointX, const Float& PointY, const Color& VertexColor, const Color& BaseColor ) { Float VertexDist; if ( mActive ) { @@ -80,7 +80,7 @@ ColorA MapLight::processVertex( const Float& PointX, const Float& PointY, const } if ( VertexDist <= mRadius ) { - ColorA TmpRGB; + Color TmpRGB; Uint8 TmpColor; Float LightC; @@ -111,7 +111,7 @@ RGB MapLight::processVertex( const Vector2f& Pos, const RGB& VertexColor, const return processVertex( Pos.x, Pos.y, VertexColor, BaseColor ); } -ColorA MapLight::processVertex( const Vector2f& Pos, const ColorA& VertexColor, const ColorA& BaseColor ) { +Color MapLight::processVertex( const Vector2f& Pos, const Color& VertexColor, const Color& BaseColor ) { return processVertex( Pos.x, Pos.y, VertexColor, BaseColor ); } diff --git a/src/eepp/maps/maplightmanager.cpp b/src/eepp/maps/maplightmanager.cpp index 378b001c3..69674964d 100644 --- a/src/eepp/maps/maplightmanager.cpp +++ b/src/eepp/maps/maplightmanager.cpp @@ -39,7 +39,7 @@ void MapLightManager::updateByVertex() { Vector2i end = mMap->getEndTile(); eeAABB VisibleArea = mMap->getViewAreaAABB(); Sizei TileSize = mMap->getTileSize(); - ColorA BaseColor = mMap->getBaseColor(); + Color BaseColor = mMap->getBaseColor(); bool firstLight = true; Vector2i Pos; @@ -92,7 +92,7 @@ void MapLightManager::updateByTile() { eeAABB VisibleArea = mMap->getViewAreaAABB(); Sizei TileSize = mMap->getTileSize(); Sizei HalfTileSize = mMap->getTileSize() / 2; - ColorA BaseColor = mMap->getBaseColor(); + Color BaseColor = mMap->getBaseColor(); bool firstLight = true; Vector2i Pos; @@ -127,8 +127,8 @@ void MapLightManager::updateByTile() { } } -ColorA MapLightManager::getColorFromPos( const Vector2f& Pos ) { - ColorA Col( mMap->getBaseColor() ); +Color MapLightManager::getColorFromPos( const Vector2f& Pos ) { + Color Col( mMap->getBaseColor() ); if ( !mLights.size() ) return Col; @@ -167,7 +167,7 @@ void MapLightManager::removeLight( const Vector2f& OverPos ) { } } -const ColorA * MapLightManager::getTileColor( const Vector2i& TilePos ) { +const Color * MapLightManager::getTileColor( const Vector2i& TilePos ) { eeASSERT( 1 == mNumVertex ); if ( !mLights.size() ) @@ -176,7 +176,7 @@ const ColorA * MapLightManager::getTileColor( const Vector2i& TilePos ) { return mTileColors[ TilePos.x ][ TilePos.y ][0]; } -const ColorA * MapLightManager::getTileColor( const Vector2i& TilePos, const Uint32& Vertex ) { +const Color * MapLightManager::getTileColor( const Vector2i& TilePos, const Uint32& Vertex ) { eeASSERT( 4 == mNumVertex ); if ( !mLights.size() ) @@ -187,16 +187,16 @@ const ColorA * MapLightManager::getTileColor( const Vector2i& TilePos, const Uin void MapLightManager::allocateColors() { Sizei Size = mMap->getSize(); - mTileColors = eeNewArray( ColorA***, Size.getWidth() ); + mTileColors = eeNewArray( Color***, Size.getWidth() ); for ( Int32 x = 0; x < Size.x; x++ ) { - mTileColors[x] = eeNewArray( ColorA**, Size.getHeight() ); + mTileColors[x] = eeNewArray( Color**, Size.getHeight() ); for ( Int32 y = 0; y < Size.y; y++ ) { - mTileColors[x][y] = eeNewArray( ColorA*, mNumVertex ); + mTileColors[x][y] = eeNewArray( Color*, mNumVertex ); for ( Int32 v = 0; v < mNumVertex; v++ ) { - mTileColors[x][y][v] = eeNew( ColorA, (255,255,255,255) ); + mTileColors[x][y][v] = eeNew( Color, (255,255,255,255) ); } } } diff --git a/src/eepp/maps/mapobjectlayer.cpp b/src/eepp/maps/mapobjectlayer.cpp index 1f5a3bd27..69312a33d 100644 --- a/src/eepp/maps/mapobjectlayer.cpp +++ b/src/eepp/maps/mapobjectlayer.cpp @@ -44,7 +44,7 @@ void MapObjectLayer::draw( const Vector2f &Offset ) { Texture * Tex = mMap->getBlankTileTexture(); if ( mMap->getShowBlocked() && NULL != Tex ) { - ColorA Col( 255, 0, 0, 200 ); + Color Col( 255, 0, 0, 200 ); for ( it = mObjects.begin(); it != mObjects.end(); it++ ) { GameObject * Obj = (*it); diff --git a/src/eepp/maps/tilemap.cpp b/src/eepp/maps/tilemap.cpp index f7a77886d..ece8a6a3c 100644 --- a/src/eepp/maps/tilemap.cpp +++ b/src/eepp/maps/tilemap.cpp @@ -61,7 +61,7 @@ void TileMap::reset() { mMaxLayers = 0; mMouseOver = false; mViewSize = Sizei( 800, 600 ); - mBaseColor = ColorA( 255, 255, 255, 255 ); + mBaseColor = Color( 255, 255, 255, 255 ); } void TileMap::forceHeadersOnLoad( Sizei mapSize, Sizei tileSize, Uint32 numLayers, Uint32 flags ) { @@ -125,11 +125,11 @@ void TileMap::createEmptyTile() { if ( NULL == Tex ) { Uint32 x, y; - ColorA Col( mGridLinesColor ); + Color Col( mGridLinesColor ); Image Img( mTileSize.getWidth(), mTileSize.getHeight(), 4 ); - Img.fillWithColor( ColorA( 0, 0, 0, 0 ) ); + Img.fillWithColor( Color( 0, 0, 0, 0 ) ); for ( x = 0; x < Img.getWidth(); x++ ) { Img.setPixel( x, 0, Col ); @@ -222,9 +222,9 @@ void TileMap::draw() { Uint8 Alpha = static_cast( (Float)mBackColor.a * ( (Float)mBackAlpha / 255.f ) ); - P.setColor( ColorA( mBackColor.r, mBackColor.g, mBackColor.b, Alpha ) ); + P.setColor( Color( mBackColor.r, mBackColor.g, mBackColor.b, Alpha ) ); P.drawRectangle( Rectf( Vector2f( mScreenPos.x, mScreenPos.y ), Sizef( mViewSize.x, mViewSize.y ) ), 0.f, Vector2f::One ); - P.setColor( ColorA( 255, 255, 255, 255 ) ); + P.setColor( Color( 255, 255, 255, 255 ) ); } float oldM[16]; @@ -276,7 +276,7 @@ void TileMap::gridDraw() { Vector2i end = getEndTile(); Float tx, ty; - ColorA TileTexCol( 255, 255, 255, mBackAlpha ); + Color TileTexCol( 255, 255, 255, mBackAlpha ); for ( Int32 x = start.x; x < end.x; x++ ) { for ( Int32 y = start.y; y < end.y; y++ ) { @@ -288,10 +288,10 @@ void TileMap::gridDraw() { Vector2i TPos( x, y ); if ( mLightManager->isByVertex() ) { - ColorA TileTexCol0( *mLightManager->getTileColor( TPos, 0 ) ); - ColorA TileTexCol1( *mLightManager->getTileColor( TPos, 1 ) ); - ColorA TileTexCol2( *mLightManager->getTileColor( TPos, 2 ) ); - ColorA TileTexCol3( *mLightManager->getTileColor( TPos, 3 ) ); + Color TileTexCol0( *mLightManager->getTileColor( TPos, 0 ) ); + Color TileTexCol1( *mLightManager->getTileColor( TPos, 1 ) ); + Color TileTexCol2( *mLightManager->getTileColor( TPos, 2 ) ); + Color TileTexCol3( *mLightManager->getTileColor( TPos, 3 ) ); TileTexCol0.a = TileTexCol1.a = TileTexCol2.a = TileTexCol3.a = mBackAlpha; @@ -519,11 +519,11 @@ const Vector2i& TileMap::getExtraTiles() const { return mExtraTiles; } -void TileMap::setBaseColor( const ColorA& color ) { +void TileMap::setBaseColor( const Color& color ) { mBaseColor = color; } -const ColorA& TileMap::getBaseColor() const { +const Color& TileMap::getBaseColor() const { return mBaseColor; } @@ -806,7 +806,7 @@ bool TileMap::loadFromStream( IOStream& IOS ) { create( mForcedHeaders->MapSize, mForcedHeaders->NumLayers, mForcedHeaders->TileSize, mForcedHeaders->Flags ); } - setBaseColor( ColorA( MapHdr.BaseColor ) ); + setBaseColor( Color( MapHdr.BaseColor ) ); //! Load Properties if ( MapHdr.PropertyCount ) { @@ -1009,8 +1009,8 @@ bool TileMap::loadFromStream( IOStream& IOS ) { for ( i = 0; i < MapHdr.LightsCount; i++ ) { tLightHdr = &( tLighsHdr[ i ] ); - ColorA color( tLightHdr->Color ); - RGB rgb( color.toColor() ); + Color color( tLightHdr->Color ); + RGB rgb( color.toRGB() ); mLightManager->addLight( eeNew( MapLight, ( tLightHdr->Radius, tLightHdr->PosX, tLightHdr->PosY, rgb, (LIGHT_TYPE)tLightHdr->Type ) ) @@ -1352,7 +1352,7 @@ void TileMap::saveToStream( IOStream& IOS ) { tLightHdr.Radius = Light->getRadius(); tLightHdr.PosX = (Int32)Light->getPosition().x; tLightHdr.PosY = (Int32)Light->getPosition().y; - tLightHdr.Color = ColorA( Light->getColor() ).getValue(); + tLightHdr.Color = Color( Light->getColor() ).getValue(); tLightHdr.Type = Light->getType(); IOS.write( (const char*)&tLightHdr, sizeof(sMapLightHdr) ); @@ -1455,11 +1455,11 @@ void TileMap::setBackAlpha( const Uint8& alpha ) { mBackAlpha = alpha; } -const ColorA& TileMap::getBackColor() const { +const Color& TileMap::getBackColor() const { return mBackColor; } -void TileMap::setBackColor( const ColorA& col ) { +void TileMap::setBackColor( const Color& col ) { mBackColor = col; } @@ -1467,11 +1467,11 @@ Uint32 TileMap::getNewObjectId() { return ++mLastObjId; } -void TileMap::setGridLinesColor( const ColorA& Col ) { +void TileMap::setGridLinesColor( const Color& Col ) { mGridLinesColor = Col; } -const ColorA& TileMap::setGridLinesColor() const { +const Color& TileMap::setGridLinesColor() const { return mGridLinesColor; } diff --git a/src/eepp/maps/tilemaplayer.cpp b/src/eepp/maps/tilemaplayer.cpp index 82cd366b0..9ae19b8d7 100644 --- a/src/eepp/maps/tilemaplayer.cpp +++ b/src/eepp/maps/tilemaplayer.cpp @@ -46,7 +46,7 @@ void TileMapLayer::draw( const Vector2f& Offset ) { for ( Int32 y = start.y; y < end.y; y++ ) { if ( NULL != mTiles[x][y] ) { if ( mTiles[x][y]->isBlocked() ) { - Tex->draw( x * mMap->getTileSize().x, y * mMap->getTileSize().y, 0 , Vector2f::One, ColorA( 255, 0, 0, 200 ) ); + Tex->draw( x * mMap->getTileSize().x, y * mMap->getTileSize().y, 0 , Vector2f::One, Color( 255, 0, 0, 200 ) ); } } } diff --git a/src/eepp/physics/constraints/dampedspring.cpp b/src/eepp/physics/constraints/dampedspring.cpp index be0a3e2e2..c829c61cb 100644 --- a/src/eepp/physics/constraints/dampedspring.cpp +++ b/src/eepp/physics/constraints/dampedspring.cpp @@ -104,7 +104,7 @@ void DampedSpring::draw() { GLi->disable( GL_TEXTURE_2D ); GLi->disableClientState( GL_TEXTURE_COORD_ARRAY ); - std::vector tcolors( springVAR_count * 4, ColorA( 0, 255, 0, 255 ) ); + std::vector tcolors( springVAR_count * 4, Color( 0, 255, 0, 255 ) ); GLi->colorPointer( 4, GL_UNSIGNED_BYTE, 0, reinterpret_cast( &tcolors[0] ), springVAR_count * 4 ); GLi->vertexPointer( 2, GL_FLOAT, 0, springVAR, springVAR_count * sizeof(float) * 2 ); diff --git a/src/eepp/physics/constraints/groovejoint.cpp b/src/eepp/physics/constraints/groovejoint.cpp index 95d5d590f..7a888d376 100644 --- a/src/eepp/physics/constraints/groovejoint.cpp +++ b/src/eepp/physics/constraints/groovejoint.cpp @@ -57,11 +57,11 @@ void GrooveJoint::draw() { BR->setTexture( NULL ); BR->setPointSize( mDrawPointSize ); BR->pointsBegin(); - BR->pointSetColor( ColorA( 128, 255, 128, 255 ) ); + BR->pointSetColor( Color( 128, 255, 128, 255 ) ); BR->batchPoint( c.x, c.y ); BR->draw(); BR->linesBegin(); - BR->linesSetColor( ColorA( 128, 255, 128, 255 ) ); + BR->linesSetColor( Color( 128, 255, 128, 255 ) ); BR->batchLine( a.x, a.y, b.x, b.y ); BR->draw(); BR->setPointSize( ps ); diff --git a/src/eepp/physics/constraints/pinjoint.cpp b/src/eepp/physics/constraints/pinjoint.cpp index 4cb66ec41..b42b16aad 100644 --- a/src/eepp/physics/constraints/pinjoint.cpp +++ b/src/eepp/physics/constraints/pinjoint.cpp @@ -56,13 +56,13 @@ void PinJoint::draw() { BR->setTexture( NULL ); BR->setPointSize( mDrawPointSize ); BR->pointsBegin(); - BR->pointSetColor( ColorA( 128, 255, 128, 255 ) ); + BR->pointSetColor( Color( 128, 255, 128, 255 ) ); BR->batchPoint( a.x, a.y ); BR->batchPoint( b.x, b.y ); BR->draw(); BR->linesBegin(); - BR->linesSetColor( ColorA( 128, 255, 128, 255 ) ); + BR->linesSetColor( Color( 128, 255, 128, 255 ) ); BR->batchLine( a.x, a.y, b.x, b.y ); BR->draw(); diff --git a/src/eepp/physics/constraints/pivotjoint.cpp b/src/eepp/physics/constraints/pivotjoint.cpp index cf0a4bfbe..c8b6dac72 100644 --- a/src/eepp/physics/constraints/pivotjoint.cpp +++ b/src/eepp/physics/constraints/pivotjoint.cpp @@ -57,7 +57,7 @@ void PivotJoint::draw() { BR->setTexture( NULL ); BR->setPointSize( mDrawPointSize ); BR->pointsBegin(); - BR->pointSetColor( ColorA( 128, 255, 128, 255 ) ); + BR->pointSetColor( Color( 128, 255, 128, 255 ) ); BR->batchPoint( a.x, a.y ); BR->batchPoint( b.x, b.y ); BR->draw(); diff --git a/src/eepp/physics/constraints/slidejoint.cpp b/src/eepp/physics/constraints/slidejoint.cpp index e55cae784..2def6f416 100644 --- a/src/eepp/physics/constraints/slidejoint.cpp +++ b/src/eepp/physics/constraints/slidejoint.cpp @@ -65,7 +65,7 @@ void SlideJoint::draw() { BR->setTexture( NULL ); BR->setPointSize( mDrawPointSize ); BR->pointsBegin(); - BR->pointSetColor( ColorA( 128, 255, 128, 255 ) ); + BR->pointSetColor( Color( 128, 255, 128, 255 ) ); BR->batchPoint( a.x, a.y ); BR->batchPoint( b.x, b.y ); BR->draw(); diff --git a/src/eepp/physics/shape.cpp b/src/eepp/physics/shape.cpp index e19f97930..428044c78 100644 --- a/src/eepp/physics/shape.cpp +++ b/src/eepp/physics/shape.cpp @@ -169,7 +169,7 @@ ShapeSegment * Shape::getAsSegment() { void Shape::drawBB() { #ifdef PHYSICS_RENDERER_ENABLED Primitives P; - P.setColor( ColorA( 76, 128, 76, 255 ) ); + P.setColor( Color( 76, 128, 76, 255 ) ); 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 ) ) ); diff --git a/src/eepp/physics/shapepoly.cpp b/src/eepp/physics/shapepoly.cpp index b36a7d25d..b2342cbc8 100644 --- a/src/eepp/physics/shapepoly.cpp +++ b/src/eepp/physics/shapepoly.cpp @@ -61,7 +61,7 @@ void ShapePoly::draw( Space * space ) { BR->setTexture( NULL ); - ColorA Col = colorForShape( (cpShape *)poly, space->getSpace() ); + Color Col = colorForShape( (cpShape *)poly, space->getSpace() ); if( !poly->CP_PRIVATE(shape).sensor ){ if ( 4 != poly->CP_PRIVATE(numVerts) ) { @@ -91,7 +91,7 @@ void ShapePoly::drawBorder( Space *space ) { BatchRenderer * BR = GlobalBatchRenderer::instance(); - ColorA Col = colorForShape( (cpShape *)poly, space->getSpace() ); + Color Col = colorForShape( (cpShape *)poly, space->getSpace() ); BR->lineLoopBegin(); BR->lineLoopSetColor( Col ); diff --git a/src/eepp/physics/shapesegment.cpp b/src/eepp/physics/shapesegment.cpp index d9a16b0f6..8a6d67d6a 100644 --- a/src/eepp/physics/shapesegment.cpp +++ b/src/eepp/physics/shapesegment.cpp @@ -97,7 +97,7 @@ void ShapeSegment::draw( Space * space ) { GLi->disable( GL_TEXTURE_2D ); GLi->disableClientState( GL_TEXTURE_COORD_ARRAY ); - std::vector tcolors( pillVAR_count * 4 ); + std::vector tcolors( pillVAR_count * 4 ); GLi->pushMatrix(); @@ -116,7 +116,7 @@ void ShapeSegment::draw( Space * space ) { GLi->vertexPointer( 3, GL_FLOAT, 0, pillVAR, pillVAR_count * sizeof(float) * 3 ); if( !seg->CP_PRIVATE(shape).sensor ) { - ColorA C = colorForShape( mShape, space->getSpace() ); + Color C = colorForShape( mShape, space->getSpace() ); tcolors.assign( tcolors.size(), C ); @@ -125,7 +125,7 @@ void ShapeSegment::draw( Space * space ) { GLi->drawArrays( GL_TRIANGLE_FAN, 0, pillVAR_count ); } - tcolors.assign( tcolors.size(), ColorA( 102, 102, 102, 255 ) ); + tcolors.assign( tcolors.size(), Color( 102, 102, 102, 255 ) ); GLi->colorPointer( 4, GL_UNSIGNED_BYTE, 0, reinterpret_cast( &tcolors[0] ), pillVAR_count * 4 ); diff --git a/src/eepp/physics/space.cpp b/src/eepp/physics/space.cpp index 873bd92b0..08d2460ab 100644 --- a/src/eepp/physics/space.cpp +++ b/src/eepp/physics/space.cpp @@ -324,7 +324,7 @@ void Space::draw() { if ( options->BodyPointSize ) { BR->setPointSize( options->BodyPointSize ); BR->pointsBegin(); - BR->pointSetColor( ColorA( 255, 255, 255, 255 ) ); + BR->pointSetColor( Color( 255, 255, 255, 255 ) ); cpArray * bodies = mSpace->CP_PRIVATE(bodies); @@ -340,7 +340,7 @@ void Space::draw() { if ( options->CollisionPointSize ) { BR->setPointSize( options->CollisionPointSize ); BR->pointsBegin(); - BR->pointSetColor( ColorA( 255, 0, 0, 255 ) ); + BR->pointSetColor( Color( 255, 0, 0, 255 ) ); cpArray * arbiters = mSpace->CP_PRIVATE(arbiters); diff --git a/src/eepp/system/color.cpp b/src/eepp/system/color.cpp index 60cfb8d95..cfdad3d0c 100644 --- a/src/eepp/system/color.cpp +++ b/src/eepp/system/color.cpp @@ -1,8 +1,10 @@ #include +#include #include namespace EE { namespace System { +const Color Color::Transparent = Color(0,0,0,0); const Color Color::White = Color(255,255,255); const Color Color::Black = Color(0,0,0); const Color Color::Red = Color(255,0,0); @@ -20,11 +22,7 @@ const Color Color::Purple = Color(128,0,128); const Color Color::Teal = Color(0,128,128); const Color Color::Navy = Color(0,0,128); -const ColorA ColorA::Transparent = ColorA(0,0,0,0); -const ColorA ColorA::White = ColorA(255,255,255,255); -const ColorA ColorA::Black = ColorA(0,0,0,255); - -Color::Color() : tColor() +RGB::RGB() : tRGB() { } @@ -33,16 +31,16 @@ Color::Color() : tColor() ** @param g Green component ** @param b Blue component */ -Color::Color( Uint8 r, Uint8 g, Uint8 b ) : tColor( r, g, b ) +RGB::RGB( Uint8 r, Uint8 g, Uint8 b ) : tRGB( r, g, b ) { } -Color::Color( const tColor& color ) : - tColor( color.r, color.g, color.b ) +RGB::RGB( const tRGB& color ) : + tRGB( color.r, color.g, color.b ) { } -Color::Color( Uint32 Col ) +RGB::RGB( Uint32 Col ) { Col = BitOp::swapLE32( Col ); r = static_cast( Col >> 16 ); @@ -50,6 +48,10 @@ Color::Color( Uint32 Col ) b = static_cast( Col >> 0 ); } +Color RGB::toColor() { + return Color(r,g,b); +} + /** Blend a source color to destination color */ ColorAf Color::blend( ColorAf srcf, ColorAf dstf ) { Float alpha = srcf.a + dstf.a * ( 1.f - srcf.a ); @@ -63,7 +65,7 @@ ColorAf Color::blend( ColorAf srcf, ColorAf dstf ) { #define EE_COLOR_BLEND_FTOU8(color) (Uint8)( color == 1.f ? 255 : (color * 255.99f)) /** Blend a source color to destination color */ -ColorA Color::blend( ColorA src, ColorA dst ) { +Color Color::blend( Color src, Color dst ) { ColorAf srcf( (Float)src.r / 255.f, (Float)src.g / 255.f, (Float)src.b / 255.f, (Float)src.a / 255.f ); ColorAf dstf( (Float)dst.r / 255.f, (Float)dst.g / 255.f, (Float)dst.b / 255.f, (Float)dst.a / 255.f ); Float alpha = srcf.a + dstf.a * ( 1.f - srcf.a ); @@ -71,34 +73,34 @@ ColorA Color::blend( ColorA src, ColorA dst ) { Float green = ( srcf.g * srcf.a + dstf.g * dstf.a * ( 1.f - srcf.a ) ) / alpha; Float blue = ( srcf.b * srcf.a + dstf.b * dstf.a * ( 1.f - srcf.a ) ) / alpha; - return ColorA( EE_COLOR_BLEND_FTOU8(red), EE_COLOR_BLEND_FTOU8(green), EE_COLOR_BLEND_FTOU8(blue), EE_COLOR_BLEND_FTOU8(alpha) ); + return Color( EE_COLOR_BLEND_FTOU8(red), EE_COLOR_BLEND_FTOU8(green), EE_COLOR_BLEND_FTOU8(blue), EE_COLOR_BLEND_FTOU8(alpha) ); } -ColorA::ColorA() : - tColorA() +Color::Color() : + tColor() {} -ColorA::ColorA(Uint8 r, Uint8 g, Uint8 b, Uint8 a) : - tColorA(r,g,b,a) +Color::Color(Uint8 r, Uint8 g, Uint8 b, Uint8 a) : + tColor(r,g,b,a) {} -ColorA::ColorA( const tColor& Col ) : - tColorA( Col ) +Color::Color( const tRGB& Col ) : + tColor( Col ) {} -ColorA::ColorA( const tColor& Col, Uint8 a ) : - tColorA( Col, a ) +Color::Color( const tRGB& Col, Uint8 a ) : + tColor( Col, a ) {} -ColorA::ColorA( const tColorA& Col ) : - tColorA( Col.Value ) +Color::Color( const tColor& Col ) : + tColor( Col.Value ) {} -ColorA::ColorA( const Uint32& Col ) : - tColorA( Col ) +Color::Color( const Uint32& Col ) : + tColor( Col ) {} -ColorA ColorA::colorFromPointer( void *ptr ) { +Color Color::colorFromPointer( void *ptr ) { unsigned long val = (long)ptr; // hash the pointer up nicely @@ -121,15 +123,58 @@ ColorA ColorA::colorFromPointer( void *ptr ) { g = (g*mult)/max + add; b = (b*mult)/max + add; - return ColorA(r, g, b, 255); + return Color(r, g, b, 255); } -ColorA ColorA::fromString( const char * str ) { - return ColorA( std::strtoul( str, NULL, 16 ) ); +Color Color::fromString( const char * str ) { + return fromString( std::string( str ) ); } -ColorA ColorA::fromString( const std::string& str ) { - return ColorA( std::strtoul( str.c_str(), NULL, 16 ) ); +Color Color::fromString( std::string str ) { + std::size_t size = str.size(); + + if ( 0 == size ) + return Color::White; + + if ( str[0] == '#' ) { + str = str.substr(1); + + size = str.size(); + + if ( 0 == size ) + return Color::White; + } else if ( size >= 3 && isalpha( str[0] ) && isalpha( str[1] ) && isalpha( str[2] ) ) { + String::toLowerInPlace( str ); + if ( "transparent" == str ) return Color::Transparent; + else if ( "white" == str ) return Color::White; + else if ( "black" == str ) return Color::Black; + else if ( "red" == str ) return Color::Red; + else if ( "green" == str ) return Color::Green; + else if ( "blue" == str ) return Color::Blue; + else if ( "yellow" == str ) return Color::Yellow; + else if ( "cyan" == str ) return Color::Cyan; + else if ( "magenta" == str ) return Color::Magenta; + else if ( "silver" == str ) return Color::Silver; + else if ( "gray" == str ) return Color::Gray; + else if ( "maroon" == str ) return Color::Maroon; + else if ( "olive" == str ) return Color::Olive; + else if ( "officegreen" == str ) return Color::OfficeGreen; + else if ( "purple" == str ) return Color::Purple; + else if ( "teal" == str ) return Color::Teal; + else if ( "navy" == str ) return Color::Navy; + } + + if ( size < 6 ) { + for ( std::size_t i = size; i < 6; i++ ) + str += str[ size - 1 ]; + + size = 6; + } + + if ( 6 == size ) + str += "FF"; + + return Color( std::strtoul( str.c_str(), NULL, 16 ) ); } }} diff --git a/src/eepp/ui/tools/textureatlaseditor.cpp b/src/eepp/ui/tools/textureatlaseditor.cpp index c275868ba..a42e7b14a 100644 --- a/src/eepp/ui/tools/textureatlaseditor.cpp +++ b/src/eepp/ui/tools/textureatlaseditor.cpp @@ -57,7 +57,7 @@ TextureAtlasEditor::TextureAtlasEditor( UIWindow * AttatchTo, const TGEditorClos " " " " " " + " flags='clip' backgroundColor='#00000032' borderWidth='1' borderColor='#000000FF' />" " " " " " " diff --git a/src/eepp/ui/tools/textureatlassubtextureeditor.cpp b/src/eepp/ui/tools/textureatlassubtextureeditor.cpp index 443c3bbac..e6c8a403d 100644 --- a/src/eepp/ui/tools/textureatlassubtextureeditor.cpp +++ b/src/eepp/ui/tools/textureatlassubtextureeditor.cpp @@ -41,7 +41,7 @@ TextureAtlasSubTextureEditor::~TextureAtlasSubTextureEditor() { void TextureAtlasSubTextureEditor::draw() { Primitives P; - P.setColor( ColorA( 255, 0, 0, mAlpha ) ); + P.setColor( Color( 255, 0, 0, mAlpha ) ); P.setLineWidth( PixelDensity::dpToPx( 1.f ) ); Vector2i uiCenterPx = PixelDensity::dpToPxI( mUICenter ); diff --git a/src/eepp/ui/uibackground.cpp b/src/eepp/ui/uibackground.cpp index 8d835877f..a95777ea8 100644 --- a/src/eepp/ui/uibackground.cpp +++ b/src/eepp/ui/uibackground.cpp @@ -10,24 +10,24 @@ UIBackground::UIBackground() : mBlendMode( ALPHA_NORMAL ), mCorners(0) { - mColor.push_back( ColorA(0xFF404040) ); + mColor.push_back( Color(0xFF404040) ); } -ColorA& UIBackground::getColor( const unsigned int& index ) { +Color& UIBackground::getColor( const unsigned int& index ) { if ( index < mColor.size() ) return mColor[ index ]; return mColor[ 0 ]; } -UIBackground * UIBackground::setColorsTo( const ColorA& Color ) { +UIBackground * UIBackground::setColorsTo( const Color& Color ) { for ( unsigned int i = 0; i < mColor.size(); i++ ) mColor[i] = Color; return this; } -UIBackground * UIBackground::setColors( const ColorA& TopLeftColor, const ColorA& BottomLeftColor, const ColorA& BottomRightColor, const ColorA& TopRightColor ) { +UIBackground * UIBackground::setColors( const Color& TopLeftColor, const Color& BottomLeftColor, const Color& BottomRightColor, const Color& TopRightColor ) { mColor[0] = TopLeftColor; if ( mColor.size() < 2 ) @@ -48,11 +48,11 @@ UIBackground * UIBackground::setColors( const ColorA& TopLeftColor, const ColorA return this; } -const std::vector& UIBackground::getColors() { +const std::vector& UIBackground::getColors() { return mColor; } -UIBackground * UIBackground::setColor( const ColorA& Col ) { +UIBackground * UIBackground::setColor( const Color& Col ) { mColor[0] = Col; return this; } diff --git a/src/eepp/ui/uiborder.cpp b/src/eepp/ui/uiborder.cpp index 68af9ea93..9f2b685a8 100644 --- a/src/eepp/ui/uiborder.cpp +++ b/src/eepp/ui/uiborder.cpp @@ -7,15 +7,15 @@ UIBorder * UIBorder::New() { } UIBorder::UIBorder() : - mColor( ColorA::Black ), + mColor( Color::Black ), mWidth( 1 ) {} -const ColorA& UIBorder::getColor() const { +const Color& UIBorder::getColor() const { return mColor; } -UIBorder * UIBorder::setColor( const ColorA& Col ) { +UIBorder * UIBorder::setColor( const Color& Col ) { mColor = Col; return this; } diff --git a/src/eepp/ui/uicontrol.cpp b/src/eepp/ui/uicontrol.cpp index 2379b1ac0..487d830ca 100644 --- a/src/eepp/ui/uicontrol.cpp +++ b/src/eepp/ui/uicontrol.cpp @@ -365,7 +365,7 @@ void UIControl::drawBox() { Primitives P; P.setFillMode( DRAW_LINE ); P.setBlendMode( getBlendMode() ); - P.setColor( ColorA::colorFromPointer( this ) ); + P.setColor( Color::colorFromPointer( this ) ); P.setLineWidth( PixelDensity::dpToPxI( 1 ) ); P.drawRectangle( getRectf() ); } diff --git a/src/eepp/ui/uicontrolanim.cpp b/src/eepp/ui/uicontrolanim.cpp index a638dd675..cafade834 100644 --- a/src/eepp/ui/uicontrolanim.cpp +++ b/src/eepp/ui/uicontrolanim.cpp @@ -416,8 +416,8 @@ void UIControlAnim::drawBorder() { } } -ColorA UIControlAnim::getColor( const ColorA& Col ) { - return ColorA( Col.r, Col.g, Col.b, static_cast( (Float)Col.a * ( mAlpha / 255.f ) ) ); +Color UIControlAnim::getColor( const Color& Col ) { + return Color( Col.r, Col.g, Col.b, static_cast( (Float)Col.a * ( mAlpha / 255.f ) ) ); } void UIControlAnim::updateQuad() { diff --git a/src/eepp/ui/uiimage.cpp b/src/eepp/ui/uiimage.cpp index f635f89d2..0c48b54b6 100644 --- a/src/eepp/ui/uiimage.cpp +++ b/src/eepp/ui/uiimage.cpp @@ -109,11 +109,11 @@ Drawable * UIImage::getDrawable() const { return mDrawable; } -const ColorA& UIImage::getColor() const { +const Color& UIImage::getColor() const { return mColor; } -void UIImage::setColor( const ColorA& col ) { +void UIImage::setColor( const Color& col ) { mColor = col; setAlpha( col.a ); } diff --git a/src/eepp/ui/uilistbox.cpp b/src/eepp/ui/uilistbox.cpp index 89639c8e6..07e356d41 100644 --- a/src/eepp/ui/uilistbox.cpp +++ b/src/eepp/ui/uilistbox.cpp @@ -681,30 +681,30 @@ Uint32 UIListBox::getItemIndex( const String& Text ) { return eeINDEX_NOT_FOUND; } -void UIListBox::setFontColor( const ColorA& Color ) { - mFontStyleConfig.Color = Color; +void UIListBox::setFontColor( const Color& Color ) { + mFontStyleConfig.FontColor = Color; for ( Uint32 i = 0; i < mItems.size(); i++ ) - mItems[i]->setFontColor( mFontStyleConfig.Color ); + mItems[i]->setFontColor( mFontStyleConfig.FontColor ); } -const ColorA& UIListBox::getFontColor() const { - return mFontStyleConfig.Color; +const Color& UIListBox::getFontColor() const { + return mFontStyleConfig.FontColor; } -void UIListBox::setFontOverColor( const ColorA& Color ) { +void UIListBox::setFontOverColor( const Color& Color ) { mFontStyleConfig.FontOverColor = Color; } -const ColorA& UIListBox::getFontOverColor() const { +const Color& UIListBox::getFontOverColor() const { return mFontStyleConfig.FontOverColor; } -void UIListBox::setFontSelectedColor( const ColorA& Color ) { +void UIListBox::setFontSelectedColor( const Color& Color ) { mFontStyleConfig.FontSelectedColor = Color; } -const ColorA& UIListBox::getFontSelectedColor() const { +const Color& UIListBox::getFontSelectedColor() const { return mFontStyleConfig.FontSelectedColor; } @@ -980,7 +980,7 @@ void UIListBox::setFontStyleConfig(const UIFontStyleConfig & fontStyleConfig) { mFontStyleConfig = fontStyleConfig; setFont( mFontStyleConfig.Font ); - setFontColor( mFontStyleConfig.Color ); + setFontColor( mFontStyleConfig.FontColor ); } void UIListBox::update() { @@ -1065,15 +1065,15 @@ void UIListBox::loadFromXmlNode(const pugi::xml_node & node) { if ( "rowheight" == name ) { setRowHeight( ait->as_int() ); } else if ( "textcolor" == name ) { - setFontColor( ColorA::fromString( ait->as_string() ) ); + setFontColor( Color::fromString( ait->as_string() ) ); } else if ( "textshadowcolor" == name ) { - mFontStyleConfig.ShadowColor = ( ColorA::fromString( ait->as_string() ) ); + mFontStyleConfig.ShadowColor = ( Color::fromString( ait->as_string() ) ); } else if ( "textovercolor" == name ) { - setFontOverColor( ColorA::fromString( ait->as_string() ) ); + setFontOverColor( Color::fromString( ait->as_string() ) ); } else if ( "textselectedcolor" == name ) { - setFontSelectedColor( ColorA::fromString( ait->as_string() ) ); + setFontSelectedColor( Color::fromString( ait->as_string() ) ); } else if ( "textselectionbackcolor" == name ) { - mFontStyleConfig.FontSelectionBackColor = ( ColorA::fromString( ait->as_string() ) ); + mFontStyleConfig.FontSelectionBackColor = ( Color::fromString( ait->as_string() ) ); } else if ( "fontfamily" == name || "fontname" == name ) { Font * font = FontManager::instance()->getByName( ait->as_string() ); diff --git a/src/eepp/ui/uiloader.cpp b/src/eepp/ui/uiloader.cpp index c60598420..cc7b47332 100644 --- a/src/eepp/ui/uiloader.cpp +++ b/src/eepp/ui/uiloader.cpp @@ -92,14 +92,14 @@ const Float& UILoader::getRadius() const { return mRadius; } -UILoader * UILoader::setFillColor( const ColorA& color ) { +UILoader * UILoader::setFillColor( const Color& color ) { mColor = color; mArc.setColor( mColor ); mCircle.setColor( mColor ); return this; } -const ColorA& UILoader::getFillColor() const { +const Color& UILoader::getFillColor() const { return mColor; } @@ -171,7 +171,7 @@ void UILoader::loadFromXmlNode(const pugi::xml_node & node) { } else if ( "progress" == name ) { setProgress( ait->as_float() ); } else if ( "fillcolor" == name ) { - setFillColor( ColorA::fromString( ait->as_string() ) ); + setFillColor( Color::fromString( ait->as_string() ) ); } else if ( "radius" == name ) { setRadius( ait->as_float() ); } else if ( "outlinethickness" == name ) { diff --git a/src/eepp/ui/uimanager.cpp b/src/eepp/ui/uimanager.cpp index 6cf085124..ceb67b303 100644 --- a/src/eepp/ui/uimanager.cpp +++ b/src/eepp/ui/uimanager.cpp @@ -343,11 +343,11 @@ bool UIManager::getDrawBoxes() const { return 0 != ( mFlags & UI_MANAGER_DRAW_BOXES ); } -void UIManager::setHighlightFocusColor( const ColorA& Color ) { +void UIManager::setHighlightFocusColor( const Color& Color ) { mHighlightFocusColor = Color; } -const ColorA& UIManager::getHighlightFocusColor() const { +const Color& UIManager::getHighlightFocusColor() const { return mHighlightFocusColor; } @@ -359,11 +359,11 @@ bool UIManager::getHighlightOver() const { return 0 != ( mFlags & UI_MANAGER_HIGHLIGHT_OVER ); } -void UIManager::setHighlightOverColor( const ColorA& Color ) { +void UIManager::setHighlightOverColor( const Color& Color ) { mHighlightOverColor = Color; } -const ColorA& UIManager::getHighlightOverColor() const { +const Color& UIManager::getHighlightOverColor() const { return mHighlightOverColor; } diff --git a/src/eepp/ui/uipushbutton.cpp b/src/eepp/ui/uipushbutton.cpp index e0c5c7f2d..d8a80853a 100644 --- a/src/eepp/ui/uipushbutton.cpp +++ b/src/eepp/ui/uipushbutton.cpp @@ -211,7 +211,7 @@ void UIPushButton::onStateChange() { if ( mSkinState->getState() == UISkinState::StateMouseEnter ) { mTextBox->setFontColor( mStyleConfig.FontOverColor ); } else { - mTextBox->setFontColor( mStyleConfig.Color ); + mTextBox->setFontColor( mStyleConfig.FontColor ); } mTextBox->setAlpha( mAlpha ); @@ -241,29 +241,29 @@ Uint32 UIPushButton::onKeyUp( const UIEventKey& Event ) { return UIWidget::onKeyUp( Event ); } -const ColorA& UIPushButton::getFontColor() const { - return mStyleConfig.Color; +const Color& UIPushButton::getFontColor() const { + return mStyleConfig.FontColor; } -void UIPushButton::setFontColor( const ColorA& color ) { - mStyleConfig.Color = color; +void UIPushButton::setFontColor( const Color& color ) { + mStyleConfig.FontColor = color; onStateChange(); } -const ColorA& UIPushButton::getFontOverColor() const { +const Color& UIPushButton::getFontOverColor() const { return mStyleConfig.FontOverColor; } -void UIPushButton::setFontOverColor( const ColorA& color ) { +void UIPushButton::setFontOverColor( const Color& color ) { mStyleConfig.FontOverColor = color; onStateChange(); } -const ColorA& UIPushButton::getFontShadowColor() const { +const Color& UIPushButton::getFontShadowColor() const { return mTextBox->getFontShadowColor(); } -void UIPushButton::setFontShadowColor( const ColorA& color ) { +void UIPushButton::setFontShadowColor( const Color& color ) { mTextBox->setFontShadowColor( color ); } @@ -293,11 +293,11 @@ UIPushButton * UIPushButton::setOutlineThickness( const Float & outlineThickness return this; } -const ColorA &UIPushButton::getOutlineColor() const { +const Color &UIPushButton::getOutlineColor() const { return mStyleConfig.OutlineColor; } -UIPushButton * UIPushButton::setOutlineColor(const ColorA & outlineColor) { +UIPushButton * UIPushButton::setOutlineColor(const Color & outlineColor) { if ( mStyleConfig.OutlineColor != outlineColor ) { mTextBox->setOutlineColor( outlineColor ); mStyleConfig.OutlineColor = outlineColor; @@ -347,7 +347,7 @@ void UIPushButton::loadFromXmlNode(const pugi::xml_node & node) { if ( "text" == name ) { setText( ait->as_string() ); } else if ( "textovercolor" == name ) { - setFontOverColor( ColorA::fromString( ait->as_string() ) ); + setFontOverColor( Color::fromString( ait->as_string() ) ); } else if ( "icon" == name ) { std::string val = ait->as_string(); Drawable * icon = NULL; diff --git a/src/eepp/ui/uiselectbutton.cpp b/src/eepp/ui/uiselectbutton.cpp index f166786da..20930039d 100644 --- a/src/eepp/ui/uiselectbutton.cpp +++ b/src/eepp/ui/uiselectbutton.cpp @@ -71,16 +71,16 @@ void UISelectButton::onStateChange() { } else if ( mSkinState->getState() == UISkinState::StateMouseEnter ) { getTextBox()->setFontColor( mStyleConfig.FontOverColor ); } else { - getTextBox()->setFontColor( mStyleConfig.Color ); + getTextBox()->setFontColor( mStyleConfig.FontColor ); } } } -void UISelectButton::setFontSelectedColor(const ColorA & color) { +void UISelectButton::setFontSelectedColor(const Color & color) { mStyleConfig.FontSelectedColor = color; } -const ColorA &UISelectButton::getFontSelectedColor() const { +const Color &UISelectButton::getFontSelectedColor() const { return mStyleConfig.FontSelectedColor; } @@ -92,7 +92,7 @@ void UISelectButton::loadFromXmlNode(const pugi::xml_node & node) { String::toLowerInPlace( name ); if ( "textselectedcolor" == name ) { - setFontSelectedColor( ColorA::fromString( ait->as_string() ) ); + setFontSelectedColor( Color::fromString( ait->as_string() ) ); } } } diff --git a/src/eepp/ui/uiskin.cpp b/src/eepp/ui/uiskin.cpp index 6663196bb..908a52743 100644 --- a/src/eepp/ui/uiskin.cpp +++ b/src/eepp/ui/uiskin.cpp @@ -22,7 +22,7 @@ UISkin::UISkin( const std::string& name, const Uint32& Type ) : mNameHash( String::hash( mName ) ), mTheme(NULL) { - ColorA tColor( 255, 255, 255, 255 ); + Color tColor( 255, 255, 255, 255 ); mColorDefault = tColor.getValue(); @@ -38,7 +38,7 @@ Sizei UISkin::getSize() { return getSize( UISkinState::StateNormal ); } -void UISkin::setColor( const Uint32& State, const ColorA& Color ) { +void UISkin::setColor( const Uint32& State, const Color& Color ) { eeASSERT ( State < UISkinState::StateCount ); BitOp::writeBitKey( &mColorDefault, State, 0 ); @@ -46,7 +46,7 @@ void UISkin::setColor( const Uint32& State, const ColorA& Color ) { mColor[ State ] = Color; } -const ColorA& UISkin::getColor( const Uint32& State ) const { +const Color& UISkin::getColor( const Uint32& State ) const { eeASSERT ( State < UISkinState::StateCount ); return mColor[ State ]; diff --git a/src/eepp/ui/uiskincomplex.cpp b/src/eepp/ui/uiskincomplex.cpp index 773c4b5e5..bf82a440b 100644 --- a/src/eepp/ui/uiskincomplex.cpp +++ b/src/eepp/ui/uiskincomplex.cpp @@ -203,7 +203,7 @@ UISkinComplex * UISkinComplex::clone( const std::string& NewName, const bool& Co if ( CopyColorsState ) { SkinC->mColorDefault = mColorDefault; - memcpy( &SkinC->mColor[0], &mColor[0], UISkinState::StateCount * sizeof(ColorA) ); + memcpy( &SkinC->mColor[0], &mColor[0], UISkinState::StateCount * sizeof(Color) ); } memcpy( &SkinC->mDrawable[0], &mDrawable[0], UISkinState::StateCount * SideCount * sizeof(Drawable*) ); diff --git a/src/eepp/ui/uiskinsimple.cpp b/src/eepp/ui/uiskinsimple.cpp index c3e28f8ba..6631a616f 100644 --- a/src/eepp/ui/uiskinsimple.cpp +++ b/src/eepp/ui/uiskinsimple.cpp @@ -61,7 +61,7 @@ UISkinSimple * UISkinSimple::clone( const std::string& NewName, const bool& Copy if ( CopyColorsState ) { SkinS->mColorDefault = mColorDefault; - memcpy( &SkinS->mColor[0], &mColor[0], UISkinState::StateCount * sizeof(ColorA) ); + memcpy( &SkinS->mColor[0], &mColor[0], UISkinState::StateCount * sizeof(Color) ); } memcpy( &SkinS->mDrawable[0], &mDrawable[0], UISkinState::StateCount * sizeof(Drawable*) ); diff --git a/src/eepp/ui/uisprite.cpp b/src/eepp/ui/uisprite.cpp index f9c7e1772..d36d2277c 100644 --- a/src/eepp/ui/uisprite.cpp +++ b/src/eepp/ui/uisprite.cpp @@ -96,14 +96,14 @@ Graphics::Sprite * UISprite::getSprite() const { return mSprite; } -ColorA UISprite::getColor() const { +Color UISprite::getColor() const { if ( NULL != mSprite ) return mSprite->getColor(); - return ColorA(); + return Color(); } -void UISprite::setColor( const ColorA& color ) { +void UISprite::setColor( const Color& color ) { if ( NULL != mSprite ) mSprite->setColor( color ); diff --git a/src/eepp/ui/uisubtexture.cpp b/src/eepp/ui/uisubtexture.cpp index a2aac691e..07d33f2e6 100644 --- a/src/eepp/ui/uisubtexture.cpp +++ b/src/eepp/ui/uisubtexture.cpp @@ -130,11 +130,11 @@ Graphics::SubTexture * UISubTexture::getSubTexture() const { return mSubTexture; } -const ColorA& UISubTexture::getColor() const { +const Color& UISubTexture::getColor() const { return mColor; } -void UISubTexture::setColor( const ColorA& col ) { +void UISubTexture::setColor( const Color& col ) { mColor = col; setAlpha( col.a ); } diff --git a/src/eepp/ui/uitabwidget.cpp b/src/eepp/ui/uitabwidget.cpp index 863a43563..627eef30c 100644 --- a/src/eepp/ui/uitabwidget.cpp +++ b/src/eepp/ui/uitabwidget.cpp @@ -141,11 +141,11 @@ UITabWidget * UITabWidget::setOutlineThickness( const Float & outlineThickness ) return this; } -const ColorA &UITabWidget::getOutlineColor() const { +const Color &UITabWidget::getOutlineColor() const { return mStyleConfig.OutlineColor; } -UITabWidget * UITabWidget::setOutlineColor(const ColorA & outlineColor) { +UITabWidget * UITabWidget::setOutlineColor(const Color & outlineColor) { if ( mStyleConfig.OutlineColor != outlineColor ) { mStyleConfig.OutlineColor = outlineColor; @@ -190,13 +190,13 @@ void UITabWidget::loadFromXmlNode(const pugi::xml_node & node) { String::toLowerInPlace( name ); if ( "textcolor" == name ) { - setFontColor( ColorA::fromString( ait->as_string() ) ); + setFontColor( Color::fromString( ait->as_string() ) ); } else if ( "textshadowcolor" == name ) { - setFontShadowColor( ColorA::fromString( ait->as_string() ) ); + setFontShadowColor( Color::fromString( ait->as_string() ) ); } else if ( "textovercolor" == name ) { - setFontOverColor( ColorA::fromString( ait->as_string() ) ); + setFontOverColor( Color::fromString( ait->as_string() ) ); } else if ( "textselectedcolor" == name ) { - setFontSelectedColor( ColorA::fromString( ait->as_string() ) ); + setFontSelectedColor( Color::fromString( ait->as_string() ) ); } else if ( "fontfamily" == name || "fontname" == name ) { Font * font = FontManager::instance()->getByName( ait->as_string() ); @@ -232,7 +232,7 @@ void UITabWidget::loadFromXmlNode(const pugi::xml_node & node) { } else if ( "fontoutlinethickness" == name ) { setOutlineThickness( PixelDensity::toDpFromString( ait->as_string() ) ); } else if ( "fontoutlinecolor" == name ) { - setOutlineColor( ColorA::fromString( ait->as_string() ) ); + setOutlineColor( Color::fromString( ait->as_string() ) ); } else if ( "maxtextlength" == name ) { setMaxTextLength( ait->as_uint(1) ); } else if ( "mintabwidth" == name ) { @@ -246,7 +246,7 @@ void UITabWidget::loadFromXmlNode(const pugi::xml_node & node) { } else if ( "drawlinebelowtabs" == name ) { setDrawLineBelowTabs( ait->as_bool() ); } else if ( "linebelowtabscolor" == name ) { - setLineBelowTabsColor( ColorA::fromString( ait->as_string() ) ); + setLineBelowTabsColor( Color::fromString( ait->as_string() ) ); } else if ( "linebelowtabsyoffset" == name ) { setLineBelowTabsYOffset( ait->as_int() ); } @@ -267,25 +267,25 @@ void UITabWidget::setFont(Font * font) { } } -ColorA UITabWidget::getFontColor() const { - return mStyleConfig.Color; +Color UITabWidget::getFontColor() const { + return mStyleConfig.FontColor; } -void UITabWidget::setFontColor(const ColorA & fontColor) { - mStyleConfig.Color = fontColor; +void UITabWidget::setFontColor(const Color & fontColor) { + mStyleConfig.FontColor = fontColor; if ( mTabs.size() > 0 ) { for ( Uint32 i = 0; i < mTabs.size(); i++ ) { - ((UITab*)mTabs[ i ])->setFontColor( mStyleConfig.Color ); + ((UITab*)mTabs[ i ])->setFontColor( mStyleConfig.FontColor ); } } } -ColorA UITabWidget::getFontShadowColor() const { +Color UITabWidget::getFontShadowColor() const { return mStyleConfig.ShadowColor; } -void UITabWidget::setFontShadowColor(const ColorA & fontShadowColor) { +void UITabWidget::setFontShadowColor(const Color & fontShadowColor) { mStyleConfig.ShadowColor = fontShadowColor; if ( mTabs.size() > 0 ) { @@ -295,11 +295,11 @@ void UITabWidget::setFontShadowColor(const ColorA & fontShadowColor) { } } -ColorA UITabWidget::getFontOverColor() const { +Color UITabWidget::getFontOverColor() const { return mStyleConfig.FontOverColor; } -void UITabWidget::setFontOverColor(const ColorA & fontOverColor) { +void UITabWidget::setFontOverColor(const Color & fontOverColor) { mStyleConfig.FontOverColor = fontOverColor; if ( mTabs.size() > 0 ) { @@ -309,11 +309,11 @@ void UITabWidget::setFontOverColor(const ColorA & fontOverColor) { } } -ColorA UITabWidget::getFontSelectedColor() const { +Color UITabWidget::getFontSelectedColor() const { return mStyleConfig.FontSelectedColor; } -void UITabWidget::setFontSelectedColor(const ColorA & fontSelectedColor) { +void UITabWidget::setFontSelectedColor(const Color & fontSelectedColor) { mStyleConfig.FontSelectedColor = fontSelectedColor; if ( mTabs.size() > 0 ) { @@ -400,11 +400,11 @@ void UITabWidget::setDrawLineBelowTabs(bool drawLineBelowTabs) { mStyleConfig.DrawLineBelowTabs = drawLineBelowTabs; } -ColorA UITabWidget::getLineBelowTabsColor() const { +Color UITabWidget::getLineBelowTabsColor() const { return mStyleConfig.LineBelowTabsColor; } -void UITabWidget::setLineBelowTabsColor(const ColorA & lineBelowTabsColor) { +void UITabWidget::setLineBelowTabsColor(const Color & lineBelowTabsColor) { mStyleConfig.LineBelowTabsColor = lineBelowTabsColor; } diff --git a/src/eepp/ui/uitextinput.cpp b/src/eepp/ui/uitextinput.cpp index 52882bba8..574227eb9 100644 --- a/src/eepp/ui/uitextinput.cpp +++ b/src/eepp/ui/uitextinput.cpp @@ -92,7 +92,7 @@ void UITextInput::drawWaitingCursor() { GLi->lineSmooth( false ); Primitives P; - P.setColor( mFontStyleConfig.Color ); + P.setColor( mFontStyleConfig.FontColor ); Float CurPosX = mScreenPos.x + mRealAlignOffset.x + mCurPos.x + PixelDensity::dpToPxI( 1.f ) + mRealPadding.Left; Float CurPosY = mScreenPos.y + mRealAlignOffset.y + mCurPos.y + mRealPadding.Top; diff --git a/src/eepp/ui/uitextview.cpp b/src/eepp/ui/uitextview.cpp index 7dee23fcb..e8e79a548 100644 --- a/src/eepp/ui/uitextview.cpp +++ b/src/eepp/ui/uitextview.cpp @@ -27,7 +27,7 @@ UITextView::UITextView() : mTextCache->setFont( mFontStyleConfig.Font ); mTextCache->setCharacterSize( mFontStyleConfig.CharacterSize ); mTextCache->setStyle( mFontStyleConfig.Style ); - mTextCache->setFillColor( mFontStyleConfig.Color ); + mTextCache->setFillColor( mFontStyleConfig.FontColor ); mTextCache->setShadowColor( mFontStyleConfig.ShadowColor ); mTextCache->setOutlineThickness( mFontStyleConfig.OutlineThickness ); mTextCache->setOutlineColor( mFontStyleConfig.OutlineColor ); @@ -119,11 +119,11 @@ UITextView * UITextView::setOutlineThickness( const Float & outlineThickness ) { return this; } -const ColorA &UITextView::getOutlineColor() const { +const Color &UITextView::getOutlineColor() const { return mFontStyleConfig.OutlineColor; } -UITextView * UITextView::setOutlineColor(const ColorA & outlineColor) { +UITextView * UITextView::setOutlineColor(const Color & outlineColor) { if ( mFontStyleConfig.OutlineColor != outlineColor ) { mTextCache->setOutlineColor( outlineColor ); mFontStyleConfig.OutlineColor = outlineColor; @@ -163,12 +163,12 @@ UITextView * UITextView::setText( const String& text ) { return this; } -const ColorA& UITextView::getFontColor() const { - return mFontStyleConfig.Color; +const Color& UITextView::getFontColor() const { + return mFontStyleConfig.FontColor; } -UITextView * UITextView::setFontColor( const ColorA& color ) { - mFontStyleConfig.Color = color; +UITextView * UITextView::setFontColor( const Color& color ) { + mFontStyleConfig.FontColor = color; mTextCache->setFillColor( color ); setAlpha( color.a ); @@ -176,32 +176,32 @@ UITextView * UITextView::setFontColor( const ColorA& color ) { return this; } -const ColorA& UITextView::getFontShadowColor() const { +const Color& UITextView::getFontShadowColor() const { return mFontStyleConfig.ShadowColor; } -UITextView * UITextView::setFontShadowColor( const ColorA& color ) { +UITextView * UITextView::setFontShadowColor( const Color& color ) { mFontStyleConfig.ShadowColor = color; mTextCache->setShadowColor( mFontStyleConfig.ShadowColor ); return this; } -const ColorA& UITextView::getSelectionBackColor() const { +const Color& UITextView::getSelectionBackColor() const { return mFontStyleConfig.FontSelectionBackColor; } -UITextView * UITextView::setSelectionBackColor( const ColorA& color ) { +UITextView * UITextView::setSelectionBackColor( const Color& color ) { mFontStyleConfig.FontSelectionBackColor = color; return this; } void UITextView::setAlpha( const Float& alpha ) { UIControlAnim::setAlpha( alpha ); - mFontStyleConfig.Color.a = (Uint8)alpha; + mFontStyleConfig.FontColor.a = (Uint8)alpha; mFontStyleConfig.ShadowColor.a = (Uint8)alpha; - mTextCache->setAlpha( mFontStyleConfig.Color.a ); + mTextCache->setAlpha( mFontStyleConfig.FontColor.a ); } void UITextView::autoShrink() { @@ -489,15 +489,15 @@ void UITextView::loadFromXmlNode(const pugi::xml_node & node) { if ( "text" == name ) { setText( ait->as_string() ); } else if ( "textcolor" == name ) { - setFontColor( ColorA::fromString( ait->as_string() ) ); + setFontColor( Color::fromString( ait->as_string() ) ); } else if ( "textshadowcolor" == name ) { - setFontShadowColor( ColorA::fromString( ait->as_string() ) ); + setFontShadowColor( Color::fromString( ait->as_string() ) ); } else if ( "textovercolor" == name ) { - mFontStyleConfig.FontOverColor = ColorA::fromString( ait->as_string() ); + mFontStyleConfig.FontOverColor = Color::fromString( ait->as_string() ); } else if ( "textselectedcolor" == name ) { - mFontStyleConfig.FontSelectedColor = ColorA::fromString( ait->as_string() ); + mFontStyleConfig.FontSelectedColor = Color::fromString( ait->as_string() ); } else if ( "textselectionbackcolor" == name ) { - setSelectionBackColor( ColorA::fromString( ait->as_string() ) ); + setSelectionBackColor( Color::fromString( ait->as_string() ) ); } else if ( "fontfamily" == name || "fontname" == name ) { Font * font = FontManager::instance()->getByName( ait->as_string() ); @@ -533,7 +533,7 @@ void UITextView::loadFromXmlNode(const pugi::xml_node & node) { } else if ( "fontoutlinethickness" == name ) { setOutlineThickness( PixelDensity::toDpFromString( ait->as_string() ) ); } else if ( "fontoutlinecolor" == name ) { - setOutlineColor( ColorA::fromString( ait->as_string() ) ); + setOutlineColor( Color::fromString( ait->as_string() ) ); } else if ( "padding" == name ) { int val = PixelDensity::toDpFromStringI( ait->as_string() ); setPadding( Recti( val, val, val, val ) ); diff --git a/src/eepp/ui/uitheme.cpp b/src/eepp/ui/uitheme.cpp index 4460d2294..eedc1d641 100644 --- a/src/eepp/ui/uitheme.cpp +++ b/src/eepp/ui/uitheme.cpp @@ -333,9 +333,9 @@ UITheme::UITheme(const std::string& name, const std::string& Abbr, Graphics::Fon mTextureAtlas( NULL ) { mFontStyleConfig.Font = defaultFont; - mFontStyleConfig.ShadowColor = ColorA( 255, 255, 255, 200 ); - mFontStyleConfig.Color = mFontStyleConfig.FontOverColor = mFontStyleConfig.FontSelectedColor = ColorA( 0, 0, 0, 255 ); - mFontStyleConfig.FontSelectionBackColor = ColorA( 150, 150, 150, 255 ); + mFontStyleConfig.ShadowColor = Color( 255, 255, 255, 200 ); + mFontStyleConfig.FontColor = mFontStyleConfig.FontOverColor = mFontStyleConfig.FontSelectedColor = Color( 0, 0, 0, 255 ); + mFontStyleConfig.FontSelectionBackColor = Color( 150, 150, 150, 255 ); if ( NULL == defaultFont ) { mFontStyleConfig.Font = UIThemeManager::instance()->getDefaultFont(); diff --git a/src/eepp/ui/uithemedefault.cpp b/src/eepp/ui/uithemedefault.cpp index 9a966134c..d783ef8a7 100644 --- a/src/eepp/ui/uithemedefault.cpp +++ b/src/eepp/ui/uithemedefault.cpp @@ -17,18 +17,18 @@ UIThemeDefault::UIThemeDefault( const std::string& name, const std::string& Abbr UITheme( name, Abbr, defaultFont ) { mFontStyleConfig.CharacterSize = 12; - mFontStyleConfig.Color = ColorA( 230, 230, 230, 255 ); - mFontStyleConfig.FontOverColor = mFontStyleConfig.FontSelectedColor = ColorA( 255, 255, 255, 255 ); - mFontStyleConfig.ShadowColor = ColorA( 50, 50, 50, 150 ); - mFontStyleConfig.FontSelectionBackColor = ColorA( 150, 150, 150, 255 ); + mFontStyleConfig.FontColor = Color( 230, 230, 230, 255 ); + mFontStyleConfig.FontOverColor = mFontStyleConfig.FontSelectedColor = Color( 255, 255, 255, 255 ); + mFontStyleConfig.ShadowColor = Color( 50, 50, 50, 150 ); + mFontStyleConfig.FontSelectionBackColor = Color( 150, 150, 150, 255 ); } UITabWidgetStyleConfig UIThemeDefault::getTabWidgetStyleConfig() { UITabWidgetStyleConfig tabWidgetStyleConfig = UITheme::getTabWidgetStyleConfig(); tabWidgetStyleConfig.TabSeparation = -1; - tabWidgetStyleConfig.FontSelectedColor = ColorA( 255, 255, 255, 255 ); + tabWidgetStyleConfig.FontSelectedColor = Color( 255, 255, 255, 255 ); tabWidgetStyleConfig.DrawLineBelowTabs = true; - tabWidgetStyleConfig.LineBelowTabsColor = ColorA( 0, 0, 0, 255 ); + tabWidgetStyleConfig.LineBelowTabsColor = Color( 0, 0, 0, 255 ); tabWidgetStyleConfig.LineBelowTabsYOffset = -1; return tabWidgetStyleConfig; } @@ -52,7 +52,7 @@ UIWindowStyleConfig UIThemeDefault::getWindowStyleConfig() { UIWindowStyleConfig windowStyleConfig = UITheme::getWindowStyleConfig(); windowStyleConfig.WinFlags |= UI_WIN_DRAW_SHADOW; windowStyleConfig.ButtonsPositionFixer.x = -2; - windowStyleConfig.TitleFontColor = ColorA( 230, 230, 230, 255 ); + windowStyleConfig.TitleFontColor = Color( 230, 230, 230, 255 ); return windowStyleConfig; } @@ -61,8 +61,8 @@ UIMenuStyleConfig UIThemeDefault::getMenuStyleConfig() { menuStyleConfig.MinWidth = 100; menuStyleConfig.MinSpaceForIcons = 24; menuStyleConfig.MinRightMargin = 8; - menuStyleConfig.Color = ColorA( 230, 230, 230, 255 ); - menuStyleConfig.FontOverColor = ColorA( 255, 255, 255, 255 ); + menuStyleConfig.FontColor = Color( 230, 230, 230, 255 ); + menuStyleConfig.FontOverColor = Color( 255, 255, 255, 255 ); return menuStyleConfig; } @@ -74,7 +74,7 @@ UISliderStyleConfig UIThemeDefault::getSliderStyleConfig() { UITooltipStyleConfig UIThemeDefault::getTooltipStyleConfig() { UITooltipStyleConfig tooltipStyleConfig = UITheme::getTooltipStyleConfig(); - tooltipStyleConfig.Color = ColorA( 0, 0, 0, 255 ); + tooltipStyleConfig.FontColor = Color( 0, 0, 0, 255 ); tooltipStyleConfig.Padding = Recti( 4, 6, 4, 6 ); return tooltipStyleConfig; } diff --git a/src/eepp/ui/uitooltip.cpp b/src/eepp/ui/uitooltip.cpp index 4ffe6ab40..354daf07d 100644 --- a/src/eepp/ui/uitooltip.cpp +++ b/src/eepp/ui/uitooltip.cpp @@ -126,21 +126,21 @@ void UITooltip::setText( const String& text ) { onTextChanged(); } -const ColorA& UITooltip::getFontColor() const { - return mStyleConfig.Color; +const Color& UITooltip::getFontColor() const { + return mStyleConfig.FontColor; } -void UITooltip::setFontColor( const ColorA& color ) { - mStyleConfig.Color = color; - mTextCache->setFillColor( mStyleConfig.Color ); +void UITooltip::setFontColor( const Color& color ) { + mStyleConfig.FontColor = color; + mTextCache->setFillColor( mStyleConfig.FontColor ); setAlpha( color.a ); } -const ColorA& UITooltip::getFontShadowColor() const { +const Color& UITooltip::getFontShadowColor() const { return mStyleConfig.ShadowColor; } -void UITooltip::setFontShadowColor( const ColorA& color ) { +void UITooltip::setFontShadowColor( const Color& color ) { mStyleConfig.ShadowColor = color; setAlpha( color.a ); mTextCache->setShadowColor( mStyleConfig.ShadowColor ); @@ -148,10 +148,10 @@ void UITooltip::setFontShadowColor( const ColorA& color ) { void UITooltip::setAlpha( const Float& alpha ) { UIControlAnim::setAlpha( alpha ); - mStyleConfig.Color.a = (Uint8)alpha; + mStyleConfig.FontColor.a = (Uint8)alpha; mStyleConfig.ShadowColor.a = (Uint8)alpha; - mTextCache->setFillColor( mStyleConfig.Color ); + mTextCache->setFillColor( mStyleConfig.FontColor ); } void UITooltip::onAutoSize() { @@ -268,7 +268,7 @@ void UITooltip::setStyleConfig(const UITooltipStyleConfig & styleConfig) { setPadding( mStyleConfig.Padding ); setFont( mStyleConfig.Font ); - setFontColor( mStyleConfig.Color ); + setFontColor( mStyleConfig.FontColor ); setFontShadowColor( mStyleConfig.ShadowColor ); mTextCache->setCharacterSize( mStyleConfig.CharacterSize ); mTextCache->setStyle( mStyleConfig.Style ); diff --git a/src/eepp/ui/uiwidget.cpp b/src/eepp/ui/uiwidget.cpp index da209cf7c..786ff5313 100644 --- a/src/eepp/ui/uiwidget.cpp +++ b/src/eepp/ui/uiwidget.cpp @@ -361,9 +361,9 @@ void UIWidget::loadFromXmlNode( const pugi::xml_node& node ) { setInternalHeight( PixelDensity::toDpFromStringI( ait->as_string() ) ); notifyLayoutAttrChange(); } else if ( "backgroundcolor" == name ) { - setBackgroundFillEnabled( true )->setColor( ColorA::fromString( ait->as_string() ) ); + setBackgroundFillEnabled( true )->setColor( Color::fromString( ait->as_string() ) ); } else if ( "bordercolor" == name ) { - setBorderEnabled( true )->setColor( ColorA::fromString( ait->as_string() ) ); + setBorderEnabled( true )->setColor( Color::fromString( ait->as_string() ) ); } else if ( "borderwidth" == name ) { setBorderEnabled( true )->setWidth( PixelDensity::toDpFromStringI( ait->as_string("1") ) ); } else if ( "visible" == name ) { diff --git a/src/eepp/ui/uiwindow.cpp b/src/eepp/ui/uiwindow.cpp index 42a69a615..b20f8d65d 100644 --- a/src/eepp/ui/uiwindow.cpp +++ b/src/eepp/ui/uiwindow.cpp @@ -766,8 +766,8 @@ void UIWindow::draw() { Primitives P; P.setForceDraw( false ); - ColorA BeginC( 0, 0, 0, 25 * ( getAlpha() / (Float)255 ) ); - ColorA EndC( 0, 0, 0, 0 ); + Color BeginC( 0, 0, 0, 25 * ( getAlpha() / (Float)255 ) ); + Color EndC( 0, 0, 0, 0 ); Float SSize = PixelDensity::dpToPx( 16.f ); Vector2i ShadowPos = mScreenPos + Vector2i( 0, 16 ); diff --git a/src/eepp/window/platform/x11/cursorx11.cpp b/src/eepp/window/platform/x11/cursorx11.cpp index f3c03814d..142cf2853 100644 --- a/src/eepp/window/platform/x11/cursorx11.cpp +++ b/src/eepp/window/platform/x11/cursorx11.cpp @@ -56,7 +56,7 @@ void CursorX11::create() { c = 0; for ( iy = 0; iy < mImage->getHeight(); iy++ ) { for ( ix = 0; ix < mImage->getWidth(); ix++ ) { - ColorA C = mImage->getPixel( ix, iy ); + Color C = mImage->getPixel( ix, iy ); image->pixels[c++] = ( C.a << 24 ) | ( C.r << 16 ) | ( C.g <<8 ) | ( C.b ); } diff --git a/src/examples/empty_window/empty_window.cpp b/src/examples/empty_window/empty_window.cpp index d9ede8885..521b57338 100644 --- a/src/examples/empty_window/empty_window.cpp +++ b/src/examples/empty_window/empty_window.cpp @@ -11,7 +11,7 @@ void mainLoop() Primitives p; // Change the color - p.setColor( ColorA( 0, 255, 0, 150 ) ); + p.setColor( Color( 0, 255, 0, 150 ) ); // Update the input win->getInput()->update(); @@ -38,7 +38,7 @@ EE_MAIN_FUNC int main (int argc, char * argv []) // Check if created if ( win->isOpen() ) { // Set window background color - win->setClearColor( Color( 50, 50, 50 ) ); + win->setClearColor( RGB( 50, 50, 50 ) ); // Set the MainLoop function and run it // This is the application loop, it will loop until the window is closed. diff --git a/src/examples/fonts/fonts.cpp b/src/examples/fonts/fonts.cpp index 090cd1cd4..4ba849781 100644 --- a/src/examples/fonts/fonts.cpp +++ b/src/examples/fonts/fonts.cpp @@ -40,7 +40,7 @@ EE_MAIN_FUNC int main (int argc, char * argv []) { win = Engine::instance()->createWindow( WindowSettings( 960, 640, "eepp - Fonts" ), ContextSettings( true ) ); // Set window background color - win->setClearColor( Color(230,230,230) ); + win->setClearColor( RGB(230,230,230) ); // Check if created if ( win->isOpen() ) { @@ -64,7 +64,7 @@ EE_MAIN_FUNC int main (int argc, char * argv []) { size_t size = Txt.size(); for ( size_t i = 0; i < size; i++ ) { - text.setFillColor( ColorA(255*i/size,0,0,255), i, i+1 ); + text.setFillColor( Color(255*i/size,0,0,255), i, i+1 ); } fontTest2 = FontTrueType::New( "Arial" ); @@ -79,8 +79,8 @@ EE_MAIN_FUNC int main (int argc, char * argv []) { text3.setString( text2.getString() ); text3.setOutlineThickness( 2 ); text3.setCharacterSize( 24 ); - text3.setFillColor( ColorA(255,255,255,255) ); - text3.setOutlineColor( ColorA(0,0,0,255) ); + text3.setFillColor( Color(255,255,255,255) ); + text3.setOutlineColor( Color(0,0,0,255) ); // Application loop win->runMainLoop( &mainLoop ); diff --git a/src/examples/sprites/sprites.cpp b/src/examples/sprites/sprites.cpp index d9184571c..89232f325 100644 --- a/src/examples/sprites/sprites.cpp +++ b/src/examples/sprites/sprites.cpp @@ -77,11 +77,11 @@ void mainLoop() Blindy.draw(); // Draw the Rock Axis-Aligned Bounding Box - P.setColor( ColorA( 255, 255, 255, 255 ) ); + P.setColor( Color( 255, 255, 255, 255 ) ); P.drawRectangle( Rock.getAABB() ); // Draw the Rock Quad - P.setColor( ColorA( 255, 0, 0, 255 ) ); + P.setColor( Color( 255, 0, 0, 255 ) ); P.drawQuad( Rock.getQuad() ); // Draw frame diff --git a/src/examples/vbo_fbo_batch/vbo_fbo_batch.cpp b/src/examples/vbo_fbo_batch/vbo_fbo_batch.cpp index 0039f7017..f25d6b692 100644 --- a/src/examples/vbo_fbo_batch/vbo_fbo_batch.cpp +++ b/src/examples/vbo_fbo_batch/vbo_fbo_batch.cpp @@ -51,7 +51,7 @@ void mainLoop() // Draw the frame buffer many times for ( int y = 0; y < 5; y++ ) { for ( int x = 0; x < 5; x++ ) { - FBO->getTexture()->draw( x * 200, y * 200, -ang, Vector2f::One, ColorA(255,255,255,100) ); + FBO->getTexture()->draw( x * 200, y * 200, -ang, Vector2f::One, Color(255,255,255,100) ); } } @@ -84,7 +84,7 @@ void mainLoop() Float tmpy = (Float)y * 32.f; // Add the quad to the batch - Batch->quadsSetColor( ColorA( z * 16, 255, 255, 150 ) ); + Batch->quadsSetColor( Color( z * 16, 255, 255, 150 ) ); Batch->batchQuadFree( TmpQuad[0].x + tmpx, TmpQuad[0].y + tmpy, TmpQuad[1].x + tmpx, TmpQuad[1].y + tmpy, TmpQuad[2].x + tmpx, TmpQuad[2].y + tmpy, TmpQuad[3].x + tmpx, TmpQuad[3].y + tmpy ); } } @@ -131,14 +131,14 @@ EE_MAIN_FUNC int main (int argc, char * argv []) if ( NULL != VBO && NULL != VBO2 ) { for ( Uint32 i = 0; i < Poly.getSize(); i++ ) { VBO->addVertex( Poly[i] ); - VBO->addColor( ColorA( 100 + i, 255 - i, 150 + i, 100 ) ); + VBO->addColor( Color( 100 + i, 255 - i, 150 + i, 100 ) ); } Poly.rotate( 90, Poly.toAABB().getCenter() ); for ( Uint32 i = 0; i < Poly.getSize(); i++ ) { VBO2->addVertex( Poly[i] ); - VBO2->addColor( ColorA( 100 + i, 255 - i, 150 + i, 100 ) ); + VBO2->addColor( Color( 100 + i, 255 - i, 150 + i, 100 ) ); } // Compile the Vertex Buffer, this uploads the data to the GPU diff --git a/src/test/eetest.cpp b/src/test/eetest.cpp index 182fe1e5d..1d327c6f2 100644 --- a/src/test/eetest.cpp +++ b/src/test/eetest.cpp @@ -139,7 +139,7 @@ void EETest::init() { if ( NULL != mVBO ) { for ( Uint32 i = 0; i < Poly.getSize(); i++ ) { mVBO->addVertex( Poly[i] ); - mVBO->addColor( ColorA( 100 + i, 255 - i, 150 + i, 200 ) ); + mVBO->addColor( Color( 100 + i, 255 - i, 150 + i, 200 ) ); } mVBO->compile(); @@ -207,12 +207,12 @@ void EETest::onFontLoaded( ResourceLoader * ObjLoaded ) { mEEText.create( TTF, "Entropia Engine++\nCTRL + Number to change Demo Screen\nRight click to see the PopUp Menu" ); mEEText.setOutlineThickness( 1 ); - mEEText.setOutlineColor( ColorA(0,0,0,255) ); + mEEText.setOutlineColor( Color(0,0,0,255) ); mFBOText.create( TTF, "This is a VBO\nInside of a FBO" ); mFBOText.setOutlineThickness( 1 ); - mFBOText.setOutlineColor( ColorA(0,0,0,255) ); + mFBOText.setOutlineColor( Color(0,0,0,255) ); - mInfoText.create( DBSM, "", ColorA(100,100,100,255) ); + mInfoText.create( DBSM, "", Color(100,100,100,255) ); mInfoText.setOutlineThickness( 1 ); } @@ -718,7 +718,7 @@ void EETest::createNewUI() { UIManager::instance()->loadLayoutFromString( "" " " - " " + " " " " " " " " @@ -1061,7 +1061,7 @@ void EETest::loadTextures() { Tiles[7] = SG->Add( TF->loadFromPixels( tImg.getPixelsPtr(), tImg.getWidth(), tImg.getHeight(), tImg.getChannels() ), "8" ); #else Tiles[7] = SG->add( TF->loadFromFile( MyPath + "sprites/objects/2.png" ), "8" ); - Tiles[7]->getTexture()->createMaskFromColor( ColorA(0,0,0,255), 0 ); + Tiles[7]->getTexture()->createMaskFromColor( Color(0,0,0,255), 0 ); #endif } @@ -1088,12 +1088,12 @@ void EETest::loadTextures() { for ( y = 0; y < h; y++) { for ( x = 0; x < w; x++) { - ColorA C = Tex->getPixel(x, y); + Color C = Tex->getPixel(x, y); if ( C.r > 200 && C.g > 200 && C.b > 200 ) - Tex->setPixel(x, y, ColorA( Math::randi(0, 255), Math::randi(0, 255), Math::randi(0, 255), C.a ) ); + Tex->setPixel(x, y, Color( Math::randi(0, 255), Math::randi(0, 255), Math::randi(0, 255), C.a ) ); else - Tex->setPixel(x, y, ColorA( Math::randi(200, 255), Math::randi(200, 255), Math::randi(200, 255), C.a ) ); + Tex->setPixel(x, y, Color( Math::randi(200, 255), Math::randi(200, 255), Math::randi(200, 255), C.a ) ); } } @@ -1115,7 +1115,7 @@ void EETest::loadTextures() { CL1.setScale( 0.5f ); CL2.addFrame(TN[0], Sizef(96, 96) ); - CL2.setColor( ColorA( 255, 255, 255, 255 ) ); + CL2.setColor( Color( 255, 255, 255, 255 ) ); mTGL = eeNew( TextureAtlasLoader, ( MyPath + "atlases/bnb" + EE_TEXTURE_ATLAS_EXTENSION ) ); @@ -1174,7 +1174,7 @@ void EETest::screen2() { Batch.setTexture( TNP[2] ); Batch.quadsBegin(); - Batch.quadsSetColor( ColorA(150,150,150,100) ); + Batch.quadsSetColor( Color(150,150,150,100) ); Batch.quadsSetSubset( 0.0f, 0.0f, 0.5f, 0.5f ); Batch.setBatchRotation( ang ); @@ -1232,10 +1232,10 @@ void EETest::screen2() { if ( mUseShaders ) mShaderProgram->unbind(); - TNP[3]->draw( HWidth - 128, HHeight, 0, Vector2f::One, ColorA(255,255,255,150), ALPHA_NORMAL, RN_ISOMETRIC); - TNP[3]->draw( HWidth - 128, HHeight - 128, 0, Vector2f::One, ColorA(255,255,255,50), ALPHA_NORMAL, RN_ISOMETRIC); - TNP[3]->draw( HWidth - 128, HHeight, 0, Vector2f::One, ColorA(255,255,255,50), ALPHA_NORMAL, RN_ISOMETRICVERTICAL); - TNP[3]->draw( HWidth, HHeight, 0, Vector2f::One, ColorA(255,255,255,50), ALPHA_NORMAL, RN_ISOMETRICVERTICALNEGATIVE); + TNP[3]->draw( HWidth - 128, HHeight, 0, Vector2f::One, Color(255,255,255,150), ALPHA_NORMAL, RN_ISOMETRIC); + TNP[3]->draw( HWidth - 128, HHeight - 128, 0, Vector2f::One, Color(255,255,255,50), ALPHA_NORMAL, RN_ISOMETRIC); + TNP[3]->draw( HWidth - 128, HHeight, 0, Vector2f::One, Color(255,255,255,50), ALPHA_NORMAL, RN_ISOMETRICVERTICAL); + TNP[3]->draw( HWidth, HHeight, 0, Vector2f::One, Color(255,255,255,50), ALPHA_NORMAL, RN_ISOMETRICVERTICALNEGATIVE); alpha = (!aside) ? alpha+et.asMilliseconds() * 0.1f : alpha-et.asMilliseconds() * 0.1f; if (alpha>=255) { @@ -1246,7 +1246,7 @@ void EETest::screen2() { aside = false; } - ColorA Col(255,255,255,(int)alpha); + Color 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.setPosition( Vector2f( alpha, alpha ) ); @@ -1256,15 +1256,15 @@ void EETest::screen2() { CL1.setRenderMode( RN_ISOMETRIC ); if ( CL1.getAABB().intersectCircle( Mousef, 80.f ) ) - CL1.setColor( ColorA(255, 0, 0, 200) ); + CL1.setColor( Color(255, 0, 0, 200) ); else - CL1.setColor( ColorA(255, 255, 255, 200) ); + CL1.setColor( Color(255, 255, 255, 200) ); if ( Polygon2f::intersectQuad2( CL1.getQuad() , CL2.getQuad() ) ) { - CL1.setColor( ColorA(0, 255, 0, 255) ); - CL2.setColor( ColorA(0, 255, 0, 255) ); + CL1.setColor( Color(0, 255, 0, 255) ); + CL2.setColor( Color(0, 255, 0, 255) ); } else - CL2.setColor( ColorA(255, 255, 255, 255) ); + CL2.setColor( Color(255, 255, 255, 255) ); CL1.setRotation(ang); CL1.setScale(scale * 0.5f); @@ -1287,7 +1287,7 @@ void EETest::screen2() { if ( ShowParticles ) particles(); - PR.setColor( ColorA(0, 255, 0, 50) ); + PR.setColor( Color(0, 255, 0, 50) ); Line2f Line( Vector2f(0.f, 0.f), Vector2f( (Float)mWindow->getWidth(), (Float)mWindow->getHeight() ) ); Line2f Line2( Vector2f(Mousef.x - 80.f, Mousef.y - 80.f), Vector2f(Mousef.x + 80.f, Mousef.y + 80.f) ); @@ -1305,11 +1305,11 @@ void EETest::screen2() { iL2 = false; if (iL1 && iL2) - PR.setColor( ColorA(255, 0, 0, 255) ); + PR.setColor( Color(255, 0, 0, 255) ); else if (iL1) - PR.setColor( ColorA(0, 0, 255, 255) ); + PR.setColor( Color(0, 0, 255, 255) ); else if (iL2) - PR.setColor( ColorA(255, 255, 0, 255) ); + PR.setColor( Color(255, 255, 0, 255) ); PR.setFillMode( DRAW_LINE ); PR.drawCircle( Vector2f( Mousef.x, Mousef.y ), 80.f, (Uint32)(Ang/3) ); @@ -1318,15 +1318,15 @@ void EETest::screen2() { 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.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.drawQuad( Quad2f( Vector2f(0.f, 0.f), Vector2f(0.f, 100.f), Vector2f(150.f, 150.f), Vector2f(200.f, 150.f) ), Color(220, 240, 0, 125), Color(100, 0, 240, 125), Color(250, 50, 25, 125), Color(50, 150, 150, 125) ); 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() ) ) ); - TNP[3]->drawQuadEx( Quad2f( Vector2f(0.f, 0.f), Vector2f(0.f, 100.f), Vector2f(150.f, 150.f), Vector2f(200.f, 150.f) ), Vector2f(), ang, Vector2f(scale,scale), ColorA(220, 240, 0, 125), ColorA(100, 0, 240, 125), ColorA(250, 50, 25, 125), ColorA(50, 150, 150, 125) ); + TNP[3]->drawQuadEx( Quad2f( Vector2f(0.f, 0.f), Vector2f(0.f, 100.f), Vector2f(150.f, 150.f), Vector2f(200.f, 150.f) ), Vector2f(), ang, Vector2f(scale,scale), Color(220, 240, 0, 125), Color(100, 0, 240, 125), Color(250, 50, 25, 125), Color(50, 150, 150, 125) ); WP.update( et ); - PR.setColor( ColorA(0, 255, 0, 255) ); + PR.setColor( Color(0, 255, 0, 255) ); PR.drawPoint( WP.getPos(), 10.f ); } @@ -1409,11 +1409,11 @@ void EETest::render() { mInfoText.setString( mInfo ); if ( mWindow->getClearColor().r == 0 ) { - mInfoText.setFillColor( ColorA(255,255,255,255) ); - mInfoText.setOutlineColor( ColorA(0,0,0,255) ); + mInfoText.setFillColor( Color(255,255,255,255) ); + mInfoText.setOutlineColor( Color(0,0,0,255) ); } else { - mInfoText.setFillColor( ColorA(0,0,0,255) ); - mInfoText.setOutlineColor( ColorA(255,255,255,255) ); + mInfoText.setFillColor( Color(0,0,0,255) ); + mInfoText.setOutlineColor( Color(255,255,255,255) ); } } @@ -1439,14 +1439,14 @@ void EETest::render() { GLi->getClippingMask()->clipDisable(); } - ColorA ColRR1( 150, 150, 150, 220 ); - ColorA ColRR4( 150, 150, 150, 220 ); - ColorA ColRR2( 100, 100, 100, 220 ); - ColorA ColRR3( 100, 100, 100, 220 ); + Color ColRR1( 150, 150, 150, 220 ); + Color ColRR4( 150, 150, 150, 220 ); + Color ColRR2( 100, 100, 100, 220 ); + Color ColRR3( 100, 100, 100, 220 ); mEEText.setAlign( TEXT_ALIGN_CENTER ); - PR.setColor( ColorA(150, 150, 150, 220) ); + PR.setColor( Color(150, 150, 150, 220) ); PR.setFillMode( DRAW_FILL ); PR.drawRectangle( Rectf(