Mercurial > sdl-ios-xcode
annotate src/video/ps2gs/SDL_gsmouse.c @ 1358:c71e05b4dc2e
More header massaging... works great on Windows. ;-)
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Fri, 10 Feb 2006 06:48:43 +0000 |
parents | 604d73db6802 |
children | 19418e4422cb |
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 |
1312
c9b51268668f
Updated copyright information and removed rcs id lines (problematic in branch merges)
Sam Lantinga <slouken@libsdl.org>
parents:
252
diff
changeset
|
3 Copyright (C) 1997-2006 Sam Lantinga |
70
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 |
1312
c9b51268668f
Updated copyright information and removed rcs id lines (problematic in branch merges)
Sam Lantinga <slouken@libsdl.org>
parents:
252
diff
changeset
|
6 modify it under the terms of the GNU Lesser General Public |
70
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 |
1312
c9b51268668f
Updated copyright information and removed rcs id lines (problematic in branch merges)
Sam Lantinga <slouken@libsdl.org>
parents:
252
diff
changeset
|
8 version 2.1 of the License, or (at your option) any later version. |
70
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 |
1312
c9b51268668f
Updated copyright information and removed rcs id lines (problematic in branch merges)
Sam Lantinga <slouken@libsdl.org>
parents:
252
diff
changeset
|
13 Lesser General Public License for more details. |
70
f590dd383b5d
Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff
changeset
|
14 |
1312
c9b51268668f
Updated copyright information and removed rcs id lines (problematic in branch merges)
Sam Lantinga <slouken@libsdl.org>
parents:
252
diff
changeset
|
15 You should have received a copy of the GNU Lesser General Public |
c9b51268668f
Updated copyright information and removed rcs id lines (problematic in branch merges)
Sam Lantinga <slouken@libsdl.org>
parents:
252
diff
changeset
|
16 License along with this library; if not, write to the Free Software |
c9b51268668f
Updated copyright information and removed rcs id lines (problematic in branch merges)
Sam Lantinga <slouken@libsdl.org>
parents:
252
diff
changeset
|
17 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
70
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 #include <sys/ioctl.h> |
f590dd383b5d
Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff
changeset
|
24 |
f590dd383b5d
Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff
changeset
|
25 #include "SDL_mouse.h" |
f590dd383b5d
Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff
changeset
|
26 #include "SDL_events_c.h" |
f590dd383b5d
Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff
changeset
|
27 #include "SDL_cursor_c.h" |
f590dd383b5d
Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff
changeset
|
28 #include "SDL_gsvideo.h" |
f590dd383b5d
Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff
changeset
|
29 #include "SDL_gsmouse_c.h" |
f590dd383b5d
Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff
changeset
|
30 |
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 /* 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
|
33 struct WMcursor { |
f590dd383b5d
Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff
changeset
|
34 int unused; |
f590dd383b5d
Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff
changeset
|
35 }; |
f590dd383b5d
Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff
changeset
|
36 |
f590dd383b5d
Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff
changeset
|
37 /* There isn't any implementation dependent data */ |
f590dd383b5d
Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff
changeset
|
38 void GS_FreeWMCursor(_THIS, WMcursor *cursor) |
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 return; |
f590dd383b5d
Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff
changeset
|
41 } |
f590dd383b5d
Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff
changeset
|
42 |
f590dd383b5d
Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff
changeset
|
43 /* There isn't any implementation dependent data */ |
f590dd383b5d
Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff
changeset
|
44 WMcursor *GS_CreateWMCursor(_THIS, |
f590dd383b5d
Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff
changeset
|
45 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
|
46 { |
f590dd383b5d
Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff
changeset
|
47 return((WMcursor *)0x01); |
f590dd383b5d
Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff
changeset
|
48 } |
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 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
|
51 { |
f590dd383b5d
Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff
changeset
|
52 SDL_Surface *screen; |
f590dd383b5d
Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff
changeset
|
53 struct ps2_image image; |
f590dd383b5d
Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff
changeset
|
54 SDL_Rect area; |
f590dd383b5d
Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff
changeset
|
55 int mouse_y1, mouse_y2; |
f590dd383b5d
Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff
changeset
|
56 void *saved_pixels; |
f590dd383b5d
Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff
changeset
|
57 int screen_updated; |
f590dd383b5d
Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff
changeset
|
58 |
f590dd383b5d
Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff
changeset
|
59 /* 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
|
60 SDL_LockCursor(); |
f590dd383b5d
Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff
changeset
|
61 |
f590dd383b5d
Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff
changeset
|
62 /* Make sure any pending DMA has completed */ |
f590dd383b5d
Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff
changeset
|
63 if ( dma_pending ) { |
f590dd383b5d
Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff
changeset
|
64 ioctl(console_fd, PS2IOC_SENDQCT, 1); |
f590dd383b5d
Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff
changeset
|
65 dma_pending = 0; |
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 |
f590dd383b5d
Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff
changeset
|
68 /* Remove the cursor image from the DMA area */ |
f590dd383b5d
Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff
changeset
|
69 screen = this->screen; |
f590dd383b5d
Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff
changeset
|
70 saved_pixels = screen->pixels; |
f590dd383b5d
Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff
changeset
|
71 screen->pixels = mapped_mem + screen->offset; |
f590dd383b5d
Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff
changeset
|
72 screen_updated = 0; |
f590dd383b5d
Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff
changeset
|
73 if ( cursor_drawn ) { |
136
717f739d6ec1
Added hardware stretching code to scale 640x480 to TV resolution
Sam Lantinga <slouken@libsdl.org>
parents:
70
diff
changeset
|
74 SDL_EraseCursorNoLock(screen); |
70
f590dd383b5d
Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff
changeset
|
75 cursor_drawn = 0; |
f590dd383b5d
Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff
changeset
|
76 screen_updated = 1; |
f590dd383b5d
Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff
changeset
|
77 } |
f590dd383b5d
Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff
changeset
|
78 |
f590dd383b5d
Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff
changeset
|
79 /* Save the current mouse area */ |
f590dd383b5d
Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff
changeset
|
80 SDL_MouseRect(&area); |
f590dd383b5d
Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff
changeset
|
81 mouse_y1 = area.y; |
f590dd383b5d
Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff
changeset
|
82 mouse_y2 = area.y+area.h; |
f590dd383b5d
Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff
changeset
|
83 |
f590dd383b5d
Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff
changeset
|
84 /* 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
|
85 if ( cursor ) { |
f590dd383b5d
Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff
changeset
|
86 /* Set the new location */ |
f590dd383b5d
Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff
changeset
|
87 cursor->area.x = (x - cursor->hot_x); |
f590dd383b5d
Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff
changeset
|
88 cursor->area.y = (y - cursor->hot_y); |
f590dd383b5d
Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff
changeset
|
89 |
f590dd383b5d
Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff
changeset
|
90 /* Draw the cursor at the new location */ |
f590dd383b5d
Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff
changeset
|
91 if ( (SDL_cursorstate & CURSOR_VISIBLE) && screen->pixels ) { |
f590dd383b5d
Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff
changeset
|
92 SDL_DrawCursorNoLock(screen); |
f590dd383b5d
Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff
changeset
|
93 cursor_drawn = 1; |
f590dd383b5d
Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff
changeset
|
94 screen_updated = 1; |
f590dd383b5d
Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff
changeset
|
95 } |
f590dd383b5d
Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff
changeset
|
96 } |
f590dd383b5d
Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff
changeset
|
97 screen->pixels = saved_pixels; |
f590dd383b5d
Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff
changeset
|
98 |
f590dd383b5d
Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff
changeset
|
99 /* Update the affected area of the screen */ |
f590dd383b5d
Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff
changeset
|
100 if ( screen_updated ) { |
f590dd383b5d
Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff
changeset
|
101 SDL_MouseRect(&area); |
f590dd383b5d
Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff
changeset
|
102 if ( area.y < mouse_y1 ) { |
f590dd383b5d
Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff
changeset
|
103 mouse_y1 = area.y; |
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 if ( (area.y+area.h) > mouse_y2 ) { |
f590dd383b5d
Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff
changeset
|
106 mouse_y2 = area.y+area.h; |
f590dd383b5d
Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff
changeset
|
107 } |
f590dd383b5d
Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff
changeset
|
108 image = screen_image; |
136
717f739d6ec1
Added hardware stretching code to scale 640x480 to TV resolution
Sam Lantinga <slouken@libsdl.org>
parents:
70
diff
changeset
|
109 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
|
110 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
|
111 image.ptr = mapped_mem + |
717f739d6ec1
Added hardware stretching code to scale 640x480 to TV resolution
Sam Lantinga <slouken@libsdl.org>
parents:
70
diff
changeset
|
112 (image.y - screen_image.y) * screen->pitch; |
70
f590dd383b5d
Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff
changeset
|
113 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
|
114 |
717f739d6ec1
Added hardware stretching code to scale 640x480 to TV resolution
Sam Lantinga <slouken@libsdl.org>
parents:
70
diff
changeset
|
115 /* 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
|
116 if ( image.y > 0 ) { |
717f739d6ec1
Added hardware stretching code to scale 640x480 to TV resolution
Sam Lantinga <slouken@libsdl.org>
parents:
70
diff
changeset
|
117 scaleimage_nonblock(console_fd, |
717f739d6ec1
Added hardware stretching code to scale 640x480 to TV resolution
Sam Lantinga <slouken@libsdl.org>
parents:
70
diff
changeset
|
118 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
|
119 } |
70
f590dd383b5d
Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff
changeset
|
120 } |
f590dd383b5d
Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff
changeset
|
121 |
f590dd383b5d
Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff
changeset
|
122 /* We're finished */ |
f590dd383b5d
Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff
changeset
|
123 SDL_UnlockCursor(); |
f590dd383b5d
Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff
changeset
|
124 } |
f590dd383b5d
Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff
changeset
|
125 |
f590dd383b5d
Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff
changeset
|
126 void GS_MoveWMCursor(_THIS, int x, int y) |
f590dd383b5d
Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff
changeset
|
127 { |
f590dd383b5d
Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff
changeset
|
128 GS_MoveCursor(this, SDL_cursor, x, y); |
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 |
f590dd383b5d
Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff
changeset
|
131 int GS_ShowWMCursor(_THIS, WMcursor *wmcursor) |
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 SDL_Cursor *cursor; |
f590dd383b5d
Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff
changeset
|
134 int x, 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 /* Draw the cursor at the appropriate location */ |
f590dd383b5d
Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff
changeset
|
137 SDL_GetMouseState(&x, &y); |
f590dd383b5d
Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff
changeset
|
138 if ( wmcursor ) { |
f590dd383b5d
Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff
changeset
|
139 cursor = SDL_cursor; |
f590dd383b5d
Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff
changeset
|
140 } else { |
f590dd383b5d
Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff
changeset
|
141 cursor = NULL; |
f590dd383b5d
Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff
changeset
|
142 } |
f590dd383b5d
Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff
changeset
|
143 GS_MoveCursor(this, cursor, x, y); |
f590dd383b5d
Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff
changeset
|
144 return(1); |
f590dd383b5d
Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff
changeset
|
145 } |