diff --git a/Sources/libewol/ewol/Game/GameElement.h b/Sources/libewol/ewol/Game/GameElement.h index 578b19dd..867c3611 100644 --- a/Sources/libewol/ewol/Game/GameElement.h +++ b/Sources/libewol/ewol/Game/GameElement.h @@ -134,7 +134,7 @@ namespace ewol { * @param[in,out] listOfEffects Reference on the list where the display must be done for every effects * @return --- */ - virtual void Draw(int32_t currentCreateId) { }; + virtual void Draw(void) { }; /** * @brief an element has been remove, just remove reference on it or ID on IT, it can be replace whith an other that have no link * @param[in] idOfElement Id of the element that has been removed diff --git a/Sources/libewol/ewol/Game/GameElementLua.cpp b/Sources/libewol/ewol/Game/GameElementLua.cpp index a779acef..f0f71a3a 100644 --- a/Sources/libewol/ewol/Game/GameElementLua.cpp +++ b/Sources/libewol/ewol/Game/GameElementLua.cpp @@ -787,10 +787,10 @@ bool ewol::GameElementLua::Process(int64_t time, int32_t deltaTime) } -void ewol::GameElementLua::Draw(int32_t currentCreateId) +void ewol::GameElementLua::Draw(void) { tmpObj = this; - tmpSprite = &m_sceneElement.animated[currentCreateId]; + tmpSprite = &m_sceneElement.animated; if (NULL != m_luaState) { // call the Draw function lua_getglobal(m_luaState, "Draw"); diff --git a/Sources/libewol/ewol/Game/GameElementLua.h b/Sources/libewol/ewol/Game/GameElementLua.h index 3d2af025..b73c94c1 100644 --- a/Sources/libewol/ewol/Game/GameElementLua.h +++ b/Sources/libewol/ewol/Game/GameElementLua.h @@ -46,7 +46,7 @@ namespace ewol { virtual void Init(void); virtual void UnInit(void); virtual bool Process(int64_t time, int32_t deltaTime); - virtual void Draw(int32_t currentCreateId); + virtual void Draw(void); virtual bool HaveImpact(int32_t group, int32_t type, Vector2D position, float size); virtual bool Explosion(int32_t group, int32_t type, Vector2D position, float pxAtenuation, float power); virtual void Message(etk::UString control, etk::UString message); diff --git a/Sources/libewol/ewol/Game/SceneElement.cpp b/Sources/libewol/ewol/Game/SceneElement.cpp index d2e14979..f3e3cd10 100644 --- a/Sources/libewol/ewol/Game/SceneElement.cpp +++ b/Sources/libewol/ewol/Game/SceneElement.cpp @@ -80,15 +80,13 @@ ewol::SceneElement::~SceneElement(void) } listAnimatedElements[iii].Clear(); } - for (int32_t iii=0; iiiHasName(fileName) == true) { + for (int32_t iii=0; iiiHasName(fileName) == true) { // count the number of element registered ... - animated[0][iii]->IncreaseLoadedTime(); + animated[iii]->IncreaseLoadedTime(); return iii; } } } - for(int32_t iii=0; iii created it ... - ewol::Sprite* tmpSprite = new ewol::Sprite(fileName, maxSize, maxSize); - if (NULL == tmpSprite) { - EWOL_ERROR("Allocation error on the sprite : " << fileName); - return -1; - } - // add it : - animated[iii].PushBack(tmpSprite); + // we did not find the sprite ==> created it ... + ewol::Sprite* tmpSprite = new ewol::Sprite(fileName, maxSize, maxSize); + if (NULL == tmpSprite) { + EWOL_ERROR("Allocation error on the sprite : " << fileName); + return -1; } - return animated[0].Size() -1; + // add it : + animated.PushBack(tmpSprite); + + return animated.Size() -1; } /** @@ -354,15 +351,13 @@ int32_t ewol::SceneElement::LoadSprite(etk::UString fileName, float maxSize) */ void ewol::SceneElement::UnLoadSprite(int32_t spriteId) { - if (spriteId >= 0 && spriteId < animated[0].Size()) { - if (animated[0][spriteId] != NULL) { + if (spriteId >= 0 && spriteId < animated.Size()) { + if (animated[spriteId] != NULL) { // count the number of element registered ... - if (true == animated[0][spriteId]->DecreaseLoadedTime() ) { + if (true == animated[spriteId]->DecreaseLoadedTime() ) { // must remove the sprite ==> pb with the double buffer ... - // TODO : ==> for all double buffer ... - for(int32_t iii=0; iii animated[NB_BOUBLE_BUFFER]; //!< element that must be display the second + etk::VectorType animated; //!< element that must be display the second etk::VectorType listAnimatedElements[MAX_GROUP_NUMBER]; //!< generic element to display order in the diffferent group etk::VectorType listGarbage; //!< garbage of the old element allocated ==> prevent multiple alloc and free etk::VectorType listCreatorElement; //!< list of all creatable elements diff --git a/Sources/libewol/ewol/Widget.cpp b/Sources/libewol/ewol/Widget.cpp index 7208e4ce..1f0cb31b 100644 --- a/Sources/libewol/ewol/Widget.cpp +++ b/Sources/libewol/ewol/Widget.cpp @@ -84,9 +84,6 @@ ewol::Widget::Widget(void) { m_limitMouseEvent = 3; m_needRegenerateDisplay = true; - m_currentDrawId = 0; - m_currentCreateId = 1; - m_needFlipFlop = true; m_origin.x = 0.0; m_origin.y = 0.0; m_size.x = 10.0; @@ -102,9 +99,7 @@ ewol::Widget::Widget(void) SetFillY(); m_canFocus = false; m_hasFocus = false; - for(int32_t iii=0 ; iii