From 35955a80bdf14b7349ef21a61c07cb4e62e96e7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=AD=C2=ADn=20Lucas=20Golini?= Date: Tue, 14 Feb 2017 23:23:24 -0300 Subject: [PATCH] Math module refactored. --HG-- branch : dev --- include/eepp/math/easing.hpp | 68 ++++---- include/eepp/math/interpolation.hpp | 54 +++--- include/eepp/math/line2.hpp | 14 +- include/eepp/math/math.hpp | 18 +- include/eepp/math/mtrand.hpp | 34 ++-- include/eepp/math/perlinnoise.hpp | 36 ++-- include/eepp/math/polygon2.hpp | 156 +++++++++--------- include/eepp/math/quad2.hpp | 70 ++++---- include/eepp/math/rect.hpp | 102 ++++++------ include/eepp/math/size.hpp | 20 +-- include/eepp/math/triangle2.hpp | 2 +- include/eepp/math/vector2.hpp | 104 ++++++------ include/eepp/math/waypoints.hpp | 50 +++--- include/eepp/ui/uiitemcontainer.hpp | 2 +- src/eepp/gaming/gameobjectobject.cpp | 28 ++-- src/eepp/gaming/gameobjectpolygon.cpp | 10 +- src/eepp/gaming/mapeditor/mapeditor.cpp | 100 +++++------ .../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 | 24 +-- src/eepp/gaming/mapeditor/uimaplayernew.cpp | 4 +- src/eepp/gaming/mapeditor/uimapnew.cpp | 56 +++---- src/eepp/gaming/maplight.cpp | 4 +- src/eepp/gaming/maplightmanager.cpp | 28 ++-- src/eepp/gaming/objectlayer.cpp | 6 +- src/eepp/gaming/tilemap.cpp | 36 ++-- src/eepp/gaming/tilemaplayer.cpp | 8 +- src/eepp/graphics/batchrenderer.cpp | 14 +- src/eepp/graphics/image.cpp | 2 +- src/eepp/graphics/particlesystem.cpp | 76 ++++----- src/eepp/graphics/primitives.cpp | 36 ++-- src/eepp/graphics/scrollparallax.cpp | 34 ++-- src/eepp/graphics/sprite.cpp | 12 +- src/eepp/graphics/subtexture.cpp | 16 +- src/eepp/graphics/texture.cpp | 18 +- src/eepp/graphics/texturefactory.cpp | 2 +- src/eepp/graphics/texturepacker.cpp | 8 +- src/eepp/graphics/texturepackernode.cpp | 2 +- src/eepp/graphics/ttffont.cpp | 2 +- src/eepp/math/easing.cpp | 62 +++---- src/eepp/math/interpolation.cpp | 56 +++---- src/eepp/math/mtrand.cpp | 68 ++++---- src/eepp/math/perlinnoise.cpp | 36 ++-- src/eepp/math/waypoints.cpp | 76 ++++----- 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 | 52 +++--- src/eepp/ui/uicontrolanim.cpp | 96 +++++------ src/eepp/ui/uidropdownlist.cpp | 18 +- src/eepp/ui/uigenericgrid.cpp | 50 +++--- src/eepp/ui/uigfx.cpp | 8 +- src/eepp/ui/uilistbox.cpp | 56 +++---- src/eepp/ui/uimenu.cpp | 78 ++++----- src/eepp/ui/uimenusubmenu.cpp | 4 +- src/eepp/ui/uimessagebox.cpp | 26 +-- src/eepp/ui/uiprogressbar.cpp | 22 +-- src/eepp/ui/uipushbutton.cpp | 16 +- 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/window.cpp | 2 +- .../external_shader/external_shader.cpp | 10 +- src/examples/physics/physics.cpp | 6 +- src/examples/sprites/sprites.cpp | 36 ++-- src/examples/vbo_fbo_batch/vbo_fbo_batch.cpp | 10 +- src/test/eetest.cpp | 66 ++++---- 87 files changed, 1372 insertions(+), 1372 deletions(-) diff --git a/include/eepp/math/easing.hpp b/include/eepp/math/easing.hpp index 5e0d25b54..673a104ed 100644 --- a/include/eepp/math/easing.hpp +++ b/include/eepp/math/easing.hpp @@ -19,7 +19,7 @@ extern EE_API easingCbFunc easingCb[]; * @param d Specifies the duration of the motion. * @return The value of the interpolated property at the specified time. */ -inline double LinearInterpolation( double t, double b, double c, double d ) { +inline double linearInterpolation( double t, double b, double c, double d ) { return b + t * c / d; } @@ -32,7 +32,7 @@ inline double LinearInterpolation( double t, double b, double c, double d ) { * @param d Specifies the duration of the motion. * @return The value of the interpolated property at the specified time. */ -inline double QuadraticIn( double t, double b, double c, double d ) { +inline double quadraticIn( double t, double b, double c, double d ) { t /= d; return c * t * t + b; @@ -48,7 +48,7 @@ inline double QuadraticIn( double t, double b, double c, double d ) { * @param d Specifies the duration of the motion. * @return The value of the interpolated property at the specified time. */ -inline double QuadraticOut( double t, double b, double c, double d ) { +inline double quadraticOut( double t, double b, double c, double d ) { t /= d; return -c * t * ( t - 2 ) + b; @@ -66,7 +66,7 @@ inline double QuadraticOut( double t, double b, double c, double d ) { * @param d Specifies the duration of the motion. * @return The value of the interpolated property at the specified time. */ -inline double QuadraticInOut( double t, double b, double c, double d ) { +inline double quadraticInOut( double t, double b, double c, double d ) { t /= d / 2; if ( t < 1 ) @@ -87,7 +87,7 @@ inline double QuadraticInOut( double t, double b, double c, double d ) { * @param d Specifies the duration of the motion. * @return The value of the interpolated property at the specified time. */ -inline double SineIn( double t, double b, double c, double d ) { +inline double sineIn( double t, double b, double c, double d ) { return -c * eecos( t / d * ( EE_PI / 2 ) ) + c + b; } @@ -101,7 +101,7 @@ inline double SineIn( double t, double b, double c, double d ) { * @param d Specifies the duration of the motion. * @return The value of the interpolated property at the specified time. */ -inline double SineOut( double t, double b, double c, double d ) { +inline double sineOut( double t, double b, double c, double d ) { return c * eesin( t / d * ( EE_PI / 2 ) ) + b; } @@ -117,7 +117,7 @@ inline double SineOut( double t, double b, double c, double d ) { * @param d Specifies the duration of the motion. * @return The value of the interpolated property at the specified time. */ -inline double SineInOut( double t, double b, double c, double d ) { +inline double sineInOut( double t, double b, double c, double d ) { return -c / 2 * ( eecos( EE_PI * t / d ) - 1 ) + b; } @@ -131,7 +131,7 @@ inline double SineInOut( double t, double b, double c, double d ) { * @param d Specifies the duration of the effect, in milliseconds. * @return Number corresponding to the position of the component. */ -inline double ExponentialIn( double t, double b, double c, double d ) { +inline double exponentialIn( double t, double b, double c, double d ) { return t == 0 ? b : c * eepow( 2, 10 * ( t / d - 1 ) ) + b; } @@ -145,7 +145,7 @@ inline double ExponentialIn( double t, double b, double c, double d ) { * @param d Specifies the duration of the motion. * @return The value of the interpolated property at the specified time. */ -inline double ExponentialOut( double t, double b, double c, double d ) { +inline double exponentialOut( double t, double b, double c, double d ) { return t == d ? b + c : c * ( -eepow( 2, -10 * t / d ) + 1 ) + b; } @@ -161,7 +161,7 @@ inline double ExponentialOut( double t, double b, double c, double d ) { * @param d Specifies the duration of the motion. * @return The value of the interpolated property at the specified time. */ -inline double ExponentialInOut( double t, double b, double c, double d ) { +inline double exponentialInOut( double t, double b, double c, double d ) { if (t == 0) return b; @@ -174,19 +174,19 @@ inline double ExponentialInOut( double t, double b, double c, double d ) { return c / 2 * ( -eepow( 2, -10 * --t ) + 2 ) + b; } -inline double QuarticIn( double t, double b, double c, double d ) { +inline double quarticIn( double t, double b, double c, double d ) { t /= d; return c * t * t * t * t + b; } -inline double QuarticOut( double t, double b, double c, double d ) { +inline double quarticOut( double t, double b, double c, double d ) { t = t / d - 1; return -c * ( t * t * t * t - 1 ) + b; } -inline double QuarticInOut( double t, double b, double c, double d ) { +inline double quarticInOut( double t, double b, double c, double d ) { t /= d / 2; if ( t < 1) @@ -197,19 +197,19 @@ inline double QuarticInOut( double t, double b, double c, double d ) { return -c / 2 * ( t * t * t * t - 2 ) + b; } -inline double QuinticIn( double t, double b, double c, double d ) { +inline double quinticIn( double t, double b, double c, double d ) { t /= d; return c * t * t * t * t * t + b; } -inline double QuinticOut( double t, double b, double c, double d ) { +inline double quinticOut( double t, double b, double c, double d ) { t = t / d - 1; return c * ( t * t * t * t * t + 1) + b; } -inline double QuinticInOut( double t, double b, double c, double d ) { +inline double quinticInOut( double t, double b, double c, double d ) { t /= d / 2; if ( t < 1 ) @@ -220,19 +220,19 @@ inline double QuinticInOut( double t, double b, double c, double d ) { return c / 2 * ( t * t * t * t * t + 2) + b; } -inline double CircularIn( double t, double b, double c, double d ) { +inline double circularIn( double t, double b, double c, double d ) { t /= d; return -c * ( eesqrt( 1 - t * t ) - 1) + b; } -inline double CircularOut( double t, double b, double c, double d ) { +inline double circularOut( double t, double b, double c, double d ) { t = t / d - 1; return c * eesqrt( 1 - t * t ) + b; } -inline double CircularInOut( double t, double b, double c, double d ) { +inline double circularInOut( double t, double b, double c, double d ) { t /= d / 2; if ( t < 1 ) @@ -243,19 +243,19 @@ inline double CircularInOut( double t, double b, double c, double d ) { return c / 2 * ( eesqrt( 1 - t * t ) + 1) + b; } -inline double CubicIn( double t, double b, double c, double d ) { +inline double cubicIn( double t, double b, double c, double d ) { t /= d; return c * t * t * t + b; } -inline double CubicOut( double t, double b, double c, double d ) { +inline double cubicOut( double t, double b, double c, double d ) { t = t / d - 1; return c * ( t * t * t + 1) + b; } -inline double CubicInOut( double t, double b, double c, double d ) { +inline double cubicInOut( double t, double b, double c, double d ) { t /= d / 2; if ( t < 1 ) @@ -266,7 +266,7 @@ inline double CubicInOut( double t, double b, double c, double d ) { return c / 2 * ( t * t * t + 2 ) + b; } -inline double BackIn( double t, double b, double c, double d ) { +inline double backIn( double t, double b, double c, double d ) { double s = 1.70158f; t /= d; @@ -274,7 +274,7 @@ inline double BackIn( double t, double b, double c, double d ) { return c * t * t * ( ( s + 1 ) * t - s) + b; } -inline double BackOut( double t, double b, double c, double d ) { +inline double backOut( double t, double b, double c, double d ) { double s = 1.70158f; t = t / d - 1; @@ -282,7 +282,7 @@ inline double BackOut( double t, double b, double c, double d ) { return c * ( t * t * ( ( s + 1 ) * t + s ) + 1 ) + b; } -inline double BackInOut( double t, double b, double c, double d ) { +inline double backInOut( double t, double b, double c, double d ) { float s = 1.70158f; t /= d / 2; @@ -296,7 +296,7 @@ inline double BackInOut( double t, double b, double c, double d ) { return c / 2 * ( t * t * ( ( s + 1 ) * t + s ) + 2) + b; } -inline double BounceOut( double t, double b, double c, double d ) { +inline double bounceOut( double t, double b, double c, double d ) { t /= d; if ( t < ( 1.f / 2.75f ) ) { @@ -316,18 +316,18 @@ inline double BounceOut( double t, double b, double c, double d ) { } } -inline double BounceIn( double t, double b, double c, double d ) { - return c - BounceOut( d - t, 0, c, d ) + b; +inline double bounceIn( double t, double b, double c, double d ) { + return c - bounceOut( d - t, 0, c, d ) + b; } -inline double BounceInOut( double t, double b, double c, double d ) { +inline double bounceInOut( double t, double b, double c, double d ) { if ( t < d * 0.5f ) - return BounceIn( t * 2.f, 0.f, c, d ) * 0.5f + b; + return bounceIn( t * 2.f, 0.f, c, d ) * 0.5f + b; - return BounceOut( t * 2.f - d, 0.f, c, d ) * 0.5f + c * 0.5f + b; + return bounceOut( t * 2.f - d, 0.f, c, d ) * 0.5f + c * 0.5f + b; } -inline double ElasticIn( double t, double b, double c, double d ) { +inline double elasticIn( double t, double b, double c, double d ) { if ( t == 0.f ) return b; @@ -345,7 +345,7 @@ inline double ElasticIn( double t, double b, double c, double d ) { return -( a * eepow( 2.f , 10.f * t ) * eesin( ( t * d - s ) * ( 2.f * EE_PI ) / p ) ) + b; } -inline double ElasticOut( double t, double b, double c, double d ) { +inline double elasticOut( double t, double b, double c, double d ) { if ( t == 0.f ) return b; @@ -361,7 +361,7 @@ inline double ElasticOut( double t, double b, double c, double d ) { return ( a * eepow( 2.f, -10.f * t ) * eesin( ( t * d - s ) * ( 2.f * EE_PI ) / p ) + c + b ); } -inline double ElasticInOut( double t, double b, double c, double d ) { +inline double elasticInOut( double t, double b, double c, double d ) { if ( t == 0 ) return b; diff --git a/include/eepp/math/interpolation.hpp b/include/eepp/math/interpolation.hpp index 6ef649a0d..7109991b1 100644 --- a/include/eepp/math/interpolation.hpp +++ b/include/eepp/math/interpolation.hpp @@ -32,84 +32,84 @@ class EE_API Interpolation { typedef cb::Callback0 OnStepCallback; /** Add a new point */ - void AddWaypoint( const Float Pos, const Float Time = 0 ); + void addWaypoint( const Float Pos, const Float Time = 0 ); /** Edit a point */ - bool EditWaypoint( const unsigned int& PointNum, const Float& NewPos, const Float NewTime = 0 ); + bool editWaypoint( const unsigned int& PointNum, const Float& NewPos, const Float NewTime = 0 ); /** Erase a point */ - bool EraseWaypoint( const unsigned int& PointNum ); + bool eraseWaypoint( const unsigned int& PointNum ); /** Start the animation */ - void Start( OnPathEndCallback PathEndCallback = OnPathEndCallback(), OnStepCallback StepCallback = OnStepCallback() ); + void start( OnPathEndCallback PathEndCallback = OnPathEndCallback(), OnStepCallback StepCallback = OnStepCallback() ); /** Stop the animation */ - void Stop(); + void stop(); /** Sets a path end callback */ - void SetPathEndCallback( OnPathEndCallback PathEndCallback ); + void setPathEndCallback( OnPathEndCallback PathEndCallback ); /** Sets a step callback */ - void SetStepCallback( OnStepCallback StepCallback ); + void setStepCallback( OnStepCallback StepCallback ); /** Update the movement interpolation */ - void Update( const Time& Elapsed ); + void update( const Time& Elapsed ); /** Reset the class */ - void Reset(); + void reset(); /** @return The Current Position */ - const Float& GetPos(); + const Float& getPos(); /** @return The Current Real Position */ - const Float& GetRealPos() const; + const Float& getRealPos() const; /** @return If movement interpolation is a loop */ - const bool& Loop() const; + const bool& loop() const; /** Set if loop the movement interpolation */ - void Loop( const bool& loop ); + void loop( const bool& loop ); /** Clear all the points */ - void ClearWaypoints(); + void clearWaypoints(); /** @return If the animation ended */ - const bool& Ended() const; + const bool& ended() const; /** Set the current interpolation speed */ - void Speed( const Float Speed ); + void speed( const Float speed ); /** Get the current interpolation speed */ - const Float& Speed() const; + const Float& speed() const; /** @return If enabled */ - const bool& Enabled() const; + const bool& enabled() const; - void Enabled( const bool& Enabled ); + void enabled( 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 ); + void setTotalTime( const Time& TotTime ); /** @return the vector of points */ - const std::vector& GetPoints() const; + const std::vector& getPoints() const; /** @return The Current Node */ - Point1d* GetCurrentActual() const; + Point1d* getCurrentActual() const; /** @return The Next Node */ - Point1d* GetCurrentNext() const; + Point1d* getCurrentNext() const; /** @return The Current Position in the vector */ - const unsigned int& GetCurrentPos() const; + const unsigned int& getCurrentPos() const; /** @return The path end position */ - const Float& GetEndPos(); + const Float& getEndPos(); /** Set the type of interpolation to be used */ - void Type( Ease::Interpolation InterpolationType ); + void type( Ease::Interpolation InterpolationType ); /** @return The type of the interpolation */ - const int& Type() const; + const int& type() const; protected: int mType; bool mEnable; diff --git a/include/eepp/math/line2.hpp b/include/eepp/math/line2.hpp index 079107650..c423fbe48 100644 --- a/include/eepp/math/line2.hpp +++ b/include/eepp/math/line2.hpp @@ -18,12 +18,12 @@ class Line2 { Vector2& p2() { return V[1]; } - Vector2 GetNormal(); + Vector2 getNormal(); /** @return The angle of the line against the x axis-aligned line */ - T GetAngle(); + T getAngle(); - bool Intersect( Line2& line, T* X = NULL, T* Y = NULL ); + bool intersect( Line2& line, T* X = NULL, T* Y = NULL ); }; template @@ -39,14 +39,14 @@ Line2::Line2( const Vector2& v1, const Vector2& v2 ) { } template -Vector2 Line2::GetNormal() { +Vector2 Line2::getNormal() { Vector2 tV = Vector2( -(V[1].y - V[0].y) , V[1].x - V[0].x ); - tV.Normalize(); + tV.normalize(); return tV; } template -T Line2::GetAngle() { +T Line2::getAngle() { return eeatan2( (V[1].y - V[0].y), (V[1].x - V[0].x) ) * EE_180_PI; } @@ -58,7 +58,7 @@ T Line2::GetAngle() { * @return True if the lines are intersecting */ template -bool Line2::Intersect( Line2& line, T* X, T* Y ) { +bool Line2::intersect( Line2& line, T* X, T* Y ) { T distAB, theCos, theSin, newX, ABpos; if ( ( V[0].x==V[1].x && V[0].y==V[1].y ) || ( line.V[0].x==line.V[1].x && line.V[0].y==line.V[1].y ) ) return false; diff --git a/include/eepp/math/math.hpp b/include/eepp/math/math.hpp index 1939e796e..7ce0e1348 100755 --- a/include/eepp/math/math.hpp +++ b/include/eepp/math/math.hpp @@ -8,7 +8,7 @@ namespace EE { namespace Math { /** Set a Random Seed to the Randomizer */ -inline Uint32 SetRandomSeed( Uint32 seed ) { +inline Uint32 setRandomSeed( Uint32 seed ) { srand(seed); return seed; } @@ -18,7 +18,7 @@ inline Uint32 SetRandomSeed( Uint32 seed ) { * @param fMax the maximun value * @return The random number generated */ -inline Float Randf( const Float& fMin = 0.0f, const Float& fMax = 1.0f ) { +inline Float randf( const Float& fMin = 0.0f, const Float& fMax = 1.0f ) { return (fMin + (fMax - fMin) * ( rand() / ( (Float) RAND_MAX + 1) ) ); } @@ -27,7 +27,7 @@ inline Float Randf( const Float& fMin = 0.0f, const Float& fMax = 1.0f ) { * @param fMax the maximun value * @return The random number generated */ -inline int Randi( const int& fMin = 0, const int& fMax = 1 ) { +inline int randi( const int& fMin = 0, const int& fMax = 1 ) { return (int)(fMin + (fMax - fMin + 1) * ( rand() / ( (Float) RAND_MAX + 1) ) ); } @@ -46,18 +46,18 @@ inline Float tanAng( const Float& Ang ) { } /** Convert an Angle from Degrees to Radians */ -inline Float Radians( const Float& Ang ) { +inline Float radians( const Float& Ang ) { return Ang * EE_PI_180; } /** Convert an Angle from Math::Radians to Degrees */ -inline Float Degrees( const Float& Radians ) { +inline Float degrees( const Float& Radians ) { return Radians * EE_180_PI; } /** @return The next power of two of the given Size */ template -T NextPowOfTwo( T Size ) { +T nextPowOfTwo( T Size ) { T p = 1; while ( p < Size ) @@ -68,19 +68,19 @@ T NextPowOfTwo( T Size ) { /** @return If the number given is power of two */ template -T IsPow2( T v ) { +T isPow2( T v ) { return ( ( v & ( v - 1 ) ) == 0 ); } /** Round the number */ template -inline T Round( T r ) { +inline T round( T r ) { return (r > 0.0f) ? floor(r + 0.5f) : ceil(r - 0.5f); } /** Round the number always to the upper value */ template -inline T RoundUp( T r ) { +inline T roundUp( T r ) { return (r > 0.0f) ? ceil(r) : ceil(r - 0.5f); } diff --git a/include/eepp/math/mtrand.hpp b/include/eepp/math/mtrand.hpp index ed907cbb9..a62567039 100755 --- a/include/eepp/math/mtrand.hpp +++ b/include/eepp/math/mtrand.hpp @@ -84,48 +84,48 @@ class EE_API MTRand { MTRand& operator=( const MTRand& o ); /** @return integer in [0,2^32-1] */ - Uint32 Randi(); + Uint32 randi(); /** @return integer in [0,n] for n < 2^32 */ - Uint32 Randi( const Uint32 n ); + Uint32 randi( const Uint32 n ); /** @return real number in [0,1] */ - double Rand(); + double rand(); /** @return real number in [0,n] */ - double Rand( const double n ); + double rand( const double n ); /** Set a new seed */ - void Seed( const Uint32 oneSeed ); + void seed( const Uint32 oneSeed ); /** Set the default seed */ - void Seed(); + void seed(); /** @return float number in [0,1] */ - Float Randf(); + Float randf(); /** @return float number in [0,n] */ - Float Randf( const Float n ); + Float randf( const Float n ); /** @return int number in [Min,Max] */ - int RandRange( int Min, int Max ); + int randRange( int Min, int Max ); /** @return float number in [Min,Max] */ - Float RandRange( Float Min, Float Max ); + Float randRange( Float Min, Float Max ); /** Save the state to an allocated array */ - void Save( Uint32* saveArray ) const; + void save( Uint32* saveArray ) const; /** Load state from an array */ - void Load( Uint32 *const loadArray ); + void load( Uint32 *const loadArray ); protected: Uint32 mState[N]; Uint32 * mNext; int mLeft; - void Initialize( const Uint32 oneSeed ); + void initialize( const Uint32 oneSeed ); - void Reload(); + void reload(); Uint32 hiBit( const Uint32 u ) const; @@ -133,11 +133,11 @@ class EE_API MTRand { Uint32 loBits( const Uint32 u ) const; - Uint32 MixBits( const Uint32 u, const Uint32 v ) const; + Uint32 mixBits( const Uint32 u, const Uint32 v ) const; - Uint32 Magic( const Uint32 u ) const; + Uint32 magic( const Uint32 u ) const; - Uint32 Twist( const Uint32 m, const Uint32 s0, const Uint32 s1 ) const; + Uint32 twist( const Uint32 m, const Uint32 s0, const Uint32 s1 ) const; }; }} diff --git a/include/eepp/math/perlinnoise.hpp b/include/eepp/math/perlinnoise.hpp index 03e231e8a..d44a47448 100755 --- a/include/eepp/math/perlinnoise.hpp +++ b/include/eepp/math/perlinnoise.hpp @@ -20,42 +20,42 @@ class EE_API PerlinNoise { ~PerlinNoise(); /** Reset the initial values */ - void Init(); + void init(); /** @return The noise value for the 2D coordinates */ - Float PerlinNoise2D(Float x, Float y); + Float perlinNoise2D(Float x, Float y); - void Octaves( const int& octaves ) { mOctaves = octaves; } + void octaves( const int& octaves ) { mOctaves = octaves; } - void Persistence( const Float& pers) { mPersistence = pers; } + void persistence( const Float& pers) { mPersistence = pers; } - void Frequency( const Float& freq ) { mFrequency = freq; } + void frequency( const Float& freq ) { mFrequency = freq; } - void Amplitude( const Float& amp ) { mAmplitude = amp; } + void amplitude( const Float& amp ) { mAmplitude = amp; } - void FrequencyOctaveDep( const bool& dep ) { mFreqOctaveDep = dep; } + void frequencyOctaveDep( const bool& dep ) { mFreqOctaveDep = dep; } - void AmplitudeOctaveDep( const bool& dep ) { mAmpOctaveDep = dep; } + void amplitudeOctaveDep( const bool& dep ) { mAmpOctaveDep = dep; } - int Octaves() const { return mOctaves; } + int octaves() const { return mOctaves; } - Float Persistence() const { return mPersistence; } + Float persistence() const { return mPersistence; } - Float Frequency() const { return mFrequency; } + Float frequency() const { return mFrequency; } - Float Amplitude() const { return mAmplitude; } + Float amplitude() const { return mAmplitude; } - bool FrequencyOctaveDep() const { return mFreqOctaveDep; } + bool frequencyOctaveDep() const { return mFreqOctaveDep; } - bool AmplitudeOctaveDep() const { return mAmpOctaveDep; } + bool amplitudeOctaveDep() const { return mAmpOctaveDep; } protected: - Float Noise2D(Int32 x, Int32 y); + Float noise2D(Int32 x, Int32 y); - Float SmoothedNoise2D(Float x, Float y); + Float smoothedNoise2D(Float x, Float y); - Float Interpolate(Float a, Float b, Float x); + Float interpolate(Float a, Float b, Float x); - Float InterpolatedNoise2D(Float x, Float y); + Float interpolatedNoise2D(Float x, Float y); Float mCurrSeed; Float mPersistence; diff --git a/include/eepp/math/polygon2.hpp b/include/eepp/math/polygon2.hpp index c00235076..d667fe28b 100755 --- a/include/eepp/math/polygon2.hpp +++ b/include/eepp/math/polygon2.hpp @@ -34,75 +34,75 @@ class Polygon2 { Polygon2( const std::vector< Vector2 >& theVecs ); /** Adds a new Vector2 to the polygon */ - Uint32 PushBack( const Vector2& V ); + Uint32 pushBack( const Vector2& V ); /** Removes the las Vector2 from the polygon */ - void PopBack(); + void popBack(); /** Clear the polygon vectors */ - void Clear(); + void clear(); /** @return The polygon Vector2 from the position ( from 0 to polygon size -1 ) */ const Vector2& operator[] ( const Uint32& Pos ) const; /** @return The polygon Vector2 from the position ( from 0 to polygon size -1 ) */ - Vector2& GetAt( const Uint32& Pos ) + Vector2& getAt( const Uint32& Pos ) { return Vector[Pos]; } /** Change the polygon vector in the position specified ** @return The Vector2 changed */ - Vector2& SetAt( const Uint32& Pos, Vector2 newPos ) + Vector2& setAt( const Uint32& Pos, Vector2 newPos ) { Vector[Pos] = newPos; return Vector[Pos]; } /** @return The number of vectors of the polygon */ - std::size_t Size() const; + std::size_t size() const; /** @return The position of the polygon ( also known as the offset of the polygon ) */ - Vector2 Position() { return Vector2(OffsetX, OffsetY); } + Vector2 position() { return Vector2(OffsetX, OffsetY); } /** Move the polygon Vector2s, add to every point the distance specified */ - void Move( Vector2 dist ); + void move( Vector2 dist ); /** @return The X position of the polygon ( the X-axis Offset ) */ - T X() const { return OffsetX; } + T x() const { return OffsetX; } /** @return The Y position of the polygon ( the Y-axis Offset ) */ - T Y() const { return OffsetY; } + T y() const { return OffsetY; } /** @return The position of the polygon ( the offset )*/ - void Position( const Vector2& V ) { OffsetX = V.x; OffsetY = V.y; } + void position( 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 x( 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 y( const T& y ) { OffsetY = y; } /** @return True if the polygons intersect */ - bool Intersect( const Polygon2& p1 ); + bool intersect( const Polygon2& p1 ); /** Rotates the polygon from a rotation center */ - void Rotate( const T& Angle, const Vector2& Center ); + void rotate( const T& angle, const Vector2& center ); /** Scale the polygon from a center point */ - void Scale( const T& scale, const Vector2& Center ); + void scale( const T& scale, const Vector2& center ); /** Scale the polygon from a center point */ - void Scale( const Vector2& scale, const Vector2& Center ); + void scale( const Vector2& scale, const Vector2& center ); /** @return True if the point is inside the polygon */ - bool PointInside( const Vector2& point ); + bool pointInside( const Vector2& point ); /** @return The polygon axis-aligned bounding box */ - tRECT ToAABB(); + tRECT toAABB(); /** Creates a rounded rectangle polygon */ - static Polygon2 CreateRoundedRectangle( const T& x, const T& y, const T& width, const T& height, const unsigned int& Radius = 8 ); + static Polygon2 createRoundedRectangle( const T& x, const T& y, const T& width, const T& height, const unsigned int& Radius = 8 ); /** @brief Intersect to Quads ** Convert the two quads in two polygons, and execute a polygon to polygon collition. @@ -110,12 +110,12 @@ class Polygon2 { ** @param q1 Second quad ** @param q0Pos The q0 quad polygon offset ** @param q1Pos The q1 quad polygon offset */ - static bool IntersectQuad2( const Quad2& q0, const Quad2& q1, const Vector2& q0Pos = Vector2(0,0), const Vector2& q1Pos = Vector2(0,0) ); + static bool intersectQuad2( const Quad2& q0, const Quad2& q1, const Vector2& q0Pos = Vector2(0,0), const Vector2& q1Pos = Vector2(0,0) ); /** @return Th closest polygon point to the point (to). ** @param to The point ** @param distance A pointer that returns the distance between the point and the closest point to the point */ - Uint32 ClosestPoint( const Vector2 &to, T * distance = NULL ); + Uint32 closestPoint( const Vector2 &to, T * distance = NULL ); private: std::vector< Vector2 > Vector; T OffsetX, OffsetY; @@ -126,7 +126,7 @@ Polygon2::Polygon2() : OffsetX(0), OffsetY(0) { - Clear(); + clear(); } template @@ -140,19 +140,19 @@ Polygon2::Polygon2( const Polygon2& fromPoly ) : template Polygon2::Polygon2( const std::vector< Vector2 >& theVecs ) : OffsetX(0), OffsetY(0) { for (Uint32 i = 0; i < theVecs.size(); i++) - PushBack ( theVecs[i] ); + pushBack ( theVecs[i] ); } template Polygon2::Polygon2( const Triangle2& fromTrig ) : OffsetX(0), OffsetY(0) { for (Uint8 i = 0; i < 3; i++) - PushBack ( fromTrig.V[i] ); + pushBack ( fromTrig.V[i] ); } template Polygon2::Polygon2( const Quad2& fromQuad ) : OffsetX(0), OffsetY(0) { for (Uint8 i = 0; i < 4; i++) - PushBack ( fromQuad.V[i] ); + pushBack ( fromQuad.V[i] ); } template @@ -165,22 +165,22 @@ Polygon2::Polygon2( const tRECT& fromRect ) : OffsetX(0), OffsetY(0) { template Polygon2::~Polygon2() { - Clear(); + clear(); } template -void Polygon2::Clear() { +void Polygon2::clear() { Vector.clear(); } template -Uint32 Polygon2::PushBack( const Vector2& V ) { +Uint32 Polygon2::pushBack( const Vector2& V ) { Vector.push_back( V ); return (Uint32)Vector.size() - 1; } template -void Polygon2::PopBack() { +void Polygon2::popBack() { Vector.pop_back(); } @@ -192,44 +192,44 @@ const Vector2& Polygon2::operator[] ( const Uint32& Pos ) const { } template -std::size_t Polygon2::Size() const { +std::size_t Polygon2::size() const { return Vector.size(); } template -void Polygon2::Rotate( const T& Angle, const Vector2& Center ) { - if ( Angle == 0.f ) +void Polygon2::rotate(const T& angle, const Vector2& center ) { + if ( angle == 0.f ) return; for ( unsigned int i = 0; i < Vector.size(); i++ ) - Vector[ i ].Rotate( Angle, Center ); + Vector[ i ].rotate( angle, center ); } template -void Polygon2::Scale( const Vector2& scale, const Vector2& Center ) { +void Polygon2::scale(const Vector2& scale, const Vector2& center ) { if ( scale == 1.0f ) return; for ( Uint32 i = 0; i < Vector.size(); i++ ) { - if ( Vector[i].x < Center.x ) - Vector[i].x = Center.x - eeabs( Center.x - Vector[i].x ) * scale.x; + if ( Vector[i].x < center.x ) + Vector[i].x = center.x - eeabs( center.x - Vector[i].x ) * scale.x; else - Vector[i].x = Center.x + eeabs( Center.x - Vector[i].x ) * scale.x; + Vector[i].x = center.x + eeabs( center.x - Vector[i].x ) * scale.x; - if ( Vector[i].y < Center.y ) - Vector[i].y = Center.y - eeabs( Center.y - Vector[i].y ) * scale.y; + if ( Vector[i].y < center.y ) + Vector[i].y = center.y - eeabs( center.y - Vector[i].y ) * scale.y; else - Vector[i].y = Center.y + eeabs( Center.y - Vector[i].y ) * scale.y; + Vector[i].y = center.y + eeabs( center.y - Vector[i].y ) * scale.y; } } template -void Polygon2::Scale( const T& scale, const Vector2& Center ) { - Scale( Vector2( scale, scale ), Center ); +void Polygon2::scale(const T& scale, const Vector2& center ) { + scale( Vector2( scale, scale ), center ); } template -Polygon2 Polygon2::CreateRoundedRectangle( const T& x, const T& y, const T& width, const T& height, const unsigned int& Radius ) { +Polygon2 Polygon2::createRoundedRectangle( const T& x, const T& y, const T& width, const T& height, const unsigned int& Radius ) { T PI05 = (T)EE_PI * 0.5f; T PI15 = (T)EE_PI * 1.5f; T PI20 = (T)EE_PI2; @@ -238,44 +238,44 @@ Polygon2 Polygon2::CreateRoundedRectangle( const T& x, const T& y, const T Polygon2 Poly; - Poly.PushBack( Vector2( x, y + height - Radius) ); - Poly.PushBack( Vector2( x, y + Radius ) ); + Poly.pushBack( Vector2( x, y + height - Radius) ); + Poly.pushBack( Vector2( x, y + Radius ) ); for( t = (T)EE_PI; t < PI15; t += 0.1f ) { sx = x + Radius + (Float)cosf(t) * Radius; sy = y + Radius + (Float)sinf(t) * Radius; - Poly.PushBack( Vector2 (sx, sy) ); + Poly.pushBack( Vector2 (sx, sy) ); } - Poly.PushBack( Vector2( x + Radius, y ) ); - Poly.PushBack( Vector2( x + width - Radius, y ) ); + Poly.pushBack( Vector2( x + Radius, y ) ); + Poly.pushBack( Vector2( x + width - Radius, y ) ); for( t = PI15; t < PI20; t += 0.1f ) { sx = x + width - Radius + (Float)cosf(t) * Radius; sy = y + Radius + (Float)sinf(t) * Radius; - Poly.PushBack( Vector2 (sx, sy) ); + Poly.pushBack( Vector2 (sx, sy) ); } - Poly.PushBack( Vector2 ( x + width, y + Radius ) ); - Poly.PushBack( Vector2 ( x + width, y + height - Radius ) ); + Poly.pushBack( Vector2 ( x + width, y + Radius ) ); + Poly.pushBack( Vector2 ( x + width, y + height - Radius ) ); for( t = 0; t < PI05; t += 0.1f ){ sx = x + width - Radius + (Float)cosf(t) * Radius; sy = y + height -Radius + (Float)sinf(t) * Radius; - Poly.PushBack( Vector2 (sx, sy) ); + Poly.pushBack( Vector2 (sx, sy) ); } - Poly.PushBack( Vector2 ( x + width - Radius, y + height ) ); - Poly.PushBack( Vector2 ( x + Radius, y + height ) ); + Poly.pushBack( Vector2 ( x + width - Radius, y + height ) ); + Poly.pushBack( Vector2 ( x + Radius, y + height ) ); for( t = PI05; t < (T)EE_PI; t += 0.1f ) { sx = x + Radius + (Float)cosf(t) * Radius; sy = y + height - Radius + (Float)sinf(t) * Radius; - Poly.PushBack( Vector2 (sx, sy) ); + Poly.pushBack( Vector2 (sx, sy) ); } return Poly; @@ -293,9 +293,9 @@ The name of W. Randolph Franklin may not be used to endorse or promote products THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ template -bool Polygon2::PointInside( const Vector2& point ) { +bool Polygon2::pointInside( const Vector2& point ) { int i, j, c = 0; - int nvert = (int)Size(); + int nvert = (int)size(); for ( i = 0, j = nvert - 1; i < nvert; j = i++ ) { if ( ( ( Vector[i].y > point.y ) != ( Vector[j].y > point.y ) ) && @@ -310,22 +310,22 @@ bool Polygon2::PointInside( const Vector2& point ) { /** Polygon Polygon Collision ( SAT ) */ template -bool Polygon2::Intersect( const Polygon2& p1 ) { +bool Polygon2::intersect( const Polygon2& p1 ) { T min0, max0, min1, max1, sOffset, t; Vector2 vAxis, vOffset; - unsigned int i = 0, j = 0, n, size = Size(); + unsigned int i = 0, j = 0, n, size = this->size(); - vOffset = Vector2( X() - p1.X(), Y() - p1.Y() ); + vOffset = Vector2( x() - p1.x(), y() - p1.y() ); for (i = 0; i < size; i++) { n = i + 1; - if ( n >= Size() ) n = 0; + if ( n >= this->size() ) n = 0; - vAxis = Line2( Vector[i], Vector[n] ).GetNormal(); + vAxis = Line2( Vector[i], Vector[n] ).getNormal(); min0 = vAxis.Dot( Vector[0] ); max0 = min0; - for (j = 1; j < Size(); j++) { + for (j = 1; j < this->size(); 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.size(); 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.size(); i++) { n = i + 1; - if ( n >= p1.Size() ) n = 0; + if ( n >= p1.size() ) n = 0; - vAxis = Line2( p1[i], p1[n] ).GetNormal(); + vAxis = Line2( p1[i], p1[n] ).getNormal(); min0 = vAxis.Dot( Vector[0] ); max0 = min0; - for (j = 1; j < Size(); j++) { + for (j = 1; j < this->size(); 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.size(); j++) { t = vAxis.Dot( p1[j] ); if (t < min1) min1 = t; if (t > max1) max1 = t; @@ -385,18 +385,18 @@ bool Polygon2::Intersect( const Polygon2& p1 ) { /** Quad Quad Collision */ template -bool Polygon2::IntersectQuad2( const Quad2& q0, const Quad2& q1, const Vector2& q0Pos, const Vector2& q1Pos ) { +bool Polygon2::intersectQuad2( const Quad2& q0, const Quad2& q1, const Vector2& q0Pos, const Vector2& q1Pos ) { Polygon2 Tmp1 = Polygon2( q0 ); Polygon2 Tmp2 = Polygon2( q1 ); - Tmp1.Position( q0Pos ); - Tmp1.Position( q1Pos ); + Tmp1.position( q0Pos ); + Tmp1.position( q1Pos ); - return Tmp1.Intersect( Tmp2 ); + return Tmp1.intersect( Tmp2 ); } template -tRECT Polygon2::ToAABB() { +tRECT Polygon2::toAABB() { tRECT TmpR; if ( Vector.size() < 4 ) { @@ -421,14 +421,14 @@ tRECT Polygon2::ToAABB() { } template -void Polygon2::Move( Vector2 dist ) { +void Polygon2::move( Vector2 dist ) { for ( Uint32 i = 0; i < Vector.size(); i++ ) { Vector[i] += dist; } } template -Uint32 Polygon2::ClosestPoint( const Vector2& to, T * distance ) { +Uint32 Polygon2::closestPoint( const Vector2& to, T * distance ) { Uint32 Index = 0; T Dist = (T)99999999; T tDist; @@ -438,7 +438,7 @@ Uint32 Polygon2::ClosestPoint( const Vector2& to, T * distance ) { } for ( Uint32 i = 0; i < Vector.size(); i++ ) { - tDist = Vector[i].Distance( to ); + tDist = Vector[i].distance( to ); if ( tDist < Dist ) { Index = i; diff --git a/include/eepp/math/quad2.hpp b/include/eepp/math/quad2.hpp index 1e5b22de6..f4b34dc87 100644 --- a/include/eepp/math/quad2.hpp +++ b/include/eepp/math/quad2.hpp @@ -31,37 +31,37 @@ class Quad2 { Vector2 V[3]; //! Right - Top Vector2 @return The center point of the quad */ - Vector2 GetCenter(); + Vector2 getCenter(); /** @return The Vector2 from the position index ( from 0 to 3 ) */ - Vector2& GetAt( Uint32 Index ) { return V[Index]; } + Vector2& getAt( Uint32 Index ) { return V[Index]; } /** Creates a quad from a rectangle */ - static Quad2 FromAABB( const tRECT& R ); + static Quad2 fromAABB( const tRECT& R ); /** @return The Axis-Aligned bounding box of the Quad */ - tRECT ToAABB( const T& OffsetX = 0, const T& OffsetY = 0 ); + tRECT toAABB( const T& OffsetX = 0, const T& OffsetY = 0 ); /** Rotates the quad from a rotation center */ - void Rotate( const T& Angle, const Vector2& Center ); + void rotate( const T& Angle, const Vector2& Center ); /** Rotates the quad from its rotation center */ - void Rotate( const T& Angle ); + void rotate( const T& Angle ); /** Scale the quad from its rotation center */ - void Scale( const T& scale ); + void scale( const T& scale ); /** Scale the quad from an specified center */ - void Scale( const T& scale, const Vector2& Center ); + void scale(const T& scale, const Vector2& center ); /** Scale the quad from its rotation center */ - void Scale( const Vector2& scale ); + void scale( const Vector2& scale ); /** Scale the quad from an specified center */ - void Scale( const Vector2& scale, const Vector2& Center ); + void scale( const Vector2& scale, const Vector2& center ); /** Move the polygon Vector2s, add to every point the distance specified */ - void Move( Vector2 dist ); + void move( Vector2 dist ); }; template @@ -89,57 +89,57 @@ Quad2::Quad2( const tRECT& R ) { } template -void Quad2::Rotate( const T& Angle ) { - Rotate( Angle, GetCenter() ); +void Quad2::rotate( const T& Angle ) { + rotate( Angle, getCenter() ); } template -void Quad2::Rotate( const T& Angle, const Vector2& Center ) { +void Quad2::rotate( const T& Angle, const Vector2& Center ) { if ( Angle == 0.f ) return; - V[0].Rotate( Angle, Center ); - V[1].Rotate( Angle, Center ); - V[2].Rotate( Angle, Center ); - V[3].Rotate( Angle, Center ); + V[0].rotate( Angle, Center ); + V[1].rotate( Angle, Center ); + V[2].rotate( Angle, Center ); + V[3].rotate( Angle, Center ); } template -void Quad2::Scale( const Vector2& scale, const Vector2& Center ) { +void Quad2::scale(const Vector2& scale, const Vector2& center ) { if ( scale == 1.0f ) return; for ( Uint32 i = 0; i < 4; i++ ) { - if ( V[i].x < Center.x ) - V[i].x = Center.x - eeabs( Center.x - V[i].x ) * scale.x; + if ( V[i].x < center.x ) + V[i].x = center.x - eeabs( center.x - V[i].x ) * scale.x; else - V[i].x = Center.x + eeabs( Center.x - V[i].x ) * scale.x; + V[i].x = center.x + eeabs( center.x - V[i].x ) * scale.x; - if ( V[i].y < Center.y ) - V[i].y = Center.y - eeabs( Center.y - V[i].y ) * scale.y; + if ( V[i].y < center.y ) + V[i].y = center.y - eeabs( center.y - V[i].y ) * scale.y; else - V[i].y = Center.y + eeabs( Center.y - V[i].y ) * scale.y; + V[i].y = center.y + eeabs( center.y - V[i].y ) * scale.y; } } template -void Quad2::Scale( const Vector2& scale ) { - Scale( scale, GetCenter() ); +void Quad2::scale( const Vector2& scale ) { + this->scale( scale, getCenter() ); } template -void Quad2::Scale( const T& scale, const Vector2& Center ) { - Scale( Vector2( scale, scale ), Center ); +void Quad2::scale( const T& scale, const Vector2& center ) { + this->scale( Vector2( scale, scale ), center ); } template -void Quad2::Scale( const T& scale ) { - Scale( scale, GetCenter() ); +void Quad2::scale( const T& scale ) { + this->scale( scale, getCenter() ); } template -Vector2 Quad2::GetCenter() { +Vector2 Quad2::getCenter() { Float MinX = V[0].x, MaxX = V[0].x, MinY = V[0].y, MaxY = V[0].y; for (Uint8 i = 1; i < 4; i++ ) { @@ -153,12 +153,12 @@ Vector2 Quad2::GetCenter() { } template -Quad2 Quad2::FromAABB( const tRECT& R ) { +Quad2 Quad2::fromAABB( const tRECT& R ) { return Quad2( Vector2( R.Left, R.Top ), Vector2( R.Left, R.Bottom ), Vector2( R.Right, R.Bottom ), Vector2( R.Right, R.Top ) ); } template -tRECT Quad2::ToAABB( const T& OffsetX, const T& OffsetY ) { +tRECT Quad2::toAABB( const T& OffsetX, const T& OffsetY ) { tRECT TmpR; Float MinX = V[0].x, MaxX = V[0].x, MinY = V[0].y, MaxY = V[0].y; @@ -187,7 +187,7 @@ const Vector2& Quad2::operator[] ( const Uint32& Pos ) const { } template -void Quad2::Move( Vector2 dist ) { +void Quad2::move( Vector2 dist ) { if ( dist.x == 0 && dist.y == 0 ) return; diff --git a/include/eepp/math/rect.hpp b/include/eepp/math/rect.hpp index a78a936df..989cb3d76 100755 --- a/include/eepp/math/rect.hpp +++ b/include/eepp/math/rect.hpp @@ -13,59 +13,59 @@ class tRECT { tRECT( T left, T top, T right, T bottom ); - tRECT( const Vector2& Pos, const tSize& Size ); + tRECT( const Vector2& pos, const tSize& size ); tRECT(); - tRECT Copy(); + tRECT copy(); - bool Intersect( const tRECT& Rect ); + bool intersect( const tRECT& Rect ); - bool Contains( const tRECT& Rect ); + bool contains( const tRECT& Rect ); - bool Contains( const Vector2& Vect ); + bool contains( const Vector2& Vect ); - void Merge( const tRECT& Rect ); + void merge( const tRECT& Rect ); - void Expand( const Vector2& Vect ); + void expand( const Vector2& Vect ); - T Area(); + T area(); - T MergedArea( const tRECT& Rect ); + T mergedArea( const tRECT& Rect ); - bool IntersectsSegment( const Vector2& a, const Vector2& b ); + bool intersectsSegment( const Vector2& a, const Vector2& b ); /** Determine if a RECT and a Circle are intersecting * @param pos Circle position * @param radius Circle Radius * @return True if are intersecting */ - bool IntersectCircle( Vector2 pos, const T& radius ); + bool intersectCircle( Vector2 pos, const T& radius ); /** Determine if a RECT ( representing a circle ) is intersecting another RECT ( also representing a circle ) */ - bool IntersectCircles( const tRECT& b ); + bool intersectCircles( const tRECT& b ); - Vector2 ClampVector( const Vector2& Vect ); + Vector2 clampVector( const Vector2& Vect ); - Vector2 WrapVector( const Vector2& Vect ); + Vector2 wrapVector( const Vector2& Vect ); - Vector2 Pos(); + Vector2 pos(); - Vector2 Center(); + Vector2 center(); - tSize Size(); + tSize size(); - T Width(); + T width(); - T Height(); + T height(); - void Scale( T scale, const Vector2& center ); + void scale( T scale, const Vector2& center ); - void Scale( T scale ); + void scale( T scale ); - void Scale( Vector2 scale, const Vector2& center ); + void scale( Vector2 scale, const Vector2& center ); - void Scale( Vector2 scale ); + void scale( Vector2 scale ); }; template @@ -140,7 +140,7 @@ tRECT::tRECT(T left, T top, T right, T bottom) { } template -tRECT tRECT::Copy() { +tRECT tRECT::copy() { return tRECT( Left, Top, Right, Bottom ); } @@ -148,55 +148,55 @@ 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.width(); + Bottom = Top + Size.height(); } template tRECT::tRECT() : Left(0), Right(0), Top(0), Bottom(0) {} template -bool tRECT::Contains( const tRECT& Rect ) { +bool tRECT::contains( const tRECT& Rect ) { return ( Left <= Rect.Left && Right >= Rect.Right && Top <= Rect.Top && Bottom >= Rect.Bottom ); } template -bool tRECT::Intersect( const tRECT& Rect ) { +bool tRECT::intersect( const tRECT& Rect ) { return !( Left > Rect.Right || Right < Rect.Left || Top > Rect.Bottom || Bottom < Rect.Top ); } template -bool tRECT::Contains( const Vector2& Vect ) { +bool tRECT::contains( const Vector2& Vect ) { return ( Left <= Vect.x && Right >= Vect.x && Top <= Vect.y && Bottom >= Vect.y ); } template -Vector2 tRECT::Pos() { +Vector2 tRECT::pos() { return Vector2( Left, Top ); } template -Vector2 tRECT::Center() { +Vector2 tRECT::center() { return Vector2( Left + ( ( Right - Left ) * 0.5 ), Top + ( ( Bottom - Top ) * 0.5 ) ); } template -tSize tRECT::Size() { +tSize tRECT::size() { return tSize( eeabs( Right - Left ), eeabs( Bottom - Top ) ); } template -T tRECT::Width() { +T tRECT::width() { return eeabs( Right - Left ); } template -T tRECT::Height() { +T tRECT::height() { return eeabs( Bottom - Top ); } template -void tRECT::Merge( const tRECT& Rect ) { +void tRECT::merge( const tRECT& Rect ) { Left = eemin( Left , Rect.Left ); Bottom = eemin( Bottom , Rect.Bottom ); Right = eemax( Right , Rect.Right ); @@ -204,7 +204,7 @@ void tRECT::Merge( const tRECT& Rect ) { } template -void tRECT::Expand( const Vector2& Vect ) { +void tRECT::expand( const Vector2& Vect ) { Left = eemin( Left , Vect.x ); Bottom = eemin( Bottom , Vect.y ); Right = eemax( Right , Vect.x ); @@ -212,17 +212,17 @@ void tRECT::Expand( const Vector2& Vect ) { } template -T tRECT::Area() { +T tRECT::area() { return ( Right - Left ) * ( Bottom - Top ); } template -T tRECT::MergedArea( const tRECT& Rect ) { +T tRECT::mergedArea( const tRECT& Rect ) { return ( eemax( Right, Rect.Right ) - eemin( Left, Rect.Left ) ) * ( eemin( Bottom, Rect.Bottom ) - eemax( Top, Rect.Top ) ); } template -bool tRECT::IntersectsSegment( const Vector2& a, const Vector2& b ) { +bool tRECT::intersectsSegment( const Vector2& a, const Vector2& b ) { tRECT seg_bb = tRECT( eemin( a.x, b.x ), eemin( a.y, b.y ), eemax( a.x, b.x ), eemax( a.y, b.y ) ); if( Intersects( seg_bb ) ){ @@ -237,7 +237,7 @@ bool tRECT::IntersectsSegment( const Vector2& a, const Vector2& b ) { } template -bool tRECT::IntersectCircle( Vector2 pos, const T& radius ) { +bool tRECT::intersectCircle( Vector2 pos, const T& radius ) { Vector2 tPos( pos ); if (tPos.x < Left) tPos.x = Left; @@ -245,14 +245,14 @@ bool tRECT::IntersectCircle( Vector2 pos, const T& radius ) { if (tPos.y < Top) tPos.y = Top; if (tPos.y > Bottom) tPos.y = Bottom; - if ( pos.Distance( tPos ) < radius ) + if ( pos.distance( tPos ) < radius ) return true; return false; } template -bool tRECT::IntersectCircles( const tRECT& b ) { +bool tRECT::intersectCircles( const tRECT& b ) { Float ra = (Float)(Right - Left) * 0.5f; Float rb = (Float)(b.Right - b.Left) * 0.5f; Float dist = ra + rb; @@ -266,7 +266,7 @@ bool tRECT::IntersectCircles( const tRECT& b ) { } template -Vector2 tRECT::ClampVector( const Vector2& Vect ) { +Vector2 tRECT::clampVector( const Vector2& Vect ) { T x = eemin( eemax( Left , Vect.x ), Right ); T y = eemin( eemax( Top , Vect.y ), Bottom ); @@ -274,7 +274,7 @@ Vector2 tRECT::ClampVector( const Vector2& Vect ) { } template -Vector2 tRECT::WrapVector( const Vector2& Vect ) { +Vector2 tRECT::wrapVector( const Vector2& Vect ) { T ix = eeabs( Right - Left ); T modx = eemod( Vect.x - Left, ix ); T x = ( modx > 0 ) ? modx : modx + ix; @@ -287,7 +287,7 @@ Vector2 tRECT::WrapVector( const Vector2& Vect ) { } template -void tRECT::Scale( Vector2 scale, const Vector2& center ) { +void tRECT::scale( Vector2 scale, const Vector2& center ) { if ( scale != 1.0f ) { Left = center.x + ( Left - center.x ) * scale.x; Top = center.y + ( Top - center.y ) * scale.y; @@ -297,18 +297,18 @@ void tRECT::Scale( Vector2 scale, const Vector2& center ) { } template -void tRECT::Scale( T scale, const Vector2& center ) { - Scale( Vector2f( scale, scale ), center ); +void tRECT::scale( T scale, const Vector2& center ) { + scale( Vector2f( scale, scale ), center ); } template -void tRECT::Scale( T scale ) { - Scale( scale, Center() ); +void tRECT::scale( T scale ) { + scale( scale, center() ); } template -void tRECT::Scale( Vector2 scale ) { - Scale( scale, Center() ); +void tRECT::scale( Vector2 scale ) { + scale( scale, center() ); } typedef tRECT Rectu; diff --git a/include/eepp/math/size.hpp b/include/eepp/math/size.hpp index 5f61ea830..aa4ddbab0 100644 --- a/include/eepp/math/size.hpp +++ b/include/eepp/math/size.hpp @@ -14,7 +14,7 @@ class tSize : public Vector2 tSize(); /** Creates a tSize of the width and height */ - tSize( const T& Width, const T& Height ); + tSize( const T& width, const T& height ); /** Creates a copy of a size */ tSize( const tSize& Size ); @@ -23,16 +23,16 @@ class tSize : public Vector2 tSize( const Vector2& Vec ); /** @return The size width */ - const T& Width() const; + const T& width() const; /** @return The size height */ - const T& Height() const; + const T& height() const; /** Set a new width */ - void Width( const T& width ); + void width( const T& width ); /** Set a new height */ - void Height( const T& height ); + void height( 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.width(), Size.height() ) { } @@ -60,22 +60,22 @@ tSize::tSize( const Vector2& Vec ) : } template -const T& tSize::Width() const { +const T& tSize::width() const { return this->x; } template -const T& tSize::Height() const { +const T& tSize::height() const { return this->y; } template -void tSize::Width( const T& width ) { +void tSize::width( const T& width ) { this->x = width; } template -void tSize::Height( const T& height ) { +void tSize::height( const T& height ) { this->y = height; } diff --git a/include/eepp/math/triangle2.hpp b/include/eepp/math/triangle2.hpp index 430100c6b..47a3bd367 100644 --- a/include/eepp/math/triangle2.hpp +++ b/include/eepp/math/triangle2.hpp @@ -18,7 +18,7 @@ class Triangle2 { Vector2 V[3]; /** @return The vector index ( between 0 and 2 ) */ - Vector2& GetAt( Uint32 Index ) { return V[Index]; } + Vector2& getAt( Uint32 Index ) { return V[Index]; } }; template diff --git a/include/eepp/math/vector2.hpp b/include/eepp/math/vector2.hpp index d65cdaa86..8a2398578 100755 --- a/include/eepp/math/vector2.hpp +++ b/include/eepp/math/vector2.hpp @@ -21,7 +21,7 @@ class Vector2 { Vector2(T X, T Y); /** @return A copy of the Vector2 */ - Vector2 Copy(); + Vector2 copy(); /** @return The Dot product of the 2D vectors. */ T Dot( const Vector2& V2 ); @@ -30,67 +30,67 @@ class Vector2 { T Cross( const Vector2& V2 ); /** @return The perpendicular vector */ - Vector2 Perp(); + Vector2 perp(); /** @return The reveser perpendicular vector */ - Vector2 RPerp(); + Vector2 rPerp(); /** Uses complex multiplication to rotate self by vec. Scaling will occur if self is not a unit vector. */ - Vector2 Rotate( const Vector2& V2 ); + Vector2 rotate( const Vector2& V2 ); - /** Inverse of Vector2::Rotate */ - Vector2 UnRotate( const Vector2& V2 ); + /** Inverse of Vector2::rotate */ + Vector2 unrotate( const Vector2& V2 ); /** @return The vector Length */ - T Length(); + T length(); /** @return The square of the length of the 2D vector. */ - T LengthSq(); + T lengthSq(); /** Normalize the vector */ - void Normalize(); + void normalize(); /** @return Clamp the vector to a magnitude length. */ - void Clamp( T len ); + void clamp( T len ); /** @return The unit length vector for the given angle (radians) */ - Vector2 ForAngle( const T& a ); + Vector2 forAngle( const T& a ); /** @return The angular direction vector is pointing in (radians). */ - T ToAngle(); + T toAngle(); /** Rotates the vector */ - void Rotate( const T& Angle ); + void rotate( const T& Angle ); /** Rotates the vector against a defined rotation center */ - void Rotate( const T& Angle, const Vector2& RotationCenter ); + void rotate( const T& Angle, const Vector2& RotationCenter ); /** @return The distance between two vectors */ - T Distance( const Vector2& Vec ); + T distance( const Vector2& Vec ); /** @return The square of the distance between two vectors */ - T DistanceSq( const Vector2& Vec ); + T distanceSq( const Vector2& Vec ); /** @return True if the distance between the two vectors is less than Dist */ - bool Near( const Vector2& Vec, T Dist ); + bool near( const Vector2& Vec, T Dist ); /** @return The spherical linear interpolation between two 2D vectors. */ - Vector2 SphericalLerp( const Vector2& Vec, T Time ); + Vector2 sphericalLerp( const Vector2& Vec, T Time ); /** Spherical linear interpolation between two vectors */ - Vector2 SphericalLerpConst( const Vector2& Vec, T Angle ); + Vector2 sphericalLerpConst( const Vector2& Vec, T Angle ); /** Performs a linear interpolation between two 2D vectors. */ - Vector2 Lerp( const Vector2& Vec, T Time ); + Vector2 lerp( const Vector2& Vec, T Time ); /** @return A vector interpolated from self towards Vec with length Dist. */ - Vector2 LerpConst( const Vector2& Vec, T Dist ); + Vector2 lerpConst( const Vector2& Vec, T Dist ); /** Scales the vector position against another vector */ - void Scale( const Vector2& scale, const Vector2& Center ); + void scale( const Vector2& scale, const Vector2& Center ); /** Scales the vector position against another vector */ - void Scale( const T& scale, const Vector2& Center ); + void scale( const T& scale, const Vector2& Center ); T x; T y; @@ -106,19 +106,19 @@ template const Vector2 Vector2::Zero = Vector2(0,0); template -Vector2 Vector2::Lerp( const Vector2& Vec, T Time ) { +Vector2 Vector2::lerp( const Vector2& Vec, T Time ) { return *this * ( 1 - Time ) + Vec * Time; } template -Vector2 Vector2::LerpConst( const Vector2& Vec, T Dist ) { +Vector2 Vector2::lerpConst( const Vector2& Vec, T Dist ) { Vector2 t( *this + ( Vec - *this ) ); - t.Clamp( Dist ); + t.clamp( Dist ); return t; } template -Vector2 Vector2::SphericalLerp( const Vector2& Vec, T Time ) { +Vector2 Vector2::sphericalLerp( const Vector2& Vec, T Time ) { T omega = eeacos( Dot( Vec ) ); if( omega ) { @@ -131,9 +131,9 @@ Vector2 Vector2::SphericalLerp( const Vector2& Vec, T Time ) { } template -Vector2 Vector2::SphericalLerpConst( const Vector2& Vec, T Angle ) { +Vector2 Vector2::sphericalLerpConst( const Vector2& Vec, T Angle ) { T angle = eeacos( Dot( Vec ) ); - return Lerp( Vec, ( ( Angle < angle ) ? Angle : angle ) / angle ); + return lerp( Vec, ( ( Angle < angle ) ? Angle : angle ) / angle ); } template @@ -273,19 +273,19 @@ T Vector2::sinAng( const T& Ang ) { } template -void Vector2::Rotate( const T& Angle ) { +void Vector2::rotate( const T& Angle ) { T nx = x * cosAng(Angle) - y * sinAng(Angle); y = y * cosAng(Angle) + x * sinAng(Angle); x = nx; } template -void Vector2::Rotate( const T& Angle, const Vector2& RotationCenter ) { +void Vector2::rotate( const T& Angle, const Vector2& RotationCenter ) { if ( 1.f != Angle ) { x -= RotationCenter.x; y -= RotationCenter.y; - Rotate( Angle ); + rotate( Angle ); x += RotationCenter.x; y += RotationCenter.y; @@ -293,7 +293,7 @@ void Vector2::Rotate( const T& Angle, const Vector2& RotationCenter ) { } template -void Vector2::Scale( const Vector2& scale, const Vector2& Center ) { +void Vector2::scale( const Vector2& scale, const Vector2& Center ) { if ( 1.f != scale ) { if ( x < Center.x ) x = Center.x - eeabs( Center.x - x ) * scale.x; @@ -308,8 +308,8 @@ void Vector2::Scale( const Vector2& scale, const Vector2& Center ) { } template -void Vector2::Scale( const T& scale, const Vector2& Center ) { - Scale( Vector2( scale, scale ), Center ); +void Vector2::scale( const T& scale, const Vector2& Center ) { + scale( Vector2( scale, scale ), Center ); } @@ -324,37 +324,37 @@ T Vector2::Cross( const Vector2& V2 ) { } template -Vector2 Vector2::Perp() { +Vector2 Vector2::perp() { return Vector2( -y, x ); } template -Vector2 Vector2::RPerp() { +Vector2 Vector2::rPerp() { return Vector2( y, -x ); } template -Vector2 Vector2::Rotate( const Vector2& V2 ) { +Vector2 Vector2::rotate( const Vector2& V2 ) { return Vector2( x * V2.x - y * V2.y , x * V2.y + y * V2.x ); } template -Vector2 Vector2::UnRotate( const Vector2& V2 ) { +Vector2 Vector2::unrotate( const Vector2& V2 ) { return Vector2( x * V2.x - y * V2.y , x * V2.x + y * V2.y ); } template -T Vector2::Length() { +T Vector2::length() { return eesqrt( Dot( Vector2( x , y ) ) ); } template -T Vector2::LengthSq() { +T Vector2::lengthSq() { return Dot( Vector2( x , y ) ); } template -void Vector2::Normalize() { +void Vector2::normalize() { T s = eesqrt(x * x + y * y); if (s == 0) { x = 0; @@ -366,29 +366,29 @@ void Vector2::Normalize() { } template -Vector2 Vector2::ForAngle( const T& a ) { +Vector2 Vector2::forAngle( const T& a ) { return Vector2( eecos(a), eesin(a) ); } template -T Vector2::ToAngle() { +T Vector2::toAngle() { return eeatan2( y, x ); } template -T Vector2::Distance( const Vector2& Vec ) { +T Vector2::distance( const Vector2& Vec ) { return eesqrt( ( x - Vec.x ) * ( x - Vec.x ) + ( y - Vec.y ) * ( y - Vec.y ) ); } template -T Vector2::DistanceSq( const Vector2& Vec ) { - return ( *this - Vec ).LengthSq(); +T Vector2::distanceSq( const Vector2& Vec ) { + return ( *this - Vec ).lengthSq(); } template -void Vector2::Clamp( T len ) { +void Vector2::clamp( T len ) { if ( Dot( Vector2( x, y ) ) > len * len ) { - Normalize(); + normalize(); x *= len; y *= len; @@ -396,12 +396,12 @@ void Vector2::Clamp( T len ) { } template -bool Vector2::Near( const Vector2& Vec, T Dist ) { - return 0 != ( DistanceSq( Vec ) < Dist * Dist ); +bool Vector2::near( const Vector2& Vec, T Dist ) { + return 0 != ( distanceSq( Vec ) < Dist * Dist ); } template -Vector2 Vector2::Copy() { +Vector2 Vector2::copy() { return Vector2( x, y ); } diff --git a/include/eepp/math/waypoints.hpp b/include/eepp/math/waypoints.hpp index 6e1af358e..2aff21a1b 100755 --- a/include/eepp/math/waypoints.hpp +++ b/include/eepp/math/waypoints.hpp @@ -33,82 +33,82 @@ class EE_API Waypoints { typedef cb::Callback0 OnStepCallback; /** Add a new waypoint */ - void AddWaypoint( const Vector2f& Pos, const Float& Time = 0.f ); + void addWaypoint( const Vector2f& Pos, const Float& Time = 0.f ); /** Edit a waypoint */ - bool EditWaypoint( const unsigned int& PointNum, const Vector2f& NewPos, const Float& NewTime ); + bool editWaypoint( const unsigned int& PointNum, const Vector2f& NewPos, const Float& NewTime ); /** Erase a waypoint */ - bool EraseWaypoint( const unsigned int& PointNum ); + bool eraseWaypoint( const unsigned int& PointNum ); /** Start the animation ( will reset the current state, and start from the beginning ) * @param PathEndCallback An optional callback fired when the animation ends. * @param StepCallback An optional callback that is fired every time that a step is completed. */ - void Start( OnPathEndCallback PathEndCallback = OnPathEndCallback(), OnStepCallback StepCallback = OnStepCallback() ); + void start( OnPathEndCallback PathEndCallback = OnPathEndCallback(), OnStepCallback StepCallback = OnStepCallback() ); /** Stop the animation ( Enable = false ) */ - void Stop(); + void stop(); /** Sets a path end callback */ - void SetPathEndCallback( OnPathEndCallback PathEndCallback ); + void setPathEndCallback( OnPathEndCallback PathEndCallback ); /** Sets a step callback */ - void SetStepCallback( OnStepCallback StepCallback ); + void setStepCallback( OnStepCallback StepCallback ); /** Update the movement interpolation */ - void Update( const Time& Elapsed ); + void update( const Time& Elapsed ); /** Reset the class */ - void Reset(); + void reset(); /** @return The Current Position */ - const Vector2f& GetPos(); + const Vector2f& getPos(); /** @return If movement interpolation is a loop */ - bool Loop() const; + bool loop() const; /** Set if loop the movement interpolation */ - void Loop( const bool& loop ); + void loop( const bool& loop ); /** Clear all the waypoints */ - void ClearWaypoints(); + void clearWaypoints(); /** @return If the animation ended */ - bool Ended() const; + bool ended() const; /** Instead if setting the time between every waypoing, this set a total time for all the movement interpolation. */ - void SetTotalTime( const Time & TotTime ); + void setTotalTime( const Time & TotTime ); /** @return The Current Node */ - Waypoint * GetCurrentActual() const; + Waypoint * getCurrentActual() const; /** @return The Next Node */ - Waypoint * GetCurrentNext() const; + Waypoint * getCurrentNext() const; /** @return The Current Position in the vector */ - const Uint32& GetCurrentPos() const; + const Uint32& getCurrentPos() const; /** @return the vector of waypoints */ - const std::vector& GetWaypoints() const; + 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 speed( const Float& speed ); /** Get the current interpolation speed */ - const Float& Speed() const; + const Float& speed() const; /** @return If enabled */ - const bool& Enabled() const; + const bool& enabled() const; /** Set it enabled or not */ - void Enabled( const bool& Enabled ); + void enabled( const bool& enabled ); /** Set the type of interpolation to be used */ - void Type( Ease::Interpolation InterpolationType ); + void type( Ease::Interpolation InterpolationType ); /** @return The type of the interpolation */ - const int& Type() const; + const int& type() const; protected: int mType; bool mEnable; diff --git a/include/eepp/ui/uiitemcontainer.hpp b/include/eepp/ui/uiitemcontainer.hpp index be11e1b07..72db47786 100644 --- a/include/eepp/ui/uiitemcontainer.hpp +++ b/include/eepp/ui/uiitemcontainer.hpp @@ -62,7 +62,7 @@ UIControl * UIItemContainer::OverFind( const Vector2f& Point ) { if ( mEnabled && mVisible && tParent->mItems.size() ) { UpdateQuad(); - if ( mPoly.PointInside( Point ) ) { + if ( mPoly.pointInside( Point ) ) { WriteCtrlFlag( UI_CTRL_FLAG_MOUSEOVER_ME_OR_CHILD, 1 ); for ( Uint32 i = tParent->mVisibleFirst; i <= tParent->mVisibleLast; i++ ) { diff --git a/src/eepp/gaming/gameobjectobject.cpp b/src/eepp/gaming/gameobjectobject.cpp index 73fda35cf..4acc7181b 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.pos() ), mDataId( DataId ), mSelected( false ) { @@ -30,7 +30,7 @@ bool GameObjectObject::IsType( const Uint32& type ) { } Sizei GameObjectObject::Size() { - Sizef size( mRect.Size() ); + Sizef size( mRect.size() ); return Sizei( size.x, size.y ); } @@ -53,7 +53,7 @@ Vector2f GameObjectObject::Pos() const { } void GameObjectObject::Pos( Vector2f pos ) { - mPoly.Move( pos - mPos ); + mPoly.move( pos - mPos ); mPos = pos; mRect = Rectf( pos, Sizef( Size().x, Size().y ) ); } @@ -62,33 +62,33 @@ void GameObjectObject::SetPolygonPoint( Uint32 index, Vector2f p ) { switch ( index ) { case 0: { - mPoly.SetAt( 1, Vector2f( p.x, mPoly[1].y ) ); - mPoly.SetAt( 3, Vector2f( mPoly[3].x, p.y ) ); + mPoly.setAt( 1, Vector2f( p.x, mPoly[1].y ) ); + mPoly.setAt( 3, Vector2f( mPoly[3].x, p.y ) ); break; } case 1: { - mPoly.SetAt( 0, Vector2f( p.x, mPoly[0].y ) ); - mPoly.SetAt( 2, Vector2f( mPoly[2].x, p.y ) ); + mPoly.setAt( 0, Vector2f( p.x, mPoly[0].y ) ); + mPoly.setAt( 2, Vector2f( mPoly[2].x, p.y ) ); break; } case 2: { - mPoly.SetAt( 3, Vector2f( p.x, mPoly[3].y ) ); - mPoly.SetAt( 1, Vector2f( mPoly[1].x, p.y ) ); + mPoly.setAt( 3, Vector2f( p.x, mPoly[3].y ) ); + mPoly.setAt( 1, Vector2f( mPoly[1].x, p.y ) ); break; } case 3: default: { - mPoly.SetAt( 2, Vector2f( p.x, mPoly[2].y ) ); - mPoly.SetAt( 0, Vector2f( mPoly[0].x, p.y ) ); + mPoly.setAt( 2, Vector2f( p.x, mPoly[2].y ) ); + mPoly.setAt( 0, Vector2f( mPoly[0].x, p.y ) ); break; } } - mPoly.SetAt( index, p ); - mRect = mPoly.ToAABB(); + mPoly.setAt( index, p ); + mRect = mPoly.toAABB(); mPos = Vector2f( mRect.Left, mRect.Top ); mPoly = mRect; } @@ -146,7 +146,7 @@ Polygon2f& GameObjectObject::GetPolygon() { } bool GameObjectObject::PointInside( const Vector2f& p ) { - return mRect.Contains( p ); + return mRect.contains( p ); } void GameObjectObject::SetProperties( const PropertiesMap& prop ) { diff --git a/src/eepp/gaming/gameobjectpolygon.cpp b/src/eepp/gaming/gameobjectpolygon.cpp index dc26b2cf0..6fbc9ef8f 100644 --- a/src/eepp/gaming/gameobjectpolygon.cpp +++ b/src/eepp/gaming/gameobjectpolygon.cpp @@ -7,7 +7,7 @@ using namespace EE::Graphics; namespace EE { namespace Gaming { GameObjectPolygon::GameObjectPolygon( Uint32 DataId, Polygon2f poly, MapLayer * Layer, const Uint32& Flags ) : - GameObjectObject( DataId, poly.ToAABB(), Layer, Flags ) + GameObjectObject( DataId, poly.toAABB(), Layer, Flags ) { mPoly = Polygon2f( poly ); } @@ -24,7 +24,7 @@ bool GameObjectPolygon::IsType( const Uint32& type ) { } Sizei GameObjectPolygon::Size() { - return Sizei( mRect.Size().x, mRect.Size().y ); + return Sizei( mRect.size().x, mRect.size().y ); } void GameObjectPolygon::Draw() { @@ -42,14 +42,14 @@ void GameObjectPolygon::Draw() { } void GameObjectPolygon::SetPolygonPoint( Uint32 index, Vector2f p ) { - mPoly.SetAt( index, p ); - mRect = mPoly.ToAABB(); + mPoly.setAt( index, p ); + mRect = mPoly.toAABB(); mPos = Vector2f( mRect.Left, mRect.Top ); } bool GameObjectPolygon::PointInside( const Vector2f& p ) { if ( GameObjectObject::PointInside( p ) ) { - return mPoly.PointInside( p ); + return mPoly.pointInside( p ); } return false; diff --git a/src/eepp/gaming/mapeditor/mapeditor.cpp b/src/eepp/gaming/mapeditor/mapeditor.cpp index a0e9f0ecb..13be271e7 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->Pos( Vector2i( mUIContainer->Size().Width() - mTileBox->Size().Width(), 0 ) ); + mTileBox->Size( 100, WinMenu->Size().height() ); + mTileBox->Pos( Vector2i( mUIContainer->Size().width() - mTileBox->Size().width(), 0 ) ); mTileBox->UpdateAnchorsDistances(); UIPopUpMenu * PU1 = mTheme->CreatePopUpMenu( mUIContainer ); @@ -161,8 +161,8 @@ void MapEditor::CreateWinMenu() { UIComplexControl::CreateParams Params; Params.Parent( mUIContainer ); - Params.PosSet( 0, WinMenu->Size().Height() ); - Params.SizeSet( mUIContainer->Size().Width(), mUIContainer->Size().Height() - WinMenu->Size().Height() ); + Params.PosSet( 0, WinMenu->Size().height() ); + Params.SizeSet( mUIContainer->Size().width(), mUIContainer->Size().height() - WinMenu->Size().height() ); 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().width() - Width - DistToBorder; Int32 DistFromTopMenu = 4; UIComplexControl::CreateParams CParams; CParams.Parent( mWinContainer ); - CParams.SizeSet( Sizei( Width + DistToBorder, mWinContainer->Size().Height() ) ); + CParams.SizeSet( Sizei( Width + DistToBorder, mWinContainer->Size().height() ) ); 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().height() - 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->Pos().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->Pos().y + Txt->Size().height() + 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->Pos().x + mGOTypeList->Size().Width() + 2, mGOTypeList->Pos().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->Pos().x + mGOTypeList->Size().width() + 2, mGOTypeList->Pos().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->Pos().y + mGOTypeList->Size().Height() + 4 ), TxtFlags ); + Txt = mTheme->CreateTextBox( "Layers:", mSubTextureCont, Sizei( Width, 16 ), Vector2i( TAB_CONT_X_DIST, mGOTypeList->Pos().y + mGOTypeList->Size().height() + 4 ), TxtFlags ); - mLayerList = mTheme->CreateDropDownList( mSubTextureCont, Sizei( Width, 21 ), Vector2i( TAB_CONT_X_DIST, Txt->Pos().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->Pos().y + Txt->Size().height() + 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->Pos().y + mLayerList->Size().Height() + 4 ), TxtFlags ); + Txt = mTheme->CreateTextBox( "Game Object Flags:", mSubTextureCont, Sizei( Width, 16 ), Vector2i( TAB_CONT_X_DIST, mLayerList->Pos().y + mLayerList->Size().height() + 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->Pos().y + Txt->Size().Height() + 4 ), ChkFlags ); + mChkMirrored = mTheme->CreateCheckBox( mSubTextureCont, Sizei(), Vector2i( TAB_CONT_X_DIST, Txt->Pos().y + Txt->Size().height() + 4 ), ChkFlags ); mChkMirrored->Text( "Mirrored" ); mChkMirrored->AddEventListener( UIEvent::EventMouseClick, cb::Make1( this, &MapEditor::ChkClickMirrored ) ); - mChkFliped = mTheme->CreateCheckBox( mSubTextureCont, Sizei(), Vector2i( mChkMirrored->Pos().x + mChkMirrored->Size().Width() + 32, mChkMirrored->Pos().y ), ChkFlags ); + mChkFliped = mTheme->CreateCheckBox( mSubTextureCont, Sizei(), Vector2i( mChkMirrored->Pos().x + mChkMirrored->Size().width() + 32, mChkMirrored->Pos().y ), ChkFlags ); mChkFliped->Text( "Fliped" ); mChkFliped->AddEventListener( UIEvent::EventMouseClick, cb::Make1( this, &MapEditor::ChkClickFliped ) ); - mChkBlocked = mTheme->CreateCheckBox( mSubTextureCont, Sizei(), Vector2i( mChkMirrored->Pos().x, mChkMirrored->Pos().y + mChkMirrored->Size().Height() + 4 ), ChkFlags ); + mChkBlocked = mTheme->CreateCheckBox( mSubTextureCont, Sizei(), Vector2i( mChkMirrored->Pos().x, mChkMirrored->Pos().y + mChkMirrored->Size().height() + 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->Pos().x, mChkFliped->Pos().y + mChkFliped->Size().Height() + 4 ), ChkFlags ); + mChkAnim = mTheme->CreateCheckBox( mSubTextureCont, Sizei(), Vector2i( mChkFliped->Pos().x, mChkFliped->Pos().y + mChkFliped->Size().height() + 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->Pos().x, mChkBlocked->Pos().y + mChkBlocked->Size().Height() + 4 ), ChkFlags ); + mChkRot90 = mTheme->CreateCheckBox( mSubTextureCont, Sizei(), Vector2i( mChkBlocked->Pos().x, mChkBlocked->Pos().y + mChkBlocked->Size().height() + 4 ), ChkFlags ); mChkRot90->Text( String::fromUtf8( "Rotate 90º" ) ); mChkRot90->AddEventListener( UIEvent::EventMouseClick, cb::Make1( this, &MapEditor::ChkClickRot90 ) ); - mChkAutoFix = mTheme->CreateCheckBox( mSubTextureCont, Sizei(), Vector2i( mChkAnim->Pos().x, mChkAnim->Pos().y + mChkAnim->Size().Height() + 4 ), ChkFlags ); + mChkAutoFix = mTheme->CreateCheckBox( mSubTextureCont, Sizei(), Vector2i( mChkAnim->Pos().x, mChkAnim->Pos().y + mChkAnim->Size().height() + 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->Pos().y + mChkRot90->Size().Height() + 8 ), TxtFlags ); + Txt = mTheme->CreateTextBox( "Game Object Data:", mSubTextureCont, Sizei( Width, 16 ), Vector2i( TAB_CONT_X_DIST, mChkRot90->Pos().y + mChkRot90->Size().height() + 8 ), TxtFlags ); - mChkDI = mTheme->CreateCheckBox( mSubTextureCont, Sizei(), Vector2i( TAB_CONT_X_DIST, Txt->Pos().y + Txt->Size().Height() + 4 ), ChkFlags ); + mChkDI = mTheme->CreateCheckBox( mSubTextureCont, Sizei(), Vector2i( TAB_CONT_X_DIST, Txt->Pos().y + Txt->Size().height() + 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.Parent( mSubTextureCont ); - SGParams.PosSet( Vector2i( TAB_CONT_X_DIST, mChkDI->Pos().y + mChkDI->Size().Height() + 8 ) ); + SGParams.PosSet( Vector2i( TAB_CONT_X_DIST, mChkDI->Pos().y + mChkDI->Size().height() + 8 ) ); SGParams.SizeSet( 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->Pos().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->Pos().y +Txt->Size().height() + 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->Pos().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->Pos().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->AddEventListener( UIEvent::EventOnItemSelected, cb::Make1( this, &MapEditor::OnSubTextureChange ) ); - mGfxPreview = mTheme->CreateGfx( NULL, mSGCont, Sizei( Width, Width ), Vector2i( 0, mSubTextureList->Pos().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->Pos().y + mSubTextureList->Size().height() + 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->Pos().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->Pos().y + Txt->Size().height() + 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().width() - 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.Parent( mLightCont ); - ComParams.PosSet( Txt->Pos().x, Txt->Pos().y + Txt->Size().Height() + 4 ); + ComParams.PosSet( Txt->Pos().x, Txt->Pos().y + Txt->Size().height() + 4 ); ComParams.SizeSet( 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->Pos().x + mUIBaseColor->Size().Width() + 4, mUIBaseColor->Pos().y ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); - mUIRedSlider = mTheme->CreateSlider( mLightCont, Sizei( 100, 20 ), Vector2i( Txt->Pos().x + Txt->Size().Width(), Txt->Pos().y ), UI_CONTROL_DEFAULT_FLAGS | UI_AUTO_SIZE ); + Txt = mTheme->CreateTextBox( "R:", mLightCont, Sizei(), Vector2i( mUIBaseColor->Pos().x + mUIBaseColor->Size().width() + 4, mUIBaseColor->Pos().y ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); + mUIRedSlider = mTheme->CreateSlider( mLightCont, Sizei( 100, 20 ), Vector2i( Txt->Pos().x + Txt->Size().width(), Txt->Pos().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->Pos().x + mUIRedSlider->Size().Width() + 4, mUIRedSlider->Pos().y ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); + mUIRedTxt = mTheme->CreateTextBox( String::toStr( (Uint32)255 ), mLightCont, Sizei(), Vector2i( mUIRedSlider->Pos().x + mUIRedSlider->Size().width() + 4, mUIRedSlider->Pos().y ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); - Txt = mTheme->CreateTextBox( "G:", mLightCont, Sizei(), Vector2i( mUIBaseColor->Pos().x + mUIBaseColor->Size().Width() + 4, mUIRedSlider->Pos().y + mUIRedSlider->Size().Height() + 4 ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); + Txt = mTheme->CreateTextBox( "G:", mLightCont, Sizei(), Vector2i( mUIBaseColor->Pos().x + mUIBaseColor->Size().width() + 4, mUIRedSlider->Pos().y + mUIRedSlider->Size().height() + 4 ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); mUIGreenSlider = mTheme->CreateSlider( mLightCont, Sizei( 100, 20 ), Vector2i( mUIRedSlider->Pos().x, Txt->Pos().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->Pos().x + mUIGreenSlider->Size().Width() + 4, mUIGreenSlider->Pos().y ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); + mUIGreenTxt = mTheme->CreateTextBox( String::toStr( (Uint32)255 ), mLightCont, Sizei(), Vector2i( mUIGreenSlider->Pos().x + mUIGreenSlider->Size().width() + 4, mUIGreenSlider->Pos().y ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); - Txt = mTheme->CreateTextBox( "B:", mLightCont, Sizei(), Vector2i( mUIBaseColor->Pos().x + mUIBaseColor->Size().Width() + 4, mUIGreenSlider->Pos().y + mUIGreenSlider->Size().Height() + 4 ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); + Txt = mTheme->CreateTextBox( "B:", mLightCont, Sizei(), Vector2i( mUIBaseColor->Pos().x + mUIBaseColor->Size().width() + 4, mUIGreenSlider->Pos().y + mUIGreenSlider->Size().height() + 4 ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); mUIBlueSlider = mTheme->CreateSlider( mLightCont, Sizei( 100, 20 ), Vector2i( mUIRedSlider->Pos().x, Txt->Pos().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->Pos().x + mUIBlueSlider->Size().Width() + 4, mUIBlueSlider->Pos().y ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); + mUIBlueTxt = mTheme->CreateTextBox( String::toStr( (Uint32)255 ), mLightCont, Sizei(), Vector2i( mUIBlueSlider->Pos().x + mUIBlueSlider->Size().width() + 4, mUIBlueSlider->Pos().y ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); - Txt = mTheme->CreateTextBox( "Light Radius:", mLightCont, Sizei(), Vector2i( TAB_CONT_X_DIST, mUIBlueTxt->Pos().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->Pos().y + mUIBlueTxt->Size().height() + 16 ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); - mLightRadius = mTheme->CreateSpinBox( mLightCont, Sizei( 100, 22 ), Vector2i( Txt->Pos().x, Txt->Pos().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->Pos().x, Txt->Pos().y + Txt->Size().height() + 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->Pos().x, mLightRadius->Pos().y + mLightRadius->Size().Height() + 8 ), UI_CONTROL_DEFAULT_FLAGS | UI_AUTO_SIZE ); + mLightTypeChk = mTheme->CreateCheckBox( mLightCont, Sizei(), Vector2i( mLightRadius->Pos().x, mLightRadius->Pos().y + mLightRadius->Size().height() + 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().width() - 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().height() + 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->Pos().y + Button->Size().Height() + 4; + Int32 nextY = Button->Pos().y + Button->Size().height() + 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().height(); } } @@ -455,14 +455,14 @@ void MapEditor::CreateUIMap() { SubTexture * tTex = VScrollSkin->GetSubTexture( UISkinState::StateNormal ); if ( NULL != tTex ) { - ScrollV = tTex->Size().Height(); + ScrollV = tTex->Size().height(); } } UIComplexControl::CreateParams Params; Params.Parent( mWinContainer ); Params.PosSet( 0, 0 ); - Params.SizeSet( mWinContainer->Size().Width() - 225 - ScrollV, mWinContainer->Size().Height() - ScrollH ); + Params.SizeSet( mWinContainer->Size().width() - 225 - ScrollV, mWinContainer->Size().height() - 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.width(), ScrollH ), Vector2i( 0, mWinContainer->Size().height() - 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.height() ), Vector2i( Params.Size.width() + ScrollV, 0 ), UI_ANCHOR_TOP | UI_ANCHOR_BOTTOM | UI_AUTO_SIZE , true ); mMapVScroll->AddEventListener( UIEvent::EventOnValueChange, cb::Make1( this, &MapEditor::OnScrollMapV ) ); MapCreated(); @@ -499,14 +499,14 @@ void MapEditor::OnAddObject( Uint32 Type, Polygon2f poly ) { return; } - if ( poly.Size() < 3 ) { + if ( poly.size() < 3 ) { return; } MapObjectLayer * OL = static_cast ( mCurLayer ); if ( GAMEOBJECT_TYPE_OBJECT == Type ) { - OL->AddGameObject( eeNew( GameObjectObject, ( mUIMap->Map()->GetNewObjectId(), poly.ToAABB(), mCurLayer ) ) ); + OL->AddGameObject( eeNew( GameObjectObject, ( mUIMap->Map()->GetNewObjectId(), poly.toAABB(), mCurLayer ) ) ); } else if ( GAMEOBJECT_TYPE_POLYGON == Type ) { OL->AddGameObject( eeNew( GameObjectPolygon, ( mUIMap->Map()->GetNewObjectId(), poly, mCurLayer ) ) ); } else if ( GAMEOBJECT_TYPE_POLYLINE == Type ) { @@ -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().width() * mUIMap->Map()->Scale() ); mMapVScroll->MinValue( 0 ); mMapVScroll->MaxValue( v.y ); - mMapVScroll->ClickStep( mUIMap->Map()->TileSize().Height() * mUIMap->Map()->Scale() ); + mMapVScroll->ClickStep( mUIMap->Map()->TileSize().height() * 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 6f5be7ce5..268401584 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->Container(), Sizei(192, 24), Vector2i( 50, mUIInput->Pos().y + mUIInput->Size().Height() + 12 ), TxtBoxFlags ); - UITextBox * TxtBox = mUITheme->CreateTextBox( "Property Value", mUIWindow->Container(), Sizei(192, 24), Vector2i( 50+192, mUIInput->Pos().y + mUIInput->Size().Height() + 12 ), TxtBoxFlags ); + mUITheme->CreateTextBox( "Property Name", mUIWindow->Container(), Sizei(192, 24), Vector2i( 50, mUIInput->Pos().y + mUIInput->Size().height() + 12 ), TxtBoxFlags ); + UITextBox * TxtBox = mUITheme->CreateTextBox( "Property Value", mUIWindow->Container(), Sizei(192, 24), Vector2i( 50+192, mUIInput->Pos().y + mUIInput->Size().height() + 12 ), TxtBoxFlags ); UIPushButton * OKButton = mUITheme->CreatePushButton( mUIWindow->Container(), Sizei( 80, 22 ), Vector2i(), UI_CONTROL_DEFAULT_FLAGS_CENTERED | UI_AUTO_SIZE, mUITheme->GetIconByName( "ok" ) ); - OKButton->Pos( mUIWindow->Container()->Size().Width() - OKButton->Size().Width() - 4, mUIWindow->Container()->Size().Height() - OKButton->Size().Height() - 4 ); + OKButton->Pos( mUIWindow->Container()->Size().width() - OKButton->Size().width() - 4, mUIWindow->Container()->Size().height() - OKButton->Size().height() - 4 ); OKButton->AddEventListener( UIEvent::EventMouseClick, cb::Make1( this, &MapLayerProperties::OKClick ) ); OKButton->Text( "OK" ); - UIPushButton * CancelButton = mUITheme->CreatePushButton( mUIWindow->Container(), OKButton->Size(), Vector2i( OKButton->Pos().x - OKButton->Size().Width() - 4, OKButton->Pos().y ), UI_CONTROL_DEFAULT_FLAGS_CENTERED | UI_AUTO_SIZE, mUITheme->GetIconByName( "cancel" ) ); + UIPushButton * CancelButton = mUITheme->CreatePushButton( mUIWindow->Container(), OKButton->Size(), Vector2i( OKButton->Pos().x - OKButton->Size().width() - 4, OKButton->Pos().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.Parent( mUIWindow->Container() ); - GridParams.PosSet( 50, TxtBox->Pos().y + TxtBox->Size().Height() ); + GridParams.PosSet( 50, TxtBox->Pos().y + TxtBox->Size().height() ); GridParams.SizeSet( 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->Pos().x + mGenGrid->Size().Width() + 10, mGenGrid->Pos().y ); + Vector2i Pos( mGenGrid->Pos().x + mGenGrid->Size().width() + 10, mGenGrid->Pos().y ); UIPushButton * AddButton = mUITheme->CreatePushButton( mUIWindow->Container(), 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().height() + 5; UIPushButton * RemoveButton = mUITheme->CreatePushButton( mUIWindow->Container(), 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 7bfffb086..f826c1050 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->Container(), Sizei(192, 24), Vector2i( 50, mUIInput->Pos().y + mUIInput->Size().Height() + 12 ), TxtBoxFlags ); - UITextBox * TxtBox = mUITheme->CreateTextBox( "Property Value", mUIWindow->Container(), Sizei(192, 24), Vector2i( 50+192, mUIInput->Pos().y + mUIInput->Size().Height() + 12 ), TxtBoxFlags ); + mUITheme->CreateTextBox( "Property Name", mUIWindow->Container(), Sizei(192, 24), Vector2i( 50, mUIInput->Pos().y + mUIInput->Size().height() + 12 ), TxtBoxFlags ); + UITextBox * TxtBox = mUITheme->CreateTextBox( "Property Value", mUIWindow->Container(), Sizei(192, 24), Vector2i( 50+192, mUIInput->Pos().y + mUIInput->Size().height() + 12 ), TxtBoxFlags ); UIPushButton * OKButton = mUITheme->CreatePushButton( mUIWindow->Container(), Sizei( 80, 22 ), Vector2i(), UI_CONTROL_DEFAULT_FLAGS_CENTERED | UI_AUTO_SIZE, mUITheme->GetIconByName( "ok" ) ); - OKButton->Pos( mUIWindow->Container()->Size().Width() - OKButton->Size().Width() - 4, mUIWindow->Container()->Size().Height() - OKButton->Size().Height() - 4 ); + OKButton->Pos( mUIWindow->Container()->Size().width() - OKButton->Size().width() - 4, mUIWindow->Container()->Size().height() - OKButton->Size().height() - 4 ); OKButton->AddEventListener( UIEvent::EventMouseClick, cb::Make1( this, &MapObjectProperties::OKClick ) ); OKButton->Text( "OK" ); - UIPushButton * CancelButton = mUITheme->CreatePushButton( mUIWindow->Container(), OKButton->Size(), Vector2i( OKButton->Pos().x - OKButton->Size().Width() - 4, OKButton->Pos().y ), UI_CONTROL_DEFAULT_FLAGS_CENTERED | UI_AUTO_SIZE, mUITheme->GetIconByName( "cancel" ) ); + UIPushButton * CancelButton = mUITheme->CreatePushButton( mUIWindow->Container(), OKButton->Size(), Vector2i( OKButton->Pos().x - OKButton->Size().width() - 4, OKButton->Pos().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.Parent( mUIWindow->Container() ); - GridParams.PosSet( 50, TxtBox->Pos().y + TxtBox->Size().Height() ); + GridParams.PosSet( 50, TxtBox->Pos().y + TxtBox->Size().height() ); GridParams.SizeSet( 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->Pos().x + mGenGrid->Size().Width() + 10, mGenGrid->Pos().y ); + Vector2i Pos( mGenGrid->Pos().x + mGenGrid->Size().width() + 10, mGenGrid->Pos().y ); UIPushButton * AddButton = mUITheme->CreatePushButton( mUIWindow->Container(), 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().height() + 5; UIPushButton * RemoveButton = mUITheme->CreatePushButton( mUIWindow->Container(), 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 68cc2fd29..3e5c658ce 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.Parent( mUIWindow->Container() ); - ComParams.PosSet( Txt->Pos().x, Txt->Pos().y + Txt->Size().Height() + 4 ); + ComParams.PosSet( Txt->Pos().x, Txt->Pos().y + Txt->Size().height() + 4 ); ComParams.SizeSet( 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->Container(), Sizei(), Vector2i( mUIBaseColor->Pos().x + mUIBaseColor->Size().Width() + 4, mUIBaseColor->Pos().y ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); - mUIRedSlider = mUITheme->CreateSlider( mUIWindow->Container(), Sizei( 255, 20 ), Vector2i( Txt->Pos().x + Txt->Size().Width() + 16, Txt->Pos().y ), UI_CONTROL_DEFAULT_FLAGS | UI_AUTO_SIZE ); + Txt = mUITheme->CreateTextBox( "Red Color:", mUIWindow->Container(), Sizei(), Vector2i( mUIBaseColor->Pos().x + mUIBaseColor->Size().width() + 4, mUIBaseColor->Pos().y ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); + mUIRedSlider = mUITheme->CreateSlider( mUIWindow->Container(), Sizei( 255, 20 ), Vector2i( Txt->Pos().x + Txt->Size().width() + 16, Txt->Pos().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->Container(), Sizei(), Vector2i( mUIRedSlider->Pos().x + mUIRedSlider->Size().Width() + 4, mUIRedSlider->Pos().y ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); + mUIRedTxt = mUITheme->CreateTextBox( String::toStr( (Uint32)mMap->BaseColor().r() ), mUIWindow->Container(), Sizei(), Vector2i( mUIRedSlider->Pos().x + mUIRedSlider->Size().width() + 4, mUIRedSlider->Pos().y ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); - Txt = mUITheme->CreateTextBox( "Green Color:", mUIWindow->Container(), Sizei(), Vector2i( mUIBaseColor->Pos().x + mUIBaseColor->Size().Width() + 4, mUIRedSlider->Pos().y + mUIRedSlider->Size().Height() + 4 ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); + Txt = mUITheme->CreateTextBox( "Green Color:", mUIWindow->Container(), Sizei(), Vector2i( mUIBaseColor->Pos().x + mUIBaseColor->Size().width() + 4, mUIRedSlider->Pos().y + mUIRedSlider->Size().height() + 4 ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); mUIGreenSlider = mUITheme->CreateSlider( mUIWindow->Container(), Sizei( 255, 20 ), Vector2i( mUIRedSlider->Pos().x, Txt->Pos().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->Container(), Sizei(), Vector2i( mUIGreenSlider->Pos().x + mUIGreenSlider->Size().Width() + 4, mUIGreenSlider->Pos().y ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); + mUIGreenTxt = mUITheme->CreateTextBox( String::toStr( (Uint32)mMap->BaseColor().g() ), mUIWindow->Container(), Sizei(), Vector2i( mUIGreenSlider->Pos().x + mUIGreenSlider->Size().width() + 4, mUIGreenSlider->Pos().y ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); - Txt = mUITheme->CreateTextBox( "Blue Color:", mUIWindow->Container(), Sizei(), Vector2i( mUIBaseColor->Pos().x + mUIBaseColor->Size().Width() + 4, mUIGreenSlider->Pos().y + mUIGreenSlider->Size().Height() + 4 ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); + Txt = mUITheme->CreateTextBox( "Blue Color:", mUIWindow->Container(), Sizei(), Vector2i( mUIBaseColor->Pos().x + mUIBaseColor->Size().width() + 4, mUIGreenSlider->Pos().y + mUIGreenSlider->Size().height() + 4 ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); mUIBlueSlider = mUITheme->CreateSlider( mUIWindow->Container(), Sizei( 255, 20 ), Vector2i( mUIRedSlider->Pos().x, Txt->Pos().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->Container(), Sizei(), Vector2i( mUIBlueSlider->Pos().x + mUIBlueSlider->Size().Width() + 4, mUIBlueSlider->Pos().y ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); + mUIBlueTxt = mUITheme->CreateTextBox( String::toStr( (Uint32)mMap->BaseColor().b() ), mUIWindow->Container(), Sizei(), Vector2i( mUIBlueSlider->Pos().x + mUIBlueSlider->Size().width() + 4, mUIBlueSlider->Pos().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->Container(), Sizei(192, 24), Vector2i(50+192, TxtBox->Pos().y ), TxtBoxFlags ); UIPushButton * OKButton = mUITheme->CreatePushButton( mUIWindow->Container(), Sizei( 80, 22 ), Vector2i(), UI_CONTROL_DEFAULT_FLAGS_CENTERED | UI_AUTO_SIZE, mUITheme->GetIconByName( "ok" ) ); - OKButton->Pos( mUIWindow->Container()->Size().Width() - OKButton->Size().Width() - 4, mUIWindow->Container()->Size().Height() - OKButton->Size().Height() - 4 ); + OKButton->Pos( mUIWindow->Container()->Size().width() - OKButton->Size().width() - 4, mUIWindow->Container()->Size().height() - OKButton->Size().height() - 4 ); OKButton->AddEventListener( UIEvent::EventMouseClick, cb::Make1( this, &TileMapProperties::OKClick ) ); OKButton->Text( "OK" ); - UIPushButton * CancelButton = mUITheme->CreatePushButton( mUIWindow->Container(), OKButton->Size(), Vector2i( OKButton->Pos().x - OKButton->Size().Width() - 4, OKButton->Pos().y ), UI_CONTROL_DEFAULT_FLAGS_CENTERED | UI_AUTO_SIZE, mUITheme->GetIconByName( "cancel" ) ); + UIPushButton * CancelButton = mUITheme->CreatePushButton( mUIWindow->Container(), OKButton->Size(), Vector2i( OKButton->Pos().x - OKButton->Size().width() - 4, OKButton->Pos().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->Pos().x + mGenGrid->Size().Width() + 10, mGenGrid->Pos().y ); + Vector2i Pos( mGenGrid->Pos().x + mGenGrid->Size().width() + 10, mGenGrid->Pos().y ); UIPushButton * AddButton = mUITheme->CreatePushButton( mUIWindow->Container(), 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().height() + 5; UIPushButton * RemoveButton = mUITheme->CreatePushButton( mUIWindow->Container(), 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 807376c71..203f8e868 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->Container(), Sizei( 120, 22 ), Vector2i( Txt->Pos().x + DistFromTitle, Txt->Pos().y + DistFromTitle ), UI_CONTROL_DEFAULT_FLAGS | UI_CLIP_ENABLE | UI_AUTO_PADDING | UI_AUTO_SIZE, true, 64 ); UIPushButton * OKButton = mUITheme->CreatePushButton( mUIWindow->Container(), Sizei( 80, 22 ), Vector2i(), UI_CONTROL_DEFAULT_FLAGS_CENTERED | UI_AUTO_SIZE, mUITheme->GetIconByName( "add" ) ); - OKButton->Pos( mUIWindow->Container()->Size().Width() - OKButton->Size().Width() - 4, mUIWindow->Container()->Size().Height() - OKButton->Size().Height() - 4 ); + OKButton->Pos( mUIWindow->Container()->Size().width() - OKButton->Size().width() - 4, mUIWindow->Container()->Size().height() - OKButton->Size().height() - 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->Container(), OKButton->Size(), Vector2i( OKButton->Pos().x - OKButton->Size().Width() - 4, OKButton->Pos().y ), UI_CONTROL_DEFAULT_FLAGS_CENTERED | UI_AUTO_SIZE, mUITheme->GetIconByName( "cancel" ) ); + UIPushButton * CancelButton = mUITheme->CreatePushButton( mUIWindow->Container(), OKButton->Size(), Vector2i( OKButton->Pos().x - OKButton->Size().width() - 4, OKButton->Pos().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 1c039b7cb..3e90e5fe2 100644 --- a/src/eepp/gaming/mapeditor/uimap.cpp +++ b/src/eepp/gaming/mapeditor/uimap.cpp @@ -120,7 +120,7 @@ void UIMap::Update() { mSelLight = NULL; } else if ( NULL != mSelLight ) { - if ( mSelLight->GetAABB().Contains( mMap->GetMouseMapPosf() ) ) { + if ( mSelLight->GetAABB().contains( mMap->GetMouseMapPosf() ) ) { mMap->GetLightManager()->RemoveLight( mSelLight ); eeSAFE_DELETE( mSelLight ); @@ -191,8 +191,8 @@ void UIMap::SelectPolyObj() { void UIMap::SelectPolyPoint() { if ( NULL != mCurLayer && mCurLayer->Type() == MAP_LAYER_OBJECT && NULL != mSelObj ) { if ( mSelObj->PointInside( mMap->GetMouseMapPosf() ) ) { - mSelPointIndex = mSelObj->GetPolygon().ClosestPoint( mMap->GetMouseMapPosf() ); - SetPointRect( mSelObj->GetPolygon().GetAt( mSelPointIndex ) ); + mSelPointIndex = mSelObj->GetPolygon().closestPoint( mMap->GetMouseMapPosf() ); + SetPointRect( mSelObj->GetPolygon().getAt( mSelPointIndex ) ); } } } @@ -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.pos().x < mp.x && mObjRECT.pos().y < mp.y ) { + mObjRECT = Rectf( mObjRECT.pos(), Sizef( mp - mObjRECT.pos() ) ); } } } @@ -253,11 +253,11 @@ void UIMap::ManageObject( Uint32 Flags ) { case INSERT_POLYGON: { if ( Flags & EE_BUTTON_LMASK ) { - mObjPoly.PushBack( GetMouseMapPos() ); + mObjPoly.pushBack( GetMouseMapPos() ); } else if ( Flags & EE_BUTTON_RMASK ) { mAddObjectCallback( ( INSERT_POLYGON == mEditingObjMode ) ? GAMEOBJECT_TYPE_POLYGON : GAMEOBJECT_TYPE_POLYLINE, mObjPoly ); - mObjPoly.Clear(); + mObjPoly.clear(); } break; @@ -282,7 +282,7 @@ void UIMap::ManageObject( Uint32 Flags ) { mSelPoint = false; } } else if ( !( LPFlags & EE_BUTTON_LMASK ) && ( PFlags & EE_BUTTON_LMASK ) ) { - if ( NULL != mSelObj && eeINDEX_NOT_FOUND != mSelPointIndex && mSelPointRect.Contains( mMap->GetMouseMapPosf() ) ) { + if ( NULL != mSelObj && eeINDEX_NOT_FOUND != mSelPointIndex && mSelPointRect.contains( mMap->GetMouseMapPosf() ) ) { mSelPoint = true; } } else if ( ( PFlags & EE_BUTTON_LMASK ) ) { @@ -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.size() ) ); } } else if ( EDITING_OBJECT == mEditingMode ) { switch ( mEditingObjMode ) { @@ -401,7 +401,7 @@ void UIMap::MapDraw() { mP.DrawPolygon( mObjPoly ); Polygon2f polyN( mObjPoly ); - polyN.PushBack( GetMouseMapPos() ); + polyN.pushBack( GetMouseMapPos() ); mP.FillMode( DRAW_FILL ); mP.SetColor( ColorA( 100, 100, 100, 100 ) ); @@ -420,7 +420,7 @@ void UIMap::MapDraw() { mP.DrawPolygon( mObjPoly ); Polygon2f polyN( mObjPoly ); - polyN.PushBack( GetMouseMapPos() ); + polyN.pushBack( GetMouseMapPos() ); mP.FillMode( DRAW_LINE ); mP.SetColor( ColorA( 255, 255, 0, 200 ) ); @@ -514,7 +514,7 @@ const bool& UIMap::ClampToTile() const { } void UIMap::EditingObjMode( EDITING_OBJ_MODE mode ) { - mObjPoly.Clear(); + mObjPoly.clear(); mSelPointIndex = eeINDEX_NOT_FOUND; mEditingObjMode = mode; diff --git a/src/eepp/gaming/mapeditor/uimaplayernew.cpp b/src/eepp/gaming/mapeditor/uimaplayernew.cpp index 387d59081..431cad807 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->Container(), Sizei( 80, 22 ), Vector2i(), UI_CONTROL_DEFAULT_FLAGS_CENTERED | UI_AUTO_SIZE, mTheme->GetIconByName( "add" ) ); - OKButton->Pos( mUIWindow->Container()->Size().Width() - OKButton->Size().Width() - 4, mUIWindow->Container()->Size().Height() - OKButton->Size().Height() - 4 ); + OKButton->Pos( mUIWindow->Container()->Size().width() - OKButton->Size().width() - 4, mUIWindow->Container()->Size().height() - OKButton->Size().height() - 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->Container(), OKButton->Size(), Vector2i( OKButton->Pos().x - OKButton->Size().Width() - 4, OKButton->Pos().y ), UI_CONTROL_DEFAULT_FLAGS_CENTERED | UI_AUTO_SIZE, mTheme->GetIconByName( "cancel" ) ); + UIPushButton * CancelButton = mTheme->CreatePushButton( mUIWindow->Container(), OKButton->Size(), Vector2i( OKButton->Pos().x - OKButton->Size().width() - 4, OKButton->Pos().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 fa6f87dac..6ea40ca69 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->Container(), Sizei( 46, 24 ), Vector2i( Txt->Pos().x + DistFromTitle, Txt->Pos().y + DistFromTitle ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW ); - mUIMapWidth = mTheme->CreateSpinBox( mUIWindow->Container(), Sizei( 53, 24 ), Vector2i( Txt->Pos().x + Txt->Size().Width(), Txt->Pos().y ), UI_CONTROL_DEFAULT_FLAGS | UI_TEXT_SELECTION_ENABLED, 100, false ); + mUIMapWidth = mTheme->CreateSpinBox( mUIWindow->Container(), Sizei( 53, 24 ), Vector2i( Txt->Pos().x + Txt->Size().width(), Txt->Pos().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().width() ); } - Txt = mTheme->CreateTextBox( "Height:", mUIWindow->Container(), Sizei( 46, 24 ), Vector2i( Txt->Pos().x, Txt->Pos().y + Txt->Size().Height() + 8 ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW ); + Txt = mTheme->CreateTextBox( "Height:", mUIWindow->Container(), Sizei( 46, 24 ), Vector2i( Txt->Pos().x, Txt->Pos().y + Txt->Size().height() + 8 ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW ); - mUIMapHeight = mTheme->CreateSpinBox( mUIWindow->Container(), Sizei( 53, 24 ), Vector2i( Txt->Pos().x + Txt->Size().Width(), Txt->Pos().y ), UI_CONTROL_DEFAULT_FLAGS | UI_TEXT_SELECTION_ENABLED, 100, false ); + mUIMapHeight = mTheme->CreateSpinBox( mUIWindow->Container(), Sizei( 53, 24 ), Vector2i( Txt->Pos().x + Txt->Size().width(), Txt->Pos().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().height() ); } - Txt = mTheme->CreateTextBox( "Tile Size", mUIWindow->Container(), Sizei(), Vector2i( mUIWindow->Container()->Size().Width() / 2, InitialY ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); + Txt = mTheme->CreateTextBox( "Tile Size", mUIWindow->Container(), Sizei(), Vector2i( mUIWindow->Container()->Size().width() / 2, InitialY ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); Txt = mTheme->CreateTextBox( "Width:", mUIWindow->Container(), Sizei( 46, 24 ), Vector2i( Txt->Pos().x + DistFromTitle, Txt->Pos().y + DistFromTitle ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW ); - mUIMapTWidth = mTheme->CreateSpinBox( mUIWindow->Container(), Sizei( 53, 24 ), Vector2i( Txt->Pos().x + Txt->Size().Width(), Txt->Pos().y ), UI_CONTROL_DEFAULT_FLAGS | UI_TEXT_SELECTION_ENABLED, 32, false ); + mUIMapTWidth = mTheme->CreateSpinBox( mUIWindow->Container(), Sizei( 53, 24 ), Vector2i( Txt->Pos().x + Txt->Size().width(), Txt->Pos().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().width() ); } - Txt = mTheme->CreateTextBox( "Height:", mUIWindow->Container(), Sizei( 46, 24 ), Vector2i( Txt->Pos().x, Txt->Pos().y + Txt->Size().Height() + 8 ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW ); + Txt = mTheme->CreateTextBox( "Height:", mUIWindow->Container(), Sizei( 46, 24 ), Vector2i( Txt->Pos().x, Txt->Pos().y + Txt->Size().height() + 8 ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW ); - mUIMapTHeight = mTheme->CreateSpinBox( mUIWindow->Container(), Sizei( 53, 24 ), Vector2i( Txt->Pos().x + Txt->Size().Width(), Txt->Pos().y ), UI_CONTROL_DEFAULT_FLAGS | UI_TEXT_SELECTION_ENABLED, 32, false ); + mUIMapTHeight = mTheme->CreateSpinBox( mUIWindow->Container(), Sizei( 53, 24 ), Vector2i( Txt->Pos().x + Txt->Size().width(), Txt->Pos().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().height() ); } - Txt = mTheme->CreateTextBox( "Max Layers", mUIWindow->Container(), Sizei(), Vector2i( 16, mUIMapTHeight->Pos().y + mUIMapTHeight->Size().Height() + 8 ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); + Txt = mTheme->CreateTextBox( "Max Layers", mUIWindow->Container(), Sizei(), Vector2i( 16, mUIMapTHeight->Pos().y + mUIMapTHeight->Size().height() + 8 ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); mUIMapMaxLayers = mTheme->CreateSpinBox( mUIWindow->Container(), Sizei( 53, 24 ), Vector2i( Txt->Pos().x + DistFromTitle, Txt->Pos().y + DistFromTitle ), UI_CONTROL_DEFAULT_FLAGS | UI_TEXT_SELECTION_ENABLED, 8, false ); mUIMapMaxLayers->MaxValue( 32 ); - Txt = mTheme->CreateTextBox( "Map Flags:", mUIWindow->Container(), Sizei(), Vector2i( Txt->Pos().x, mUIMapMaxLayers->Pos().y + mUIMapMaxLayers->Size().Height() + 8 ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); + Txt = mTheme->CreateTextBox( "Map Flags:", mUIWindow->Container(), Sizei(), Vector2i( Txt->Pos().x, mUIMapMaxLayers->Pos().y + mUIMapMaxLayers->Size().height() + 8 ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); - mUILightsEnabled = mTheme->CreateCheckBox( mUIWindow->Container(), Sizei(), Vector2i( Txt->Pos().x + DistFromTitle, Txt->Pos().y + Txt->Size().Height() + 16 ), UI_CONTROL_DEFAULT_FLAGS | UI_AUTO_SIZE ); + mUILightsEnabled = mTheme->CreateCheckBox( mUIWindow->Container(), Sizei(), Vector2i( Txt->Pos().x + DistFromTitle, Txt->Pos().y + Txt->Size().height() + 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->Container(), Sizei(), Vector2i( mUIWindow->Container()->Size().Width() / 2, mUILightsEnabled->Pos().y ), UI_CONTROL_DEFAULT_FLAGS | UI_AUTO_SIZE ); + mUILightsByVertex = mTheme->CreateCheckBox( mUIWindow->Container(), Sizei(), Vector2i( mUIWindow->Container()->Size().width() / 2, mUILightsEnabled->Pos().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->Container(), Sizei(), Vector2i( Txt->Pos().x + DistFromTitle, mUILightsEnabled->Pos().y + mUILightsEnabled->Size().Height() + 16 ), UI_CONTROL_DEFAULT_FLAGS | UI_AUTO_SIZE ); + mUIClampBorders = mTheme->CreateCheckBox( mUIWindow->Container(), Sizei(), Vector2i( Txt->Pos().x + DistFromTitle, mUILightsEnabled->Pos().y + mUILightsEnabled->Size().height() + 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->Container(), Sizei(), Vector2i( mUIWindow->Container()->Size().Width() / 2, mUIClampBorders->Pos().y ), UI_CONTROL_DEFAULT_FLAGS | UI_AUTO_SIZE ); + mUIClipArea = mTheme->CreateCheckBox( mUIWindow->Container(), Sizei(), Vector2i( mUIWindow->Container()->Size().width() / 2, mUIClampBorders->Pos().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->Container(), Sizei(), Vector2i( Txt->Pos().x, mUIClipArea->Pos().y + mUIClipArea->Size().Height() + 8 ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); + Txt = mTheme->CreateTextBox( "Map Base Color:", mUIWindow->Container(), Sizei(), Vector2i( Txt->Pos().x, mUIClipArea->Pos().y + mUIClipArea->Size().height() + 8 ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); UIComplexControl::CreateParams ComParams; ComParams.Parent( mUIWindow->Container() ); - ComParams.PosSet( Txt->Pos().x, Txt->Pos().y + Txt->Size().Height() + 4 ); + ComParams.PosSet( Txt->Pos().x, Txt->Pos().y + Txt->Size().height() + 4 ); ComParams.SizeSet( 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->Container(), Sizei(), Vector2i( mUIBaseColor->Pos().x + mUIBaseColor->Size().Width() + 4, mUIBaseColor->Pos().y ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); + Txt = mTheme->CreateTextBox( "Red Color:", mUIWindow->Container(), Sizei(), Vector2i( mUIBaseColor->Pos().x + mUIBaseColor->Size().width() + 4, mUIBaseColor->Pos().y ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); - mUIRedSlider = mTheme->CreateSlider( mUIWindow->Container(), Sizei( 128, 20 ), Vector2i( Txt->Pos().x + Txt->Size().Width() + 16, Txt->Pos().y ), UI_CONTROL_DEFAULT_FLAGS | UI_AUTO_SIZE ); + mUIRedSlider = mTheme->CreateSlider( mUIWindow->Container(), Sizei( 128, 20 ), Vector2i( Txt->Pos().x + Txt->Size().width() + 16, Txt->Pos().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->Container(), Sizei(), Vector2i( mUIRedSlider->Pos().x + mUIRedSlider->Size().Width() + 4, mUIRedSlider->Pos().y ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); + mUIRedTxt = mTheme->CreateTextBox( String::toStr( 255 ), mUIWindow->Container(), Sizei(), Vector2i( mUIRedSlider->Pos().x + mUIRedSlider->Size().width() + 4, mUIRedSlider->Pos().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->Container(), Sizei(), Vector2i( mUIBaseColor->Pos().x + mUIBaseColor->Size().Width() + 4, mUIRedSlider->Pos().y + mUIRedSlider->Size().Height() + 4 ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); + Txt = mTheme->CreateTextBox( "Green Color:", mUIWindow->Container(), Sizei(), Vector2i( mUIBaseColor->Pos().x + mUIBaseColor->Size().width() + 4, mUIRedSlider->Pos().y + mUIRedSlider->Size().height() + 4 ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); mUIGreenSlider = mTheme->CreateSlider( mUIWindow->Container(), Sizei( 128, 20 ), Vector2i( mUIRedSlider->Pos().x, Txt->Pos().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->Container(), Sizei(), Vector2i( mUIGreenSlider->Pos().x + mUIGreenSlider->Size().Width() + 4, mUIGreenSlider->Pos().y ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); + mUIGreenTxt = mTheme->CreateTextBox( String::toStr( 255 ), mUIWindow->Container(), Sizei(), Vector2i( mUIGreenSlider->Pos().x + mUIGreenSlider->Size().width() + 4, mUIGreenSlider->Pos().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->Container(), Sizei(), Vector2i( mUIBaseColor->Pos().x + mUIBaseColor->Size().Width() + 4, mUIGreenSlider->Pos().y + mUIGreenSlider->Size().Height() + 4 ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); + Txt = mTheme->CreateTextBox( "Blue Color:", mUIWindow->Container(), Sizei(), Vector2i( mUIBaseColor->Pos().x + mUIBaseColor->Size().width() + 4, mUIGreenSlider->Pos().y + mUIGreenSlider->Size().height() + 4 ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); mUIBlueSlider = mTheme->CreateSlider( mUIWindow->Container(), Sizei( 128, 20 ), Vector2i( mUIRedSlider->Pos().x, Txt->Pos().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->Container(), Sizei(), Vector2i( mUIBlueSlider->Pos().x + mUIBlueSlider->Size().Width() + 4, mUIBlueSlider->Pos().y ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); + mUIBlueTxt = mTheme->CreateTextBox( String::toStr( 255 ), mUIWindow->Container(), Sizei(), Vector2i( mUIBlueSlider->Pos().x + mUIBlueSlider->Size().width() + 4, mUIBlueSlider->Pos().y ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); if ( ResizeMap ) { mUIBlueSlider->Value( mUIMap->Map()->BaseColor().b() ); } UIPushButton * OKButton = mTheme->CreatePushButton( mUIWindow->Container(), Sizei( 80, 22 ), Vector2i(), UI_CONTROL_DEFAULT_FLAGS_CENTERED | UI_AUTO_SIZE, mTheme->GetIconByName( "ok" ) ); - OKButton->Pos( mUIWindow->Container()->Size().Width() - OKButton->Size().Width() - 4, mUIWindow->Container()->Size().Height() - OKButton->Size().Height() - 4 ); + OKButton->Pos( mUIWindow->Container()->Size().width() - OKButton->Size().width() - 4, mUIWindow->Container()->Size().height() - OKButton->Size().height() - 4 ); OKButton->AddEventListener( UIEvent::EventMouseClick, cb::Make1( this, &UIMapNew::OKClick ) ); OKButton->Text( "OK" ); - UIPushButton * CancelButton = mTheme->CreatePushButton( mUIWindow->Container(), OKButton->Size(), Vector2i( OKButton->Pos().x - OKButton->Size().Width() - 4, OKButton->Pos().y ), UI_CONTROL_DEFAULT_FLAGS_CENTERED | UI_AUTO_SIZE, mTheme->GetIconByName( "cancel" ) ); + UIPushButton * CancelButton = mTheme->CreatePushButton( mUIWindow->Container(), OKButton->Size(), Vector2i( OKButton->Pos().x - OKButton->Size().width() - 4, OKButton->Pos().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/maplight.cpp b/src/eepp/gaming/maplight.cpp index b366f4f51..4c1b318fb 100755 --- a/src/eepp/gaming/maplight.cpp +++ b/src/eepp/gaming/maplight.cpp @@ -32,7 +32,7 @@ RGB MapLight::ProcessVertex( const Float& PointX, const Float& PointY, const RGB if ( mActive ) { if ( mType == LIGHT_NORMAL ) - VertexDist = eeabs( mPos.Distance( Vector2f( PointX, PointY ) ) ); + VertexDist = eeabs( mPos.distance( Vector2f( PointX, PointY ) ) ); else { Float XDist = eeabs(mPos.x - PointX) * 0.5f; Float YDist = eeabs(mPos.y - PointY); @@ -72,7 +72,7 @@ ColorA MapLight::ProcessVertex( const Float& PointX, const Float& PointY, const if ( mActive ) { if ( mType == LIGHT_NORMAL ) - VertexDist = eeabs( mPos.Distance( Vector2f( PointX, PointY ) ) ); + VertexDist = eeabs( mPos.distance( Vector2f( PointX, PointY ) ) ); else { Float XDist = eeabs(mPos.x - PointX) * 0.5f; Float YDist = eeabs(mPos.y - PointY); diff --git a/src/eepp/gaming/maplightmanager.cpp b/src/eepp/gaming/maplightmanager.cpp index 136123c72..522867156 100644 --- a/src/eepp/gaming/maplightmanager.cpp +++ b/src/eepp/gaming/maplightmanager.cpp @@ -49,7 +49,7 @@ void MapLightManager::UpdateByVertex() { for ( LightsList::iterator it = mLights.begin(); it != mLights.end(); it++ ) { MapLight * Light = (*it); - if ( firstLight || VisibleArea.Intersect( Light->GetAABB() ) ) { + if ( firstLight || VisibleArea.intersect( Light->GetAABB() ) ) { for ( Int32 x = start.x; x < end.x; x++ ) { for ( Int32 y = start.y; y < end.y; y++ ) { if ( firstLight ) { @@ -63,20 +63,20 @@ void MapLightManager::UpdateByVertex() { eeAABB TileAABB( Pos.x, Pos.y, Pos.x + TileSize.x, Pos.y + TileSize.y ); - if ( TileAABB.Intersect( Light->GetAABB() ) ) { + if ( TileAABB.intersect( Light->GetAABB() ) ) { if ( y > 0 ) mTileColors[x][y][0]->assign( *mTileColors[x][y - 1][1] ); 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.height(), *(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.width(), Pos.y + TileSize.height(), *(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.width(), Pos.y, *(mTileColors[x][y][3]), *(mTileColors[x][y][3]) ) ); } } } @@ -102,7 +102,7 @@ void MapLightManager::UpdateByTile() { for ( LightsList::iterator it = mLights.begin(); it != mLights.end(); it++ ) { MapLight * Light = (*it); - if ( firstLight || VisibleArea.Intersect( Light->GetAABB() ) ) { + if ( firstLight || VisibleArea.intersect( Light->GetAABB() ) ) { for ( Int32 x = start.x; x < end.x; x++ ) { for ( Int32 y = start.y; y < end.y; y++ ) { if ( firstLight ) { @@ -116,8 +116,8 @@ 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]) ) ); + 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]) ) ); } } } @@ -136,7 +136,7 @@ ColorA MapLightManager::GetColorFromPos( const Vector2f& Pos ) { for ( LightsList::iterator it = mLights.begin(); it != mLights.end(); it++ ) { MapLight * Light = (*it); - if ( Light->GetAABB().Contains( Pos ) ) { + if ( Light->GetAABB().contains( Pos ) ) { Col = Light->ProcessVertex( Pos, Col, Col ); } } @@ -159,7 +159,7 @@ void MapLightManager::RemoveLight( const Vector2f& OverPos ) { for ( LightsList::reverse_iterator it = mLights.rbegin(); it != mLights.rend(); it++ ) { MapLight * Light = (*it); - if ( Light->GetAABB().Contains( OverPos ) ) { + if ( Light->GetAABB().contains( OverPos ) ) { mLights.remove( Light ); eeSAFE_DELETE( Light ); break; @@ -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.width() ); for ( Int32 x = 0; x < Size.x; x++ ) { - mTileColors[x] = eeNewArray( ColorA**, Size.Height() ); + mTileColors[x] = eeNewArray( ColorA**, Size.height() ); for ( Int32 y = 0; y < Size.y; y++ ) { mTileColors[x][y] = eeNewArray( ColorA*, mNumVertex ); @@ -243,7 +243,7 @@ MapLight * MapLightManager::GetLightOver( const Vector2f& OverPos, MapLight * Li for ( LightsList::reverse_iterator it = mLights.rbegin(); it != mLights.rend(); it++ ) { MapLight * Light = (*it); - if ( Light->GetAABB().Contains( OverPos ) ) { + if ( Light->GetAABB().contains( OverPos ) ) { if ( NULL == FirstLight ) { FirstLight = Light; } @@ -268,7 +268,7 @@ MapLight * MapLightManager::GetLightOver( const Vector2f& OverPos, MapLight * Li return FirstLight; } - if ( NULL == PivotLight && NULL != LightCurrent && LightCurrent->GetAABB().Contains( OverPos ) ) { + if ( NULL == PivotLight && NULL != LightCurrent && LightCurrent->GetAABB().contains( OverPos ) ) { return LightCurrent; } diff --git a/src/eepp/gaming/objectlayer.cpp b/src/eepp/gaming/objectlayer.cpp index 1430623fc..0846982b8 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().width(), Obj->Size().height(), 0, Vector2f::One, Col, Col, Col, Col ); } } } @@ -110,7 +110,7 @@ GameObject * MapObjectLayer::GetObjectOver( const Vector2i& pos, SEARCH_TYPE typ Recti objR( tPos.x, tPos.y, tPos.x + tSize.x, tPos.y + tSize.y ); - if ( objR.Contains( pos ) ) + if ( objR.contains( pos ) ) return tObj; } } else { @@ -125,7 +125,7 @@ GameObject * MapObjectLayer::GetObjectOver( const Vector2i& pos, SEARCH_TYPE typ Recti objR( tPos.x, tPos.y, tPos.x + tSize.x, tPos.y + tSize.y ); - if ( objR.Contains( pos ) ) + if ( objR.contains( pos ) ) return tObj; } } diff --git a/src/eepp/gaming/tilemap.cpp b/src/eepp/gaming/tilemap.cpp index 30664c6a7..186b974e7 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.width(), mTileSize.height(), 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.width(), mTileSize.height(), 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.width(); + mMouseOverTile.y = MapPos.y / mTileSize.height(); // Clamped pos - mMouseOverTileFinal.x = eemin( mMouseOverTile.x, mSize.Width() - 1 ); - mMouseOverTileFinal.y = eemin( mMouseOverTile.y, mSize.Height() - 1 ); + mMouseOverTileFinal.x = eemin( mMouseOverTile.x, mSize.width() - 1 ); + mMouseOverTileFinal.y = eemin( mMouseOverTile.y, mSize.height() - 1 ); mMouseOverTileFinal.x = eemax( mMouseOverTileFinal.x, 0 ); mMouseOverTileFinal.y = eemax( mMouseOverTileFinal.y, 0 ); @@ -353,8 +353,8 @@ void TileMap::CalcTilesClip() { if ( mStartTile.y < 0 ) mStartTile.y = 0; - mEndTile.x = mStartTile.x + Math::RoundUp( (Float)mViewSize.x / ( (Float)mTileSize.x * mScale ) ) + 1 + mExtraTiles.x; - mEndTile.y = mStartTile.y + Math::RoundUp( (Float)mViewSize.y / ( (Float)mTileSize.y * mScale ) ) + 1 + mExtraTiles.y; + mEndTile.x = mStartTile.x + Math::roundUp( (Float)mViewSize.x / ( (Float)mTileSize.x * mScale ) ) + 1 + mExtraTiles.x; + mEndTile.y = mStartTile.y + Math::roundUp( (Float)mViewSize.y / ( (Float)mTileSize.y * mScale ) ) + 1 + mExtraTiles.y; if ( mEndTile.x > mSize.x ) mEndTile.x = mSize.x; @@ -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.width(), -mOffset.y + mViewSize.height() ); } const eeAABB& TileMap::GetViewAreaAABB() const { @@ -634,7 +634,7 @@ GameObject * TileMap::CreateGameObject( const Uint32& Type, const Uint32& Flags, GameObjectObject * tObject = NULL; if ( GAMEOBJECT_TYPE_OBJECT == Type ) { - tObject = eeNew( GameObjectObject, ( DataId, ObjData.Poly.ToAABB(), Layer, Flags ) ); + tObject = eeNew( GameObjectObject, ( DataId, ObjData.Poly.toAABB(), Layer, Flags ) ); } else if ( GAMEOBJECT_TYPE_POLYGON == Type ) { tObject = eeNew( GameObjectPolygon, ( DataId, ObjData.Poly, Layer, Flags ) ); } else if ( GAMEOBJECT_TYPE_POLYLINE == Type ) { @@ -979,7 +979,7 @@ bool TileMap::LoadFromStream( IOStream& IOS ) { IOS.read( (char*)&p, sizeof(Vector2if) ); - tObjData.Poly.PushBack( Vector2f( p.x, p.y ) ); + tObjData.Poly.pushBack( Vector2f( p.x, p.y ) ); } mPolyObjs[ tOGOHdr.Id ] = tObjData; @@ -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.width(); + MapHdr.SizeY = mSize.height(); + MapHdr.TileSizeX = mTileSize.width(); + MapHdr.TileSizeY = mTileSize.height(); 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.size(); tObjObjHdr.PropertyCount = tObjObjProp.size(); //! Writes the ObjObj header @@ -1329,8 +1329,8 @@ void TileMap::SaveToStream( IOStream& IOS ) { } //! Writes the polygon points - for ( Uint32 tPoint = 0; tPoint < tPoly.Size(); tPoint++ ) { - Vector2f pf( tPoly.GetAt( tPoint ) ); + for ( Uint32 tPoint = 0; tPoint < tPoly.size(); tPoint++ ) { + Vector2f pf( tPoly.getAt( tPoint ) ); Vector2if p( pf.x, pf.y ); //! Convert it to Int32 IOS.write( (const char*)&p, sizeof(Vector2if) ); diff --git a/src/eepp/gaming/tilemaplayer.cpp b/src/eepp/gaming/tilemaplayer.cpp index 16dcd8591..f19f71029 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.width() ); for ( Int32 x = 0; x < mSize.x; x++ ) { - mTiles[x] = eeNewArray( GameObject*, mSize.Height() ); + mTiles[x] = eeNewArray( GameObject*, mSize.height() ); 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().width(), ( (Int32)Pos.y + mOffset.y ) / mMap->TileSize().height() ); } 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().width() + mOffset.x, TilePos.y * mMap->TileSize().height() + mOffset.y ); } }} diff --git a/src/eepp/graphics/batchrenderer.cpp b/src/eepp/graphics/batchrenderer.cpp index d57212e19..07676a5fe 100755 --- a/src/eepp/graphics/batchrenderer.cpp +++ b/src/eepp/graphics/batchrenderer.cpp @@ -349,9 +349,9 @@ void BatchRenderer::BatchQuadFreeEx( const Float& x0, const Float& y0, const Flo mQ.V[0].y = y0; mQ.V[1].y = y1; mQ.V[2].y = y2; mQ.V[3].y = y3; if ( Angle != 0 || Scale != 1.0f ) { - QCenter = mQ.GetCenter(); - mQ.Rotate( Angle, QCenter ); - mQ.Scale( Scale, QCenter ); + QCenter = mQ.getCenter(); + mQ.rotate( Angle, QCenter ); + mQ.scale( Scale, QCenter ); } SetBlendMode( DM_QUADS, mForceBlendMode ); @@ -756,16 +756,16 @@ void BatchRenderer::PolygonSetColor( const ColorA& Color ) { } void BatchRenderer::BatchPolygon( const Polygon2f& Polygon ) { - if ( Polygon.Size() > mVertexSize ) + if ( Polygon.size() > mVertexSize ) return; SetBlendMode( DM_POLYGON, mForceBlendMode ); - for ( Uint32 i = 0; i < Polygon.Size(); i++ ) { + for ( Uint32 i = 0; i < Polygon.size(); i++ ) { mTVertex = &mVertex[ mNumVertex ]; - mTVertex->pos.x = Polygon.X() + Polygon[i].x; - mTVertex->pos.y = Polygon.Y() + Polygon[i].y; + mTVertex->pos.x = Polygon.x() + Polygon[i].x; + mTVertex->pos.y = Polygon.y() + 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 c3ccbf5d3..96dd045ca 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.size().width(), rect.size().height(), mChannels ) ); // Copy per row for ( unsigned int ty = 0; ty < img->mHeight; ty++ ) { diff --git a/src/eepp/graphics/particlesystem.cpp b/src/eepp/graphics/particlesystem.cpp index 130352598..e1bb4bc8e 100755 --- a/src/eepp/graphics/particlesystem.cpp +++ b/src/eepp/graphics/particlesystem.cpp @@ -105,60 +105,60 @@ void ParticleSystem::Reset( Particle * P ) { } case PSE_BlueBall: { - P->Reset( mPos.x, mPos.y, -10, ( -1 * Math::Randf() ), 0.01f, Math::Randf(), mSize ); - P->Color( ColorAf( 0.25f ,0.25f ,1 ,1 ), 0.1f + ( 0.1f * Math::Randf() ) ); + P->Reset( mPos.x, mPos.y, -10, ( -1 * Math::randf() ), 0.01f, Math::randf(), mSize ); + P->Color( ColorAf( 0.25f ,0.25f ,1 ,1 ), 0.1f + ( 0.1f * Math::randf() ) ); break; } case PSE_Fire: { - x = ( mPos2.x - mPos.x + 1 ) * Math::Randf() + mPos.x; - y = ( mPos2.y - mPos.y + 1 ) * Math::Randf() + mPos.y; + x = ( mPos2.x - mPos.x + 1 ) * Math::randf() + mPos.x; + y = ( mPos2.y - mPos.y + 1 ) * Math::randf() + mPos.y; - P->Reset( x, y, Math::Randf() - 0.5f, ( Math::Randf() - 1.1f ) * 8.5f, 0.f, 0.05f, mSize ); - P->Color( ColorAf( 1.f, 0.5f, 0.1f, ( Math::Randf() * 0.5f ) ), Math::Randf() * 0.4f + 0.01f ); + P->Reset( x, y, Math::randf() - 0.5f, ( Math::randf() - 1.1f ) * 8.5f, 0.f, 0.05f, mSize ); + P->Color( ColorAf( 1.f, 0.5f, 0.1f, ( Math::randf() * 0.5f ) ), Math::randf() * 0.4f + 0.01f ); break; } case PSE_Smoke: { - x = ( mPos2.x - mPos.x + 1 ) * Math::Randf() + mPos.x; - y = ( mPos2.y - mPos.y + 1 ) * Math::Randf() + mPos.y; + x = ( mPos2.x - mPos.x + 1 ) * Math::randf() + mPos.x; + y = ( mPos2.y - mPos.y + 1 ) * Math::randf() + mPos.y; - P->Reset( x, y, -( Math::Randf() / 3.f + 0.1f ), ( ( Math::Randf() * 0.5f ) - 0.7f ) * 3, ( Math::Randf() / 200.f ), ( Math::Randf() - 0.5f ) / 200.f ); - P->Color( ColorAf( 0.8f, 0.8f, 0.8f, 0.3f ), ( Math::Randf() * 0.005f ) + 0.005f ); + P->Reset( x, y, -( Math::randf() / 3.f + 0.1f ), ( ( Math::randf() * 0.5f ) - 0.7f ) * 3, ( Math::randf() / 200.f ), ( Math::randf() - 0.5f ) / 200.f ); + P->Color( ColorAf( 0.8f, 0.8f, 0.8f, 0.3f ), ( Math::randf() * 0.005f ) + 0.005f ); break; } case PSE_Snow: { - x = ( mPos2.x - mPos.x + 1 ) * Math::Randf() + mPos.x; - y = ( mPos2.y - mPos.y + 1 ) * Math::Randf() + mPos.y; - w = ( Math::Randf() + 0.3f ) * 4; + x = ( mPos2.x - mPos.x + 1 ) * Math::randf() + mPos.x; + y = ( mPos2.y - mPos.y + 1 ) * Math::randf() + mPos.y; + w = ( Math::randf() + 0.3f ) * 4; - P->Reset( x, y, Math::Randf() - 0.5f, w, 0.f, 0.f, w * 3 ); + P->Reset( x, y, Math::randf() - 0.5f, w, 0.f, 0.f, w * 3 ); P->Color( ColorAf( 1.f, 1.f, 1.f, 0.5f ), 0 ); break; } case PSE_MagicFire: { - P->Reset( mPos.x + Math::Randf() , mPos.y, -0.4f + Math::Randf() * 0.8f, -0.5f - Math::Randf() * 0.4f, 0.f, -( Math::Randf() * 0.3f ) ); - P->Color( ColorAf( 1.f, 0.5f, 0.1f, 0.7f + 0.2f * Math::Randf() ), 0.01f + Math::Randf() * 0.05f ); + P->Reset( mPos.x + Math::randf() , mPos.y, -0.4f + Math::randf() * 0.8f, -0.5f - Math::randf() * 0.4f, 0.f, -( Math::randf() * 0.3f ) ); + P->Color( ColorAf( 1.f, 0.5f, 0.1f, 0.7f + 0.2f * Math::randf() ), 0.01f + Math::randf() * 0.05f ); break; } case PSE_LevelUp: { - P->Reset( mPos.x, mPos.y, Math::Randf() * 1.5f - 0.75f, Math::Randf() * 1.5f - 0.75f, Math::Randf() * 4 - 2, Math::Randf() * -4 + 2 ); - P->Color( ColorAf( 1.f, 0.5f, 0.1f, 1.f ), 0.07f + Math::Randf() * 0.01f ); + P->Reset( mPos.x, mPos.y, Math::randf() * 1.5f - 0.75f, Math::randf() * 1.5f - 0.75f, Math::randf() * 4 - 2, Math::randf() * -4 + 2 ); + P->Color( ColorAf( 1.f, 0.5f, 0.1f, 1.f ), 0.07f + Math::randf() * 0.01f ); break; } case PSE_LevelUp2: { - P->Reset( mPos.x + Math::Randf() * 32 - 16, mPos.y + Math::Randf() * 64 - 32, Math::Randf() - 0.5f, Math::Randf() - 0.5f, Math::Randf() - 0.5f, Math::Randf() * -0.9f + 0.45f ); - P->Color( ColorAf( 0.1f + Math::Randf() * 0.1f, 0.1f + Math::Randf() * 0.1f, 0.8f + Math::Randf() * 0.3f, 1 ), 0.07f + Math::Randf() * 0.01f ); + P->Reset( mPos.x + Math::randf() * 32 - 16, mPos.y + Math::randf() * 64 - 32, Math::randf() - 0.5f, Math::randf() - 0.5f, Math::randf() - 0.5f, Math::randf() * -0.9f + 0.45f ); + P->Color( ColorAf( 0.1f + Math::randf() * 0.1f, 0.1f + Math::randf() * 0.1f, 0.8f + Math::randf() * 0.3f, 1 ), 0.07f + Math::randf() * 0.01f ); break; } case PSE_Heal: { - P->Reset( mPos.x, mPos.y, Math::Randf() * 1.4f - 0.7f, Math::Randf() * -0.4f - 1.5f, Math::Randf() - 0.5f, Math::Randf() * -0.2f + 0.1f ); - P->Color( ColorAf( 0.2f, 0.3f, 0.9f, 0.4f ), 0.01f + Math::Randf() * 0.01f ); + P->Reset( mPos.x, mPos.y, Math::randf() * 1.4f - 0.7f, Math::randf() * -0.4f - 1.5f, Math::randf() - 0.5f, Math::randf() * -0.2f + 0.1f ); + P->Color( ColorAf( 0.2f, 0.3f, 0.9f, 0.4f ), 0.01f + Math::randf() * 0.01f ); break; } case PSE_WormHole: @@ -167,20 +167,20 @@ void ParticleSystem::Reset( Particle * P ) { Float VarB[4]; for ( lo = 0; lo <= 3; lo++ ) { - VarB[lo] = Math::Randf() * 5; - la = (int)( Math::Randf() * 8 ); + VarB[lo] = Math::randf() * 5; + la = (int)( Math::randf() * 8 ); if ( ( la * 0.5f ) != (int)( la * 0.5f ) ) VarB[lo] = -VarB[lo]; } - mProgression = (int) Math::Randf() * 10; + mProgression = (int) Math::randf() * 10; radio = ( P->Id() * 0.125f ) * mProgression; x = mPos.x + ( radio * eecos( (Float)P->Id() ) ); y = mPos.y + ( radio * eesin( (Float)P->Id() ) ); P->Reset( x, y, VarB[0], VarB[1], VarB[2], VarB[3] ); - P->Color( ColorAf( 1.f, 0.6f, 0.3f, 1.f ), 0.02f + Math::Randf() * 0.3f ); + P->Color( ColorAf( 1.f, 0.6f, 0.3f, 1.f ), 0.02f + Math::randf() * 0.3f ); break; } case PSE_Twirl: @@ -200,7 +200,7 @@ void ParticleSystem::Reset( Particle * P ) { y = mPos.y - z * eecos( q ); P->Reset( x, y, 1, 1, 0, 0 ); - P->Color( ColorAf( 1.f, 0.25f, 0.25f, 1 ), 0.6f + Math::Randf() * 0.3f ); + P->Color( ColorAf( 1.f, 0.25f, 0.25f, 1 ), 0.6f + Math::randf() * 0.3f ); break; } case PSE_Flower: @@ -210,17 +210,17 @@ void ParticleSystem::Reset( Particle * P ) { y = mPos.y + radio * eesin( (Float)P->Id() * 0.1f ); P->Reset( x, y, 1, 1, 0, 0 ); - P->Color( ColorAf( 1.f, 0.25f, 0.1f, 0.1f ), 0.3f + ( 0.2f * Math::Randf()) + Math::Randf() * 0.3f ); + P->Color( ColorAf( 1.f, 0.25f, 0.1f, 0.1f ), 0.3f + ( 0.2f * Math::randf()) + Math::randf() * 0.3f ); break; } case PSE_Galaxy: { - radio = ( Math::Randf( 1.f, 1.2f ) + eesin( 20.f / (Float)P->Id() ) ) * 60; + radio = ( Math::randf( 1.f, 1.2f ) + eesin( 20.f / (Float)P->Id() ) ) * 60; x = mPos.x + radio * eecos( (Float)P->Id() ); y = mPos.y + radio * eesin( (Float)P->Id() ); P->Reset( x, y, 0, 0, 0, 0 ); - P->Color( ColorAf( 0.2f, 0.2f, 0.6f + 0.4f * Math::Randf(), 1.f ), Math::Randf( 0.05f, 0.15f ) ); + P->Color( ColorAf( 0.2f, 0.2f, 0.6f + 0.4f * Math::randf(), 1.f ), Math::randf( 0.05f, 0.15f ) ); break; } case PSE_Heart: @@ -229,8 +229,8 @@ void ParticleSystem::Reset( Particle * P ) { x = mPos.x - 50 * eesin( q * 2 ) * eesqrt( eeabs( eecos( q ) ) ); y = mPos.y - 50 * eecos( q * 2 ) * eesqrt( eeabs( eesin( q ) ) ); - P->Reset( x, y, 0.f, 0.f, 0.f, -( Math::Randf() * 0.2f ) ); - P->Color( ColorAf( 1.f, 0.5f, 0.2f, 0.6f + 0.2f * Math::Randf() ), 0.01f + Math::Randf() * 0.08f ); + P->Reset( x, y, 0.f, 0.f, 0.f, -( Math::randf() * 0.2f ) ); + P->Color( ColorAf( 1.f, 0.5f, 0.2f, 0.6f + 0.2f * Math::randf() ), 0.01f + Math::randf() * 0.08f ); break; } case PSE_BlueExplosion: @@ -248,12 +248,12 @@ void ParticleSystem::Reset( Particle * P ) { } case PSE_GP: { - radio = 50 + Math::Randf() * 15 * eecos( (Float)P->Id() * 3.5f ); + radio = 50 + Math::randf() * 15 * eecos( (Float)P->Id() * 3.5f ); x = mPos.x + ( radio * eecos( (Float)P->Id() * (Float)0.01428571428 ) ); y = mPos.y + ( radio * eesin( (Float)P->Id() * (Float)0.01428571428 ) ); P->Reset( x, y, 0, 0, 0, 0 ); - P->Color( ColorAf( 0.2f, 0.8f, 0.4f, 0.5f ), Math::Randf() * 0.3f ); + P->Color( ColorAf( 0.2f, 0.8f, 0.4f, 0.5f ), Math::randf() * 0.3f ); break; } case PSE_BTwirl: @@ -272,7 +272,7 @@ void ParticleSystem::Reset( Particle * P ) { y = mPos.y - w * eecos( q ); P->Reset( x, y, 1, 1, 0, 0 ); - P->Color( ColorAf( 0.25f, 0.25f, 1.f, 1.f ), 0.1f + Math::Randf() * 0.3f + Math::Randf() * 0.3f ); + P->Color( ColorAf( 0.25f, 0.25f, 1.f, 1.f ), 0.1f + Math::randf() * 0.3f + Math::randf() * 0.3f ); break; } case PSE_BT: @@ -290,8 +290,8 @@ void ParticleSystem::Reset( Particle * P ) { x = mPos.x + w * eesin( q ); y = mPos.y - w * eecos( q ); - P->Reset( x, y, -10, -1 * Math::Randf(), 0, Math::Randf() ); - P->Color( ColorAf( 0.25f, 0.25f, 1.f, 1.f ), 0.1f + Math::Randf() * 0.1f + Math::Randf() * 0.3f ); + P->Reset( x, y, -10, -1 * Math::randf(), 0, Math::randf() ); + P->Color( ColorAf( 0.25f, 0.25f, 1.f, 1.f ), 0.1f + Math::randf() * 0.1f + Math::randf() * 0.3f ); break; } case PSE_Atomic: @@ -301,7 +301,7 @@ void ParticleSystem::Reset( Particle * P ) { y = mPos.y + radio * eesin( (Float)P->Id() * 0.033333 ); P->Reset( x, y, 1, 1, 0, 0 ); - P->Color( ColorAf( 0.4f, 0.25f, 1.f, 1.f ), 0.3f + Math::Randf() * 0.2f + Math::Randf() * 0.3f ); + P->Color( ColorAf( 0.4f, 0.25f, 1.f, 1.f ), 0.3f + Math::randf() * 0.2f + Math::randf() * 0.3f ); break; } case PSE_Callback: diff --git a/src/eepp/graphics/primitives.cpp b/src/eepp/graphics/primitives.cpp index c84b0e470..b30006480 100755 --- a/src/eepp/graphics/primitives.cpp +++ b/src/eepp/graphics/primitives.cpp @@ -172,8 +172,8 @@ void Primitives::DrawArc( const Vector2f& p, const Float& radius, Uint32 segment sBR->SetLineWidth( mLineWidth ); segmentsCount = Uint32( (Float)segmentsCount * (Float)eeabs( arcAngleA ) / 360 ); - Float startAngle = Math::Radians(arcStartAngle); - Float theta = Math::Radians(arcAngleA) / Float(segmentsCount - 1); + Float startAngle = Math::radians(arcStartAngle); + Float theta = Math::radians(arcAngleA) / Float(segmentsCount - 1); Float tangetialFactor = eetan(theta); Float radialFactor = eecos(theta); Float x = radius * eecos(startAngle); @@ -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)->size(); - sBR->BatchQuadEx( R.Left, R.Top, size.Width(), size.Height(), Angle, Scale ); + sBR->BatchQuadEx( R.Left, R.Top, size.width(), size.height(), 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)->size(); - Q.Scale( Scale ); - Q.Rotate( Angle, Vector2f( R.Left + size.Width() * 0.5f, R.Top + size.Height() * 0.5f ) ); + Q.scale( Scale ); + Q.rotate( Angle, Vector2f( R.Left + size.width() * 0.5f, R.Top + size.height() * 0.5f ) ); sBR->BatchLineLoop( Q[0].x, Q[0].y, Q[1].x, Q[1].y ); sBR->LineLoopSetColorFree( BottomRight, TopRight ); @@ -271,14 +271,14 @@ 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 )->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 ); Vector2f poly; - Poly.Rotate( Angle, Center ); + Poly.rotate( Angle, Center ); switch( mFillMode ) { case DRAW_FILL: @@ -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.size(); 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.size(); 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.size(); 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.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 ); break; } diff --git a/src/eepp/graphics/scrollparallax.cpp b/src/eepp/graphics/scrollparallax.cpp index 8a8175107..d1f2f638a 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().width(), (Float)mSubTexture->RealSize().height() ); - mTiles.x = ( (Int32)mSize.Width() / mSubTexture->RealSize().Width() ) + 1; - mTiles.y = ( (Int32)mSize.Height() / mSubTexture->RealSize().Height() ) + 1; + mTiles.x = ( (Int32)mSize.width() / mSubTexture->RealSize().width() ) + 1; + mTiles.y = ( (Int32)mSize.height() / mSubTexture->RealSize().height() ) + 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.width(), mInitPos.y + mSize.height() ); } 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.elapsed().asSeconds(); - if ( mPos.x > mAABB.Left + mRealSize.Width() || mPos.x < mAABB.Left - mRealSize.Width() ) + if ( mPos.x > mAABB.Left + mRealSize.width() || mPos.x < mAABB.Left - mRealSize.width() ) mPos.x = mAABB.Left; - if ( mPos.y > mAABB.Top + mRealSize.Height() || mPos.y < mAABB.Top - mRealSize.Height() ) + if ( mPos.y > mAABB.Top + mRealSize.height() || mPos.y < mAABB.Top - mRealSize.height() ) mPos.y = mAABB.Top; Vector2f Pos = mPos; @@ -96,24 +96,24 @@ void ScrollParallax::Draw() { Pos.y = (Float)(Int32)Pos.y; if ( mSpeed.x > 0.f ) - Pos.x -= mRealSize.Width(); + Pos.x -= mRealSize.width(); if ( mSpeed.y > 0.f ) - Pos.y -= mRealSize.Height(); + Pos.y -= mRealSize.height(); 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.width(), Pos.y + mRealSize.height() ); - if ( AABB.Intersect( mAABB ) ) { + if ( AABB.intersect( mAABB ) ) { if ( Pos.x < mAABB.Left ) { Rect.Left += (Int32)( mAABB.Left - Pos.x ); AABB.Left = mAABB.Left; } - if ( Pos.x + mRealSize.Width() > mAABB.Right ) { - Rect.Right -= (Int32)( ( Pos.x + mRealSize.Width() ) - mAABB.Right ); + if ( Pos.x + mRealSize.width() > mAABB.Right ) { + Rect.Right -= (Int32)( ( Pos.x + mRealSize.width() ) - 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.height() > mAABB.Bottom ) { + Rect.Bottom -= (Int32)( ( Pos.y + mRealSize.height() ) - 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.width(); } Pos.x = (Float)(Int32)mPos.x; if ( mSpeed.x > 0.f ) - Pos.x -= mRealSize.Width(); + Pos.x -= mRealSize.width(); - Pos.y += mRealSize.Height(); + Pos.y += mRealSize.height(); } mSubTexture->SrcRect( mRect ); diff --git a/src/eepp/graphics/sprite.cpp b/src/eepp/graphics/sprite.cpp index 6476b8eac..090e6ab66 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.center(); } else if ( mOrigin.OriginType == OriginPoint::OriginTopLeft ) { Center = mPos; } else { @@ -267,8 +267,8 @@ Quad2f Sprite::GetQuad() { break; } - Q.Rotate( mAngle, Center ); - Q.Scale( mScale, Center ); + Q.rotate( mAngle, Center ); + Q.scale( mScale, Center ); return Q; } @@ -282,21 +282,21 @@ eeAABB Sprite::GetAABB() { if ( mFrames.size() && ( S = GetCurrentSubTexture() ) ) { if ( mAngle != 0 || mEffect >= 4 ) { - return GetQuad().ToAABB(); + return GetQuad().toAABB(); } else { // The method used if mAngle != 0 works for mAngle = 0, but i prefer to use the faster way TmpR = Rectf( mPos.x, mPos.y, mPos.x + S->DestSize().x, mPos.y + S->DestSize().y ); Vector2f Center; if ( mOrigin.OriginType == OriginPoint::OriginCenter ) { - Center = TmpR.Center(); + Center = TmpR.center(); } else if ( mOrigin.OriginType == OriginPoint::OriginTopLeft ) { Center = mPos; } else { Center = mPos + mOrigin; } - TmpR.Scale( mScale, Center ); + TmpR.scale( mScale, Center ); } } diff --git a/src/eepp/graphics/subtexture.cpp b/src/eepp/graphics/subtexture.cpp index 4aa65683b..15813556a 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.size().width(), (Float)mSrcRect.size().height() ), 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.size().width(), mSrcRect.size().height(), 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.size(); } 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().width(), RealSize().height(), 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().width(), RealSize().height(), 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.size(); + mDestSize.x = (Float)Size.width(); + mDestSize.y = (Float)Size.height(); } }} diff --git a/src/eepp/graphics/texture.cpp b/src/eepp/graphics/texture.cpp index 715978f93..29fcce0a6 100755 --- a/src/eepp/graphics/texture.cpp +++ b/src/eepp/graphics/texture.cpp @@ -601,15 +601,15 @@ 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.center(); } else if ( Center.OriginType == OriginPoint::OriginTopLeft ) { - Center = TmpR.Pos(); + Center = TmpR.pos(); } else { - Center += TmpR.Pos(); + Center += TmpR.pos(); } - Q.Rotate( Angle, Center ); - Q.Scale( Scale, Center ); + Q.rotate( Angle, Center ); + Q.scale( Scale, Center ); } sBR->BatchQuadFree( Q[0].x, Q[0].y, Q[1].x, Q[1].y, Q[2].x, Q[2].y, Q[3].x, Q[3].y ); @@ -643,9 +643,9 @@ void Texture::DrawQuadEx( Quad2f Q, const Vector2f& Offset, const Float &Angle, sBR->QuadsSetColorFree( Color0, Color1, Color2, Color3 ); if ( Angle != 0 || Scale != 1.0f ) { - Vector2f QCenter( Q.GetCenter() ); - Q.Rotate( Angle, QCenter ); - Q.Scale( Scale, QCenter ); + Vector2f QCenter( Q.getCenter() ); + Q.rotate( Angle, QCenter ); + Q.scale( Scale, QCenter ); } if ( ClampMode() == CLAMP_REPEAT ) { @@ -654,7 +654,7 @@ void Texture::DrawQuadEx( Quad2f Q, const Vector2f& Offset, const Float &Angle, sBR->QuadsSetSubsetFree( texSector.Left / w, texSector.Top / h, texSector.Left / w, texSector.Bottom / h, texSector.Right / w, texSector.Bottom / h, texSector.Right / w, texSector.Top / h ); } - Q.Move( Offset ); + Q.move( Offset ); sBR->BatchQuadFreeEx( Q[0].x, Q[0].y, Q[1].x, Q[1].y, Q[2].x, Q[2].y, Q[3].x, Q[3].y ); diff --git a/src/eepp/graphics/texturefactory.cpp b/src/eepp/graphics/texturefactory.cpp index 1deb41958..ee4fd14d8 100755 --- a/src/eepp/graphics/texturefactory.cpp +++ b/src/eepp/graphics/texturefactory.cpp @@ -239,7 +239,7 @@ unsigned int TextureFactory::GetValidTextureSize( const unsigned int& Size ) { if ( GLi->IsExtension( EEGL_ARB_texture_non_power_of_two ) ) return Size; else - return Math::NextPowOfTwo(Size); + return Math::nextPowOfTwo(Size); } bool TextureFactory::SaveImage( const std::string& filepath, const EE_SAVE_TYPE& Format, const unsigned int& Width, const unsigned int& Height, const unsigned int& Channels, const unsigned char* data ) { diff --git a/src/eepp/graphics/texturepacker.cpp b/src/eepp/graphics/texturepacker.cpp index 98f4b2ae5..f42af5628 100644 --- a/src/eepp/graphics/texturepacker.cpp +++ b/src/eepp/graphics/texturepacker.cpp @@ -83,11 +83,11 @@ void TexturePacker::SetOptions( const Uint32& MaxWidth, const Uint32& MaxHeight, mWidth = MaxWidth; mHeight = MaxHeight; - if ( ForcePowOfTwo && !Math::IsPow2( mWidth ) ) - mWidth = Math::NextPowOfTwo( mWidth ); + if ( ForcePowOfTwo && !Math::isPow2( mWidth ) ) + mWidth = Math::nextPowOfTwo( mWidth ); - if ( ForcePowOfTwo && !Math::IsPow2( mHeight ) ) - mHeight = Math::NextPowOfTwo( mHeight ); + if ( ForcePowOfTwo && !Math::isPow2( mHeight ) ) + mHeight = Math::nextPowOfTwo( mHeight ); mForcePowOfTwo = ForcePowOfTwo; mAllowFlipping = AllowFlipping; diff --git a/src/eepp/graphics/texturepackernode.cpp b/src/eepp/graphics/texturepackernode.cpp index a992d7ff0..4c84e2617 100644 --- a/src/eepp/graphics/texturepackernode.cpp +++ b/src/eepp/graphics/texturepackernode.cpp @@ -54,7 +54,7 @@ void TexturePackerNode::Validate( TexturePackerNode * n ) { Recti r2; GetRect( r1 ); n->GetRect( r2 ); - eeASSERT( !r1.Intersect(r2) ); + eeASSERT( !r1.intersect(r2) ); } bool TexturePackerNode::Merge( const TexturePackerNode& n ) { diff --git a/src/eepp/graphics/ttffont.cpp b/src/eepp/graphics/ttffont.cpp index ffaca7ac8..e9032df11 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.size() ); if ( nGlyphS.x > 0 && nGlyphS.y > 0 ) { Uint32 Pos = 0; diff --git a/src/eepp/math/easing.cpp b/src/eepp/math/easing.cpp index b355e7fa8..1ae060f54 100644 --- a/src/eepp/math/easing.cpp +++ b/src/eepp/math/easing.cpp @@ -3,37 +3,37 @@ namespace EE { namespace Math { namespace easing { easingCbFunc easingCb[] = { - LinearInterpolation, - QuadraticIn, - QuadraticOut, - QuadraticInOut, - SineIn, - SineOut, - SineInOut, - ExponentialIn, - ExponentialOut, - ExponentialInOut, - QuarticIn, - QuarticOut, - QuarticInOut, - QuinticIn, - QuinticOut, - QuinticInOut, - CircularIn, - CircularOut, - CircularInOut, - CubicIn, - CubicOut, - CubicInOut, - BackIn, - BackOut, - BackInOut, - BounceIn, - BounceOut, - BounceInOut, - ElasticIn, - ElasticOut, - ElasticInOut + linearInterpolation, + quadraticIn, + quadraticOut, + quadraticInOut, + sineIn, + sineOut, + sineInOut, + exponentialIn, + exponentialOut, + exponentialInOut, + quarticIn, + quarticOut, + quarticInOut, + quinticIn, + quinticOut, + quinticInOut, + circularIn, + circularOut, + circularInOut, + cubicIn, + cubicOut, + cubicInOut, + backIn, + backOut, + backInOut, + bounceIn, + bounceOut, + bounceInOut, + elasticIn, + elasticOut, + elasticInOut }; }}} diff --git a/src/eepp/math/interpolation.cpp b/src/eepp/math/interpolation.cpp index e8f70bf6e..0187b02c7 100644 --- a/src/eepp/math/interpolation.cpp +++ b/src/eepp/math/interpolation.cpp @@ -25,7 +25,7 @@ Interpolation::Interpolation() : Interpolation::~Interpolation() { } -void Interpolation::Start( OnPathEndCallback PathEndCallback, OnStepCallback StepCallback) { +void Interpolation::start( OnPathEndCallback PathEndCallback, OnStepCallback StepCallback) { mEnable = true; mOnPathEndCallback = PathEndCallback; mOnStepCallback = StepCallback; @@ -42,19 +42,19 @@ void Interpolation::Start( OnPathEndCallback PathEndCallback, OnStepCallback Ste } } -void Interpolation::Stop() { +void Interpolation::stop() { mEnable = false; } -void Interpolation::SetPathEndCallback( OnPathEndCallback PathEndCallback ) { +void Interpolation::setPathEndCallback( OnPathEndCallback PathEndCallback ) { mOnPathEndCallback = PathEndCallback; } -void Interpolation::SetStepCallback( OnStepCallback StepCallback ) { +void Interpolation::setStepCallback( OnStepCallback StepCallback ) { mOnStepCallback = StepCallback; } -void Interpolation::Reset() { +void Interpolation::reset() { mTotDist = 0.f; mActP = mNexP = NULL; mEnable = false; @@ -68,19 +68,19 @@ void Interpolation::Reset() { mCurPos = mPoints[0].p; } -void Interpolation::ClearWaypoints() { - Reset(); +void Interpolation::clearWaypoints() { + reset(); mPoints.clear(); } -void Interpolation::AddWaypoint( const Float Pos, const Float Time ) { +void Interpolation::addWaypoint( const Float Pos, const Float Time ) { mPoints.push_back( Point1d( Pos, Time ) ); if ( mPoints.size() >= 2 ) mTotDist += eeabs( mPoints[ mPoints.size() - 1 ].p - mPoints[ mPoints.size() - 2 ].p ); } -bool Interpolation::EditWaypoint( const unsigned int& PointNum, const Float& NewPos, const Float NewTime ) { +bool Interpolation::editWaypoint( const unsigned int& PointNum, const Float& NewPos, const Float NewTime ) { if ( PointNum < mPoints.size() ) { if ( 0 == PointNum ) mTotDist -= eeabs( mPoints[ PointNum ].p - mPoints[ PointNum + 1 ].p ); @@ -101,7 +101,7 @@ bool Interpolation::EditWaypoint( const unsigned int& PointNum, const Float& New return false; } -bool Interpolation::EraseWaypoint( const unsigned int& PointNum ) { +bool Interpolation::eraseWaypoint( const unsigned int& PointNum ) { if ( PointNum < mPoints.size() && !mEnable ) { if ( 0 == PointNum ) mTotDist -= eeabs( mPoints[ PointNum ].p - mPoints[ PointNum + 1 ].p ); @@ -115,19 +115,19 @@ bool Interpolation::EraseWaypoint( const unsigned int& PointNum ) { return false; } -const Float& Interpolation::GetEndPos() { +const Float& Interpolation::getEndPos() { return mPoints[ mPoints.size() - 1 ].p; } -const Float& Interpolation::GetPos() { +const Float& Interpolation::getPos() { return mCurPos; } -const Float& Interpolation::GetRealPos() const { +const Float& Interpolation::getRealPos() const { return mCurPos; } -void Interpolation::Update( const Time& Elapsed ) { +void Interpolation::update( const Time& Elapsed ) { if ( mEnable && mPoints.size() > 1 && mCurPoint != mPoints.size() ) { if ( mUpdate ) { mCurTime = 0; @@ -178,7 +178,7 @@ void Interpolation::Update( const Time& Elapsed ) { } } -void Interpolation::SetTotalTime( const Time & TotTime ) { +void Interpolation::setTotalTime( const Time & TotTime ) { Float tdist = mTotDist; if ( tdist == 0.0f ) { @@ -197,7 +197,7 @@ void Interpolation::SetTotalTime( const Time & TotTime ) { } } -void Interpolation::Speed( const Float Speed ) { +void Interpolation::speed( const Float Speed ) { Float tdist = mTotDist; mSpeed = Speed; Float CurDist; @@ -225,51 +225,51 @@ void Interpolation::Speed( const Float Speed ) { } } -void Interpolation::Type( Ease::Interpolation InterpolationType ) { +void Interpolation::type( Ease::Interpolation InterpolationType ) { mType = InterpolationType; } -const int& Interpolation::Type() const { +const int& Interpolation::type() const { return mType; } -const bool& Interpolation::Loop() const { +const bool& Interpolation::loop() const { return mLoop; } -void Interpolation::Loop( const bool& loop ) { +void Interpolation::loop( const bool& loop ) { mLoop = loop; } -const bool& Interpolation::Ended() const { +const bool& Interpolation::ended() const { return mEnded; } -Point1d * Interpolation::GetCurrentActual() const { +Point1d * Interpolation::getCurrentActual() const { return mActP; } -Point1d * Interpolation::GetCurrentNext() const { +Point1d * Interpolation::getCurrentNext() const { return mNexP; } -const Uint32& Interpolation::GetCurrentPos() const { +const Uint32& Interpolation::getCurrentPos() const { return mCurPoint; } -const std::vector& Interpolation::GetPoints() const { +const std::vector& Interpolation::getPoints() const { return mPoints; } -const Float& Interpolation::Speed() const { +const Float& Interpolation::speed() const { return mSpeed; } -const bool& Interpolation::Enabled() const { +const bool& Interpolation::enabled() const { return mEnable; } -void Interpolation::Enabled( const bool& Enabled ) { +void Interpolation::enabled( const bool& Enabled ) { mEnable = Enabled; } diff --git a/src/eepp/math/mtrand.cpp b/src/eepp/math/mtrand.cpp index 3274c28db..73a138329 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 ); + seed( oneSeed ); } MTRand::MTRand() { - Seed(); + seed(); } MTRand::MTRand( const MTRand& o ) { @@ -24,7 +24,7 @@ MTRand::MTRand( const MTRand& o ) { mNext = &mState[ N - mLeft ]; } -void MTRand::Initialize( const Uint32 seed ) { +void MTRand::initialize( const Uint32 seed ) { register Uint32 *s = mState; register Uint32 *r = mState; @@ -39,7 +39,7 @@ void MTRand::Initialize( const Uint32 seed ) { } } -void MTRand::Reload() { +void MTRand::reload() { static const int MmN = int(M) - int(N); register Uint32 *p = mState; @@ -47,23 +47,23 @@ void MTRand::Reload() { register int i; for ( i = N - M; i--; ++p ) - *p = Twist( p[M], p[0], p[1] ); + *p = twist( p[M], p[0], p[1] ); for ( i = M; --i; ++p ) - *p = Twist( p[MmN], p[0], p[1] ); + *p = twist( p[MmN], p[0], p[1] ); - *p = Twist( p[MmN], p[0], mState[0] ); + *p = twist( p[MmN], p[0], mState[0] ); mLeft = N, mNext = mState; } -void MTRand::Seed( const Uint32 oneSeed ) { - Initialize( oneSeed ); - Reload(); +void MTRand::seed( const Uint32 oneSeed ) { + initialize( oneSeed ); + reload(); } -void MTRand::Seed() { - Seed( 0xFEDCBA09 ); +void MTRand::seed() { + seed( 0xFEDCBA09 ); } Uint32 MTRand::hiBit( const Uint32 u ) const { @@ -78,21 +78,21 @@ Uint32 MTRand::loBits( const Uint32 u ) const { return u & 0x7fffffffUL; } -Uint32 MTRand::MixBits( const Uint32 u, const Uint32 v ) const { +Uint32 MTRand::mixBits( const Uint32 u, const Uint32 v ) const { return hiBit(u) | loBits(v); } -Uint32 MTRand::Magic( const Uint32 u ) const { +Uint32 MTRand::magic( const Uint32 u ) const { return loBit(u) ? 0x9908b0dfUL : 0x0UL; } -Uint32 MTRand::Twist( const Uint32 m, const Uint32 s0, const Uint32 s1 ) const { - return m ^ ( MixBits( s0, s1 )>>1 ) ^ Magic(s1); +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::randi() { if ( mLeft == 0 ) - Reload(); + reload(); --mLeft; @@ -105,7 +105,7 @@ Uint32 MTRand::Randi() { return ( s1 ^ (s1 >> 18) ); } -Uint32 MTRand::Randi( const Uint32 n ) { +Uint32 MTRand::randi( 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 = randi() & used; } while ( i > n ); return i; } -double MTRand::Rand() { - return double( Randi() ) * ( 1.0 / 4294967295.0 ); +double MTRand::rand() { + return double( randi() ) * ( 1.0 / 4294967295.0 ); } -double MTRand::Rand( const double n ) { - return Rand() * n; +double MTRand::rand( const double n ) { + return rand() * n; } -Float MTRand::Randf() { - return (Float)Rand(); +Float MTRand::randf() { + return (Float)rand(); } -Float MTRand::Randf( const Float n ) { - return (Float)Rand(n); +Float MTRand::randf( const Float n ) { + return (Float)rand(n); } -int MTRand::RandRange( int Min, int Max ) { - return Min + Randi( Max - Min ); +int MTRand::randRange( int Min, int Max ) { + return Min + randi( Max - Min ); } -Float MTRand::RandRange( Float Min, Float Max ) { - return Min + Randf( Max - Min ); +Float MTRand::randRange( Float Min, Float Max ) { + return Min + randf( Max - Min ); } MTRand& MTRand::operator=( const MTRand& o ) { @@ -164,7 +164,7 @@ MTRand& MTRand::operator=( const MTRand& o ) { return (*this); } -void MTRand::Save( Uint32* saveArray ) const { +void MTRand::save( Uint32* saveArray ) const { register const Uint32 *s = mState; register Uint32 *sa = saveArray; register int i = N; @@ -172,7 +172,7 @@ void MTRand::Save( Uint32* saveArray ) const { *sa = mLeft; } -void MTRand::Load( Uint32 *const loadArray ) { +void MTRand::load( Uint32 *const loadArray ) { register Uint32 *s = mState; register Uint32 *la = loadArray; register int i = N; diff --git a/src/eepp/math/perlinnoise.cpp b/src/eepp/math/perlinnoise.cpp index 7be212e66..72f96a34d 100755 --- a/src/eepp/math/perlinnoise.cpp +++ b/src/eepp/math/perlinnoise.cpp @@ -4,12 +4,12 @@ namespace EE { namespace Math { PerlinNoise::PerlinNoise() { - Init(); + init(); } PerlinNoise::~PerlinNoise() {} -void PerlinNoise::Init() { +void PerlinNoise::init() { mPersistence = 0.25f; mOctaves = 4; mFrequency = 0.015f; @@ -18,7 +18,7 @@ void PerlinNoise::Init() { mAmpOctaveDep = false; } -Float PerlinNoise::PerlinNoise2D(Float x, Float y) { +Float PerlinNoise::perlinNoise2D(Float x, Float y) { Float total = 0; Float p = mPersistence; Float n = static_cast( mOctaves - 1 ); @@ -35,13 +35,13 @@ Float PerlinNoise::PerlinNoise2D(Float x, Float y) { amp *= p; } - total = total + InterpolatedNoise2D( x * tmpFreq, y * tmpFreq ) * amp; + total = total + interpolatedNoise2D( x * tmpFreq, y * tmpFreq ) * amp; } return total; } -Float PerlinNoise::Noise2D( Int32 x, Int32 y ) { +Float PerlinNoise::noise2D( Int32 x, Int32 y ) { Int32 n = x + y * 57; n = ( n << 13 ) ^ n; @@ -51,25 +51,25 @@ Float PerlinNoise::Noise2D( Int32 x, Int32 y ) { return static_cast( 1.0 - static_cast( n ) / 1073741824.0); } -Float PerlinNoise::SmoothedNoise2D(Float x, Float y) { +Float PerlinNoise::smoothedNoise2D(Float x, Float y) { register Int32 tx = static_cast( x ); register Int32 ty = static_cast( y ); - Float corners = ( Noise2D( tx - 1, ty - 1 ) + Noise2D( tx + 1, ty - 1 ) + Noise2D( tx - 1 , ty + 1 ) + Noise2D( tx + 1, ty + 1 ) ) / 16; - Float sides = ( Noise2D( tx - 1, ty ) + Noise2D( tx + 1, ty ) + Noise2D( tx , ty - 1 ) + Noise2D( tx , ty + 1 ) ) / 8; - Float center = Noise2D( tx, ty ) / 4; + Float corners = ( noise2D( tx - 1, ty - 1 ) + noise2D( tx + 1, ty - 1 ) + noise2D( tx - 1 , ty + 1 ) + noise2D( tx + 1, ty + 1 ) ) / 16; + Float sides = ( noise2D( tx - 1, ty ) + noise2D( tx + 1, ty ) + noise2D( tx , ty - 1 ) + noise2D( tx , ty + 1 ) ) / 8; + Float center = noise2D( tx, ty ) / 4; return corners + sides + center; } -Float PerlinNoise::Interpolate( Float a, Float b, Float x ) { +Float PerlinNoise::interpolate( Float a, Float b, Float x ) { Float fac1 = 3 * eepow( 1 - x, 2 ) - 2 * eepow( 1 - x, 3 ); Float fac2 = 3 * eepow( x, 2 ) - 2 * eepow( x, 3 ); return a * fac1 + b * fac2; //add the weighted factors } -Float PerlinNoise::InterpolatedNoise2D(Float x, Float y) { +Float PerlinNoise::interpolatedNoise2D(Float x, Float y) { Int32 eger_X = static_cast( x ); Int32 eger_Y = static_cast( y ); @@ -79,15 +79,15 @@ Float PerlinNoise::InterpolatedNoise2D(Float x, Float y) { Float feger_X = static_cast ( eger_X ); Float feger_Y = static_cast ( eger_Y ); - Float v1 = SmoothedNoise2D( feger_X , feger_Y ); - Float v2 = SmoothedNoise2D( feger_X + 1.f , feger_Y ); - Float v3 = SmoothedNoise2D( feger_X , feger_Y + 1.f ); - Float v4 = SmoothedNoise2D( feger_X + 1.f , feger_Y + 1.f ); + Float v1 = smoothedNoise2D( feger_X , feger_Y ); + Float v2 = smoothedNoise2D( feger_X + 1.f , feger_Y ); + Float v3 = smoothedNoise2D( feger_X , feger_Y + 1.f ); + Float v4 = smoothedNoise2D( feger_X + 1.f , feger_Y + 1.f ); - Float i1 = Interpolate( v1 , v2 , fractional_X ); - Float i2 = Interpolate( v3 , v4 , fractional_X ); + Float i1 = interpolate( v1 , v2 , fractional_X ); + Float i2 = interpolate( v3 , v4 , fractional_X ); - return Interpolate( i1 , i2 , fractional_Y ); + return interpolate( i1 , i2 , fractional_Y ); } }} diff --git a/src/eepp/math/waypoints.cpp b/src/eepp/math/waypoints.cpp index 5e10dee9f..cc48ed945 100755 --- a/src/eepp/math/waypoints.cpp +++ b/src/eepp/math/waypoints.cpp @@ -22,7 +22,7 @@ Waypoints::Waypoints() : Waypoints::~Waypoints() { } -void Waypoints::Start( OnPathEndCallback PathEndCallback, OnStepCallback StepCallback ) { +void Waypoints::start( OnPathEndCallback PathEndCallback, OnStepCallback StepCallback ) { mEnable = true; mOnPathEndCallback = PathEndCallback; mOnStepCallback = StepCallback; @@ -39,19 +39,19 @@ void Waypoints::Start( OnPathEndCallback PathEndCallback, OnStepCallback StepCal } } -void Waypoints::Stop() { +void Waypoints::stop() { mEnable = false; } -void Waypoints::SetPathEndCallback( OnPathEndCallback PathEndCallback ) { +void Waypoints::setPathEndCallback( OnPathEndCallback PathEndCallback ) { mOnPathEndCallback = PathEndCallback; } -void Waypoints::SetStepCallback( OnStepCallback StepCallback ) { +void Waypoints::setStepCallback( OnStepCallback StepCallback ) { mOnStepCallback = StepCallback; } -void Waypoints::Reset() { +void Waypoints::reset() { mTotDist = 0.f; mEnable = false; mCurPoint = 0; @@ -63,46 +63,46 @@ void Waypoints::Reset() { mCurPos = mPoints[0].p; } -void Waypoints::ClearWaypoints() { - Reset(); +void Waypoints::clearWaypoints() { + reset(); mPoints.clear(); } -void Waypoints::AddWaypoint( const Vector2f& Pos, const Float& Time ) { +void Waypoints::addWaypoint( const Vector2f& Pos, const Float& Time ) { mPoints.push_back( Waypoint(Pos, Time) ); if ( mPoints.size() >= 2 ) { - mTotDist += mPoints[ mPoints.size() - 1 ].p.Distance( mPoints[ mPoints.size() - 2 ].p ); + mTotDist += mPoints[ mPoints.size() - 1 ].p.distance( mPoints[ mPoints.size() - 2 ].p ); } } -bool Waypoints::EditWaypoint( const unsigned int& PointNum, const Vector2f& NewPos, const Float& NewTime ) { +bool Waypoints::editWaypoint( const unsigned int& PointNum, const Vector2f& NewPos, const Float& NewTime ) { if ( PointNum < mPoints.size() ) { if ( 0 == PointNum ) - mTotDist -= mPoints[ PointNum ].p.Distance( mPoints[ PointNum + 1 ].p ); + mTotDist -= mPoints[ PointNum ].p.distance( mPoints[ PointNum + 1 ].p ); else - mTotDist -= mPoints[ PointNum ].p.Distance( mPoints[ PointNum - 1 ].p ); + mTotDist -= mPoints[ PointNum ].p.distance( mPoints[ PointNum - 1 ].p ); mPoints[ PointNum ] = Waypoint( NewPos, NewTime ); if ( 0 == PointNum ) { if ( PointNum + (unsigned int)1 < mPoints.size() ) - mTotDist += mPoints[ PointNum ].p.Distance( mPoints[ PointNum + 1 ].p ); + mTotDist += mPoints[ PointNum ].p.distance( mPoints[ PointNum + 1 ].p ); } else - mTotDist += mPoints[ PointNum ].p.Distance( mPoints[ PointNum - 1 ].p ); + mTotDist += mPoints[ PointNum ].p.distance( mPoints[ PointNum - 1 ].p ); return true; } return false; } -bool Waypoints::EraseWaypoint( const unsigned int& PointNum ) { +bool Waypoints::eraseWaypoint( const unsigned int& PointNum ) { if ( PointNum < mPoints.size() && !mEnable ) { if ( 0 == PointNum ) - mTotDist -= mPoints[ PointNum ].p.Distance( mPoints[ PointNum + 1 ].p ); + mTotDist -= mPoints[ PointNum ].p.distance( mPoints[ PointNum + 1 ].p ); else - mTotDist -= mPoints[ PointNum ].p.Distance( mPoints[ PointNum - 1 ].p ); + mTotDist -= mPoints[ PointNum ].p.distance( mPoints[ PointNum - 1 ].p ); mPoints.erase( mPoints.begin() + PointNum ); @@ -111,7 +111,7 @@ bool Waypoints::EraseWaypoint( const unsigned int& PointNum ) { return false; } -void Waypoints::Speed( const Float& Speed ) { +void Waypoints::speed( const Float& Speed ) { Float tdist = mTotDist; mSpeed = Speed; Float CurDist; @@ -125,7 +125,7 @@ void Waypoints::Speed( const Float& Speed ) { Float TotTime = tdist * ( 1000.f / mSpeed ); if ( mLoop ) { - CurDist = mPoints[ mPoints.size() - 1 ].p.Distance( mPoints[0].p ); + CurDist = mPoints[ mPoints.size() - 1 ].p.distance( mPoints[0].p ); tdist += CurDist; mPoints[ mPoints.size() - 1 ].t = CurDist * TotTime / tdist; @@ -133,17 +133,17 @@ void Waypoints::Speed( const Float& Speed ) { } for ( unsigned int i = 0; i < mPoints.size() - 1; i++) { - CurDist = mPoints[i].p.Distance( mPoints[i + 1].p ); + CurDist = mPoints[i].p.distance( mPoints[i + 1].p ); mPoints[i].t = CurDist * TotTime / tdist; } } } -const Vector2f& Waypoints::GetPos() { +const Vector2f& Waypoints::getPos() { return mCurPos; } -void Waypoints::Update( const Time& Elapsed ) { +void Waypoints::update( const Time& Elapsed ) { if ( mEnable && mPoints.size() > 1 && mCurPoint != mPoints.size() ) { if ( mUpdate ) { mCurTime = 0; @@ -195,7 +195,7 @@ void Waypoints::Update( const Time& Elapsed ) { } } -void Waypoints::SetTotalTime( const Time& TotTime ) { +void Waypoints::setTotalTime( const Time& TotTime ) { unsigned int i; Float tdist = mTotDist; @@ -208,59 +208,59 @@ void Waypoints::SetTotalTime( const Time& TotTime ) { } if ( mLoop ) { - tdist += mPoints[ mPoints.size() - 1 ].p.Distance( mPoints[0].p ); - mPoints[ mPoints.size() - 1 ].t = mPoints[ mPoints.size() - 1 ].p.Distance( mPoints[0].p ) * TotTime.asMilliseconds() / tdist; + tdist += mPoints[ mPoints.size() - 1 ].p.distance( mPoints[0].p ); + mPoints[ mPoints.size() - 1 ].t = mPoints[ mPoints.size() - 1 ].p.distance( mPoints[0].p ) * TotTime.asMilliseconds() / tdist; } for (i = 0; i < mPoints.size() - 1; i++) - mPoints[i].t = mPoints[i].p.Distance( mPoints[i + 1].p ) * TotTime.asMilliseconds() / tdist; + mPoints[i].t = mPoints[i].p.distance( mPoints[i + 1].p ) * TotTime.asMilliseconds() / tdist; } -void Waypoints::Type( Ease::Interpolation InterpolationType ) { +void Waypoints::type( Ease::Interpolation InterpolationType ) { mType = InterpolationType; } -const int& Waypoints::Type() const { +const int& Waypoints::type() const { return mType; } -bool Waypoints::Loop() const { +bool Waypoints::loop() const { return mLoop; } -void Waypoints::Loop( const bool& loop ) { +void Waypoints::loop( const bool& loop ) { mLoop = loop; } -bool Waypoints::Ended() const { +bool Waypoints::ended() const { return mEnded; } -Waypoint * Waypoints::GetCurrentActual() const { +Waypoint * Waypoints::getCurrentActual() const { return mActP; } -Waypoint * Waypoints::GetCurrentNext() const { +Waypoint * Waypoints::getCurrentNext() const { return mNexP; } -const Uint32& Waypoints::GetCurrentPos() const { +const Uint32& Waypoints::getCurrentPos() const { return mCurPoint; } -const std::vector& Waypoints::GetWaypoints() const { +const std::vector& Waypoints::getWaypoints() const { return mPoints; } -const Float& Waypoints::Speed() const { +const Float& Waypoints::speed() const { return mSpeed; } -const bool& Waypoints::Enabled() const { +const bool& Waypoints::enabled() const { return mEnable; } -void Waypoints::Enabled( const bool& Enabled ) { +void Waypoints::enabled( const bool& Enabled ) { mEnable = Enabled; } diff --git a/src/eepp/ui/tools/textureatlaseditor.cpp b/src/eepp/ui/tools/textureatlaseditor.cpp index 0c70327b3..be62d6149 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; - CreateTxtBox( Vector2i( mUIContainer->Size().Width() - 205, 30 ), "SubTexture List:" ); + CreateTxtBox( Vector2i( mUIContainer->Size().width() - 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().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->AddEventListener( UIEvent::EventOnItemSelected, cb::Make1( this, &TextureAtlasEditor::OnSubTextureChange ) ); - CreateTxtBox( Vector2i( mUIContainer->Size().Width() - 205, InitY ), "Current SubTexture:" ); + CreateTxtBox( Vector2i( mUIContainer->Size().width() - 205, InitY ), "Current SubTexture:" ); InitY +=30; mSpinOffX = mTheme->CreateSpinBox( mUIContainer, Sizei( 100, 22 ), Vector2i(), Flags, 0, false ); mSpinOffX->MinValue( -32000 ); mSpinOffX->MaxValue( 32000 ); - mSpinOffX->Pos( mUIContainer->Size().Width() - mSpinOffX->Size().Width() - 10, InitY ); + mSpinOffX->Pos( mUIContainer->Size().width() - mSpinOffX->Size().width() - 10, InitY ); mSpinOffX->AddEventListener( UIEvent::EventOnValueChange, cb::Make1( this, &TextureAtlasEditor::OnOffXChange ) ); TxtBox = CreateTxtBox( Vector2i(), "Offset X:" ); - TxtBox->Pos( mSpinOffX->Pos().x - 10 - TxtBox->Size().Width(), InitY ); + TxtBox->Pos( mSpinOffX->Pos().x - 10 - TxtBox->Size().width(), InitY ); InitY +=30; mSpinOffY = mTheme->CreateSpinBox( mUIContainer, Sizei( 100, 22 ), Vector2i(), Flags, 0, false ); mSpinOffY->MinValue( -32000 ); mSpinOffY->MaxValue( 32000 ); - mSpinOffY->Pos( mUIContainer->Size().Width() - mSpinOffY->Size().Width() - 10, InitY ); + mSpinOffY->Pos( mUIContainer->Size().width() - mSpinOffY->Size().width() - 10, InitY ); mSpinOffY->AddEventListener( UIEvent::EventOnValueChange, cb::Make1( this, &TextureAtlasEditor::OnOffYChange ) ); TxtBox = CreateTxtBox( Vector2i(), "Offset Y:" ); - TxtBox->Pos( mSpinOffY->Pos().x - 10 - TxtBox->Size().Width(), InitY ); + TxtBox->Pos( mSpinOffY->Pos().x - 10 - TxtBox->Size().width(), InitY ); InitY +=30; mSpinDestW = mTheme->CreateSpinBox( mUIContainer, Sizei( 100, 22 ), Vector2i(), Flags, 0, false ); mSpinDestW->MaxValue( 32000 ); - mSpinDestW->Pos( mUIContainer->Size().Width() - mSpinDestW->Size().Width() - 10, InitY ); + mSpinDestW->Pos( mUIContainer->Size().width() - mSpinDestW->Size().width() - 10, InitY ); mSpinDestW->AddEventListener( UIEvent::EventOnValueChange, cb::Make1( this, &TextureAtlasEditor::OnDestWChange ) ); TxtBox = CreateTxtBox( Vector2i(), "Dest. Width:" ); - TxtBox->Pos( mSpinDestW->Pos().x - 10 - TxtBox->Size().Width(), InitY ); + TxtBox->Pos( mSpinDestW->Pos().x - 10 - TxtBox->Size().width(), InitY ); InitY +=30; mSpinDestH = mTheme->CreateSpinBox( mUIContainer, Sizei( 100, 22 ), Vector2i(), Flags, 0, false ); mSpinDestH->MaxValue( 32000 ); - mSpinDestH->Pos( mUIContainer->Size().Width() - mSpinDestH->Size().Width() - 10, InitY ); + mSpinDestH->Pos( mUIContainer->Size().width() - mSpinDestH->Size().width() - 10, InitY ); mSpinDestH->AddEventListener( UIEvent::EventOnValueChange, cb::Make1( this, &TextureAtlasEditor::OnDestHChange ) ); TxtBox = CreateTxtBox( Vector2i(), "Dest. Height:" ); - TxtBox->Pos( mSpinDestH->Pos().x - 10 - TxtBox->Size().Width(), InitY ); + TxtBox->Pos( mSpinDestH->Pos().x - 10 - TxtBox->Size().width(), 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->Pos().y + mSpinDestH->Size().Height() + 8 ), ButFlags ); + UIPushButton * ResetButton = mTheme->CreatePushButton( mUIContainer, Sizei( 120, 22 ), Vector2i( mUIContainer->Size().width() - 120 - 5 , mSpinDestH->Pos().y + mSpinDestH->Size().height() + 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->Pos().x, ResetButton->Pos().y + ResetButton->Size().Height() + 8 ), ButFlags ); + UIPushButton * ResetOffsetButton = mTheme->CreatePushButton( mUIContainer, Sizei( 120, 22 ), Vector2i( ResetButton->Pos().x, ResetButton->Pos().y + ResetButton->Size().height() + 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->Pos().x, ResetOffsetButton->Pos().y + ResetOffsetButton->Size().Height() + 8 ), ButFlags ); + UIPushButton * CenterOffsetButton = mTheme->CreatePushButton( mUIContainer, Sizei( 120, 22 ), Vector2i( ResetOffsetButton->Pos().x, ResetOffsetButton->Pos().y + ResetOffsetButton->Size().height() + 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->Pos().x, CenterOffsetButton->Pos().y + CenterOffsetButton->Size().Height() + 8 ), ButFlags ); + UIPushButton * HBOffsetButton = mTheme->CreatePushButton( mUIContainer, Sizei( 120, 22 ), Vector2i( CenterOffsetButton->Pos().x, CenterOffsetButton->Pos().y + CenterOffsetButton->Size().height() + 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.Parent( mUIContainer ); - Params.PosSet( 0, mWinMenu->Size().Height() ); + Params.PosSet( 0, mWinMenu->Size().height() ); Params.SizeSet( 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.width() ); + mSpinDestH->Value( RealSize.height() ); } } diff --git a/src/eepp/ui/tools/textureatlasnew.cpp b/src/eepp/ui/tools/textureatlasnew.cpp index 94029f84d..ebab07c53 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->Container()->Size().Width() - 110; + Int32 PosX = mUIWindow->Container()->Size().width() - 110; CreateTxtBox( Vector2i( 10, 20 ), "Save File Format:" ); mSaveFileType = mTheme->CreateDropDownList( mUIWindow->Container(), 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->Container(), 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->Container(), Sizei( mUIWindow->Container()->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->Container(), Sizei( mUIWindow->Container()->Size().width() - 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->Container(), Sizei( 32, 32 ), Vector2i( mUIWindow->Container()->Size().Width() - 10 - 32, 160 ) ); + mSetPathButton = mTheme->CreatePushButton( mUIWindow->Container(), Sizei( 32, 32 ), Vector2i( mUIWindow->Container()->Size().width() - 10 - 32, 160 ) ); mSetPathButton->Text( "..." ); mSetPathButton->AddEventListener( UIEvent::EventMouseClick, cb::Make1( this, &TextureAtlasNew::OnDialogFolderSelect ) ); UIPushButton * OKButton = mTheme->CreatePushButton( mUIWindow->Container(), Sizei( 80, 22 ), Vector2i(), UI_CONTROL_DEFAULT_FLAGS_CENTERED | UI_AUTO_SIZE, mTheme->GetIconByName( "ok" ) ); - OKButton->Pos( mUIWindow->Container()->Size().Width() - OKButton->Size().Width() - 4, mUIWindow->Container()->Size().Height() - OKButton->Size().Height() - 4 ); + OKButton->Pos( mUIWindow->Container()->Size().width() - OKButton->Size().width() - 4, mUIWindow->Container()->Size().height() - OKButton->Size().height() - 4 ); OKButton->AddEventListener( UIEvent::EventMouseClick, cb::Make1( this, &TextureAtlasNew::OKClick ) ); OKButton->Text( "OK" ); - UIPushButton * CancelButton = mTheme->CreatePushButton( mUIWindow->Container(), OKButton->Size(), Vector2i( OKButton->Pos().x - OKButton->Size().Width() - 4, OKButton->Pos().y ), UI_CONTROL_DEFAULT_FLAGS_CENTERED | UI_AUTO_SIZE, mTheme->GetIconByName( "cancel" ) ); + UIPushButton * CancelButton = mTheme->CreatePushButton( mUIWindow->Container(), OKButton->Size(), Vector2i( OKButton->Pos().x - OKButton->Size().width() - 4, OKButton->Pos().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 17a7a07a8..bc3a1e677 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.width(), mScreenPos.y + mUICenter.y ) ) ); + P.DrawLine( Line2f( Vector2f( mScreenPos.x + mUICenter.x, mScreenPos.y ), Vector2f( mScreenPos.x + mUICenter.x, mScreenPos.y + mSize.height() ) ) ); UIComplexControl::Draw(); } @@ -75,7 +75,7 @@ UIGfx * TextureAtlasSubTextureEditor::Gfx() const { } void TextureAtlasSubTextureEditor::GetCenter() { - mUICenter = Vector2i( mSize.Width() / 2, mSize.Height() / 2 ); + mUICenter = Vector2i( mSize.width() / 2, mSize.height() / 2 ); } }}} diff --git a/src/eepp/ui/uicheckbox.cpp b/src/eepp/ui/uicheckbox.cpp index 42c0f9303..b3cf738b3 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.width( (int)mTextCache->GetTextWidth() + mActiveButton->Size().width() ); } } @@ -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().width(); } UIControlAnim * UICheckBox::ActiveButton() const { diff --git a/src/eepp/ui/uicombobox.cpp b/src/eepp/ui/uicombobox.cpp index 5569fccf6..061397257 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().width(); } } UIControl::CreateParams Params; Params.Parent( this ), - Params.Size = Sizei( btnWidth, mSize.Height() ); - Params.PosSet( mSize.Width() - btnWidth, 0 ); + Params.Size = Sizei( btnWidth, mSize.height() ); + Params.PosSet( mSize.width() - 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 655109acd..2b99f4e46 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.width() < CDLG_MIN_WIDTH ) mSize.x = CDLG_MIN_WIDTH; - if ( mSize.Height() < CDLG_MIN_HEIGHT ) + if ( mSize.height() < CDLG_MIN_HEIGHT ) mSize.y = CDLG_MIN_HEIGHT; - if ( mMinWindowSize.Width() < CDLG_MIN_WIDTH ) - mMinWindowSize.Width( CDLG_MIN_WIDTH ); + if ( mMinWindowSize.width() < CDLG_MIN_WIDTH ) + mMinWindowSize.width( CDLG_MIN_WIDTH ); - if ( mMinWindowSize.Height() < CDLG_MIN_HEIGHT ) - mMinWindowSize.Height( CDLG_MIN_HEIGHT ); + if ( mMinWindowSize.height() < CDLG_MIN_HEIGHT ) + mMinWindowSize.height( 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.Parent( Container() ); - ButtonParams.PosSet( Container()->Size().Width() - 86, Container()->Size().Height() - 24 ); + ButtonParams.PosSet( Container()->Size().width() - 86, Container()->Size().height() - 24 ); ButtonParams.SizeSet( 80, 22 ); mButtonCancel = eeNew( UIPushButton, ( ButtonParams ) ); mButtonCancel->Visible( true ); mButtonCancel->Enabled( true ); mButtonCancel->Text( "Cancel" ); - mButtonCancel->Pos( Vector2i( mButtonCancel->Pos().x, Container()->Size().Height() - mButtonCancel->Size().Height() - 2 ) ); + mButtonCancel->Pos( Vector2i( mButtonCancel->Pos().x, Container()->Size().height() - mButtonCancel->Size().height() - 2 ) ); mButtonCancel->UpdateAnchorsDistances(); - ButtonParams.PosSet( mButtonCancel->Pos().x, mButtonCancel->Pos().y - mButtonCancel->Size().Height() ); + ButtonParams.PosSet( mButtonCancel->Pos().x, mButtonCancel->Pos().y - mButtonCancel->Size().height() ); mButtonOpen = eeNew( UIPushButton, ( ButtonParams ) ); mButtonOpen->Visible( true ); mButtonOpen->Enabled( true ); @@ -68,14 +68,14 @@ UICommonDialog::UICommonDialog( const UICommonDialog::CreateParams& Params ) : TInputParams.Parent( Container() ); 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.PosSet( 70, 6 ); - TInputParams.SizeSet( Container()->Size().Width() - TInputParams.Pos.x - 42, 22 ); + TInputParams.SizeSet( Container()->Size().width() - 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.PosSet( TInputParams.Pos.x + TInputParams.Size.Width() + 6, TInputParams.Pos.y ); + ButtonParams.PosSet( TInputParams.Pos.x + TInputParams.Size.width() + 6, TInputParams.Pos.y ); ButtonParams.SizeSet( 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.Parent( Container() ); - LBParams.PosSet( 6, mButtonUp->Pos().y + mButtonUp->Size().Height() + 4 ); - LBParams.Size = Sizei( Container()->Size().Width() - 12, - Container()->Size().Height() - - mButtonUp->Size().Height() - + LBParams.PosSet( 6, mButtonUp->Pos().y + mButtonUp->Size().height() + 4 ); + LBParams.Size = Sizei( Container()->Size().width() - 12, + Container()->Size().height() - + mButtonUp->Size().height() - mButtonUp->Pos().y - - mButtonOpen->Size().Height() - - mButtonCancel->Size().Height() - + mButtonOpen->Size().height() - + mButtonCancel->Size().height() - 8 ); @@ -108,7 +108,7 @@ UICommonDialog::UICommonDialog( const UICommonDialog::CreateParams& Params ) : mList->Visible( true ); mList->Enabled( true ); - TxtBoxParams.PosSet( 6, Container()->Size().Height() - 54 ); + TxtBoxParams.PosSet( 6, Container()->Size().height() - 54 ); TxtBoxParams.SizeSet( 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.PosSet( TBox->Pos().x, TBox->Pos().y + TBox->Size().Height()+ 6 ); + TxtBoxParams.PosSet( TBox->Pos().x, TBox->Pos().y + TBox->Size().height()+ 6 ); UITextBox * TBox2 = eeNew( UITextBox, ( TxtBoxParams ) ); TBox2->Visible( true ); TBox2->Enabled( false ); TBox2->Text( "Files of type:" ); TInputParams.Flags &= ~UI_ANCHOR_TOP; - TInputParams.PosSet( TBox->Pos().x + TBox->Size().Width(), TBox->Pos().y ); - TInputParams.SizeSet( Container()->Size().Width() - mButtonOpen->Size().Width() - TInputParams.Pos.x - 20, TInputParams.Size.Height() ); + TInputParams.PosSet( TBox->Pos().x + TBox->Size().width(), TBox->Pos().y ); + TInputParams.SizeSet( Container()->Size().width() - mButtonOpen->Size().width() - TInputParams.Pos.x - 20, TInputParams.Size.height() ); mFile = eeNew( UITextInput, ( TInputParams ) ); mFile->Visible( true ); mFile->Enabled( true ); @@ -132,8 +132,8 @@ UICommonDialog::UICommonDialog( const UICommonDialog::CreateParams& Params ) : UIDropDownList::CreateParams DDLParams; DDLParams.Parent( Container() ); - DDLParams.PosSet( TBox2->Pos().x + TBox2->Size().Width(), TBox2->Pos().y ); - DDLParams.SizeSet( Container()->Size().Width() - mButtonCancel->Size().Width() - DDLParams.Pos.x - 20, 22 ); + DDLParams.PosSet( TBox2->Pos().x + TBox2->Size().width(), TBox2->Pos().y ); + DDLParams.SizeSet( Container()->Size().width() - mButtonCancel->Size().width() - 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().height() ) ); } } diff --git a/src/eepp/ui/uicomplexcontrol.cpp b/src/eepp/ui/uicomplexcontrol.cpp index e96813a43..9e9492cf5 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().width() > UIManager::instance()->MainControl()->Size().width() ) { + Pos.x = UIManager::instance()->GetMousePos().x - mTooltip->Size().width(); } - 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().height() > UIManager::instance()->MainControl()->Size().height() ) { + Pos.y = UIManager::instance()->GetMousePos().y - mTooltip->Size().height(); } 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().width() - mPos.x - mDistToBorder.Right; - if ( newSize.x < mMinControlSize.Width() ) - newSize.x = mMinControlSize.Width(); + if ( newSize.x < mMinControlSize.width() ) + newSize.x = mMinControlSize.width(); } } @@ -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.height() ) + newSize.y = mMinControlSize.height(); } } diff --git a/src/eepp/ui/uicontrol.cpp b/src/eepp/ui/uicontrol.cpp index 2dacf4251..42852c1b3 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.width() && Pos.y < mSize.height() ); } void UIControl::Pos( const Vector2i& Pos ) { @@ -222,14 +222,14 @@ void UIControl::CenterHorizontal() { UIControl * Ctrl = Parent(); if ( NULL != Ctrl ) - Pos( Vector2i( ( Ctrl->Size().Width() / 2 ) - ( mSize.Width() / 2 ), mPos.y ) ); + Pos( Vector2i( ( Ctrl->Size().width() / 2 ) - ( mSize.width() / 2 ), mPos.y ) ); } void UIControl::CenterVertical(){ UIControl * Ctrl = Parent(); if ( NULL != Ctrl ) - Pos( Vector2i( mPos.x, ( Ctrl->Size().Height() / 2 ) - ( mSize.Height() / 2 ) ) ); + Pos( Vector2i( mPos.x, ( Ctrl->Size().height() / 2 ) - ( mSize.height() / 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.width(), (Float)mSize.height(), 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.width(), (Float)mSize.height() ) ); } 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.width() - 0.1f, (Float)mSize.height() - 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.width(), mSize.height() + 1 ); else - UIManager::instance()->ClipEnable( mScreenPos.x, mScreenPos.y, mSize.Width(), mSize.Height() ); + UIManager::instance()->ClipEnable( mScreenPos.x, mScreenPos.y, mSize.width(), mSize.height() ); } } @@ -804,7 +804,7 @@ UIControl * UIControl::OverFind( const Vector2f& Point ) { if ( mEnabled && mVisible ) { UpdateQuad(); - if ( mPoly.PointInside( Point ) ) { + if ( mPoly.pointInside( Point ) ) { WriteCtrlFlag( UI_CTRL_FLAG_MOUSEOVER_ME_OR_CHILD, 1 ); UIControl * ChildLoop = mChildLast; @@ -838,7 +838,7 @@ UIControl * UIControl::ChildGetAt( Vector2i CtrlPos, unsigned int RecursiveLevel if ( !pLoop->Visible() ) continue; - if ( pLoop->Rect().Contains( CtrlPos ) ) { + if ( pLoop->Rect().contains( CtrlPos ) ) { if ( RecursiveLevel ) Ctrl = ChildGetAt( CtrlPos - pLoop->Pos(), RecursiveLevel - 1 ); @@ -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.width(), mScreenPosf.y + mSize.height() ) ); UIControl * tParent = Parent(); @@ -883,8 +883,8 @@ void UIControl::UpdateQuad() { if ( tParent->IsAnimated() ) { UIControlAnim * tP = reinterpret_cast ( tParent ); - mPoly.Rotate( tP->Angle(), tP->RotationCenter() ); - mPoly.Scale( tP->Scale(), tP->ScaleCenter() ); + mPoly.rotate( tP->Angle(), tP->RotationCenter() ); + mPoly.scale( tP->Scale(), tP->ScaleCenter() ); } tParent = 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.width() * 0.5f, mScreenPosf.y + (Float)mSize.height() * 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().width(); } if ( PadRight ) { tSubTexture = tComplex->GetSubTextureSide( UISkinState::StateNormal, UISkinComplex::Right ); if ( NULL != tSubTexture ) - tPadding.Right = tSubTexture->RealSize().Width(); + tPadding.Right = tSubTexture->RealSize().width(); } if ( PadTop ) { tSubTexture = tComplex->GetSubTextureSide( UISkinState::StateNormal, UISkinComplex::Up ); if ( NULL != tSubTexture ) - tPadding.Top = tSubTexture->RealSize().Height(); + tPadding.Top = tSubTexture->RealSize().height(); } if ( PadBottom ) { tSubTexture = tComplex->GetSubTextureSide( UISkinState::StateNormal, UISkinComplex::Down ); if ( NULL != tSubTexture ) - tPadding.Bottom = tSubTexture->RealSize().Height(); + tPadding.Bottom = tSubTexture->RealSize().height(); } } } @@ -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().height(); } tSubTexture = SkinC->GetSubTextureSide( State, UISkinComplex::Down ); if ( NULL != tSubTexture ) { - tSize.y += tSubTexture->RealSize().Height(); + tSize.y += tSubTexture->RealSize().height(); } tSubTexture = SkinC->GetSubTextureSide( State, UISkinComplex::Left ); if ( NULL != tSubTexture ) { - tSize.x += tSubTexture->RealSize().Width(); + tSize.x += tSubTexture->RealSize().width(); } tSubTexture = SkinC->GetSubTextureSide( State, UISkinComplex::Right ); if ( NULL != tSubTexture ) { - tSize.x += tSubTexture->RealSize().Width(); + tSize.x += tSubTexture->RealSize().width(); } } } @@ -1254,14 +1254,14 @@ void UIControl::WorldToControl( Vector2i& pos ) const { Center = tP->ScaleOriginPoint() * scale; scale *= tP->Scale(); - pPos.Scale( scale, pPos + Center ); + pPos.scale( scale, pPos + Center ); } Pos -= pPos; if ( NULL != tP && 0.f != tP->Angle() ) { Center = tP->RotationOriginPoint() * scale; - Pos.Rotate( -tP->Angle(), Center ); + Pos.rotate( -tP->Angle(), Center ); } } @@ -1293,8 +1293,8 @@ void UIControl::ControlToWorld( Vector2i& pos ) const { Vector2f CenterAngle( pPos.x + tP->mRotationOriginPoint.x, pPos.y + tP->mRotationOriginPoint.y ); Vector2f CenterScale( pPos.x + tP->mScaleOriginPoint.x, pPos.y + tP->mScaleOriginPoint.y ); - Pos.Rotate( tP->Angle(), CenterAngle ); - Pos.Scale( tP->Scale(), CenterScale ); + Pos.rotate( tP->Angle(), CenterAngle ); + Pos.scale( tP->Scale(), CenterScale ); } } diff --git a/src/eepp/ui/uicontrolanim.cpp b/src/eepp/ui/uicontrolanim.cpp index 818f995b1..561441a23 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.width(), (Float)mSize.height(), (Uint32)mAlpha ); if ( UIManager::instance()->HighlightFocus() && UIManager::instance()->FocusControl() == this ) { Primitives P; @@ -187,19 +187,19 @@ void UIControlAnim::MatrixUnset() { void UIControlAnim::Update() { UIDragable::Update(); - if ( NULL != mMoveAnim && mMoveAnim->Enabled() ) { - mMoveAnim->Update( Elapsed() ); - Pos( (int)mMoveAnim->GetPos().x, (int)mMoveAnim->GetPos().y ); + if ( NULL != mMoveAnim && mMoveAnim->enabled() ) { + mMoveAnim->update( Elapsed() ); + Pos( (int)mMoveAnim->getPos().x, (int)mMoveAnim->getPos().y ); - if ( mMoveAnim->Ended() ) + if ( mMoveAnim->ended() ) eeSAFE_DELETE( mMoveAnim ); } - if ( NULL != mAlphaAnim && mAlphaAnim->Enabled() ) { - mAlphaAnim->Update( Elapsed() ); - Alpha( mAlphaAnim->GetRealPos() ); + if ( NULL != mAlphaAnim && mAlphaAnim->enabled() ) { + mAlphaAnim->update( Elapsed() ); + Alpha( mAlphaAnim->getRealPos() ); - if ( mAlphaAnim->Ended() ) { + if ( mAlphaAnim->ended() ) { if ( ( mControlFlags & UI_CTRL_FLAG_CLOSE_FO ) ) Close(); @@ -213,19 +213,19 @@ void UIControlAnim::Update() { } } - if ( NULL != mScaleAnim && mScaleAnim->Enabled() ) { - mScaleAnim->Update( Elapsed() ); - Scale( mScaleAnim->GetPos() ); + if ( NULL != mScaleAnim && mScaleAnim->enabled() ) { + mScaleAnim->update( Elapsed() ); + Scale( mScaleAnim->getPos() ); - if ( mScaleAnim->Ended() ) + if ( mScaleAnim->ended() ) eeSAFE_DELETE( mScaleAnim ); } - if ( NULL != mAngleAnim && mAngleAnim->Enabled() ) { - mAngleAnim->Update( Elapsed() ); - Angle( mAngleAnim->GetRealPos() ); + if ( NULL != mAngleAnim && mAngleAnim->enabled() ) { + mAngleAnim->update( Elapsed() ); + Angle( mAngleAnim->getRealPos() ); - if ( mAngleAnim->Ended() ) + if ( mAngleAnim->ended() ) eeSAFE_DELETE( mAngleAnim ); } } @@ -235,19 +235,19 @@ bool UIControlAnim::FadingOut() { } bool UIControlAnim::Animating() { - return ( NULL != mAlphaAnim && mAlphaAnim->Enabled() ) || ( NULL != mAngleAnim && mAngleAnim->Enabled() ) || ( NULL != mScaleAnim && mScaleAnim->Enabled() ) || ( NULL != mMoveAnim && mMoveAnim->Enabled() ); + return ( NULL != mAlphaAnim && mAlphaAnim->enabled() ) || ( NULL != mAngleAnim && mAngleAnim->enabled() ) || ( NULL != mScaleAnim && mScaleAnim->enabled() ) || ( NULL != mMoveAnim && mMoveAnim->enabled() ); } Interpolation * UIControlAnim::StartAlphaAnim( const Float& From, const Float& To, const Time& TotalTime, const bool& AlphaChilds, const Ease::Interpolation& Type, Interpolation::OnPathEndCallback PathEndCallback ) { if ( NULL == mAlphaAnim ) mAlphaAnim = eeNew( Interpolation, () ); - mAlphaAnim->ClearWaypoints(); - mAlphaAnim->AddWaypoint( From ); - mAlphaAnim->AddWaypoint( To ); - mAlphaAnim->SetTotalTime( TotalTime ); - mAlphaAnim->Start( PathEndCallback ); - mAlphaAnim->Type( Type ); + mAlphaAnim->clearWaypoints(); + mAlphaAnim->addWaypoint( From ); + mAlphaAnim->addWaypoint( To ); + mAlphaAnim->setTotalTime( TotalTime ); + mAlphaAnim->start( PathEndCallback ); + mAlphaAnim->type( Type ); Alpha( From ); @@ -273,12 +273,12 @@ Waypoints * UIControlAnim::StartScaleAnim( const Vector2f& From, const Vector2f& if ( NULL == mScaleAnim ) mScaleAnim = eeNew( Waypoints, () ); - mScaleAnim->ClearWaypoints(); - mScaleAnim->AddWaypoint( From ); - mScaleAnim->AddWaypoint( To ); - mScaleAnim->SetTotalTime( TotalTime ); - mScaleAnim->Start( PathEndCallback ); - mScaleAnim->Type( Type ); + mScaleAnim->clearWaypoints(); + mScaleAnim->addWaypoint( From ); + mScaleAnim->addWaypoint( To ); + mScaleAnim->setTotalTime( TotalTime ); + mScaleAnim->start( PathEndCallback ); + mScaleAnim->type( Type ); Scale( From ); @@ -293,12 +293,12 @@ Waypoints * UIControlAnim::StartMovement( const Vector2i& From, const Vector2i& if ( NULL == mMoveAnim ) mMoveAnim = eeNew( Waypoints, () ); - mMoveAnim->ClearWaypoints(); - mMoveAnim->AddWaypoint( Vector2f( (Float)From.x, (Float)From.y ) ); - mMoveAnim->AddWaypoint( Vector2f( (Float)To.x, (Float)To.y ) ); - mMoveAnim->SetTotalTime( TotalTime ); - mMoveAnim->Start( PathEndCallback ); - mMoveAnim->Type( Type ); + mMoveAnim->clearWaypoints(); + mMoveAnim->addWaypoint( Vector2f( (Float)From.x, (Float)From.y ) ); + mMoveAnim->addWaypoint( Vector2f( (Float)To.x, (Float)To.y ) ); + mMoveAnim->setTotalTime( TotalTime ); + mMoveAnim->start( PathEndCallback ); + mMoveAnim->type( Type ); Pos( From ); @@ -309,12 +309,12 @@ Interpolation * UIControlAnim::StartRotation( const Float& From, const Float& To if ( NULL == mAngleAnim ) mAngleAnim = eeNew( Interpolation, () ); - mAngleAnim->ClearWaypoints(); - mAngleAnim->AddWaypoint( From ); - mAngleAnim->AddWaypoint( To ); - mAngleAnim->SetTotalTime( TotalTime ); - mAngleAnim->Start( PathEndCallback ); - mAngleAnim->Type( Type ); + mAngleAnim->clearWaypoints(); + mAngleAnim->addWaypoint( From ); + mAngleAnim->addWaypoint( To ); + mAngleAnim->setTotalTime( TotalTime ); + mAngleAnim->start( PathEndCallback ); + mAngleAnim->type( 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.width() - 0.1f, (Float)mSize.height() - 0.1f ) ); if ( mBackground->Corners() ) { P.DrawRoundedRectangle( GetRectf(), 0.f, Vector2f::One, mBackground->Corners() ); @@ -396,10 +396,10 @@ 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.width(), mScreenPosf.y + mSize.height() ) ); - mPoly.Rotate( mAngle, RotationCenter() ); - mPoly.Scale( mScale, ScaleCenter() ); + mPoly.rotate( mAngle, RotationCenter() ); + mPoly.scale( mScale, ScaleCenter() ); UIControl * tParent = Parent(); @@ -407,8 +407,8 @@ void UIControlAnim::UpdateQuad() { if ( tParent->IsAnimated() ) { UIControlAnim * tP = reinterpret_cast ( tParent ); - mPoly.Rotate( tP->Angle(), tP->RotationCenter() ); - mPoly.Scale( tP->Scale(), tP->ScaleCenter() ); + mPoly.rotate( tP->Angle(), tP->RotationCenter() ); + mPoly.scale( tP->Scale(), tP->ScaleCenter() ); } tParent = tParent->Parent(); diff --git a/src/eepp/ui/uidropdownlist.cpp b/src/eepp/ui/uidropdownlist.cpp index 3c251b07c..624e0bb40 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.width(), mMinNumVisibleItems * mSize.height() ),Vector2i(), flags ); } else { UIListBox::CreateParams LBParams; - LBParams.Size = Sizei( mSize.Width(), mMinNumVisibleItems * mSize.Height() ); + LBParams.Size = Sizei( mSize.width(), mMinNumVisibleItems * mSize.height() ); 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().height() ); } } @@ -101,7 +101,7 @@ void UIDropDownList::ShowListBox() { mListBox->ToFront(); - Vector2i Pos( mPos.x, mPos.y + mSize.Height() ); + Vector2i Pos( mPos.x, mPos.y + mSize.height() ); if ( mPopUpToMainControl ) { Parent()->ControlToWorld( Pos ); @@ -115,24 +115,24 @@ 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.width(), (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.width(), (Int32)( mListBox->Count() * mListBox->RowHeight() ) + tPadding.Top + tPadding.Bottom ); } mListBox->UpdateQuad(); - Rectf aabb( mListBox->GetPolygon().ToAABB() ); + Rectf aabb( mListBox->GetPolygon().toAABB() ); Recti aabbi( aabb.Left, aabb.Top, aabb.Right, aabb.Bottom ); - if ( !UIManager::instance()->MainControl()->GetScreenRect().Contains( aabbi ) ) { + if ( !UIManager::instance()->MainControl()->GetScreenRect().contains( aabbi ) ) { Pos = Vector2i( mPos.x, mPos.y ); if ( mPopUpToMainControl ) { Parent()->ControlToWorld( Pos ); } - Pos.y -= mListBox->Size().Height(); + Pos.y -= mListBox->Size().height(); mListBox->Pos( Pos ); } diff --git a/src/eepp/ui/uigenericgrid.cpp b/src/eepp/ui/uigenericgrid.cpp index 6c53024c7..c600a7ac6 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.Parent( this ); CParams.PosSet( mPadding.Left, mPadding.Top ); - CParams.Size = Sizei( mSize.Width() - mPadding.Right - mPadding.Left, mSize.Height() - mPadding.Top - mPadding.Bottom ); + CParams.Size = Sizei( mSize.width() - mPadding.Right - mPadding.Left, mSize.height() - 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.Parent ( this ); - ScrollBarP.PosSet ( mSize.Width() - 15, 0 ); + ScrollBarP.PosSet ( mSize.width() - 15, 0 ); ScrollBarP.Flags = UI_AUTO_SIZE; ScrollBarP.VerticalScrollBar = true; - ScrollBarP.Size = Sizei( 15, mSize.Height() ); + ScrollBarP.Size = Sizei( 15, mSize.height() ); mVScrollBar = eeNew( UIScrollBar, ( ScrollBarP ) ); - ScrollBarP.PosSet ( 0, mSize.Height() - 15 ); - ScrollBarP.Size = Sizei( mSize.Width() - mVScrollBar->Size().Width(), 15 ); + ScrollBarP.PosSet ( 0, mSize.height() - 15 ); + ScrollBarP.Size = Sizei( mSize.width() - mVScrollBar->Size().width(), 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().height() / 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().width() / mCollumnsCount; for ( Uint32 i = 0; i < mCollumnsCount; i++ ) { mCollumnsWidth[ i ] = CollumnWidh; @@ -126,14 +126,14 @@ void UIGenericGrid::AutoPadding() { } void UIGenericGrid::OnSizeChange() { - mVScrollBar->Pos( mSize.Width() - mVScrollBar->Size().Width(), 0 ); - mVScrollBar->Size( mVScrollBar->Size().Width(), mSize.Height() ); + mVScrollBar->Pos( mSize.width() - mVScrollBar->Size().width(), 0 ); + mVScrollBar->Size( mVScrollBar->Size().width(), mSize.height() ); - mHScrollBar->Pos( 0, mSize.Height() - mHScrollBar->Size().Height() ); - mHScrollBar->Size( mSize.Width() - mVScrollBar->Size().Width(), mHScrollBar->Size().Height() ); + mHScrollBar->Pos( 0, mSize.height() - mHScrollBar->Size().height() ); + mHScrollBar->Size( mSize.width() - mVScrollBar->Size().width(), mHScrollBar->Size().height() ); if ( mContainer->IsClipped() && UI_SCROLLBAR_AUTO == mHScrollMode ) { - if ( (Int32)mTotalWidth <= mContainer->Size().Width() ) { + if ( (Int32)mTotalWidth <= mContainer->Size().width() ) { mHScrollBar->Visible( false ); mHScrollBar->Enabled( false ); mHScrollInit = 0; @@ -149,12 +149,12 @@ void UIGenericGrid::ContainerResize() { mContainer->Pos( mPadding.Left, mPadding.Top ); if( mHScrollBar->Visible() ) - mContainer->Size( mSize.Width() - mPadding.Right, mSize.Height() - mPadding.Top - mHScrollBar->Size().Height() ); + mContainer->Size( mSize.width() - mPadding.Right, mSize.height() - mPadding.Top - mHScrollBar->Size().height() ); else - mContainer->Size( mSize.Width() - mPadding.Right, mSize.Height() - mPadding.Bottom - mPadding.Top ); + mContainer->Size( mSize.width() - mPadding.Right, mSize.height() - mPadding.Bottom - mPadding.Top ); if ( mVScrollBar->Visible() ) - mContainer->Size( mContainer->Size().Width() - mVScrollBar->Size().Width(), mContainer->Size().Height() ); + mContainer->Size( mContainer->Size().width() - mVScrollBar->Size().width(), mContainer->Size().height() ); 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().width() < (Int32)mTotalWidth ) { mHScrollBar->Visible( true ); mHScrollBar->Enabled( true ); ContainerResize(); - Int32 ScrollH = mTotalWidth - mContainer->Size().Width(); + Int32 ScrollH = mTotalWidth - mContainer->Size().width(); 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().height() / 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().height() / mRowHeight; mItemsNotVisible = (Uint32)mItems.size() - VisibleItems; - Int32 Scrolleable = (Int32)mItems.size() * mRowHeight - mContainer->Size().Height(); + Int32 Scrolleable = (Int32)mItems.size() * mRowHeight - mContainer->Size().height(); 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().height() + 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->Pos( 0, mSize.Height() - mHScrollBar->Size().Height() ); - mHScrollBar->Size( mSize.Width(), mHScrollBar->Size().Height() ); + mHScrollBar->Pos( 0, mSize.height() - mHScrollBar->Size().height() ); + mHScrollBar->Size( mSize.width(), mHScrollBar->Size().height() ); } else { - mHScrollBar->Pos( 0, mSize.Height() - mHScrollBar->Size().Height() ); - mHScrollBar->Size( mSize.Width() - mVScrollBar->Size().Width(), mHScrollBar->Size().Height() ); + mHScrollBar->Pos( 0, mSize.height() - mHScrollBar->Size().height() ); + mHScrollBar->Size( mSize.width() - mVScrollBar->Size().width(), mHScrollBar->Size().height() ); } } diff --git a/src/eepp/ui/uigfx.cpp b/src/eepp/ui/uigfx.cpp index 0c17fb0d5..a4fd0a1b3 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.width() / 2 - mSubTexture->DestSize().x / 2; } else if ( FontHAlignGet( mFlags ) == UI_HALIGN_RIGHT ) { - mAlignOffset.x = mSize.Width() - mSubTexture->DestSize().x; + mAlignOffset.x = mSize.width() - 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.height() / 2 - mSubTexture->DestSize().y / 2; } else if ( FontVAlignGet( mFlags ) == UI_VALIGN_BOTTOM ) { - mAlignOffset.y = mSize.Height() - mSubTexture->DestSize().y; + mAlignOffset.y = mSize.height() - mSubTexture->DestSize().y; } else { mAlignOffset.y = 0; } diff --git a/src/eepp/ui/uilistbox.cpp b/src/eepp/ui/uilistbox.cpp index 1461c348d..528a85791 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.Parent( this ); CParams.PosSet( mPaddingContainer.Left, mPaddingContainer.Top ); - CParams.Size = Sizei( mSize.Width() - mPaddingContainer.Right - mPaddingContainer.Left, mSize.Height() - mPaddingContainer.Top - mPaddingContainer.Bottom ); + CParams.Size = Sizei( mSize.width() - mPaddingContainer.Right - mPaddingContainer.Left, mSize.height() - 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.Parent( this ); - ScrollBarP.Size = Sizei( 15, mSize.Height() ); - ScrollBarP.PosSet( mSize.Width() - 15, 0 ); + ScrollBarP.Size = Sizei( 15, mSize.height() ); + ScrollBarP.PosSet( mSize.width() - 15, 0 ); ScrollBarP.Flags = UI_AUTO_SIZE; ScrollBarP.VerticalScrollBar = true; mVScrollBar = eeNew( UIScrollBar, ( ScrollBarP ) ); - ScrollBarP.Size = Sizei( mSize.Width() - mVScrollBar->Size().Width(), 15 ); - ScrollBarP.PosSet( 0, mSize.Height() - 15 ); + ScrollBarP.Size = Sizei( mSize.width() - mVScrollBar->Size().width(), 15 ); + ScrollBarP.PosSet( 0, mSize.height() - 15 ); ScrollBarP.VerticalScrollBar = false; mHScrollBar = eeNew( UIScrollBar, ( ScrollBarP ) ); @@ -279,14 +279,14 @@ void UIListBox::OnHScrollValueChange( const UIEvent * Event ) { } void UIListBox::OnSizeChange() { - mVScrollBar->Pos( mSize.Width() - mVScrollBar->Size().Width() + mVScrollPadding.Left, mVScrollPadding.Top ); - mVScrollBar->Size( mVScrollBar->Size().Width() + mVScrollPadding.Right, mSize.Height() + mVScrollPadding.Bottom ); + mVScrollBar->Pos( mSize.width() - mVScrollBar->Size().width() + mVScrollPadding.Left, mVScrollPadding.Top ); + mVScrollBar->Size( mVScrollBar->Size().width() + mVScrollPadding.Right, mSize.height() + mVScrollPadding.Bottom ); - mHScrollBar->Pos( mHScrollPadding.Left, mSize.Height() - mHScrollBar->Size().Height() + mHScrollPadding.Top ); - mHScrollBar->Size( mSize.Width() - mVScrollBar->Size().Width() + mHScrollPadding.Right, mHScrollBar->Size().Height() + mHScrollPadding.Bottom ); + mHScrollBar->Pos( mHScrollPadding.Left, mSize.height() - mHScrollBar->Size().height() + mHScrollPadding.Top ); + mHScrollBar->Size( mSize.width() - mVScrollBar->Size().width() + mHScrollPadding.Right, mHScrollBar->Size().height() + mHScrollPadding.Bottom ); if ( mContainer->IsClipped() && UI_SCROLLBAR_AUTO == mHScrollMode ) { - if ( (Int32)mMaxTextWidth <= mContainer->Size().Width() ) { + if ( (Int32)mMaxTextWidth <= mContainer->Size().width() ) { 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().width() ) + width = mContainer->Size().width(); if ( ( mItemsNotVisible > 0 && UI_SCROLLBAR_AUTO == mVScrollMode ) || UI_SCROLLBAR_ALWAYS_ON == mVScrollMode ) - width -= mVScrollBar->Size().Width(); + width -= mVScrollBar->Size().width(); } else { width = mMaxTextWidth; } @@ -371,9 +371,9 @@ void UIListBox::ContainerResize() { mContainer->Pos( 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.width() - mPaddingContainer.Right - mPaddingContainer.Left, mSize.height() - mPaddingContainer.Top - mHScrollBar->Size().height() ); else - mContainer->Size( mSize.Width() - mPaddingContainer.Right - mPaddingContainer.Left, mSize.Height() - mPaddingContainer.Bottom - mPaddingContainer.Top ); + mContainer->Size( mSize.width() - mPaddingContainer.Right - mPaddingContainer.Left, mSize.height() - 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().height() / 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().width() - mVScrollBar->Size().width() < (Int32)mMaxTextWidth ) || + ( !mVScrollBar->Visible() && mContainer->Size().width() < (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().width() + mVScrollBar->Size().width(); else - ScrollH = mMaxTextWidth - mContainer->Size().Width(); + ScrollH = mMaxTextWidth - mContainer->Size().width(); Int32 HScrolleable = (Uint32)( mHScrollBar->Value() * ScrollH ); @@ -457,9 +457,9 @@ void UIListBox::UpdateScroll( bool FromScrollChange ) { } } - VisibleItems = mContainer->Size().Height() / mRowHeight; + VisibleItems = mContainer->Size().height() / mRowHeight; mItemsNotVisible = (Uint32)mItems.size() - VisibleItems; - Int32 Scrolleable = (Int32)mItems.size() * mRowHeight - mContainer->Size().Height(); + Int32 Scrolleable = (Int32)mItems.size() * mRowHeight - mContainer->Size().height(); 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().height() + 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->Pos( mHScrollPadding.Left, mSize.Height() - mHScrollBar->Size().Height() + mHScrollPadding.Top ); - mHScrollBar->Size( mSize.Width() + mHScrollPadding.Right, mHScrollBar->Size().Height() + mHScrollPadding.Bottom ); + mHScrollBar->Pos( mHScrollPadding.Left, mSize.height() - mHScrollBar->Size().height() + mHScrollPadding.Top ); + mHScrollBar->Size( mSize.width() + mHScrollPadding.Right, mHScrollBar->Size().height() + mHScrollPadding.Bottom ); } else { - mHScrollBar->Pos( mHScrollPadding.Left, mSize.Height() - mHScrollBar->Size().Height() + mHScrollPadding.Top ); - mHScrollBar->Size( mSize.Width() - mVScrollBar->Size().Width() + mHScrollPadding.Right, mHScrollBar->Size().Height() + mHScrollPadding.Bottom ); + mHScrollBar->Pos( mHScrollPadding.Left, mSize.height() - mHScrollBar->Size().height() + mHScrollPadding.Top ); + mHScrollBar->Size( mSize.width() - mVScrollBar->Size().width() + mHScrollPadding.Right, mHScrollBar->Size().height() + mHScrollPadding.Bottom ); } } @@ -817,7 +817,7 @@ void UIListBox::SelectNext() { if ( NULL == mItems[ SelIndex ] ) CreateItemIndex( SelIndex ); - if ( mItems[ SelIndex ]->Pos().y + (Int32)RowHeight() > mContainer->Size().Height() ) { + if ( mItems[ SelIndex ]->Pos().y + (Int32)RowHeight() > mContainer->Size().height() ) { 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 ff4f145d3..f4fb7dcf6 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().width() > (Int32)mBiggestIcon ) { + mBiggestIcon = tItem->IconHorizontalMargin() + tItem->Icon()->Size().width(); } if ( mFlags & UI_AUTO_SIZE ) { if ( Control->IsType( UI_TYPE_MENUSUBMENU ) ) { UIMenuSubMenu * tMenu = reinterpret_cast ( tItem ); - if ( tMenu->TextBox()->GetTextWidth() + mBiggestIcon + tMenu->Arrow()->Size().Width() + mMinRightMargin > (Int32)mMaxWidth - mPadding.Left - mPadding.Right ) { - mMaxWidth = tMenu->TextBox()->GetTextWidth() + mBiggestIcon + mPadding.Left + mPadding.Right + tMenu->Arrow()->Size().Width() + mMinRightMargin; + if ( tMenu->TextBox()->GetTextWidth() + mBiggestIcon + tMenu->Arrow()->Size().width() + mMinRightMargin > (Int32)mMaxWidth - mPadding.Left - mPadding.Right ) { + mMaxWidth = tMenu->TextBox()->GetTextWidth() + mBiggestIcon + mPadding.Left + mPadding.Right + tMenu->Arrow()->Size().width() + 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.width() - mPadding.Left - mPadding.Right, mRowHeight ); } else { - Control->Size( mSize.Width() - mPadding.Left - mPadding.Right, Control->Size().Height() ); + Control->Size( mSize.width() - mPadding.Left - mPadding.Right, Control->Size().height() ); } } @@ -224,14 +224,14 @@ Uint32 UIMenu::AddSeparator() { UISeparator::CreateParams Params; Params.Parent( this ); Params.PosSet( mPadding.Left, mPadding.Top + mNextPosY ); - Params.Size = Sizei( mSize.Width() - mPadding.Left - mPadding.Right, 3 ); + Params.Size = Sizei( mSize.width() - mPadding.Left - mPadding.Right, 3 ); UISeparator * Control = eeNew( UISeparator, ( Params ) ); Control->Visible( true ); Control->Enabled( true ); - mNextPosY += Control->Size().Height(); + mNextPosY += Control->Size().height(); 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.width() < (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]->Pos( mPadding.Left, mPadding.Top + mNextPosY ); - mNextPosY += mItems[i]->Size().Height(); + mNextPosY += mItems[i]->Size().height(); } 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.width(), 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().width(), UIManager::instance()->MainControl()->Size().height() ); + eeAABB qPos( Pos.x, Pos.y, Pos.x + Menu->Size().width(), Pos.y + Menu->Size().height() ); if ( NULL != Parent && NULL != SubMenu ) { Vector2i addToPos( 0, 0 ); if ( NULL != SubMenu ) { - addToPos.y = SubMenu->Size().Height(); + addToPos.y = SubMenu->Size().height(); } Vector2i sPos = SubMenu->Pos(); @@ -576,50 +576,50 @@ void UIMenu::FixMenuPos( Vector2i& Pos, UIMenu * Menu, UIMenu * Parent, UIMenuSu Vector2i pPos = Parent->Pos(); 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().width(), pPos.y + Parent->Size().height() ); 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().width(); qPos.Top = Pos.y; - qPos.Bottom = qPos.Top + Menu->Size().Height(); + qPos.Bottom = qPos.Top + Menu->Size().height(); - if ( !qScreen.Contains( qPos ) ) { - Pos.y = sPos.y + SubMenu->Size().Height() - Menu->Size().Height(); + if ( !qScreen.contains( qPos ) ) { + Pos.y = sPos.y + SubMenu->Size().height() - Menu->Size().height(); qPos.Top = Pos.y; - qPos.Bottom = qPos.Top + Menu->Size().Height(); + qPos.Bottom = qPos.Top + Menu->Size().height(); - if ( !qScreen.Contains( qPos ) ) { - Pos.x = qParent.Left - Menu->Size().Width(); + if ( !qScreen.contains( qPos ) ) { + Pos.x = qParent.Left - Menu->Size().width(); Pos.y = sPos.y; qPos.Left = Pos.x; - qPos.Right = qPos.Left + Menu->Size().Width(); + qPos.Right = qPos.Left + Menu->Size().width(); qPos.Top = Pos.y; - qPos.Bottom = qPos.Top + Menu->Size().Height(); + qPos.Bottom = qPos.Top + Menu->Size().height(); - if ( !qScreen.Contains( qPos ) ) { - Pos.y = sPos.y + SubMenu->Size().Height() - Menu->Size().Height(); + if ( !qScreen.contains( qPos ) ) { + Pos.y = sPos.y + SubMenu->Size().height() - Menu->Size().height(); qPos.Top = Pos.y; - qPos.Bottom = qPos.Top + Menu->Size().Height(); + qPos.Bottom = qPos.Top + Menu->Size().height(); } } } } else { - if ( !qScreen.Contains( qPos ) ) { - Pos.y -= Menu->Size().Height(); - qPos.Top -= Menu->Size().Height(); - qPos.Bottom -= Menu->Size().Height(); + if ( !qScreen.contains( qPos ) ) { + Pos.y -= Menu->Size().height(); + qPos.Top -= Menu->Size().height(); + qPos.Bottom -= Menu->Size().height(); - if ( !qScreen.Contains( qPos ) ) { - Pos.x -= Menu->Size().Width(); - qPos.Left -= Menu->Size().Width(); - qPos.Right -= Menu->Size().Width(); + if ( !qScreen.contains( qPos ) ) { + Pos.x -= Menu->Size().width(); + qPos.Left -= Menu->Size().width(); + qPos.Right -= Menu->Size().width(); - if ( !qScreen.Contains( qPos ) ) { - Pos.y += Menu->Size().Height(); - qPos.Top += Menu->Size().Height(); - qPos.Bottom += Menu->Size().Height(); + if ( !qScreen.contains( qPos ) ) { + Pos.y += Menu->Size().height(); + qPos.Top += Menu->Size().height(); + qPos.Bottom += Menu->Size().height(); } } } diff --git a/src/eepp/ui/uimenusubmenu.cpp b/src/eepp/ui/uimenusubmenu.cpp index 09bf64330..1e7ce7ced 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->Pos( Parent()->Size().Width() - mArrow->Size().Width() - 1, 0 ); + mArrow->Pos( Parent()->Size().width() - mArrow->Size().width() - 1, 0 ); mArrow->CenterVertical(); } @@ -103,7 +103,7 @@ void UIMenuSubMenu::ShowSubMenu() { Vector2i Pos = this->Pos(); ControlToScreen( Pos ); - Pos.x += mSize.Width() + reinterpret_cast ( Parent() )->Padding().Right; + Pos.x += mSize.width() + 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 c769a4e03..5101be798 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.Parent( Container() ); ButtonParams.SizeSet( 90, 22 ); - ButtonParams.PosSet( Container()->Size().Width() - 96, Container()->Size().Height() - ButtonParams.Size.Height() - 8 ); + ButtonParams.PosSet( Container()->Size().width() - 96, Container()->Size().height() - ButtonParams.Size.height() - 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->Pos().x - mButtonOK->Size().Width() - 8; + ButtonParams.Pos.x = mButtonOK->Pos().x - mButtonOK->Size().width() - 8; mButtonCancel = eeNew( UIPushButton, ( ButtonParams ) ); mButtonCancel->Visible( true ); mButtonCancel->Enabled( true ); @@ -30,19 +30,19 @@ UIMessageBox::UIMessageBox( const UIMessageBox::CreateParams& Params ) : { mButtonOK = Theme->CreatePushButton( Container(), Sizei( 90, 22 ), - Vector2i( Container()->Size().Width() - 96, Container()->Size().Height() - 22 - 8 ), + Vector2i( Container()->Size().width() - 96, Container()->Size().height() - 22 - 8 ), UI_HALIGN_CENTER | UI_ANCHOR_RIGHT | UI_VALIGN_CENTER | UI_AUTO_SIZE ); mButtonCancel = Theme->CreatePushButton( Container(), mButtonOK->Size(), - Vector2i( mButtonOK->Pos().x - mButtonOK->Size().Width() - 8, mButtonOK->Pos().y ), + Vector2i( mButtonOK->Pos().x - mButtonOK->Size().width() - 8, mButtonOK->Pos().y ), mButtonOK->Flags() ); } UITextBox::CreateParams TxtParams; TxtParams.Parent( Container() ); TxtParams.Flags = UI_CONTROL_DEFAULT_FLAGS_CENTERED | UI_ANCHOR_RIGHT | UI_ANCHOR_BOTTOM; - TxtParams.SizeSet( Container()->Size().Width(), mButtonOK->Pos().y ); + TxtParams.SizeSet( Container()->Size().width(), mButtonOK->Pos().y ); mTextBox = eeNew( UITextBox, ( TxtParams ) ); mTextBox->Visible( true ); @@ -104,7 +104,7 @@ void UIMessageBox::SetTheme( UITheme * Theme ) { } } - mButtonOK->Pos( mButtonOK->Pos().x, Container()->Size().Height() - mButtonOK->Size().Height() - 8 ); + mButtonOK->Pos( mButtonOK->Pos().x, Container()->Size().height() - mButtonOK->Size().height() - 8 ); mButtonCancel->Pos( mButtonCancel->Pos().x, mButtonOK->Pos().y ); } @@ -116,7 +116,7 @@ Uint32 UIMessageBox::OnMessage( const UIMessage * Msg ) { Vector2i mousei( UIManager::instance()->GetMousePos() ); Vector2f mouse( mousei.x, mousei.y ); - if ( Msg->Sender() == mButtonOK && mButtonOK->GetPolygon().PointInside( mouse ) ) { + if ( Msg->Sender() == mButtonOK && mButtonOK->GetPolygon().pointInside( mouse ) ) { SendCommonEvent( UIEvent::EventMsgBoxConfirmClick ); CloseWindow(); @@ -145,17 +145,17 @@ UIPushButton * UIMessageBox::ButtonCancel() 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().height() + mDecoSize.height() + 8 ); - if ( !( nSize.Width() > Container()->Size().Width() ) ) { - nSize.x = Container()->Size().Width(); + if ( !( nSize.width() > Container()->Size().width() ) ) { + nSize.x = Container()->Size().width(); } - if ( !( nSize.Height() > Container()->Size().Height() ) ) { - nSize.y = Container()->Size().Height(); + if ( !( nSize.height() > Container()->Size().height() ) ) { + nSize.y = Container()->Size().height(); } - if ( nSize.x != Container()->Size().Width() || nSize.y != Container()->Size().Height() ) { + if ( nSize.x != Container()->Size().width() || nSize.y != Container()->Size().height() ) { Size( nSize ); mMinWindowSize = nSize; diff --git a/src/eepp/ui/uiprogressbar.cpp b/src/eepp/ui/uiprogressbar.cpp index 946e4e26b..fe73bc94a 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().height() ); } 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().height(); if ( !mVerticalExpand ) - Height = (Float)tSubTexture->RealSize().Height(); + Height = (Float)tSubTexture->RealSize().height(); - if ( Height > mSize.Height() ) - Height = mSize.Height(); + if ( Height > mSize.height() ) + Height = mSize.height(); - 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.width() - 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.height(); if ( !mVerticalExpand && mParallax->SubTexture() ) - Height = (Float)mParallax->SubTexture()->RealSize().Height(); + Height = (Float)mParallax->SubTexture()->RealSize().height(); - if ( Height > mSize.Height() ) - Height = mSize.Height(); + if ( Height > mSize.height() ) + Height = mSize.height(); - mParallax->Size( Sizef( ( ( mSize.Width() - mFillerMargin.Left - mFillerMargin.Right ) * mProgress ) / mTotalSteps, Height - mFillerMargin.Top - mFillerMargin.Bottom ) ); + mParallax->Size( Sizef( ( ( mSize.width() - 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 2046669c8..9d070725b 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->Pos( mIcon->Pos().x + mIcon->Size().Width(), 0 ); - mTextBox->Size( mSize.Width() - mIcon->Pos().x + mIcon->Size().Width(), mSize.Height() ); + mTextBox->Pos( mIcon->Pos().x + mIcon->Size().width(), 0 ); + mTextBox->Size( mSize.width() - mIcon->Pos().x + mIcon->Size().width(), mSize.height() ); break; case UI_HALIGN_CENTER: if ( NULL != mIcon->SubTexture() ) { - if ( mIcon->Pos().x + mIcon->Size().Width() >= mTextBox->AlignOffset().x ) { - mTextBox->Pos( mIcon->Pos().x + mIcon->Size().Width() + 1 - mTextBox->AlignOffset().x, mTextBox->Pos().y ); + if ( mIcon->Pos().x + mIcon->Size().width() >= mTextBox->AlignOffset().x ) { + mTextBox->Pos( mIcon->Pos().x + mIcon->Size().width() + 1 - mTextBox->AlignOffset().x, mTextBox->Pos().y ); } } @@ -100,14 +100,14 @@ void UIPushButton::OnSizeChange() { if ( NULL != mTextBox ) { Recti P = MakePadding(); - mSize.Height( mIcon->Size().Height() + P.Top + P.Bottom ); + mSize.Height( mIcon->Size().height() + P.Top + P.Bottom ); if ( 0 == mTextBox->Text().size() ) { - mSize.Width ( mIcon->Size().Width() + P.Left + P.Right ); + mSize.Width ( mIcon->Size().width() + P.Left + P.Right ); mIcon->Center(); } else { - mSize.Width( mIconSpace + mIcon->Pos().x + mIcon->Size().Width() + mTextBox->Size().Width() ); + mSize.Width( mIconSpace + mIcon->Pos().x + mIcon->Size().width() + mTextBox->Size().width() ); if ( mSize.Height() < P.Top + P.Bottom + mTextBox->GetTextHeight() ) mSize.Height( P.Top + P.Bottom + mTextBox->GetTextHeight() ); @@ -137,7 +137,7 @@ void UIPushButton::DoAfterSetTheme() { } if ( mFlags & UI_AUTO_SIZE ) { - mSize.Height( GetSkinSize().Height() ); + mSize.height( GetSkinSize().height() ); } AutoPadding(); diff --git a/src/eepp/ui/uiradiobutton.cpp b/src/eepp/ui/uiradiobutton.cpp index 796ab6e9b..c4eed22d7 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.width( (int)mTextCache->GetTextWidth() + mActiveButton->Size().width() ); } } @@ -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().width(); } UIControlAnim * UIRadioButton::ActiveButton() const { diff --git a/src/eepp/ui/uiscrollbar.cpp b/src/eepp/ui/uiscrollbar.cpp index d5688ce33..698dd5b55 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().width() , mSize.height() ); + Size( tSubTexture->RealSize().width() , mSize.height() ); + mMinControlSize.x = mSize.width(); } else { - mSlider->Size( mSize.Width(), tSubTexture->RealSize().Height() ); - Size( mSize.Width(), tSubTexture->RealSize().Height() ); - mMinControlSize.y = mSize.Height(); + mSlider->Size( mSize.width(), tSubTexture->RealSize().height() ); + Size( mSize.width(), tSubTexture->RealSize().height() ); + mMinControlSize.y = mSize.height(); } } } @@ -128,17 +128,17 @@ void UIScrollBar::AdjustChilds() { mBtnUp->Pos( 0, 0 ); if ( !IsVertical() ) { - mBtnDown->Pos( mSize.Width() - mBtnDown->Size().Width(), 0 ); - mSlider->Size( mSize.Width() - mBtnDown->Size().Width() - mBtnUp->Size().Width(), mSlider->Size().Height() ); - mSlider->Pos( mBtnUp->Size().Width(), 0 ); + mBtnDown->Pos( mSize.width() - mBtnDown->Size().width(), 0 ); + mSlider->Size( mSize.width() - mBtnDown->Size().width() - mBtnUp->Size().width(), mSlider->Size().height() ); + mSlider->Pos( mBtnUp->Size().width(), 0 ); mBtnDown->CenterVertical(); mBtnUp->CenterVertical(); mSlider->CenterVertical(); } else { - mBtnDown->Pos( 0, mSize.Height() - mBtnDown->Size().Height() ); - mSlider->Size( mSlider->Size().Width(), mSize.Height() - mBtnDown->Size().Height() - mBtnUp->Size().Height() ); - mSlider->Pos( 0, mBtnUp->Size().Height() ); + mBtnDown->Pos( 0, mSize.height() - mBtnDown->Size().height() ); + mSlider->Size( mSlider->Size().width(), mSize.height() - mBtnDown->Size().height() - mBtnUp->Size().height() ); + mSlider->Pos( 0, mBtnUp->Size().height() ); mBtnDown->CenterHorizontal(); mBtnUp->CenterHorizontal(); diff --git a/src/eepp/ui/uiseparator.cpp b/src/eepp/ui/uiseparator.cpp index 3f49603b4..f5042edb4 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.width(), mSkinState->GetSkin()->GetSubTexture( UISkinState::StateNormal )->RealSize().height() ); } } diff --git a/src/eepp/ui/uiskincomplex.cpp b/src/eepp/ui/uiskincomplex.cpp index e6b1899ef..331812ea3 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.height(), 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.width(), 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.width(), Y + Height - drs.height(), 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.height() - dls.height() ) ); - tSubTexture->Draw( X, Y + uls.Height(), mTempColor ); + tSubTexture->Draw( X, Y + uls.height(), mTempColor ); tSubTexture->ResetDestSize(); - if ( uls.Width() == 0 ) - uls.x = tSubTexture->RealSize().Width(); + if ( uls.width() == 0 ) + uls.x = tSubTexture->RealSize().width(); } tSubTexture = mSubTexture[ State ][ Up ]; if ( NULL != tSubTexture ) { - tSubTexture->DestSize( Sizef( Width - uls.Width() - urs.Width(), tSubTexture->DestSize().y ) ); + tSubTexture->DestSize( Sizef( Width - uls.width() - urs.width(), tSubTexture->DestSize().y ) ); - tSubTexture->Draw( X + uls.Width(), Y, mTempColor ); + tSubTexture->Draw( X + uls.width(), Y, mTempColor ); tSubTexture->ResetDestSize(); - if ( urs.Height() == 0 ) - urs.y = tSubTexture->RealSize().Height(); + if ( urs.height() == 0 ) + urs.y = tSubTexture->RealSize().height(); - if ( uls.Height() == 0 ) - uls.y = tSubTexture->RealSize().Height(); + if ( uls.height() == 0 ) + uls.y = tSubTexture->RealSize().height(); } tSubTexture = mSubTexture[ State ][ Right ]; if ( NULL != tSubTexture ) { - if ( urs.Width() == 0 ) - urs.x = tSubTexture->RealSize().Width(); + if ( urs.width() == 0 ) + urs.x = tSubTexture->RealSize().width(); - tSubTexture->DestSize( Sizef( tSubTexture->DestSize().x, Height - urs.Height() - drs.Height() ) ); + tSubTexture->DestSize( Sizef( tSubTexture->DestSize().x, Height - urs.height() - drs.height() ) ); - tSubTexture->Draw( X + Width - tSubTexture->RealSize().Width(), Y + urs.Height(), mTempColor ); + tSubTexture->Draw( X + Width - tSubTexture->RealSize().width(), Y + urs.height(), 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.width() - drs.width(), tSubTexture->DestSize().y ) ); - tSubTexture->Draw( X + dls.Width(), Y + Height - tSubTexture->RealSize().Height(), mTempColor ); + tSubTexture->Draw( X + dls.width(), Y + Height - tSubTexture->RealSize().height(), mTempColor ); tSubTexture->ResetDestSize(); - if ( dls.Height() == 0 && drs.Height() == 0 ) - dls.Height( tSubTexture->RealSize().Height() ); + if ( dls.height() == 0 && drs.height() == 0 ) + dls.height( tSubTexture->RealSize().height() ); } 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.width() - urs.width(), Height - uls.height() - dls.height() ) ); - tSubTexture->Draw( X + uls.Width(), Y + uls.Height(), mTempColor ); + tSubTexture->Draw( X + uls.width(), Y + uls.height(), mTempColor ); tSubTexture->ResetDestSize(); } diff --git a/src/eepp/ui/uislider.cpp b/src/eepp/ui/uislider.cpp index 52c194fe8..61a2f8d2f 100644 --- a/src/eepp/ui/uislider.cpp +++ b/src/eepp/ui/uislider.cpp @@ -21,9 +21,9 @@ UISlider::UISlider( const UISlider::CreateParams& Params ) : BgParams.Parent( this ); if ( !mVertical ) - BgParams.Size = Sizei( mSize.Width() - 16, 8 ); + BgParams.Size = Sizei( mSize.width() - 16, 8 ); else - BgParams.Size = Sizei( 8, mSize.Width() - 16 ); + BgParams.Size = Sizei( 8, mSize.width() - 16 ); mBackSlider = eeNew( UIControlAnim, ( BgParams ) ); mBackSlider->Visible( true ); @@ -111,26 +111,26 @@ void UISlider::AdjustChilds() { Int32 Height; if ( mExpandBackground ) - Height = mSize.Height(); + Height = mSize.height(); else - Height = tSubTexture->RealSize().Height(); + Height = tSubTexture->RealSize().height(); if ( mAllowHalfSliderOut ) - mBackSlider->Size( Sizei( mSize.Width() - mSlider->Size().Width(), Height ) ); + mBackSlider->Size( Sizei( mSize.width() - mSlider->Size().width(), Height ) ); else - mBackSlider->Size( Sizei( mSize.Width(), Height ) ); + mBackSlider->Size( Sizei( mSize.width(), Height ) ); } else { Int32 Width; if ( mExpandBackground ) - Width = mSize.Width(); + Width = mSize.width(); else - Width = tSubTexture->RealSize().Width(); + Width = tSubTexture->RealSize().width(); if ( mAllowHalfSliderOut ) - mBackSlider->Size( Sizei( Width, mSize.Height() - mSlider->Size().Height() ) ); + mBackSlider->Size( Sizei( Width, mSize.height() - mSlider->Size().height() ) ); else - mBackSlider->Size( Sizei( Width, mSize.Height() ) ); + mBackSlider->Size( Sizei( Width, mSize.height() ) ); } mBackSlider->Center(); @@ -149,19 +149,19 @@ void UISlider::FixSliderPos() { mSlider->Pos( 0, 0 ); if ( mAllowHalfSliderOut ) { - if ( mSlider->Pos().x > mBackSlider->Size().Width() ) - mSlider->Pos( mBackSlider->Size().Width(), 0 ); + if ( mSlider->Pos().x > mBackSlider->Size().width() ) + mSlider->Pos( mBackSlider->Size().width(), 0 ); } else { - if ( mSlider->Pos().x > mBackSlider->Size().Width() - mSlider->Size().Width() ) - mSlider->Pos( mBackSlider->Size().Width() - mSlider->Size().Width(), 0 ); + if ( mSlider->Pos().x > mBackSlider->Size().width() - mSlider->Size().width() ) + mSlider->Pos( mBackSlider->Size().width() - mSlider->Size().width(), 0 ); } mSlider->CenterVertical(); if ( mAllowHalfSliderOut ) - Value( mMinValue + (Float)mSlider->Pos().x * ( mMaxValue - mMinValue ) / (Float)mBackSlider->Size().Width() ); + Value( mMinValue + (Float)mSlider->Pos().x * ( mMaxValue - mMinValue ) / (Float)mBackSlider->Size().width() ); else - Value( mMinValue + (Float)mSlider->Pos().x * ( mMaxValue - mMinValue ) / ( (Float)mSize.Width() - mSlider->Size().Width() ) ); + Value( mMinValue + (Float)mSlider->Pos().x * ( mMaxValue - mMinValue ) / ( (Float)mSize.width() - mSlider->Size().width() ) ); } else { mSlider->Pos( 0, mSlider->Pos().y ); @@ -169,19 +169,19 @@ void UISlider::FixSliderPos() { mSlider->Pos( 0, 0 ); if ( mAllowHalfSliderOut ) { - if ( mSlider->Pos().y > mBackSlider->Size().Height() ) - mSlider->Pos( 0, mBackSlider->Size().Height() ); + if ( mSlider->Pos().y > mBackSlider->Size().height() ) + mSlider->Pos( 0, mBackSlider->Size().height() ); } else { - if ( mSlider->Pos().y > mBackSlider->Size().Height() - mSlider->Size().Height() ) - mSlider->Pos( 0, mBackSlider->Size().Height() - mSlider->Size().Height() ); + if ( mSlider->Pos().y > mBackSlider->Size().height() - mSlider->Size().height() ) + mSlider->Pos( 0, mBackSlider->Size().height() - mSlider->Size().height() ); } mSlider->CenterHorizontal(); if ( mAllowHalfSliderOut ) - Value( mMinValue + (Float)mSlider->Pos().y * ( mMaxValue - mMinValue ) / (Float)mBackSlider->Size().Height() ); + Value( mMinValue + (Float)mSlider->Pos().y * ( mMaxValue - mMinValue ) / (Float)mBackSlider->Size().height() ); else - Value( mMinValue + (Float)mSlider->Pos().y * ( mMaxValue - mMinValue ) / ( (Float)mSize.Height() - mSlider->Size().Height() ) ); + Value( mMinValue + (Float)mSlider->Pos().y * ( mMaxValue - mMinValue ) / ( (Float)mSize.height() - mSlider->Size().height() ) ); } mOnPosChange = false; @@ -202,14 +202,14 @@ void UISlider::Value( Float Val ) { if ( !mVertical ) { if ( mAllowHalfSliderOut ) - mSlider->Pos( (Int32)( (Float)mBackSlider->Size().Width() * Percent ), mSlider->Pos().y ); + mSlider->Pos( (Int32)( (Float)mBackSlider->Size().width() * Percent ), mSlider->Pos().y ); else - mSlider->Pos( (Int32)( ( (Float)mSize.Width() - mSlider->Size().Width() ) * Percent ), mSlider->Pos().y ); + mSlider->Pos( (Int32)( ( (Float)mSize.width() - mSlider->Size().width() ) * Percent ), mSlider->Pos().y ); } else { if ( mAllowHalfSliderOut ) - mSlider->Pos( mSlider->Pos().x, (Int32)( (Float)mBackSlider->Size().Height() * Percent ) ); + mSlider->Pos( mSlider->Pos().x, (Int32)( (Float)mBackSlider->Size().height() * Percent ) ); else - mSlider->Pos( mSlider->Pos().x, (Int32)( ( (Float)mSize.Height() - mSlider->Size().Height() ) * Percent ) ); + mSlider->Pos( mSlider->Pos().x, (Int32)( ( (Float)mSize.height() - mSlider->Size().height() ) * Percent ) ); } mOnPosChange = false; diff --git a/src/eepp/ui/uispinbox.cpp b/src/eepp/ui/uispinbox.cpp index 93a7f8e41..85c659b4e 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.height( mInput->GetSkinSize().height() ); } AdjustChilds(); } void UISpinBox::AdjustChilds() { - mPushUp->Pos( mSize.Width() - mPushUp->Size().Width(), 0 ); - mPushDown->Pos( mSize.Width() - mPushDown->Size().Width(), mPushUp->Size().Height() ); - mInput->Size( mSize.Width() - mPushUp->Size().Width(), mSize.Height() ); + mPushUp->Pos( mSize.width() - mPushUp->Size().width(), 0 ); + mPushDown->Pos( mSize.width() - mPushDown->Size().width(), mPushUp->Size().height() ); + mInput->Size( mSize.width() - mPushUp->Size().width(), mSize.height() ); } void UISpinBox::Padding( const Recti& padding ) { diff --git a/src/eepp/ui/uisprite.cpp b/src/eepp/ui/uisprite.cpp index dd0ec5e11..32e14944b 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.width() / 2 - tSubTexture->Size().width() / 2; } else if ( FontHAlignGet( mFlags ) == UI_HALIGN_RIGHT ) { - mAlignOffset.x = mSize.Width() - tSubTexture->Size().Width(); + mAlignOffset.x = mSize.width() - tSubTexture->Size().width(); } else { mAlignOffset.x = 0; } if ( VAlignGet( mFlags ) == UI_VALIGN_CENTER ) { - mAlignOffset.y = mSize.Height() / 2 - tSubTexture->Size().Height() / 2; + mAlignOffset.y = mSize.height() / 2 - tSubTexture->Size().height() / 2; } else if ( FontVAlignGet( mFlags ) == UI_VALIGN_BOTTOM ) { - mAlignOffset.y = mSize.Height() - tSubTexture->Size().Height(); + mAlignOffset.y = mSize.height() - tSubTexture->Size().height(); } else { mAlignOffset.y = 0; } diff --git a/src/eepp/ui/uitab.cpp b/src/eepp/ui/uitab.cpp index 839feb8ca..127489119 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.width(), GetSkinSize( GetSkin(), mSkinState->GetState() ).height() ); 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().width(); UITabWidget * tTabW = GetTabWidget(); @@ -115,7 +115,7 @@ void UITab::SetRealSize() { w = eemin( w, tTabW->mMaxTabWidth ); } - Size( w, mSize.Height() ); + Size( w, mSize.height() ); } } diff --git a/src/eepp/ui/uitabwidget.cpp b/src/eepp/ui/uitabwidget.cpp index 8f30983d5..47df6479e 100644 --- a/src/eepp/ui/uitabwidget.cpp +++ b/src/eepp/ui/uitabwidget.cpp @@ -29,7 +29,7 @@ UITabWidget::UITabWidget( UITabWidget::CreateParams& Params ) : TabParams.Parent( this ); TabParams.PosSet( 0, 0 ); TabParams.Flags |= UI_CLIP_ENABLE | UI_ANCHOR_RIGHT; - TabParams.SizeSet( mSize.Width(), mTabWidgetHeight ); + TabParams.SizeSet( mSize.width(), mTabWidgetHeight ); mTabContainer = eeNew( UIComplexControl, ( TabParams ) ); mTabContainer->Visible( true ); @@ -38,7 +38,7 @@ UITabWidget::UITabWidget( UITabWidget::CreateParams& Params ) : UIComplexControl::CreateParams CtrlParams; CtrlParams.Parent( this ); CtrlParams.PosSet( 0, mTabWidgetHeight ); - CtrlParams.SizeSet( mSize.Width(), mSize.Height() - mTabWidgetHeight ); + CtrlParams.SizeSet( mSize.width(), mSize.height() - 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.height(), tSize2.height() ); SeContainerSize(); OrderTabs(); @@ -86,9 +86,9 @@ void UITabWidget::DoAfterSetTheme() { } void UITabWidget::SeContainerSize() { - mTabContainer->Size( mSize.Width(), mTabWidgetHeight ); + mTabContainer->Size( mSize.width(), mTabWidgetHeight ); mCtrlContainer->Pos( 0, mTabWidgetHeight ); - mCtrlContainer->Size( mSize.Width(), mSize.Height() - mTabWidgetHeight ); + mCtrlContainer->Size( mSize.width(), mSize.height() - 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().height() + mLineBewowTabsYOffset ); Vector2i p2( mPos.x + mTabContainer->Pos().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->Pos().x + mTabContainer->Size().Width(), mPos.y + mTabContainer->Size().Height() + mLineBewowTabsYOffset ); - Vector2i p4( mPos.x + mSize.Width(), p3.y ); + Vector2i p3( mPos.x + mTabContainer->Pos().x + mTabContainer->Size().width(), mPos.y + mTabContainer->Size().height() + mLineBewowTabsYOffset ); + Vector2i p4( mPos.x + mSize.width(), 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().width() + mTabSeparation; } s -= mTabSeparation; @@ -141,7 +141,7 @@ void UITabWidget::SetTabContainerSize() { mTabContainer->CenterHorizontal(); break; case UI_HALIGN_RIGHT: - mTabContainer->Pos( mSize.Width() - mTabContainer->Size().Width(), 0 ); + mTabContainer->Pos( mSize.width() - mTabContainer->Size().width(), 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().height(); 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().height() / 2; break; } mTabs[i]->Pos( w, h ); - w += mTabs[i]->Size().Width() + mTabSeparation; + w += mTabs[i]->Size().width() + mTabSeparation; } } diff --git a/src/eepp/ui/uitextbox.cpp b/src/eepp/ui/uitextbox.cpp index fb35f558c..d3b0e4611 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.width() - mPadding.Left - mPadding.Right, + mSize.height() - 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.width() ); } } @@ -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.width( (int)mTextCache->GetTextWidth() ); + mSize.height( (int)mTextCache->GetTextHeight() ); } } diff --git a/src/eepp/ui/uitextedit.cpp b/src/eepp/ui/uitextedit.cpp index 5d5f92c90..dbb30b548 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.Parent( this ); - ScrollBarP.PosSet( mSize.Width() - 15, 0 ); - ScrollBarP.Size = Sizei( 15, mSize.Height() ); + ScrollBarP.PosSet( mSize.width() - 15, 0 ); + ScrollBarP.Size = Sizei( 15, mSize.height() ); ScrollBarP.Flags = UI_AUTO_SIZE; ScrollBarP.VerticalScrollBar = true; mVScrollBar = eeNew( UIScrollBar, ( ScrollBarP ) ); mVScrollBar->Value( 1 ); - ScrollBarP.PosSet( 0, mSize.Height() - 15 ); - ScrollBarP.Size = Sizei( mSize.Width() - mVScrollBar->Size().Width(), 15 ); + ScrollBarP.PosSet( 0, mSize.height() - 15 ); + ScrollBarP.Size = Sizei( mSize.width() - mVScrollBar->Size().width(), 15 ); ScrollBarP.VerticalScrollBar = false; mHScrollBar = eeNew( UIScrollBar, ( ScrollBarP ) ); @@ -97,11 +97,11 @@ void UITextEdit::SetTheme( UITheme * Theme ) { } void UITextEdit::OnSizeChange() { - mHScrollBar->Pos( 0, mSize.Height() - mHScrollBar->Size().Height() ); - mVScrollBar->Pos( mSize.Width() - mVScrollBar->Size().Width(), 0 ); + mHScrollBar->Pos( 0, mSize.height() - mHScrollBar->Size().height() ); + mVScrollBar->Pos( mSize.width() - mVScrollBar->Size().width(), 0 ); - mHScrollBar->Size( mSize.Width(), mHScrollBar->Size().Height() ); - mVScrollBar->Size( mVScrollBar->Size().Width(), mSize.Height() ); + mHScrollBar->Size( mSize.width(), mHScrollBar->Size().height() ); + mVScrollBar->Size( mVScrollBar->Size().width(), mSize.height() ); mTextInput->Pos( 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.width() - mPadding.Left - mPadding.Right; + int Height = mSize.height() - mPadding.Top - mPadding.Bottom; if ( mHScrollBar->Visible() ) - Height -= mHScrollBar->Size().Height(); + Height -= mHScrollBar->Size().height(); int diff; Float pos; - if ( mTextInput->Size().Height() - Height >= 0 ) { - diff = mTextInput->Size().Height() - Height; + if ( mTextInput->Size().height() - Height >= 0 ) { + diff = mTextInput->Size().height() - Height; pos = diff * mVScrollBar->Value(); mTextInput->Pos( mTextInput->Pos().x, mPadding.Top - pos ); } - if ( mTextInput->Size().Width() - Width >= 0 ) { - diff = mTextInput->Size().Width() - Width; + if ( mTextInput->Size().width() - Width >= 0 ) { + diff = mTextInput->Size().width() - 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.width() - 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().height(); - if ( mTextInput->GetTextHeight() > mSize.Height() - mPadding.Top - mPadding.Bottom - extraH ) { + if ( mTextInput->GetTextHeight() > mSize.height() - 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.width(), mHScrollBar->Size().height() ); } else { - mHScrollBar->Size( mSize.Width() - mVScrollBar->Size().Width(), mHScrollBar->Size().Height() ); + mHScrollBar->Size( mSize.width() - mVScrollBar->Size().width(), mHScrollBar->Size().height() ); } 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.width() - mPadding.Left - mPadding.Right - mVScrollBar->Size().width() ) { 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.width() - mPadding.Left - mPadding.Right; + int Height = mSize.height() - mPadding.Top - mPadding.Bottom; if ( NULL != Event ) { if ( Event->EventType() == UIEvent::EventOnPressEnter ) { @@ -281,10 +281,10 @@ void UITextEdit::OnInputSizeChange( const UIEvent * Event ) { ScrollbarsSet(); if ( mHScrollBar->Visible() ) - Height -= mHScrollBar->Size().Height(); + Height -= mHScrollBar->Size().height(); if ( mVScrollBar->Visible() ) - Width -= mVScrollBar->Size().Width(); + Width -= mVScrollBar->Size().width(); 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().width() < Width || mTextInput->Size().height() < Height ) { + if ( mTextInput->Size().width() < Width && mTextInput->Size().height() < Height ) { mTextInput->Size( Width, Height ); } else { - if ( mTextInput->Size().Width() < Width ) { - mTextInput->Size( Width, mTextInput->Size().Height() ); + if ( mTextInput->Size().width() < Width ) { + mTextInput->Size( Width, mTextInput->Size().height() ); } else { - mTextInput->Size( mTextInput->Size().Width(), Height ); + mTextInput->Size( mTextInput->Size().width(), 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.width() - mPadding.Left - mPadding.Right; + int Height = mSize.height() - mPadding.Top - mPadding.Bottom; if ( mVScrollBar->Visible() ) - Width -= mVScrollBar->Size().Width(); + Width -= mVScrollBar->Size().width(); if ( mHScrollBar->Visible() ) - Height -= mHScrollBar->Size().Height(); + Height -= mHScrollBar->Size().height(); if ( FontHAlignGet( mTextInput->Flags() ) == UI_HALIGN_LEFT ) { Uint32 NLPos = 0; @@ -364,8 +364,8 @@ void UITextEdit::FixScrollToCursor() { mTextInput->Pos( mTextInput->Pos().x, mPadding.Top ); } - mHScrollBar->Value( tW / mTextInput->Size().Width() ); - mVScrollBar->Value( tH / mTextInput->Size().Height() ); + mHScrollBar->Value( tW / mTextInput->Size().width() ); + mVScrollBar->Value( tH / mTextInput->Size().height() ); mSkipValueChange = false; } diff --git a/src/eepp/ui/uitextinput.cpp b/src/eepp/ui/uitextinput.cpp index 80169cd7c..e0b267bdb 100644 --- a/src/eepp/ui/uitextinput.cpp +++ b/src/eepp/ui/uitextinput.cpp @@ -162,8 +162,8 @@ void UITextInput::AlignFix() { if ( !mTextBuffer.SupportNewLine() ) { 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.width() - mPadding.Left - mPadding.Right ) + mAlignOffset.x = mSize.width() - 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().height() ); } } diff --git a/src/eepp/ui/uitextinputpassword.cpp b/src/eepp/ui/uitextinputpassword.cpp index fcc80293b..2516b2f5c 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.width() - mPadding.Left - mPadding.Right, + mSize.height() - mPadding.Top - mPadding.Bottom ); } @@ -72,8 +72,8 @@ void UITextInputPassword::AlignFix() { if ( !mTextBuffer.SupportNewLine() ) { 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.width() - mPadding.Left - mPadding.Right ) + mAlignOffset.x = mSize.width() - mPadding.Left - mPadding.Right - ( mAlignOffset.x + ( tW - mAlignOffset.x ) ); } } } diff --git a/src/eepp/ui/uitooltip.cpp b/src/eepp/ui/uitooltip.cpp index 0e20f4149..57a5f88da 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.width( (int)mTextCache->GetTextWidth() + mPadding.Left + mPadding.Right ); + mSize.height( (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.width() - mPadding.Left - mPadding.Right; + Uint32 Height = mSize.height() - 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 671b2bb4a..77cbe4762 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->Pos() - Vector2i( mBorderLeft->Size().Width(), mWindowDecoration->Size().Height() ); + Vector2i PosDiff = mContainer->Pos() - Vector2i( mBorderLeft->Size().width(), mWindowDecoration->Size().height() ); if ( PosDiff.x != 0 || PosDiff.y != 0 ) { - mContainer->Pos( mBorderLeft->Size().Width(), mWindowDecoration->Size().Height() ); + mContainer->Pos( mBorderLeft->Size().width(), mWindowDecoration->Size().height() ); Pos( 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().width() + mBorderRight->Size().width() - mButtonsPositionFixer.x; + tSize.y = mWindowDecoration->Size().height() + mBorderBottom->Size().height(); if ( NULL != mButtonClose ) - tSize.x += mButtonClose->Size().Width(); + tSize.x += mButtonClose->Size().width(); if ( NULL != mButtonMaximize ) - tSize.x += mButtonMaximize->Size().Width(); + tSize.x += mButtonMaximize->Size().width(); if ( NULL != mButtonMinimize ) - tSize.x += mButtonMinimize->Size().Width(); + tSize.x += mButtonMinimize->Size().width(); 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().width() + mBorderRight->Size().width(); + size.y += mWindowDecoration->Size().height() + mBorderBottom->Size().height(); 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.width(), mSize.height() ); return; } if ( mDecoAutoSize ) { - mDecoSize = Sizei( mSize.Width(), mWindowDecoration->GetSkinSize().Height() ); + mDecoSize = Sizei( mSize.width(), mWindowDecoration->GetSkinSize().height() ); } mWindowDecoration->Size( mDecoSize ); if ( mBorderAutoSize ) { - mBorderBottom->Size( mSize.Width(), mBorderBottom->GetSkinSize().Height() ); + mBorderBottom->Size( mSize.width(), mBorderBottom->GetSkinSize().height() ); } else { - mBorderBottom->Size( mSize.Width(), mBorderSize.Height() ); + mBorderBottom->Size( mSize.width(), mBorderSize.height() ); } - Uint32 BorderHeight = mSize.Height() - mDecoSize.Height() - mBorderBottom->Size().Height(); + Uint32 BorderHeight = mSize.height() - mDecoSize.height() - mBorderBottom->Size().height(); if ( mBorderAutoSize ) { - mBorderLeft->Size( mBorderLeft->GetSkinSize().Width() , BorderHeight ); - mBorderRight->Size( mBorderRight->GetSkinSize().Width(), BorderHeight ); + mBorderLeft->Size( mBorderLeft->GetSkinSize().width() , BorderHeight ); + mBorderRight->Size( mBorderRight->GetSkinSize().width(), BorderHeight ); } else { - mBorderLeft->Size( mBorderSize.Width(), BorderHeight ); - mBorderRight->Size( mBorderSize.Width(), BorderHeight ); + mBorderLeft->Size( mBorderSize.width(), BorderHeight ); + mBorderRight->Size( mBorderSize.width(), BorderHeight ); } - mBorderLeft->Pos( 0, mWindowDecoration->Size().Height() ); - mBorderRight->Pos( mSize.Width() - mBorderRight->Size().Width(), mWindowDecoration->Size().Height() ); - mBorderBottom->Pos( 0, mSize.Height() - mBorderBottom->Size().Height() ); + mBorderLeft->Pos( 0, mWindowDecoration->Size().height() ); + mBorderRight->Pos( mSize.width() - mBorderRight->Size().width(), mWindowDecoration->Size().height() ); + mBorderBottom->Pos( 0, mSize.height() - mBorderBottom->Size().height() ); - mContainer->Pos( 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->Pos( mBorderLeft->Size().width(), mWindowDecoration->Size().height() ); + mContainer->Size( mSize.width() - mBorderLeft->Size().width() - mBorderRight->Size().width(), mSize.height() - mWindowDecoration->Size().height() - mBorderBottom->Size().height() ); Uint32 yPos; if ( NULL != mButtonClose ) { - yPos = mWindowDecoration->Size().Height() / 2 - mButtonClose->Size().Height() / 2 + mButtonsPositionFixer.y; + yPos = mWindowDecoration->Size().height() / 2 - mButtonClose->Size().height() / 2 + mButtonsPositionFixer.y; - mButtonClose->Pos( mWindowDecoration->Size().Width() - mBorderRight->Size().Width() - mButtonClose->Size().Width() + mButtonsPositionFixer.x, yPos ); + mButtonClose->Pos( mWindowDecoration->Size().width() - mBorderRight->Size().width() - mButtonClose->Size().width() + mButtonsPositionFixer.x, yPos ); } if ( NULL != mButtonMaximize ) { - yPos = mWindowDecoration->Size().Height() / 2 - mButtonMaximize->Size().Height() / 2 + mButtonsPositionFixer.y; + yPos = mWindowDecoration->Size().height() / 2 - mButtonMaximize->Size().height() / 2 + mButtonsPositionFixer.y; if ( NULL != mButtonClose ) { - mButtonMaximize->Pos( mButtonClose->Pos().x - mButtonsSeparation - mButtonMaximize->Size().Width(), yPos ); + mButtonMaximize->Pos( mButtonClose->Pos().x - mButtonsSeparation - mButtonMaximize->Size().width(), yPos ); } else { - mButtonMaximize->Pos( mWindowDecoration->Size().Width() - mBorderRight->Size().Width() - mButtonMaximize->Size().Width() + mButtonsPositionFixer.x, yPos ); + mButtonMaximize->Pos( mWindowDecoration->Size().width() - mBorderRight->Size().width() - mButtonMaximize->Size().width() + mButtonsPositionFixer.x, yPos ); } } if ( NULL != mButtonMinimize ) { - yPos = mWindowDecoration->Size().Height() / 2 - mButtonMinimize->Size().Height() / 2 + mButtonsPositionFixer.y; + yPos = mWindowDecoration->Size().height() / 2 - mButtonMinimize->Size().height() / 2 + mButtonsPositionFixer.y; if ( NULL != mButtonMaximize ) { - mButtonMinimize->Pos( mButtonMaximize->Pos().x - mButtonsSeparation - mButtonMinimize->Size().Width(), yPos ); + mButtonMinimize->Pos( mButtonMaximize->Pos().x - mButtonsSeparation - mButtonMinimize->Size().width(), yPos ); } else { if ( NULL != mButtonClose ) { - mButtonMinimize->Pos( mButtonClose->Pos().x - mButtonsSeparation - mButtonMinimize->Size().Width(), yPos ); + mButtonMinimize->Pos( mButtonClose->Pos().x - mButtonsSeparation - mButtonMinimize->Size().width(), yPos ); } else { - mButtonMinimize->Pos( mWindowDecoration->Size().Width() - mBorderRight->Size().Width() - mButtonMinimize->Size().Width() + mButtonsPositionFixer.x, yPos ); + mButtonMinimize->Pos( mWindowDecoration->Size().width() - mBorderRight->Size().width() - mButtonMinimize->Size().width() + 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().width() ) { TryResize( RESIZE_TOPLEFT ); - } else if ( Pos.x >= ( mSize.Width() - mBorderRight->Size().Width() ) ) { + } else if ( Pos.x >= ( mSize.width() - mBorderRight->Size().width() ) ) { TryResize( RESIZE_TOPRIGHT ); - } else if ( Pos.y <= mBorderBottom->Size().Height() ) { + } else if ( Pos.y <= mBorderBottom->Size().height() ) { if ( Pos.x < mMinCornerDistance ) { TryResize( RESIZE_TOPLEFT ); - } else if ( Pos.x > mSize.Width() - mMinCornerDistance ) { + } else if ( Pos.x > mSize.width() - 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.width() - mMinCornerDistance ) { TryResize( RESIZE_RIGHTBOTTOM ); } else { TryResize( RESIZE_BOTTOM ); } } else if ( Control == mBorderLeft ) { - if ( Pos.y >= mSize.Height() - mMinCornerDistance ) { + if ( Pos.y >= mSize.height() - mMinCornerDistance ) { TryResize( RESIZE_LEFTBOTTOM ); } else { TryResize( RESIZE_LEFT ); } } else if ( Control == mBorderRight ) { - if ( Pos.y >= mSize.Height() - mMinCornerDistance ) { + if ( Pos.y >= mSize.height() - 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.width() - 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.height() - Pos.y; break; } case RESIZE_RIGHTBOTTOM: { - mResizePos.x = mSize.Width() - Pos.x; - mResizePos.y = mSize.Height() - Pos.y; + mResizePos.x = mSize.width() - Pos.x; + mResizePos.y = mSize.height() - Pos.y; break; } case RESIZE_LEFTBOTTOM: { mResizePos.x = Pos.x; - mResizePos.y = mSize.Height() - Pos.y; + mResizePos.y = mSize.height() - 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.width() - 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.height() ); break; } case RESIZE_BOTTOM: { - InternalSize( mSize.Width(), Pos.y + mResizePos.y ); + InternalSize( mSize.width(), Pos.y + mResizePos.y ); break; } case RESIZE_LEFT: { Pos.x -= mResizePos.x; UIControl::Pos( mPos.x + Pos.x, mPos.y ); - InternalSize( mSize.Width() - Pos.x, mSize.Height() ); + InternalSize( mSize.width() - Pos.x, mSize.height() ); break; } case RESIZE_TOP: { Pos.y -= mResizePos.y; UIControl::Pos( mPos.x, mPos.y + Pos.y ); - InternalSize( mSize.Width(), mSize.Height() - Pos.y ); + InternalSize( mSize.width(), mSize.height() - Pos.y ); break; } case RESIZE_RIGHTBOTTOM: @@ -603,7 +603,7 @@ void UIWindow::UpdateResize() { { Pos -= mResizePos; UIControl::Pos( mPos.x + Pos.x, mPos.y + Pos.y ); - InternalSize( mSize.Width() - Pos.x, mSize.Height() - Pos.y ); + InternalSize( mSize.width() - Pos.x, mSize.height() - Pos.y ); break; } case RESIZE_TOPRIGHT: @@ -611,7 +611,7 @@ void UIWindow::UpdateResize() { Pos.y -= mResizePos.y; Pos.x += mResizePos.x; UIControl::Pos( mPos.x, mPos.y + Pos.y ); - InternalSize( Pos.x, mSize.Height() - Pos.y ); + InternalSize( Pos.x, mSize.height() - Pos.y ); break; } case RESIZE_LEFTBOTTOM: @@ -619,7 +619,7 @@ void UIWindow::UpdateResize() { Pos.x -= mResizePos.x; Pos.y += mResizePos.y; UIControl::Pos( mPos.x + Pos.x, mPos.y ); - InternalSize( mSize.Width() - Pos.x, Pos.y ); + InternalSize( mSize.width() - 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.width(), mSize.height() ) ), 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.width(), 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.height() ) ), 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.width(), ShadowPos.y ), Sizef( SSize, mSize.height() ) ), 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.height() ), Sizef( mSize.width(), 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.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, 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.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, 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.height() ), Vector2f( ShadowPos.x - SSize, ShadowPos.y + mSize.height() ), Vector2f( ShadowPos.x, ShadowPos.y + mSize.height() + 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->Pos( mBorderLeft->Size().Width(), 0 ); + mTitle->Size( mWindowDecoration->Size().width() - mBorderLeft->Size().width() - mBorderRight->Size().width(), mWindowDecoration->Size().height() ); + mTitle->Pos( mBorderLeft->Size().width(), 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().width() ) { Man->SetCursor( EE_CURSOR_SIZENWSE ); // RESIZE_TOPLEFT - } else if ( Pos.x >= ( mSize.Width() - mBorderRight->Size().Width() ) ) { + } else if ( Pos.x >= ( mSize.width() - mBorderRight->Size().width() ) ) { Man->SetCursor( EE_CURSOR_SIZENESW ); // RESIZE_TOPRIGHT - } else if ( Pos.y <= mBorderBottom->Size().Height() ) { + } else if ( Pos.y <= mBorderBottom->Size().height() ) { if ( Pos.x < mMinCornerDistance ) { Man->SetCursor( EE_CURSOR_SIZENWSE ); // RESIZE_TOPLEFT - } else if ( Pos.x > mSize.Width() - mMinCornerDistance ) { + } else if ( Pos.x > mSize.width() - 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.width() - 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.height() - 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.height() - 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 46252238e..c43602e96 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().width(), 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().height(); - Size( Parent()->Size().Width(), mMenuHeight ); + Size( Parent()->Size().width(), 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().height(); 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().height(); switch ( VAlignGet( Flags() ) ) { case UI_VALIGN_CENTER: @@ -158,10 +158,10 @@ void UIWinMenu::RefreshButtons() { UISelectButton * pbut = it->first; UITextBox * tbox = pbut->TextBox(); - pbut->Size( tbox->GetTextWidth() + mButtonMargin, Size().Height() ); + pbut->Size( tbox->GetTextWidth() + mButtonMargin, Size().height() ); pbut->Pos( xpos, ycenter ); - xpos += pbut->Size().Width() + mMarginBetweenButtons; + xpos += pbut->Size().width() + mMarginBetweenButtons; } } @@ -174,7 +174,7 @@ Uint32 UIWinMenu::OnMessage( const UIMessage * Msg ) { UISelectButton * tbut = reinterpret_cast ( Msg->Sender() ); UIPopUpMenu * tpop = GetMenuFromButton( tbut ); - Vector2i pos( tbut->Pos().x, tbut->Pos().y + tbut->Size().Height() ); + Vector2i pos( tbut->Pos().x, tbut->Pos().y + tbut->Size().height() ); tpop->Pos( pos ); if ( Msg->Msg() == UIMessage::MsgMouseEnter ) { diff --git a/src/eepp/window/backend/SDL2/windowsdl2.cpp b/src/eepp/window/backend/SDL2/windowsdl2.cpp index 879ec8ae2..9e2b27db0 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.width(); + mWindow.WindowConfig.Height = mWindow.DesktopResolution.height(); } mWindow.Flags = SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN; @@ -340,7 +340,7 @@ void WindowSDL::ToggleFullscreen() { if ( Windowed() ) { Size( mWindow.WindowConfig.Width, mWindow.WindowConfig.Height, !Windowed() ); } else { - Size( mWindow.WindowSize.Width(), mWindow.WindowSize.Height(), !Windowed() ); + Size( mWindow.WindowSize.width(), mWindow.WindowSize.height(), !Windowed() ); } if ( WasMaximized ) { @@ -374,8 +374,8 @@ bool WindowSDL::Visible() { void WindowSDL::Size( Uint32 Width, Uint32 Height, bool Windowed ) { if ( ( !Width || !Height ) ) { - Width = mWindow.DesktopResolution.Width(); - Height = mWindow.DesktopResolution.Height(); + Width = mWindow.DesktopResolution.width(); + Height = mWindow.DesktopResolution.height(); } if ( this->Windowed() == 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.size().width(); + r.h = rect.size().height(); SDL_SetTextInputRect( &r ); diff --git a/src/eepp/window/window.cpp b/src/eepp/window/window.cpp index b675cfe77..483a38034 100644 --- a/src/eepp/window/window.cpp +++ b/src/eepp/window/window.cpp @@ -489,7 +489,7 @@ void Window::SetCurrent() { void Window::Center() { if ( Windowed() ) { - Position( mWindow.DesktopResolution.Width() / 2 - mWindow.WindowConfig.Width / 2, mWindow.DesktopResolution.Height() / 2 - mWindow.WindowConfig.Height / 2 ); + Position( mWindow.DesktopResolution.width() / 2 - mWindow.WindowConfig.Width / 2, mWindow.DesktopResolution.height() / 2 - mWindow.WindowConfig.Height / 2 ); } } diff --git a/src/examples/external_shader/external_shader.cpp b/src/examples/external_shader/external_shader.cpp index acacaf15e..cf4fd456c 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->Windowed() ) { - win->Size( win->GetDesktopResolution().Width(), win->GetDesktopResolution().Height(), false ); + win->Size( win->GetDesktopResolution().width(), win->GetDesktopResolution().height(), false ); } else { win->Size( 960, 640, true ); win->Center(); @@ -168,8 +168,8 @@ void MainLoop() if ( d < 2.f ) { if ( d < 0.03f ) { - vertices[i+1].x = Math::Randf( -1, 1 ) * aspectRatio; - vertices[i+1].y = Math::Randf( -1, 1 ); + vertices[i+1].x = Math::randf( -1, 1 ) * aspectRatio; + vertices[i+1].y = Math::randf( -1, 1 ); velocities[i].x = 0; velocities[i].y = 0; } else { @@ -259,8 +259,8 @@ EE_MAIN_FUNC int main (int argc, char * argv []) for (i = 0; i < ParticlesNum; i++ ) { vertices[i] = Vector3ff( 0, 0, 1.83 ); - velocities[i] = Vector3ff( (Math::Randf() * 2 - 1)*.05, (Math::Randf() * 2 - 1)*.05, .93 + Math::Randf()*.02 ); - colors[i] = ColorAf( Math::Randf() * 0.5, 0.1, 0.8, 0.5 ); + velocities[i] = Vector3ff( (Math::randf() * 2 - 1)*.05, (Math::randf() * 2 - 1)*.05, .93 + Math::randf()*.02 ); + colors[i] = ColorAf( Math::randf() * 0.5, 0.1, 0.8, 0.5 ); } /** Optimized for ARM ( pre-cache sqrt ) */ diff --git a/src/examples/physics/physics.cpp b/src/examples/physics/physics.cpp index 08b1ba44d..dea4da158 100644 --- a/src/examples/physics/physics.cpp +++ b/src/examples/physics/physics.cpp @@ -341,7 +341,7 @@ void Demo3Update() { Body * body = mSpace->AddBody( Body::New( 1.0f, Moment::ForCircle(1.0f, 15.0f, 0.0f, cVectZero ) ) ); body->Pos( emitterInstance.position ); - body->Vel( cVectNew( Math::Randf(-1,1), Math::Randf(-1,1) ) * (cpFloat)100 ); + body->Vel( cVectNew( Math::randf(-1,1), Math::randf(-1,1) ) * (cpFloat)100 ); Shape *shape = mSpace->AddShape( ShapeCircle::New( body, 15.0f, cVectZero ) ); shape->CollisionType( BALL_TYPE ); @@ -502,8 +502,8 @@ void Demo4Create() { cpFloat radius = 10.0f; Body * body = mSpace->AddBody( Body::New( mass, Moment::ForCircle( mass, 0.0f, radius, cVectZero ) ) ); - body->Pos( cVectNew( x + easing::LinearInterpolation( Math::Randf(), -150.0f, 150.0f, 1 ), - y + easing::LinearInterpolation( Math::Randf(), -150.0f, 150.0f, 1 ) + body->Pos( cVectNew( x + easing::linearInterpolation( Math::randf(), -150.0f, 150.0f, 1 ), + y + easing::linearInterpolation( Math::randf(), -150.0f, 150.0f, 1 ) ) ); Shape * shape = mSpace->AddShape( ShapeCircle::New( body, radius + STICK_SENSOR_THICKNESS, cVectZero ) ); diff --git a/src/examples/sprites/sprites.cpp b/src/examples/sprites/sprites.cpp index 0c95d9849..7424a3908 100644 --- a/src/examples/sprites/sprites.cpp +++ b/src/examples/sprites/sprites.cpp @@ -25,12 +25,12 @@ void spriteCallback( Uint32 Event, Sprite * Sprite, void * UserData ) { } else if ( Event == USER_SPRITE_EVENT ) { // Create an interpolation to change the angle of the sprite Interpolation * RotationInterpolation = reinterpret_cast( UserData ); - RotationInterpolation->ClearWaypoints(); - 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->Start(); + RotationInterpolation->clearWaypoints(); + 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->start(); // Scale the sprite if ( Sprite->Scale().x < 3 ) { @@ -60,12 +60,12 @@ void MainLoop() } // Update the angle interpolation - PlanetAngle.Update( win->Elapsed() ); - RockAngle.Update( win->Elapsed() ); + PlanetAngle.update( win->Elapsed() ); + RockAngle.update( win->Elapsed() ); // Set the Planet and Rock angle from the interpolation - Planet->Angle( PlanetAngle.GetPos() ); - Rock->Angle( RockAngle.GetPos() ); + Planet->Angle( PlanetAngle.getPos() ); + Rock->Angle( RockAngle.getPos() ); // Draw the static planet sprite Planet->Draw(); @@ -142,18 +142,18 @@ 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().size().width() / 2, ScreenCenter.y - Planet->GetAABB().size().height() / 2 ); - Rock->Position( ScreenCenter.x - Rock->GetAABB().Size().Width() / 2, ScreenCenter.y - Rock->GetAABB().Size().Height() / 2 ); + Rock->Position( ScreenCenter.x - Rock->GetAABB().size().width() / 2, ScreenCenter.y - Rock->GetAABB().size().height() / 2 ); - Blindy->Position( ScreenCenter.x - Blindy->GetAABB().Size().Width() / 2, ScreenCenter.y - Blindy->GetAABB().Size().Height() / 2 ); + Blindy->Position( ScreenCenter.x - Blindy->GetAABB().size().width() / 2, ScreenCenter.y - Blindy->GetAABB().size().height() / 2 ); // Set the planet angle interpolation - PlanetAngle.AddWaypoint( 0 ); - PlanetAngle.AddWaypoint( 360 ); - PlanetAngle.SetTotalTime( Seconds( 10 ) ); - PlanetAngle.Loop( true ); - PlanetAngle.Start(); + PlanetAngle.addWaypoint( 0 ); + PlanetAngle.addWaypoint( 360 ); + PlanetAngle.setTotalTime( Seconds( 10 ) ); + PlanetAngle.loop( true ); + PlanetAngle.start(); // Create a Event callback for the rock sprite Rock->SetEventsCallback( cb::Make3( &spriteCallback ), &RockAngle ); diff --git a/src/examples/vbo_fbo_batch/vbo_fbo_batch.cpp b/src/examples/vbo_fbo_batch/vbo_fbo_batch.cpp index beae82678..915a3b04b 100644 --- a/src/examples/vbo_fbo_batch/vbo_fbo_batch.cpp +++ b/src/examples/vbo_fbo_batch/vbo_fbo_batch.cpp @@ -72,7 +72,7 @@ void MainLoop() Vector2f( aX + 32.f, aY + 32.f ), Vector2f( aX + 32.f, aY ) ); - TmpQuad.Rotate( ang, Vector2f( aX + 16.f, aY + 16.f ) ); + TmpQuad.rotate( ang, Vector2f( aX + 16.f, aY + 16.f ) ); // Begin drawing quads Batch->QuadsBegin(); @@ -120,7 +120,7 @@ EE_MAIN_FUNC int main (int argc, char * argv []) // Check if created if ( win->Created() ) { - Polygon2f Poly( Polygon2f::CreateRoundedRectangle( 0, 0, 200, 50 ) ); + Polygon2f Poly( Polygon2f::createRoundedRectangle( 0, 0, 200, 50 ) ); // Create the Vertex Buffer, the vertex buffer stores the vertex data in the GPU, making the rendering much faster // In the case that Vertex Buffer Object is not supported by the GPU, it will fallback to a inmediate-mode vertex buffer @@ -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.size(); 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().center() ); - for ( Uint32 i = 0; i < Poly.Size(); i++ ) { + for ( Uint32 i = 0; i < Poly.size(); 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 a8746530e..714a28bfe 100644 --- a/src/test/eetest.cpp +++ b/src/test/eetest.cpp @@ -82,7 +82,7 @@ void EETest::Init() { //InBuf.Start(); InBuf.SupportNewLine( true ); - SetRandomSeed( static_cast( Sys::getSystemTime() * 1000 ) ); + setRandomSeed( static_cast( Sys::getSystemTime() * 1000 ) ); LoadTextures(); @@ -99,17 +99,17 @@ void EETest::Init() { } } - WP.Type( Ease::QuarticInOut ); - WP.AddWaypoint( Vector2f(0,0), 100 ); - WP.AddWaypoint( Vector2f(800,0), 100 ); - WP.AddWaypoint( Vector2f(0,0), 100 ); - WP.AddWaypoint( Vector2f(1024,768), 100 ); - WP.AddWaypoint( Vector2f(0,600), 100 ); - WP.EditWaypoint( 2, Vector2f(800,600), 100 ); - WP.EraseWaypoint( 3 ); - WP.Loop(true); - WP.SetTotalTime( Milliseconds( 5000 ) ); - WP.Start(); + WP.type( Ease::QuarticInOut ); + WP.addWaypoint( Vector2f(0,0), 100 ); + WP.addWaypoint( Vector2f(800,0), 100 ); + WP.addWaypoint( Vector2f(0,0), 100 ); + WP.addWaypoint( Vector2f(1024,768), 100 ); + WP.addWaypoint( Vector2f(0,600), 100 ); + WP.editWaypoint( 2, Vector2f(800,600), 100 ); + WP.eraseWaypoint( 3 ); + WP.loop(true); + WP.setTotalTime( Milliseconds( 5000 ) ); + WP.start(); Batch.AllocVertexs( 2048 ); Batch.SetBlendMode( ALPHA_BLENDONE ); @@ -119,12 +119,12 @@ void EETest::Init() { if ( NULL != mFBO ) mFBO->ClearColor( ColorAf( 0, 0, 0, 0.5f ) ); - Polygon2f Poly = Polygon2f::CreateRoundedRectangle( 0, 0, 256, 50 ); + Polygon2f Poly = Polygon2f::createRoundedRectangle( 0, 0, 256, 50 ); 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.size(); 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()->loop( true ); Params.Background.Colors( ColorA( 0xFFFF0077 ), ColorA( 0xCCCC0077 ), ColorA( 0xCCCC0077 ), ColorA( 0xFFFF0077 ) ); Params.Parent( 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()->loop( true ); mTheme->CreateSprite( eeNew( Sprite, ( "gn" ) ), C, Sizei(), Vector2i( 160, 100 ) ); @@ -771,7 +771,7 @@ void EETest::ButtonClick( const UIEvent * Event ) { Gfx->Enabled( false ); Gfx->StartRotation( 0, 2500, Milliseconds( 2500 ) ); - Gfx->StartMovement( Vector2i( Math::Randi( 0, mWindow->GetWidth() ), -64 ), Vector2i( Math::Randi( 0, mWindow->GetWidth() ), mWindow->GetHeight() + 64 ), Milliseconds( 2500 ) ); + Gfx->StartMovement( Vector2i( Math::randi( 0, mWindow->GetWidth() ), -64 ), Vector2i( Math::randi( 0, mWindow->GetWidth() ), mWindow->GetHeight() + 64 ), Milliseconds( 2500 ) ); Gfx->CloseFadeOut( Milliseconds( 3500 ) ); mListBox->AddListBoxItem( "Test ListBox " + String::toStr( mListBox->Count() + 1 ) + " testing it right now!" ); @@ -894,9 +894,9 @@ void EETest::LoadTextures() { ColorA C = Tex->GetPixel(x, y); if ( C.r() > 200 && C.g() > 200 && C.b() > 200 ) - Tex->SetPixel(x, y, ColorA( Math::Randi(0, 255), Math::Randi(0, 255), Math::Randi(0, 255), C.a() ) ); + Tex->SetPixel(x, y, ColorA( Math::randi(0, 255), Math::randi(0, 255), Math::randi(0, 255), C.a() ) ); else - Tex->SetPixel(x, y, ColorA( Math::Randi(200, 255), Math::Randi(200, 255), Math::Randi(200, 255), C.a() ) ); + Tex->SetPixel(x, y, ColorA( Math::randi(200, 255), Math::randi(200, 255), Math::randi(200, 255), C.a() ) ); } } @@ -992,7 +992,7 @@ void EETest::Screen2() { Vector2f( aX + 32.f, aY + 32.f ), Vector2f( aX + 32.f, aY ) ); - TmpQuad.Rotate( ang, Vector2f( aX + 16.f, aY + 16.f ) ); + TmpQuad.rotate( ang, Vector2f( aX + 16.f, aY + 16.f ) ); for ( Uint32 z = 0; z < 16; z++ ) { for ( Uint32 y = 0; y < 16; y++ ) { @@ -1058,12 +1058,12 @@ void EETest::Screen2() { #ifndef EE_GLES CL1.RenderMode( RN_ISOMETRIC ); - if ( CL1.GetAABB().IntersectCircle( Mousef, 80.f ) ) + if ( CL1.GetAABB().intersectCircle( Mousef, 80.f ) ) CL1.Color( ColorA(255, 0, 0, 200) ); else CL1.Color( ColorA(255, 255, 255, 200) ); - if ( Polygon2f::IntersectQuad2( CL1.GetQuad() , CL2.GetQuad() ) ) { + if ( Polygon2f::intersectQuad2( CL1.GetQuad() , CL2.GetQuad() ) ) { CL1.Color( ColorA(0, 255, 0, 255) ); CL2.Color( ColorA(0, 255, 0, 255) ); } else @@ -1097,12 +1097,12 @@ void EETest::Screen2() { Line2f Line3( Vector2f((Float)mWindow->GetWidth(), 0.f), Vector2f( 0.f, (Float)mWindow->GetHeight() ) ); Line2f Line4( Vector2f(Mousef.x - 80.f, Mousef.y + 80.f), Vector2f(Mousef.x + 80.f, Mousef.y - 80.f) ); - if ( Line.Intersect( Line2 ) ) + if ( Line.intersect( Line2 ) ) iL1 = true; else iL1 = false; - if ( Line3.Intersect( Line4 ) ) + if ( Line3.intersect( Line4 ) ) iL2 = true; else iL2 = false; @@ -1128,9 +1128,9 @@ void EETest::Screen2() { TNP[3]->DrawQuadEx( Quad2f( Vector2f(0.f, 0.f), Vector2f(0.f, 100.f), Vector2f(150.f, 150.f), Vector2f(200.f, 150.f) ), Vector2f(), ang, Vector2f(scale,scale), ColorA(220, 240, 0, 125), ColorA(100, 0, 240, 125), ColorA(250, 50, 25, 125), ColorA(50, 150, 150, 125) ); - WP.Update( et ); + WP.update( et ); PR.SetColor( ColorA(0, 255, 0, 255) ); - PR.DrawPoint( WP.GetPos(), 10.f ); + PR.DrawPoint( WP.getPos(), 10.f ); } void EETest::Screen3() { @@ -1339,7 +1339,7 @@ void EETest::Input() { if ( KM->AltPressed() && KM->IsKeyUp( KEY_RETURN ) ) { if ( mWindow->Windowed() ) { - mWindow->Size( mWindow->GetDesktopResolution().Width(), mWindow->GetDesktopResolution().Height(), false ); + mWindow->Size( mWindow->GetDesktopResolution().width(), mWindow->GetDesktopResolution().height(), false ); } else { mWindow->ToggleFullscreen(); } @@ -1538,11 +1538,11 @@ void EETest::ParticlesCallback( Particle * P, ParticleSystem * Me ) { Float x, y, radio; Vector2f MePos( Me->Position() ); - radio = (Math::Randf(1.f, 1.2f) + sin( 20.0f / P->Id() )) * 24; + radio = (Math::randf(1.f, 1.2f) + sin( 20.0f / P->Id() )) * 24; x = MePos.x + radio * cos( (Float)P->Id() ); y = MePos.y + radio * sin( (Float)P->Id() ); - P->Reset(x, y, Math::Randf(-10.f, 10.f), Math::Randf(-10.f, 10.f), Math::Randf(-10.f, 10.f), Math::Randf(-10.f, 10.f)); - P->Color( ColorAf(1.f, 0.6f, 0.3f, 1.f), 0.02f + Math::Randf() * 0.3f ); + P->Reset(x, y, Math::randf(-10.f, 10.f), Math::randf(-10.f, 10.f), Math::randf(-10.f, 10.f), Math::randf(-10.f, 10.f)); + P->Color( ColorAf(1.f, 0.6f, 0.3f, 1.f), 0.02f + Math::randf() * 0.3f ); } void EETest::Particles() { @@ -1552,8 +1552,8 @@ void EETest::Particles() { PS[1].Position( Mousef ); PS[2].Position( HWidth, HHeight ); - PS[3].Position( Math::cosAng(Ang) * 220.f + HWidth + Math::Randf(0.f, 10.f), Math::sinAng(Ang) * 220.f + HHeight + Math::Randf(0.f, 10.f) ); - PS[4].Position( -Math::cosAng(Ang) * 220.f + HWidth + Math::Randf(0.f, 10.f), -Math::sinAng(Ang) * 220.f + HHeight + Math::Randf(0.f, 10.f) ); + PS[3].Position( Math::cosAng(Ang) * 220.f + HWidth + Math::randf(0.f, 10.f), Math::sinAng(Ang) * 220.f + HHeight + Math::randf(0.f, 10.f) ); + PS[4].Position( -Math::cosAng(Ang) * 220.f + HWidth + Math::randf(0.f, 10.f), -Math::sinAng(Ang) * 220.f + HHeight + Math::randf(0.f, 10.f) ); for ( Uint32 i = 0; i < PS.size(); i++ ) PS[i].Draw(); @@ -1754,7 +1754,7 @@ void EETest::Demo2Update() { Body * body = mSpace->AddBody( Body::New( 1.0f, Moment::ForCircle(1.0f, 15.0f, 0.0f, cVectZero ) ) ); body->Pos( emitterInstance.position ); - body->Vel( cVectNew( Math::Randf(-1,1), Math::Randf(-1,1) ) * (cpFloat)100 ); + body->Vel( cVectNew( Math::randf(-1,1), Math::randf(-1,1) ) * (cpFloat)100 ); Shape *shape = mSpace->AddShape( ShapeCircle::New( body, 15.0f, cVectZero ) ); shape->CollisionType( BALL_TYPE );