Fix assertion in mouse code. We checked for mouse values that
only worked pre-SDL-porting. git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@521 4a71c877-e1ca-e34f-864e-861f7616d084master
parent
8dc0fc2878
commit
31fe5565aa
|
@ -432,21 +432,21 @@ SDWORD mouseY(void)
|
|||
/* This returns true if the mouse key is currently depressed */
|
||||
BOOL mouseDown(MOUSE_KEY_CODE code)
|
||||
{
|
||||
ASSERT(((code >= 0) && (code < 3), "Invalid mouse key code: %d", code));
|
||||
ASSERT(((code >= 0), "Invalid mouse key code: %d", code));
|
||||
return (aMouseState[code] != KEY_UP);
|
||||
}
|
||||
|
||||
/* This returns true if the mouse key was double clicked */
|
||||
BOOL mouseDClicked(MOUSE_KEY_CODE code)
|
||||
{
|
||||
ASSERT(((code >= 0) && (code < 3), "Invalid mouse key code: %d", code));
|
||||
ASSERT((code >= 0, "Invalid mouse key code: %d", code));
|
||||
return (aMouseState[code] == KEY_DOUBLECLICK);
|
||||
}
|
||||
|
||||
/* This returns true if the mouse key went from being up to being down this frame */
|
||||
BOOL mousePressed(MOUSE_KEY_CODE code)
|
||||
{
|
||||
ASSERT(((code >= 0) && (code < 3), "Invalid mouse key code: %d", code));
|
||||
ASSERT(((code >= 0), "Invalid mouse key code: %d", code));
|
||||
return ((aMouseState[code] == KEY_PRESSED) ||
|
||||
(aMouseState[code] == KEY_PRESSRELEASE));
|
||||
}
|
||||
|
@ -454,7 +454,7 @@ BOOL mousePressed(MOUSE_KEY_CODE code)
|
|||
/* This returns true if the mouse key went from being down to being up this frame */
|
||||
BOOL mouseReleased(MOUSE_KEY_CODE code)
|
||||
{
|
||||
ASSERT(((code >= 0) && (code < 3), "Invalid mouse key code: %d", code));
|
||||
ASSERT(((code >= 0), "Invalid mouse key code: %d", code));
|
||||
return ((aMouseState[code] == KEY_RELEASED) ||
|
||||
(aMouseState[code] == KEY_DOUBLECLICK) ||
|
||||
(aMouseState[code] == KEY_PRESSRELEASE));
|
||||
|
@ -463,7 +463,7 @@ BOOL mouseReleased(MOUSE_KEY_CODE code)
|
|||
/* Check for a mouse drag, return the drag start coords if dragging */
|
||||
BOOL mouseDrag(MOUSE_KEY_CODE code, UDWORD *px, UDWORD *py)
|
||||
{
|
||||
ASSERT(((code >= 0) && (code < 3), "Invalid mouse key code: %d", code));
|
||||
ASSERT(((code >= 0), "Invalid mouse key code: %d", code));
|
||||
if (aMouseState[code] == KEY_DRAG)
|
||||
{
|
||||
*px = dragX;
|
||||
|
|
Loading…
Reference in New Issue