annotate src/video/ps2gs/SDL_gsmouse.c @ 389:ca655a7a9d80

*** empty log message ***
author Sam Lantinga <slouken@libsdl.org>
date Sat, 01 Jun 2002 19:54:15 +0000
parents e8157fcb3114
children c9b51268668f
rev   line source
70
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1 /*
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2 SDL - Simple DirectMedia Layer
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3 Copyright (C) 1997, 1998, 1999, 2000 Sam Lantinga
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5 This library is free software; you can redistribute it and/or
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6 modify it under the terms of the GNU Library General Public
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
7 License as published by the Free Software Foundation; either
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
8 version 2 of the License, or (at your option) any later version.
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
9
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
10 This library is distributed in the hope that it will be useful,
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
13 Library General Public License for more details.
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
14
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
15 You should have received a copy of the GNU Library General Public
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
16 License along with this library; if not, write to the Free
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
17 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
18
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
19 Sam Lantinga
252
e8157fcb3114 Updated the source with the correct e-mail address
Sam Lantinga <slouken@libsdl.org>
parents: 136
diff changeset
20 slouken@libsdl.org
70
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
21 */
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
22
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
23 #ifdef SAVE_RCSID
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
24 static char rcsid =
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
25 "@(#) $Id$";
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
26 #endif
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
27
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
28 #include <stdlib.h>
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
29 #include <stdio.h>
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
30 #include <sys/ioctl.h>
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
31
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
32 #include "SDL_error.h"
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
33 #include "SDL_mouse.h"
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
34 #include "SDL_events_c.h"
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
35 #include "SDL_cursor_c.h"
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
36 #include "SDL_gsvideo.h"
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
37 #include "SDL_gsmouse_c.h"
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
38
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
39
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
40 /* The implementation dependent data for the window manager cursor */
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
41 struct WMcursor {
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
42 int unused;
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
43 };
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
44
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
45 /* There isn't any implementation dependent data */
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
46 void GS_FreeWMCursor(_THIS, WMcursor *cursor)
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
47 {
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
48 return;
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
49 }
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
50
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
51 /* There isn't any implementation dependent data */
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
52 WMcursor *GS_CreateWMCursor(_THIS,
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
53 Uint8 *data, Uint8 *mask, int w, int h, int hot_x, int hot_y)
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
54 {
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
55 return((WMcursor *)0x01);
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
56 }
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
57
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
58 static void GS_MoveCursor(_THIS, SDL_Cursor *cursor, int x, int y)
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
59 {
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
60 SDL_Surface *screen;
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
61 struct ps2_image image;
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
62 SDL_Rect area;
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
63 int mouse_y1, mouse_y2;
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
64 void *saved_pixels;
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
65 int screen_updated;
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
66
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
67 /* Lock so we don't interrupt an update with mouse motion */
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
68 SDL_LockCursor();
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
69
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
70 /* Make sure any pending DMA has completed */
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
71 if ( dma_pending ) {
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
72 ioctl(console_fd, PS2IOC_SENDQCT, 1);
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
73 dma_pending = 0;
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
74 }
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
75
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
76 /* Remove the cursor image from the DMA area */
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
77 screen = this->screen;
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
78 saved_pixels = screen->pixels;
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
79 screen->pixels = mapped_mem + screen->offset;
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
80 screen_updated = 0;
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
81 if ( cursor_drawn ) {
136
717f739d6ec1 Added hardware stretching code to scale 640x480 to TV resolution
Sam Lantinga <slouken@libsdl.org>
parents: 70
diff changeset
82 SDL_EraseCursorNoLock(screen);
70
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
83 cursor_drawn = 0;
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
84 screen_updated = 1;
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
85 }
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
86
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
87 /* Save the current mouse area */
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
88 SDL_MouseRect(&area);
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
89 mouse_y1 = area.y;
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
90 mouse_y2 = area.y+area.h;
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
91
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
92 /* Only draw the new cursor if there was one passed in */
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
93 if ( cursor ) {
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
94 /* Set the new location */
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
95 cursor->area.x = (x - cursor->hot_x);
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
96 cursor->area.y = (y - cursor->hot_y);
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
97
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
98 /* Draw the cursor at the new location */
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
99 if ( (SDL_cursorstate & CURSOR_VISIBLE) && screen->pixels ) {
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
100 SDL_DrawCursorNoLock(screen);
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
101 cursor_drawn = 1;
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
102 screen_updated = 1;
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
103 }
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
104 }
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
105 screen->pixels = saved_pixels;
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
106
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
107 /* Update the affected area of the screen */
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
108 if ( screen_updated ) {
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
109 SDL_MouseRect(&area);
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
110 if ( area.y < mouse_y1 ) {
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
111 mouse_y1 = area.y;
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
112 }
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
113 if ( (area.y+area.h) > mouse_y2 ) {
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
114 mouse_y2 = area.y+area.h;
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
115 }
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
116 image = screen_image;
136
717f739d6ec1 Added hardware stretching code to scale 640x480 to TV resolution
Sam Lantinga <slouken@libsdl.org>
parents: 70
diff changeset
117 image.y += screen->offset / screen->pitch + mouse_y1;
70
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
118 image.h = mouse_y2 - mouse_y1;
136
717f739d6ec1 Added hardware stretching code to scale 640x480 to TV resolution
Sam Lantinga <slouken@libsdl.org>
parents: 70
diff changeset
119 image.ptr = mapped_mem +
717f739d6ec1 Added hardware stretching code to scale 640x480 to TV resolution
Sam Lantinga <slouken@libsdl.org>
parents: 70
diff changeset
120 (image.y - screen_image.y) * screen->pitch;
70
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
121 ioctl(console_fd, PS2IOC_LOADIMAGE, &image);
136
717f739d6ec1 Added hardware stretching code to scale 640x480 to TV resolution
Sam Lantinga <slouken@libsdl.org>
parents: 70
diff changeset
122
717f739d6ec1 Added hardware stretching code to scale 640x480 to TV resolution
Sam Lantinga <slouken@libsdl.org>
parents: 70
diff changeset
123 /* Need to scale offscreen image to TV output */
717f739d6ec1 Added hardware stretching code to scale 640x480 to TV resolution
Sam Lantinga <slouken@libsdl.org>
parents: 70
diff changeset
124 if ( image.y > 0 ) {
717f739d6ec1 Added hardware stretching code to scale 640x480 to TV resolution
Sam Lantinga <slouken@libsdl.org>
parents: 70
diff changeset
125 scaleimage_nonblock(console_fd,
717f739d6ec1 Added hardware stretching code to scale 640x480 to TV resolution
Sam Lantinga <slouken@libsdl.org>
parents: 70
diff changeset
126 tex_tags_mem, scale_tags_mem);
717f739d6ec1 Added hardware stretching code to scale 640x480 to TV resolution
Sam Lantinga <slouken@libsdl.org>
parents: 70
diff changeset
127 }
70
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
128 }
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
129
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
130 /* We're finished */
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
131 SDL_UnlockCursor();
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
132 }
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
133
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
134 void GS_MoveWMCursor(_THIS, int x, int y)
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
135 {
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
136 GS_MoveCursor(this, SDL_cursor, x, y);
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
137 }
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
138
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
139 int GS_ShowWMCursor(_THIS, WMcursor *wmcursor)
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
140 {
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
141 SDL_Cursor *cursor;
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
142 int x, y;
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
143
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
144 /* Draw the cursor at the appropriate location */
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
145 SDL_GetMouseState(&x, &y);
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
146 if ( wmcursor ) {
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
147 cursor = SDL_cursor;
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
148 } else {
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
149 cursor = NULL;
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
150 }
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
151 GS_MoveCursor(this, cursor, x, y);
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
152 return(1);
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
153 }