comparison src/video/SDL_blit_1.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
37 int width, height; 37 int width, height;
38 Uint8 *src, *map, *dst; 38 Uint8 *src, *map, *dst;
39 int srcskip, dstskip; 39 int srcskip, dstskip;
40 40
41 /* Set up some basic variables */ 41 /* Set up some basic variables */
42 width = info->d_width; 42 width = info->dst_w;
43 height = info->d_height; 43 height = info->dst_h;
44 src = info->s_pixels; 44 src = info->src;
45 srcskip = info->s_skip; 45 srcskip = info->s_skip;
46 dst = info->d_pixels; 46 dst = info->dst;
47 dstskip = info->d_skip; 47 dstskip = info->dst_pitch;
48 map = info->table; 48 map = info->table;
49 49
50 while (height--) { 50 while (height--) {
51 #ifdef USE_DUFFS_LOOP 51 #ifdef USE_DUFFS_LOOP
52 /* *INDENT-OFF* */ 52 /* *INDENT-OFF* */
88 Uint8 *src, *dst; 88 Uint8 *src, *dst;
89 Uint16 *map; 89 Uint16 *map;
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 = info->d_pixels; 97 dst = info->dst;
98 dstskip = info->d_skip; 98 dstskip = info->dst_pitch;
99 map = (Uint16 *) info->table; 99 map = (Uint16 *) info->table;
100 100
101 #ifdef USE_DUFFS_LOOP 101 #ifdef USE_DUFFS_LOOP
102 while (height--) { 102 while (height--) {
103 /* *INDENT-OFF* */ 103 /* *INDENT-OFF* */
194 int width, height; 194 int width, height;
195 Uint8 *src, *map, *dst; 195 Uint8 *src, *map, *dst;
196 int srcskip, dstskip; 196 int srcskip, dstskip;
197 197
198 /* Set up some basic variables */ 198 /* Set up some basic variables */
199 width = info->d_width; 199 width = info->dst_w;
200 height = info->d_height; 200 height = info->dst_h;
201 src = info->s_pixels; 201 src = info->src;
202 srcskip = info->s_skip; 202 srcskip = info->s_skip;
203 dst = info->d_pixels; 203 dst = info->dst;
204 dstskip = info->d_skip; 204 dstskip = info->dst_pitch;
205 map = info->table; 205 map = info->table;
206 206
207 while (height--) { 207 while (height--) {
208 #ifdef USE_DUFFS_LOOP 208 #ifdef USE_DUFFS_LOOP
209 /* *INDENT-OFF* */ 209 /* *INDENT-OFF* */
242 Uint8 *src; 242 Uint8 *src;
243 Uint32 *map, *dst; 243 Uint32 *map, *dst;
244 int srcskip, dstskip; 244 int srcskip, dstskip;
245 245
246 /* Set up some basic variables */ 246 /* Set up some basic variables */
247 width = info->d_width; 247 width = info->dst_w;
248 height = info->d_height; 248 height = info->dst_h;
249 src = info->s_pixels; 249 src = info->src;
250 srcskip = info->s_skip; 250 srcskip = info->s_skip;
251 dst = (Uint32 *) info->d_pixels; 251 dst = (Uint32 *) info->dst;
252 dstskip = info->d_skip / 4; 252 dstskip = info->dst_pitch / 4;
253 map = (Uint32 *) info->table; 253 map = (Uint32 *) info->table;
254 254
255 while (height--) { 255 while (height--) {
256 #ifdef USE_DUFFS_LOOP 256 #ifdef USE_DUFFS_LOOP
257 /* *INDENT-OFF* */ 257 /* *INDENT-OFF* */
281 } 281 }
282 282
283 static void 283 static void
284 Blit1to1Key(SDL_BlitInfo * info) 284 Blit1to1Key(SDL_BlitInfo * info)
285 { 285 {
286 int width = info->d_width; 286 int width = info->dst_w;
287 int height = info->d_height; 287 int height = info->dst_h;
288 Uint8 *src = info->s_pixels; 288 Uint8 *src = info->src;
289 int srcskip = info->s_skip; 289 int srcskip = info->s_skip;
290 Uint8 *dst = info->d_pixels; 290 Uint8 *dst = info->dst;
291 int dstskip = info->d_skip; 291 int dstskip = info->dst_pitch;
292 Uint8 *palmap = info->table; 292 Uint8 *palmap = info->table;
293 Uint32 ckey = info->ckey; 293 Uint32 ckey = info->ckey;
294 294
295 if (palmap) { 295 if (palmap) {
296 while (height--) { 296 while (height--) {
328 } 328 }
329 329
330 static void 330 static void
331 Blit1to2Key(SDL_BlitInfo * info) 331 Blit1to2Key(SDL_BlitInfo * info)
332 { 332 {
333 int width = info->d_width; 333 int width = info->dst_w;
334 int height = info->d_height; 334 int height = info->dst_h;
335 Uint8 *src = info->s_pixels; 335 Uint8 *src = info->src;
336 int srcskip = info->s_skip; 336 int srcskip = info->s_skip;
337 Uint16 *dstp = (Uint16 *) info->d_pixels; 337 Uint16 *dstp = (Uint16 *) info->dst;
338 int dstskip = info->d_skip; 338 int dstskip = info->dst_pitch;
339 Uint16 *palmap = (Uint16 *) info->table; 339 Uint16 *palmap = (Uint16 *) info->table;
340 Uint32 ckey = info->ckey; 340 Uint32 ckey = info->ckey;
341 341
342 /* Set up some basic variables */ 342 /* Set up some basic variables */
343 dstskip /= 2; 343 dstskip /= 2;
360 } 360 }
361 361
362 static void 362 static void
363 Blit1to3Key(SDL_BlitInfo * info) 363 Blit1to3Key(SDL_BlitInfo * info)
364 { 364 {
365 int width = info->d_width; 365 int width = info->dst_w;
366 int height = info->d_height; 366 int height = info->dst_h;
367 Uint8 *src = info->s_pixels; 367 Uint8 *src = info->src;
368 int srcskip = info->s_skip; 368 int srcskip = info->s_skip;
369 Uint8 *dst = info->d_pixels; 369 Uint8 *dst = info->dst;
370 int dstskip = info->d_skip; 370 int dstskip = info->dst_pitch;
371 Uint8 *palmap = info->table; 371 Uint8 *palmap = info->table;
372 Uint32 ckey = info->ckey; 372 Uint32 ckey = info->ckey;
373 int o; 373 int o;
374 374
375 while (height--) { 375 while (height--) {
393 } 393 }
394 394
395 static void 395 static void
396 Blit1to4Key(SDL_BlitInfo * info) 396 Blit1to4Key(SDL_BlitInfo * info)
397 { 397 {
398 int width = info->d_width; 398 int width = info->dst_w;
399 int height = info->d_height; 399 int height = info->dst_h;
400 Uint8 *src = info->s_pixels; 400 Uint8 *src = info->src;
401 int srcskip = info->s_skip; 401 int srcskip = info->s_skip;
402 Uint32 *dstp = (Uint32 *) info->d_pixels; 402 Uint32 *dstp = (Uint32 *) info->dst;
403 int dstskip = info->d_skip; 403 int dstskip = info->dst_pitch;
404 Uint32 *palmap = (Uint32 *) info->table; 404 Uint32 *palmap = (Uint32 *) info->table;
405 Uint32 ckey = info->ckey; 405 Uint32 ckey = info->ckey;
406 406
407 /* Set up some basic variables */ 407 /* Set up some basic variables */
408 dstskip /= 4; 408 dstskip /= 4;
425 } 425 }
426 426
427 static void 427 static void
428 Blit1toNAlpha(SDL_BlitInfo * info) 428 Blit1toNAlpha(SDL_BlitInfo * info)
429 { 429 {
430 int width = info->d_width; 430 int width = info->dst_w;
431 int height = info->d_height; 431 int height = info->dst_h;
432 Uint8 *src = info->s_pixels; 432 Uint8 *src = info->src;
433 int srcskip = info->s_skip; 433 int srcskip = info->s_skip;
434 Uint8 *dst = info->d_pixels; 434 Uint8 *dst = info->dst;
435 int dstskip = info->d_skip; 435 int dstskip = info->dst_pitch;
436 SDL_PixelFormat *dstfmt = info->dst; 436 SDL_PixelFormat *dstfmt = info->dst;
437 const SDL_Color *srcpal = info->src->palette->colors; 437 const SDL_Color *srcpal = info->src->palette->colors;
438 int dstbpp; 438 int dstbpp;
439 const int A = (info->cmod >> 24); 439 const int A = (info->cmod >> 24);
440 440
466 } 466 }
467 467
468 static void 468 static void
469 Blit1toNAlphaKey(SDL_BlitInfo * info) 469 Blit1toNAlphaKey(SDL_BlitInfo * info)
470 { 470 {
471 int width = info->d_width; 471 int width = info->dst_w;
472 int height = info->d_height; 472 int height = info->dst_h;
473 Uint8 *src = info->s_pixels; 473 Uint8 *src = info->src;
474 int srcskip = info->s_skip; 474 int srcskip = info->s_skip;
475 Uint8 *dst = info->d_pixels; 475 Uint8 *dst = info->dst;
476 int dstskip = info->d_skip; 476 int dstskip = info->dst_pitch;
477 SDL_PixelFormat *srcfmt = info->src; 477 SDL_PixelFormat *srcfmt = info->src;
478 SDL_PixelFormat *dstfmt = info->dst; 478 SDL_PixelFormat *dstfmt = info->dst;
479 const SDL_Color *srcpal = info->src->palette->colors; 479 const SDL_Color *srcpal = info->src->palette->colors;
480 Uint32 ckey = info->ckey; 480 Uint32 ckey = info->ckey;
481 int dstbpp; 481 int dstbpp;