Added support for multitexture binding.

Added some functions for tex env managing.
Modified some enum names from renders.
Added a pixel separator for characters in the ttf creation ( optional ).
Moved some OpenGL and GLEW things to cGL, this is for a future implementation with OpenGL ES and without GLEW.
Tryed to fix a bad rendering bug when clipping controls with borders ( borders disappear ), i think that the hack is working.
Modified some name conventions.
This commit is contained in:
spartanj
2010-09-04 05:28:41 -03:00
parent f8703cd568
commit 6432fa9a9b
56 changed files with 992 additions and 510 deletions

View File

@@ -8,7 +8,9 @@ cTextCache::cTextCache() :
mCachedWidth(0.f),
mNumLines(1),
mFontColor(0xFFFFFFFF),
mFontShadowColor(0xFF000000)
mFontShadowColor(0xFF000000),
mCachedCoords(false),
mFlags(0)
{
}
@@ -96,6 +98,8 @@ void cTextCache::Cache() {
mFont->CacheWidth( mText, mLinesWidth, mCachedWidth, mNumLines );
else
mCachedWidth = 0;
mCachedCoords = false;
}
eeFloat cTextCache::GetTextWidth() {
@@ -110,7 +114,7 @@ const std::vector<eeFloat>& cTextCache::LinesWidth() {
return mLinesWidth;
}
void cTextCache::Draw( const eeFloat& X, const eeFloat& Y, const Uint32& Flags, const eeFloat& Scale, const eeFloat& Angle, const EE_RENDERALPHAS& Effect ) {
void cTextCache::Draw( const eeFloat& X, const eeFloat& Y, const Uint32& Flags, const eeFloat& Scale, const eeFloat& Angle, const EE_PRE_BLEND_FUNC& Effect ) {
if ( NULL != mFont ) {
eeColorA FontColor = mFont->Color();
eeColorA FontShadowColor = mFont->ShadowColor();
@@ -118,11 +122,28 @@ void cTextCache::Draw( const eeFloat& X, const eeFloat& Y, const Uint32& Flags,
mFont->Color( mFontColor );
mFont->ShadowColor( mFontShadowColor );
mFont->Draw( *this, X, Y, Flags, Scale, Angle, Effect );
if ( mFlags != Flags ) {
mFlags = Flags;
mCachedCoords = false;
}
glTranslatef( X, Y, 0.f );
mFont->Draw( *this, 0, 0, Flags, Scale, Angle, Effect );
glTranslatef( -X, -Y, 0.f );
mFont->Color( FontColor );
mFont->ShadowColor( FontShadowColor );
}
}
const bool& cTextCache::CachedCoords() const {
return mCachedCoords;
}
void cTextCache::CachedCoords( const bool& cached ) {
mCachedCoords = cached;
}
}}