diff src/video/fbcon/SDL_fbevents.c @ 1323:be736c197ceb

Fixed compile warning
author Sam Lantinga <slouken@libsdl.org>
date Fri, 03 Feb 2006 06:01:23 +0000
parents c9b51268668f
children 3692456e7b0f
line wrap: on
line diff
--- a/src/video/fbcon/SDL_fbevents.c	Thu Feb 02 21:27:24 2006 +0000
+++ b/src/video/fbcon/SDL_fbevents.c	Fri Feb 03 06:01:23 2006 +0000
@@ -674,7 +674,7 @@
 	while (ts_read(ts_dev, &sample, 1) > 0) {
 		button = (sample.pressure > 0) ? 1 : 0;
 		button <<= 2;	/* must report it as button 3 */
-    	FB_vgamousecallback(button, 0, sample.x, sample.y);
+		FB_vgamousecallback(button, 0, sample.x, sample.y);
 	}
 	return;
 }
@@ -713,15 +713,18 @@
 			packetsize = 3;
 			break;
 		case MOUSE_ELO:
-			packetsize = ELO_PACKET_SIZE;
-			relative = 0;
-			break;
+			/* try to read the next packet */
+			if(eloReadPosition(this, mouse_fd, &dx, &dy, &button, &realx, &realy)) {
+				button = (button & 0x01) << 2;
+				FB_vgamousecallback(button, 0, dx, dy);
+			}
+			return; /* nothing left to do */
 		case MOUSE_TSLIB:
 #ifdef HAVE_TSLIB
 			handle_tslib(this);
 #endif
 			return; /* nothing left to do */
-		case NUM_MOUSE_DRVS:
+		default:
 			/* Uh oh.. */
 			packetsize = 0;
 			break;
@@ -730,13 +733,6 @@
 	/* Special handling for the quite sensitive ELO controller */
 	if (mouse_drv == MOUSE_ELO) {
 	
-	    /* try to read the next packet */
-	    if(eloReadPosition(this, mouse_fd, &dx, &dy, &button, &realx, &realy)) {
-		button = (button & 0x01) << 2;
-    		FB_vgamousecallback(button, relative, dx, dy);
-	    }
-	    
-	    return;
 	}
 	
 	/* Read as many packets as possible */
@@ -834,26 +830,7 @@
 				dx =  (signed char)mousebuf[i+1];
 				dy = -(signed char)mousebuf[i+2];
 				break;
-			/*
-			case MOUSE_ELO:
-				if ( mousebuf[i] != ELO_START_BYTE ) {
-					i -= (packetsize-1);
-					continue;
-				}
-
-				if(!eloParsePacket(&(mousebuf[i]), &dx, &dy, &button)) {
-					i -= (packetsize-1);
-					continue;
-				}
-				
-				button = (button & 0x01) << 2;
-
-				eloConvertXY(this, &dx, &dy);
-				break;
-			*/
-
-			case MOUSE_ELO:
-			case NUM_MOUSE_DRVS:
+			default:
 				/* Uh oh.. */
 				dx = 0;
 				dy = 0;