diff --git a/include/eepp/graphics/font.hpp b/include/eepp/graphics/font.hpp index 428daa81b..4ba7fdab0 100755 --- a/include/eepp/graphics/font.hpp +++ b/include/eepp/graphics/font.hpp @@ -13,7 +13,7 @@ class EE_API Glyph { Float advance; ///< Offset to move horizontally to the next character Rectf bounds; ///< Bounding rectangle of the glyph, in coordinates relative to the baseline - Recti textureRect; ///< Texture coordinates of the glyph inside the font's texture + Rect textureRect; ///< Texture coordinates of the glyph inside the font's texture }; /** @brief Font interface class. */ diff --git a/include/eepp/graphics/fonttruetype.hpp b/include/eepp/graphics/fonttruetype.hpp index a8b592d61..1dc0cc92f 100644 --- a/include/eepp/graphics/fonttruetype.hpp +++ b/include/eepp/graphics/fonttruetype.hpp @@ -73,7 +73,7 @@ class EE_API FontTrueType : public Font { Glyph loadGlyph(Uint32 codePoint, unsigned int characterSize, bool bold, Float outlineThickness) const; - Recti findGlyphRect(Page& page, unsigned int width, unsigned int height) const; + Rect findGlyphRect(Page& page, unsigned int width, unsigned int height) const; bool setCurrentSize(unsigned int characterSize) const; diff --git a/include/eepp/graphics/image.hpp b/include/eepp/graphics/image.hpp index e597878b6..bb32448fd 100644 --- a/include/eepp/graphics/image.hpp +++ b/include/eepp/graphics/image.hpp @@ -157,7 +157,7 @@ class EE_API Image { Graphics::Image * thumbnail( const Uint32& maxWidth, const Uint32& maxHeight, EE_RESAMPLER_FILTER filter = RESAMPLER_LANCZOS4 ); /** Creates a cropped image from the current image */ - Graphics::Image * crop( Recti rect ); + Graphics::Image * crop( Rect rect ); /** Set as true if you dont want to free the image data in the Image destruction ( false as default ). */ void avoidFreeImage( const bool& AvoidFree ); diff --git a/include/eepp/graphics/pixeldensity.hpp b/include/eepp/graphics/pixeldensity.hpp index 96ae5bf7e..3b73522a5 100644 --- a/include/eepp/graphics/pixeldensity.hpp +++ b/include/eepp/graphics/pixeldensity.hpp @@ -55,9 +55,9 @@ class EE_API PixelDensity { static Sizei pxToDpI( Sizei size ); - static Recti dpToPxI( Recti size); + static Rect dpToPxI( Rect size); - static Recti pxToDpI( Recti size ); + static Rect pxToDpI( Rect size ); static Rectf dpToPx( Rectf size); diff --git a/include/eepp/graphics/scrollparallax.hpp b/include/eepp/graphics/scrollparallax.hpp index 50e87cff8..cee861f60 100755 --- a/include/eepp/graphics/scrollparallax.hpp +++ b/include/eepp/graphics/scrollparallax.hpp @@ -84,7 +84,7 @@ class EE_API ScrollParallax { Vector2f mPos; Vector2f mSpeed; Sizef mSize; - Recti mRect; + Rect mRect; Clock mElapsed; Vector2i mTiles; Rectf mAABB; diff --git a/include/eepp/graphics/sprite.hpp b/include/eepp/graphics/sprite.hpp index 981b811c1..37d84f5ed 100755 --- a/include/eepp/graphics/sprite.hpp +++ b/include/eepp/graphics/sprite.hpp @@ -45,7 +45,7 @@ class EE_API Sprite : public Drawable { * @param Offset The offset added to the position of the frame ( the SubTexture ) * @param TexSector The sector of the texture used by the SubTexture to be rendered */ - Sprite( const Uint32& TexId, const Sizef &DestSize = Sizef(0,0), const Vector2i &offset = Vector2i(0,0), const Recti& TexSector = Recti(0,0,0,0) ); + Sprite( const Uint32& TexId, const Sizef &DestSize = Sizef(0,0), const Vector2i &offset = Vector2i(0,0), const Rect& TexSector = Rect(0,0,0,0) ); virtual ~Sprite(); @@ -148,7 +148,7 @@ class EE_API Sprite : public Drawable { void reset(); /** @return The AABB (axis-aligned bounding box) */ - eeAABB getAABB(); + Rectf getAABB(); /** Update the colors of every vertex rendered of the sprite ( this will override the default color ) * @param Color0 The Left - Top vertex color @@ -174,7 +174,7 @@ class EE_API Sprite : public Drawable { * @param TexSector The texture sector to be rendered ( default all the texture ) * @return True if success */ - bool createStatic(const Uint32& TexId, const Sizef &DestSize = Sizef(0,0), const Vector2i &offset = Vector2i(0,0), const Recti& TexSector = Recti(0,0,0,0) ); + bool createStatic(const Uint32& TexId, const Sizef &DestSize = Sizef(0,0), const Vector2i &offset = Vector2i(0,0), const Rect& TexSector = Rect(0,0,0,0) ); /** Creates an animated sprite * @param SubFramesNum The number of subframes of the sprite @@ -188,7 +188,7 @@ class EE_API Sprite : public Drawable { * @param TexSector The texture sector to be rendered ( default all the texture ) * @return The frame position or 0 if fails */ - unsigned int addFrame( const Uint32& TexId, const Sizef& DestSize = Sizef(0,0), const Vector2i& offset = Vector2i(0,0), const Recti& TexSector = Recti(0,0,0,0) ); + unsigned int addFrame( const Uint32& TexId, const Sizef& DestSize = Sizef(0,0), const Vector2i& offset = Vector2i(0,0), const Rect& TexSector = Rect(0,0,0,0) ); /** Add a frame to the sprite (on the current sub frame) * @param SubTexture The SubTexture used in the frame @@ -215,7 +215,7 @@ class EE_API Sprite : public Drawable { * @param TexSector The texture sector to be rendered ( default all the texture ) * @return True if success */ - bool addSubFrame( const Uint32& TexId, const unsigned int& NumFrame, const unsigned int& NumSubFrame, const Sizef& DestSize = Sizef(0,0), const Vector2i& offset = Vector2i(0,0), const Recti& TexSector = Recti(0,0,0,0) ); + bool addSubFrame( const Uint32& TexId, const unsigned int& NumFrame, const unsigned int& NumSubFrame, const Sizef& DestSize = Sizef(0,0), const Vector2i& offset = Vector2i(0,0), const Rect& TexSector = Rect(0,0,0,0) ); /** Add a frame on an specific subframe to the sprite * @param SubTexture The SubTexture used in the frame diff --git a/include/eepp/graphics/subtexture.hpp b/include/eepp/graphics/subtexture.hpp index 19be8627b..cd3bbf73b 100644 --- a/include/eepp/graphics/subtexture.hpp +++ b/include/eepp/graphics/subtexture.hpp @@ -25,7 +25,7 @@ class EE_API SubTexture : public Drawable { * @param SrcRect The texture part that will be used as the SubTexture. * @param Name The texture name ( if any ) */ - SubTexture( const Uint32& TexId, const Recti& srcRect, const std::string& getName = "" ); + SubTexture( const Uint32& TexId, const Rect& srcRect, const std::string& getName = "" ); /** Creates a SubTexture of the indicated part of the texture. * @param TexId The texture id @@ -33,7 +33,7 @@ class EE_API SubTexture : public Drawable { * @param DestSize The destination size that the SubTexture will have when rendered. * @param Name The texture name ( if any ) */ - SubTexture( const Uint32& TexId, const Recti& srcRect, const Sizef& destSize, const std::string& getName = "" ); + SubTexture( const Uint32& TexId, const Rect& srcRect, const Sizef& destSize, const std::string& getName = "" ); /** Creates a SubTexture of the indicated part of the texture. * @param TexId The texture id @@ -42,7 +42,7 @@ class EE_API SubTexture : public Drawable { * @param Offset The offset that will be added to the position passed when any Draw call is used. * @param Name The texture name ( if any ) */ - SubTexture( const Uint32& TexId, const Recti& srcRect, const Sizef& destSize, const Vector2i& offset, const std::string& getName = "" ); + SubTexture( const Uint32& TexId, const Rect& srcRect, const Sizef& destSize, const Vector2i& offset, const std::string& getName = "" ); virtual ~SubTexture(); @@ -62,10 +62,10 @@ class EE_API SubTexture : public Drawable { void setTextureId( const Uint32& TexId ); /** @return The Texture sector that represents the SubTexture */ - const Recti& getSrcRect() const; + const Rect& getSrcRect() const; /** Sets the Texture sector that represents the SubTexture */ - void setSrcRect( const Recti& Rect ); + void setSrcRect( const Rect& rect ); /** @return The Destination Size of the SubTexture. */ const Sizef& getDestSize() const; @@ -169,7 +169,7 @@ class EE_API SubTexture : public Drawable { Uint32 mId; Uint32 mTexId; Graphics::Texture * mTexture; - Recti mSrcRect; + Rect mSrcRect; Sizef mOriDestSize; Sizef mDestSize; Vector2i mOffset; diff --git a/include/eepp/graphics/texture.hpp b/include/eepp/graphics/texture.hpp index d86720fe4..6b0ff1d52 100755 --- a/include/eepp/graphics/texture.hpp +++ b/include/eepp/graphics/texture.hpp @@ -171,7 +171,7 @@ class EE_API Texture : public Image, public Drawable, private NonCopyable { * @param Center The rotation and scaling center. The center point is relative to the top-left corner of the object. * @param texSector The texture sector to render. You can render only a part of the texture. ( default render all the texture ) */ - void draw( const Float &x, const Float &y, const Float &Angle = 0, const Vector2f &scale = Vector2f::One, const Color& Color = Color(255,255,255,255), const EE_BLEND_MODE &Blend = ALPHA_NORMAL, const EE_RENDER_MODE &Effect = RN_NORMAL, OriginPoint Center = OriginPoint(OriginPoint::OriginCenter), const Recti& texSector = Recti(0,0,0,0) ); + void draw( const Float &x, const Float &y, const Float &Angle = 0, const Vector2f &scale = Vector2f::One, const Color& Color = Color(255,255,255,255), const EE_BLEND_MODE &Blend = ALPHA_NORMAL, const EE_RENDER_MODE &Effect = RN_NORMAL, OriginPoint Center = OriginPoint(OriginPoint::OriginCenter), const Rect& texSector = Rect(0,0,0,0) ); /** Render the texture on screen. Extended because can set the vertex colors individually * @param x The x position on screen @@ -189,7 +189,7 @@ class EE_API Texture : public Image, public Drawable, private NonCopyable { * @param Center The rotation and scaling center. The center point is relative to the top-left corner of the object. * @param texSector The texture sector to render. You can render only a part of the texture. ( default render all the texture ) */ - void drawEx( Float x, Float y, Float width = 0.0f, Float height = 0.0f, const Float &Angle = 0, const Vector2f &scale = Vector2f::One, const Color& Color0 = Color(255,255,255,255), const Color& Color1 = Color(255,255,255,255), const Color& Color2 = Color(255,255,255,255), const Color& Color3 = Color(255,255,255,255), const EE_BLEND_MODE &Blend = ALPHA_NORMAL, const EE_RENDER_MODE &Effect = RN_NORMAL, OriginPoint Center = OriginPoint(OriginPoint::OriginCenter), const Recti& texSector = Recti(0,0,0,0) ); + void drawEx( Float x, Float y, Float width = 0.0f, Float height = 0.0f, const Float &Angle = 0, const Vector2f &scale = Vector2f::One, const Color& Color0 = Color(255,255,255,255), const Color& Color1 = Color(255,255,255,255), const Color& Color2 = Color(255,255,255,255), const Color& Color3 = Color(255,255,255,255), const EE_BLEND_MODE &Blend = ALPHA_NORMAL, const EE_RENDER_MODE &Effect = RN_NORMAL, OriginPoint Center = OriginPoint(OriginPoint::OriginCenter), const Rect& texSector = Rect(0,0,0,0) ); /** Render a quad on Screen * @param Q The Quad2f @@ -200,7 +200,7 @@ class EE_API Texture : public Image, public Drawable, private NonCopyable { * @param Blend Set the Blend Mode ( default ALPHA_NORMAL ) * @param texSector The texture sector to render. You can render only a part of the texture. ( default render all the texture ) */ - void drawQuad( const Quad2f& Q, const Vector2f& Offset = Vector2f(), const Float &Angle = 0.0f, const Vector2f &scale = Vector2f::One, const Color& Color = Color(255,255,255,255), const EE_BLEND_MODE &Blend = ALPHA_NORMAL, const Recti& texSector = Recti(0,0,0,0) ); + void drawQuad( const Quad2f& Q, const Vector2f& Offset = Vector2f(), const Float &Angle = 0.0f, const Vector2f &scale = Vector2f::One, const Color& Color = Color(255,255,255,255), const EE_BLEND_MODE &Blend = ALPHA_NORMAL, const Rect& texSector = Rect(0,0,0,0) ); /** Render a quad on Screen * @param Q The Quad2f @@ -214,7 +214,7 @@ class EE_API Texture : public Image, public Drawable, private NonCopyable { * @param Blend Set the Blend Mode ( default ALPHA_NORMAL ) * @param texSector The texture sector to render. You can render only a part of the texture. ( default render all the texture ) */ - void drawQuadEx( Quad2f Q, const Vector2f& Offset = Vector2f(), const Float &Angle = 0.0f, const Vector2f &scale = Vector2f::One, const Color& Color0 = Color(255,255,255,255), const Color& Color1 = Color(255,255,255,255), const Color& Color2 = Color(255,255,255,255), const Color& Color3 = Color(255,255,255,255), const EE_BLEND_MODE &Blend = ALPHA_NORMAL, Recti texSector = Recti(0,0,0,0) ); + void drawQuadEx( Quad2f Q, const Vector2f& Offset = Vector2f(), const Float &Angle = 0.0f, const Vector2f &scale = Vector2f::One, const Color& Color0 = Color(255,255,255,255), const Color& Color1 = Color(255,255,255,255), const Color& Color2 = Color(255,255,255,255), const Color& Color3 = Color(255,255,255,255), const EE_BLEND_MODE &Blend = ALPHA_NORMAL, Rect texSector = Rect(0,0,0,0) ); Sizef getSize(); diff --git a/include/eepp/graphics/textureatlas.hpp b/include/eepp/graphics/textureatlas.hpp index ae59cf5c2..4a07cddd7 100644 --- a/include/eepp/graphics/textureatlas.hpp +++ b/include/eepp/graphics/textureatlas.hpp @@ -30,7 +30,7 @@ class EE_API TextureAtlas : public ResourceManager { * @param SrcRect The texture part that will be used as the SubTexture. * @param Name The texture name ( if any ) */ - SubTexture * add( const Uint32& TexId, const Recti& SrcRect, const std::string& getName = "" ); + SubTexture * add( const Uint32& TexId, const Rect& SrcRect, const std::string& getName = "" ); /** Creates and add to the texture atlas a SubTexture of the indicated part of the texture. * @param TexId The texture id @@ -38,7 +38,7 @@ class EE_API TextureAtlas : public ResourceManager { * @param DestSize The destination size that the SubTexture will have when rendered. * @param Name The texture name ( if any ) */ - SubTexture * add( const Uint32& TexId, const Recti& SrcRect, const Sizef& DestSize, const std::string& getName = "" ); + SubTexture * add( const Uint32& TexId, const Rect& SrcRect, const Sizef& DestSize, const std::string& getName = "" ); /** Creates and add to the texture atlas a SubTexture of the indicated part of the texture. * @param TexId The texture id @@ -47,7 +47,7 @@ class EE_API TextureAtlas : public ResourceManager { * @param Offset The offset that will be added to the position passed when any Draw call is used. * @param Name The texture name ( if any ) */ - SubTexture * add( const Uint32& TexId, const Recti& SrcRect, const Sizef& DestSize, const Vector2i& Offset, const std::string& getName = "" ); + SubTexture * add( const Uint32& TexId, const Rect& SrcRect, const Sizef& DestSize, const Vector2i& Offset, const std::string& getName = "" ); /** @return The texture atlas name. */ const std::string& getName() const; diff --git a/include/eepp/maps/maplight.hpp b/include/eepp/maps/maplight.hpp index 94afd93ad..1149ce86a 100644 --- a/include/eepp/maps/maplight.hpp +++ b/include/eepp/maps/maplight.hpp @@ -35,7 +35,7 @@ class EE_API MapLight { void updatePos( const Vector2f& newPos ); - eeAABB getAABB() const; + Rectf getAABB() const; const Float& getRadius() const; @@ -61,7 +61,7 @@ class EE_API MapLight { Vector2f mPos; RGB mColor; LIGHT_TYPE mType; - eeAABB mAABB; + Rectf mAABB; bool mActive; void updateAABB(); diff --git a/include/eepp/maps/tilemap.hpp b/include/eepp/maps/tilemap.hpp index cee397794..9f6a065ac 100644 --- a/include/eepp/maps/tilemap.hpp +++ b/include/eepp/maps/tilemap.hpp @@ -172,7 +172,7 @@ class EE_API TileMap { const Color& getBaseColor() const; - const eeAABB& getViewAreaAABB() const; + const Rectf& getViewAreaAABB() const; MapLightManager * getLightManager() const; @@ -265,7 +265,7 @@ class EE_API TileMap { GOTypesList mObjTypes; CreateGOCb mCreateGOCb; Texture * mTileTex; - eeAABB mScreenAABB; + Rectf mScreenAABB; MapLightManager * mLightManager; MapDrawCb mDrawCb; MapUpdateCb mUpdateCb; diff --git a/include/eepp/math/rect.hpp b/include/eepp/math/rect.hpp index e25713fc2..b94b978a7 100755 --- a/include/eepp/math/rect.hpp +++ b/include/eepp/math/rect.hpp @@ -19,21 +19,21 @@ class tRECT { tRECT copy(); - bool intersect( const tRECT& Rect ); + bool intersect( const tRECT& rect ); - bool contains( const tRECT& Rect ); + bool contains( const tRECT& rect ); bool contains( const Vector2& Vect ); - void expand( const tRECT& Rect ); + void expand( const tRECT& rect ); - void shrink( const tRECT& Rect ); + void shrink( const tRECT& rect ); void expand( const Vector2& Vect ); T area(); - T mergedArea( const tRECT& Rect ); + T mergedArea( const tRECT& rect ); bool intersectsSegment( const Vector2& a, const Vector2& b ); @@ -176,13 +176,13 @@ template tRECT::tRECT() : Left(0), Right(0), Top(0), Bottom(0) {} template -bool tRECT::contains( const tRECT& Rect ) { - return ( Left <= Rect.Left && Right >= Rect.Right && Top <= Rect.Top && Bottom >= Rect.Bottom ); +bool tRECT::contains( const tRECT& rect ) { + return ( Left <= rect.Left && Right >= rect.Right && Top <= rect.Top && Bottom >= rect.Bottom ); } template -bool tRECT::intersect( const tRECT& Rect ) { - return !( Left > Rect.Right || Right < Rect.Left || Top > Rect.Bottom || Bottom < Rect.Top ); +bool tRECT::intersect( const tRECT& rect ) { + return !( Left > rect.Right || Right < rect.Left || Top > rect.Bottom || Bottom < rect.Top ); } template @@ -216,19 +216,19 @@ T tRECT::getHeight() { } template -void tRECT::expand( const tRECT& Rect ) { - Left = eemin( Left , Rect.Left ); - Bottom = eemax( Bottom , Rect.Bottom ); - Right = eemax( Right , Rect.Right ); - Top = eemin( Top , Rect.Top ); +void tRECT::expand( const tRECT& rect ) { + Left = eemin( Left , rect.Left ); + Bottom = eemax( Bottom , rect.Bottom ); + Right = eemax( Right , rect.Right ); + Top = eemin( Top , rect.Top ); } template -void tRECT::shrink( const tRECT& Rect ) { - Left = eemax( Left , Rect.Left ); - Top = eemax( Top , Rect.Top ); - Right = eemax( Left, eemin( Right , Rect.Right ) ); - Bottom = eemax( Top, eemin( Bottom , Rect.Bottom ) ); +void tRECT::shrink( const tRECT& rect ) { + Left = eemax( Left , rect.Left ); + Top = eemax( Top , rect.Top ); + Right = eemax( Left, eemin( Right , rect.Right ) ); + Bottom = eemax( Top, eemin( Bottom , rect.Bottom ) ); } template @@ -245,8 +245,8 @@ T tRECT::area() { } template -T tRECT::mergedArea( const tRECT& Rect ) { - return ( eemax( Right, Rect.Right ) - eemin( Left, Rect.Left ) ) * ( eemin( Bottom, Rect.Bottom ) - eemax( Top, Rect.Top ) ); +T tRECT::mergedArea( const tRECT& rect ) { + return ( eemax( Right, rect.Right ) - eemin( Left, rect.Left ) ) * ( eemin( Bottom, rect.Bottom ) - eemax( Top, rect.Top ) ); } template @@ -341,9 +341,7 @@ void tRECT::scale( Vector2 scale ) { typedef tRECT Rectu; typedef tRECT Rectf; -typedef tRECT eeAABB; // Axis-Aligned Bounding Box -typedef tRECT Recti; -typedef tRECT Rect; +typedef tRECT Rect; }} diff --git a/include/eepp/ui/uicontrol.hpp b/include/eepp/ui/uicontrol.hpp index f9a156835..d6763a855 100644 --- a/include/eepp/ui/uicontrol.hpp +++ b/include/eepp/ui/uicontrol.hpp @@ -68,7 +68,7 @@ class EE_API UIControl { const Sizei& getRealSize(); - Recti getRect() const; + Rect getRect() const; UIControl * setVisible( const bool& visible ); @@ -223,7 +223,7 @@ class EE_API UIControl { void applyDefaultTheme(); - Recti getScreenRect(); + Rect getScreenRect(); void childsCloseAll(); @@ -400,7 +400,7 @@ class EE_API UIControl { Time getElapsed(); - Recti makePadding( bool PadLeft = true, bool PadRight = true, bool PadTop = true, bool PadBottom = true, bool SkipFlags = false ); + Rect makePadding( bool PadLeft = true, bool PadRight = true, bool PadTop = true, bool PadBottom = true, bool SkipFlags = false ); Sizei getSkinSize( UISkin * Skin, const Uint32& State = UISkinState::StateNormal ); diff --git a/include/eepp/ui/uilistbox.hpp b/include/eepp/ui/uilistbox.hpp index 2acf6b7e8..a10e4edb7 100644 --- a/include/eepp/ui/uilistbox.hpp +++ b/include/eepp/ui/uilistbox.hpp @@ -77,9 +77,9 @@ class EE_API UIListBox : public UITouchDragableWidget { Graphics::Font * getFont() const; - void setContainerPadding( const Recti& Padding ); + void setContainerPadding( const Rect& Padding ); - const Recti& getContainerPadding() const; + const Rect& getContainerPadding() const; void setSmoothScroll( const bool& soft ); @@ -121,9 +121,9 @@ class EE_API UIListBox : public UITouchDragableWidget { Uint32 mRowHeight; UI_SCROLLBAR_MODE mVScrollMode; UI_SCROLLBAR_MODE mHScrollMode; - Recti mContainerPadding; - Recti mHScrollPadding; - Recti mVScrollPadding; + Rect mContainerPadding; + Rect mHScrollPadding; + Rect mVScrollPadding; UIItemContainer * mContainer; UIScrollBar * mVScrollBar; UIScrollBar * mHScrollBar; diff --git a/include/eepp/ui/uimenu.hpp b/include/eepp/ui/uimenu.hpp index ce93315ea..0f8ded9ed 100644 --- a/include/eepp/ui/uimenu.hpp +++ b/include/eepp/ui/uimenu.hpp @@ -58,7 +58,7 @@ class EE_API UIMenu : public UIWidget { virtual bool hide(); - const Recti& getPadding() const; + const Rect& getPadding() const; Uint32 getMinRightMargin() const; diff --git a/include/eepp/ui/uipushbutton.hpp b/include/eepp/ui/uipushbutton.hpp index baebe2dfb..774401e53 100644 --- a/include/eepp/ui/uipushbutton.hpp +++ b/include/eepp/ui/uipushbutton.hpp @@ -29,9 +29,9 @@ class EE_API UIPushButton : public UIWidget { virtual const String& getText(); - void setPadding( const Recti& padding ); + void setPadding( const Rect& padding ); - const Recti& getPadding() const; + const Rect& getPadding() const; void setIconHorizontalMargin( Int32 margin ); diff --git a/include/eepp/ui/uiscrollview.hpp b/include/eepp/ui/uiscrollview.hpp index 062c56be6..0e7099239 100644 --- a/include/eepp/ui/uiscrollview.hpp +++ b/include/eepp/ui/uiscrollview.hpp @@ -39,6 +39,8 @@ class EE_API UIScrollView : public UITouchDragableWidget { UIScrollBar * getHorizontalScrollBar() const; UIControlAnim * getContainer() const; + + virtual void loadFromXmlNode( const pugi::xml_node& node ); protected: ScrollViewType mViewType; UI_SCROLLBAR_MODE mVScrollMode; diff --git a/include/eepp/ui/uispinbox.hpp b/include/eepp/ui/uispinbox.hpp index ff35414f3..4267c7d37 100644 --- a/include/eepp/ui/uispinbox.hpp +++ b/include/eepp/ui/uispinbox.hpp @@ -20,9 +20,9 @@ class EE_API UISpinBox : public UIWidget { virtual void setTheme( UITheme * Theme ); - virtual void setPadding( const Recti& padding ); + virtual void setPadding( const Rect& padding ); - const Recti& getPadding() const; + const Rect& getPadding() const; virtual void setClickStep( const Float& step ); diff --git a/include/eepp/ui/uitable.hpp b/include/eepp/ui/uitable.hpp index 4dc310a1b..d1f6742e9 100644 --- a/include/eepp/ui/uitable.hpp +++ b/include/eepp/ui/uitable.hpp @@ -75,14 +75,14 @@ class EE_API UITable : public UITouchDragableWidget { UITable * setSmoothScroll(bool smoothScroll); - Recti getContainerPadding() const; + Rect getContainerPadding() const; - void setContainerPadding( const Recti & containerPadding); + void setContainerPadding( const Rect & containerPadding); protected: friend class UIItemContainer; friend class UITableCell; - Recti mContainerPadding; + Rect mContainerPadding; UIItemContainer * mContainer; UIScrollBar * mVScrollBar; UIScrollBar * mHScrollBar; diff --git a/include/eepp/ui/uitextedit.hpp b/include/eepp/ui/uitextedit.hpp index 9dba7f54d..d38aaae17 100644 --- a/include/eepp/ui/uitextedit.hpp +++ b/include/eepp/ui/uitextedit.hpp @@ -57,7 +57,7 @@ class EE_API UITextEdit : public UIWidget { UI_SCROLLBAR_MODE mHScrollBarMode; UI_SCROLLBAR_MODE mVScrollBarMode; bool mSkipValueChange; - Recti mContainerPadding; + Rect mContainerPadding; virtual void onSizeChange(); diff --git a/include/eepp/ui/uitextview.hpp b/include/eepp/ui/uitextview.hpp index a5d779c2f..0f60c83b6 100644 --- a/include/eepp/ui/uitextview.hpp +++ b/include/eepp/ui/uitextview.hpp @@ -76,9 +76,9 @@ class EE_API UITextView : public UIWidget { UITooltipStyleConfig getFontStyleConfig() const; - const Recti& getPadding() const; + const Rect& getPadding() const; - UITextView * setPadding(const Recti & padding); + UITextView * setPadding(const Rect & padding); virtual void loadFromXmlNode( const pugi::xml_node& node ); protected: @@ -89,8 +89,8 @@ class EE_API UITextView : public UIWidget { Vector2f mRealAlignOffset; Int32 mSelCurInit; Int32 mSelCurEnd; - Recti mPadding; - Recti mRealPadding; + Rect mPadding; + Rect mRealPadding; struct SelPosCache { SelPosCache( Vector2f ip, Vector2f ep ) : diff --git a/include/eepp/ui/uithemeconfig.hpp b/include/eepp/ui/uithemeconfig.hpp index 5a08d9b62..f5ca60f6e 100644 --- a/include/eepp/ui/uithemeconfig.hpp +++ b/include/eepp/ui/uithemeconfig.hpp @@ -152,7 +152,7 @@ class UIMenuStyleConfig : public UIFontStyleConfig { UIFontStyleConfig( fontStyleConfig ) {} - Recti Padding = Recti(0, 0, 0, 0); + Rect Padding = Rect(0, 0, 0, 0); Uint32 MinWidth = 0; Uint32 MinSpaceForIcons = 0; Uint32 MinRightMargin = 0; @@ -188,7 +188,7 @@ class UITooltipStyleConfig : public UIFontStyleConfig { UIFontStyleConfig( fontStyleConfig ) {} - Recti Padding; + Rect Padding; }; class UIScaleType { diff --git a/include/eepp/ui/uitooltip.hpp b/include/eepp/ui/uitooltip.hpp index 25332d917..3446e8be2 100644 --- a/include/eepp/ui/uitooltip.hpp +++ b/include/eepp/ui/uitooltip.hpp @@ -51,9 +51,9 @@ class EE_API UITooltip : public UIControlAnim { virtual void onFontChanged(); - virtual void setPadding( const Recti& padding ); + virtual void setPadding( const Rect& padding ); - const Recti& getPadding() const; + const Rect& getPadding() const; Text * getTextCache(); @@ -82,7 +82,7 @@ class EE_API UITooltip : public UIControlAnim { Text * mTextCache; UITooltipStyleConfig mStyleConfig; Vector2f mAlignOffset; - Recti mRealPadding; + Rect mRealPadding; Time mTooltipTime; UIControl * mTooltipOf; diff --git a/include/eepp/ui/uiwidget.hpp b/include/eepp/ui/uiwidget.hpp index b241a59b1..9d906523f 100644 --- a/include/eepp/ui/uiwidget.hpp +++ b/include/eepp/ui/uiwidget.hpp @@ -48,9 +48,9 @@ class EE_API UIWidget : public UIControlAnim { void updateAnchorsDistances(); - Recti getLayoutMargin() const; + Rect getLayoutMargin() const; - UIWidget * setLayoutMargin(const Recti & margin); + UIWidget * setLayoutMargin(const Rect & margin); Float getLayoutWeight() const; @@ -79,14 +79,13 @@ class EE_API UIWidget : public UIControlAnim { virtual void loadFromXmlNode( const pugi::xml_node& node ); protected: friend class UIManager; - friend class UILinearLayout; UITheme * mTheme; UITooltip * mTooltip; Sizei mMinControlSize; - Recti mDistToBorder; - Recti mLayoutMargin; - Recti mRealMargin; + Rect mDistToBorder; + Rect mLayoutMargin; + Rect mRealMargin; Float mLayoutWeight; Uint32 mLayoutGravity; LayoutSizeRules mLayoutWidthRules; diff --git a/include/eepp/window/view.hpp b/include/eepp/window/view.hpp index e0072d92c..e2ba49fc7 100755 --- a/include/eepp/window/view.hpp +++ b/include/eepp/window/view.hpp @@ -12,7 +12,7 @@ class EE_API View { View( const int& X, const int& Y, const int& Width, const int& Height ); - View( const Recti& View ); + View( const Rect& View ); ~View(); @@ -35,7 +35,7 @@ class EE_API View { void setCenter( const Vector2i& center ); /** @return The current view ( Left = X, Right = Width, Top = Y, Bottom = Height ) */ - Recti getView() const { return mView; } + Rect getView() const { return mView; } /** Set a new position to the view */ void setPosition( const int& X, const int& Y ); @@ -49,7 +49,7 @@ class EE_API View { friend class Window; bool mNeedUpdate; - Recti mView; + Rect mView; Vector2f mCenter; void calcCenter(); diff --git a/include/eepp/window/window.hpp b/include/eepp/window/window.hpp index b6c6ad0a9..40e7a0d4e 100644 --- a/include/eepp/window/window.hpp +++ b/include/eepp/window/window.hpp @@ -371,7 +371,7 @@ class EE_API Window { * * @sa startTextInput() */ - virtual void setTextInputRect( Recti& rect ); + virtual void setTextInputRect( Rect& rect ); /** * @brief Returns whether the platform has some screen keyboard support. diff --git a/src/eepp/graphics/fonttruetype.cpp b/src/eepp/graphics/fonttruetype.cpp index a73eeff95..1d73c903b 100644 --- a/src/eepp/graphics/fonttruetype.cpp +++ b/src/eepp/graphics/fonttruetype.cpp @@ -532,7 +532,7 @@ Glyph FontTrueType::loadGlyph(Uint32 codePoint, unsigned int characterSize, bool return glyph; } -Recti FontTrueType::findGlyphRect(Page& page, unsigned int width, unsigned int height) const { +Rect FontTrueType::findGlyphRect(Page& page, unsigned int width, unsigned int height) const { // Find the line that fits well the glyph Row* row = NULL; Float bestRatio = 0; @@ -577,7 +577,7 @@ Recti FontTrueType::findGlyphRect(Page& page, unsigned int width, unsigned int h } else { // Oops, we've reached the maximum texture size... eePRINTL( "Failed to add a new character to the font: the maximum texture size has been reached" ); - return Recti(0, 0, 2, 2); + return Rect(0, 0, 2, 2); } } @@ -588,7 +588,7 @@ Recti FontTrueType::findGlyphRect(Page& page, unsigned int width, unsigned int h } // Find the glyph's rectangle on the selected row - Recti rect(row->width, row->top, width, height); + Rect rect(row->width, row->top, width, height); // Update the row informations row->width += width; diff --git a/src/eepp/graphics/image.cpp b/src/eepp/graphics/image.cpp index 3aa68f713..11b70a980 100644 --- a/src/eepp/graphics/image.cpp +++ b/src/eepp/graphics/image.cpp @@ -613,7 +613,7 @@ Graphics::Image * Image::thumbnail( const Uint32& maxWidth, const Uint32& maxHei return NULL; } -Graphics::Image * Image::crop( Recti rect ) { +Graphics::Image * Image::crop( Rect rect ) { if ( rect.Left >= 0 && rect.Right <= (Int32)mWidth && rect.Top >= 0 && rect.Bottom <= (Int32)mHeight ) { Image * img = eeNew( Image, ( rect.getSize().getWidth(), rect.getSize().getHeight(), mChannels ) ); diff --git a/src/eepp/graphics/pixeldensity.cpp b/src/eepp/graphics/pixeldensity.cpp index 9f592f260..5facbebb9 100644 --- a/src/eepp/graphics/pixeldensity.cpp +++ b/src/eepp/graphics/pixeldensity.cpp @@ -41,11 +41,11 @@ Sizei PixelDensity::pxToDpI( Sizei size ) { return Sizei( pxToDpI( size.x ), pxToDpI( size.y ) ); } -Recti PixelDensity::dpToPxI( Recti rect ) { +Rect PixelDensity::dpToPxI( Rect rect ) { return rect * getPixelDensity(); } -Recti PixelDensity::pxToDpI( Recti rect ) { +Rect PixelDensity::pxToDpI( Rect rect ) { return rect / getPixelDensity(); } diff --git a/src/eepp/graphics/scrollparallax.cpp b/src/eepp/graphics/scrollparallax.cpp index ffc460224..556fc5356 100755 --- a/src/eepp/graphics/scrollparallax.cpp +++ b/src/eepp/graphics/scrollparallax.cpp @@ -106,7 +106,7 @@ void ScrollParallax::draw() { for ( Int32 y = -1; y < mTiles.y; y++ ) { for ( Int32 x = -1; x < mTiles.x; x++ ) { - Recti Rect = mRect; + Rect Rect = mRect; Rectf AABB( Pos.x, Pos.y, Pos.x + mRealSize.getWidth(), Pos.y + mRealSize.getHeight() ); if ( AABB.intersect( mAABB ) ) { diff --git a/src/eepp/graphics/sprite.cpp b/src/eepp/graphics/sprite.cpp index 4ebc3224f..17dc72c7f 100755 --- a/src/eepp/graphics/sprite.cpp +++ b/src/eepp/graphics/sprite.cpp @@ -72,7 +72,7 @@ Sprite::Sprite( SubTexture * SubTexture ) : createStatic( SubTexture ); } -Sprite::Sprite( const Uint32& TexId, const Sizef &DestSize, const Vector2i &Offset, const Recti& TexSector ) : +Sprite::Sprite( const Uint32& TexId, const Sizef &DestSize, const Vector2i &Offset, const Rect& TexSector ) : Drawable( DRAWABLE_SPRITE ), mFlags( SPRITE_FLAG_AUTO_ANIM | SPRITE_FLAG_EVENTS_ENABLED ), mRotation( 0.f ), @@ -277,8 +277,8 @@ Quad2f Sprite::getQuad() { return Quad2f(); } -eeAABB Sprite::getAABB() { - eeAABB TmpR; +Rectf Sprite::getAABB() { + Rectf TmpR; SubTexture * S; if ( mFrames.size() && ( S = getCurrentSubTexture() ) ) { @@ -331,7 +331,7 @@ bool Sprite::createStatic( SubTexture * SubTexture ) { return true; } -bool Sprite::createStatic( const Uint32& TexId, const Sizef& DestSize, const Vector2i& Offset, const Recti& TexSector ) { +bool Sprite::createStatic( const Uint32& TexId, const Sizef& DestSize, const Vector2i& Offset, const Rect& TexSector ) { if ( TextureFactory::instance()->existsId( TexId ) ) { reset(); @@ -427,7 +427,7 @@ unsigned int Sprite::addFrame( SubTexture * SubTexture ) { return id; } -unsigned int Sprite::addFrame( const Uint32& TexId, const Sizef& DestSize, const Vector2i& Offset, const Recti& TexSector ) { +unsigned int Sprite::addFrame( const Uint32& TexId, const Sizef& DestSize, const Vector2i& Offset, const Rect& TexSector ) { unsigned int id = framePos(); if ( addSubFrame( TexId, id, mCurrentSubFrame, DestSize, Offset, TexSector ) ) @@ -436,7 +436,7 @@ unsigned int Sprite::addFrame( const Uint32& TexId, const Sizef& DestSize, const return 0; } -bool Sprite::addSubFrame(const Uint32& TexId, const unsigned int& NumFrame, const unsigned int& NumSubFrame, const Sizef& DestSize, const Vector2i& Offset, const Recti& TexSector) { +bool Sprite::addSubFrame(const Uint32& TexId, const unsigned int& NumFrame, const unsigned int& NumSubFrame, const Sizef& DestSize, const Vector2i& Offset, const Rect& TexSector) { if ( !TextureFactory::instance()->existsId( TexId ) ) return false; @@ -448,7 +448,7 @@ bool Sprite::addSubFrame(const Uint32& TexId, const unsigned int& NumFrame, cons if ( TexSector.Right > 0 && TexSector.Bottom > 0 ) S->setSrcRect( TexSector ); else - S->setSrcRect( Recti( 0, 0, (Int32)Tex->getImageWidth(), (Int32)Tex->getImageHeight() ) ); + S->setSrcRect( Rect( 0, 0, (Int32)Tex->getImageWidth(), (Int32)Tex->getImageHeight() ) ); Sizef destSize( DestSize ); diff --git a/src/eepp/graphics/subtexture.cpp b/src/eepp/graphics/subtexture.cpp index ebd47911e..5a34a7fc1 100644 --- a/src/eepp/graphics/subtexture.cpp +++ b/src/eepp/graphics/subtexture.cpp @@ -16,7 +16,7 @@ SubTexture::SubTexture() : mId(0), mTexId(0), mTexture(NULL), - mSrcRect( Recti(0,0,0,0) ), + mSrcRect( Rect(0,0,0,0) ), mOriDestSize(0,0), mDestSize(0,0), mOffset(0,0), @@ -33,7 +33,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->getImageWidth() : 0, NULL != mTexture ? mTexture->getImageHeight() : 0 ) ), + mSrcRect( Rect( 0, 0, NULL != mTexture ? mTexture->getImageWidth() : 0, NULL != mTexture ? mTexture->getImageHeight() : 0 ) ), mOriDestSize( (Float)mSrcRect.getSize().getWidth(), (Float)mSrcRect.getSize().getHeight() ), mDestSize( mOriDestSize ), mOffset(0,0), @@ -42,7 +42,7 @@ SubTexture::SubTexture( const Uint32& TexId, const std::string& Name ) : createUnnamed(); } -SubTexture::SubTexture( const Uint32& TexId, const Recti& SrcRect, const std::string& Name ) : +SubTexture::SubTexture( const Uint32& TexId, const Rect& SrcRect, const std::string& Name ) : Drawable( DRAWABLE_SUBTEXTURE ), mPixels(NULL), mAlphaMask(NULL), @@ -59,7 +59,7 @@ SubTexture::SubTexture( const Uint32& TexId, const Recti& SrcRect, const std::st createUnnamed(); } -SubTexture::SubTexture( const Uint32& TexId, const Recti& SrcRect, const Sizef& DestSize, const std::string& Name ) : +SubTexture::SubTexture( const Uint32& TexId, const Rect& SrcRect, const Sizef& DestSize, const std::string& Name ) : Drawable( DRAWABLE_SUBTEXTURE ), mPixels(NULL), mAlphaMask(NULL), @@ -76,7 +76,7 @@ SubTexture::SubTexture( const Uint32& TexId, const Recti& SrcRect, const Sizef& createUnnamed(); } -SubTexture::SubTexture( const Uint32& TexId, const Recti& SrcRect, const Sizef& DestSize, const Vector2i &Offset, const std::string& Name ) : +SubTexture::SubTexture( const Uint32& TexId, const Rect& SrcRect, const Sizef& DestSize, const Vector2i &Offset, const std::string& Name ) : Drawable( DRAWABLE_SUBTEXTURE ), mPixels(NULL), mAlphaMask(NULL), @@ -124,12 +124,12 @@ void SubTexture::setTextureId( const Uint32& TexId ) { mTexture = TextureFactory::instance()->getTexture( TexId ); } -const Recti& SubTexture::getSrcRect() const { +const Rect& SubTexture::getSrcRect() const { return mSrcRect; } -void SubTexture::setSrcRect( const Recti& Rect ) { - mSrcRect = Rect; +void SubTexture::setSrcRect( const Rect& rect ) { + mSrcRect = rect; if ( NULL != mPixels ) cacheColors(); diff --git a/src/eepp/graphics/texture.cpp b/src/eepp/graphics/texture.cpp index dbdfcd011..0e389d279 100755 --- a/src/eepp/graphics/texture.cpp +++ b/src/eepp/graphics/texture.cpp @@ -495,7 +495,7 @@ bool Texture::isCompressed() const { return 0 != ( mFlags & TEX_FLAG_COMPRESSED ); } -void Texture::draw( const Float &x, const Float &y, const Float &Angle, const Vector2f &Scale, const Color& Color, const EE_BLEND_MODE &Blend, const EE_RENDER_MODE &Effect, OriginPoint Center, const Recti& texSector) { +void Texture::draw( const Float &x, const Float &y, const Float &Angle, const Vector2f &Scale, const Color& Color, const EE_BLEND_MODE &Blend, const EE_RENDER_MODE &Effect, OriginPoint Center, const Rect& texSector) { drawEx( x, y, 0, 0, Angle, Scale, Color, Color, Color, Color, Blend, Effect, Center, texSector ); } @@ -518,9 +518,9 @@ void Texture::drawFast( const Float& x, const Float& y, const Float& Angle, cons sBR->drawOpt(); } -void Texture::drawEx( Float x, Float y, Float width, Float height, const Float &Angle, const Vector2f &Scale, const Color& Color0, const Color& Color1, const Color& Color2, const Color& Color3, const EE_BLEND_MODE &Blend, const EE_RENDER_MODE &Effect, OriginPoint Center, const Recti& texSector ) { +void Texture::drawEx( Float x, Float y, Float width, Float height, const Float &Angle, const Vector2f &Scale, const Color& Color0, const Color& Color1, const Color& Color2, const Color& Color3, const EE_BLEND_MODE &Blend, const EE_RENDER_MODE &Effect, OriginPoint Center, const Rect& texSector ) { bool renderSector = true; - Recti Sector = texSector; + Rect Sector = texSector; Float w = (Float)getImageWidth(); Float h = (Float)getImageHeight(); @@ -685,11 +685,11 @@ void Texture::drawEx( Float x, Float y, Float width, Float height, const Float & sBR->drawOpt(); } -void Texture::drawQuad( const Quad2f& Q, const Vector2f& Offset, const Float &Angle, const Vector2f &Scale, const Color& Color, const EE_BLEND_MODE &Blend, const Recti& texSector) { +void Texture::drawQuad( const Quad2f& Q, const Vector2f& Offset, const Float &Angle, const Vector2f &Scale, const Color& Color, const EE_BLEND_MODE &Blend, const Rect& texSector) { drawQuadEx( Q, Offset, Angle, Scale, Color, Color, Color, Color, Blend, texSector ); } -void Texture::drawQuadEx( Quad2f Q, const Vector2f& Offset, const Float &Angle, const Vector2f &Scale, const Color& Color0, const Color& Color1, const Color& Color2, const Color& Color3, const EE_BLEND_MODE &Blend, Recti texSector ) { +void Texture::drawQuadEx( Quad2f Q, const Vector2f& Offset, const Float &Angle, const Vector2f &Scale, const Color& Color0, const Color& Color1, const Color& Color2, const Color& Color3, const EE_BLEND_MODE &Blend, Rect texSector ) { bool renderSector = true; Float w = (Float)getImageWidth(); Float h = (Float)getImageHeight(); diff --git a/src/eepp/graphics/textureatlas.cpp b/src/eepp/graphics/textureatlas.cpp index 3edcb6fe9..39bc3ad84 100644 --- a/src/eepp/graphics/textureatlas.cpp +++ b/src/eepp/graphics/textureatlas.cpp @@ -40,15 +40,15 @@ SubTexture * TextureAtlas::add( const Uint32& TexId, const std::string& Name ) { return add( eeNew( SubTexture, ( TexId, Name ) ) ); } -SubTexture * TextureAtlas::add( const Uint32& TexId, const Recti& SrcRect, const std::string& Name ) { +SubTexture * TextureAtlas::add( const Uint32& TexId, const Rect& SrcRect, const std::string& Name ) { return add( eeNew( SubTexture, ( TexId, SrcRect, Name ) ) ); } -SubTexture * TextureAtlas::add( const Uint32& TexId, const Recti& SrcRect, const Sizef& DestSize, const std::string& Name ) { +SubTexture * TextureAtlas::add( const Uint32& TexId, const Rect& SrcRect, const Sizef& DestSize, const std::string& Name ) { return add( eeNew ( SubTexture, ( TexId, SrcRect, DestSize, Name ) ) ); } -SubTexture * TextureAtlas::add( const Uint32& TexId, const Recti& SrcRect, const Sizef& DestSize, const Vector2i& Offset, const std::string& Name ) { +SubTexture * TextureAtlas::add( const Uint32& TexId, const Rect& SrcRect, const Sizef& DestSize, const Vector2i& Offset, const std::string& Name ) { return add( eeNew ( SubTexture, ( TexId, SrcRect, DestSize, Offset, Name ) ) ); } diff --git a/src/eepp/graphics/textureatlasloader.cpp b/src/eepp/graphics/textureatlasloader.cpp index a19a3b868..c975fddd2 100644 --- a/src/eepp/graphics/textureatlasloader.cpp +++ b/src/eepp/graphics/textureatlasloader.cpp @@ -228,7 +228,7 @@ void TextureAtlasLoader::createSubTextures() { if ( mTexGrHdr.Flags & HDR_TEXTURE_ATLAS_REMOVE_EXTENSION ) SubTextureName = FileSystem::fileRemoveExtension( SubTextureName ); - Recti tRect( tSh->X, tSh->Y, tSh->X + tSh->Width, tSh->Y + tSh->Height ); + Rect tRect( tSh->X, tSh->Y, tSh->X + tSh->Width, tSh->Y + tSh->Height ); SubTexture * tSubTexture = eeNew( SubTexture, ( tTex->getId(), tRect, Sizef( (Float)tSh->DestWidth, (Float)tSh->DestHeight ), Vector2i( tSh->OffsetX, tSh->OffsetY ), SubTextureName ) ); diff --git a/src/eepp/graphics/texturepackernode.cpp b/src/eepp/graphics/texturepackernode.cpp index 9eaf51157..21c2bd6d6 100644 --- a/src/eepp/graphics/texturepackernode.cpp +++ b/src/eepp/graphics/texturepackernode.cpp @@ -45,13 +45,13 @@ bool TexturePackerNode::fits( Int32 width, Int32 height, Int32 &edgeCount, const return ret; } -void TexturePackerNode::getRect( Recti &r ) const { - r = Recti( mX, mY, mX + mWidth - 1, mY + mHeight - 1 ); +void TexturePackerNode::getRect( Rect &r ) const { + r = Rect( mX, mY, mX + mWidth - 1, mY + mHeight - 1 ); } void TexturePackerNode::validate( TexturePackerNode * n ) { - Recti r1; - Recti r2; + Rect r1; + Rect r2; getRect( r1 ); n->getRect( r2 ); eeASSERT( !r1.intersect(r2) ); @@ -60,8 +60,8 @@ void TexturePackerNode::validate( TexturePackerNode * n ) { bool TexturePackerNode::merge( const TexturePackerNode& n ) { bool ret = false; - Recti r1; - Recti r2; + Rect r1; + Rect r2; getRect( r1 ); n.getRect( r2 ); diff --git a/src/eepp/graphics/texturepackernode.hpp b/src/eepp/graphics/texturepackernode.hpp index 129caa6a6..5f09975a9 100644 --- a/src/eepp/graphics/texturepackernode.hpp +++ b/src/eepp/graphics/texturepackernode.hpp @@ -11,7 +11,7 @@ class TexturePackerNode { bool fits( Int32 wid, Int32 hit, Int32 &edgeCount, const bool& AllowFlipping = false ) const; - void getRect( Recti &r ) const; + void getRect( Rect &r ) const; void validate( TexturePackerNode * n ); diff --git a/src/eepp/maps/mapeditor/uimap.cpp b/src/eepp/maps/mapeditor/uimap.cpp index 346d61234..24e25b670 100644 --- a/src/eepp/maps/mapeditor/uimap.cpp +++ b/src/eepp/maps/mapeditor/uimap.cpp @@ -373,7 +373,7 @@ void UIMap::mapDraw() { mP.setColor( Color( 255, 0, 0, (Uint8)mAlpha ) ); Vector2f Pos( mSelLight->getAABB().Left, mSelLight->getAABB().Top ); - eeAABB AB( mSelLight->getAABB() ); + Rectf AB( mSelLight->getAABB() ); mP.setFillMode( DRAW_LINE ); mP.drawRectangle( Rectf( Pos, AB.getSize() ) ); diff --git a/src/eepp/maps/maplight.cpp b/src/eepp/maps/maplight.cpp index 2486ef6ac..9f0f4ff8a 100755 --- a/src/eepp/maps/maplight.cpp +++ b/src/eepp/maps/maplight.cpp @@ -133,15 +133,15 @@ void MapLight::move( const Float& addtox, const Float& addtoy ) { updatePos( mPos.x + addtox, mPos.y + addtoy ); } -eeAABB MapLight::getAABB() const { +Rectf MapLight::getAABB() const { return mAABB; } void MapLight::updateAABB() { if ( mType == LIGHT_NORMAL ) - mAABB = eeAABB( mPos.x - mRadius, mPos.y - mRadius, mPos.x + mRadius, mPos.y + mRadius ); + mAABB = Rectf( mPos.x - mRadius, mPos.y - mRadius, mPos.x + mRadius, mPos.y + mRadius ); else - mAABB = eeAABB( mPos.x - mRadius, mPos.y - mRadius * 0.5f, mPos.x + mRadius, mPos.y + mRadius * 0.5f ); + mAABB = Rectf( mPos.x - mRadius, mPos.y - mRadius * 0.5f, mPos.x + mRadius, mPos.y + mRadius * 0.5f ); } const Float& MapLight::getRadius() const { diff --git a/src/eepp/maps/maplightmanager.cpp b/src/eepp/maps/maplightmanager.cpp index 69674964d..f9082012d 100644 --- a/src/eepp/maps/maplightmanager.cpp +++ b/src/eepp/maps/maplightmanager.cpp @@ -37,7 +37,7 @@ const bool& MapLightManager::isByVertex() const { void MapLightManager::updateByVertex() { Vector2i start = mMap->getStartTile(); Vector2i end = mMap->getEndTile(); - eeAABB VisibleArea = mMap->getViewAreaAABB(); + Rectf VisibleArea = mMap->getViewAreaAABB(); Sizei TileSize = mMap->getTileSize(); Color BaseColor = mMap->getBaseColor(); bool firstLight = true; @@ -61,7 +61,7 @@ void MapLightManager::updateByVertex() { Pos.x = x * TileSize.x; Pos.y = y * TileSize.y; - eeAABB TileAABB( Pos.x, Pos.y, Pos.x + TileSize.x, Pos.y + TileSize.y ); + Rectf TileAABB( Pos.x, Pos.y, Pos.x + TileSize.x, Pos.y + TileSize.y ); if ( TileAABB.intersect( Light->getAABB() ) ) { if ( y > 0 ) @@ -89,7 +89,7 @@ void MapLightManager::updateByVertex() { void MapLightManager::updateByTile() { Vector2i start = mMap->getStartTile(); Vector2i end = mMap->getEndTile(); - eeAABB VisibleArea = mMap->getViewAreaAABB(); + Rectf VisibleArea = mMap->getViewAreaAABB(); Sizei TileSize = mMap->getTileSize(); Sizei HalfTileSize = mMap->getTileSize() / 2; Color BaseColor = mMap->getBaseColor(); @@ -114,7 +114,7 @@ void MapLightManager::updateByTile() { Pos.x = x * TileSize.x; Pos.y = y * TileSize.y; - eeAABB TileAABB( Pos.x, Pos.y, Pos.x + TileSize.x, Pos.y + TileSize.y ); + Rectf TileAABB( Pos.x, Pos.y, Pos.x + TileSize.x, Pos.y + TileSize.y ); if ( TileAABB.intersect( Light->getAABB() ) ) { mTileColors[x][y][0]->assign( Light->processVertex( Pos.x + HalfTileSize.getWidth(), Pos.y + HalfTileSize.getHeight(), *(mTileColors[x][y][0]), *(mTileColors[x][y][0]) ) ); diff --git a/src/eepp/maps/mapobjectlayer.cpp b/src/eepp/maps/mapobjectlayer.cpp index 69312a33d..483730055 100644 --- a/src/eepp/maps/mapobjectlayer.cpp +++ b/src/eepp/maps/mapobjectlayer.cpp @@ -108,7 +108,7 @@ GameObject * MapObjectLayer::getObjectOver( const Vector2i& pos, SEARCH_TYPE typ tPos = tObj->getPosition(); tSize = tObj->getSize(); - Recti objR( tPos.x, tPos.y, tPos.x + tSize.x, tPos.y + tSize.y ); + Rect objR( tPos.x, tPos.y, tPos.x + tSize.x, tPos.y + tSize.y ); if ( objR.contains( pos ) ) return tObj; @@ -123,7 +123,7 @@ GameObject * MapObjectLayer::getObjectOver( const Vector2i& pos, SEARCH_TYPE typ tPos = tObj->getPosition(); tSize = tObj->getSize(); - Recti objR( tPos.x, tPos.y, tPos.x + tSize.x, tPos.y + tSize.y ); + Rect objR( tPos.x, tPos.y, tPos.x + tSize.x, tPos.y + tSize.y ); if ( objR.contains( pos ) ) return tObj; diff --git a/src/eepp/maps/tilemap.cpp b/src/eepp/maps/tilemap.cpp index ece8a6a3c..cb5e46b00 100644 --- a/src/eepp/maps/tilemap.cpp +++ b/src/eepp/maps/tilemap.cpp @@ -433,10 +433,10 @@ void TileMap::setScale( const Float& scale ) { } void TileMap::updateScreenAABB() { - mScreenAABB = eeAABB( -mOffset.x, -mOffset.y, -mOffset.x + mViewSize.getWidth(), -mOffset.y + mViewSize.getHeight() ); + mScreenAABB = Rectf( -mOffset.x, -mOffset.y, -mOffset.x + mViewSize.getWidth(), -mOffset.y + mViewSize.getHeight() ); } -const eeAABB& TileMap::getViewAreaAABB() const { +const Rectf& TileMap::getViewAreaAABB() const { return mScreenAABB; } diff --git a/src/eepp/ui/uicommondialog.cpp b/src/eepp/ui/uicommondialog.cpp index 42698c736..57c6657b2 100644 --- a/src/eepp/ui/uicommondialog.cpp +++ b/src/eepp/ui/uicommondialog.cpp @@ -45,12 +45,12 @@ UICommonDialog::UICommonDialog( Uint32 CDLFlags , std::string DefaultFilePattern } UILinearLayout * linearLayout = UILinearLayout::NewVertical(); - linearLayout->setLayoutSizeRules( MATCH_PARENT, MATCH_PARENT )->setLayoutMargin( Recti( 4, 2, 4, 2 ) )->setParent( getContainer() ); + linearLayout->setLayoutSizeRules( MATCH_PARENT, MATCH_PARENT )->setLayoutMargin( Rect( 4, 2, 4, 2 ) )->setParent( getContainer() ); UILinearLayout * hLayout = UILinearLayout::NewHorizontal(); - hLayout->setLayoutSizeRules( MATCH_PARENT, WRAP_CONTENT )->setLayoutMargin( Recti(0,0,0,4) )->setParent( linearLayout ); + hLayout->setLayoutSizeRules( MATCH_PARENT, WRAP_CONTENT )->setLayoutMargin( Rect(0,0,0,4) )->setParent( linearLayout ); - UITextView::New()->setText( "Look in:" )->setLayoutSizeRules( WRAP_CONTENT, MATCH_PARENT )->setLayoutMargin( Recti( 0, 0, 4, 0 ) ) + UITextView::New()->setText( "Look in:" )->setLayoutSizeRules( WRAP_CONTENT, MATCH_PARENT )->setLayoutMargin( Rect( 0, 0, 4, 0 ) ) ->setParent( hLayout )->setEnabled( false ); mPath = UITextInput::New(); @@ -62,16 +62,16 @@ UICommonDialog::UICommonDialog( Uint32 CDLFlags , std::string DefaultFilePattern mList = UIListBox::New(); mList->setParent( linearLayout ); - mList->setLayoutSizeRules( MATCH_PARENT, WRAP_CONTENT )->setLayoutWeight( 1 )->setLayoutMargin( Recti(0,0,0,4) ); + mList->setLayoutSizeRules( MATCH_PARENT, WRAP_CONTENT )->setLayoutWeight( 1 )->setLayoutMargin( Rect(0,0,0,4) ); hLayout = UILinearLayout::NewHorizontal(); - hLayout->setLayoutSizeRules( MATCH_PARENT, WRAP_CONTENT )->setLayoutMargin( Recti(0,0,0,4) )->setParent( linearLayout ); + hLayout->setLayoutSizeRules( MATCH_PARENT, WRAP_CONTENT )->setLayoutMargin( Rect(0,0,0,4) )->setParent( linearLayout ); UITextView::New()->setText( "File Name:" )->setLayoutSizeRules( FIXED, MATCH_PARENT )->setSize(74,0)->setParent( hLayout )->setEnabled( false ); mFile = UITextInput::New(); mFile->setLayoutSizeRules( WRAP_CONTENT, MATCH_PARENT )->setLayoutWeight( 1 )->setParent( hLayout ); - mFile->setLayoutMargin( Recti( 0, 0, 4, 0 ) ); + mFile->setLayoutMargin( Rect( 0, 0, 4, 0 ) ); mFile->addEventListener( UIEvent::EventOnPressEnter, cb::Make1( this, &UICommonDialog::onPressFileEnter ) ); mButtonOpen = UIPushButton::New(); @@ -87,7 +87,7 @@ UICommonDialog::UICommonDialog( Uint32 CDLFlags , std::string DefaultFilePattern mFiletype->setPopUpToMainControl( true ); mFiletype->getListBox()->addListBoxItem( DefaultFilePattern ); mFiletype->getListBox()->setSelected(0); - mFiletype->setLayoutMargin( Recti( 0, 0, 4, 0 ) ); + mFiletype->setLayoutMargin( Rect( 0, 0, 4, 0 ) ); mButtonCancel = UIPushButton::New(); mButtonCancel->setText( "Cancel" )->setLayoutSizeRules( FIXED, WRAP_CONTENT )->setSize(80,0)->setParent( hLayout ); diff --git a/src/eepp/ui/uicontrol.cpp b/src/eepp/ui/uicontrol.cpp index a3fd92371..87b90a560 100644 --- a/src/eepp/ui/uicontrol.cpp +++ b/src/eepp/ui/uicontrol.cpp @@ -211,8 +211,8 @@ void UIControl::setInternalPixelsHeight( const Int32& height ) { setInternalPixelsSize( Sizei( mRealSize.x, height ) ); } -Recti UIControl::getRect() const { - return Recti( mPos, mSize ); +Rect UIControl::getRect() const { + return Rect( mPos, mSize ); } const Sizei& UIControl::getSize() { @@ -1142,7 +1142,7 @@ const Vector2f& UIControl::getPolygonCenter() const { } void UIControl::updateQuad() { - mPoly = Polygon2f( eeAABB( mScreenPosf.x, mScreenPosf.y, mScreenPosf.x + mRealSize.getWidth(), mScreenPosf.y + mRealSize.getHeight() ) ); + mPoly = Polygon2f( Rectf( mScreenPosf.x, mScreenPosf.y, mScreenPosf.x + mRealSize.getWidth(), mScreenPosf.y + mRealSize.getHeight() ) ); UIControl * tParent = getParent(); @@ -1376,12 +1376,12 @@ void UIControl::applyDefaultTheme() { UIThemeManager::instance()->applyDefaultTheme( this ); } -Recti UIControl::getScreenRect() { - return Recti( mScreenPos, mRealSize ); +Rect UIControl::getScreenRect() { + return Rect( mScreenPos, mRealSize ); } -Recti UIControl::makePadding( bool PadLeft, bool PadRight, bool PadTop, bool PadBottom, bool SkipFlags ) { - Recti tPadding( 0, 0, 0, 0 ); +Rect UIControl::makePadding( bool PadLeft, bool PadRight, bool PadTop, bool PadBottom, bool SkipFlags ) { + Rect tPadding( 0, 0, 0, 0 ); if ( mFlags & UI_AUTO_PADDING || SkipFlags ) { if ( NULL != mSkinState && NULL != mSkinState->getSkin() ) { diff --git a/src/eepp/ui/uicontrolanim.cpp b/src/eepp/ui/uicontrolanim.cpp index 596e22249..48ce6ca9f 100644 --- a/src/eepp/ui/uicontrolanim.cpp +++ b/src/eepp/ui/uicontrolanim.cpp @@ -421,7 +421,7 @@ Color UIControlAnim::getColor( const Color& Col ) { } void UIControlAnim::updateQuad() { - mPoly = Polygon2f( eeAABB( mScreenPosf.x, mScreenPosf.y, mScreenPosf.x + mRealSize.getWidth(), mScreenPosf.y + mRealSize.getHeight() ) ); + mPoly = Polygon2f( Rectf( mScreenPosf.x, mScreenPosf.y, mScreenPosf.x + mRealSize.getWidth(), mScreenPosf.y + mRealSize.getHeight() ) ); mPoly.rotate( mAngle, getRotationCenter() ); mPoly.scale( mScale, getScaleCenter() ); diff --git a/src/eepp/ui/uidropdownlist.cpp b/src/eepp/ui/uidropdownlist.cpp index 81275c47f..2edb91c6f 100644 --- a/src/eepp/ui/uidropdownlist.cpp +++ b/src/eepp/ui/uidropdownlist.cpp @@ -127,7 +127,7 @@ void UIDropDownList::showList() { mListBox->setPosition( Pos ); if ( mListBox->getCount() ) { - Recti tPadding = mListBox->getContainerPadding(); + Rect tPadding = mListBox->getContainerPadding(); Float sliderValue = mListBox->getVerticalScrollBar()->getValue(); @@ -140,7 +140,7 @@ void UIDropDownList::showList() { mListBox->updateQuad(); Rectf aabb( mListBox->getPolygon().toAABB() ); - Recti aabbi( aabb.Left, aabb.Top, aabb.Right, aabb.Bottom ); + Rect aabbi( aabb.Left, aabb.Top, aabb.Right, aabb.Bottom ); if ( !UIManager::instance()->getMainControl()->getScreenRect().contains( aabbi ) ) { Pos = Vector2i( mPos.x, mPos.y ); diff --git a/src/eepp/ui/uilinearlayout.cpp b/src/eepp/ui/uilinearlayout.cpp index 347b87481..598d5f50c 100644 --- a/src/eepp/ui/uilinearlayout.cpp +++ b/src/eepp/ui/uilinearlayout.cpp @@ -115,7 +115,7 @@ void UILinearLayout::packVertical() { while ( NULL != ChildLoop ) { if ( ChildLoop->isWidget() ) { UIWidget * widget = static_cast( ChildLoop ); - Recti margin = widget->getLayoutMargin(); + Rect margin = widget->getLayoutMargin(); curY += margin.Top; @@ -216,7 +216,7 @@ void UILinearLayout::packHorizontal() { while ( NULL != ChildLoop ) { if ( ChildLoop->isWidget() && ChildLoop->isVisible() ) { UIWidget * widget = static_cast( ChildLoop ); - Recti margin = widget->getLayoutMargin(); + Rect margin = widget->getLayoutMargin(); curX += margin.Left; @@ -275,7 +275,7 @@ Sizei UILinearLayout::getTotalUsedSize() { while ( NULL != ChildLoop ) { if ( ChildLoop->isWidget() ) { UIWidget * widget = static_cast( ChildLoop ); - Recti margin = widget->getLayoutMargin(); + Rect margin = widget->getLayoutMargin(); size.x += margin.Left + margin.Right; diff --git a/src/eepp/ui/uilistbox.cpp b/src/eepp/ui/uilistbox.cpp index d95b1a68a..9559afd92 100644 --- a/src/eepp/ui/uilistbox.cpp +++ b/src/eepp/ui/uilistbox.cpp @@ -734,7 +734,7 @@ Graphics::Font * UIListBox::getFont() const { return mFontStyleConfig.Font; } -void UIListBox::setContainerPadding( const Recti& Padding ) { +void UIListBox::setContainerPadding( const Rect& Padding ) { if ( Padding != mContainerPadding ) { mContainerPadding = Padding; @@ -743,7 +743,7 @@ void UIListBox::setContainerPadding( const Recti& Padding ) { } } -const Recti& UIListBox::getContainerPadding() const { +const Rect& UIListBox::getContainerPadding() const { return mContainerPadding; } @@ -1009,15 +1009,15 @@ void UIListBox::loadFromXmlNode(const pugi::xml_node & node) { setFont( font ); } else if ( "padding" == name ) { int val = ait->as_int(); - setContainerPadding( Recti( val, val, val, val ) ); + setContainerPadding( Rect( val, val, val, val ) ); } else if ( "paddingleft" == name ) { - setContainerPadding( Recti( ait->as_int(), mContainerPadding.Top, mContainerPadding.Right, mContainerPadding.Bottom ) ); + setContainerPadding( Rect( ait->as_int(), mContainerPadding.Top, mContainerPadding.Right, mContainerPadding.Bottom ) ); } else if ( "paddingright" == name ) { - setContainerPadding( Recti( mContainerPadding.Left, mContainerPadding.Top, ait->as_int(), mContainerPadding.Bottom ) ); + setContainerPadding( Rect( mContainerPadding.Left, mContainerPadding.Top, ait->as_int(), mContainerPadding.Bottom ) ); } else if ( "paddingtop" == name ) { - setContainerPadding( Recti( mContainerPadding.Left, ait->as_int(), mContainerPadding.Right, mContainerPadding.Bottom ) ); + setContainerPadding( Rect( mContainerPadding.Left, ait->as_int(), mContainerPadding.Right, mContainerPadding.Bottom ) ); } else if ( "paddingbottom" == name ) { - setContainerPadding( Recti( mContainerPadding.Left, mContainerPadding.Top, mContainerPadding.Right, ait->as_int() ) ); + setContainerPadding( Rect( mContainerPadding.Left, mContainerPadding.Top, mContainerPadding.Right, ait->as_int() ) ); } else if ( "verticalscrollmode" == name || "vscrollmode" == name ) { std::string val = ait->as_string(); if ( "auto" == val ) setVerticalScrollMode( UI_SCROLLBAR_AUTO ); diff --git a/src/eepp/ui/uimenu.cpp b/src/eepp/ui/uimenu.cpp index 7ec67fb7c..35a3e630c 100644 --- a/src/eepp/ui/uimenu.cpp +++ b/src/eepp/ui/uimenu.cpp @@ -508,7 +508,7 @@ Uint32 UIMenu::onKeyDown( const UIEventKey& Event ) { return UIWidget::onKeyDown( Event ); } -const Recti& UIMenu::getPadding() const { +const Rect& UIMenu::getPadding() const { return mStyleConfig.Padding; } @@ -574,8 +574,8 @@ void UIMenu::loadFromXmlNode( const pugi::xml_node& node ) { } void UIMenu::fixMenuPos( Vector2i& Pos, UIMenu * Menu, UIMenu * Parent, UIMenuSubMenu * SubMenu ) { - eeAABB qScreen( 0.f, 0.f, UIManager::instance()->getMainControl()->getRealSize().getWidth(), UIManager::instance()->getMainControl()->getRealSize().getHeight() ); - eeAABB qPos( Pos.x, Pos.y, Pos.x + Menu->getRealSize().getWidth(), Pos.y + Menu->getRealSize().getHeight() ); + Rectf qScreen( 0.f, 0.f, UIManager::instance()->getMainControl()->getRealSize().getWidth(), UIManager::instance()->getMainControl()->getRealSize().getHeight() ); + Rectf qPos( Pos.x, Pos.y, Pos.x + Menu->getRealSize().getWidth(), Pos.y + Menu->getRealSize().getHeight() ); if ( NULL != Parent && NULL != SubMenu ) { Vector2i addToPos( 0, 0 ); @@ -590,7 +590,7 @@ void UIMenu::fixMenuPos( Vector2i& Pos, UIMenu * Menu, UIMenu * Parent, UIMenuSu Vector2i pPos = Parent->getRealPosition(); Parent->controlToScreen( pPos ); - eeAABB qParent( pPos.x, pPos.y, pPos.x + Parent->getRealSize().getWidth(), pPos.y + Parent->getRealSize().getHeight() ); + Rectf qParent( pPos.x, pPos.y, pPos.x + Parent->getRealSize().getWidth(), pPos.y + Parent->getRealSize().getHeight() ); Pos.x = qParent.Right; Pos.y = sPos.y; diff --git a/src/eepp/ui/uimenucheckbox.cpp b/src/eepp/ui/uimenucheckbox.cpp index fb3691e90..15df7df90 100644 --- a/src/eepp/ui/uimenucheckbox.cpp +++ b/src/eepp/ui/uimenucheckbox.cpp @@ -80,7 +80,7 @@ void UIMenuCheckBox::setActive( const bool& active ) { if ( !Menu->checkControlSize( this ) ) { if ( NULL != getIcon()->getDrawable() ) { - setPadding( Recti( 0, 0, 0, 0 ) ); + setPadding( Rect( 0, 0, 0, 0 ) ); } } diff --git a/src/eepp/ui/uimessagebox.cpp b/src/eepp/ui/uimessagebox.cpp index fb6e3fb83..a932c5844 100644 --- a/src/eepp/ui/uimessagebox.cpp +++ b/src/eepp/ui/uimessagebox.cpp @@ -22,7 +22,7 @@ UIMessageBox::UIMessageBox( UI_MSGBOX_TYPE type , String message ) : UILinearLayout * vlay = UILinearLayout::NewVertical(); vlay->setLayoutSizeRules( WRAP_CONTENT, WRAP_CONTENT ) - ->setLayoutMargin( Recti( 8, 8, 8, 8) )->setParent( rlay ); + ->setLayoutMargin( Rect( 8, 8, 8, 8) )->setParent( rlay ); mTextBox = UITextView::New(); mTextBox->setText( message ) @@ -30,7 +30,7 @@ UIMessageBox::UIMessageBox( UI_MSGBOX_TYPE type , String message ) : ->setParent( vlay ); UILinearLayout * hlay = UILinearLayout::NewHorizontal(); - hlay->setLayoutMargin( Recti( 0, 8, 0, 0 ) ) + hlay->setLayoutMargin( Rect( 0, 8, 0, 0 ) ) ->setLayoutSizeRules( WRAP_CONTENT, WRAP_CONTENT ) ->setLayoutGravity( UI_HALIGN_RIGHT | UI_VALIGN_CENTER ) ->setParent( vlay ); @@ -39,7 +39,7 @@ UIMessageBox::UIMessageBox( UI_MSGBOX_TYPE type , String message ) : mButtonOK->setSize( 90, 0 )->setParent( hlay ); mButtonCancel = UIPushButton::New(); - mButtonCancel->setLayoutMargin( Recti( 8, 0, 0, 0 ) )->setSize( 90, 0 )->setParent( hlay ); + mButtonCancel->setLayoutMargin( Rect( 8, 0, 0, 0 ) )->setSize( 90, 0 )->setParent( hlay ); switch ( mMsgBoxType ) { case MSGBOX_OKCANCEL: diff --git a/src/eepp/ui/uipushbutton.cpp b/src/eepp/ui/uipushbutton.cpp index 33e2fc64c..828b67130 100644 --- a/src/eepp/ui/uipushbutton.cpp +++ b/src/eepp/ui/uipushbutton.cpp @@ -133,7 +133,7 @@ void UIPushButton::onThemeLoaded() { mTextBox->setFont( mSkinState->getSkin()->getTheme()->getFontStyleConfig().getFont() ); if ( mControlFlags & UI_CTRL_FLAG_FREE_USE ) { - Recti RMargin = makePadding( true, false, false, false, true ); + Rect RMargin = makePadding( true, false, false, false, true ); mStyleConfig.IconHorizontalMargin = RMargin.Left; } @@ -172,11 +172,11 @@ const String& UIPushButton::getText() { return mTextBox->getText(); } -void UIPushButton::setPadding( const Recti& padding ) { +void UIPushButton::setPadding( const Rect& padding ) { mTextBox->setPadding( padding ); } -const Recti& UIPushButton::getPadding() const { +const Rect& UIPushButton::getPadding() const { return mTextBox->getPadding(); } diff --git a/src/eepp/ui/uiscrollview.cpp b/src/eepp/ui/uiscrollview.cpp index a19a6ceea..336938a4e 100644 --- a/src/eepp/ui/uiscrollview.cpp +++ b/src/eepp/ui/uiscrollview.cpp @@ -1,5 +1,6 @@ #include #include +#include namespace EE { namespace UI { @@ -198,4 +199,35 @@ bool UIScrollView::isTouchOverAllowedChilds() { return isMouseOverMeOrChilds() && mScrollView->isMouseOver() && ret; } +void UIScrollView::loadFromXmlNode( const pugi::xml_node& node ) { + UIWidget::loadFromXmlNode( node ); + + for (pugi::xml_attribute_iterator ait = node.attributes_begin(); ait != node.attributes_end(); ++ait) { + std::string name = ait->name(); + String::toLowerInPlace( name ); + + if ( "type" == name ) { + std::string val( ait->as_string() ); + String::toLowerInPlace( val ); + + if ( "inclusive" == val ) setViewType( Inclusive ); + else if ( "exclusive" == val ) setViewType( Exclusive ); + } else if ( "vscroll_mode" == name ) { + std::string val( ait->as_string() ); + String::toLowerInPlace( val ); + + if ( "on" == val ) setVerticalScrollMode( UI_SCROLLBAR_ALWAYS_ON ); + else if ( "off" == val ) setVerticalScrollMode( UI_SCROLLBAR_ALWAYS_ON ); + else if ( "auto" == val ) setVerticalScrollMode( UI_SCROLLBAR_AUTO ); + } else if ( "hscroll_mode" == name ) { + std::string val( ait->as_string() ); + String::toLowerInPlace( val ); + + if ( "on" == val ) setHorizontalScrollMode( UI_SCROLLBAR_ALWAYS_ON ); + else if ( "off" == val ) setHorizontalScrollMode( UI_SCROLLBAR_ALWAYS_ON ); + else if ( "auto" == val ) setHorizontalScrollMode( UI_SCROLLBAR_AUTO ); + } + } +} + }} diff --git a/src/eepp/ui/uispinbox.cpp b/src/eepp/ui/uispinbox.cpp index 5c28de40f..1b0f72fae 100644 --- a/src/eepp/ui/uispinbox.cpp +++ b/src/eepp/ui/uispinbox.cpp @@ -95,11 +95,11 @@ void UISpinBox::adjustChilds() { mPushDown->setPosition( mSize.getWidth() - mPushDown->getSize().getWidth(), mInput->getPosition().y + mPushUp->getSize().getHeight() ); } -void UISpinBox::setPadding( const Recti& padding ) { +void UISpinBox::setPadding( const Rect& padding ) { mInput->setPadding( padding ); } -const Recti& UISpinBox::getPadding() const { +const Rect& UISpinBox::getPadding() const { return mInput->getPadding(); } diff --git a/src/eepp/ui/uitable.cpp b/src/eepp/ui/uitable.cpp index 9d8cab6ed..c7be6d461 100644 --- a/src/eepp/ui/uitable.cpp +++ b/src/eepp/ui/uitable.cpp @@ -593,11 +593,11 @@ UITable * UITable::setSmoothScroll(bool smoothScroll) { return this; } -Recti UITable::getContainerPadding() const { +Rect UITable::getContainerPadding() const { return mContainerPadding; } -void UITable::setContainerPadding(const Recti & containerPadding) { +void UITable::setContainerPadding(const Rect & containerPadding) { if ( containerPadding != mContainerPadding ) { mContainerPadding = containerPadding; containerResize(); diff --git a/src/eepp/ui/uitextview.cpp b/src/eepp/ui/uitextview.cpp index bb0d5e659..0c3e8e5d1 100644 --- a/src/eepp/ui/uitextview.cpp +++ b/src/eepp/ui/uitextview.cpp @@ -462,11 +462,11 @@ void UITextView::setFontStyleConfig( const UITooltipStyleConfig& fontStyleConfig setOutlineColor( mFontStyleConfig.getOutlineColor() ); } -const Recti& UITextView::getPadding() const { +const Rect& UITextView::getPadding() const { return mPadding; } -UITextView * UITextView::setPadding(const Recti & padding) { +UITextView * UITextView::setPadding(const Rect & padding) { if ( padding != mPadding ) { mPadding = padding; mRealPadding = PixelDensity::dpToPxI( mPadding ); @@ -536,15 +536,15 @@ void UITextView::loadFromXmlNode(const pugi::xml_node & node) { setOutlineColor( Color::fromString( ait->as_string() ) ); } else if ( "padding" == name ) { int val = PixelDensity::toDpFromStringI( ait->as_string() ); - setPadding( Recti( val, val, val, val ) ); + setPadding( Rect( val, val, val, val ) ); } else if ( "paddingleft" == name ) { - setPadding( Recti( PixelDensity::toDpFromStringI( ait->as_string() ), mPadding.Top, mPadding.Right, mPadding.Bottom ) ); + setPadding( Rect( PixelDensity::toDpFromStringI( ait->as_string() ), mPadding.Top, mPadding.Right, mPadding.Bottom ) ); } else if ( "paddingright" == name ) { - setPadding( Recti( mPadding.Left, mPadding.Top, PixelDensity::toDpFromStringI( ait->as_string() ), mPadding.Bottom ) ); + setPadding( Rect( mPadding.Left, mPadding.Top, PixelDensity::toDpFromStringI( ait->as_string() ), mPadding.Bottom ) ); } else if ( "paddingtop" == name ) { - setPadding( Recti( mPadding.Left, PixelDensity::toDpFromStringI( ait->as_string() ), mPadding.Right, mPadding.Bottom ) ); + setPadding( Rect( mPadding.Left, PixelDensity::toDpFromStringI( ait->as_string() ), mPadding.Right, mPadding.Bottom ) ); } else if ( "paddingbottom" == name ) { - setPadding( Recti( mPadding.Left, mPadding.Top, mPadding.Right, PixelDensity::toDpFromStringI( ait->as_string() ) ) ); + setPadding( Rect( mPadding.Left, mPadding.Top, mPadding.Right, PixelDensity::toDpFromStringI( ait->as_string() ) ) ); } } } diff --git a/src/eepp/ui/uithemedefault.cpp b/src/eepp/ui/uithemedefault.cpp index d783ef8a7..deb9d1a95 100644 --- a/src/eepp/ui/uithemedefault.cpp +++ b/src/eepp/ui/uithemedefault.cpp @@ -75,7 +75,7 @@ UISliderStyleConfig UIThemeDefault::getSliderStyleConfig() { UITooltipStyleConfig UIThemeDefault::getTooltipStyleConfig() { UITooltipStyleConfig tooltipStyleConfig = UITheme::getTooltipStyleConfig(); tooltipStyleConfig.FontColor = Color( 0, 0, 0, 255 ); - tooltipStyleConfig.Padding = Recti( 4, 6, 4, 6 ); + tooltipStyleConfig.Padding = Rect( 4, 6, 4, 6 ); return tooltipStyleConfig; } diff --git a/src/eepp/ui/uitooltip.cpp b/src/eepp/ui/uitooltip.cpp index 354daf07d..89415fe22 100644 --- a/src/eepp/ui/uitooltip.cpp +++ b/src/eepp/ui/uitooltip.cpp @@ -60,7 +60,7 @@ void UITooltip::setTheme( UITheme * Theme ) { } void UITooltip::autoPadding() { - if ( ( mFlags & UI_AUTO_PADDING ) && mStyleConfig.Padding == Recti() ) { + if ( ( mFlags & UI_AUTO_PADDING ) && mStyleConfig.Padding == Rect() ) { setPadding( makePadding( true, true, true, true ) ); } } @@ -208,12 +208,12 @@ void UITooltip::onFontChanged() { sendCommonEvent( UIEvent::EventOnFontChanged ); } -void UITooltip::setPadding( const Recti& padding ) { +void UITooltip::setPadding( const Rect& padding ) { mStyleConfig.Padding = padding; mRealPadding = PixelDensity::dpToPxI( mStyleConfig.Padding ); } -const Recti& UITooltip::getPadding() const { +const Rect& UITooltip::getPadding() const { return mStyleConfig.Padding; } @@ -264,7 +264,7 @@ UITooltipStyleConfig UITooltip::getStyleConfig() const { void UITooltip::setStyleConfig(const UITooltipStyleConfig & styleConfig) { mStyleConfig = styleConfig; - if ( mStyleConfig.Padding != Recti() ) + if ( mStyleConfig.Padding != Rect() ) setPadding( mStyleConfig.Padding ); setFont( mStyleConfig.Font ); diff --git a/src/eepp/ui/uiwidget.cpp b/src/eepp/ui/uiwidget.cpp index f7302f113..d5cc21a7f 100644 --- a/src/eepp/ui/uiwidget.cpp +++ b/src/eepp/ui/uiwidget.cpp @@ -39,15 +39,15 @@ bool UIWidget::isType( const Uint32& type ) const { void UIWidget::updateAnchorsDistances() { if ( NULL != mParentCtrl ) { - mDistToBorder = Recti( mRealPos.x, mRealPos.y, mParentCtrl->getRealSize().x - ( mRealPos.x + mRealSize.x ), mParentCtrl->getRealSize().y - ( mRealPos.y + mRealSize.y ) ); + mDistToBorder = Rect( mRealPos.x, mRealPos.y, mParentCtrl->getRealSize().x - ( mRealPos.x + mRealSize.x ), mParentCtrl->getRealSize().y - ( mRealPos.y + mRealSize.y ) ); } } -Recti UIWidget::getLayoutMargin() const { +Rect UIWidget::getLayoutMargin() const { return mLayoutMargin; } -UIWidget * UIWidget::setLayoutMargin(const Recti & margin) { +UIWidget * UIWidget::setLayoutMargin(const Rect & margin) { mLayoutMargin = margin; mRealMargin = PixelDensity::dpToPxI( margin ); notifyLayoutAttrChange(); @@ -441,15 +441,15 @@ void UIWidget::loadFromXmlNode( const pugi::xml_node& node ) { } } else if ( "layout_margin" == name ) { int val = PixelDensity::toDpFromStringI( ait->as_string() ); - setLayoutMargin( Recti( val, val, val, val ) ); + setLayoutMargin( Rect( val, val, val, val ) ); } else if ( "layout_marginleft" == name ) { - setLayoutMargin( Recti( PixelDensity::toDpFromStringI( ait->as_string() ), mLayoutMargin.Top, mLayoutMargin.Right, mLayoutMargin.Bottom ) ); + setLayoutMargin( Rect( PixelDensity::toDpFromStringI( ait->as_string() ), mLayoutMargin.Top, mLayoutMargin.Right, mLayoutMargin.Bottom ) ); } else if ( "layout_marginright" == name ) { - setLayoutMargin( Recti( mLayoutMargin.Left, mLayoutMargin.Top, PixelDensity::toDpFromStringI( ait->as_string() ), mLayoutMargin.Bottom ) ); + setLayoutMargin( Rect( mLayoutMargin.Left, mLayoutMargin.Top, PixelDensity::toDpFromStringI( ait->as_string() ), mLayoutMargin.Bottom ) ); } else if ( "layout_margintop" == name ) { - setLayoutMargin( Recti( mLayoutMargin.Left, PixelDensity::toDpFromStringI( ait->as_string() ), mLayoutMargin.Right, mLayoutMargin.Bottom ) ); + setLayoutMargin( Rect( mLayoutMargin.Left, PixelDensity::toDpFromStringI( ait->as_string() ), mLayoutMargin.Right, mLayoutMargin.Bottom ) ); } else if ( "layout_marginbottom" == name ) { - setLayoutMargin( Recti( mLayoutMargin.Left, mLayoutMargin.Top, mLayoutMargin.Right, PixelDensity::toDpFromStringI( ait->as_string() ) ) ); + setLayoutMargin( Rect( mLayoutMargin.Left, mLayoutMargin.Top, mLayoutMargin.Right, PixelDensity::toDpFromStringI( ait->as_string() ) ) ); } else if ( "tooltip" == name ) { setTooltipText( ait->as_string() ); } else if ( "layout_weight" == name ) { diff --git a/src/eepp/window/backend/SDL2/inputsdl2.cpp b/src/eepp/window/backend/SDL2/inputsdl2.cpp index 9ae600645..ac720555f 100644 --- a/src/eepp/window/backend/SDL2/inputsdl2.cpp +++ b/src/eepp/window/backend/SDL2/inputsdl2.cpp @@ -331,7 +331,7 @@ void InputSDL::init() { Vector2i mTempMouse; Vector2i mTempWinPos; - Recti mBordersSize; + Rect mBordersSize; SDL_GetGlobalMouseState( &mTempMouse.x, &mTempMouse.y ); SDL_GetWindowPosition( sdlw, &mTempWinPos.x, &mTempWinPos.y ); diff --git a/src/eepp/window/backend/SDL2/windowsdl2.cpp b/src/eepp/window/backend/SDL2/windowsdl2.cpp index 19397047f..87f868055 100644 --- a/src/eepp/window/backend/SDL2/windowsdl2.cpp +++ b/src/eepp/window/backend/SDL2/windowsdl2.cpp @@ -606,7 +606,7 @@ void WindowSDL::stopTextInput() { SDL_StopTextInput(); } -void WindowSDL::setTextInputRect( Recti& rect ) { +void WindowSDL::setTextInputRect( Rect& rect ) { SDL_Rect r; r.x = rect.Left; diff --git a/src/eepp/window/backend/SDL2/windowsdl2.hpp b/src/eepp/window/backend/SDL2/windowsdl2.hpp index 9561905e3..2de0a0900 100644 --- a/src/eepp/window/backend/SDL2/windowsdl2.hpp +++ b/src/eepp/window/backend/SDL2/windowsdl2.hpp @@ -67,7 +67,7 @@ class EE_API WindowSDL : public Window { void stopTextInput(); - void setTextInputRect( Recti& rect ); + void setTextInputRect( Rect& rect ); bool hasScreenKeyboardSupport(); diff --git a/src/eepp/window/input.cpp b/src/eepp/window/input.cpp index 1a8257b43..9e7600345 100644 --- a/src/eepp/window/input.cpp +++ b/src/eepp/window/input.cpp @@ -275,7 +275,7 @@ Vector2f Input::getMousePosf() { Vector2i Input::getMousePosFromView( const View& View ) { Vector2i RealMousePos = getMousePos(); - Recti RView = View.getView(); + Rect RView = View.getView(); return Vector2i( RealMousePos.x - RView.Left, RealMousePos.y - RView.Top ); } diff --git a/src/eepp/window/view.cpp b/src/eepp/window/view.cpp index d0fcbca77..ed0379470 100755 --- a/src/eepp/window/view.cpp +++ b/src/eepp/window/view.cpp @@ -15,7 +15,7 @@ View::View( const int& X, const int& Y, const int& Width, const int& Height ) : setView( X, Y, Width, Height ); } -View::View( const Recti& View ) : mNeedUpdate(true) { +View::View( const Rect& View ) : mNeedUpdate(true) { mView = View; calcCenter(); diff --git a/src/eepp/window/window.cpp b/src/eepp/window/window.cpp index 1d2d7b009..6ff05c753 100644 --- a/src/eepp/window/window.cpp +++ b/src/eepp/window/window.cpp @@ -111,7 +111,7 @@ void Window::setViewport( const Int32& x, const Int32& y, const Uint32& Width, c void Window::setView( const View& View ) { mCurrentView = &View; - Recti RView = mCurrentView->getView(); + Rect RView = mCurrentView->getView(); setViewport( RView.Left, RView.Top, RView.Right, RView.Bottom ); } @@ -486,7 +486,7 @@ bool Window::isTextInputActive() { void Window::stopTextInput() { } -void Window::setTextInputRect( Recti& rect ) { +void Window::setTextInputRect( Rect& rect ) { } bool Window::hasScreenKeyboardSupport() diff --git a/src/examples/sprites/sprites.cpp b/src/examples/sprites/sprites.cpp index 89232f325..9eaa56943 100644 --- a/src/examples/sprites/sprites.cpp +++ b/src/examples/sprites/sprites.cpp @@ -110,7 +110,7 @@ EE_MAIN_FUNC int main (int argc, char * argv []) for ( Int32 my = 0; my < 4; my++ ) { for( Int32 mx = 0; mx < 8; mx++ ) { // DestSize as 0,0 will use the SubTexture size - Rock.addFrame( RockId, Sizef( 0, 0 ), Vector2i( 0, 0 ), Recti( mx * 64, my * 64, mx * 64 + 64, my * 64 + 64 ) ); + Rock.addFrame( RockId, Sizef( 0, 0 ), Vector2i( 0, 0 ), Rect( mx * 64, my * 64, mx * 64 + 64, my * 64 + 64 ) ); } } diff --git a/src/test/eetest.cpp b/src/test/eetest.cpp index b14e418d9..3dab13a53 100644 --- a/src/test/eetest.cpp +++ b/src/test/eetest.cpp @@ -676,7 +676,7 @@ void EETest::createNewUI() { UILinearLayout * layPar = UILinearLayout::NewHorizontal(); layPar->setParent( layWin ); - layPar->setLayoutMargin( Recti( 10, 10, 10, 10 ) ); + layPar->setLayoutMargin( Rect( 10, 10, 10, 10 ) ); layPar->setLayoutSizeRules( MATCH_PARENT, WRAP_CONTENT ); layPar->setLayoutGravity( UI_VALIGN_CENTER | UI_HALIGN_CENTER ); layPar->setBackgroundFillEnabled( true )->setColor( 0x999999FF ); @@ -687,12 +687,12 @@ void EETest::createNewUI() { lay->setBackgroundFillEnabled( true )->setColor( 0x333333FF ); lay->setLayoutWeight( 0.7f ); - UITextView::New()->setText( "Text on test 1" )->setLayoutMargin( Recti( 10, 10, 10, 10 ) )->setLayoutSizeRules( WRAP_CONTENT, WRAP_CONTENT )->setParent( lay ); - UITextView::New()->setText( "Text on test 2" )->setLayoutMargin( Recti( 10, 10, 10, 10 ) )->setLayoutSizeRules( MATCH_PARENT, WRAP_CONTENT )->setParent( lay ); - UICheckBox::New()->setText( "Checkbox" )->setLayoutMargin( Recti( 10, 10, 10, 10 ) )->setLayoutSizeRules( MATCH_PARENT, WRAP_CONTENT )->setParent( lay ); - UITextView::New()->setText( "Text on test 3" )->setLayoutMargin( Recti( 10, 10, 10, 10 ) )->setLayoutSizeRules( MATCH_PARENT, WRAP_CONTENT )->setParent( lay ); - UITextView::New()->setText( "Text on test 4" )->setLayoutMargin( Recti( 10, 10, 10, 10 ) )->setLayoutSizeRules( MATCH_PARENT, WRAP_CONTENT )->setParent( lay ); - UITextInput::New()->setLayoutMargin( Recti( 10, 10, 10, 10 ) )->setLayoutSizeRules( MATCH_PARENT, WRAP_CONTENT )->setParent( lay ); + UITextView::New()->setText( "Text on test 1" )->setLayoutMargin( Rect( 10, 10, 10, 10 ) )->setLayoutSizeRules( WRAP_CONTENT, WRAP_CONTENT )->setParent( lay ); + UITextView::New()->setText( "Text on test 2" )->setLayoutMargin( Rect( 10, 10, 10, 10 ) )->setLayoutSizeRules( MATCH_PARENT, WRAP_CONTENT )->setParent( lay ); + UICheckBox::New()->setText( "Checkbox" )->setLayoutMargin( Rect( 10, 10, 10, 10 ) )->setLayoutSizeRules( MATCH_PARENT, WRAP_CONTENT )->setParent( lay ); + UITextView::New()->setText( "Text on test 3" )->setLayoutMargin( Rect( 10, 10, 10, 10 ) )->setLayoutSizeRules( MATCH_PARENT, WRAP_CONTENT )->setParent( lay ); + UITextView::New()->setText( "Text on test 4" )->setLayoutMargin( Rect( 10, 10, 10, 10 ) )->setLayoutSizeRules( MATCH_PARENT, WRAP_CONTENT )->setParent( lay ); + UITextInput::New()->setLayoutMargin( Rect( 10, 10, 10, 10 ) )->setLayoutSizeRules( MATCH_PARENT, WRAP_CONTENT )->setParent( lay ); UILinearLayout * lay2 = UILinearLayout::NewVertical(); lay2->setLayoutGravity( UI_HALIGN_CENTER | UI_VALIGN_CENTER ); @@ -700,15 +700,15 @@ void EETest::createNewUI() { lay2->setBackgroundFillEnabled( true )->setColor( Color::Black ); lay2->setLayoutWeight( 0.3f ); - UIPushButton::New()->setText( "PushButton" )->setLayoutMargin( Recti( 10, 10, 10, 10 ) )->setLayoutSizeRules( MATCH_PARENT, WRAP_CONTENT )->setLayoutGravity( UI_VALIGN_CENTER )->setParent( lay2 ); + UIPushButton::New()->setText( "PushButton" )->setLayoutMargin( Rect( 10, 10, 10, 10 ) )->setLayoutSizeRules( MATCH_PARENT, WRAP_CONTENT )->setLayoutGravity( UI_VALIGN_CENTER )->setParent( lay2 ); UIListBox * lbox = UIListBox::New(); - lbox->setLayoutMargin( Recti( 10, 10, 10, 10 ) )->setLayoutSizeRules( MATCH_PARENT, FIXED )->setSize( 0, 105 )->setParent( lay2 ); + lbox->setLayoutMargin( Rect( 10, 10, 10, 10 ) )->setLayoutSizeRules( MATCH_PARENT, FIXED )->setSize( 0, 105 )->setParent( lay2 ); lbox->addListBoxItems( { "This", "is", "a", "ListBox" } ); lay2->setParent( layPar ); lay->setParent( layPar ); UIDropDownList * drop = UIDropDownList::New(); - drop->setLayoutMargin( Recti( 10, 10, 10, 10 ) )->setLayoutSizeRules( MATCH_PARENT, WRAP_CONTENT )->setParent( layWin ); + drop->setLayoutMargin( Rect( 10, 10, 10, 10 ) )->setLayoutSizeRules( MATCH_PARENT, WRAP_CONTENT )->setParent( layWin ); drop->getListBox()->addListBoxItems( { "Car", "Bus", "Plane", "Submarine" } ); drop->getListBox()->setSelected(0); win->show(); @@ -720,13 +720,13 @@ void EETest::createNewUI() { UIRelativeLayout * rlay = UIRelativeLayout::New(); rlay->setParent( win2 ); rlay->setLayoutSizeRules( MATCH_PARENT, MATCH_PARENT ); - rlay->setLayoutMargin( Recti( 16, 16, 16, 16 ) ); + rlay->setLayoutMargin( Rect( 16, 16, 16, 16 ) ); rlay->setBackgroundFillEnabled( true )->setColor( 0x333333CC ); UIPushButton * ofBut = UIPushButton::New(); - ofBut->setText( "OK" )->setLayoutGravity( UI_VALIGN_BOTTOM | UI_HALIGN_RIGHT )->setLayoutMargin( Recti( 0, 0, 16, 16 ) )->setParent( rlay ); + ofBut->setText( "OK" )->setLayoutGravity( UI_VALIGN_BOTTOM | UI_HALIGN_RIGHT )->setLayoutMargin( Rect( 0, 0, 16, 16 ) )->setParent( rlay ); - UIPushButton::New()->setText( "Cancel" )->setLayoutGravity( UI_VALIGN_BOTTOM | UI_HALIGN_RIGHT )->setLayoutMargin( Recti( 0, 0, 8, 0 ) ) + UIPushButton::New()->setText( "Cancel" )->setLayoutGravity( UI_VALIGN_BOTTOM | UI_HALIGN_RIGHT )->setLayoutMargin( Rect( 0, 0, 8, 0 ) ) ->setLayoutPositionRule( LEFT_OF, ofBut )->setParent( rlay ); win2->show(); @@ -828,7 +828,7 @@ void EETest::createDecoratedWindow() { WinMenu->addMenuButton( "Edit", PopMenu2 ); UIPushButton * Button = UIPushButton::New(); - Button->setLayoutMargin( Recti( 5, 5, 5, 5 ) ); + Button->setLayoutMargin( Rect( 5, 5, 5, 5 ) ); Button->setText( "Click Me" ); Button->setLayoutSizeRules( MATCH_PARENT, WRAP_CONTENT )->setParent( lay ); Button->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &EETest::onButtonClick ) ); @@ -836,7 +836,7 @@ void EETest::createDecoratedWindow() { mUIWindow->addShortcut( KEY_C, KEYMOD_ALT, Button ); UITabWidget * TabWidget = UITabWidget::New(); - TabWidget->setLayoutMargin( Recti( 5, 5, 5, 5 ) ) + TabWidget->setLayoutMargin( Rect( 5, 5, 5, 5 ) ) ->setLayoutWeight( 1 ) ->setLayoutSizeRules( MATCH_PARENT, WRAP_CONTENT ) ->setParent( lay )->setFlags( UI_HALIGN_CENTER | UI_VALIGN_CENTER ); @@ -1086,7 +1086,7 @@ void EETest::loadTextures() { for ( Int32 my = 0; my < 4; my++ ) for( Int32 mx = 0; mx < 8; mx++ ) - SP.addFrame( TN[4], Sizef( 0, 0 ), Vector2i( 0, 0 ), Recti( mx * 64, my * 64, mx * 64 + 64, my * 64 + 64 ) ); + SP.addFrame( TN[4], Sizef( 0, 0 ), Vector2i( 0, 0 ), Rect( mx * 64, my * 64, mx * 64 + 64, my * 64 + 64 ) ); PS[0].setCallbackReset( cb::Make2( this, &EETest::particlesCallback ) ); PS[0].create( PSE_Callback, 500, TN[5], Vector2f( 0, 0 ), 16, true );