annotate src/video/ps2gs/SDL_gsmouse.c @ 1322:a4566d07718f

Update for mintlib 0.57.6 (m68k-atari-mint libc)
author Patrice Mandin <patmandin@gmail.com>
date Thu, 02 Feb 2006 21:27:24 +0000
parents c9b51268668f
children 604d73db6802
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 <stdlib.h>
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
24 #include <stdio.h>
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
25 #include <sys/ioctl.h>
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
26
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
27 #include "SDL_error.h"
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
28 #include "SDL_mouse.h"
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
29 #include "SDL_events_c.h"
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
30 #include "SDL_cursor_c.h"
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
31 #include "SDL_gsvideo.h"
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
32 #include "SDL_gsmouse_c.h"
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
33
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
34
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
35 /* 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
36 struct WMcursor {
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
37 int unused;
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 /* There isn't any implementation dependent data */
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
41 void GS_FreeWMCursor(_THIS, WMcursor *cursor)
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 return;
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
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
46 /* There isn't any implementation dependent data */
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
47 WMcursor *GS_CreateWMCursor(_THIS,
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
48 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
49 {
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
50 return((WMcursor *)0x01);
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
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
53 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
54 {
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
55 SDL_Surface *screen;
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
56 struct ps2_image image;
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
57 SDL_Rect area;
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
58 int mouse_y1, mouse_y2;
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
59 void *saved_pixels;
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
60 int screen_updated;
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 /* 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
63 SDL_LockCursor();
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
64
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
65 /* Make sure any pending DMA has completed */
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
66 if ( dma_pending ) {
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
67 ioctl(console_fd, PS2IOC_SENDQCT, 1);
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
68 dma_pending = 0;
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
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
71 /* Remove the cursor image from the DMA area */
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
72 screen = this->screen;
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
73 saved_pixels = screen->pixels;
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
74 screen->pixels = mapped_mem + screen->offset;
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
75 screen_updated = 0;
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
76 if ( cursor_drawn ) {
136
717f739d6ec1 Added hardware stretching code to scale 640x480 to TV resolution
Sam Lantinga <slouken@libsdl.org>
parents: 70
diff changeset
77 SDL_EraseCursorNoLock(screen);
70
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
78 cursor_drawn = 0;
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
79 screen_updated = 1;
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
80 }
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
81
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
82 /* Save the current mouse area */
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
83 SDL_MouseRect(&area);
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
84 mouse_y1 = area.y;
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
85 mouse_y2 = area.y+area.h;
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 /* 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
88 if ( cursor ) {
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
89 /* Set the new location */
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
90 cursor->area.x = (x - cursor->hot_x);
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
91 cursor->area.y = (y - cursor->hot_y);
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
92
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
93 /* Draw the cursor at the new location */
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
94 if ( (SDL_cursorstate & CURSOR_VISIBLE) && screen->pixels ) {
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
95 SDL_DrawCursorNoLock(screen);
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
96 cursor_drawn = 1;
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
97 screen_updated = 1;
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 }
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
100 screen->pixels = saved_pixels;
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
101
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
102 /* Update the affected area of the screen */
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
103 if ( screen_updated ) {
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
104 SDL_MouseRect(&area);
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
105 if ( area.y < mouse_y1 ) {
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
106 mouse_y1 = area.y;
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 if ( (area.y+area.h) > mouse_y2 ) {
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
109 mouse_y2 = area.y+area.h;
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
110 }
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
111 image = screen_image;
136
717f739d6ec1 Added hardware stretching code to scale 640x480 to TV resolution
Sam Lantinga <slouken@libsdl.org>
parents: 70
diff changeset
112 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
113 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
114 image.ptr = mapped_mem +
717f739d6ec1 Added hardware stretching code to scale 640x480 to TV resolution
Sam Lantinga <slouken@libsdl.org>
parents: 70
diff changeset
115 (image.y - screen_image.y) * screen->pitch;
70
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
116 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
117
717f739d6ec1 Added hardware stretching code to scale 640x480 to TV resolution
Sam Lantinga <slouken@libsdl.org>
parents: 70
diff changeset
118 /* 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
119 if ( image.y > 0 ) {
717f739d6ec1 Added hardware stretching code to scale 640x480 to TV resolution
Sam Lantinga <slouken@libsdl.org>
parents: 70
diff changeset
120 scaleimage_nonblock(console_fd,
717f739d6ec1 Added hardware stretching code to scale 640x480 to TV resolution
Sam Lantinga <slouken@libsdl.org>
parents: 70
diff changeset
121 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
122 }
70
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
123 }
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 /* We're finished */
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
126 SDL_UnlockCursor();
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
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
129 void GS_MoveWMCursor(_THIS, int x, int y)
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 GS_MoveCursor(this, SDL_cursor, x, y);
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 int GS_ShowWMCursor(_THIS, WMcursor *wmcursor)
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 SDL_Cursor *cursor;
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
137 int x, y;
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 /* Draw the cursor at the appropriate location */
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
140 SDL_GetMouseState(&x, &y);
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
141 if ( wmcursor ) {
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
142 cursor = SDL_cursor;
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
143 } else {
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
144 cursor = NULL;
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
145 }
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
146 GS_MoveCursor(this, cursor, x, y);
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
147 return(1);
f590dd383b5d Added Linux PlayStation 2 Graphics Synthesizer support
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
148 }