aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--dc/input.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/dc/input.cpp b/dc/input.cpp
index 77cb121c18..355b4401d5 100644
--- a/dc/input.cpp
+++ b/dc/input.cpp
@@ -124,5 +124,10 @@ void handleInput(struct mapledev *pad, int16 &mouse_x, int16 &mouse_y,
lastkey = 0;
else if(newkey != lastkey)
keyPressed = lastkey = newkey;
+
+ if (mouse_x<0) mouse_x=0;
+ if (mouse_x>319) mouse_x=319;
+ if (mouse_y<0) mouse_y=0;
+ if (mouse_y>199) mouse_y=199;
}