Refactored Colors.

Removed PBuffer support.
Abstracted WMInfo.
This commit is contained in:
Martín Lucas Golini
2014-06-14 05:51:39 -03:00
parent 82008b9aee
commit c865d2c09f
132 changed files with 837 additions and 1122 deletions

View File

@@ -8,7 +8,7 @@ namespace EE { namespace Gaming {
class EE_API cGameObjectSubTextureEx : public cGameObjectSubTexture {
public:
cGameObjectSubTextureEx( const Uint32& Flags, cLayer * Layer, cSubTexture * SubTexture = NULL, const eeVector2f& Pos = eeVector2f(), EE_BLEND_MODE Blend = ALPHA_NORMAL, EE_RENDER_MODE Render = RN_NORMAL, Float Angle = 0.f, eeVector2f Scale = eeVector2f::One, eeColorA Color = eeColorA() );
cGameObjectSubTextureEx( const Uint32& Flags, cLayer * Layer, cSubTexture * SubTexture = NULL, const eeVector2f& Pos = eeVector2f(), EE_BLEND_MODE Blend = ALPHA_NORMAL, EE_RENDER_MODE Render = RN_NORMAL, Float Angle = 0.f, eeVector2f Scale = eeVector2f::One, ColorA Color = ColorA() );
virtual ~cGameObjectSubTextureEx();
@@ -24,8 +24,8 @@ class EE_API cGameObjectSubTextureEx : public cGameObjectSubTexture {
EE_RENDER_MODE mRender;
Float mAngle;
eeVector2f mScale;
eeColorA mColor;
eeColorA * mVertexColors;
ColorA mColor;
ColorA * mVertexColors;
};
}}

View File

@@ -15,19 +15,19 @@ class EE_API cLight {
public:
cLight();
cLight( const Float& Radius, const Float& x, const Float& y, const eeColor& Color = eeColor(255,255,255), LIGHT_TYPE Type = LIGHT_NORMAL );
cLight( const Float& Radius, const Float& x, const Float& y, const RGB& Color = RGB(255,255,255), LIGHT_TYPE Type = LIGHT_NORMAL );
virtual ~cLight();
void Create( const Float& Radius, const Float& x, const Float& y, const eeColor& Color = eeColor(255,255,255), LIGHT_TYPE Type = LIGHT_NORMAL );
void Create( const Float& Radius, const Float& x, const Float& y, const RGB& Color = RGB(255,255,255), LIGHT_TYPE Type = LIGHT_NORMAL );
virtual eeColor ProcessVertex( const Float& PointX, const Float& PointY, const eeColor& VertexColor, const eeColor& BaseColor );
virtual RGB ProcessVertex( const Float& PointX, const Float& PointY, const RGB& VertexColor, const RGB& BaseColor );
virtual eeColorA ProcessVertex( const Float& PointX, const Float& PointY, const eeColorA& VertexColor, const eeColorA& BaseColor );
virtual ColorA ProcessVertex( const Float& PointX, const Float& PointY, const ColorA& VertexColor, const ColorA& BaseColor );
eeColor ProcessVertex( const eeVector2f& Pos, const eeColor& VertexColor, const eeColor& BaseColor );
RGB ProcessVertex( const eeVector2f& Pos, const RGB& VertexColor, const RGB& BaseColor );
eeColorA ProcessVertex( const eeVector2f& Pos, const eeColorA& VertexColor, const eeColorA& BaseColor );
ColorA ProcessVertex( const eeVector2f& Pos, const ColorA& VertexColor, const ColorA& BaseColor );
void Move( const Float& addtox, const Float& addtoy );
@@ -45,9 +45,9 @@ class EE_API cLight {
void Active( const bool& active );
void Color( const eeColor& color );
void Color( const RGB& color );
const eeColor& Color() const;
const RGB& Color() const;
void Type( const LIGHT_TYPE& type );
@@ -59,7 +59,7 @@ class EE_API cLight {
protected:
Float mRadius;
eeVector2f mPos;
eeColor mColor;
RGB mColor;
LIGHT_TYPE mType;
eeAABB mAABB;
bool mActive;

View File

@@ -27,11 +27,11 @@ class EE_API cLightManager {
Uint32 Count();
const eeColorA * GetTileColor( const eeVector2i& TilePos );
const ColorA * GetTileColor( const eeVector2i& TilePos );
const eeColorA * GetTileColor( const eeVector2i& TilePos, const Uint32& Vertex );
const ColorA * GetTileColor( const eeVector2i& TilePos, const Uint32& Vertex );
eeColorA GetColorFromPos( const eeVector2f& Pos );
ColorA GetColorFromPos( const eeVector2f& Pos );
const bool& IsByVertex() const;
@@ -41,7 +41,7 @@ class EE_API cLightManager {
protected:
cMap * mMap;
Int32 mNumVertex;
eeColorA**** mTileColors;
ColorA**** mTileColors;
LightsList mLights;
bool mIsByVertex;

View File

@@ -170,9 +170,9 @@ class EE_API cMap {
const std::string& Path() const;
void BaseColor( const eeColorA& color );
void BaseColor( const ColorA& color );
const eeColorA& BaseColor() const;
const ColorA& BaseColor() const;
const eeAABB& GetViewAreaAABB() const;
@@ -203,9 +203,9 @@ class EE_API cMap {
void BackAlpha( const Uint8& alpha );
const eeColorA& BackColor() const;
const ColorA& BackColor() const;
void BackColor( const eeColorA& col );
void BackColor( const ColorA& col );
const Float& Scale() const;
@@ -221,9 +221,9 @@ class EE_API cMap {
void DisableForcedHeaders();
void GridLinesColor( const eeColorA& Col );
void GridLinesColor( const ColorA& Col );
const eeColorA& GridLinesColor() const;
const ColorA& GridLinesColor() const;
protected:
friend class EE::Gaming::MapEditor::cUIMapNew;
@@ -262,7 +262,7 @@ class EE_API cMap {
eeVector2i mMouseOverTile;
eeVector2i mMouseOverTileFinal;
eeVector2i mMouseMapPos;
eeColorA mBaseColor;
ColorA mBaseColor;
PropertiesMap mProperties;
GOTypesList mObjTypes;
CreateGOCb mCreateGOCb;
@@ -272,9 +272,9 @@ class EE_API cMap {
MapDrawCb mDrawCb;
MapUpdateCb mUpdateCb;
void * mData;
eeColorA mTileOverColor;
eeColorA mBackColor;
eeColorA mGridLinesColor;
ColorA mTileOverColor;
ColorA mBackColor;
ColorA mGridLinesColor;
Uint8 mBackAlpha;
bool mMouseOver;
std::string mPath;

View File

@@ -15,7 +15,7 @@ struct eeTexCoord {
struct eeVertex {
eeVector2f pos;
eeTexCoord tex;
eeColorA color;
ColorA color;
};
class cTextureFactory;
@@ -91,7 +91,7 @@ class EE_API cBatchRenderer {
/** Add to the batch a quad with the vertex freely seted ( this will change your batch rendering method to DM_QUADS, so if you were using another one will Draw all the batched vertexs first ) */
void BatchQuadFreeEx( const Float& x0, const Float& y0, const Float& x1, const Float& y1, const Float& x2, const Float& y2, const Float& x3, const Float& y3, const Float& Angle = 0.0f, const Float& Scale = 1.0f );
/** This will set as the default batch rendering to GL_QUADS. WIll reset the texture subset rendering to the whole texture. Will reset the default color rendering to eeColorA(255,255,255,255). */
/** This will set as the default batch rendering to GL_QUADS. WIll reset the texture subset rendering to the whole texture. Will reset the default color rendering to ColorA(255,255,255,255). */
void QuadsBegin();
/** Set the texture sector to be rendered */
@@ -101,40 +101,40 @@ class EE_API cBatchRenderer {
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 eeColorA& Color );
void QuadsSetColor( const ColorA& Color );
/** Set the quad color per vertex */
void QuadsSetColorFree( const eeColorA& Color0, const eeColorA& Color1, const eeColorA& Color2, const eeColorA& Color3 );
void QuadsSetColorFree( const ColorA& Color0, const ColorA& Color1, const ColorA& Color2, const ColorA& Color3 );
/** This will set as the default batch rendering to DM_POINTS. And will reset the point color to eeColorA(255,255,255,255). */
/** 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 eeColorA& Color );
void PointSetColor( const ColorA& 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 );
/** This will set as the default batch rendering to DM_LINES. And will reset the line color to eeColorA(255,255,255,255). */
/** This will set as the default batch rendering to DM_LINES. And will reset the line color to ColorA(255,255,255,255). */
void LinesBegin();
/** Set the line color */
void LinesSetColor( const eeColorA& Color );
void LinesSetColor( const ColorA& Color );
/** Set the line color, per vertex */
void LinesSetColorFree( const eeColorA& Color0, const eeColorA& Color1 );
void LinesSetColorFree( const ColorA& Color0, const ColorA& 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 );
/** This will set as the default batch rendering to GL_LINE_LOOP. And will reset the line color to eeColorA(255,255,255,255). */
/** This will set as the default batch rendering to GL_LINE_LOOP. And will reset the line color to ColorA(255,255,255,255). */
void LineLoopBegin();
/** Set the line color */
void LineLoopSetColor( const eeColorA& Color );
void LineLoopSetColor( const ColorA& Color );
/** Set the line color, per vertex */
void LineLoopSetColorFree( const eeColorA& Color0, const eeColorA& Color1 );
void LineLoopSetColorFree( const ColorA& Color0, const ColorA& 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 );
@@ -148,14 +148,14 @@ class EE_API cBatchRenderer {
/** Add to the batch a point to the line loop batch ( 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 eeVector2f& vector1 );
/** This will set as the default batch rendering to DM_TRIANGLE_FAN. And will reset the line color to eeColorA(255,255,255,255). */
/** This will set as the default batch rendering to DM_TRIANGLE_FAN. And will reset the line color to ColorA(255,255,255,255). */
void TriangleFanBegin();
/** Set the triangle fan color */
void TriangleFanSetColor( const eeColorA& Color );
void TriangleFanSetColor( const ColorA& Color );
/** Set the triangle fan color, per vertex */
void TriangleFanSetColorFree( const eeColorA& Color0, const eeColorA& Color1, const eeColorA& Color2 );
void TriangleFanSetColorFree( const ColorA& Color0, const ColorA& Color1, const ColorA& 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 );
@@ -166,14 +166,14 @@ class EE_API cBatchRenderer {
/** Add to the batch a triangle fan ( this will change your batch rendering method to DM_TRIANGLE_FAN, so if you were using another one will Draw all the batched vertexs first ) */
void BatchTriangleFan( const Float& x0, const Float& y0 );
/** This will set as the default batch rendering to DM_TRIANGLES. And will reset the line color to eeColorA(255,255,255,255). */
/** This will set as the default batch rendering to DM_TRIANGLES. And will reset the line color to ColorA(255,255,255,255). */
void TrianglesBegin();
/** Set the triangles color */
void TrianglesSetColor( const eeColorA& Color );
void TrianglesSetColor( const ColorA& Color );
/** Set the triangles color, per vertex */
void TrianglesSetColorFree( const eeColorA& Color0, const eeColorA& Color1, const eeColorA& Color2 );
void TrianglesSetColorFree( const ColorA& Color0, const ColorA& Color1, const ColorA& 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 );
@@ -182,7 +182,7 @@ class EE_API cBatchRenderer {
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 eeColorA& Color );
void PolygonSetColor( const ColorA& 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 eePolygon2f& Polygon );
@@ -221,7 +221,7 @@ class EE_API cBatchRenderer {
EE_BLEND_MODE mBlend;
eeTexCoord mTexCoord[4];
eeColorA mVerColor[4];
ColorA mVerColor[4];
EE_DRAW_MODE mCurrentMode;

View File

@@ -39,28 +39,28 @@ class EE_API cConsole : protected LogReaderInterface {
Uint32 TextureId() const { return mTexId; }
/** Set the Console Background Color */
void BackgroundColor( const eeColorA& BackColor ) { mConColor = BackColor; }
void BackgroundColor( const ColorA& BackColor ) { mConColor = BackColor; }
/** Get the Console Background Color */
const eeColorA& BackgroundColor() const { return mConColor; }
const ColorA& BackgroundColor() const { return mConColor; }
/** Set the Console Border Line Background Color */
void BackgroundLineColor( const eeColorA& BackColor ) { mConLineColor = BackColor; }
void BackgroundLineColor( const ColorA& BackColor ) { mConLineColor = BackColor; }
/** Get the Console Border Line Background Color */
const eeColorA& BackgroundLineColor() const { return mConLineColor; }
const ColorA& BackgroundLineColor() const { return mConLineColor; }
/** Set the Console Font Color */
void FontColor( const eeColorA& FntColor ) { mFontColor = FntColor; }
void FontColor( const ColorA& FntColor ) { mFontColor = FntColor; }
/** Get the Console Font Color */
const eeColorA& FontColor() const { return mFontColor; }
const ColorA& FontColor() const { return mFontColor; }
/** Set the Console Client Input ( Writeable Line ) Font Color */
void FontLineColor( const eeColorA& FntColor ) { mFontLineColor = FntColor; }
void FontLineColor( const ColorA& FntColor ) { mFontLineColor = FntColor; }
/** Get the Console Client Input ( Writeable Line ) Font Color */
const eeColorA& FontLineColor() const { return mFontLineColor; }
const ColorA& FontLineColor() const { return mFontLineColor; }
/** Toogle the console between visible and hided with Fade In or Fade Out effect. */
void Toggle();
@@ -128,10 +128,10 @@ class EE_API cConsole : protected LogReaderInterface {
Window::cWindow * mWindow;
eeColorA mConColor;
eeColorA mConLineColor;
eeColorA mFontColor;
eeColorA mFontLineColor;
ColorA mConColor;
ColorA mConLineColor;
ColorA mFontColor;
ColorA mFontLineColor;
Float mWidth;
Float mHeight;

View File

@@ -31,16 +31,16 @@ class EE_API cFont {
virtual int GetNumLines();
/** @return The Font Color */
const eeColorA& Color() const;
const ColorA& Color() const;
/** Set the color of the string rendered */
void Color(const eeColorA& Color);
void Color(const ColorA& Color);
/** @return The Shadow Font Color */
const eeColorA& ShadowColor() const;
const ColorA& ShadowColor() const;
/** Set the shadow color of the string rendered */
void ShadowColor(const eeColorA& Color);
void ShadowColor(const ColorA& Color);
/** @return The current font size */
Uint32 GetFontSize() const;

View File

@@ -48,10 +48,10 @@ class EE_API cFrameBuffer {
cTexture * GetTexture() const;
/** @brief Sets the frame buffer clear color. */
void ClearColor( eeColorAf Color );
void ClearColor( ColorAf Color );
/** @return The clear color used for the frame buffer. */
eeColorAf ClearColor() const;
ColorAf ClearColor() const;
/** @return The frame buffer width. */
const Int32& GetWidth() const;
@@ -67,7 +67,7 @@ class EE_API cFrameBuffer {
Int32 mHeight;
bool mHasDepthBuffer;
cTexture * mTexture;
eeColorAf mClearColor;
ColorAf mClearColor;
cView mPrevView;
float mProjMat[16];

View File

@@ -64,7 +64,7 @@ class EE_API cImage {
cImage( const Uint8* data, const unsigned int& Width, const unsigned int& Height, const unsigned int& Channels );
/** Create an empty image */
cImage( const Uint32& Width, const Uint32& Height, const Uint32& Channels, const eeColorA& DefaultColor = eeColorA(0,0,0,0), const bool& initWithDefaultColor = true );
cImage( const Uint32& Width, const Uint32& Height, const Uint32& Channels, const ColorA& DefaultColor = ColorA(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 cImage {
virtual ~cImage();
/** Create an empty image data */
void Create( const Uint32& Width, const Uint32& Height, const Uint32& Channels, const eeColorA &DefaultColor = eeColorA(0,0,0,0), const bool& initWithDefaultColor = true );
void Create( const Uint32& Width, const Uint32& Height, const Uint32& Channels, const ColorA &DefaultColor = ColorA(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 eeColorA GetPixel(const unsigned int& x, const unsigned int& y);
virtual ColorA 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 eeColorA& Color);
virtual void SetPixel(const unsigned int& x, const unsigned int& y, const ColorA& 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 cImage {
virtual bool SaveToFile( const std::string& filepath, const EE_SAVE_TYPE& Format );
/** Create an Alpha mask from a Color */
virtual void CreateMaskFromColor( const eeColorA& ColorKey, Uint8 Alpha );
virtual void CreateMaskFromColor( const ColorA& ColorKey, Uint8 Alpha );
/** Create an Alpha mask from a Color */
void CreateMaskFromColor( const eeColor& ColorKey, Uint8 Alpha );
void CreateMaskFromColor( const RGB& ColorKey, Uint8 Alpha );
/** Replace a color on the image */
virtual void ReplaceColor( const eeColorA& ColorKey, const eeColorA& NewColor );
virtual void ReplaceColor( const ColorA& ColorKey, const ColorA& NewColor );
/** Fill the image with a color */
virtual void FillWithColor( const eeColorA& Color );
virtual void FillWithColor( const ColorA& Color );
/** Copy the image to this image data, starting from the position x,y */
virtual void CopyImage( cImage * image, const Uint32& x = 0, const Uint32& y = 0 );
@@ -184,7 +184,7 @@ class EE_API cImage {
bool mAvoidFree;
bool mLoadedFromStbi;
void Allocate( const Uint32& size, eeColorA DefaultColor = eeColorA(0,0,0,0), bool memsetData = true );
void Allocate( const Uint32& size, ColorA DefaultColor = ColorA(0,0,0,0), bool memsetData = true );
void LoadFromPack( Pack * Pack, const std::string& FilePackPath );
};

View File

@@ -12,8 +12,8 @@ class EE_API cParticle{
cParticle();
~cParticle();
void Color(eeColorAf Color, Float AlphaDecay);
eeColorAf Color() const { return mColor; }
void Color(ColorAf Color, Float AlphaDecay);
ColorAf Color() const { return mColor; }
Float R() { return mColor.R(); }
Float G() { return mColor.G(); }
@@ -54,7 +54,7 @@ class EE_API cParticle{
Uint32 Id() const { return cId; }
private:
Float mX, mY;
eeColorAf mColor;
ColorAf mColor;
Float mXSpeed, mYSpeed, mXAcc, mYAcc, mAlphaDecay, mSize;
bool cUsed;

View File

@@ -61,7 +61,7 @@ class EE_API cParticleSystem {
const Float& PartSize = 16.0f,
const bool& AnimLoop = false,
const Uint32& NumLoops = 1,
const eeColorAf& Color = eeColorAf( 1.0f, 1.0f, 1.0f, 1.0f ),
const ColorAf& Color = ColorAf( 1.0f, 1.0f, 1.0f, 1.0f ),
const eeVector2f& Pos2 = eeVector2f( 0, 0 ),
const Float& AlphaDecay = 0.01f,
const eeVector2f& Speed = eeVector2f( 0.1f, 0.1f ),
@@ -128,10 +128,10 @@ class EE_API cParticleSystem {
void BlendMode( const EE_BLEND_MODE& mode );
/** @return The color of the effect */
const eeColorAf& Color() const;
const ColorAf& Color() const;
/** Set the color of the effect */
void Color( const eeColorAf& Col );
void Color( const ColorAf& Col );
/** @return The alpha decay of the effect */
const Float& AlphaDecay() const;
@@ -160,7 +160,7 @@ class EE_API cParticleSystem {
EE_PARTICLE_EFFECT mEffect;
EE_BLEND_MODE mBlend;
eeColorAf mColor;
ColorAf mColor;
int mProgression;
int mDirection;

View File

@@ -42,7 +42,7 @@ class EE_API cPrimitives {
* @param Color2 Second Point Color
* @param Color3 Third Point Color
*/
void DrawTriangle( const eeTriangle2f& t, const eeColorA& Color1, const eeColorA& Color2, const eeColorA& Color3 );
void DrawTriangle( const eeTriangle2f& t, const ColorA& Color1, const ColorA& Color2, const ColorA& Color3 );
/** Draw a rectangle on the screen
* @param R The Rectangle eeRectf
@@ -68,7 +68,7 @@ class EE_API cPrimitives {
* @param Angle Rectangle Angle
* @param Scale Rectangle Scale ( default 1.0f )
*/
void DrawRectangle( const eeRectf& R, const eeColorA& TopLeft, const eeColorA& BottomLeft, const eeColorA& BottomRight, const eeColorA& TopRight, const Float& Angle = 0, const eeVector2f& Scale = eeVector2f::One );
void DrawRectangle( const eeRectf& R, const ColorA& TopLeft, const ColorA& BottomLeft, const ColorA& BottomRight, const ColorA& TopRight, const Float& Angle = 0, const eeVector2f& Scale = eeVector2f::One );
/** Draw a rounded rectangle on the screen setting per vertex color
* @param R The Rectangle eeRectf
@@ -80,7 +80,7 @@ class EE_API cPrimitives {
* @param Scale Rectangle Scale ( default 1.0f )
* @param Corners Number of vertices per corner ( how rounded is each corner )
*/
void DrawRoundedRectangle( const eeRectf& R, const eeColorA& TopLeft, const eeColorA& BottomLeft, const eeColorA& BottomRight, const eeColorA& TopRight, const Float& Angle = 0, const eeVector2f& Scale = eeVector2f::One, const unsigned int& Corners = 8 );
void DrawRoundedRectangle( const eeRectf& R, const ColorA& TopLeft, const ColorA& BottomLeft, const ColorA& BottomRight, const ColorA& TopRight, const Float& Angle = 0, const eeVector2f& Scale = eeVector2f::One, const unsigned int& Corners = 8 );
/** Draw a four edges polygon on screen
* @param q The Quad
@@ -98,7 +98,7 @@ class EE_API cPrimitives {
* @param OffsetX X offset for the quad
* @param OffsetY Y offset for the quad
*/
void DrawQuad( const eeQuad2f& q, const eeColorA& Color1, const eeColorA& Color2, const eeColorA& Color3, const eeColorA& Color4, const Float& OffsetX = 0, const Float& OffsetY = 0 );
void DrawQuad( const eeQuad2f& q, const ColorA& Color1, const ColorA& Color2, const ColorA& Color3, const ColorA& Color4, const Float& OffsetX = 0, const Float& OffsetY = 0 );
/** Draw a polygon on screen
* @param p The Polygon
@@ -106,7 +106,7 @@ class EE_API cPrimitives {
void DrawPolygon( const eePolygon2f& p );
/** Set the current color for drawing primitives */
void SetColor( const eeColorA& Color );
void SetColor( const ColorA& Color );
/** Forcing the draw, will force the batch renderer to draw the batched vertexs immediately ( active by default ). */
void ForceDraw( const bool& force );
@@ -134,7 +134,7 @@ class EE_API cPrimitives {
/** @return The line with to draw primitives */
const Float& LineWidth() const;
private:
eeColorA mColor;
ColorA mColor;
EE_FILL_MODE mFillMode;
EE_BLEND_MODE mBlendMode;
Float mLineWidth;

View File

@@ -23,7 +23,7 @@ class EE_API cScrollParallax {
* @param Speed Speed of movement ( in Pixels Per Second )
* @param Color The Texture Color
* @param Blend The Blend Mode ( default ALPHA_NORMAL ) */
cScrollParallax( cSubTexture * SubTexture, const eeVector2f& Position = eeVector2f(), const eeSizef& Size = eeSizef(), const eeVector2f& Speed = eeVector2f(), const eeColorA& Color = eeColorA(), const EE_BLEND_MODE& Blend = ALPHA_NORMAL );
cScrollParallax( cSubTexture * SubTexture, const eeVector2f& Position = eeVector2f(), const eeSizef& Size = eeSizef(), const eeVector2f& Speed = eeVector2f(), const ColorA& Color = ColorA(), 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 cScrollParallax {
* @param Blend The Blend Mode ( default ALPHA_NORMAL )
* @return True if success
*/
bool Create( cSubTexture * SubTexture, const eeVector2f& Position = eeVector2f(), const eeSizef& Size = eeSizef(), const eeVector2f& Speed = eeVector2f(), const eeColorA& Color = eeColorA(), const EE_BLEND_MODE& Blend = ALPHA_NORMAL );
bool Create( cSubTexture * SubTexture, const eeVector2f& Position = eeVector2f(), const eeSizef& Size = eeSizef(), const eeVector2f& Speed = eeVector2f(), const ColorA& Color = ColorA(), const EE_BLEND_MODE& Blend = ALPHA_NORMAL );
/** Set the parallax texture color. */
void Color( const eeColorA& Color ) { mColor = Color; }
void Color( const ColorA& Color ) { mColor = Color; }
/** Get the parallax texture color. */
eeColorA Color() const { return mColor; }
ColorA Color() const { return mColor; }
/** Set the Blend Mode used. */
void BlendMode( const EE_BLEND_MODE& Blend ) { mBlend = Blend; }
@@ -79,7 +79,7 @@ class EE_API cScrollParallax {
private:
cSubTexture * mSubTexture;
EE_BLEND_MODE mBlend;
eeColorA mColor;
ColorA mColor;
eeVector2f mInitPos;
eeVector2f mPos;
eeVector2f mSpeed;

View File

@@ -125,10 +125,10 @@ class EE_API cSprite {
void AnimPaused( const bool& Pause );
/** Set the sprite color */
void Color( const eeColorA& Color);
void Color( const ColorA& Color);
/** @return The sprite color */
const eeColorA& Color() const;
const ColorA& Color() const;
/** Set the sprite Color Alpha */
void Alpha( const Uint8& Alpha );
@@ -189,7 +189,7 @@ class EE_API cSprite {
* @param Color2 The Right - Bottom vertex color
* @param Color3 The Right - Top vertex color
*/
void UpdateVertexColors( const eeColorA& Color0, const eeColorA& Color1, const eeColorA& Color2, const eeColorA& Color3 );
void UpdateVertexColors( const ColorA& Color0, const ColorA& Color1, const ColorA& Color2, const ColorA& Color3 );
/** This will disable the vertex colors */
void DisableVertexColors();
@@ -365,8 +365,8 @@ class EE_API cSprite {
eeVector2f mScale;
Float mAnimSpeed;
eeColorA mColor;
eeColorA * mVertexColors;
ColorA mColor;
ColorA * mVertexColors;
int mRepeations; //!< Number of repetions of the animation, default -1 that equals to loop.

View File

@@ -80,23 +80,23 @@ class EE_API cSubTexture {
/** Set the SubTexture offset. */
void Offset( const eeVector2i& offset );
void Draw( const Float& X, const Float& Y, const eeColorA& Color = eeColorA(), const Float& Angle = 0.f, const eeVector2f& Scale = eeVector2f::One, const EE_BLEND_MODE& Blend = ALPHA_NORMAL, const EE_RENDER_MODE& Effect = RN_NORMAL, eeOriginPoint Center = eeOriginPoint(eeOriginPoint::OriginCenter) );
void Draw( const Float& X, const Float& Y, const ColorA& Color = ColorA(), const Float& Angle = 0.f, const eeVector2f& Scale = eeVector2f::One, const EE_BLEND_MODE& Blend = ALPHA_NORMAL, const EE_RENDER_MODE& Effect = RN_NORMAL, eeOriginPoint Center = eeOriginPoint(eeOriginPoint::OriginCenter) );
void Draw( const Float& X, const Float& Y, const Float& Angle, const eeVector2f& Scale, const eeColorA& Color0 = eeColorA(), const eeColorA& Color1 = eeColorA(), const eeColorA& Color2 = eeColorA(), const eeColorA& Color3 = eeColorA(), const EE_BLEND_MODE& Blend = ALPHA_NORMAL, const EE_RENDER_MODE& Effect = RN_NORMAL, eeOriginPoint Center = eeOriginPoint(eeOriginPoint::OriginCenter) );
void Draw( const Float& X, const Float& Y, const Float& Angle, const eeVector2f& 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, eeOriginPoint Center = eeOriginPoint(eeOriginPoint::OriginCenter) );
void Draw( const eeQuad2f Q, const eeVector2f& Offset = eeVector2f(), const Float& Angle = 0.f, const eeVector2f& Scale = eeVector2f::One, const eeColorA& Color0 = eeColorA(), const eeColorA& Color1 = eeColorA(), const eeColorA& Color2 = eeColorA(), const eeColorA& Color3 = eeColorA(), const EE_BLEND_MODE& Blend = ALPHA_NORMAL );
void Draw( const eeQuad2f Q, const eeVector2f& Offset = eeVector2f(), const Float& Angle = 0.f, const eeVector2f& Scale = eeVector2f::One, const ColorA& Color0 = ColorA(), const ColorA& Color1 = ColorA(), const ColorA& Color2 = ColorA(), const ColorA& Color3 = ColorA(), const EE_BLEND_MODE& Blend = ALPHA_NORMAL );
/** @return The texture instance used by the SubTexture. */
cTexture * GetTexture();
/** Replaces a color in the SubTexture ( needs Lock() ) */
void ReplaceColor( eeColorA ColorKey, eeColorA NewColor );
void ReplaceColor( ColorA ColorKey, ColorA NewColor );
/** Creates a mask from a color. */
void CreateMaskFromColor( eeColorA ColorKey, Uint8 Alpha );
void CreateMaskFromColor( ColorA ColorKey, Uint8 Alpha );
/** Creates a mask from a color. */
void CreateMaskFromColor( eeColor ColorKey, Uint8 Alpha );
void CreateMaskFromColor( RGB ColorKey, Uint8 Alpha );
/** Creates a copy of the alpha mask to memory from the texture loaded in VRAM. */
void CacheAlphaMask();
@@ -110,12 +110,12 @@ class EE_API cSubTexture {
/** @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. */
eeColorA GetColorAt( const Int32& X, const Int32& Y );
ColorA 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 eeColorA& Color );
void SetColorAt( const Int32& X, const Int32& Y, const ColorA& Color );
/** Deletes the texture buffer from memory ( not from VRAM ) if it was cached before ( using Lock() ). */
void ClearCache();

View File

@@ -12,14 +12,14 @@ class cFont;
class EE_API cTextCache {
public:
/** Create a text from a font */
cTextCache( cFont * font, const String& text = "", eeColorA FontColor = eeColorA(255,255,255,255), eeColorA FontShadowColor = eeColorA(0,0,0,255) );
cTextCache( cFont * font, const String& text = "", ColorA FontColor = ColorA(255,255,255,255), ColorA FontShadowColor = ColorA(0,0,0,255) );
cTextCache();
~cTextCache();
/** Create a text from a font */
void Create( cFont * font, const String& text = "", eeColorA FontColor = eeColorA(255,255,255,255), eeColorA FontShadowColor = eeColorA(0,0,0,255) );
void Create( cFont * font, const String& text = "", ColorA FontColor = ColorA(255,255,255,255), ColorA FontShadowColor = ColorA(0,0,0,255) );
/** @return The font used for the text cache */
cFont * Font() const;
@@ -46,16 +46,16 @@ class EE_API cTextCache {
std::vector<eeVertexCoords>& VertextCoords();
/** @return The text colors cached */
std::vector<eeColorA>& Colors();
std::vector<ColorA>& Colors();
/** Draw the cached text on screen */
void Draw( const Float& X, const Float& Y, const eeVector2f& Scale = eeVector2f::One, const Float& Angle = 0, EE_BLEND_MODE Effect = ALPHA_NORMAL );
/** @return The Font Color */
const eeColorA& Color() const;
const ColorA& Color() const;
/** Set the color of the string rendered */
void Color(const eeColorA& color);
void Color(const ColorA& color);
/** @see Set the alpha of each individual character.
** This doesn't break any custom color per-character setted. */
@@ -66,13 +66,13 @@ class EE_API cTextCache {
* @param from The first char to change the color
* @param to The last char to change the color
*/
void Color(const eeColorA& color, Uint32 from, Uint32 to );
void Color(const ColorA& color, Uint32 from, Uint32 to );
/** @return The Shadow Font Color */
const eeColorA& ShadowColor() const;
const ColorA& ShadowColor() const;
/** Set the shadow color of the string rendered */
void ShadowColor(const eeColorA& color);
void ShadowColor(const ColorA& color);
/** @return The number of lines that the cached text contains */
const int& GetNumLines() const;
@@ -95,8 +95,8 @@ class EE_API cTextCache {
int mNumLines;
int mLargestLineCharCount;
eeColorA mFontColor;
eeColorA mFontShadowColor;
ColorA mFontColor;
ColorA mFontShadowColor;
Uint32 mFlags;
Uint32 mVertexNumCached;
@@ -105,7 +105,7 @@ class EE_API cTextCache {
std::vector<Float> mLinesWidth;
std::vector<eeVertexCoords> mRenderCoords;
std::vector<eeColorA> mColors;
std::vector<ColorA> mColors;
void UpdateCoords();

View File

@@ -1,9 +1,9 @@
#ifndef EE_GRAPHICSCTEXTURE_H
#define EE_GRAPHICSCTEXTURE_H
#include <eepp/graphics/base.hpp>
#include <eepp/core.hpp>
#include <eepp/graphics/cimage.hpp>
#include <eepp/graphics/ctexturefactory.hpp>
#include <eepp/core/noncopyable.hpp>
#include <eepp/math/polygon2.hpp>
#include <eepp/math/originpoint.hpp>
@@ -68,13 +68,13 @@ class EE_API cTexture : public cImage, private NonCopyable {
bool SaveToFile( const std::string& filepath, const EE_SAVE_TYPE& Format );
/** Replace a color on the texture */
void ReplaceColor( const eeColorA& ColorKey, const eeColorA& NewColor);
void ReplaceColor( const ColorA& ColorKey, const ColorA& NewColor);
/** Create an Alpha mask from a Color */
void CreateMaskFromColor( const eeColorA& ColorKey, Uint8 Alpha );
void CreateMaskFromColor( const ColorA& ColorKey, Uint8 Alpha );
/** Fill a texture with a color */
void FillWithColor( const eeColorA& Color );
void FillWithColor( const ColorA& Color );
/** Resize the texture */
void Resize( const Uint32& newWidth, const Uint32& newHeight, EE_RESAMPLER_FILTER filter = RESAMPLER_LANCZOS4 );
@@ -152,7 +152,7 @@ class EE_API cTexture : public cImage, 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 eeVector2f& Scale = eeVector2f::One, const eeColorA& Color = eeColorA(), 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 eeVector2f& Scale = eeVector2f::One, const ColorA& Color = ColorA(), 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
@@ -165,7 +165,7 @@ class EE_API cTexture : public cImage, 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 eeVector2f &Scale = eeVector2f::One, const eeColorA& Color = eeColorA(255,255,255,255), const EE_BLEND_MODE &Blend = ALPHA_NORMAL, const EE_RENDER_MODE &Effect = RN_NORMAL, eeOriginPoint Center = eeOriginPoint(eeOriginPoint::OriginCenter), const eeRecti& texSector = eeRecti(0,0,0,0) );
void Draw( const Float &x, const Float &y, const Float &Angle = 0, const eeVector2f &Scale = eeVector2f::One, const ColorA& Color = ColorA(255,255,255,255), const EE_BLEND_MODE &Blend = ALPHA_NORMAL, const EE_RENDER_MODE &Effect = RN_NORMAL, eeOriginPoint Center = eeOriginPoint(eeOriginPoint::OriginCenter), const eeRecti& texSector = eeRecti(0,0,0,0) );
/** Render the texture on screen. Extended because can set the vertex colors individually
* @param x The x position on screen
@@ -183,7 +183,7 @@ class EE_API cTexture : public cImage, 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 eeVector2f &Scale = eeVector2f::One, const eeColorA& Color0 = eeColorA(255,255,255,255), const eeColorA& Color1 = eeColorA(255,255,255,255), const eeColorA& Color2 = eeColorA(255,255,255,255), const eeColorA& Color3 = eeColorA(255,255,255,255), const EE_BLEND_MODE &Blend = ALPHA_NORMAL, const EE_RENDER_MODE &Effect = RN_NORMAL, eeOriginPoint Center = eeOriginPoint(eeOriginPoint::OriginCenter), const eeRecti& texSector = eeRecti(0,0,0,0) );
void DrawEx( Float x, Float y, Float width = 0.0f, Float height = 0.0f, const Float &Angle = 0, const eeVector2f &Scale = eeVector2f::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, eeOriginPoint Center = eeOriginPoint(eeOriginPoint::OriginCenter), const eeRecti& texSector = eeRecti(0,0,0,0) );
/** Render a quad on Screen
* @param Q The eeQuad2f
@@ -194,7 +194,7 @@ class EE_API cTexture : public cImage, 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 eeQuad2f& Q, const eeVector2f& Offset = eeVector2f(), const Float &Angle = 0.0f, const eeVector2f &Scale = eeVector2f::One, const eeColorA& Color = eeColorA(255,255,255,255), const EE_BLEND_MODE &Blend = ALPHA_NORMAL, const eeRecti& texSector = eeRecti(0,0,0,0) );
void DrawQuad( const eeQuad2f& Q, const eeVector2f& Offset = eeVector2f(), const Float &Angle = 0.0f, const eeVector2f &Scale = eeVector2f::One, const ColorA& Color = ColorA(255,255,255,255), const EE_BLEND_MODE &Blend = ALPHA_NORMAL, const eeRecti& texSector = eeRecti(0,0,0,0) );
/** Render a quad on Screen
* @param Q The eeQuad2f
@@ -208,7 +208,7 @@ class EE_API cTexture : public cImage, 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( eeQuad2f Q, const eeVector2f& Offset = eeVector2f(), const Float &Angle = 0.0f, const eeVector2f &Scale = eeVector2f::One, const eeColorA& Color0 = eeColorA(255,255,255,255), const eeColorA& Color1 = eeColorA(255,255,255,255), const eeColorA& Color2 = eeColorA(255,255,255,255), const eeColorA& Color3 = eeColorA(255,255,255,255), const EE_BLEND_MODE &Blend = ALPHA_NORMAL, eeRecti texSector = eeRecti(0,0,0,0) );
void DrawQuadEx( eeQuad2f Q, const eeVector2f& Offset = eeVector2f(), const Float &Angle = 0.0f, const eeVector2f &Scale = eeVector2f::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, eeRecti texSector = eeRecti(0,0,0,0) );
/** Set the texture factory internal id of the texture */
void Id( const Uint32& id );
@@ -220,7 +220,7 @@ class EE_API cTexture : public cImage, private NonCopyable {
void Reload();
/** Set a pixel to the locked texture. */
void SetPixel( const unsigned int& x, const unsigned int& y, const eeColorA& Color );
void SetPixel( const unsigned int& x, const unsigned int& y, const ColorA& Color );
/** Bind the texture. Activate the texture for rendering. */
void Bind();

View File

@@ -24,7 +24,7 @@ class EE_API cTextureFactory : 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 eeColorA& DefaultColor = eeColorA(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 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 );
/** Loads a RAW Texture from Memory
* @param Pixels The Texture array

View File

@@ -67,7 +67,7 @@ class EE_API cTextureLoader : public ObjectLoader {
virtual ~cTextureLoader();
/** A color key can be set to be transparent in the texture. This must be set before the loading is done. */
void SetColorKey( eeColor Color );
void SetColorKey( RGB Color );
/** This must be called for the asynchronous mode to update the texture data to the GPU, the call must be done from the same thread that the GL context was created ( the main thread ).
** @see ObjectLoader::Update */
@@ -105,7 +105,7 @@ class EE_API cTextureLoader : public ObjectLoader {
const Uint8 * mImagePtr;
Uint32 mSize;
eeColor * mColorKey;
RGB * mColorKey;
void Start();

View File

@@ -40,7 +40,7 @@ class EE_API cTTFFont : public cFont {
* @param AddPixelSeparator Indicates if separates the glyphs by a pixel to avoid problems with font scaling
* @return If success
*/
bool Load( const std::string& Filepath, const unsigned int& Size, EE_TTF_FONT_STYLE Style = TTF_STYLE_NORMAL, const Uint16& NumCharsToGen = 512, const eeColor& FontColor = eeColor(), const Uint8& OutlineSize = 0, const eeColor& OutlineColor = eeColor(0,0,0), const bool& AddPixelSeparator = true );
bool Load( const std::string& Filepath, const unsigned int& Size, EE_TTF_FONT_STYLE Style = TTF_STYLE_NORMAL, const Uint16& NumCharsToGen = 512, const RGB& FontColor = RGB(), const Uint8& OutlineSize = 0, const RGB& OutlineColor = RGB(0,0,0), const bool& AddPixelSeparator = true );
/** Loads a True Type Font from pack
* @param Pack Pointer to the pack instance
@@ -54,7 +54,7 @@ class EE_API cTTFFont : public cFont {
* @param AddPixelSeparator Indicates if separates the glyphs by a pixel to avoid problems with font scaling
* @return If success
*/
bool LoadFromPack( Pack* Pack, const std::string& FilePackPath, const unsigned int& Size, EE_TTF_FONT_STYLE Style = TTF_STYLE_NORMAL, const Uint16& NumCharsToGen = 512, const eeColor& FontColor = eeColor(), const Uint8& OutlineSize = 0, const eeColor& OutlineColor = eeColor(0,0,0), const bool& AddPixelSeparator = true );
bool LoadFromPack( Pack* Pack, const std::string& FilePackPath, const unsigned int& Size, EE_TTF_FONT_STYLE Style = TTF_STYLE_NORMAL, const Uint16& NumCharsToGen = 512, const RGB& FontColor = RGB(), const Uint8& OutlineSize = 0, const RGB& OutlineColor = RGB(0,0,0), const bool& AddPixelSeparator = true );
/** Loads a True Type Font from memory
* @param TTFData The pointer to the data
@@ -68,7 +68,7 @@ class EE_API cTTFFont : public cFont {
* @param AddPixelSeparator Indicates if separates the glyphs by a pixel to avoid problems with font scaling
* @return If success
*/
bool LoadFromMemory( Uint8* TTFData, const unsigned int& TTFDataSize, const unsigned int& Size, EE_TTF_FONT_STYLE Style = TTF_STYLE_NORMAL, const Uint16& NumCharsToGen = 512, const eeColor& FontColor = eeColor(), const Uint8& OutlineSize = 0, const eeColor& OutlineColor = eeColor(0,0,0), const bool& AddPixelSeparator = true );
bool LoadFromMemory( Uint8* TTFData, const unsigned int& TTFDataSize, const unsigned int& Size, EE_TTF_FONT_STYLE Style = TTF_STYLE_NORMAL, const Uint16& NumCharsToGen = 512, const RGB& FontColor = RGB(), const Uint8& OutlineSize = 0, const RGB& OutlineColor = RGB(0,0,0), const bool& AddPixelSeparator = true );
/** Save the texture generated from the TTF file to disk */
bool SaveTexture( const std::string& Filepath, const EE_SAVE_TYPE& Format = SAVE_TYPE_PNG );
@@ -83,14 +83,14 @@ class EE_API cTTFFont : public cFont {
HaikuTTF::hkFont * mFont;
HaikuTTF::hkFont * mFontOutline;
eeColorA * mPixels;
ColorA * mPixels;
std::string mFilepath;
Uint32 mNumChars;
Uint8 mOutlineSize;
eeColor mFontColor;
eeColor mOutlineColor;
RGB mFontColor;
RGB mOutlineColor;
EE_TTF_FONT_STYLE mStyle;
@@ -109,7 +109,7 @@ class EE_API cTTFFont : public cFont {
void UpdateLoading();
bool iLoad( const unsigned int& Size, EE_TTF_FONT_STYLE Style, const Uint16& NumCharsToGen, const eeColor& FontColor, Uint8 OutlineSize, const eeColor& OutlineColor, const bool& AddPixelSeparator );
bool iLoad( const unsigned int& Size, EE_TTF_FONT_STYLE Style, const Uint16& NumCharsToGen, const RGB& FontColor, Uint8 OutlineSize, const RGB& OutlineColor, const bool& AddPixelSeparator );
void MakeOutline( Uint8 *in, Uint8 *out, Int16 w, Int16 h, Int16 OutlineSize );

View File

@@ -24,7 +24,7 @@ class EE_API cTTFFontLoader : public ObjectLoader {
* @param OutlineColor The Outline Color
* @param AddPixelSeparator Indicates if separates the glyphs by a pixel to avoid problems with font scaling
*/
cTTFFontLoader( const std::string& FontName, const std::string& Filepath, const unsigned int& Size, EE_TTF_FONT_STYLE Style = TTF_STYLE_NORMAL, const Uint16& NumCharsToGen = 512, const eeColor& FontColor = eeColor(), const Uint8& OutlineSize = 0, const eeColor& OutlineColor = eeColor(0,0,0), const bool& AddPixelSeparator = true );
cTTFFontLoader( const std::string& FontName, const std::string& Filepath, const unsigned int& Size, EE_TTF_FONT_STYLE Style = TTF_STYLE_NORMAL, const Uint16& NumCharsToGen = 512, const RGB& FontColor = RGB(), const Uint8& OutlineSize = 0, const RGB& OutlineColor = RGB(0,0,0), const bool& AddPixelSeparator = true );
/** Load a True Type Font from a Pack
* @param FontName The font name
@@ -38,7 +38,7 @@ class EE_API cTTFFontLoader : public ObjectLoader {
* @param OutlineColor The Outline Color
* @param AddPixelSeparator Indicates if separates the glyphs by a pixel to avoid problems with font scaling
*/
cTTFFontLoader( const std::string& FontName, Pack * Pack, const std::string& FilePackPath, const unsigned int& Size, EE_TTF_FONT_STYLE Style = TTF_STYLE_NORMAL, const Uint16& NumCharsToGen = 512, const eeColor& FontColor = eeColor(), const Uint8& OutlineSize = 0, const eeColor& OutlineColor = eeColor(0,0,0), const bool& AddPixelSeparator = true );
cTTFFontLoader( const std::string& FontName, Pack * Pack, const std::string& FilePackPath, const unsigned int& Size, EE_TTF_FONT_STYLE Style = TTF_STYLE_NORMAL, const Uint16& NumCharsToGen = 512, const RGB& FontColor = RGB(), const Uint8& OutlineSize = 0, const RGB& OutlineColor = RGB(0,0,0), const bool& AddPixelSeparator = true );
/** Loads a True Type Font from memory
* @param FontName The font name
@@ -52,7 +52,7 @@ class EE_API cTTFFontLoader : public ObjectLoader {
* @param OutlineColor The Outline Color
* @param AddPixelSeparator Indicates if separates the glyphs by a pixel to avoid problems with font scaling
*/
cTTFFontLoader( const std::string& FontName, Uint8* TTFData, const unsigned int& TTFDataSize, const unsigned int& Size, EE_TTF_FONT_STYLE Style = TTF_STYLE_NORMAL, const Uint16& NumCharsToGen = 512, const eeColor& FontColor = eeColor(), const Uint8& OutlineSize = 0, const eeColor& OutlineColor = eeColor(0,0,0), const bool& AddPixelSeparator = true );
cTTFFontLoader( const std::string& FontName, Uint8* TTFData, const unsigned int& TTFDataSize, const unsigned int& Size, EE_TTF_FONT_STYLE Style = TTF_STYLE_NORMAL, const Uint16& NumCharsToGen = 512, const RGB& FontColor = RGB(), const Uint8& OutlineSize = 0, const RGB& OutlineColor = RGB(0,0,0), const bool& AddPixelSeparator = true );
virtual ~cTTFFontLoader();
@@ -86,9 +86,9 @@ class EE_API cTTFFontLoader : public ObjectLoader {
unsigned int mSize;
EE_TTF_FONT_STYLE mStyle;
Uint16 mNumCharsToGen;
eeColor mFontColor;
RGB mFontColor;
Uint8 mOutlineSize;
eeColor mOutlineColor;
RGB mOutlineColor;
bool mAddPixelSeparator;
Pack * mPack;
Uint8 * mData;

View File

@@ -40,7 +40,7 @@ class EE_API cVertexBuffer {
/** @brief Adds a color to the buffer.
* @param Color The color value.
*/
void AddColor( const eeColorA& Color );
void AddColor( const ColorA& Color );
/** @brief Adds an index to the buffer.
* @param Index The index value.
@@ -83,7 +83,7 @@ class EE_API cVertexBuffer {
/** @return The color at the buffer position.
* @param Index The position in the buffer.
*/
eeColorA GetColor( const Uint32& Index );
ColorA GetColor( const Uint32& Index );
/** @return The index at the buffer position.
* @param Index The position in the buffer.
@@ -150,7 +150,7 @@ class EE_API cVertexBuffer {
// Upload the rounded rectangle data to the vertex buffer.
for ( Uint32 i = 0; i < Poly.Size(); i++ ) {
VBO->AddVertex( Poly[i] ); // Adds the vertex position
VBO->AddColor( eeColorA( 255, 255, 255, 255 ) ); // Adds the vertex color
VBO->AddColor( ColorA( 255, 255, 255, 255 ) ); // Adds the vertex color
}
// Compiles the buffered data

View File

@@ -78,7 +78,7 @@ typedef cpBB cBB;
#ifdef PHYSICS_RENDERER_ENABLED
inline eeColorA ColorFromPointer(void *ptr) {
inline ColorA ColorFromPointer(void *ptr) {
unsigned long val = (long)ptr;
// hash the pointer up nicely
@@ -101,10 +101,10 @@ inline eeColorA ColorFromPointer(void *ptr) {
g = (g*mult)/max + add;
b = (b*mult)/max + add;
return eeColorA(r, g, b, 255);
return ColorA(r, g, b, 255);
}
inline eeColorA ColorForShape( cpShape *shape, cpSpace *space ) {
inline ColorA ColorForShape( cpShape *shape, cpSpace *space ) {
cpBody *body = shape->body;
int nc;
@@ -112,11 +112,11 @@ inline eeColorA ColorForShape( cpShape *shape, cpSpace *space ) {
if(cpBodyIsSleeping(body)){
float v = 0.25f;
nc = (int)( v * 255 );
return eeColorA( nc, nc, nc, 255 );
return ColorA( nc, nc, nc, 255 );
} else if(body->CP_PRIVATE(node).idleTime > space->sleepTimeThreshold) {
float v = 0.9f;
nc = (int)( v * 255 );
return eeColorA( nc, nc, nc, 255 );
return ColorA( nc, nc, nc, 255 );
}
}

View File

@@ -191,40 +191,69 @@ const tColorA<T> tColorA<T>::Transparent = tColorA<T>(0,0,0,0);
template <typename T>
const tColorA<T> tColorA<T>::Black = tColorA<T>(0,0,0,255);
typedef tColor<Uint8> eeColor;
typedef tColor<Float> eeColorf;
typedef tColorA<Uint8> eeColorA;
typedef tColorA<Float> eeColorAf;
typedef tColorA<float> eeColorAff;
typedef tColor<Float> Colorf;
typedef tColorA<Uint8> ColorA;
typedef tColorA<Float> ColorAf;
typedef tColorA<float> ColorAff;
//! @brief Small class to help in some color operations
class Color {
class Color : public tColor<Uint8> {
public:
Color() : tColor<Uint8>()
{
}
/** 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) : tColor<Uint8>( r, g, b )
{
}
Color( const tColor<Uint8>& color ) :
tColor<Uint8>( color.Red, color.Green, color.Blue )
{
}
Color( Uint32 Col )
{
Col = BitOp::SwapLE32( Col );
Red = static_cast<Uint8>( Col >> 16 );
Green = static_cast<Uint8>( Col >> 8 );
Blue = static_cast<Uint8>( Col >> 0 );
}
/** Blend a source color to destination color */
static inline eeColorAf Blend( eeColorAf srcf, eeColorAf dstf ) {
static inline ColorAf Blend( ColorAf srcf, ColorAf dstf ) {
Float alpha = srcf.Alpha + dstf.Alpha * ( 1.f - srcf.Alpha );
Float red = ( srcf.Red * srcf.Alpha + dstf.Red * dstf.Alpha * ( 1.f - srcf.Alpha ) ) / alpha;
Float green = ( srcf.Green * srcf.Alpha + dstf.Green * dstf.Alpha * ( 1.f - srcf.Alpha ) ) / alpha;
Float blue = ( srcf.Blue * srcf.Alpha + dstf.Blue * dstf.Alpha * ( 1.f - srcf.Alpha ) ) / alpha;
return eeColorAf( red, green, blue, alpha );
return ColorAf( red, green, blue, alpha );
}
#define EE_COLOR_BLEND_FTOU8(color) (Uint8)( color == 1.f ? 255 : (color * 255.99f))
/** Blend a source color to destination color */
static inline eeColorA Blend( eeColorA src, eeColorA dst ) {
eeColorAf srcf( (Float)src.Red / 255.f, (Float)src.Green / 255.f, (Float)src.Blue / 255.f, (Float)src.Alpha / 255.f );
eeColorAf dstf( (Float)dst.Red / 255.f, (Float)dst.Green / 255.f, (Float)dst.Blue / 255.f, (Float)dst.Alpha / 255.f );
static inline ColorA Blend( ColorA src, ColorA dst ) {
ColorAf srcf( (Float)src.Red / 255.f, (Float)src.Green / 255.f, (Float)src.Blue / 255.f, (Float)src.Alpha / 255.f );
ColorAf dstf( (Float)dst.Red / 255.f, (Float)dst.Green / 255.f, (Float)dst.Blue / 255.f, (Float)dst.Alpha / 255.f );
Float alpha = srcf.Alpha + dstf.Alpha * ( 1.f - srcf.Alpha );
Float red = ( srcf.Red * srcf.Alpha + dstf.Red * dstf.Alpha * ( 1.f - srcf.Alpha ) ) / alpha;
Float red = ( srcf.Red * srcf.Alpha + dstf.Red * dstf.Alpha * ( 1.f - srcf.Alpha ) ) / alpha;
Float green = ( srcf.Green * srcf.Alpha + dstf.Green * dstf.Alpha * ( 1.f - srcf.Alpha ) ) / alpha;
Float blue = ( srcf.Blue * srcf.Alpha + dstf.Blue * dstf.Alpha * ( 1.f - srcf.Alpha ) ) / alpha;
return eeColorA( EE_COLOR_BLEND_FTOU8(red), EE_COLOR_BLEND_FTOU8(green), EE_COLOR_BLEND_FTOU8(blue), EE_COLOR_BLEND_FTOU8(alpha) );
return ColorA( EE_COLOR_BLEND_FTOU8(red), EE_COLOR_BLEND_FTOU8(green), EE_COLOR_BLEND_FTOU8(blue), EE_COLOR_BLEND_FTOU8(alpha) );
}
};
typedef Color RGB;
typedef Colorf RGBf;
typedef ColorA RGBA;
typedef ColorAf RGBAf;
}}

View File

@@ -8,19 +8,19 @@ namespace EE { namespace UI {
class EE_API cUIBackground {
public:
cUIBackground();
cUIBackground( const eeColorA& Color, const unsigned int& Corners = 0, const EE_BLEND_MODE& BlendMode = ALPHA_NORMAL );
cUIBackground( const ColorA& Color, const unsigned int& Corners = 0, const EE_BLEND_MODE& BlendMode = ALPHA_NORMAL );
cUIBackground( const cUIBackground& Back );
cUIBackground( const eeColorA& TopLeftColor, const eeColorA& BottomLeftColor, const eeColorA& BottomRightColor, const eeColorA& TopRightColor, const unsigned int& Corners, const EE_BLEND_MODE& BlendMode );
cUIBackground( const ColorA& TopLeftColor, const ColorA& BottomLeftColor, const ColorA& BottomRightColor, const ColorA& TopRightColor, const unsigned int& Corners, const EE_BLEND_MODE& BlendMode );
eeColorA& Color( const unsigned int& index = 0 );
ColorA& Color( const unsigned int& index = 0 );
void Color( const eeColorA& Col );
void Color( const ColorA& Col );
const std::vector<eeColorA>& Colors();
const std::vector<ColorA>& Colors();
void Colors( const eeColorA& TopLeftColor, const eeColorA& BottomLeftColor, const eeColorA& BottomRightColor, const eeColorA& TopRightColor );
void Colors( const ColorA& TopLeftColor, const ColorA& BottomLeftColor, const ColorA& BottomRightColor, const ColorA& TopRightColor );
void ColorsTo( const eeColorA& Color );
void ColorsTo( const ColorA& Color );
const EE_BLEND_MODE& Blend() const;
void Blend( const EE_BLEND_MODE& blend );
@@ -28,7 +28,7 @@ class EE_API cUIBackground {
const unsigned int& Corners() const;
void Corners( const unsigned int& corners );
protected:
std::vector<eeColorA> mColor;
std::vector<ColorA> mColor;
EE_BLEND_MODE mBlendMode;
unsigned int mCorners;

View File

@@ -10,13 +10,13 @@ class EE_API cUIBorder {
cUIBorder();
cUIBorder( const cUIBorder& border );
const eeColorA& Color() const;
void Color( const eeColorA& Col );
const ColorA& Color() const;
void Color( const ColorA& Col );
const unsigned int& Width() const;
void Width( const unsigned int& width );
protected:
eeColorA mColor;
ColorA mColor;
unsigned int mWidth;
};

View File

@@ -82,7 +82,7 @@ class EE_API cUIControlAnim : public cUIDragable {
virtual void BorderDraw();
eeColorA GetColor( const eeColorA& Col );
ColorA GetColor( const ColorA& Col );
virtual void UpdateQuad();

View File

@@ -20,7 +20,7 @@ class EE_API cUIGfx : public cUIComplexControl {
inline ~CreateParams() {}
cSubTexture * SubTexture;
eeColorA SubTextureColor;
ColorA SubTextureColor;
EE_RENDER_MODE SubTextureRender;
};
@@ -40,9 +40,9 @@ class EE_API cUIGfx : public cUIComplexControl {
void SubTexture( cSubTexture * subTexture );
const eeColorA& Color() const;
const ColorA& Color() const;
void Color( const eeColorA& color );
void Color( const ColorA& color );
const EE_RENDER_MODE& RenderMode() const;
@@ -51,7 +51,7 @@ class EE_API cUIGfx : public cUIComplexControl {
const eeVector2i& AlignOffset() const;
protected:
cSubTexture * mSubTexture;
eeColorA mColor;
ColorA mColor;
EE_RENDER_MODE mRender;
eeVector2i mAlignOffset;

View File

@@ -48,9 +48,9 @@ class EE_API cUIListBox : public cUIComplexControl {
eeRecti HScrollPadding;
eeRecti VScrollPadding;
cFont * Font;
eeColorA FontColor;
eeColorA FontOverColor;
eeColorA FontSelectedColor;
ColorA FontColor;
ColorA FontOverColor;
ColorA FontSelectedColor;
Float TouchDragDeceleration;
};
@@ -102,17 +102,17 @@ class EE_API cUIListBox : public cUIComplexControl {
std::list<cUIListBoxItem *> GetItemsSelected();
void FontColor( const eeColorA& Color );
void FontColor( const ColorA& Color );
const eeColorA& FontColor() const;
const ColorA& FontColor() const;
void FontOverColor( const eeColorA& Color );
void FontOverColor( const ColorA& Color );
const eeColorA& FontOverColor() const;
const ColorA& FontOverColor() const;
void FontSelectedColor( const eeColorA& Color );
void FontSelectedColor( const ColorA& Color );
const eeColorA& FontSelectedColor() const;
const ColorA& FontSelectedColor() const;
void Font( cFont * Font );
@@ -177,9 +177,9 @@ class EE_API cUIListBox : public cUIComplexControl {
cUIScrollBar * mVScrollBar;
cUIScrollBar * mHScrollBar;
cFont * mFont;
eeColorA mFontColor;
eeColorA mFontOverColor;
eeColorA mFontSelectedColor;
ColorA mFontColor;
ColorA mFontOverColor;
ColorA mFontSelectedColor;
Uint32 mLastPos;
Uint32 mMaxTextWidth;
Int32 mHScrollInit;

View File

@@ -61,17 +61,17 @@ class EE_API cUIManager {
bool HighlightFocus() const;
void HighlightFocusColor( const eeColorA& Color );
void HighlightFocusColor( const ColorA& Color );
const eeColorA& HighlightFocusColor() const;
const ColorA& HighlightFocusColor() const;
void HighlightOver( bool Highlight );
bool HighlightOver() const;
void HighlightOverColor( const eeColorA& Color );
void HighlightOverColor( const ColorA& Color );
const eeColorA& HighlightOverColor() const;
const ColorA& HighlightOverColor() const;
void SendMouseClick( cUIControl * ToCtrl, const eeVector2i& Pos, const Uint32 Flags );
@@ -120,8 +120,8 @@ class EE_API cUIManager {
Uint32 mResizeCb;
Uint32 mFlags;
eeColorA mHighlightFocusColor;
eeColorA mHighlightOverColor;
ColorA mHighlightFocusColor;
ColorA mHighlightOverColor;
eeVector2i mMouseDownPos;
bool mInit;

View File

@@ -48,10 +48,10 @@ class EE_API cUIMenu : public cUIComplexControl {
Uint32 MinSpaceForIcons;
Uint32 MinRightMargin;
cFont * Font;
eeColorA FontColor;
eeColorA FontShadowColor;
eeColorA FontOverColor;
eeColorA FontSelectedColor;
ColorA FontColor;
ColorA FontShadowColor;
ColorA FontOverColor;
ColorA FontSelectedColor;
};
@@ -108,10 +108,10 @@ class EE_API cUIMenu : public cUIComplexControl {
std::deque<cUIControl *> mItems;
eeRecti mPadding;
cFont * mFont;
eeColorA mFontColor;
eeColorA mFontShadowColor;
eeColorA mFontOverColor;
eeColorA mFontSelectedColor;
ColorA mFontColor;
ColorA mFontShadowColor;
ColorA mFontOverColor;
ColorA mFontSelectedColor;
Uint32 mMinWidth;
Uint32 mMinSpaceForIcons;
Uint32 mMinRightMargin;

View File

@@ -45,9 +45,9 @@ class EE_API cUIPushButton : public cUIComplexControl {
}
cFont * Font;
eeColorA FontColor;
eeColorA FontShadowColor;
eeColorA FontOverColor;
ColorA FontColor;
ColorA FontShadowColor;
ColorA FontOverColor;
cSubTexture * Icon;
Int32 IconHorizontalMargin;
bool IconAutoMargin;
@@ -82,16 +82,16 @@ class EE_API cUIPushButton : public cUIComplexControl {
cUITextBox * TextBox() const;
const eeColorA& FontColor() const;
const ColorA& FontColor() const;
void FontColor( const eeColorA& color );
void FontColor( const ColorA& color );
const eeColorA& FontOverColor() const;
const ColorA& FontOverColor() const;
void FontOverColor( const eeColorA& color );
void FontOverColor( const ColorA& color );
protected:
eeColorA mFontColor;
eeColorA mFontOverColor;
ColorA mFontColor;
ColorA mFontOverColor;
cUIGfx * mIcon;
cUITextBox * mTextBox;
Int32 mIconSpace;

View File

@@ -32,9 +32,9 @@ class EE_API cUISkin {
virtual cSubTexture * GetSubTexture( const Uint32& State ) const = 0;
virtual void SetColor( const Uint32& State, const eeColorA& Color );
virtual void SetColor( const Uint32& State, const ColorA& Color );
virtual const eeColorA& GetColor( const Uint32& State ) const;
virtual const ColorA& GetColor( const Uint32& State ) const;
virtual void SetSkins();
@@ -59,7 +59,7 @@ class EE_API cUISkin {
std::string mName;
Uint32 mNameHash;
Uint32 mColorDefault;
eeColorA mColor[ cUISkinState::StateCount ];
ColorA mColor[ cUISkinState::StateCount ];
cUITheme * mTheme;
void StateBack( const Uint32& State );

View File

@@ -40,7 +40,7 @@ class EE_API cUISkinComplex : public cUISkin {
virtual cUISkin * Copy();
protected:
cSubTexture * mSubTexture[ cUISkinState::StateCount ][ SideCount ];
eeColorA mTempColor;
ColorA mTempColor;
void StateNormalToState( const Uint32& State );
};

View File

@@ -23,7 +23,7 @@ class EE_API cUISkinSimple : public cUISkin {
virtual cUISkin * Copy();
protected:
cSubTexture * mSubTexture[ cUISkinState::StateCount ];
eeColorA mTempColor;
ColorA mTempColor;
void StateNormalToState( const Uint32& State );
};

View File

@@ -44,9 +44,9 @@ class EE_API cUISprite : public cUIComplexControl {
void Sprite( cSprite * sprite );
eeColorA Color() const;
ColorA Color() const;
void Color( const eeColorA& color );
void Color( const ColorA& color );
const EE_RENDER_MODE& RenderMode() const;

View File

@@ -47,10 +47,10 @@ class EE_API cUITabWidget : public cUIComplexControl {
inline ~CreateParams() {}
cFont * Font;
eeColorA FontColor;
eeColorA FontShadowColor;
eeColorA FontOverColor;
eeColorA FontSelectedColor;
ColorA FontColor;
ColorA FontShadowColor;
ColorA FontOverColor;
ColorA FontSelectedColor;
Int32 TabSeparation;
Uint32 MaxTextLength;
Uint32 TabWidgetHeight;
@@ -60,7 +60,7 @@ class EE_API cUITabWidget : public cUIComplexControl {
bool TabsClosable;
bool SpecialBorderTabs; //! Indicates if the periferical tabs ( the left and right border tab ) are different from the central tabs.
bool DrawLineBelowTabs;
eeColorA LineBelowTabsColor;
ColorA LineBelowTabsColor;
Int32 LineBewowTabsYOffset;
};
@@ -112,10 +112,10 @@ class EE_API cUITabWidget : public cUIComplexControl {
cUIComplexControl * mCtrlContainer;
cUIComplexControl * mTabContainer;
cFont * mFont;
eeColorA mFontColor;
eeColorA mFontShadowColor;
eeColorA mFontOverColor;
eeColorA mFontSelectedColor;
ColorA mFontColor;
ColorA mFontShadowColor;
ColorA mFontOverColor;
ColorA mFontSelectedColor;
Int32 mTabSeparation;
Uint32 mMaxTextLength;
Uint32 mTabWidgetHeight;
@@ -124,7 +124,7 @@ class EE_API cUITabWidget : public cUIComplexControl {
bool mTabsClosable;
bool mSpecialBorderTabs;
bool mDrawLineBelowTabs;
eeColorA mLineBelowTabsColor;
ColorA mLineBelowTabsColor;
Int32 mLineBewowTabsYOffset;
std::deque<cUITab*> mTabs;

View File

@@ -31,9 +31,9 @@ class EE_API cUITextBox : public cUIComplexControl {
inline ~CreateParams() {}
cFont * Font;
eeColorA FontColor;
eeColorA FontShadowColor;
eeColorA FontSelectionBackColor;
ColorA FontColor;
ColorA FontShadowColor;
ColorA FontSelectionBackColor;
};
cUITextBox( const cUITextBox::CreateParams& Params );
@@ -56,17 +56,17 @@ class EE_API cUITextBox : public cUIComplexControl {
virtual void Text( const String& text );
const eeColorA& Color() const;
const ColorA& Color() const;
void Color( const eeColorA& color );
void Color( const ColorA& color );
const eeColorA& ShadowColor() const;
const ColorA& ShadowColor() const;
void ShadowColor( const eeColorA& color );
void ShadowColor( const ColorA& color );
const eeColorA& SelectionBackColor() const;
const ColorA& SelectionBackColor() const;
void SelectionBackColor( const eeColorA& color );
void SelectionBackColor( const ColorA& color );
virtual void OnTextChanged();
@@ -94,9 +94,9 @@ class EE_API cUITextBox : public cUIComplexControl {
protected:
cTextCache * mTextCache;
String mString;
eeColorA mFontColor;
eeColorA mFontShadowColor;
eeColorA mFontSelectionBackColor;
ColorA mFontColor;
ColorA mFontShadowColor;
ColorA mFontSelectionBackColor;
eeVector2f mAlignOffset;
eeRecti mPadding;
Int32 mSelCurInit;

View File

@@ -78,21 +78,21 @@ class EE_API cUITheme : protected ResourceManager<cUISkin> {
cFont * Font() const;
const eeColorA& FontColor() const;
const ColorA& FontColor() const;
const eeColorA& FontShadowColor() const;
const ColorA& FontShadowColor() const;
const eeColorA& FontOverColor() const;
const ColorA& FontOverColor() const;
const eeColorA& FontSelectedColor() const;
const ColorA& FontSelectedColor() const;
void FontColor( const eeColorA& Color );
void FontColor( const ColorA& Color );
void FontShadowColor( const eeColorA& Color );
void FontShadowColor( const ColorA& Color );
void FontOverColor( const eeColorA& Color );
void FontOverColor( const ColorA& Color );
void FontSelectedColor( const eeColorA& Color );
void FontSelectedColor( const ColorA& Color );
void UseDefaultThemeValues( const bool& Use );
@@ -102,7 +102,7 @@ class EE_API cUITheme : protected ResourceManager<cUISkin> {
cSubTexture * GetIconByName( const std::string& name );
virtual cUIGfx * CreateGfx( cSubTexture * SubTexture, cUIControl * Parent = NULL, const eeSize& Size = eeSize(), const eeVector2i& Pos = eeVector2i(), const Uint32& Flags = UI_CONTROL_DEFAULT_FLAGS_CENTERED | UI_AUTO_SIZE, eeColorA SubTextureColor = eeColorA(255,255,255,255), EE_RENDER_MODE SubTextureRender = RN_NORMAL );
virtual cUIGfx * CreateGfx( cSubTexture * SubTexture, cUIControl * Parent = NULL, const eeSize& Size = eeSize(), const eeVector2i& Pos = eeVector2i(), const Uint32& Flags = UI_CONTROL_DEFAULT_FLAGS_CENTERED | UI_AUTO_SIZE, ColorA SubTextureColor = ColorA(255,255,255,255), EE_RENDER_MODE SubTextureRender = RN_NORMAL );
virtual cUISprite * CreateSprite( cSprite * Sprite, cUIControl * Parent = NULL, const eeSize& Size = eeSize(), const eeVector2i& Pos = eeVector2i(), const Uint32& Flags = UI_CONTROL_DEFAULT_FLAGS_CENTERED | UI_AUTO_SIZE, bool DeallocSprite = true, EE_RENDER_MODE SpriteRender = RN_NORMAL );
@@ -157,10 +157,10 @@ class EE_API cUITheme : protected ResourceManager<cUISkin> {
std::string mAbbr;
cTextureAtlas * mTextureAtlas;
cFont * mFont;
eeColorA mFontColor;
eeColorA mFontShadowColor;
eeColorA mFontOverColor;
eeColorA mFontSelectedColor;
ColorA mFontColor;
ColorA mFontShadowColor;
ColorA mFontOverColor;
ColorA mFontSelectedColor;
bool mUseDefaultThemeValues;
std::list<std::string> mUIElements;
std::list<std::string> mUIIcons;

View File

@@ -34,8 +34,8 @@ class EE_API cUITooltip : public cUIControlAnim {
inline ~CreateParams() {}
cFont * Font;
eeColorA FontColor;
eeColorA FontShadowColor;
ColorA FontColor;
ColorA FontShadowColor;
eeRecti Padding;
};
@@ -65,13 +65,13 @@ class EE_API cUITooltip : public cUIControlAnim {
virtual void Text( const String& text );
const eeColorA& Color() const;
const ColorA& Color() const;
void Color( const eeColorA& color );
void Color( const ColorA& color );
const eeColorA& ShadowColor() const;
const ColorA& ShadowColor() const;
void ShadowColor( const eeColorA& color );
void ShadowColor( const ColorA& color );
virtual void OnTextChanged();
@@ -98,8 +98,8 @@ class EE_API cUITooltip : public cUIControlAnim {
const Time & TooltipTime() const;
protected:
cTextCache * mTextCache;
eeColorA mFontColor;
eeColorA mFontShadowColor;
ColorA mFontColor;
ColorA mFontShadowColor;
eeVector2f mAlignOffset;
eeRecti mPadding;
Time mTooltipTime;

View File

@@ -32,7 +32,7 @@ class EE_API cUIWindow : public cUIComplexControl {
eeVector2i ButtonsPositionFixer;
Uint32 ButtonsSeparation;
Int32 MinCornerDistance;
eeColorA TitleFontColor;
ColorA TitleFontColor;
Uint8 BaseAlpha;
bool DecorationAutoSize;
bool BorderAutoSize;
@@ -158,7 +158,7 @@ class EE_API cUIWindow : public cUIComplexControl {
UI_RESIZE_TYPE mResizeType;
eeVector2i mResizePos;
eeColorA mTitleFontColor;
ColorA mTitleFontColor;
KeyboardShortcuts mKbShortcuts;

View File

@@ -39,10 +39,10 @@ class EE_API cUIWinMenu : public cUIComplexControl {
}
cFont * Font;
eeColorA FontColor;
eeColorA FontShadowColor;
eeColorA FontOverColor;
eeColorA FontSelectedColor;
ColorA FontColor;
ColorA FontShadowColor;
ColorA FontOverColor;
ColorA FontSelectedColor;
Uint32 MarginBetweenButtons;
Uint32 ButtonMargin;
Uint32 MenuHeight;
@@ -63,17 +63,17 @@ class EE_API cUIWinMenu : public cUIComplexControl {
virtual void SetTheme( cUITheme * Theme );
void FontColor( const eeColorA& Color );
void FontColor( const ColorA& Color );
const eeColorA& FontColor() const;
const ColorA& FontColor() const;
void FontOverColor( const eeColorA& Color );
void FontOverColor( const ColorA& Color );
const eeColorA& FontOverColor() const;
const ColorA& FontOverColor() const;
void FontSelectedColor( const eeColorA& Color );
void FontSelectedColor( const ColorA& Color );
const eeColorA& FontSelectedColor() const;
const ColorA& FontSelectedColor() const;
cFont * Font() const;
@@ -84,10 +84,10 @@ class EE_API cUIWinMenu : public cUIComplexControl {
typedef std::list< std::pair< cUISelectButton *, cUIPopUpMenu * > > WinMenuList;
cFont * mFont;
eeColorA mFontColor;
eeColorA mFontShadowColor;
eeColorA mFontOverColor;
eeColorA mFontSelectedColor;
ColorA mFontColor;
ColorA mFontShadowColor;
ColorA mFontOverColor;
ColorA mFontSelectedColor;
cUIPopUpMenu * mCurrentMenu;
Uint32 mMarginBetweenButtons;
Uint32 mButtonMargin;

View File

@@ -1,16 +1,18 @@
#ifndef EE_WINDOWCCURSOR_HPP
#define EE_WINDOWCCURSOR_HPP
#include <eepp/window/base.hpp>
#include <eepp/core.hpp>
#include <eepp/graphics/cimage.hpp>
#include <eepp/graphics/ctexture.hpp>
using namespace EE::Graphics;
#include <eepp/window/cwindow.hpp>
#include <eepp/window/windowhandle.hpp>
namespace EE { namespace Window {
class cWindow;
class EE_API cCursor {
public:
/** @return The cursor id */

View File

@@ -1,7 +1,13 @@
#ifndef EE_WINDOWCPLATFORMIMPL_HPP
#define EE_WINDOWCPLATFORMIMPL_HPP
#include <eepp/window/base.hpp>
#include <eepp/core.hpp>
#include <eepp/math/vector2.hpp>
using namespace EE::Math;
#include <eepp/window/windowhandle.hpp>
#include <eepp/window/windowcontext.hpp>
#include <eepp/window/cursorhelper.hpp>
namespace EE {
@@ -21,6 +27,7 @@ class cCursor;
namespace EE { namespace Window { namespace Platform {
using namespace EE::Window;
using namespace EE::Graphics;
/** This is an abstraction of some platform specific implementations
* It's not garanteed that everything is implemented in every platform.

View File

@@ -115,7 +115,7 @@ class WindowInfo {
eeSize DesktopResolution;
eeSize WindowSize;
Uint32 Flags;
eeColor BackgroundColor;
RGB BackgroundColor;
bool Created;
bool Maximized;
eeWindowContex Context;
@@ -238,7 +238,7 @@ class EE_API cWindow {
virtual void Display( bool clear = false );
/** @return The elapsed time for the last frame rendered */
virtual Time Elapsed() const;
virtual System::Time Elapsed() const;
/** @return The current frames per second of the screen */
virtual Uint32 FPS() const;
@@ -294,10 +294,10 @@ class EE_API cWindow {
void SetViewport( const Int32& x, const Int32& y, const Uint32& Width, const Uint32& Height, const bool& UpdateProjectionMatrix = true );
/** Set the window background color */
void BackColor( const eeColor& Color );
void BackColor( const RGB& Color );
/** @return The background clear color */
const eeColor& BackColor() const;
const RGB& BackColor() const;
/** Captures the window front buffer and saves it to disk. \n
* You have to call it before Display, and after render all the objects. \n
@@ -481,8 +481,8 @@ class EE_API cWindow {
};
cFPSData FPS;
Clock * FrameElapsed;
Time ElapsedTime;
Clock * FrameElapsed;
System::Time ElapsedTime;
cFrameData();

View File

@@ -479,7 +479,6 @@
../../src/eepp/graphics/cimage.cpp
../../src/eepp/graphics/cglobaltextureatlas.cpp
../../src/eepp/graphics/cglobalbatchrenderer.cpp
../../src/eepp/graphics/cframebufferpbuffer.cpp
../../src/eepp/graphics/cframebuffermanager.cpp
../../src/eepp/graphics/cframebufferfbo.cpp
../../src/eepp/graphics/cframebuffer.cpp
@@ -547,7 +546,6 @@
../../src/eepp/window/backend/SFML/ccursormanagersfml.cpp
../../src/eepp/window/backend/SFML/cclipboardsfml.cpp
../../src/eepp/window/cbackend.hpp
../../src/eepp/graphics/cframebufferpbuffer.hpp
../../src/eepp/graphics/cframebufferfbo.hpp
../../src/eepp/graphics/renderer/rendererhelper.hpp
../../include/eepp/graphics/packerhelper.hpp
@@ -678,3 +676,5 @@
../../src/eepp/core/version.cpp
../../include/eepp/system/clock.hpp
../../include/eepp/system/clock.hpp
../../src/eepp/window/backend/SDL2/wminfo.cpp
../../src/eepp/window/backend/SDL2/wminfo.hpp

View File

@@ -40,11 +40,11 @@ void cGameObjectObject::Draw() {
cPrimitives P;
P.FillMode( DRAW_FILL );
P.SetColor( eeColorA( colFill, colFill, colFill, colFill ) );
P.SetColor( ColorA( colFill, colFill, colFill, colFill ) );
P.DrawRectangle( mRect );
P.FillMode( DRAW_LINE );
P.SetColor( eeColorA( 255, 255, 0, 200 ) );
P.SetColor( ColorA( 255, 255, 0, 200 ) );
P.DrawRectangle( mRect );
}

View File

@@ -33,11 +33,11 @@ void cGameObjectPolygon::Draw() {
cPrimitives P;
P.FillMode( DRAW_FILL );
P.SetColor( eeColorA( colFill, colFill, colFill, colFill ) );
P.SetColor( ColorA( colFill, colFill, colFill, colFill ) );
P.DrawPolygon( mPoly );
P.FillMode( DRAW_LINE );
P.SetColor( eeColorA( 255, 255, 0, 200 ) );
P.SetColor( ColorA( 255, 255, 0, 200 ) );
P.DrawPolygon( mPoly );
}

View File

@@ -27,12 +27,12 @@ void cGameObjectPolyline::Draw() {
if ( mSelected ) {
P.FillMode( DRAW_FILL );
P.SetColor( eeColorA( 150, 150, 150, 150 ) );
P.SetColor( ColorA( 150, 150, 150, 150 ) );
P.DrawPolygon( mPoly );
}
P.FillMode( DRAW_LINE );
P.SetColor( eeColorA( 255, 255, 0, 200 ) );
P.SetColor( ColorA( 255, 255, 0, 200 ) );
P.DrawPolygon( mPoly );
}

View File

@@ -68,7 +68,7 @@ void cGameObjectSubTexture::Draw() {
}
}
} else {
mSubTexture->Draw( mPos.x, mPos.y, eeColorA(), GetAngle(), eeVector2f::One, ALPHA_NORMAL, RenderModeFromFlags() );
mSubTexture->Draw( mPos.x, mPos.y, ColorA(), GetAngle(), eeVector2f::One, ALPHA_NORMAL, RenderModeFromFlags() );
}
}
}

View File

@@ -4,7 +4,7 @@
namespace EE { namespace Gaming {
cGameObjectSubTextureEx::cGameObjectSubTextureEx( const Uint32& Flags, cLayer * Layer, cSubTexture * SubTexture, const eeVector2f& Pos, EE_BLEND_MODE Blend, EE_RENDER_MODE Render, Float Angle, eeVector2f Scale, eeColorA Color ) :
cGameObjectSubTextureEx::cGameObjectSubTextureEx( const Uint32& Flags, cLayer * Layer, cSubTexture * SubTexture, const eeVector2f& Pos, EE_BLEND_MODE Blend, EE_RENDER_MODE Render, Float Angle, eeVector2f Scale, ColorA Color ) :
cGameObjectSubTexture( Flags, Layer, SubTexture, Pos ),
mBlend( Blend ),
mRender( Render ),

View File

@@ -98,12 +98,12 @@ void cGameObjectVirtual::Draw() {
}
}
} else {
mSubTexture->Draw( mPos.x, mPos.y, eeColorA(), GetAngle(), eeVector2f::One, ALPHA_NORMAL, RenderModeFromFlags() );
mSubTexture->Draw( mPos.x, mPos.y, ColorA(), GetAngle(), eeVector2f::One, ALPHA_NORMAL, RenderModeFromFlags() );
}
} else {
cPrimitives P;
eeColorA C( mDataId );
ColorA C( mDataId );
C.Alpha = 255;
P.SetColor( C );

View File

@@ -13,13 +13,13 @@ cLight::cLight() :
cLight::~cLight() {
}
cLight::cLight( const Float& Radius, const Float& x, const Float& y, const eeColor& Color, LIGHT_TYPE Type ) :
cLight::cLight( const Float& Radius, const Float& x, const Float& y, const RGB& Color, LIGHT_TYPE Type ) :
mActive( true )
{
Create( Radius, x, y, Color, Type );
}
void cLight::Create( const Float& Radius, const Float& x, const Float& y, const eeColor& Color, LIGHT_TYPE Type ) {
void cLight::Create( const Float& Radius, const Float& x, const Float& y, const RGB& Color, LIGHT_TYPE Type ) {
mRadius = Radius;
mColor = Color;
mType = Type;
@@ -27,7 +27,7 @@ void cLight::Create( const Float& Radius, const Float& x, const Float& y, const
UpdatePos( x, y );
}
eeColor cLight::ProcessVertex( const Float& PointX, const Float& PointY, const eeColor& VertexColor, const eeColor& BaseColor ) {
RGB cLight::ProcessVertex( const Float& PointX, const Float& PointY, const RGB& VertexColor, const RGB& BaseColor ) {
Float VertexDist;
if ( mActive ) {
@@ -40,7 +40,7 @@ eeColor cLight::ProcessVertex( const Float& PointX, const Float& PointY, const e
}
if ( VertexDist <= mRadius ) {
eeColor TmpRGB;
RGB TmpRGB;
Uint8 TmpColor;
Float LightC;
@@ -67,7 +67,7 @@ eeColor cLight::ProcessVertex( const Float& PointX, const Float& PointY, const e
return BaseColor;
}
eeColorA cLight::ProcessVertex( const Float& PointX, const Float& PointY, const eeColorA& VertexColor, const eeColorA& BaseColor ) {
ColorA cLight::ProcessVertex( const Float& PointX, const Float& PointY, const ColorA& VertexColor, const ColorA& BaseColor ) {
Float VertexDist;
if ( mActive ) {
@@ -80,7 +80,7 @@ eeColorA cLight::ProcessVertex( const Float& PointX, const Float& PointY, const
}
if ( VertexDist <= mRadius ) {
eeColorA TmpRGB;
ColorA TmpRGB;
Uint8 TmpColor;
Float LightC;
@@ -107,11 +107,11 @@ eeColorA cLight::ProcessVertex( const Float& PointX, const Float& PointY, const
return BaseColor;
}
eeColor cLight::ProcessVertex( const eeVector2f& Pos, const eeColor& VertexColor, const eeColor& BaseColor ) {
RGB cLight::ProcessVertex( const eeVector2f& Pos, const RGB& VertexColor, const RGB& BaseColor ) {
return ProcessVertex( Pos.x, Pos.y, VertexColor, BaseColor );
}
eeColorA cLight::ProcessVertex( const eeVector2f& Pos, const eeColorA& VertexColor, const eeColorA& BaseColor ) {
ColorA cLight::ProcessVertex( const eeVector2f& Pos, const ColorA& VertexColor, const ColorA& BaseColor ) {
return ProcessVertex( Pos.x, Pos.y, VertexColor, BaseColor );
}
@@ -163,11 +163,11 @@ void cLight::Active( const bool& active ) {
mActive = active;
}
void cLight::Color( const eeColor& color ) {
void cLight::Color( const RGB& color ) {
mColor = color;
}
const eeColor& cLight::Color() const {
const RGB& cLight::Color() const {
return mColor;
}

View File

@@ -39,7 +39,7 @@ void cLightManager::UpdateByVertex() {
eeVector2i end = mMap->EndTile();
eeAABB VisibleArea = mMap->GetViewAreaAABB();
eeSize TileSize = mMap->TileSize();
eeColorA BaseColor = mMap->BaseColor();
ColorA BaseColor = mMap->BaseColor();
bool firstLight = true;
eeVector2i Pos;
@@ -92,7 +92,7 @@ void cLightManager::UpdateByTile() {
eeAABB VisibleArea = mMap->GetViewAreaAABB();
eeSize TileSize = mMap->TileSize();
eeSize HalfTileSize = mMap->TileSize() / 2;
eeColorA BaseColor = mMap->BaseColor();
ColorA BaseColor = mMap->BaseColor();
bool firstLight = true;
eeVector2i Pos;
@@ -127,8 +127,8 @@ void cLightManager::UpdateByTile() {
}
}
eeColorA cLightManager::GetColorFromPos( const eeVector2f& Pos ) {
eeColorA Col( mMap->BaseColor() );
ColorA cLightManager::GetColorFromPos( const eeVector2f& Pos ) {
ColorA Col( mMap->BaseColor() );
if ( !mLights.size() )
return Col;
@@ -167,7 +167,7 @@ void cLightManager::RemoveLight( const eeVector2f& OverPos ) {
}
}
const eeColorA * cLightManager::GetTileColor( const eeVector2i& TilePos ) {
const ColorA * cLightManager::GetTileColor( const eeVector2i& TilePos ) {
eeASSERT( 1 == mNumVertex );
if ( !mLights.size() )
@@ -176,7 +176,7 @@ const eeColorA * cLightManager::GetTileColor( const eeVector2i& TilePos ) {
return mTileColors[ TilePos.x ][ TilePos.y ][0];
}
const eeColorA * cLightManager::GetTileColor( const eeVector2i& TilePos, const Uint32& Vertex ) {
const ColorA * cLightManager::GetTileColor( const eeVector2i& TilePos, const Uint32& Vertex ) {
eeASSERT( 4 == mNumVertex );
if ( !mLights.size() )
@@ -187,16 +187,16 @@ const eeColorA * cLightManager::GetTileColor( const eeVector2i& TilePos, const U
void cLightManager::AllocateColors() {
eeSize Size = mMap->Size();
mTileColors = eeNewArray( eeColorA***, Size.Width() );
mTileColors = eeNewArray( ColorA***, Size.Width() );
for ( Int32 x = 0; x < Size.x; x++ ) {
mTileColors[x] = eeNewArray( eeColorA**, Size.Height() );
mTileColors[x] = eeNewArray( ColorA**, Size.Height() );
for ( Int32 y = 0; y < Size.y; y++ ) {
mTileColors[x][y] = eeNewArray( eeColorA*, mNumVertex );
mTileColors[x][y] = eeNewArray( ColorA*, mNumVertex );
for ( Int32 v = 0; v < mNumVertex; v++ ) {
mTileColors[x][y][v] = eeNew( eeColorA, (255,255,255,255) );
mTileColors[x][y][v] = eeNew( ColorA, (255,255,255,255) );
}
}
}

View File

@@ -61,7 +61,7 @@ void cMap::Reset() {
mMaxLayers = 0;
mMouseOver = false;
mViewSize = eeSize( 800, 600 );
mBaseColor = eeColorA( 255, 255, 255, 255 );
mBaseColor = ColorA( 255, 255, 255, 255 );
}
void cMap::ForceHeadersOnLoad( eeSize mapSize, eeSize tileSize, Uint32 numLayers, Uint32 flags ) {
@@ -125,11 +125,11 @@ void cMap::CreateEmptyTile() {
if ( NULL == Tex ) {
Uint32 x, y;
eeColorA Col( mGridLinesColor );
ColorA Col( mGridLinesColor );
cImage Img( mTileSize.Width(), mTileSize.Height(), 4 );
Img.FillWithColor( eeColorA( 0, 0, 0, 0 ) );
Img.FillWithColor( ColorA( 0, 0, 0, 0 ) );
for ( x = 0; x < Img.Width(); x++ ) {
Img.SetPixel( x, 0, Col );
@@ -222,9 +222,9 @@ void cMap::Draw() {
Uint8 Alpha = static_cast<Uint8>( (Float)mBackColor.A() * ( (Float)mBackAlpha / 255.f ) );
P.SetColor( eeColorA( mBackColor.R(), mBackColor.G(), mBackColor.B(), Alpha ) );
P.SetColor( ColorA( mBackColor.R(), mBackColor.G(), mBackColor.B(), Alpha ) );
P.DrawRectangle( eeRectf( eeVector2f( mScreenPos.x, mScreenPos.y ), eeSizef( mViewSize.x, mViewSize.y ) ), 0.f, eeVector2f::One );
P.SetColor( eeColorA( 255, 255, 255, 255 ) );
P.SetColor( ColorA( 255, 255, 255, 255 ) );
}
float oldM[16];
@@ -276,7 +276,7 @@ void cMap::GridDraw() {
eeVector2i end = EndTile();
Float tx, ty;
eeColorA TileTexCol( 255, 255, 255, mBackAlpha );
ColorA 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 cMap::GridDraw() {
eeVector2i TPos( x, y );
if ( mLightManager->IsByVertex() ) {
eeColorA TileTexCol0( *mLightManager->GetTileColor( TPos, 0 ) );
eeColorA TileTexCol1( *mLightManager->GetTileColor( TPos, 1 ) );
eeColorA TileTexCol2( *mLightManager->GetTileColor( TPos, 2 ) );
eeColorA TileTexCol3( *mLightManager->GetTileColor( TPos, 3 ) );
ColorA TileTexCol0( *mLightManager->GetTileColor( TPos, 0 ) );
ColorA TileTexCol1( *mLightManager->GetTileColor( TPos, 1 ) );
ColorA TileTexCol2( *mLightManager->GetTileColor( TPos, 2 ) );
ColorA TileTexCol3( *mLightManager->GetTileColor( TPos, 3 ) );
TileTexCol0.Alpha = TileTexCol1.Alpha = TileTexCol2.Alpha = TileTexCol3.Alpha = mBackAlpha;
@@ -519,11 +519,11 @@ const eeVector2i& cMap::ExtraTiles() const {
return mExtraTiles;
}
void cMap::BaseColor( const eeColorA& color ) {
void cMap::BaseColor( const ColorA& color ) {
mBaseColor = color;
}
const eeColorA& cMap::BaseColor() const {
const ColorA& cMap::BaseColor() const {
return mBaseColor;
}
@@ -806,7 +806,7 @@ bool cMap::LoadFromStream( IOStream& IOS ) {
Create( mForcedHeaders->MapSize, mForcedHeaders->NumLayers, mForcedHeaders->TileSize, mForcedHeaders->Flags );
}
BaseColor( eeColorA( MapHdr.BaseColor ) );
BaseColor( ColorA( MapHdr.BaseColor ) );
//! Load Properties
if ( MapHdr.PropertyCount ) {
@@ -1009,8 +1009,11 @@ bool cMap::LoadFromStream( IOStream& IOS ) {
for ( i = 0; i < MapHdr.LightsCount; i++ ) {
tLightHdr = &( tLighsHdr[ i ] );
ColorA color( tLightHdr->Color );
RGB rgb( color.ToColor() );
mLightManager->AddLight(
eeNew( cLight, ( tLightHdr->Radius, tLightHdr->PosX, tLightHdr->PosY, eeColorA( tLightHdr->Color ).ToColor(), (LIGHT_TYPE)tLightHdr->Type ) )
eeNew( cLight, ( tLightHdr->Radius, tLightHdr->PosX, tLightHdr->PosY, rgb, (LIGHT_TYPE)tLightHdr->Type ) )
);
}
@@ -1349,7 +1352,7 @@ void cMap::SaveToStream( IOStream& IOS ) {
tLightHdr.Radius = Light->Radius();
tLightHdr.PosX = (Int32)Light->Position().x;
tLightHdr.PosY = (Int32)Light->Position().y;
tLightHdr.Color = eeColorA( Light->Color() ).GetValue();
tLightHdr.Color = ColorA( Light->Color() ).GetValue();
tLightHdr.Type = Light->Type();
IOS.Write( (const char*)&tLightHdr, sizeof(sMapLightHdr) );
@@ -1452,11 +1455,11 @@ void cMap::BackAlpha( const Uint8& alpha ) {
mBackAlpha = alpha;
}
const eeColorA& cMap::BackColor() const {
const ColorA& cMap::BackColor() const {
return mBackColor;
}
void cMap::BackColor( const eeColorA& col ) {
void cMap::BackColor( const ColorA& col ) {
mBackColor = col;
}
@@ -1464,11 +1467,11 @@ Uint32 cMap::GetNewObjectId() {
return ++mLastObjId;
}
void cMap::GridLinesColor( const eeColorA& Col ) {
void cMap::GridLinesColor( const ColorA& Col ) {
mGridLinesColor = Col;
}
const eeColorA& cMap::GridLinesColor() const {
const ColorA& cMap::GridLinesColor() const {
return mGridLinesColor;
}

View File

@@ -44,7 +44,7 @@ void cObjectLayer::Draw( const eeVector2f &Offset ) {
cTexture * Tex = mMap->GetBlankTileTexture();
if ( mMap->ShowBlocked() && NULL != Tex ) {
eeColorA Col( 255, 0, 0, 200 );
ColorA Col( 255, 0, 0, 200 );
for ( it = mObjects.begin(); it != mObjects.end(); it++ ) {
cGameObject * Obj = (*it);

View File

@@ -46,7 +46,7 @@ void cTileLayer::Draw( const eeVector2f& Offset ) {
for ( Int32 y = start.y; y < end.y; y++ ) {
if ( NULL != mTiles[x][y] ) {
if ( mTiles[x][y]->Blocked() ) {
Tex->Draw( x * mMap->TileSize().x, y * mMap->TileSize().y, 0 , eeVector2f::One, eeColorA( 255, 0, 0, 200 ) );
Tex->Draw( x * mMap->TileSize().x, y * mMap->TileSize().y, 0 , eeVector2f::One, ColorA( 255, 0, 0, 200 ) );
}
}
}

View File

@@ -316,7 +316,7 @@ void cMapEditor::CreateSubTextureContainer( Int32 Width ) {
mGfxPreview = mTheme->CreateGfx( NULL, mSGCont, eeSize( Width, Width ), eeVector2i( 0, mSubTextureList->Pos().y + mSubTextureList->Size().Height() + 4 ), UI_VALIGN_CENTER | UI_HALIGN_CENTER | UI_ANCHOR_RIGHT | UI_ANCHOR_TOP | UI_AUTO_FIT );
mGfxPreview->Border( true );
mGfxPreview->Border()->Color( eeColorA( 0, 0, 0, 200 ) );
mGfxPreview->Border()->Color( ColorA( 0, 0, 0, 200 ) );
cUIComplexControl::CreateParams DIParams;
DIParams.Parent( mSubTextureCont );
@@ -345,8 +345,8 @@ void cMapEditor::CreateLighContainer() {
ComParams.Parent( mLightCont );
ComParams.PosSet( Txt->Pos().x, Txt->Pos().y + Txt->Size().Height() + 4 );
ComParams.SizeSet( 58, 64 );
ComParams.Background.Color( eeColorA(255,255,255,255) );
ComParams.Border.Color( eeColorA( 100, 100, 100, 200 ) );
ComParams.Background.Color( ColorA(255,255,255,255) );
ComParams.Border.Color( ColorA( 100, 100, 100, 200 ) );
ComParams.Flags |= UI_FILL_BACKGROUND | UI_BORDER;
mUIBaseColor = eeNew( cUIComplexControl, ( ComParams ) );
mUIBaseColor->Visible( true );
@@ -530,7 +530,7 @@ void cMapEditor::OnLightRadiusChange( cLight * Light ) {
}
void cMapEditor::OnLightSelect( cLight * Light ) {
eeColorA Col( Light->Color() );
ColorA Col( Light->Color() );
mUIRedSlider->Value( Col.R() );
mUIGreenSlider->Value( Col.G() );
@@ -549,39 +549,39 @@ void cMapEditor::OnNewLight( const cUIEvent * Event ) {
}
void cMapEditor::OnRedChange( const cUIEvent * Event ) {
eeColorA Col = mUIBaseColor->Background()->Color();
ColorA Col = mUIBaseColor->Background()->Color();
Col.Red = (Uint8)mUIRedSlider->Value();
mUIBaseColor->Background()->Color( Col );
mUIRedTxt->Text( String::ToStr( (Int32)mUIRedSlider->Value() ) );
if ( NULL != mUIMap->GetSelectedLight() ) {
eeColor lCol( mUIMap->GetSelectedLight()->Color() );
RGB lCol( mUIMap->GetSelectedLight()->Color() );
lCol.Red = Col.R();
mUIMap->GetSelectedLight()->Color( lCol );
}
}
void cMapEditor::OnGreenChange( const cUIEvent * Event ) {
eeColorA Col = mUIBaseColor->Background()->Color();
ColorA Col = mUIBaseColor->Background()->Color();
Col.Green = (Uint8)mUIGreenSlider->Value();
mUIBaseColor->Background()->Color( Col );
mUIGreenTxt->Text( String::ToStr( (Uint32)mUIGreenSlider->Value() ) );
if ( NULL != mUIMap->GetSelectedLight() ) {
eeColor lCol( mUIMap->GetSelectedLight()->Color() );
RGB lCol( mUIMap->GetSelectedLight()->Color() );
lCol.Green = Col.G();
mUIMap->GetSelectedLight()->Color( lCol );
}
}
void cMapEditor::OnBlueChange( const cUIEvent * Event ) {
eeColorA Col = mUIBaseColor->Background()->Color();
ColorA Col = mUIBaseColor->Background()->Color();
Col.Blue = (Uint8)mUIBlueSlider->Value();
mUIBaseColor->Background()->Color( Col );
mUIBlueTxt->Text( String::ToStr( (Uint32)mUIBlueSlider->Value() ) );
if ( NULL != mUIMap->GetSelectedLight() ) {
eeColor lCol( mUIMap->GetSelectedLight()->Color() );
RGB lCol( mUIMap->GetSelectedLight()->Color() );
lCol.Blue = Col.B();
mUIMap->GetSelectedLight()->Color( lCol );
}

View File

@@ -35,7 +35,7 @@ cMapProperties::cMapProperties( cMap * Map ) :
ComParams.PosSet( Txt->Pos().x, Txt->Pos().y + Txt->Size().Height() + 4 );
ComParams.SizeSet( 64, 64 );
ComParams.Background.Color( mMap->BaseColor() );
ComParams.Border.Color( eeColorA( 100, 100, 100, 200 ) );
ComParams.Border.Color( ColorA( 100, 100, 100, 200 ) );
ComParams.Flags |= UI_FILL_BACKGROUND | UI_BORDER;
mUIBaseColor = eeNew( cUIComplexControl, ( ComParams ) );
mUIBaseColor->Visible( true );
@@ -122,34 +122,34 @@ cMapProperties::~cMapProperties() {
}
void cMapProperties::OnRedChange( const cUIEvent * Event ) {
eeColorA Col = mUIBaseColor->Background()->Color();
ColorA Col = mUIBaseColor->Background()->Color();
Col.Red = (Uint8)mUIRedSlider->Value();
mUIBaseColor->Background()->Color( Col );
mUIRedTxt->Text( String::ToStr( (Int32)mUIRedSlider->Value() ) );
eeColorA MapCol = mMap->BaseColor();
ColorA MapCol = mMap->BaseColor();
MapCol.Red = Col.Red;
mMap->BaseColor( MapCol );
}
void cMapProperties::OnGreenChange( const cUIEvent * Event ) {
eeColorA Col = mUIBaseColor->Background()->Color();
ColorA Col = mUIBaseColor->Background()->Color();
Col.Green = (Uint8)mUIGreenSlider->Value();
mUIBaseColor->Background()->Color( Col );
mUIGreenTxt->Text( String::ToStr( (Uint32)mUIGreenSlider->Value() ) );
eeColorA MapCol = mMap->BaseColor();
ColorA MapCol = mMap->BaseColor();
MapCol.Green = Col.Green;
mMap->BaseColor( MapCol );
}
void cMapProperties::OnBlueChange( const cUIEvent * Event ) {
eeColorA Col = mUIBaseColor->Background()->Color();
ColorA Col = mUIBaseColor->Background()->Color();
Col.Blue = (Uint8)mUIBlueSlider->Value();
mUIBaseColor->Background()->Color( Col );
mUIBlueTxt->Text( String::ToStr( (Uint32)mUIBlueSlider->Value() ) );
eeColorA MapCol = mMap->BaseColor();
ColorA MapCol = mMap->BaseColor();
MapCol.Blue = Col.Blue;
mMap->BaseColor( MapCol );
}

View File

@@ -29,8 +29,8 @@ cUIMap::cUIMap( const cUIComplexControl::CreateParams& Params, cUITheme * Theme,
mMap = eeNew( cMap, () );
}
mMap->BackColor( eeColorA( 100, 100, 100, 100 ) );
mMap->GridLinesColor( eeColorA( 150, 150, 150, 150 ) );
mMap->BackColor( ColorA( 100, 100, 100, 100 ) );
mMap->GridLinesColor( ColorA( 150, 150, 150, 150 ) );
mMap->SetDrawCallback( cb::Make0( this, &cUIMap::MapDraw ) );
@@ -366,7 +366,7 @@ void cUIMap::AddLight( cLight * Light ) {
void cUIMap::MapDraw() {
if ( EDITING_LIGHT == mEditingMode ) {
if ( NULL != mSelLight ) {
mP.SetColor( eeColorA( 255, 0, 0, (Uint8)mAlpha ) );
mP.SetColor( ColorA( 255, 0, 0, (Uint8)mAlpha ) );
eeVector2f Pos( mSelLight->GetAABB().Left, mSelLight->GetAABB().Top );
eeAABB AB( mSelLight->GetAABB() );
@@ -380,11 +380,11 @@ void cUIMap::MapDraw() {
{
if ( mObjRECTEditing ) {
mP.FillMode( DRAW_FILL );
mP.SetColor( eeColorA( 100, 100, 100, 20 ) );
mP.SetColor( ColorA( 100, 100, 100, 20 ) );
mP.DrawRectangle( mObjRECT );
mP.FillMode( DRAW_LINE );
mP.SetColor( eeColorA( 255, 0, 0, 200 ) );
mP.SetColor( ColorA( 255, 0, 0, 200 ) );
mP.DrawRectangle( mObjRECT );
}
@@ -393,22 +393,22 @@ void cUIMap::MapDraw() {
case INSERT_POLYGON:
{
mP.FillMode( DRAW_FILL );
mP.SetColor( eeColorA( 50, 50, 50, 50 ) );
mP.SetColor( ColorA( 50, 50, 50, 50 ) );
mP.DrawPolygon( mObjPoly );
mP.FillMode( DRAW_LINE );
mP.SetColor( eeColorA( 255, 0, 0, 200 ) );
mP.SetColor( ColorA( 255, 0, 0, 200 ) );
mP.DrawPolygon( mObjPoly );
eePolygon2f polyN( mObjPoly );
polyN.PushBack( GetMouseMapPos() );
mP.FillMode( DRAW_FILL );
mP.SetColor( eeColorA( 100, 100, 100, 100 ) );
mP.SetColor( ColorA( 100, 100, 100, 100 ) );
mP.DrawPolygon( polyN );
mP.FillMode( DRAW_LINE );
mP.SetColor( eeColorA( 255, 255, 0, 200 ) );
mP.SetColor( ColorA( 255, 255, 0, 200 ) );
mP.DrawPolygon( polyN );
break;
@@ -416,14 +416,14 @@ void cUIMap::MapDraw() {
case INSERT_POLYLINE:
{
mP.FillMode( DRAW_LINE );
mP.SetColor( eeColorA( 255, 0, 0, 200 ) );
mP.SetColor( ColorA( 255, 0, 0, 200 ) );
mP.DrawPolygon( mObjPoly );
eePolygon2f polyN( mObjPoly );
polyN.PushBack( GetMouseMapPos() );
mP.FillMode( DRAW_LINE );
mP.SetColor( eeColorA( 255, 255, 0, 200 ) );
mP.SetColor( ColorA( 255, 255, 0, 200 ) );
mP.DrawPolygon( polyN );
break;
@@ -431,7 +431,7 @@ void cUIMap::MapDraw() {
case EDIT_POLYGONS:
{
if ( NULL != mSelObj && eeINDEX_NOT_FOUND != mSelPointIndex ) {
mP.SetColor( eeColorA( 255, 255, 100, 100 ) );
mP.SetColor( ColorA( 255, 255, 100, 100 ) );
mP.FillMode( DRAW_FILL );
mP.DrawRectangle( mSelPointRect );

View File

@@ -114,13 +114,13 @@ cUIMapNew::cUIMapNew( cUIMap * Map, cb::Callback0<void> NewMapCb, bool ResizeMap
ComParams.Parent( mUIWindow->Container() );
ComParams.PosSet( Txt->Pos().x, Txt->Pos().y + Txt->Size().Height() + 4 );
ComParams.SizeSet( 64, 64 );
ComParams.Background.Color( eeColorA( 255, 255, 255, 255 ) );
ComParams.Background.Color( ColorA( 255, 255, 255, 255 ) );
if ( ResizeMap ) {
ComParams.Background.Color( mUIMap->Map()->BaseColor() );
}
ComParams.Border.Color( eeColorA( 100, 100, 100, 200 ) );
ComParams.Border.Color( ColorA( 100, 100, 100, 200 ) );
ComParams.Flags |= UI_FILL_BACKGROUND | UI_BORDER;
mUIBaseColor = eeNew( cUIComplexControl, ( ComParams ) );
mUIBaseColor->Visible( true );
@@ -183,21 +183,21 @@ cUIMapNew::~cUIMapNew() {
}
void cUIMapNew::OnRedChange( const cUIEvent * Event ) {
eeColorA Col = mUIBaseColor->Background()->Color();
ColorA Col = mUIBaseColor->Background()->Color();
Col.Red = (Uint8)mUIRedSlider->Value();
mUIBaseColor->Background()->Color( Col );
mUIRedTxt->Text( String::ToStr( (Int32)mUIRedSlider->Value() ) );
}
void cUIMapNew::OnGreenChange( const cUIEvent * Event ) {
eeColorA Col = mUIBaseColor->Background()->Color();
ColorA Col = mUIBaseColor->Background()->Color();
Col.Green = (Uint8)mUIGreenSlider->Value();
mUIBaseColor->Background()->Color( Col );
mUIGreenTxt->Text( String::ToStr( (Uint32)mUIGreenSlider->Value() ) );
}
void cUIMapNew::OnBlueChange( const cUIEvent * Event ) {
eeColorA Col = mUIBaseColor->Background()->Color();
ColorA Col = mUIBaseColor->Background()->Color();
Col.Blue = (Uint8)mUIBlueSlider->Value();
mUIBaseColor->Background()->Color( Col );
mUIBlueTxt->Text( String::ToStr( (Uint32)mUIBlueSlider->Value() ) );
@@ -234,8 +234,8 @@ void cUIMapNew::OKClick( const cUIEvent * Event ) {
mUIMap->Map()->Save( mapPath );
cMap * Map = eeNew( cMap, () );
Map->BackColor( eeColorA( 100, 100, 100, 100 ) );
Map->GridLinesColor( eeColorA( 150, 150, 150, 150 ) );
Map->BackColor( ColorA( 100, 100, 100, 100 ) );
Map->GridLinesColor( ColorA( 150, 150, 150, 150 ) );
Map->ForceHeadersOnLoad( eeSize( w, h ), eeSize( tw, th ), ml, Flags );
Map->Load( mapPath );
Map->DisableForcedHeaders();

View File

@@ -426,14 +426,14 @@ void cBatchRenderer::BatchQuadFreeEx( const Float& x0, const Float& y0, const Fl
void cBatchRenderer::QuadsBegin() {
SetBlendMode( DM_QUADS, true );
QuadsSetSubset( 0, 0, 1, 1 );
QuadsSetColor( eeColorA() );
QuadsSetColor( ColorA() );
}
void cBatchRenderer::QuadsSetColor( const eeColorA& Color ) {
void cBatchRenderer::QuadsSetColor( const ColorA& Color ) {
mVerColor[0] = mVerColor[1] = mVerColor[2] = mVerColor[3] = Color;
}
void cBatchRenderer::QuadsSetColorFree( const eeColorA& Color0, const eeColorA& Color1, const eeColorA& Color2, const eeColorA& Color3 ) {
void cBatchRenderer::QuadsSetColorFree( const ColorA& Color0, const ColorA& Color1, const ColorA& Color2, const ColorA& Color3 ) {
mVerColor[0] = Color0;
mVerColor[1] = Color1;
mVerColor[2] = Color2;
@@ -467,10 +467,10 @@ void cBatchRenderer::Rotate( const eeVector2f& center, eeVector2f* point, const
void cBatchRenderer::PointsBegin() {
SetBlendMode( DM_POINTS, true );
QuadsSetSubset( 0, 0, 1, 1 );
PointSetColor( eeColorA() );
PointSetColor( ColorA() );
}
void cBatchRenderer::PointSetColor( const eeColorA& Color ) {
void cBatchRenderer::PointSetColor( const ColorA& Color ) {
QuadsSetColor( Color );
}
@@ -492,14 +492,14 @@ void cBatchRenderer::BatchPoint( const Float& x, const Float& y ) {
void cBatchRenderer::LinesBegin() {
SetBlendMode( DM_LINES, true );
QuadsSetSubset( 0, 0, 1, 1 );
PointSetColor( eeColorA() );
PointSetColor( ColorA() );
}
void cBatchRenderer::LinesSetColor( const eeColorA& Color ) {
void cBatchRenderer::LinesSetColor( const ColorA& Color ) {
QuadsSetColor( Color );
}
void cBatchRenderer::LinesSetColorFree( const eeColorA& Color0, const eeColorA& Color1 ) {
void cBatchRenderer::LinesSetColorFree( const ColorA& Color0, const ColorA& Color1 ) {
QuadsSetColorFree( Color0, Color1, Color0, Color0 );
}
@@ -527,14 +527,14 @@ void cBatchRenderer::BatchLine( const Float& x0, const Float& y0, const Float& x
void cBatchRenderer::LineLoopBegin() {
SetBlendMode( DM_LINE_LOOP, true );
QuadsSetSubset( 0, 0, 1, 1 );
PointSetColor( eeColorA() );
PointSetColor( ColorA() );
}
void cBatchRenderer::LineLoopSetColor( const eeColorA& Color ) {
void cBatchRenderer::LineLoopSetColor( const ColorA& Color ) {
QuadsSetColor( Color );
}
void cBatchRenderer::LineLoopSetColorFree( const eeColorA& Color0, const eeColorA& Color1 ) {
void cBatchRenderer::LineLoopSetColorFree( const ColorA& Color0, const ColorA& Color1 ) {
QuadsSetColorFree( Color0, Color1, Color0, Color0 );
}
@@ -585,14 +585,14 @@ void cBatchRenderer::BatchLineLoop( const eeVector2f& vector1 ) {
void cBatchRenderer::TriangleFanBegin() {
SetBlendMode( DM_TRIANGLE_FAN, true );
TriangleFanSetSubset( 0, 0, 0, 1, 1, 1 );
TriangleFanSetColor( eeColorA() );
TriangleFanSetColor( ColorA() );
}
void cBatchRenderer::TriangleFanSetColor( const eeColorA& Color ) {
void cBatchRenderer::TriangleFanSetColor( const ColorA& Color ) {
QuadsSetColor( Color );
}
void cBatchRenderer::TriangleFanSetColorFree( const eeColorA& Color0, const eeColorA& Color1, const eeColorA& Color2 ) {
void cBatchRenderer::TriangleFanSetColorFree( const ColorA& Color0, const ColorA& Color1, const ColorA& Color2 ) {
QuadsSetColorFree( Color0, Color1, Color2, Color0 );
}
@@ -648,14 +648,14 @@ void cBatchRenderer::BatchTriangleFan( const Float& x0, const Float& y0 ) {
void cBatchRenderer::TrianglesBegin() {
SetBlendMode( DM_TRIANGLES, true );
TrianglesSetSubset( 0, 0, 0, 1, 1, 1 );
TrianglesSetColor( eeColorA() );
TrianglesSetColor( ColorA() );
}
void cBatchRenderer::TrianglesSetColor( const eeColorA& Color ) {
void cBatchRenderer::TrianglesSetColor( const ColorA& Color ) {
QuadsSetColor( Color );
}
void cBatchRenderer::TrianglesSetColorFree( const eeColorA& Color0, const eeColorA& Color1, const eeColorA& Color2 ) {
void cBatchRenderer::TrianglesSetColorFree( const ColorA& Color0, const ColorA& Color1, const ColorA& Color2 ) {
QuadsSetColorFree( Color0, Color1, Color2, Color0 );
}
@@ -693,7 +693,7 @@ void cBatchRenderer::BatchTriangle( const Float& x0, const Float& y0, const Floa
AddVertexs(3);
}
void cBatchRenderer::PolygonSetColor( const eeColorA& Color ) {
void cBatchRenderer::PolygonSetColor( const ColorA& Color ) {
PointSetColor( Color );
}

View File

@@ -155,23 +155,23 @@ void cConsole::AddCommand( const String& Command, ConsoleCallback CB ) {
void cConsole::Draw() {
if ( mEnabled && NULL != mFont ) {
eeColorA OldColor( mFont->Color() );
ColorA OldColor( mFont->Color() );
Fade();
if ( mY > 0.0f ) {
if ( mTexId == 0 ) {
mPri.SetColor( eeColorA( mConColor.R(), mConColor.G(), mConColor.B(), static_cast<Uint8>(mA) ) );
mPri.SetColor( ColorA( mConColor.R(), mConColor.G(), mConColor.B(), static_cast<Uint8>(mA) ) );
mPri.DrawRectangle( eeRectf( eeVector2f( 0.0f, 0.0f ), eeSizef( mWidth, mY ) ) );
} else {
eeColorA C( mConColor.R(), mConColor.G(), mConColor.B(), static_cast<Uint8>(mA) );
ColorA C( mConColor.R(), mConColor.G(), mConColor.B(), static_cast<Uint8>(mA) );
cTexture * Tex = cTextureFactory::instance()->GetTexture( mTexId );
if ( NULL != Tex )
Tex->DrawEx( 0.0f, 0.0f, mWidth, mY, 0.0f, eeVector2f::One, C, C, C, C );
}
mPri.SetColor( eeColorA( mConLineColor.R(), mConLineColor.G(), mConLineColor.B(), static_cast<Uint8>(mA) ) );
mPri.SetColor( ColorA( mConLineColor.R(), mConLineColor.G(), mConLineColor.B(), static_cast<Uint8>(mA) ) );
mPri.DrawRectangle( eeRectf( eeVector2f( 0.0f, mY ), eeSizef( mWidth, 4.0f ) ) );
Int32 linesInScreen = LinesInScreen();
@@ -188,7 +188,7 @@ void cConsole::Draw() {
mCon.ConMin = mEx;
mCon.ConMax = (int)mCmdLog.size() - 1;
mFont->Color( eeColorA ( mFontColor.R(), mFontColor.G(), mFontColor.B(), static_cast<Uint8>(mA) ) );
mFont->Color( ColorA ( mFontColor.R(), mFontColor.G(), mFontColor.B(), static_cast<Uint8>(mA) ) );
for (int i = mCon.ConMax - mCon.ConModif; i >= mCon.ConMin - mCon.ConModif; i-- ) {
if ( i < static_cast<Int16>( mCmdLog.size() ) && i >= 0 ) {
@@ -202,11 +202,11 @@ void cConsole::Draw() {
CurY = mTempY + mY + mCurHeight - mFontSize - 1;
mFont->Color( eeColorA ( mFontLineColor.R(), mFontLineColor.G(), mFontLineColor.B(), static_cast<Uint8>(mA) ) );
mFont->Color( ColorA ( mFontLineColor.R(), mFontLineColor.G(), mFontLineColor.B(), static_cast<Uint8>(mA) ) );
mFont->SetText( "> " + mTBuf->Buffer() );
mFont->Draw( mFontSize, CurY );
mFont->Color( eeColorA ( mFontLineColor.R(), mFontLineColor.G(), mFontLineColor.B(), static_cast<Uint8>(mCurAlpha) ) );
mFont->Color( ColorA ( mFontLineColor.R(), mFontLineColor.G(), mFontLineColor.B(), static_cast<Uint8>(mCurAlpha) ) );
if ( (unsigned int)mTBuf->CurPos() == mTBuf->Buffer().size() ) {
mFont->Draw( "_", mFontSize + mFont->GetTextWidth() , CurY );
@@ -220,8 +220,8 @@ void cConsole::Draw() {
}
if ( mShowFps && NULL != mFont ) {
eeColorA OldColor1( mFont->Color() );
mFont->Color( eeColorA () );
ColorA OldColor1( mFont->Color() );
mFont->Color( ColorA () );
mFont->SetText( "FPS: " + String::ToStr( mWindow->FPS() ) );
mFont->Draw( mWindow->GetWidth() - mFont->GetTextWidth() - 15, 6 );
mFont->Color( OldColor1 );

View File

@@ -32,19 +32,19 @@ void cFont::SetText( const String& Text ) {
mTextCache.Text( Text );
}
const eeColorA& cFont::Color() const {
const ColorA& cFont::Color() const {
return mTextCache.Color();
}
void cFont::Color(const eeColorA& Color) {
void cFont::Color(const ColorA& Color) {
mTextCache.Color( Color );
}
const eeColorA& cFont::ShadowColor() const {
const ColorA& cFont::ShadowColor() const {
return mTextCache.ShadowColor();
}
void cFont::ShadowColor(const eeColorA& Color) {
void cFont::ShadowColor(const ColorA& Color) {
mTextCache.ShadowColor( Color );
}
@@ -116,12 +116,12 @@ void cFont::Draw( cTextCache& TextCache, const Float& X, const Float& Y, const U
f &= ~FONT_DRAW_SHADOW;
eeColorA Col = TextCache.Color();
ColorA Col = TextCache.Color();
SetText( TextCache.Text() );
if ( Col.A() != 255 ) {
eeColorA ShadowColor = TextCache.ShadowColor();
ColorA ShadowColor = TextCache.ShadowColor();
ShadowColor.Alpha = (Uint8)( (Float)ShadowColor.Alpha * ( (Float)Col.A() / (Float)255 ) );
@@ -156,7 +156,7 @@ void cFont::Draw( cTextCache& TextCache, const Float& X, const Float& Y, const U
}
std::vector<eeVertexCoords>& RenderCoords = TextCache.VertextCoords();
std::vector<eeColorA>& Colors = TextCache.Colors();
std::vector<ColorA>& Colors = TextCache.Colors();
if ( !TextCache.CachedCoords() ) {
if ( !( Flags & FONT_DRAW_VERTICAL ) ) {

View File

@@ -4,7 +4,6 @@
#include <eepp/graphics/glextensions.hpp>
#include <eepp/graphics/renderer/cgl.hpp>
#include <eepp/graphics/cframebufferfbo.hpp>
#include <eepp/graphics/cframebufferpbuffer.hpp>
#include <eepp/graphics/cframebuffermanager.hpp>
#include <eepp/window/cwindow.hpp>
using namespace EE::Graphics::Private;
@@ -15,9 +14,6 @@ cFrameBuffer * cFrameBuffer::New( const Uint32& Width, const Uint32& Height, boo
if ( cFrameBufferFBO::IsSupported() )
return eeNew( cFrameBufferFBO, ( Width, Height, DepthBuffer, window ) );
if ( cFrameBufferPBuffer::IsSupported() )
return eeNew( cFrameBufferPBuffer, ( Width, Height, DepthBuffer, window ) );
return NULL;
}
@@ -48,11 +44,11 @@ cTexture * cFrameBuffer::GetTexture() const {
return mTexture;
}
void cFrameBuffer::ClearColor( eeColorAf Color ) {
void cFrameBuffer::ClearColor( ColorAf Color ) {
mClearColor = Color;
}
eeColorAf cFrameBuffer::ClearColor() const {
ColorAf cFrameBuffer::ClearColor() const {
return mClearColor;
}

View File

@@ -95,7 +95,7 @@ bool cFrameBufferFBO::Create( const Uint32& Width, const Uint32& Height, bool De
}
if ( NULL == mTexture ) {
Uint32 TexId = cTextureFactory::instance()->CreateEmptyTexture( Width, Height, 4, eeColorA(0,0,0,0) );
Uint32 TexId = cTextureFactory::instance()->CreateEmptyTexture( Width, Height, 4, ColorA(0,0,0,0) );
if ( cTextureFactory::instance()->TextureIdExists( TexId ) ) {
mTexture = cTextureFactory::instance()->GetTexture( TexId );

View File

@@ -1,314 +0,0 @@
#include <eepp/graphics/cframebufferpbuffer.hpp>
#include <eepp/graphics/ctexturefactory.hpp>
#include <eepp/window/cengine.hpp>
#ifdef EE_GLEW_AVAILABLE
#include <eepp/graphics/glextensions.hpp>
#include <eepp/graphics/renderer/cgl.hpp>
#if EE_PLATFORM == EE_PLATFORM_WIN
#include <eepp/helper/glew/wglew.h>
#elif defined( EE_X11_PLATFORM )
#include <eepp/helper/glew/glxew.h>
#include <X11/Xlib.h>
#else
#warning No PBuffer implemented on this platform
#endif
#endif
#include <eepp/graphics/renderer/crenderergl3.hpp>
#include <eepp/graphics/renderer/crenderergles2.hpp>
#include <eepp/graphics/cglobalbatchrenderer.hpp>
namespace EE { namespace Graphics {
cFrameBufferPBuffer::cFrameBufferPBuffer( Window::cWindow * window )
#if EE_PLATFORM == EE_PLATFORM_WIN
: cFrameBuffer( window ),
mDeviceContext( NULL ),
mPBuffer( NULL ),
mContext( NULL )
#elif defined( EE_X11_PLATFORM )
: cFrameBuffer( window ),
mDisplay( NULL ),
mPBuffer( 0 ),
mContext( NULL )
#else
: cFrameBuffer( window )
#endif
{
#if defined( EE_GLEW_AVAILABLE ) && defined( EE_X11_PLATFORM )
mDisplay = XOpenDisplay(NULL);
#endif
}
cFrameBufferPBuffer::cFrameBufferPBuffer( const Uint32& Width, const Uint32& Height, bool DepthBuffer, Window::cWindow * window )
#if EE_PLATFORM == EE_PLATFORM_WIN
: cFrameBuffer( window ),
mDeviceContext( NULL ),
mPBuffer( NULL ),
mContext( NULL )
#elif defined( EE_X11_PLATFORM )
: cFrameBuffer( window ),
mDisplay( NULL ),
mPBuffer( 0 ),
mContext( NULL )
#else
: cFrameBuffer( window )
#endif
{
#if defined( EE_GLEW_AVAILABLE ) && defined( EE_X11_PLATFORM )
mDisplay = XOpenDisplay(NULL);
#endif
Create( Width, Height, DepthBuffer );
}
cFrameBufferPBuffer::~cFrameBufferPBuffer() {
#ifdef EE_GLEW_AVAILABLE
#if EE_PLATFORM == EE_PLATFORM_WIN
if ( mContext )
wglDeleteContext( (HGLRC)mContext );
if ( mPBuffer && mDeviceContext ) {
wglReleasePbufferDCARB( (HPBUFFERARB)mPBuffer, (HDC)mDeviceContext );
wglDestroyPbufferARB( (HPBUFFERARB)mPBuffer );
}
#elif defined( EE_X11_PLATFORM )
if ( mContext )
glXDestroyContext( (Display*)mDisplay, (GLXContext)mContext );
if ( mPBuffer )
glXDestroyGLXPbufferSGIX( (Display*)mDisplay, mPBuffer );
if ( mDisplay )
XCloseDisplay( (Display*)mDisplay );
#endif
#endif
if ( Window::cEngine::instance()->ExistsWindow( mWindow ) ) {
mWindow->SetDefaultContext();
}
}
bool cFrameBufferPBuffer::IsSupported() {
#ifdef EE_GLEW_AVAILABLE
#if EE_PLATFORM == EE_PLATFORM_WIN
return WGLEW_ARB_pbuffer && WGLEW_ARB_pixel_format;
#elif defined( EE_X11_PLATFORM )
return glxewIsSupported("GLX_SGIX_pbuffer");
#else
return false;
#endif
#else
return false;
#endif
}
bool cFrameBufferPBuffer::Create( const Uint32& Width, const Uint32& Height ) {
return Create( Width, Height, false );
}
bool cFrameBufferPBuffer::Create( const Uint32& Width, const Uint32& Height, bool DepthBuffer ) {
if ( !IsSupported() )
return false;
if ( NULL == mWindow ) {
mWindow = cEngine::instance()->GetCurrentWindow();
}
mWidth = Width;
mHeight = Height;
mHasDepthBuffer = DepthBuffer;
#ifdef EE_GLEW_AVAILABLE
#if EE_PLATFORM == EE_PLATFORM_WIN
HDC currentDC = wglGetCurrentDC();
int attributes[] =
{
WGL_SUPPORT_OPENGL_ARB, GL_TRUE,
WGL_DRAW_TO_PBUFFER_ARB, GL_TRUE,
WGL_RED_BITS_ARB, 8,
WGL_GREEN_BITS_ARB, 8,
WGL_BLUE_BITS_ARB, 8,
WGL_ALPHA_BITS_ARB, 8,
WGL_DEPTH_BITS_ARB, ( DepthBuffer ? 24 : 0 ),
WGL_DOUBLE_BUFFER_ARB, GL_FALSE,
0
};
unsigned int nbFormats = 0;
int pixelFormat = -1;
wglChoosePixelFormatARB( currentDC, attributes, NULL, 1, &pixelFormat, &nbFormats );
if ( nbFormats == 0 )
return false;
mPBuffer = wglCreatePbufferARB( currentDC, pixelFormat, Width, Height, NULL );
mDeviceContext = wglGetPbufferDCARB( (HPBUFFERARB)mPBuffer );
mContext = wglCreateContext( (HDC)mDeviceContext );
if ( !mPBuffer || !mDeviceContext || !mContext )
return false;
int actualWidth, actualHeight;
wglQueryPbufferARB( (HPBUFFERARB)mPBuffer, WGL_PBUFFER_WIDTH_ARB, &actualWidth );
wglQueryPbufferARB( (HPBUFFERARB)mPBuffer, WGL_PBUFFER_HEIGHT_ARB, &actualHeight );
if ( ( actualWidth != static_cast<int>(Width) ) || ( actualHeight != static_cast<int>(Height) ) )
return false;
HGLRC currentContext = wglGetCurrentContext();
if (currentContext) {
wglMakeCurrent( NULL, NULL );
wglShareLists( currentContext, (HGLRC)mContext );
wglMakeCurrent( currentDC, currentContext );
}
#elif defined( EE_X11_PLATFORM )
int visualAttributes[] =
{
GLX_RENDER_TYPE, GLX_RGBA_BIT,
GLX_DRAWABLE_TYPE, GLX_PBUFFER_BIT,
GLX_RED_SIZE, 8,
GLX_GREEN_SIZE, 8,
GLX_BLUE_SIZE, 8,
GLX_ALPHA_SIZE, 8,
GLX_DEPTH_SIZE, ( DepthBuffer ? 24 : 0 ),
0
};
int PBufferAttributes[] =
{
GLX_PBUFFER_WIDTH, (int)Width,
GLX_PBUFFER_HEIGHT, (int)Height,
0
};
int nbConfigs = 0;
GLXFBConfig* configs = glXChooseFBConfigSGIX( (Display*)mDisplay, DefaultScreen( (Display*)mDisplay ), visualAttributes, &nbConfigs );
if (!configs || !nbConfigs)
return false;
mPBuffer = glXCreateGLXPbufferSGIX( (Display*)mDisplay, configs[0], Width, Height, PBufferAttributes );
if ( !mPBuffer ) {
XFree(configs);
return false;
}
unsigned int actualWidth, actualHeight;
glXQueryGLXPbufferSGIX( (Display*)mDisplay, mPBuffer, GLX_WIDTH_SGIX, &actualWidth);
glXQueryGLXPbufferSGIX( (Display*)mDisplay, mPBuffer, GLX_HEIGHT_SGIX, &actualHeight);
if ( ( actualWidth != Width ) || ( actualHeight != Height ) ) {
XFree(configs);
return false;
}
GLXDrawable currentDrawable = glXGetCurrentDrawable();
GLXContext currentContext = glXGetCurrentContext();
if ( currentContext )
glXMakeCurrent( (Display*)mDisplay, 0, NULL );
XVisualInfo* visual = glXGetVisualFromFBConfig( (Display*)mDisplay, configs[0] );
mContext = glXCreateContext( (Display*)mDisplay, visual, currentContext, true );
if ( !mContext ) {
XFree(configs);
XFree(visual);
return false;
}
if ( currentContext )
glXMakeCurrent( (Display*)mDisplay, currentDrawable, currentContext );
XFree(configs);
XFree(visual);
#endif
#endif
if ( NULL == mTexture ) {
Uint32 TexId = cTextureFactory::instance()->CreateEmptyTexture( Width, Height, 4, eeColorA(0,0,0,0) );
if ( cTextureFactory::instance()->TextureIdExists( TexId ) ) {
mTexture = cTextureFactory::instance()->GetTexture( TexId );
} else {
return false;
}
}
return true;
}
void cFrameBufferPBuffer::Bind() {
bool ChangeContext = false;
cGlobalBatchRenderer::instance()->Draw();
#ifdef EE_GLEW_AVAILABLE
#if EE_PLATFORM == EE_PLATFORM_WIN
if ( mDeviceContext && mContext ) {
if ( wglGetCurrentContext() != mContext ) {
ChangeContext = true;
wglMakeCurrent( (HDC)mDeviceContext, (HGLRC)mContext );
}
}
#elif defined( EE_X11_PLATFORM )
if ( mPBuffer && mContext ) {
if ( glXGetCurrentContext() != mContext ) {
ChangeContext = true;
glXMakeCurrent( (Display*)mDisplay, mPBuffer, (GLXContext)mContext );
}
}
#endif
#endif
if ( ChangeContext ) {
#ifdef EE_GL3_ENABLED
if ( GLv_3 == GLi->Version() ) {
GLi->GetRendererGL3()->ReloadCurrentShader();
}
if ( GLv_ES2 == GLi->Version() ) {
GLi->GetRendererGLES2()->ReloadCurrentShader();
}
#endif
mWindow->Setup2D( true );
SetBufferView();
}
}
void cFrameBufferPBuffer::Unbind() {
RecoverView();
int previousTexture;
glGetIntegerv( GL_TEXTURE_BINDING_2D, &previousTexture );
GLi->BindTexture( GL_TEXTURE_2D, (int)mTexture->Handle() );
glCopyTexSubImage2D( GL_TEXTURE_2D, 0, 0, 0, 0, 0, mWidth, mHeight );
GLi->BindTexture( GL_TEXTURE_2D, previousTexture );
mWindow->SetDefaultContext();
}
void cFrameBufferPBuffer::Reload() {
Create( mWidth, mHeight, mHasDepthBuffer );
}
}}

View File

@@ -1,71 +0,0 @@
#ifndef EE_GRAPHICSCFRAMEBUFFERPBUFFER_HPP
#define EE_GRAPHICSCFRAMEBUFFERPBUFFER_HPP
/** Part of this code is based on the implementation of PBuffers from:
*
// SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2009 Laurent Gomila (laurent.gom@gmail.com)
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
//
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it freely,
// subject to the following restrictions:
//
// 1. The origin of this software must not be misrepresented;
// you must not claim that you wrote the original software.
// If you use this software in a product, an acknowledgment
// in the product documentation would be appreciated but is not required.
//
// 2. Altered source versions must be plainly marked as such,
// and must not be misrepresented as being the original software.
//
// 3. This notice may not be removed or altered from any source distribution.
*
* NOTE by Martin Lucas Golini: This is not the original version, so differs from SFML implementation.
*/
#include <eepp/graphics/base.hpp>
#include <eepp/graphics/cframebuffer.hpp>
namespace EE { namespace Graphics {
class EE_API cFrameBufferPBuffer : public cFrameBuffer {
public:
cFrameBufferPBuffer( Window::cWindow * window = NULL );
~cFrameBufferPBuffer();
cFrameBufferPBuffer( const Uint32& Width, const Uint32& Height, bool DepthBuffer = false, Window::cWindow * window = NULL );
void Bind();
void Unbind();
void Reload();
static bool IsSupported();
protected:
#ifdef EE_GLEW_AVAILABLE
#if EE_PLATFORM == EE_PLATFORM_WIN
void * mDeviceContext;
void * mPBuffer;
void * mContext;
#elif defined( EE_X11_PLATFORM )
void * mDisplay;
unsigned long mPBuffer;
void * mContext;
#endif
#endif
bool Create( const Uint32& Width, const Uint32& Height );
bool Create( const Uint32& Width, const Uint32& Height, bool DepthBuffer );
};
}}
#endif

View File

@@ -262,7 +262,7 @@ cImage::cImage( const Uint8* data, const unsigned int& Width, const unsigned int
SetPixels( data );
}
cImage::cImage( const Uint32& Width, const Uint32& Height, const Uint32& Channels, const eeColorA& DefaultColor, const bool& initWithDefaultColor ) :
cImage::cImage( const Uint32& Width, const Uint32& Height, const Uint32& Channels, const ColorA& DefaultColor, const bool& initWithDefaultColor ) :
mPixels(NULL),
mWidth(Width),
mHeight(Height),
@@ -373,7 +373,7 @@ void cImage::LoadFromPack( Pack * Pack, const std::string& FilePackPath ) {
void cImage::SetPixels( const Uint8* data ) {
if ( data != NULL ) {
Allocate( mWidth * mHeight * mChannels, eeColorA(0,0,0,0), false );
Allocate( mWidth * mHeight * mChannels, ColorA(0,0,0,0), false );
memcpy( reinterpret_cast<void*>( &mPixels[0] ), reinterpret_cast<const void*> ( data ), mSize );
}
@@ -383,19 +383,19 @@ const Uint8* cImage::GetPixelsPtr() {
return reinterpret_cast<const Uint8*> (&mPixels[0]);
}
eeColorA cImage::GetPixel( const unsigned int& x, const unsigned int& y ) {
ColorA cImage::GetPixel( const unsigned int& x, const unsigned int& y ) {
eeASSERT( !( mPixels == NULL || x > mWidth || y > mHeight ) );
eeColorA dst;
ColorA dst;
memcpy( &dst, &mPixels[ ( ( x + y * mWidth ) * mChannels ) ], mChannels );
return dst;
}
void cImage::SetPixel(const unsigned int& x, const unsigned int& y, const eeColorA& Color) {
void cImage::SetPixel(const unsigned int& x, const unsigned int& y, const ColorA& Color) {
eeASSERT( !( mPixels == NULL || x > mWidth || y > mHeight ) );
memcpy( &mPixels[ ( ( x + y * mWidth ) * mChannels ) ], &Color, mChannels );
}
void cImage::Create( const Uint32& Width, const Uint32& Height, const Uint32& Channels, const eeColorA& DefaultColor, const bool& initWithDefaultColor ) {
void cImage::Create( const Uint32& Width, const Uint32& Height, const Uint32& Channels, const ColorA& DefaultColor, const bool& initWithDefaultColor ) {
mWidth = Width;
mHeight = Height;
mChannels = Channels;
@@ -407,7 +407,7 @@ Uint8* cImage::GetPixels() const {
return mPixels;
}
void cImage::Allocate( const Uint32& size, eeColorA DefaultColor, bool memsetData ) {
void cImage::Allocate( const Uint32& size, ColorA DefaultColor, bool memsetData ) {
ClearCache();
mPixels = eeNewArray( unsigned char, size );
@@ -480,7 +480,7 @@ bool cImage::SaveToFile( const std::string& filepath, const EE_SAVE_TYPE& Format
return Res;
}
void cImage::ReplaceColor( const eeColorA& ColorKey, const eeColorA& NewColor ) {
void cImage::ReplaceColor( const ColorA& ColorKey, const ColorA& NewColor ) {
unsigned int Pos = 0;
if ( NULL == mPixels )
@@ -517,15 +517,15 @@ void cImage::ReplaceColor( const eeColorA& ColorKey, const eeColorA& NewColor )
}
}
void cImage::CreateMaskFromColor( const eeColorA& ColorKey, Uint8 Alpha ) {
ReplaceColor( ColorKey, eeColorA( ColorKey.R(), ColorKey.G(), ColorKey.B(), Alpha ) );
void cImage::CreateMaskFromColor( const ColorA& ColorKey, Uint8 Alpha ) {
ReplaceColor( ColorKey, ColorA( ColorKey.R(), ColorKey.G(), ColorKey.B(), Alpha ) );
}
void cImage::CreateMaskFromColor( const eeColor& ColorKey, Uint8 Alpha ) {
CreateMaskFromColor( eeColorA( ColorKey.R(), ColorKey.G(), ColorKey.B(), 255 ), Alpha );
void cImage::CreateMaskFromColor( const RGB& ColorKey, Uint8 Alpha ) {
CreateMaskFromColor( ColorA( ColorKey.R(), ColorKey.G(), ColorKey.B(), 255 ), Alpha );
}
void cImage::FillWithColor( const eeColorA& Color ) {
void cImage::FillWithColor( const ColorA& Color ) {
if ( NULL == mPixels )
return;
@@ -659,8 +659,8 @@ void cImage::Blit( cImage * image, const Uint32& x, const Uint32& y ) {
for ( unsigned int ty = y; ty < dh; ty++ ) {
for ( unsigned int tx = x; tx < dw; tx++ ) {
eeColorA ts( image->GetPixel( tx - x, ty - y ) );
eeColorA td( GetPixel( tx, ty ) );
ColorA ts( image->GetPixel( tx - x, ty - y ) );
ColorA td( GetPixel( tx, ty ) );
SetPixel( tx, ty, Color::Blend( ts, td ) );
}

View File

@@ -8,7 +8,7 @@ cParticle::cParticle() {
cParticle::~cParticle() {}
void cParticle::Color(eeColorAf Color, Float AlphaDecay) {
void cParticle::Color(ColorAf Color, Float AlphaDecay) {
mColor = Color;
mAlphaDecay = AlphaDecay;
}
@@ -21,7 +21,7 @@ void cParticle::Reset(const Float &x, const Float &y, const Float &xspeed, const
mXAcc = xacc;
mYAcc = yacc;
mSize = size;
mColor = eeColorAf(1.0f,1.0f,1.0f,1.0f);
mColor = ColorAf(1.0f,1.0f,1.0f,1.0f);
mAlphaDecay = 0.01f;
}

View File

@@ -39,7 +39,7 @@ cParticleSystem::~cParticleSystem() {
eeSAFE_DELETE_ARRAY( mParticle );
}
void cParticleSystem::Create( const EE_PARTICLE_EFFECT& Effect, const Uint32& NumParticles, const Uint32& TexId, const eeVector2f& Pos, const Float& PartSize, const bool& AnimLoop, const Uint32& NumLoops, const eeColorAf& Color, const eeVector2f& Pos2, const Float& AlphaDecay, const eeVector2f& Speed, const eeVector2f& Acc ) {
void cParticleSystem::Create( const EE_PARTICLE_EFFECT& Effect, const Uint32& NumParticles, const Uint32& TexId, const eeVector2f& Pos, const Float& PartSize, const bool& AnimLoop, const Uint32& NumLoops, const ColorAf& Color, const eeVector2f& Pos2, const Float& AlphaDecay, const eeVector2f& Speed, const eeVector2f& Acc ) {
mPointsSup = GLi->PointSpriteSupported();
mEffect = Effect;
mPos = Pos;
@@ -106,7 +106,7 @@ void cParticleSystem::Reset( cParticle * P ) {
case PSE_BlueBall:
{
P->Reset( mPos.x, mPos.y, -10, ( -1 * Math::Randf() ), 0.01f, Math::Randf(), mSize );
P->Color( eeColorAf( 0.25f ,0.25f ,1 ,1 ), 0.1f + ( 0.1f * Math::Randf() ) );
P->Color( ColorAf( 0.25f ,0.25f ,1 ,1 ), 0.1f + ( 0.1f * Math::Randf() ) );
break;
}
case PSE_Fire:
@@ -115,7 +115,7 @@ void cParticleSystem::Reset( cParticle * P ) {
y = ( mPos2.y - mPos.y + 1 ) * Math::Randf() + mPos.y;
P->Reset( x, y, Math::Randf() - 0.5f, ( Math::Randf() - 1.1f ) * 8.5f, 0.f, 0.05f, mSize );
P->Color( eeColorAf( 1.f, 0.5f, 0.1f, ( Math::Randf() * 0.5f ) ), Math::Randf() * 0.4f + 0.01f );
P->Color( ColorAf( 1.f, 0.5f, 0.1f, ( Math::Randf() * 0.5f ) ), Math::Randf() * 0.4f + 0.01f );
break;
}
case PSE_Smoke:
@@ -124,7 +124,7 @@ void cParticleSystem::Reset( cParticle * P ) {
y = ( mPos2.y - mPos.y + 1 ) * Math::Randf() + mPos.y;
P->Reset( x, y, -( Math::Randf() / 3.f + 0.1f ), ( ( Math::Randf() * 0.5f ) - 0.7f ) * 3, ( Math::Randf() / 200.f ), ( Math::Randf() - 0.5f ) / 200.f );
P->Color( eeColorAf( 0.8f, 0.8f, 0.8f, 0.3f ), ( Math::Randf() * 0.005f ) + 0.005f );
P->Color( ColorAf( 0.8f, 0.8f, 0.8f, 0.3f ), ( Math::Randf() * 0.005f ) + 0.005f );
break;
}
case PSE_Snow:
@@ -134,31 +134,31 @@ void cParticleSystem::Reset( cParticle * P ) {
w = ( Math::Randf() + 0.3f ) * 4;
P->Reset( x, y, Math::Randf() - 0.5f, w, 0.f, 0.f, w * 3 );
P->Color( eeColorAf( 1.f, 1.f, 1.f, 0.5f ), 0 );
P->Color( ColorAf( 1.f, 1.f, 1.f, 0.5f ), 0 );
break;
}
case PSE_MagicFire:
{
P->Reset( mPos.x + Math::Randf() , mPos.y, -0.4f + Math::Randf() * 0.8f, -0.5f - Math::Randf() * 0.4f, 0.f, -( Math::Randf() * 0.3f ) );
P->Color( eeColorAf( 1.f, 0.5f, 0.1f, 0.7f + 0.2f * Math::Randf() ), 0.01f + Math::Randf() * 0.05f );
P->Color( ColorAf( 1.f, 0.5f, 0.1f, 0.7f + 0.2f * Math::Randf() ), 0.01f + Math::Randf() * 0.05f );
break;
}
case PSE_LevelUp:
{
P->Reset( mPos.x, mPos.y, Math::Randf() * 1.5f - 0.75f, Math::Randf() * 1.5f - 0.75f, Math::Randf() * 4 - 2, Math::Randf() * -4 + 2 );
P->Color( eeColorAf( 1.f, 0.5f, 0.1f, 1.f ), 0.07f + Math::Randf() * 0.01f );
P->Color( ColorAf( 1.f, 0.5f, 0.1f, 1.f ), 0.07f + Math::Randf() * 0.01f );
break;
}
case PSE_LevelUp2:
{
P->Reset( mPos.x + Math::Randf() * 32 - 16, mPos.y + Math::Randf() * 64 - 32, Math::Randf() - 0.5f, Math::Randf() - 0.5f, Math::Randf() - 0.5f, Math::Randf() * -0.9f + 0.45f );
P->Color( eeColorAf( 0.1f + Math::Randf() * 0.1f, 0.1f + Math::Randf() * 0.1f, 0.8f + Math::Randf() * 0.3f, 1 ), 0.07f + Math::Randf() * 0.01f );
P->Color( ColorAf( 0.1f + Math::Randf() * 0.1f, 0.1f + Math::Randf() * 0.1f, 0.8f + Math::Randf() * 0.3f, 1 ), 0.07f + Math::Randf() * 0.01f );
break;
}
case PSE_Heal:
{
P->Reset( mPos.x, mPos.y, Math::Randf() * 1.4f - 0.7f, Math::Randf() * -0.4f - 1.5f, Math::Randf() - 0.5f, Math::Randf() * -0.2f + 0.1f );
P->Color( eeColorAf( 0.2f, 0.3f, 0.9f, 0.4f ), 0.01f + Math::Randf() * 0.01f );
P->Color( ColorAf( 0.2f, 0.3f, 0.9f, 0.4f ), 0.01f + Math::Randf() * 0.01f );
break;
}
case PSE_WormHole:
@@ -180,7 +180,7 @@ void cParticleSystem::Reset( cParticle * P ) {
y = mPos.y + ( radio * eesin( (Float)P->Id() ) );
P->Reset( x, y, VarB[0], VarB[1], VarB[2], VarB[3] );
P->Color( eeColorAf( 1.f, 0.6f, 0.3f, 1.f ), 0.02f + Math::Randf() * 0.3f );
P->Color( ColorAf( 1.f, 0.6f, 0.3f, 1.f ), 0.02f + Math::Randf() * 0.3f );
break;
}
case PSE_Twirl:
@@ -200,7 +200,7 @@ void cParticleSystem::Reset( cParticle * P ) {
y = mPos.y - z * eecos( q );
P->Reset( x, y, 1, 1, 0, 0 );
P->Color( eeColorAf( 1.f, 0.25f, 0.25f, 1 ), 0.6f + Math::Randf() * 0.3f );
P->Color( ColorAf( 1.f, 0.25f, 0.25f, 1 ), 0.6f + Math::Randf() * 0.3f );
break;
}
case PSE_Flower:
@@ -210,7 +210,7 @@ void cParticleSystem::Reset( cParticle * P ) {
y = mPos.y + radio * eesin( (Float)P->Id() * 0.1f );
P->Reset( x, y, 1, 1, 0, 0 );
P->Color( eeColorAf( 1.f, 0.25f, 0.1f, 0.1f ), 0.3f + ( 0.2f * Math::Randf()) + Math::Randf() * 0.3f );
P->Color( ColorAf( 1.f, 0.25f, 0.1f, 0.1f ), 0.3f + ( 0.2f * Math::Randf()) + Math::Randf() * 0.3f );
break;
}
case PSE_Galaxy:
@@ -220,7 +220,7 @@ void cParticleSystem::Reset( cParticle * P ) {
y = mPos.y + radio * eesin( (Float)P->Id() );
P->Reset( x, y, 0, 0, 0, 0 );
P->Color( eeColorAf( 0.2f, 0.2f, 0.6f + 0.4f * Math::Randf(), 1.f ), Math::Randf( 0.05f, 0.15f ) );
P->Color( ColorAf( 0.2f, 0.2f, 0.6f + 0.4f * Math::Randf(), 1.f ), Math::Randf( 0.05f, 0.15f ) );
break;
}
case PSE_Heart:
@@ -230,7 +230,7 @@ void cParticleSystem::Reset( cParticle * P ) {
y = mPos.y - 50 * eecos( q * 2 ) * eesqrt( eeabs( eesin( q ) ) );
P->Reset( x, y, 0.f, 0.f, 0.f, -( Math::Randf() * 0.2f ) );
P->Color( eeColorAf( 1.f, 0.5f, 0.2f, 0.6f + 0.2f * Math::Randf() ), 0.01f + Math::Randf() * 0.08f );
P->Color( ColorAf( 1.f, 0.5f, 0.2f, 0.6f + 0.2f * Math::Randf() ), 0.01f + Math::Randf() * 0.08f );
break;
}
case PSE_BlueExplosion:
@@ -243,7 +243,7 @@ void cParticleSystem::Reset( cParticle * P ) {
y = mPos.y + ( radio * eesin( (Float)P->Id() / mProgression ) * 30 );
P->Reset(x, y, eecos( (Float)P->Id() ), eesin( (Float)P->Id() ), 0, 0 );
P->Color( eeColorAf( 0.3f, 0.6f, 1.f, 1.f ), 0.03f );
P->Color( ColorAf( 0.3f, 0.6f, 1.f, 1.f ), 0.03f );
break;
}
case PSE_GP:
@@ -253,7 +253,7 @@ void cParticleSystem::Reset( cParticle * P ) {
y = mPos.y + ( radio * eesin( (Float)P->Id() * (Float)0.01428571428 ) );
P->Reset( x, y, 0, 0, 0, 0 );
P->Color( eeColorAf( 0.2f, 0.8f, 0.4f, 0.5f ), Math::Randf() * 0.3f );
P->Color( ColorAf( 0.2f, 0.8f, 0.4f, 0.5f ), Math::Randf() * 0.3f );
break;
}
case PSE_BTwirl:
@@ -272,7 +272,7 @@ void cParticleSystem::Reset( cParticle * P ) {
y = mPos.y - w * eecos( q );
P->Reset( x, y, 1, 1, 0, 0 );
P->Color( eeColorAf( 0.25f, 0.25f, 1.f, 1.f ), 0.1f + Math::Randf() * 0.3f + Math::Randf() * 0.3f );
P->Color( ColorAf( 0.25f, 0.25f, 1.f, 1.f ), 0.1f + Math::Randf() * 0.3f + Math::Randf() * 0.3f );
break;
}
case PSE_BT:
@@ -291,7 +291,7 @@ void cParticleSystem::Reset( cParticle * P ) {
y = mPos.y - w * eecos( q );
P->Reset( x, y, -10, -1 * Math::Randf(), 0, Math::Randf() );
P->Color( eeColorAf( 0.25f, 0.25f, 1.f, 1.f ), 0.1f + Math::Randf() * 0.1f + Math::Randf() * 0.3f );
P->Color( ColorAf( 0.25f, 0.25f, 1.f, 1.f ), 0.1f + Math::Randf() * 0.1f + Math::Randf() * 0.3f );
break;
}
case PSE_Atomic:
@@ -301,7 +301,7 @@ void cParticleSystem::Reset( cParticle * P ) {
y = mPos.y + radio * eesin( (Float)P->Id() * 0.033333 );
P->Reset( x, y, 1, 1, 0, 0 );
P->Color( eeColorAf( 0.4f, 0.25f, 1.f, 1.f ), 0.3f + Math::Randf() * 0.2f + Math::Randf() * 0.3f );
P->Color( ColorAf( 0.4f, 0.25f, 1.f, 1.f ), 0.3f + Math::Randf() * 0.2f + Math::Randf() * 0.3f );
break;
}
case PSE_Callback:
@@ -353,7 +353,7 @@ void cParticleSystem::Draw() {
P = &mParticle[i];
if ( P->Used() ) {
BR->QuadsSetColor( eeColorA( 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( ColorA( static_cast<Uint8> ( P->R() * 255 ), static_cast<Uint8> ( P->G() * 255 ), static_cast<Uint8>( P->B() * 255 ), static_cast<Uint8>( P->A() * 255 ) ) );
BR->BatchQuad( P->X() - mHSize, P->Y() - mHSize, mSize, mSize );
}
}
@@ -470,11 +470,11 @@ void cParticleSystem::BlendMode( const EE_BLEND_MODE& mode ) {
mBlend = mode;
}
const eeColorAf& cParticleSystem::Color() const {
const ColorAf& cParticleSystem::Color() const {
return mColor;
}
void cParticleSystem::Color( const eeColorAf& Col ) {
void cParticleSystem::Color( const ColorAf& Col ) {
mColor = Col;
}

View File

@@ -47,7 +47,7 @@ void cPrimitives::DrawLine( const eeLine2f& line ) {
DrawBatch();
}
void cPrimitives::DrawTriangle( const eeTriangle2f& t, const eeColorA& Color1, const eeColorA& Color2, const eeColorA& Color3 ) {
void cPrimitives::DrawTriangle( const eeTriangle2f& t, const ColorA& Color1, const ColorA& Color2, const ColorA& Color3 ) {
sBR->SetTexture( NULL );
sBR->SetBlendMode( mBlendMode );
@@ -128,7 +128,7 @@ void cPrimitives::DrawCircle( const eeVector2f& p, const Float& radius, Uint32 p
GLi->VertexPointer( 2, GL_FLOAT, 0, circleVAR, circleVAR_count * sizeof(float) * 2 );
std::vector<eeColorA> colors( circleVAR_count - 1 ,mColor );
std::vector<ColorA> colors( circleVAR_count - 1 ,mColor );
GLi->ColorPointer( 4, GL_UNSIGNED_BYTE, 0, &colors[0], circleVAR_count * 4 );
@@ -186,7 +186,7 @@ void cPrimitives::DrawCircle( const eeVector2f& p, const Float& radius, Uint32 p
DrawBatch();
}
void cPrimitives::DrawRectangle( const eeRectf& R, const eeColorA& TopLeft, const eeColorA& BottomLeft, const eeColorA& BottomRight, const eeColorA& TopRight, const Float& Angle, const eeVector2f& Scale ) {
void cPrimitives::DrawRectangle( const eeRectf& R, const ColorA& TopLeft, const ColorA& BottomLeft, const ColorA& BottomRight, const ColorA& TopRight, const Float& Angle, const eeVector2f& Scale ) {
sBR->SetTexture( NULL );
sBR->SetBlendMode( mBlendMode );
@@ -235,7 +235,7 @@ void cPrimitives::DrawRectangle( const eeRectf& R, const Float& Angle, const eeV
DrawRectangle( R, mColor, mColor, mColor, mColor, Angle, Scale );
}
void cPrimitives::DrawRoundedRectangle( const eeRectf& R, const eeColorA& TopLeft, const eeColorA& BottomLeft, const eeColorA& BottomRight, const eeColorA& TopRight, const Float& Angle, const eeVector2f& Scale, const unsigned int& Corners ) {
void cPrimitives::DrawRoundedRectangle( const eeRectf& R, const ColorA& TopLeft, const ColorA& BottomLeft, const ColorA& BottomRight, const ColorA& TopRight, const Float& Angle, const eeVector2f& Scale, const unsigned int& Corners ) {
sBR->SetTexture( NULL );
sBR->SetBlendMode( mBlendMode );
@@ -318,7 +318,7 @@ void cPrimitives::DrawRoundedRectangle( const eeRectf& R, const Float& Angle, co
DrawRoundedRectangle( R, mColor, mColor, mColor, mColor, Angle, Scale, Corners );
}
void cPrimitives::DrawQuad( const eeQuad2f& q, const eeColorA& Color1, const eeColorA& Color2, const eeColorA& Color3, const eeColorA& Color4, const Float& OffsetX, const Float& OffsetY ) {
void cPrimitives::DrawQuad( const eeQuad2f& q, const ColorA& Color1, const ColorA& Color2, const ColorA& Color3, const ColorA& Color4, const Float& OffsetX, const Float& OffsetY ) {
sBR->SetTexture( NULL );
sBR->SetBlendMode( mBlendMode );
@@ -396,7 +396,7 @@ const bool& cPrimitives::ForceDraw() const {
return mForceDraw;
}
void cPrimitives::SetColor( const eeColorA& Color ) {
void cPrimitives::SetColor( const ColorA& Color ) {
mColor = Color;
}

View File

@@ -12,7 +12,7 @@ cScrollParallax::cScrollParallax() :
cScrollParallax::~cScrollParallax()
{}
cScrollParallax::cScrollParallax( cSubTexture * SubTexture, const eeVector2f& Position, const eeSizef& Size, const eeVector2f& Speed, const eeColorA& Color, const EE_BLEND_MODE& Blend ) {
cScrollParallax::cScrollParallax( cSubTexture * SubTexture, const eeVector2f& Position, const eeSizef& Size, const eeVector2f& Speed, const ColorA& Color, const EE_BLEND_MODE& Blend ) {
Create( SubTexture, Position, Size, Speed, Color, Blend );
}
@@ -40,7 +40,7 @@ void cScrollParallax::SetAABB() {
mAABB = eeRectf( mInitPos.x, mInitPos.y, mInitPos.x + mSize.Width(), mInitPos.y + mSize.Height() );
}
bool cScrollParallax::Create( cSubTexture * SubTexture, const eeVector2f& Position, const eeSizef& Size, const eeVector2f& Speed, const eeColorA& Color, const EE_BLEND_MODE& Blend ) {
bool cScrollParallax::Create( cSubTexture * SubTexture, const eeVector2f& Position, const eeSizef& Size, const eeVector2f& Speed, const ColorA& Color, const EE_BLEND_MODE& Blend ) {
mSubTexture = SubTexture;
mPos = Position;
mSize = Size;

View File

@@ -120,7 +120,7 @@ cSprite& cSprite::operator =( const cSprite& Other ) {
mCb = Other.mCb;
if ( NULL != Other.mVertexColors ) {
mVertexColors = eeNewArray( eeColorA, 4 );
mVertexColors = eeNewArray( ColorA, 4 );
mVertexColors[0] = Other.mVertexColors[0];
mVertexColors[1] = Other.mVertexColors[1];
mVertexColors[2] = Other.mVertexColors[2];
@@ -153,7 +153,7 @@ cSprite * cSprite::Copy() {
Spr->mCb = mCb;
if ( NULL != mVertexColors ) {
Spr->mVertexColors = eeNewArray( eeColorA, 4 );
Spr->mVertexColors = eeNewArray( ColorA, 4 );
Spr->mVertexColors[0] = mVertexColors[0];
Spr->mVertexColors[1] = mVertexColors[1];
Spr->mVertexColors[2] = mVertexColors[2];
@@ -182,7 +182,7 @@ void cSprite::Reset() {
mRepeations = -1;
mAngle = 0;
mColor = eeColorA(255, 255, 255, 255);
mColor = ColorA(255, 255, 255, 255);
mBlend = ALPHA_NORMAL;
mEffect = RN_NORMAL;
@@ -316,9 +316,9 @@ void cSprite::Position( const eeVector2f& NewPos ) {
mPos = NewPos;
}
void cSprite::UpdateVertexColors( const eeColorA& Color0, const eeColorA& Color1, const eeColorA& Color2, const eeColorA& Color3 ) {
void cSprite::UpdateVertexColors( const ColorA& Color0, const ColorA& Color1, const ColorA& Color2, const ColorA& Color3 ) {
if ( NULL == mVertexColors )
mVertexColors = eeNewArray( eeColorA, 4 );
mVertexColors = eeNewArray( ColorA, 4 );
mVertexColors[0] = Color0;
mVertexColors[1] = Color1;
@@ -758,11 +758,11 @@ void cSprite::AnimPaused( const bool& Pause ) {
}
}
void cSprite::Color( const eeColorA& Color) {
void cSprite::Color( const ColorA& Color) {
mColor = Color;
}
const eeColorA& cSprite::Color() const {
const ColorA& cSprite::Color() const {
return mColor;
}

View File

@@ -138,17 +138,17 @@ void cSubTexture::Offset( const eeVector2i& offset ) {
mOffset = offset;
}
void cSubTexture::Draw( const Float& X, const Float& Y, const eeColorA& Color, const Float& Angle, const eeVector2f& Scale, const EE_BLEND_MODE& Blend, const EE_RENDER_MODE& Effect, eeOriginPoint Center ) {
void cSubTexture::Draw( const Float& X, const Float& Y, const ColorA& Color, const Float& Angle, const eeVector2f& Scale, const EE_BLEND_MODE& Blend, const EE_RENDER_MODE& Effect, eeOriginPoint 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 cSubTexture::Draw( const Float& X, const Float& Y, const Float& Angle, const eeVector2f& Scale, const eeColorA& Color0, const eeColorA& Color1, const eeColorA& Color2, const eeColorA& Color3, const EE_BLEND_MODE& Blend, const EE_RENDER_MODE& Effect, eeOriginPoint Center ) {
void cSubTexture::Draw( const Float& X, const Float& Y, const Float& Angle, const eeVector2f& Scale, const ColorA& Color0, const ColorA& Color1, const ColorA& Color2, const ColorA& Color3, const EE_BLEND_MODE& Blend, const EE_RENDER_MODE& Effect, eeOriginPoint 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 cSubTexture::Draw( const eeQuad2f Q, const eeVector2f& Offset, const Float& Angle, const eeVector2f& Scale, const eeColorA& Color0, const eeColorA& Color1, const eeColorA& Color2, const eeColorA& Color3, const EE_BLEND_MODE& Blend ) {
void cSubTexture::Draw( const eeQuad2f Q, const eeVector2f& Offset, const Float& Angle, const eeVector2f& Scale, const ColorA& Color0, const ColorA& Color1, const ColorA& Color2, const ColorA& Color3, const EE_BLEND_MODE& Blend ) {
if ( NULL != mTexture )
mTexture->DrawQuadEx( Q, Offset, Angle, Scale, Color0, Color1, Color2, Color3, Blend, mSrcRect );
}
@@ -157,7 +157,7 @@ cTexture * cSubTexture::GetTexture() {
return mTexture;
}
void cSubTexture::ReplaceColor( eeColorA ColorKey, eeColorA NewColor ) {
void cSubTexture::ReplaceColor( ColorA ColorKey, ColorA NewColor ) {
mTexture->Lock();
for ( int y = mSrcRect.Top; y < mSrcRect.Bottom; y++ ) {
@@ -170,12 +170,12 @@ void cSubTexture::ReplaceColor( eeColorA ColorKey, eeColorA NewColor ) {
mTexture->Unlock( false, true );
}
void cSubTexture::CreateMaskFromColor(eeColorA ColorKey, Uint8 Alpha) {
ReplaceColor( ColorKey, eeColorA( ColorKey.R(), ColorKey.G(), ColorKey.B(), Alpha ) );
void cSubTexture::CreateMaskFromColor(ColorA ColorKey, Uint8 Alpha) {
ReplaceColor( ColorKey, ColorA( ColorKey.R(), ColorKey.G(), ColorKey.B(), Alpha ) );
}
void cSubTexture::CreateMaskFromColor(eeColor ColorKey, Uint8 Alpha) {
CreateMaskFromColor( eeColorA( ColorKey.R(), ColorKey.G(), ColorKey.B(), 255 ), Alpha );
void cSubTexture::CreateMaskFromColor(RGB ColorKey, Uint8 Alpha) {
CreateMaskFromColor( ColorA( ColorKey.R(), ColorKey.G(), ColorKey.B(), 255 ), Alpha );
}
void cSubTexture::CacheAlphaMask() {
@@ -215,7 +215,7 @@ void cSubTexture::CacheColors() {
int rY = 0;
int rX = 0;
int rW = mSrcRect.Right - mSrcRect.Left;
eeColorA tColor;
ColorA tColor;
Uint32 Channels = mTexture->Channels();
int Pos;
@@ -254,7 +254,7 @@ Uint8 cSubTexture::GetAlphaAt( const Int32& X, const Int32& Y ) {
return GetAlphaAt( X, Y );
}
eeColorA cSubTexture::GetColorAt( const Int32& X, const Int32& Y ) {
ColorA cSubTexture::GetColorAt( const Int32& X, const Int32& Y ) {
if ( mTexture->LocalCopy() )
return mTexture->GetPixel( mSrcRect.Left + X, mSrcRect.Right + Y );
@@ -263,13 +263,13 @@ eeColorA cSubTexture::GetColorAt( const Int32& X, const Int32& Y ) {
unsigned int Pos = ( X + Y * ( mSrcRect.Right - mSrcRect.Left ) ) * Channels;
if ( 4 == Channels )
return eeColorA( mPixels[ Pos ], mPixels[ Pos + 1 ], mPixels[ Pos + 2 ], mPixels[ Pos + 3 ] );
return ColorA( mPixels[ Pos ], mPixels[ Pos + 1 ], mPixels[ Pos + 2 ], mPixels[ Pos + 3 ] );
else if ( 3 == Channels )
return eeColorA( mPixels[ Pos ], mPixels[ Pos + 1 ], mPixels[ Pos + 2 ], 255 );
return ColorA( mPixels[ Pos ], mPixels[ Pos + 1 ], mPixels[ Pos + 2 ], 255 );
else if ( 2 == Channels )
return eeColorA( mPixels[ Pos ], mPixels[ Pos + 1 ], 255, 255 );
return ColorA( mPixels[ Pos ], mPixels[ Pos + 1 ], 255, 255 );
else
return eeColorA( mPixels[ Pos ], 255, 255, 255 );
return ColorA( mPixels[ Pos ], 255, 255, 255 );
}
CacheColors();
@@ -277,7 +277,7 @@ eeColorA cSubTexture::GetColorAt( const Int32& X, const Int32& Y ) {
return GetColorAt( X, Y );
}
void cSubTexture::SetColorAt( const Int32& X, const Int32& Y, const eeColorA& Color ) {
void cSubTexture::SetColorAt( const Int32& X, const Int32& Y, const ColorA& Color ) {
if ( NULL != mPixels ) {
Uint32 Channels = mTexture->Channels();
unsigned int Pos = ( X + Y * ( mSrcRect.Right - mSrcRect.Left ) ) * Channels;

View File

@@ -18,7 +18,7 @@ cTextCache::cTextCache() :
{
}
cTextCache::cTextCache( cFont * font, const String& text, eeColorA FontColor, eeColorA FontShadowColor ) :
cTextCache::cTextCache( cFont * font, const String& text, ColorA FontColor, ColorA FontShadowColor ) :
mText( text ),
mFont( font ),
mCachedWidth(0.f),
@@ -37,7 +37,7 @@ cTextCache::cTextCache( cFont * font, const String& text, eeColorA FontColor, ee
cTextCache::~cTextCache() {
}
void cTextCache::Create( cFont * font, const String& text, eeColorA FontColor, eeColorA FontShadowColor ) {
void cTextCache::Create( cFont * font, const String& text, ColorA FontColor, ColorA FontShadowColor ) {
mFont = font;
mText = text;
UpdateCoords();
@@ -80,7 +80,7 @@ void cTextCache::Text( const String& text ) {
Cache();
}
const eeColorA& cTextCache::Color() const {
const ColorA& cTextCache::Color() const {
return mFontColor;
}
@@ -91,7 +91,7 @@ void cTextCache::Alpha( const Uint8& alpha ) {
}
}
void cTextCache::Color( const eeColorA& color ) {
void cTextCache::Color( const ColorA& color ) {
if ( mFontColor != color ) {
mFontColor = color;
@@ -99,8 +99,8 @@ void cTextCache::Color( const eeColorA& color ) {
}
}
void cTextCache::Color( const eeColorA& color, Uint32 from, Uint32 to ) {
std::vector<eeColorA> colors( GLi->QuadVertexs(), color );
void cTextCache::Color( const ColorA& color, Uint32 from, Uint32 to ) {
std::vector<ColorA> colors( GLi->QuadVertexs(), color );
std::size_t s = mText.size();
if ( to >= s ) {
@@ -112,7 +112,7 @@ void cTextCache::Color( const eeColorA& color, Uint32 from, Uint32 to ) {
Int32 rpos = from;
Int32 lpos = 0;
Uint32 i;
Uint32 qsize = sizeof(eeColorA) * GLi->QuadVertexs();
Uint32 qsize = sizeof(ColorA) * GLi->QuadVertexs();
String::StringBaseType curChar;
// New lines and tabs are not rendered, and not counted as a color
@@ -144,11 +144,11 @@ void cTextCache::Color( const eeColorA& color, Uint32 from, Uint32 to ) {
}
}
const eeColorA& cTextCache::ShadowColor() const {
const ColorA& cTextCache::ShadowColor() const {
return mFontShadowColor;
}
void cTextCache::ShadowColor(const eeColorA& color) {
void cTextCache::ShadowColor(const ColorA& color) {
mFontShadowColor = color;
}
@@ -156,7 +156,7 @@ std::vector<eeVertexCoords>& cTextCache::VertextCoords() {
return mRenderCoords;
}
std::vector<eeColorA>& cTextCache::Colors() {
std::vector<ColorA>& cTextCache::Colors() {
return mColors;
}

View File

@@ -190,7 +190,7 @@ const Uint8 * cTexture::GetPixelsPtr() {
return cImage::GetPixelsPtr();
}
void cTexture::SetPixel( const unsigned int& x, const unsigned int& y, const eeColorA& Color ) {
void cTexture::SetPixel( const unsigned int& x, const unsigned int& y, const ColorA& Color ) {
cImage::SetPixel( x, y, Color );
mFlags |= TEX_FLAG_MODIFIED;
@@ -239,7 +239,7 @@ const EE_TEX_FILTER& cTexture::Filter() const {
return mFilter;
}
void cTexture::ReplaceColor( const eeColorA& ColorKey, const eeColorA& NewColor ) {
void cTexture::ReplaceColor( const ColorA& ColorKey, const ColorA& NewColor ) {
Lock();
cImage::ReplaceColor( ColorKey, NewColor );
@@ -247,15 +247,15 @@ void cTexture::ReplaceColor( const eeColorA& ColorKey, const eeColorA& NewColor
Unlock( false, true );
}
void cTexture::CreateMaskFromColor( const eeColorA& ColorKey, Uint8 Alpha ) {
void cTexture::CreateMaskFromColor( const ColorA& ColorKey, Uint8 Alpha ) {
Lock( true );
cImage::ReplaceColor( ColorKey, eeColorA( ColorKey.R(), ColorKey.G(), ColorKey.B(), Alpha ) );
cImage::ReplaceColor( ColorKey, ColorA( ColorKey.R(), ColorKey.G(), ColorKey.B(), Alpha ) );
Unlock( false, true );
}
void cTexture::FillWithColor( const eeColorA& Color ) {
void cTexture::FillWithColor( const ColorA& Color ) {
Lock();
cImage::FillWithColor( Color );
@@ -428,11 +428,11 @@ bool cTexture::IsCompressed() const {
return 0 != ( mFlags & TEX_FLAG_COMPRESSED );
}
void cTexture::Draw( const Float &x, const Float &y, const Float &Angle, const eeVector2f &Scale, const eeColorA& Color, const EE_BLEND_MODE &Blend, const EE_RENDER_MODE &Effect, eeOriginPoint Center, const eeRecti& texSector) {
void cTexture::Draw( const Float &x, const Float &y, const Float &Angle, const eeVector2f &Scale, const ColorA& Color, const EE_BLEND_MODE &Blend, const EE_RENDER_MODE &Effect, eeOriginPoint Center, const eeRecti& texSector) {
DrawEx( x, y, 0, 0, Angle, Scale, Color, Color, Color, Color, Blend, Effect, Center, texSector );
}
void cTexture::DrawFast( const Float& x, const Float& y, const Float& Angle, const eeVector2f& Scale, const eeColorA& Color, const EE_BLEND_MODE &Blend, const Float &width, const Float &height ) {
void cTexture::DrawFast( const Float& x, const Float& y, const Float& Angle, const eeVector2f& Scale, const ColorA& Color, const EE_BLEND_MODE &Blend, const Float &width, const Float &height ) {
Float w = 0.f != width ? width : (Float)ImgWidth();
Float h = 0.f != height ? height : (Float)ImgHeight();
@@ -451,7 +451,7 @@ void cTexture::DrawFast( const Float& x, const Float& y, const Float& Angle, con
sBR->DrawOpt();
}
void cTexture::DrawEx( Float x, Float y, Float width, Float height, const Float &Angle, const eeVector2f &Scale, const eeColorA& Color0, const eeColorA& Color1, const eeColorA& Color2, const eeColorA& Color3, const EE_BLEND_MODE &Blend, const EE_RENDER_MODE &Effect, eeOriginPoint Center, const eeRecti& texSector ) {
void cTexture::DrawEx( Float x, Float y, Float width, Float height, const Float &Angle, const eeVector2f &Scale, const ColorA& Color0, const ColorA& Color1, const ColorA& Color2, const ColorA& Color3, const EE_BLEND_MODE &Blend, const EE_RENDER_MODE &Effect, eeOriginPoint Center, const eeRecti& texSector ) {
bool renderSector = true;
eeRecti Sector = texSector;
Float w = (Float)ImgWidth();
@@ -618,11 +618,11 @@ void cTexture::DrawEx( Float x, Float y, Float width, Float height, const Float
sBR->DrawOpt();
}
void cTexture::DrawQuad( const eeQuad2f& Q, const eeVector2f& Offset, const Float &Angle, const eeVector2f &Scale, const eeColorA& Color, const EE_BLEND_MODE &Blend, const eeRecti& texSector) {
void cTexture::DrawQuad( const eeQuad2f& Q, const eeVector2f& Offset, const Float &Angle, const eeVector2f &Scale, const ColorA& Color, const EE_BLEND_MODE &Blend, const eeRecti& texSector) {
DrawQuadEx( Q, Offset, Angle, Scale, Color, Color, Color, Color, Blend, texSector );
}
void cTexture::DrawQuadEx( eeQuad2f Q, const eeVector2f& Offset, const Float &Angle, const eeVector2f &Scale, const eeColorA& Color0, const eeColorA& Color1, const eeColorA& Color2, const eeColorA& Color3, const EE_BLEND_MODE &Blend, eeRecti texSector ) {
void cTexture::DrawQuadEx( eeQuad2f Q, const eeVector2f& Offset, const Float &Angle, const eeVector2f &Scale, const ColorA& Color0, const ColorA& Color1, const ColorA& Color2, const ColorA& Color3, const EE_BLEND_MODE &Blend, eeRecti texSector ) {
bool renderSector = true;
Float w = (Float)ImgWidth();
Float h = (Float)ImgHeight();

View File

@@ -26,7 +26,7 @@ cTextureFactory::~cTextureFactory() {
UnloadTextures();
}
Uint32 cTextureFactory::CreateEmptyTexture( const unsigned int& Width, const unsigned int& Height, const unsigned int& Channels, const eeColorA& DefaultColor, const bool& Mipmap, const EE_CLAMP_MODE& ClampMode, const bool& CompressTexture, const bool& KeepLocalCopy ) {
Uint32 cTextureFactory::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 ) {
cImage TmpImg( Width, Height, Channels, DefaultColor );
return LoadFromPixels( TmpImg.GetPixelsPtr(), Width, Height, Channels, Mipmap, ClampMode, CompressTexture, KeepLocalCopy );
}

View File

@@ -450,7 +450,7 @@ void cTextureLoader::LoadFromPixels() {
cImage * tImg = eeNew ( cImage, ( mPixels, mImgWidth, mImgHeight, mChannels ) );
tImg->CreateMaskFromColor( eeColorA( mColorKey->R(), mColorKey->G(), mColorKey->B(), 255 ), 0 );
tImg->CreateMaskFromColor( ColorA( mColorKey->R(), mColorKey->G(), mColorKey->B(), 255 ), 0 );
tImg->AvoidFreeImage( true );
@@ -536,9 +536,9 @@ const Uint32& cTextureLoader::Id() const {
return mTexId;
}
void cTextureLoader::SetColorKey( eeColor Color ) {
void cTextureLoader::SetColorKey( RGB Color ) {
eeSAFE_DELETE( mColorKey );
mColorKey = eeNew( eeColor, ( Color.R(), Color.G(), Color.B() ) );
mColorKey = eeNew( RGB, ( Color.R(), Color.G(), Color.B() ) );
}
const std::string& cTextureLoader::Filepath() const {

View File

@@ -520,7 +520,7 @@ void cTexturePacker::Save( const std::string& Filepath, const EE_SAVE_TYPE& Form
cImage Img( (Uint32)mWidth, (Uint32)mHeight, (Uint32)4 );
Img.FillWithColor( eeColorA(0,0,0,0) );
Img.FillWithColor( ColorA(0,0,0,0) );
cTexturePackerTex * t = NULL;
int w, h, c;

View File

@@ -26,7 +26,7 @@ cTTFFont::~cTTFFont() {
hkFontManager::instance()->Destroy();
}
bool cTTFFont::LoadFromPack( Pack* Pack, const std::string& FilePackPath, const unsigned int& Size, EE_TTF_FONT_STYLE Style, const Uint16& NumCharsToGen, const eeColor& FontColor, const Uint8& OutlineSize, const eeColor& OutlineColor, const bool& AddPixelSeparator ) {
bool cTTFFont::LoadFromPack( Pack* Pack, const std::string& FilePackPath, const unsigned int& Size, EE_TTF_FONT_STYLE Style, const Uint16& NumCharsToGen, const RGB& FontColor, const Uint8& OutlineSize, const RGB& OutlineColor, const bool& AddPixelSeparator ) {
bool Ret = false;
SafeDataPointer PData;
@@ -39,7 +39,7 @@ bool cTTFFont::LoadFromPack( Pack* Pack, const std::string& FilePackPath, const
return Ret;
}
bool cTTFFont::LoadFromMemory( Uint8* TTFData, const unsigned int& TTFDataSize, const unsigned int& Size, EE_TTF_FONT_STYLE Style, const Uint16& NumCharsToGen, const eeColor& FontColor, const Uint8& OutlineSize, const eeColor& OutlineColor, const bool& AddPixelSeparator ) {
bool cTTFFont::LoadFromMemory( Uint8* TTFData, const unsigned int& TTFDataSize, const unsigned int& Size, EE_TTF_FONT_STYLE Style, const Uint16& NumCharsToGen, const RGB& FontColor, const Uint8& OutlineSize, const RGB& OutlineColor, const bool& AddPixelSeparator ) {
if ( !mFilepath.size() )
mFilepath = "from memory";
@@ -55,7 +55,7 @@ bool cTTFFont::LoadFromMemory( Uint8* TTFData, const unsigned int& TTFDataSize,
return iLoad( Size, Style, NumCharsToGen, FontColor, OutlineSize, OutlineColor, AddPixelSeparator );
}
bool cTTFFont::Load( const std::string& Filepath, const unsigned int& Size, EE_TTF_FONT_STYLE Style, const Uint16& NumCharsToGen, const eeColor& FontColor, const Uint8& OutlineSize, const eeColor& OutlineColor, const bool& AddPixelSeparator ) {
bool cTTFFont::Load( const std::string& Filepath, const unsigned int& Size, EE_TTF_FONT_STYLE Style, const Uint16& NumCharsToGen, const RGB& FontColor, const Uint8& OutlineSize, const RGB& OutlineColor, const bool& AddPixelSeparator ) {
mFilepath = Filepath;
if ( FileSystem::FileExists( Filepath ) ) {
@@ -80,7 +80,7 @@ bool cTTFFont::Load( const std::string& Filepath, const unsigned int& Size, EE_T
return false;
}
bool cTTFFont::iLoad( const unsigned int& Size, EE_TTF_FONT_STYLE Style, const Uint16& NumCharsToGen, const eeColor& FontColor, Uint8 OutlineSize, const eeColor& OutlineColor, const bool& AddPixelSeparator ) {
bool cTTFFont::iLoad( const unsigned int& Size, EE_TTF_FONT_STYLE Style, const Uint16& NumCharsToGen, const RGB& FontColor, Uint8 OutlineSize, const RGB& OutlineColor, const bool& AddPixelSeparator ) {
eeRect CurrentPos;
eeSize GlyphRect;
@@ -148,7 +148,7 @@ bool cTTFFont::iLoad( const unsigned int& Size, EE_TTF_FONT_STYLE Style, const U
}
} while ( TexSize < ReqSize );
mPixels = eeNewArray( eeColorA, TexSize );
mPixels = eeNewArray( ColorA, TexSize );
memset( mPixels, 0x00000000, TexSize * 4 );
CurrentPos.Left = OutSize;
@@ -157,7 +157,7 @@ bool cTTFFont::iLoad( const unsigned int& Size, EE_TTF_FONT_STYLE Style, const U
Uint32 * TexGlyph;
Uint32 w = (Uint32)mTexWidth;
//Uint32 h = (Uint32)mTexHeight;
eeColorA fFontColor( FontColor );
ColorA fFontColor( FontColor );
//Loop through all chars
for ( unsigned int i = 0; i < mNumChars; i++ ) {
@@ -175,7 +175,7 @@ bool cTTFFont::iLoad( const unsigned int& Size, EE_TTF_FONT_STYLE Style, const U
// Create the outline for the glyph and copy the outline to the texture
if ( OutlineSize && OutlineFreetype == OutlineMethod ) {
TempOutGlyphSurface = mFontOutline->GlyphRender( i, eeColorA( OutlineColor ).GetValue() );
TempOutGlyphSurface = mFontOutline->GlyphRender( i, ColorA( OutlineColor ).GetValue() );
mFontOutline->GlyphMetrics( i, &TempGlyph.MinX, &TempGlyph.MaxX, &TempGlyph.MinY, &TempGlyph.MaxY, &TempGlyph.Advance );
@@ -213,7 +213,7 @@ bool cTTFFont::iLoad( const unsigned int& Size, EE_TTF_FONT_STYLE Style, const U
// Copy the glyph to the texture
for (int y = 0; y < GlyphRect.y; ++y ) {
// Copy per row
memcpy( &mPixels[ CurrentPos.Left + (CurrentPos.Top + y) * w ], &TexGlyph[ y * GlyphRect.x ], GlyphRect.x * sizeof(eeColorA) );
memcpy( &mPixels[ CurrentPos.Left + (CurrentPos.Top + y) * w ], &TexGlyph[ y * GlyphRect.x ], GlyphRect.x * sizeof(ColorA) );
}
// Fixes the width and height of the current pos
@@ -280,7 +280,7 @@ bool cTTFFont::iLoad( const unsigned int& Size, EE_TTF_FONT_STYLE Style, const U
Pos = x + y * nGlyphS.x;
// Blending the normal glyph color to the outline color
mPixels[ RPos ] = Color::Blend( eeColorA( FontColor, alpha_init[ Pos ] ), eeColorA( OutlineColor, alpha_final[ Pos ] ) );
mPixels[ RPos ] = Color::Blend( ColorA( FontColor, alpha_init[ Pos ] ), ColorA( OutlineColor, alpha_final[ Pos ] ) );
}
}

View File

@@ -4,7 +4,7 @@
namespace EE { namespace Graphics {
cTTFFontLoader::cTTFFontLoader( const std::string& FontName, const std::string& Filepath, const unsigned int& Size, EE_TTF_FONT_STYLE Style, const Uint16& NumCharsToGen, const eeColor& FontColor, const Uint8& OutlineSize, const eeColor& OutlineColor, const bool& AddPixelSeparator ) :
cTTFFontLoader::cTTFFontLoader( const std::string& FontName, const std::string& Filepath, const unsigned int& Size, EE_TTF_FONT_STYLE Style, const Uint16& NumCharsToGen, const RGB& FontColor, const Uint8& OutlineSize, const RGB& OutlineColor, const bool& AddPixelSeparator ) :
ObjectLoader( FontTTFLoader ),
mLoadType( TTF_LT_PATH ),
mFontName( FontName ),
@@ -21,7 +21,7 @@ cTTFFontLoader::cTTFFontLoader( const std::string& FontName, const std::string&
Create();
}
cTTFFontLoader::cTTFFontLoader( const std::string& FontName, Pack * Pack, const std::string& FilePackPath, const unsigned int& Size, EE_TTF_FONT_STYLE Style, const Uint16& NumCharsToGen, const eeColor& FontColor, const Uint8& OutlineSize, const eeColor& OutlineColor, const bool& AddPixelSeparator ) :
cTTFFontLoader::cTTFFontLoader( const std::string& FontName, Pack * Pack, const std::string& FilePackPath, const unsigned int& Size, EE_TTF_FONT_STYLE Style, const Uint16& NumCharsToGen, const RGB& FontColor, const Uint8& OutlineSize, const RGB& OutlineColor, const bool& AddPixelSeparator ) :
ObjectLoader( FontTTFLoader ),
mLoadType( TTF_LT_PACK ),
mFontName( FontName ),
@@ -39,7 +39,7 @@ cTTFFontLoader::cTTFFontLoader( const std::string& FontName, Pack * Pack, const
Create();
}
cTTFFontLoader::cTTFFontLoader( const std::string& FontName, Uint8* TTFData, const unsigned int& TTFDataSize, const unsigned int& Size, EE_TTF_FONT_STYLE Style, const Uint16& NumCharsToGen, const eeColor& FontColor, const Uint8& OutlineSize, const eeColor& OutlineColor, const bool& AddPixelSeparator ) :
cTTFFontLoader::cTTFFontLoader( const std::string& FontName, Uint8* TTFData, const unsigned int& TTFDataSize, const unsigned int& Size, EE_TTF_FONT_STYLE Style, const Uint16& NumCharsToGen, const RGB& FontColor, const Uint8& OutlineSize, const RGB& OutlineColor, const bool& AddPixelSeparator ) :
ObjectLoader( FontTTFLoader ),
mLoadType( TTF_LT_MEM ),
mFontName( FontName ),

View File

@@ -53,7 +53,7 @@ void cVertexBuffer::AddVertexCoord( const eeVector2f& VertexCoord, const Uint32&
AddVertex( VERTEX_FLAG_TEXTURE0 + TextureLevel, VertexCoord );
}
void cVertexBuffer::AddColor( const eeColorA& Color ) {
void cVertexBuffer::AddColor( const ColorA& Color ) {
mColorArray.push_back( Color.R() );
mColorArray.push_back( Color.G() );
mColorArray.push_back( Color.B() );
@@ -114,12 +114,12 @@ eeVector2f cVertexBuffer::GetVector2( const Uint32& Type, const Uint32& Index )
return eeVector2f( mVertexArray[ Type ][ pos ], mVertexArray[ Type ][ pos + 1 ] );
}
eeColorA cVertexBuffer::GetColor( const Uint32& Index ) {
ColorA cVertexBuffer::GetColor( const Uint32& Index ) {
eeASSERT( !VERTEX_FLAG_QUERY( mVertexFlags, VERTEX_FLAG_COLOR ) );
Int32 pos = Index * eeVertexElements[ VERTEX_FLAG_COLOR ];
return eeColorA( mColorArray[ pos ], mColorArray[ pos + 1 ], mColorArray[ pos + 2 ], mColorArray[ pos + 3 ] );
return ColorA( mColorArray[ pos ], mColorArray[ pos + 1 ], mColorArray[ pos + 2 ], mColorArray[ pos + 3 ] );
}
Uint32 cVertexBuffer::GetIndex( const Uint32& Index ) {

View File

@@ -38,7 +38,7 @@ bool PixelPerfectCollide( cTexture * Tex1, const unsigned int& x1, const unsigne
inter_x1 = eemin(ax2,bx2);
inter_y0 = eemax(ay1,by1);
inter_y1 = eemin(ay2,by2);
eeColorA C1, C2;
ColorA C1, C2;
for(unsigned int y = inter_y0 ; y <= inter_y1 ; y++) {
for(unsigned int x = inter_x0 ; x <= inter_x1 ; x++) {
@@ -82,7 +82,7 @@ bool PixelPerfectCollide( cTexture * Tex, const unsigned int& x1, const unsigned
}
if ( !( ax1 >= x2 && ax2 <= x2 && ay1 >= y2 && ay2 <= y2 ) ) {
eeColorA C1;
ColorA C1;
Tex->Lock();

View File

@@ -104,7 +104,7 @@ void cDampedSpring::Draw() {
GLi->Disable( GL_TEXTURE_2D );
GLi->DisableClientState( GL_TEXTURE_COORD_ARRAY );
std::vector<eeColorA> tcolors( springVAR_count * 4, eeColorA( 0, 255, 0, 255 ) );
std::vector<ColorA> tcolors( springVAR_count * 4, ColorA( 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 );

View File

@@ -57,11 +57,11 @@ void cGrooveJoint::Draw() {
BR->SetTexture( NULL );
BR->SetPointSize( mDrawPointSize );
BR->PointsBegin();
BR->PointSetColor( eeColorA( 128, 255, 128, 255 ) );
BR->PointSetColor( ColorA( 128, 255, 128, 255 ) );
BR->BatchPoint( c.x, c.y );
BR->Draw();
BR->LinesBegin();
BR->LinesSetColor( eeColorA( 128, 255, 128, 255 ) );
BR->LinesSetColor( ColorA( 128, 255, 128, 255 ) );
BR->BatchLine( a.x, a.y, b.x, b.y );
BR->Draw();
BR->SetPointSize( ps );

View File

@@ -56,13 +56,13 @@ void cPinJoint::Draw() {
BR->SetTexture( NULL );
BR->SetPointSize( mDrawPointSize );
BR->PointsBegin();
BR->PointSetColor( eeColorA( 128, 255, 128, 255 ) );
BR->PointSetColor( ColorA( 128, 255, 128, 255 ) );
BR->BatchPoint( a.x, a.y );
BR->BatchPoint( b.x, b.y );
BR->Draw();
BR->LinesBegin();
BR->LinesSetColor( eeColorA( 128, 255, 128, 255 ) );
BR->LinesSetColor( ColorA( 128, 255, 128, 255 ) );
BR->BatchLine( a.x, a.y, b.x, b.y );
BR->Draw();

View File

@@ -57,7 +57,7 @@ void cPivotJoint::Draw() {
BR->SetTexture( NULL );
BR->SetPointSize( mDrawPointSize );
BR->PointsBegin();
BR->PointSetColor( eeColorA( 128, 255, 128, 255 ) );
BR->PointSetColor( ColorA( 128, 255, 128, 255 ) );
BR->BatchPoint( a.x, a.y );
BR->BatchPoint( b.x, b.y );
BR->Draw();

View File

@@ -65,7 +65,7 @@ void cSlideJoint::Draw() {
BR->SetTexture( NULL );
BR->SetPointSize( mDrawPointSize );
BR->PointsBegin();
BR->PointSetColor( eeColorA( 128, 255, 128, 255 ) );
BR->PointSetColor( ColorA( 128, 255, 128, 255 ) );
BR->BatchPoint( a.x, a.y );
BR->BatchPoint( b.x, b.y );
BR->Draw();

View File

@@ -169,7 +169,7 @@ cShapeSegment * cShape::GetAsSegment() {
void cShape::DrawBB() {
#ifdef PHYSICS_RENDERER_ENABLED
cPrimitives P;
P.SetColor( eeColorA( 76, 128, 76, 255 ) );
P.SetColor( ColorA( 76, 128, 76, 255 ) );
P.ForceDraw( false );
P.DrawLine( eeLine2f( eeVector2f( mShape->bb.l, mShape->bb.t ), eeVector2f( mShape->bb.r, mShape->bb.t ) ) );
P.DrawLine( eeLine2f( eeVector2f( mShape->bb.l, mShape->bb.t ), eeVector2f( mShape->bb.l, mShape->bb.b ) ) );

View File

@@ -61,7 +61,7 @@ void cShapePoly::Draw( cSpace * space ) {
BR->SetTexture( NULL );
eeColorA Col = ColorForShape( (cpShape *)poly, space->Space() );
ColorA Col = ColorForShape( (cpShape *)poly, space->Space() );
if( !poly->CP_PRIVATE(shape).sensor ){
if ( 4 != poly->CP_PRIVATE(numVerts) ) {
@@ -91,7 +91,7 @@ void cShapePoly::DrawBorder( cSpace *space ) {
cBatchRenderer * BR = cGlobalBatchRenderer::instance();
eeColorA Col = ColorForShape( (cpShape *)poly, space->Space() );
ColorA Col = ColorForShape( (cpShape *)poly, space->Space() );
BR->LineLoopBegin();
BR->LineLoopSetColor( Col );

View File

@@ -97,7 +97,7 @@ void cShapeSegment::Draw( cSpace * space ) {
GLi->Disable( GL_TEXTURE_2D );
GLi->DisableClientState( GL_TEXTURE_COORD_ARRAY );
std::vector<eeColorA> tcolors( pillVAR_count * 4 );
std::vector<ColorA> tcolors( pillVAR_count * 4 );
GLi->PushMatrix();
@@ -116,7 +116,7 @@ void cShapeSegment::Draw( cSpace * space ) {
GLi->VertexPointer( 3, GL_FLOAT, 0, pillVAR, pillVAR_count * sizeof(float) * 3 );
if( !seg->CP_PRIVATE(shape).sensor ) {
eeColorA C = ColorForShape( mShape, space->Space() );
ColorA C = ColorForShape( mShape, space->Space() );
tcolors.assign( tcolors.size(), C );
@@ -125,7 +125,7 @@ void cShapeSegment::Draw( cSpace * space ) {
GLi->DrawArrays( GL_TRIANGLE_FAN, 0, pillVAR_count );
}
tcolors.assign( tcolors.size(), eeColorA( 102, 102, 102, 255 ) );
tcolors.assign( tcolors.size(), ColorA( 102, 102, 102, 255 ) );
GLi->ColorPointer( 4, GL_UNSIGNED_BYTE, 0, reinterpret_cast<const void*>( &tcolors[0] ), pillVAR_count * 4 );

View File

@@ -324,7 +324,7 @@ void cSpace::Draw() {
if ( options->BodyPointSize ) {
BR->SetPointSize( options->BodyPointSize );
BR->PointsBegin();
BR->PointSetColor( eeColorA( 255, 255, 255, 255 ) );
BR->PointSetColor( ColorA( 255, 255, 255, 255 ) );
cpArray * bodies = mSpace->CP_PRIVATE(bodies);
@@ -340,7 +340,7 @@ void cSpace::Draw() {
if ( options->CollisionPointSize ) {
BR->SetPointSize( options->CollisionPointSize );
BR->PointsBegin();
BR->PointSetColor( eeColorA( 255, 0, 0, 255 ) );
BR->PointSetColor( ColorA( 255, 0, 0, 255 ) );
cpArray * arbiters = mSpace->CP_PRIVATE(arbiters);

View File

@@ -6,7 +6,7 @@ cUIBackground::cUIBackground() :
mBlendMode( ALPHA_NORMAL ),
mCorners(0)
{
mColor.push_back( eeColorA(0xFF404040) );
mColor.push_back( ColorA(0xFF404040) );
}
cUIBackground::cUIBackground( const cUIBackground& Back ) :
@@ -17,33 +17,33 @@ cUIBackground::cUIBackground( const cUIBackground& Back ) :
mColor = b->Colors();
}
cUIBackground::cUIBackground( const eeColorA& Color, const unsigned int& Corners, const EE_BLEND_MODE& BlendMode ) :
cUIBackground::cUIBackground( const ColorA& Color, const unsigned int& Corners, const EE_BLEND_MODE& BlendMode ) :
mBlendMode( BlendMode ),
mCorners( Corners )
{
mColor.push_back( Color );
}
cUIBackground::cUIBackground( const eeColorA& TopLeftColor, const eeColorA& BottomLeftColor, const eeColorA& BottomRightColor, const eeColorA& TopRightColor, const unsigned int& Corners, const EE_BLEND_MODE& BlendMode ) :
cUIBackground::cUIBackground( const ColorA& TopLeftColor, const ColorA& BottomLeftColor, const ColorA& BottomRightColor, const ColorA& TopRightColor, const unsigned int& Corners, const EE_BLEND_MODE& BlendMode ) :
mBlendMode( BlendMode ),
mCorners( Corners )
{
Colors( TopLeftColor, BottomLeftColor, BottomRightColor, TopRightColor );
}
eeColorA& cUIBackground::Color( const unsigned int& index ) {
ColorA& cUIBackground::Color( const unsigned int& index ) {
if ( index < mColor.size() )
return mColor[ index ];
return mColor[ 0 ];
}
void cUIBackground::ColorsTo( const eeColorA& Color ) {
void cUIBackground::ColorsTo( const ColorA& Color ) {
for ( unsigned int i = 0; i < mColor.size(); i++ )
mColor[i] = Color;
}
void cUIBackground::Colors( const eeColorA& TopLeftColor, const eeColorA& BottomLeftColor, const eeColorA& BottomRightColor, const eeColorA& TopRightColor ) {
void cUIBackground::Colors( const ColorA& TopLeftColor, const ColorA& BottomLeftColor, const ColorA& BottomRightColor, const ColorA& TopRightColor ) {
mColor[0] = TopLeftColor;
if ( mColor.size() < 2 )
@@ -62,11 +62,11 @@ void cUIBackground::Colors( const eeColorA& TopLeftColor, const eeColorA& Bottom
mColor[3] = TopRightColor;
}
const std::vector<eeColorA>& cUIBackground::Colors() {
const std::vector<ColorA>& cUIBackground::Colors() {
return mColor;
}
void cUIBackground::Color( const eeColorA& Col ) {
void cUIBackground::Color( const ColorA& Col ) {
mColor[0] = Col;
}

View File

@@ -5,11 +5,11 @@ namespace EE { namespace UI {
cUIBorder::cUIBorder() : mColor( 0xFF404040 ), mWidth( 1 ) {}
cUIBorder::cUIBorder( const cUIBorder& border ) : mColor( border.Color() ), mWidth( border.Width() ) {}
const eeColorA& cUIBorder::Color() const {
const ColorA& cUIBorder::Color() const {
return mColor;
}
void cUIBorder::Color( const eeColorA& Col ) {
void cUIBorder::Color( const ColorA& Col ) {
mColor = Col;
}

View File

@@ -96,7 +96,7 @@ cUICommonDialog::cUICommonDialog( const cUICommonDialog::CreateParams& Params )
);
LBParams.Flags = UI_AUTO_PADDING | UI_ANCHOR_RIGHT | UI_ANCHOR_LEFT | UI_ANCHOR_TOP | UI_ANCHOR_BOTTOM | UI_CLIP_ENABLE;
LBParams.FontSelectedColor = eeColorA( 255, 255, 255, 255 );
LBParams.FontSelectedColor = ColorA( 255, 255, 255, 255 );
if ( NULL != cUIThemeManager::instance()->DefaultTheme() ) {
cUITheme * Theme = cUIThemeManager::instance()->DefaultTheme();

View File

@@ -325,8 +325,8 @@ void cUIControlAnim::BorderDraw() {
}
}
eeColorA cUIControlAnim::GetColor( const eeColorA& Col ) {
return eeColorA( Col.R(), Col.G(), Col.B(), static_cast<Uint8>( (Float)Col.A() * ( mAlpha / 255.f ) ) );
ColorA cUIControlAnim::GetColor( const ColorA& Col ) {
return ColorA( Col.R(), Col.G(), Col.B(), static_cast<Uint8>( (Float)Col.A() * ( mAlpha / 255.f ) ) );
}
void cUIControlAnim::UpdateQuad() {

View File

@@ -12,10 +12,10 @@ namespace EE { namespace UI {
cUIDefaultTheme::cUIDefaultTheme( const std::string& Name, const std::string& Abbr, cFont * DefaultFont ) :
cUITheme( Name, Abbr, DefaultFont )
{
FontColor( eeColorA( 230, 230, 230, 255 ) );
FontOverColor( eeColorA( 255, 255, 255, 255 ) );
FontSelectedColor( eeColorA( 255, 255, 255, 255 ) );
FontShadowColor( eeColorA( 50, 50, 50, 150 ) );
FontColor( ColorA( 230, 230, 230, 255 ) );
FontOverColor( ColorA( 255, 255, 255, 255 ) );
FontSelectedColor( ColorA( 255, 255, 255, 255 ) );
FontShadowColor( ColorA( 50, 50, 50, 150 ) );
}
cUIPopUpMenu * cUIDefaultTheme::CreatePopUpMenu( cUIControl * Parent, const eeSize& Size, const eeVector2i& Pos, const Uint32& Flags, Uint32 RowHeight, eeRecti PaddingContainer, Uint32 MinWidth, Uint32 MinSpaceForIcons, Uint32 MinRightMargin ) {
@@ -34,7 +34,7 @@ cUIPopUpMenu * cUIDefaultTheme::CreatePopUpMenu( cUIControl * Parent, const eeSi
MenuParams.MinWidth = 100;
MenuParams.MinSpaceForIcons = 24;
MenuParams.MinRightMargin = 8;
MenuParams.FontColor = eeColorA( 230, 230, 230, 255 );
MenuParams.FontColor = ColorA( 230, 230, 230, 255 );
}
return eeNew( cUIPopUpMenu, ( MenuParams ) );
@@ -100,7 +100,7 @@ cUIWindow * cUIDefaultTheme::CreateWindow( cUIControl * Parent, const eeSize& Si
WinParams.Flags |= UI_DRAW_SHADOW;
WinParams.WinFlags |= UI_WIN_DRAW_SHADOW;
WinParams.ButtonsPositionFixer.x = -2;
WinParams.TitleFontColor = eeColorA( 230, 230, 230, 255 );
WinParams.TitleFontColor = ColorA( 230, 230, 230, 255 );
}
return eeNew( cUIWindow, ( WinParams ) );
@@ -123,7 +123,7 @@ cUICommonDialog * cUIDefaultTheme::CreateCommonDialog( cUIControl * Parent, cons
DLGParams.Flags |= UI_DRAW_SHADOW;
DLGParams.WinFlags |= UI_WIN_DRAW_SHADOW;
DLGParams.ButtonsPositionFixer.x = -2;
DLGParams.TitleFontColor = eeColorA( 230, 230, 230, 255 );
DLGParams.TitleFontColor = ColorA( 230, 230, 230, 255 );
}
return eeNew( cUICommonDialog, ( DLGParams ) );
@@ -145,7 +145,7 @@ cUIMessageBox * cUIDefaultTheme::CreateMessageBox( UI_MSGBOX_TYPE Type, const St
MsgBoxParams.Flags |= UI_DRAW_SHADOW;
MsgBoxParams.WinFlags |= UI_WIN_DRAW_SHADOW;
MsgBoxParams.ButtonsPositionFixer.x = -2;
MsgBoxParams.TitleFontColor = eeColorA( 230, 230, 230, 255 );
MsgBoxParams.TitleFontColor = ColorA( 230, 230, 230, 255 );
}
return eeNew( cUIMessageBox, ( MsgBoxParams ) );
@@ -208,9 +208,9 @@ cUITabWidget * cUIDefaultTheme::CreateTabWidget( cUIControl *Parent, const eeSiz
if ( UseDefaultThemeValues() ) {
TabWidgetParams.TabSeparation = -1;
TabWidgetParams.FontSelectedColor = eeColorA( 255, 255, 255, 255 );
TabWidgetParams.FontSelectedColor = ColorA( 255, 255, 255, 255 );
TabWidgetParams.DrawLineBelowTabs = true;
TabWidgetParams.LineBelowTabsColor = eeColorA( 0, 0, 0, 255 );
TabWidgetParams.LineBelowTabsColor = ColorA( 0, 0, 0, 255 );
TabWidgetParams.LineBewowTabsYOffset = -1;
}
@@ -229,7 +229,7 @@ cUITooltip * cUIDefaultTheme::CreateTooltip( cUIControl * TooltipOf, cUIControl
if ( UseDefaultThemeValues() ) {
TooltipParams.Flags &= ~UI_AUTO_PADDING;
TooltipParams.FontColor = eeColorA( 0, 0, 0, 255 );
TooltipParams.FontColor = ColorA( 0, 0, 0, 255 );
TooltipParams.Padding = eeRecti( 4, 6, 4, 6 );
}

View File

@@ -30,7 +30,7 @@ cUIDropDownList::cUIDropDownList( cUIDropDownList::CreateParams& Params ) :
cUIListBox::CreateParams LBParams;
LBParams.Size = eeSize( mSize.Width(), mMinNumVisibleItems * mSize.Height() );
LBParams.Flags = flags;
LBParams.FontSelectedColor = eeColorA( 255, 255, 255, 255 );
LBParams.FontSelectedColor = ColorA( 255, 255, 255, 255 );
mListBox = eeNew( cUIListBox, ( LBParams ) );
}
}

View File

@@ -108,11 +108,11 @@ cSubTexture * cUIGfx::SubTexture() const {
return mSubTexture;
}
const eeColorA& cUIGfx::Color() const {
const ColorA& cUIGfx::Color() const {
return mColor;
}
void cUIGfx::Color( const eeColorA& color ) {
void cUIGfx::Color( const ColorA& color ) {
mColor = color;
Alpha( color.A() );
}

Some files were not shown because too many files have changed in this diff Show More