From fdf67752a3c6cde06a5691b6a3323bbb96fdb448 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=ADn=20Lucas=20Golini?= Date: Fri, 17 Feb 2017 19:16:39 -0300 Subject: [PATCH] Math module improvements. --HG-- branch : dev --- include/eepp/math/interpolation.hpp | 16 +- include/eepp/math/mtrand.hpp | 20 +-- include/eepp/math/perlinnoise.hpp | 26 ++-- include/eepp/math/polygon2.hpp | 40 ++--- include/eepp/math/rect.hpp | 28 ++-- include/eepp/math/size.hpp | 18 +-- include/eepp/math/waypoints.hpp | 16 +- src/eepp/gaming/gameobjectobject.cpp | 4 +- src/eepp/gaming/gameobjectpolygon.cpp | 2 +- src/eepp/gaming/mapeditor/mapeditor.cpp | 98 ++++++------- .../gaming/mapeditor/maplayerproperties.cpp | 14 +- .../gaming/mapeditor/mapobjectproperties.cpp | 14 +- .../gaming/mapeditor/tilemapproperties.cpp | 24 +-- src/eepp/gaming/mapeditor/uigotypenew.cpp | 4 +- src/eepp/gaming/mapeditor/uimap.cpp | 6 +- src/eepp/gaming/mapeditor/uimaplayernew.cpp | 4 +- src/eepp/gaming/mapeditor/uimapnew.cpp | 56 +++---- src/eepp/gaming/maplightmanager.cpp | 12 +- src/eepp/gaming/objectlayer.cpp | 2 +- src/eepp/gaming/tilemap.cpp | 26 ++-- src/eepp/gaming/tilemaplayer.cpp | 8 +- src/eepp/graphics/batchrenderer.cpp | 8 +- src/eepp/graphics/image.cpp | 2 +- src/eepp/graphics/primitives.cpp | 28 ++-- src/eepp/graphics/scrollparallax.cpp | 32 ++-- src/eepp/graphics/sprite.cpp | 4 +- src/eepp/graphics/subtexture.cpp | 16 +- src/eepp/graphics/texture.cpp | 6 +- src/eepp/graphics/ttffont.cpp | 2 +- src/eepp/math/interpolation.cpp | 16 +- src/eepp/math/mtrand.cpp | 40 ++--- src/eepp/math/perlinnoise.cpp | 2 +- src/eepp/math/waypoints.cpp | 16 +- src/eepp/ui/tools/textureatlaseditor.cpp | 38 ++--- src/eepp/ui/tools/textureatlasnew.cpp | 10 +- .../ui/tools/textureatlassubtextureeditor.cpp | 6 +- src/eepp/ui/uicheckbox.cpp | 4 +- src/eepp/ui/uicombobox.cpp | 6 +- src/eepp/ui/uicommondialog.cpp | 48 +++--- src/eepp/ui/uicomplexcontrol.cpp | 18 +-- src/eepp/ui/uicontrol.cpp | 36 ++--- src/eepp/ui/uicontrolanim.cpp | 24 +-- src/eepp/ui/uidropdownlist.cpp | 14 +- src/eepp/ui/uigenericgrid.cpp | 50 +++---- src/eepp/ui/uigfx.cpp | 8 +- src/eepp/ui/uilistbox.cpp | 56 +++---- src/eepp/ui/uimenu.cpp | 66 ++++----- src/eepp/ui/uimenusubmenu.cpp | 4 +- src/eepp/ui/uimessagebox.cpp | 24 +-- src/eepp/ui/uiprogressbar.cpp | 22 +-- src/eepp/ui/uipushbutton.cpp | 10 +- src/eepp/ui/uiradiobutton.cpp | 4 +- src/eepp/ui/uiscrollbar.cpp | 24 +-- src/eepp/ui/uiseparator.cpp | 2 +- src/eepp/ui/uiskincomplex.cpp | 46 +++--- src/eepp/ui/uislider.cpp | 52 +++---- src/eepp/ui/uispinbox.cpp | 8 +- src/eepp/ui/uisprite.cpp | 8 +- src/eepp/ui/uitab.cpp | 6 +- src/eepp/ui/uitabwidget.cpp | 26 ++-- src/eepp/ui/uitextbox.cpp | 10 +- src/eepp/ui/uitextedit.cpp | 72 ++++----- src/eepp/ui/uitextinput.cpp | 6 +- src/eepp/ui/uitextinputpassword.cpp | 8 +- src/eepp/ui/uitooltip.cpp | 8 +- src/eepp/ui/uiwindow.cpp | 138 +++++++++--------- src/eepp/ui/uiwinmenu.cpp | 16 +- src/eepp/window/backend/SDL2/windowsdl2.cpp | 14 +- src/eepp/window/backend/SFML/windowsfml.cpp | 4 +- src/eepp/window/window.cpp | 2 +- .../external_shader/external_shader.cpp | 2 +- src/examples/sprites/sprites.cpp | 10 +- src/examples/vbo_fbo_batch/vbo_fbo_batch.cpp | 6 +- src/test/eetest.cpp | 12 +- 74 files changed, 769 insertions(+), 769 deletions(-) diff --git a/include/eepp/math/interpolation.hpp b/include/eepp/math/interpolation.hpp index 7109991b1..45ffe883e 100644 --- a/include/eepp/math/interpolation.hpp +++ b/include/eepp/math/interpolation.hpp @@ -65,10 +65,10 @@ class EE_API Interpolation { const Float& getRealPos() const; /** @return If movement interpolation is a loop */ - const bool& loop() const; + const bool& getLoop() const; /** Set if loop the movement interpolation */ - void loop( const bool& loop ); + void setLoop( const bool& loop ); /** Clear all the points */ void clearWaypoints(); @@ -77,15 +77,15 @@ class EE_API Interpolation { const bool& ended() const; /** Set the current interpolation speed */ - void speed( const Float speed ); + void setSpeed( const Float speed ); /** Get the current interpolation speed */ - const Float& speed() const; + const Float& getSpeed() const; /** @return If enabled */ - const bool& enabled() const; + const bool& isEnabled() const; - void enabled( const bool& enabled ); + void setEnabled( const bool& enabled ); /** Instead if setting the time between every waypoing, this set a total time for all the movement interpolation. */ void setTotalTime( const Time& TotTime ); @@ -106,10 +106,10 @@ class EE_API Interpolation { const Float& getEndPos(); /** Set the type of interpolation to be used */ - void type( Ease::Interpolation InterpolationType ); + void setType( Ease::Interpolation InterpolationType ); /** @return The type of the interpolation */ - const int& type() const; + const int& getType() const; protected: int mType; bool mEnable; diff --git a/include/eepp/math/mtrand.hpp b/include/eepp/math/mtrand.hpp index a62567039..d24fda67d 100755 --- a/include/eepp/math/mtrand.hpp +++ b/include/eepp/math/mtrand.hpp @@ -84,34 +84,34 @@ class EE_API MTRand { MTRand& operator=( const MTRand& o ); /** @return integer in [0,2^32-1] */ - Uint32 randi(); + Uint32 getRandi(); /** @return integer in [0,n] for n < 2^32 */ - Uint32 randi( const Uint32 n ); + Uint32 getRandi( const Uint32 n ); /** @return real number in [0,1] */ - double rand(); + double getRand(); /** @return real number in [0,n] */ - double rand( const double n ); + double getRand( const double n ); /** Set a new seed */ - void seed( const Uint32 oneSeed ); + void setSeed( const Uint32 oneSeed ); /** Set the default seed */ - void seed(); + void setSeed(); /** @return float number in [0,1] */ - Float randf(); + Float getRandf(); /** @return float number in [0,n] */ - Float randf( const Float n ); + Float getRandf( const Float n ); /** @return int number in [Min,Max] */ - int randRange( int Min, int Max ); + int getRandFromRange( int Min, int Max ); /** @return float number in [Min,Max] */ - Float randRange( Float Min, Float Max ); + Float getRandFromRange( Float Min, Float Max ); /** Save the state to an allocated array */ void save( Uint32* saveArray ) const; diff --git a/include/eepp/math/perlinnoise.hpp b/include/eepp/math/perlinnoise.hpp index d44a47448..16257e47b 100755 --- a/include/eepp/math/perlinnoise.hpp +++ b/include/eepp/math/perlinnoise.hpp @@ -23,31 +23,31 @@ class EE_API PerlinNoise { void init(); /** @return The noise value for the 2D coordinates */ - Float perlinNoise2D(Float x, Float y); + Float getPerlinNoise2D(Float x, Float y); - void octaves( const int& octaves ) { mOctaves = octaves; } + void setOctaves( const int& octaves ) { mOctaves = octaves; } - void persistence( const Float& pers) { mPersistence = pers; } + void setPersistence( const Float& pers) { mPersistence = pers; } - void frequency( const Float& freq ) { mFrequency = freq; } + void setFrequency( const Float& freq ) { mFrequency = freq; } - void amplitude( const Float& amp ) { mAmplitude = amp; } + void setAmplitude( const Float& amp ) { mAmplitude = amp; } - void frequencyOctaveDep( const bool& dep ) { mFreqOctaveDep = dep; } + void setFrequencyOctaveDep( const bool& dep ) { mFreqOctaveDep = dep; } - void amplitudeOctaveDep( const bool& dep ) { mAmpOctaveDep = dep; } + void setAmplitudeOctaveDep( const bool& dep ) { mAmpOctaveDep = dep; } - int octaves() const { return mOctaves; } + int getOctaves() const { return mOctaves; } - Float persistence() const { return mPersistence; } + Float getPersistence() const { return mPersistence; } - Float frequency() const { return mFrequency; } + Float getFrequency() const { return mFrequency; } - Float amplitude() const { return mAmplitude; } + Float getAmplitude() const { return mAmplitude; } - bool frequencyOctaveDep() const { return mFreqOctaveDep; } + bool getFrequencyOctaveDep() const { return mFreqOctaveDep; } - bool amplitudeOctaveDep() const { return mAmpOctaveDep; } + bool getAmplitudeOctaveDep() const { return mAmpOctaveDep; } protected: Float noise2D(Int32 x, Int32 y); diff --git a/include/eepp/math/polygon2.hpp b/include/eepp/math/polygon2.hpp index d667fe28b..187c56f33 100755 --- a/include/eepp/math/polygon2.hpp +++ b/include/eepp/math/polygon2.hpp @@ -60,28 +60,28 @@ class Polygon2 { } /** @return The number of vectors of the polygon */ - std::size_t size() const; + std::size_t getSize() const; /** @return The position of the polygon ( also known as the offset of the polygon ) */ - Vector2 position() { return Vector2(OffsetX, OffsetY); } + Vector2 getPosition() { return Vector2(OffsetX, OffsetY); } /** Move the polygon Vector2s, add to every point the distance specified */ void move( Vector2 dist ); /** @return The X position of the polygon ( the X-axis Offset ) */ - T x() const { return OffsetX; } + T getX() const { return OffsetX; } /** @return The Y position of the polygon ( the Y-axis Offset ) */ - T y() const { return OffsetY; } + T getY() const { return OffsetY; } /** @return The position of the polygon ( the offset )*/ - void position( const Vector2& V ) { OffsetX = V.x; OffsetY = V.y; } + void setPosition( const Vector2& V ) { OffsetX = V.x; OffsetY = V.y; } /** Set the new position of the x-axis ( the x-axis offset ) */ - T x( const T& x ) { OffsetX = x; } + T setX( const T& x ) { OffsetX = x; } /** Set the new position of the y-axis ( the y-axis offset ) */ - T y( const T& y ) { OffsetY = y; } + T setY( const T& y ) { OffsetY = y; } /** @return True if the polygons intersect */ bool intersect( const Polygon2& p1 ); @@ -192,7 +192,7 @@ const Vector2& Polygon2::operator[] ( const Uint32& Pos ) const { } template -std::size_t Polygon2::size() const { +std::size_t Polygon2::getSize() const { return Vector.size(); } @@ -295,7 +295,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI template bool Polygon2::pointInside( const Vector2& point ) { int i, j, c = 0; - int nvert = (int)size(); + int nvert = (int)getSize(); for ( i = 0, j = nvert - 1; i < nvert; j = i++ ) { if ( ( ( Vector[i].y > point.y ) != ( Vector[j].y > point.y ) ) && @@ -313,19 +313,19 @@ template bool Polygon2::intersect( const Polygon2& p1 ) { T min0, max0, min1, max1, sOffset, t; Vector2 vAxis, vOffset; - unsigned int i = 0, j = 0, n, size = this->size(); + unsigned int i = 0, j = 0, n, size = this->getSize(); - vOffset = Vector2( x() - p1.x(), y() - p1.y() ); + vOffset = Vector2( getX() - p1.getX(), getY() - p1.getY() ); for (i = 0; i < size; i++) { n = i + 1; - if ( n >= this->size() ) n = 0; + if ( n >= this->getSize() ) n = 0; vAxis = Line2( Vector[i], Vector[n] ).getNormal(); min0 = vAxis.Dot( Vector[0] ); max0 = min0; - for (j = 1; j < this->size(); j++) { + for (j = 1; j < this->getSize(); j++) { t = vAxis.Dot( Vector[j] ); if (t < min0) min0 = t; if (t > max0) max0 = t; @@ -333,7 +333,7 @@ bool Polygon2::intersect( const Polygon2& p1 ) { min1 = vAxis.Dot( p1[0] ); max1 = min1; - for (j = 1; j < p1.size(); j++) { + for (j = 1; j < p1.getSize(); j++) { t = vAxis.Dot( p1[j] ); if (t < min1) min1 = t; if (t > max1) max1 = t; @@ -348,15 +348,15 @@ bool Polygon2::intersect( const Polygon2& p1 ) { } } - for (i = 0; i < p1.size(); i++) { + for (i = 0; i < p1.getSize(); i++) { n = i + 1; - if ( n >= p1.size() ) n = 0; + if ( n >= p1.getSize() ) n = 0; vAxis = Line2( p1[i], p1[n] ).getNormal(); min0 = vAxis.Dot( Vector[0] ); max0 = min0; - for (j = 1; j < this->size(); j++) { + for (j = 1; j < this->getSize(); j++) { t = vAxis.Dot( Vector[j] ); if (t < min0) min0 = t; if (t > max0) max0 = t; @@ -364,7 +364,7 @@ bool Polygon2::intersect( const Polygon2& p1 ) { min1 = vAxis.Dot( p1[0] ); max1 = min1; - for (j = 1; j < p1.size(); j++) { + for (j = 1; j < p1.getSize(); j++) { t = vAxis.Dot( p1[j] ); if (t < min1) min1 = t; if (t > max1) max1 = t; @@ -389,8 +389,8 @@ bool Polygon2::intersectQuad2( const Quad2& q0, const Quad2& q1, const Polygon2 Tmp1 = Polygon2( q0 ); Polygon2 Tmp2 = Polygon2( q1 ); - Tmp1.position( q0Pos ); - Tmp1.position( q1Pos ); + Tmp1.setPosition( q0Pos ); + Tmp1.setPosition( q1Pos ); return Tmp1.intersect( Tmp2 ); } diff --git a/include/eepp/math/rect.hpp b/include/eepp/math/rect.hpp index 989cb3d76..a57c1702c 100755 --- a/include/eepp/math/rect.hpp +++ b/include/eepp/math/rect.hpp @@ -49,15 +49,15 @@ class tRECT { Vector2 wrapVector( const Vector2& Vect ); - Vector2 pos(); + Vector2 getPosition(); - Vector2 center(); + Vector2 getCenter(); - tSize size(); + tSize getSize(); - T width(); + T getWidth(); - T height(); + T getHeight(); void scale( T scale, const Vector2& center ); @@ -148,8 +148,8 @@ template tRECT::tRECT( const Vector2& Pos, const tSize& Size ) { Left = Pos.x; Top = Pos.y; - Right = Left + Size.width(); - Bottom = Top + Size.height(); + Right = Left + Size.getWidth(); + Bottom = Top + Size.getHeight(); } template @@ -171,27 +171,27 @@ bool tRECT::contains( const Vector2& Vect ) { } template -Vector2 tRECT::pos() { +Vector2 tRECT::getPosition() { return Vector2( Left, Top ); } template -Vector2 tRECT::center() { +Vector2 tRECT::getCenter() { return Vector2( Left + ( ( Right - Left ) * 0.5 ), Top + ( ( Bottom - Top ) * 0.5 ) ); } template -tSize tRECT::size() { +tSize tRECT::getSize() { return tSize( eeabs( Right - Left ), eeabs( Bottom - Top ) ); } template -T tRECT::width() { +T tRECT::getWidth() { return eeabs( Right - Left ); } template -T tRECT::height() { +T tRECT::getHeight() { return eeabs( Bottom - Top ); } @@ -303,12 +303,12 @@ void tRECT::scale( T scale, const Vector2& center ) { template void tRECT::scale( T scale ) { - scale( scale, center() ); + scale( scale, getCenter() ); } template void tRECT::scale( Vector2 scale ) { - scale( scale, center() ); + scale( scale, getCenter() ); } typedef tRECT Rectu; diff --git a/include/eepp/math/size.hpp b/include/eepp/math/size.hpp index aa4ddbab0..7fd6bd8ef 100644 --- a/include/eepp/math/size.hpp +++ b/include/eepp/math/size.hpp @@ -23,16 +23,16 @@ class tSize : public Vector2 tSize( const Vector2& Vec ); /** @return The size width */ - const T& width() const; + const T& getWidth() const; /** @return The size height */ - const T& height() const; + const T& getHeight() const; /** Set a new width */ - void width( const T& width ); + void setWidth( const T& width ); /** Set a new height */ - void height( const T& height ); + void setHeight( const T& height ); }; template @@ -49,7 +49,7 @@ tSize::tSize( const T& Width, const T& Height ) : template tSize::tSize( const tSize& Size ) : - Vector2( Size.width(), Size.height() ) + Vector2( Size.getWidth(), Size.getHeight() ) { } @@ -60,22 +60,22 @@ tSize::tSize( const Vector2& Vec ) : } template -const T& tSize::width() const { +const T& tSize::getWidth() const { return this->x; } template -const T& tSize::height() const { +const T& tSize::getHeight() const { return this->y; } template -void tSize::width( const T& width ) { +void tSize::setWidth( const T& width ) { this->x = width; } template -void tSize::height( const T& height ) { +void tSize::setHeight( const T& height ) { this->y = height; } diff --git a/include/eepp/math/waypoints.hpp b/include/eepp/math/waypoints.hpp index 2aff21a1b..c706c157d 100755 --- a/include/eepp/math/waypoints.hpp +++ b/include/eepp/math/waypoints.hpp @@ -66,10 +66,10 @@ class EE_API Waypoints { const Vector2f& getPos(); /** @return If movement interpolation is a loop */ - bool loop() const; + bool getLoop() const; /** Set if loop the movement interpolation */ - void loop( const bool& loop ); + void setLoop( const bool& loop ); /** Clear all the waypoints */ void clearWaypoints(); @@ -93,22 +93,22 @@ class EE_API Waypoints { const std::vector& getWaypoints() const; /** Set the current interpolation speed ( This will destroy the time of the interpolation and create one depending on the speed ) ( pixels per second ) */ - void speed( const Float& speed ); + void setSpeed( const Float& speed ); /** Get the current interpolation speed */ - const Float& speed() const; + const Float& getSpeed() const; /** @return If enabled */ - const bool& enabled() const; + const bool& isEnabled() const; /** Set it enabled or not */ - void enabled( const bool& enabled ); + void setEnabled( const bool& enabled ); /** Set the type of interpolation to be used */ - void type( Ease::Interpolation InterpolationType ); + void setType( Ease::Interpolation InterpolationType ); /** @return The type of the interpolation */ - const int& type() const; + const int& getType() const; protected: int mType; bool mEnable; diff --git a/src/eepp/gaming/gameobjectobject.cpp b/src/eepp/gaming/gameobjectobject.cpp index 545b3faf1..7e9cbfacf 100644 --- a/src/eepp/gaming/gameobjectobject.cpp +++ b/src/eepp/gaming/gameobjectobject.cpp @@ -12,7 +12,7 @@ GameObjectObject::GameObjectObject( Uint32 DataId, const Rectf& rect, MapLayer * GameObject( Flags, Layer ), mRect( rect ), mPoly( rect ), - mPos( mRect.pos() ), + mPos( mRect.getPosition() ), mDataId( DataId ), mSelected( false ) { @@ -30,7 +30,7 @@ bool GameObjectObject::IsType( const Uint32& type ) { } Sizei GameObjectObject::Size() { - Sizef size( mRect.size() ); + Sizef size( mRect.getSize() ); return Sizei( size.x, size.y ); } diff --git a/src/eepp/gaming/gameobjectpolygon.cpp b/src/eepp/gaming/gameobjectpolygon.cpp index e5242ac7c..487345c37 100644 --- a/src/eepp/gaming/gameobjectpolygon.cpp +++ b/src/eepp/gaming/gameobjectpolygon.cpp @@ -24,7 +24,7 @@ bool GameObjectPolygon::IsType( const Uint32& type ) { } Sizei GameObjectPolygon::Size() { - return Sizei( mRect.size().x, mRect.size().y ); + return Sizei( mRect.getSize().x, mRect.getSize().y ); } void GameObjectPolygon::Draw() { diff --git a/src/eepp/gaming/mapeditor/mapeditor.cpp b/src/eepp/gaming/mapeditor/mapeditor.cpp index f2e7deb98..044874c6e 100644 --- a/src/eepp/gaming/mapeditor/mapeditor.cpp +++ b/src/eepp/gaming/mapeditor/mapeditor.cpp @@ -87,8 +87,8 @@ void MapEditor::CreateWinMenu() { UIWinMenu * WinMenu = mTheme->createWinMenu( mUIContainer ); mTileBox = mTheme->createTextBox( "", mUIContainer, Sizei(), Vector2i(), UI_HALIGN_RIGHT | UI_VALIGN_CENTER | UI_ANCHOR_TOP | UI_ANCHOR_RIGHT ); - mTileBox->size( 100, WinMenu->size().height() ); - mTileBox->position( Vector2i( mUIContainer->size().width() - mTileBox->size().width(), 0 ) ); + mTileBox->size( 100, WinMenu->size().getHeight() ); + mTileBox->position( Vector2i( mUIContainer->size().getWidth() - mTileBox->size().getWidth(), 0 ) ); mTileBox->updateAnchorsDistances(); UIPopUpMenu * PU1 = mTheme->createPopUpMenu( mUIContainer ); @@ -161,8 +161,8 @@ void MapEditor::CreateWinMenu() { UIComplexControl::CreateParams Params; Params.setParent( mUIContainer ); - Params.setPos( 0, WinMenu->size().height() ); - Params.setSize( mUIContainer->size().width(), mUIContainer->size().height() - WinMenu->size().height() ); + Params.setPos( 0, WinMenu->size().getHeight() ); + Params.setSize( mUIContainer->size().getWidth(), mUIContainer->size().getHeight() - WinMenu->size().getHeight() ); Params.Flags = UI_ANCHOR_TOP | UI_ANCHOR_BOTTOM | UI_ANCHOR_LEFT | UI_ANCHOR_RIGHT | UI_REPORT_SIZE_CHANGE_TO_CHILDS; mWinContainer = eeNew( UIComplexControl, ( Params ) ); mWinContainer->visible( true ); @@ -172,12 +172,12 @@ void MapEditor::CreateWinMenu() { void MapEditor::CreateETGMenu() { Int32 Width = 200; Int32 DistToBorder = 5; - Int32 ContPosX = mWinContainer->size().width() - Width - DistToBorder; + Int32 ContPosX = mWinContainer->size().getWidth() - Width - DistToBorder; Int32 DistFromTopMenu = 4; UIComplexControl::CreateParams CParams; CParams.setParent( mWinContainer ); - CParams.setSize( Sizei( Width + DistToBorder, mWinContainer->size().height() ) ); + CParams.setSize( Sizei( Width + DistToBorder, mWinContainer->size().getHeight() ) ); CParams.Flags = UI_CONTROL_DEFAULT_ALIGN | UI_ANCHOR_RIGHT | UI_ANCHOR_TOP; mSubTextureCont = eeNew( UIComplexControl, ( CParams ) ); mSubTextureCont->enabled( true ); @@ -187,7 +187,7 @@ void MapEditor::CreateETGMenu() { mObjectCont = eeNew( UIComplexControl, ( CParams ) ); - mTabWidget = mTheme->createTabWidget( mWinContainer, Sizei( Width + DistToBorder, mWinContainer->size().height() - DistFromTopMenu ), Vector2i( ContPosX, DistFromTopMenu ), UI_HALIGN_CENTER | UI_VALIGN_BOTTOM | UI_ANCHOR_RIGHT | UI_ANCHOR_TOP | UI_ANCHOR_BOTTOM ); + mTabWidget = mTheme->createTabWidget( mWinContainer, Sizei( Width + DistToBorder, mWinContainer->size().getHeight() - DistFromTopMenu ), Vector2i( ContPosX, DistFromTopMenu ), UI_HALIGN_CENTER | UI_VALIGN_BOTTOM | UI_ANCHOR_RIGHT | UI_ANCHOR_TOP | UI_ANCHOR_BOTTOM ); mTabWidget->addEventListener( UIEvent::EventOnTabSelected, cb::Make1( this, &MapEditor::OnTabSelected ) ); CreateTabs(); @@ -243,63 +243,63 @@ void MapEditor::CreateSubTextureContainer( Int32 Width ) { Txt = mTheme->createTextBox( "Add Game Object as...", mSubTextureCont, Sizei( Width, 16 ), Vector2i( TAB_CONT_X_DIST, 4 ), TxtFlags ); - mGOTypeList = mTheme->createDropDownList( mSubTextureCont, Sizei( Width - 26, 21 ), Vector2i( TAB_CONT_X_DIST, Txt->position().y + Txt->size().height() + 4 ), UI_CONTROL_DEFAULT_ALIGN | UI_CLIP_ENABLE | UI_AUTO_PADDING | UI_ANCHOR_RIGHT | UI_ANCHOR_TOP ); + mGOTypeList = mTheme->createDropDownList( mSubTextureCont, Sizei( Width - 26, 21 ), Vector2i( TAB_CONT_X_DIST, Txt->position().y + Txt->size().getHeight() + 4 ), UI_CONTROL_DEFAULT_ALIGN | UI_CLIP_ENABLE | UI_AUTO_PADDING | UI_ANCHOR_RIGHT | UI_ANCHOR_TOP ); mGOTypeList->addEventListener( UIEvent::EventOnItemSelected, cb::Make1( this, &MapEditor::OnTypeChange ) ); FillGotyList(); - mBtnGOTypeAdd = mTheme->createPushButton( mSubTextureCont, Sizei( 24, 21 ), Vector2i( mGOTypeList->position().x + mGOTypeList->size().width() + 2, mGOTypeList->position().y ), UI_CONTROL_ALIGN_CENTER | UI_AUTO_SIZE | UI_ANCHOR_RIGHT | UI_ANCHOR_TOP, mTheme->getIconByName( "add" ) ); + mBtnGOTypeAdd = mTheme->createPushButton( mSubTextureCont, Sizei( 24, 21 ), Vector2i( mGOTypeList->position().x + mGOTypeList->size().getWidth() + 2, mGOTypeList->position().y ), UI_CONTROL_ALIGN_CENTER | UI_AUTO_SIZE | UI_ANCHOR_RIGHT | UI_ANCHOR_TOP, mTheme->getIconByName( "add" ) ); mBtnGOTypeAdd->tooltipText( "Adds a new game object type\nunknown by the map editor." ); mBtnGOTypeAdd->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &MapEditor::AddNewGOType ) ); if ( NULL == mBtnGOTypeAdd->icon()->subTexture() ) mBtnGOTypeAdd->text( "..." ); - Txt = mTheme->createTextBox( "Layers:", mSubTextureCont, Sizei( Width, 16 ), Vector2i( TAB_CONT_X_DIST, mGOTypeList->position().y + mGOTypeList->size().height() + 4 ), TxtFlags ); + Txt = mTheme->createTextBox( "Layers:", mSubTextureCont, Sizei( Width, 16 ), Vector2i( TAB_CONT_X_DIST, mGOTypeList->position().y + mGOTypeList->size().getHeight() + 4 ), TxtFlags ); - mLayerList = mTheme->createDropDownList( mSubTextureCont, Sizei( Width, 21 ), Vector2i( TAB_CONT_X_DIST, Txt->position().y + Txt->size().height() + 4 ), UI_CONTROL_DEFAULT_ALIGN | UI_CLIP_ENABLE | UI_AUTO_PADDING | UI_ANCHOR_RIGHT | UI_ANCHOR_TOP ); + mLayerList = mTheme->createDropDownList( mSubTextureCont, Sizei( Width, 21 ), Vector2i( TAB_CONT_X_DIST, Txt->position().y + Txt->size().getHeight() + 4 ), UI_CONTROL_DEFAULT_ALIGN | UI_CLIP_ENABLE | UI_AUTO_PADDING | UI_ANCHOR_RIGHT | UI_ANCHOR_TOP ); mLayerList->addEventListener( UIEvent::EventOnItemSelected, cb::Make1( this, &MapEditor::OnLayerSelect ) ); - Txt = mTheme->createTextBox( "Game Object Flags:", mSubTextureCont, Sizei( Width, 16 ), Vector2i( TAB_CONT_X_DIST, mLayerList->position().y + mLayerList->size().height() + 4 ), TxtFlags ); + Txt = mTheme->createTextBox( "Game Object Flags:", mSubTextureCont, Sizei( Width, 16 ), Vector2i( TAB_CONT_X_DIST, mLayerList->position().y + mLayerList->size().getHeight() + 4 ), TxtFlags ); Uint32 ChkFlags = UI_CONTROL_DEFAULT_ALIGN | UI_AUTO_SIZE | UI_ANCHOR_RIGHT | UI_ANCHOR_TOP; - mChkMirrored = mTheme->createCheckBox( mSubTextureCont, Sizei(), Vector2i( TAB_CONT_X_DIST, Txt->position().y + Txt->size().height() + 4 ), ChkFlags ); + mChkMirrored = mTheme->createCheckBox( mSubTextureCont, Sizei(), Vector2i( TAB_CONT_X_DIST, Txt->position().y + Txt->size().getHeight() + 4 ), ChkFlags ); mChkMirrored->text( "Mirrored" ); mChkMirrored->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &MapEditor::ChkClickMirrored ) ); - mChkFliped = mTheme->createCheckBox( mSubTextureCont, Sizei(), Vector2i( mChkMirrored->position().x + mChkMirrored->size().width() + 32, mChkMirrored->position().y ), ChkFlags ); + mChkFliped = mTheme->createCheckBox( mSubTextureCont, Sizei(), Vector2i( mChkMirrored->position().x + mChkMirrored->size().getWidth() + 32, mChkMirrored->position().y ), ChkFlags ); mChkFliped->text( "Fliped" ); mChkFliped->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &MapEditor::ChkClickFliped ) ); - mChkBlocked = mTheme->createCheckBox( mSubTextureCont, Sizei(), Vector2i( mChkMirrored->position().x, mChkMirrored->position().y + mChkMirrored->size().height() + 4 ), ChkFlags ); + mChkBlocked = mTheme->createCheckBox( mSubTextureCont, Sizei(), Vector2i( mChkMirrored->position().x, mChkMirrored->position().y + mChkMirrored->size().getHeight() + 4 ), ChkFlags ); mChkBlocked->text( "Blocked" ); mChkBlocked->tooltipText( "Blocks the tile occupied by the sprite." ); mChkBlocked->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &MapEditor::ChkClickBlocked ) ); - mChkAnim = mTheme->createCheckBox( mSubTextureCont, Sizei(), Vector2i( mChkFliped->position().x, mChkFliped->position().y + mChkFliped->size().height() + 4 ), ChkFlags ); + mChkAnim = mTheme->createCheckBox( mSubTextureCont, Sizei(), Vector2i( mChkFliped->position().x, mChkFliped->position().y + mChkFliped->size().getHeight() + 4 ), ChkFlags ); mChkAnim->text( "Animated" ); mChkAnim->tooltipText( "Indicates if the Sprite is animated." ); mChkAnim->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &MapEditor::ChkClickAnimated ) ); - mChkRot90 = mTheme->createCheckBox( mSubTextureCont, Sizei(), Vector2i( mChkBlocked->position().x, mChkBlocked->position().y + mChkBlocked->size().height() + 4 ), ChkFlags ); + mChkRot90 = mTheme->createCheckBox( mSubTextureCont, Sizei(), Vector2i( mChkBlocked->position().x, mChkBlocked->position().y + mChkBlocked->size().getHeight() + 4 ), ChkFlags ); mChkRot90->text( String::fromUtf8( "Rotate 90ยบ" ) ); mChkRot90->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &MapEditor::ChkClickRot90 ) ); - mChkAutoFix = mTheme->createCheckBox( mSubTextureCont, Sizei(), Vector2i( mChkAnim->position().x, mChkAnim->position().y + mChkAnim->size().height() + 4 ), ChkFlags ); + mChkAutoFix = mTheme->createCheckBox( mSubTextureCont, Sizei(), Vector2i( mChkAnim->position().x, mChkAnim->position().y + mChkAnim->size().getHeight() + 4 ), ChkFlags ); mChkAutoFix->text( "AutoFix TilePos" ); mChkAutoFix->tooltipText( "In a tiled layer if the sprite is moved,\nit will update the current tile position automatically." ); mChkAutoFix->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &MapEditor::ChkClickAutoFix ) ); - Txt = mTheme->createTextBox( "Game Object Data:", mSubTextureCont, Sizei( Width, 16 ), Vector2i( TAB_CONT_X_DIST, mChkRot90->position().y + mChkRot90->size().height() + 8 ), TxtFlags ); + Txt = mTheme->createTextBox( "Game Object Data:", mSubTextureCont, Sizei( Width, 16 ), Vector2i( TAB_CONT_X_DIST, mChkRot90->position().y + mChkRot90->size().getHeight() + 8 ), TxtFlags ); - mChkDI = mTheme->createCheckBox( mSubTextureCont, Sizei(), Vector2i( TAB_CONT_X_DIST, Txt->position().y + Txt->size().height() + 4 ), ChkFlags ); + mChkDI = mTheme->createCheckBox( mSubTextureCont, Sizei(), Vector2i( TAB_CONT_X_DIST, Txt->position().y + Txt->size().getHeight() + 4 ), ChkFlags ); mChkDI->text( "Add as DataId" ); mChkDI->tooltipText( "If the resource it's not a sprite,\nyou can reference it with a data id" ); mChkDI->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &MapEditor::ChkClickDI ) ); UIComplexControl::CreateParams SGParams; SGParams.setParent( mSubTextureCont ); - SGParams.setPos( Vector2i( TAB_CONT_X_DIST, mChkDI->position().y + mChkDI->size().height() + 8 ) ); + SGParams.setPos( Vector2i( TAB_CONT_X_DIST, mChkDI->position().y + mChkDI->size().getHeight() + 8 ) ); SGParams.setSize( Sizei( Width, 400 ) ); SGParams.Flags = UI_CONTROL_DEFAULT_ALIGN | UI_ANCHOR_RIGHT | UI_ANCHOR_TOP; mSGCont = eeNew( UIComplexControl, ( SGParams ) ); @@ -308,14 +308,14 @@ void MapEditor::CreateSubTextureContainer( Int32 Width ) { Txt = mTheme->createTextBox( "Texture Atlases:", mSGCont, Sizei( Width, 16 ), Vector2i( TAB_CONT_X_DIST, 0 ), TxtFlags ); - mTextureAtlasesList = mTheme->createDropDownList( mSGCont, Sizei( Width, 21 ), Vector2i( 0, Txt->position().y +Txt->size().height() + 4 ), UI_CONTROL_DEFAULT_ALIGN | UI_CLIP_ENABLE | UI_AUTO_PADDING | UI_ANCHOR_RIGHT | UI_ANCHOR_TOP ); + mTextureAtlasesList = mTheme->createDropDownList( mSGCont, Sizei( Width, 21 ), Vector2i( 0, Txt->position().y +Txt->size().getHeight() + 4 ), UI_CONTROL_DEFAULT_ALIGN | UI_CLIP_ENABLE | UI_AUTO_PADDING | UI_ANCHOR_RIGHT | UI_ANCHOR_TOP ); mTextureAtlasesList->addEventListener( UIEvent::EventOnItemSelected, cb::Make1( this, &MapEditor::OnTextureAtlasChange ) ); - mSubTextureList = mTheme->createListBox( mSGCont, Sizei( Width, 156 ), Vector2i( 0, mTextureAtlasesList->position().y + mTextureAtlasesList->size().height() + 4 ), UI_CONTROL_DEFAULT_ALIGN | UI_CLIP_ENABLE | UI_AUTO_PADDING | UI_ANCHOR_RIGHT | UI_ANCHOR_TOP ); - mSubTextureList->size( mSubTextureList->size().width(), mSubTextureList->rowHeight() * 9 + mSubTextureList->paddingContainer().Top + mSubTextureList->paddingContainer().Bottom ); + mSubTextureList = mTheme->createListBox( mSGCont, Sizei( Width, 156 ), Vector2i( 0, mTextureAtlasesList->position().y + mTextureAtlasesList->size().getHeight() + 4 ), UI_CONTROL_DEFAULT_ALIGN | UI_CLIP_ENABLE | UI_AUTO_PADDING | UI_ANCHOR_RIGHT | UI_ANCHOR_TOP ); + mSubTextureList->size( mSubTextureList->size().getWidth(), mSubTextureList->rowHeight() * 9 + mSubTextureList->paddingContainer().Top + mSubTextureList->paddingContainer().Bottom ); mSubTextureList->addEventListener( UIEvent::EventOnItemSelected, cb::Make1( this, &MapEditor::OnSubTextureChange ) ); - mGfxPreview = mTheme->createGfx( NULL, mSGCont, Sizei( Width, Width ), Vector2i( 0, mSubTextureList->position().y + mSubTextureList->size().height() + 4 ), UI_VALIGN_CENTER | UI_HALIGN_CENTER | UI_ANCHOR_RIGHT | UI_ANCHOR_TOP | UI_AUTO_FIT ); + mGfxPreview = mTheme->createGfx( NULL, mSGCont, Sizei( Width, Width ), Vector2i( 0, mSubTextureList->position().y + mSubTextureList->size().getHeight() + 4 ), UI_VALIGN_CENTER | UI_HALIGN_CENTER | UI_ANCHOR_RIGHT | UI_ANCHOR_TOP | UI_AUTO_FIT ); mGfxPreview->border( true ); mGfxPreview->border()->color( ColorA( 0, 0, 0, 200 ) ); @@ -330,13 +330,13 @@ void MapEditor::CreateSubTextureContainer( Int32 Width ) { Txt = mTheme->createTextBox( "DataId String:", mDICont, Sizei( Width, 16 ), Vector2i( TAB_CONT_X_DIST, 0 ), TxtFlags ); - mDataIdInput = mTheme->createTextInput( mDICont, Sizei( Width / 4 * 3, 21 ), Vector2i( TAB_CONT_X_DIST + 8, Txt->position().y + Txt->size().height() + 8 ), UI_CONTROL_DEFAULT_ALIGN | UI_CLIP_ENABLE | UI_AUTO_PADDING | UI_AUTO_SIZE ); + mDataIdInput = mTheme->createTextInput( mDICont, Sizei( Width / 4 * 3, 21 ), Vector2i( TAB_CONT_X_DIST + 8, Txt->position().y + Txt->size().getHeight() + 8 ), UI_CONTROL_DEFAULT_ALIGN | UI_CLIP_ENABLE | UI_AUTO_PADDING | UI_AUTO_SIZE ); FillSGCombo(); } void MapEditor::CreateLighContainer() { - UIPushButton * NewLightBut = mTheme->createPushButton( mLightCont, Sizei( mLightCont->size().width() - TAB_CONT_X_DIST * 2, 22 ), Vector2i( TAB_CONT_X_DIST, 0 ) ); + UIPushButton * NewLightBut = mTheme->createPushButton( mLightCont, Sizei( mLightCont->size().getWidth() - TAB_CONT_X_DIST * 2, 22 ), Vector2i( TAB_CONT_X_DIST, 0 ) ); NewLightBut->text( "New Light" ); NewLightBut->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &MapEditor::OnNewLight ) ); @@ -344,7 +344,7 @@ void MapEditor::CreateLighContainer() { UIComplexControl::CreateParams ComParams; ComParams.setParent( mLightCont ); - ComParams.setPos( Txt->position().x, Txt->position().y + Txt->size().height() + 4 ); + ComParams.setPos( Txt->position().x, Txt->position().y + Txt->size().getHeight() + 4 ); ComParams.setSize( 58, 64 ); ComParams.Background.color( ColorA(255,255,255,255) ); ComParams.Border.color( ColorA( 100, 100, 100, 200 ) ); @@ -353,51 +353,51 @@ void MapEditor::CreateLighContainer() { mUIBaseColor->visible( true ); mUIBaseColor->enabled( true ); - Txt = mTheme->createTextBox( "R:", mLightCont, Sizei(), Vector2i( mUIBaseColor->position().x + mUIBaseColor->size().width() + 4, mUIBaseColor->position().y ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); - mUIRedSlider = mTheme->createSlider( mLightCont, Sizei( 100, 20 ), Vector2i( Txt->position().x + Txt->size().width(), Txt->position().y ), UI_CONTROL_DEFAULT_FLAGS | UI_AUTO_SIZE ); + Txt = mTheme->createTextBox( "R:", mLightCont, Sizei(), Vector2i( mUIBaseColor->position().x + mUIBaseColor->size().getWidth() + 4, mUIBaseColor->position().y ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); + mUIRedSlider = mTheme->createSlider( mLightCont, Sizei( 100, 20 ), Vector2i( Txt->position().x + Txt->size().getWidth(), Txt->position().y ), UI_CONTROL_DEFAULT_FLAGS | UI_AUTO_SIZE ); mUIRedSlider->maxValue( 255 ); mUIRedSlider->value( 255 ); mUIRedSlider->addEventListener( UIEvent::EventOnValueChange, cb::Make1( this, &MapEditor::OnRedChange ) ); - mUIRedTxt = mTheme->createTextBox( String::toStr( (Uint32)255 ), mLightCont, Sizei(), Vector2i( mUIRedSlider->position().x + mUIRedSlider->size().width() + 4, mUIRedSlider->position().y ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); + mUIRedTxt = mTheme->createTextBox( String::toStr( (Uint32)255 ), mLightCont, Sizei(), Vector2i( mUIRedSlider->position().x + mUIRedSlider->size().getWidth() + 4, mUIRedSlider->position().y ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); - Txt = mTheme->createTextBox( "G:", mLightCont, Sizei(), Vector2i( mUIBaseColor->position().x + mUIBaseColor->size().width() + 4, mUIRedSlider->position().y + mUIRedSlider->size().height() + 4 ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); + Txt = mTheme->createTextBox( "G:", mLightCont, Sizei(), Vector2i( mUIBaseColor->position().x + mUIBaseColor->size().getWidth() + 4, mUIRedSlider->position().y + mUIRedSlider->size().getHeight() + 4 ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); mUIGreenSlider = mTheme->createSlider( mLightCont, Sizei( 100, 20 ), Vector2i( mUIRedSlider->position().x, Txt->position().y ), UI_CONTROL_DEFAULT_FLAGS | UI_AUTO_SIZE ); mUIGreenSlider->maxValue( 255 ); mUIGreenSlider->value( 255 ); mUIGreenSlider->addEventListener( UIEvent::EventOnValueChange, cb::Make1( this, &MapEditor::OnGreenChange ) ); - mUIGreenTxt = mTheme->createTextBox( String::toStr( (Uint32)255 ), mLightCont, Sizei(), Vector2i( mUIGreenSlider->position().x + mUIGreenSlider->size().width() + 4, mUIGreenSlider->position().y ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); + mUIGreenTxt = mTheme->createTextBox( String::toStr( (Uint32)255 ), mLightCont, Sizei(), Vector2i( mUIGreenSlider->position().x + mUIGreenSlider->size().getWidth() + 4, mUIGreenSlider->position().y ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); - Txt = mTheme->createTextBox( "B:", mLightCont, Sizei(), Vector2i( mUIBaseColor->position().x + mUIBaseColor->size().width() + 4, mUIGreenSlider->position().y + mUIGreenSlider->size().height() + 4 ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); + Txt = mTheme->createTextBox( "B:", mLightCont, Sizei(), Vector2i( mUIBaseColor->position().x + mUIBaseColor->size().getWidth() + 4, mUIGreenSlider->position().y + mUIGreenSlider->size().getHeight() + 4 ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); mUIBlueSlider = mTheme->createSlider( mLightCont, Sizei( 100, 20 ), Vector2i( mUIRedSlider->position().x, Txt->position().y ), UI_CONTROL_DEFAULT_FLAGS | UI_AUTO_SIZE ); mUIBlueSlider->maxValue( 255 ); mUIBlueSlider->value( 255 ); mUIBlueSlider->addEventListener( UIEvent::EventOnValueChange, cb::Make1( this, &MapEditor::OnBlueChange ) ); - mUIBlueTxt = mTheme->createTextBox( String::toStr( (Uint32)255 ), mLightCont, Sizei(), Vector2i( mUIBlueSlider->position().x + mUIBlueSlider->size().width() + 4, mUIBlueSlider->position().y ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); + mUIBlueTxt = mTheme->createTextBox( String::toStr( (Uint32)255 ), mLightCont, Sizei(), Vector2i( mUIBlueSlider->position().x + mUIBlueSlider->size().getWidth() + 4, mUIBlueSlider->position().y ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); - Txt = mTheme->createTextBox( "Light Radius:", mLightCont, Sizei(), Vector2i( TAB_CONT_X_DIST, mUIBlueTxt->position().y + mUIBlueTxt->size().height() + 16 ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); + Txt = mTheme->createTextBox( "Light Radius:", mLightCont, Sizei(), Vector2i( TAB_CONT_X_DIST, mUIBlueTxt->position().y + mUIBlueTxt->size().getHeight() + 16 ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); - mLightRadius = mTheme->createSpinBox( mLightCont, Sizei( 100, 22 ), Vector2i( Txt->position().x, Txt->position().y + Txt->size().height() + 8 ), UI_CONTROL_DEFAULT_FLAGS | UI_CLIP_ENABLE | UI_AUTO_SIZE | UI_TEXT_SELECTION_ENABLED, 100, false ); + mLightRadius = mTheme->createSpinBox( mLightCont, Sizei( 100, 22 ), Vector2i( Txt->position().x, Txt->position().y + Txt->size().getHeight() + 8 ), UI_CONTROL_DEFAULT_FLAGS | UI_CLIP_ENABLE | UI_AUTO_SIZE | UI_TEXT_SELECTION_ENABLED, 100, false ); mLightRadius->maxValue( 2000 ); mLightRadius->addEventListener( UIEvent::EventOnValueChange, cb::Make1( this, &MapEditor::OnLightRadiusChangeVal ) ); - mLightTypeChk = mTheme->createCheckBox( mLightCont, Sizei(), Vector2i( mLightRadius->position().x, mLightRadius->position().y + mLightRadius->size().height() + 8 ), UI_CONTROL_DEFAULT_FLAGS | UI_AUTO_SIZE ); + mLightTypeChk = mTheme->createCheckBox( mLightCont, Sizei(), Vector2i( mLightRadius->position().x, mLightRadius->position().y + mLightRadius->size().getHeight() + 8 ), UI_CONTROL_DEFAULT_FLAGS | UI_AUTO_SIZE ); mLightTypeChk->text( "Isometric Light" ); mLightTypeChk->active( false ); mLightTypeChk->addEventListener( UIEvent::EventOnValueChange, cb::Make1( this, &MapEditor::OnLightTypeChange ) ); } UISelectButton * MapEditor::AddObjContButton( String text, Uint32 mode ) { - UISelectButton * Button = mTheme->createSelectButton( mObjectCont, Sizei( mObjectCont->size().width() - TAB_CONT_X_DIST * 2, 22 ), Vector2i( TAB_CONT_X_DIST, mLastSelButtonY ) ); + UISelectButton * Button = mTheme->createSelectButton( mObjectCont, Sizei( mObjectCont->size().getWidth() - TAB_CONT_X_DIST * 2, 22 ), Vector2i( TAB_CONT_X_DIST, mLastSelButtonY ) ); Button->text( text ); Button->data( mode ); Button->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &MapEditor::OnObjectModeSel ) ); - mLastSelButtonY += Button->size().height() + 4; + mLastSelButtonY += Button->size().getHeight() + 4; mObjContButton.push_back( Button ); @@ -411,7 +411,7 @@ void MapEditor::CreateObjectsContainer() { AddObjContButton( "Insert Polygon", UIMap::INSERT_POLYGON ); UISelectButton * Button = AddObjContButton( "Insert Polyline", UIMap::INSERT_POLYLINE ); - Int32 nextY = Button->position().y + Button->size().height() + 4; + Int32 nextY = Button->position().y + Button->size().getHeight() + 4; Uint32 ChkFlags = UI_CONTROL_DEFAULT_ALIGN | UI_AUTO_SIZE | UI_ANCHOR_RIGHT | UI_ANCHOR_TOP; @@ -447,7 +447,7 @@ void MapEditor::CreateUIMap() { SubTexture * tTex = HScrollSkin->getSubTexture( UISkinState::StateNormal ); if ( NULL != tTex ) { - ScrollH = tTex->size().height(); + ScrollH = tTex->size().getHeight(); } } @@ -455,14 +455,14 @@ void MapEditor::CreateUIMap() { SubTexture * tTex = VScrollSkin->getSubTexture( UISkinState::StateNormal ); if ( NULL != tTex ) { - ScrollV = tTex->size().height(); + ScrollV = tTex->size().getHeight(); } } UIComplexControl::CreateParams Params; Params.setParent( mWinContainer ); Params.setPos( 0, 0 ); - Params.setSize( mWinContainer->size().width() - 225 - ScrollV, mWinContainer->size().height() - ScrollH ); + Params.setSize( mWinContainer->size().getWidth() - 225 - ScrollV, mWinContainer->size().getHeight() - ScrollH ); Params.Flags |= UI_ANCHOR_BOTTOM | UI_ANCHOR_RIGHT; mUIMap = eeNew( UIMap, ( Params, mTheme ) ); @@ -479,10 +479,10 @@ void MapEditor::CreateUIMap() { mUIMap->SetUpdateScrollCb( cb::Make0( this, &MapEditor::UpdateScroll ) ); mUIMap->SetTileBox( mTileBox ); - mMapHScroll = mTheme->createScrollBar( mWinContainer, Sizei( Params.Size.width(), ScrollH ), Vector2i( 0, mWinContainer->size().height() - ScrollH ), UI_ANCHOR_LEFT | UI_ANCHOR_RIGHT | UI_ANCHOR_BOTTOM | UI_AUTO_SIZE ); + mMapHScroll = mTheme->createScrollBar( mWinContainer, Sizei( Params.Size.getWidth(), ScrollH ), Vector2i( 0, mWinContainer->size().getHeight() - ScrollH ), UI_ANCHOR_LEFT | UI_ANCHOR_RIGHT | UI_ANCHOR_BOTTOM | UI_AUTO_SIZE ); mMapHScroll->addEventListener( UIEvent::EventOnValueChange, cb::Make1( this, &MapEditor::OnScrollMapH ) ); - mMapVScroll = mTheme->createScrollBar( mWinContainer, Sizei( ScrollV, Params.Size.height() ), Vector2i( Params.Size.width() + ScrollV, 0 ), UI_ANCHOR_TOP | UI_ANCHOR_BOTTOM | UI_AUTO_SIZE , true ); + mMapVScroll = mTheme->createScrollBar( mWinContainer, Sizei( ScrollV, Params.Size.getHeight() ), Vector2i( Params.Size.getWidth() + ScrollV, 0 ), UI_ANCHOR_TOP | UI_ANCHOR_BOTTOM | UI_AUTO_SIZE , true ); mMapVScroll->addEventListener( UIEvent::EventOnValueChange, cb::Make1( this, &MapEditor::OnScrollMapV ) ); MapCreated(); @@ -499,7 +499,7 @@ void MapEditor::OnAddObject( Uint32 Type, Polygon2f poly ) { return; } - if ( poly.size() < 3 ) { + if ( poly.getSize() < 3 ) { return; } @@ -807,10 +807,10 @@ void MapEditor::OnMapSizeChange( const UIEvent *Event ) { mMapHScroll->minValue( 0 ); mMapHScroll->maxValue( v.x ); - mMapHScroll->clickStep( mUIMap->Map()->TileSize().width() * mUIMap->Map()->Scale() ); + mMapHScroll->clickStep( mUIMap->Map()->TileSize().getWidth() * mUIMap->Map()->Scale() ); mMapVScroll->minValue( 0 ); mMapVScroll->maxValue( v.y ); - mMapVScroll->clickStep( mUIMap->Map()->TileSize().height() * mUIMap->Map()->Scale() ); + mMapVScroll->clickStep( mUIMap->Map()->TileSize().getHeight() * mUIMap->Map()->Scale() ); } void MapEditor::OnScrollMapH( const UIEvent * Event ) { diff --git a/src/eepp/gaming/mapeditor/maplayerproperties.cpp b/src/eepp/gaming/mapeditor/maplayerproperties.cpp index 2c1cf1096..aead69eda 100644 --- a/src/eepp/gaming/mapeditor/maplayerproperties.cpp +++ b/src/eepp/gaming/mapeditor/maplayerproperties.cpp @@ -33,22 +33,22 @@ MapLayerProperties::MapLayerProperties( MapLayer * Map, RefreshLayerListCb Cb ) mUIInput->addEventListener( UIEvent::EventOnPressEnter, cb::Make1( this, &MapLayerProperties::OKClick ) ); Uint32 TxtBoxFlags = UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_HALIGN_CENTER | UI_VALIGN_CENTER; - mUITheme->createTextBox( "Property Name", mUIWindow->getContainer(), Sizei(192, 24), Vector2i( 50, mUIInput->position().y + mUIInput->size().height() + 12 ), TxtBoxFlags ); - UITextBox * TxtBox = mUITheme->createTextBox( "Property Value", mUIWindow->getContainer(), Sizei(192, 24), Vector2i( 50+192, mUIInput->position().y + mUIInput->size().height() + 12 ), TxtBoxFlags ); + mUITheme->createTextBox( "Property Name", mUIWindow->getContainer(), Sizei(192, 24), Vector2i( 50, mUIInput->position().y + mUIInput->size().getHeight() + 12 ), TxtBoxFlags ); + UITextBox * TxtBox = mUITheme->createTextBox( "Property Value", mUIWindow->getContainer(), Sizei(192, 24), Vector2i( 50+192, mUIInput->position().y + mUIInput->size().getHeight() + 12 ), TxtBoxFlags ); UIPushButton * OKButton = mUITheme->createPushButton( mUIWindow->getContainer(), Sizei( 80, 22 ), Vector2i(), UI_CONTROL_DEFAULT_FLAGS_CENTERED | UI_AUTO_SIZE, mUITheme->getIconByName( "ok" ) ); - OKButton->position( mUIWindow->getContainer()->size().width() - OKButton->size().width() - 4, mUIWindow->getContainer()->size().height() - OKButton->size().height() - 4 ); + OKButton->position( mUIWindow->getContainer()->size().getWidth() - OKButton->size().getWidth() - 4, mUIWindow->getContainer()->size().getHeight() - OKButton->size().getHeight() - 4 ); OKButton->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &MapLayerProperties::OKClick ) ); OKButton->text( "OK" ); - UIPushButton * CancelButton = mUITheme->createPushButton( mUIWindow->getContainer(), OKButton->size(), Vector2i( OKButton->position().x - OKButton->size().width() - 4, OKButton->position().y ), UI_CONTROL_DEFAULT_FLAGS_CENTERED | UI_AUTO_SIZE, mUITheme->getIconByName( "cancel" ) ); + UIPushButton * CancelButton = mUITheme->createPushButton( mUIWindow->getContainer(), OKButton->size(), Vector2i( OKButton->position().x - OKButton->size().getWidth() - 4, OKButton->position().y ), UI_CONTROL_DEFAULT_FLAGS_CENTERED | UI_AUTO_SIZE, mUITheme->getIconByName( "cancel" ) ); CancelButton->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &MapLayerProperties::CancelClick ) ); CancelButton->text( "Cancel" ); UIGenericGrid::CreateParams GridParams; GridParams.setParent( mUIWindow->getContainer() ); - GridParams.setPos( 50, TxtBox->position().y + TxtBox->size().height() ); + GridParams.setPos( 50, TxtBox->position().y + TxtBox->size().getHeight() ); GridParams.setSize( 400, 350 ); GridParams.Flags = UI_AUTO_PADDING; GridParams.RowHeight = 24; @@ -62,7 +62,7 @@ MapLayerProperties::MapLayerProperties( MapLayer * Map, RefreshLayerListCb Cb ) mGenGrid->collumnWidth( 3, 175 ); mGenGrid->collumnWidth( 4, 10 ); - Vector2i Pos( mGenGrid->position().x + mGenGrid->size().width() + 10, mGenGrid->position().y ); + Vector2i Pos( mGenGrid->position().x + mGenGrid->size().getWidth() + 10, mGenGrid->position().y ); UIPushButton * AddButton = mUITheme->createPushButton( mUIWindow->getContainer(), Sizei(24,21), Pos, UI_CONTROL_ALIGN_CENTER | UI_AUTO_SIZE | UI_ANCHOR_RIGHT | UI_ANCHOR_TOP, mUITheme->getIconByName( "add" ) ); AddButton->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &MapLayerProperties::AddCellClick ) ); @@ -70,7 +70,7 @@ MapLayerProperties::MapLayerProperties( MapLayer * Map, RefreshLayerListCb Cb ) if ( NULL == AddButton->icon()->subTexture() ) AddButton->text( "+" ); - Pos.y += AddButton->size().height() + 5; + Pos.y += AddButton->size().getHeight() + 5; UIPushButton * RemoveButton = mUITheme->createPushButton( mUIWindow->getContainer(), Sizei(24,21), Pos, UI_CONTROL_ALIGN_CENTER | UI_AUTO_SIZE | UI_ANCHOR_RIGHT | UI_ANCHOR_TOP, mUITheme->getIconByName( "remove" ) ); RemoveButton->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &MapLayerProperties::RemoveCellClick ) ); diff --git a/src/eepp/gaming/mapeditor/mapobjectproperties.cpp b/src/eepp/gaming/mapeditor/mapobjectproperties.cpp index 071d05b0a..038bb380e 100644 --- a/src/eepp/gaming/mapeditor/mapobjectproperties.cpp +++ b/src/eepp/gaming/mapeditor/mapobjectproperties.cpp @@ -37,22 +37,22 @@ MapObjectProperties::MapObjectProperties( GameObjectObject * Obj ) : mUIInput2->addEventListener( UIEvent::EventOnPressEnter, cb::Make1( this, &MapObjectProperties::OKClick ) ); Uint32 TxtBoxFlags = UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_HALIGN_CENTER | UI_VALIGN_CENTER; - mUITheme->createTextBox( "Property Name", mUIWindow->getContainer(), Sizei(192, 24), Vector2i( 50, mUIInput->position().y + mUIInput->size().height() + 12 ), TxtBoxFlags ); - UITextBox * TxtBox = mUITheme->createTextBox( "Property Value", mUIWindow->getContainer(), Sizei(192, 24), Vector2i( 50+192, mUIInput->position().y + mUIInput->size().height() + 12 ), TxtBoxFlags ); + mUITheme->createTextBox( "Property Name", mUIWindow->getContainer(), Sizei(192, 24), Vector2i( 50, mUIInput->position().y + mUIInput->size().getHeight() + 12 ), TxtBoxFlags ); + UITextBox * TxtBox = mUITheme->createTextBox( "Property Value", mUIWindow->getContainer(), Sizei(192, 24), Vector2i( 50+192, mUIInput->position().y + mUIInput->size().getHeight() + 12 ), TxtBoxFlags ); UIPushButton * OKButton = mUITheme->createPushButton( mUIWindow->getContainer(), Sizei( 80, 22 ), Vector2i(), UI_CONTROL_DEFAULT_FLAGS_CENTERED | UI_AUTO_SIZE, mUITheme->getIconByName( "ok" ) ); - OKButton->position( mUIWindow->getContainer()->size().width() - OKButton->size().width() - 4, mUIWindow->getContainer()->size().height() - OKButton->size().height() - 4 ); + OKButton->position( mUIWindow->getContainer()->size().getWidth() - OKButton->size().getWidth() - 4, mUIWindow->getContainer()->size().getHeight() - OKButton->size().getHeight() - 4 ); OKButton->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &MapObjectProperties::OKClick ) ); OKButton->text( "OK" ); - UIPushButton * CancelButton = mUITheme->createPushButton( mUIWindow->getContainer(), OKButton->size(), Vector2i( OKButton->position().x - OKButton->size().width() - 4, OKButton->position().y ), UI_CONTROL_DEFAULT_FLAGS_CENTERED | UI_AUTO_SIZE, mUITheme->getIconByName( "cancel" ) ); + UIPushButton * CancelButton = mUITheme->createPushButton( mUIWindow->getContainer(), OKButton->size(), Vector2i( OKButton->position().x - OKButton->size().getWidth() - 4, OKButton->position().y ), UI_CONTROL_DEFAULT_FLAGS_CENTERED | UI_AUTO_SIZE, mUITheme->getIconByName( "cancel" ) ); CancelButton->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &MapObjectProperties::CancelClick ) ); CancelButton->text( "Cancel" ); UIGenericGrid::CreateParams GridParams; GridParams.setParent( mUIWindow->getContainer() ); - GridParams.setPos( 50, TxtBox->position().y + TxtBox->size().height() ); + GridParams.setPos( 50, TxtBox->position().y + TxtBox->size().getHeight() ); GridParams.setSize( 400, 350 ); GridParams.Flags = UI_AUTO_PADDING; GridParams.RowHeight = 24; @@ -66,7 +66,7 @@ MapObjectProperties::MapObjectProperties( GameObjectObject * Obj ) : mGenGrid->collumnWidth( 3, 175 ); mGenGrid->collumnWidth( 4, 10 ); - Vector2i Pos( mGenGrid->position().x + mGenGrid->size().width() + 10, mGenGrid->position().y ); + Vector2i Pos( mGenGrid->position().x + mGenGrid->size().getWidth() + 10, mGenGrid->position().y ); UIPushButton * AddButton = mUITheme->createPushButton( mUIWindow->getContainer(), Sizei(24,21), Pos, UI_CONTROL_ALIGN_CENTER | UI_AUTO_SIZE | UI_ANCHOR_RIGHT | UI_ANCHOR_TOP, mUITheme->getIconByName( "add" ) ); AddButton->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &MapObjectProperties::AddCellClick ) ); @@ -74,7 +74,7 @@ MapObjectProperties::MapObjectProperties( GameObjectObject * Obj ) : if ( NULL == AddButton->icon()->subTexture() ) AddButton->text( "+" ); - Pos.y += AddButton->size().height() + 5; + Pos.y += AddButton->size().getHeight() + 5; UIPushButton * RemoveButton = mUITheme->createPushButton( mUIWindow->getContainer(), Sizei(24,21), Pos, UI_CONTROL_ALIGN_CENTER | UI_AUTO_SIZE | UI_ANCHOR_RIGHT | UI_ANCHOR_TOP, mUITheme->getIconByName( "remove" ) ); RemoveButton->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &MapObjectProperties::RemoveCellClick ) ); diff --git a/src/eepp/gaming/mapeditor/tilemapproperties.cpp b/src/eepp/gaming/mapeditor/tilemapproperties.cpp index 02a11056e..8e89a0ad3 100644 --- a/src/eepp/gaming/mapeditor/tilemapproperties.cpp +++ b/src/eepp/gaming/mapeditor/tilemapproperties.cpp @@ -32,7 +32,7 @@ TileMapProperties::TileMapProperties( TileMap * Map ) : UIComplexControl::CreateParams ComParams; ComParams.setParent( mUIWindow->getContainer() ); - ComParams.setPos( Txt->position().x, Txt->position().y + Txt->size().height() + 4 ); + ComParams.setPos( Txt->position().x, Txt->position().y + Txt->size().getHeight() + 4 ); ComParams.setSize( 64, 64 ); ComParams.Background.color( mMap->BaseColor() ); ComParams.Border.color( ColorA( 100, 100, 100, 200 ) ); @@ -41,29 +41,29 @@ TileMapProperties::TileMapProperties( TileMap * Map ) : mUIBaseColor->visible( true ); mUIBaseColor->enabled( true ); - Txt = mUITheme->createTextBox( "Red Color:", mUIWindow->getContainer(), Sizei(), Vector2i( mUIBaseColor->position().x + mUIBaseColor->size().width() + 4, mUIBaseColor->position().y ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); - mUIRedSlider = mUITheme->createSlider( mUIWindow->getContainer(), Sizei( 255, 20 ), Vector2i( Txt->position().x + Txt->size().width() + 16, Txt->position().y ), UI_CONTROL_DEFAULT_FLAGS | UI_AUTO_SIZE ); + Txt = mUITheme->createTextBox( "Red Color:", mUIWindow->getContainer(), Sizei(), Vector2i( mUIBaseColor->position().x + mUIBaseColor->size().getWidth() + 4, mUIBaseColor->position().y ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); + mUIRedSlider = mUITheme->createSlider( mUIWindow->getContainer(), Sizei( 255, 20 ), Vector2i( Txt->position().x + Txt->size().getWidth() + 16, Txt->position().y ), UI_CONTROL_DEFAULT_FLAGS | UI_AUTO_SIZE ); mUIRedSlider->maxValue( 255 ); mUIRedSlider->value( mMap->BaseColor().r() ); mUIRedSlider->addEventListener( UIEvent::EventOnValueChange, cb::Make1( this, &TileMapProperties::OnRedChange ) ); - mUIRedTxt = mUITheme->createTextBox( String::toStr( (Uint32)mMap->BaseColor().r() ), mUIWindow->getContainer(), Sizei(), Vector2i( mUIRedSlider->position().x + mUIRedSlider->size().width() + 4, mUIRedSlider->position().y ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); + mUIRedTxt = mUITheme->createTextBox( String::toStr( (Uint32)mMap->BaseColor().r() ), mUIWindow->getContainer(), Sizei(), Vector2i( mUIRedSlider->position().x + mUIRedSlider->size().getWidth() + 4, mUIRedSlider->position().y ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); - Txt = mUITheme->createTextBox( "Green Color:", mUIWindow->getContainer(), Sizei(), Vector2i( mUIBaseColor->position().x + mUIBaseColor->size().width() + 4, mUIRedSlider->position().y + mUIRedSlider->size().height() + 4 ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); + Txt = mUITheme->createTextBox( "Green Color:", mUIWindow->getContainer(), Sizei(), Vector2i( mUIBaseColor->position().x + mUIBaseColor->size().getWidth() + 4, mUIRedSlider->position().y + mUIRedSlider->size().getHeight() + 4 ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); mUIGreenSlider = mUITheme->createSlider( mUIWindow->getContainer(), Sizei( 255, 20 ), Vector2i( mUIRedSlider->position().x, Txt->position().y ), UI_CONTROL_DEFAULT_FLAGS | UI_AUTO_SIZE ); mUIGreenSlider->maxValue( 255 ); mUIGreenSlider->value( mMap->BaseColor().g() ); mUIGreenSlider->addEventListener( UIEvent::EventOnValueChange, cb::Make1( this, &TileMapProperties::OnGreenChange ) ); - mUIGreenTxt = mUITheme->createTextBox( String::toStr( (Uint32)mMap->BaseColor().g() ), mUIWindow->getContainer(), Sizei(), Vector2i( mUIGreenSlider->position().x + mUIGreenSlider->size().width() + 4, mUIGreenSlider->position().y ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); + mUIGreenTxt = mUITheme->createTextBox( String::toStr( (Uint32)mMap->BaseColor().g() ), mUIWindow->getContainer(), Sizei(), Vector2i( mUIGreenSlider->position().x + mUIGreenSlider->size().getWidth() + 4, mUIGreenSlider->position().y ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); - Txt = mUITheme->createTextBox( "Blue Color:", mUIWindow->getContainer(), Sizei(), Vector2i( mUIBaseColor->position().x + mUIBaseColor->size().width() + 4, mUIGreenSlider->position().y + mUIGreenSlider->size().height() + 4 ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); + Txt = mUITheme->createTextBox( "Blue Color:", mUIWindow->getContainer(), Sizei(), Vector2i( mUIBaseColor->position().x + mUIBaseColor->size().getWidth() + 4, mUIGreenSlider->position().y + mUIGreenSlider->size().getHeight() + 4 ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); mUIBlueSlider = mUITheme->createSlider( mUIWindow->getContainer(), Sizei( 255, 20 ), Vector2i( mUIRedSlider->position().x, Txt->position().y ), UI_CONTROL_DEFAULT_FLAGS | UI_AUTO_SIZE ); mUIBlueSlider->maxValue( 255 ); mUIBlueSlider->value( mMap->BaseColor().b() ); mUIBlueSlider->addEventListener( UIEvent::EventOnValueChange, cb::Make1( this, &TileMapProperties::OnBlueChange ) ); - mUIBlueTxt = mUITheme->createTextBox( String::toStr( (Uint32)mMap->BaseColor().b() ), mUIWindow->getContainer(), Sizei(), Vector2i( mUIBlueSlider->position().x + mUIBlueSlider->size().width() + 4, mUIBlueSlider->position().y ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); + mUIBlueTxt = mUITheme->createTextBox( String::toStr( (Uint32)mMap->BaseColor().b() ), mUIWindow->getContainer(), Sizei(), Vector2i( mUIBlueSlider->position().x + mUIBlueSlider->size().getWidth() + 4, mUIBlueSlider->position().y ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); } Uint32 TxtBoxFlags = UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_HALIGN_CENTER | UI_VALIGN_CENTER; @@ -71,12 +71,12 @@ TileMapProperties::TileMapProperties( TileMap * Map ) : mUITheme->createTextBox( "Property Value", mUIWindow->getContainer(), Sizei(192, 24), Vector2i(50+192, TxtBox->position().y ), TxtBoxFlags ); UIPushButton * OKButton = mUITheme->createPushButton( mUIWindow->getContainer(), Sizei( 80, 22 ), Vector2i(), UI_CONTROL_DEFAULT_FLAGS_CENTERED | UI_AUTO_SIZE, mUITheme->getIconByName( "ok" ) ); - OKButton->position( mUIWindow->getContainer()->size().width() - OKButton->size().width() - 4, mUIWindow->getContainer()->size().height() - OKButton->size().height() - 4 ); + OKButton->position( mUIWindow->getContainer()->size().getWidth() - OKButton->size().getWidth() - 4, mUIWindow->getContainer()->size().getHeight() - OKButton->size().getHeight() - 4 ); OKButton->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &TileMapProperties::OKClick ) ); OKButton->text( "OK" ); - UIPushButton * CancelButton = mUITheme->createPushButton( mUIWindow->getContainer(), OKButton->size(), Vector2i( OKButton->position().x - OKButton->size().width() - 4, OKButton->position().y ), UI_CONTROL_DEFAULT_FLAGS_CENTERED | UI_AUTO_SIZE, mUITheme->getIconByName( "cancel" ) ); + UIPushButton * CancelButton = mUITheme->createPushButton( mUIWindow->getContainer(), OKButton->size(), Vector2i( OKButton->position().x - OKButton->size().getWidth() - 4, OKButton->position().y ), UI_CONTROL_DEFAULT_FLAGS_CENTERED | UI_AUTO_SIZE, mUITheme->getIconByName( "cancel" ) ); CancelButton->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &TileMapProperties::CancelClick ) ); CancelButton->text( "Cancel" ); @@ -96,7 +96,7 @@ TileMapProperties::TileMapProperties( TileMap * Map ) : mGenGrid->collumnWidth( 3, 175 ); mGenGrid->collumnWidth( 4, 10 ); - Vector2i Pos( mGenGrid->position().x + mGenGrid->size().width() + 10, mGenGrid->position().y ); + Vector2i Pos( mGenGrid->position().x + mGenGrid->size().getWidth() + 10, mGenGrid->position().y ); UIPushButton * AddButton = mUITheme->createPushButton( mUIWindow->getContainer(), Sizei(24,21), Pos, UI_CONTROL_ALIGN_CENTER | UI_AUTO_SIZE | UI_ANCHOR_RIGHT | UI_ANCHOR_TOP, mUITheme->getIconByName( "add" ) ); AddButton->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &TileMapProperties::AddCellClick ) ); @@ -104,7 +104,7 @@ TileMapProperties::TileMapProperties( TileMap * Map ) : if ( NULL == AddButton->icon()->subTexture() ) AddButton->text( "+" ); - Pos.y += AddButton->size().height() + 5; + Pos.y += AddButton->size().getHeight() + 5; UIPushButton * RemoveButton = mUITheme->createPushButton( mUIWindow->getContainer(), Sizei(24,21), Pos, UI_CONTROL_ALIGN_CENTER | UI_AUTO_SIZE | UI_ANCHOR_RIGHT | UI_ANCHOR_TOP, mUITheme->getIconByName( "remove" ) ); RemoveButton->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &TileMapProperties::RemoveCellClick ) ); diff --git a/src/eepp/gaming/mapeditor/uigotypenew.cpp b/src/eepp/gaming/mapeditor/uigotypenew.cpp index 546ded4e5..33a127f8f 100644 --- a/src/eepp/gaming/mapeditor/uigotypenew.cpp +++ b/src/eepp/gaming/mapeditor/uigotypenew.cpp @@ -26,13 +26,13 @@ UIGOTypeNew::UIGOTypeNew( cb::Callback2 Cb ) : mUIInput = mUITheme->createTextInput( mUIWindow->getContainer(), Sizei( 120, 22 ), Vector2i( Txt->position().x + DistFromTitle, Txt->position().y + DistFromTitle ), UI_CONTROL_DEFAULT_FLAGS | UI_CLIP_ENABLE | UI_AUTO_PADDING | UI_AUTO_SIZE, true, 64 ); UIPushButton * OKButton = mUITheme->createPushButton( mUIWindow->getContainer(), Sizei( 80, 22 ), Vector2i(), UI_CONTROL_DEFAULT_FLAGS_CENTERED | UI_AUTO_SIZE, mUITheme->getIconByName( "add" ) ); - OKButton->position( mUIWindow->getContainer()->size().width() - OKButton->size().width() - 4, mUIWindow->getContainer()->size().height() - OKButton->size().height() - 4 ); + OKButton->position( mUIWindow->getContainer()->size().getWidth() - OKButton->size().getWidth() - 4, mUIWindow->getContainer()->size().getHeight() - OKButton->size().getHeight() - 4 ); OKButton->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &UIGOTypeNew::OKClick ) ); mUIInput->addEventListener( UIEvent::EventOnPressEnter, cb::Make1( this, &UIGOTypeNew::OKClick ) ); OKButton->text( "Add" ); - UIPushButton * CancelButton = mUITheme->createPushButton( mUIWindow->getContainer(), OKButton->size(), Vector2i( OKButton->position().x - OKButton->size().width() - 4, OKButton->position().y ), UI_CONTROL_DEFAULT_FLAGS_CENTERED | UI_AUTO_SIZE, mUITheme->getIconByName( "cancel" ) ); + UIPushButton * CancelButton = mUITheme->createPushButton( mUIWindow->getContainer(), OKButton->size(), Vector2i( OKButton->position().x - OKButton->size().getWidth() - 4, OKButton->position().y ), UI_CONTROL_DEFAULT_FLAGS_CENTERED | UI_AUTO_SIZE, mUITheme->getIconByName( "cancel" ) ); CancelButton->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &UIGOTypeNew::CancelClick ) ); CancelButton->text( "Cancel" ); diff --git a/src/eepp/gaming/mapeditor/uimap.cpp b/src/eepp/gaming/mapeditor/uimap.cpp index 2be45f271..c4e994809 100644 --- a/src/eepp/gaming/mapeditor/uimap.cpp +++ b/src/eepp/gaming/mapeditor/uimap.cpp @@ -234,8 +234,8 @@ void UIMap::ManageObject( Uint32 Flags ) { mObjRECTEditing = true; mObjRECT = Rectf( mp, Sizef(0,0) ); } else { - if ( mObjRECT.pos().x < mp.x && mObjRECT.pos().y < mp.y ) { - mObjRECT = Rectf( mObjRECT.pos(), Sizef( mp - mObjRECT.pos() ) ); + if ( mObjRECT.getPosition().x < mp.x && mObjRECT.getPosition().y < mp.y ) { + mObjRECT = Rectf( mObjRECT.getPosition(), Sizef( mp - mObjRECT.getPosition() ) ); } } } @@ -372,7 +372,7 @@ void UIMap::MapDraw() { eeAABB AB( mSelLight->GetAABB() ); mP.fillMode( DRAW_LINE ); - mP.drawRectangle( Rectf( Pos, AB.size() ) ); + mP.drawRectangle( Rectf( Pos, AB.getSize() ) ); } } else if ( EDITING_OBJECT == mEditingMode ) { switch ( mEditingObjMode ) { diff --git a/src/eepp/gaming/mapeditor/uimaplayernew.cpp b/src/eepp/gaming/mapeditor/uimaplayernew.cpp index caa8d1aa6..3589effc7 100644 --- a/src/eepp/gaming/mapeditor/uimaplayernew.cpp +++ b/src/eepp/gaming/mapeditor/uimaplayernew.cpp @@ -33,13 +33,13 @@ UIMapLayerNew::UIMapLayerNew( UIMap * Map, EE_LAYER_TYPE Type, NewLayerCb newLay mUILayerName->text( "Layer " + String::toStr( mUIMap->Map()->LayerCount() + 1 ) ); UIPushButton * OKButton = mTheme->createPushButton( mUIWindow->getContainer(), Sizei( 80, 22 ), Vector2i(), UI_CONTROL_DEFAULT_FLAGS_CENTERED | UI_AUTO_SIZE, mTheme->getIconByName( "add" ) ); - OKButton->position( mUIWindow->getContainer()->size().width() - OKButton->size().width() - 4, mUIWindow->getContainer()->size().height() - OKButton->size().height() - 4 ); + OKButton->position( mUIWindow->getContainer()->size().getWidth() - OKButton->size().getWidth() - 4, mUIWindow->getContainer()->size().getHeight() - OKButton->size().getHeight() - 4 ); OKButton->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &UIMapLayerNew::OKClick ) ); mUILayerName->addEventListener( UIEvent::EventOnPressEnter, cb::Make1( this, &UIMapLayerNew::OKClick ) ); OKButton->text( "Add" ); - UIPushButton * CancelButton = mTheme->createPushButton( mUIWindow->getContainer(), OKButton->size(), Vector2i( OKButton->position().x - OKButton->size().width() - 4, OKButton->position().y ), UI_CONTROL_DEFAULT_FLAGS_CENTERED | UI_AUTO_SIZE, mTheme->getIconByName( "cancel" ) ); + UIPushButton * CancelButton = mTheme->createPushButton( mUIWindow->getContainer(), OKButton->size(), Vector2i( OKButton->position().x - OKButton->size().getWidth() - 4, OKButton->position().y ), UI_CONTROL_DEFAULT_FLAGS_CENTERED | UI_AUTO_SIZE, mTheme->getIconByName( "cancel" ) ); CancelButton->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &UIMapLayerNew::CancelClick ) ); CancelButton->text( "Cancel" ); diff --git a/src/eepp/gaming/mapeditor/uimapnew.cpp b/src/eepp/gaming/mapeditor/uimapnew.cpp index 5fec4fac0..01c49d6c9 100644 --- a/src/eepp/gaming/mapeditor/uimapnew.cpp +++ b/src/eepp/gaming/mapeditor/uimapnew.cpp @@ -33,50 +33,50 @@ UIMapNew::UIMapNew( UIMap * Map, cb::Callback0 NewMapCb, bool ResizeMap ) Txt = mTheme->createTextBox( "Width:", mUIWindow->getContainer(), Sizei( 46, 24 ), Vector2i( Txt->position().x + DistFromTitle, Txt->position().y + DistFromTitle ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW ); - mUIMapWidth = mTheme->createSpinBox( mUIWindow->getContainer(), Sizei( 53, 24 ), Vector2i( Txt->position().x + Txt->size().width(), Txt->position().y ), UI_CONTROL_DEFAULT_FLAGS | UI_TEXT_SELECTION_ENABLED, 100, false ); + mUIMapWidth = mTheme->createSpinBox( mUIWindow->getContainer(), Sizei( 53, 24 ), Vector2i( Txt->position().x + Txt->size().getWidth(), Txt->position().y ), UI_CONTROL_DEFAULT_FLAGS | UI_TEXT_SELECTION_ENABLED, 100, false ); mUIMapWidth->minValue(1); if ( ResizeMap ) { - mUIMapWidth->value( mUIMap->Map()->Size().width() ); + mUIMapWidth->value( mUIMap->Map()->Size().getWidth() ); } - Txt = mTheme->createTextBox( "Height:", mUIWindow->getContainer(), Sizei( 46, 24 ), Vector2i( Txt->position().x, Txt->position().y + Txt->size().height() + 8 ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW ); + Txt = mTheme->createTextBox( "Height:", mUIWindow->getContainer(), Sizei( 46, 24 ), Vector2i( Txt->position().x, Txt->position().y + Txt->size().getHeight() + 8 ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW ); - mUIMapHeight = mTheme->createSpinBox( mUIWindow->getContainer(), Sizei( 53, 24 ), Vector2i( Txt->position().x + Txt->size().width(), Txt->position().y ), UI_CONTROL_DEFAULT_FLAGS | UI_TEXT_SELECTION_ENABLED, 100, false ); + mUIMapHeight = mTheme->createSpinBox( mUIWindow->getContainer(), Sizei( 53, 24 ), Vector2i( Txt->position().x + Txt->size().getWidth(), Txt->position().y ), UI_CONTROL_DEFAULT_FLAGS | UI_TEXT_SELECTION_ENABLED, 100, false ); mUIMapHeight->minValue(1); if ( ResizeMap ) { - mUIMapHeight->value( mUIMap->Map()->Size().height() ); + mUIMapHeight->value( mUIMap->Map()->Size().getHeight() ); } - Txt = mTheme->createTextBox( "Tile Size", mUIWindow->getContainer(), Sizei(), Vector2i( mUIWindow->getContainer()->size().width() / 2, InitialY ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); + Txt = mTheme->createTextBox( "Tile Size", mUIWindow->getContainer(), Sizei(), Vector2i( mUIWindow->getContainer()->size().getWidth() / 2, InitialY ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); Txt = mTheme->createTextBox( "Width:", mUIWindow->getContainer(), Sizei( 46, 24 ), Vector2i( Txt->position().x + DistFromTitle, Txt->position().y + DistFromTitle ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW ); - mUIMapTWidth = mTheme->createSpinBox( mUIWindow->getContainer(), Sizei( 53, 24 ), Vector2i( Txt->position().x + Txt->size().width(), Txt->position().y ), UI_CONTROL_DEFAULT_FLAGS | UI_TEXT_SELECTION_ENABLED, 32, false ); + mUIMapTWidth = mTheme->createSpinBox( mUIWindow->getContainer(), Sizei( 53, 24 ), Vector2i( Txt->position().x + Txt->size().getWidth(), Txt->position().y ), UI_CONTROL_DEFAULT_FLAGS | UI_TEXT_SELECTION_ENABLED, 32, false ); mUIMapTWidth->minValue(1); if ( ResizeMap ) { - mUIMapTWidth->value( mUIMap->Map()->TileSize().width() ); + mUIMapTWidth->value( mUIMap->Map()->TileSize().getWidth() ); } - Txt = mTheme->createTextBox( "Height:", mUIWindow->getContainer(), Sizei( 46, 24 ), Vector2i( Txt->position().x, Txt->position().y + Txt->size().height() + 8 ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW ); + Txt = mTheme->createTextBox( "Height:", mUIWindow->getContainer(), Sizei( 46, 24 ), Vector2i( Txt->position().x, Txt->position().y + Txt->size().getHeight() + 8 ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW ); - mUIMapTHeight = mTheme->createSpinBox( mUIWindow->getContainer(), Sizei( 53, 24 ), Vector2i( Txt->position().x + Txt->size().width(), Txt->position().y ), UI_CONTROL_DEFAULT_FLAGS | UI_TEXT_SELECTION_ENABLED, 32, false ); + mUIMapTHeight = mTheme->createSpinBox( mUIWindow->getContainer(), Sizei( 53, 24 ), Vector2i( Txt->position().x + Txt->size().getWidth(), Txt->position().y ), UI_CONTROL_DEFAULT_FLAGS | UI_TEXT_SELECTION_ENABLED, 32, false ); mUIMapTHeight->minValue(1); if ( ResizeMap ) { - mUIMapTHeight->value( mUIMap->Map()->TileSize().height() ); + mUIMapTHeight->value( mUIMap->Map()->TileSize().getHeight() ); } - Txt = mTheme->createTextBox( "Max Layers", mUIWindow->getContainer(), Sizei(), Vector2i( 16, mUIMapTHeight->position().y + mUIMapTHeight->size().height() + 8 ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); + Txt = mTheme->createTextBox( "Max Layers", mUIWindow->getContainer(), Sizei(), Vector2i( 16, mUIMapTHeight->position().y + mUIMapTHeight->size().getHeight() + 8 ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); mUIMapMaxLayers = mTheme->createSpinBox( mUIWindow->getContainer(), Sizei( 53, 24 ), Vector2i( Txt->position().x + DistFromTitle, Txt->position().y + DistFromTitle ), UI_CONTROL_DEFAULT_FLAGS | UI_TEXT_SELECTION_ENABLED, 8, false ); mUIMapMaxLayers->maxValue( 32 ); - Txt = mTheme->createTextBox( "Map Flags:", mUIWindow->getContainer(), Sizei(), Vector2i( Txt->position().x, mUIMapMaxLayers->position().y + mUIMapMaxLayers->size().height() + 8 ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); + Txt = mTheme->createTextBox( "Map Flags:", mUIWindow->getContainer(), Sizei(), Vector2i( Txt->position().x, mUIMapMaxLayers->position().y + mUIMapMaxLayers->size().getHeight() + 8 ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); - mUILightsEnabled = mTheme->createCheckBox( mUIWindow->getContainer(), Sizei(), Vector2i( Txt->position().x + DistFromTitle, Txt->position().y + Txt->size().height() + 16 ), UI_CONTROL_DEFAULT_FLAGS | UI_AUTO_SIZE ); + mUILightsEnabled = mTheme->createCheckBox( mUIWindow->getContainer(), Sizei(), Vector2i( Txt->position().x + DistFromTitle, Txt->position().y + Txt->size().getHeight() + 16 ), UI_CONTROL_DEFAULT_FLAGS | UI_AUTO_SIZE ); mUILightsEnabled->text( "Lights Enabled" ); mUILightsEnabled->active( true ); @@ -84,7 +84,7 @@ UIMapNew::UIMapNew( UIMap * Map, cb::Callback0 NewMapCb, bool ResizeMap ) mUILightsEnabled->active( 0 != mUIMap->Map()->LightsEnabled() ); } - mUILightsByVertex = mTheme->createCheckBox( mUIWindow->getContainer(), Sizei(), Vector2i( mUIWindow->getContainer()->size().width() / 2, mUILightsEnabled->position().y ), UI_CONTROL_DEFAULT_FLAGS | UI_AUTO_SIZE ); + mUILightsByVertex = mTheme->createCheckBox( mUIWindow->getContainer(), Sizei(), Vector2i( mUIWindow->getContainer()->size().getWidth() / 2, mUILightsEnabled->position().y ), UI_CONTROL_DEFAULT_FLAGS | UI_AUTO_SIZE ); mUILightsByVertex->text( "Lights By Vertex" ); mUILightsByVertex->active( true ); @@ -92,7 +92,7 @@ UIMapNew::UIMapNew( UIMap * Map, cb::Callback0 NewMapCb, bool ResizeMap ) mUILightsByVertex->active( 0 != mUIMap->Map()->LightsByVertex() ); } - mUIClampBorders = mTheme->createCheckBox( mUIWindow->getContainer(), Sizei(), Vector2i( Txt->position().x + DistFromTitle, mUILightsEnabled->position().y + mUILightsEnabled->size().height() + 16 ), UI_CONTROL_DEFAULT_FLAGS | UI_AUTO_SIZE ); + mUIClampBorders = mTheme->createCheckBox( mUIWindow->getContainer(), Sizei(), Vector2i( Txt->position().x + DistFromTitle, mUILightsEnabled->position().y + mUILightsEnabled->size().getHeight() + 16 ), UI_CONTROL_DEFAULT_FLAGS | UI_AUTO_SIZE ); mUIClampBorders->text( "Clamp Borders" ); mUIClampBorders->active( true ); @@ -100,7 +100,7 @@ UIMapNew::UIMapNew( UIMap * Map, cb::Callback0 NewMapCb, bool ResizeMap ) mUIClampBorders->active( 0 != mUIMap->Map()->ClampBorders() ); } - mUIClipArea = mTheme->createCheckBox( mUIWindow->getContainer(), Sizei(), Vector2i( mUIWindow->getContainer()->size().width() / 2, mUIClampBorders->position().y ), UI_CONTROL_DEFAULT_FLAGS | UI_AUTO_SIZE ); + mUIClipArea = mTheme->createCheckBox( mUIWindow->getContainer(), Sizei(), Vector2i( mUIWindow->getContainer()->size().getWidth() / 2, mUIClampBorders->position().y ), UI_CONTROL_DEFAULT_FLAGS | UI_AUTO_SIZE ); mUIClipArea->text( "Clip View Area" ); mUIClipArea->active( true ); @@ -108,11 +108,11 @@ UIMapNew::UIMapNew( UIMap * Map, cb::Callback0 NewMapCb, bool ResizeMap ) mUIClipArea->active( 0 != mUIMap->Map()->ClipedArea() ); } - Txt = mTheme->createTextBox( "Map Base Color:", mUIWindow->getContainer(), Sizei(), Vector2i( Txt->position().x, mUIClipArea->position().y + mUIClipArea->size().height() + 8 ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); + Txt = mTheme->createTextBox( "Map Base Color:", mUIWindow->getContainer(), Sizei(), Vector2i( Txt->position().x, mUIClipArea->position().y + mUIClipArea->size().getHeight() + 8 ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); UIComplexControl::CreateParams ComParams; ComParams.setParent( mUIWindow->getContainer() ); - ComParams.setPos( Txt->position().x, Txt->position().y + Txt->size().height() + 4 ); + ComParams.setPos( Txt->position().x, Txt->position().y + Txt->size().getHeight() + 4 ); ComParams.setSize( 64, 64 ); ComParams.Background.color( ColorA( 255, 255, 255, 255 ) ); @@ -126,20 +126,20 @@ UIMapNew::UIMapNew( UIMap * Map, cb::Callback0 NewMapCb, bool ResizeMap ) mUIBaseColor->visible( true ); mUIBaseColor->enabled( true ); - Txt = mTheme->createTextBox( "Red Color:", mUIWindow->getContainer(), Sizei(), Vector2i( mUIBaseColor->position().x + mUIBaseColor->size().width() + 4, mUIBaseColor->position().y ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); + Txt = mTheme->createTextBox( "Red Color:", mUIWindow->getContainer(), Sizei(), Vector2i( mUIBaseColor->position().x + mUIBaseColor->size().getWidth() + 4, mUIBaseColor->position().y ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); - mUIRedSlider = mTheme->createSlider( mUIWindow->getContainer(), Sizei( 128, 20 ), Vector2i( Txt->position().x + Txt->size().width() + 16, Txt->position().y ), UI_CONTROL_DEFAULT_FLAGS | UI_AUTO_SIZE ); + mUIRedSlider = mTheme->createSlider( mUIWindow->getContainer(), Sizei( 128, 20 ), Vector2i( Txt->position().x + Txt->size().getWidth() + 16, Txt->position().y ), UI_CONTROL_DEFAULT_FLAGS | UI_AUTO_SIZE ); mUIRedSlider->maxValue( 255 ); mUIRedSlider->value( 255 ); mUIRedSlider->addEventListener( UIEvent::EventOnValueChange, cb::Make1( this, &UIMapNew::OnRedChange ) ); - mUIRedTxt = mTheme->createTextBox( String::toStr( 255 ), mUIWindow->getContainer(), Sizei(), Vector2i( mUIRedSlider->position().x + mUIRedSlider->size().width() + 4, mUIRedSlider->position().y ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); + mUIRedTxt = mTheme->createTextBox( String::toStr( 255 ), mUIWindow->getContainer(), Sizei(), Vector2i( mUIRedSlider->position().x + mUIRedSlider->size().getWidth() + 4, mUIRedSlider->position().y ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); if ( ResizeMap ) { mUIRedSlider->value( mUIMap->Map()->BaseColor().r() ); } - Txt = mTheme->createTextBox( "Green Color:", mUIWindow->getContainer(), Sizei(), Vector2i( mUIBaseColor->position().x + mUIBaseColor->size().width() + 4, mUIRedSlider->position().y + mUIRedSlider->size().height() + 4 ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); + Txt = mTheme->createTextBox( "Green Color:", mUIWindow->getContainer(), Sizei(), Vector2i( mUIBaseColor->position().x + mUIBaseColor->size().getWidth() + 4, mUIRedSlider->position().y + mUIRedSlider->size().getHeight() + 4 ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); mUIGreenSlider = mTheme->createSlider( mUIWindow->getContainer(), Sizei( 128, 20 ), Vector2i( mUIRedSlider->position().x, Txt->position().y ), UI_CONTROL_DEFAULT_FLAGS | UI_AUTO_SIZE ); mUIGreenSlider->maxValue( 255 ); @@ -147,31 +147,31 @@ UIMapNew::UIMapNew( UIMap * Map, cb::Callback0 NewMapCb, bool ResizeMap ) mUIGreenSlider->addEventListener( UIEvent::EventOnValueChange, cb::Make1( this, &UIMapNew::OnGreenChange ) ); - mUIGreenTxt = mTheme->createTextBox( String::toStr( 255 ), mUIWindow->getContainer(), Sizei(), Vector2i( mUIGreenSlider->position().x + mUIGreenSlider->size().width() + 4, mUIGreenSlider->position().y ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); + mUIGreenTxt = mTheme->createTextBox( String::toStr( 255 ), mUIWindow->getContainer(), Sizei(), Vector2i( mUIGreenSlider->position().x + mUIGreenSlider->size().getWidth() + 4, mUIGreenSlider->position().y ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); if ( ResizeMap ) { mUIGreenSlider->value( mUIMap->Map()->BaseColor().g() ); } - Txt = mTheme->createTextBox( "Blue Color:", mUIWindow->getContainer(), Sizei(), Vector2i( mUIBaseColor->position().x + mUIBaseColor->size().width() + 4, mUIGreenSlider->position().y + mUIGreenSlider->size().height() + 4 ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); + Txt = mTheme->createTextBox( "Blue Color:", mUIWindow->getContainer(), Sizei(), Vector2i( mUIBaseColor->position().x + mUIBaseColor->size().getWidth() + 4, mUIGreenSlider->position().y + mUIGreenSlider->size().getHeight() + 4 ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); mUIBlueSlider = mTheme->createSlider( mUIWindow->getContainer(), Sizei( 128, 20 ), Vector2i( mUIRedSlider->position().x, Txt->position().y ), UI_CONTROL_DEFAULT_FLAGS | UI_AUTO_SIZE ); mUIBlueSlider->maxValue( 255 ); mUIBlueSlider->value( 255 ); mUIBlueSlider->addEventListener( UIEvent::EventOnValueChange, cb::Make1( this, &UIMapNew::OnBlueChange ) ); - mUIBlueTxt = mTheme->createTextBox( String::toStr( 255 ), mUIWindow->getContainer(), Sizei(), Vector2i( mUIBlueSlider->position().x + mUIBlueSlider->size().width() + 4, mUIBlueSlider->position().y ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); + mUIBlueTxt = mTheme->createTextBox( String::toStr( 255 ), mUIWindow->getContainer(), Sizei(), Vector2i( mUIBlueSlider->position().x + mUIBlueSlider->size().getWidth() + 4, mUIBlueSlider->position().y ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); if ( ResizeMap ) { mUIBlueSlider->value( mUIMap->Map()->BaseColor().b() ); } UIPushButton * OKButton = mTheme->createPushButton( mUIWindow->getContainer(), Sizei( 80, 22 ), Vector2i(), UI_CONTROL_DEFAULT_FLAGS_CENTERED | UI_AUTO_SIZE, mTheme->getIconByName( "ok" ) ); - OKButton->position( mUIWindow->getContainer()->size().width() - OKButton->size().width() - 4, mUIWindow->getContainer()->size().height() - OKButton->size().height() - 4 ); + OKButton->position( mUIWindow->getContainer()->size().getWidth() - OKButton->size().getWidth() - 4, mUIWindow->getContainer()->size().getHeight() - OKButton->size().getHeight() - 4 ); OKButton->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &UIMapNew::OKClick ) ); OKButton->text( "OK" ); - UIPushButton * CancelButton = mTheme->createPushButton( mUIWindow->getContainer(), OKButton->size(), Vector2i( OKButton->position().x - OKButton->size().width() - 4, OKButton->position().y ), UI_CONTROL_DEFAULT_FLAGS_CENTERED | UI_AUTO_SIZE, mTheme->getIconByName( "cancel" ) ); + UIPushButton * CancelButton = mTheme->createPushButton( mUIWindow->getContainer(), OKButton->size(), Vector2i( OKButton->position().x - OKButton->size().getWidth() - 4, OKButton->position().y ), UI_CONTROL_DEFAULT_FLAGS_CENTERED | UI_AUTO_SIZE, mTheme->getIconByName( "cancel" ) ); CancelButton->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &UIMapNew::CancelClick ) ); CancelButton->text( "Cancel" ); diff --git a/src/eepp/gaming/maplightmanager.cpp b/src/eepp/gaming/maplightmanager.cpp index 522867156..0631cdb51 100644 --- a/src/eepp/gaming/maplightmanager.cpp +++ b/src/eepp/gaming/maplightmanager.cpp @@ -69,14 +69,14 @@ void MapLightManager::UpdateByVertex() { else mTileColors[x][y][0]->assign( Light->ProcessVertex( Pos.x, Pos.y, *(mTileColors[x][y][0]), *(mTileColors[x][y][0]) ) ); - mTileColors[x][y][1]->assign( Light->ProcessVertex( Pos.x, Pos.y + TileSize.height(), *(mTileColors[x][y][1]), *(mTileColors[x][y][1]) ) ); + mTileColors[x][y][1]->assign( Light->ProcessVertex( Pos.x, Pos.y + TileSize.getHeight(), *(mTileColors[x][y][1]), *(mTileColors[x][y][1]) ) ); - mTileColors[x][y][2]->assign( Light->ProcessVertex( Pos.x + TileSize.width(), Pos.y + TileSize.height(), *(mTileColors[x][y][2]), *(mTileColors[x][y][2]) ) ); + mTileColors[x][y][2]->assign( Light->ProcessVertex( Pos.x + TileSize.getWidth(), Pos.y + TileSize.getHeight(), *(mTileColors[x][y][2]), *(mTileColors[x][y][2]) ) ); if ( y > 0 ) mTileColors[x][y][3]->assign( *mTileColors[x][y - 1][2] ); else - mTileColors[x][y][3]->assign( Light->ProcessVertex( Pos.x + TileSize.width(), Pos.y, *(mTileColors[x][y][3]), *(mTileColors[x][y][3]) ) ); + mTileColors[x][y][3]->assign( Light->ProcessVertex( Pos.x + TileSize.getWidth(), Pos.y, *(mTileColors[x][y][3]), *(mTileColors[x][y][3]) ) ); } } } @@ -117,7 +117,7 @@ void MapLightManager::UpdateByTile() { eeAABB 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.width(), Pos.y + HalfTileSize.height(), *(mTileColors[x][y][0]), *(mTileColors[x][y][0]) ) ); + mTileColors[x][y][0]->assign( Light->ProcessVertex( Pos.x + HalfTileSize.getWidth(), Pos.y + HalfTileSize.getHeight(), *(mTileColors[x][y][0]), *(mTileColors[x][y][0]) ) ); } } } @@ -187,10 +187,10 @@ const ColorA * MapLightManager::GetTileColor( const Vector2i& TilePos, const Uin void MapLightManager::AllocateColors() { Sizei Size = mMap->Size(); - mTileColors = eeNewArray( ColorA***, Size.width() ); + mTileColors = eeNewArray( ColorA***, Size.getWidth() ); for ( Int32 x = 0; x < Size.x; x++ ) { - mTileColors[x] = eeNewArray( ColorA**, Size.height() ); + mTileColors[x] = eeNewArray( ColorA**, Size.getHeight() ); for ( Int32 y = 0; y < Size.y; y++ ) { mTileColors[x][y] = eeNewArray( ColorA*, mNumVertex ); diff --git a/src/eepp/gaming/objectlayer.cpp b/src/eepp/gaming/objectlayer.cpp index 4d8659ccc..b02e8743c 100644 --- a/src/eepp/gaming/objectlayer.cpp +++ b/src/eepp/gaming/objectlayer.cpp @@ -50,7 +50,7 @@ void MapObjectLayer::Draw( const Vector2f &Offset ) { GameObject * Obj = (*it); if ( Obj->Blocked() ) { - Tex->drawEx( Obj->Pos().x, Obj->Pos().y, Obj->Size().width(), Obj->Size().height(), 0, Vector2f::One, Col, Col, Col, Col ); + Tex->drawEx( Obj->Pos().x, Obj->Pos().y, Obj->Size().getWidth(), Obj->Size().getHeight(), 0, Vector2f::One, Col, Col, Col, Col ); } } } diff --git a/src/eepp/gaming/tilemap.cpp b/src/eepp/gaming/tilemap.cpp index 79aec18ba..33b68702e 100644 --- a/src/eepp/gaming/tilemap.cpp +++ b/src/eepp/gaming/tilemap.cpp @@ -119,7 +119,7 @@ void TileMap::CreateEmptyTile() { //! I create a texture representing an empty tile to render instead of rendering with primitives because is a lot faster, at least with NVIDIA GPUs. TextureFactory * TF = TextureFactory::instance(); - std::string tileName( String::strFormated( "maptile-%dx%d-%ul", mTileSize.width(), mTileSize.height(), mGridLinesColor.getValue() ) ); + std::string tileName( String::strFormated( "maptile-%dx%d-%ul", mTileSize.getWidth(), mTileSize.getHeight(), mGridLinesColor.getValue() ) ); Texture * Tex = TF->getByName( tileName ); @@ -127,7 +127,7 @@ void TileMap::CreateEmptyTile() { Uint32 x, y; ColorA Col( mGridLinesColor ); - Image Img( mTileSize.width(), mTileSize.height(), 4 ); + Image Img( mTileSize.getWidth(), mTileSize.getHeight(), 4 ); Img.fillWithColor( ColorA( 0, 0, 0, 0 ) ); @@ -327,12 +327,12 @@ void TileMap::GetMouseOverTile() { MapPos.x = eemin( MapPos.x, mPixelSize.x ); MapPos.y = eemin( MapPos.y, mPixelSize.y ); - mMouseOverTile.x = MapPos.x / mTileSize.width(); - mMouseOverTile.y = MapPos.y / mTileSize.height(); + mMouseOverTile.x = MapPos.x / mTileSize.getWidth(); + mMouseOverTile.y = MapPos.y / mTileSize.getHeight(); // Clamped pos - mMouseOverTileFinal.x = eemin( mMouseOverTile.x, mSize.width() - 1 ); - mMouseOverTileFinal.y = eemin( mMouseOverTile.y, mSize.height() - 1 ); + mMouseOverTileFinal.x = eemin( mMouseOverTile.x, mSize.getWidth() - 1 ); + mMouseOverTileFinal.y = eemin( mMouseOverTile.y, mSize.getHeight() - 1 ); mMouseOverTileFinal.x = eemax( mMouseOverTileFinal.x, 0 ); mMouseOverTileFinal.y = eemax( mMouseOverTileFinal.y, 0 ); @@ -433,7 +433,7 @@ void TileMap::Scale( const Float& scale ) { } void TileMap::UpdateScreenAABB() { - mScreenAABB = eeAABB( -mOffset.x, -mOffset.y, -mOffset.x + mViewSize.width(), -mOffset.y + mViewSize.height() ); + mScreenAABB = eeAABB( -mOffset.x, -mOffset.y, -mOffset.x + mViewSize.getWidth(), -mOffset.y + mViewSize.getHeight() ); } const eeAABB& TileMap::GetViewAreaAABB() const { @@ -1086,10 +1086,10 @@ void TileMap::SaveToStream( IOStream& IOS ) { MapHdr.Magic = EE_MAP_MAGIC; MapHdr.Flags = mFlags; MapHdr.MaxLayers = mMaxLayers; - MapHdr.SizeX = mSize.width(); - MapHdr.SizeY = mSize.height(); - MapHdr.TileSizeX = mTileSize.width(); - MapHdr.TileSizeY = mTileSize.height(); + MapHdr.SizeX = mSize.getWidth(); + MapHdr.SizeY = mSize.getHeight(); + MapHdr.TileSizeX = mTileSize.getWidth(); + MapHdr.TileSizeY = mTileSize.getHeight(); MapHdr.LayerCount = mLayerCount; MapHdr.PropertyCount = mProperties.size(); MapHdr.TextureAtlasCount = TextureAtlases.size(); @@ -1309,7 +1309,7 @@ void TileMap::SaveToStream( IOStream& IOS ) { String::strCopy( tObjObjHdr.Name, tObjObj->Name().c_str(), MAP_PROPERTY_SIZE ); String::strCopy( tObjObjHdr.Type, tObjObj->TypeName().c_str(), MAP_PROPERTY_SIZE ); - tObjObjHdr.PointCount = tPoly.size(); + tObjObjHdr.PointCount = tPoly.getSize(); tObjObjHdr.PropertyCount = tObjObjProp.size(); //! Writes the ObjObj header @@ -1329,7 +1329,7 @@ void TileMap::SaveToStream( IOStream& IOS ) { } //! Writes the polygon points - for ( Uint32 tPoint = 0; tPoint < tPoly.size(); tPoint++ ) { + for ( Uint32 tPoint = 0; tPoint < tPoly.getSize(); tPoint++ ) { Vector2f pf( tPoly.getAt( tPoint ) ); Vector2if p( pf.x, pf.y ); //! Convert it to Int32 diff --git a/src/eepp/gaming/tilemaplayer.cpp b/src/eepp/gaming/tilemaplayer.cpp index b4a296519..dd5187742 100644 --- a/src/eepp/gaming/tilemaplayer.cpp +++ b/src/eepp/gaming/tilemaplayer.cpp @@ -75,10 +75,10 @@ void TileMapLayer::Update() { } void TileMapLayer::AllocateLayer() { - mTiles = eeNewArray( GameObject**, mSize.width() ); + mTiles = eeNewArray( GameObject**, mSize.getWidth() ); for ( Int32 x = 0; x < mSize.x; x++ ) { - mTiles[x] = eeNewArray( GameObject*, mSize.height() ); + mTiles[x] = eeNewArray( GameObject*, mSize.getHeight() ); for ( Int32 y = 0; y < mSize.y; y++ ) { mTiles[x][y] = NULL; @@ -139,11 +139,11 @@ const Vector2i& TileMapLayer::GetCurrentTile() const { } Vector2i TileMapLayer::GetTilePosFromPos( const Vector2f& Pos ) { - return Vector2i( ( (Int32)Pos.x + mOffset.x ) / mMap->TileSize().width(), ( (Int32)Pos.y + mOffset.y ) / mMap->TileSize().height() ); + return Vector2i( ( (Int32)Pos.x + mOffset.x ) / mMap->TileSize().getWidth(), ( (Int32)Pos.y + mOffset.y ) / mMap->TileSize().getHeight() ); } Vector2f TileMapLayer::GetPosFromTilePos( const Vector2i& TilePos ) { - return Vector2f( TilePos.x * mMap->TileSize().width() + mOffset.x, TilePos.y * mMap->TileSize().height() + mOffset.y ); + return Vector2f( TilePos.x * mMap->TileSize().getWidth() + mOffset.x, TilePos.y * mMap->TileSize().getHeight() + mOffset.y ); } }} diff --git a/src/eepp/graphics/batchrenderer.cpp b/src/eepp/graphics/batchrenderer.cpp index b7a72ee70..c62614c5d 100755 --- a/src/eepp/graphics/batchrenderer.cpp +++ b/src/eepp/graphics/batchrenderer.cpp @@ -756,16 +756,16 @@ void BatchRenderer::polygonSetColor( const ColorA& Color ) { } void BatchRenderer::batchPolygon( const Polygon2f& Polygon ) { - if ( Polygon.size() > mVertexSize ) + if ( Polygon.getSize() > mVertexSize ) return; setBlendMode( DM_POLYGON, mForceBlendMode ); - for ( Uint32 i = 0; i < Polygon.size(); i++ ) { + for ( Uint32 i = 0; i < Polygon.getSize(); i++ ) { mTVertex = &mVertex[ mNumVertex ]; - mTVertex->pos.x = Polygon.x() + Polygon[i].x; - mTVertex->pos.y = Polygon.y() + Polygon[i].y; + mTVertex->pos.x = Polygon.getX() + Polygon[i].x; + mTVertex->pos.y = Polygon.getY() + Polygon[i].y; mTVertex->tex = mTexCoord[0]; mTVertex->color = mVerColor[0]; diff --git a/src/eepp/graphics/image.cpp b/src/eepp/graphics/image.cpp index 34be9c202..808f62290 100644 --- a/src/eepp/graphics/image.cpp +++ b/src/eepp/graphics/image.cpp @@ -614,7 +614,7 @@ Graphics::Image * Image::thumbnail( const Uint32& maxWidth, const Uint32& maxHei Graphics::Image * Image::crop( Recti rect ) { if ( rect.Left >= 0 && rect.Right <= (Int32)mWidth && rect.Top >= 0 && rect.Bottom <= (Int32)mHeight ) { - Image * img = eeNew( Image, ( rect.size().width(), rect.size().height(), mChannels ) ); + Image * img = eeNew( Image, ( rect.getSize().getWidth(), rect.getSize().getHeight(), mChannels ) ); // Copy per row for ( unsigned int ty = 0; ty < img->mHeight; ty++ ) { diff --git a/src/eepp/graphics/primitives.cpp b/src/eepp/graphics/primitives.cpp index 6faf5c042..87b42aeec 100755 --- a/src/eepp/graphics/primitives.cpp +++ b/src/eepp/graphics/primitives.cpp @@ -227,9 +227,9 @@ void Primitives::drawRectangle( const Rectf& R, const ColorA& TopLeft, const Col sBR->quadsBegin(); sBR->quadsSetColorFree( TopLeft, BottomLeft, BottomRight, TopRight ); - Sizef size = const_cast(&R)->size(); + Sizef size = const_cast(&R)->getSize(); - sBR->batchQuadEx( R.Left, R.Top, size.width(), size.height(), Angle, Scale ); + sBR->batchQuadEx( R.Left, R.Top, size.getWidth(), size.getHeight(), Angle, Scale ); break; } case DRAW_LINE: @@ -241,10 +241,10 @@ void Primitives::drawRectangle( const Rectf& R, const ColorA& TopLeft, const Col if ( Scale != 1.0f || Angle != 0.0f ) { Quad2f Q( R ); - Sizef size = const_cast(&R)->size(); + Sizef size = const_cast(&R)->getSize(); Q.scale( Scale ); - Q.rotate( Angle, Vector2f( R.Left + size.width() * 0.5f, R.Top + size.height() * 0.5f ) ); + Q.rotate( Angle, Vector2f( R.Left + size.getWidth() * 0.5f, R.Top + size.getHeight() * 0.5f ) ); sBR->batchLineLoop( Q[0].x, Q[0].y, Q[1].x, Q[1].y ); sBR->lineLoopSetColorFree( BottomRight, TopRight ); @@ -271,11 +271,11 @@ void Primitives::drawRoundedRectangle( const Rectf& R, const ColorA& TopLeft, co sBR->setBlendMode( mBlendMode ); unsigned int i; - Sizef size = const_cast( &R )->size(); - Float xscalediff = size.width() * Scale.x - size.width(); - Float yscalediff = size.height() * Scale.y - size.height(); - Vector2f Center( R.Left + size.width() * 0.5f + xscalediff, R.Top + size.height() * 0.5f + yscalediff ); - Polygon2f Poly = Polygon2f::createRoundedRectangle( R.Left - xscalediff, R.Top - yscalediff, size.width() + xscalediff, size.height() + yscalediff, Corners ); + Sizef size = const_cast( &R )->getSize(); + Float xscalediff = size.getWidth() * Scale.x - size.getWidth(); + Float yscalediff = size.getHeight() * Scale.y - size.getHeight(); + Vector2f Center( R.Left + size.getWidth() * 0.5f + xscalediff, R.Top + size.getHeight() * 0.5f + yscalediff ); + Polygon2f Poly = Polygon2f::createRoundedRectangle( R.Left - xscalediff, R.Top - yscalediff, size.getWidth() + xscalediff, size.getHeight() + yscalediff, Corners ); Vector2f poly; Poly.rotate( Angle, Center ); @@ -288,7 +288,7 @@ void Primitives::drawRoundedRectangle( const Rectf& R, const ColorA& TopLeft, co sBR->batchPolygon( Poly ); } else { - for ( i = 0; i < Poly.size(); i++ ) { + for ( i = 0; i < Poly.getSize(); i++ ) { poly = Poly[i]; if ( poly.x <= Center.x && poly.y <= Center.y ) @@ -316,11 +316,11 @@ void Primitives::drawRoundedRectangle( const Rectf& R, const ColorA& TopLeft, co sBR->lineLoopSetColor( TopLeft ); if ( TopLeft == BottomLeft && BottomLeft == BottomRight && BottomRight == TopRight ) { - for ( i = 0; i < Poly.size(); i+=2 ) { + for ( i = 0; i < Poly.getSize(); i+=2 ) { sBR->batchLineLoop( Poly[i], Poly[i+1] ); } } else { - for ( unsigned int i = 0; i < Poly.size(); i++ ) { + for ( unsigned int i = 0; i < Poly.getSize(); i++ ) { poly = Poly[i]; if ( poly.x <= Center.x && poly.y <= Center.y ) @@ -393,8 +393,8 @@ void Primitives::drawPolygon( const Polygon2f& p ) { sBR->lineLoopBegin(); sBR->lineLoopSetColor( mColor ); - for ( Uint32 i = 0; i < p.size(); i += 2 ) - sBR->batchLineLoop( p.x() + p[i].x, p.y() + p[i].y, p.x() + p[i+1].x, p.y() + p[i+1].y ); + for ( Uint32 i = 0; i < p.getSize(); i += 2 ) + sBR->batchLineLoop( p.getX() + p[i].x, p.getY() + p[i].y, p.getX() + p[i+1].x, p.getY() + p[i+1].y ); break; } diff --git a/src/eepp/graphics/scrollparallax.cpp b/src/eepp/graphics/scrollparallax.cpp index f2f148e66..44a03e656 100755 --- a/src/eepp/graphics/scrollparallax.cpp +++ b/src/eepp/graphics/scrollparallax.cpp @@ -29,15 +29,15 @@ void ScrollParallax::subTexture( Graphics::SubTexture * subTexture ) { void ScrollParallax::setSubTexture() { if ( NULL != mSubTexture ) { mRect = mSubTexture->srcRect(); - mRealSize = Vector2f( (Float)mSubTexture->realSize().width(), (Float)mSubTexture->realSize().height() ); + mRealSize = Vector2f( (Float)mSubTexture->realSize().getWidth(), (Float)mSubTexture->realSize().getHeight() ); - mTiles.x = ( (Int32)mSize.width() / mSubTexture->realSize().width() ) + 1; - mTiles.y = ( (Int32)mSize.height() / mSubTexture->realSize().height() ) + 1; + mTiles.x = ( (Int32)mSize.getWidth() / mSubTexture->realSize().getWidth() ) + 1; + mTiles.y = ( (Int32)mSize.getHeight() / mSubTexture->realSize().getHeight() ) + 1; } } void ScrollParallax::setAABB() { - mAABB = Rectf( mInitPos.x, mInitPos.y, mInitPos.x + mSize.width(), mInitPos.y + mSize.height() ); + mAABB = Rectf( mInitPos.x, mInitPos.y, mInitPos.x + mSize.getWidth(), mInitPos.y + mSize.getHeight() ); } bool ScrollParallax::create( Graphics::SubTexture * SubTexture, const Vector2f& Position, const Sizef& Size, const Vector2f& Speed, const ColorA& Color, const EE_BLEND_MODE& Blend ) { @@ -84,10 +84,10 @@ void ScrollParallax::draw() { if ( NULL != mSubTexture && mAABB.Left != mAABB.Right && mAABB.Top != mAABB.Bottom && 0 != mColor.Alpha ) { mPos += mSpeed * (Float)mElapsed.getElapsed().asSeconds(); - if ( mPos.x > mAABB.Left + mRealSize.width() || mPos.x < mAABB.Left - mRealSize.width() ) + if ( mPos.x > mAABB.Left + mRealSize.getWidth() || mPos.x < mAABB.Left - mRealSize.getWidth() ) mPos.x = mAABB.Left; - if ( mPos.y > mAABB.Top + mRealSize.height() || mPos.y < mAABB.Top - mRealSize.height() ) + if ( mPos.y > mAABB.Top + mRealSize.getHeight() || mPos.y < mAABB.Top - mRealSize.getHeight() ) mPos.y = mAABB.Top; Vector2f Pos = mPos; @@ -96,15 +96,15 @@ void ScrollParallax::draw() { Pos.y = (Float)(Int32)Pos.y; if ( mSpeed.x > 0.f ) - Pos.x -= mRealSize.width(); + Pos.x -= mRealSize.getWidth(); if ( mSpeed.y > 0.f ) - Pos.y -= mRealSize.height(); + Pos.y -= mRealSize.getHeight(); for ( Int32 y = -1; y < mTiles.y; y++ ) { for ( Int32 x = -1; x < mTiles.x; x++ ) { Recti Rect = mRect; - Rectf AABB( Pos.x, Pos.y, Pos.x + mRealSize.width(), Pos.y + mRealSize.height() ); + Rectf AABB( Pos.x, Pos.y, Pos.x + mRealSize.getWidth(), Pos.y + mRealSize.getHeight() ); if ( AABB.intersect( mAABB ) ) { if ( Pos.x < mAABB.Left ) { @@ -112,8 +112,8 @@ void ScrollParallax::draw() { AABB.Left = mAABB.Left; } - if ( Pos.x + mRealSize.width() > mAABB.Right ) { - Rect.Right -= (Int32)( ( Pos.x + mRealSize.width() ) - mAABB.Right ); + if ( Pos.x + mRealSize.getWidth() > mAABB.Right ) { + Rect.Right -= (Int32)( ( Pos.x + mRealSize.getWidth() ) - mAABB.Right ); } if ( Pos.y < mAABB.Top ) { @@ -121,8 +121,8 @@ void ScrollParallax::draw() { AABB.Top = mAABB.Top; } - if ( Pos.y + mRealSize.height() > mAABB.Bottom ) { - Rect.Bottom -= (Int32)( ( Pos.y + mRealSize.height() ) - mAABB.Bottom ); + if ( Pos.y + mRealSize.getHeight() > mAABB.Bottom ) { + Rect.Bottom -= (Int32)( ( Pos.y + mRealSize.getHeight() ) - mAABB.Bottom ); } mSubTexture->srcRect( Rect ); @@ -132,15 +132,15 @@ void ScrollParallax::draw() { mSubTexture->draw( AABB.Left, AABB.Top, mColor, 0.f, Vector2f::One, mBlend ); } - Pos.x += mRealSize.width(); + Pos.x += mRealSize.getWidth(); } Pos.x = (Float)(Int32)mPos.x; if ( mSpeed.x > 0.f ) - Pos.x -= mRealSize.width(); + Pos.x -= mRealSize.getWidth(); - Pos.y += mRealSize.height(); + Pos.y += mRealSize.getHeight(); } mSubTexture->srcRect( mRect ); diff --git a/src/eepp/graphics/sprite.cpp b/src/eepp/graphics/sprite.cpp index 7bf5c899c..80b6fd305 100755 --- a/src/eepp/graphics/sprite.cpp +++ b/src/eepp/graphics/sprite.cpp @@ -238,7 +238,7 @@ Quad2f Sprite::getQuad() { Vector2f Center; if ( mOrigin.OriginType == OriginPoint::OriginCenter ) { - Center = TmpR.center(); + Center = TmpR.getCenter(); } else if ( mOrigin.OriginType == OriginPoint::OriginTopLeft ) { Center = mPos; } else { @@ -289,7 +289,7 @@ eeAABB Sprite::getAABB() { Vector2f Center; if ( mOrigin.OriginType == OriginPoint::OriginCenter ) { - Center = TmpR.center(); + Center = TmpR.getCenter(); } else if ( mOrigin.OriginType == OriginPoint::OriginTopLeft ) { Center = mPos; } else { diff --git a/src/eepp/graphics/subtexture.cpp b/src/eepp/graphics/subtexture.cpp index 516a15eda..929854867 100644 --- a/src/eepp/graphics/subtexture.cpp +++ b/src/eepp/graphics/subtexture.cpp @@ -29,7 +29,7 @@ SubTexture::SubTexture( const Uint32& TexId, const std::string& Name ) : mTexId( TexId ), mTexture( TextureFactory::instance()->getTexture( TexId ) ), mSrcRect( Recti( 0, 0, NULL != mTexture ? mTexture->imgWidth() : 0, NULL != mTexture ? mTexture->imgHeight() : 0 ) ), - mDestSize( (Float)mSrcRect.size().width(), (Float)mSrcRect.size().height() ), + mDestSize( (Float)mSrcRect.getSize().getWidth(), (Float)mSrcRect.getSize().getHeight() ), mOffset(0,0) { createUnnamed(); @@ -318,7 +318,7 @@ bool SubTexture::unlock( const bool& KeepData, const bool& Modified ) { else if ( 1 == Channels ) Channel = GL_ALPHA; - glTexSubImage2D( GL_TEXTURE_2D, 0, mSrcRect.Left, mSrcRect.Top, mSrcRect.size().width(), mSrcRect.size().height(), Channel, GL_UNSIGNED_BYTE, reinterpret_cast ( &mPixels[0] ) ); + glTexSubImage2D( GL_TEXTURE_2D, 0, mSrcRect.Left, mSrcRect.Top, mSrcRect.getSize().getWidth(), mSrcRect.getSize().getHeight(), Channel, GL_UNSIGNED_BYTE, reinterpret_cast ( &mPixels[0] ) ); } if ( !KeepData ) { @@ -332,7 +332,7 @@ bool SubTexture::unlock( const bool& KeepData, const bool& Modified ) { } Sizei SubTexture::realSize() { - return mSrcRect.size(); + return mSrcRect.getSize(); } Sizei SubTexture::size() { @@ -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().width(), realSize().height(), mTexture->channels(), getPixelsPtr() ) ); + Res = 0 != ( SOIL_save_image ( filepath.c_str(), Format, realSize().getWidth(), realSize().getHeight(), mTexture->channels(), getPixelsPtr() ) ); } else { jpge::params params; params.m_quality = Image::jpegQuality(); - Res = jpge::compress_image_to_jpeg_file( filepath.c_str(), realSize().width(), realSize().height(), mTexture->channels(), getPixelsPtr(), params); + Res = jpge::compress_image_to_jpeg_file( filepath.c_str(), realSize().getWidth(), realSize().getHeight(), mTexture->channels(), getPixelsPtr(), params); } } @@ -369,9 +369,9 @@ bool SubTexture::saveToFile(const std::string& filepath, const EE_SAVE_TYPE& For } void SubTexture::resetDestSize() { - Sizei Size = mSrcRect.size(); - mDestSize.x = (Float)Size.width(); - mDestSize.y = (Float)Size.height(); + Sizei Size = mSrcRect.getSize(); + mDestSize.x = (Float)Size.getWidth(); + mDestSize.y = (Float)Size.getHeight(); } }} diff --git a/src/eepp/graphics/texture.cpp b/src/eepp/graphics/texture.cpp index 0278a65f7..1d9990254 100755 --- a/src/eepp/graphics/texture.cpp +++ b/src/eepp/graphics/texture.cpp @@ -601,11 +601,11 @@ void Texture::drawEx( Float x, Float y, Float width, Float height, const Float & if ( Angle != 0.f || Scale != 1.f ) { if ( Center.OriginType == OriginPoint::OriginCenter ) { - Center = TmpR.center(); + Center = TmpR.getCenter(); } else if ( Center.OriginType == OriginPoint::OriginTopLeft ) { - Center = TmpR.pos(); + Center = TmpR.getPosition(); } else { - Center += TmpR.pos(); + Center += TmpR.getPosition(); } Q.rotate( Angle, Center ); diff --git a/src/eepp/graphics/ttffont.cpp b/src/eepp/graphics/ttffont.cpp index ba08b1048..a31fdbc9a 100755 --- a/src/eepp/graphics/ttffont.cpp +++ b/src/eepp/graphics/ttffont.cpp @@ -251,7 +251,7 @@ bool TTFFont::iLoad( const unsigned int& Size, EE_TTF_FONT_STYLE Style, const Ui TempGlyph.CurX + TempGlyph.CurW, TempGlyph.CurY + TempGlyph.CurH ); - Sizei nGlyphS( nGlyphR.size() ); + Sizei nGlyphS( nGlyphR.getSize() ); if ( nGlyphS.x > 0 && nGlyphS.y > 0 ) { Uint32 Pos = 0; diff --git a/src/eepp/math/interpolation.cpp b/src/eepp/math/interpolation.cpp index 0187b02c7..b330b7e56 100644 --- a/src/eepp/math/interpolation.cpp +++ b/src/eepp/math/interpolation.cpp @@ -197,7 +197,7 @@ void Interpolation::setTotalTime( const Time & TotTime ) { } } -void Interpolation::speed( const Float Speed ) { +void Interpolation::setSpeed( const Float Speed ) { Float tdist = mTotDist; mSpeed = Speed; Float CurDist; @@ -225,19 +225,19 @@ void Interpolation::speed( const Float Speed ) { } } -void Interpolation::type( Ease::Interpolation InterpolationType ) { +void Interpolation::setType( Ease::Interpolation InterpolationType ) { mType = InterpolationType; } -const int& Interpolation::type() const { +const int& Interpolation::getType() const { return mType; } -const bool& Interpolation::loop() const { +const bool& Interpolation::getLoop() const { return mLoop; } -void Interpolation::loop( const bool& loop ) { +void Interpolation::setLoop( const bool& loop ) { mLoop = loop; } @@ -261,15 +261,15 @@ const std::vector& Interpolation::getPoints() const { return mPoints; } -const Float& Interpolation::speed() const { +const Float& Interpolation::getSpeed() const { return mSpeed; } -const bool& Interpolation::enabled() const { +const bool& Interpolation::isEnabled() const { return mEnable; } -void Interpolation::enabled( const bool& Enabled ) { +void Interpolation::setEnabled( const bool& Enabled ) { mEnable = Enabled; } diff --git a/src/eepp/math/mtrand.cpp b/src/eepp/math/mtrand.cpp index 73a138329..a60c905bf 100755 --- a/src/eepp/math/mtrand.cpp +++ b/src/eepp/math/mtrand.cpp @@ -3,11 +3,11 @@ namespace EE { namespace Math { MTRand::MTRand( const Uint32 oneSeed ) { - seed( oneSeed ); + setSeed( oneSeed ); } MTRand::MTRand() { - seed(); + setSeed(); } MTRand::MTRand( const MTRand& o ) { @@ -57,13 +57,13 @@ void MTRand::reload() { mLeft = N, mNext = mState; } -void MTRand::seed( const Uint32 oneSeed ) { +void MTRand::setSeed( const Uint32 oneSeed ) { initialize( oneSeed ); reload(); } -void MTRand::seed() { - seed( 0xFEDCBA09 ); +void MTRand::setSeed() { + setSeed( 0xFEDCBA09 ); } Uint32 MTRand::hiBit( const Uint32 u ) const { @@ -90,7 +90,7 @@ Uint32 MTRand::twist( const Uint32 m, const Uint32 s0, const Uint32 s1 ) const { return m ^ ( mixBits( s0, s1 )>>1 ) ^ magic(s1); } -Uint32 MTRand::randi() { +Uint32 MTRand::getRandi() { if ( mLeft == 0 ) reload(); @@ -105,7 +105,7 @@ Uint32 MTRand::randi() { return ( s1 ^ (s1 >> 18) ); } -Uint32 MTRand::randi( const Uint32 n ) { +Uint32 MTRand::getRandi( const Uint32 n ) { Uint32 used = n; used |= used >> 1; used |= used >> 2; @@ -116,34 +116,34 @@ Uint32 MTRand::randi( const Uint32 n ) { Uint32 i; do { - i = randi() & used; + i = getRandi() & used; } while ( i > n ); return i; } -double MTRand::rand() { - return double( randi() ) * ( 1.0 / 4294967295.0 ); +double MTRand::getRand() { + return double( getRandi() ) * ( 1.0 / 4294967295.0 ); } -double MTRand::rand( const double n ) { - return rand() * n; +double MTRand::getRand( const double n ) { + return getRand() * n; } -Float MTRand::randf() { - return (Float)rand(); +Float MTRand::getRandf() { + return (Float)getRand(); } -Float MTRand::randf( const Float n ) { - return (Float)rand(n); +Float MTRand::getRandf( const Float n ) { + return (Float)getRand(n); } -int MTRand::randRange( int Min, int Max ) { - return Min + randi( Max - Min ); +int MTRand::getRandFromRange( int Min, int Max ) { + return Min + getRandi( Max - Min ); } -Float MTRand::randRange( Float Min, Float Max ) { - return Min + randf( Max - Min ); +Float MTRand::getRandFromRange( Float Min, Float Max ) { + return Min + getRandf( Max - Min ); } MTRand& MTRand::operator=( const MTRand& o ) { diff --git a/src/eepp/math/perlinnoise.cpp b/src/eepp/math/perlinnoise.cpp index 72f96a34d..04b065149 100755 --- a/src/eepp/math/perlinnoise.cpp +++ b/src/eepp/math/perlinnoise.cpp @@ -18,7 +18,7 @@ void PerlinNoise::init() { mAmpOctaveDep = false; } -Float PerlinNoise::perlinNoise2D(Float x, Float y) { +Float PerlinNoise::getPerlinNoise2D(Float x, Float y) { Float total = 0; Float p = mPersistence; Float n = static_cast( mOctaves - 1 ); diff --git a/src/eepp/math/waypoints.cpp b/src/eepp/math/waypoints.cpp index cc48ed945..3dc36dc1b 100755 --- a/src/eepp/math/waypoints.cpp +++ b/src/eepp/math/waypoints.cpp @@ -111,7 +111,7 @@ bool Waypoints::eraseWaypoint( const unsigned int& PointNum ) { return false; } -void Waypoints::speed( const Float& Speed ) { +void Waypoints::setSpeed( const Float& Speed ) { Float tdist = mTotDist; mSpeed = Speed; Float CurDist; @@ -216,19 +216,19 @@ void Waypoints::setTotalTime( const Time& TotTime ) { mPoints[i].t = mPoints[i].p.distance( mPoints[i + 1].p ) * TotTime.asMilliseconds() / tdist; } -void Waypoints::type( Ease::Interpolation InterpolationType ) { +void Waypoints::setType( Ease::Interpolation InterpolationType ) { mType = InterpolationType; } -const int& Waypoints::type() const { +const int& Waypoints::getType() const { return mType; } -bool Waypoints::loop() const { +bool Waypoints::getLoop() const { return mLoop; } -void Waypoints::loop( const bool& loop ) { +void Waypoints::setLoop( const bool& loop ) { mLoop = loop; } @@ -252,15 +252,15 @@ const std::vector& Waypoints::getWaypoints() const { return mPoints; } -const Float& Waypoints::speed() const { +const Float& Waypoints::getSpeed() const { return mSpeed; } -const bool& Waypoints::enabled() const { +const bool& Waypoints::isEnabled() const { return mEnable; } -void Waypoints::enabled( const bool& Enabled ) { +void Waypoints::setEnabled( const bool& Enabled ) { mEnable = Enabled; } diff --git a/src/eepp/ui/tools/textureatlaseditor.cpp b/src/eepp/ui/tools/textureatlaseditor.cpp index f6e39732b..2f905f33b 100644 --- a/src/eepp/ui/tools/textureatlaseditor.cpp +++ b/src/eepp/ui/tools/textureatlaseditor.cpp @@ -39,68 +39,68 @@ TextureAtlasEditor::TextureAtlasEditor( UIWindow * AttatchTo, const TGEditorClos Uint32 Flags = UI_CONTROL_DEFAULT_ALIGN | UI_ANCHOR_TOP | UI_ANCHOR_RIGHT | UI_CLIP_ENABLE | UI_AUTO_SIZE | UI_TEXT_SELECTION_ENABLED; Uint32 InitY = 230; - createTextBox( Vector2i( mUIContainer->size().width() - 205, 30 ), "SubTexture List:" ); + createTextBox( Vector2i( mUIContainer->size().getWidth() - 205, 30 ), "SubTexture List:" ); - mSubTextureList = mTheme->createListBox( mUIContainer, Sizei( 200, 156 ), Vector2i( mUIContainer->size().width() - 205, 50 ), UI_CONTROL_DEFAULT_ALIGN | UI_CLIP_ENABLE | UI_AUTO_PADDING | UI_ANCHOR_RIGHT | UI_ANCHOR_TOP ); - mSubTextureList->size( mSubTextureList->size().width(), mSubTextureList->rowHeight() * 9 + mSubTextureList->paddingContainer().Top + mSubTextureList->paddingContainer().Bottom ); + mSubTextureList = mTheme->createListBox( mUIContainer, Sizei( 200, 156 ), Vector2i( mUIContainer->size().getWidth() - 205, 50 ), UI_CONTROL_DEFAULT_ALIGN | UI_CLIP_ENABLE | UI_AUTO_PADDING | UI_ANCHOR_RIGHT | UI_ANCHOR_TOP ); + mSubTextureList->size( mSubTextureList->size().getWidth(), mSubTextureList->rowHeight() * 9 + mSubTextureList->paddingContainer().Top + mSubTextureList->paddingContainer().Bottom ); mSubTextureList->addEventListener( UIEvent::EventOnItemSelected, cb::Make1( this, &TextureAtlasEditor::onSubTextureChange ) ); - createTextBox( Vector2i( mUIContainer->size().width() - 205, InitY ), "Current SubTexture:" ); + createTextBox( Vector2i( mUIContainer->size().getWidth() - 205, InitY ), "Current SubTexture:" ); InitY +=30; mSpinOffX = mTheme->createSpinBox( mUIContainer, Sizei( 100, 22 ), Vector2i(), Flags, 0, false ); mSpinOffX->minValue( -32000 ); mSpinOffX->maxValue( 32000 ); - mSpinOffX->position( mUIContainer->size().width() - mSpinOffX->size().width() - 10, InitY ); + mSpinOffX->position( mUIContainer->size().getWidth() - mSpinOffX->size().getWidth() - 10, InitY ); mSpinOffX->addEventListener( UIEvent::EventOnValueChange, cb::Make1( this, &TextureAtlasEditor::onOffXChange ) ); TxtBox = createTextBox( Vector2i(), "Offset X:" ); - TxtBox->position( mSpinOffX->position().x - 10 - TxtBox->size().width(), InitY ); + TxtBox->position( mSpinOffX->position().x - 10 - TxtBox->size().getWidth(), InitY ); InitY +=30; mSpinOffY = mTheme->createSpinBox( mUIContainer, Sizei( 100, 22 ), Vector2i(), Flags, 0, false ); mSpinOffY->minValue( -32000 ); mSpinOffY->maxValue( 32000 ); - mSpinOffY->position( mUIContainer->size().width() - mSpinOffY->size().width() - 10, InitY ); + mSpinOffY->position( mUIContainer->size().getWidth() - mSpinOffY->size().getWidth() - 10, InitY ); mSpinOffY->addEventListener( UIEvent::EventOnValueChange, cb::Make1( this, &TextureAtlasEditor::onOffYChange ) ); TxtBox = createTextBox( Vector2i(), "Offset Y:" ); - TxtBox->position( mSpinOffY->position().x - 10 - TxtBox->size().width(), InitY ); + TxtBox->position( mSpinOffY->position().x - 10 - TxtBox->size().getWidth(), InitY ); InitY +=30; mSpinDestW = mTheme->createSpinBox( mUIContainer, Sizei( 100, 22 ), Vector2i(), Flags, 0, false ); mSpinDestW->maxValue( 32000 ); - mSpinDestW->position( mUIContainer->size().width() - mSpinDestW->size().width() - 10, InitY ); + mSpinDestW->position( mUIContainer->size().getWidth() - mSpinDestW->size().getWidth() - 10, InitY ); mSpinDestW->addEventListener( UIEvent::EventOnValueChange, cb::Make1( this, &TextureAtlasEditor::onDestWChange ) ); TxtBox = createTextBox( Vector2i(), "Dest. Width:" ); - TxtBox->position( mSpinDestW->position().x - 10 - TxtBox->size().width(), InitY ); + TxtBox->position( mSpinDestW->position().x - 10 - TxtBox->size().getWidth(), InitY ); InitY +=30; mSpinDestH = mTheme->createSpinBox( mUIContainer, Sizei( 100, 22 ), Vector2i(), Flags, 0, false ); mSpinDestH->maxValue( 32000 ); - mSpinDestH->position( mUIContainer->size().width() - mSpinDestH->size().width() - 10, InitY ); + mSpinDestH->position( mUIContainer->size().getWidth() - mSpinDestH->size().getWidth() - 10, InitY ); mSpinDestH->addEventListener( UIEvent::EventOnValueChange, cb::Make1( this, &TextureAtlasEditor::onDestHChange ) ); TxtBox = createTextBox( Vector2i(), "Dest. Height:" ); - TxtBox->position( mSpinDestH->position().x - 10 - TxtBox->size().width(), InitY ); + TxtBox->position( mSpinDestH->position().x - 10 - TxtBox->size().getWidth(), InitY ); Uint32 ButFlags = UI_CONTROL_ALIGN_CENTER | UI_ANCHOR_TOP | UI_ANCHOR_RIGHT | UI_AUTO_SIZE; - UIPushButton * ResetButton = mTheme->createPushButton( mUIContainer, Sizei( 120, 22 ), Vector2i( mUIContainer->size().width() - 120 - 5 , mSpinDestH->position().y + mSpinDestH->size().height() + 8 ), ButFlags ); + UIPushButton * ResetButton = mTheme->createPushButton( mUIContainer, Sizei( 120, 22 ), Vector2i( mUIContainer->size().getWidth() - 120 - 5 , mSpinDestH->position().y + mSpinDestH->size().getHeight() + 8 ), ButFlags ); ResetButton->text( "Reset Dest. Size" ); ResetButton->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &TextureAtlasEditor::onResetDestSize ) ); - UIPushButton * ResetOffsetButton = mTheme->createPushButton( mUIContainer, Sizei( 120, 22 ), Vector2i( ResetButton->position().x, ResetButton->position().y + ResetButton->size().height() + 8 ), ButFlags ); + UIPushButton * ResetOffsetButton = mTheme->createPushButton( mUIContainer, Sizei( 120, 22 ), Vector2i( ResetButton->position().x, ResetButton->position().y + ResetButton->size().getHeight() + 8 ), ButFlags ); ResetOffsetButton->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &TextureAtlasEditor::onResetOffset ) ); ResetOffsetButton->text( "Reset Offset" ); - UIPushButton * CenterOffsetButton = mTheme->createPushButton( mUIContainer, Sizei( 120, 22 ), Vector2i( ResetOffsetButton->position().x, ResetOffsetButton->position().y + ResetOffsetButton->size().height() + 8 ), ButFlags ); + UIPushButton * CenterOffsetButton = mTheme->createPushButton( mUIContainer, Sizei( 120, 22 ), Vector2i( ResetOffsetButton->position().x, ResetOffsetButton->position().y + ResetOffsetButton->size().getHeight() + 8 ), ButFlags ); CenterOffsetButton->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &TextureAtlasEditor::onCenterOffset ) ); CenterOffsetButton->text( "Centered Offset" ); - UIPushButton * HBOffsetButton = mTheme->createPushButton( mUIContainer, Sizei( 120, 22 ), Vector2i( CenterOffsetButton->position().x, CenterOffsetButton->position().y + CenterOffsetButton->size().height() + 8 ), ButFlags ); + UIPushButton * HBOffsetButton = mTheme->createPushButton( mUIContainer, Sizei( 120, 22 ), Vector2i( CenterOffsetButton->position().x, CenterOffsetButton->position().y + CenterOffsetButton->size().getHeight() + 8 ), ButFlags ); HBOffsetButton->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &TextureAtlasEditor::onHBOffset ) ); HBOffsetButton->text( "Half-Bottom Offset" ); @@ -111,7 +111,7 @@ TextureAtlasEditor::TextureAtlasEditor( UIWindow * AttatchTo, const TGEditorClos UIComplexControl::CreateParams Params; Params.setParent( mUIContainer ); - Params.setPos( 0, mWinMenu->size().height() ); + Params.setPos( 0, mWinMenu->size().getHeight() ); Params.setSize( 800, 600 ); Params.Background.color( ColorA( 0, 0, 0, 50 ) ); Params.Flags |= UI_ANCHOR_BOTTOM | UI_ANCHOR_RIGHT | UI_CLIP_ENABLE | UI_BORDER | UI_FILL_BACKGROUND; @@ -139,8 +139,8 @@ void TextureAtlasEditor::onResetDestSize( const UIEvent * Event ) { mCurSubTexture->resetDestSize(); - mSpinDestW->value( RealSize.width() ); - mSpinDestH->value( RealSize.height() ); + mSpinDestW->value( RealSize.getWidth() ); + mSpinDestH->value( RealSize.getHeight() ); } } diff --git a/src/eepp/ui/tools/textureatlasnew.cpp b/src/eepp/ui/tools/textureatlasnew.cpp index 829716e21..3b8fad481 100644 --- a/src/eepp/ui/tools/textureatlasnew.cpp +++ b/src/eepp/ui/tools/textureatlasnew.cpp @@ -20,7 +20,7 @@ TextureAtlasNew::TextureAtlasNew( TGCreateCb NewTGCb ) : mUIWindow->addEventListener( UIEvent::EventOnWindowClose, cb::Make1( this, &TextureAtlasNew::windowClose ) ); mUIWindow->title( "New Texture Atlas" ); - Int32 PosX = mUIWindow->getContainer()->size().width() - 110; + Int32 PosX = mUIWindow->getContainer()->size().getWidth() - 110; createTxtBox( Vector2i( 10, 20 ), "Save File Format:" ); mSaveFileType = mTheme->createDropDownList( mUIWindow->getContainer(), Sizei( 100, 22 ), Vector2i( PosX, 20 ), UI_CONTROL_DEFAULT_FLAGS | UI_CLIP_ENABLE | UI_AUTO_PADDING | UI_AUTO_SIZE ); @@ -57,19 +57,19 @@ TextureAtlasNew::TextureAtlasNew( TGCreateCb NewTGCb ) : mPixelSpace = mTheme->createSpinBox( mUIWindow->getContainer(), Sizei( 100, 22 ), Vector2i( PosX, 110 ), UI_CONTROL_DEFAULT_FLAGS | UI_CLIP_ENABLE | UI_AUTO_SIZE | UI_TEXT_SELECTION_ENABLED, 0, false ); createTxtBox( Vector2i( 10, 140 ), "Texture Atlas Folder Path:" ); - mTGPath = mTheme->createTextInput( mUIWindow->getContainer(), Sizei( mUIWindow->getContainer()->size().width() - 60, 22 ), Vector2i( 10, 160 ), UI_CONTROL_DEFAULT_FLAGS | UI_CLIP_ENABLE | UI_AUTO_PADDING | UI_AUTO_SIZE , false, 512 ); + mTGPath = mTheme->createTextInput( mUIWindow->getContainer(), Sizei( mUIWindow->getContainer()->size().getWidth() - 60, 22 ), Vector2i( 10, 160 ), UI_CONTROL_DEFAULT_FLAGS | UI_CLIP_ENABLE | UI_AUTO_PADDING | UI_AUTO_SIZE , false, 512 ); mTGPath->allowEditing( false ); - mSetPathButton = mTheme->createPushButton( mUIWindow->getContainer(), Sizei( 32, 32 ), Vector2i( mUIWindow->getContainer()->size().width() - 10 - 32, 160 ) ); + mSetPathButton = mTheme->createPushButton( mUIWindow->getContainer(), Sizei( 32, 32 ), Vector2i( mUIWindow->getContainer()->size().getWidth() - 10 - 32, 160 ) ); mSetPathButton->text( "..." ); mSetPathButton->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &TextureAtlasNew::onDialogFolderSelect ) ); UIPushButton * OKButton = mTheme->createPushButton( mUIWindow->getContainer(), Sizei( 80, 22 ), Vector2i(), UI_CONTROL_DEFAULT_FLAGS_CENTERED | UI_AUTO_SIZE, mTheme->getIconByName( "ok" ) ); - OKButton->position( mUIWindow->getContainer()->size().width() - OKButton->size().width() - 4, mUIWindow->getContainer()->size().height() - OKButton->size().height() - 4 ); + OKButton->position( mUIWindow->getContainer()->size().getWidth() - OKButton->size().getWidth() - 4, mUIWindow->getContainer()->size().getHeight() - OKButton->size().getHeight() - 4 ); OKButton->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &TextureAtlasNew::okClick ) ); OKButton->text( "OK" ); - UIPushButton * CancelButton = mTheme->createPushButton( mUIWindow->getContainer(), OKButton->size(), Vector2i( OKButton->position().x - OKButton->size().width() - 4, OKButton->position().y ), UI_CONTROL_DEFAULT_FLAGS_CENTERED | UI_AUTO_SIZE, mTheme->getIconByName( "cancel" ) ); + UIPushButton * CancelButton = mTheme->createPushButton( mUIWindow->getContainer(), OKButton->size(), Vector2i( OKButton->position().x - OKButton->size().getWidth() - 4, OKButton->position().y ), UI_CONTROL_DEFAULT_FLAGS_CENTERED | UI_AUTO_SIZE, mTheme->getIconByName( "cancel" ) ); CancelButton->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &TextureAtlasNew::cancelClick ) ); CancelButton->text( "Cancel" ); diff --git a/src/eepp/ui/tools/textureatlassubtextureeditor.cpp b/src/eepp/ui/tools/textureatlassubtextureeditor.cpp index 7b7a8edfc..725e07421 100644 --- a/src/eepp/ui/tools/textureatlassubtextureeditor.cpp +++ b/src/eepp/ui/tools/textureatlassubtextureeditor.cpp @@ -35,8 +35,8 @@ TextureAtlasSubTextureEditor::~TextureAtlasSubTextureEditor() { void TextureAtlasSubTextureEditor::draw() { Primitives P; P.setColor( ColorA( 255, 0, 0, mAlpha ) ); - P.drawLine( Line2f( Vector2f( mScreenPos.x, mScreenPos.y + mUICenter.y ), Vector2f( mScreenPos.x + mSize.width(), mScreenPos.y + mUICenter.y ) ) ); - P.drawLine( Line2f( Vector2f( mScreenPos.x + mUICenter.x, mScreenPos.y ), Vector2f( mScreenPos.x + mUICenter.x, mScreenPos.y + mSize.height() ) ) ); + P.drawLine( Line2f( Vector2f( mScreenPos.x, mScreenPos.y + mUICenter.y ), Vector2f( mScreenPos.x + mSize.getWidth(), mScreenPos.y + mUICenter.y ) ) ); + P.drawLine( Line2f( Vector2f( mScreenPos.x + mUICenter.x, mScreenPos.y ), Vector2f( mScreenPos.x + mUICenter.x, mScreenPos.y + mSize.getHeight() ) ) ); UIComplexControl::draw(); } @@ -75,7 +75,7 @@ UIGfx * TextureAtlasSubTextureEditor::getGfx() const { } void TextureAtlasSubTextureEditor::getCenter() { - mUICenter = Vector2i( mSize.width() / 2, mSize.height() / 2 ); + mUICenter = Vector2i( mSize.getWidth() / 2, mSize.getHeight() / 2 ); } }}} diff --git a/src/eepp/ui/uicheckbox.cpp b/src/eepp/ui/uicheckbox.cpp index 3e92b3261..60883bf5c 100644 --- a/src/eepp/ui/uicheckbox.cpp +++ b/src/eepp/ui/uicheckbox.cpp @@ -82,7 +82,7 @@ void UICheckBox::autoSize() { mActiveButton->centerVertical(); mInactiveButton->centerVertical(); - mSize.width( (int)mTextCache->getTextWidth() + mActiveButton->size().width() ); + mSize.setWidth( (int)mTextCache->getTextWidth() + mActiveButton->size().getWidth() ); } } @@ -141,7 +141,7 @@ const bool& UICheckBox::isActive() const { void UICheckBox::padding( const Recti& padding ) { mPadding = padding; - mPadding.Left = mPadding.Left + mActiveButton->size().width(); + mPadding.Left = mPadding.Left + mActiveButton->size().getWidth(); } UIControlAnim * UICheckBox::activeButton() const { diff --git a/src/eepp/ui/uicombobox.cpp b/src/eepp/ui/uicombobox.cpp index 41c535a07..bb35bb157 100644 --- a/src/eepp/ui/uicombobox.cpp +++ b/src/eepp/ui/uicombobox.cpp @@ -47,14 +47,14 @@ void UIComboBox::createButton() { SubTexture * tSubTexture = tComplex->getSubTextureSide( UISkinState::StateNormal, UISkinComplex::Right ); if ( NULL != tSubTexture ) - btnWidth = tSubTexture->realSize().width(); + btnWidth = tSubTexture->realSize().getWidth(); } } UIControl::CreateParams Params; Params.setParent( this ), - Params.Size = Sizei( btnWidth, mSize.height() ); - Params.setPos( mSize.width() - btnWidth, 0 ); + Params.Size = Sizei( btnWidth, mSize.getHeight() ); + Params.setPos( mSize.getWidth() - btnWidth, 0 ); mButton = eeNew( UIControl, ( Params ) ); mButton->visible( true ); mButton->enabled( true ); diff --git a/src/eepp/ui/uicommondialog.cpp b/src/eepp/ui/uicommondialog.cpp index 825e3ba46..443999fb6 100644 --- a/src/eepp/ui/uicommondialog.cpp +++ b/src/eepp/ui/uicommondialog.cpp @@ -15,17 +15,17 @@ UICommonDialog::UICommonDialog( const UICommonDialog::CreateParams& Params ) : mCurPath( Params.DefaultDirectory ), mCDLFlags( Params.CDLFlags ) { - if ( mSize.width() < CDLG_MIN_WIDTH ) + if ( mSize.getWidth() < CDLG_MIN_WIDTH ) mSize.x = CDLG_MIN_WIDTH; - if ( mSize.height() < CDLG_MIN_HEIGHT ) + if ( mSize.getHeight() < CDLG_MIN_HEIGHT ) mSize.y = CDLG_MIN_HEIGHT; - if ( mMinWindowSize.width() < CDLG_MIN_WIDTH ) - mMinWindowSize.width( CDLG_MIN_WIDTH ); + if ( mMinWindowSize.getWidth() < CDLG_MIN_WIDTH ) + mMinWindowSize.setWidth( CDLG_MIN_WIDTH ); - if ( mMinWindowSize.height() < CDLG_MIN_HEIGHT ) - mMinWindowSize.height( CDLG_MIN_HEIGHT ); + if ( mMinWindowSize.getHeight() < CDLG_MIN_HEIGHT ) + mMinWindowSize.setHeight( CDLG_MIN_HEIGHT ); if ( allowFolderSelect() ) { title( "Select a folder" ); @@ -45,16 +45,16 @@ UICommonDialog::UICommonDialog( const UICommonDialog::CreateParams& Params ) : UIPushButton::CreateParams ButtonParams; ButtonParams.Flags = UI_HALIGN_CENTER | UI_ANCHOR_RIGHT | UI_VALIGN_CENTER | UI_AUTO_SIZE; ButtonParams.setParent( getContainer() ); - ButtonParams.setPos( getContainer()->size().width() - 86, getContainer()->size().height() - 24 ); + ButtonParams.setPos( getContainer()->size().getWidth() - 86, getContainer()->size().getHeight() - 24 ); ButtonParams.setSize( 80, 22 ); mButtonCancel = eeNew( UIPushButton, ( ButtonParams ) ); mButtonCancel->visible( true ); mButtonCancel->enabled( true ); mButtonCancel->text( "Cancel" ); - mButtonCancel->position( Vector2i( mButtonCancel->position().x, getContainer()->size().height() - mButtonCancel->size().height() - 2 ) ); + mButtonCancel->position( Vector2i( mButtonCancel->position().x, getContainer()->size().getHeight() - mButtonCancel->size().getHeight() - 2 ) ); mButtonCancel->updateAnchorsDistances(); - ButtonParams.setPos( mButtonCancel->position().x, mButtonCancel->position().y - mButtonCancel->size().height() ); + ButtonParams.setPos( mButtonCancel->position().x, mButtonCancel->position().y - mButtonCancel->size().getHeight() ); mButtonOpen = eeNew( UIPushButton, ( ButtonParams ) ); mButtonOpen->visible( true ); mButtonOpen->enabled( true ); @@ -68,14 +68,14 @@ UICommonDialog::UICommonDialog( const UICommonDialog::CreateParams& Params ) : TInputParams.setParent( getContainer() ); TInputParams.Flags = UI_AUTO_PADDING | UI_CLIP_ENABLE | UI_ANCHOR_RIGHT | UI_ANCHOR_LEFT | UI_ANCHOR_TOP | UI_VALIGN_CENTER | UI_TEXT_SELECTION_ENABLED; TInputParams.setPos( 70, 6 ); - TInputParams.setSize( getContainer()->size().width() - TInputParams.Pos.x - 42, 22 ); + TInputParams.setSize( getContainer()->size().getWidth() - TInputParams.Pos.x - 42, 22 ); mPath = eeNew( UITextInput, ( TInputParams ) ); mPath->addEventListener( UIEvent::EventOnPressEnter, cb::Make1( this, &UICommonDialog::onPressEnter ) ); mPath->visible( true ); mPath->enabled( true ); mPath->text( mCurPath ); - ButtonParams.setPos( TInputParams.Pos.x + TInputParams.Size.width() + 6, TInputParams.Pos.y ); + ButtonParams.setPos( TInputParams.Pos.x + TInputParams.Size.getWidth() + 6, TInputParams.Pos.y ); ButtonParams.setSize( 24, 22 ); ButtonParams.Flags |= UI_ANCHOR_TOP; mButtonUp = eeNew( UIPushButton, ( ButtonParams ) ); @@ -85,13 +85,13 @@ UICommonDialog::UICommonDialog( const UICommonDialog::CreateParams& Params ) : UIListBox::CreateParams LBParams; LBParams.setParent( getContainer() ); - LBParams.setPos( 6, mButtonUp->position().y + mButtonUp->size().height() + 4 ); - LBParams.Size = Sizei( getContainer()->size().width() - 12, - getContainer()->size().height() - - mButtonUp->size().height() - + LBParams.setPos( 6, mButtonUp->position().y + mButtonUp->size().getHeight() + 4 ); + LBParams.Size = Sizei( getContainer()->size().getWidth() - 12, + getContainer()->size().getHeight() - + mButtonUp->size().getHeight() - mButtonUp->position().y - - mButtonOpen->size().height() - - mButtonCancel->size().height() - + mButtonOpen->size().getHeight() - + mButtonCancel->size().getHeight() - 8 ); @@ -108,7 +108,7 @@ UICommonDialog::UICommonDialog( const UICommonDialog::CreateParams& Params ) : mList->visible( true ); mList->enabled( true ); - TxtBoxParams.setPos( 6, getContainer()->size().height() - 54 ); + TxtBoxParams.setPos( 6, getContainer()->size().getHeight() - 54 ); TxtBoxParams.setSize( 74, 19 ); TxtBoxParams.Flags = UI_ANCHOR_LEFT | UI_VALIGN_CENTER; TBox = eeNew( UITextBox, ( TxtBoxParams ) ); @@ -116,15 +116,15 @@ UICommonDialog::UICommonDialog( const UICommonDialog::CreateParams& Params ) : TBox->enabled( false ); TBox->text( "File Name:" ); - TxtBoxParams.setPos( TBox->position().x, TBox->position().y + TBox->size().height()+ 6 ); + TxtBoxParams.setPos( TBox->position().x, TBox->position().y + TBox->size().getHeight()+ 6 ); UITextBox * TBox2 = eeNew( UITextBox, ( TxtBoxParams ) ); TBox2->visible( true ); TBox2->enabled( false ); TBox2->text( "Files of type:" ); TInputParams.Flags &= ~UI_ANCHOR_TOP; - TInputParams.setPos( TBox->position().x + TBox->size().width(), TBox->position().y ); - TInputParams.setSize( getContainer()->size().width() - mButtonOpen->size().width() - TInputParams.Pos.x - 20, TInputParams.Size.height() ); + TInputParams.setPos( TBox->position().x + TBox->size().getWidth(), TBox->position().y ); + TInputParams.setSize( getContainer()->size().getWidth() - mButtonOpen->size().getWidth() - TInputParams.Pos.x - 20, TInputParams.Size.getHeight() ); mFile = eeNew( UITextInput, ( TInputParams ) ); mFile->visible( true ); mFile->enabled( true ); @@ -132,8 +132,8 @@ UICommonDialog::UICommonDialog( const UICommonDialog::CreateParams& Params ) : UIDropDownList::CreateParams DDLParams; DDLParams.setParent( getContainer() ); - DDLParams.setPos( TBox2->position().x + TBox2->size().width(), TBox2->position().y ); - DDLParams.setSize( getContainer()->size().width() - mButtonCancel->size().width() - DDLParams.Pos.x - 20, 22 ); + DDLParams.setPos( TBox2->position().x + TBox2->size().getWidth(), TBox2->position().y ); + DDLParams.setSize( getContainer()->size().getWidth() - mButtonCancel->size().getWidth() - DDLParams.Pos.x - 20, 22 ); DDLParams.Flags = UI_CLIP_ENABLE | UI_AUTO_PADDING | UI_VALIGN_CENTER | UI_HALIGN_LEFT | UI_ANCHOR_LEFT | UI_ANCHOR_RIGHT | UI_AUTO_SIZE; DDLParams.PopUpToMainControl = true; mFiletype = eeNew( UIDropDownList, ( DDLParams ) ); @@ -220,7 +220,7 @@ void UICommonDialog::refreshFolder() { mList->addListBoxItems( files ); if ( NULL != mList->verticalScrollBar() ) { - mList->verticalScrollBar()->clickStep( 1.f / ( ( mList->count() * mList->rowHeight() ) / (Float)mList->size().height() ) ); + mList->verticalScrollBar()->clickStep( 1.f / ( ( mList->count() * mList->rowHeight() ) / (Float)mList->size().getHeight() ) ); } } diff --git a/src/eepp/ui/uicomplexcontrol.cpp b/src/eepp/ui/uicomplexcontrol.cpp index 36b871b83..4dce0d3a6 100644 --- a/src/eepp/ui/uicomplexcontrol.cpp +++ b/src/eepp/ui/uicomplexcontrol.cpp @@ -40,12 +40,12 @@ void UIComplexControl::update() { Pos.x += UIThemeManager::instance()->cursorSize().x; Pos.y += UIThemeManager::instance()->cursorSize().y; - if ( Pos.x + mTooltip->size().width() > UIManager::instance()->mainControl()->size().width() ) { - Pos.x = UIManager::instance()->getMousePos().x - mTooltip->size().width(); + if ( Pos.x + mTooltip->size().getWidth() > UIManager::instance()->mainControl()->size().getWidth() ) { + Pos.x = UIManager::instance()->getMousePos().x - mTooltip->size().getWidth(); } - if ( Pos.y + mTooltip->size().height() > UIManager::instance()->mainControl()->size().height() ) { - Pos.y = UIManager::instance()->getMousePos().y - mTooltip->size().height(); + if ( Pos.y + mTooltip->size().getHeight() > UIManager::instance()->mainControl()->size().getHeight() ) { + Pos.y = UIManager::instance()->getMousePos().y - mTooltip->size().getHeight(); } if ( Time::Zero == UIThemeManager::instance()->tooltipTimeToShow() ) { @@ -155,10 +155,10 @@ void UIComplexControl::onParentSizeChange( const Vector2i& SizeChange ) { if ( mFlags & UI_ANCHOR_RIGHT ) { if ( NULL != mParentCtrl ) { - newSize.x = mParentCtrl->size().width() - mPos.x - mDistToBorder.Right; + newSize.x = mParentCtrl->size().getWidth() - mPos.x - mDistToBorder.Right; - if ( newSize.x < mMinControlSize.width() ) - newSize.x = mMinControlSize.width(); + if ( newSize.x < mMinControlSize.getWidth() ) + newSize.x = mMinControlSize.getWidth(); } } @@ -172,8 +172,8 @@ void UIComplexControl::onParentSizeChange( const Vector2i& SizeChange ) { if ( NULL != mParentCtrl ) { newSize.y = mParentCtrl->size().y - mPos.y - mDistToBorder.Bottom; - if ( newSize.y < mMinControlSize.height() ) - newSize.y = mMinControlSize.height(); + if ( newSize.y < mMinControlSize.getHeight() ) + newSize.y = mMinControlSize.getHeight(); } } diff --git a/src/eepp/ui/uicontrol.cpp b/src/eepp/ui/uicontrol.cpp index 70f60ff0c..063d148ad 100644 --- a/src/eepp/ui/uicontrol.cpp +++ b/src/eepp/ui/uicontrol.cpp @@ -115,7 +115,7 @@ Uint32 UIControl::onMessage( const UIMessage * Msg ) { } bool UIControl::isInside( const Vector2i& Pos ) const { - return ( Pos.x >= 0 && Pos.y >= 0 && Pos.x < mSize.width() && Pos.y < mSize.height() ); + return ( Pos.x >= 0 && Pos.y >= 0 && Pos.x < mSize.getWidth() && Pos.y < mSize.getHeight() ); } void UIControl::position( const Vector2i& Pos ) { @@ -222,14 +222,14 @@ void UIControl::centerHorizontal() { UIControl * Ctrl = parent(); if ( NULL != Ctrl ) - position( Vector2i( ( Ctrl->size().width() / 2 ) - ( mSize.width() / 2 ), mPos.y ) ); + position( Vector2i( ( Ctrl->size().getWidth() / 2 ) - ( mSize.getWidth() / 2 ), mPos.y ) ); } void UIControl::centerVertical(){ UIControl * Ctrl = parent(); if ( NULL != Ctrl ) - position( Vector2i( mPos.x, ( Ctrl->size().height() / 2 ) - ( mSize.height() / 2 ) ) ); + position( Vector2i( mPos.x, ( Ctrl->size().getHeight() / 2 ) - ( mSize.getHeight() / 2 ) ) ); } void UIControl::center() { @@ -252,7 +252,7 @@ void UIControl::draw() { borderDraw(); if ( NULL != mSkinState ) - mSkinState->draw( mScreenPosf.x, mScreenPosf.y, (Float)mSize.width(), (Float)mSize.height(), 255 ); + mSkinState->draw( mScreenPosf.x, mScreenPosf.y, (Float)mSize.getWidth(), (Float)mSize.getHeight(), 255 ); if ( UIManager::instance()->highlightFocus() && UIManager::instance()->focusControl() == this ) { Primitives P; @@ -522,7 +522,7 @@ void UIControl::onSizeChange() { } Rectf UIControl::getRectf() { - return Rectf( mScreenPosf, Sizef( (Float)mSize.width(), (Float)mSize.height() ) ); + return Rectf( mScreenPosf, Sizef( (Float)mSize.getWidth(), (Float)mSize.getHeight() ) ); } void UIControl::backgroundDraw() { @@ -555,7 +555,7 @@ void UIControl::borderDraw() { //! @TODO: Check why was this +0.1f -0.1f? if ( mFlags & UI_CLIP_ENABLE ) { - Rectf R( Vector2f( mScreenPosf.x + 0.1f, mScreenPosf.y + 0.1f ), Sizef( (Float)mSize.width() - 0.1f, (Float)mSize.height() - 0.1f ) ); + Rectf R( Vector2f( mScreenPosf.x + 0.1f, mScreenPosf.y + 0.1f ), Sizef( (Float)mSize.getWidth() - 0.1f, (Float)mSize.getHeight() - 0.1f ) ); if ( mBackground->corners() ) { P.drawRoundedRectangle( getRectf(), 0.f, Vector2f::One, mBackground->corners() ); @@ -610,9 +610,9 @@ void UIControl::internalDraw() { void UIControl::clipMe() { if ( mFlags & UI_CLIP_ENABLE ) { if ( mFlags & UI_BORDER ) - UIManager::instance()->clipEnable( mScreenPos.x, mScreenPos.y, mSize.width(), mSize.height() + 1 ); + UIManager::instance()->clipEnable( mScreenPos.x, mScreenPos.y, mSize.getWidth(), mSize.getHeight() + 1 ); else - UIManager::instance()->clipEnable( mScreenPos.x, mScreenPos.y, mSize.width(), mSize.height() ); + UIManager::instance()->clipEnable( mScreenPos.x, mScreenPos.y, mSize.getWidth(), mSize.getHeight() ); } } @@ -875,7 +875,7 @@ const Vector2f& UIControl::getPolygonCenter() const { } void UIControl::updateQuad() { - mPoly = Polygon2f( eeAABB( mScreenPosf.x, mScreenPosf.y, mScreenPosf.x + mSize.width(), mScreenPosf.y + mSize.height() ) ); + mPoly = Polygon2f( eeAABB( mScreenPosf.x, mScreenPosf.y, mScreenPosf.x + mSize.getWidth(), mScreenPosf.y + mSize.getHeight() ) ); UIControl * tParent = parent(); @@ -892,7 +892,7 @@ void UIControl::updateQuad() { } void UIControl::updateCenter() { - mCenter = Vector2f( mScreenPosf.x + (Float)mSize.width() * 0.5f, mScreenPosf.y + (Float)mSize.height() * 0.5f ); + mCenter = Vector2f( mScreenPosf.x + (Float)mSize.getWidth() * 0.5f, mScreenPosf.y + (Float)mSize.getHeight() * 0.5f ); } Time UIControl::elapsed() { @@ -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().width(); + tPadding.Left = tSubTexture->realSize().getWidth(); } if ( PadRight ) { tSubTexture = tComplex->getSubTextureSide( UISkinState::StateNormal, UISkinComplex::Right ); if ( NULL != tSubTexture ) - tPadding.Right = tSubTexture->realSize().width(); + tPadding.Right = tSubTexture->realSize().getWidth(); } if ( PadTop ) { tSubTexture = tComplex->getSubTextureSide( UISkinState::StateNormal, UISkinComplex::Up ); if ( NULL != tSubTexture ) - tPadding.Top = tSubTexture->realSize().height(); + tPadding.Top = tSubTexture->realSize().getHeight(); } if ( PadBottom ) { tSubTexture = tComplex->getSubTextureSide( UISkinState::StateNormal, UISkinComplex::Down ); if ( NULL != tSubTexture ) - tPadding.Bottom = tSubTexture->realSize().height(); + tPadding.Bottom = tSubTexture->realSize().getHeight(); } } } @@ -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().height(); + tSize.y += tSubTexture->realSize().getHeight(); } tSubTexture = SkinC->getSubTextureSide( State, UISkinComplex::Down ); if ( NULL != tSubTexture ) { - tSize.y += tSubTexture->realSize().height(); + tSize.y += tSubTexture->realSize().getHeight(); } tSubTexture = SkinC->getSubTextureSide( State, UISkinComplex::Left ); if ( NULL != tSubTexture ) { - tSize.x += tSubTexture->realSize().width(); + tSize.x += tSubTexture->realSize().getWidth(); } tSubTexture = SkinC->getSubTextureSide( State, UISkinComplex::Right ); if ( NULL != tSubTexture ) { - tSize.x += tSubTexture->realSize().width(); + tSize.x += tSubTexture->realSize().getWidth(); } } } diff --git a/src/eepp/ui/uicontrolanim.cpp b/src/eepp/ui/uicontrolanim.cpp index a94b78412..96309c3b9 100644 --- a/src/eepp/ui/uicontrolanim.cpp +++ b/src/eepp/ui/uicontrolanim.cpp @@ -45,7 +45,7 @@ void UIControlAnim::draw() { borderDraw(); if ( NULL != mSkinState ) - mSkinState->draw( mScreenPosf.x, mScreenPosf.y, (Float)mSize.width(), (Float)mSize.height(), (Uint32)mAlpha ); + mSkinState->draw( mScreenPosf.x, mScreenPosf.y, (Float)mSize.getWidth(), (Float)mSize.getHeight(), (Uint32)mAlpha ); if ( UIManager::instance()->highlightFocus() && UIManager::instance()->focusControl() == this ) { Primitives P; @@ -187,7 +187,7 @@ void UIControlAnim::matrixUnset() { void UIControlAnim::update() { UIDragable::update(); - if ( NULL != mMoveAnim && mMoveAnim->enabled() ) { + if ( NULL != mMoveAnim && mMoveAnim->isEnabled() ) { mMoveAnim->update( elapsed() ); position( (int)mMoveAnim->getPos().x, (int)mMoveAnim->getPos().y ); @@ -195,7 +195,7 @@ void UIControlAnim::update() { eeSAFE_DELETE( mMoveAnim ); } - if ( NULL != mAlphaAnim && mAlphaAnim->enabled() ) { + if ( NULL != mAlphaAnim && mAlphaAnim->isEnabled() ) { mAlphaAnim->update( elapsed() ); alpha( mAlphaAnim->getRealPos() ); @@ -213,7 +213,7 @@ void UIControlAnim::update() { } } - if ( NULL != mScaleAnim && mScaleAnim->enabled() ) { + if ( NULL != mScaleAnim && mScaleAnim->isEnabled() ) { mScaleAnim->update( elapsed() ); scale( mScaleAnim->getPos() ); @@ -221,7 +221,7 @@ void UIControlAnim::update() { eeSAFE_DELETE( mScaleAnim ); } - if ( NULL != mAngleAnim && mAngleAnim->enabled() ) { + if ( NULL != mAngleAnim && mAngleAnim->isEnabled() ) { mAngleAnim->update( elapsed() ); angle( mAngleAnim->getRealPos() ); @@ -235,7 +235,7 @@ bool UIControlAnim::isFadingOut() { } bool UIControlAnim::isAnimating() { - return ( NULL != mAlphaAnim && mAlphaAnim->enabled() ) || ( NULL != mAngleAnim && mAngleAnim->enabled() ) || ( NULL != mScaleAnim && mScaleAnim->enabled() ) || ( NULL != mMoveAnim && mMoveAnim->enabled() ); + return ( NULL != mAlphaAnim && mAlphaAnim->isEnabled() ) || ( NULL != mAngleAnim && mAngleAnim->isEnabled() ) || ( NULL != mScaleAnim && mScaleAnim->isEnabled() ) || ( NULL != mMoveAnim && mMoveAnim->isEnabled() ); } Interpolation * UIControlAnim::startAlphaAnim( const Float& From, const Float& To, const Time& TotalTime, const bool& AlphaChilds, const Ease::Interpolation& Type, Interpolation::OnPathEndCallback PathEndCallback ) { @@ -247,7 +247,7 @@ Interpolation * UIControlAnim::startAlphaAnim( const Float& From, const Float& T mAlphaAnim->addWaypoint( To ); mAlphaAnim->setTotalTime( TotalTime ); mAlphaAnim->start( PathEndCallback ); - mAlphaAnim->type( Type ); + mAlphaAnim->setType( Type ); alpha( From ); @@ -278,7 +278,7 @@ Waypoints * UIControlAnim::startScaleAnim( const Vector2f& From, const Vector2f& mScaleAnim->addWaypoint( To ); mScaleAnim->setTotalTime( TotalTime ); mScaleAnim->start( PathEndCallback ); - mScaleAnim->type( Type ); + mScaleAnim->setType( Type ); scale( From ); @@ -298,7 +298,7 @@ Waypoints * UIControlAnim::startMovement( const Vector2i& From, const Vector2i& mMoveAnim->addWaypoint( Vector2f( (Float)To.x, (Float)To.y ) ); mMoveAnim->setTotalTime( TotalTime ); mMoveAnim->start( PathEndCallback ); - mMoveAnim->type( Type ); + mMoveAnim->setType( Type ); position( From ); @@ -314,7 +314,7 @@ Interpolation * UIControlAnim::startRotation( const Float& From, const Float& To mAngleAnim->addWaypoint( To ); mAngleAnim->setTotalTime( TotalTime ); mAngleAnim->start( PathEndCallback ); - mAngleAnim->type( Type ); + mAngleAnim->setType( Type ); angle( From ); @@ -375,7 +375,7 @@ void UIControlAnim::borderDraw() { //! @TODO: Check why was this +0.1f -0.1f? if ( mFlags & UI_CLIP_ENABLE ) { - Rectf R( Vector2f( mScreenPosf.x + 0.1f, mScreenPosf.y + 0.1f ), Sizef( (Float)mSize.width() - 0.1f, (Float)mSize.height() - 0.1f ) ); + Rectf R( Vector2f( mScreenPosf.x + 0.1f, mScreenPosf.y + 0.1f ), Sizef( (Float)mSize.getWidth() - 0.1f, (Float)mSize.getHeight() - 0.1f ) ); if ( mBackground->corners() ) { P.drawRoundedRectangle( getRectf(), 0.f, Vector2f::One, mBackground->corners() ); @@ -396,7 +396,7 @@ ColorA UIControlAnim::getColor( const ColorA& Col ) { } void UIControlAnim::updateQuad() { - mPoly = Polygon2f( eeAABB( mScreenPosf.x, mScreenPosf.y, mScreenPosf.x + mSize.width(), mScreenPosf.y + mSize.height() ) ); + mPoly = Polygon2f( eeAABB( mScreenPosf.x, mScreenPosf.y, mScreenPosf.x + mSize.getWidth(), mScreenPosf.y + mSize.getHeight() ) ); mPoly.rotate( mAngle, rotationCenter() ); mPoly.scale( mScale, scaleCenter() ); diff --git a/src/eepp/ui/uidropdownlist.cpp b/src/eepp/ui/uidropdownlist.cpp index d19620a40..2d51ffbd6 100644 --- a/src/eepp/ui/uidropdownlist.cpp +++ b/src/eepp/ui/uidropdownlist.cpp @@ -25,10 +25,10 @@ UIDropDownList::UIDropDownList( UIDropDownList::CreateParams& Params ) : UITheme * Theme = UIThemeManager::instance()->defaultTheme(); if ( NULL != Theme ) { - mListBox = Theme->createListBox( NULL, Sizei( mSize.width(), mMinNumVisibleItems * mSize.height() ),Vector2i(), flags ); + mListBox = Theme->createListBox( NULL, Sizei( mSize.getWidth(), mMinNumVisibleItems * mSize.getHeight() ),Vector2i(), flags ); } else { UIListBox::CreateParams LBParams; - LBParams.Size = Sizei( mSize.width(), mMinNumVisibleItems * mSize.height() ); + LBParams.Size = Sizei( mSize.getWidth(), mMinNumVisibleItems * mSize.getHeight() ); LBParams.Flags = flags; LBParams.FontSelectedColor = ColorA( 255, 255, 255, 255 ); mListBox = eeNew( UIListBox, ( LBParams ) ); @@ -74,7 +74,7 @@ void UIDropDownList::onSizeChange() { void UIDropDownList::autoSizeControl() { if ( mFlags & UI_AUTO_SIZE ) { - size( mSize.x, getSkinSize().height() ); + size( mSize.x, getSkinSize().getHeight() ); } } @@ -101,7 +101,7 @@ void UIDropDownList::showListBox() { mListBox->toFront(); - Vector2i Pos( mPos.x, mPos.y + mSize.height() ); + Vector2i Pos( mPos.x, mPos.y + mSize.getHeight() ); if ( mPopUpToMainControl ) { parent()->controlToWorld( Pos ); @@ -115,9 +115,9 @@ void UIDropDownList::showListBox() { Float sliderValue = mListBox->verticalScrollBar()->value(); if ( mMinNumVisibleItems < mListBox->count() ) - mListBox->size( mSize.width(), (Int32)( mMinNumVisibleItems * mListBox->rowHeight() ) + tPadding.Top + tPadding.Bottom ); + mListBox->size( mSize.getWidth(), (Int32)( mMinNumVisibleItems * mListBox->rowHeight() ) + tPadding.Top + tPadding.Bottom ); else { - mListBox->size( mSize.width(), (Int32)( mListBox->count() * mListBox->rowHeight() ) + tPadding.Top + tPadding.Bottom ); + mListBox->size( mSize.getWidth(), (Int32)( mListBox->count() * mListBox->rowHeight() ) + tPadding.Top + tPadding.Bottom ); } mListBox->updateQuad(); @@ -132,7 +132,7 @@ void UIDropDownList::showListBox() { parent()->controlToWorld( Pos ); } - Pos.y -= mListBox->size().height(); + Pos.y -= mListBox->size().getHeight(); mListBox->position( Pos ); } diff --git a/src/eepp/ui/uigenericgrid.cpp b/src/eepp/ui/uigenericgrid.cpp index 1b2ff6605..21340534b 100644 --- a/src/eepp/ui/uigenericgrid.cpp +++ b/src/eepp/ui/uigenericgrid.cpp @@ -31,7 +31,7 @@ UIGenericGrid::UIGenericGrid( const UIGenericGrid::CreateParams& Params ) : UIComplexControl::CreateParams CParams; CParams.setParent( this ); CParams.setPos( mPadding.Left, mPadding.Top ); - CParams.Size = Sizei( mSize.width() - mPadding.Right - mPadding.Left, mSize.height() - mPadding.Top - mPadding.Bottom ); + CParams.Size = Sizei( mSize.getWidth() - mPadding.Right - mPadding.Left, mSize.getHeight() - mPadding.Top - mPadding.Bottom ); CParams.Flags = Params.Flags; mContainer = eeNew( UIItemContainer , ( CParams ) ); mContainer->visible( true ); @@ -42,14 +42,14 @@ UIGenericGrid::UIGenericGrid( const UIGenericGrid::CreateParams& Params ) : UIScrollBar::CreateParams ScrollBarP; ScrollBarP.setParent ( this ); - ScrollBarP.setPos ( mSize.width() - 15, 0 ); + ScrollBarP.setPos ( mSize.getWidth() - 15, 0 ); ScrollBarP.Flags = UI_AUTO_SIZE; ScrollBarP.VerticalScrollBar = true; - ScrollBarP.Size = Sizei( 15, mSize.height() ); + ScrollBarP.Size = Sizei( 15, mSize.getHeight() ); mVScrollBar = eeNew( UIScrollBar, ( ScrollBarP ) ); - ScrollBarP.setPos ( 0, mSize.height() - 15 ); - ScrollBarP.Size = Sizei( mSize.width() - mVScrollBar->size().width(), 15 ); + ScrollBarP.setPos ( 0, mSize.getHeight() - 15 ); + ScrollBarP.Size = Sizei( mSize.getWidth() - mVScrollBar->size().getWidth(), 15 ); ScrollBarP.VerticalScrollBar = false; mHScrollBar = eeNew( UIScrollBar, ( ScrollBarP ) ); @@ -85,7 +85,7 @@ void UIGenericGrid::setDefaultCollumnsWidth() { return; if ( mItemsNotVisible <= 0 ) { - Uint32 VisibleItems = mContainer->size().height() / mRowHeight; + Uint32 VisibleItems = mContainer->size().getHeight() / mRowHeight; Int32 oItemsNotVisible = (Int32)mItems.size() - VisibleItems; if ( oItemsNotVisible > 0 ) { @@ -97,7 +97,7 @@ void UIGenericGrid::setDefaultCollumnsWidth() { } } - Uint32 CollumnWidh = mContainer->size().width() / mCollumnsCount; + Uint32 CollumnWidh = mContainer->size().getWidth() / mCollumnsCount; for ( Uint32 i = 0; i < mCollumnsCount; i++ ) { mCollumnsWidth[ i ] = CollumnWidh; @@ -126,14 +126,14 @@ void UIGenericGrid::autoPadding() { } void UIGenericGrid::onSizeChange() { - mVScrollBar->position( mSize.width() - mVScrollBar->size().width(), 0 ); - mVScrollBar->size( mVScrollBar->size().width(), mSize.height() ); + mVScrollBar->position( mSize.getWidth() - mVScrollBar->size().getWidth(), 0 ); + mVScrollBar->size( mVScrollBar->size().getWidth(), mSize.getHeight() ); - mHScrollBar->position( 0, mSize.height() - mHScrollBar->size().height() ); - mHScrollBar->size( mSize.width() - mVScrollBar->size().width(), mHScrollBar->size().height() ); + mHScrollBar->position( 0, mSize.getHeight() - mHScrollBar->size().getHeight() ); + mHScrollBar->size( mSize.getWidth() - mVScrollBar->size().getWidth(), mHScrollBar->size().getHeight() ); if ( mContainer->isClipped() && UI_SCROLLBAR_AUTO == mHScrollMode ) { - if ( (Int32)mTotalWidth <= mContainer->size().width() ) { + if ( (Int32)mTotalWidth <= mContainer->size().getWidth() ) { mHScrollBar->visible( false ); mHScrollBar->enabled( false ); mHScrollInit = 0; @@ -149,12 +149,12 @@ void UIGenericGrid::containerResize() { mContainer->position( mPadding.Left, mPadding.Top ); if( mHScrollBar->visible() ) - mContainer->size( mSize.width() - mPadding.Right, mSize.height() - mPadding.Top - mHScrollBar->size().height() ); + mContainer->size( mSize.getWidth() - mPadding.Right, mSize.getHeight() - mPadding.Top - mHScrollBar->size().getHeight() ); else - mContainer->size( mSize.width() - mPadding.Right, mSize.height() - mPadding.Bottom - mPadding.Top ); + mContainer->size( mSize.getWidth() - mPadding.Right, mSize.getHeight() - mPadding.Bottom - mPadding.Top ); if ( mVScrollBar->visible() ) - mContainer->size( mContainer->size().width() - mVScrollBar->size().width(), mContainer->size().height() ); + mContainer->size( mContainer->size().getWidth() - mVScrollBar->size().getWidth(), mContainer->size().getHeight() ); setDefaultCollumnsWidth(); } @@ -183,13 +183,13 @@ void UIGenericGrid::updateVScroll() { void UIGenericGrid::updateHScroll() { if ( mContainer->isClipped() && ( UI_SCROLLBAR_AUTO == mHScrollMode || UI_SCROLLBAR_ALWAYS_ON == mHScrollMode ) ) { - if ( mContainer->size().width() < (Int32)mTotalWidth ) { + if ( mContainer->size().getWidth() < (Int32)mTotalWidth ) { mHScrollBar->visible( true ); mHScrollBar->enabled( true ); containerResize(); - Int32 ScrollH = mTotalWidth - mContainer->size().width(); + Int32 ScrollH = mTotalWidth - mContainer->size().getWidth(); Int32 HScrolleable = (Uint32)( mHScrollBar->value() * ScrollH ); @@ -216,7 +216,7 @@ void UIGenericGrid::updateScroll( bool FromScrollChange ) { Int32 ItemPos, ItemPosMax; Int32 tHLastScroll = mHScrollInit; - Uint32 VisibleItems = mContainer->size().height() / mRowHeight; + Uint32 VisibleItems = mContainer->size().getHeight() / mRowHeight; mItemsNotVisible = (Int32)mItems.size() - VisibleItems; bool Clipped = 0 != mContainer->isClipped(); @@ -224,9 +224,9 @@ void UIGenericGrid::updateScroll( bool FromScrollChange ) { updateHScroll(); - VisibleItems = mContainer->size().height() / mRowHeight; + VisibleItems = mContainer->size().getHeight() / mRowHeight; mItemsNotVisible = (Uint32)mItems.size() - VisibleItems; - Int32 Scrolleable = (Int32)mItems.size() * mRowHeight - mContainer->size().height(); + Int32 Scrolleable = (Int32)mItems.size() * mRowHeight - mContainer->size().getHeight(); bool FirstVisible = false; if ( Clipped && mSmoothScroll ) { @@ -235,7 +235,7 @@ void UIGenericGrid::updateScroll( bool FromScrollChange ) { else RelPos = 0; - RelPosMax = RelPos + mContainer->size().height() + mRowHeight; + RelPosMax = RelPos + mContainer->size().getHeight() + mRowHeight; if ( ( FromScrollChange && eeINDEX_NOT_FOUND != mLastPos && mLastPos == RelPos ) && ( tHLastScroll == mHScrollInit ) ) return; @@ -303,11 +303,11 @@ void UIGenericGrid::updateScroll( bool FromScrollChange ) { } if ( mHScrollBar->visible() && !mVScrollBar->visible() ) { - mHScrollBar->position( 0, mSize.height() - mHScrollBar->size().height() ); - mHScrollBar->size( mSize.width(), mHScrollBar->size().height() ); + mHScrollBar->position( 0, mSize.getHeight() - mHScrollBar->size().getHeight() ); + mHScrollBar->size( mSize.getWidth(), mHScrollBar->size().getHeight() ); } else { - mHScrollBar->position( 0, mSize.height() - mHScrollBar->size().height() ); - mHScrollBar->size( mSize.width() - mVScrollBar->size().width(), mHScrollBar->size().height() ); + mHScrollBar->position( 0, mSize.getHeight() - mHScrollBar->size().getHeight() ); + mHScrollBar->size( mSize.getWidth() - mVScrollBar->size().getWidth(), mHScrollBar->size().getHeight() ); } } diff --git a/src/eepp/ui/uigfx.cpp b/src/eepp/ui/uigfx.cpp index b074ad394..e30d47e28 100644 --- a/src/eepp/ui/uigfx.cpp +++ b/src/eepp/ui/uigfx.cpp @@ -130,17 +130,17 @@ void UIGfx::autoAlign() { return; if ( HAlignGet( mFlags ) == UI_HALIGN_CENTER ) { - mAlignOffset.x = mSize.width() / 2 - mSubTexture->destSize().x / 2; + mAlignOffset.x = mSize.getWidth() / 2 - mSubTexture->destSize().x / 2; } else if ( FontHAlignGet( mFlags ) == UI_HALIGN_RIGHT ) { - mAlignOffset.x = mSize.width() - mSubTexture->destSize().x; + mAlignOffset.x = mSize.getWidth() - mSubTexture->destSize().x; } else { mAlignOffset.x = 0; } if ( VAlignGet( mFlags ) == UI_VALIGN_CENTER ) { - mAlignOffset.y = mSize.height() / 2 - mSubTexture->destSize().y / 2; + mAlignOffset.y = mSize.getHeight() / 2 - mSubTexture->destSize().y / 2; } else if ( FontVAlignGet( mFlags ) == UI_VALIGN_BOTTOM ) { - mAlignOffset.y = mSize.height() - mSubTexture->destSize().y; + mAlignOffset.y = mSize.getHeight() - mSubTexture->destSize().y; } else { mAlignOffset.y = 0; } diff --git a/src/eepp/ui/uilistbox.cpp b/src/eepp/ui/uilistbox.cpp index e4c695df6..60a388a9b 100644 --- a/src/eepp/ui/uilistbox.cpp +++ b/src/eepp/ui/uilistbox.cpp @@ -38,7 +38,7 @@ UIListBox::UIListBox( UIListBox::CreateParams& Params ) : UIControl::CreateParams CParams; CParams.setParent( this ); CParams.setPos( mPaddingContainer.Left, mPaddingContainer.Top ); - CParams.Size = Sizei( mSize.width() - mPaddingContainer.Right - mPaddingContainer.Left, mSize.height() - mPaddingContainer.Top - mPaddingContainer.Bottom ); + CParams.Size = Sizei( mSize.getWidth() - mPaddingContainer.Right - mPaddingContainer.Left, mSize.getHeight() - mPaddingContainer.Top - mPaddingContainer.Bottom ); CParams.Flags = Params.Flags; mContainer = eeNew( UIItemContainer, ( CParams ) ); mContainer->visible( true ); @@ -49,14 +49,14 @@ UIListBox::UIListBox( UIListBox::CreateParams& Params ) : UIScrollBar::CreateParams ScrollBarP; ScrollBarP.setParent( this ); - ScrollBarP.Size = Sizei( 15, mSize.height() ); - ScrollBarP.setPos( mSize.width() - 15, 0 ); + ScrollBarP.Size = Sizei( 15, mSize.getHeight() ); + ScrollBarP.setPos( mSize.getWidth() - 15, 0 ); ScrollBarP.Flags = UI_AUTO_SIZE; ScrollBarP.VerticalScrollBar = true; mVScrollBar = eeNew( UIScrollBar, ( ScrollBarP ) ); - ScrollBarP.Size = Sizei( mSize.width() - mVScrollBar->size().width(), 15 ); - ScrollBarP.setPos( 0, mSize.height() - 15 ); + ScrollBarP.Size = Sizei( mSize.getWidth() - mVScrollBar->size().getWidth(), 15 ); + ScrollBarP.setPos( 0, mSize.getHeight() - 15 ); ScrollBarP.VerticalScrollBar = false; mHScrollBar = eeNew( UIScrollBar, ( ScrollBarP ) ); @@ -279,14 +279,14 @@ void UIListBox::onHScrollValueChange( const UIEvent * Event ) { } void UIListBox::onSizeChange() { - mVScrollBar->position( mSize.width() - mVScrollBar->size().width() + mVScrollPadding.Left, mVScrollPadding.Top ); - mVScrollBar->size( mVScrollBar->size().width() + mVScrollPadding.Right, mSize.height() + mVScrollPadding.Bottom ); + mVScrollBar->position( mSize.getWidth() - mVScrollBar->size().getWidth() + mVScrollPadding.Left, mVScrollPadding.Top ); + mVScrollBar->size( mVScrollBar->size().getWidth() + mVScrollPadding.Right, mSize.getHeight() + mVScrollPadding.Bottom ); - mHScrollBar->position( mHScrollPadding.Left, mSize.height() - mHScrollBar->size().height() + mHScrollPadding.Top ); - mHScrollBar->size( mSize.width() - mVScrollBar->size().width() + mHScrollPadding.Right, mHScrollBar->size().height() + mHScrollPadding.Bottom ); + mHScrollBar->position( mHScrollPadding.Left, mSize.getHeight() - mHScrollBar->size().getHeight() + mHScrollPadding.Top ); + mHScrollBar->size( mSize.getWidth() - mVScrollBar->size().getWidth() + mHScrollPadding.Right, mHScrollBar->size().getHeight() + mHScrollPadding.Bottom ); if ( mContainer->isClipped() && UI_SCROLLBAR_AUTO == mHScrollMode ) { - if ( (Int32)mMaxTextWidth <= mContainer->size().width() ) { + if ( (Int32)mMaxTextWidth <= mContainer->size().getWidth() ) { mHScrollBar->visible( false ); mHScrollBar->enabled( false ); mHScrollInit = 0; @@ -354,11 +354,11 @@ void UIListBox::itemUpdateSize( UIListBoxItem * Item ) { mMaxTextWidth = (Uint32)width; if ( !mHScrollBar->visible() ) { - if ( width < mContainer->size().width() ) - width = mContainer->size().width(); + if ( width < mContainer->size().getWidth() ) + width = mContainer->size().getWidth(); if ( ( mItemsNotVisible > 0 && UI_SCROLLBAR_AUTO == mVScrollMode ) || UI_SCROLLBAR_ALWAYS_ON == mVScrollMode ) - width -= mVScrollBar->size().width(); + width -= mVScrollBar->size().getWidth(); } else { width = mMaxTextWidth; } @@ -371,9 +371,9 @@ void UIListBox::containerResize() { mContainer->position( mPaddingContainer.Left, mPaddingContainer.Top ); if( mHScrollBar->visible() ) - mContainer->size( mSize.width() - mPaddingContainer.Right - mPaddingContainer.Left, mSize.height() - mPaddingContainer.Top - mHScrollBar->size().height() ); + mContainer->size( mSize.getWidth() - mPaddingContainer.Right - mPaddingContainer.Left, mSize.getHeight() - mPaddingContainer.Top - mHScrollBar->size().getHeight() ); else - mContainer->size( mSize.width() - mPaddingContainer.Right - mPaddingContainer.Left, mSize.height() - mPaddingContainer.Bottom - mPaddingContainer.Top ); + mContainer->size( mSize.getWidth() - mPaddingContainer.Right - mPaddingContainer.Left, mSize.getHeight() - mPaddingContainer.Bottom - mPaddingContainer.Top ); } void UIListBox::createItemIndex( const Uint32& i ) { @@ -401,7 +401,7 @@ void UIListBox::updateScroll( bool FromScrollChange ) { Int32 ItemPos, ItemPosMax; Int32 tHLastScroll = mHScrollInit; - Uint32 VisibleItems = mContainer->size().height() / mRowHeight; + Uint32 VisibleItems = mContainer->size().getHeight() / mRowHeight; mItemsNotVisible = (Int32)mItems.size() - VisibleItems; bool wasScrollVisible = mVScrollBar->visible(); @@ -428,8 +428,8 @@ void UIListBox::updateScroll( bool FromScrollChange ) { } if ( Clipped && ( UI_SCROLLBAR_AUTO == mHScrollMode || UI_SCROLLBAR_ALWAYS_ON == mHScrollMode ) ) { - if ( ( mVScrollBar->visible() && mContainer->size().width() - mVScrollBar->size().width() < (Int32)mMaxTextWidth ) || - ( !mVScrollBar->visible() && mContainer->size().width() < (Int32)mMaxTextWidth ) ) { + if ( ( mVScrollBar->visible() && mContainer->size().getWidth() - mVScrollBar->size().getWidth() < (Int32)mMaxTextWidth ) || + ( !mVScrollBar->visible() && mContainer->size().getWidth() < (Int32)mMaxTextWidth ) ) { mHScrollBar->visible( true ); mHScrollBar->enabled( true ); @@ -438,9 +438,9 @@ void UIListBox::updateScroll( bool FromScrollChange ) { Int32 ScrollH; if ( mVScrollBar->visible() ) - ScrollH = mMaxTextWidth - mContainer->size().width() + mVScrollBar->size().width(); + ScrollH = mMaxTextWidth - mContainer->size().getWidth() + mVScrollBar->size().getWidth(); else - ScrollH = mMaxTextWidth - mContainer->size().width(); + ScrollH = mMaxTextWidth - mContainer->size().getWidth(); Int32 HScrolleable = (Uint32)( mHScrollBar->value() * ScrollH ); @@ -457,9 +457,9 @@ void UIListBox::updateScroll( bool FromScrollChange ) { } } - VisibleItems = mContainer->size().height() / mRowHeight; + VisibleItems = mContainer->size().getHeight() / mRowHeight; mItemsNotVisible = (Uint32)mItems.size() - VisibleItems; - Int32 Scrolleable = (Int32)mItems.size() * mRowHeight - mContainer->size().height(); + Int32 Scrolleable = (Int32)mItems.size() * mRowHeight - mContainer->size().getHeight(); bool isScrollVisible = mVScrollBar->visible(); bool isHScrollVisible = mHScrollBar->visible(); bool FirstVisible = false; @@ -470,7 +470,7 @@ void UIListBox::updateScroll( bool FromScrollChange ) { else RelPos = 0; - RelPosMax = RelPos + mContainer->size().height() + mRowHeight; + RelPosMax = RelPos + mContainer->size().getHeight() + mRowHeight; if ( ( FromScrollChange && eeINDEX_NOT_FOUND != mLastPos && mLastPos == RelPos ) && ( tHLastScroll == mHScrollInit ) ) return; @@ -559,11 +559,11 @@ void UIListBox::updateScroll( bool FromScrollChange ) { if ( mHScrollBar->visible() && !mVScrollBar->visible() ) { - mHScrollBar->position( mHScrollPadding.Left, mSize.height() - mHScrollBar->size().height() + mHScrollPadding.Top ); - mHScrollBar->size( mSize.width() + mHScrollPadding.Right, mHScrollBar->size().height() + mHScrollPadding.Bottom ); + mHScrollBar->position( mHScrollPadding.Left, mSize.getHeight() - mHScrollBar->size().getHeight() + mHScrollPadding.Top ); + mHScrollBar->size( mSize.getWidth() + mHScrollPadding.Right, mHScrollBar->size().getHeight() + mHScrollPadding.Bottom ); } else { - mHScrollBar->position( mHScrollPadding.Left, mSize.height() - mHScrollBar->size().height() + mHScrollPadding.Top ); - mHScrollBar->size( mSize.width() - mVScrollBar->size().width() + mHScrollPadding.Right, mHScrollBar->size().height() + mHScrollPadding.Bottom ); + mHScrollBar->position( mHScrollPadding.Left, mSize.getHeight() - mHScrollBar->size().getHeight() + mHScrollPadding.Top ); + mHScrollBar->size( mSize.getWidth() - mVScrollBar->size().getWidth() + mHScrollPadding.Right, mHScrollBar->size().getHeight() + mHScrollPadding.Bottom ); } } @@ -817,7 +817,7 @@ void UIListBox::selectNext() { if ( NULL == mItems[ SelIndex ] ) createItemIndex( SelIndex ); - if ( mItems[ SelIndex ]->position().y + (Int32)rowHeight() > mContainer->size().height() ) { + if ( mItems[ SelIndex ]->position().y + (Int32)rowHeight() > mContainer->size().getHeight() ) { mVScrollBar->value( (Float)( SelIndex * mRowHeight ) / (Float)( ( mItems.size() - 1 ) * mRowHeight ) ); mItems[ SelIndex ]->setFocus(); diff --git a/src/eepp/ui/uimenu.cpp b/src/eepp/ui/uimenu.cpp index 94b3256d9..330ce75b0 100644 --- a/src/eepp/ui/uimenu.cpp +++ b/src/eepp/ui/uimenu.cpp @@ -158,16 +158,16 @@ bool UIMenu::CheckControlSize( UIControl * Control, const bool& Resize ) { if ( Control->isType( UI_TYPE_MENUITEM ) ) { UIMenuItem * tItem = reinterpret_cast ( Control ); - if ( NULL != tItem->icon() && tItem->iconHorizontalMargin() + tItem->icon()->size().width() > (Int32)mBiggestIcon ) { - mBiggestIcon = tItem->iconHorizontalMargin() + tItem->icon()->size().width(); + if ( NULL != tItem->icon() && tItem->iconHorizontalMargin() + tItem->icon()->size().getWidth() > (Int32)mBiggestIcon ) { + mBiggestIcon = tItem->iconHorizontalMargin() + tItem->icon()->size().getWidth(); } if ( mFlags & UI_AUTO_SIZE ) { if ( Control->isType( UI_TYPE_MENUSUBMENU ) ) { UIMenuSubMenu * tMenu = reinterpret_cast ( tItem ); - if ( tMenu->getTextBox()->getTextWidth() + mBiggestIcon + tMenu->getArrow()->size().width() + mMinRightMargin > (Int32)mMaxWidth - mPadding.Left - mPadding.Right ) { - mMaxWidth = tMenu->getTextBox()->getTextWidth() + mBiggestIcon + mPadding.Left + mPadding.Right + tMenu->getArrow()->size().width() + mMinRightMargin; + if ( tMenu->getTextBox()->getTextWidth() + mBiggestIcon + tMenu->getArrow()->size().getWidth() + mMinRightMargin > (Int32)mMaxWidth - mPadding.Left - mPadding.Right ) { + mMaxWidth = tMenu->getTextBox()->getTextWidth() + mBiggestIcon + mPadding.Left + mPadding.Right + tMenu->getArrow()->size().getWidth() + mMinRightMargin; if ( Resize ) { ResizeControls(); @@ -214,9 +214,9 @@ Uint32 UIMenu::Add( UIControl * Control ) { void UIMenu::SetControlSize( UIControl * Control, const Uint32& Pos ) { if ( Control->isType( UI_TYPE_MENUITEM ) ) { - Control->size( mSize.width() - mPadding.Left - mPadding.Right, mRowHeight ); + Control->size( mSize.getWidth() - mPadding.Left - mPadding.Right, mRowHeight ); } else { - Control->size( mSize.width() - mPadding.Left - mPadding.Right, Control->size().height() ); + Control->size( mSize.getWidth() - mPadding.Left - mPadding.Right, Control->size().getHeight() ); } } @@ -224,14 +224,14 @@ Uint32 UIMenu::AddSeparator() { UISeparator::CreateParams Params; Params.setParent( this ); Params.setPos( mPadding.Left, mPadding.Top + mNextPosY ); - Params.Size = Sizei( mSize.width() - mPadding.Left - mPadding.Right, 3 ); + Params.Size = Sizei( mSize.getWidth() - mPadding.Left - mPadding.Right, 3 ); UISeparator * Control = eeNew( UISeparator, ( Params ) ); Control->visible( true ); Control->enabled( true ); - mNextPosY += Control->size().height(); + mNextPosY += Control->size().getHeight(); mItems.push_back( Control ); @@ -360,7 +360,7 @@ void UIMenu::onSizeChange() { mRowHeight = mFont->getFontHeight() + 8; } - if ( 0 != mMinWidth && mSize.width() < (Int32)mMinWidth ) { + if ( 0 != mMinWidth && mSize.getWidth() < (Int32)mMinWidth ) { size( mMinWidth, mNextPosY + mPadding.Top + mPadding.Bottom ); } } @@ -395,7 +395,7 @@ void UIMenu::ReposControls() { for ( i = 0; i < mItems.size(); i++ ) { mItems[i]->position( mPadding.Left, mPadding.Top + mNextPosY ); - mNextPosY += mItems[i]->size().height(); + mNextPosY += mItems[i]->size().getHeight(); } ResizeMe(); @@ -405,7 +405,7 @@ void UIMenu::ResizeMe() { if ( mFlags & UI_AUTO_SIZE ) { size( mMaxWidth, mNextPosY + mPadding.Top + mPadding.Bottom ); } else { - size( mSize.width(), mNextPosY + mPadding.Top + mPadding.Bottom ); + size( mSize.getWidth(), mNextPosY + mPadding.Top + mPadding.Bottom ); } } @@ -560,14 +560,14 @@ const Recti& UIMenu::Padding() const { } void UIMenu::FixMenuPos( Vector2i& Pos, UIMenu * Menu, UIMenu * Parent, UIMenuSubMenu * SubMenu ) { - eeAABB qScreen( 0.f, 0.f, UIManager::instance()->mainControl()->size().width(), UIManager::instance()->mainControl()->size().height() ); - eeAABB qPos( Pos.x, Pos.y, Pos.x + Menu->size().width(), Pos.y + Menu->size().height() ); + eeAABB qScreen( 0.f, 0.f, UIManager::instance()->mainControl()->size().getWidth(), UIManager::instance()->mainControl()->size().getHeight() ); + eeAABB qPos( Pos.x, Pos.y, Pos.x + Menu->size().getWidth(), Pos.y + Menu->size().getHeight() ); if ( NULL != Parent && NULL != SubMenu ) { Vector2i addToPos( 0, 0 ); if ( NULL != SubMenu ) { - addToPos.y = SubMenu->size().height(); + addToPos.y = SubMenu->size().getHeight(); } Vector2i sPos = SubMenu->position(); @@ -576,50 +576,50 @@ void UIMenu::FixMenuPos( Vector2i& Pos, UIMenu * Menu, UIMenu * Parent, UIMenuSu Vector2i pPos = Parent->position(); Parent->controlToScreen( pPos ); - eeAABB qParent( pPos.x, pPos.y, pPos.x + Parent->size().width(), pPos.y + Parent->size().height() ); + eeAABB qParent( pPos.x, pPos.y, pPos.x + Parent->size().getWidth(), pPos.y + Parent->size().getHeight() ); Pos.x = qParent.Right; Pos.y = sPos.y; qPos.Left = Pos.x; - qPos.Right = qPos.Left + Menu->size().width(); + qPos.Right = qPos.Left + Menu->size().getWidth(); qPos.Top = Pos.y; - qPos.Bottom = qPos.Top + Menu->size().height(); + qPos.Bottom = qPos.Top + Menu->size().getHeight(); if ( !qScreen.contains( qPos ) ) { - Pos.y = sPos.y + SubMenu->size().height() - Menu->size().height(); + Pos.y = sPos.y + SubMenu->size().getHeight() - Menu->size().getHeight(); qPos.Top = Pos.y; - qPos.Bottom = qPos.Top + Menu->size().height(); + qPos.Bottom = qPos.Top + Menu->size().getHeight(); if ( !qScreen.contains( qPos ) ) { - Pos.x = qParent.Left - Menu->size().width(); + Pos.x = qParent.Left - Menu->size().getWidth(); Pos.y = sPos.y; qPos.Left = Pos.x; - qPos.Right = qPos.Left + Menu->size().width(); + qPos.Right = qPos.Left + Menu->size().getWidth(); qPos.Top = Pos.y; - qPos.Bottom = qPos.Top + Menu->size().height(); + qPos.Bottom = qPos.Top + Menu->size().getHeight(); if ( !qScreen.contains( qPos ) ) { - Pos.y = sPos.y + SubMenu->size().height() - Menu->size().height(); + Pos.y = sPos.y + SubMenu->size().getHeight() - Menu->size().getHeight(); qPos.Top = Pos.y; - qPos.Bottom = qPos.Top + Menu->size().height(); + qPos.Bottom = qPos.Top + Menu->size().getHeight(); } } } } else { if ( !qScreen.contains( qPos ) ) { - Pos.y -= Menu->size().height(); - qPos.Top -= Menu->size().height(); - qPos.Bottom -= Menu->size().height(); + Pos.y -= Menu->size().getHeight(); + qPos.Top -= Menu->size().getHeight(); + qPos.Bottom -= Menu->size().getHeight(); if ( !qScreen.contains( qPos ) ) { - Pos.x -= Menu->size().width(); - qPos.Left -= Menu->size().width(); - qPos.Right -= Menu->size().width(); + Pos.x -= Menu->size().getWidth(); + qPos.Left -= Menu->size().getWidth(); + qPos.Right -= Menu->size().getWidth(); if ( !qScreen.contains( qPos ) ) { - Pos.y += Menu->size().height(); - qPos.Top += Menu->size().height(); - qPos.Bottom += Menu->size().height(); + Pos.y += Menu->size().getHeight(); + qPos.Top += Menu->size().getHeight(); + qPos.Bottom += Menu->size().getHeight(); } } } diff --git a/src/eepp/ui/uimenusubmenu.cpp b/src/eepp/ui/uimenusubmenu.cpp index beccf8bcd..d3131fb3a 100644 --- a/src/eepp/ui/uimenusubmenu.cpp +++ b/src/eepp/ui/uimenusubmenu.cpp @@ -49,7 +49,7 @@ void UIMenuSubMenu::setTheme( UITheme * Theme ) { void UIMenuSubMenu::onSizeChange() { UIMenuItem::onSizeChange(); - mArrow->position( parent()->size().width() - mArrow->size().width() - 1, 0 ); + mArrow->position( parent()->size().getWidth() - mArrow->size().getWidth() - 1, 0 ); mArrow->centerVertical(); } @@ -103,7 +103,7 @@ void UIMenuSubMenu::showSubMenu() { Vector2i Pos = this->position(); controlToScreen( Pos ); - Pos.x += mSize.width() + reinterpret_cast ( parent() )->Padding().Right; + Pos.x += mSize.getWidth() + reinterpret_cast ( parent() )->Padding().Right; UIMenu::FixMenuPos( Pos, mSubMenu, reinterpret_cast ( parent() ), this ); diff --git a/src/eepp/ui/uimessagebox.cpp b/src/eepp/ui/uimessagebox.cpp index 7425aebbd..2981f8628 100644 --- a/src/eepp/ui/uimessagebox.cpp +++ b/src/eepp/ui/uimessagebox.cpp @@ -15,13 +15,13 @@ UIMessageBox::UIMessageBox( const UIMessageBox::CreateParams& Params ) : UIPushButton::CreateParams ButtonParams; ButtonParams.setParent( getContainer() ); ButtonParams.setSize( 90, 22 ); - ButtonParams.setPos( getContainer()->size().width() - 96, getContainer()->size().height() - ButtonParams.Size.height() - 8 ); + ButtonParams.setPos( getContainer()->size().getWidth() - 96, getContainer()->size().getHeight() - ButtonParams.Size.getHeight() - 8 ); ButtonParams.Flags = UI_HALIGN_CENTER | UI_ANCHOR_RIGHT | UI_VALIGN_CENTER | UI_AUTO_SIZE; mButtonOK = eeNew( UIPushButton, ( ButtonParams ) ); mButtonOK->visible( true ); mButtonOK->enabled( true ); - ButtonParams.Pos.x = mButtonOK->position().x - mButtonOK->size().width() - 8; + ButtonParams.Pos.x = mButtonOK->position().x - mButtonOK->size().getWidth() - 8; mButtonCancel = eeNew( UIPushButton, ( ButtonParams ) ); mButtonCancel->visible( true ); mButtonCancel->enabled( true ); @@ -30,19 +30,19 @@ UIMessageBox::UIMessageBox( const UIMessageBox::CreateParams& Params ) : { mButtonOK = Theme->createPushButton( getContainer(), Sizei( 90, 22 ), - Vector2i( getContainer()->size().width() - 96, getContainer()->size().height() - 22 - 8 ), + Vector2i( getContainer()->size().getWidth() - 96, getContainer()->size().getHeight() - 22 - 8 ), UI_HALIGN_CENTER | UI_ANCHOR_RIGHT | UI_VALIGN_CENTER | UI_AUTO_SIZE ); mButtonCancel = Theme->createPushButton( getContainer(), mButtonOK->size(), - Vector2i( mButtonOK->position().x - mButtonOK->size().width() - 8, mButtonOK->position().y ), + Vector2i( mButtonOK->position().x - mButtonOK->size().getWidth() - 8, mButtonOK->position().y ), mButtonOK->flags() ); } UITextBox::CreateParams TxtParams; TxtParams.setParent( getContainer() ); TxtParams.Flags = UI_CONTROL_DEFAULT_FLAGS_CENTERED | UI_ANCHOR_RIGHT | UI_ANCHOR_BOTTOM; - TxtParams.setSize( getContainer()->size().width(), mButtonOK->position().y ); + TxtParams.setSize( getContainer()->size().getWidth(), mButtonOK->position().y ); mTextBox = eeNew( UITextBox, ( TxtParams ) ); mTextBox->visible( true ); @@ -104,7 +104,7 @@ void UIMessageBox::setTheme( UITheme * Theme ) { } } - mButtonOK->position( mButtonOK->position().x, getContainer()->size().height() - mButtonOK->size().height() - 8 ); + mButtonOK->position( mButtonOK->position().x, getContainer()->size().getHeight() - mButtonOK->size().getHeight() - 8 ); mButtonCancel->position( mButtonCancel->position().x, mButtonOK->position().y ); } @@ -145,17 +145,17 @@ UIPushButton * UIMessageBox::getButtonCancel() const { } void UIMessageBox::autoSize() { - Sizei nSize( mTextBox->getTextWidth() + 48, mTextBox->getTextHeight() + mButtonOK->size().height() + mDecoSize.height() + 8 ); + Sizei nSize( mTextBox->getTextWidth() + 48, mTextBox->getTextHeight() + mButtonOK->size().getHeight() + mDecoSize.getHeight() + 8 ); - if ( !( nSize.width() > getContainer()->size().width() ) ) { - nSize.x = getContainer()->size().width(); + if ( !( nSize.getWidth() > getContainer()->size().getWidth() ) ) { + nSize.x = getContainer()->size().getWidth(); } - if ( !( nSize.height() > getContainer()->size().height() ) ) { - nSize.y = getContainer()->size().height(); + if ( !( nSize.getHeight() > getContainer()->size().getHeight() ) ) { + nSize.y = getContainer()->size().getHeight(); } - if ( nSize.x != getContainer()->size().width() || nSize.y != getContainer()->size().height() ) { + if ( nSize.x != getContainer()->size().getWidth() || nSize.y != getContainer()->size().getHeight() ) { size( nSize ); mMinWindowSize = nSize; diff --git a/src/eepp/ui/uiprogressbar.cpp b/src/eepp/ui/uiprogressbar.cpp index faad8913a..989b11336 100644 --- a/src/eepp/ui/uiprogressbar.cpp +++ b/src/eepp/ui/uiprogressbar.cpp @@ -55,7 +55,7 @@ void UIProgressBar::setTheme( UITheme * Theme ) { UIControl::setThemeControl( Theme, "progressbar" ); if ( mFlags & UI_AUTO_SIZE ) { - size( mSize.x, getSkinSize().height() ); + size( mSize.x, getSkinSize().getHeight() ); } UISkin * tSkin = Theme->getByName( Theme->abbr() + "_progressbar_filler" ); @@ -66,15 +66,15 @@ void UIProgressBar::setTheme( UITheme * Theme ) { if ( NULL != tSubTexture ) { eeSAFE_DELETE( mParallax ); - Float Height = (Float)getSkinSize().height(); + Float Height = (Float)getSkinSize().getHeight(); if ( !mVerticalExpand ) - Height = (Float)tSubTexture->realSize().height(); + Height = (Float)tSubTexture->realSize().getHeight(); - if ( Height > mSize.height() ) - Height = mSize.height(); + if ( Height > mSize.getHeight() ) + Height = mSize.getHeight(); - mParallax = eeNew( ScrollParallax, ( tSubTexture, Vector2f( mScreenPos.x + mFillerMargin.Left, mScreenPos.y + mFillerMargin.Top ), Sizef( ( ( mSize.width() - mFillerMargin.Left - mFillerMargin.Right ) * mProgress ) / mTotalSteps, Height - mFillerMargin.Top - mFillerMargin.Bottom ), mSpeed ) ); + mParallax = eeNew( ScrollParallax, ( tSubTexture, Vector2f( mScreenPos.x + mFillerMargin.Left, mScreenPos.y + mFillerMargin.Top ), Sizef( ( ( mSize.getWidth() - mFillerMargin.Left - mFillerMargin.Right ) * mProgress ) / mTotalSteps, Height - mFillerMargin.Top - mFillerMargin.Bottom ), mSpeed ) ); } } } @@ -89,15 +89,15 @@ Uint32 UIProgressBar::onValueChange() { void UIProgressBar::onSizeChange() { if ( NULL != mParallax ) { - Float Height = (Float)mSize.height(); + Float Height = (Float)mSize.getHeight(); if ( !mVerticalExpand && mParallax->subTexture() ) - Height = (Float)mParallax->subTexture()->realSize().height(); + Height = (Float)mParallax->subTexture()->realSize().getHeight(); - if ( Height > mSize.height() ) - Height = mSize.height(); + if ( Height > mSize.getHeight() ) + Height = mSize.getHeight(); - mParallax->size( Sizef( ( ( mSize.width() - mFillerMargin.Left - mFillerMargin.Right ) * mProgress ) / mTotalSteps, Height - mFillerMargin.Top - mFillerMargin.Bottom ) ); + mParallax->size( Sizef( ( ( mSize.getWidth() - mFillerMargin.Left - mFillerMargin.Right ) * mProgress ) / mTotalSteps, Height - mFillerMargin.Top - mFillerMargin.Bottom ) ); } updateTextBox(); diff --git a/src/eepp/ui/uipushbutton.cpp b/src/eepp/ui/uipushbutton.cpp index c7f53ab5d..537d95060 100644 --- a/src/eepp/ui/uipushbutton.cpp +++ b/src/eepp/ui/uipushbutton.cpp @@ -76,13 +76,13 @@ void UIPushButton::onSizeChange() { if ( NULL != mTextBox ) { switch ( FontHAlignGet( flags() ) ) { case UI_HALIGN_LEFT: - mTextBox->position( mIcon->position().x + mIcon->size().width(), 0 ); - mTextBox->size( mSize.width() - mIcon->position().x + mIcon->size().width(), mSize.height() ); + mTextBox->position( mIcon->position().x + mIcon->size().getWidth(), 0 ); + mTextBox->size( mSize.getWidth() - mIcon->position().x + mIcon->size().getWidth(), mSize.getHeight() ); break; case UI_HALIGN_CENTER: if ( NULL != mIcon->subTexture() ) { - if ( mIcon->position().x + mIcon->size().width() >= mTextBox->alignOffset().x ) { - mTextBox->position( mIcon->position().x + mIcon->size().width() + 1 - mTextBox->alignOffset().x, mTextBox->position().y ); + if ( mIcon->position().x + mIcon->size().getWidth() >= mTextBox->alignOffset().x ) { + mTextBox->position( mIcon->position().x + mIcon->size().getWidth() + 1 - mTextBox->alignOffset().x, mTextBox->position().y ); } } @@ -137,7 +137,7 @@ void UIPushButton::doAftersetTheme() { } if ( mFlags & UI_AUTO_SIZE ) { - mSize.height( getSkinSize().height() ); + mSize.setHeight( getSkinSize().getHeight() ); } autoPadding(); diff --git a/src/eepp/ui/uiradiobutton.cpp b/src/eepp/ui/uiradiobutton.cpp index 87d33c088..ddc2f969a 100644 --- a/src/eepp/ui/uiradiobutton.cpp +++ b/src/eepp/ui/uiradiobutton.cpp @@ -82,7 +82,7 @@ void UIRadioButton::autoSize() { mActiveButton->centerVertical(); mInactiveButton->centerVertical(); - mSize.width( (int)mTextCache->getTextWidth() + mActiveButton->size().width() ); + mSize.setWidth( (int)mTextCache->getTextWidth() + mActiveButton->size().getWidth() ); } } @@ -207,7 +207,7 @@ const bool& UIRadioButton::isActive() const { void UIRadioButton::padding( const Recti& padding ) { mPadding = padding; - mPadding.Left = mPadding.Left + mActiveButton->size().width(); + mPadding.Left = mPadding.Left + mActiveButton->size().getWidth(); } UIControlAnim * UIRadioButton::activeButton() const { diff --git a/src/eepp/ui/uiscrollbar.cpp b/src/eepp/ui/uiscrollbar.cpp index 76d031d16..7f9cf26fa 100644 --- a/src/eepp/ui/uiscrollbar.cpp +++ b/src/eepp/ui/uiscrollbar.cpp @@ -101,13 +101,13 @@ void UIScrollBar::setTheme( UITheme * Theme ) { if ( NULL != tSubTexture ) { if ( mSlider->isVertical() ) { - mSlider->size( tSubTexture->realSize().width() , mSize.height() ); - size( tSubTexture->realSize().width() , mSize.height() ); - mMinControlSize.x = mSize.width(); + mSlider->size( tSubTexture->realSize().getWidth() , mSize.getHeight() ); + size( tSubTexture->realSize().getWidth() , mSize.getHeight() ); + mMinControlSize.x = mSize.getWidth(); } else { - mSlider->size( mSize.width(), tSubTexture->realSize().height() ); - size( mSize.width(), tSubTexture->realSize().height() ); - mMinControlSize.y = mSize.height(); + mSlider->size( mSize.getWidth(), tSubTexture->realSize().getHeight() ); + size( mSize.getWidth(), tSubTexture->realSize().getHeight() ); + mMinControlSize.y = mSize.getHeight(); } } } @@ -128,17 +128,17 @@ void UIScrollBar::adjustChilds() { mBtnUp->position( 0, 0 ); if ( !isVertical() ) { - mBtnDown->position( mSize.width() - mBtnDown->size().width(), 0 ); - mSlider->size( mSize.width() - mBtnDown->size().width() - mBtnUp->size().width(), mSlider->size().height() ); - mSlider->position( mBtnUp->size().width(), 0 ); + mBtnDown->position( mSize.getWidth() - mBtnDown->size().getWidth(), 0 ); + mSlider->size( mSize.getWidth() - mBtnDown->size().getWidth() - mBtnUp->size().getWidth(), mSlider->size().getHeight() ); + mSlider->position( mBtnUp->size().getWidth(), 0 ); mBtnDown->centerVertical(); mBtnUp->centerVertical(); mSlider->centerVertical(); } else { - mBtnDown->position( 0, mSize.height() - mBtnDown->size().height() ); - mSlider->size( mSlider->size().width(), mSize.height() - mBtnDown->size().height() - mBtnUp->size().height() ); - mSlider->position( 0, mBtnUp->size().height() ); + mBtnDown->position( 0, mSize.getHeight() - mBtnDown->size().getHeight() ); + mSlider->size( mSlider->size().getWidth(), mSize.getHeight() - mBtnDown->size().getHeight() - mBtnUp->size().getHeight() ); + mSlider->position( 0, mBtnUp->size().getHeight() ); mBtnDown->centerHorizontal(); mBtnUp->centerHorizontal(); diff --git a/src/eepp/ui/uiseparator.cpp b/src/eepp/ui/uiseparator.cpp index e468d0517..067830d03 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.width(), mSkinState->getSkin()->getSubTexture( UISkinState::StateNormal )->realSize().height() ); + size( mSize.getWidth(), mSkinState->getSkin()->getSubTexture( UISkinState::StateNormal )->realSize().getHeight() ); } } diff --git a/src/eepp/ui/uiskincomplex.cpp b/src/eepp/ui/uiskincomplex.cpp index 505ca4b04..3852189f7 100644 --- a/src/eepp/ui/uiskincomplex.cpp +++ b/src/eepp/ui/uiskincomplex.cpp @@ -53,7 +53,7 @@ void UISkinComplex::draw( const Float& X, const Float& Y, const Float& Width, co if ( NULL != tSubTexture ) { dls = tSubTexture->realSize(); - tSubTexture->draw( X, Y + Height - dls.height(), mTempColor ); + tSubTexture->draw( X, Y + Height - dls.getHeight(), mTempColor ); } tSubTexture = mSubTexture[ State ][ UpRight ]; @@ -63,7 +63,7 @@ void UISkinComplex::draw( const Float& X, const Float& Y, const Float& Width, co if ( NULL != tSubTexture ) { urs = tSubTexture->realSize(); - tSubTexture->draw( X + Width - urs.width(), Y, mTempColor ); + tSubTexture->draw( X + Width - urs.getWidth(), Y, mTempColor ); } tSubTexture = mSubTexture[ State ][ DownRight ]; @@ -73,47 +73,47 @@ void UISkinComplex::draw( const Float& X, const Float& Y, const Float& Width, co if ( NULL != tSubTexture ) { drs = tSubTexture->realSize(); - tSubTexture->draw( X + Width - drs.width(), Y + Height - drs.height(), mTempColor ); + tSubTexture->draw( X + Width - drs.getWidth(), Y + Height - drs.getHeight(), mTempColor ); } tSubTexture = mSubTexture[ State ][ Left ]; if ( NULL != tSubTexture ) { - tSubTexture->destSize( Sizef( tSubTexture->destSize().x, Height - uls.height() - dls.height() ) ); + tSubTexture->destSize( Sizef( tSubTexture->destSize().x, Height - uls.getHeight() - dls.getHeight() ) ); - tSubTexture->draw( X, Y + uls.height(), mTempColor ); + tSubTexture->draw( X, Y + uls.getHeight(), mTempColor ); tSubTexture->resetDestSize(); - if ( uls.width() == 0 ) - uls.x = tSubTexture->realSize().width(); + if ( uls.getWidth() == 0 ) + uls.x = tSubTexture->realSize().getWidth(); } tSubTexture = mSubTexture[ State ][ Up ]; if ( NULL != tSubTexture ) { - tSubTexture->destSize( Sizef( Width - uls.width() - urs.width(), tSubTexture->destSize().y ) ); + tSubTexture->destSize( Sizef( Width - uls.getWidth() - urs.getWidth(), tSubTexture->destSize().y ) ); - tSubTexture->draw( X + uls.width(), Y, mTempColor ); + tSubTexture->draw( X + uls.getWidth(), Y, mTempColor ); tSubTexture->resetDestSize(); - if ( urs.height() == 0 ) - urs.y = tSubTexture->realSize().height(); + if ( urs.getHeight() == 0 ) + urs.y = tSubTexture->realSize().getHeight(); - if ( uls.height() == 0 ) - uls.y = tSubTexture->realSize().height(); + if ( uls.getHeight() == 0 ) + uls.y = tSubTexture->realSize().getHeight(); } tSubTexture = mSubTexture[ State ][ Right ]; if ( NULL != tSubTexture ) { - if ( urs.width() == 0 ) - urs.x = tSubTexture->realSize().width(); + if ( urs.getWidth() == 0 ) + urs.x = tSubTexture->realSize().getWidth(); - tSubTexture->destSize( Sizef( tSubTexture->destSize().x, Height - urs.height() - drs.height() ) ); + tSubTexture->destSize( Sizef( tSubTexture->destSize().x, Height - urs.getHeight() - drs.getHeight() ) ); - tSubTexture->draw( X + Width - tSubTexture->realSize().width(), Y + urs.height(), mTempColor ); + tSubTexture->draw( X + Width - tSubTexture->realSize().getWidth(), Y + urs.getHeight(), mTempColor ); tSubTexture->resetDestSize(); } @@ -121,22 +121,22 @@ 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.width() - drs.width(), tSubTexture->destSize().y ) ); + tSubTexture->destSize( Sizef( Width - dls.getWidth() - drs.getWidth(), tSubTexture->destSize().y ) ); - tSubTexture->draw( X + dls.width(), Y + Height - tSubTexture->realSize().height(), mTempColor ); + tSubTexture->draw( X + dls.getWidth(), Y + Height - tSubTexture->realSize().getHeight(), mTempColor ); tSubTexture->resetDestSize(); - if ( dls.height() == 0 && drs.height() == 0 ) - dls.height( tSubTexture->realSize().height() ); + if ( dls.getHeight() == 0 && drs.getHeight() == 0 ) + dls.setHeight( tSubTexture->realSize().getHeight() ); } tSubTexture = mSubTexture[ State ][ Center ]; if ( NULL != tSubTexture ) { - tSubTexture->destSize( Sizef( Width - uls.width() - urs.width(), Height - uls.height() - dls.height() ) ); + tSubTexture->destSize( Sizef( Width - uls.getWidth() - urs.getWidth(), Height - uls.getHeight() - dls.getHeight() ) ); - tSubTexture->draw( X + uls.width(), Y + uls.height(), mTempColor ); + tSubTexture->draw( X + uls.getWidth(), Y + uls.getHeight(), mTempColor ); tSubTexture->resetDestSize(); } diff --git a/src/eepp/ui/uislider.cpp b/src/eepp/ui/uislider.cpp index f9623cce7..6b2a38876 100644 --- a/src/eepp/ui/uislider.cpp +++ b/src/eepp/ui/uislider.cpp @@ -21,9 +21,9 @@ UISlider::UISlider( const UISlider::CreateParams& Params ) : BgParams.setParent( this ); if ( !mVertical ) - BgParams.Size = Sizei( mSize.width() - 16, 8 ); + BgParams.Size = Sizei( mSize.getWidth() - 16, 8 ); else - BgParams.Size = Sizei( 8, mSize.width() - 16 ); + BgParams.Size = Sizei( 8, mSize.getWidth() - 16 ); mBackSlider = eeNew( UIControlAnim, ( BgParams ) ); mBackSlider->visible( true ); @@ -111,26 +111,26 @@ void UISlider::adjustChilds() { Int32 Height; if ( mExpandBackground ) - Height = mSize.height(); + Height = mSize.getHeight(); else - Height = tSubTexture->realSize().height(); + Height = tSubTexture->realSize().getHeight(); if ( mAllowHalfSliderOut ) - mBackSlider->size( Sizei( mSize.width() - mSlider->size().width(), Height ) ); + mBackSlider->size( Sizei( mSize.getWidth() - mSlider->size().getWidth(), Height ) ); else - mBackSlider->size( Sizei( mSize.width(), Height ) ); + mBackSlider->size( Sizei( mSize.getWidth(), Height ) ); } else { Int32 Width; if ( mExpandBackground ) - Width = mSize.width(); + Width = mSize.getWidth(); else - Width = tSubTexture->realSize().width(); + Width = tSubTexture->realSize().getWidth(); if ( mAllowHalfSliderOut ) - mBackSlider->size( Sizei( Width, mSize.height() - mSlider->size().height() ) ); + mBackSlider->size( Sizei( Width, mSize.getHeight() - mSlider->size().getHeight() ) ); else - mBackSlider->size( Sizei( Width, mSize.height() ) ); + mBackSlider->size( Sizei( Width, mSize.getHeight() ) ); } mBackSlider->center(); @@ -149,19 +149,19 @@ void UISlider::fixSliderPos() { mSlider->position( 0, 0 ); if ( mAllowHalfSliderOut ) { - if ( mSlider->position().x > mBackSlider->size().width() ) - mSlider->position( mBackSlider->size().width(), 0 ); + if ( mSlider->position().x > mBackSlider->size().getWidth() ) + mSlider->position( mBackSlider->size().getWidth(), 0 ); } else { - if ( mSlider->position().x > mBackSlider->size().width() - mSlider->size().width() ) - mSlider->position( mBackSlider->size().width() - mSlider->size().width(), 0 ); + if ( mSlider->position().x > mBackSlider->size().getWidth() - mSlider->size().getWidth() ) + mSlider->position( mBackSlider->size().getWidth() - mSlider->size().getWidth(), 0 ); } mSlider->centerVertical(); if ( mAllowHalfSliderOut ) - value( mMinValue + (Float)mSlider->position().x * ( mMaxValue - mMinValue ) / (Float)mBackSlider->size().width() ); + value( mMinValue + (Float)mSlider->position().x * ( mMaxValue - mMinValue ) / (Float)mBackSlider->size().getWidth() ); else - value( mMinValue + (Float)mSlider->position().x * ( mMaxValue - mMinValue ) / ( (Float)mSize.width() - mSlider->size().width() ) ); + value( mMinValue + (Float)mSlider->position().x * ( mMaxValue - mMinValue ) / ( (Float)mSize.getWidth() - mSlider->size().getWidth() ) ); } else { mSlider->position( 0, mSlider->position().y ); @@ -169,19 +169,19 @@ void UISlider::fixSliderPos() { mSlider->position( 0, 0 ); if ( mAllowHalfSliderOut ) { - if ( mSlider->position().y > mBackSlider->size().height() ) - mSlider->position( 0, mBackSlider->size().height() ); + if ( mSlider->position().y > mBackSlider->size().getHeight() ) + mSlider->position( 0, mBackSlider->size().getHeight() ); } else { - if ( mSlider->position().y > mBackSlider->size().height() - mSlider->size().height() ) - mSlider->position( 0, mBackSlider->size().height() - mSlider->size().height() ); + if ( mSlider->position().y > mBackSlider->size().getHeight() - mSlider->size().getHeight() ) + mSlider->position( 0, mBackSlider->size().getHeight() - mSlider->size().getHeight() ); } mSlider->centerHorizontal(); if ( mAllowHalfSliderOut ) - value( mMinValue + (Float)mSlider->position().y * ( mMaxValue - mMinValue ) / (Float)mBackSlider->size().height() ); + value( mMinValue + (Float)mSlider->position().y * ( mMaxValue - mMinValue ) / (Float)mBackSlider->size().getHeight() ); else - value( mMinValue + (Float)mSlider->position().y * ( mMaxValue - mMinValue ) / ( (Float)mSize.height() - mSlider->size().height() ) ); + value( mMinValue + (Float)mSlider->position().y * ( mMaxValue - mMinValue ) / ( (Float)mSize.getHeight() - mSlider->size().getHeight() ) ); } mOnPosChange = false; @@ -202,14 +202,14 @@ void UISlider::value( Float Val ) { if ( !mVertical ) { if ( mAllowHalfSliderOut ) - mSlider->position( (Int32)( (Float)mBackSlider->size().width() * Percent ), mSlider->position().y ); + mSlider->position( (Int32)( (Float)mBackSlider->size().getWidth() * Percent ), mSlider->position().y ); else - mSlider->position( (Int32)( ( (Float)mSize.width() - mSlider->size().width() ) * Percent ), mSlider->position().y ); + mSlider->position( (Int32)( ( (Float)mSize.getWidth() - mSlider->size().getWidth() ) * Percent ), mSlider->position().y ); } else { if ( mAllowHalfSliderOut ) - mSlider->position( mSlider->position().x, (Int32)( (Float)mBackSlider->size().height() * Percent ) ); + mSlider->position( mSlider->position().x, (Int32)( (Float)mBackSlider->size().getHeight() * Percent ) ); else - mSlider->position( mSlider->position().x, (Int32)( ( (Float)mSize.height() - mSlider->size().height() ) * Percent ) ); + mSlider->position( mSlider->position().x, (Int32)( ( (Float)mSize.getHeight() - mSlider->size().getHeight() ) * Percent ) ); } mOnPosChange = false; diff --git a/src/eepp/ui/uispinbox.cpp b/src/eepp/ui/uispinbox.cpp index c600f894a..fb7de8de4 100644 --- a/src/eepp/ui/uispinbox.cpp +++ b/src/eepp/ui/uispinbox.cpp @@ -92,16 +92,16 @@ void UISpinBox::setTheme( UITheme * Theme ) { } if ( mFlags & UI_AUTO_SIZE ) { - mSize.height( mInput->getSkinSize().height() ); + mSize.setHeight( mInput->getSkinSize().getHeight() ); } adjustChilds(); } void UISpinBox::adjustChilds() { - mPushUp->position( mSize.width() - mPushUp->size().width(), 0 ); - mPushDown->position( mSize.width() - mPushDown->size().width(), mPushUp->size().height() ); - mInput->size( mSize.width() - mPushUp->size().width(), mSize.height() ); + mPushUp->position( mSize.getWidth() - mPushUp->size().getWidth(), 0 ); + mPushDown->position( mSize.getWidth() - mPushDown->size().getWidth(), mPushUp->size().getHeight() ); + mInput->size( mSize.getWidth() - mPushUp->size().getWidth(), mSize.getHeight() ); } void UISpinBox::padding( const Recti& padding ) { diff --git a/src/eepp/ui/uisprite.cpp b/src/eepp/ui/uisprite.cpp index 39222c7a3..f775a0d84 100644 --- a/src/eepp/ui/uisprite.cpp +++ b/src/eepp/ui/uisprite.cpp @@ -115,17 +115,17 @@ void UISprite::autoAlign() { SubTexture * tSubTexture = mSprite->getCurrentSubTexture(); if ( HAlignGet( mFlags ) == UI_HALIGN_CENTER ) { - mAlignOffset.x = mSize.width() / 2 - tSubTexture->size().width() / 2; + mAlignOffset.x = mSize.getWidth() / 2 - tSubTexture->size().getWidth() / 2; } else if ( FontHAlignGet( mFlags ) == UI_HALIGN_RIGHT ) { - mAlignOffset.x = mSize.width() - tSubTexture->size().width(); + mAlignOffset.x = mSize.getWidth() - tSubTexture->size().getWidth(); } else { mAlignOffset.x = 0; } if ( VAlignGet( mFlags ) == UI_VALIGN_CENTER ) { - mAlignOffset.y = mSize.height() / 2 - tSubTexture->size().height() / 2; + mAlignOffset.y = mSize.getHeight() / 2 - tSubTexture->size().getHeight() / 2; } else if ( FontVAlignGet( mFlags ) == UI_VALIGN_BOTTOM ) { - mAlignOffset.y = mSize.height() - tSubTexture->size().height(); + mAlignOffset.y = mSize.getHeight() - tSubTexture->size().getHeight(); } else { mAlignOffset.y = 0; } diff --git a/src/eepp/ui/uitab.cpp b/src/eepp/ui/uitab.cpp index d62d785bc..bdee97256 100644 --- a/src/eepp/ui/uitab.cpp +++ b/src/eepp/ui/uitab.cpp @@ -70,7 +70,7 @@ void UITab::onStateChange() { UITabWidget * tTabW = getTabWidget(); if ( NULL != tTabW ) { - size( mSize.width(), getSkinSize( getSkin(), mSkinState->getState() ).height() ); + size( mSize.getWidth(), getSkinSize( getSkin(), mSkinState->getState() ).getHeight() ); if ( mSkinState->getState() == UISkinState::StateSelected ) { mTextBox->color( tTabW->mFontSelectedColor ); @@ -106,7 +106,7 @@ void UITab::text( const String &text ) { void UITab::setRealSize() { if ( mFlags & UI_AUTO_SIZE ) { - Uint32 w = mTextBox->getTextWidth() + getSkinSize().width(); + Uint32 w = mTextBox->getTextWidth() + getSkinSize().getWidth(); UITabWidget * tTabW = getTabWidget(); @@ -115,7 +115,7 @@ void UITab::setRealSize() { w = eemin( w, tTabW->mMaxTabWidth ); } - size( w, mSize.height() ); + size( w, mSize.getHeight() ); } } diff --git a/src/eepp/ui/uitabwidget.cpp b/src/eepp/ui/uitabwidget.cpp index 1de1726c8..9b7d07f4b 100644 --- a/src/eepp/ui/uitabwidget.cpp +++ b/src/eepp/ui/uitabwidget.cpp @@ -29,7 +29,7 @@ UITabWidget::UITabWidget( UITabWidget::CreateParams& Params ) : TabParams.setParent( this ); TabParams.setPos( 0, 0 ); TabParams.Flags |= UI_CLIP_ENABLE | UI_ANCHOR_RIGHT; - TabParams.setSize( mSize.width(), mTabWidgetHeight ); + TabParams.setSize( mSize.getWidth(), mTabWidgetHeight ); mTabContainer = eeNew( UIComplexControl, ( TabParams ) ); mTabContainer->visible( true ); @@ -38,7 +38,7 @@ UITabWidget::UITabWidget( UITabWidget::CreateParams& Params ) : UIComplexControl::CreateParams CtrlParams; CtrlParams.setParent( this ); CtrlParams.setPos( 0, mTabWidgetHeight ); - CtrlParams.setSize( mSize.width(), mSize.height() - mTabWidgetHeight ); + CtrlParams.setSize( mSize.getWidth(), mSize.getHeight() - mTabWidgetHeight ); CtrlParams.Flags |= UI_CLIP_ENABLE | UI_ANCHOR_BOTTOM | UI_ANCHOR_RIGHT; mCtrlContainer = eeNew( UIComplexControl, ( CtrlParams ) ); @@ -72,7 +72,7 @@ void UITabWidget::setTheme( UITheme * Theme ) { Sizei tSize1 = getSkinSize( tSkin ); Sizei tSize2 = getSkinSize( tSkin, UISkinState::StateSelected ); - mTabWidgetHeight = eemax( tSize1.height(), tSize2.height() ); + mTabWidgetHeight = eemax( tSize1.getHeight(), tSize2.getHeight() ); seContainerSize(); orderTabs(); @@ -86,9 +86,9 @@ void UITabWidget::doAftersetTheme() { } void UITabWidget::seContainerSize() { - mTabContainer->size( mSize.width(), mTabWidgetHeight ); + mTabContainer->size( mSize.getWidth(), mTabWidgetHeight ); mCtrlContainer->position( 0, mTabWidgetHeight ); - mCtrlContainer->size( mSize.width(), mSize.height() - mTabWidgetHeight ); + mCtrlContainer->size( mSize.getWidth(), mSize.getHeight() - mTabWidgetHeight ); } void UITabWidget::draw() { @@ -97,7 +97,7 @@ void UITabWidget::draw() { if ( smooth ) GLi->lineSmooth( false ); Primitives P; - Vector2i p1( mPos.x, mPos.y + mTabContainer->size().height() + mLineBewowTabsYOffset ); + Vector2i p1( mPos.x, mPos.y + mTabContainer->size().getHeight() + mLineBewowTabsYOffset ); Vector2i p2( mPos.x + mTabContainer->position().x, p1.y ); controlToScreen( p1 ); @@ -107,8 +107,8 @@ void UITabWidget::draw() { P.setColor( mLineBelowTabsColor ); P.drawLine( Line2f( Vector2f( p1.x, p1.y ), Vector2f( p2.x, p2.y ) ) ); - Vector2i p3( mPos.x + mTabContainer->position().x + mTabContainer->size().width(), mPos.y + mTabContainer->size().height() + mLineBewowTabsYOffset ); - Vector2i p4( mPos.x + mSize.width(), p3.y ); + Vector2i p3( mPos.x + mTabContainer->position().x + mTabContainer->size().getWidth(), mPos.y + mTabContainer->size().getHeight() + mLineBewowTabsYOffset ); + Vector2i p4( mPos.x + mSize.getWidth(), p3.y ); controlToScreen( p3 ); controlToScreen( p4 ); @@ -124,7 +124,7 @@ void UITabWidget::setTabContainerSize() { if ( mTabs.size() > 0 ) { for ( Uint32 i = 0; i < mTabs.size(); i++ ) { - s += mTabs[i]->size().width() + mTabSeparation; + s += mTabs[i]->size().getWidth() + mTabSeparation; } s -= mTabSeparation; @@ -141,7 +141,7 @@ void UITabWidget::setTabContainerSize() { mTabContainer->centerHorizontal(); break; case UI_HALIGN_RIGHT: - mTabContainer->position( mSize.width() - mTabContainer->size().width(), 0 ); + mTabContainer->position( mSize.getWidth() - mTabContainer->size().getWidth(), 0 ); break; } } @@ -155,19 +155,19 @@ void UITabWidget::posTabs() { switch ( VA ) { case UI_VALIGN_BOTTOM: - h = mTabWidgetHeight - mTabs[i]->size().height(); + h = mTabWidgetHeight - mTabs[i]->size().getHeight(); break; case UI_VALIGN_TOP: h = 0; break; case UI_VALIGN_CENTER: - h = mTabWidgetHeight / 2 - mTabs[i]->size().height() / 2; + h = mTabWidgetHeight / 2 - mTabs[i]->size().getHeight() / 2; break; } mTabs[i]->position( w, h ); - w += mTabs[i]->size().width() + mTabSeparation; + w += mTabs[i]->size().getHeight() + mTabSeparation; } } diff --git a/src/eepp/ui/uitextbox.cpp b/src/eepp/ui/uitextbox.cpp index 3cc11e4dd..b839ca316 100644 --- a/src/eepp/ui/uitextbox.cpp +++ b/src/eepp/ui/uitextbox.cpp @@ -55,8 +55,8 @@ void UITextBox::draw() { UIManager::instance()->clipEnable( mScreenPos.x + mPadding.Left, mScreenPos.y + mPadding.Top, - mSize.width() - mPadding.Left - mPadding.Right, - mSize.height() - mPadding.Top - mPadding.Bottom + mSize.getWidth() - mPadding.Left - mPadding.Right, + mSize.getHeight() - mPadding.Top - mPadding.Bottom ); } @@ -143,7 +143,7 @@ void UITextBox::alpha( const Float& alpha ) { void UITextBox::autoShrink() { if ( mFlags & UI_AUTO_SHRINK_TEXT ) { - shrinkText( mSize.width() ); + shrinkText( mSize.getWidth() ); } } @@ -157,8 +157,8 @@ void UITextBox::shrinkText( const Uint32& MaxWidth ) { void UITextBox::autoSize() { if ( mFlags & UI_AUTO_SIZE ) { - mSize.width( (int)mTextCache->getTextWidth() ); - mSize.height( (int)mTextCache->getTextHeight() ); + mSize.setWidth( (int)mTextCache->getTextWidth() ); + mSize.setHeight( (int)mTextCache->getTextHeight() ); } } diff --git a/src/eepp/ui/uitextedit.cpp b/src/eepp/ui/uitextedit.cpp index 2b73eb17d..a554ab516 100644 --- a/src/eepp/ui/uitextedit.cpp +++ b/src/eepp/ui/uitextedit.cpp @@ -51,15 +51,15 @@ UITextEdit::UITextEdit( UITextEdit::CreateParams& Params ) : UIScrollBar::CreateParams ScrollBarP; ScrollBarP.setParent( this ); - ScrollBarP.setPos( mSize.width() - 15, 0 ); - ScrollBarP.Size = Sizei( 15, mSize.height() ); + ScrollBarP.setPos( mSize.getWidth() - 15, 0 ); + ScrollBarP.Size = Sizei( 15, mSize.getHeight() ); ScrollBarP.Flags = UI_AUTO_SIZE; ScrollBarP.VerticalScrollBar = true; mVScrollBar = eeNew( UIScrollBar, ( ScrollBarP ) ); mVScrollBar->value( 1 ); - ScrollBarP.setPos( 0, mSize.height() - 15 ); - ScrollBarP.Size = Sizei( mSize.width() - mVScrollBar->size().width(), 15 ); + ScrollBarP.setPos( 0, mSize.getHeight() - 15 ); + ScrollBarP.Size = Sizei( mSize.getWidth() - mVScrollBar->size().getWidth(), 15 ); ScrollBarP.VerticalScrollBar = false; mHScrollBar = eeNew( UIScrollBar, ( ScrollBarP ) ); @@ -97,11 +97,11 @@ void UITextEdit::setTheme( UITheme * Theme ) { } void UITextEdit::onSizeChange() { - mHScrollBar->position( 0, mSize.height() - mHScrollBar->size().height() ); - mVScrollBar->position( mSize.width() - mVScrollBar->size().width(), 0 ); + mHScrollBar->position( 0, mSize.getHeight() - mHScrollBar->size().getHeight() ); + mVScrollBar->position( mSize.getWidth() - mVScrollBar->size().getWidth(), 0 ); - mHScrollBar->size( mSize.width(), mHScrollBar->size().height() ); - mVScrollBar->size( mVScrollBar->size().width(), mSize.height() ); + mHScrollBar->size( mSize.getWidth(), mHScrollBar->size().getHeight() ); + mVScrollBar->size( mVScrollBar->size().getWidth(), mSize.getHeight() ); mTextInput->position( mPadding.Left, mPadding.Top ); @@ -125,25 +125,25 @@ void UITextEdit::onAlphaChange() { } void UITextEdit::fixScroll() { - int Width = mSize.width() - mPadding.Left - mPadding.Right; - int Height = mSize.height() - mPadding.Top - mPadding.Bottom; + int Width = mSize.getWidth() - mPadding.Left - mPadding.Right; + int Height = mSize.getHeight() - mPadding.Top - mPadding.Bottom; if ( mHScrollBar->visible() ) - Height -= mHScrollBar->size().height(); + Height -= mHScrollBar->size().getHeight(); int diff; Float pos; - if ( mTextInput->size().height() - Height >= 0 ) { - diff = mTextInput->size().height() - Height; + if ( mTextInput->size().getHeight() - Height >= 0 ) { + diff = mTextInput->size().getHeight() - Height; pos = diff * mVScrollBar->value(); mTextInput->position( mTextInput->position().x, mPadding.Top - pos ); } - if ( mTextInput->size().width() - Width >= 0 ) { - diff = mTextInput->size().width() - Width; + if ( mTextInput->size().getWidth() - Width >= 0 ) { + diff = mTextInput->size().getWidth() - Width; pos = diff * mHScrollBar->value(); @@ -167,7 +167,7 @@ void UITextEdit::scrollbarsSet() { } case UI_SCROLLBAR_AUTO: { - if ( mTextInput->getTextWidth() > mSize.width() - mPadding.Left - mPadding.Right ) { + if ( mTextInput->getTextWidth() > mSize.getWidth() - mPadding.Left - mPadding.Right ) { mHScrollBar->visible( true ); mHScrollBar->enabled( true ); } else { @@ -196,9 +196,9 @@ void UITextEdit::scrollbarsSet() { int extraH = 0; if ( mHScrollBar->visible() ) - extraH = mHScrollBar->size().height(); + extraH = mHScrollBar->size().getHeight(); - if ( mTextInput->getTextHeight() > mSize.height() - mPadding.Top - mPadding.Bottom - extraH ) { + if ( mTextInput->getTextHeight() > mSize.getHeight() - mPadding.Top - mPadding.Bottom - extraH ) { mVScrollBar->visible( true ); mVScrollBar->enabled( true ); } else { @@ -210,13 +210,13 @@ void UITextEdit::scrollbarsSet() { } if ( !mVScrollBar->visible() && mHScrollBar->visible() ) { - mHScrollBar->size( mSize.width(), mHScrollBar->size().height() ); + mHScrollBar->size( mSize.getWidth(), mHScrollBar->size().getHeight() ); } else { - mHScrollBar->size( mSize.width() - mVScrollBar->size().width(), mHScrollBar->size().height() ); + mHScrollBar->size( mSize.getWidth() - mVScrollBar->size().getWidth(), mHScrollBar->size().getHeight() ); } if ( UI_SCROLLBAR_AUTO == mHScrollBarMode && mVScrollBar->visible() && !mHScrollBar->visible() ) { - if ( mTextInput->getTextWidth() > mSize.width() - mPadding.Left - mPadding.Right - mVScrollBar->size().width() ) { + if ( mTextInput->getTextWidth() > mSize.getWidth() - mPadding.Left - mPadding.Right - mVScrollBar->size().getWidth() ) { mHScrollBar->visible( true ); mHScrollBar->enabled( true ); } @@ -269,8 +269,8 @@ void UITextEdit::text( const String& Txt ) { } void UITextEdit::onInputSizeChange( const UIEvent * Event ) { - int Width = mSize.width() - mPadding.Left - mPadding.Right; - int Height = mSize.height() - mPadding.Top - mPadding.Bottom; + int Width = mSize.getWidth() - mPadding.Left - mPadding.Right; + int Height = mSize.getHeight() - mPadding.Top - mPadding.Bottom; if ( NULL != Event ) { if ( Event->getEventType() == UIEvent::EventOnPressEnter ) { @@ -281,10 +281,10 @@ void UITextEdit::onInputSizeChange( const UIEvent * Event ) { scrollbarsSet(); if ( mHScrollBar->visible() ) - Height -= mHScrollBar->size().height(); + Height -= mHScrollBar->size().getHeight(); if ( mVScrollBar->visible() ) - Width -= mVScrollBar->size().width(); + Width -= mVScrollBar->size().getWidth(); shrinkText( Width ); @@ -293,14 +293,14 @@ void UITextEdit::onInputSizeChange( const UIEvent * Event ) { mVScrollBar->enabled( false ); } - if ( mTextInput->size().width() < Width || mTextInput->size().height() < Height ) { - if ( mTextInput->size().width() < Width && mTextInput->size().height() < Height ) { + if ( mTextInput->size().getWidth() < Width || mTextInput->size().getHeight() < Height ) { + if ( mTextInput->size().getWidth() < Width && mTextInput->size().getHeight() < Height ) { mTextInput->size( Width, Height ); } else { - if ( mTextInput->size().width() < Width ) { - mTextInput->size( Width, mTextInput->size().height() ); + if ( mTextInput->size().getWidth() < Width ) { + mTextInput->size( Width, mTextInput->size().getHeight() ); } else { - mTextInput->size( mTextInput->size().width(), Height ); + mTextInput->size( mTextInput->size().getWidth(), Height ); } } } @@ -328,14 +328,14 @@ void UITextEdit::onCursorPosChange( const UIEvent * Event ) { } void UITextEdit::fixScrollToCursor() { - int Width = mSize.width() - mPadding.Left - mPadding.Right; - int Height = mSize.height() - mPadding.Top - mPadding.Bottom; + int Width = mSize.getWidth() - mPadding.Left - mPadding.Right; + int Height = mSize.getHeight() - mPadding.Top - mPadding.Bottom; if ( mVScrollBar->visible() ) - Width -= mVScrollBar->size().width(); + Width -= mVScrollBar->size().getWidth(); if ( mHScrollBar->visible() ) - Height -= mHScrollBar->size().height(); + Height -= mHScrollBar->size().getHeight(); if ( FontHAlignGet( mTextInput->flags() ) == UI_HALIGN_LEFT ) { Uint32 NLPos = 0; @@ -364,8 +364,8 @@ void UITextEdit::fixScrollToCursor() { mTextInput->position( mTextInput->position().x, mPadding.Top ); } - mHScrollBar->value( tW / mTextInput->size().width() ); - mVScrollBar->value( tH / mTextInput->size().height() ); + mHScrollBar->value( tW / mTextInput->size().getWidth() ); + mVScrollBar->value( tH / mTextInput->size().getHeight() ); mSkipValueChange = false; } diff --git a/src/eepp/ui/uitextinput.cpp b/src/eepp/ui/uitextinput.cpp index 4218954ea..7b244f993 100644 --- a/src/eepp/ui/uitextinput.cpp +++ b/src/eepp/ui/uitextinput.cpp @@ -162,8 +162,8 @@ void UITextInput::alignFix() { if ( !mTextBuffer.setSupportNewLine() ) { if ( tX < 0.f ) mAlignOffset.x = -( mAlignOffset.x + ( tW - mAlignOffset.x ) ); - else if ( tX > mSize.width() - mPadding.Left - mPadding.Right ) - mAlignOffset.x = mSize.width() - mPadding.Left - mPadding.Right - ( mAlignOffset.x + ( tW - mAlignOffset.x ) ); + else if ( tX > mSize.getWidth() - mPadding.Left - mPadding.Right ) + mAlignOffset.x = mSize.getWidth() - mPadding.Left - mPadding.Right - ( mAlignOffset.x + ( tW - mAlignOffset.x ) ); } } } @@ -177,7 +177,7 @@ void UITextInput::setTheme( UITheme * Theme ) { void UITextInput::autoSize() { if ( mFlags & UI_AUTO_SIZE ) { - size( mSize.x, getSkinSize().height() ); + size( mSize.x, getSkinSize().getHeight() ); } } diff --git a/src/eepp/ui/uitextinputpassword.cpp b/src/eepp/ui/uitextinputpassword.cpp index e2c33b796..a0cd28e30 100644 --- a/src/eepp/ui/uitextinputpassword.cpp +++ b/src/eepp/ui/uitextinputpassword.cpp @@ -33,8 +33,8 @@ void UITextInputPassword::draw() { UIManager::instance()->clipEnable( mScreenPos.x + mPadding.Left, mScreenPos.y + mPadding.Top, - mSize.width() - mPadding.Left - mPadding.Right, - mSize.height() - mPadding.Top - mPadding.Bottom + mSize.getWidth() - mPadding.Left - mPadding.Right, + mSize.getHeight() - mPadding.Top - mPadding.Bottom ); } @@ -72,8 +72,8 @@ void UITextInputPassword::alignFix() { if ( !mTextBuffer.setSupportNewLine() ) { if ( tX < 0.f ) mAlignOffset.x = -( mAlignOffset.x + ( tW - mAlignOffset.x ) ); - else if ( tX > mSize.width() - mPadding.Left - mPadding.Right ) - mAlignOffset.x = mSize.width() - mPadding.Left - mPadding.Right - ( mAlignOffset.x + ( tW - mAlignOffset.x ) ); + else if ( tX > mSize.getWidth() - mPadding.Left - mPadding.Right ) + mAlignOffset.x = mSize.getWidth() - mPadding.Left - mPadding.Right - ( mAlignOffset.x + ( tW - mAlignOffset.x ) ); } } } diff --git a/src/eepp/ui/uitooltip.cpp b/src/eepp/ui/uitooltip.cpp index a0791b71a..59bb6140b 100644 --- a/src/eepp/ui/uitooltip.cpp +++ b/src/eepp/ui/uitooltip.cpp @@ -154,14 +154,14 @@ void UITooltip::alpha( const Float& alpha ) { void UITooltip::autoSize() { if ( mFlags & UI_AUTO_SIZE ) { - mSize.width( (int)mTextCache->getTextWidth() + mPadding.Left + mPadding.Right ); - mSize.height( (int)mTextCache->getTextHeight() + mPadding.Top + mPadding.Bottom ); + mSize.setWidth( (int)mTextCache->getTextWidth() + mPadding.Left + mPadding.Right ); + mSize.setHeight( (int)mTextCache->getTextHeight() + mPadding.Top + mPadding.Bottom ); } } void UITooltip::autoAlign() { - Uint32 Width = mSize.width() - mPadding.Left - mPadding.Right; - Uint32 Height = mSize.height() - mPadding.Top - mPadding.Bottom; + Uint32 Width = mSize.getWidth() - mPadding.Left - mPadding.Right; + Uint32 Height = mSize.getHeight() - mPadding.Top - mPadding.Bottom; switch ( FontHAlignGet( flags() ) ) { case UI_HALIGN_CENTER: diff --git a/src/eepp/ui/uiwindow.cpp b/src/eepp/ui/uiwindow.cpp index 699ff67e9..6d22a8d30 100644 --- a/src/eepp/ui/uiwindow.cpp +++ b/src/eepp/ui/uiwindow.cpp @@ -173,10 +173,10 @@ bool UIWindow::isType( const Uint32& type ) const { } void UIWindow::containerPosChange( const UIEvent * Event ) { - Vector2i PosDiff = mContainer->position() - Vector2i( mBorderLeft->size().width(), mWindowDecoration->size().height() ); + Vector2i PosDiff = mContainer->position() - Vector2i( mBorderLeft->size().getWidth(), mWindowDecoration->size().getHeight() ); if ( PosDiff.x != 0 || PosDiff.y != 0 ) { - mContainer->position( mBorderLeft->size().width(), mWindowDecoration->size().height() ); + mContainer->position( mBorderLeft->size().getWidth(), mWindowDecoration->size().getHeight() ); position( mPos + PosDiff ); } @@ -264,17 +264,17 @@ void UIWindow::getMinWinSize() { Sizei tSize; - tSize.x = mBorderLeft->size().width() + mBorderRight->size().width() - mButtonsPositionFixer.x; - tSize.y = mWindowDecoration->size().height() + mBorderBottom->size().height(); + tSize.x = mBorderLeft->size().getWidth() + mBorderRight->size().getWidth() - mButtonsPositionFixer.x; + tSize.y = mWindowDecoration->size().getHeight() + mBorderBottom->size().getHeight(); if ( NULL != mButtonClose ) - tSize.x += mButtonClose->size().width(); + tSize.x += mButtonClose->size().getWidth(); if ( NULL != mButtonMaximize ) - tSize.x += mButtonMaximize->size().width(); + tSize.x += mButtonMaximize->size().getWidth(); if ( NULL != mButtonMinimize ) - tSize.x += mButtonMinimize->size().width(); + tSize.x += mButtonMinimize->size().getWidth(); if ( mMinWindowSize.x < tSize.x ) mMinWindowSize.x = tSize.x; @@ -303,8 +303,8 @@ void UIWindow::size( const Sizei& Size ) { if ( NULL != mWindowDecoration ) { Sizei size = Size; - size.x += mBorderLeft->size().width() + mBorderRight->size().width(); - size.y += mWindowDecoration->size().height() + mBorderBottom->size().height(); + size.x += mBorderLeft->size().getWidth() + mBorderRight->size().getWidth(); + size.y += mWindowDecoration->size().getHeight() + mBorderBottom->size().getHeight(); UIComplexControl::size( size ); } else { @@ -322,67 +322,67 @@ const Sizei& UIWindow::size() { void UIWindow::fixChildsSize() { if ( NULL == mWindowDecoration ) { - mContainer->size( mSize.width(), mSize.height() ); + mContainer->size( mSize.getWidth(), mSize.getHeight() ); return; } if ( mDecoAutoSize ) { - mDecoSize = Sizei( mSize.width(), mWindowDecoration->getSkinSize().height() ); + mDecoSize = Sizei( mSize.getWidth(), mWindowDecoration->getSkinSize().getHeight() ); } mWindowDecoration->size( mDecoSize ); if ( mBorderAutoSize ) { - mBorderBottom->size( mSize.width(), mBorderBottom->getSkinSize().height() ); + mBorderBottom->size( mSize.getWidth(), mBorderBottom->getSkinSize().getHeight() ); } else { - mBorderBottom->size( mSize.width(), mBorderSize.height() ); + mBorderBottom->size( mSize.getWidth(), mBorderSize.getHeight() ); } - Uint32 BorderHeight = mSize.height() - mDecoSize.height() - mBorderBottom->size().height(); + Uint32 BorderHeight = mSize.getHeight() - mDecoSize.getHeight() - mBorderBottom->size().getHeight(); if ( mBorderAutoSize ) { - mBorderLeft->size( mBorderLeft->getSkinSize().width() , BorderHeight ); - mBorderRight->size( mBorderRight->getSkinSize().width(), BorderHeight ); + mBorderLeft->size( mBorderLeft->getSkinSize().getWidth() , BorderHeight ); + mBorderRight->size( mBorderRight->getSkinSize().getWidth(), BorderHeight ); } else { - mBorderLeft->size( mBorderSize.width(), BorderHeight ); - mBorderRight->size( mBorderSize.width(), BorderHeight ); + mBorderLeft->size( mBorderSize.getWidth(), BorderHeight ); + mBorderRight->size( mBorderSize.getWidth(), BorderHeight ); } - mBorderLeft->position( 0, mWindowDecoration->size().height() ); - mBorderRight->position( mSize.width() - mBorderRight->size().width(), mWindowDecoration->size().height() ); - mBorderBottom->position( 0, mSize.height() - mBorderBottom->size().height() ); + mBorderLeft->position( 0, mWindowDecoration->size().getHeight() ); + mBorderRight->position( mSize.getWidth() - mBorderRight->size().getWidth(), mWindowDecoration->size().getHeight() ); + mBorderBottom->position( 0, mSize.getHeight() - mBorderBottom->size().getHeight() ); - mContainer->position( mBorderLeft->size().width(), mWindowDecoration->size().height() ); - mContainer->size( mSize.width() - mBorderLeft->size().width() - mBorderRight->size().width(), mSize.height() - mWindowDecoration->size().height() - mBorderBottom->size().height() ); + mContainer->position( mBorderLeft->size().getWidth(), mWindowDecoration->size().getHeight() ); + mContainer->size( mSize.getWidth() - mBorderLeft->size().getWidth() - mBorderRight->size().getWidth(), mSize.getHeight() - mWindowDecoration->size().getHeight() - mBorderBottom->size().getHeight() ); Uint32 yPos; if ( NULL != mButtonClose ) { - yPos = mWindowDecoration->size().height() / 2 - mButtonClose->size().height() / 2 + mButtonsPositionFixer.y; + yPos = mWindowDecoration->size().getHeight() / 2 - mButtonClose->size().getHeight() / 2 + mButtonsPositionFixer.y; - mButtonClose->position( mWindowDecoration->size().width() - mBorderRight->size().width() - mButtonClose->size().width() + mButtonsPositionFixer.x, yPos ); + mButtonClose->position( mWindowDecoration->size().getWidth() - mBorderRight->size().getWidth() - mButtonClose->size().getWidth() + mButtonsPositionFixer.x, yPos ); } if ( NULL != mButtonMaximize ) { - yPos = mWindowDecoration->size().height() / 2 - mButtonMaximize->size().height() / 2 + mButtonsPositionFixer.y; + yPos = mWindowDecoration->size().getHeight() / 2 - mButtonMaximize->size().getHeight() / 2 + mButtonsPositionFixer.y; if ( NULL != mButtonClose ) { - mButtonMaximize->position( mButtonClose->position().x - mButtonsSeparation - mButtonMaximize->size().width(), yPos ); + mButtonMaximize->position( mButtonClose->position().x - mButtonsSeparation - mButtonMaximize->size().getWidth(), yPos ); } else { - mButtonMaximize->position( mWindowDecoration->size().width() - mBorderRight->size().width() - mButtonMaximize->size().width() + mButtonsPositionFixer.x, yPos ); + mButtonMaximize->position( mWindowDecoration->size().getWidth() - mBorderRight->size().getWidth() - mButtonMaximize->size().getWidth() + mButtonsPositionFixer.x, yPos ); } } if ( NULL != mButtonMinimize ) { - yPos = mWindowDecoration->size().height() / 2 - mButtonMinimize->size().height() / 2 + mButtonsPositionFixer.y; + yPos = mWindowDecoration->size().getHeight() / 2 - mButtonMinimize->size().getHeight() / 2 + mButtonsPositionFixer.y; if ( NULL != mButtonMaximize ) { - mButtonMinimize->position( mButtonMaximize->position().x - mButtonsSeparation - mButtonMinimize->size().width(), yPos ); + mButtonMinimize->position( mButtonMaximize->position().x - mButtonsSeparation - mButtonMinimize->size().getWidth(), yPos ); } else { if ( NULL != mButtonClose ) { - mButtonMinimize->position( mButtonClose->position().x - mButtonsSeparation - mButtonMinimize->size().width(), yPos ); + mButtonMinimize->position( mButtonClose->position().x - mButtonsSeparation - mButtonMinimize->size().getWidth(), yPos ); } else { - mButtonMinimize->position( mWindowDecoration->size().width() - mBorderRight->size().width() - mButtonMinimize->size().width() + mButtonsPositionFixer.x, yPos ); + mButtonMinimize->position( mWindowDecoration->size().getWidth() - mBorderRight->size().getWidth() - mButtonMinimize->size().getWidth() + mButtonsPositionFixer.x, yPos ); } } } @@ -450,14 +450,14 @@ void UIWindow::decideResizeType( UIControl * Control ) { worldToControl( Pos ); if ( Control == this ) { - if ( Pos.x <= mBorderLeft->size().width() ) { + if ( Pos.x <= mBorderLeft->size().getWidth() ) { tryResize( RESIZE_TOPLEFT ); - } else if ( Pos.x >= ( mSize.width() - mBorderRight->size().width() ) ) { + } else if ( Pos.x >= ( mSize.getWidth() - mBorderRight->size().getWidth() ) ) { tryResize( RESIZE_TOPRIGHT ); - } else if ( Pos.y <= mBorderBottom->size().height() ) { + } else if ( Pos.y <= mBorderBottom->size().getHeight() ) { if ( Pos.x < mMinCornerDistance ) { tryResize( RESIZE_TOPLEFT ); - } else if ( Pos.x > mSize.width() - mMinCornerDistance ) { + } else if ( Pos.x > mSize.getWidth() - mMinCornerDistance ) { tryResize( RESIZE_TOPRIGHT ); } else { tryResize( RESIZE_TOP ); @@ -466,19 +466,19 @@ void UIWindow::decideResizeType( UIControl * Control ) { } else if ( Control == mBorderBottom ) { if ( Pos.x < mMinCornerDistance ) { tryResize( RESIZE_LEFTBOTTOM ); - } else if ( Pos.x > mSize.width() - mMinCornerDistance ) { + } else if ( Pos.x > mSize.getWidth() - mMinCornerDistance ) { tryResize( RESIZE_RIGHTBOTTOM ); } else { tryResize( RESIZE_BOTTOM ); } } else if ( Control == mBorderLeft ) { - if ( Pos.y >= mSize.height() - mMinCornerDistance ) { + if ( Pos.y >= mSize.getHeight() - mMinCornerDistance ) { tryResize( RESIZE_LEFTBOTTOM ); } else { tryResize( RESIZE_LEFT ); } } else if ( Control == mBorderRight ) { - if ( Pos.y >= mSize.height() - mMinCornerDistance ) { + if ( Pos.y >= mSize.getHeight() - mMinCornerDistance ) { tryResize( RESIZE_RIGHTBOTTOM ); } else { tryResize( RESIZE_RIGHT ); @@ -502,7 +502,7 @@ void UIWindow::tryResize( const UI_RESIZE_TYPE& Type ) { { case RESIZE_RIGHT: { - mResizePos.x = mSize.width() - Pos.x; + mResizePos.x = mSize.getWidth() - Pos.x; break; } case RESIZE_LEFT: @@ -517,19 +517,19 @@ void UIWindow::tryResize( const UI_RESIZE_TYPE& Type ) { } case RESIZE_BOTTOM: { - mResizePos.y = mSize.height() - Pos.y; + mResizePos.y = mSize.getHeight() - Pos.y; break; } case RESIZE_RIGHTBOTTOM: { - mResizePos.x = mSize.width() - Pos.x; - mResizePos.y = mSize.height() - Pos.y; + mResizePos.x = mSize.getWidth() - Pos.x; + mResizePos.y = mSize.getHeight() - Pos.y; break; } case RESIZE_LEFTBOTTOM: { mResizePos.x = Pos.x; - mResizePos.y = mSize.height() - Pos.y; + mResizePos.y = mSize.getHeight() - Pos.y; break; } case RESIZE_TOPLEFT: @@ -541,7 +541,7 @@ void UIWindow::tryResize( const UI_RESIZE_TYPE& Type ) { case RESIZE_TOPRIGHT: { mResizePos.y = Pos.y; - mResizePos.x = mSize.width() - Pos.x; + mResizePos.x = mSize.getWidth() - Pos.x; break; } case RESIZE_NONE: @@ -571,26 +571,26 @@ void UIWindow::updateResize() { switch ( mResizeType ) { case RESIZE_RIGHT: { - internalSize( Pos.x + mResizePos.x, mSize.height() ); + internalSize( Pos.x + mResizePos.x, mSize.getHeight() ); break; } case RESIZE_BOTTOM: { - internalSize( mSize.width(), Pos.y + mResizePos.y ); + internalSize( mSize.getWidth(), Pos.y + mResizePos.y ); break; } case RESIZE_LEFT: { Pos.x -= mResizePos.x; UIControl::position( mPos.x + Pos.x, mPos.y ); - internalSize( mSize.width() - Pos.x, mSize.height() ); + internalSize( mSize.getWidth() - Pos.x, mSize.getHeight() ); break; } case RESIZE_TOP: { Pos.y -= mResizePos.y; UIControl::position( mPos.x, mPos.y + Pos.y ); - internalSize( mSize.width(), mSize.height() - Pos.y ); + internalSize( mSize.getWidth(), mSize.getHeight() - Pos.y ); break; } case RESIZE_RIGHTBOTTOM: @@ -603,7 +603,7 @@ void UIWindow::updateResize() { { Pos -= mResizePos; UIControl::position( mPos.x + Pos.x, mPos.y + Pos.y ); - internalSize( mSize.width() - Pos.x, mSize.height() - Pos.y ); + internalSize( mSize.getWidth() - Pos.x, mSize.getHeight() - Pos.y ); break; } case RESIZE_TOPRIGHT: @@ -611,7 +611,7 @@ void UIWindow::updateResize() { Pos.y -= mResizePos.y; Pos.x += mResizePos.x; UIControl::position( mPos.x, mPos.y + Pos.y ); - internalSize( Pos.x, mSize.height() - Pos.y ); + internalSize( Pos.x, mSize.getHeight() - Pos.y ); break; } case RESIZE_LEFTBOTTOM: @@ -619,7 +619,7 @@ void UIWindow::updateResize() { Pos.x -= mResizePos.x; Pos.y += mResizePos.y; UIControl::position( mPos.x + Pos.x, mPos.y ); - internalSize( mSize.width() - Pos.x, Pos.y ); + internalSize( mSize.getWidth() - Pos.x, Pos.y ); break; } case RESIZE_NONE: @@ -662,23 +662,23 @@ void UIWindow::draw() { Vector2i ShadowPos = mScreenPos + Vector2i( 0, 16 ); - P.drawRectangle( Rectf( Vector2f( ShadowPos.x, ShadowPos.y ), Sizef( mSize.width(), mSize.height() ) ), BeginC, BeginC, BeginC, BeginC ); + P.drawRectangle( Rectf( Vector2f( ShadowPos.x, ShadowPos.y ), Sizef( mSize.getWidth(), mSize.getHeight() ) ), BeginC, BeginC, BeginC, BeginC ); - P.drawRectangle( Rectf( Vector2f( ShadowPos.x, ShadowPos.y - SSize ), Sizef( mSize.width(), SSize ) ), EndC, BeginC, BeginC, EndC ); + P.drawRectangle( Rectf( Vector2f( ShadowPos.x, ShadowPos.y - SSize ), Sizef( mSize.getWidth(), SSize ) ), EndC, BeginC, BeginC, EndC ); - P.drawRectangle( Rectf( Vector2f( ShadowPos.x - SSize, ShadowPos.y ), Sizef( SSize, mSize.height() ) ), EndC, EndC, BeginC, BeginC ); + P.drawRectangle( Rectf( Vector2f( ShadowPos.x - SSize, ShadowPos.y ), Sizef( SSize, mSize.getHeight() ) ), EndC, EndC, BeginC, BeginC ); - P.drawRectangle( Rectf( Vector2f( ShadowPos.x + mSize.width(), ShadowPos.y ), Sizef( SSize, mSize.height() ) ), BeginC, BeginC, EndC, EndC ); + P.drawRectangle( Rectf( Vector2f( ShadowPos.x + mSize.getWidth(), ShadowPos.y ), Sizef( SSize, mSize.getHeight() ) ), BeginC, BeginC, EndC, EndC ); - P.drawRectangle( Rectf( Vector2f( ShadowPos.x, ShadowPos.y + mSize.height() ), Sizef( mSize.width(), SSize ) ), BeginC, EndC, EndC, BeginC ); + P.drawRectangle( Rectf( Vector2f( ShadowPos.x, ShadowPos.y + mSize.getHeight() ), Sizef( mSize.getWidth(), SSize ) ), BeginC, EndC, EndC, BeginC ); - P.drawTriangle( Triangle2f( Vector2f( ShadowPos.x + mSize.width(), ShadowPos.y ), Vector2f( ShadowPos.x + mSize.width(), ShadowPos.y - SSize ), Vector2f( ShadowPos.x + mSize.width() + SSize, ShadowPos.y ) ), BeginC, EndC, EndC ); + P.drawTriangle( Triangle2f( Vector2f( ShadowPos.x + mSize.getWidth(), ShadowPos.y ), Vector2f( ShadowPos.x + mSize.getWidth(), ShadowPos.y - SSize ), Vector2f( ShadowPos.x + mSize.getWidth() + SSize, ShadowPos.y ) ), BeginC, EndC, EndC ); P.drawTriangle( Triangle2f( Vector2f( ShadowPos.x, ShadowPos.y ), Vector2f( ShadowPos.x, ShadowPos.y - SSize ), Vector2f( ShadowPos.x - SSize, ShadowPos.y ) ), BeginC, EndC, EndC ); - P.drawTriangle( Triangle2f( Vector2f( ShadowPos.x + mSize.width(), ShadowPos.y + mSize.height() ), Vector2f( ShadowPos.x + mSize.width(), ShadowPos.y + mSize.height() + SSize ), Vector2f( ShadowPos.x + mSize.width() + SSize, ShadowPos.y + mSize.height() ) ), BeginC, EndC, EndC ); + P.drawTriangle( Triangle2f( Vector2f( ShadowPos.x + mSize.getWidth(), ShadowPos.y + mSize.getHeight() ), Vector2f( ShadowPos.x + mSize.getWidth(), ShadowPos.y + mSize.getHeight() + SSize ), Vector2f( ShadowPos.x + mSize.getWidth() + SSize, ShadowPos.y + mSize.getHeight() ) ), BeginC, EndC, EndC ); - P.drawTriangle( Triangle2f( Vector2f( ShadowPos.x, ShadowPos.y + mSize.height() ), Vector2f( ShadowPos.x - SSize, ShadowPos.y + mSize.height() ), Vector2f( ShadowPos.x, ShadowPos.y + mSize.height() + SSize ) ), BeginC, EndC, EndC ); + P.drawTriangle( Triangle2f( Vector2f( ShadowPos.x, ShadowPos.y + mSize.getHeight() ), Vector2f( ShadowPos.x - SSize, ShadowPos.y + mSize.getHeight() ), Vector2f( ShadowPos.x, ShadowPos.y + mSize.getHeight() + SSize ) ), BeginC, EndC, EndC ); P.forceDraw( true ); } @@ -810,8 +810,8 @@ void UIWindow::title( const String& Text ) { void UIWindow::fixTitleSize() { if ( NULL != mWindowDecoration && NULL != mTitle ) { - mTitle->size( mWindowDecoration->size().width() - mBorderLeft->size().width() - mBorderRight->size().width(), mWindowDecoration->size().height() ); - mTitle->position( mBorderLeft->size().width(), 0 ); + mTitle->size( mWindowDecoration->size().getWidth() - mBorderLeft->size().getWidth() - mBorderRight->size().getWidth(), mWindowDecoration->size().getHeight() ); + mTitle->position( mBorderLeft->size().getWidth(), 0 ); } } @@ -922,14 +922,14 @@ void UIWindow::resizeCursor() { const UIControl * Control = Man->overControl(); if ( Control == this ) { - if ( Pos.x <= mBorderLeft->size().width() ) { + if ( Pos.x <= mBorderLeft->size().getWidth() ) { Man->setCursor( EE_CURSOR_SIZENWSE ); // RESIZE_TOPLEFT - } else if ( Pos.x >= ( mSize.width() - mBorderRight->size().width() ) ) { + } else if ( Pos.x >= ( mSize.getWidth() - mBorderRight->size().getWidth() ) ) { Man->setCursor( EE_CURSOR_SIZENESW ); // RESIZE_TOPRIGHT - } else if ( Pos.y <= mBorderBottom->size().height() ) { + } else if ( Pos.y <= mBorderBottom->size().getHeight() ) { if ( Pos.x < mMinCornerDistance ) { Man->setCursor( EE_CURSOR_SIZENWSE ); // RESIZE_TOPLEFT - } else if ( Pos.x > mSize.width() - mMinCornerDistance ) { + } else if ( Pos.x > mSize.getWidth() - mMinCornerDistance ) { Man->setCursor( EE_CURSOR_SIZENESW ); // RESIZE_TOPRIGHT } else { Man->setCursor( EE_CURSOR_SIZENS ); // RESIZE_TOP @@ -940,19 +940,19 @@ void UIWindow::resizeCursor() { } else if ( Control == mBorderBottom ) { if ( Pos.x < mMinCornerDistance ) { Man->setCursor( EE_CURSOR_SIZENESW ); // RESIZE_LEFTBOTTOM - } else if ( Pos.x > mSize.width() - mMinCornerDistance ) { + } else if ( Pos.x > mSize.getWidth() - mMinCornerDistance ) { Man->setCursor( EE_CURSOR_SIZENWSE ); // RESIZE_RIGHTBOTTOM } else { Man->setCursor( EE_CURSOR_SIZENS ); // RESIZE_BOTTOM } } else if ( Control == mBorderLeft ) { - if ( Pos.y >= mSize.height() - mMinCornerDistance ) { + if ( Pos.y >= mSize.getHeight() - mMinCornerDistance ) { Man->setCursor( EE_CURSOR_SIZENESW ); // RESIZE_LEFTBOTTOM } else { Man->setCursor( EE_CURSOR_SIZEWE ); // RESIZE_LEFT } } else if ( Control == mBorderRight ) { - if ( Pos.y >= mSize.height() - mMinCornerDistance ) { + if ( Pos.y >= mSize.getHeight() - mMinCornerDistance ) { Man->setCursor( EE_CURSOR_SIZENWSE ); // RESIZE_RIGHTBOTTOM } else { Man->setCursor( EE_CURSOR_SIZEWE ); // RESIZE_RIGHT diff --git a/src/eepp/ui/uiwinmenu.cpp b/src/eepp/ui/uiwinmenu.cpp index 66709a4c4..b879be5c3 100644 --- a/src/eepp/ui/uiwinmenu.cpp +++ b/src/eepp/ui/uiwinmenu.cpp @@ -20,7 +20,7 @@ UIWinMenu::UIWinMenu( const UIWinMenu::CreateParams& Params ) : if ( !(mFlags & UI_ANCHOR_RIGHT) ) mFlags |= UI_ANCHOR_RIGHT; - size( parent()->size().width(), mMenuHeight ); + size( parent()->size().getWidth(), mMenuHeight ); updateAnchorsDistances(); @@ -78,9 +78,9 @@ void UIWinMenu::setTheme( UITheme * Theme ) { } if ( 0 == mMenuHeight && NULL != getSkin() && NULL != getSkin()->getSubTexture( UISkinState::StateNormal ) ) { - mMenuHeight = getSkin()->getSubTexture( UISkinState::StateNormal )->size().height(); + mMenuHeight = getSkin()->getSubTexture( UISkinState::StateNormal )->size().getHeight(); - size( parent()->size().width(), mMenuHeight ); + size( parent()->size().getWidth(), mMenuHeight ); updateAnchorsDistances(); } @@ -126,7 +126,7 @@ void UIWinMenu::refreshButtons() { SubTexture * subTexture = getSkin()->getSubTexture( UISkinState::StateNormal ); if ( NULL != subTexture ) { - h = subTexture->size().height(); + h = subTexture->size().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().height(); + th = tSubTexture2->size().getHeight(); switch ( VAlignGet( flags() ) ) { case UI_VALIGN_CENTER: @@ -158,10 +158,10 @@ void UIWinMenu::refreshButtons() { UISelectButton * pbut = it->first; UITextBox * tbox = pbut->getTextBox(); - pbut->size( tbox->getTextWidth() + mButtonMargin, size().height() ); + pbut->size( tbox->getTextWidth() + mButtonMargin, size().getHeight() ); pbut->position( xpos, ycenter ); - xpos += pbut->size().width() + mMarginBetweenButtons; + xpos += pbut->size().getWidth() + mMarginBetweenButtons; } } @@ -174,7 +174,7 @@ Uint32 UIWinMenu::onMessage( const UIMessage * Msg ) { UISelectButton * tbut = reinterpret_cast ( Msg->getSender() ); UIPopUpMenu * tpop = getMenuFromButton( tbut ); - Vector2i pos( tbut->position().x, tbut->position().y + tbut->size().height() ); + Vector2i pos( tbut->position().x, tbut->position().y + tbut->size().getHeight() ); tpop->position( pos ); if ( Msg->getMsg() == UIMessage::MsgMouseEnter ) { diff --git a/src/eepp/window/backend/SDL2/windowsdl2.cpp b/src/eepp/window/backend/SDL2/windowsdl2.cpp index 3c1fc8eb3..aed890470 100644 --- a/src/eepp/window/backend/SDL2/windowsdl2.cpp +++ b/src/eepp/window/backend/SDL2/windowsdl2.cpp @@ -122,8 +122,8 @@ bool WindowSDL::create( WindowSettings Settings, ContextSettings Context ) { #endif if ( mWindow.WindowConfig.Style & WindowStyle::UseDesktopResolution ) { - mWindow.WindowConfig.Width = mWindow.DesktopResolution.width(); - mWindow.WindowConfig.Height = mWindow.DesktopResolution.height(); + mWindow.WindowConfig.Width = mWindow.DesktopResolution.getWidth(); + mWindow.WindowConfig.Height = mWindow.DesktopResolution.getHeight(); } mWindow.Flags = SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN; @@ -340,7 +340,7 @@ void WindowSDL::toggleFullscreen() { if ( isWindowed() ) { setSize( mWindow.WindowConfig.Width, mWindow.WindowConfig.Height, !isWindowed() ); } else { - setSize( mWindow.WindowSize.width(), mWindow.WindowSize.height(), !isWindowed() ); + setSize( mWindow.WindowSize.getWidth(), mWindow.WindowSize.getHeight(), !isWindowed() ); } if ( WasMaximized ) { @@ -374,8 +374,8 @@ bool WindowSDL::isVisible() { void WindowSDL::setSize( Uint32 Width, Uint32 Height, bool Windowed ) { if ( ( !Width || !Height ) ) { - Width = mWindow.DesktopResolution.width(); - Height = mWindow.DesktopResolution.height(); + Width = mWindow.DesktopResolution.getWidth(); + Height = mWindow.DesktopResolution.getHeight(); } if ( this->isWindowed() == Windowed && Width == mWindow.WindowConfig.Width && Height == mWindow.WindowConfig.Height ) @@ -611,8 +611,8 @@ void WindowSDL::setTextInputRect( Recti& rect ) { r.x = rect.Left; r.y = rect.Top; - r.w = rect.size().width(); - r.h = rect.size().height(); + r.w = rect.getSize().getWidth(); + r.h = rect.getSize().getHeight(); SDL_SetTextInputRect( &r ); diff --git a/src/eepp/window/backend/SFML/windowsfml.cpp b/src/eepp/window/backend/SFML/windowsfml.cpp index f58ac1571..e8dcfe44a 100644 --- a/src/eepp/window/backend/SFML/windowsfml.cpp +++ b/src/eepp/window/backend/SFML/windowsfml.cpp @@ -167,8 +167,8 @@ Vector2i WindowSFML::getPosition() { void WindowSFML::setSize( Uint32 Width, Uint32 Height, bool Windowed ) { if ( ( !Width || !Height ) ) { - Width = mWindow.DesktopResolution.width(); - Height = mWindow.DesktopResolution.height(); + Width = mWindow.DesktopResolution.getWidth(); + Height = mWindow.DesktopResolution.getHeight(); } if ( this->isWindowed() == Windowed && Width == mWindow.WindowConfig.Width && Height == mWindow.WindowConfig.Height ) diff --git a/src/eepp/window/window.cpp b/src/eepp/window/window.cpp index 2cbebe8d1..fa5929767 100644 --- a/src/eepp/window/window.cpp +++ b/src/eepp/window/window.cpp @@ -489,7 +489,7 @@ void Window::setCurrent() { void Window::centerToScreen() { if ( isWindowed() ) { - setPosition( mWindow.DesktopResolution.width() / 2 - mWindow.WindowConfig.Width / 2, mWindow.DesktopResolution.height() / 2 - mWindow.WindowConfig.Height / 2 ); + setPosition( mWindow.DesktopResolution.getWidth() / 2 - mWindow.WindowConfig.Width / 2, mWindow.DesktopResolution.getHeight() / 2 - mWindow.WindowConfig.Height / 2 ); } } diff --git a/src/examples/external_shader/external_shader.cpp b/src/examples/external_shader/external_shader.cpp index bf09802fb..df8abe6f0 100644 --- a/src/examples/external_shader/external_shader.cpp +++ b/src/examples/external_shader/external_shader.cpp @@ -105,7 +105,7 @@ void MainLoop() if ( imp->isKeyUp( KEY_F ) ) { if ( win->isWindowed() ) { - win->setSize( win->getDesktopResolution().width(), win->getDesktopResolution().height(), false ); + win->setSize( win->getDesktopResolution().getWidth(), win->getDesktopResolution().getHeight(), false ); } else { win->setSize( 960, 640, true ); win->centerToScreen(); diff --git a/src/examples/sprites/sprites.cpp b/src/examples/sprites/sprites.cpp index 85d93665a..cce356f5b 100644 --- a/src/examples/sprites/sprites.cpp +++ b/src/examples/sprites/sprites.cpp @@ -29,7 +29,7 @@ void spriteCallback( Uint32 Event, Sprite * Sprite, void * UserData ) { RotationInterpolation->addWaypoint( Sprite->angle() ); RotationInterpolation->addWaypoint( Sprite->angle() + 45.f ); RotationInterpolation->setTotalTime( Milliseconds( 500 ) ); - RotationInterpolation->type( Ease::BounceOut ); // Set the easing effect used for the interpolation + RotationInterpolation->setType( Ease::BounceOut ); // Set the easing effect used for the interpolation RotationInterpolation->start(); // Scale the sprite @@ -142,17 +142,17 @@ EE_MAIN_FUNC int main (int argc, char * argv []) // Set the sprites position to the screen center Vector2i ScreenCenter( Engine::instance()->getWidth() / 2, Engine::instance()->getHeight() / 2 ); - Planet->position( ScreenCenter.x - Planet->getAABB().size().width() / 2, ScreenCenter.y - Planet->getAABB().size().height() / 2 ); + Planet->position( ScreenCenter.x - Planet->getAABB().getSize().getWidth() / 2, ScreenCenter.y - Planet->getAABB().getSize().getHeight() / 2 ); - Rock->position( ScreenCenter.x - Rock->getAABB().size().width() / 2, ScreenCenter.y - Rock->getAABB().size().height() / 2 ); + Rock->position( ScreenCenter.x - Rock->getAABB().getSize().getWidth() / 2, ScreenCenter.y - Rock->getAABB().getSize().getHeight() / 2 ); - Blindy->position( ScreenCenter.x - Blindy->getAABB().size().width() / 2, ScreenCenter.y - Blindy->getAABB().size().height() / 2 ); + Blindy->position( ScreenCenter.x - Blindy->getAABB().getSize().getWidth() / 2, ScreenCenter.y - Blindy->getAABB().getSize().getHeight() / 2 ); // Set the planet angle interpolation PlanetAngle.addWaypoint( 0 ); PlanetAngle.addWaypoint( 360 ); PlanetAngle.setTotalTime( Seconds( 10 ) ); - PlanetAngle.loop( true ); + PlanetAngle.setLoop( true ); PlanetAngle.start(); // Create a Event callback for the rock sprite diff --git a/src/examples/vbo_fbo_batch/vbo_fbo_batch.cpp b/src/examples/vbo_fbo_batch/vbo_fbo_batch.cpp index bb950270e..a2dffdb65 100644 --- a/src/examples/vbo_fbo_batch/vbo_fbo_batch.cpp +++ b/src/examples/vbo_fbo_batch/vbo_fbo_batch.cpp @@ -129,14 +129,14 @@ EE_MAIN_FUNC int main (int argc, char * argv []) // Add the vertex and vertex colors to the Vertex Buffer if ( NULL != VBO && NULL != VBO2 ) { - for ( Uint32 i = 0; i < Poly.size(); i++ ) { + for ( Uint32 i = 0; i < Poly.getSize(); i++ ) { VBO->addVertex( Poly[i] ); VBO->addColor( ColorA( 100 + i, 255 - i, 150 + i, 100 ) ); } - Poly.rotate( 90, Poly.toAABB().center() ); + Poly.rotate( 90, Poly.toAABB().getCenter() ); - for ( Uint32 i = 0; i < Poly.size(); i++ ) { + for ( Uint32 i = 0; i < Poly.getSize(); i++ ) { VBO2->addVertex( Poly[i] ); VBO2->addColor( ColorA( 100 + i, 255 - i, 150 + i, 100 ) ); } diff --git a/src/test/eetest.cpp b/src/test/eetest.cpp index fd041ca74..6c2e343b8 100644 --- a/src/test/eetest.cpp +++ b/src/test/eetest.cpp @@ -99,7 +99,7 @@ void EETest::Init() { } } - WP.type( Ease::QuarticInOut ); + WP.setType( Ease::QuarticInOut ); WP.addWaypoint( Vector2f(0,0), 100 ); WP.addWaypoint( Vector2f(800,0), 100 ); WP.addWaypoint( Vector2f(0,0), 100 ); @@ -107,7 +107,7 @@ void EETest::Init() { WP.addWaypoint( Vector2f(0,600), 100 ); WP.editWaypoint( 2, Vector2f(800,600), 100 ); WP.eraseWaypoint( 3 ); - WP.loop(true); + WP.setLoop(true); WP.setTotalTime( Milliseconds( 5000 ) ); WP.start(); @@ -124,7 +124,7 @@ void EETest::Init() { mVBO = VertexBuffer::New( VERTEX_FLAGS_PRIMITIVE, DM_TRIANGLE_FAN ); if ( NULL != mVBO ) { - for ( Uint32 i = 0; i < Poly.size(); i++ ) { + for ( Uint32 i = 0; i < Poly.getSize(); i++ ) { mVBO->addVertex( Poly[i] ); mVBO->addColor( ColorA( 100 + i, 255 - i, 150 + i, 200 ) ); } @@ -291,7 +291,7 @@ void EETest::CreateUI() { Child->visible( true ); Child->enabled( true ); Child->startRotation( 0.f, 360.f, Milliseconds( 5000.f ) ); - Child->rotationInterpolation()->loop( true ); + Child->rotationInterpolation()->setLoop( true ); Params.Background.colors( ColorA( 0xFFFF0077 ), ColorA( 0xCCCC0077 ), ColorA( 0xCCCC0077 ), ColorA( 0xFFFF0077 ) ); Params.setParent( Child ); @@ -301,7 +301,7 @@ void EETest::CreateUI() { Child2->visible( true ); Child2->enabled( true ); Child2->startRotation( 0.f, 360.f, Milliseconds( 5000.f ) ); - Child2->rotationInterpolation()->loop( true ); + Child2->rotationInterpolation()->setLoop( true ); mTheme->createSprite( eeNew( Sprite, ( "gn" ) ), C, Sizei(), Vector2i( 160, 100 ) ); @@ -1339,7 +1339,7 @@ void EETest::Input() { if ( KM->isAltPressed() && KM->isKeyUp( KEY_RETURN ) ) { if ( mWindow->isWindowed() ) { - mWindow->setSize( mWindow->getDesktopResolution().width(), mWindow->getDesktopResolution().height(), false ); + mWindow->setSize( mWindow->getDesktopResolution().getWidth(), mWindow->getDesktopResolution().getHeight(), false ); } else { mWindow->toggleFullscreen(); }