Move to standard type :float, Vector2D<float> ...
This commit is contained in:
parent
ba09b090a9
commit
261d88ff37
@ -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);
|
||||
|
@ -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);
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -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 <etk/TypesCoordonate.h>
|
||||
|
||||
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;
|
||||
|
@ -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 <typename T> class Vector2D
|
||||
{
|
||||
@ -468,7 +42,6 @@ template <typename T> class Vector2D
|
||||
Vector2D(const Vector2D<double>& obj) : x((T)obj.x), y((T)obj.y) { };
|
||||
Vector2D(const Vector2D<float>& obj) : x((T)obj.x), y((T)obj.y) { };
|
||||
Vector2D(const Vector2D<int32_t>& obj) : x((T)obj.x), y((T)obj.y) { };
|
||||
// Vector2D(const Vector2D<oglt>& obj) : x((T)obj.x), y((T)obj.y) { };
|
||||
~Vector2D(void) { };
|
||||
/*****************************************************
|
||||
* = assigment
|
||||
@ -613,7 +186,6 @@ template <typename T> class Vector3D
|
||||
Vector3D(const Vector3D<double>& obj) : x((T)obj.x), y((T)obj.y), z((T)obj.z) { };
|
||||
Vector3D(const Vector3D<float>& obj) : x((T)obj.x), y((T)obj.y), z((T)obj.z) { };
|
||||
Vector3D(const Vector3D<int32_t>& obj) : x((T)obj.x), y((T)obj.y), z((T)obj.z) { };
|
||||
// Vector3D(const Vector3D<oglt>& obj) : x((T)obj.x), y((T)obj.y), z((T)obj.z) { };
|
||||
~Vector3D(void) { };
|
||||
/*****************************************************
|
||||
* = assigment
|
||||
|
@ -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)
|
||||
{
|
||||
|
||||
}
|
||||
|
@ -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);
|
||||
|
@ -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<tmpHeight) {
|
||||
@ -571,13 +571,13 @@ void ewol::UnloadFont(int32_t id)
|
||||
EWOL_TODO("I do not think it was a good idea... will be done later");
|
||||
}
|
||||
|
||||
int32_t ewol::DrawText(int32_t fontID,
|
||||
Vector2D<float> textPos,
|
||||
clipping_ts & drawClipping,
|
||||
const etk::UString& unicodeString,
|
||||
int32_t & fontTextureId,
|
||||
etk::VectorType<Vector2D<float>> & coord,
|
||||
etk::VectorType<texCoord_ts> & coordTex)
|
||||
int32_t ewol::DrawText(int32_t fontID,
|
||||
Vector2D<float> textPos,
|
||||
clipping_ts & drawClipping,
|
||||
const etk::UString& unicodeString,
|
||||
int32_t & fontTextureId,
|
||||
etk::VectorType<Vector2D<float> > & coord,
|
||||
etk::VectorType<texCoord_ts> & 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<unicodeString.Size(); iii++) {
|
||||
uniChar_t tmpChar = unicodeString[iii];
|
||||
@ -615,15 +615,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
|
||||
@ -634,41 +634,41 @@ 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;
|
||||
}
|
||||
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<float> textPos,
|
||||
clipping_ts & drawClipping,
|
||||
const uniChar_t unicodeChar,
|
||||
int32_t & fontTextureId,
|
||||
etk::VectorType<Vector2D<float>> & coord,
|
||||
etk::VectorType<texCoord_ts> & coordTex)
|
||||
int32_t ewol::DrawText(int32_t fontID,
|
||||
Vector2D<float> textPos,
|
||||
clipping_ts & drawClipping,
|
||||
const uniChar_t unicodeChar,
|
||||
int32_t & fontTextureId,
|
||||
etk::VectorType<Vector2D<float> > & coord,
|
||||
etk::VectorType<texCoord_ts> & 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<float> textPos,
|
||||
const etk::UString& unicodeString,
|
||||
int32_t & fontTextureId,
|
||||
etk::VectorType<Vector2D<float>> & coord,
|
||||
etk::VectorType<texCoord_ts> & coordTex)
|
||||
int32_t ewol::DrawText(int32_t fontID,
|
||||
Vector2D<float> textPos,
|
||||
const etk::UString& unicodeString,
|
||||
int32_t & fontTextureId,
|
||||
etk::VectorType<Vector2D<float> > & coord,
|
||||
etk::VectorType<texCoord_ts> & 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<unicodeString.Size(); iii++) {
|
||||
uniChar_t tmpChar = unicodeString[iii];
|
||||
@ -949,15 +949,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
|
||||
@ -1040,12 +1040,12 @@ int32_t ewol::DrawText(int32_t fontID,
|
||||
}
|
||||
|
||||
// TODO : Simplify this ...
|
||||
int32_t ewol::DrawText(int32_t fontID,
|
||||
int32_t ewol::DrawText(int32_t fontID,
|
||||
Vector2D<float> textPos,
|
||||
const uniChar_t unicodeChar,
|
||||
int32_t & fontTextureId,
|
||||
etk::VectorType<Vector2D<float>> & coord,
|
||||
etk::VectorType<texCoord_ts> & coordTex)
|
||||
const uniChar_t unicodeChar,
|
||||
int32_t & fontTextureId,
|
||||
etk::VectorType<Vector2D<float> > & coord,
|
||||
etk::VectorType<texCoord_ts> & 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<freeTypeFontElement_ts> & listOfElement = m_listLoadedFont[fontID]->GetRefOnElement();
|
||||
|
||||
etkFloat_t posDrawX = 0.0;
|
||||
float posDrawX = 0.0;
|
||||
for(int32_t iii=0; iii<unicodeString.Size(); iii++) {
|
||||
uniChar_t tmpChar = unicodeString[iii];
|
||||
int32_t charIndex;
|
||||
|
@ -84,10 +84,10 @@ int32_t ewol::GameElement::LoadSprite(etk::VectorType<ewol::Sprite*> listOfEleme
|
||||
}
|
||||
|
||||
|
||||
etkFloat_t quadDist(Vector2D<float> pos1, Vector2D<float> pos2)
|
||||
float quadDist(Vector2D<float> pos1, Vector2D<float> 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<float> position, etkFloat_t size)
|
||||
bool ewol::GameElement::HaveImpact(int32_t group, int32_t type, Vector2D<float> 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;
|
||||
|
@ -48,11 +48,11 @@ namespace ewol {
|
||||
bool m_visible;
|
||||
Vector2D<float> m_position;
|
||||
Vector2D<float> 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<float> PositionGet(void) { return m_position; };
|
||||
void PositionSet(Vector2D<float> 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<float> SpeedGet(void) { return m_speed; };
|
||||
void SpeedSet(Vector2D<float> 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<float> position, etkFloat_t size);
|
||||
virtual bool Explosion(int32_t group, int32_t type, Vector2D<float> position, etkFloat_t pxAtenuation, etkFloat_t power) { return false; } ;
|
||||
virtual bool HaveImpact(int32_t group, int32_t type, Vector2D<float> position, float size);
|
||||
virtual bool Explosion(int32_t group, int32_t type, Vector2D<float> 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 <ewol/widget/Scene.h>
|
||||
|
||||
etkFloat_t quadDist(Vector2D<float> pos1, Vector2D<float> pos2);
|
||||
float quadDist(Vector2D<float> pos1, Vector2D<float> pos2);
|
||||
|
||||
#endif
|
||||
|
@ -106,28 +106,28 @@ template <typename T> class LuaValue
|
||||
|
||||
|
||||
/*
|
||||
template <> int lua_Set<etkFloat_t>(lua_State* L)
|
||||
template <> int lua_Set<float>(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<etkFloat_t>(lua_State* L)
|
||||
template <> int lua_Get<float>(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<ewol::Sprite*> & listOfSprite, e
|
||||
}
|
||||
|
||||
|
||||
bool ewol::GameElementLua::HaveImpact(int32_t group, int32_t type, Vector2D<float> position, etkFloat_t size)
|
||||
bool ewol::GameElementLua::HaveImpact(int32_t group, int32_t type, Vector2D<float> 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<floa
|
||||
lua_pushnumber(m_luaState, position.x);
|
||||
lua_pushnumber(m_luaState, position.y);
|
||||
lua_pushnumber(m_luaState, size);
|
||||
etkFloat_t quadDistance = quadDist(m_position, position);
|
||||
float quadDistance = quadDist(m_position, position);
|
||||
lua_pushnumber(m_luaState, quadDistance);
|
||||
// do the call (6 arguments, 1 result)
|
||||
if (lua_pcall(m_luaState, 6, 1, 0) != 0) {
|
||||
@ -870,7 +870,7 @@ bool ewol::GameElementLua::HaveImpact(int32_t group, int32_t type, Vector2D<floa
|
||||
}
|
||||
|
||||
|
||||
bool ewol::GameElementLua::Explosion(int32_t group, int32_t type, Vector2D<float> position, etkFloat_t pxAtenuation, etkFloat_t power)
|
||||
bool ewol::GameElementLua::Explosion(int32_t group, int32_t type, Vector2D<float> 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<float
|
||||
lua_pushnumber(m_luaState, position.y);
|
||||
lua_pushnumber(m_luaState, pxAtenuation);
|
||||
lua_pushnumber(m_luaState, power);
|
||||
etkFloat_t quadDistance = quadDist(m_position, position);
|
||||
float quadDistance = quadDist(m_position, position);
|
||||
lua_pushnumber(m_luaState, quadDistance);
|
||||
// do the call (7 arguments, 1 result)
|
||||
if (lua_pcall(m_luaState, 7, 1, 0) != 0) {
|
||||
|
@ -47,8 +47,8 @@ namespace ewol {
|
||||
virtual void UnInit(void);
|
||||
virtual bool Process(int64_t time, int32_t deltaTime);
|
||||
virtual void Draw(etk::VectorType<ewol::Sprite*> & listOfSprite, etk::VectorType<ewol::Sprite*> & listOfEffects);
|
||||
virtual bool HaveImpact(int32_t group, int32_t type, Vector2D<float> position, etkFloat_t size);
|
||||
virtual bool Explosion(int32_t group, int32_t type, Vector2D<float> position, etkFloat_t pxAtenuation, etkFloat_t power);
|
||||
virtual bool HaveImpact(int32_t group, int32_t type, Vector2D<float> position, float size);
|
||||
virtual bool Explosion(int32_t group, int32_t type, Vector2D<float> position, float pxAtenuation, float power);
|
||||
virtual void Message(etk::UString control, etk::UString message);
|
||||
};
|
||||
void RegisterLuaElementInFolder(ewol::SceneElement & sceneElement, etk::UString folder);
|
||||
|
@ -235,7 +235,7 @@ ewol::GameElement* ewol::SceneElement::GetElement(uint32_t idElement)
|
||||
uint32_t ewol::SceneElement::GetNearestEnemy(Vector2D<float> 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<float> position, int32_t g
|
||||
if (NULL != listAnimatedElements[groupEnemy[groupId][jjj]][iii]) {
|
||||
if (true == listAnimatedElements[groupEnemy[groupId][jjj]][iii]->CanBeCibledGet()) {
|
||||
Vector2D<float> 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<float> position, int32_t g
|
||||
}
|
||||
|
||||
|
||||
bool ewol::SceneElement::HaveImpact(int32_t group, int32_t type, Vector2D<float> position, etkFloat_t size)
|
||||
bool ewol::SceneElement::HaveImpact(int32_t group, int32_t type, Vector2D<float> position, float size)
|
||||
{
|
||||
for (int32_t jjj=0; jjj<MAX_GROUP_NUMBER; jjj++) {
|
||||
if (group != jjj) {
|
||||
@ -276,7 +276,7 @@ bool ewol::SceneElement::HaveImpact(int32_t group, int32_t type, Vector2D<float>
|
||||
return false;
|
||||
}
|
||||
|
||||
void ewol::SceneElement::Explosion(int32_t group, int32_t type, Vector2D<float> position, etkFloat_t pxAtenuation, etkFloat_t power)
|
||||
void ewol::SceneElement::Explosion(int32_t group, int32_t type, Vector2D<float> position, float pxAtenuation, float power)
|
||||
{
|
||||
for (int32_t jjj=0; jjj<MAX_GROUP_NUMBER; jjj++) {
|
||||
for (int32_t iii=0; iii<listAnimatedElements[jjj].Size(); iii++) {
|
||||
@ -293,12 +293,12 @@ void ewol::SceneElement::Explosion(int32_t group, int32_t type, Vector2D<float>
|
||||
uint32_t ewol::SceneElement::GetElementAtPos(Vector2D<float> position, int32_t maxDistanceDetection)
|
||||
{
|
||||
uint32_t result = 0;
|
||||
etkFloat_t lastQuadDistance = 9999999999999999.0;
|
||||
float lastQuadDistance = 9999999999999999.0;
|
||||
for (int32_t jjj=0; jjj<MAX_GROUP_NUMBER; jjj++) {
|
||||
for (int32_t iii=0; iii<listAnimatedElements[jjj].Size(); iii++) {
|
||||
if (NULL != listAnimatedElements[jjj][iii]) {
|
||||
Vector2D<float> 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 ...");
|
||||
}
|
||||
|
@ -40,7 +40,7 @@ namespace ewol {
|
||||
Vector2D<float> position; //!< current position
|
||||
Vector2D<float> speed; //!< current speed
|
||||
Vector2D<float> 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<float> position, int32_t groupId);
|
||||
bool HaveImpact(int32_t group, int32_t type, Vector2D<float> position, etkFloat_t size);
|
||||
void Explosion(int32_t group, int32_t type, Vector2D<float> position, etkFloat_t pxAtenuation, etkFloat_t power);
|
||||
bool HaveImpact(int32_t group, int32_t type, Vector2D<float> position, float size);
|
||||
void Explosion(int32_t group, int32_t type, Vector2D<float> position, float pxAtenuation, float power);
|
||||
uint32_t GetElementAtPos(Vector2D<float> position, int32_t maxDistanceDetection);
|
||||
void SetEventInput(uint32_t id, Vector2D<float> 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);
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -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<Coord2D<oglt> > & input, etk::VectorType<Coord2D<oglt> > & output )
|
||||
void generatePolyGone(etk::VectorType<Vector2D<float> > & input, etk::VectorType<Vector2D<float> > & output )
|
||||
{
|
||||
if (input.Size()<3) {
|
||||
return;
|
||||
@ -94,7 +94,7 @@ void generatePolyGone(etk::VectorType<Coord2D<oglt> > & input, etk::VectorType<C
|
||||
//EWOL_DEBUG("generate Plygone : " << input.Size() << " ==> " << output.Size() );
|
||||
}
|
||||
|
||||
void SutherlandHodgman(etk::VectorType<Coord2D<oglt> > & input, etk::VectorType<Coord2D<oglt> > & output, etkFloat_t sx, etkFloat_t sy, etkFloat_t ex, etkFloat_t ey)
|
||||
void SutherlandHodgman(etk::VectorType<Vector2D<float> > & input, etk::VectorType<Vector2D<float> > & 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<Coord2D<oglt> > & input, etk::VectorType<
|
||||
}
|
||||
//int32_t sizeInit=input.Size();
|
||||
// last element :
|
||||
Coord2D<oglt> destPoint;
|
||||
Coord2D<oglt> lastElement = input[input.Size()-1];
|
||||
Vector2D<float> destPoint;
|
||||
Vector2D<float> lastElement = input[input.Size()-1];
|
||||
bool inside = true;
|
||||
if (lastElement.x < sx) {
|
||||
inside = false;
|
||||
@ -115,8 +115,8 @@ void SutherlandHodgman(etk::VectorType<Coord2D<oglt> > & 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<Coord2D<oglt> > & 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<Coord2D<oglt> > & 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<Coord2D<oglt> > & 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<Coord2D<oglt> > & 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<Coord2D<oglt> > & 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<Coord2D<oglt> > & 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<Coord2D<oglt> > & 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<float> point)
|
||||
{
|
||||
// TODO : Clean this :
|
||||
Coord2D<oglt> tmpElement;
|
||||
Vector2D<float> tmpElement;
|
||||
tmpElement.x = point.x;
|
||||
tmpElement.y = point.y;
|
||||
m_triangle[m_triElement] = tmpElement;
|
||||
@ -348,7 +348,7 @@ void ewol::OObject2DColored::SetPoint(Vector2D<float> 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<nbOcurence; iii++) {
|
||||
|
||||
etkFloat_t angleOne = 2*M_PI* iii / nbOcurence ;
|
||||
etkFloat_t offsetExty = sin(angleOne) * (radius+thickness/2);
|
||||
etkFloat_t offsetExtx = cos(angleOne) * (radius+thickness/2);
|
||||
etkFloat_t offsetInty = sin(angleOne) * (radius-thickness/2);
|
||||
etkFloat_t offsetIntx = cos(angleOne) * (radius-thickness/2);
|
||||
float angleOne = 2*M_PI* iii / nbOcurence ;
|
||||
float offsetExty = sin(angleOne) * (radius+thickness/2);
|
||||
float offsetExtx = cos(angleOne) * (radius+thickness/2);
|
||||
float offsetInty = sin(angleOne) * (radius-thickness/2);
|
||||
float offsetIntx = cos(angleOne) * (radius-thickness/2);
|
||||
|
||||
etkFloat_t angleTwo = 2*M_PI* (iii+1) / nbOcurence ;
|
||||
etkFloat_t offsetExt2y = sin(angleTwo) * (radius+thickness/2);
|
||||
etkFloat_t offsetExt2x = cos(angleTwo) * (radius+thickness/2);
|
||||
etkFloat_t offsetInt2y = sin(angleTwo) * (radius-thickness/2);
|
||||
etkFloat_t offsetInt2x = cos(angleTwo) * (radius-thickness/2);
|
||||
float angleTwo = 2*M_PI* (iii+1) / nbOcurence ;
|
||||
float offsetExt2y = sin(angleTwo) * (radius+thickness/2);
|
||||
float offsetExt2x = cos(angleTwo) * (radius+thickness/2);
|
||||
float offsetInt2y = sin(angleTwo) * (radius-thickness/2);
|
||||
float offsetInt2x = cos(angleTwo) * (radius-thickness/2);
|
||||
|
||||
SetPoint(x + offsetIntx, y + offsetInty);
|
||||
SetPoint(x + offsetExtx, y + offsetExty);
|
||||
@ -488,7 +488,7 @@ void ewol::OObject2DColored::Circle(etkFloat_t x, etkFloat_t y, etkFloat_t radiu
|
||||
}
|
||||
}
|
||||
|
||||
void ewol::OObject2DColored::CirclePart(etkFloat_t x, etkFloat_t y, etkFloat_t radius, etkFloat_t thickness, etkFloat_t angleStart, etkFloat_t angleStop)
|
||||
void ewol::OObject2DColored::CirclePart(float x, float y, float radius, float thickness, float angleStart, float angleStop)
|
||||
{
|
||||
ResetCount();
|
||||
if (radius<0) {
|
||||
@ -500,9 +500,9 @@ void ewol::OObject2DColored::CirclePart(etkFloat_t x, etkFloat_t y, etkFloat_t r
|
||||
|
||||
angleStart -= 90;
|
||||
angleStop -= 90;
|
||||
etkFloat_t AStart = angleStart * (M_PI)/180;
|
||||
//etkFloat_t AStop = angleStop * (M_PI)/180;
|
||||
etkFloat_t angleLinear = (angleStop-angleStart)* (M_PI)/180;
|
||||
float AStart = angleStart * (M_PI)/180;
|
||||
//float AStop = angleStop * (M_PI)/180;
|
||||
float angleLinear = (angleStop-angleStart)* (M_PI)/180;
|
||||
|
||||
int32_t nbOcurence = radius;
|
||||
if (nbOcurence < 10)
|
||||
@ -511,17 +511,17 @@ void ewol::OObject2DColored::CirclePart(etkFloat_t x, etkFloat_t y, etkFloat_t r
|
||||
}
|
||||
for (int32_t iii=0; iii<nbOcurence; iii++) {
|
||||
|
||||
etkFloat_t angleOne = AStart + (angleLinear* iii / nbOcurence) ;
|
||||
etkFloat_t offsetExty = sin(angleOne) * (radius+thickness/2);
|
||||
etkFloat_t offsetExtx = cos(angleOne) * (radius+thickness/2);
|
||||
etkFloat_t offsetInty = sin(angleOne) * (radius-thickness/2);
|
||||
etkFloat_t offsetIntx = cos(angleOne) * (radius-thickness/2);
|
||||
float angleOne = AStart + (angleLinear* iii / nbOcurence) ;
|
||||
float offsetExty = sin(angleOne) * (radius+thickness/2);
|
||||
float offsetExtx = cos(angleOne) * (radius+thickness/2);
|
||||
float offsetInty = sin(angleOne) * (radius-thickness/2);
|
||||
float offsetIntx = cos(angleOne) * (radius-thickness/2);
|
||||
|
||||
etkFloat_t angleTwo = AStart + (angleLinear* (iii+1) / nbOcurence );
|
||||
etkFloat_t offsetExt2y = sin(angleTwo) * (radius+thickness/2);
|
||||
etkFloat_t offsetExt2x = cos(angleTwo) * (radius+thickness/2);
|
||||
etkFloat_t offsetInt2y = sin(angleTwo) * (radius-thickness/2);
|
||||
etkFloat_t offsetInt2x = cos(angleTwo) * (radius-thickness/2);
|
||||
float angleTwo = AStart + (angleLinear* (iii+1) / nbOcurence );
|
||||
float offsetExt2y = sin(angleTwo) * (radius+thickness/2);
|
||||
float offsetExt2x = cos(angleTwo) * (radius+thickness/2);
|
||||
float offsetInt2y = sin(angleTwo) * (radius-thickness/2);
|
||||
float offsetInt2x = cos(angleTwo) * (radius-thickness/2);
|
||||
|
||||
SetPoint(x + offsetIntx, y + offsetInty);
|
||||
SetPoint(x + offsetExtx, y + offsetExty);
|
||||
@ -533,7 +533,7 @@ void ewol::OObject2DColored::CirclePart(etkFloat_t x, etkFloat_t y, etkFloat_t r
|
||||
}
|
||||
}
|
||||
|
||||
void ewol::OObject2DColored::Disc(etkFloat_t x, etkFloat_t y, etkFloat_t radius)
|
||||
void ewol::OObject2DColored::Disc(float x, float y, float radius)
|
||||
{
|
||||
ResetCount();
|
||||
if (radius<0) {
|
||||
@ -549,13 +549,13 @@ void ewol::OObject2DColored::Disc(etkFloat_t x, etkFloat_t y, etkFloat_t radius)
|
||||
for (int32_t iii=0; iii<nbOcurence; iii++) {
|
||||
SetPoint(x, y);
|
||||
|
||||
etkFloat_t angleOne = 2*M_PI* iii / nbOcurence ;
|
||||
etkFloat_t offsety = sin(angleOne) * radius;
|
||||
etkFloat_t offsetx = cos(angleOne) * radius;
|
||||
float angleOne = 2*M_PI* iii / nbOcurence ;
|
||||
float offsety = sin(angleOne) * radius;
|
||||
float offsetx = cos(angleOne) * radius;
|
||||
|
||||
SetPoint(x + offsetx, y + offsety);
|
||||
|
||||
etkFloat_t angleTwo = 2*M_PI* (iii+1) / nbOcurence ;
|
||||
float angleTwo = 2*M_PI* (iii+1) / nbOcurence ;
|
||||
offsety = sin(angleTwo) * radius;
|
||||
offsetx = cos(angleTwo) * radius;
|
||||
|
||||
@ -563,7 +563,7 @@ void ewol::OObject2DColored::Disc(etkFloat_t x, etkFloat_t y, etkFloat_t radius)
|
||||
}
|
||||
}
|
||||
|
||||
void ewol::OObject2DColored::DiscPart(etkFloat_t x, etkFloat_t y, etkFloat_t radius, etkFloat_t angleStart, etkFloat_t angleStop)
|
||||
void ewol::OObject2DColored::DiscPart(float x, float y, float radius, float angleStart, float angleStop)
|
||||
{
|
||||
ResetCount();
|
||||
if (radius<0) {
|
||||
@ -571,9 +571,9 @@ void ewol::OObject2DColored::DiscPart(etkFloat_t x, etkFloat_t y, etkFloat_t rad
|
||||
}
|
||||
angleStart -= 90;
|
||||
angleStop -= 90;
|
||||
etkFloat_t AStart = angleStart * (M_PI)/180;
|
||||
//etkFloat_t AStop = angleStop * (M_PI)/180;
|
||||
etkFloat_t angleLinear = (angleStop-angleStart)* (M_PI)/180;
|
||||
float AStart = angleStart * (M_PI)/180;
|
||||
//float AStop = angleStop * (M_PI)/180;
|
||||
float angleLinear = (angleStop-angleStart)* (M_PI)/180;
|
||||
//EWOL_DEBUG("Write a part of disk " << angleStart << " -> " << 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<nbOcurence; iii++) {
|
||||
SetPoint(x, y);
|
||||
|
||||
etkFloat_t angleOne = AStart + (angleLinear* iii / nbOcurence) ;
|
||||
etkFloat_t offsety = sin(angleOne) * radius;
|
||||
etkFloat_t offsetx = cos(angleOne) * radius;
|
||||
float angleOne = AStart + (angleLinear* iii / nbOcurence) ;
|
||||
float offsety = sin(angleOne) * radius;
|
||||
float offsetx = cos(angleOne) * radius;
|
||||
|
||||
SetPoint(x + offsetx, y + offsety);
|
||||
|
||||
etkFloat_t angleTwo = AStart + (angleLinear* (iii+1) / nbOcurence) ;
|
||||
float angleTwo = AStart + (angleLinear* (iii+1) / nbOcurence) ;
|
||||
offsety = sin(angleTwo) * radius;
|
||||
offsetx = cos(angleTwo) * radius;
|
||||
|
||||
|
@ -36,27 +36,27 @@ namespace ewol {
|
||||
public:
|
||||
virtual void Draw(void);
|
||||
protected:
|
||||
etk::VectorType<Coord2D<oglt> > m_coord; //!< internal coord of the object
|
||||
etk::VectorType<color_ts> m_coordColor; //!< internal color of the different point
|
||||
etk::VectorType<Vector2D<float> > m_coord; //!< internal coord of the object
|
||||
etk::VectorType<color_ts> m_coordColor; //!< internal color of the different point
|
||||
//etk::VectorType<linkCoord_ts> m_linkCoord; //!< internal link between point to generate triangle
|
||||
int32_t m_triElement;
|
||||
color_ts m_color[3];
|
||||
Coord2D<oglt> m_triangle[3];
|
||||
int32_t m_triElement;
|
||||
color_ts m_color[3];
|
||||
Vector2D<float> 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<float> 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);
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -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
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
|
@ -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<float> point;
|
||||
|
@ -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<Vector2D<float> > m_coord; //!< internal coord of the object
|
||||
|
@ -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<float> pos, etkFloat_t size, etkFloat_t angle)
|
||||
void ewol::Sprite::Element(Vector2D<float> pos, float size, float angle)
|
||||
{
|
||||
angle -= M_PI/4;
|
||||
size *= 0.7;
|
||||
@ -99,8 +99,8 @@ void ewol::Sprite::Element(Vector2D<float> pos, etkFloat_t size, etkFloat_t angl
|
||||
texD.v = 0.0;
|
||||
|
||||
Vector2D<float> 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;
|
||||
|
@ -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<float> pos, etkFloat_t size, etkFloat_t angle);
|
||||
void Element(Vector2D<float> pos, float size, float angle);
|
||||
bool HasName(etk::UString& name) { return name == m_name; };
|
||||
protected:
|
||||
int32_t m_textureId; //!< texture internal ID
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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 ---
|
||||
|
@ -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;
|
||||
|
@ -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
|
||||
|
@ -36,8 +36,8 @@
|
||||
#include <ewol/base/MainThread.h>
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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 "";
|
||||
}
|
||||
}
|
||||
|
@ -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; iii<NB_MAX_INPUT ; iii++) {
|
||||
if (true == inputIsPressed[iii]) {
|
||||
EWOL_VERBOSE("X11 event: bt=" << iii << " " << event.type << " = \"MotionNotify\" (" << (etkFloat_t)event.xmotion.x << "," << (etkFloat_t)event.xmotion.y << ")");
|
||||
EWOL_VERBOSE("X11 event: bt=" << iii << " " << event.type << " = \"MotionNotify\" (" << (float)event.xmotion.x << "," << (float)event.xmotion.y << ")");
|
||||
EWOL_ThreadEventMouseMotion(iii, (float)event.xmotion.x, (float)event.xmotion.y);
|
||||
findOne = true;
|
||||
}
|
||||
}
|
||||
if (false == findOne) {
|
||||
EWOL_VERBOSE("X11 event: bt=" << 0 << " " << event.type << " = \"MotionNotify\" (" << (etkFloat_t)event.xmotion.x << "," << (etkFloat_t)event.xmotion.y << ")");
|
||||
EWOL_VERBOSE("X11 event: bt=" << 0 << " " << event.type << " = \"MotionNotify\" (" << (float)event.xmotion.x << "," << (float)event.xmotion.y << ")");
|
||||
EWOL_ThreadEventMouseMotion(0, (float)event.xmotion.x, (float)event.xmotion.y);
|
||||
}
|
||||
}
|
||||
|
@ -184,7 +184,7 @@ void ewol::ButtonImage::OnRegenerateDisplay(void)
|
||||
m_OOImageBG2[m_currentCreateId]->Rectangle(tmpOriginX, tmpOriginY, tmpSizeX, tmpSizeY);
|
||||
}
|
||||
}
|
||||
etkFloat_t tmpval = tmpSizeX * 0.2;
|
||||
float tmpval = tmpSizeX * 0.2;
|
||||
tmpSizeX -= tmpval;
|
||||
tmpOriginX += tmpval/2;
|
||||
tmpval = tmpSizeY * 0.2;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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)");
|
||||
}
|
||||
|
@ -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<float> m_padding;
|
||||
Vector2D<float> m_arrowPos;
|
||||
etkFloat_t m_offset;
|
||||
float m_offset;
|
||||
markPosition_te m_arrawBorder;
|
||||
ewol::Widget* m_subWidget[NB_BOUBLE_BUFFER];
|
||||
public:
|
||||
|
@ -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<float> 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;
|
||||
|
@ -44,8 +44,8 @@ namespace ewol {
|
||||
color_ts m_colorFg; //!< Forground color
|
||||
color_ts m_colorBg; //!< Background color
|
||||
Vector2D<float> 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
|
||||
|
@ -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)");
|
||||
}
|
||||
|
@ -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);
|
||||
|
@ -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:
|
||||
|
@ -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<float> pos)
|
||||
}
|
||||
|
||||
|
||||
void ewol::PopUp::SetDisplayRatio(etkFloat_t ratio)
|
||||
void ewol::PopUp::SetDisplayRatio(float ratio)
|
||||
{
|
||||
m_displayRatio = ratio;
|
||||
}
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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
|
||||
|
@ -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; iii<m_subWidget[m_currentCreateId].Size(); iii++) {
|
||||
@ -101,7 +101,7 @@ bool ewol::SizerHori::CalculateSize(etkFloat_t availlableX, etkFloat_t availlabl
|
||||
}
|
||||
}
|
||||
}
|
||||
etkFloat_t sizeToAddAtEveryOne = 0;
|
||||
float sizeToAddAtEveryOne = 0;
|
||||
// 2 cases : 1 or more can Expend, or all is done ...
|
||||
if (0 != nbWidgetNotFixedSize) {
|
||||
sizeToAddAtEveryOne = (m_size.x - unexpendableSize) / nbWidgetNotFixedSize;
|
||||
@ -161,7 +161,7 @@ bool ewol::SizerHori::CalculateMinSize(void)
|
||||
return true;
|
||||
}
|
||||
|
||||
void ewol::SizerHori::SetMinSise(etkFloat_t x, etkFloat_t y)
|
||||
void ewol::SizerHori::SetMinSise(float x, float y)
|
||||
{
|
||||
EWOL_ERROR("Sizer can not have a user Minimum size (herited from under elements)");
|
||||
}
|
||||
|
@ -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);
|
||||
|
@ -82,13 +82,13 @@ const char * const ewol::SizerVert::GetObjectType(void)
|
||||
|
||||
|
||||
|
||||
bool ewol::SizerVert::CalculateSize(etkFloat_t availlableX, etkFloat_t availlableY)
|
||||
bool ewol::SizerVert::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; iii<m_subWidget[m_currentCreateId].Size(); iii++) {
|
||||
@ -103,7 +103,7 @@ bool ewol::SizerVert::CalculateSize(etkFloat_t availlableX, etkFloat_t availlabl
|
||||
}
|
||||
}
|
||||
// 2 cases : 1 or more can Expend, or all is done ...
|
||||
etkFloat_t sizeToAddAtEveryOne = 0;
|
||||
float sizeToAddAtEveryOne = 0;
|
||||
// 2 cases : 1 or more can Expend, or all is done ...
|
||||
if (0 != nbWidgetNotFixedSize) {
|
||||
sizeToAddAtEveryOne = (m_size.y - unexpendableSize) / nbWidgetNotFixedSize;
|
||||
@ -164,7 +164,7 @@ bool ewol::SizerVert::CalculateMinSize(void)
|
||||
return true;
|
||||
}
|
||||
|
||||
void ewol::SizerVert::SetMinSise(etkFloat_t x, etkFloat_t y)
|
||||
void ewol::SizerVert::SetMinSise(float x, float y)
|
||||
{
|
||||
EWOL_ERROR("Sizer can not have a user Minimum size (herited from under elements)");
|
||||
}
|
||||
|
@ -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);
|
||||
|
@ -152,10 +152,10 @@ void ewol::Slider::OnRegenerateDisplay(void)
|
||||
color_ts borderDot = m_textColorFg;
|
||||
borderDot.alpha /= 2;
|
||||
tmpOObjects->SetColor(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 << "]");
|
||||
|
@ -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();
|
||||
|
@ -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<float> pos) { return NULL; };
|
||||
private:
|
||||
etkFloat_t m_size;
|
||||
float m_size;
|
||||
};
|
||||
|
||||
extern const char * const TYPE_EOBJECT_WIDGET_SPACER;
|
||||
|
@ -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)");
|
||||
}
|
||||
|
@ -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);
|
||||
|
@ -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) {
|
||||
|
@ -52,10 +52,10 @@ namespace ewol {
|
||||
protected:
|
||||
Vector2D<float> m_originScrooled;
|
||||
Vector2D<float> 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<float> 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...
|
||||
|
@ -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();
|
||||
|
@ -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) {
|
||||
|
@ -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);
|
||||
};
|
||||
};
|
||||
|
@ -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...
|
||||
|
@ -140,14 +140,14 @@ void svg::Base::ParsePosition(const TiXmlNode *node, Vector2D<float> &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);
|
||||
|
@ -61,7 +61,7 @@ namespace svg
|
||||
virtual void Display(int32_t spacing) { };
|
||||
void ParseTransform(TiXmlNode *node);
|
||||
void ParsePosition(const TiXmlNode *node, Vector2D<float> &pos, Vector2D<float> &size);
|
||||
etkFloat_t ParseLength(const char *dataInput);
|
||||
float ParseLength(const char *dataInput);
|
||||
void ParsePaintAttr(const TiXmlNode *node);
|
||||
color_ts ParseColor(const char *inputData);
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user