comparison src/video/directfb/SDL_DirectFB_mouse.c @ 2698:e1da92da346c gsoc2008_nds

Clean up.
author Darren Alton <dalton@stevens.edu>
date Wed, 27 Aug 2008 04:23:38 +0000
parents 1e690901ecd7
children
comparison
equal deleted inserted replaced
2697:c9121b04cffa 2698:e1da92da346c
83 dsc.caps = DSCAPS_NONE; //DSCAPS_SYSTEMONLY; 83 dsc.caps = DSCAPS_NONE; //DSCAPS_SYSTEMONLY;
84 dsc.width = surface->w; 84 dsc.width = surface->w;
85 dsc.height = surface->h; 85 dsc.height = surface->h;
86 dsc.pixelformat = DSPF_ARGB; 86 dsc.pixelformat = DSPF_ARGB;
87 87
88 SDL_DFB_CHECKERR(devdata->dfb-> 88 SDL_DFB_CHECKERR(devdata->
89 CreateSurface(devdata->dfb, &dsc, &curdata->surf)); 89 dfb->CreateSurface(devdata->dfb, &dsc, &curdata->surf));
90 curdata->hotx = hot_x; 90 curdata->hotx = hot_x;
91 curdata->hoty = hot_y; 91 curdata->hoty = hot_y;
92 cursor->driverdata = curdata; 92 cursor->driverdata = curdata;
93 93
94 SDL_DFB_CHECKERR(curdata->surf-> 94 SDL_DFB_CHECKERR(curdata->
95 Lock(curdata->surf, DSLF_WRITE, (void *) &dest, &pitch)); 95 surf->Lock(curdata->surf, DSLF_WRITE, (void *) &dest,
96 &pitch));
96 97
97 //FIXME: Implies a lot of things, e.g. rgba format for SDL_SURFACE .... 98 //FIXME: Implies a lot of things, e.g. rgba format for SDL_SURFACE ....
98 p = surface->pixels; 99 p = surface->pixels;
99 for (i = 0; i < surface->w * surface->h; i++) 100 for (i = 0; i < surface->w * surface->h; i++)
100 if (p[i] == 0x00000000) 101 if (p[i] == 0x00000000)
131 SDL_VideoDisplay *display = SDL_GetDisplayFromWindow(window); 132 SDL_VideoDisplay *display = SDL_GetDisplayFromWindow(window);
132 DFB_DisplayData *dispdata = (DFB_DisplayData *) display->driverdata; 133 DFB_DisplayData *dispdata = (DFB_DisplayData *) display->driverdata;
133 DFB_WindowData *windata = (DFB_WindowData *) window->driverdata; 134 DFB_WindowData *windata = (DFB_WindowData *) window->driverdata;
134 135
135 if (cursor) 136 if (cursor)
136 SDL_DFB_CHECKERR(windata->window-> 137 SDL_DFB_CHECKERR(windata->window->SetCursorShape(windata->window,
137 SetCursorShape(windata->window, curdata->surf, 138 curdata->surf,
138 curdata->hotx, curdata->hoty)); 139 curdata->hotx,
140 curdata->hoty));
139 //FIXME: This is somehow a directfb issue 141 //FIXME: This is somehow a directfb issue
140 //TODO: Check administrative 142 //TODO: Check administrative
141 SDL_DFB_CHECKERR(dispdata->layer-> 143 SDL_DFB_CHECKERR(dispdata->layer->SetCooperativeLevel(dispdata->layer,
142 SetCooperativeLevel(dispdata->layer, 144 DLSCL_ADMINISTRATIVE));
143 DLSCL_ADMINISTRATIVE)); 145 SDL_DFB_CHECKERR(dispdata->layer->SetCursorOpacity(dispdata->layer,
144 SDL_DFB_CHECKERR(dispdata->layer-> 146 cursor ? 0xC0 :
145 SetCursorOpacity(dispdata->layer, 147 0x00));
146 cursor ? 0xC0 : 0x00)); 148 SDL_DFB_CHECKERR(dispdata->layer->SetCooperativeLevel(dispdata->layer,
147 SDL_DFB_CHECKERR(dispdata->layer-> 149 DLSCL_SHARED));
148 SetCooperativeLevel(dispdata->layer, DLSCL_SHARED));
149 } 150 }
150 151
151 return 0; 152 return 0;
152 error: 153 error:
153 return -1; 154 return -1;
183 DFB_WindowData *windata = (DFB_WindowData *) window->driverdata; 184 DFB_WindowData *windata = (DFB_WindowData *) window->driverdata;
184 DFBResult ret; 185 DFBResult ret;
185 int cx, cy; 186 int cx, cy;
186 187
187 SDL_DFB_CHECKERR(windata->window->GetPosition(windata->window, &cx, &cy)); 188 SDL_DFB_CHECKERR(windata->window->GetPosition(windata->window, &cx, &cy));
188 SDL_DFB_CHECKERR(dispdata->layer-> 189 SDL_DFB_CHECKERR(dispdata->
189 WarpCursor(dispdata->layer, cx + x, cy + y)); 190 layer->WarpCursor(dispdata->layer, cx + x, cy + y));
190 191
191 error: 192 error:
192 return; 193 return;
193 } 194 }
194 195