From 277a86b8ca33a629d6c1a5c60b4573c69cc87827 Mon Sep 17 00:00:00 2001 From: Marcus Comstedt Date: Sun, 3 Feb 2002 14:54:11 +0000 Subject: [PATCH] Confine mouse movements. svn-id: r3562 --- dc/input.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dc/input.cpp b/dc/input.cpp index 77cb121c183..355b4401d53 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; }