Mercurial > sdl-ios-xcode
annotate src/video/cybergfx/SDL_cgximage.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 | d910939febfa |
rev | line source |
---|---|
0 | 1 /* |
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:
769
diff
changeset
|
3 Copyright (C) 1997-2006 Sam Lantinga |
0 | 4 |
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:
769
diff
changeset
|
6 modify it under the terms of the GNU Lesser General Public |
0 | 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:
769
diff
changeset
|
8 version 2.1 of the License, or (at your option) any later version. |
0 | 9 |
10 This library is distributed in the hope that it will be useful, | |
11 but WITHOUT ANY WARRANTY; without even the implied warranty of | |
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:
769
diff
changeset
|
13 Lesser General Public License for more details. |
0 | 14 |
1312
c9b51268668f
Updated copyright information and removed rcs id lines (problematic in branch merges)
Sam Lantinga <slouken@libsdl.org>
parents:
769
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:
769
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:
769
diff
changeset
|
17 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
0 | 18 |
19 Sam Lantinga | |
252
e8157fcb3114
Updated the source with the correct e-mail address
Sam Lantinga <slouken@libsdl.org>
parents:
21
diff
changeset
|
20 slouken@libsdl.org |
0 | 21 */ |
22 | |
23 #include "SDL_endian.h" | |
24 #include "SDL_cgximage_c.h" | |
25 | |
26 #ifdef HAVE_KSTAT | |
27 #include <kstat.h> | |
28 #endif | |
29 | |
30 #ifdef USE_CGX_WRITELUTPIXEL | |
31 #if defined(__SASC) || defined(__PPC__) | |
32 #define WLUT WriteLUTPixelArray | |
33 #else | |
34 void WLUT(APTR a,UWORD b,UWORD c,UWORD d,struct RastPort *e,APTR f,UWORD g,UWORD h,UWORD i,UWORD l,UBYTE m) | |
35 { WriteLUTPixelArray(a,b,c,d,e,f,g,h,i,l,m); } | |
36 #endif | |
37 | |
38 #endif | |
39 | |
40 /* Various screen update functions available */ | |
41 static void CGX_NormalUpdate(_THIS, int numrects, SDL_Rect *rects); | |
42 static void CGX_FakeUpdate(_THIS, int numrects, SDL_Rect *rects); | |
43 | |
44 BOOL SafeDisp=TRUE,SafeChange=TRUE; | |
45 struct MsgPort *safeport=NULL,*dispport=NULL; | |
46 ULONG safe_sigbit,disp_sigbit; | |
255
dcb5e869f8b5
Updated Amiga port by Gabriele Greco
Sam Lantinga <slouken@libsdl.org>
parents:
252
diff
changeset
|
47 int use_picasso96=1; |
0 | 48 |
49 int CGX_SetupImage(_THIS, SDL_Surface *screen) | |
50 { | |
255
dcb5e869f8b5
Updated Amiga port by Gabriele Greco
Sam Lantinga <slouken@libsdl.org>
parents:
252
diff
changeset
|
51 SDL_Ximage=NULL; |
dcb5e869f8b5
Updated Amiga port by Gabriele Greco
Sam Lantinga <slouken@libsdl.org>
parents:
252
diff
changeset
|
52 |
dcb5e869f8b5
Updated Amiga port by Gabriele Greco
Sam Lantinga <slouken@libsdl.org>
parents:
252
diff
changeset
|
53 if(screen->flags&SDL_HWSURFACE) { |
dcb5e869f8b5
Updated Amiga port by Gabriele Greco
Sam Lantinga <slouken@libsdl.org>
parents:
252
diff
changeset
|
54 ULONG pitch; |
0 | 55 |
255
dcb5e869f8b5
Updated Amiga port by Gabriele Greco
Sam Lantinga <slouken@libsdl.org>
parents:
252
diff
changeset
|
56 if(!screen->hwdata) { |
1336
3692456e7b0f
Use SDL_ prefixed versions of C library functions.
Sam Lantinga <slouken@libsdl.org>
parents:
1312
diff
changeset
|
57 if(!(screen->hwdata=SDL_malloc(sizeof(struct private_hwdata)))) |
0 | 58 return -1; |
255
dcb5e869f8b5
Updated Amiga port by Gabriele Greco
Sam Lantinga <slouken@libsdl.org>
parents:
252
diff
changeset
|
59 |
0 | 60 D(bug("Creating system accel struct\n")); |
61 } | |
255
dcb5e869f8b5
Updated Amiga port by Gabriele Greco
Sam Lantinga <slouken@libsdl.org>
parents:
252
diff
changeset
|
62 screen->hwdata->lock=NULL; |
dcb5e869f8b5
Updated Amiga port by Gabriele Greco
Sam Lantinga <slouken@libsdl.org>
parents:
252
diff
changeset
|
63 screen->hwdata->allocated=0; |
dcb5e869f8b5
Updated Amiga port by Gabriele Greco
Sam Lantinga <slouken@libsdl.org>
parents:
252
diff
changeset
|
64 screen->hwdata->mask=NULL; |
21
75a95f82bc1f
Updated the Amiga OS port of SDL (thanks Gabriele)
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
65 screen->hwdata->bmap=SDL_RastPort->BitMap; |
75a95f82bc1f
Updated the Amiga OS port of SDL (thanks Gabriele)
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
66 screen->hwdata->videodata=this; |
75a95f82bc1f
Updated the Amiga OS port of SDL (thanks Gabriele)
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
67 |
75a95f82bc1f
Updated the Amiga OS port of SDL (thanks Gabriele)
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
68 if(!(screen->hwdata->lock=LockBitMapTags(screen->hwdata->bmap, |
75a95f82bc1f
Updated the Amiga OS port of SDL (thanks Gabriele)
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
69 LBMI_BASEADDRESS,(ULONG)&screen->pixels, |
255
dcb5e869f8b5
Updated Amiga port by Gabriele Greco
Sam Lantinga <slouken@libsdl.org>
parents:
252
diff
changeset
|
70 LBMI_BYTESPERROW,(ULONG)&pitch,TAG_DONE))) { |
1336
3692456e7b0f
Use SDL_ prefixed versions of C library functions.
Sam Lantinga <slouken@libsdl.org>
parents:
1312
diff
changeset
|
71 SDL_free(screen->hwdata); |
21
75a95f82bc1f
Updated the Amiga OS port of SDL (thanks Gabriele)
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
72 screen->hwdata=NULL; |
75a95f82bc1f
Updated the Amiga OS port of SDL (thanks Gabriele)
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
73 return -1; |
75a95f82bc1f
Updated the Amiga OS port of SDL (thanks Gabriele)
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
74 } |
255
dcb5e869f8b5
Updated Amiga port by Gabriele Greco
Sam Lantinga <slouken@libsdl.org>
parents:
252
diff
changeset
|
75 else { |
21
75a95f82bc1f
Updated the Amiga OS port of SDL (thanks Gabriele)
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
76 UnLockBitMap(screen->hwdata->lock); |
75a95f82bc1f
Updated the Amiga OS port of SDL (thanks Gabriele)
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
77 screen->hwdata->lock=NULL; |
75a95f82bc1f
Updated the Amiga OS port of SDL (thanks Gabriele)
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
78 } |
75a95f82bc1f
Updated the Amiga OS port of SDL (thanks Gabriele)
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
79 |
75a95f82bc1f
Updated the Amiga OS port of SDL (thanks Gabriele)
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
80 screen->pitch=pitch; |
0 | 81 |
82 this->UpdateRects = CGX_FakeUpdate; | |
83 | |
21
75a95f82bc1f
Updated the Amiga OS port of SDL (thanks Gabriele)
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
84 D(bug("Accel video image configured (%lx, pitch %ld).\n",screen->pixels,screen->pitch)); |
0 | 85 return 0; |
86 } | |
87 | |
1336
3692456e7b0f
Use SDL_ prefixed versions of C library functions.
Sam Lantinga <slouken@libsdl.org>
parents:
1312
diff
changeset
|
88 screen->pixels = SDL_malloc(screen->h*screen->pitch); |
0 | 89 |
90 if ( screen->pixels == NULL ) { | |
91 SDL_OutOfMemory(); | |
92 return(-1); | |
93 } | |
21
75a95f82bc1f
Updated the Amiga OS port of SDL (thanks Gabriele)
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
94 |
0 | 95 SDL_Ximage=screen->pixels; |
96 | |
97 if ( SDL_Ximage == NULL ) { | |
98 SDL_SetError("Couldn't create XImage"); | |
99 return(-1); | |
100 } | |
101 | |
102 this->UpdateRects = CGX_NormalUpdate; | |
103 | |
104 return(0); | |
105 } | |
106 | |
107 void CGX_DestroyImage(_THIS, SDL_Surface *screen) | |
108 { | |
109 if ( SDL_Ximage ) { | |
1336
3692456e7b0f
Use SDL_ prefixed versions of C library functions.
Sam Lantinga <slouken@libsdl.org>
parents:
1312
diff
changeset
|
110 SDL_free(SDL_Ximage); |
0 | 111 SDL_Ximage = NULL; |
112 } | |
113 if ( screen ) { | |
114 screen->pixels = NULL; | |
255
dcb5e869f8b5
Updated Amiga port by Gabriele Greco
Sam Lantinga <slouken@libsdl.org>
parents:
252
diff
changeset
|
115 |
dcb5e869f8b5
Updated Amiga port by Gabriele Greco
Sam Lantinga <slouken@libsdl.org>
parents:
252
diff
changeset
|
116 if(screen->hwdata) { |
1336
3692456e7b0f
Use SDL_ prefixed versions of C library functions.
Sam Lantinga <slouken@libsdl.org>
parents:
1312
diff
changeset
|
117 SDL_free(screen->hwdata); |
255
dcb5e869f8b5
Updated Amiga port by Gabriele Greco
Sam Lantinga <slouken@libsdl.org>
parents:
252
diff
changeset
|
118 screen->hwdata=NULL; |
dcb5e869f8b5
Updated Amiga port by Gabriele Greco
Sam Lantinga <slouken@libsdl.org>
parents:
252
diff
changeset
|
119 } |
0 | 120 } |
121 } | |
122 | |
21
75a95f82bc1f
Updated the Amiga OS port of SDL (thanks Gabriele)
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
123 /* This is a hack to see whether this system has more than 1 CPU */ |
75a95f82bc1f
Updated the Amiga OS port of SDL (thanks Gabriele)
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
124 static int num_CPU(void) |
75a95f82bc1f
Updated the Amiga OS port of SDL (thanks Gabriele)
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
125 { |
75a95f82bc1f
Updated the Amiga OS port of SDL (thanks Gabriele)
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
126 return 1; |
75a95f82bc1f
Updated the Amiga OS port of SDL (thanks Gabriele)
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
127 } |
75a95f82bc1f
Updated the Amiga OS port of SDL (thanks Gabriele)
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
128 |
0 | 129 int CGX_ResizeImage(_THIS, SDL_Surface *screen, Uint32 flags) |
130 { | |
131 int retval; | |
132 | |
255
dcb5e869f8b5
Updated Amiga port by Gabriele Greco
Sam Lantinga <slouken@libsdl.org>
parents:
252
diff
changeset
|
133 D(bug("Calling ResizeImage()\n")); |
21
75a95f82bc1f
Updated the Amiga OS port of SDL (thanks Gabriele)
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
134 |
0 | 135 CGX_DestroyImage(this, screen); |
136 | |
255
dcb5e869f8b5
Updated Amiga port by Gabriele Greco
Sam Lantinga <slouken@libsdl.org>
parents:
252
diff
changeset
|
137 if ( flags & SDL_OPENGL ) { /* No image when using GL */ |
0 | 138 retval = 0; |
255
dcb5e869f8b5
Updated Amiga port by Gabriele Greco
Sam Lantinga <slouken@libsdl.org>
parents:
252
diff
changeset
|
139 } else { |
0 | 140 retval = CGX_SetupImage(this, screen); |
21
75a95f82bc1f
Updated the Amiga OS port of SDL (thanks Gabriele)
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
141 /* We support asynchronous blitting on the display */ |
75a95f82bc1f
Updated the Amiga OS port of SDL (thanks Gabriele)
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
142 if ( flags & SDL_ASYNCBLIT ) { |
75a95f82bc1f
Updated the Amiga OS port of SDL (thanks Gabriele)
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
143 if ( num_CPU() > 1 ) { |
75a95f82bc1f
Updated the Amiga OS port of SDL (thanks Gabriele)
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
144 screen->flags |= SDL_ASYNCBLIT; |
75a95f82bc1f
Updated the Amiga OS port of SDL (thanks Gabriele)
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
145 } |
75a95f82bc1f
Updated the Amiga OS port of SDL (thanks Gabriele)
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
146 } |
0 | 147 } |
148 return(retval); | |
149 } | |
150 | |
151 int CGX_AllocHWSurface(_THIS, SDL_Surface *surface) | |
152 { | |
153 D(bug("Alloc HW surface...%ld x %ld x %ld!\n",surface->w,surface->h,this->hidden->depth)); | |
154 | |
155 if(surface==SDL_VideoSurface) | |
156 { | |
157 D(bug("Allocation skipped, it's system one!\n")); | |
158 return 0; | |
159 } | |
160 | |
161 if(!surface->hwdata) | |
162 { | |
1336
3692456e7b0f
Use SDL_ prefixed versions of C library functions.
Sam Lantinga <slouken@libsdl.org>
parents:
1312
diff
changeset
|
163 if(!(surface->hwdata=SDL_malloc(sizeof(struct private_hwdata)))) |
0 | 164 return -1; |
165 } | |
166 | |
255
dcb5e869f8b5
Updated Amiga port by Gabriele Greco
Sam Lantinga <slouken@libsdl.org>
parents:
252
diff
changeset
|
167 surface->hwdata->mask=NULL; |
21
75a95f82bc1f
Updated the Amiga OS port of SDL (thanks Gabriele)
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
168 surface->hwdata->lock=NULL; |
75a95f82bc1f
Updated the Amiga OS port of SDL (thanks Gabriele)
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
169 surface->hwdata->videodata=this; |
255
dcb5e869f8b5
Updated Amiga port by Gabriele Greco
Sam Lantinga <slouken@libsdl.org>
parents:
252
diff
changeset
|
170 surface->hwdata->allocated=0; |
21
75a95f82bc1f
Updated the Amiga OS port of SDL (thanks Gabriele)
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
171 |
0 | 172 if(surface->hwdata->bmap=AllocBitMap(surface->w,surface->h,this->hidden->depth,BMF_MINPLANES,SDL_Display->RastPort.BitMap)) |
173 { | |
255
dcb5e869f8b5
Updated Amiga port by Gabriele Greco
Sam Lantinga <slouken@libsdl.org>
parents:
252
diff
changeset
|
174 surface->hwdata->allocated=1; |
0 | 175 surface->flags|=SDL_HWSURFACE; |
176 D(bug("...OK\n")); | |
177 return 0; | |
178 } | |
179 else | |
180 { | |
1336
3692456e7b0f
Use SDL_ prefixed versions of C library functions.
Sam Lantinga <slouken@libsdl.org>
parents:
1312
diff
changeset
|
181 SDL_free(surface->hwdata); |
0 | 182 surface->hwdata=NULL; |
183 } | |
184 | |
185 return(-1); | |
186 } | |
187 void CGX_FreeHWSurface(_THIS, SDL_Surface *surface) | |
188 { | |
189 if(surface && surface!=SDL_VideoSurface && surface->hwdata) | |
190 { | |
191 D(bug("Free hw surface.\n")); | |
192 | |
193 if(surface->hwdata->mask) | |
1336
3692456e7b0f
Use SDL_ prefixed versions of C library functions.
Sam Lantinga <slouken@libsdl.org>
parents:
1312
diff
changeset
|
194 SDL_free(surface->hwdata->mask); |
0 | 195 |
255
dcb5e869f8b5
Updated Amiga port by Gabriele Greco
Sam Lantinga <slouken@libsdl.org>
parents:
252
diff
changeset
|
196 if(surface->hwdata->bmap&&surface->hwdata->allocated) |
0 | 197 FreeBitMap(surface->hwdata->bmap); |
198 | |
1336
3692456e7b0f
Use SDL_ prefixed versions of C library functions.
Sam Lantinga <slouken@libsdl.org>
parents:
1312
diff
changeset
|
199 SDL_free(surface->hwdata); |
0 | 200 surface->hwdata=NULL; |
255
dcb5e869f8b5
Updated Amiga port by Gabriele Greco
Sam Lantinga <slouken@libsdl.org>
parents:
252
diff
changeset
|
201 surface->pixels=NULL; |
dcb5e869f8b5
Updated Amiga port by Gabriele Greco
Sam Lantinga <slouken@libsdl.org>
parents:
252
diff
changeset
|
202 D(bug("end of free hw surface\n")); |
0 | 203 } |
204 return; | |
205 } | |
206 | |
207 int CGX_LockHWSurface(_THIS, SDL_Surface *surface) | |
208 { | |
209 if (surface->hwdata) | |
210 { | |
211 // D(bug("Locking a bitmap...\n")); | |
212 if(!surface->hwdata->lock) | |
213 { | |
214 Uint32 pitch; | |
215 | |
216 if(!(surface->hwdata->lock=LockBitMapTags(surface->hwdata->bmap, | |
217 LBMI_BASEADDRESS,(ULONG)&surface->pixels, | |
218 LBMI_BYTESPERROW,(ULONG)&pitch,TAG_DONE))) | |
219 return -1; | |
220 | |
221 // surface->pitch e' a 16bit! | |
222 | |
223 surface->pitch=pitch; | |
224 | |
225 if(!currently_fullscreen&&surface==SDL_VideoSurface) | |
226 surface->pixels=((char *)surface->pixels)+(surface->pitch*(SDL_Window->BorderTop+SDL_Window->TopEdge)+ | |
227 surface->format->BytesPerPixel*(SDL_Window->BorderLeft+SDL_Window->LeftEdge)); | |
228 } | |
255
dcb5e869f8b5
Updated Amiga port by Gabriele Greco
Sam Lantinga <slouken@libsdl.org>
parents:
252
diff
changeset
|
229 D(else bug("Already locked!!!\n")); |
0 | 230 } |
231 return(0); | |
232 } | |
255
dcb5e869f8b5
Updated Amiga port by Gabriele Greco
Sam Lantinga <slouken@libsdl.org>
parents:
252
diff
changeset
|
233 |
0 | 234 void CGX_UnlockHWSurface(_THIS, SDL_Surface *surface) |
235 { | |
236 if(surface->hwdata && surface->hwdata->lock) | |
237 { | |
238 UnLockBitMap(surface->hwdata->lock); | |
239 surface->hwdata->lock=NULL; | |
21
75a95f82bc1f
Updated the Amiga OS port of SDL (thanks Gabriele)
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
240 // surface->pixels=NULL; |
0 | 241 } |
242 } | |
243 | |
244 int CGX_FlipHWSurface(_THIS, SDL_Surface *surface) | |
245 { | |
246 static int current=0; | |
247 | |
248 if(this->hidden->dbuffer) | |
249 { | |
250 if(!SafeChange) | |
251 { | |
252 Wait(disp_sigbit); | |
253 // Non faccio nulla, vuoto solo la porta | |
254 while(GetMsg(dispport)!=NULL) | |
255 ; | |
256 SafeChange=TRUE; | |
257 } | |
258 | |
259 if(ChangeScreenBuffer(SDL_Display,this->hidden->SB[current^1])) | |
260 { | |
261 surface->hwdata->bmap=SDL_RastPort->BitMap=this->hidden->SB[current]->sb_BitMap; | |
262 SafeChange=FALSE; | |
263 SafeDisp=FALSE; | |
264 current^=1; | |
265 } | |
266 | |
267 if(!SafeDisp) | |
268 { | |
269 Wait(safe_sigbit); | |
270 while(GetMsg(safeport)!=NULL) | |
271 ; | |
272 SafeDisp=TRUE; | |
273 } | |
274 | |
275 } | |
276 return(0); | |
277 } | |
278 | |
279 /* Byte-swap the pixels in the display image */ | |
280 static void CGX_SwapAllPixels(SDL_Surface *screen) | |
281 { | |
282 int x, y; | |
283 | |
284 switch (screen->format->BytesPerPixel) { | |
285 case 2: { | |
286 Uint16 *spot; | |
287 for ( y=0; y<screen->h; ++y ) { | |
288 spot = (Uint16 *) ((Uint8 *)screen->pixels + | |
289 y * screen->pitch); | |
290 for ( x=0; x<screen->w; ++x, ++spot ) { | |
291 *spot = SDL_Swap16(*spot); | |
292 } | |
293 } | |
294 } | |
295 break; | |
296 | |
297 case 4: { | |
298 Uint32 *spot; | |
299 for ( y=0; y<screen->h; ++y ) { | |
300 spot = (Uint32 *) ((Uint8 *)screen->pixels + | |
301 y * screen->pitch); | |
302 for ( x=0; x<screen->w; ++x, ++spot ) { | |
303 *spot = SDL_Swap32(*spot); | |
304 } | |
305 } | |
306 } | |
307 break; | |
308 | |
309 default: | |
310 /* should never get here */ | |
311 break; | |
312 } | |
313 } | |
314 static void CGX_SwapPixels(SDL_Surface *screen, int numrects, SDL_Rect *rects) | |
315 { | |
316 int i; | |
317 int x, minx, maxx; | |
318 int y, miny, maxy; | |
319 | |
320 switch (screen->format->BytesPerPixel) { | |
321 case 2: { | |
322 Uint16 *spot; | |
323 for ( i=0; i<numrects; ++i ) { | |
324 minx = rects[i].x; | |
325 maxx = rects[i].x+rects[i].w; | |
326 miny = rects[i].y; | |
327 maxy = rects[i].y+rects[i].h; | |
328 for ( y=miny; y<maxy; ++y ) { | |
329 spot = (Uint16 *) ((Uint8 *)screen->pixels + | |
330 y * screen->pitch + minx * 2); | |
331 for ( x=minx; x<maxx; ++x, ++spot ) { | |
332 *spot = SDL_Swap16(*spot); | |
333 } | |
334 } | |
335 } | |
336 } | |
337 break; | |
338 | |
339 case 4: { | |
340 Uint32 *spot; | |
341 for ( i=0; i<numrects; ++i ) { | |
342 minx = rects[i].x; | |
343 maxx = rects[i].x+rects[i].w; | |
344 miny = rects[i].y; | |
345 maxy = rects[i].y+rects[i].h; | |
346 for ( y=miny; y<maxy; ++y ) { | |
347 spot = (Uint32 *) ((Uint8 *)screen->pixels + | |
348 y * screen->pitch + minx * 4); | |
349 for ( x=minx; x<maxx; ++x, ++spot ) { | |
350 *spot = SDL_Swap32(*spot); | |
351 } | |
352 } | |
353 } | |
354 } | |
355 break; | |
356 | |
357 default: | |
358 /* should never get here */ | |
359 break; | |
360 } | |
361 } | |
362 | |
363 #ifdef __SASC | |
364 | |
365 #define USE_WPA WritePixelArray | |
366 #else | |
367 | |
368 void USE_WPA(char *a,int b,int c,int d, struct RastPort *e,int f,int g, int h, int i, Uint32 l) | |
369 { | |
370 WritePixelArray(a,b,c,d,e,f,g,h,i,l); | |
371 } | |
372 | |
373 #endif | |
374 | |
375 static void CGX_FakeUpdate(_THIS, int numrects, SDL_Rect *rects) | |
376 { | |
377 } | |
378 | |
379 static void CGX_NormalUpdate(_THIS, int numrects, SDL_Rect *rects) | |
380 { | |
381 int i,format,customroutine=0; | |
382 #ifndef USE_CGX_WRITELUTPIXEL | |
383 int bpp; | |
384 #endif | |
255
dcb5e869f8b5
Updated Amiga port by Gabriele Greco
Sam Lantinga <slouken@libsdl.org>
parents:
252
diff
changeset
|
385 if(this->hidden->same_format && !use_picasso96) |
0 | 386 { |
387 format=RECTFMT_RAW; | |
388 } | |
389 else switch(this->screen->format->BytesPerPixel) | |
390 { | |
391 case 4: | |
392 format=RECTFMT_RGBA; | |
393 break; | |
394 case 3: | |
395 format=RECTFMT_RGB; | |
396 break; | |
397 case 2: | |
398 customroutine=1; | |
399 break; | |
400 case 1: | |
401 // D(bug("soft depth: 8 hardbpp: %ld\n",this->hidden->depth)); | |
402 if(this->hidden->depth>8) | |
403 { | |
404 #ifndef USE_CGX_WRITELUTPIXEL | |
405 if(this->hidden->depth>32) | |
406 customroutine=4; | |
407 else if(this->hidden->depth>16) | |
408 { | |
409 bpp=this->hidden->BytesPerPixel; // That one is the only one that needs bpp | |
410 customroutine=2; // The slow one! | |
411 } | |
412 else | |
413 customroutine=3; | |
414 #else | |
415 | |
416 customroutine=2; | |
417 #endif | |
418 | |
419 // format=RECTFMT_LUT8; Vecchia funzione x usare la WritePixelArray. | |
420 } | |
421 else | |
422 customroutine=1; | |
423 break; | |
424 default: | |
425 D(bug("Unable to blit this surface!\n")); | |
426 return; | |
427 } | |
428 | |
429 /* Check for endian-swapped X server, swap if necessary (VERY slow!) */ | |
430 if ( swap_pixels && | |
431 ((this->screen->format->BytesPerPixel%2) == 0) ) { | |
255
dcb5e869f8b5
Updated Amiga port by Gabriele Greco
Sam Lantinga <slouken@libsdl.org>
parents:
252
diff
changeset
|
432 D(bug("Software Swapping! SLOOOW!\n")); |
0 | 433 CGX_SwapPixels(this->screen, numrects, rects); |
434 for ( i=0; i<numrects; ++i ) { | |
435 if ( ! rects[i].w ) { /* Clipped? */ | |
436 continue; | |
437 } | |
438 USE_WPA(this->screen->pixels,rects[i].x, rects[i].y,this->screen->pitch, | |
439 SDL_RastPort,SDL_Window->BorderLeft+rects[i].x,SDL_Window->BorderTop+rects[i].y, | |
440 rects[i].w,rects[i].h,format); | |
441 } | |
442 CGX_SwapPixels(this->screen, numrects, rects); | |
443 } | |
444 else if (customroutine==2) | |
445 { | |
446 #ifdef USE_CGX_WRITELUTPIXEL | |
447 for ( i=0; i<numrects; ++i ) { | |
448 if ( ! rects[i].w ) { /* Clipped? */ | |
449 continue; | |
450 } | |
451 | |
452 WLUT(this->screen->pixels,rects[i].x, rects[i].y,this->screen->pitch, | |
453 SDL_RastPort,SDL_XPixels,SDL_Window->BorderLeft+rects[i].x,SDL_Window->BorderTop+rects[i].y, | |
454 rects[i].w,rects[i].h,CTABFMT_XRGB8); | |
455 } | |
456 #else | |
457 unsigned char *bm_address; | |
458 Uint32 destpitch; | |
459 APTR handle; | |
460 | |
461 if(handle=LockBitMapTags(SDL_RastPort->BitMap,LBMI_BASEADDRESS,&bm_address, | |
462 LBMI_BYTESPERROW,&destpitch,TAG_DONE)) | |
463 { | |
464 int srcwidth; | |
465 unsigned char *destbase; | |
466 register int j,k,t; | |
467 register unsigned char *mask,*dst; | |
468 register unsigned char *src,*dest; | |
469 | |
470 // Aggiungo il bordo della finestra se sono fullscreen. | |
471 if(currently_fullscreen) | |
472 destbase=bm_address; | |
473 else | |
474 destbase=bm_address+(SDL_Window->TopEdge+SDL_Window->BorderTop)*destpitch+(SDL_Window->BorderLeft+SDL_Window->LeftEdge)*this->hidden->BytesPerPixel; | |
475 | |
476 for ( i=0; i<numrects; ++i ) | |
477 { | |
478 srcwidth=rects[i].w; | |
479 | |
480 if ( !srcwidth ) { /* Clipped? */ | |
481 continue; | |
482 } | |
483 | |
484 dest=destbase+rects[i].x*this->hidden->BytesPerPixel; | |
485 dest+=(rects[i].y*destpitch); | |
486 src=((char *)(this->screen->pixels))+rects[i].x; | |
487 src+=(rects[i].y*this->screen->pitch); | |
488 | |
489 for(j=rects[i].h;j;--j) | |
490 { | |
491 dst=dest; | |
492 // SLOW routine, used for 8->24 bit mapping | |
493 for(k=0;k<srcwidth;k++) | |
494 { | |
495 mask=(unsigned char *)(&SDL_XPixels[src[k]]); | |
496 for(t=0;t<bpp;t++) | |
497 { | |
498 dst[t]=mask[t]; | |
499 } | |
500 dst+=bpp; | |
501 } | |
502 src+=this->screen->pitch; | |
503 dest+=destpitch; | |
504 } | |
505 } | |
506 UnLockBitMap(handle); | |
507 } | |
508 } | |
509 else if (customroutine==3) | |
510 { | |
511 unsigned char *bm_address; | |
512 Uint32 destpitch; | |
513 APTR handle; | |
514 | |
515 if(handle=LockBitMapTags(SDL_RastPort->BitMap,LBMI_BASEADDRESS,&bm_address, | |
516 LBMI_BYTESPERROW,&destpitch,TAG_DONE)) | |
517 { | |
518 int srcwidth; | |
519 unsigned char *destbase; | |
520 register int j,k; | |
521 register unsigned char *src,*dest; | |
522 register Uint16 *destl,*srcl; | |
523 | |
524 if(currently_fullscreen) | |
525 destbase=bm_address; | |
526 else | |
527 destbase=bm_address+(SDL_Window->TopEdge+SDL_Window->BorderTop)*destpitch+(SDL_Window->BorderLeft+SDL_Window->LeftEdge)*this->hidden->BytesPerPixel; | |
528 | |
529 for ( i=0; i<numrects; ++i ) | |
530 { | |
531 srcwidth=rects[i].w; | |
532 | |
533 if ( !srcwidth ) { /* Clipped? */ | |
534 continue; | |
535 } | |
536 | |
537 dest=destbase+rects[i].x*this->hidden->BytesPerPixel; | |
538 dest+=(rects[i].y*destpitch); | |
539 src=((char *)(this->screen->pixels))+rects[i].x; | |
540 src+=(rects[i].y*this->screen->pitch); | |
541 | |
542 // This is the fast, well not too slow, remapping code for 16bit displays | |
543 | |
544 for(j=rects[i].h;j;--j) | |
545 { | |
546 destl=(Uint16 *)dest; | |
547 | |
548 for(k=0;k<srcwidth;k++) | |
549 { | |
550 srcl=(Uint16 *)&SDL_XPixels[src[k]]; | |
551 *destl=*srcl; | |
552 destl++; | |
553 } | |
554 src+=this->screen->pitch; | |
555 dest+=destpitch; | |
556 } | |
557 } | |
558 UnLockBitMap(handle); | |
559 } | |
560 } | |
561 else if (customroutine==4) | |
562 { | |
563 unsigned char *bm_address; | |
564 Uint32 destpitch; | |
565 APTR handle; | |
566 | |
567 if(handle=LockBitMapTags(SDL_RastPort->BitMap,LBMI_BASEADDRESS,&bm_address, | |
568 LBMI_BYTESPERROW,&destpitch,TAG_DONE)) | |
569 { | |
570 int srcwidth; | |
571 unsigned char *destbase; | |
572 register int j,k; | |
573 register unsigned char *src,*dest; | |
574 register Uint32 *destl,*srcl; | |
575 | |
576 if(currently_fullscreen) | |
577 destbase=bm_address; | |
578 else | |
579 destbase=bm_address+(SDL_Window->TopEdge+SDL_Window->BorderTop)*destpitch+(SDL_Window->BorderLeft+SDL_Window->LeftEdge)*this->hidden->BytesPerPixel; | |
580 | |
581 for ( i=0; i<numrects; ++i ) | |
582 { | |
583 srcwidth=rects[i].w; | |
584 | |
585 if ( !srcwidth ) { /* Clipped? */ | |
586 continue; | |
587 } | |
588 | |
589 dest=destbase+rects[i].x*this->hidden->BytesPerPixel; | |
590 dest+=(rects[i].y*destpitch); | |
591 src=((char *)(this->screen->pixels))+rects[i].x; | |
592 src+=(rects[i].y*this->screen->pitch); | |
593 | |
594 // This is the fast, well not too slow, remapping code for 32bit displays | |
595 | |
596 for(j=rects[i].h;j;--j) | |
597 { | |
598 destl=(Uint32 *)dest; | |
599 | |
600 for(k=0;k<srcwidth;k++) | |
601 { | |
602 srcl=(Uint32 *)&SDL_XPixels[src[k]]; | |
603 *destl=*srcl; | |
604 destl++; | |
605 } | |
606 src+=this->screen->pitch; | |
607 dest+=destpitch; | |
608 } | |
609 } | |
610 UnLockBitMap(handle); | |
611 } | |
612 #endif | |
613 } | |
614 else if(customroutine) | |
615 { | |
616 unsigned char *bm_address; | |
617 Uint32 destpitch; | |
618 APTR handle; | |
619 | |
255
dcb5e869f8b5
Updated Amiga port by Gabriele Greco
Sam Lantinga <slouken@libsdl.org>
parents:
252
diff
changeset
|
620 // D(bug("Using customroutine!\n")); |
0 | 621 |
622 if(handle=LockBitMapTags(SDL_RastPort->BitMap,LBMI_BASEADDRESS,(ULONG)&bm_address, | |
623 LBMI_BYTESPERROW,(ULONG)&destpitch,TAG_DONE)) | |
624 { | |
625 unsigned char *destbase; | |
626 register int j,srcwidth; | |
627 register unsigned char *src,*dest; | |
628 | |
629 // Aggiungo il bordo della finestra se sono fullscreen. | |
630 if(currently_fullscreen) | |
631 destbase=bm_address; | |
632 else | |
633 destbase=bm_address+(SDL_Window->TopEdge+SDL_Window->BorderTop)*destpitch+(SDL_Window->BorderLeft+SDL_Window->LeftEdge)*this->screen->format->BytesPerPixel; | |
634 | |
635 for ( i=0; i<numrects; ++i ) | |
636 { | |
637 srcwidth=rects[i].w; | |
638 | |
639 if ( !srcwidth ) { /* Clipped? */ | |
640 continue; | |
641 } | |
642 | |
643 dest=destbase+rects[i].x*this->screen->format->BytesPerPixel; | |
644 dest+=(rects[i].y*destpitch); | |
645 src=((char *)(this->screen->pixels))+rects[i].x*this->screen->format->BytesPerPixel; | |
646 src+=(rects[i].y*this->screen->pitch); | |
647 | |
648 srcwidth*=this->screen->format->BytesPerPixel; | |
649 | |
650 // D(bug("Rects: %ld,%ld %ld,%ld Src:%lx Dest:%lx\n",rects[i].x,rects[i].y,rects[i].w,rects[i].h,src,dest)); | |
651 | |
652 for(j=rects[i].h;j;--j) | |
653 { | |
1336
3692456e7b0f
Use SDL_ prefixed versions of C library functions.
Sam Lantinga <slouken@libsdl.org>
parents:
1312
diff
changeset
|
654 SDL_memcpy(dest,src,srcwidth); |
0 | 655 src+=this->screen->pitch; |
656 dest+=destpitch; | |
657 } | |
658 } | |
659 UnLockBitMap(handle); | |
660 // D(bug("Rectblit addr: %lx pitch: %ld rects:%ld srcptr: %lx srcpitch: %ld\n",bm_address,destpitch,numrects,this->screen->pixels,this->screen->pitch)); | |
661 } | |
662 } | |
663 else | |
664 { | |
665 for ( i=0; i<numrects; ++i ) { | |
666 if ( ! rects[i].w ) { /* Clipped? */ | |
667 continue; | |
668 } | |
669 USE_WPA(this->screen->pixels,rects[i].x, rects[i].y,this->screen->pitch, | |
670 SDL_RastPort,SDL_Window->BorderLeft+rects[i].x,SDL_Window->BorderTop+rects[i].y, | |
671 rects[i].w,rects[i].h,format); | |
672 } | |
673 } | |
674 } | |
675 | |
676 void CGX_RefreshDisplay(_THIS) | |
677 { | |
678 int format,customroutine=0; | |
679 #ifndef USE_CGX_WRITELUTPIXEL | |
680 int bpp; | |
681 #endif | |
682 /* Don't refresh a display that doesn't have an image (like GL) */ | |
683 if ( ! SDL_Ximage ) { | |
684 return; | |
685 } | |
686 | |
255
dcb5e869f8b5
Updated Amiga port by Gabriele Greco
Sam Lantinga <slouken@libsdl.org>
parents:
252
diff
changeset
|
687 if(this->hidden->same_format && !use_picasso96) |
0 | 688 { |
689 format=RECTFMT_RAW; | |
690 } | |
691 else switch(this->screen->format->BytesPerPixel) | |
692 { | |
693 case 4: | |
694 format=RECTFMT_RGBA; | |
695 break; | |
696 case 3: | |
697 format=RECTFMT_RGB; | |
698 break; | |
699 case 2: | |
700 customroutine=1; | |
701 break; | |
702 case 1: | |
703 // D(bug("soft depth: 8 hardbpp: %ld\n",this->hidden->depth)); | |
704 if(this->hidden->depth>8) | |
705 { | |
706 #ifndef USE_CGX_WRITELUTPIXEL | |
707 if(this->hidden->depth>32) | |
708 customroutine=4; | |
709 else if(this->hidden->depth>16) | |
710 { | |
711 bpp=this->hidden->BytesPerPixel; // That one is the only one that needs bpp | |
712 customroutine=2; // The slow one! | |
713 } | |
714 else | |
715 customroutine=3; | |
716 #else | |
717 | |
718 customroutine=2; | |
719 #endif | |
720 // format=RECTFMT_LUT8; | |
721 } | |
722 else | |
723 customroutine=1; | |
724 break; | |
725 | |
726 } | |
727 | |
728 /* Check for endian-swapped X server, swap if necessary */ | |
729 if ( swap_pixels && | |
730 ((this->screen->format->BytesPerPixel%2) == 0) ) { | |
731 CGX_SwapAllPixels(this->screen); | |
732 USE_WPA(this->screen->pixels,0,0,this->screen->pitch, | |
733 SDL_RastPort,SDL_Window->BorderLeft,SDL_Window->BorderTop, | |
734 this->screen->w,this->screen->h,format); | |
735 CGX_SwapAllPixels(this->screen); | |
736 } | |
737 else if (customroutine==2) | |
738 { | |
739 #ifdef USE_CGX_WRITELUTPIXEL | |
740 WLUT(this->screen->pixels,0,0,this->screen->pitch, | |
741 SDL_RastPort,SDL_XPixels,SDL_Window->BorderLeft,SDL_Window->BorderTop, | |
742 this->screen->w,this->screen->h,CTABFMT_XRGB8); | |
743 #else | |
744 unsigned char *bm_address; | |
745 Uint32 destpitch; | |
746 APTR handle; | |
747 | |
748 if(handle=LockBitMapTags(SDL_RastPort->BitMap,LBMI_BASEADDRESS,(ULONG)&bm_address, | |
749 LBMI_BYTESPERROW,(ULONG)&destpitch,TAG_DONE)) | |
750 { | |
751 register int j,k,t; | |
752 register unsigned char *mask,*dst; | |
753 register unsigned char *src,*dest; | |
754 | |
755 // Aggiungo il bordo della finestra se sono fullscreen. | |
756 if(!currently_fullscreen) | |
757 dest=bm_address+(SDL_Window->TopEdge+SDL_Window->BorderTop)*destpitch+(SDL_Window->BorderLeft+SDL_Window->LeftEdge)*this->hidden->BytesPerPixel; | |
758 else | |
759 dest=bm_address; | |
760 | |
761 src=this->screen->pixels; | |
762 | |
763 for(j=this->screen->h;j;--j) | |
764 { | |
765 dst=dest; | |
766 // SLOW routine, used for 8->24 bit mapping | |
767 for(k=0;k<this->screen->w;k++) | |
768 { | |
769 mask=(unsigned char *)(&SDL_XPixels[src[k]]); | |
770 for(t=0;t<bpp;t++) | |
771 { | |
772 dst[t]=mask[t]; | |
773 } | |
774 dst+=bpp; | |
775 } | |
776 src+=this->screen->pitch; | |
777 dest+=destpitch; | |
778 } | |
779 UnLockBitMap(handle); | |
780 } | |
781 } | |
782 else if (customroutine==3) | |
783 { | |
784 unsigned char *bm_address; | |
785 Uint32 destpitch; | |
786 APTR handle; | |
787 | |
788 if(handle=LockBitMapTags(SDL_RastPort->BitMap,LBMI_BASEADDRESS,(ULONG)&bm_address, | |
789 LBMI_BYTESPERROW,(ULONG)&destpitch,TAG_DONE)) | |
790 { | |
791 register int j,k; | |
792 register unsigned char *src,*dest; | |
793 register Uint16 *destl,*srcl; | |
794 | |
795 if(!currently_fullscreen) | |
796 dest=bm_address+(SDL_Window->TopEdge+SDL_Window->BorderTop)*destpitch+(SDL_Window->BorderLeft+SDL_Window->LeftEdge)*this->hidden->BytesPerPixel; | |
797 else | |
798 dest=bm_address; | |
799 | |
800 src=this->screen->pixels; | |
801 | |
802 // This is the fast, well not too slow, remapping code for 16bit displays | |
803 | |
804 for(j=this->screen->h;j;--j) | |
805 { | |
806 destl=(Uint16 *)dest; | |
807 | |
808 for(k=0;k<this->screen->w;k++) | |
809 { | |
810 srcl=(Uint16 *)&SDL_XPixels[src[k]]; | |
811 *destl=*srcl; | |
812 destl++; | |
813 } | |
814 src+=this->screen->pitch; | |
815 dest+=destpitch; | |
816 } | |
817 UnLockBitMap(handle); | |
818 } | |
819 } | |
820 else if (customroutine==4) | |
821 { | |
822 unsigned char *bm_address; | |
823 Uint32 destpitch; | |
824 APTR handle; | |
825 | |
826 if(handle=LockBitMapTags(SDL_RastPort->BitMap,LBMI_BASEADDRESS,(ULONG)&bm_address, | |
827 LBMI_BYTESPERROW,(ULONG)&destpitch,TAG_DONE)) | |
828 { | |
829 register int j,k; | |
830 register unsigned char *src,*dest; | |
831 register Uint32 *destl,*srcl; | |
832 | |
833 if(!currently_fullscreen) | |
834 dest=bm_address+(SDL_Window->TopEdge+SDL_Window->BorderTop)*destpitch+(SDL_Window->BorderLeft+SDL_Window->LeftEdge)*this->hidden->BytesPerPixel; | |
835 else | |
836 dest=bm_address; | |
837 | |
838 src=this->screen->pixels; | |
839 | |
840 // This is the fast, well not too slow, remapping code for 32bit displays | |
841 | |
842 for(j=this->screen->h;j;--j) | |
843 { | |
844 destl=(Uint32 *)dest; | |
845 | |
846 for(k=0;k<this->screen->w;k++) | |
847 { | |
848 srcl=(Uint32 *)&SDL_XPixels[src[k]]; | |
849 *destl=*srcl; | |
850 destl++; | |
851 } | |
852 src+=this->screen->pitch; | |
853 dest+=destpitch; | |
854 } | |
855 UnLockBitMap(handle); | |
856 } | |
857 #endif | |
858 } | |
859 else if(customroutine) | |
860 { | |
861 unsigned char *bm_address; | |
862 Uint32 destpitch; | |
863 APTR handle; | |
864 | |
865 if(handle=LockBitMapTags(SDL_RastPort->BitMap, | |
866 LBMI_BASEADDRESS,(ULONG)&bm_address, | |
867 LBMI_BYTESPERROW,(ULONG)&destpitch,TAG_DONE)) | |
868 { | |
869 register int j; | |
870 register unsigned char *src,*dest; | |
871 | |
872 if(!currently_fullscreen) | |
873 dest=bm_address+(SDL_Window->TopEdge+SDL_Window->BorderTop)*destpitch+(SDL_Window->BorderLeft+SDL_Window->LeftEdge)*this->screen->format->BytesPerPixel; | |
874 else | |
875 dest=bm_address; | |
876 | |
877 src=this->screen->pixels; | |
878 | |
879 // D(bug("addr: %lx pitch: %ld src:%lx srcpitch: %ld\n",dest,destpitch,this->screen->pixels,this->screen->pitch)); | |
880 | |
881 if(this->screen->pitch==destpitch) | |
882 { | |
1336
3692456e7b0f
Use SDL_ prefixed versions of C library functions.
Sam Lantinga <slouken@libsdl.org>
parents:
1312
diff
changeset
|
883 SDL_memcpy(dest,src,this->screen->pitch*this->screen->h); |
0 | 884 } |
885 else | |
886 { | |
887 for(j=this->screen->h;j;--j) | |
888 { | |
1336
3692456e7b0f
Use SDL_ prefixed versions of C library functions.
Sam Lantinga <slouken@libsdl.org>
parents:
1312
diff
changeset
|
889 SDL_memcpy(dest,src,this->screen->pitch); |
0 | 890 src+=this->screen->pitch; |
891 dest+=destpitch; | |
892 } | |
893 } | |
894 | |
895 UnLockBitMap(handle); | |
896 } | |
897 } | |
898 else | |
899 { | |
900 USE_WPA(this->screen->pixels,0,0,this->screen->pitch, | |
901 SDL_RastPort,SDL_Window->BorderLeft,SDL_Window->BorderTop, | |
902 this->screen->w,this->screen->h,format); | |
903 } | |
904 | |
905 } |