Count frames the pointer has been held.

This commit is contained in:
Henrik Rydgard 2012-04-28 00:02:55 +02:00
parent def79c0180
commit ab96a3fc70
2 changed files with 7 additions and 2 deletions

View File

@ -36,6 +36,10 @@ void UIUpdateMouse(int i, float x, float y, bool down) {
} else {
uistate.mousepressed[i] = 0;
}
if (uistate.mousedown[i])
uistate.mouseframesdown[i]++;
else
uistate.mouseframesdown[i] = 0;
uistate.mousex[i] = x;
uistate.mousey[i] = y;

View File

@ -81,8 +81,9 @@ private:
struct UIState {
int mousex[MAX_POINTERS];
int mousey[MAX_POINTERS];
int mousedown[MAX_POINTERS];
int mousepressed[MAX_POINTERS];
bool mousedown[MAX_POINTERS];
bool mousepressed[MAX_POINTERS];
short mouseframesdown[MAX_POINTERS];
int mouseStartX[MAX_POINTERS];
int mouseStartY[MAX_POINTERS];