From 8317780a736fe48a87439cc2594f4177a8f0cbaf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=AD=C2=ADn=20Lucas=20Golini?= Date: Sat, 18 Feb 2017 03:03:01 -0300 Subject: [PATCH] More refactoring of the Graphic module. --HG-- branch : dev --- bin/assets/ee.ini | 2 +- include/eepp/graphics/sprite.hpp | 6 +- include/eepp/graphics/subtexture.hpp | 20 +-- include/eepp/graphics/textcache.hpp | 56 ++++---- include/eepp/graphics/texture.hpp | 36 ++--- include/eepp/graphics/textureatlas.hpp | 4 +- include/eepp/graphics/textureatlasloader.hpp | 4 +- include/eepp/graphics/texturefactory.hpp | 4 +- projects/linux/ee.creator.user | 129 +++++++++++++++++- src/eepp/gaming/gameobjectsprite.cpp | 2 +- src/eepp/gaming/gameobjectsubtexture.cpp | 8 +- src/eepp/gaming/gameobjectsubtextureex.cpp | 6 +- src/eepp/gaming/gameobjectvirtual.cpp | 8 +- src/eepp/gaming/mapeditor/mapeditor.cpp | 4 +- src/eepp/gaming/tilemap.cpp | 2 +- src/eepp/graphics/console.cpp | 2 +- src/eepp/graphics/font.cpp | 50 +++---- src/eepp/graphics/framebufferfbo.cpp | 4 +- src/eepp/graphics/scrollparallax.cpp | 12 +- src/eepp/graphics/sprite.cpp | 113 +++++++-------- src/eepp/graphics/subtexture.cpp | 32 ++--- src/eepp/graphics/textcache.cpp | 50 +++---- src/eepp/graphics/texture.cpp | 48 +++---- src/eepp/graphics/textureatlas.cpp | 4 +- src/eepp/graphics/textureatlasloader.cpp | 16 +-- src/eepp/graphics/texturefactory.cpp | 20 +-- src/eepp/graphics/texturefont.cpp | 2 +- src/eepp/ui/tools/textureatlaseditor.cpp | 22 +-- .../ui/tools/textureatlassubtextureeditor.cpp | 6 +- src/eepp/ui/uicheckbox.cpp | 4 +- src/eepp/ui/uicombobox.cpp | 2 +- src/eepp/ui/uicontrol.cpp | 18 +-- src/eepp/ui/uigfx.cpp | 32 ++--- src/eepp/ui/uiprogressbar.cpp | 4 +- src/eepp/ui/uiradiobutton.cpp | 4 +- src/eepp/ui/uiscrollbar.cpp | 12 +- src/eepp/ui/uiseparator.cpp | 2 +- src/eepp/ui/uiskincomplex.cpp | 32 ++--- src/eepp/ui/uiskinsimple.cpp | 2 +- src/eepp/ui/uislider.cpp | 6 +- src/eepp/ui/uispinbox.cpp | 4 +- src/eepp/ui/uisprite.cpp | 14 +- src/eepp/ui/uitextbox.cpp | 56 ++++---- src/eepp/ui/uitextedit.cpp | 6 +- src/eepp/ui/uitextinput.cpp | 14 +- src/eepp/ui/uitextinputpassword.cpp | 22 +-- src/eepp/ui/uitheme.cpp | 2 +- src/eepp/ui/uitooltip.cpp | 30 ++-- src/eepp/ui/uiwinmenu.cpp | 6 +- src/examples/fonts/fonts.cpp | 6 +- src/test/eetest.cpp | 12 +- 51 files changed, 539 insertions(+), 423 deletions(-) diff --git a/bin/assets/ee.ini b/bin/assets/ee.ini index 4139430ba..689257c72 100755 --- a/bin/assets/ee.ini +++ b/bin/assets/ee.ini @@ -6,7 +6,7 @@ BitColor = 32 Windowed = 1 Resizeable = 1 WinIcon = assets/icon/ee.png -VSync = 0 +VSync = 1 GLVersion = Default Backend = Default JoystickEnabled = 0 diff --git a/include/eepp/graphics/sprite.hpp b/include/eepp/graphics/sprite.hpp index 6ecab1a11..fcb4f40dd 100755 --- a/include/eepp/graphics/sprite.hpp +++ b/include/eepp/graphics/sprite.hpp @@ -338,8 +338,8 @@ class EE_API Sprite { /** Removes the current callback */ void clearCallback(); - /** Creates a copy of the current sprite and return it */ - Sprite * copy(); + /** Creates a copy of the current sprite and returns it */ + Sprite clone(); /** Update the sprite animation */ void update( const Time& ElapsedTime ); @@ -368,7 +368,7 @@ class EE_API Sprite { ColorA mColor; ColorA * mVertexColors; - int mRepeations; //!< Number of repetions of the animation, default -1 that equals to loop. + int mRepetitions; //!< Number of repetions of the animation, default -1 that equals to loop. EE_BLEND_MODE mBlend; EE_RENDER_MODE mEffect; diff --git a/include/eepp/graphics/subtexture.hpp b/include/eepp/graphics/subtexture.hpp index 18682dc08..bad11b87f 100644 --- a/include/eepp/graphics/subtexture.hpp +++ b/include/eepp/graphics/subtexture.hpp @@ -55,30 +55,30 @@ class EE_API SubTexture { void setName( const std::string& name ); /** @return The Texture Id that holds the SubTexture. */ - const Uint32& texture(); + const Uint32& getTextureId(); /** Set the Texture Id that holds the SubTexture. */ - void texture( const Uint32& TexId ); + void setTextureId( const Uint32& TexId ); /** @return The Texture sector that represents the SubTexture */ - const Recti& srcRect() const; + const Recti& getSrcRect() const; /** Sets the Texture sector that represents the SubTexture */ - void srcRect( const Recti& Rect ); + void setSrcRect( const Recti& Rect ); /** @return The Destination Size of the SubTexture. */ - const Sizef& destSize() const; + const Sizef& getDestSize() const; /** Sets the Destination Size of the SubTexture. * The size can be different from the original size of the SubTexture. * For example if the SubTexture width is 32 pixels, by default the destination width is 32 pixels, but it can be changed to anything wanted. */ - void destSize( const Sizef& destSize ); + void setDestSize( const Sizef& destSize ); /** @return The SubTexture default offset. The offset is added to the position passed when is drawed. */ - const Vector2i& offset() const; + const Vector2i& getOffset() const; /** Set the SubTexture offset. */ - void offset( const Vector2i& offset ); + void setOffset( const Vector2i& offset ); void draw( const Float& X, const Float& Y, const ColorA& Color = ColorA(), const Float& Angle = 0.f, const Vector2f& Scale = Vector2f::One, const EE_BLEND_MODE& Blend = ALPHA_NORMAL, const EE_RENDER_MODE& Effect = RN_NORMAL, OriginPoint Center = OriginPoint(OriginPoint::OriginCenter) ); @@ -129,10 +129,10 @@ class EE_API SubTexture { bool unlock( const bool& KeepData = false, const bool& Modified = false ); /** @return The SubTexture size in the texture. This is the source rect size. */ - Sizei realSize(); + Sizei getRealSize(); /** @return This is the same as Destination Size but with the values rounded as integers. */ - Sizei size(); + Sizei getSize(); /** @return A pixel pointer to the texture loaded in memory ( downloaded from VRAM doing Lock()/Unlock() ). */ const Uint8* getPixelsPtr(); diff --git a/include/eepp/graphics/textcache.hpp b/include/eepp/graphics/textcache.hpp index a30b1d98f..5a3e90538 100644 --- a/include/eepp/graphics/textcache.hpp +++ b/include/eepp/graphics/textcache.hpp @@ -22,16 +22,16 @@ class EE_API TextCache { void create( Graphics::Font * 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 */ - Graphics::Font * font() const; + Graphics::Font * getFont() const; /** Change the font used for the text cache */ - void font( Graphics::Font * font ); + void setFont( Graphics::Font * font ); /** @return The text cached */ - String& text(); + String& getText(); /** Set the text to be cached */ - void text( const String& text ); + void setText( const String& text ); /** @return The cached text width */ Float getTextWidth(); @@ -40,72 +40,72 @@ class EE_API TextCache { Float getTextHeight(); /** @return Every cached text line width */ - const std::vector& linesWidth(); + const std::vector& getLinesWidth(); /** @return The vertex coordinates cached */ - std::vector& vertextCoords(); + std::vector& getVertextCoords(); /** @return The text colors cached */ - std::vector& colors(); + std::vector& getColors(); /** Draw the cached text on screen */ void draw( const Float& X, const Float& Y, const Vector2f& Scale = Vector2f::One, const Float& Angle = 0, EE_BLEND_MODE Effect = ALPHA_NORMAL ); /** @return The Font Color */ - const ColorA& color() const; + const ColorA& getColor() const; /** Set the color of the string rendered */ - void color(const ColorA& color); + void setColor(const ColorA& color); /** @see Set the alpha of each individual character. ** This doesn't break any custom color per-character setted. */ - void alpha( const Uint8& alpha ); + void setAlpha( const Uint8& alpha ); /** Set the color of the substring * @param color The color * @param from The first char to change the color * @param to The last char to change the color */ - void color(const ColorA& color, Uint32 from, Uint32 to ); + void setColor(const ColorA& color, Uint32 from, Uint32 to ); /** @return The Shadow Font Color */ - const ColorA& shadowColor() const; + const ColorA& getShadowColor() const; /** Set the shadow color of the string rendered */ - void shadowColor(const ColorA& color); + void setShadowColor(const ColorA& color); /** @return The number of lines that the cached text contains */ const int& getNumLines() const; /** Set the font draw flags */ - void flags( const Uint32& flags ); + void setFlags( const Uint32& flags ); /** @return The font draw flags */ - const Uint32& flags() const; + const Uint32& getFlags() const; /** Force to cache the width of the current text */ - void cache(); + void cacheWidth(); protected: friend class Font; - String mText; - Graphics::Font * mFont; + String mText; + Graphics::Font * mFont; - Float mCachedWidth; - int mNumLines; - int mLargestLineCharCount; + Float mCachedWidth; + int mNumLines; + int mLargestLineCharCount; - ColorA mFontColor; - ColorA mFontShadowColor; + ColorA mFontColor; + ColorA mFontShadowColor; - Uint32 mFlags; - Uint32 mVertexNumCached; + Uint32 mFlags; + Uint32 mVertexNumCached; - bool mCachedCoords; + bool mCachedCoords; - std::vector mLinesWidth; + std::vector mLinesWidth; std::vector mRenderCoords; - std::vector mColors; + std::vector mColors; void updateCoords(); diff --git a/include/eepp/graphics/texture.hpp b/include/eepp/graphics/texture.hpp index 0bff10cf9..77ea20162 100755 --- a/include/eepp/graphics/texture.hpp +++ b/include/eepp/graphics/texture.hpp @@ -12,37 +12,37 @@ namespace EE { namespace Graphics { class EE_API Texture : public Image, private NonCopyable { public: /** Set the OpenGL Texture Id (texture handle) */ - void handle( const int& texture ) { mTexture = texture; } + void setHandle( const int& texture ) { mTexture = texture; } /** @return The OpenGL Texture Id (texture handle) */ - int handle() const { return mTexture; } + int getHandle() const { return mTexture; } /** @return The hash of the filename */ - const Uint32& hashName() const; + const Uint32& getHashName() const; /** Set the Texture File Path */ - void filepath( const std::string& filepath ) { mFilepath = filepath; } + void setFilepath( const std::string& filepath ) { mFilepath = filepath; } /** @return The Texture File Path */ - std::string filepath() const { return mFilepath; } + std::string getFilepath() const { return mFilepath; } /** @return The Image Width */ - unsigned int imgWidth() const { return mImgWidth; } + unsigned int getImageWidth() const { return mImgWidth; } /** @return The Image Height */ - unsigned int imgHeight() const { return mImgHeight; } + unsigned int getImageHeight() const { return mImgHeight; } /** Set if the Texture use Mipmaps */ - void mipmap( const bool& UseMipmap ); + void setMipmap( const bool& UseMipmap ); /** @return If the texture use Mipmaps */ - bool mipmap() const; + bool getMipmap() const; /** Set the Texture Clamp Mode */ - void clampMode( const EE_CLAMP_MODE& clampmode ); + void setClampMode( const EE_CLAMP_MODE& clampmode ); /** @return The Texture Clamp Mode */ - EE_CLAMP_MODE clampMode() const { return mClampMode; } + EE_CLAMP_MODE getClampMode() const { return mClampMode; } /** Lock the Texture for direct access. ** It is needed to have any read/write access to the texture. This feature is not supported in OpenGL ES. */ @@ -59,10 +59,10 @@ class EE_API Texture : public Image, private NonCopyable { const Uint8* getPixelsPtr(); /** Set the Texture Filter Mode */ - void filter( const EE_TEX_FILTER& filter ); + void setFilter( const EE_TEX_FILTER& filter ); /** @return The texture filter used by the texture */ - const EE_TEX_FILTER& filter() const; + const EE_TEX_FILTER& getFilter() const; /** Save the Texture to a new File */ bool saveToFile( const std::string& filepath, const EE_SAVE_TYPE& Format ); @@ -128,16 +128,16 @@ class EE_API Texture : public Image, private NonCopyable { void flip(); /** @return If the Texture has a copy on the local memory */ - bool localCopy(); + bool hasLocalCopy(); /** Unload the Texture from Memory */ void deleteTexture(); /** Set if the Texture is Grabed */ - void grabed( const bool& isGrabed ); + void setGrabed( const bool& isGrabed ); /** @return If the texture is Grabed */ - bool grabed() const; + bool isGrabed() const; /** @return If the texture was compressed on load (DXT compression) */ bool isCompressed() const; @@ -252,8 +252,8 @@ class EE_API Texture : public Image, private NonCopyable { Uint32 mTexId; int mTexture; - unsigned int mImgWidth; - unsigned int mImgHeight; + unsigned int mImgWidth; + unsigned int mImgHeight; Uint32 mFlags; diff --git a/include/eepp/graphics/textureatlas.hpp b/include/eepp/graphics/textureatlas.hpp index 0076fb06a..6be09fbf1 100644 --- a/include/eepp/graphics/textureatlas.hpp +++ b/include/eepp/graphics/textureatlas.hpp @@ -56,10 +56,10 @@ class EE_API TextureAtlas : public ResourceManager { void setName( const std::string& name ); /** @return The texture atlas path. */ - const std::string& path() const; + const std::string& getPath() const; /** Sets the texture atlas path. */ - void path( const std::string& path ); + void setPath( const std::string& path ); /** @return The texture atlas Id. The Id is the String::Hash of the texture atlas name. */ const Uint32& getId() const; diff --git a/include/eepp/graphics/textureatlasloader.hpp b/include/eepp/graphics/textureatlasloader.hpp index e6d9d924e..7ab17ab5c 100644 --- a/include/eepp/graphics/textureatlasloader.hpp +++ b/include/eepp/graphics/textureatlasloader.hpp @@ -90,10 +90,10 @@ class EE_API TextureAtlasLoader { void loadFromPack( Pack * Pack, const std::string& FilePackPath ); /** @return If the loader is threaded ( asynchronous ). */ - bool threaded() const; + bool isThreaded() const; /** If threaded is true sets the loader as asynchronous. This must be called before the loading is done. */ - void threaded( const bool& threaded ); + void setThreaded( const bool& threaded ); /** @return True if the texture atlas is loaded. */ const bool& isLoaded() const; diff --git a/include/eepp/graphics/texturefactory.hpp b/include/eepp/graphics/texturefactory.hpp index f176ff3ac..4cc70a608 100755 --- a/include/eepp/graphics/texturefactory.hpp +++ b/include/eepp/graphics/texturefactory.hpp @@ -145,7 +145,7 @@ class EE_API TextureFactory : protected Mutex { bool saveImage( const std::string& filepath, const EE_SAVE_TYPE& Format, const unsigned int& Width, const unsigned int& Height, const unsigned int& Channels, const unsigned char* data ); /** Determine if the TextureId passed exists */ - bool textureIdExists( const Uint32& TexId ); + bool existsId( const Uint32& TexId ); /** @return A pointer to the Texture */ Texture* getTexture( const Uint32& TexId ); @@ -160,7 +160,7 @@ class EE_API TextureFactory : protected Mutex { void allocate( const unsigned int& size ); /** @return The memory used by the textures (in bytes) */ - unsigned int memorySize() { return mMemSize; } + unsigned int getTextureMemorySize() { return mMemSize; } /** It's possible to create textures outside the texture factory loader, but the library will need to know of this texture, so it's necessary to push the texture to the factory. * @param Filepath The Texture path ( if exists ) diff --git a/projects/linux/ee.creator.user b/projects/linux/ee.creator.user index 6cf9616ac..a7f85997d 100644 --- a/projects/linux/ee.creator.user +++ b/projects/linux/ee.creator.user @@ -1,10 +1,10 @@ - + EnvironmentId - {d43f4693-30c1-436c-b1d1-498aab2c2f8c} + {b6114084-39c2-4cd0-b9e2-d8803dc6b446} ProjectExplorer.Project.ActiveTarget @@ -63,7 +63,7 @@ Desktop Desktop - {6d057187-158a-4883-8d5b-d470a6b6b025} + {388e5431-b31b-42b3-b9ad-9002d279d75d} 10 0 0 @@ -957,12 +957,12 @@ 0 Deploy - + Deploy ProjectExplorer.BuildSteps.Deploy 1 - Deploy locally - + No deployment + No deployment ProjectExplorer.DefaultDeployConfiguration 1 @@ -1698,9 +1698,124 @@ 13 + + ProjectExplorer.Project.Target.1 + + Android ARM + Android ARM + {c56c34f8-2eb8-43f6-b2b6-c1a99b989f1a} + 0 + -1 + 0 + + /home/programming/eepp/projects/linux + + + + all + + false + + + true + Make + + GenericProjectManager.GenericMakeStep + + 1 + Build + + ProjectExplorer.BuildSteps.Build + + + + + clean + + true + + + true + Make + + GenericProjectManager.GenericMakeStep + + 1 + Clean + + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Default + Default + GenericProjectManager.GenericBuildConfiguration + + 1 + 0 + + + false + false + 1000 + + true + + false + false + false + false + true + 0.01 + 10 + true + 1 + 25 + + 1 + true + false + true + valgrind + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + + -1 + + + + %{buildDir} + Custom Executable + + ProjectExplorer.CustomExecutableRunConfiguration + 3768 + false + true + false + false + true + + 1 + + ProjectExplorer.Project.TargetCount - 1 + 2 ProjectExplorer.Project.Updater.FileVersion diff --git a/src/eepp/gaming/gameobjectsprite.cpp b/src/eepp/gaming/gameobjectsprite.cpp index 77ef71d27..01133ef52 100644 --- a/src/eepp/gaming/gameobjectsprite.cpp +++ b/src/eepp/gaming/gameobjectsprite.cpp @@ -92,7 +92,7 @@ void GameObjectSprite::TilePos( Vector2i pos ) { Sizei GameObjectSprite::Size() { if ( NULL != mSprite ) - return mSprite->getSubTexture(0)->realSize(); + return mSprite->getSubTexture(0)->getRealSize(); return Sizei(); } diff --git a/src/eepp/gaming/gameobjectsubtexture.cpp b/src/eepp/gaming/gameobjectsubtexture.cpp index e07e4a297..d2c1906a0 100644 --- a/src/eepp/gaming/gameobjectsubtexture.cpp +++ b/src/eepp/gaming/gameobjectsubtexture.cpp @@ -57,9 +57,9 @@ void GameObjectSubTexture::Draw() { GetAngle(), Vector2f::One, LM->GetColorFromPos( Vector2f( mPos.x, mPos.y ) ), - LM->GetColorFromPos( Vector2f( mPos.x, mPos.y + mSubTexture->destSize().y ) ), - LM->GetColorFromPos( Vector2f( mPos.x + mSubTexture->destSize().x, mPos.y + mSubTexture->destSize().y ) ), - LM->GetColorFromPos( Vector2f( mPos.x + mSubTexture->destSize().y, mPos.y ) ), + LM->GetColorFromPos( Vector2f( mPos.x, mPos.y + mSubTexture->getDestSize().y ) ), + LM->GetColorFromPos( Vector2f( mPos.x + mSubTexture->getDestSize().x, mPos.y + mSubTexture->getDestSize().y ) ), + LM->GetColorFromPos( Vector2f( mPos.x + mSubTexture->getDestSize().y, mPos.y ) ), ALPHA_NORMAL, RenderModeFromFlags() ); @@ -92,7 +92,7 @@ void GameObjectSubTexture::TilePos( Vector2i pos ) { Sizei GameObjectSubTexture::Size() { if ( NULL != mSubTexture ) - return mSubTexture->realSize(); + return mSubTexture->getRealSize(); return Sizei(); } diff --git a/src/eepp/gaming/gameobjectsubtextureex.cpp b/src/eepp/gaming/gameobjectsubtextureex.cpp index 18b5d6e79..4918e3752 100644 --- a/src/eepp/gaming/gameobjectsubtextureex.cpp +++ b/src/eepp/gaming/gameobjectsubtextureex.cpp @@ -63,9 +63,9 @@ void GameObjectSubTextureEx::Draw() { mAngle, mScale, LM->GetColorFromPos( Vector2f( mPos.x, mPos.y ) ), - LM->GetColorFromPos( Vector2f( mPos.x, mPos.y + mSubTexture->destSize().y ) ), - LM->GetColorFromPos( Vector2f( mPos.x + mSubTexture->destSize().x, mPos.y + mSubTexture->destSize().y ) ), - LM->GetColorFromPos( Vector2f( mPos.x + mSubTexture->destSize().x, mPos.y ) ), + LM->GetColorFromPos( Vector2f( mPos.x, mPos.y + mSubTexture->getDestSize().y ) ), + LM->GetColorFromPos( Vector2f( mPos.x + mSubTexture->getDestSize().x, mPos.y + mSubTexture->getDestSize().y ) ), + LM->GetColorFromPos( Vector2f( mPos.x + mSubTexture->getDestSize().x, mPos.y ) ), mBlend, mRender ); diff --git a/src/eepp/gaming/gameobjectvirtual.cpp b/src/eepp/gaming/gameobjectvirtual.cpp index c08ff680e..faa2d176e 100644 --- a/src/eepp/gaming/gameobjectvirtual.cpp +++ b/src/eepp/gaming/gameobjectvirtual.cpp @@ -47,7 +47,7 @@ Uint32 GameObjectVirtual::RealType() const { Sizei GameObjectVirtual::Size() { if ( NULL != mSubTexture ) - return mSubTexture->realSize(); + return mSubTexture->getRealSize(); if ( NULL != mLayer ) return mLayer->Map()->TileSize(); @@ -87,9 +87,9 @@ void GameObjectVirtual::Draw() { GetAngle(), Vector2f::One, LM->GetColorFromPos( Vector2f( mPos.x, mPos.y ) ), - LM->GetColorFromPos( Vector2f( mPos.x, mPos.y + mSubTexture->destSize().y ) ), - LM->GetColorFromPos( Vector2f( mPos.x + mSubTexture->destSize().x, mPos.y + mSubTexture->destSize().y ) ), - LM->GetColorFromPos( Vector2f( mPos.x + mSubTexture->destSize().x, mPos.y ) ), + LM->GetColorFromPos( Vector2f( mPos.x, mPos.y + mSubTexture->getDestSize().y ) ), + LM->GetColorFromPos( Vector2f( mPos.x + mSubTexture->getDestSize().x, mPos.y + mSubTexture->getDestSize().y ) ), + LM->GetColorFromPos( Vector2f( mPos.x + mSubTexture->getDestSize().x, mPos.y ) ), ALPHA_NORMAL, RenderModeFromFlags() ); diff --git a/src/eepp/gaming/mapeditor/mapeditor.cpp b/src/eepp/gaming/mapeditor/mapeditor.cpp index 044874c6e..25c25a9ec 100644 --- a/src/eepp/gaming/mapeditor/mapeditor.cpp +++ b/src/eepp/gaming/mapeditor/mapeditor.cpp @@ -447,7 +447,7 @@ void MapEditor::CreateUIMap() { SubTexture * tTex = HScrollSkin->getSubTexture( UISkinState::StateNormal ); if ( NULL != tTex ) { - ScrollH = tTex->size().getHeight(); + ScrollH = tTex->getSize().getHeight(); } } @@ -455,7 +455,7 @@ void MapEditor::CreateUIMap() { SubTexture * tTex = VScrollSkin->getSubTexture( UISkinState::StateNormal ); if ( NULL != tTex ) { - ScrollV = tTex->size().getHeight(); + ScrollV = tTex->getSize().getHeight(); } } diff --git a/src/eepp/gaming/tilemap.cpp b/src/eepp/gaming/tilemap.cpp index 82f742645..cde04dbed 100644 --- a/src/eepp/gaming/tilemap.cpp +++ b/src/eepp/gaming/tilemap.cpp @@ -1383,7 +1383,7 @@ std::vector TileMap::GetTextureAtlases() { for ( std::list::iterator it = Res.begin(); it != Res.end(); it++ ) { if ( (*it)->getId() != Restricted1 && (*it)->getId() != Restricted2 ) - items.push_back( (*it)->path() ); + items.push_back( (*it)->getPath() ); } return items; diff --git a/src/eepp/graphics/console.cpp b/src/eepp/graphics/console.cpp index 26c3a432b..78a7ccbc9 100755 --- a/src/eepp/graphics/console.cpp +++ b/src/eepp/graphics/console.cpp @@ -716,7 +716,7 @@ void Console::cmdQuit ( const std::vector < String >& params ) { } void Console::cmdGetTextureMemory ( const std::vector < String >& params ) { - privPushText( "Total texture memory used: " + FileSystem::sizeToString( TextureFactory::instance()->memorySize() ) ); + privPushText( "Total texture memory used: " + FileSystem::sizeToString( TextureFactory::instance()->getTextureMemorySize() ) ); } void Console::cmdCmdList ( const std::vector < String >& params ) { diff --git a/src/eepp/graphics/font.cpp b/src/eepp/graphics/font.cpp index d4ac8e0e9..6b061e326 100644 --- a/src/eepp/graphics/font.cpp +++ b/src/eepp/graphics/font.cpp @@ -29,23 +29,23 @@ Font::~Font() { } void Font::setText( const String& Text ) { - mTextCache.text( Text ); + mTextCache.setText( Text ); } const ColorA& Font::getColor() const { - return mTextCache.color(); + return mTextCache.getColor(); } void Font::setColor(const ColorA& color) { - mTextCache.color( color ); + mTextCache.setColor( color ); } const ColorA& Font::getShadowColor() const { - return mTextCache.shadowColor(); + return mTextCache.getShadowColor(); } void Font::setShadowColor(const ColorA& color) { - mTextCache.shadowColor( color ); + mTextCache.setShadowColor( color ); } int Font::getNumLines() { @@ -82,7 +82,7 @@ Int32 Font::getFontDescent() const { } String Font::getText() { - return mTextCache.text(); + return mTextCache.getText(); } Float Font::getTextHeight() { @@ -90,7 +90,7 @@ Float Font::getTextHeight() { } const std::vector& Font::getLinesWidth() { - return mTextCache.linesWidth(); + return mTextCache.getLinesWidth(); } void Font::draw( const Float& X, const Float& Y, const Uint32& Flags, const Vector2f& Scale, const Float& Angle, const EE_BLEND_MODE& Effect) { @@ -98,13 +98,13 @@ void Font::draw( const Float& X, const Float& Y, const Uint32& Flags, const Vect } void Font::draw( const String& Text, const Float& X, const Float& Y, const Uint32& Flags, const Vector2f& Scale, const Float& Angle, const EE_BLEND_MODE& Effect ) { - mTextCache.text( Text ); - mTextCache.flags( Flags ); + mTextCache.setText( Text ); + mTextCache.setFlags( Flags ); mTextCache.draw( X, Y, Scale, Angle, Effect ); } void Font::draw( TextCache& TextCache, const Float& X, const Float& Y, const Uint32& Flags, const Vector2f& Scale, const Float& Angle, const EE_BLEND_MODE& Effect ) { - if ( !TextCache.text().size() ) + if ( !TextCache.getText().size() ) return; GlobalBatchRenderer::instance()->draw(); @@ -116,23 +116,23 @@ void Font::draw( TextCache& TextCache, const Float& X, const Float& Y, const Uin f &= ~FONT_DRAW_SHADOW; - ColorA Col = TextCache.color(); + ColorA Col = TextCache.getColor(); - setText( TextCache.text() ); + setText( TextCache.getText() ); if ( Col.a() != 255 ) { - ColorA ShadowColor = TextCache.shadowColor(); + ColorA ShadowColor = TextCache.getShadowColor(); ShadowColor.Alpha = (Uint8)( (Float)ShadowColor.Alpha * ( (Float)Col.a() / (Float)255 ) ); setColor( ShadowColor ); } else { - setColor( TextCache.shadowColor() ); + setColor( TextCache.getShadowColor() ); } draw( X + 1, Y + 1, f, Scale, Angle, Effect ); - mTextCache.flags( Flags ); + mTextCache.setFlags( Flags ); setColor( Col ); } @@ -155,18 +155,18 @@ void Font::draw( TextCache& TextCache, const Float& X, const Float& Y, const Uin GLi->translatef( -Center.x + X, -Center.y + Y, 0.f ); } - std::vector& RenderCoords = TextCache.vertextCoords(); - std::vector& Colors = TextCache.colors(); + std::vector& RenderCoords = TextCache.getVertextCoords(); + std::vector& Colors = TextCache.getColors(); if ( !TextCache.cachedCoords() ) { if ( !( Flags & FONT_DRAW_VERTICAL ) ) { switch ( FontHAlignGet( Flags ) ) { case FONT_DRAW_CENTER: - nX = (Float)( (Int32)( ( TextCache.getTextWidth() - TextCache.linesWidth()[ Line ] ) * 0.5f ) ); + nX = (Float)( (Int32)( ( TextCache.getTextWidth() - TextCache.getLinesWidth()[ Line ] ) * 0.5f ) ); Line++; break; case FONT_DRAW_RIGHT: - nX = TextCache.getTextWidth() - TextCache.linesWidth()[ Line ]; + nX = TextCache.getTextWidth() - TextCache.getLinesWidth()[ Line ]; Line++; break; } @@ -174,8 +174,8 @@ void Font::draw( TextCache& TextCache, const Float& X, const Float& Y, const Uin Int32 tGlyphSize = (Int32)mGlyphs.size(); - for ( unsigned int i = 0; i < TextCache.text().size(); i++ ) { - Char = static_cast( TextCache.text().at(i) ); + for ( unsigned int i = 0; i < TextCache.getText().size(); i++ ) { + Char = static_cast( TextCache.getText().at(i) ); if ( Char < 0 && Char > -128 ) Char = 256 + Char; @@ -206,13 +206,13 @@ void Font::draw( TextCache& TextCache, const Float& X, const Float& Y, const Uin nX += (getFontHeight() * Scale.y); nY = 0; } else { - if ( i + 1 < TextCache.text().size() ) { + if ( i + 1 < TextCache.getText().size() ) { switch ( FontHAlignGet( Flags ) ) { case FONT_DRAW_CENTER: - nX = (Float)( (Int32)( ( TextCache.getTextWidth() - TextCache.linesWidth()[ Line ] ) * 0.5f ) ); + nX = (Float)( (Int32)( ( TextCache.getTextWidth() - TextCache.getLinesWidth()[ Line ] ) * 0.5f ) ); break; case FONT_DRAW_RIGHT: - nX = TextCache.getTextWidth() - TextCache.linesWidth()[ Line ]; + nX = TextCache.getTextWidth() - TextCache.getLinesWidth()[ Line ]; break; default: nX = 0; @@ -477,7 +477,7 @@ void Font::selectSubStringFromCursor( const String& Text, const Int32& CurPos, I } void Font::cacheWidth() { - mTextCache.cache(); + mTextCache.cacheWidth(); } void Font::shrinkText( std::string& Str, const Uint32& MaxWidth ) { diff --git a/src/eepp/graphics/framebufferfbo.cpp b/src/eepp/graphics/framebufferfbo.cpp index c6ef1269f..af8e826fb 100644 --- a/src/eepp/graphics/framebufferfbo.cpp +++ b/src/eepp/graphics/framebufferfbo.cpp @@ -97,14 +97,14 @@ bool FrameBufferFBO::create( const Uint32& Width, const Uint32& Height, bool Dep if ( NULL == mTexture ) { Uint32 TexId = TextureFactory::instance()->createEmptyTexture( Width, Height, 4, ColorA(0,0,0,0) ); - if ( TextureFactory::instance()->textureIdExists( TexId ) ) { + if ( TextureFactory::instance()->existsId( TexId ) ) { mTexture = TextureFactory::instance()->getTexture( TexId ); } else { return false; } } - glFramebufferTexture2DEXT( GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, mTexture->handle(), 0 ); + glFramebufferTexture2DEXT( GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, mTexture->getHandle(), 0 ); if ( glCheckFramebufferStatusEXT( GL_FRAMEBUFFER ) != GL_FRAMEBUFFER_COMPLETE ) { glBindFramebufferEXT( GL_FRAMEBUFFER, mLastFB ); diff --git a/src/eepp/graphics/scrollparallax.cpp b/src/eepp/graphics/scrollparallax.cpp index 5119aee13..403765eb7 100755 --- a/src/eepp/graphics/scrollparallax.cpp +++ b/src/eepp/graphics/scrollparallax.cpp @@ -28,11 +28,11 @@ void ScrollParallax::setSubTexture( Graphics::SubTexture * subTexture ) { void ScrollParallax::setSubTexture() { if ( NULL != mSubTexture ) { - mRect = mSubTexture->srcRect(); - mRealSize = Vector2f( (Float)mSubTexture->realSize().getWidth(), (Float)mSubTexture->realSize().getHeight() ); + mRect = mSubTexture->getSrcRect(); + mRealSize = Vector2f( (Float)mSubTexture->getRealSize().getWidth(), (Float)mSubTexture->getRealSize().getHeight() ); - mTiles.x = ( (Int32)mSize.getWidth() / mSubTexture->realSize().getWidth() ) + 1; - mTiles.y = ( (Int32)mSize.getHeight() / mSubTexture->realSize().getHeight() ) + 1; + mTiles.x = ( (Int32)mSize.getWidth() / mSubTexture->getRealSize().getWidth() ) + 1; + mTiles.y = ( (Int32)mSize.getHeight() / mSubTexture->getRealSize().getHeight() ) + 1; } } @@ -125,7 +125,7 @@ void ScrollParallax::draw() { Rect.Bottom -= (Int32)( ( Pos.y + mRealSize.getHeight() ) - mAABB.Bottom ); } - mSubTexture->srcRect( Rect ); + mSubTexture->setSrcRect( Rect ); mSubTexture->resetDestSize(); if ( !( Rect.Right == 0 || Rect.Bottom == 0 ) ) @@ -143,7 +143,7 @@ void ScrollParallax::draw() { Pos.y += mRealSize.getHeight(); } - mSubTexture->srcRect( mRect ); + mSubTexture->setSrcRect( mRect ); mSubTexture->resetDestSize(); } } diff --git a/src/eepp/graphics/sprite.cpp b/src/eepp/graphics/sprite.cpp index 28aad3ada..e71e7ed73 100755 --- a/src/eepp/graphics/sprite.cpp +++ b/src/eepp/graphics/sprite.cpp @@ -18,7 +18,7 @@ Sprite::Sprite() : mAnimSpeed( 16.f ), mColor( 255,255,255,255 ), mVertexColors( NULL ), - mRepeations( -1 ), + mRepetitions( -1 ), mBlend( ALPHA_NORMAL ), mEffect( RN_NORMAL ), mCurrentFrame( 0 ), @@ -39,7 +39,7 @@ Sprite::Sprite( const std::string& name, const std::string& extension, TextureAt mAnimSpeed( 16.f ), mColor( 255,255,255,255 ), mVertexColors( NULL ), - mRepeations( -1 ), + mRepetitions( -1 ), mBlend( ALPHA_NORMAL ), mEffect( RN_NORMAL ), mCurrentFrame( 0 ), @@ -61,7 +61,7 @@ Sprite::Sprite( SubTexture * SubTexture ) : mAnimSpeed( 16.f ), mColor( 255,255,255,255 ), mVertexColors( NULL ), - mRepeations( -1 ), + mRepetitions( -1 ), mBlend( ALPHA_NORMAL ), mEffect( RN_NORMAL ), mCurrentFrame( 0 ), @@ -83,7 +83,7 @@ Sprite::Sprite( const Uint32& TexId, const Sizef &DestSize, const Vector2i &Offs mAnimSpeed( 16.f ), mColor( 255,255,255,255 ), mVertexColors( NULL ), - mRepeations( -1 ), + mRepetitions( -1 ), mBlend( ALPHA_NORMAL ), mEffect( RN_NORMAL ), mCurrentFrame( 0 ), @@ -109,7 +109,7 @@ Sprite& Sprite::operator =( const Sprite& Other ) { mScale = Other.mScale; mAnimSpeed = Other.mAnimSpeed; mColor = Other.mColor; - mRepeations = Other.mRepeations; + mRepetitions = Other.mRepetitions; mBlend = Other.mBlend; mEffect = Other.mEffect; mCurrentFrame = Other.mCurrentFrame; @@ -132,34 +132,35 @@ Sprite& Sprite::operator =( const Sprite& Other ) { return *this; } -Sprite * Sprite::copy() { - Sprite * Spr = eeNew( Sprite, () ); +Sprite Sprite::clone() { + Sprite Spr; - Spr->mFrames = mFrames; - Spr->mFlags = mFlags; - Spr->mPos = mPos; - Spr->mRotation = mRotation; - Spr->mScale = mScale; - Spr->mAnimSpeed = mAnimSpeed; - Spr->mColor = mColor; - Spr->mRepeations = mRepeations; - Spr->mBlend = mBlend; - Spr->mEffect = mEffect; - Spr->mCurrentFrame = mCurrentFrame; - Spr->mfCurrentFrame = mfCurrentFrame; - Spr->mCurrentSubFrame = mCurrentSubFrame; - Spr->mSubFrames = mSubFrames; - Spr->mAnimTo = mAnimTo; - Spr->mCb = mCb; + Spr.mFrames = mFrames; + Spr.mFlags = mFlags; + Spr.mPos = mPos; + Spr.mRotation = mRotation; + Spr.mScale = mScale; + Spr.mAnimSpeed = mAnimSpeed; + Spr.mColor = mColor; + Spr.mRepetitions = mRepetitions; + Spr.mBlend = mBlend; + Spr.mEffect = mEffect; + Spr.mCurrentFrame = mCurrentFrame; + Spr.mfCurrentFrame = mfCurrentFrame; + Spr.mCurrentSubFrame = mCurrentSubFrame; + Spr.mSubFrames = mSubFrames; + Spr.mAnimTo = mAnimTo; + Spr.mCb = mCb; + Spr.mUserData = mUserData; if ( NULL != mVertexColors ) { - Spr->mVertexColors = eeNewArray( ColorA, 4 ); - Spr->mVertexColors[0] = mVertexColors[0]; - Spr->mVertexColors[1] = mVertexColors[1]; - Spr->mVertexColors[2] = mVertexColors[2]; - Spr->mVertexColors[3] = mVertexColors[3]; + Spr.mVertexColors = eeNewArray( ColorA, 4 ); + Spr.mVertexColors[0] = mVertexColors[0]; + Spr.mVertexColors[1] = mVertexColors[1]; + Spr.mVertexColors[2] = mVertexColors[2]; + Spr.mVertexColors[3] = mVertexColors[3]; } else { - Spr->mVertexColors = NULL; + Spr.mVertexColors = NULL; } return Spr; @@ -179,7 +180,7 @@ void Sprite::reset() { mAnimSpeed = 16.f; mScale = Vector2f::One; - mRepeations = -1; + mRepetitions = -1; mRotation = 0; mColor = ColorA(255, 255, 255, 255); @@ -225,8 +226,8 @@ Quad2f Sprite::getQuad() { if ( mFrames.size() && ( S = getCurrentSubTexture() ) ) { Rectf TmpR( mPos.x, mPos.y, - mPos.x + S->destSize().x, - mPos.y + S->destSize().y + mPos.x + S->getDestSize().x, + mPos.y + S->getDestSize().y ); Quad2f Q = Quad2f( Vector2f( TmpR.Left, TmpR.Top ), @@ -284,7 +285,7 @@ eeAABB Sprite::getAABB() { if ( mRotation != 0 || mEffect >= 4 ) { return getQuad().toAABB(); } else { // The method used if mAngle != 0 works for mAngle = 0, but i prefer to use the faster way - TmpR = Rectf( mPos.x, mPos.y, mPos.x + S->destSize().x, mPos.y + S->destSize().y ); + TmpR = Rectf( mPos.x, mPos.y, mPos.x + S->getDestSize().x, mPos.y + S->getDestSize().y ); Vector2f Center; @@ -344,7 +345,7 @@ bool Sprite::createStatic( SubTexture * SubTexture ) { } bool Sprite::createStatic( const Uint32& TexId, const Sizef& DestSize, const Vector2i& Offset, const Recti& TexSector ) { - if ( TextureFactory::instance()->textureIdExists( TexId ) ) { + if ( TextureFactory::instance()->existsId( TexId ) ) { reset(); addFrame( TexId, DestSize, Offset, TexSector ); @@ -449,31 +450,31 @@ unsigned int Sprite::addFrame( const Uint32& TexId, const Sizef& DestSize, const } bool Sprite::addSubFrame(const Uint32& TexId, const unsigned int& NumFrame, const unsigned int& NumSubFrame, const Sizef& DestSize, const Vector2i& Offset, const Recti& TexSector) { - if ( !TextureFactory::instance()->textureIdExists( TexId ) ) + if ( !TextureFactory::instance()->existsId( TexId ) ) return false; Texture * Tex = TextureFactory::instance()->getTexture( TexId ); SubTexture * S = GlobalTextureAtlas::instance()->add( eeNew( SubTexture, () ) ); - S->texture( TexId ); + S->setTextureId( TexId ); if ( TexSector.Right > 0 && TexSector.Bottom > 0 ) - S->srcRect( TexSector ); + S->setSrcRect( TexSector ); else - S->srcRect( Recti( 0, 0, (Int32)Tex->imgWidth(), (Int32)Tex->imgHeight() ) ); + S->setSrcRect( Recti( 0, 0, (Int32)Tex->getImageWidth(), (Int32)Tex->getImageHeight() ) ); Sizef destSize( DestSize ); if ( destSize.x <= 0 ) { - destSize.x = static_cast ( S->srcRect().Right - S->srcRect().Left ); + destSize.x = static_cast ( S->getSrcRect().Right - S->getSrcRect().Left ); } if ( destSize.y <= 0 ) { - destSize.y = static_cast ( S->srcRect().Bottom - S->srcRect().Top ); + destSize.y = static_cast ( S->getSrcRect().Bottom - S->getSrcRect().Top ); } - S->destSize( destSize ); - S->offset( Offset ); + S->setDestSize( destSize ); + S->setOffset( Offset ); addSubFrame( S, NumFrame, NumSubFrame ); @@ -488,7 +489,7 @@ void Sprite::update( const Time& ElapsedTime ) { if ( mFrames.size() > 1 && !SPR_FGET( SPRITE_FLAG_ANIM_PAUSED ) && Time::Zero != ElapsedTime ) { unsigned int Size = (unsigned int)mFrames.size() - 1; - if ( mRepeations == 0 ) + if ( mRepetitions == 0 ) return; if ( !SPR_FGET( SPRITE_FLAG_REVERSE_ANIM ) ) @@ -511,36 +512,36 @@ void Sprite::update( const Time& ElapsedTime ) { } if ( !SPR_FGET( SPRITE_FLAG_REVERSE_ANIM ) && mfCurrentFrame >= Size + 1.0f ) { - if ( mRepeations < 0 ) { + if ( mRepetitions < 0 ) { mfCurrentFrame = 0.0f; mCurrentFrame = 0; fireEvent( SPRITE_EVENT_FIRST_FRAME ); } else { - if ( mRepeations == 0 ) { + if ( mRepetitions == 0 ) { mfCurrentFrame = (Float)Size; mCurrentFrame = Size; fireEvent( SPRITE_EVENT_LAST_FRAME ); } else { mfCurrentFrame = 0.0f; mCurrentFrame = 0; - mRepeations--; + mRepetitions--; fireEvent( SPRITE_EVENT_FIRST_FRAME ); } } } else if ( SPR_FGET( SPRITE_FLAG_REVERSE_ANIM ) && mfCurrentFrame < 0.0f ) { - if ( mRepeations < 0 ) { + if ( mRepetitions < 0 ) { mfCurrentFrame = Size + 1.0f; mCurrentFrame = Size; fireEvent( SPRITE_EVENT_LAST_FRAME ); } else { - if ( mRepeations == 0 ) { + if ( mRepetitions == 0 ) { mfCurrentFrame = 0.0f; mCurrentFrame = 0; fireEvent( SPRITE_EVENT_FIRST_FRAME ); } else { mfCurrentFrame = Size + 1.0f; mCurrentFrame = Size; - mRepeations--; + mRepetitions--; fireEvent( SPRITE_EVENT_LAST_FRAME ); } } @@ -631,7 +632,7 @@ Vector2i Sprite::getOffset() { SubTexture* S = getCurrentSubTexture(); if ( S != NULL ) - return S->offset(); + return S->getOffset(); return Vector2i(); } @@ -640,28 +641,28 @@ void Sprite::setOffset( const Vector2i& offset ) { SubTexture* S = getCurrentSubTexture(); if ( S != NULL ) { - S->offset( offset ); + S->setOffset( offset ); } } void Sprite::setSize( const Sizef& Size, const unsigned int& FrameNum, const unsigned int& SubFrame ) { - mFrames[ getFrame(FrameNum) ].Spr[ getSubFrame(SubFrame) ]->destSize( Size ); + mFrames[ getFrame(FrameNum) ].Spr[ getSubFrame(SubFrame) ]->setDestSize( Size ); } void Sprite::setSize( const Sizef& Size ) { - mFrames[ mCurrentFrame ].Spr[ mCurrentSubFrame ]->destSize( Size ); + mFrames[ mCurrentFrame ].Spr[ mCurrentSubFrame ]->setDestSize( Size ); } Sizef Sprite::setSize( const unsigned int& FrameNum, const unsigned int& SubFrame ) { - return mFrames[ getFrame(FrameNum) ].Spr[ getSubFrame(SubFrame) ]->destSize(); + return mFrames[ getFrame(FrameNum) ].Spr[ getSubFrame(SubFrame) ]->getDestSize(); } Sizef Sprite::getSize() { - return mFrames[ mCurrentFrame ].Spr[ mCurrentSubFrame ]->destSize(); + return mFrames[ mCurrentFrame ].Spr[ mCurrentSubFrame ]->getDestSize(); } void Sprite::setRepetitions( const int& Repeations ) { - mRepeations = Repeations; + mRepetitions = Repeations; } void Sprite::setAutoAnimate( const bool& Autoanim ) { diff --git a/src/eepp/graphics/subtexture.cpp b/src/eepp/graphics/subtexture.cpp index ff48b76cc..8b6272264 100644 --- a/src/eepp/graphics/subtexture.cpp +++ b/src/eepp/graphics/subtexture.cpp @@ -28,7 +28,7 @@ SubTexture::SubTexture( const Uint32& TexId, const std::string& Name ) : mId( String::hash( mName ) ), mTexId( TexId ), mTexture( TextureFactory::instance()->getTexture( TexId ) ), - mSrcRect( Recti( 0, 0, NULL != mTexture ? mTexture->imgWidth() : 0, NULL != mTexture ? mTexture->imgHeight() : 0 ) ), + mSrcRect( Recti( 0, 0, NULL != mTexture ? mTexture->getImageWidth() : 0, NULL != mTexture ? mTexture->getImageHeight() : 0 ) ), mDestSize( (Float)mSrcRect.getSize().getWidth(), (Float)mSrcRect.getSize().getHeight() ), mOffset(0,0) { @@ -99,20 +99,20 @@ void SubTexture::setName( const std::string& name ) { mId = String::hash( mName ); } -const Uint32& SubTexture::texture() { +const Uint32& SubTexture::getTextureId() { return mTexId; } -void SubTexture::texture( const Uint32& TexId ) { +void SubTexture::setTextureId( const Uint32& TexId ) { mTexId = TexId; mTexture = TextureFactory::instance()->getTexture( TexId ); } -const Recti& SubTexture::srcRect() const { +const Recti& SubTexture::getSrcRect() const { return mSrcRect; } -void SubTexture::srcRect( const Recti& Rect ) { +void SubTexture::setSrcRect( const Recti& Rect ) { mSrcRect = Rect; if ( NULL != mPixels ) @@ -122,19 +122,19 @@ void SubTexture::srcRect( const Recti& Rect ) { cacheAlphaMask(); } -const Sizef& SubTexture::destSize() const { +const Sizef& SubTexture::getDestSize() const { return mDestSize; } -void SubTexture::destSize( const Sizef& destSize ) { +void SubTexture::setDestSize( const Sizef& destSize ) { mDestSize = destSize; } -const Vector2i& SubTexture::offset() const { +const Vector2i& SubTexture::getOffset() const { return mOffset; } -void SubTexture::offset( const Vector2i& offset ) { +void SubTexture::setOffset( const Vector2i& offset ) { mOffset = offset; } @@ -240,7 +240,7 @@ void SubTexture::cacheColors() { } Uint8 SubTexture::getAlphaAt( const Int32& X, const Int32& Y ) { - if ( mTexture->localCopy() ) + if ( mTexture->hasLocalCopy() ) return mTexture->getPixel( mSrcRect.Left + X, mSrcRect.Right + Y ).a(); if ( NULL != mAlpha ) @@ -255,7 +255,7 @@ Uint8 SubTexture::getAlphaAt( const Int32& X, const Int32& Y ) { } ColorA SubTexture::getColorAt( const Int32& X, const Int32& Y ) { - if ( mTexture->localCopy() ) + if ( mTexture->hasLocalCopy() ) return mTexture->getPixel( mSrcRect.Left + X, mSrcRect.Right + Y ); if ( NULL != mPixels ) { @@ -306,7 +306,7 @@ Uint8 * SubTexture::lock() { bool SubTexture::unlock( const bool& KeepData, const bool& Modified ) { if ( NULL != mPixels && NULL != mTexture ) { if ( Modified ) { - TextureSaver saver( mTexture->handle() ); + TextureSaver saver( mTexture->getHandle() ); Uint32 Channels = mTexture->getChannels(); Uint32 Channel = GL_RGBA; @@ -331,11 +331,11 @@ bool SubTexture::unlock( const bool& KeepData, const bool& Modified ) { return false; } -Sizei SubTexture::realSize() { +Sizei SubTexture::getRealSize() { return mSrcRect.getSize(); } -Sizei SubTexture::size() { +Sizei SubTexture::getSize() { return Sizei( (Int32)mDestSize.x, (Int32)mDestSize.y ); } @@ -355,11 +355,11 @@ bool SubTexture::saveToFile(const std::string& filepath, const EE_SAVE_TYPE& For if ( NULL != mTexture ) { if ( SAVE_TYPE_JPG != Format ) { - Res = 0 != ( SOIL_save_image ( filepath.c_str(), Format, realSize().getWidth(), realSize().getHeight(), mTexture->getChannels(), getPixelsPtr() ) ); + Res = 0 != ( SOIL_save_image ( filepath.c_str(), Format, getRealSize().getWidth(), getRealSize().getHeight(), mTexture->getChannels(), getPixelsPtr() ) ); } else { jpge::params params; params.m_quality = Image::jpegQuality(); - Res = jpge::compress_image_to_jpeg_file( filepath.c_str(), realSize().getWidth(), realSize().getHeight(), mTexture->getChannels(), getPixelsPtr(), params); + Res = jpge::compress_image_to_jpeg_file( filepath.c_str(), getRealSize().getWidth(), getRealSize().getHeight(), mTexture->getChannels(), getPixelsPtr(), params); } } diff --git a/src/eepp/graphics/textcache.cpp b/src/eepp/graphics/textcache.cpp index 3fad7325a..b67e46941 100644 --- a/src/eepp/graphics/textcache.cpp +++ b/src/eepp/graphics/textcache.cpp @@ -28,10 +28,10 @@ TextCache::TextCache( Graphics::Font * font, const String& text, ColorA FontColo mVertexNumCached(0), mCachedCoords(false) { - cache(); + cacheWidth(); updateCoords(); - color( FontColor ); - shadowColor( FontShadowColor ); + setColor( FontColor ); + setShadowColor( FontShadowColor ); } TextCache::~TextCache() { @@ -41,21 +41,21 @@ void TextCache::create( Graphics::Font * font, const String& text, ColorA FontCo mFont = font; mText = text; updateCoords(); - color( FontColor ); - shadowColor( FontShadowColor ); - cache(); + setColor( FontColor ); + setShadowColor( FontShadowColor ); + cacheWidth(); } -Graphics::Font * TextCache::font() const { +Graphics::Font * TextCache::getFont() const { return mFont; } -void TextCache::font( Graphics::Font * font ) { +void TextCache::setFont( Graphics::Font * font ) { mFont = font; - cache(); + cacheWidth(); } -String& TextCache::text() { +String& TextCache::getText() { return mText; } @@ -66,7 +66,7 @@ void TextCache::updateCoords() { mColors.resize( size, mFontColor ); } -void TextCache::text( const String& text ) { +void TextCache::setText( const String& text ) { bool needUpdate = false; if ( mText.size() != text.size() ) @@ -77,21 +77,21 @@ void TextCache::text( const String& text ) { if ( needUpdate ) updateCoords(); - cache(); + cacheWidth(); } -const ColorA& TextCache::color() const { +const ColorA& TextCache::getColor() const { return mFontColor; } -void TextCache::alpha( const Uint8& alpha ) { +void TextCache::setAlpha( const Uint8& alpha ) { std::size_t s = mColors.size(); for ( Uint32 i = 0; i < s; i++ ) { mColors[ i ].Alpha = alpha; } } -void TextCache::color( const ColorA& color ) { +void TextCache::setColor( const ColorA& color ) { if ( mFontColor != color ) { mFontColor = color; @@ -99,7 +99,7 @@ void TextCache::color( const ColorA& color ) { } } -void TextCache::color( const ColorA& color, Uint32 from, Uint32 to ) { +void TextCache::setColor( const ColorA& color, Uint32 from, Uint32 to ) { std::vector colors( GLi->quadVertexs(), color ); std::size_t s = mText.size(); @@ -144,23 +144,23 @@ void TextCache::color( const ColorA& color, Uint32 from, Uint32 to ) { } } -const ColorA& TextCache::shadowColor() const { +const ColorA& TextCache::getShadowColor() const { return mFontShadowColor; } -void TextCache::shadowColor(const ColorA& color) { +void TextCache::setShadowColor(const ColorA& color) { mFontShadowColor = color; } -std::vector& TextCache::vertextCoords() { +std::vector& TextCache::getVertextCoords() { return mRenderCoords; } -std::vector& TextCache::colors() { +std::vector& TextCache::getColors() { return mColors; } -void TextCache::cache() { +void TextCache::cacheWidth() { if ( NULL != mFont && mText.size() ) { mFont->cacheWidth( mText, mLinesWidth, mCachedWidth, mNumLines, mLargestLineCharCount ); }else { @@ -182,7 +182,7 @@ const int& TextCache::getNumLines() const { return mNumLines; } -const std::vector& TextCache::linesWidth() { +const std::vector& TextCache::getLinesWidth() { return mLinesWidth; } @@ -218,18 +218,18 @@ void TextCache::cachedVerts( const unsigned int& num ) { mVertexNumCached = num; } -void TextCache::flags( const Uint32& flags ) { +void TextCache::setFlags( const Uint32& flags ) { if ( mFlags != flags ) { mFlags = flags; mCachedCoords = false; if ( ( mFlags & FONT_DRAW_VERTICAL ) != ( flags & FONT_DRAW_VERTICAL ) ) { - cache(); + cacheWidth(); } } } -const Uint32& TextCache::flags() const { +const Uint32& TextCache::getFlags() const { return mFlags; } diff --git a/src/eepp/graphics/texture.cpp b/src/eepp/graphics/texture.cpp index 5cb9bf0fa..2b50e1f15 100755 --- a/src/eepp/graphics/texture.cpp +++ b/src/eepp/graphics/texture.cpp @@ -182,7 +182,7 @@ bool Texture::unlock( const bool& KeepData, const bool& Modified ) { } const Uint8 * Texture::getPixelsPtr() { - if ( !localCopy() ) { + if ( !hasLocalCopy() ) { lock(); unlock(true); } @@ -214,7 +214,7 @@ bool Texture::saveToFile( const std::string& filepath, const EE_SAVE_TYPE& Forma return Res; } -void Texture::filter(const EE_TEX_FILTER& filter) { +void Texture::setFilter(const EE_TEX_FILTER& filter) { if ( mFilter != filter ) { iTextureFilter( filter ); } @@ -235,7 +235,7 @@ void Texture::iTextureFilter( const EE_TEX_FILTER& filter ) { } } -const EE_TEX_FILTER& Texture::filter() const { +const EE_TEX_FILTER& Texture::getFilter() const { return mFilter; } @@ -298,11 +298,11 @@ void Texture::flip() { mImgHeight = mHeight; } -bool Texture::localCopy() { +bool Texture::hasLocalCopy() { return ( mPixels != NULL ); } -void Texture::clampMode( const EE_CLAMP_MODE& clampmode ) { +void Texture::setClampMode( const EE_CLAMP_MODE& clampmode ) { if ( mClampMode != clampmode ) { mClampMode = clampmode; applyClampMode(); @@ -333,7 +333,7 @@ const Uint32& Texture::getId() const { } void Texture::reload() { - if ( localCopy() ) { + if ( hasLocalCopy() ) { Int32 width = (Int32)mWidth; Int32 height = (Int32)mHeight; @@ -343,7 +343,7 @@ void Texture::reload() { flags = (mClampMode == CLAMP_REPEAT) ? (flags | SOIL_FLAG_TEXTURE_REPEATS) : flags; if ( ( mFlags & TEX_FLAG_COMPRESSED ) ) { - if ( grabed() ) + if ( isGrabed() ) mTexture = SOIL_create_OGL_texture( reinterpret_cast ( &mPixels[0] ), &width, &height, mChannels, mTexture, flags | SOIL_FLAG_COMPRESS_TO_DXT ); else glCompressedTexImage2D( mTexture, 0, mInternalFormat, width, height, 0, mSize, &mPixels[0] ); @@ -354,7 +354,7 @@ void Texture::reload() { mSize = mWidth * mHeight * mChannels; - if ( mipmap() ) { + if ( getMipmap() ) { int w = mWidth; int h = mHeight; @@ -392,11 +392,11 @@ void Texture::update( Image *image, Uint32 x, Uint32 y ) { update( image->getPixelsPtr(), image->getWidth(), image->getHeight(), x, y, channelsToPixelFormat( image->getChannels() ) ); } -const Uint32& Texture::hashName() const { +const Uint32& Texture::getHashName() const { return mId; } -void Texture::mipmap( const bool& UseMipmap ) { +void Texture::setMipmap( const bool& UseMipmap ) { if ( mFlags & TEX_FLAG_MIPMAP ) { if ( !UseMipmap ) mFlags &= ~TEX_FLAG_MIPMAP; @@ -406,11 +406,11 @@ void Texture::mipmap( const bool& UseMipmap ) { } } -bool Texture::mipmap() const { +bool Texture::getMipmap() const { return mFlags & TEX_FLAG_MIPMAP; } -void Texture::grabed( const bool& isGrabed ) { +void Texture::setGrabed( const bool& isGrabed ) { if ( mFlags & TEX_FLAG_GRABED ) { if ( !isGrabed ) mFlags &= ~TEX_FLAG_GRABED; @@ -420,7 +420,7 @@ void Texture::grabed( const bool& isGrabed ) { } } -bool Texture::grabed() const { +bool Texture::isGrabed() const { return 0 != ( mFlags & TEX_FLAG_GRABED ); } @@ -433,8 +433,8 @@ void Texture::draw( const Float &x, const Float &y, const Float &Angle, const Ve } void Texture::drawFast( const Float& x, const Float& y, const Float& Angle, const Vector2f& Scale, const ColorA& Color, const EE_BLEND_MODE &Blend, const Float &width, const Float &height ) { - Float w = 0.f != width ? width : (Float)imgWidth(); - Float h = 0.f != height ? height : (Float)imgHeight(); + Float w = 0.f != width ? width : (Float)getImageWidth(); + Float h = 0.f != height ? height : (Float)getImageHeight(); sBR->setTexture( this ); sBR->setBlendMode( Blend ); @@ -442,7 +442,7 @@ void Texture::drawFast( const Float& x, const Float& y, const Float& Angle, cons sBR->quadsBegin(); sBR->quadsSetColor( Color ); - if ( clampMode() == CLAMP_REPEAT ) { + if ( getClampMode() == CLAMP_REPEAT ) { sBR->quadsSetSubsetFree( 0, 0, 0, height / h, width / w, height / h, width / w, 0 ); } @@ -454,8 +454,8 @@ void Texture::drawFast( const Float& x, const Float& y, const Float& Angle, cons void Texture::drawEx( Float x, Float y, Float width, Float height, const Float &Angle, const Vector2f &Scale, const ColorA& Color0, const ColorA& Color1, const ColorA& Color2, const ColorA& Color3, const EE_BLEND_MODE &Blend, const EE_RENDER_MODE &Effect, OriginPoint Center, const Recti& texSector ) { bool renderSector = true; Recti Sector = texSector; - Float w = (Float)imgWidth(); - Float h = (Float)imgHeight(); + Float w = (Float)getImageWidth(); + Float h = (Float)getImageHeight(); if ( Sector.Right == 0 && Sector.Bottom == 0 ) { Sector.Left = 0; @@ -478,7 +478,7 @@ void Texture::drawEx( Float x, Float y, Float width, Float height, const Float & sBR->quadsSetColorFree( Color0, Color1, Color2, Color3 ); if ( Effect <= RN_FLIPMIRROR ) { - if ( clampMode() == CLAMP_REPEAT ) { + if ( getClampMode() == CLAMP_REPEAT ) { if ( Effect == RN_NORMAL ) { if ( renderSector ) { sBR->quadsSetSubsetFree( Sector.Left / w, Sector.Top / h, Sector.Left / w, Sector.Bottom / h, Sector.Right / w, Sector.Bottom / h, Sector.Right / w, Sector.Top / h ); @@ -624,14 +624,14 @@ void Texture::drawQuad( const Quad2f& Q, const Vector2f& Offset, const Float &An void Texture::drawQuadEx( Quad2f Q, const Vector2f& Offset, const Float &Angle, const Vector2f &Scale, const ColorA& Color0, const ColorA& Color1, const ColorA& Color2, const ColorA& Color3, const EE_BLEND_MODE &Blend, Recti texSector ) { bool renderSector = true; - Float w = (Float)imgWidth(); - Float h = (Float)imgHeight(); + Float w = (Float)getImageWidth(); + Float h = (Float)getImageHeight(); if ( texSector.Right == 0 && texSector.Bottom == 0 ) { texSector.Left = 0; texSector.Top = 0; - texSector.Right = imgWidth(); - texSector.Bottom = imgHeight(); + texSector.Right = getImageWidth(); + texSector.Bottom = getImageHeight(); } renderSector = !( texSector.Left == 0 && texSector.Top == 0 && texSector.Right == w && texSector.Bottom == h ); @@ -648,7 +648,7 @@ void Texture::drawQuadEx( Quad2f Q, const Vector2f& Offset, const Float &Angle, Q.scale( Scale, QCenter ); } - if ( clampMode() == CLAMP_REPEAT ) { + if ( getClampMode() == CLAMP_REPEAT ) { sBR->quadsSetSubsetFree( 0, 0, 0, ( Q.V[0].y - Q.V[0].y ) / h, ( Q.V[0].x - Q.V[0].x ) / w, ( Q.V[0].y - Q.V[0].y ) / h, ( Q.V[0].x - Q.V[0].x ) / w, 0 ); } else if ( renderSector ) { sBR->quadsSetSubsetFree( texSector.Left / w, texSector.Top / h, texSector.Left / w, texSector.Bottom / h, texSector.Right / w, texSector.Bottom / h, texSector.Right / w, texSector.Top / h ); diff --git a/src/eepp/graphics/textureatlas.cpp b/src/eepp/graphics/textureatlas.cpp index d8e235a3d..3edcb6fe9 100644 --- a/src/eepp/graphics/textureatlas.cpp +++ b/src/eepp/graphics/textureatlas.cpp @@ -20,11 +20,11 @@ void TextureAtlas::setName( const std::string& name ) { mId = String::hash( mName ); } -const std::string& TextureAtlas::path() const { +const std::string& TextureAtlas::getPath() const { return mPath; } -void TextureAtlas::path( const std::string& path ) { +void TextureAtlas::setPath( const std::string& path ) { mPath = path; } diff --git a/src/eepp/graphics/textureatlasloader.cpp b/src/eepp/graphics/textureatlasloader.cpp index 8c16ada8f..2b9700a19 100644 --- a/src/eepp/graphics/textureatlasloader.cpp +++ b/src/eepp/graphics/textureatlasloader.cpp @@ -205,14 +205,14 @@ void TextureAtlasLoader::createSubTextures() { TextureAtlas * tTextureAtlas = TextureAtlasManager::instance()->getByName( name ); - if ( NULL != tTextureAtlas && tTextureAtlas->path() == etapath ) { + if ( NULL != tTextureAtlas && tTextureAtlas->getPath() == etapath ) { mTextureAtlas = tTextureAtlas; IsAlreadyLoaded = true; } else { mTextureAtlas = eeNew( TextureAtlas, ( name ) ); - mTextureAtlas->path( etapath ); + mTextureAtlas->setPath( etapath ); TextureAtlasManager::instance()->add( mTextureAtlas ); } @@ -258,11 +258,11 @@ void TextureAtlasLoader::createSubTextures() { } } -bool TextureAtlasLoader::threaded() const { +bool TextureAtlasLoader::isThreaded() const { return mThreaded; } -void TextureAtlasLoader::threaded( const bool& threaded ) { +void TextureAtlasLoader::setThreaded( const bool& threaded ) { mThreaded = threaded; } @@ -297,10 +297,10 @@ bool TextureAtlasLoader::updateTextureAtlas() { SubTexture * tSubTexture = mTextureAtlas->getById( tSh->ResourceID ); if ( NULL != tSubTexture ) { - tSh->OffsetX = tSubTexture->offset().x; - tSh->OffsetY = tSubTexture->offset().x; - tSh->DestWidth = (Int32)tSubTexture->destSize().x; - tSh->DestHeight = (Int32)tSubTexture->destSize().x; + tSh->OffsetX = tSubTexture->getOffset().x; + tSh->OffsetY = tSubTexture->getOffset().x; + tSh->DestWidth = (Int32)tSubTexture->getDestSize().x; + tSh->DestHeight = (Int32)tSubTexture->getDestSize().x; } } } diff --git a/src/eepp/graphics/texturefactory.cpp b/src/eepp/graphics/texturefactory.cpp index 2127f3167..3974a5683 100755 --- a/src/eepp/graphics/texturefactory.cpp +++ b/src/eepp/graphics/texturefactory.cpp @@ -104,13 +104,13 @@ Uint32 TextureFactory::findFreeSlot() { } void TextureFactory::bind( const Texture* Tex, const Uint32& TextureUnit ) { - if( NULL != Tex && mCurrentTexture[ TextureUnit ] != (Int32)Tex->handle() ) { + if( NULL != Tex && mCurrentTexture[ TextureUnit ] != (Int32)Tex->getHandle() ) { if ( TextureUnit && GLi->isExtension( EEGL_ARB_multitexture ) ) setActiveTextureUnit( TextureUnit ); - GLi->bindTexture( GL_TEXTURE_2D, Tex->handle() ); + GLi->bindTexture( GL_TEXTURE_2D, Tex->getHandle() ); - mCurrentTexture[ TextureUnit ] = Tex->handle(); + mCurrentTexture[ TextureUnit ] = Tex->getHandle(); if ( TextureUnit && GLi->isExtension( EEGL_ARB_multitexture ) ) setActiveTextureUnit( 0 ); @@ -153,7 +153,7 @@ bool TextureFactory::remove( Uint32 TexId ) { void TextureFactory::removeReference( Texture * Tex ) { mMemSize -= Tex->getMemSize(); - int glTexId = Tex->handle(); + int glTexId = Tex->getHandle(); mTextures[ Tex->getId() ] = NULL; @@ -194,9 +194,9 @@ void TextureFactory::grabTextures() { for ( Uint32 i = 1; i < mTextures.size(); i++ ) { Texture* Tex = getTexture(i); - if ( Tex && !Tex->localCopy() ) { + if ( Tex && !Tex->hasLocalCopy() ) { Tex->lock(); - Tex->grabed(true); + Tex->setGrabed(true); } } } @@ -205,10 +205,10 @@ void TextureFactory::ungrabTextures() { for ( Uint32 i = 1; i < mTextures.size(); i++ ) { Texture* Tex = getTexture(i); - if ( NULL != Tex && Tex->grabed() ) { + if ( NULL != Tex && Tex->isGrabed() ) { Tex->reload(); Tex->unlock(); - Tex->grabed(false); + Tex->setGrabed(false); } } } @@ -256,7 +256,7 @@ bool TextureFactory::saveImage( const std::string& filepath, const EE_SAVE_TYPE& return Res; } -bool TextureFactory::textureIdExists( const Uint32& TexId ) { +bool TextureFactory::existsId( const Uint32& TexId ) { return ( TexId < mTextures.size() && TexId > 0 && NULL != mTextures[ TexId ] ); } @@ -283,7 +283,7 @@ Texture * TextureFactory::getByHash( const Uint32& Hash ) { for ( Uint32 i = (Uint32)mTextures.size() - 1; i > 0; i-- ) { tTex = mTextures[ i ]; - if ( NULL != tTex && tTex->hashName() == Hash ) + if ( NULL != tTex && tTex->getHashName() == Hash ) return mTextures[ i ]; } diff --git a/src/eepp/graphics/texturefont.cpp b/src/eepp/graphics/texturefont.cpp index 243196e26..149f22112 100755 --- a/src/eepp/graphics/texturefont.cpp +++ b/src/eepp/graphics/texturefont.cpp @@ -45,7 +45,7 @@ bool TextureFont::load( const Uint32& TexId, const unsigned int& StartChar, cons buildFont(); - eePRINTL( "Texture Font %s loaded.", Tex->filepath().c_str() ); + eePRINTL( "Texture Font %s loaded.", Tex->getFilepath().c_str() ); return true; } diff --git a/src/eepp/ui/tools/textureatlaseditor.cpp b/src/eepp/ui/tools/textureatlaseditor.cpp index 2f905f33b..03dd9ba99 100644 --- a/src/eepp/ui/tools/textureatlaseditor.cpp +++ b/src/eepp/ui/tools/textureatlaseditor.cpp @@ -135,7 +135,7 @@ void TextureAtlasEditor::onResetDestSize( const UIEvent * Event ) { const UIEventMouse * MouseEvent = reinterpret_cast ( Event ); if ( NULL != mCurSubTexture && MouseEvent->getFlags() & EE_BUTTON_LMASK ) { - Sizei RealSize = mCurSubTexture->realSize(); + Sizei RealSize = mCurSubTexture->getRealSize(); mCurSubTexture->resetDestSize(); @@ -157,7 +157,7 @@ void TextureAtlasEditor::onCenterOffset( const UIEvent * Event ) { const UIEventMouse * MouseEvent = reinterpret_cast ( Event ); if ( NULL != mCurSubTexture && MouseEvent->getFlags() & EE_BUTTON_LMASK ) { - Sizei NSize( -( (Int32)mCurSubTexture->destSize().x / 2 ), -( (Int32)mCurSubTexture->destSize().y / 2 ) ); + Sizei NSize( -( (Int32)mCurSubTexture->getDestSize().x / 2 ), -( (Int32)mCurSubTexture->getDestSize().y / 2 ) ); mSpinOffX->value( NSize.x ); mSpinOffY->value( NSize.y ); @@ -168,7 +168,7 @@ void TextureAtlasEditor::onHBOffset( const UIEvent * Event ) { const UIEventMouse * MouseEvent = reinterpret_cast ( Event ); if ( NULL != mCurSubTexture && MouseEvent->getFlags() & EE_BUTTON_LMASK ) { - Sizei NSize( -( (Int32)mCurSubTexture->destSize().x / 2 ), -(Int32)mCurSubTexture->destSize().y ); + Sizei NSize( -( (Int32)mCurSubTexture->getDestSize().x / 2 ), -(Int32)mCurSubTexture->getDestSize().y ); mSpinOffX->value( NSize.x ); mSpinOffY->value( NSize.y ); @@ -177,25 +177,25 @@ void TextureAtlasEditor::onHBOffset( const UIEvent * Event ) { void TextureAtlasEditor::onOffXChange( const UIEvent * Event ) { if ( NULL != mCurSubTexture ) { - mCurSubTexture->offset( Vector2i( (Int32)mSpinOffX->value(), mCurSubTexture->offset().y ) ); + mCurSubTexture->setOffset( Vector2i( (Int32)mSpinOffX->value(), mCurSubTexture->getOffset().y ) ); } } void TextureAtlasEditor::onOffYChange( const UIEvent * Event ) { if ( NULL != mCurSubTexture ) { - mCurSubTexture->offset( Vector2i( mCurSubTexture->offset().x, (Int32)mSpinOffY->value() ) ); + mCurSubTexture->setOffset( Vector2i( mCurSubTexture->getOffset().x, (Int32)mSpinOffY->value() ) ); } } void TextureAtlasEditor::onDestWChange( const UIEvent * Event ) { if ( NULL != mCurSubTexture ) { - mCurSubTexture->destSize( Sizef( (Int32)mSpinDestW->value(), mCurSubTexture->destSize().y ) ); + mCurSubTexture->setDestSize( Sizef( (Int32)mSpinDestW->value(), mCurSubTexture->getDestSize().y ) ); } } void TextureAtlasEditor::onDestHChange( const UIEvent * Event ) { if ( NULL != mCurSubTexture ) { - mCurSubTexture->destSize( Sizef( mCurSubTexture->destSize().x, (Int32)mSpinDestH->value() ) ); + mCurSubTexture->setDestSize( Sizef( mCurSubTexture->getDestSize().x, (Int32)mSpinDestH->value() ) ); } } @@ -316,10 +316,10 @@ void TextureAtlasEditor::onSubTextureChange( const UIEvent * Event ) { if ( NULL != mCurSubTexture ) { mSubTextureEditor->subTexture( mCurSubTexture ); - mSpinOffX->value( mCurSubTexture->offset().x ); - mSpinOffY->value( mCurSubTexture->offset().y ); - mSpinDestW->value( mCurSubTexture->destSize().x ); - mSpinDestH->value( mCurSubTexture->destSize().y ); + mSpinOffX->value( mCurSubTexture->getOffset().x ); + mSpinOffY->value( mCurSubTexture->getOffset().y ); + mSpinDestW->value( mCurSubTexture->getDestSize().x ); + mSpinDestH->value( mCurSubTexture->getDestSize().y ); } } } diff --git a/src/eepp/ui/tools/textureatlassubtextureeditor.cpp b/src/eepp/ui/tools/textureatlassubtextureeditor.cpp index 725e07421..7517797e2 100644 --- a/src/eepp/ui/tools/textureatlassubtextureeditor.cpp +++ b/src/eepp/ui/tools/textureatlassubtextureeditor.cpp @@ -49,10 +49,10 @@ void TextureAtlasSubTextureEditor::update() { if ( NULL != mGfx->subTexture() && mDrag->dragEnable() && mDrag->dragging() && Pos != mDrag->position() ) { Vector2i Diff = -( Pos - mDrag->position() ); - mGfx->subTexture()->offset( Vector2i( mGfx->subTexture()->offset().x + Diff.x, mGfx->subTexture()->offset().y + Diff.y ) ); + mGfx->subTexture()->setOffset( Vector2i( mGfx->subTexture()->getOffset().x + Diff.x, mGfx->subTexture()->getOffset().y + Diff.y ) ); - mEditor->spinOffX()->value( mGfx->subTexture()->offset().x ); - mEditor->spinOffY()->value( mGfx->subTexture()->offset().y ); + mEditor->spinOffX()->value( mGfx->subTexture()->getOffset().x ); + mEditor->spinOffY()->value( mGfx->subTexture()->getOffset().y ); } mGfx->position( mUICenter ); diff --git a/src/eepp/ui/uicheckbox.cpp b/src/eepp/ui/uicheckbox.cpp index 60883bf5c..ed2595034 100644 --- a/src/eepp/ui/uicheckbox.cpp +++ b/src/eepp/ui/uicheckbox.cpp @@ -56,7 +56,7 @@ void UICheckBox::doAftersetTheme() { tSubTexture = tSkin->getSubTexture( UISkinState::StateNormal ); if ( NULL != tSubTexture ) { - mActiveButton->size( tSubTexture->realSize() ); + mActiveButton->size( tSubTexture->getRealSize() ); mActiveButton->centerVertical(); } } @@ -67,7 +67,7 @@ void UICheckBox::doAftersetTheme() { tSubTexture = tSkin->getSubTexture( UISkinState::StateNormal ); if ( NULL != tSubTexture ) { - mInactiveButton->size( tSubTexture->realSize() ); + mInactiveButton->size( tSubTexture->getRealSize() ); mInactiveButton->centerVertical(); } } diff --git a/src/eepp/ui/uicombobox.cpp b/src/eepp/ui/uicombobox.cpp index bb35bb157..a6ff30ed8 100644 --- a/src/eepp/ui/uicombobox.cpp +++ b/src/eepp/ui/uicombobox.cpp @@ -47,7 +47,7 @@ void UIComboBox::createButton() { SubTexture * tSubTexture = tComplex->getSubTextureSide( UISkinState::StateNormal, UISkinComplex::Right ); if ( NULL != tSubTexture ) - btnWidth = tSubTexture->realSize().getWidth(); + btnWidth = tSubTexture->getRealSize().getWidth(); } } diff --git a/src/eepp/ui/uicontrol.cpp b/src/eepp/ui/uicontrol.cpp index 3f60bc440..4d6186eb8 100644 --- a/src/eepp/ui/uicontrol.cpp +++ b/src/eepp/ui/uicontrol.cpp @@ -1085,28 +1085,28 @@ Recti UIControl::makePadding( bool PadLeft, bool PadRight, bool PadTop, bool Pad tSubTexture = tComplex->getSubTextureSide( UISkinState::StateNormal, UISkinComplex::Left ); if ( NULL != tSubTexture ) - tPadding.Left = tSubTexture->realSize().getWidth(); + tPadding.Left = tSubTexture->getRealSize().getWidth(); } if ( PadRight ) { tSubTexture = tComplex->getSubTextureSide( UISkinState::StateNormal, UISkinComplex::Right ); if ( NULL != tSubTexture ) - tPadding.Right = tSubTexture->realSize().getWidth(); + tPadding.Right = tSubTexture->getRealSize().getWidth(); } if ( PadTop ) { tSubTexture = tComplex->getSubTextureSide( UISkinState::StateNormal, UISkinComplex::Up ); if ( NULL != tSubTexture ) - tPadding.Top = tSubTexture->realSize().getHeight(); + tPadding.Top = tSubTexture->getRealSize().getHeight(); } if ( PadBottom ) { tSubTexture = tComplex->getSubTextureSide( UISkinState::StateNormal, UISkinComplex::Down ); if ( NULL != tSubTexture ) - tPadding.Bottom = tSubTexture->realSize().getHeight(); + tPadding.Bottom = tSubTexture->getRealSize().getHeight(); } } } @@ -1141,7 +1141,7 @@ Sizei UIControl::getSkinSize( UISkin * Skin, const Uint32& State ) { SubTexture * tSubTexture = Skin->getSubTexture( State ); if ( NULL != tSubTexture ) { - tSize = tSubTexture->realSize(); + tSize = tSubTexture->getRealSize(); } if ( Skin->getType() == UISkin::SkinComplex ) { @@ -1150,25 +1150,25 @@ Sizei UIControl::getSkinSize( UISkin * Skin, const Uint32& State ) { tSubTexture = SkinC->getSubTextureSide( State, UISkinComplex::Up ); if ( NULL != tSubTexture ) { - tSize.y += tSubTexture->realSize().getHeight(); + tSize.y += tSubTexture->getRealSize().getHeight(); } tSubTexture = SkinC->getSubTextureSide( State, UISkinComplex::Down ); if ( NULL != tSubTexture ) { - tSize.y += tSubTexture->realSize().getHeight(); + tSize.y += tSubTexture->getRealSize().getHeight(); } tSubTexture = SkinC->getSubTextureSide( State, UISkinComplex::Left ); if ( NULL != tSubTexture ) { - tSize.x += tSubTexture->realSize().getWidth(); + tSize.x += tSubTexture->getRealSize().getWidth(); } tSubTexture = SkinC->getSubTextureSide( State, UISkinComplex::Right ); if ( NULL != tSubTexture ) { - tSize.x += tSubTexture->realSize().getWidth(); + tSize.x += tSubTexture->getRealSize().getWidth(); } } } diff --git a/src/eepp/ui/uigfx.cpp b/src/eepp/ui/uigfx.cpp index e30d47e28..4112a4539 100644 --- a/src/eepp/ui/uigfx.cpp +++ b/src/eepp/ui/uigfx.cpp @@ -11,7 +11,7 @@ UIGfx::UIGfx( const UIGfx::CreateParams& Params ) : mAlignOffset(0,0) { if ( NULL != mSubTexture && ( ( flags() & UI_AUTO_SIZE ) || ( Params.Size.x == -1 && Params.Size.y == -1 ) ) ) - size( mSubTexture->size() ); + size( mSubTexture->getSize() ); mColor.Alpha = (Uint8)mAlpha; @@ -39,7 +39,7 @@ void UIGfx::subTexture( Graphics::SubTexture * subTexture ) { void UIGfx::autoSize() { if ( mFlags & UI_AUTO_SIZE ) { if ( NULL != mSubTexture ) { - size( mSubTexture->size() ); + size( mSubTexture->getSize() ); } else { size( Sizei( 0, 0 ) ); } @@ -51,19 +51,19 @@ void UIGfx::draw() { if ( mVisible ) { if ( NULL != mSubTexture && 0.f != mAlpha ) { - Sizef oDestSize = mSubTexture->destSize(); - Vector2i oOff = mSubTexture->offset(); + Sizef oDestSize = mSubTexture->getDestSize(); + Vector2i oOff = mSubTexture->getOffset(); if ( mFlags & UI_FIT_TO_CONTROL ) { - mSubTexture->offset( Vector2i( 0, 0 ) ); - mSubTexture->destSize( Vector2f( mSize.x, mSize.y ) ); + mSubTexture->setOffset( Vector2i( 0, 0 ) ); + mSubTexture->setDestSize( Vector2f( mSize.x, mSize.y ) ); drawSubTexture(); - mSubTexture->destSize( oDestSize ); - mSubTexture->offset( oOff ); + mSubTexture->setDestSize( oDestSize ); + mSubTexture->setOffset( oOff ); } else if ( mFlags & UI_AUTO_FIT ) { - mSubTexture->offset( Vector2i( 0, 0 ) ); + mSubTexture->setOffset( Vector2i( 0, 0 ) ); Float Scale1 = mSize.x / oDestSize.x; Float Scale2 = mSize.y / oDestSize.y; @@ -72,20 +72,20 @@ void UIGfx::draw() { if ( Scale2 < Scale1 ) Scale1 = Scale2; - mSubTexture->destSize( Sizef( oDestSize.x * Scale1, oDestSize.y * Scale1 ) ); + mSubTexture->setDestSize( Sizef( oDestSize.x * Scale1, oDestSize.y * Scale1 ) ); autoAlign(); drawSubTexture(); - mSubTexture->destSize( oDestSize ); + mSubTexture->setDestSize( oDestSize ); autoAlign(); } else { drawSubTexture(); } - mSubTexture->offset( oOff ); + mSubTexture->setOffset( oOff ); } else { autoAlign(); @@ -130,17 +130,17 @@ void UIGfx::autoAlign() { return; if ( HAlignGet( mFlags ) == UI_HALIGN_CENTER ) { - mAlignOffset.x = mSize.getWidth() / 2 - mSubTexture->destSize().x / 2; + mAlignOffset.x = mSize.getWidth() / 2 - mSubTexture->getDestSize().x / 2; } else if ( FontHAlignGet( mFlags ) == UI_HALIGN_RIGHT ) { - mAlignOffset.x = mSize.getWidth() - mSubTexture->destSize().x; + mAlignOffset.x = mSize.getWidth() - mSubTexture->getDestSize().x; } else { mAlignOffset.x = 0; } if ( VAlignGet( mFlags ) == UI_VALIGN_CENTER ) { - mAlignOffset.y = mSize.getHeight() / 2 - mSubTexture->destSize().y / 2; + mAlignOffset.y = mSize.getHeight() / 2 - mSubTexture->getDestSize().y / 2; } else if ( FontVAlignGet( mFlags ) == UI_VALIGN_BOTTOM ) { - mAlignOffset.y = mSize.getHeight() - mSubTexture->destSize().y; + mAlignOffset.y = mSize.getHeight() - mSubTexture->getDestSize().y; } else { mAlignOffset.y = 0; } diff --git a/src/eepp/ui/uiprogressbar.cpp b/src/eepp/ui/uiprogressbar.cpp index 7122da4c2..8261edbee 100644 --- a/src/eepp/ui/uiprogressbar.cpp +++ b/src/eepp/ui/uiprogressbar.cpp @@ -69,7 +69,7 @@ void UIProgressBar::setTheme( UITheme * Theme ) { Float Height = (Float)getSkinSize().getHeight(); if ( !mVerticalExpand ) - Height = (Float)tSubTexture->realSize().getHeight(); + Height = (Float)tSubTexture->getRealSize().getHeight(); if ( Height > mSize.getHeight() ) Height = mSize.getHeight(); @@ -92,7 +92,7 @@ void UIProgressBar::onSizeChange() { Float Height = (Float)mSize.getHeight(); if ( !mVerticalExpand && mParallax->getSubTexture() ) - Height = (Float)mParallax->getSubTexture()->realSize().getHeight(); + Height = (Float)mParallax->getSubTexture()->getRealSize().getHeight(); if ( Height > mSize.getHeight() ) Height = mSize.getHeight(); diff --git a/src/eepp/ui/uiradiobutton.cpp b/src/eepp/ui/uiradiobutton.cpp index ddc2f969a..22e6aca11 100644 --- a/src/eepp/ui/uiradiobutton.cpp +++ b/src/eepp/ui/uiradiobutton.cpp @@ -56,7 +56,7 @@ void UIRadioButton::setTheme( UITheme * Theme ) { tSubTexture = tSkin->getSubTexture( UISkinState::StateNormal ); if ( NULL != tSubTexture ) { - mActiveButton->size( tSubTexture->realSize() ); + mActiveButton->size( tSubTexture->getRealSize() ); mActiveButton->centerVertical(); } } @@ -67,7 +67,7 @@ void UIRadioButton::setTheme( UITheme * Theme ) { tSubTexture = tSkin->getSubTexture( UISkinState::StateNormal ); if ( NULL != tSubTexture ) { - mInactiveButton->size( tSubTexture->realSize() ); + mInactiveButton->size( tSubTexture->getRealSize() ); mInactiveButton->centerVertical(); } } diff --git a/src/eepp/ui/uiscrollbar.cpp b/src/eepp/ui/uiscrollbar.cpp index 7f9cf26fa..485d9bfa6 100644 --- a/src/eepp/ui/uiscrollbar.cpp +++ b/src/eepp/ui/uiscrollbar.cpp @@ -79,7 +79,7 @@ void UIScrollBar::setTheme( UITheme * Theme ) { tSubTexture = tSkin->getSubTexture( UISkinState::StateNormal ); if ( NULL != tSubTexture ) { - mBtnUp->size( tSubTexture->realSize() ); + mBtnUp->size( tSubTexture->getRealSize() ); } } @@ -89,7 +89,7 @@ void UIScrollBar::setTheme( UITheme * Theme ) { tSubTexture = tSkin->getSubTexture( UISkinState::StateNormal ); if ( NULL != tSubTexture ) { - mBtnDown->size( tSubTexture->realSize() ); + mBtnDown->size( tSubTexture->getRealSize() ); } } @@ -101,12 +101,12 @@ void UIScrollBar::setTheme( UITheme * Theme ) { if ( NULL != tSubTexture ) { if ( mSlider->isVertical() ) { - mSlider->size( tSubTexture->realSize().getWidth() , mSize.getHeight() ); - size( tSubTexture->realSize().getWidth() , mSize.getHeight() ); + mSlider->size( tSubTexture->getRealSize().getWidth() , mSize.getHeight() ); + size( tSubTexture->getRealSize().getWidth() , mSize.getHeight() ); mMinControlSize.x = mSize.getWidth(); } else { - mSlider->size( mSize.getWidth(), tSubTexture->realSize().getHeight() ); - size( mSize.getWidth(), tSubTexture->realSize().getHeight() ); + mSlider->size( mSize.getWidth(), tSubTexture->getRealSize().getHeight() ); + size( mSize.getWidth(), tSubTexture->getRealSize().getHeight() ); mMinControlSize.y = mSize.getHeight(); } } diff --git a/src/eepp/ui/uiseparator.cpp b/src/eepp/ui/uiseparator.cpp index 067830d03..ee8c2fbb9 100644 --- a/src/eepp/ui/uiseparator.cpp +++ b/src/eepp/ui/uiseparator.cpp @@ -24,7 +24,7 @@ void UISeparator::setTheme( UITheme * Theme ) { UIControl::setThemeControl( Theme, "separator" ); if ( NULL != mSkinState && NULL != mSkinState->getSkin() && NULL != mSkinState->getSkin()->getSubTexture( UISkinState::StateNormal ) ) { - size( mSize.getWidth(), mSkinState->getSkin()->getSubTexture( UISkinState::StateNormal )->realSize().getHeight() ); + size( mSize.getWidth(), mSkinState->getSkin()->getSubTexture( UISkinState::StateNormal )->getRealSize().getHeight() ); } } diff --git a/src/eepp/ui/uiskincomplex.cpp b/src/eepp/ui/uiskincomplex.cpp index 3852189f7..df0b8fb2a 100644 --- a/src/eepp/ui/uiskincomplex.cpp +++ b/src/eepp/ui/uiskincomplex.cpp @@ -41,7 +41,7 @@ void UISkinComplex::draw( const Float& X, const Float& Y, const Float& Width, co Sizei uls; if ( NULL != tSubTexture ) { - uls = tSubTexture->realSize(); + uls = tSubTexture->getRealSize(); tSubTexture->draw( X, Y, mTempColor ); } @@ -51,7 +51,7 @@ void UISkinComplex::draw( const Float& X, const Float& Y, const Float& Width, co Sizei dls; if ( NULL != tSubTexture ) { - dls = tSubTexture->realSize(); + dls = tSubTexture->getRealSize(); tSubTexture->draw( X, Y + Height - dls.getHeight(), mTempColor ); } @@ -61,7 +61,7 @@ void UISkinComplex::draw( const Float& X, const Float& Y, const Float& Width, co Sizei urs; if ( NULL != tSubTexture ) { - urs = tSubTexture->realSize(); + urs = tSubTexture->getRealSize(); tSubTexture->draw( X + Width - urs.getWidth(), Y, mTempColor ); } @@ -71,7 +71,7 @@ void UISkinComplex::draw( const Float& X, const Float& Y, const Float& Width, co Sizei drs; if ( NULL != tSubTexture ) { - drs = tSubTexture->realSize(); + drs = tSubTexture->getRealSize(); tSubTexture->draw( X + Width - drs.getWidth(), Y + Height - drs.getHeight(), mTempColor ); } @@ -79,41 +79,41 @@ void UISkinComplex::draw( const Float& X, const Float& Y, const Float& Width, co tSubTexture = mSubTexture[ State ][ Left ]; if ( NULL != tSubTexture ) { - tSubTexture->destSize( Sizef( tSubTexture->destSize().x, Height - uls.getHeight() - dls.getHeight() ) ); + tSubTexture->setDestSize( Sizef( tSubTexture->getDestSize().x, Height - uls.getHeight() - dls.getHeight() ) ); tSubTexture->draw( X, Y + uls.getHeight(), mTempColor ); tSubTexture->resetDestSize(); if ( uls.getWidth() == 0 ) - uls.x = tSubTexture->realSize().getWidth(); + uls.x = tSubTexture->getRealSize().getWidth(); } tSubTexture = mSubTexture[ State ][ Up ]; if ( NULL != tSubTexture ) { - tSubTexture->destSize( Sizef( Width - uls.getWidth() - urs.getWidth(), tSubTexture->destSize().y ) ); + tSubTexture->setDestSize( Sizef( Width - uls.getWidth() - urs.getWidth(), tSubTexture->getDestSize().y ) ); tSubTexture->draw( X + uls.getWidth(), Y, mTempColor ); tSubTexture->resetDestSize(); if ( urs.getHeight() == 0 ) - urs.y = tSubTexture->realSize().getHeight(); + urs.y = tSubTexture->getRealSize().getHeight(); if ( uls.getHeight() == 0 ) - uls.y = tSubTexture->realSize().getHeight(); + uls.y = tSubTexture->getRealSize().getHeight(); } tSubTexture = mSubTexture[ State ][ Right ]; if ( NULL != tSubTexture ) { if ( urs.getWidth() == 0 ) - urs.x = tSubTexture->realSize().getWidth(); + urs.x = tSubTexture->getRealSize().getWidth(); - tSubTexture->destSize( Sizef( tSubTexture->destSize().x, Height - urs.getHeight() - drs.getHeight() ) ); + tSubTexture->setDestSize( Sizef( tSubTexture->getDestSize().x, Height - urs.getHeight() - drs.getHeight() ) ); - tSubTexture->draw( X + Width - tSubTexture->realSize().getWidth(), Y + urs.getHeight(), mTempColor ); + tSubTexture->draw( X + Width - tSubTexture->getRealSize().getWidth(), Y + urs.getHeight(), mTempColor ); tSubTexture->resetDestSize(); } @@ -121,20 +121,20 @@ void UISkinComplex::draw( const Float& X, const Float& Y, const Float& Width, co tSubTexture = mSubTexture[ State ][ Down ]; if ( NULL != tSubTexture ) { - tSubTexture->destSize( Sizef( Width - dls.getWidth() - drs.getWidth(), tSubTexture->destSize().y ) ); + tSubTexture->setDestSize( Sizef( Width - dls.getWidth() - drs.getWidth(), tSubTexture->getDestSize().y ) ); - tSubTexture->draw( X + dls.getWidth(), Y + Height - tSubTexture->realSize().getHeight(), mTempColor ); + tSubTexture->draw( X + dls.getWidth(), Y + Height - tSubTexture->getRealSize().getHeight(), mTempColor ); tSubTexture->resetDestSize(); if ( dls.getHeight() == 0 && drs.getHeight() == 0 ) - dls.setHeight( tSubTexture->realSize().getHeight() ); + dls.setHeight( tSubTexture->getRealSize().getHeight() ); } tSubTexture = mSubTexture[ State ][ Center ]; if ( NULL != tSubTexture ) { - tSubTexture->destSize( Sizef( Width - uls.getWidth() - urs.getWidth(), Height - uls.getHeight() - dls.getHeight() ) ); + tSubTexture->setDestSize( Sizef( Width - uls.getWidth() - urs.getWidth(), Height - uls.getHeight() - dls.getHeight() ) ); tSubTexture->draw( X + uls.getWidth(), Y + uls.getHeight(), mTempColor ); diff --git a/src/eepp/ui/uiskinsimple.cpp b/src/eepp/ui/uiskinsimple.cpp index d8c0a1b63..2537a9b14 100644 --- a/src/eepp/ui/uiskinsimple.cpp +++ b/src/eepp/ui/uiskinsimple.cpp @@ -23,7 +23,7 @@ void UISkinSimple::draw( const Float& X, const Float& Y, const Float& Width, con mTempColor = mColor[ State ]; if ( NULL != tSubTexture ) { - tSubTexture->destSize( Sizef( Width, Height ) ); + tSubTexture->setDestSize( Sizef( Width, Height ) ); if ( mTempColor.Alpha != Alpha ) { mTempColor.Alpha = (Uint8)( (Float)mTempColor.Alpha * ( (Float)Alpha / 255.f ) ); diff --git a/src/eepp/ui/uislider.cpp b/src/eepp/ui/uislider.cpp index 6b2a38876..bcf5235b5 100644 --- a/src/eepp/ui/uislider.cpp +++ b/src/eepp/ui/uislider.cpp @@ -92,7 +92,7 @@ void UISlider::adjustChilds() { tSubTexture = tSkin->getSubTexture( UISkinState::StateNormal ); if ( NULL != tSubTexture ) { - mSlider->size( tSubTexture->realSize() ); + mSlider->size( tSubTexture->getRealSize() ); if ( !mVertical ) mSlider->centerVertical(); @@ -113,7 +113,7 @@ void UISlider::adjustChilds() { if ( mExpandBackground ) Height = mSize.getHeight(); else - Height = tSubTexture->realSize().getHeight(); + Height = tSubTexture->getRealSize().getHeight(); if ( mAllowHalfSliderOut ) mBackSlider->size( Sizei( mSize.getWidth() - mSlider->size().getWidth(), Height ) ); @@ -125,7 +125,7 @@ void UISlider::adjustChilds() { if ( mExpandBackground ) Width = mSize.getWidth(); else - Width = tSubTexture->realSize().getWidth(); + Width = tSubTexture->getRealSize().getWidth(); if ( mAllowHalfSliderOut ) mBackSlider->size( Sizei( Width, mSize.getHeight() - mSlider->size().getHeight() ) ); diff --git a/src/eepp/ui/uispinbox.cpp b/src/eepp/ui/uispinbox.cpp index fb7de8de4..4810093d5 100644 --- a/src/eepp/ui/uispinbox.cpp +++ b/src/eepp/ui/uispinbox.cpp @@ -77,7 +77,7 @@ void UISpinBox::setTheme( UITheme * Theme ) { tSubTexture = tSkin->getSubTexture( UISkinState::StateNormal ); if ( NULL != tSubTexture ) { - mPushUp->size( tSubTexture->realSize() ); + mPushUp->size( tSubTexture->getRealSize() ); } } @@ -87,7 +87,7 @@ void UISpinBox::setTheme( UITheme * Theme ) { tSubTexture = tSkin->getSubTexture( UISkinState::StateNormal ); if ( NULL != tSubTexture ) { - mPushDown->size( tSubTexture->realSize() ); + mPushDown->size( tSubTexture->getRealSize() ); } } diff --git a/src/eepp/ui/uisprite.cpp b/src/eepp/ui/uisprite.cpp index f39e09901..5eb4ee560 100644 --- a/src/eepp/ui/uisprite.cpp +++ b/src/eepp/ui/uisprite.cpp @@ -15,7 +15,7 @@ UISprite::UISprite( const UISprite::CreateParams& Params ) : if ( ( flags() & UI_AUTO_SIZE ) || ( Params.Size.x == -1 && Params.Size.y == -1 ) ) { if ( NULL != mSprite && NULL != mSprite->getCurrentSubTexture() ) { - size( mSprite->getCurrentSubTexture()->size() ); + size( mSprite->getCurrentSubTexture()->getSize() ); } } } @@ -102,8 +102,8 @@ void UISprite::renderMode( const EE_RENDER_MODE& render ) { void UISprite::updateSize() { if ( flags() & UI_AUTO_SIZE ) { if ( NULL != mSprite ) { - if ( NULL != mSprite->getCurrentSubTexture() && mSprite->getCurrentSubTexture()->size() != mSize ) - size( mSprite->getCurrentSubTexture()->size() ); + if ( NULL != mSprite->getCurrentSubTexture() && mSprite->getCurrentSubTexture()->getSize() != mSize ) + size( mSprite->getCurrentSubTexture()->getSize() ); } } } @@ -115,17 +115,17 @@ void UISprite::autoAlign() { SubTexture * tSubTexture = mSprite->getCurrentSubTexture(); if ( HAlignGet( mFlags ) == UI_HALIGN_CENTER ) { - mAlignOffset.x = mSize.getWidth() / 2 - tSubTexture->size().getWidth() / 2; + mAlignOffset.x = mSize.getWidth() / 2 - tSubTexture->getSize().getWidth() / 2; } else if ( FontHAlignGet( mFlags ) == UI_HALIGN_RIGHT ) { - mAlignOffset.x = mSize.getWidth() - tSubTexture->size().getWidth(); + mAlignOffset.x = mSize.getWidth() - tSubTexture->getSize().getWidth(); } else { mAlignOffset.x = 0; } if ( VAlignGet( mFlags ) == UI_VALIGN_CENTER ) { - mAlignOffset.y = mSize.getHeight() / 2 - tSubTexture->size().getHeight() / 2; + mAlignOffset.y = mSize.getHeight() / 2 - tSubTexture->getSize().getHeight() / 2; } else if ( FontVAlignGet( mFlags ) == UI_VALIGN_BOTTOM ) { - mAlignOffset.y = mSize.getHeight() - tSubTexture->size().getHeight(); + mAlignOffset.y = mSize.getHeight() - tSubTexture->getSize().getHeight(); } else { mAlignOffset.y = 0; } diff --git a/src/eepp/ui/uitextbox.cpp b/src/eepp/ui/uitextbox.cpp index b839ca316..3b3366ff7 100644 --- a/src/eepp/ui/uitextbox.cpp +++ b/src/eepp/ui/uitextbox.cpp @@ -18,13 +18,13 @@ UITextBox::UITextBox( const UITextBox::CreateParams& Params ) : mSelCurEnd( -1 ) { mTextCache = eeNew( TextCache, () ); - mTextCache->font( Params.Font ); - mTextCache->color( mFontColor ); - mTextCache->shadowColor( mFontShadowColor ); + mTextCache->setFont( Params.Font ); + mTextCache->setColor( mFontColor ); + mTextCache->setShadowColor( mFontShadowColor ); if ( NULL == Params.Font ) { if ( NULL != UIThemeManager::instance()->defaultFont() ) - mTextCache->font( UIThemeManager::instance()->defaultFont() ); + mTextCache->setFont( UIThemeManager::instance()->defaultFont() ); else eePRINTL( "UITextBox::UITextBox : Created a UI TextBox without a defined font." ); } @@ -60,7 +60,7 @@ void UITextBox::draw() { ); } - mTextCache->flags( flags() ); + mTextCache->setFlags( flags() ); mTextCache->draw( (Float)mScreenPos.x + mAlignOffset.x + (Float)mPadding.Left, (Float)mScreenPos.y + mAlignOffset.y + (Float)mPadding.Top, Vector2f::One, 0.f, blend() ); if ( mFlags & UI_CLIP_ENABLE ) { @@ -71,12 +71,12 @@ void UITextBox::draw() { } Graphics::Font * UITextBox::font() const { - return mTextCache->font(); + return mTextCache->getFont(); } void UITextBox::font( Graphics::Font * font ) { - if ( mTextCache->font() != font ) { - mTextCache->font( font ); + if ( mTextCache->getFont() != font ) { + mTextCache->setFont( font ); autoShrink(); autoSize(); autoAlign(); @@ -88,15 +88,15 @@ const String& UITextBox::text() { if ( mFlags & UI_AUTO_SHRINK_TEXT ) return mString; - return mTextCache->text(); + return mTextCache->getText(); } void UITextBox::text( const String& text ) { if ( mFlags & UI_AUTO_SHRINK_TEXT ) { mString = text; - mTextCache->text( mString ); + mTextCache->setText( mString ); } else { - mTextCache->text( text ); + mTextCache->setText( text ); } autoShrink(); @@ -111,7 +111,7 @@ const ColorA& UITextBox::color() const { void UITextBox::color( const ColorA& color ) { mFontColor = color; - mTextCache->color( color ); + mTextCache->setColor( color ); alpha( color.a() ); } @@ -122,7 +122,7 @@ const ColorA& UITextBox::shadowColor() const { void UITextBox::shadowColor( const ColorA& color ) { mFontShadowColor = color; - mTextCache->shadowColor( mFontColor ); + mTextCache->setShadowColor( mFontColor ); } const ColorA& UITextBox::selectionBackColor() const { @@ -138,7 +138,7 @@ void UITextBox::alpha( const Float& alpha ) { mFontColor.Alpha = (Uint8)alpha; mFontShadowColor.Alpha = (Uint8)alpha; - mTextCache->alpha( mFontColor.Alpha ); + mTextCache->setAlpha( mFontColor.Alpha ); } void UITextBox::autoShrink() { @@ -149,10 +149,10 @@ void UITextBox::autoShrink() { void UITextBox::shrinkText( const Uint32& MaxWidth ) { if ( mFlags & UI_AUTO_SHRINK_TEXT ) { - mTextCache->text( mString ); + mTextCache->setText( mString ); } - mTextCache->font()->shrinkText( mTextCache->text(), MaxWidth ); + mTextCache->getFont()->shrinkText( mTextCache->getText(), MaxWidth ); } void UITextBox::autoSize() { @@ -202,7 +202,7 @@ void UITextBox::onSizeChange() { UIControlAnim::onSizeChange(); - mTextCache->cache(); + mTextCache->cacheWidth(); } void UITextBox::onTextChanged() { @@ -224,8 +224,8 @@ const Recti& UITextBox::padding() const { void UITextBox::setTheme( UITheme * Theme ) { UIControlAnim::setTheme( Theme ); - if ( NULL == mTextCache->font() && NULL != Theme->font() ) { - mTextCache->font( Theme->font() ); + if ( NULL == mTextCache->getFont() && NULL != Theme->font() ) { + mTextCache->setFont( Theme->font() ); } } @@ -254,12 +254,12 @@ Uint32 UITextBox::onMouseDoubleClick( const Vector2i& Pos, const Uint32 Flags ) Vector2i controlPos( Pos ); worldToControl( controlPos ); - Int32 curPos = mTextCache->font()->findClosestCursorPosFromPoint( mTextCache->text(), controlPos ); + Int32 curPos = mTextCache->getFont()->findClosestCursorPosFromPoint( mTextCache->getText(), controlPos ); if ( -1 != curPos ) { Int32 tSelCurInit, tSelCurEnd; - mTextCache->font()->selectSubStringFromCursor( mTextCache->text(), curPos, tSelCurInit, tSelCurEnd ); + mTextCache->getFont()->selectSubStringFromCursor( mTextCache->getText(), curPos, tSelCurInit, tSelCurEnd ); selCurInit( tSelCurInit ); selCurEnd( tSelCurEnd ); @@ -289,7 +289,7 @@ Uint32 UITextBox::onMouseDown( const Vector2i& Pos, const Uint32 Flags ) { Vector2i controlPos( Pos ); worldToControl( controlPos ); - Int32 curPos = mTextCache->font()->findClosestCursorPosFromPoint( mTextCache->text(), controlPos ); + Int32 curPos = mTextCache->getFont()->findClosestCursorPosFromPoint( mTextCache->getText(), controlPos ); if ( -1 != curPos ) { if ( -1 == selCurInit() || !( mControlFlags & UI_CTRL_FLAG_SELECTING ) ) { @@ -311,7 +311,7 @@ void UITextBox::drawSelection() { Int32 init = eemin( selCurInit(), selCurEnd() ); Int32 end = eemax( selCurInit(), selCurEnd() ); - if ( init < 0 && end > (Int32)mTextCache->text().size() ) { + if ( init < 0 && end > (Int32)mTextCache->getText().size() ) { return; } @@ -322,19 +322,19 @@ void UITextBox::drawSelection() { P.setColor( mFontSelectionBackColor ); do { - initPos = mTextCache->font()->getCursorPos( mTextCache->text(), init ); - lastEnd = mTextCache->text().find_first_of( '\n', init ); + initPos = mTextCache->getFont()->getCursorPos( mTextCache->getText(), init ); + lastEnd = mTextCache->getText().find_first_of( '\n', init ); if ( lastEnd < end && -1 != lastEnd ) { - endPos = mTextCache->font()->getCursorPos( mTextCache->text(), lastEnd ); + endPos = mTextCache->getFont()->getCursorPos( mTextCache->getText(), lastEnd ); init = lastEnd + 1; } else { - endPos = mTextCache->font()->getCursorPos( mTextCache->text(), end ); + endPos = mTextCache->getFont()->getCursorPos( mTextCache->getText(), end ); lastEnd = end; } P.drawRectangle( Rectf( mScreenPos.x + initPos.x + mAlignOffset.x + mPadding.Left, - mScreenPos.y + initPos.y - mTextCache->font()->getFontHeight() + mAlignOffset.y + mPadding.Top, + mScreenPos.y + initPos.y - mTextCache->getFont()->getFontHeight() + mAlignOffset.y + mPadding.Top, mScreenPos.x + endPos.x + mAlignOffset.x + mPadding.Left, mScreenPos.y + endPos.y + mAlignOffset.y + mPadding.Top ) ); diff --git a/src/eepp/ui/uitextedit.cpp b/src/eepp/ui/uitextedit.cpp index a554ab516..8ab1d39bc 100644 --- a/src/eepp/ui/uitextedit.cpp +++ b/src/eepp/ui/uitextedit.cpp @@ -341,7 +341,7 @@ void UITextEdit::fixScrollToCursor() { Uint32 NLPos = 0; Uint32 LineNum = mTextInput->getInputTextBuffer()->getCurPosLinePos( NLPos ); - mTextInput->getTextCache()->font()->setText( + mTextInput->getTextCache()->getFont()->setText( mTextInput->getInputTextBuffer()->getBuffer().substr( NLPos, mTextInput->getInputTextBuffer()->getCursorPos() - NLPos ) @@ -349,8 +349,8 @@ void UITextEdit::fixScrollToCursor() { mSkipValueChange = true; - Float tW = mTextInput->getTextCache()->font()->getTextWidth(); - Float tH = (Float)(LineNum + 1) * (Float)mTextInput->getTextCache()->font()->getFontHeight(); + Float tW = mTextInput->getTextCache()->getFont()->getTextWidth(); + Float tH = (Float)(LineNum + 1) * (Float)mTextInput->getTextCache()->getFont()->getFontHeight(); if ( tW > Width ) { mTextInput->position( mPadding.Left + Width - tW, mTextInput->position().y ); diff --git a/src/eepp/ui/uitextinput.cpp b/src/eepp/ui/uitextinput.cpp index 7b244f993..608b6397a 100644 --- a/src/eepp/ui/uitextinput.cpp +++ b/src/eepp/ui/uitextinput.cpp @@ -92,7 +92,7 @@ void UITextInput::drawWaitingCursor() { if ( CurPosX > (Float)mScreenPos.x + (Float)mSize.x ) CurPosX = (Float)mScreenPos.x + (Float)mSize.x; - P.drawLine( Line2f( Vector2f( CurPosX, CurPosY ), Vector2f( CurPosX, CurPosY + mTextCache->font()->getFontHeight() ) ) ); + P.drawLine( Line2f( Vector2f( CurPosX, CurPosY ), Vector2f( CurPosX, CurPosY + mTextCache->getFont()->getFontHeight() ) ) ); if ( disableSmooth ) GLi->lineSmooth( true ); @@ -151,13 +151,13 @@ void UITextInput::alignFix() { Uint32 NLPos = 0; Uint32 LineNum = mTextBuffer.getCurPosLinePos( NLPos ); - mTextCache->font()->setText( mTextBuffer.getBuffer().substr( NLPos, mTextBuffer.getCursorPos() - NLPos ) ); + mTextCache->getFont()->setText( mTextBuffer.getBuffer().substr( NLPos, mTextBuffer.getCursorPos() - NLPos ) ); - Float tW = mTextCache->font()->getTextWidth(); + Float tW = mTextCache->getFont()->getTextWidth(); Float tX = mAlignOffset.x + tW; mCurPos.x = tW; - mCurPos.y = (Float)LineNum * (Float)mTextCache->font()->getFontHeight(); + mCurPos.y = (Float)LineNum * (Float)mTextCache->getFont()->getFontHeight(); if ( !mTextBuffer.setSupportNewLine() ) { if ( tX < 0.f ) @@ -215,11 +215,11 @@ const String& UITextInput::text() { } void UITextInput::shrinkText( const Uint32& MaxWidth ) { - mTextCache->text( mTextBuffer.getBuffer() ); + mTextCache->setText( mTextBuffer.getBuffer() ); UITextBox::shrinkText( MaxWidth ); - mTextBuffer.setBuffer( mTextCache->text() ); + mTextBuffer.setBuffer( mTextCache->getText() ); alignFix(); } @@ -232,7 +232,7 @@ Uint32 UITextInput::onMouseClick( const Vector2i& Pos, const Uint32 Flags ) { Vector2i controlPos( Pos ); worldToControl( controlPos ); - Int32 curPos = mTextCache->font()->findClosestCursorPosFromPoint( mTextCache->text(), controlPos ); + Int32 curPos = mTextCache->getFont()->findClosestCursorPosFromPoint( mTextCache->getText(), controlPos ); if ( -1 != curPos ) { mTextBuffer.setCursorPos( curPos ); diff --git a/src/eepp/ui/uitextinputpassword.cpp b/src/eepp/ui/uitextinputpassword.cpp index a0cd28e30..52a1bd882 100644 --- a/src/eepp/ui/uitextinputpassword.cpp +++ b/src/eepp/ui/uitextinputpassword.cpp @@ -10,13 +10,13 @@ UITextInputPassword::UITextInputPassword( const UITextInput::CreateParams& Param UITextInput( Params ) { mPassCache = eeNew( TextCache, () ); - mPassCache->font( Params.Font ); - mPassCache->color( mFontColor ); - mPassCache->shadowColor( mFontShadowColor ); + mPassCache->setFont( Params.Font ); + mPassCache->setColor( mFontColor ); + mPassCache->setShadowColor( mFontShadowColor ); if ( NULL == Params.Font ) { if ( NULL != UIThemeManager::instance()->defaultFont() ) - mPassCache->font( UIThemeManager::instance()->defaultFont() ); + mPassCache->setFont( UIThemeManager::instance()->defaultFont() ); else eePRINTL( "UITextInputPassword::UITextInputPassword : Created a UI TextInputPassword without a defined font." ); } @@ -38,7 +38,7 @@ void UITextInputPassword::draw() { ); } - mPassCache->flags( flags() ); + mPassCache->setFlags( flags() ); mPassCache->draw( (Float)mScreenPos.x + mAlignOffset.x + (Float)mPadding.Left, (Float)mScreenPos.y + mAlignOffset.y + (Float)mPadding.Top, Vector2f::One, 0.f, blend() ); if ( mFlags & UI_CLIP_ENABLE ) { @@ -61,13 +61,13 @@ void UITextInputPassword::alignFix() { for ( size_t i = 0; i < curStr.size(); i++ ) pasStr += '*'; - mPassCache->font()->setText( pasStr ); + mPassCache->getFont()->setText( pasStr ); - Float tW = mPassCache->font()->getTextWidth(); + Float tW = mPassCache->getFont()->getTextWidth(); Float tX = mAlignOffset.x + tW; mCurPos.x = tW; - mCurPos.y = (Float)LineNum * (Float)mPassCache->font()->getFontHeight(); + mCurPos.y = (Float)LineNum * (Float)mPassCache->getFont()->getFontHeight(); if ( !mTextBuffer.setSupportNewLine() ) { if ( tX < 0.f ) @@ -105,11 +105,11 @@ void UITextInputPassword::autoAlign() { } void UITextInputPassword::updateText() { - updatePass( mTextCache->text() ); + updatePass( mTextCache->getText() ); } void UITextInputPassword::updatePass( const String& pass ) { - mPassCache->text().clear(); + mPassCache->getText().clear(); String newTxt; @@ -117,7 +117,7 @@ void UITextInputPassword::updatePass( const String& pass ) { newTxt += '*'; } - mPassCache->text( newTxt ); + mPassCache->setText( newTxt ); } void UITextInputPassword::text( const String& text ) { diff --git a/src/eepp/ui/uitheme.cpp b/src/eepp/ui/uitheme.cpp index 8dbff7199..f0c6290d5 100644 --- a/src/eepp/ui/uitheme.cpp +++ b/src/eepp/ui/uitheme.cpp @@ -127,7 +127,7 @@ UITheme * UITheme::loadFromTextureAtlas( UITheme * tTheme, Graphics::TextureAtla /** Themes use nearest filter by default, force the filter to the textures. */ for ( Uint32 tC = 0; tC < TextureAtlas->getTexturesCount(); tC++ ) { - TextureAtlas->getTexture( tC )->filter( TEX_FILTER_NEAREST ); + TextureAtlas->getTexture( tC )->setFilter( TEX_FILTER_NEAREST ); } Clock TE; diff --git a/src/eepp/ui/uitooltip.cpp b/src/eepp/ui/uitooltip.cpp index 59bb6140b..e932c57f6 100644 --- a/src/eepp/ui/uitooltip.cpp +++ b/src/eepp/ui/uitooltip.cpp @@ -15,13 +15,13 @@ UITooltip::UITooltip( UITooltip::CreateParams& Params, UIControl * TooltipOf ) : mTooltipOf( TooltipOf ) { mTextCache = eeNew( TextCache, () ); - mTextCache->font( Params.Font ); - mTextCache->color( mFontColor ); - mTextCache->shadowColor( mFontShadowColor ); + mTextCache->setFont( Params.Font ); + mTextCache->setColor( mFontColor ); + mTextCache->setShadowColor( mFontShadowColor ); if ( NULL == Params.Font ) { if ( NULL != UIThemeManager::instance()->defaultFont() ) - mTextCache->font( UIThemeManager::instance()->defaultFont() ); + mTextCache->setFont( UIThemeManager::instance()->defaultFont() ); else eePRINTL( "UITooltip::UITextBox : Created a UI TextBox without a defined font." ); } @@ -55,8 +55,8 @@ void UITooltip::setTheme( UITheme * Theme ) { autoPadding(); - if ( NULL == mTextCache->font() && NULL != Theme->font() ) { - mTextCache->font( Theme->font() ); + if ( NULL == mTextCache->getFont() && NULL != Theme->font() ) { + mTextCache->setFont( Theme->font() ); } } @@ -93,19 +93,19 @@ void UITooltip::draw() { UIControlAnim::draw(); if ( mTextCache->getTextWidth() ) { - mTextCache->flags( flags() ); + mTextCache->setFlags( flags() ); mTextCache->draw( (Float)mScreenPos.x + mAlignOffset.x, (Float)mScreenPos.y + mAlignOffset.y, Vector2f::One, 0.f, blend() ); } } } Graphics::Font * UITooltip::font() const { - return mTextCache->font(); + return mTextCache->getFont(); } void UITooltip::font( Graphics::Font * font ) { - if ( mTextCache->font() != font ) { - mTextCache->font( font ); + if ( mTextCache->getFont() != font ) { + mTextCache->setFont( font ); autoPadding(); autoSize(); autoAlign(); @@ -114,11 +114,11 @@ void UITooltip::font( Graphics::Font * font ) { } const String& UITooltip::text() { - return mTextCache->text(); + return mTextCache->getText(); } void UITooltip::text( const String& text ) { - mTextCache->text( text ); + mTextCache->setText( text ); autoPadding(); autoSize(); autoAlign(); @@ -141,7 +141,7 @@ const ColorA& UITooltip::shadowColor() const { void UITooltip::shadowColor( const ColorA& color ) { mFontShadowColor = color; alpha( color.a() ); - mTextCache->shadowColor( mFontColor ); + mTextCache->setShadowColor( mFontColor ); } void UITooltip::alpha( const Float& alpha ) { @@ -149,7 +149,7 @@ void UITooltip::alpha( const Float& alpha ) { mFontColor.Alpha = (Uint8)alpha; mFontShadowColor.Alpha = (Uint8)alpha; - mTextCache->color( mFontColor ); + mTextCache->setColor( mFontColor ); } void UITooltip::autoSize() { @@ -195,7 +195,7 @@ void UITooltip::onSizeChange() { UIControlAnim::onSizeChange(); - mTextCache->cache(); + mTextCache->cacheWidth(); } void UITooltip::onTextChanged() { diff --git a/src/eepp/ui/uiwinmenu.cpp b/src/eepp/ui/uiwinmenu.cpp index b879be5c3..701243060 100644 --- a/src/eepp/ui/uiwinmenu.cpp +++ b/src/eepp/ui/uiwinmenu.cpp @@ -78,7 +78,7 @@ void UIWinMenu::setTheme( UITheme * Theme ) { } if ( 0 == mMenuHeight && NULL != getSkin() && NULL != getSkin()->getSubTexture( UISkinState::StateNormal ) ) { - mMenuHeight = getSkin()->getSubTexture( UISkinState::StateNormal )->size().getHeight(); + mMenuHeight = getSkin()->getSubTexture( UISkinState::StateNormal )->getSize().getHeight(); size( parent()->size().getWidth(), mMenuHeight ); @@ -126,7 +126,7 @@ void UIWinMenu::refreshButtons() { SubTexture * subTexture = getSkin()->getSubTexture( UISkinState::StateNormal ); if ( NULL != subTexture ) { - h = subTexture->size().getHeight(); + h = subTexture->getSize().getHeight(); if ( mButtons.begin() != mButtons.end() ) { UISelectButton * tbut = mButtons.begin()->first; @@ -135,7 +135,7 @@ void UIWinMenu::refreshButtons() { SubTexture * tSubTexture2 = tbut->getSkin()->getSubTexture( UISkinState::StateSelected ); if ( NULL != tSubTexture2 ) { - th = tSubTexture2->size().getHeight(); + th = tSubTexture2->getSize().getHeight(); switch ( VAlignGet( flags() ) ) { case UI_VALIGN_CENTER: diff --git a/src/examples/fonts/fonts.cpp b/src/examples/fonts/fonts.cpp index 1ee842409..a2b7f568e 100644 --- a/src/examples/fonts/fonts.cpp +++ b/src/examples/fonts/fonts.cpp @@ -112,15 +112,15 @@ EE_MAIN_FUNC int main (int argc, char * argv []) TxtCache = eeNew( TextCache, ( TTF2, Txt, ColorA(0,0,0,255) ) ); // Set the text cache to be centered - TxtCache->flags( FONT_DRAW_CENTER ); + TxtCache->setFlags( FONT_DRAW_CENTER ); // Set the font color to a substring of the text // To be able to set the color of the font, create the font as white // Create a gradient - size_t size = TxtCache->text().size(); + size_t size = TxtCache->getText().size(); for ( size_t i = 0; i < size; i++ ) { - TxtCache->color( ColorA(255*i/size,0,0,255), i, i+1 ); + TxtCache->setColor( ColorA(255*i/size,0,0,255), i, i+1 ); } // Application loop diff --git a/src/test/eetest.cpp b/src/test/eetest.cpp index f90f61016..2805f1ece 100644 --- a/src/test/eetest.cpp +++ b/src/test/eetest.cpp @@ -198,8 +198,8 @@ void EETest::OnFontLoaded( ResourceLoader * ObjLoaded ) { mEEText.create( TTFB, "Entropia Engine++\nCTRL + Number to change Demo Screen\nRight click to see the PopUp Menu" ); mFBOText.create( TTFB, "This is a VBO\nInside of a FBO" ); - mFBOText.color( ColorA(255,255,0,255), mFBOText.text().find( "VBO" ), mFBOText.text().find( "VBO" ) + 2 ); - mFBOText.color( ColorA(255,255,0,255), mFBOText.text().find( "FBO" ), mFBOText.text().find( "FBO" ) + 2 ); + mFBOText.setColor( ColorA(255,255,0,255), mFBOText.getText().find( "VBO" ), mFBOText.getText().find( "VBO" ) + 2 ); + mFBOText.setColor( ColorA(255,255,0,255), mFBOText.getText().find( "FBO" ), mFBOText.getText().find( "FBO" ) + 2 ); mInfoText.create( FF, "", ColorA(255,255,255,150) ); } @@ -1165,7 +1165,7 @@ void EETest::Screen4() { mVBO->draw(); mVBO->unbind(); - mFBOText.flags( FONT_DRAW_CENTER ); + mFBOText.setFlags( FONT_DRAW_CENTER ); mFBOText.draw( 128.f - (Float)(Int32)( mFBOText.getTextWidth() * 0.5f ), 25.f - (Float)(Int32)( mFBOText.getTextHeight() * 0.5f ) ); } @@ -1195,7 +1195,7 @@ void EETest::Render() { et.asMilliseconds(), (Int32)Mouse.x, (Int32)Mouse.y, - FileSystem::sizeToString( TF->memorySize() ).c_str(), + FileSystem::sizeToString( TF->getTextureMemorySize() ).c_str(), FileSystem::sizeToString( (Uint32)MemoryManager::getTotalMemoryUsage() ).c_str(), FileSystem::sizeToString( (Uint32)MemoryManager::getPeakMemoryUsage() ).c_str() ); @@ -1209,7 +1209,7 @@ void EETest::Render() { ); #endif - mInfoText.text( mInfo ); + mInfoText.setText( mInfo ); } if ( !MultiViewportMode ) { @@ -1239,7 +1239,7 @@ void EETest::Render() { ColorA ColRR2( 100, 100, 100, 220 ); ColorA ColRR3( 100, 100, 100, 220 ); - mEEText.flags( FONT_DRAW_CENTER ); + mEEText.setFlags( FONT_DRAW_CENTER ); PR.setColor( ColorA(150, 150, 150, 220) ); PR.setFillMode( DRAW_FILL );