mirror of
https://github.com/SpartanJ/eepp.git
synced 2026-05-31 02:26:29 +03:00
Color now is RGB.
ColorA now is Color. --HG-- branch : dev
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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);
|
||||
};
|
||||
|
||||
}}
|
||||
|
||||
@@ -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 );
|
||||
};
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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.
|
||||
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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<Float>& 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<VertexCoords> mVertices;
|
||||
std::vector<ColorA> mColors;
|
||||
std::vector<Color> mColors;
|
||||
|
||||
std::vector<VertexCoords> mOutlineVertices;
|
||||
std::vector<ColorA> mOutlineColors;
|
||||
std::vector<Color> mOutlineColors;
|
||||
std::vector<Float> mLinesWidth;
|
||||
|
||||
void ensureGeometryUpdate();
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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;
|
||||
};
|
||||
|
||||
}}
|
||||
|
||||
@@ -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 );
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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 );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -9,13 +9,13 @@ namespace EE { namespace System {
|
||||
|
||||
/** @brief Template class for a RGB color */
|
||||
template<typename T>
|
||||
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<T>( Col >> 16 );
|
||||
@@ -43,18 +43,18 @@ class tColor {
|
||||
b = static_cast<T>( Col >> 0 );
|
||||
}
|
||||
|
||||
bool operator==( const tColor<T>& Col ) {
|
||||
bool operator==( const tRGB<T>& Col ) {
|
||||
return ( r == Col.r && g == Col.g && b == Col.b );
|
||||
}
|
||||
|
||||
bool operator!=( const tColor<T>& Col ) {
|
||||
bool operator!=( const tRGB<T>& Col ) {
|
||||
return !( r == Col.r && g == Col.g && b == Col.b );
|
||||
}
|
||||
};
|
||||
|
||||
/** @brief Template class for a RGBA color */
|
||||
template<typename T>
|
||||
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<T>& Col ) :
|
||||
tColor( const tRGB<T>& 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<T>& Col, T a ) :
|
||||
tColor( const tRGB<T>& Col, T a ) :
|
||||
r( Col.r ),
|
||||
g( Col.g ),
|
||||
b( Col.b ),
|
||||
@@ -111,13 +111,13 @@ class tColorA {
|
||||
{
|
||||
}
|
||||
|
||||
tColorA( const tColorA<T>& Col ) :
|
||||
tColor( const tColor<T>& 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<T>& Col ) {
|
||||
void assign( const tColor<T>& Col ) {
|
||||
Value = Col.Value;
|
||||
}
|
||||
|
||||
bool operator==( const tColorA<T>& Col ) const {
|
||||
bool operator==( const tColor<T>& Col ) const {
|
||||
return ( r == Col.r && g == Col.g && b == Col.b && a == Col.a );
|
||||
}
|
||||
|
||||
bool operator!=( const tColorA<T>& Col ) const {
|
||||
bool operator!=( const tColor<T>& Col ) const {
|
||||
return !(*this == Col);
|
||||
}
|
||||
|
||||
tColorA<T> operator+( const tColorA<T>& Col ) const {
|
||||
return tColorA<T>( eemin( this->r + Col.r , 255 ),
|
||||
tColor<T> operator+( const tColor<T>& Col ) const {
|
||||
return tColor<T>( 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<T> operator-( const tColorA<T>& Col ) const {
|
||||
return tColorA<T>( eemax( this->r - Col.r , 0 ),
|
||||
tColor<T> operator-( const tColor<T>& Col ) const {
|
||||
return tColor<T>( 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<T> operator*( const tColorA<T>& Col ) const {
|
||||
return tColorA<T>( ( this->r * Col.r / 255 ),
|
||||
tColor<T> operator*( const tColor<T>& Col ) const {
|
||||
return tColor<T>( ( this->r * Col.r / 255 ),
|
||||
( this->g * Col.g / 255 ),
|
||||
( this->b * Col.b / 255 ),
|
||||
( this->a * Col.a / 255 )
|
||||
);
|
||||
}
|
||||
|
||||
tColor<T> toColor() {
|
||||
return tColor<T>( r, g, b );
|
||||
tRGB<T> toRGB() {
|
||||
return tRGB<T>( r, g, b );
|
||||
}
|
||||
};
|
||||
|
||||
class EE_API ColorA : public tColorA<Uint8>
|
||||
|
||||
typedef tColor<Float> ColorAf;
|
||||
|
||||
class EE_API Color : public tColor<Uint8>
|
||||
{
|
||||
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<Uint8>& Col );
|
||||
Color( const tRGB<Uint8>& Col );
|
||||
|
||||
ColorA( const tColor<Uint8>& Col, Uint8 a );
|
||||
Color( const tRGB<Uint8>& Col, Uint8 a );
|
||||
|
||||
ColorA( const tColorA<Uint8>& Col );
|
||||
Color( const tColor<Uint8>& 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<Float> Colorf;
|
||||
typedef tColorA<Float> ColorAf;
|
||||
typedef tColorA<float> ColorAff;
|
||||
typedef Color ColorA;
|
||||
typedef tColor<Float> ColorAf;
|
||||
|
||||
//! @brief Small class to help in some color operations
|
||||
class EE_API Color : public tColor<Uint8> {
|
||||
class EE_API RGB : public tRGB<Uint8> {
|
||||
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<Uint8>& color );
|
||||
RGB( const tRGB<Uint8>& 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;
|
||||
};
|
||||
|
||||
}}
|
||||
|
||||
@@ -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<ColorA>& getColors();
|
||||
const std::vector<Color>& 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<ColorA> mColor;
|
||||
std::vector<Color> mColor;
|
||||
|
||||
EE_BLEND_MODE mBlendMode;
|
||||
unsigned int mCorners;
|
||||
|
||||
@@ -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;
|
||||
};
|
||||
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -60,17 +60,17 @@ class EE_API UIListBox : public UIWidget {
|
||||
|
||||
std::list<UIListBoxItem *> 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 );
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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 );
|
||||
|
||||
@@ -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 ];
|
||||
|
||||
|
||||
@@ -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 );
|
||||
};
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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 );
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
@@ -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 );
|
||||
}
|
||||
|
||||
|
||||
@@ -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<Uint8>(mA) ) );
|
||||
mPri.setColor( Color( mConColor.r, mConColor.g, mConColor.b, static_cast<Uint8>(mA) ) );
|
||||
mPri.drawRectangle( Rectf( Vector2f( 0.0f, 0.0f ), Sizef( mWidth, mY ) ) );
|
||||
} else {
|
||||
ColorA C( mConColor.r, mConColor.g, mConColor.b, static_cast<Uint8>(mA) );
|
||||
Color C( mConColor.r, mConColor.g, mConColor.b, static_cast<Uint8>(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<Uint8>(mA) ) );
|
||||
mPri.setColor( Color( mConLineColor.r, mConLineColor.g, mConLineColor.b, static_cast<Uint8>(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<Uint8>(mA) ) );
|
||||
text.setFillColor( Color( mFontStyleConfig.FontColor.r, mFontStyleConfig.FontColor.g, mFontStyleConfig.FontColor.b, static_cast<Uint8>(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<Uint8>(mA) ) );
|
||||
text.setFillColor( Color( mFontLineColor.r, mFontLineColor.g, mFontLineColor.b, static_cast<Uint8>(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<Uint8>(mCurAlpha) ) );
|
||||
text2.setFillColor( Color( mFontLineColor.r, mFontLineColor.g, mFontLineColor.b, static_cast<Uint8>(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 );
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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 );
|
||||
|
||||
@@ -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 );
|
||||
|
||||
@@ -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<void*>( &mPixels[0] ), reinterpret_cast<const void*> ( data ), mSize );
|
||||
}
|
||||
@@ -384,19 +384,19 @@ const Uint8* Image::getPixelsPtr() {
|
||||
return reinterpret_cast<const Uint8*> (&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 ) );
|
||||
}
|
||||
|
||||
@@ -353,7 +353,7 @@ void ParticleSystem::draw() {
|
||||
P = &mParticle[i];
|
||||
|
||||
if ( P->isUsed() ) {
|
||||
BR->quadsSetColor( ColorA( static_cast<Uint8> ( P->r() * 255 ), static_cast<Uint8> ( P->g() * 255 ), static_cast<Uint8>( P->b() * 255 ), static_cast<Uint8>( P->a() * 255 ) ) );
|
||||
BR->quadsSetColor( Color( static_cast<Uint8> ( P->r() * 255 ), static_cast<Uint8> ( P->g() * 255 ), static_cast<Uint8>( P->b() * 255 ), static_cast<Uint8>( P->a() * 255 ) ) );
|
||||
BR->batchQuad( P->getX() - mHSize, P->getY() - mHSize, mSize, mSize );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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<ColorA> colors( circleVAR_count - 1 ,mColor );
|
||||
std::vector<Color> 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;
|
||||
}
|
||||
|
||||
@@ -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 );
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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<ColorA> colors( GLi->quadVertexs(), color );
|
||||
std::vector<Color> 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
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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 );
|
||||
}
|
||||
|
||||
@@ -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 );
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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 ) {
|
||||
|
||||
@@ -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 );
|
||||
}
|
||||
|
||||
|
||||
@@ -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 );
|
||||
}
|
||||
|
||||
|
||||
@@ -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 );
|
||||
}
|
||||
|
||||
|
||||
@@ -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 );
|
||||
|
||||
@@ -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 ),
|
||||
|
||||
@@ -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 );
|
||||
|
||||
@@ -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() ) );
|
||||
|
||||
@@ -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 );
|
||||
}
|
||||
|
||||
@@ -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 );
|
||||
|
||||
@@ -138,8 +138,8 @@ UIMapNew::UIMapNew( UIMap * Map, cb::Callback0<void> 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();
|
||||
|
||||
@@ -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 );
|
||||
}
|
||||
|
||||
|
||||
@@ -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) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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<Uint8>( (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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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 ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -104,7 +104,7 @@ void DampedSpring::draw() {
|
||||
GLi->disable( GL_TEXTURE_2D );
|
||||
GLi->disableClientState( GL_TEXTURE_COORD_ARRAY );
|
||||
|
||||
std::vector<ColorA> tcolors( springVAR_count * 4, ColorA( 0, 255, 0, 255 ) );
|
||||
std::vector<Color> tcolors( springVAR_count * 4, Color( 0, 255, 0, 255 ) );
|
||||
GLi->colorPointer( 4, GL_UNSIGNED_BYTE, 0, reinterpret_cast<const void*>( &tcolors[0] ), springVAR_count * 4 );
|
||||
GLi->vertexPointer( 2, GL_FLOAT, 0, springVAR, springVAR_count * sizeof(float) * 2 );
|
||||
|
||||
|
||||
@@ -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 );
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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 ) ) );
|
||||
|
||||
@@ -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 );
|
||||
|
||||
@@ -97,7 +97,7 @@ void ShapeSegment::draw( Space * space ) {
|
||||
GLi->disable( GL_TEXTURE_2D );
|
||||
GLi->disableClientState( GL_TEXTURE_COORD_ARRAY );
|
||||
|
||||
std::vector<ColorA> tcolors( pillVAR_count * 4 );
|
||||
std::vector<Color> 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<const void*>( &tcolors[0] ), pillVAR_count * 4 );
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
#include <eepp/system/color.hpp>
|
||||
#include <eepp/core/string.hpp>
|
||||
#include <cstdlib>
|
||||
|
||||
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<Uint8>()
|
||||
RGB::RGB() : tRGB<Uint8>()
|
||||
{
|
||||
}
|
||||
|
||||
@@ -33,16 +31,16 @@ Color::Color() : tColor<Uint8>()
|
||||
** @param g Green component
|
||||
** @param b Blue component
|
||||
*/
|
||||
Color::Color( Uint8 r, Uint8 g, Uint8 b ) : tColor<Uint8>( r, g, b )
|
||||
RGB::RGB( Uint8 r, Uint8 g, Uint8 b ) : tRGB<Uint8>( r, g, b )
|
||||
{
|
||||
}
|
||||
|
||||
Color::Color( const tColor<Uint8>& color ) :
|
||||
tColor<Uint8>( color.r, color.g, color.b )
|
||||
RGB::RGB( const tRGB<Uint8>& color ) :
|
||||
tRGB<Uint8>( color.r, color.g, color.b )
|
||||
{
|
||||
}
|
||||
|
||||
Color::Color( Uint32 Col )
|
||||
RGB::RGB( Uint32 Col )
|
||||
{
|
||||
Col = BitOp::swapLE32( Col );
|
||||
r = static_cast<Uint8>( Col >> 16 );
|
||||
@@ -50,6 +48,10 @@ Color::Color( Uint32 Col )
|
||||
b = static_cast<Uint8>( 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<Uint8>()
|
||||
Color::Color() :
|
||||
tColor<Uint8>()
|
||||
{}
|
||||
|
||||
ColorA::ColorA(Uint8 r, Uint8 g, Uint8 b, Uint8 a) :
|
||||
tColorA<Uint8>(r,g,b,a)
|
||||
Color::Color(Uint8 r, Uint8 g, Uint8 b, Uint8 a) :
|
||||
tColor<Uint8>(r,g,b,a)
|
||||
{}
|
||||
|
||||
ColorA::ColorA( const tColor<Uint8>& Col ) :
|
||||
tColorA<Uint8>( Col )
|
||||
Color::Color( const tRGB<Uint8>& Col ) :
|
||||
tColor<Uint8>( Col )
|
||||
{}
|
||||
|
||||
ColorA::ColorA( const tColor<Uint8>& Col, Uint8 a ) :
|
||||
tColorA<Uint8>( Col, a )
|
||||
Color::Color( const tRGB<Uint8>& Col, Uint8 a ) :
|
||||
tColor<Uint8>( Col, a )
|
||||
{}
|
||||
|
||||
ColorA::ColorA( const tColorA<Uint8>& Col ) :
|
||||
tColorA<Uint8>( Col.Value )
|
||||
Color::Color( const tColor<Uint8>& Col ) :
|
||||
tColor<Uint8>( Col.Value )
|
||||
{}
|
||||
|
||||
ColorA::ColorA( const Uint32& Col ) :
|
||||
tColorA<Uint8>( Col )
|
||||
Color::Color( const Uint32& Col ) :
|
||||
tColor<Uint8>( 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 ) );
|
||||
}
|
||||
|
||||
}}
|
||||
|
||||
@@ -57,7 +57,7 @@ TextureAtlasEditor::TextureAtlasEditor( UIWindow * AttatchTo, const TGEditorClos
|
||||
" </WinMenu>"
|
||||
" <LinearLayout layout_width='match_parent' layout_height='match_parent' orientation='horizontal'>"
|
||||
" <TextureAtlasSubTextureEditor layout_width='match_parent' layout_height='match_parent' layout_weight='1' "
|
||||
" flags='clip' backgroundColor='00000032' borderWidth='1' borderColor='000000FF' />"
|
||||
" flags='clip' backgroundColor='#00000032' borderWidth='1' borderColor='#000000FF' />"
|
||||
" <LinearLayout orientation='vertical' layout_width='205dp' layout_height='match_parent' layout_marginLeft='8dp' layout_marginRight='8dp'>"
|
||||
" <TextView text='SubTexture List:' fontStyle='shadow' layout_marginTop='4dp' layout_marginBottom='8dp' />"
|
||||
" <ListBox id='SubTextureList' layout_width='match_parent' layout_height='144dp' />"
|
||||
|
||||
@@ -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 );
|
||||
|
||||
@@ -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<ColorA>& UIBackground::getColors() {
|
||||
const std::vector<Color>& UIBackground::getColors() {
|
||||
return mColor;
|
||||
}
|
||||
|
||||
UIBackground * UIBackground::setColor( const ColorA& Col ) {
|
||||
UIBackground * UIBackground::setColor( const Color& Col ) {
|
||||
mColor[0] = Col;
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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() );
|
||||
}
|
||||
|
||||
@@ -416,8 +416,8 @@ void UIControlAnim::drawBorder() {
|
||||
}
|
||||
}
|
||||
|
||||
ColorA UIControlAnim::getColor( const ColorA& Col ) {
|
||||
return ColorA( Col.r, Col.g, Col.b, static_cast<Uint8>( (Float)Col.a * ( mAlpha / 255.f ) ) );
|
||||
Color UIControlAnim::getColor( const Color& Col ) {
|
||||
return Color( Col.r, Col.g, Col.b, static_cast<Uint8>( (Float)Col.a * ( mAlpha / 255.f ) ) );
|
||||
}
|
||||
|
||||
void UIControlAnim::updateQuad() {
|
||||
|
||||
@@ -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 );
|
||||
}
|
||||
|
||||
@@ -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() );
|
||||
|
||||
|
||||
@@ -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 ) {
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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() ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 ];
|
||||
|
||||
@@ -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*) );
|
||||
|
||||
@@ -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*) );
|
||||
|
||||
@@ -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 );
|
||||
|
||||
|
||||
@@ -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 );
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user