Don't make texture coordinates in WindowVertex public at all,

the meaning may possibly change in the future if more than one texture
is used. Instead store original coordinates.


svn path=/trunk/KDE/kdebase/workspace/; revision=689918
This commit is contained in:
Luboš Luňák 2007-07-19 14:35:55 +00:00
parent ac42ba0b4f
commit 4dd8d34c8f
3 changed files with 21 additions and 21 deletions

View file

@ -66,8 +66,8 @@ void WavyWindowsEffect::paintWindow( EffectWindow* w, int mask, QRegion region,
++j )
{
WindowVertex& v = data.quads[ i ][ j ];
v.move( v.x() + sin(mTimeElapsed + v.textureY() / 60 + 0.5f) * 10,
v.y() + sin(mTimeElapsed + v.textureX() / 80) * 10 );
v.move( v.x() + sin(mTimeElapsed + v.originalY() / 60 + 0.5f) * 10,
v.y() + sin(mTimeElapsed + v.originalX() / 80) * 10 );
}
}

View file

@ -452,8 +452,8 @@ void WindowQuadList::makeArrays( float** vertices, float** texcoords ) const
{
*vpos++ = at( i )[ j ].x();
*vpos++ = at( i )[ j ].y();
*tpos++ = at( i )[ j ].textureX();
*tpos++ = at( i )[ j ].textureY();
*tpos++ = at( i )[ j ].tx;
*tpos++ = at( i )[ j ].ty;
}
}

View file

@ -368,13 +368,15 @@ class KWIN_EXPORT WindowVertex
void move( float x, float y );
void setX( float x );
void setY( float y );
float textureX() const;
float textureY() const;
float originalX() const;
float originalY() const;
WindowVertex();
WindowVertex( float x, float y, float tx, float ty );
private:
friend class WindowQuad;
friend class WindowQuadList;
float px, py; // position
float ox, oy; // origional position
float tx, ty; // texture coords
};
@ -507,7 +509,7 @@ WindowVertex::WindowVertex()
inline
WindowVertex::WindowVertex( float _x, float _y, float _tx, float _ty )
: px( _x ), py( _y ), tx( _tx ), ty( _ty )
: px( _x ), py( _y ), ox( _x ), oy( _y ), tx( _tx ), ty( _ty )
{
}
@ -523,6 +525,18 @@ float WindowVertex::y() const
return py;
}
inline
float WindowVertex::originalX() const
{
return ox;
}
inline
float WindowVertex::originalY() const
{
return oy;
}
inline
void WindowVertex::move( float x, float y )
{
@ -542,18 +556,6 @@ void WindowVertex::setY( float y )
py = y;
}
inline
float WindowVertex::textureX() const
{
return tx;
}
inline
float WindowVertex::textureY() const
{
return ty;
}
/***************************************************************
WindowQuad
***************************************************************/
@ -590,8 +592,6 @@ void WindowQuad::checkUntransformed() const
{
assert( verts[ 0 ].py == verts[ 1 ].py && verts[ 2 ].py == verts[ 3 ].py
&& verts[ 0 ].px == verts[ 3 ].px && verts[ 1 ].px == verts[ 2 ].px );
assert( verts[ 0 ].ty == verts[ 1 ].ty && verts[ 2 ].ty == verts[ 3 ].ty
&& verts[ 0 ].tx == verts[ 3 ].tx && verts[ 1 ].tx == verts[ 2 ].tx );
}
inline