correction of the compilation error

This commit is contained in:
Edouard Dupin 2012-04-28 10:20:13 +02:00
parent 9f258dcf7e
commit bf10f40b3e
3 changed files with 25 additions and 20 deletions

View File

@ -82,7 +82,7 @@ namespace ewol {
void GroupSet(int32_t state) { m_group = state; };
virtual bool GetElementProperty(gameElementGenericProperty_ts &element, int32_t id) {return false;};
virtual int32_t GetNearestEnemy(coord2D_ts position, int32_t groupId, etkFloat_t& lastQuadDistance) { return -1;};
virtual int32_t GetNearestEnemy(coord2D_ts position, etkFloat_t& lastQuadDistance) { return -1;};
/**
* @brief Periodicly this fuction will be call tu change property of all the dynamic obbjects
* @param[in] time Current game time (start at 0)

View File

@ -56,7 +56,7 @@ void ewol::SceneElement::AddElement(int32_t group, ewol::GameElement* newElement
}
}
//did not find empty slot :
listAnimatedElements.PushBack(newElement);
listAnimatedElements[group].PushBack(newElement);
}
@ -67,6 +67,7 @@ bool ewol::SceneElement::GetElementProperty(gameElementGenericProperty_ts &eleme
}
if (id.listId >= listAnimatedElements[id.group].Size()) {
return false;
}
if (NULL == listAnimatedElements[id.group][id.listId]) {
return false;
}
@ -77,7 +78,7 @@ bool ewol::SceneElement::GetElementProperty(gameElementGenericProperty_ts &eleme
}
elementIdentifier_ts ewol::SceneElement::GetNearestEnemy(coord2D_ts position, int32_t groupId)
ewol::elementIdentifier_ts ewol::SceneElement::GetNearestEnemy(coord2D_ts position, int32_t groupId)
{
elementIdentifier_ts findId;
findId.id = -1;
@ -85,13 +86,13 @@ elementIdentifier_ts ewol::SceneElement::GetNearestEnemy(coord2D_ts position, in
findId.listId = -1;
etkFloat_t lastQuadDistance = 9999999999999999.0;
int32_t jjj=0;
while (groupEnemy[jjj] != -1) {
for (int32_t iii=0; iii<listAnimatedElements[groupEnemy[jjj]].Size(); iii++) {
if (NULL != listAnimatedElements[groupEnemy[jjj]][iii]) {
int32_t newID = listAnimatedElements[groupEnemy[jjj]][iii]->GetNearestEnemy(position, lastQuadDistance);
while (groupEnemy[groupId][jjj] != -1) {
for (int32_t iii=0; iii<listAnimatedElements[groupEnemy[groupId][jjj]].Size(); iii++) {
if (NULL != listAnimatedElements[groupEnemy[groupId][jjj]][iii]) {
int32_t newID = listAnimatedElements[groupEnemy[groupId][jjj]][iii]->GetNearestEnemy(position, lastQuadDistance);
if (-1 != newID) {
findId.id = newID;
findId.group = groupEnemy[jjj];
findId.group = groupEnemy[groupId][jjj];
findId.listId = iii;
}
}
@ -127,7 +128,7 @@ void ewol::SceneElement::Explosion(int32_t group, int32_t type, coord2D_ts posit
}
}
elementIdentifier_ts ewol::SceneElement::GetElementAtPos(coord2D_ts position, int32_t maxDistanceDetection)
ewol::elementIdentifier_ts ewol::SceneElement::GetElementAtPos(coord2D_ts position, int32_t maxDistanceDetection)
{
elementIdentifier_ts findId;
findId.id = -1;
@ -141,7 +142,7 @@ elementIdentifier_ts ewol::SceneElement::GetElementAtPos(coord2D_ts position, in
int32_t newID = listAnimatedElements[jjj][iii]->GetNearestEnemy(position, lastQuadDistance);
if (-1 != newID) {
findId.id = newID;
findId.group = groupEnemy[jjj];
findId.group = jjj;
findId.listId = iii;
}
}

View File

@ -110,10 +110,12 @@ void ewol::Scene::OnRegenerateDisplay(void)
m_sceneElement.effects[m_currentCreateId][iii]->Clear();
}
}
for (int32_t iii=0; iii<m_sceneElement.listAnimatedElements.Size(); iii++) {
if (NULL != m_sceneElement.listAnimatedElements[iii]) {
// find an empty slot ...
m_sceneElement.listAnimatedElements[iii]->Draw(m_sceneElement.animated[m_currentCreateId], m_sceneElement.effects[m_currentCreateId]);
for (int32_t jjj=0; jjj<MAX_GROUP_NUMBER; jjj++) {
for (int32_t iii=0; iii<m_sceneElement.listAnimatedElements[jjj].Size(); iii++) {
if (NULL != m_sceneElement.listAnimatedElements[jjj][iii]) {
// find an empty slot ...
m_sceneElement.listAnimatedElements[jjj][iii]->Draw(m_sceneElement.animated[m_currentCreateId], m_sceneElement.effects[m_currentCreateId]);
}
}
}
}
@ -173,12 +175,14 @@ void ewol::Scene::PeriodicCall(int64_t localTime)
deltaTime -= CYCLIC_CALL_PERIODE_US;
ScenePeriodicCall(m_lastCallTime, CYCLIC_CALL_PERIODE_US);
//EWOL_ERROR("Periodic Call ... " << localTime);
for (int32_t iii=0; iii<m_sceneElement.listAnimatedElements.Size(); iii++) {
if (NULL != m_sceneElement.listAnimatedElements[iii]) {
// check if the element request an auto Kill ...
if (true == m_sceneElement.listAnimatedElements[iii]->Process(m_lastCallTime, CYCLIC_CALL_PERIODE_US, m_sceneElement) ) {
delete(m_sceneElement.listAnimatedElements[iii]);
m_sceneElement.listAnimatedElements[iii] = NULL;
for (int32_t jjj=0; jjj<MAX_GROUP_NUMBER; jjj++) {
for (int32_t iii=0; iii<m_sceneElement.listAnimatedElements[jjj].Size(); iii++) {
if (NULL != m_sceneElement.listAnimatedElements[jjj][iii]) {
// check if the element request an auto Kill ...
if (true == m_sceneElement.listAnimatedElements[jjj][iii]->Process(m_lastCallTime, CYCLIC_CALL_PERIODE_US, m_sceneElement) ) {
delete(m_sceneElement.listAnimatedElements[jjj][iii]);
m_sceneElement.listAnimatedElements[jjj][iii] = NULL;
}
}
}
}