From 261d88ff37fd6e347ff5ad31669f3dfa422da235 Mon Sep 17 00:00:00 2001 From: Edouard Dupin Date: Mon, 11 Jun 2012 10:53:39 +0200 Subject: [PATCH] Move to standard type :float, Vector2D ... --- Sources/libetk/etk/Color.cpp | 2 +- Sources/libetk/etk/Color.h | 2 +- Sources/libetk/etk/Types.h | 11 - Sources/libetk/etk/TypesCoordonate.h | 428 ------------------ Sources/libewol/ewol/Audio/audio.cpp | 2 +- Sources/libewol/ewol/Audio/audio.h | 2 +- Sources/libewol/ewol/FontFreeType.cpp | 162 +++---- Sources/libewol/ewol/Game/GameElement.cpp | 12 +- Sources/libewol/ewol/Game/GameElement.h | 30 +- Sources/libewol/ewol/Game/GameElementLua.cpp | 26 +- Sources/libewol/ewol/Game/GameElementLua.h | 4 +- Sources/libewol/ewol/Game/SceneElement.cpp | 14 +- Sources/libewol/ewol/Game/SceneElement.h | 8 +- Sources/libewol/ewol/OObject/2DColored.cpp | 144 +++--- Sources/libewol/ewol/OObject/2DColored.h | 28 +- Sources/libewol/ewol/OObject/2DText.cpp | 4 +- .../libewol/ewol/OObject/2DTextColored.cpp | 6 +- Sources/libewol/ewol/OObject/2DTextColored.h | 2 +- Sources/libewol/ewol/OObject/2DTextured.cpp | 8 +- Sources/libewol/ewol/OObject/2DTextured.h | 4 +- Sources/libewol/ewol/OObject/Sprite.cpp | 12 +- Sources/libewol/ewol/OObject/Sprite.h | 4 +- Sources/libewol/ewol/Widget.cpp | 4 +- Sources/libewol/ewol/Widget.h | 6 +- Sources/libewol/ewol/Windows.cpp | 2 +- Sources/libewol/ewol/Windows.h | 2 +- Sources/libewol/ewol/base/gui.cpp | 10 +- Sources/libewol/ewol/base/guiAndroid.cpp | 14 +- Sources/libewol/ewol/base/guiX11.cpp | 24 +- Sources/libewol/ewol/widget/ButtonImage.cpp | 2 +- Sources/libewol/ewol/widget/CheckBox.cpp | 4 +- Sources/libewol/ewol/widget/ColorBar.cpp | 8 +- Sources/libewol/ewol/widget/ContextMenu.cpp | 4 +- Sources/libewol/ewol/widget/ContextMenu.h | 6 +- Sources/libewol/ewol/widget/Joystick.cpp | 16 +- Sources/libewol/ewol/widget/Joystick.h | 14 +- Sources/libewol/ewol/widget/Layer.cpp | 4 +- Sources/libewol/ewol/widget/Layer.h | 4 +- Sources/libewol/ewol/widget/List.h | 2 +- Sources/libewol/ewol/widget/PopUp.cpp | 6 +- Sources/libewol/ewol/widget/PopUp.h | 8 +- Sources/libewol/ewol/widget/ProgressBar.cpp | 4 +- Sources/libewol/ewol/widget/ProgressBar.h | 6 +- Sources/libewol/ewol/widget/SizerHori.cpp | 8 +- Sources/libewol/ewol/widget/SizerHori.h | 4 +- Sources/libewol/ewol/widget/SizerVert.cpp | 8 +- Sources/libewol/ewol/widget/SizerVert.h | 4 +- Sources/libewol/ewol/widget/Slider.cpp | 6 +- Sources/libewol/ewol/widget/Spacer.cpp | 2 +- Sources/libewol/ewol/widget/Spacer.h | 4 +- Sources/libewol/ewol/widget/WSlider.cpp | 4 +- Sources/libewol/ewol/widget/WSlider.h | 4 +- .../libewol/ewol/widget/WidgetScrolled.cpp | 14 +- Sources/libewol/ewol/widget/WidgetScrolled.h | 6 +- .../libewol/ewol/widgetMeta/ColorChooser.cpp | 2 +- .../libewol/ewol/widgetMeta/FileChooser.cpp | 4 +- Sources/libewol/ewol/widgetMeta/StdPopUp.cpp | 4 +- Sources/libewol/ewol/widgetMeta/StdPopUp.h | 2 +- Sources/libparsersvg/parserSVG/Base.cpp | 18 +- Sources/libparsersvg/parserSVG/Base.h | 2 +- 60 files changed, 361 insertions(+), 800 deletions(-) diff --git a/Sources/libetk/etk/Color.cpp b/Sources/libetk/etk/Color.cpp index d063ca45..276bfe06 100644 --- a/Sources/libetk/etk/Color.cpp +++ b/Sources/libetk/etk/Color.cpp @@ -485,7 +485,7 @@ color_ts etk::color::Create(uint8_t _red, uint8_t _green, uint8_t _blue, uint8_t return tmpColor; } -color_ts etk::color::Create(etkFloat_t _red, etkFloat_t _green, etkFloat_t _blue, etkFloat_t _alpha) +color_ts etk::color::Create(float _red, float _green, float _blue, float _alpha) { color_ts tmpColor; _red = etk_avg((float)0, (float)_red, (float)1); diff --git a/Sources/libetk/etk/Color.h b/Sources/libetk/etk/Color.h index 22c1ca5b..f5b052c2 100644 --- a/Sources/libetk/etk/Color.h +++ b/Sources/libetk/etk/Color.h @@ -183,7 +183,7 @@ namespace etk { color_ts Create( uint8_t _red, uint8_t _green, uint8_t _blue, uint8_t _alpha=255); - color_ts Create(etkFloat_t _red, etkFloat_t _green, etkFloat_t _blue, etkFloat_t _alpha=1.0); + color_ts Create(float _red, float _green, float _blue, float _alpha=1.0); }; }; diff --git a/Sources/libetk/etk/Types.h b/Sources/libetk/etk/Types.h index 2653ae88..f6762935 100644 --- a/Sources/libetk/etk/Types.h +++ b/Sources/libetk/etk/Types.h @@ -68,19 +68,8 @@ typedef enum { #define etk_max(elemA, elemB) ((elemA)<(elemB)) ? (elemB) : (elemA) #define etk_avg(minimim, elem, maximum) ((minimim)>(elem)) ? (minimim) : ((maximum)<(elem)) ? (maximum) : (elem) - -//#define EWOL_PECISION_FIXPOINT - #include -typedef oglt etkFloat_t; - -#if defined(EWOL_PECISION_FIXPOINT) - #define oglTypeFloat_t GL_FIXED -#else - #define oglTypeFloat_t GL_FLOAT -#endif - typedef struct { float u; float v; diff --git a/Sources/libetk/etk/TypesCoordonate.h b/Sources/libetk/etk/TypesCoordonate.h index 18fc71b2..b534e0cd 100644 --- a/Sources/libetk/etk/TypesCoordonate.h +++ b/Sources/libetk/etk/TypesCoordonate.h @@ -25,432 +25,6 @@ #ifndef __ETK_TYPES_COORDONATES_H__ #define __ETK_TYPES_COORDONATES_H__ -typedef float oglt; - -#if 0 -class oglt -{ - public: - #if defined(EWOL_PECISION_FIXPOINT32) - int32_t val; - #elseif defined(EWOL_PECISION_DOUBLE) - double val; - #else - float val; - #endif - public: - /***************************************************** - * Constructor - *****************************************************/ - oglt(void) : val(0) { }; - oglt(const oglt& obj) : val(obj.val) { }; - ~oglt(void) { }; - #if defined(EWOL_PECISION_FIXPOINT32) - oglt(const int32_t val) : val(val << 16) { }; - oglt(const float val) : val(val*65536.0) { }; - oglt(const double val) : val(val*65536.0) { }; - //operator int32_t() const { return val>>16; } - operator float() const { return (float)((float)val/(float)65536.0); } - //operator double() const { return (double)((double)val/(double)65536.0); } - #else - oglt(const int32_t val) : val(val) { }; - oglt(const float val) : val(val) { }; - oglt(const double val) : val(val) { }; - //operator int32_t() const { return (int32_t)val; } - operator float() const { return (float)val; } - //operator double() const { return (double)val; } - #endif - /***************************************************** - * = assigment - *****************************************************/ - const oglt& operator= (const oglt& obj ) { - val = obj.val; - return *this; - } - const oglt& operator= (const int32_t value) { - #if defined(EWOL_PECISION_FIXPOINT32) - val = ((int32_t)(value<<16); - #else - val = value; - #endif - return *this; - } - const oglt& operator= (const float value) { - #if defined(EWOL_PECISION_FIXPOINT32) - val = ((int32_t)(value*65636.0); - #else - val = value; - #endif - return *this; - } - /***************************************************** - * == operator - *****************************************************/ - const bool operator== (const oglt& obj) const { - return (obj.val == val) ? true : false; - } - const bool operator== (const int32_t value) const { - #if defined(EWOL_PECISION_FIXPOINT32) - return ((int32_t)(value<<16) == val) ? false : true; - #else - return (value == val) ? false : true; - #endif - } - const bool operator== (const float value) const { - #if defined(EWOL_PECISION_FIXPOINT32) - return ((int32_t)(value*65636.0) == val) ? false : true; - #else - return (value == val) ? false : true; - #endif - } - /***************************************************** - * != operator - *****************************************************/ - const bool operator!= (const oglt& obj) const { - return (obj.val != val) ? false : true; - } - const bool operator!= (const int32_t value) const { - #if defined(EWOL_PECISION_FIXPOINT32) - return ((int32_t)(value<<16) != val) ? false : true; - #else - return (value != val) ? false : true; - #endif - } - const bool operator!= (const float value) const { - #if defined(EWOL_PECISION_FIXPOINT32) - return ((int32_t)(value*65636.0) != val) ? false : true; - #else - return (value != val) ? false : true; - #endif - } - /***************************************************** - * <= operator - *****************************************************/ - const bool operator<= (const oglt& obj) const { - return (obj.val <= val) ? false : true; - } - const bool operator<= (const int32_t value) const { - #if defined(EWOL_PECISION_FIXPOINT32) - return ((int32_t)(value<<16) <= val) ? false : true; - #else - return (value <= val) ? false : true; - #endif - } - const bool operator<= (const float value) const { - #if defined(EWOL_PECISION_FIXPOINT32) - return ((int32_t)(value*65636.0) <= val) ? false : true; - #else - return (value <= val) ? false : true; - #endif - } - /***************************************************** - * < operator - *****************************************************/ - const bool operator< (const oglt& obj) const { - return (obj.val < val) ? false : true; - } - const bool operator< (const int32_t value) const { - #if defined(EWOL_PECISION_FIXPOINT32) - return ((int32_t)(value<<16) < val) ? false : true; - #else - return (value < val) ? false : true; - #endif - } - const bool operator< (const float value) const { - #if defined(EWOL_PECISION_FIXPOINT32) - return ((int32_t)(value*65636.0) < val) ? false : true; - #else - return (value < val) ? false : true; - #endif - } - /***************************************************** - * >= operator - *****************************************************/ - const bool operator>= (const oglt& obj) const { - return (obj.val >= val) ? false : true; - } - const bool operator>= (const int32_t value) const { - #if defined(EWOL_PECISION_FIXPOINT32) - return ((int32_t)(value<<16) >= val) ? false : true; - #else - return (value >= val) ? false : true; - #endif - } - const bool operator>= (const float value) const { - #if defined(EWOL_PECISION_FIXPOINT32) - return ((int32_t)(value*65636.0) >= val) ? false : true; - #else - return (value >= val) ? false : true; - #endif - } - /***************************************************** - * > operator - *****************************************************/ - const bool operator> (const oglt& obj) const { - return (obj.val > val) ? false : true; - } - const bool operator> (const int32_t value) const { - #if defined(EWOL_PECISION_FIXPOINT32) - return ((int32_t)(value<<16) > val) ? false : true; - #else - return (value > val) ? false : true; - #endif - } - const bool operator> (const float value) const { - #if defined(EWOL_PECISION_FIXPOINT32) - return ((int32_t)(value*65636.0) > val) ? false : true; - #else - return (value > val) ? false : true; - #endif - } - /***************************************************** - * += operator - *****************************************************/ - const oglt& operator+= (const oglt& obj) { - val += obj.val; - return *this; - } - const oglt& operator+= (const int32_t value) { - #if defined(EWOL_PECISION_FIXPOINT32) - val += (value<<16); - #else - val += value; - #endif - return *this; - } - const oglt& operator+= (const float value) { - #if defined(EWOL_PECISION_FIXPOINT32) - val += (int32_t)(value*65636.0); - #else - val += value; - #endif - return *this; - } - /***************************************************** - * + operator - *****************************************************/ - const oglt& operator+ (const oglt& obj) { - val += obj.val; - return *this; - } - const oglt& operator+ (const int32_t value) { - #if defined(EWOL_PECISION_FIXPOINT32) - val += (value<<16); - #else - val += value; - #endif - return *this; - } - const oglt operator+ (const float value) { - #if defined(EWOL_PECISION_FIXPOINT32) - val += (int32_t)(value*65636.0); - #else - val += value; - #endif - return *this; - } - /* - oglt operator+ (const oglt& obj, const oglt& obj2) { - oglt tmpVal = obj; - tmpVal += obj2; - return tmpVal; - } - */ - /***************************************************** - * -= operator - *****************************************************/ - const oglt& operator-= (const oglt& obj) { - val -= obj.val; - return *this; - } - const oglt& operator-= (const int32_t value) { - #if defined(EWOL_PECISION_FIXPOINT32) - val -= (value<<16); - #else - val -= value; - #endif - return *this; - } - const oglt& operator-= (const float value) { - #if defined(EWOL_PECISION_FIXPOINT32) - val -= (int32_t)(value*65636.0); - #else - val -= value; - #endif - return *this; - } - /***************************************************** - * - operator - *****************************************************/ - const oglt& operator- (const oglt& obj) { - val -= obj.val; - return *this; - } - const oglt& operator- (const int32_t value) { - #if defined(EWOL_PECISION_FIXPOINT32) - val -= (value<<16); - #else - val -= value; - #endif - return *this; - } - const oglt& operator- (const float value) { - #if defined(EWOL_PECISION_FIXPOINT32) - val -= (int32_t)(value*65636.0); - #else - val -= value; - #endif - return *this; - } - /***************************************************** - * /= operator - *****************************************************/ - const oglt& operator/= (const oglt& obj) { - #if defined(EWOL_PECISION_FIXPOINT32) - val = ((int64_t)val<<16) / obj.val; - #else - val /= obj.val; - #endif - return *this; - } - const oglt& operator/= (const int32_t value) { - #if defined(EWOL_PECISION_FIXPOINT32) - val = val / value; - #else - val /= (float)value; - #endif - return *this; - } - const oglt& operator/= (const float value) { - #if defined(EWOL_PECISION_FIXPOINT32) - val = ((int64_t)val<<16) / (int32_t)(value); - #else - val /= value; - #endif - return *this; - } - /***************************************************** - * / operator - *****************************************************/ - oglt operator/ (const oglt& obj) { - #if defined(EWOL_PECISION_FIXPOINT32) - val = ((int64_t)val<<16) / obj.val; - #else - val /= obj.val; - #endif - return *this; - } - oglt operator/ (const int32_t value) { - #if defined(EWOL_PECISION_FIXPOINT32) - val = val / value; - #else - val /= (float)value; - #endif - return *this; - } - oglt operator/ (const float value) { - #if defined(EWOL_PECISION_FIXPOINT32) - val = ((int64_t)val<<16) / (int32_t)(value); - #else - val /= value; - #endif - return *this; - } - /***************************************************** - * *= operator - *****************************************************/ - const oglt& operator*= (const oglt& obj) { - #if defined(EWOL_PECISION_FIXPOINT32) - int64_t tmpVal = (int64_t)val * (int64_t)obj.val; - val = tmpVal >> 16; - #else - val *= obj.val; - #endif - return *this; - } - const oglt& operator*= (const int32_t value) { - #if defined(EWOL_PECISION_FIXPOINT32) - val = (int32_t)((int64_t)val * (int64_t)value); - #else - val *= (float)value; - #endif - return *this; - } - const oglt& operator*= (const float value) { - #if defined(EWOL_PECISION_FIXPOINT32) - int64_t tmpVal = (int64_t)val * (int64_t)(value*65636.0); - val = tmpVal >> 16; - #else - val *= value; - #endif - return *this; - } - /***************************************************** - * * operator - *****************************************************/ - oglt operator* (const oglt& obj) { - #if defined(EWOL_PECISION_FIXPOINT32) - int64_t tmpVal = (int64_t)val * (int64_t)obj.val; - val = tmpVal >> 16; - #else - val *= obj.val; - #endif - return *this; - } - oglt operator* (const int32_t value) { - #if defined(EWOL_PECISION_FIXPOINT32) - val = (int32_t)((int64_t)val * (int64_t)value); - #else - val *= (float)value; - #endif - return *this; - } - oglt operator* (const float value) { - #if defined(EWOL_PECISION_FIXPOINT32) - int64_t tmpVal = (int64_t)val * (int64_t)(value*65636.0); - val = tmpVal >> 16; - #else - val *= value; - #endif - return *this; - } - /***************************************************** - * ++ operator - *****************************************************/ - oglt& operator++() // prefix - { - ++val; - return *this; - } - oglt operator++(int unused) // postfix - { - oglt result = *this; - ++(*this); - return result; - } - /***************************************************** - * -- operator - *****************************************************/ - oglt& operator--() // prefix - { - --val; - return *this; - } - oglt operator--(int unused) // postfix - { - oglt result = *this; - --(*this); - return result; - } -}; -/* -inline explicit operator*(const float val, const oglt& obj) { - float val2 = val; - val2 *= (float)obj.val; - return val2; -} -*/ -#endif template class Vector2D { @@ -468,7 +42,6 @@ template class Vector2D Vector2D(const Vector2D& obj) : x((T)obj.x), y((T)obj.y) { }; Vector2D(const Vector2D& obj) : x((T)obj.x), y((T)obj.y) { }; Vector2D(const Vector2D& obj) : x((T)obj.x), y((T)obj.y) { }; - // Vector2D(const Vector2D& obj) : x((T)obj.x), y((T)obj.y) { }; ~Vector2D(void) { }; /***************************************************** * = assigment @@ -613,7 +186,6 @@ template class Vector3D Vector3D(const Vector3D& obj) : x((T)obj.x), y((T)obj.y), z((T)obj.z) { }; Vector3D(const Vector3D& obj) : x((T)obj.x), y((T)obj.y), z((T)obj.z) { }; Vector3D(const Vector3D& obj) : x((T)obj.x), y((T)obj.y), z((T)obj.z) { }; - // Vector3D(const Vector3D& obj) : x((T)obj.x), y((T)obj.y), z((T)obj.z) { }; ~Vector3D(void) { }; /***************************************************** * = assigment diff --git a/Sources/libewol/ewol/Audio/audio.cpp b/Sources/libewol/ewol/Audio/audio.cpp index c53996dd..e992843c 100644 --- a/Sources/libewol/ewol/Audio/audio.cpp +++ b/Sources/libewol/ewol/Audio/audio.cpp @@ -187,7 +187,7 @@ void ewol::audio::effects::Rm(int32_t effectId) } -void ewol::audio::effects::Play(int32_t effectId, etkFloat_t xxx, etkFloat_t yyy) +void ewol::audio::effects::Play(int32_t effectId, float xxx, float yyy) { } diff --git a/Sources/libewol/ewol/Audio/audio.h b/Sources/libewol/ewol/Audio/audio.h index b9b688d1..3db530cd 100644 --- a/Sources/libewol/ewol/Audio/audio.h +++ b/Sources/libewol/ewol/Audio/audio.h @@ -59,7 +59,7 @@ namespace ewol { namespace effects { int32_t Add(etk::UString file); void Rm(int32_t effectId); - void Play(int32_t effectId, etkFloat_t xxx, etkFloat_t yyy); + void Play(int32_t effectId, float xxx, float yyy); // in db float VolumeGet(void); diff --git a/Sources/libewol/ewol/FontFreeType.cpp b/Sources/libewol/ewol/FontFreeType.cpp index 2de43555..ee4a8cdd 100644 --- a/Sources/libewol/ewol/FontFreeType.cpp +++ b/Sources/libewol/ewol/FontFreeType.cpp @@ -343,10 +343,10 @@ class FTFontInternal listElement[iii].size.x = tmpWidth; listElement[iii].size.y = tmpHeight; listElement[iii].advance = slot->metrics.horiAdvance>>6; - listElement[iii].posStart.u = (etkFloat_t)(tmpRowStartPos) / (etkFloat_t)textureWidth; - listElement[iii].posStart.v = (etkFloat_t)(tmpLineStartPos) / (etkFloat_t)textureHeight; - listElement[iii].posStop.u = (etkFloat_t)(tmpRowStartPos + tmpWidth) / (etkFloat_t)textureWidth; - listElement[iii].posStop.v = (etkFloat_t)(tmpLineStartPos + tmpHeight) / (etkFloat_t)textureHeight; + listElement[iii].posStart.u = (float)(tmpRowStartPos) / (float)textureWidth; + listElement[iii].posStart.v = (float)(tmpLineStartPos) / (float)textureHeight; + listElement[iii].posStop.u = (float)(tmpRowStartPos + tmpWidth) / (float)textureWidth; + listElement[iii].posStop.v = (float)(tmpLineStartPos + tmpHeight) / (float)textureHeight; // update the maximum of the line hight : if (CurrentLineHigh textPos, - clipping_ts & drawClipping, - const etk::UString& unicodeString, - int32_t & fontTextureId, - etk::VectorType> & coord, - etk::VectorType & coordTex) +int32_t ewol::DrawText(int32_t fontID, + Vector2D textPos, + clipping_ts & drawClipping, + const etk::UString& unicodeString, + int32_t & fontTextureId, + etk::VectorType > & coord, + etk::VectorType & coordTex) { if(fontID>=m_listLoadedFont.Size() || fontID < 0) { EWOL_WARNING("try to display text with an fontID that does not existed " << fontID); @@ -588,7 +588,7 @@ int32_t ewol::DrawText(int32_t fontID, fontTextureId = m_listLoadedFont[fontID]->GetOglId(); int32_t fontSize = m_listLoadedFont[fontID]->GetSize(); - etkFloat_t posDrawX = textPos.x; + float posDrawX = textPos.x; for(int32_t iii=0; iii drawClipping.x + drawClipping.w) { // clip display - etkFloat_t drawSize = dxB - (drawClipping.x + drawClipping.w); + float drawSize = dxB - (drawClipping.x + drawClipping.w); // Update element start display dxB = drawClipping.x + drawClipping.w; - etkFloat_t addElement = TexSizeX * drawSize / listOfElement[charIndex].size.x; + float addElement = TexSizeX * drawSize / listOfElement[charIndex].size.x; // update texture start X Pos tuB -= addElement; } - etkFloat_t TexSizeY = tvD - tvC; + float TexSizeY = tvD - tvC; if (dyC < drawClipping.y) { // clip display - etkFloat_t drawSize = drawClipping.y - dyC; + float drawSize = drawClipping.y - dyC; // Update element start display dyC = drawClipping.y; - etkFloat_t addElement = TexSizeY * drawSize / listOfElement[charIndex].size.y; + float addElement = TexSizeY * drawSize / listOfElement[charIndex].size.y; // update texture start X Pos tvC += addElement; } if (dyD > drawClipping.y + drawClipping.h) { // clip display - etkFloat_t drawSize = dyD - (drawClipping.y + drawClipping.h); + float drawSize = dyD - (drawClipping.y + drawClipping.h); // Update element start display dyD = drawClipping.y + drawClipping.h; - etkFloat_t addElement = TexSizeX * drawSize / listOfElement[charIndex].size.y; + float addElement = TexSizeX * drawSize / listOfElement[charIndex].size.y; // update texture start X Pos tvD -= addElement; } @@ -752,13 +752,13 @@ int32_t ewol::DrawText(int32_t fontID, } // TODO : Simplify this ... -int32_t ewol::DrawText(int32_t fontID, - Vector2D textPos, - clipping_ts & drawClipping, - const uniChar_t unicodeChar, - int32_t & fontTextureId, - etk::VectorType> & coord, - etk::VectorType & coordTex) +int32_t ewol::DrawText(int32_t fontID, + Vector2D textPos, + clipping_ts & drawClipping, + const uniChar_t unicodeChar, + int32_t & fontTextureId, + etk::VectorType > & coord, + etk::VectorType & coordTex) { if(fontID>=m_listLoadedFont.Size() || fontID < 0) { EWOL_WARNING("try to display text with an fontID that does not existed " << fontID); @@ -769,7 +769,7 @@ int32_t ewol::DrawText(int32_t fontID, fontTextureId = m_listLoadedFont[fontID]->GetOglId(); int32_t fontSize = m_listLoadedFont[fontID]->GetSize(); - etkFloat_t posDrawX = textPos.x; + float posDrawX = textPos.x; int32_t charIndex; if (unicodeChar < 0x20) { @@ -794,15 +794,15 @@ int32_t ewol::DrawText(int32_t fontID, * | | * yD *------* */ - etkFloat_t dxA = posDrawX + listOfElement[charIndex].bearing.x; - etkFloat_t dxB = posDrawX + listOfElement[charIndex].bearing.x + listOfElement[charIndex].size.x; - etkFloat_t dyC = textPos.y + fontSize - listOfElement[charIndex].bearing.y; - etkFloat_t dyD = textPos.y + fontSize - listOfElement[charIndex].bearing.y + listOfElement[charIndex].size.y; + float dxA = posDrawX + listOfElement[charIndex].bearing.x; + float dxB = posDrawX + listOfElement[charIndex].bearing.x + listOfElement[charIndex].size.x; + float dyC = textPos.y + fontSize - listOfElement[charIndex].bearing.y; + float dyD = textPos.y + fontSize - listOfElement[charIndex].bearing.y + listOfElement[charIndex].size.y; - etkFloat_t tuA = listOfElement[charIndex].posStart.u; - etkFloat_t tuB = listOfElement[charIndex].posStop.u; - etkFloat_t tvC = listOfElement[charIndex].posStart.v; - etkFloat_t tvD = listOfElement[charIndex].posStop.v; + float tuA = listOfElement[charIndex].posStart.u; + float tuB = listOfElement[charIndex].posStop.u; + float tvC = listOfElement[charIndex].posStart.v; + float tvD = listOfElement[charIndex].posStop.v; // Clipping and drawing area @@ -813,22 +813,22 @@ int32_t ewol::DrawText(int32_t fontID, // Nothing to diplay ... } else { // generata positions... - etkFloat_t TexSizeX = tuB - tuA; + float TexSizeX = tuB - tuA; if (dxA < drawClipping.x) { // clip display - etkFloat_t drawSize = drawClipping.x - dxA; + float drawSize = drawClipping.x - dxA; // Update element start display dxA = drawClipping.x; - etkFloat_t addElement = TexSizeX * drawSize / listOfElement[charIndex].size.x; + float addElement = TexSizeX * drawSize / listOfElement[charIndex].size.x; // update texture start X Pos tuA += addElement; } if (dxB > drawClipping.x + drawClipping.w) { // clip display - etkFloat_t drawSize = dxB - (drawClipping.x + drawClipping.w); + float drawSize = dxB - (drawClipping.x + drawClipping.w); // Update element start display dxB = drawClipping.x + drawClipping.w; - etkFloat_t addElement = TexSizeX * drawSize / listOfElement[charIndex].size.x; + float addElement = TexSizeX * drawSize / listOfElement[charIndex].size.x; // update texture start X Pos tuB -= addElement; } @@ -906,12 +906,12 @@ int32_t ewol::DrawText(int32_t fontID, } -int32_t ewol::DrawText(int32_t fontID, - Vector2D textPos, - const etk::UString& unicodeString, - int32_t & fontTextureId, - etk::VectorType> & coord, - etk::VectorType & coordTex) +int32_t ewol::DrawText(int32_t fontID, + Vector2D textPos, + const etk::UString& unicodeString, + int32_t & fontTextureId, + etk::VectorType > & coord, + etk::VectorType & coordTex) { if(fontID>=m_listLoadedFont.Size() || fontID < 0) { EWOL_WARNING("try to display text with an fontID that does not existed " << fontID); @@ -922,7 +922,7 @@ int32_t ewol::DrawText(int32_t fontID, fontTextureId = m_listLoadedFont[fontID]->GetOglId(); int32_t fontSize = m_listLoadedFont[fontID]->GetSize(); - etkFloat_t posDrawX = textPos.x; + float posDrawX = textPos.x; for(int32_t iii=0; iii textPos, - const uniChar_t unicodeChar, - int32_t & fontTextureId, - etk::VectorType> & coord, - etk::VectorType & coordTex) + const uniChar_t unicodeChar, + int32_t & fontTextureId, + etk::VectorType > & coord, + etk::VectorType & coordTex) { if(fontID>=m_listLoadedFont.Size() || fontID < 0) { EWOL_WARNING("try to display text with an fontID that does not existed " << fontID); @@ -1056,7 +1056,7 @@ int32_t ewol::DrawText(int32_t fontID, fontTextureId = m_listLoadedFont[fontID]->GetOglId(); int32_t fontSize = m_listLoadedFont[fontID]->GetSize(); - etkFloat_t posDrawX = textPos.x; + float posDrawX = textPos.x; int32_t charIndex; if (unicodeChar < 0x20) { @@ -1081,15 +1081,15 @@ int32_t ewol::DrawText(int32_t fontID, * | | * yD *------* */ - etkFloat_t dxA = posDrawX + listOfElement[charIndex].bearing.x; - etkFloat_t dxB = posDrawX + listOfElement[charIndex].bearing.x + listOfElement[charIndex].size.x; - etkFloat_t dyC = textPos.y + fontSize - listOfElement[charIndex].bearing.y; - etkFloat_t dyD = textPos.y + fontSize - listOfElement[charIndex].bearing.y + listOfElement[charIndex].size.y; + float dxA = posDrawX + listOfElement[charIndex].bearing.x; + float dxB = posDrawX + listOfElement[charIndex].bearing.x + listOfElement[charIndex].size.x; + float dyC = textPos.y + fontSize - listOfElement[charIndex].bearing.y; + float dyD = textPos.y + fontSize - listOfElement[charIndex].bearing.y + listOfElement[charIndex].size.y; - etkFloat_t tuA = listOfElement[charIndex].posStart.u; - etkFloat_t tuB = listOfElement[charIndex].posStop.u; - etkFloat_t tvC = listOfElement[charIndex].posStart.v; - etkFloat_t tvD = listOfElement[charIndex].posStop.v; + float tuA = listOfElement[charIndex].posStart.u; + float tuB = listOfElement[charIndex].posStop.u; + float tvC = listOfElement[charIndex].posStart.v; + float tvD = listOfElement[charIndex].posStop.v; if( dxB <= dxA || dyD <= dyC) { @@ -1177,7 +1177,7 @@ int32_t ewol::GetWidth(int32_t fontID, const etk::UString& unicodeString) } etk::VectorType & listOfElement = m_listLoadedFont[fontID]->GetRefOnElement(); - etkFloat_t posDrawX = 0.0; + float posDrawX = 0.0; for(int32_t iii=0; iii listOfEleme } -etkFloat_t quadDist(Vector2D pos1, Vector2D pos2) +float quadDist(Vector2D pos1, Vector2D pos2) { - etkFloat_t tmpVal1 = pos1.x - pos2.x; - etkFloat_t tmpVal2 = pos1.y - pos2.y; + float tmpVal1 = pos1.x - pos2.x; + float tmpVal2 = pos1.y - pos2.y; return tmpVal1*tmpVal1 + tmpVal2*tmpVal2; } @@ -105,14 +105,14 @@ void ewol::GameElement::GetElementProperty(gameElementGenericProperty_ts &elemen } -bool ewol::GameElement::HaveImpact(int32_t group, int32_t type, Vector2D position, etkFloat_t size) +bool ewol::GameElement::HaveImpact(int32_t group, int32_t type, Vector2D position, float size) { // check if it was in the same group if (group == m_group) { return false; } - etkFloat_t quadDistance = quadDist(m_position, position); - etkFloat_t radiusElement = m_size * m_size; + float quadDistance = quadDist(m_position, position); + float radiusElement = m_size * m_size; if (radiusElement < quadDistance) { //distance is greten than expected return false; diff --git a/Sources/libewol/ewol/Game/GameElement.h b/Sources/libewol/ewol/Game/GameElement.h index 5fc3dd0b..b1f54ba0 100644 --- a/Sources/libewol/ewol/Game/GameElement.h +++ b/Sources/libewol/ewol/Game/GameElement.h @@ -48,11 +48,11 @@ namespace ewol { bool m_visible; Vector2D m_position; Vector2D m_speed; - etkFloat_t m_size; - etkFloat_t m_angle; - etkFloat_t m_gravity; + float m_size; + float m_angle; + float m_gravity; bool m_canBeCibled; - etkFloat_t m_life; + float m_life; public: /** * @brief Constructor : here are requested all the needed sprite and effect that can be used in the game @@ -77,16 +77,16 @@ namespace ewol { void SetVisible(bool state) { m_visible = state; }; Vector2D PositionGet(void) { return m_position; }; void PositionSet(Vector2D state) { m_position = state; }; - void PositionSet(etkFloat_t xxx, etkFloat_t yyy) { m_position.x = xxx; m_position.y = yyy; }; + void PositionSet(float xxx, float yyy) { m_position.x = xxx; m_position.y = yyy; }; Vector2D SpeedGet(void) { return m_speed; }; void SpeedSet(Vector2D state) { m_speed = state; }; - void SpeedSet(etkFloat_t xxx, etkFloat_t yyy) { m_speed.x = xxx; m_speed.y = yyy; }; - etkFloat_t SizeGet(void) { return m_size; }; - void SizeSet(etkFloat_t state) { m_size = state; }; - etkFloat_t AngleGet(void) { return m_angle; }; - void AngleSet(etkFloat_t state) { m_angle = state; }; - etkFloat_t GravityGet(void) { return m_gravity; }; - void GravitySet(etkFloat_t state) { m_gravity = state; }; + void SpeedSet(float xxx, float yyy) { m_speed.x = xxx; m_speed.y = yyy; }; + float SizeGet(void) { return m_size; }; + void SizeSet(float state) { m_size = state; }; + float AngleGet(void) { return m_angle; }; + void AngleSet(float state) { m_angle = state; }; + float GravityGet(void) { return m_gravity; }; + void GravitySet(float state) { m_gravity = state; }; int32_t PowerGet(void) { return m_power; }; void PowerSet(int32_t state) { m_power = state; }; bool CanBeCibledGet(void) { return m_canBeCibled; }; @@ -122,8 +122,8 @@ namespace ewol { * @return --- */ virtual void RemoveElement(int32_t idOfElement) { }; - virtual bool HaveImpact(int32_t group, int32_t type, Vector2D position, etkFloat_t size); - virtual bool Explosion(int32_t group, int32_t type, Vector2D position, etkFloat_t pxAtenuation, etkFloat_t power) { return false; } ; + virtual bool HaveImpact(int32_t group, int32_t type, Vector2D position, float size); + virtual bool Explosion(int32_t group, int32_t type, Vector2D position, float pxAtenuation, float power) { return false; } ; /** * @brief Requuest the draw of the current element, it will be done on the current Sprite list * @param[in,out] listOfElement Reference on the list of sprite that we need to find if it exist or added a new one @@ -140,6 +140,6 @@ namespace ewol { #include -etkFloat_t quadDist(Vector2D pos1, Vector2D pos2); +float quadDist(Vector2D pos1, Vector2D pos2); #endif diff --git a/Sources/libewol/ewol/Game/GameElementLua.cpp b/Sources/libewol/ewol/Game/GameElementLua.cpp index c0731af4..40d4c801 100644 --- a/Sources/libewol/ewol/Game/GameElementLua.cpp +++ b/Sources/libewol/ewol/Game/GameElementLua.cpp @@ -106,28 +106,28 @@ template class LuaValue /* -template <> int lua_Set(lua_State* L) +template <> int lua_Set(lua_State* L) { if (NULL==tmpObj) { EWOL_ERROR("NULL obj..."); lua_pushnumber(L, 0 ); return 1; } - etkFloat_t value = luaL_checknumber(L, 1); + float value = luaL_checknumber(L, 1); tmpObj->AngleSet(value); // return number of parameters return 1; } -template <> int lua_Get(lua_State* L) +template <> int lua_Get(lua_State* L) { if (NULL==tmpObj) { EWOL_ERROR("NULL obj..."); lua_pushnumber(L, 0 ); return 1; } - etkFloat_t value = tmpObj->AngleGet(); + float value = tmpObj->AngleGet(); lua_pushnumber(L, value ); // return number of parameters return 1; @@ -256,7 +256,7 @@ LUAMOD_API int lua_GetAngle(lua_State *L) lua_pushnumber(L, 0 ); return 1; } - etkFloat_t value = tmpObj->AngleGet(); + float value = tmpObj->AngleGet(); lua_pushnumber(L, value ); // return number of parameters return 1; @@ -269,7 +269,7 @@ LUAMOD_API int lua_SetAngle(lua_State *L) lua_pushnumber(L, 0 ); return 1; } - etkFloat_t value = luaL_checknumber(L, 1); + float value = luaL_checknumber(L, 1); tmpObj->AngleSet(value); // return number of parameters return 1; @@ -283,7 +283,7 @@ LUAMOD_API int lua_GetSize(lua_State *L) lua_pushnumber(L, 0 ); return 1; } - etkFloat_t value = tmpObj->SizeGet(); + float value = tmpObj->SizeGet(); lua_pushnumber(L, value ); // return number of parameters return 1; @@ -296,7 +296,7 @@ LUAMOD_API int lua_SetSize(lua_State *L) lua_pushnumber(L, 0 ); return 0; } - etkFloat_t value = luaL_checknumber(L, 1); + float value = luaL_checknumber(L, 1); tmpObj->SizeSet(value); // return number of parameters return 0; @@ -310,7 +310,7 @@ LUAMOD_API int lua_GetCanBeCibled(lua_State *L) lua_pushboolean(L, false ); return 1; } - etkFloat_t value = tmpObj->CanBeCibledGet(); + float value = tmpObj->CanBeCibledGet(); lua_pushboolean(L, value ); // return number of parameters return 1; @@ -827,7 +827,7 @@ void ewol::GameElementLua::Draw(etk::VectorType & listOfSprite, e } -bool ewol::GameElementLua::HaveImpact(int32_t group, int32_t type, Vector2D position, etkFloat_t size) +bool ewol::GameElementLua::HaveImpact(int32_t group, int32_t type, Vector2D position, float size) { // todo set a flag that permit lua to direct control of this ... if (false == ewol::GameElement::HaveImpact(group, type, position, size) ) { @@ -848,7 +848,7 @@ bool ewol::GameElementLua::HaveImpact(int32_t group, int32_t type, Vector2D position, etkFloat_t pxAtenuation, etkFloat_t power) +bool ewol::GameElementLua::Explosion(int32_t group, int32_t type, Vector2D position, float pxAtenuation, float power) { tmpObj = this; bool retVal = false; @@ -887,7 +887,7 @@ bool ewol::GameElementLua::Explosion(int32_t group, int32_t type, Vector2D & listOfSprite, etk::VectorType & listOfEffects); - virtual bool HaveImpact(int32_t group, int32_t type, Vector2D position, etkFloat_t size); - virtual bool Explosion(int32_t group, int32_t type, Vector2D position, etkFloat_t pxAtenuation, etkFloat_t power); + virtual bool HaveImpact(int32_t group, int32_t type, Vector2D position, float size); + virtual bool Explosion(int32_t group, int32_t type, Vector2D position, float pxAtenuation, float power); virtual void Message(etk::UString control, etk::UString message); }; void RegisterLuaElementInFolder(ewol::SceneElement & sceneElement, etk::UString folder); diff --git a/Sources/libewol/ewol/Game/SceneElement.cpp b/Sources/libewol/ewol/Game/SceneElement.cpp index 82d67536..2d365ce6 100644 --- a/Sources/libewol/ewol/Game/SceneElement.cpp +++ b/Sources/libewol/ewol/Game/SceneElement.cpp @@ -235,7 +235,7 @@ ewol::GameElement* ewol::SceneElement::GetElement(uint32_t idElement) uint32_t ewol::SceneElement::GetNearestEnemy(Vector2D position, int32_t groupId) { uint32_t result = 0; - etkFloat_t lastQuadDistance = 9999999999999999.0; + float lastQuadDistance = 9999999999999999.0; int32_t jjj=0; if (groupId <0 || groupId >= MAX_GROUP_NUMBER) { EWOL_ERROR("incorect group number : " << groupId); @@ -246,7 +246,7 @@ uint32_t ewol::SceneElement::GetNearestEnemy(Vector2D position, int32_t g if (NULL != listAnimatedElements[groupEnemy[groupId][jjj]][iii]) { if (true == listAnimatedElements[groupEnemy[groupId][jjj]][iii]->CanBeCibledGet()) { Vector2D tmpPos = listAnimatedElements[groupEnemy[groupId][jjj]][iii]->PositionGet(); - etkFloat_t distance = quadDist(position, tmpPos); + float distance = quadDist(position, tmpPos); if (distance <= lastQuadDistance) { lastQuadDistance = distance; result = createUniqueId(listAnimatedElements[groupEnemy[groupId][jjj]][iii]->GetUniqueId(), iii); @@ -260,7 +260,7 @@ uint32_t ewol::SceneElement::GetNearestEnemy(Vector2D position, int32_t g } -bool ewol::SceneElement::HaveImpact(int32_t group, int32_t type, Vector2D position, etkFloat_t size) +bool ewol::SceneElement::HaveImpact(int32_t group, int32_t type, Vector2D position, float size) { for (int32_t jjj=0; jjj return false; } -void ewol::SceneElement::Explosion(int32_t group, int32_t type, Vector2D position, etkFloat_t pxAtenuation, etkFloat_t power) +void ewol::SceneElement::Explosion(int32_t group, int32_t type, Vector2D position, float pxAtenuation, float power) { for (int32_t jjj=0; jjj uint32_t ewol::SceneElement::GetElementAtPos(Vector2D position, int32_t maxDistanceDetection) { uint32_t result = 0; - etkFloat_t lastQuadDistance = 9999999999999999.0; + float lastQuadDistance = 9999999999999999.0; for (int32_t jjj=0; jjj tmpPos = listAnimatedElements[jjj][iii]->PositionGet(); - etkFloat_t distance = quadDist(position, tmpPos); + float distance = quadDist(position, tmpPos); if (distance <= lastQuadDistance) { lastQuadDistance = distance; result = createUniqueId(listAnimatedElements[jjj][iii]->GetUniqueId(), iii); @@ -322,7 +322,7 @@ void ewol::SceneElement::SetEventExternButton(uint32_t id, int32_t btId, int32_t EWOL_TODO("but when ..."); } -void ewol::SceneElement::SetEventExternJoystick(uint32_t id, int32_t joyId, etkFloat_t angle, etkFloat_t distance, int32_t state) +void ewol::SceneElement::SetEventExternJoystick(uint32_t id, int32_t joyId, float angle, float distance, int32_t state) { EWOL_TODO("but when ..."); } diff --git a/Sources/libewol/ewol/Game/SceneElement.h b/Sources/libewol/ewol/Game/SceneElement.h index 78113efd..011bab0d 100644 --- a/Sources/libewol/ewol/Game/SceneElement.h +++ b/Sources/libewol/ewol/Game/SceneElement.h @@ -40,7 +40,7 @@ namespace ewol { Vector2D position; //!< current position Vector2D speed; //!< current speed Vector2D size; //!< curent size of the element - etkFloat_t angle; //!< element angle + float angle; //!< element angle } gameElementGenericProperty_ts; typedef ewol::GameElement* (creatorElement_tf)(SceneElement & sceneElement, etk::UString& tmpName, etk::UString& userString); @@ -77,12 +77,12 @@ namespace ewol { uint32_t AddElementNamed(int32_t group, etk::UString &elementName); ewol::GameElement* GetElement(uint32_t idElement); uint32_t GetNearestEnemy(Vector2D position, int32_t groupId); - bool HaveImpact(int32_t group, int32_t type, Vector2D position, etkFloat_t size); - void Explosion(int32_t group, int32_t type, Vector2D position, etkFloat_t pxAtenuation, etkFloat_t power); + bool HaveImpact(int32_t group, int32_t type, Vector2D position, float size); + void Explosion(int32_t group, int32_t type, Vector2D position, float pxAtenuation, float power); uint32_t GetElementAtPos(Vector2D position, int32_t maxDistanceDetection); void SetEventInput(uint32_t id, Vector2D position); void SetEventExternButton(uint32_t id, int32_t btId, int32_t state); - void SetEventExternJoystick(uint32_t id, int32_t joyId, etkFloat_t angle, etkFloat_t distance, int32_t state); + void SetEventExternJoystick(uint32_t id, int32_t joyId, float angle, float distance, int32_t state); }; }; diff --git a/Sources/libewol/ewol/OObject/2DColored.cpp b/Sources/libewol/ewol/OObject/2DColored.cpp index a74de6be..e8532241 100644 --- a/Sources/libewol/ewol/OObject/2DColored.cpp +++ b/Sources/libewol/ewol/OObject/2DColored.cpp @@ -58,7 +58,7 @@ void ewol::OObject2DColored::Draw(void) glScalef(m_scaling.x, m_scaling.y, 1.0); // Set the vertex pointer to our vertex data - glVertexPointer(2, oglTypeFloat_t, 0, &m_coord[0] ); + glVertexPointer(2, GL_FLOAT, 0, &m_coord[0] ); //glColorPointer(4, oglTypeFloat_t, 0, &m_coordColor[0] ); glColorPointer(4, GL_UNSIGNED_BYTE, 0, &m_coordColor[0] ); // Render : draw all of the triangles at once @@ -80,7 +80,7 @@ void ewol::OObject2DColored::Clear(void) } -void generatePolyGone(etk::VectorType > & input, etk::VectorType > & output ) +void generatePolyGone(etk::VectorType > & input, etk::VectorType > & output ) { if (input.Size()<3) { return; @@ -94,7 +94,7 @@ void generatePolyGone(etk::VectorType > & input, etk::VectorType " << output.Size() ); } -void SutherlandHodgman(etk::VectorType > & input, etk::VectorType > & output, etkFloat_t sx, etkFloat_t sy, etkFloat_t ex, etkFloat_t ey) +void SutherlandHodgman(etk::VectorType > & input, etk::VectorType > & output, float sx, float sy, float ex, float ey) { // with Sutherland-Hodgman-Algorithm if (input.Size() <0) { @@ -102,8 +102,8 @@ void SutherlandHodgman(etk::VectorType > & input, etk::VectorType< } //int32_t sizeInit=input.Size(); // last element : - Coord2D destPoint; - Coord2D lastElement = input[input.Size()-1]; + Vector2D destPoint; + Vector2D lastElement = input[input.Size()-1]; bool inside = true; if (lastElement.x < sx) { inside = false; @@ -115,8 +115,8 @@ void SutherlandHodgman(etk::VectorType > & input, etk::VectorType< //EWOL_DEBUG("element IN ==> OUT "); //new point intersection ... //y=aaax+bbb - etkFloat_t aaa = (lastElement.y-input[iii].y) / (lastElement.x-input[iii].x); - etkFloat_t bbb = lastElement.y - (aaa*lastElement.x); + float aaa = (lastElement.y-input[iii].y) / (lastElement.x-input[iii].x); + float bbb = lastElement.y - (aaa*lastElement.x); destPoint.y = aaa*sx + bbb; destPoint.x = sx; output.PushBack(destPoint); @@ -132,8 +132,8 @@ void SutherlandHodgman(etk::VectorType > & input, etk::VectorType< //EWOL_DEBUG("element OUT ==> IN "); //new point intersection ... //y=aaax+bbb - etkFloat_t aaa = (lastElement.y-input[iii].y) / (lastElement.x-input[iii].x); - etkFloat_t bbb = lastElement.y - (aaa*lastElement.x); + float aaa = (lastElement.y-input[iii].y) / (lastElement.x-input[iii].x); + float bbb = lastElement.y - (aaa*lastElement.x); destPoint.y = aaa*sx + bbb; destPoint.x = sx; output.PushBack(destPoint); @@ -160,8 +160,8 @@ void SutherlandHodgman(etk::VectorType > & input, etk::VectorType< //EWOL_DEBUG("element IN ==> OUT "); //new point intersection ... //x=aaay+bbb - etkFloat_t aaa = (lastElement.x-input[iii].x) / (lastElement.y-input[iii].y); - etkFloat_t bbb = lastElement.x - (aaa*lastElement.y); + float aaa = (lastElement.x-input[iii].x) / (lastElement.y-input[iii].y); + float bbb = lastElement.x - (aaa*lastElement.y); destPoint.y = sy; destPoint.x = sy*aaa + bbb; output.PushBack(destPoint); @@ -177,8 +177,8 @@ void SutherlandHodgman(etk::VectorType > & input, etk::VectorType< //EWOL_DEBUG("element OUT ==> IN "); //new point intersection ... //y=aaax+bbb - etkFloat_t aaa = (lastElement.x-input[iii].x) / (lastElement.y-input[iii].y); - etkFloat_t bbb = lastElement.x - (aaa*lastElement.y); + float aaa = (lastElement.x-input[iii].x) / (lastElement.y-input[iii].y); + float bbb = lastElement.x - (aaa*lastElement.y); destPoint.y = sy; destPoint.x = sy*aaa + bbb; output.PushBack(destPoint); @@ -205,8 +205,8 @@ void SutherlandHodgman(etk::VectorType > & input, etk::VectorType< //EWOL_DEBUG("element IN ==> OUT "); //new point intersection ... //y=aaax+bbb - etkFloat_t aaa = (lastElement.y-input[iii].y) / (lastElement.x-input[iii].x); - etkFloat_t bbb = lastElement.y - (aaa*lastElement.x); + float aaa = (lastElement.y-input[iii].y) / (lastElement.x-input[iii].x); + float bbb = lastElement.y - (aaa*lastElement.x); destPoint.y = aaa*ex + bbb; destPoint.x = ex; output.PushBack(destPoint); @@ -222,8 +222,8 @@ void SutherlandHodgman(etk::VectorType > & input, etk::VectorType< //EWOL_DEBUG("element OUT ==> IN "); //new point intersection ... //y=aaax+bbb - etkFloat_t aaa = (lastElement.y-input[iii].y) / (lastElement.x-input[iii].x); - etkFloat_t bbb = lastElement.y - (aaa*lastElement.x); + float aaa = (lastElement.y-input[iii].y) / (lastElement.x-input[iii].x); + float bbb = lastElement.y - (aaa*lastElement.x); destPoint.y = aaa*ex + bbb; destPoint.x = ex; output.PushBack(destPoint); @@ -249,8 +249,8 @@ void SutherlandHodgman(etk::VectorType > & input, etk::VectorType< //EWOL_DEBUG("element IN ==> OUT "); //new point intersection ... //x=aaay+bbb - etkFloat_t aaa = (lastElement.x-input[iii].x) / (lastElement.y-input[iii].y); - etkFloat_t bbb = lastElement.x - (aaa*lastElement.y); + float aaa = (lastElement.x-input[iii].x) / (lastElement.y-input[iii].y); + float bbb = lastElement.x - (aaa*lastElement.y); destPoint.y = ey; destPoint.x = ey*aaa + bbb; output.PushBack(destPoint); @@ -266,8 +266,8 @@ void SutherlandHodgman(etk::VectorType > & input, etk::VectorType< //EWOL_DEBUG("element OUT ==> IN "); //new point intersection ... //y=aaax+bbb - etkFloat_t aaa = (lastElement.x-input[iii].x) / (lastElement.y-input[iii].y); - etkFloat_t bbb = lastElement.x - (aaa*lastElement.y); + float aaa = (lastElement.x-input[iii].x) / (lastElement.y-input[iii].y); + float bbb = lastElement.x - (aaa*lastElement.y); destPoint.y = ey; destPoint.x = ey*aaa + bbb; output.PushBack(destPoint); @@ -312,7 +312,7 @@ void ewol::OObject2DColored::SetColor(color_ts color) } -void ewol::OObject2DColored::SetColor(etkFloat_t red, etkFloat_t green, etkFloat_t blue, etkFloat_t alpha) +void ewol::OObject2DColored::SetColor(float red, float green, float blue, float alpha) { if (m_triElement < 1) { m_color[0].red = red*255; @@ -338,7 +338,7 @@ void ewol::OObject2DColored::SetColor(etkFloat_t red, etkFloat_t green, etkFloat void ewol::OObject2DColored::SetPoint(Vector2D point) { // TODO : Clean this : - Coord2D tmpElement; + Vector2D tmpElement; tmpElement.x = point.x; tmpElement.y = point.y; m_triangle[m_triElement] = tmpElement; @@ -348,7 +348,7 @@ void ewol::OObject2DColored::SetPoint(Vector2D point) } } -void ewol::OObject2DColored::SetPoint(etkFloat_t x, etkFloat_t y) +void ewol::OObject2DColored::SetPoint(float x, float y) { m_triangle[m_triElement].x = x; m_triangle[m_triElement].y = y; @@ -366,7 +366,7 @@ void ewol::OObject2DColored::ResetCount(void) m_color[2] = m_color[0]; } -void ewol::OObject2DColored::Line(etkFloat_t sx, etkFloat_t sy, etkFloat_t ex, etkFloat_t ey, etkFloat_t thickness) +void ewol::OObject2DColored::Line(float sx, float sy, float ex, float ey, float thickness) { ResetCount(); if (sx == ex && sy == ey) { @@ -374,7 +374,7 @@ void ewol::OObject2DColored::Line(etkFloat_t sx, etkFloat_t sy, etkFloat_t ex, e return; } //teta = tan-1(oposer/adjacent) - etkFloat_t teta = 0; + float teta = 0; if (sx <= ex) { teta = atan((ey-sy)/(ex-sx)); } else { @@ -386,8 +386,8 @@ void ewol::OObject2DColored::Line(etkFloat_t sx, etkFloat_t sy, etkFloat_t ex, e teta -= 2*M_PI; } //EWOL_DEBUG("teta = " << (teta*180/(M_PI)) << " deg." ); - etkFloat_t offsety = sin(teta-M_PI/2) * (thickness/2); - etkFloat_t offsetx = cos(teta-M_PI/2) * (thickness/2); + float offsety = sin(teta-M_PI/2) * (thickness/2); + float offsetx = cos(teta-M_PI/2) * (thickness/2); SetPoint(sx - offsetx, sy - offsety); SetPoint(sx + offsetx, sy + offsety); @@ -398,7 +398,7 @@ void ewol::OObject2DColored::Line(etkFloat_t sx, etkFloat_t sy, etkFloat_t ex, e SetPoint(sx - offsetx, sy - offsety); } -void ewol::OObject2DColored::Rectangle(etkFloat_t x, etkFloat_t y, etkFloat_t w, etkFloat_t h) +void ewol::OObject2DColored::Rectangle(float x, float y, float w, float h) { ResetCount(); @@ -409,10 +409,10 @@ void ewol::OObject2DColored::Rectangle(etkFloat_t x, etkFloat_t y, etkFloat_t w, * | | * yD *------* */ - etkFloat_t dxA = x; - etkFloat_t dxB = x + w; - etkFloat_t dyC = y; - etkFloat_t dyD = y + h; + float dxA = x; + float dxB = x + w; + float dyC = y; + float dyD = y + h; if (true == m_hasClipping) { if (dxA < m_clipping.x) { @@ -441,7 +441,7 @@ void ewol::OObject2DColored::Rectangle(etkFloat_t x, etkFloat_t y, etkFloat_t w, SetPoint(dxA, dyD); } -void ewol::OObject2DColored::RectangleBorder(etkFloat_t x, etkFloat_t y, etkFloat_t w, etkFloat_t h, etkFloat_t thickness) +void ewol::OObject2DColored::RectangleBorder(float x, float y, float w, float h, float thickness) { // TODO : This did not manage the thickness of the line ... Line(x, y, x+w, y, thickness); @@ -450,7 +450,7 @@ void ewol::OObject2DColored::RectangleBorder(etkFloat_t x, etkFloat_t y, etkFloa Line(x, y+h, x, y, thickness); } -void ewol::OObject2DColored::Circle(etkFloat_t x, etkFloat_t y, etkFloat_t radius, etkFloat_t thickness) +void ewol::OObject2DColored::Circle(float x, float y, float radius, float thickness) { ResetCount(); if (radius<0) { @@ -466,17 +466,17 @@ void ewol::OObject2DColored::Circle(etkFloat_t x, etkFloat_t y, etkFloat_t radiu } for (int32_t iii=0; iii " << angleStop << " ocurence=" << (angleLinear*180/(M_PI)) ); int32_t nbOcurence = radius*0.50; @@ -586,13 +586,13 @@ void ewol::OObject2DColored::DiscPart(etkFloat_t x, etkFloat_t y, etkFloat_t rad for (int32_t iii=0; iii > m_coord; //!< internal coord of the object - etk::VectorType m_coordColor; //!< internal color of the different point + etk::VectorType > m_coord; //!< internal coord of the object + etk::VectorType m_coordColor; //!< internal color of the different point //etk::VectorType m_linkCoord; //!< internal link between point to generate triangle - int32_t m_triElement; - color_ts m_color[3]; - Coord2D m_triangle[3]; + int32_t m_triElement; + color_ts m_color[3]; + Vector2D m_triangle[3]; void GenerateTriangle(void); void ResetCount(void); public: void Clear(void); - void SetColor(etkFloat_t red, etkFloat_t green, etkFloat_t blue, etkFloat_t alpha = 1.0); + void SetColor(float red, float green, float blue, float alpha = 1.0); void SetColor(color_ts color); void SetPoint(Vector2D point); - void SetPoint(etkFloat_t x, etkFloat_t y); - void Line(etkFloat_t sx, etkFloat_t sy, etkFloat_t ex, etkFloat_t ey, etkFloat_t thickness); - void Rectangle(etkFloat_t x, etkFloat_t y, etkFloat_t w, etkFloat_t h); - void RectangleBorder(etkFloat_t x, etkFloat_t y, etkFloat_t w, etkFloat_t h, etkFloat_t thickness); - void Circle(etkFloat_t x, etkFloat_t y, etkFloat_t radius, etkFloat_t thickness); - void CirclePart(etkFloat_t x, etkFloat_t y, etkFloat_t radius, etkFloat_t thickness, etkFloat_t angleStart, etkFloat_t angleStop); - void Disc(etkFloat_t x, etkFloat_t y, etkFloat_t radius); - void DiscPart(etkFloat_t x, etkFloat_t y, etkFloat_t radius, etkFloat_t angleStart, etkFloat_t angleStop); + void SetPoint(float x, float y); + void Line(float sx, float sy, float ex, float ey, float thickness); + void Rectangle(float x, float y, float w, float h); + void RectangleBorder(float x, float y, float w, float h, float thickness); + void Circle(float x, float y, float radius, float thickness); + void CirclePart(float x, float y, float radius, float thickness, float angleStart, float angleStop); + void Disc(float x, float y, float radius); + void DiscPart(float x, float y, float radius, float angleStart, float angleStop); }; }; diff --git a/Sources/libewol/ewol/OObject/2DText.cpp b/Sources/libewol/ewol/OObject/2DText.cpp index 58dba654..72a45ed9 100644 --- a/Sources/libewol/ewol/OObject/2DText.cpp +++ b/Sources/libewol/ewol/OObject/2DText.cpp @@ -68,8 +68,8 @@ void ewol::OObject2DText::Draw(void) glBindTexture(GL_TEXTURE_2D, ewol::texture::GetGLID(m_FontTextureId)); glEnableClientState( GL_VERTEX_ARRAY ); // Enable Vertex Arrays glEnableClientState( GL_TEXTURE_COORD_ARRAY ); // Enable Texture Coord Arrays - glVertexPointer( 2, oglTypeFloat_t, 0, &m_coord[0] ); - glTexCoordPointer( 2, oglTypeFloat_t, 0, &m_coordTex[0] ); + glVertexPointer( 2, GL_FLOAT, 0, &m_coord[0] ); + glTexCoordPointer( 2, GL_FLOAT, 0, &m_coordTex[0] ); glDrawArrays( GL_TRIANGLES, 0, m_coord.Size()); //EWOL_DEBUG("request draw of " << m_coord.Size() << " elements"); glDisableClientState( GL_VERTEX_ARRAY ); // Disable Vertex Arrays diff --git a/Sources/libewol/ewol/OObject/2DTextColored.cpp b/Sources/libewol/ewol/OObject/2DTextColored.cpp index 388d822f..19328f8a 100644 --- a/Sources/libewol/ewol/OObject/2DTextColored.cpp +++ b/Sources/libewol/ewol/OObject/2DTextColored.cpp @@ -81,8 +81,8 @@ void ewol::OObject2DTextColored::Draw(void) glEnableClientState( GL_VERTEX_ARRAY ); // Enable Vertex Arrays glEnableClientState( GL_TEXTURE_COORD_ARRAY ); // Enable Texture Coord Arrays glEnableClientState( GL_COLOR_ARRAY ); // Enable Color Arrays - glVertexPointer( 2, oglTypeFloat_t, 0, &m_coord[0] ); - glTexCoordPointer( 2, oglTypeFloat_t, 0, &m_coordTex[0] ); + glVertexPointer( 2, GL_FLOAT, 0, &m_coord[0] ); + glTexCoordPointer( 2, GL_FLOAT, 0, &m_coordTex[0] ); glColorPointer( 4, GL_UNSIGNED_BYTE, 0, &m_coordColor[0] ); glDrawArrays( GL_TRIANGLES, 0, m_coord.Size()); //EWOL_DEBUG("request draw of " << m_coord.Size() << " elements"); @@ -146,7 +146,7 @@ void ewol::OObject2DTextColored::SetColor(color_ts color) } -void ewol::OObject2DTextColored::SetColor(etkFloat_t red, etkFloat_t green, etkFloat_t blue, etkFloat_t alpha) +void ewol::OObject2DTextColored::SetColor(float red, float green, float blue, float alpha) { m_color = etk::color::Create(red, green, blue, alpha); } diff --git a/Sources/libewol/ewol/OObject/2DTextColored.h b/Sources/libewol/ewol/OObject/2DTextColored.h index 6ada3b4a..1566dc78 100644 --- a/Sources/libewol/ewol/OObject/2DTextColored.h +++ b/Sources/libewol/ewol/OObject/2DTextColored.h @@ -37,7 +37,7 @@ namespace ewol { virtual ~OObject2DTextColored(void); public: virtual void Draw(void); - void SetColor(etkFloat_t red, etkFloat_t green, etkFloat_t blue, etkFloat_t alpha = 1.0); + void SetColor(float red, float green, float blue, float alpha = 1.0); void SetColor(color_ts color); // set a specific text void Clear(void); diff --git a/Sources/libewol/ewol/OObject/2DTextured.cpp b/Sources/libewol/ewol/OObject/2DTextured.cpp index 002073e4..096e8b2d 100644 --- a/Sources/libewol/ewol/OObject/2DTextured.cpp +++ b/Sources/libewol/ewol/OObject/2DTextured.cpp @@ -36,7 +36,7 @@ ewol::OObject2DTextured::OObject2DTextured(etk::UString textureName) EWOL_VERBOSE("Create OObject textured : \"" << textureName << "\""); m_textureId = ewol::texture::Load(textureName); } -ewol::OObject2DTextured::OObject2DTextured(etk::UString textureName, etkFloat_t sizeX, etkFloat_t sizeY) +ewol::OObject2DTextured::OObject2DTextured(etk::UString textureName, float sizeX, float sizeY) { EWOL_VERBOSE("Create OObject textured : \"" << textureName << "\""); m_textureId = ewol::texture::Load(textureName, sizeX); @@ -65,8 +65,8 @@ void ewol::OObject2DTextured::Draw(void) glBindTexture(GL_TEXTURE_2D, ewol::texture::GetGLID(m_textureId)); glEnableClientState( GL_VERTEX_ARRAY ); // Enable Vertex Arrays glEnableClientState( GL_TEXTURE_COORD_ARRAY ); // Enable Texture Coord Arrays - glVertexPointer( 2, oglTypeFloat_t, 0, &m_coord[0] ); - glTexCoordPointer( 2, oglTypeFloat_t, 0, &m_coordTex[0] ); + glVertexPointer( 2, GL_FLOAT, 0, &m_coord[0] ); + glTexCoordPointer( 2, GL_FLOAT, 0, &m_coordTex[0] ); glDrawArrays( GL_TRIANGLES, 0, m_coord.Size()); //EWOL_DEBUG("request draw of " << m_coord.Size() << " elements"); glDisableClientState( GL_VERTEX_ARRAY ); // Disable Vertex Arrays @@ -80,7 +80,7 @@ void ewol::OObject2DTextured::Clear(void) m_coordTex.Clear(); } -void ewol::OObject2DTextured::Rectangle(etkFloat_t x, etkFloat_t y, etkFloat_t w, etkFloat_t h, etkFloat_t texX, etkFloat_t texY, etkFloat_t texSX, etkFloat_t texSY) +void ewol::OObject2DTextured::Rectangle(float x, float y, float w, float h, float texX, float texY, float texSX, float texSY) { //EWOL_DEBUG("Add rectangle : ..."); Vector2D point; diff --git a/Sources/libewol/ewol/OObject/2DTextured.h b/Sources/libewol/ewol/OObject/2DTextured.h index 76f5e293..a4a39f31 100644 --- a/Sources/libewol/ewol/OObject/2DTextured.h +++ b/Sources/libewol/ewol/OObject/2DTextured.h @@ -32,12 +32,12 @@ namespace ewol { { public: OObject2DTextured(etk::UString textureName); - OObject2DTextured(etk::UString textureName, etkFloat_t sizeX, etkFloat_t sizeY); + OObject2DTextured(etk::UString textureName, float sizeX, float sizeY); virtual ~OObject2DTextured(void); public: virtual void Draw(void); void Clear(void); - void Rectangle(etkFloat_t x, etkFloat_t y, etkFloat_t w, etkFloat_t h, etkFloat_t texX=0.0, etkFloat_t texY=0.0, etkFloat_t texSX=1.0, etkFloat_t texSY=1.0); + void Rectangle(float x, float y, float w, float h, float texX=0.0, float texY=0.0, float texSX=1.0, float texSY=1.0); protected: int32_t m_textureId; //!< texture internal ID etk::VectorType > m_coord; //!< internal coord of the object diff --git a/Sources/libewol/ewol/OObject/Sprite.cpp b/Sources/libewol/ewol/OObject/Sprite.cpp index 71ff5c1f..d941afc8 100644 --- a/Sources/libewol/ewol/OObject/Sprite.cpp +++ b/Sources/libewol/ewol/OObject/Sprite.cpp @@ -38,7 +38,7 @@ ewol::Sprite::Sprite(etk::UString spriteName) EWOL_VERBOSE("Create Sprite : \"" << m_name << "\""); m_textureId = ewol::texture::Load(m_name); } -ewol::Sprite::Sprite(etk::UString spriteName, etkFloat_t sizeX, etkFloat_t sizeY) +ewol::Sprite::Sprite(etk::UString spriteName, float sizeX, float sizeY) { m_name = spriteName; EWOL_VERBOSE("Create Sprite : \"" << m_name << "\""); @@ -69,8 +69,8 @@ void ewol::Sprite::Draw(void) glBindTexture(GL_TEXTURE_2D, ewol::texture::GetGLID(m_textureId)); glEnableClientState( GL_VERTEX_ARRAY ); // Enable Vertex Arrays glEnableClientState( GL_TEXTURE_COORD_ARRAY ); // Enable Texture Coord Arrays - glVertexPointer( 2, oglTypeFloat_t, 0, &m_coord[0] ); - glTexCoordPointer( 2, oglTypeFloat_t, 0, &m_coordTex[0] ); + glVertexPointer( 2, GL_FLOAT, 0, &m_coord[0] ); + glTexCoordPointer( 2, GL_FLOAT, 0, &m_coordTex[0] ); glDrawArrays( GL_TRIANGLES, 0, m_coord.Size()); //EWOL_DEBUG("request draw of " << m_coord.Size() << " elements"); glDisableClientState( GL_VERTEX_ARRAY ); // Disable Vertex Arrays @@ -84,7 +84,7 @@ void ewol::Sprite::Clear(void) m_coordTex.Clear(); } -void ewol::Sprite::Element(Vector2D pos, etkFloat_t size, etkFloat_t angle) +void ewol::Sprite::Element(Vector2D pos, float size, float angle) { angle -= M_PI/4; size *= 0.7; @@ -99,8 +99,8 @@ void ewol::Sprite::Element(Vector2D pos, etkFloat_t size, etkFloat_t angl texD.v = 0.0; Vector2D point; - etkFloat_t yyySin = sin(angle) * size; - etkFloat_t xxxCos = cos(angle) * size; + float yyySin = sin(angle) * size; + float xxxCos = cos(angle) * size; point.x = xxxCos + pos.x; point.y = yyySin + pos.y; diff --git a/Sources/libewol/ewol/OObject/Sprite.h b/Sources/libewol/ewol/OObject/Sprite.h index 8caa2e2d..705fd38b 100644 --- a/Sources/libewol/ewol/OObject/Sprite.h +++ b/Sources/libewol/ewol/OObject/Sprite.h @@ -34,11 +34,11 @@ namespace ewol { etk::UString m_name; public: Sprite(etk::UString spriteName); - Sprite(etk::UString spriteName, etkFloat_t sizeX, etkFloat_t sizeY); + Sprite(etk::UString spriteName, float sizeX, float sizeY); virtual ~Sprite(void); virtual void Draw(void); void Clear(void); - void Element(Vector2D pos, etkFloat_t size, etkFloat_t angle); + void Element(Vector2D pos, float size, float angle); bool HasName(etk::UString& name) { return name == m_name; }; protected: int32_t m_textureId; //!< texture internal ID diff --git a/Sources/libewol/ewol/Widget.cpp b/Sources/libewol/ewol/Widget.cpp index 4afc8d1e..6e3ff804 100644 --- a/Sources/libewol/ewol/Widget.cpp +++ b/Sources/libewol/ewol/Widget.cpp @@ -164,7 +164,7 @@ void ewol::Widget::MarkToRemove(void) * @param[in] availlableY Availlable vertical pixel size * @return --- */ -bool ewol::Widget::CalculateSize(etkFloat_t availlableX, etkFloat_t availlableY) +bool ewol::Widget::CalculateSize(float availlableX, float availlableY) { m_size.x = availlableX; m_size.y = availlableY; @@ -290,4 +290,4 @@ void ewol::Widget::PeriodicCallSet(bool statusToSet) } else { ewol::widgetManager::PeriodicCallRm(this); } -} \ No newline at end of file +} diff --git a/Sources/libewol/ewol/Widget.h b/Sources/libewol/ewol/Widget.h index 2ab5a190..5cfa3917 100644 --- a/Sources/libewol/ewol/Widget.h +++ b/Sources/libewol/ewol/Widget.h @@ -163,7 +163,7 @@ namespace ewol { * @param[in] y Position ot hte vertical origin * @return --- */ - void SetOrigin(etkFloat_t x, etkFloat_t y) { m_origin.x=x; m_origin.y=y;}; + void SetOrigin(float x, float y) { m_origin.x=x; m_origin.y=y;}; /** * @brief Get the origin (obsolute position in the windows) * @param --- @@ -185,7 +185,7 @@ namespace ewol { */ // TODO : Remove bool ==> deprecated ... // TODO : Rename in SetSize() - virtual bool CalculateSize(etkFloat_t availlableX, etkFloat_t availlableY); + virtual bool CalculateSize(float availlableX, float availlableY); //update the min Size ... and the expend parameters for the sizer /** * @brief Calculate the minimum size of the widget that is needed to display or the user requested) @@ -200,7 +200,7 @@ namespace ewol { * @param[in] y Set minimum vertical size (-1 : no requested) * @return --- */ - virtual void SetMinSize(etkFloat_t x=-1, etkFloat_t y=-1) { m_userMinSize.x = x; m_userMinSize.y = y; }; + virtual void SetMinSize(float x=-1, float y=-1) { m_userMinSize.x = x; m_userMinSize.y = y; }; /** * @brief Get the current calculated min size * @param --- diff --git a/Sources/libewol/ewol/Windows.cpp b/Sources/libewol/ewol/Windows.cpp index 447169ef..7abaa98f 100644 --- a/Sources/libewol/ewol/Windows.cpp +++ b/Sources/libewol/ewol/Windows.cpp @@ -108,7 +108,7 @@ const char * const ewol::Windows::GetObjectType(void) } -bool ewol::Windows::CalculateSize(etkFloat_t availlableX, etkFloat_t availlableY) +bool ewol::Windows::CalculateSize(float availlableX, float availlableY) { //EWOL_DEBUG("calculateMinSize on : " << m_currentCreateId); m_size.x = availlableX; diff --git a/Sources/libewol/ewol/Windows.h b/Sources/libewol/ewol/Windows.h index cfd70a62..52e7799d 100644 --- a/Sources/libewol/ewol/Windows.h +++ b/Sources/libewol/ewol/Windows.h @@ -65,7 +65,7 @@ namespace ewol { virtual void OnReduce(void) { }; virtual void On(void) { }; public: - virtual bool CalculateSize(etkFloat_t availlableX, etkFloat_t availlableY); + virtual bool CalculateSize(float availlableX, float availlableY); /** * @brief Get the widget at the specific windows absolute position * @param[in] pos gAbsolute position of the requested widget knowledge diff --git a/Sources/libewol/ewol/base/gui.cpp b/Sources/libewol/ewol/base/gui.cpp index 0b42d5d7..efe57959 100644 --- a/Sources/libewol/ewol/base/gui.cpp +++ b/Sources/libewol/ewol/base/gui.cpp @@ -36,8 +36,8 @@ #include ewol::Windows* gui_uniqueWindows = NULL; -etkFloat_t gui_width = 320; -etkFloat_t gui_height = 480; +float gui_width = 320; +float gui_height = 480; int32_t ewol::GetCurrentWidth(void) @@ -64,7 +64,7 @@ void EWOL_NativeResize(int w, int h ) gui_height = h; //EWOL_INFO("Resize w=" << w << " h=" << h); if (NULL != gui_uniqueWindows) { - gui_uniqueWindows->CalculateSize((etkFloat_t)gui_width, (etkFloat_t)gui_height); + gui_uniqueWindows->CalculateSize((float)gui_width, (float)gui_height); gui_uniqueWindows->SetOrigin(0.0, 0.0); } } @@ -92,14 +92,14 @@ void guiAbstraction::SetDisplayOnWindows(ewol::Windows * newWindows) { gui_uniqueWindows = newWindows; if (NULL != gui_uniqueWindows) { - gui_uniqueWindows->CalculateSize((etkFloat_t)gui_width, (etkFloat_t)gui_height); + gui_uniqueWindows->CalculateSize((float)gui_width, (float)gui_height); } } void guiAbstraction::ForceRedrawAll(void) { if (NULL != gui_uniqueWindows) { - gui_uniqueWindows->CalculateSize((etkFloat_t)gui_width, (etkFloat_t)gui_height); + gui_uniqueWindows->CalculateSize((float)gui_width, (float)gui_height); } } diff --git a/Sources/libewol/ewol/base/guiAndroid.cpp b/Sources/libewol/ewol/base/guiAndroid.cpp index 0d583134..c0915ec4 100644 --- a/Sources/libewol/ewol/base/guiAndroid.cpp +++ b/Sources/libewol/ewol/base/guiAndroid.cpp @@ -45,8 +45,8 @@ int32_t separateClickTime = 800000; int32_t offsetMoveClicked = 40000; int32_t offsetMoveClickedDouble = 300000; -extern etkFloat_t gui_width; -extern etkFloat_t gui_height; +extern float gui_width; +extern float gui_height; extern ewol::Windows* gui_uniqueWindows; int64_t GetCurrentTime(void) @@ -78,8 +78,8 @@ static etk::UString l_clipBoardPrimary(""); // local copy of the selection static etk::UString l_clipBoardStd(""); // local copy of the clipboard -static etkFloat_t gTriangleVertices[] = { 0.0f, 0.0f, 200.0f, 0.0f, 0.0f, 200.0f }; -static etkFloat_t gTriangleVertices5[] = { 200.0f, 200.0f, 100.0f, 200.0f, 200.0f, 100.0f, +static float gTriangleVertices[] = { 0.0f, 0.0f, 200.0f, 0.0f, 0.0f, 200.0f }; +static float gTriangleVertices5[] = { 200.0f, 200.0f, 100.0f, 200.0f, 200.0f, 100.0f, 200.0f, 200.0f, 300.0f, 200.0f, 200.0f, 300.0f }; void EWOL_NativeRender(void) @@ -114,7 +114,7 @@ void EWOL_NativeRender(void) //LOGI("engine_draw_frame (%d,%d)",width,height); glColor4f(0.0, 1.0, 1.0, 1.0); - glVertexPointer(2, oglTypeFloat_t, 0, gTriangleVertices5 ); + glVertexPointer(2, GL_FLOAT, 0, gTriangleVertices5 ); glDrawArrays( GL_TRIANGLES, 0, 6); static int vallllll = 0; static float transparency = 0.0; @@ -173,7 +173,7 @@ void EWOL_NativeRender(void) glColor4f(1.0, 0.0, 1.0, transparency); } } - glVertexPointer(2, oglTypeFloat_t, 0, gTriangleVertices ); + glVertexPointer(2, GL_FLOAT, 0, gTriangleVertices ); glDrawArrays( GL_TRIANGLES, 0, 3); glDisableClientState( GL_VERTEX_ARRAY ); @@ -297,4 +297,4 @@ int32_t ewol::CmdLineNb(void) etk::UString ewol::CmdLineGet(int32_t id) { return ""; -} \ No newline at end of file +} diff --git a/Sources/libewol/ewol/base/guiX11.cpp b/Sources/libewol/ewol/base/guiX11.cpp index 14dc7910..f10a7bcf 100644 --- a/Sources/libewol/ewol/base/guiX11.cpp +++ b/Sources/libewol/ewol/base/guiX11.cpp @@ -116,8 +116,8 @@ XVisualInfo * m_visual = NULL; bool m_doubleBuffered = 0; bool m_run = 0; extern ewol::Windows* gui_uniqueWindows; -extern etkFloat_t gui_width; -extern etkFloat_t gui_height; +extern float gui_width; +extern float gui_height; int32_t separateClickTime = 300000; int32_t offsetMoveClicked = 10000; @@ -481,17 +481,17 @@ void EWOL_NativeRender(void) glMatrixMode(GL_PROJECTION); glLoadIdentity(); - glOrtho(0., (etkFloat_t)gui_width, 0., (etkFloat_t)gui_height, 1., 20.); + glOrtho(0., (float)gui_width, 0., (float)gui_height, 1., 20.); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); glTranslatef(0, 0, -5); glBegin(GL_QUADS); - glColor3f(1., 0., 0.); glVertex3f( .25*(etkFloat_t)gui_width, .25*(etkFloat_t)gui_height, 0.); - glColor3f(0., 1., 0.); glVertex3f( .75*(etkFloat_t)gui_width, .25*(etkFloat_t)gui_height, 0.); - glColor3f(0., 0., 1.); glVertex3f( .75*(etkFloat_t)gui_width, .75*(etkFloat_t)gui_height, 0.); - glColor3f(1., 1., 0.); glVertex3f( .25*(etkFloat_t)gui_width, .75*(etkFloat_t)gui_height, 0.); + glColor3f(1., 0., 0.); glVertex3f( .25*(float)gui_width, .25*(float)gui_height, 0.); + glColor3f(0., 1., 0.); glVertex3f( .75*(float)gui_width, .25*(float)gui_height, 0.); + glColor3f(0., 0., 1.); glVertex3f( .75*(float)gui_width, .75*(float)gui_height, 0.); + glColor3f(1., 1., 0.); glVertex3f( .25*(float)gui_width, .75*(float)gui_height, 0.); glEnd(); } else { EWOL_GenericDraw(false); @@ -817,8 +817,8 @@ void X11_Run(void) #endif m_cursorEventX = event.xcrossing.x; m_cursorEventY = event.xcrossing.y; - //EWOL_DEBUG("X11 event : " << event.type << " = \"EnterNotify\" (" << (etkFloat_t)event.xcrossing.x << "," << (etkFloat_t)event.xcrossing.y << ")"); - //gui_uniqueWindows->GenEventInput(0, ewol::EVENT_INPUT_TYPE_ENTER, (etkFloat_t)event.xcrossing.x, (etkFloat_t)event.xcrossing.y); + //EWOL_DEBUG("X11 event : " << event.type << " = \"EnterNotify\" (" << (float)event.xcrossing.x << "," << (float)event.xcrossing.y << ")"); + //gui_uniqueWindows->GenEventInput(0, ewol::EVENT_INPUT_TYPE_ENTER, (float)event.xcrossing.x, (float)event.xcrossing.y); break; case LeaveNotify: #ifdef DEBUG_X11_EVENT @@ -826,7 +826,7 @@ void X11_Run(void) #endif m_cursorEventX = event.xcrossing.x; m_cursorEventY = event.xcrossing.y; - //EWOL_DEBUG("X11 event : " << event.type << " = \"LeaveNotify\" (" << (etkFloat_t)event.xcrossing.x << "," << (etkFloat_t)event.xcrossing.y << ")"); + //EWOL_DEBUG("X11 event : " << event.type << " = \"LeaveNotify\" (" << (float)event.xcrossing.x << "," << (float)event.xcrossing.y << ")"); break; case MotionNotify: #ifdef DEBUG_X11_EVENT @@ -839,13 +839,13 @@ void X11_Run(void) bool findOne = false; for (int32_t iii=0; iiiRectangle(tmpOriginX, tmpOriginY, tmpSizeX, tmpSizeY); } } - etkFloat_t tmpval = tmpSizeX * 0.2; + float tmpval = tmpSizeX * 0.2; tmpSizeX -= tmpval; tmpOriginX += tmpval/2; tmpval = tmpSizeY * 0.2; diff --git a/Sources/libewol/ewol/widget/CheckBox.cpp b/Sources/libewol/ewol/widget/CheckBox.cpp index be2f3fa5..481c22cd 100644 --- a/Sources/libewol/ewol/widget/CheckBox.cpp +++ b/Sources/libewol/ewol/widget/CheckBox.cpp @@ -106,7 +106,7 @@ bool ewol::CheckBox::CalculateMinSize(void) int32_t fontId = GetDefaultFontId(); int32_t minWidth = ewol::GetWidth(fontId, m_label); int32_t minHeight = ewol::GetHeight(fontId); - etkFloat_t boxSize = etk_max(20, minHeight) + 5; + float boxSize = etk_max(20, minHeight) + 5; m_minSize.x = boxSize+minWidth; m_minSize.y = etk_max(boxSize, minHeight)+3; MarkToReedraw(); @@ -146,7 +146,7 @@ void ewol::CheckBox::OnRegenerateDisplay(void) ewol::OObject2DText * tmpText = new ewol::OObject2DText("", -1, m_textColorFg); int32_t fontId = GetDefaultFontId(); int32_t fontHeight = ewol::GetHeight(fontId); - etkFloat_t boxSize = etk_max(20, fontHeight); + float boxSize = etk_max(20, fontHeight); //int32_t fontWidth = ewol::GetWidth(fontId, m_label.c_str()); int32_t posy = (m_size.y - fontHeight - 6)/2 + 3; //int32_t posx = (m_size.x - fontWidth - 6)/2 + 25; diff --git a/Sources/libewol/ewol/widget/ColorBar.cpp b/Sources/libewol/ewol/widget/ColorBar.cpp index 591cf9d1..0356a555 100644 --- a/Sources/libewol/ewol/widget/ColorBar.cpp +++ b/Sources/libewol/ewol/widget/ColorBar.cpp @@ -275,8 +275,8 @@ bool ewol::ColorBar::OnEventInput(ewol::inputType_te type, int32_t IdInput, even //==> try to estimate color EWOL_VERBOSE("event on (" << relativePos.x << "," << relativePos.y << ")"); int32_t bandID = (int32_t)(relativePos.x/(m_size.x/6)); - etkFloat_t localPos = relativePos.x - (m_size.x/6) * bandID; - etkFloat_t poroportionnalPos = localPos/(m_size.x/6); + float localPos = relativePos.x - (m_size.x/6) * bandID; + float poroportionnalPos = localPos/(m_size.x/6); EWOL_VERBOSE("bandId=" << bandID << " relative pos=" << localPos); color_ts estimateColor; estimateColor.alpha = 1.0; @@ -305,12 +305,12 @@ bool ewol::ColorBar::OnEventInput(ewol::inputType_te type, int32_t IdInput, even if (relativePos.y == (m_size.y/2)) { // nothing to do ... just get the current color ... } else if (relativePos.y < (m_size.y/2)) { - etkFloat_t poroportionnalWhite = 1.0-relativePos.y/(m_size.y/2); + float poroportionnalWhite = 1.0-relativePos.y/(m_size.y/2); estimateColor.red = estimateColor.red + (1.0 - estimateColor.red )*poroportionnalWhite; estimateColor.green = estimateColor.green + (1.0 - estimateColor.green)*poroportionnalWhite; estimateColor.blue = estimateColor.blue + (1.0 - estimateColor.blue )*poroportionnalWhite; } else { - etkFloat_t poroportionnalBlack = (relativePos.y-(m_size.y/2))/(m_size.y/2); + float poroportionnalBlack = (relativePos.y-(m_size.y/2))/(m_size.y/2); estimateColor.red = estimateColor.red - (estimateColor.red )*poroportionnalBlack; estimateColor.green = estimateColor.green - (estimateColor.green)*poroportionnalBlack; estimateColor.blue = estimateColor.blue - (estimateColor.blue )*poroportionnalBlack; diff --git a/Sources/libewol/ewol/widget/ContextMenu.cpp b/Sources/libewol/ewol/widget/ContextMenu.cpp index f1a96dc2..51f035bd 100644 --- a/Sources/libewol/ewol/widget/ContextMenu.cpp +++ b/Sources/libewol/ewol/widget/ContextMenu.cpp @@ -95,7 +95,7 @@ const char * const ewol::ContextMenu::GetObjectType(void) -bool ewol::ContextMenu::CalculateSize(etkFloat_t availlableX, etkFloat_t availlableY) +bool ewol::ContextMenu::CalculateSize(float availlableX, float availlableY) { EWOL_DEBUG("CalculateSize(" << availlableX << "," << availlableY << ")"); // pop-up fill all the display : @@ -188,7 +188,7 @@ bool ewol::ContextMenu::CalculateMinSize(void) return true; } -void ewol::ContextMenu::SetMinSise(etkFloat_t x, etkFloat_t y) +void ewol::ContextMenu::SetMinSise(float x, float y) { EWOL_ERROR("Pop-up can not have a user Minimum size (herited from under elements)"); } diff --git a/Sources/libewol/ewol/widget/ContextMenu.h b/Sources/libewol/ewol/widget/ContextMenu.h index 73d88a29..a1f54668 100644 --- a/Sources/libewol/ewol/widget/ContextMenu.h +++ b/Sources/libewol/ewol/widget/ContextMenu.h @@ -59,9 +59,9 @@ namespace ewol { */ virtual const char * const GetObjectType(void); public: - virtual bool CalculateSize(etkFloat_t availlableX, etkFloat_t availlableY); // this generate the current size ... + virtual bool CalculateSize(float availlableX, float availlableY); // this generate the current size ... virtual bool CalculateMinSize(void); //update the min Size ... and the expend parameters for the sizer - virtual void SetMinSise(etkFloat_t x=-1, etkFloat_t y=-1); + virtual void SetMinSise(float x=-1, float y=-1); virtual void SetExpendX(bool newExpend=false); virtual void SetExpendY(bool newExpend=false); private: @@ -69,7 +69,7 @@ namespace ewol { color_ts m_colorBorder; Vector2D m_padding; Vector2D m_arrowPos; - etkFloat_t m_offset; + float m_offset; markPosition_te m_arrawBorder; ewol::Widget* m_subWidget[NB_BOUBLE_BUFFER]; public: diff --git a/Sources/libewol/ewol/widget/Joystick.cpp b/Sources/libewol/ewol/widget/Joystick.cpp index 4d36cf4b..554fcf2b 100644 --- a/Sources/libewol/ewol/widget/Joystick.cpp +++ b/Sources/libewol/ewol/widget/Joystick.cpp @@ -35,7 +35,7 @@ extern const char * const ewolEventJoystickMove = "ewol-joystick-move"; static bool l_displayBackground(true); static etk::UString l_background(""); static etk::UString l_foreground(""); -static etkFloat_t l_ratio(1.0/7.0); +static float l_ratio(1.0/7.0); /** * @brief Initilise the basic widget property ==> due to the android system @@ -56,7 +56,7 @@ void ewol::WIDGET_JoystickInit(void) * @param[in] newRatio the new ratio that might be set * @return --- */ -void ewol::WIDGET_JoystickDefaultRatio(etkFloat_t newRatio) +void ewol::WIDGET_JoystickDefaultRatio(float newRatio) { if (newRatio > 1) { newRatio = 1; @@ -172,9 +172,9 @@ const char * const ewol::Joystick::GetObjectType(void) * @param[in] availlableY Availlable vertical pixel size * @return --- */ -bool ewol::Joystick::CalculateSize(etkFloat_t availlableX, etkFloat_t availlableY) +bool ewol::Joystick::CalculateSize(float availlableX, float availlableY) { - etkFloat_t minimumSize = etk_min(availlableX, availlableY); + float minimumSize = etk_min(availlableX, availlableY); m_size.x = minimumSize; m_size.y = minimumSize; MarkToReedraw(); @@ -202,7 +202,7 @@ void ewol::Joystick::OnRegenerateDisplay(void) } } // set cursor point - etkFloat_t sizeElement = m_size.x*m_ratio; + float sizeElement = m_size.x*m_ratio; if (m_foreground == "") { if (NULL == tmpOObjects) { tmpOObjects = new ewol::OObject2DColored; @@ -250,7 +250,7 @@ bool ewol::Joystick::OnEventInput(ewol::inputType_te type, int32_t IdInput, even || ewol::EVENT_INPUT_TYPE_MOVE == typeEvent) { // get local relative position Vector2D relativePos = RelativePosition(pos); - etkFloat_t sizeElement = m_size.x*m_ratio; + float sizeElement = m_size.x*m_ratio; // Calculate the position of the cursor... m_displayPos.x = (relativePos.x-sizeElement)/(m_size.x-sizeElement*2)*2.0 - 1.0; m_displayPos.y = (relativePos.y-sizeElement)/(m_size.y-sizeElement*2)*2.0 - 1.0; @@ -305,7 +305,7 @@ bool ewol::Joystick::OnEventInput(ewol::inputType_te type, int32_t IdInput, even * @param[in] newRatio the new ratio that might be set * @return --- */ -void ewol::Joystick::Ratio(etkFloat_t newRatio) +void ewol::Joystick::Ratio(float newRatio) { if (newRatio > 1) { newRatio = 1; @@ -346,7 +346,7 @@ void ewol::Joystick::Foreground(etk::UString imageNameInData) * @param[out] angle angle of the joy * @return --- */ -void ewol::Joystick::GetProperty(etkFloat_t& distance, etkFloat_t& angle) +void ewol::Joystick::GetProperty(float& distance, float& angle) { distance = m_distance; angle = m_angle+M_PI/2; diff --git a/Sources/libewol/ewol/widget/Joystick.h b/Sources/libewol/ewol/widget/Joystick.h index f9b0aa84..0a88ac90 100644 --- a/Sources/libewol/ewol/widget/Joystick.h +++ b/Sources/libewol/ewol/widget/Joystick.h @@ -44,8 +44,8 @@ namespace ewol { color_ts m_colorFg; //!< Forground color color_ts m_colorBg; //!< Background color Vector2D m_displayPos; //!< direction of the cursor ... - etkFloat_t m_distance; //!< dintance from the center - etkFloat_t m_angle; //!< angle of the arraw (if < 0 : No arraw...) 0 is the TOP ... + float m_distance; //!< dintance from the center + float m_angle; //!< angle of the arraw (if < 0 : No arraw...) 0 is the TOP ... bool m_lock; //!< flag to mark the lock when the cursor is free when we are outside the circle joystickMode_te m_displayMode; //!< Type of fonctionnal mode of the joystick private: @@ -53,7 +53,7 @@ namespace ewol { bool m_displayBackground; etk::UString m_background; etk::UString m_foreground; - etkFloat_t m_ratio; + float m_ratio; public: Joystick(void); virtual ~Joystick(void); @@ -79,7 +79,7 @@ namespace ewol { * @param[in] availlableY Availlable vertical pixel size * @return --- */ - virtual bool CalculateSize(etkFloat_t availlableX, etkFloat_t availlableY); + virtual bool CalculateSize(float availlableX, float availlableY); virtual void OnRegenerateDisplay(void); /** * @brief Event on an input of this Widget @@ -98,7 +98,7 @@ namespace ewol { * @param[in] newRatio the new ratio that might be set * @return --- */ - void Ratio(etkFloat_t newRatio); + void Ratio(float newRatio); /** * @brief Set the Background of the widget joystick @@ -120,7 +120,7 @@ namespace ewol { * @param[out] angle angle of the joy * @return --- */ - void GetProperty(etkFloat_t& distance, etkFloat_t& angle); + void GetProperty(float& distance, float& angle); }; @@ -136,7 +136,7 @@ namespace ewol { * @param[in] newRatio the new ratio that might be set * @return --- */ - void WIDGET_JoystickDefaultRatio(etkFloat_t newRatio); + void WIDGET_JoystickDefaultRatio(float newRatio); /** * @brief Set the default Background of the widget joystick * @param[in] imageNameInData the new rbackground that might be set diff --git a/Sources/libewol/ewol/widget/Layer.cpp b/Sources/libewol/ewol/widget/Layer.cpp index 2111288c..af4444b3 100644 --- a/Sources/libewol/ewol/widget/Layer.cpp +++ b/Sources/libewol/ewol/widget/Layer.cpp @@ -82,7 +82,7 @@ const char * const ewol::Layer::GetObjectType(void) -bool ewol::Layer::CalculateSize(etkFloat_t availlableX, etkFloat_t availlableY) +bool ewol::Layer::CalculateSize(float availlableX, float availlableY) { //EWOL_DEBUG("Update Size"); m_size.x = availlableX; @@ -121,7 +121,7 @@ bool ewol::Layer::CalculateMinSize(void) return true; } -void ewol::Layer::SetMinSise(etkFloat_t x, etkFloat_t y) +void ewol::Layer::SetMinSise(float x, float y) { EWOL_ERROR("Layer can not have a user Minimum size (herited from under elements)"); } diff --git a/Sources/libewol/ewol/widget/Layer.h b/Sources/libewol/ewol/widget/Layer.h index 23b4e212..bef9d882 100644 --- a/Sources/libewol/ewol/widget/Layer.h +++ b/Sources/libewol/ewol/widget/Layer.h @@ -51,9 +51,9 @@ namespace ewol { */ virtual const char * const GetObjectType(void); public: - virtual bool CalculateSize(etkFloat_t availlableX, etkFloat_t availlableY); // this generate the current size ... + virtual bool CalculateSize(float availlableX, float availlableY); // this generate the current size ... virtual bool CalculateMinSize(void); //update the min Size ... and the expend parameters for the sizer - virtual void SetMinSise(etkFloat_t x=-1, etkFloat_t y=-1); + virtual void SetMinSise(float x=-1, float y=-1); virtual void SetExpendX(bool newExpend=false); virtual bool CanExpentX(void); virtual void SetExpendY(bool newExpend=false); diff --git a/Sources/libewol/ewol/widget/List.h b/Sources/libewol/ewol/widget/List.h index 2ea56e8c..320afdb7 100644 --- a/Sources/libewol/ewol/widget/List.h +++ b/Sources/libewol/ewol/widget/List.h @@ -119,7 +119,7 @@ namespace ewol { } return false; }; - virtual bool OnItemEvent(int32_t IdInput, ewol::eventInputType_te typeEvent, int32_t colomn, int32_t raw, etkFloat_t x, etkFloat_t y) { + virtual bool OnItemEvent(int32_t IdInput, ewol::eventInputType_te typeEvent, int32_t colomn, int32_t raw, float x, float y) { return false; } protected: diff --git a/Sources/libewol/ewol/widget/PopUp.cpp b/Sources/libewol/ewol/widget/PopUp.cpp index 86ae572f..623c978f 100644 --- a/Sources/libewol/ewol/widget/PopUp.cpp +++ b/Sources/libewol/ewol/widget/PopUp.cpp @@ -93,7 +93,7 @@ const char * const ewol::PopUp::GetObjectType(void) -bool ewol::PopUp::CalculateSize(etkFloat_t availlableX, etkFloat_t availlableY) +bool ewol::PopUp::CalculateSize(float availlableX, float availlableY) { //EWOL_DEBUG("CalculateSize(" << availlableX << "," << availlableY << ")"); // pop-up fill all the display : @@ -147,7 +147,7 @@ bool ewol::PopUp::CalculateMinSize(void) return true; } -void ewol::PopUp::SetMinSise(etkFloat_t x, etkFloat_t y) +void ewol::PopUp::SetMinSise(float x, float y) { EWOL_ERROR("Pop-up can not have a user Minimum size (herited from under elements)"); } @@ -248,7 +248,7 @@ ewol::Widget * ewol::PopUp::GetWidgetAtPos(Vector2D pos) } -void ewol::PopUp::SetDisplayRatio(etkFloat_t ratio) +void ewol::PopUp::SetDisplayRatio(float ratio) { m_displayRatio = ratio; } diff --git a/Sources/libewol/ewol/widget/PopUp.h b/Sources/libewol/ewol/widget/PopUp.h index 70c14478..12ff51d1 100644 --- a/Sources/libewol/ewol/widget/PopUp.h +++ b/Sources/libewol/ewol/widget/PopUp.h @@ -52,18 +52,18 @@ namespace ewol { */ virtual const char * const GetObjectType(void); public: - virtual bool CalculateSize(etkFloat_t availlableX, etkFloat_t availlableY); // this generate the current size ... + virtual bool CalculateSize(float availlableX, float availlableY); // this generate the current size ... virtual bool CalculateMinSize(void); //update the min Size ... and the expend parameters for the sizer - virtual void SetMinSise(etkFloat_t x=-1, etkFloat_t y=-1); + virtual void SetMinSise(float x=-1, float y=-1); virtual void SetExpendX(bool newExpend=false); virtual void SetExpendY(bool newExpend=false); - void SetDisplayRatio(etkFloat_t ratio); + void SetDisplayRatio(float ratio); private: color_ts m_colorBackGroung; color_ts m_colorBorder; color_ts m_colorEmptyArea; ewol::Widget* m_subWidget[NB_BOUBLE_BUFFER]; - etkFloat_t m_displayRatio; + float m_displayRatio; public: void SubWidgetSet(ewol::Widget* newWidget); void SubWidgetRemove(void); diff --git a/Sources/libewol/ewol/widget/ProgressBar.cpp b/Sources/libewol/ewol/widget/ProgressBar.cpp index 2bc51a50..7c62c9cf 100644 --- a/Sources/libewol/ewol/widget/ProgressBar.cpp +++ b/Sources/libewol/ewol/widget/ProgressBar.cpp @@ -103,14 +103,14 @@ bool ewol::ProgressBar::CalculateMinSize(void) } -void ewol::ProgressBar::ValueSet(etkFloat_t val) +void ewol::ProgressBar::ValueSet(float val) { m_value = etk_avg(0.0, val, 1.0); MarkToReedraw(); } -etkFloat_t ewol::ProgressBar::ValueGet(void) +float ewol::ProgressBar::ValueGet(void) { return m_value; } diff --git a/Sources/libewol/ewol/widget/ProgressBar.h b/Sources/libewol/ewol/widget/ProgressBar.h index 43bc9eb8..7677f163 100644 --- a/Sources/libewol/ewol/widget/ProgressBar.h +++ b/Sources/libewol/ewol/widget/ProgressBar.h @@ -52,11 +52,11 @@ namespace ewol { */ virtual const char * const GetObjectType(void); virtual bool CalculateMinSize(void); - void ValueSet(etkFloat_t val); - etkFloat_t ValueGet(void); + void ValueSet(float val); + float ValueGet(void); void SetColor(color_ts newColor) { m_textColorFg = newColor; }; private: - etkFloat_t m_value; //!< % used + float m_value; //!< % used color_ts m_textColorFg; //!< forder bar color color_ts m_textColorBgOn; //!< bar color enable color_ts m_textColorBgOff; //!< bar color disable diff --git a/Sources/libewol/ewol/widget/SizerHori.cpp b/Sources/libewol/ewol/widget/SizerHori.cpp index c59e7b84..c846c3ba 100644 --- a/Sources/libewol/ewol/widget/SizerHori.cpp +++ b/Sources/libewol/ewol/widget/SizerHori.cpp @@ -81,13 +81,13 @@ const char * const ewol::SizerHori::GetObjectType(void) -bool ewol::SizerHori::CalculateSize(etkFloat_t availlableX, etkFloat_t availlableY) +bool ewol::SizerHori::CalculateSize(float availlableX, float availlableY) { //EWOL_DEBUG("Update Size"); m_size.x = availlableX; m_size.y = availlableY; // calculate unExpendable Size : - etkFloat_t unexpendableSize=0.0; + float unexpendableSize=0.0; int32_t nbWidgetFixedSize=0; int32_t nbWidgetNotFixedSize=0; for (int32_t iii=0; iiiSetColor(borderDot); - tmpOObjects->Disc(4+((etkFloat_t)(m_value-m_min)/(etkFloat_t)(m_max-m_min))*(etkFloat_t)(m_size.x-2*dotRadius), m_size.y/2, dotRadius); + tmpOObjects->Disc(4+((float)(m_value-m_min)/(float)(m_max-m_min))*(float)(m_size.x-2*dotRadius), m_size.y/2, dotRadius); tmpOObjects->SetColor(m_textColorFg); - tmpOObjects->Disc(4+((etkFloat_t)(m_value-m_min)/(etkFloat_t)(m_max-m_min))*(etkFloat_t)(m_size.x-2*dotRadius), m_size.y/2, dotRadius/1.6); + tmpOObjects->Disc(4+((float)(m_value-m_min)/(float)(m_max-m_min))*(float)(m_size.x-2*dotRadius), m_size.y/2, dotRadius/1.6); AddOObject(tmpOObjects); } @@ -183,7 +183,7 @@ bool ewol::Slider::OnEventInput(ewol::inputType_te type, int32_t IdInput, eventI // get the new position : EWOL_DEBUG("Event on Slider (" << relativePos.x << "," << relativePos.y << ")"); int32_t oldValue = m_value; - m_value = m_min + (etkFloat_t)(relativePos.x - dotRadius) / (etkFloat_t)(m_size.x-2*dotRadius) * (etkFloat_t)(m_max-m_min); + m_value = m_min + (float)(relativePos.x - dotRadius) / (float)(m_size.x-2*dotRadius) * (float)(m_max-m_min); m_value = etk_max(etk_min(m_value, m_max), m_min); if (oldValue != m_value) { EWOL_DEBUG(" new value : " << m_value << " in [" << m_min << ".." << m_max << "]"); diff --git a/Sources/libewol/ewol/widget/Spacer.cpp b/Sources/libewol/ewol/widget/Spacer.cpp index bb7072ad..53e1d54d 100644 --- a/Sources/libewol/ewol/widget/Spacer.cpp +++ b/Sources/libewol/ewol/widget/Spacer.cpp @@ -90,7 +90,7 @@ bool ewol::Spacer::CalculateMinSize(void) } -void ewol::Spacer::SetSize(etkFloat_t size) +void ewol::Spacer::SetSize(float size) { m_size = size; MarkToReedraw(); diff --git a/Sources/libewol/ewol/widget/Spacer.h b/Sources/libewol/ewol/widget/Spacer.h index aba3e13c..e2ff01a0 100644 --- a/Sources/libewol/ewol/widget/Spacer.h +++ b/Sources/libewol/ewol/widget/Spacer.h @@ -51,7 +51,7 @@ namespace ewol { */ virtual const char * const GetObjectType(void); virtual bool CalculateMinSize(void); - void SetSize(etkFloat_t size); + void SetSize(float size); /** * @brief Get the widget at the specific windows absolute position * @note the sizer return NULL, because nothing can be done inside nothing @@ -61,7 +61,7 @@ namespace ewol { */ virtual ewol::Widget * GetWidgetAtPos(Vector2D pos) { return NULL; }; private: - etkFloat_t m_size; + float m_size; }; extern const char * const TYPE_EOBJECT_WIDGET_SPACER; diff --git a/Sources/libewol/ewol/widget/WSlider.cpp b/Sources/libewol/ewol/widget/WSlider.cpp index fd8bc1b9..26da057d 100644 --- a/Sources/libewol/ewol/widget/WSlider.cpp +++ b/Sources/libewol/ewol/widget/WSlider.cpp @@ -85,7 +85,7 @@ const char * const ewol::WSlider::GetObjectType(void) -bool ewol::WSlider::CalculateSize(etkFloat_t availlableX, etkFloat_t availlableY) +bool ewol::WSlider::CalculateSize(float availlableX, float availlableY) { //EWOL_DEBUG("Update Size"); m_size.x = availlableX; @@ -137,7 +137,7 @@ bool ewol::WSlider::CalculateMinSize(void) return true; } -void ewol::WSlider::SetMinSise(etkFloat_t x, etkFloat_t y) +void ewol::WSlider::SetMinSise(float x, float y) { EWOL_ERROR("Layer can not have a user Minimum size (herited from under elements)"); } diff --git a/Sources/libewol/ewol/widget/WSlider.h b/Sources/libewol/ewol/widget/WSlider.h index 4bc84213..ebd99624 100644 --- a/Sources/libewol/ewol/widget/WSlider.h +++ b/Sources/libewol/ewol/widget/WSlider.h @@ -51,9 +51,9 @@ namespace ewol { */ virtual const char * const GetObjectType(void); public: - virtual bool CalculateSize(etkFloat_t availlableX, etkFloat_t availlableY); // this generate the current size ... + virtual bool CalculateSize(float availlableX, float availlableY); // this generate the current size ... virtual bool CalculateMinSize(void); //update the min Size ... and the expend parameters for the sizer - virtual void SetMinSise(etkFloat_t x=-1, etkFloat_t y=-1); + virtual void SetMinSise(float x=-1, float y=-1); virtual void SetExpendX(bool newExpend=false); virtual bool CanExpentX(void); virtual void SetExpendY(bool newExpend=false); diff --git a/Sources/libewol/ewol/widget/WidgetScrolled.cpp b/Sources/libewol/ewol/widget/WidgetScrolled.cpp index 307d5915..64e6af06 100644 --- a/Sources/libewol/ewol/widget/WidgetScrolled.cpp +++ b/Sources/libewol/ewol/widget/WidgetScrolled.cpp @@ -99,9 +99,9 @@ void ewol::WidgetScrooled::OnRegenerateDisplay(void) if(m_size.y < m_maxSize.y) { //myOObjectsColored->Line(m_size.x-SCROLL_BAR_SPACE, SCROLL_BAR_SPACE, m_size.x-SCROLL_BAR_SPACE, m_size.y-SCROLL_BAR_SPACE, 1); myOObjectsColored->Line(m_size.x-(SCROLL_BAR_SPACE/2), SCROLL_BAR_SPACE, m_size.x-(SCROLL_BAR_SPACE/2), m_size.y-SCROLL_BAR_SPACE, 1); - etkFloat_t lenScrollBar = m_size.y*(m_size.y-SCROLL_BAR_SPACE*2) / m_maxSize.y; + float lenScrollBar = m_size.y*(m_size.y-SCROLL_BAR_SPACE*2) / m_maxSize.y; lenScrollBar = etk_avg(10, lenScrollBar, (m_size.y-SCROLL_BAR_SPACE*2)); - etkFloat_t originScrollBar = m_originScrooled.y / m_maxSize.y; + float originScrollBar = m_originScrooled.y / m_maxSize.y; originScrollBar = etk_avg(0.0, originScrollBar, 1.0); originScrollBar *= (m_size.y-SCROLL_BAR_SPACE*2-lenScrollBar); originScrollBar += 15; @@ -110,9 +110,9 @@ void ewol::WidgetScrooled::OnRegenerateDisplay(void) if(m_size.x < m_maxSize.x) { //myOObjectsColored->Line(SCROLL_BAR_SPACE, m_size.y-SCROLL_BAR_SPACE, m_size.x-SCROLL_BAR_SPACE, m_size.y-SCROLL_BAR_SPACE, 1); myOObjectsColored->Line(SCROLL_BAR_SPACE, m_size.y-(SCROLL_BAR_SPACE/2), m_size.x-SCROLL_BAR_SPACE, m_size.y-(SCROLL_BAR_SPACE/2), 1); - etkFloat_t lenScrollBar = m_size.x*(m_size.x-SCROLL_BAR_SPACE*2) / m_maxSize.x; + float lenScrollBar = m_size.x*(m_size.x-SCROLL_BAR_SPACE*2) / m_maxSize.x; lenScrollBar = etk_avg(10, lenScrollBar, (m_size.x-SCROLL_BAR_SPACE*2)); - etkFloat_t originScrollBar = m_originScrooled.x / m_maxSize.x; + float originScrollBar = m_originScrooled.x / m_maxSize.x; originScrollBar = etk_avg(0.0, originScrollBar, 1.0); originScrollBar *= (m_size.x-SCROLL_BAR_SPACE*2-lenScrollBar); originScrollBar += 15; @@ -224,7 +224,7 @@ bool ewol::WidgetScrooled::OnEventInput(ewol::inputType_te type, int32_t IdInput } else if (relativePos.y == m_highSpeedStartPos.y) { m_highSpeedMode = ewol::SCROLL_ENABLE_HORIZONTAL; } else { - etkFloat_t coef = (relativePos.y - m_highSpeedStartPos.y) / (relativePos.x - m_highSpeedStartPos.x); + float coef = (relativePos.y - m_highSpeedStartPos.y) / (relativePos.x - m_highSpeedStartPos.x); if (abs(coef) <= 1 ) { m_highSpeedMode = ewol::SCROLL_ENABLE_HORIZONTAL; } else { @@ -303,8 +303,8 @@ bool ewol::WidgetScrooled::OnEventInput(ewol::inputType_te type, int32_t IdInput } } else if (SCROLL_MODE_CENTER == m_scroollingMode) { if (ewol::INPUT_TYPE_MOUSE==type) { - etkFloat_t tmp1=ewol::GetCurrentHeight() / m_maxSize.y; - etkFloat_t tmp2=ewol::GetCurrentWidth() / m_maxSize.x; + float tmp1=ewol::GetCurrentHeight() / m_maxSize.y; + float tmp2=ewol::GetCurrentWidth() / m_maxSize.x; //EWOL_INFO(" elements Zoom : " << tmp1 << " " << tmp2); tmp1 = etk_min(tmp1, tmp2); if (4 == IdInput && ewol::EVENT_INPUT_TYPE_UP == typeEvent) { diff --git a/Sources/libewol/ewol/widget/WidgetScrolled.h b/Sources/libewol/ewol/widget/WidgetScrolled.h index 31b35034..914750ee 100644 --- a/Sources/libewol/ewol/widget/WidgetScrolled.h +++ b/Sources/libewol/ewol/widget/WidgetScrolled.h @@ -52,10 +52,10 @@ namespace ewol { protected: Vector2D m_originScrooled; Vector2D m_maxSize; - etkFloat_t m_zoom; //!< current zoom on the display + float m_zoom; //!< current zoom on the display private: scrollingMode_te m_scroollingMode; //!< mode of management of the scrooling - etkFloat_t m_pixelScrolling; + float m_pixelScrolling; Vector2D m_highSpeedStartPos; highSpeedMode_te m_highSpeedMode; int32_t m_highSpeedButton; @@ -104,7 +104,7 @@ namespace ewol { * @param[in] nbPixel number of pixel scrolling * @return --- */ - void SetScrollingSize(etkFloat_t nbPixel) { m_pixelScrolling = nbPixel; }; + void SetScrollingSize(float nbPixel) { m_pixelScrolling = nbPixel; }; /** * @brief Specify the mode of scrolling for this windows * @param[in] newMode the selected mode for the scrolling... diff --git a/Sources/libewol/ewol/widgetMeta/ColorChooser.cpp b/Sources/libewol/ewol/widgetMeta/ColorChooser.cpp index cc87b84d..410bc96a 100644 --- a/Sources/libewol/ewol/widgetMeta/ColorChooser.cpp +++ b/Sources/libewol/ewol/widgetMeta/ColorChooser.cpp @@ -202,7 +202,7 @@ void ewol::ColorChooser::OnReceiveMessage(ewol::EObject * CallerObject, const ch //EWOL_INFO("Receive Extern Event ... : widgetPointer=" << CallerObject << "\"" << eventId << "\" ==> data=\"" << data << "\"" ); if (eventColorBarHasChange == eventId) { //==> colorBar has change ... - etkFloat_t tmpAlpha = m_currentColor.alpha; + float tmpAlpha = m_currentColor.alpha; // the colorbar has no notion of the alpha ==> keep it ... if (NULL != m_widgetColorBar) { m_currentColor = m_widgetColorBar->GetCurrentColor(); diff --git a/Sources/libewol/ewol/widgetMeta/FileChooser.cpp b/Sources/libewol/ewol/widgetMeta/FileChooser.cpp index fa94a803..0abf30e5 100644 --- a/Sources/libewol/ewol/widgetMeta/FileChooser.cpp +++ b/Sources/libewol/ewol/widgetMeta/FileChooser.cpp @@ -160,7 +160,7 @@ class FileChooserFolderList : public ewol::List return true; }; - bool OnItemEvent(int32_t IdInput, ewol::eventInputType_te typeEvent, int32_t colomn, int32_t raw, etkFloat_t x, etkFloat_t y) { + bool OnItemEvent(int32_t IdInput, ewol::eventInputType_te typeEvent, int32_t colomn, int32_t raw, float x, float y) { if (typeEvent == ewol::EVENT_INPUT_TYPE_SINGLE) { EWOL_INFO("Event on List : IdInput=" << IdInput << " colomn=" << colomn << " raw=" << raw ); if (1 == IdInput) { @@ -326,7 +326,7 @@ class FileChooserFileList : public ewol::List return true; }; - bool OnItemEvent(int32_t IdInput, ewol::eventInputType_te typeEvent, int32_t colomn, int32_t raw, etkFloat_t x, etkFloat_t y) { + bool OnItemEvent(int32_t IdInput, ewol::eventInputType_te typeEvent, int32_t colomn, int32_t raw, float x, float y) { if (typeEvent == ewol::EVENT_INPUT_TYPE_SINGLE) { EWOL_INFO("Event on List : IdInput=" << IdInput << " colomn=" << colomn << " raw=" << raw ); if (1 == IdInput) { diff --git a/Sources/libewol/ewol/widgetMeta/StdPopUp.cpp b/Sources/libewol/ewol/widgetMeta/StdPopUp.cpp index f17bade5..6fd1487f 100644 --- a/Sources/libewol/ewol/widgetMeta/StdPopUp.cpp +++ b/Sources/libewol/ewol/widgetMeta/StdPopUp.cpp @@ -201,7 +201,7 @@ void ewol::StdPopUp::SetFolder(etk::UString folder) -bool ewol::StdPopUp::OnEventAreaExternal(int32_t widgetID, const char * generateEventId, const char * eventExternId, etkFloat_t x, etkFloat_t y) +bool ewol::StdPopUp::OnEventAreaExternal(int32_t widgetID, const char * generateEventId, const char * eventExternId, float x, float y) { EWOL_INFO("Receive Event from the BT ... : widgetid=" << widgetID << "\"" << generateEventId << "\" ==> internalEvent=\"" << eventExternId << "\"" ); if (ewolEventFileChooserCancel == eventExternId) { @@ -209,4 +209,4 @@ bool ewol::StdPopUp::OnEventAreaExternal(int32_t widgetID, const char * generate } return GenEventInputExternal(eventExternId, x, y); -}; \ No newline at end of file +}; diff --git a/Sources/libewol/ewol/widgetMeta/StdPopUp.h b/Sources/libewol/ewol/widgetMeta/StdPopUp.h index b687b91e..2fa34c3c 100644 --- a/Sources/libewol/ewol/widgetMeta/StdPopUp.h +++ b/Sources/libewol/ewol/widgetMeta/StdPopUp.h @@ -59,7 +59,7 @@ namespace ewol { * @return true if the object is compatible, otherwise false */ virtual const char * const GetObjectType(void); - virtual bool OnEventAreaExternal(int32_t widgetID, const char * generateEventId, const char * eventExternId, etkFloat_t x, etkFloat_t y); + virtual bool OnEventAreaExternal(int32_t widgetID, const char * generateEventId, const char * eventExternId, float x, float y); void SetTitle(etk::UString text); void SetComment(etk::UString text); void SetButtonLabel(int32_t btId, etk::UString text); // note : if no label no bt... diff --git a/Sources/libparsersvg/parserSVG/Base.cpp b/Sources/libparsersvg/parserSVG/Base.cpp index c7bbda6a..2339e86f 100644 --- a/Sources/libparsersvg/parserSVG/Base.cpp +++ b/Sources/libparsersvg/parserSVG/Base.cpp @@ -140,14 +140,14 @@ void svg::Base::ParsePosition(const TiXmlNode *node, Vector2D &pos, Vecto * @param[in] dataInput Data C String with the printed lenght * @return standart number of pixels */ -etkFloat_t svg::Base::ParseLength(const char *dataInput) +float svg::Base::ParseLength(const char *dataInput) { int32_t numLength = strspn(dataInput, "0123456789+-."); const char *unit = dataInput + numLength; //SVG_INFO(" ==> \"" << dataInput << "\""); - etkFloat_t n = atof(dataInput); + float n = atof(dataInput); //SVG_INFO(" ==> ?? = " << n ); - etkFloat_t font_size = 20.0; + float font_size = 20.0; // note : ";" is for the parsing of the style elements ... if (unit[0] == '\0' || unit[0] == ';' ) { @@ -238,20 +238,20 @@ void svg::Base::ParsePaintAttr(const TiXmlNode *node) } content = node->ToElement()->Attribute("opacity"); if (NULL != content) { - etkFloat_t opacity = ParseLength(content); + float opacity = ParseLength(content); opacity = etk_max(0.0, etk_min(1.0, opacity)); m_paint.fill.alpha = opacity*0xFF; m_paint.stroke.alpha = opacity*0xFF; } content = node->ToElement()->Attribute("fill-opacity"); if (NULL != content) { - etkFloat_t opacity = ParseLength(content); + float opacity = ParseLength(content); opacity = etk_max(0.0, etk_min(1.0, opacity)); m_paint.fill.alpha = opacity*0xFF; } content = node->ToElement()->Attribute("stroke-opacity"); if (NULL != content) { - etkFloat_t opacity = ParseLength(content); + float opacity = ParseLength(content); opacity = etk_max(0.0, etk_min(1.0, opacity)); m_paint.stroke.alpha = opacity*0xFF; } @@ -316,18 +316,18 @@ void svg::Base::ParsePaintAttr(const TiXmlNode *node) m_paint.strokeWidth = ParseLength(outputValue); SVG_VERBOSE(" input : \"" << outputValue << "\" ==> " << m_paint.strokeWidth); } else if (0 == strcmp(outputType, "opacity") ) { - etkFloat_t opacity = ParseLength(outputValue); + float opacity = ParseLength(outputValue); opacity = etk_max(0.0, etk_min(1.0, opacity)); m_paint.fill.alpha = opacity*0xFF; m_paint.stroke.alpha = opacity*0xFF; SVG_VERBOSE(" input : \"" << outputValue << "\" ==> " << m_paint.fill); } else if (0 == strcmp(outputType, "fill-opacity") ) { - etkFloat_t opacity = ParseLength(outputValue); + float opacity = ParseLength(outputValue); opacity = etk_max(0.0, etk_min(1.0, opacity)); m_paint.fill.alpha = opacity*0xFF; SVG_VERBOSE(" input : \"" << outputValue << "\" ==> " << m_paint.fill); } else if (0 == strcmp(outputType, "stroke-opacity") ) { - etkFloat_t opacity = ParseLength(outputValue); + float opacity = ParseLength(outputValue); opacity = etk_max(0.0, etk_min(1.0, opacity)); m_paint.stroke.alpha = opacity*0xFF; SVG_VERBOSE(" input : \"" << outputValue << "\" ==> " << m_paint.stroke); diff --git a/Sources/libparsersvg/parserSVG/Base.h b/Sources/libparsersvg/parserSVG/Base.h index 61aa8f05..c241b5e5 100644 --- a/Sources/libparsersvg/parserSVG/Base.h +++ b/Sources/libparsersvg/parserSVG/Base.h @@ -61,7 +61,7 @@ namespace svg virtual void Display(int32_t spacing) { }; void ParseTransform(TiXmlNode *node); void ParsePosition(const TiXmlNode *node, Vector2D &pos, Vector2D &size); - etkFloat_t ParseLength(const char *dataInput); + float ParseLength(const char *dataInput); void ParsePaintAttr(const TiXmlNode *node); color_ts ParseColor(const char *inputData); };