diff src/video/ps2gs/SDL_gsmouse.c @ 136:717f739d6ec1

Added hardware stretching code to scale 640x480 to TV resolution There's a bug of some kind in the 16bpp code. ??
author Sam Lantinga <slouken@libsdl.org>
date Wed, 01 Aug 2001 08:41:45 +0000
parents f590dd383b5d
children e8157fcb3114
line wrap: on
line diff
--- a/src/video/ps2gs/SDL_gsmouse.c	Wed Aug 01 05:01:08 2001 +0000
+++ b/src/video/ps2gs/SDL_gsmouse.c	Wed Aug 01 08:41:45 2001 +0000
@@ -79,7 +79,7 @@
 	screen->pixels = mapped_mem + screen->offset;
 	screen_updated = 0;
 	if ( cursor_drawn ) {
-		SDL_EraseCursorNoLock(this->screen);
+		SDL_EraseCursorNoLock(screen);
 		cursor_drawn = 0;
 		screen_updated = 1;
 	}
@@ -114,10 +114,17 @@
 			mouse_y2 = area.y+area.h;
 		}
 		image = screen_image;
-		image.y = screen->offset / screen->pitch + mouse_y1;
+		image.y += screen->offset / screen->pitch + mouse_y1;
 		image.h = mouse_y2 - mouse_y1;
-		image.ptr = mapped_mem + image.y * screen->pitch;
+		image.ptr = mapped_mem +
+		            (image.y - screen_image.y) * screen->pitch;
 		ioctl(console_fd, PS2IOC_LOADIMAGE, &image);
+
+		/* Need to scale offscreen image to TV output */
+		if ( image.y > 0 ) {
+			scaleimage_nonblock(console_fd,
+			                    tex_tags_mem, scale_tags_mem);
+		}
 	}
 
 	/* We're finished */