comparison src/video/SDL_blit_0.c @ 2262:bee005ace1bf

Work in progress: merging new texture features into SDL blit system
author Sam Lantinga <slouken@libsdl.org>
date Fri, 17 Aug 2007 06:21:58 +0000
parents 340942cfda48
children c785543d1843
comparison
equal deleted inserted replaced
2261:c20476d7d7b3 2262:bee005ace1bf
33 int width, height; 33 int width, height;
34 Uint8 *src, *map, *dst; 34 Uint8 *src, *map, *dst;
35 int srcskip, dstskip; 35 int srcskip, dstskip;
36 36
37 /* Set up some basic variables */ 37 /* Set up some basic variables */
38 width = info->d_width; 38 width = info->dst_w;
39 height = info->d_height; 39 height = info->dst_h;
40 src = info->s_pixels; 40 src = info->src;
41 srcskip = info->s_skip; 41 srcskip = info->s_skip;
42 dst = info->d_pixels; 42 dst = info->dst;
43 dstskip = info->d_skip; 43 dstskip = info->dst_pitch;
44 map = info->table; 44 map = info->table;
45 srcskip += width - (width + 7) / 8; 45 srcskip += width - (width + 7) / 8;
46 46
47 if (map) { 47 if (map) {
48 while (height--) { 48 while (height--) {
88 Uint8 *src; 88 Uint8 *src;
89 Uint16 *map, *dst; 89 Uint16 *map, *dst;
90 int srcskip, dstskip; 90 int srcskip, dstskip;
91 91
92 /* Set up some basic variables */ 92 /* Set up some basic variables */
93 width = info->d_width; 93 width = info->dst_w;
94 height = info->d_height; 94 height = info->dst_h;
95 src = info->s_pixels; 95 src = info->src;
96 srcskip = info->s_skip; 96 srcskip = info->s_skip;
97 dst = (Uint16 *) info->d_pixels; 97 dst = (Uint16 *) info->dst;
98 dstskip = info->d_skip / 2; 98 dstskip = info->dst_pitch / 2;
99 map = (Uint16 *) info->table; 99 map = (Uint16 *) info->table;
100 srcskip += width - (width + 7) / 8; 100 srcskip += width - (width + 7) / 8;
101 101
102 while (height--) { 102 while (height--) {
103 Uint8 byte = 0, bit; 103 Uint8 byte = 0, bit;
123 int width, height; 123 int width, height;
124 Uint8 *src, *map, *dst; 124 Uint8 *src, *map, *dst;
125 int srcskip, dstskip; 125 int srcskip, dstskip;
126 126
127 /* Set up some basic variables */ 127 /* Set up some basic variables */
128 width = info->d_width; 128 width = info->dst_w;
129 height = info->d_height; 129 height = info->dst_h;
130 src = info->s_pixels; 130 src = info->src;
131 srcskip = info->s_skip; 131 srcskip = info->s_skip;
132 dst = info->d_pixels; 132 dst = info->dst;
133 dstskip = info->d_skip; 133 dstskip = info->dst_pitch;
134 map = info->table; 134 map = info->table;
135 srcskip += width - (width + 7) / 8; 135 srcskip += width - (width + 7) / 8;
136 136
137 while (height--) { 137 while (height--) {
138 Uint8 byte = 0, bit; 138 Uint8 byte = 0, bit;
162 Uint32 *map, *dst; 162 Uint32 *map, *dst;
163 int srcskip, dstskip; 163 int srcskip, dstskip;
164 int c; 164 int c;
165 165
166 /* Set up some basic variables */ 166 /* Set up some basic variables */
167 width = info->d_width; 167 width = info->dst_w;
168 height = info->d_height; 168 height = info->dst_h;
169 src = info->s_pixels; 169 src = info->src;
170 srcskip = info->s_skip; 170 srcskip = info->s_skip;
171 dst = (Uint32 *) info->d_pixels; 171 dst = (Uint32 *) info->dst;
172 dstskip = info->d_skip / 4; 172 dstskip = info->dst_pitch / 4;
173 map = (Uint32 *) info->table; 173 map = (Uint32 *) info->table;
174 srcskip += width - (width + 7) / 8; 174 srcskip += width - (width + 7) / 8;
175 175
176 while (height--) { 176 while (height--) {
177 Uint8 byte = 0, bit; 177 Uint8 byte = 0, bit;
192 } 192 }
193 193
194 static void 194 static void
195 BlitBto1Key(SDL_BlitInfo * info) 195 BlitBto1Key(SDL_BlitInfo * info)
196 { 196 {
197 int width = info->d_width; 197 int width = info->dst_w;
198 int height = info->d_height; 198 int height = info->dst_h;
199 Uint8 *src = info->s_pixels; 199 Uint8 *src = info->src;
200 Uint8 *dst = info->d_pixels; 200 Uint8 *dst = info->dst;
201 int srcskip = info->s_skip; 201 int srcskip = info->s_skip;
202 int dstskip = info->d_skip; 202 int dstskip = info->dst_pitch;
203 Uint32 ckey = info->ckey; 203 Uint32 ckey = info->ckey;
204 Uint8 *palmap = info->table; 204 Uint8 *palmap = info->table;
205 int c; 205 int c;
206 206
207 /* Set up some basic variables */ 207 /* Set up some basic variables */
245 } 245 }
246 246
247 static void 247 static void
248 BlitBto2Key(SDL_BlitInfo * info) 248 BlitBto2Key(SDL_BlitInfo * info)
249 { 249 {
250 int width = info->d_width; 250 int width = info->dst_w;
251 int height = info->d_height; 251 int height = info->dst_h;
252 Uint8 *src = info->s_pixels; 252 Uint8 *src = info->src;
253 Uint16 *dstp = (Uint16 *) info->d_pixels; 253 Uint16 *dstp = (Uint16 *) info->dst;
254 int srcskip = info->s_skip; 254 int srcskip = info->s_skip;
255 int dstskip = info->d_skip; 255 int dstskip = info->dst_pitch;
256 Uint32 ckey = info->ckey; 256 Uint32 ckey = info->ckey;
257 Uint8 *palmap = info->table; 257 Uint8 *palmap = info->table;
258 int c; 258 int c;
259 259
260 /* Set up some basic variables */ 260 /* Set up some basic variables */
280 } 280 }
281 281
282 static void 282 static void
283 BlitBto3Key(SDL_BlitInfo * info) 283 BlitBto3Key(SDL_BlitInfo * info)
284 { 284 {
285 int width = info->d_width; 285 int width = info->dst_w;
286 int height = info->d_height; 286 int height = info->dst_h;
287 Uint8 *src = info->s_pixels; 287 Uint8 *src = info->src;
288 Uint8 *dst = info->d_pixels; 288 Uint8 *dst = info->dst;
289 int srcskip = info->s_skip; 289 int srcskip = info->s_skip;
290 int dstskip = info->d_skip; 290 int dstskip = info->dst_pitch;
291 Uint32 ckey = info->ckey; 291 Uint32 ckey = info->ckey;
292 Uint8 *palmap = info->table; 292 Uint8 *palmap = info->table;
293 int c; 293 int c;
294 294
295 /* Set up some basic variables */ 295 /* Set up some basic variables */
314 } 314 }
315 315
316 static void 316 static void
317 BlitBto4Key(SDL_BlitInfo * info) 317 BlitBto4Key(SDL_BlitInfo * info)
318 { 318 {
319 int width = info->d_width; 319 int width = info->dst_w;
320 int height = info->d_height; 320 int height = info->dst_h;
321 Uint8 *src = info->s_pixels; 321 Uint8 *src = info->src;
322 Uint32 *dstp = (Uint32 *) info->d_pixels; 322 Uint32 *dstp = (Uint32 *) info->dst;
323 int srcskip = info->s_skip; 323 int srcskip = info->s_skip;
324 int dstskip = info->d_skip; 324 int dstskip = info->dst_pitch;
325 Uint32 ckey = info->ckey; 325 Uint32 ckey = info->ckey;
326 Uint8 *palmap = info->table; 326 Uint8 *palmap = info->table;
327 int c; 327 int c;
328 328
329 /* Set up some basic variables */ 329 /* Set up some basic variables */
349 } 349 }
350 350
351 static void 351 static void
352 BlitBtoNAlpha(SDL_BlitInfo * info) 352 BlitBtoNAlpha(SDL_BlitInfo * info)
353 { 353 {
354 int width = info->d_width; 354 int width = info->dst_w;
355 int height = info->d_height; 355 int height = info->dst_h;
356 Uint8 *src = info->s_pixels; 356 Uint8 *src = info->src;
357 Uint8 *dst = info->d_pixels; 357 Uint8 *dst = info->dst;
358 int srcskip = info->s_skip; 358 int srcskip = info->s_skip;
359 int dstskip = info->d_skip; 359 int dstskip = info->dst_pitch;
360 const SDL_Color *srcpal = info->src->palette->colors; 360 const SDL_Color *srcpal = info->src->palette->colors;
361 SDL_PixelFormat *dstfmt = info->dst; 361 SDL_PixelFormat *dstfmt = info->dst;
362 int dstbpp; 362 int dstbpp;
363 int c; 363 int c;
364 const int A = (info->cmod >> 24); 364 const int A = (info->cmod >> 24);
394 } 394 }
395 395
396 static void 396 static void
397 BlitBtoNAlphaKey(SDL_BlitInfo * info) 397 BlitBtoNAlphaKey(SDL_BlitInfo * info)
398 { 398 {
399 int width = info->d_width; 399 int width = info->dst_w;
400 int height = info->d_height; 400 int height = info->dst_h;
401 Uint8 *src = info->s_pixels; 401 Uint8 *src = info->src;
402 Uint8 *dst = info->d_pixels; 402 Uint8 *dst = info->dst;
403 int srcskip = info->s_skip; 403 int srcskip = info->s_skip;
404 int dstskip = info->d_skip; 404 int dstskip = info->dst_pitch;
405 SDL_PixelFormat *srcfmt = info->src; 405 SDL_PixelFormat *srcfmt = info->src;
406 SDL_PixelFormat *dstfmt = info->dst; 406 SDL_PixelFormat *dstfmt = info->dst;
407 const SDL_Color *srcpal = srcfmt->palette->colors; 407 const SDL_Color *srcpal = srcfmt->palette->colors;
408 int dstbpp; 408 int dstbpp;
409 int c; 409 int c;