1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-07-05 00:49:09 +02:00

* added #13 and #15 (for buttons and minimap, rest will be added later)

This commit is contained in:
Michał W. Urbańczyk
2007-10-13 20:31:50 +00:00
parent 62b69b1f25
commit 9e84383a61
9 changed files with 202 additions and 21 deletions

View File

@ -21,6 +21,11 @@ public:
return (*a.first)<(*b.first);
}
} ocmptwo_cgin ;
CSimpleWindow::~CSimpleWindow()
{
SDL_FreeSurface(bitmap);
bitmap=NULL;
}
CButtonBase::CButtonBase()
{
curimg=0;
@ -187,6 +192,8 @@ void CPlayerInterface::yourTurn()
adventureInt->update();
LOCPLINT->adventureInt->updateScreen=false;
}
for(int i=0;i<objsToBlit.size();i++)
blitAt(objsToBlit[i]->bitmap,objsToBlit[i]->pos.x,objsToBlit[i]->pos.y);
SDL_Delay(5); //give time for other apps
SDL_framerateDelay(mainFPSmng);
}
@ -957,6 +964,28 @@ void CPlayerInterface::handleEvent(SDL_Event *sEvent)
lclickable[i]->clickLeft(boost::logic::indeterminate);
}
}
else if ((sEvent->type==SDL_MOUSEBUTTONDOWN) && (sEvent->button.button == SDL_BUTTON_RIGHT))
{
for(int i=0; i<rclickable.size();i++)
{
if (isItIn(&rclickable[i]->pos,sEvent->motion.x,sEvent->motion.y))
{
rclickable[i]->clickRight(true);
}
}
}
else if ((sEvent->type==SDL_MOUSEBUTTONUP) && (sEvent->button.button == SDL_BUTTON_RIGHT))
{
for(int i=0; i<rclickable.size();i++)
{
if (isItIn(&rclickable[i]->pos,sEvent->motion.x,sEvent->motion.y))
{
rclickable[i]->clickRight(false);
}
else
rclickable[i]->clickRight(boost::logic::indeterminate);
}
}
current = NULL;
} //event end